@north-light/crouter 0.3.308 → 0.3.310

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.
Files changed (49) hide show
  1. package/dist/clients/attach/viewer.js +394 -394
  2. package/dist/commands/__tests__/node-message.test.js +13 -0
  3. package/dist/commands/canvas-history/grep.js +1 -1
  4. package/dist/commands/canvas-history/read.js +1 -1
  5. package/dist/commands/canvas-history/search.js +1 -1
  6. package/dist/commands/memory/__tests__/command-selector-and-mutation-guards.test.js +20 -0
  7. package/dist/commands/memory/edit.js +8 -11
  8. package/dist/commands/node-inspect-artifacts.js +2 -2
  9. package/dist/commands/push.js +1 -1
  10. package/dist/core/__tests__/canvas-inbox-watcher.test.js +3 -3
  11. package/dist/core/__tests__/human-deliver.test.js +1 -1
  12. package/dist/core/__tests__/integration/broker-wedge-supervision.test.d.ts +1 -0
  13. package/dist/core/__tests__/integration/broker-wedge-supervision.test.js +102 -0
  14. package/dist/core/__tests__/integration/refresh-stall-recycle.test.js +68 -2
  15. package/dist/core/__tests__/integration/worktree-reap.test.js +31 -0
  16. package/dist/core/__tests__/seam/inbox-reference-guidance.test.d.ts +1 -0
  17. package/dist/core/__tests__/seam/inbox-reference-guidance.test.js +70 -0
  18. package/dist/core/canvas/__tests__/session-window.test.d.ts +1 -0
  19. package/dist/core/canvas/__tests__/session-window.test.js +70 -0
  20. package/dist/core/canvas/browse/app.js +52 -27
  21. package/dist/core/canvas/browse/render.js +11 -2
  22. package/dist/core/canvas/render-source.js +63 -25
  23. package/dist/core/command.js +15 -0
  24. package/dist/core/feed/inbox.js +6 -4
  25. package/dist/core/runtime/bearings-render.js +3 -3
  26. package/dist/core/runtime/broker/inbox.js +6 -4
  27. package/dist/core/runtime/fleet.js +1 -1
  28. package/dist/core/runtime/placement.d.ts +1 -1
  29. package/dist/core/runtime/placement.js +1 -1
  30. package/dist/core/runtime/tmux-driver.d.ts +7 -0
  31. package/dist/core/runtime/tmux-driver.js +20 -0
  32. package/dist/core/substrate/on-read.d.ts +6 -4
  33. package/dist/core/substrate/on-read.js +14 -6
  34. package/dist/core/substrate/surface-match.d.ts +12 -4
  35. package/dist/core/substrate/surface-match.js +19 -10
  36. package/dist/core/worktree-mutation-async.js +1 -2
  37. package/dist/core/worktree.d.ts +0 -1
  38. package/dist/core/worktree.js +0 -113
  39. package/dist/daemon/api/handlers/canvas.js +3 -3
  40. package/dist/daemon/reconcilers/broker-supervision.d.ts +14 -2
  41. package/dist/daemon/reconcilers/broker-supervision.js +109 -57
  42. package/dist/daemon/reconcilers/storage-maintenance.d.ts +5 -0
  43. package/dist/daemon/reconcilers/storage-maintenance.js +31 -8
  44. package/dist/pi-extensions/__tests__/pre-command-gate.test.js +10 -10
  45. package/dist/pi-extensions/canvas-doc-substrate.js +11 -5
  46. package/dist/shared/generated-context.d.ts +2 -0
  47. package/dist/shared/generated-context.js +6 -0
  48. package/package.json +1 -1
  49. package/runtime.lock.json +5 -5
@@ -19,7 +19,7 @@ import { homedir } from 'node:os';
19
19
  import { join, resolve } from 'node:path';
20
20
  import { brokerExtensionState } from '../core/runtime/broker/daemon-ops.js';
21
21
  import { renderPreferencesFromState } from '../core/runtime/broker-extension-render.js';
22
- import { corpusHasPreCommandSurfaces, demotePreCommandExposures, renderOnCommandDocsForSubject, renderOnReadDocsForSubject, renderPreCommandDocsForSubject, } from '../core/substrate/on-read.js';
22
+ import { corpusHasCommandSurfaceForCommand, corpusHasPreCommandSurfaceForCommand, demotePreCommandExposures, renderOnCommandDocsForSubject, renderOnReadDocsForSubject, renderPreCommandDocsForSubject, } from '../core/substrate/on-read.js';
23
23
  import { clearSessionCache } from '../core/substrate/session-cache.js';
24
24
  import { cloneContextExposureState, exposureTarget, freezePreferenceSnapshot, loadContextExposureState, mergeContextExposureState, replaceContextExposureState, saveContextExposureState, sharedContextExposureState, } from '../core/substrate/injected-store.js';
25
25
  import { autoLoadedContextInner, mergeAutoLoadedContext } from './envelope-merge.js';
@@ -110,12 +110,13 @@ export function registerCanvasDocSubstrate(pi) {
110
110
  const command = bashCommandOf(event.input);
111
111
  if (command === null)
112
112
  return;
113
- // The common case is a corpus with no pre-command doc at all, and it must
114
- // cost nothing — short-circuit before the daemon round-trip below.
115
- if (!corpusHasPreCommandSurfaces())
116
- return;
117
113
  if (blockedThisTurn)
118
114
  return { block: true, reason: HELD_SIBLING_REASON };
115
+ // Match the parsed command before resolving daemon-owned node config. Gates
116
+ // remain intentionally conservative here: a matching gated entry still
117
+ // resolves its subject and cannot fail open.
118
+ if (!corpusHasPreCommandSurfaceForCommand(command))
119
+ return;
119
120
  const state = await brokerExtensionState(nodeId);
120
121
  mergeContextExposureState(contextExposure, loadContextExposureState(nodeId));
121
122
  const next = cloneContextExposureState(contextExposure);
@@ -152,6 +153,11 @@ export function registerCanvasDocSubstrate(pi) {
152
153
  else {
153
154
  return;
154
155
  }
156
+ // A successful bash call only needs daemon-owned node config when its
157
+ // parsed command could match a post-command surface. Gates are deliberately
158
+ // ignored by this prefilter so a matching safety gate cannot fail open.
159
+ if (command !== null && !corpusHasCommandSurfaceForCommand(command))
160
+ return;
155
161
  const state = await brokerExtensionState(nodeId);
156
162
  mergeContextExposureState(contextExposure, loadContextExposureState(nodeId));
157
163
  const next = cloneContextExposureState(contextExposure);
@@ -69,5 +69,7 @@ export declare function formatCard(kind: string, facts: Record<string, string |
69
69
  export declare function formatDataCard(kind: string, facts: Record<string, string | number | boolean | undefined>, body: string): string;
70
70
  /** Parse a runtime envelope, with pre-envelope customType compatibility. */
71
71
  export declare function parseCard(message: GeneratedContextMessageLike): GeneratedCard | null;
72
+ /** Explain how an inbox entry's ref is read without guessing its filesystem location. */
73
+ export declare function formatInboxRefInstruction(ref: string): string;
72
74
  /** Format a complete inbox card from report bodies resolved by the caller. */
73
75
  export declare function formatInboxCard(sections: readonly InboxCardSection[]): string;
@@ -205,6 +205,12 @@ export function parseCard(message) {
205
205
  senders: [],
206
206
  };
207
207
  }
208
+ /** Explain how an inbox entry's ref is read without guessing its filesystem location. */
209
+ export function formatInboxRefInstruction(ref) {
210
+ return ref.startsWith('/')
211
+ ? `Preview only. Read the full body from file \`${ref}\`.`
212
+ : `Read this report with \`crtr canvas history read ${ref}\`.`;
213
+ }
208
214
  /** Format a complete inbox card from report bodies resolved by the caller. */
209
215
  export function formatInboxCard(sections) {
210
216
  const body = sections.map((section) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/crouter",
3
- "version": "0.3.308",
3
+ "version": "0.3.310",
4
4
  "description": "crtr — agent runtime with memory, plugins, and marketplaces",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/runtime.lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@north-light/crouter",
3
- "version": "0.3.308",
3
+ "version": "0.3.310",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@north-light/crouter",
9
- "version": "0.3.308",
9
+ "version": "0.3.310",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "workspaces": [
@@ -5206,17 +5206,17 @@
5206
5206
  },
5207
5207
  "packages/crouter-api": {
5208
5208
  "name": "@north-light/crouter-api",
5209
- "version": "0.3.308",
5209
+ "version": "0.3.310",
5210
5210
  "license": "UNLICENSED"
5211
5211
  },
5212
5212
  "packages/crouter-env-docker": {
5213
5213
  "name": "@north-light/crouter-env-docker",
5214
- "version": "0.3.308",
5214
+ "version": "0.3.310",
5215
5215
  "license": "UNLICENSED"
5216
5216
  },
5217
5217
  "packages/crouter-sdk": {
5218
5218
  "name": "@north-light/crouter-sdk",
5219
- "version": "0.3.308",
5219
+ "version": "0.3.310",
5220
5220
  "license": "UNLICENSED",
5221
5221
  "dependencies": {
5222
5222
  "@north-light/crouter-api": "^0.3.295"