@noegenesis/harness-pi0.2.0
Autonomous persistent script-gated wakeup and context injection extension for Pi Coding Agent
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.
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.jsonuntil a future wakeup.inject: Callspi.sendMessage(..., { triggerTurn: false })— injects context without starting a turn.followup: Materializes lazy context scripts, flushes staged context, and callspi.sendUserMessage(text, { deliverAs: 'followUp' }).steer: Same context assembly, delivered viapi.sendUserMessage(text, { deliverAs: 'steer' }).turn_end& Cleanup: Hooks into Pi'sagent_endlifecycle event and gracefully shuts down timers, managed CLI streams (SIGINT), and active delegated subagents onsession_shutdown.- Cross-harness Delegation: Because Pi extensions run inside a single interactive session,
delegate_*launches isolated bidirectional stdio workers forpi(pi --mode rpc),agy(agy acp --stdio),dsh(dsh --profile headless --patch), orcustomCLIs, feeding settlements back into Pi's rule engine asContextEvents.
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 (ndjsonorline)wakeup_rule_put— bind trigger scripts, lazy context scripts, drivers (interval,cron,once,turn_end,event), and persisted statewakeup_rule_list— inspect rules, state, staged context count, and latest evaluationwakeup_rule_control— pause, resume, delete, or run a rule immediatelywakeup_rule_test— dry-run a rule and preview the composed message without mutating state or waking Pidelegate_spawn— spawn a persistent multi-turn subagent onpi,agy,dsh, orcustom(on_turn,on_group_settled, ormanualnotification)delegate_send— send follow-up prompts or steering messages to an existing delegation (cold-resuming viaremoteSessionIdwhen needed)delegate_manage— list/get delegations, read full spilled outputs (read_output),abortan active turn, orclose/cancela delegation