@north-light/crouter 0.3.154 → 0.3.158

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  ## Install
4
4
 
5
- `@north-light/crouter` is a private package in the `north-light` npm org, so installing it requires npm credentials with read access to that org (`npm login`, or an `//registry.npmjs.org/:_authToken=` line in `~/.npmrc`).
5
+ A private package in the `@north-light` npm org, so the install needs a token
6
+ with read access to that scope on your npm account or in `.npmrc`.
6
7
 
7
8
  ```bash
8
9
  npm install -g @north-light/crouter
@@ -808,7 +808,7 @@ const nodeBashBackground = defineLeaf({
808
808
  { name: 'jobs', type: 'object[]', required: true, constraint: 'Per handed-off job {job_id, elapsed_ms} — the foreground elapsed time in milliseconds at the moment of handoff.' },
809
809
  ],
810
810
  outputKind: 'object',
811
- effects: ['Signals every foreground bash command currently running for the node to return from its tool call immediately while its detached supervisor keeps the command running.', 'Each handed-off command retains its log under the node context jobs directory and sends the node an inbox message when it exits.'],
811
+ effects: ['Signals every foreground bash command currently running for the node to return from its tool call immediately while its detached supervisor keeps the command running.', 'Each handed-off command retains its log under the node context jobs directory and sends the node an urgent inbox message when it exits, which steers the node mid-turn.'],
812
812
  },
813
813
  run: async (input) => {
814
814
  const pane = input['pane'] ?? process.env['TMUX_PANE'];
@@ -1,5 +1,6 @@
1
1
  // canvas-bash-valve.ts — the bash safety valve: auto-background hanging
2
- // commands, alert via inbox.
2
+ // commands, alert via inbox at tier `urgent` so completion lands as a steering
3
+ // message mid-turn rather than queuing behind the current turn.
3
4
  //
4
5
  // Loaded into every canvas node's pi process via the node's launch.extensions
5
6
  // list. INERT when CRTR_NODE_ID is absent (plain pi session or legacy job
@@ -58,7 +59,7 @@ const SUPERVISOR_SCRIPT = [
58
59
  'ec=$?',
59
60
  'echo "$ec" > "$3"',
60
61
  'if [ -f "$4" ]; then',
61
- ' crtr node message send "Background bash job $5 finished (exit $ec). Log: $2 Command: $1" --to "$6" --tier normal || true',
62
+ ' crtr node message send "Background bash job $5 finished (exit $ec). Log: $2 Command: $1" --to "$6" --tier urgent || true',
62
63
  'fi',
63
64
  ].join('\n');
64
65
  function makeJobPaths(contextDir) {
@@ -215,7 +216,7 @@ export function createValveOperations(nodeId, contextDir) {
215
216
  function background(auto = false) {
216
217
  const elapsed = formatBashElapsed(Date.now() - startedAt);
217
218
  const notice = `\n[backgrounded as job ${paths.jobId} after ${elapsed} in the foreground${auto ? ' (auto)' : ''}. ` +
218
- `You'll get an inbox message when it exits. ` +
219
+ `It will interrupt you with a message when it exits. ` +
219
220
  `Watch: tail -f ${paths.jobLog} ; stop: kill -- -${pgid}]`;
220
221
  onData(Buffer.from(notice));
221
222
  finish(() => resolve({ exitCode: 0 }));