omp packages

@noegenesis/harness-pi0.2.0

Autonomous persistent script-gated wakeup and context injection extension for Pi Coding Agent

GitHub Actions Published 23 hours ago MIT ~0 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

@noegenesis/harness-pi

English | 中文

Autonomous persistent wakeup, script-gated context injection, and cross-harness multi-turn delegation extension for Pi Coding Agent.

External platforms and local CLIs (qq-cli, himalaya, lark-cli, fswatch, gh, etc.) can only supply context; Followup and steering turns fire if and only if your agent's own reusable, persistent rule scripts decide to wake up.

Installation

Install directly via Pi's package manager (auto-discovered via the pi.extensions manifest):

pi install npm:@noegenesis/harness-pi

Or install into a custom extension wrapper in ~/.pi/agent/extensions/ when you want to pass explicit options via createPiWakeupExtension:

import { createPiWakeupExtension } from '@noegenesis/harness-pi'

export default createPiWakeupExtension({
  defaultTimeoutMs: 30_000,
  paused: false,
})

How It Maps to Pi

  • noop / stage: Zero tokens. Context is ignored or persisted in ~/.pi/agent/noema-wakeup/state.json until a future wakeup.
  • inject: Calls pi.sendMessage(..., { triggerTurn: false }) — injects context without starting a turn.
  • followup: Materializes lazy context scripts, flushes staged context, and calls pi.sendUserMessage(text, { deliverAs: 'followUp' }).
  • steer: Same context assembly, delivered via pi.sendUserMessage(text, { deliverAs: 'steer' }).
  • turn_end & Cleanup: Hooks into Pi's agent_end lifecycle event and gracefully shuts down timers, managed CLI streams (SIGINT), and active delegated subagents on session_shutdown.
  • Cross-harness Delegation: Because Pi extensions run inside a single interactive session, delegate_* launches isolated bidirectional stdio workers for pi (pi --mode rpc), agy (agy acp --stdio), dsh (dsh --profile headless --patch), or custom CLIs, feeding settlements back into Pi's rule engine as ContextEvents.

Agent Tools

Registers nine tools on Pi:

  • wakeup_script_manage — save/register reusable scripts at any path (or default ~/.pi/agent/noema-wakeup/scripts)
  • wakeup_source_manage — manage foreground CLI stream sources (ndjson or line)
  • wakeup_rule_put — bind trigger scripts, lazy context scripts, drivers (interval, cron, once, turn_end, event), and persisted state
  • wakeup_rule_list — inspect rules, state, staged context count, and latest evaluation
  • wakeup_rule_control — pause, resume, delete, or run a rule immediately
  • wakeup_rule_test — dry-run a rule and preview the composed message without mutating state or waking Pi
  • delegate_spawn — spawn a persistent multi-turn subagent on pi, agy, dsh, or custom (on_turn, on_group_settled, or manual notification)
  • delegate_send — send follow-up prompts or steering messages to an existing delegation (cold-resuming via remoteSessionId when needed)
  • delegate_manage — list/get delegations, read full spilled outputs (read_output), abort an active turn, or close/cancel a delegation