@north-light/crouter 0.3.176 → 0.3.177
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/dist/api/client.d.ts +4 -4
- package/dist/api/client.js +2 -2
- package/dist/api/dto/lifecycle.d.ts +1 -1
- package/dist/api/dto/reports.d.ts +1 -1
- package/dist/clients/attach/__tests__/group-activity.test.js +2 -2
- package/dist/clients/attach/config.js +5 -5
- package/dist/clients/attach/input/clipboard-image.js +2 -2
- package/dist/clients/attach/input/ref-autocomplete.js +1 -1
- package/dist/clients/attach/input/titled-editor.d.ts +12 -13
- package/dist/clients/attach/input/titled-editor.js +14 -15
- package/dist/clients/attach/overlays/dialogs.d.ts +1 -1
- package/dist/clients/attach/overlays/dialogs.js +2 -2
- package/dist/clients/attach/overlays/mcp.js +5 -12
- package/dist/clients/attach/render/chat-view.d.ts +1 -1
- package/dist/clients/attach/render/chat-view.js +2 -2
- package/dist/clients/attach/render/group-recap.js +7 -0
- package/dist/clients/attach/session/context.js +3 -3
- package/dist/clients/attach/session/editor-inventory.js +6 -6
- package/dist/clients/attach/session/input-wiring.js +1 -1
- package/dist/clients/attach/session/teardown.js +7 -9
- package/dist/clients/attach/slash/dispatch.d.ts +1 -2
- package/dist/clients/attach/slash/dispatch.js +4 -8
- package/dist/clients/attach/viewer.js +394 -394
- package/dist/clients/inbox/controller.js +3 -2
- package/dist/clients/inbox/deck-adapter.js +3 -2
- package/dist/clients/surfaces/host.d.ts +1 -1
- package/dist/commands/api-client.d.ts +12 -13
- package/dist/commands/api-client.js +15 -16
- package/dist/commands/chord.js +1 -2
- package/dist/commands/human/queue.js +6 -5
- package/dist/commands/memory/find.js +3 -3
- package/dist/commands/node/lifecycle.js +1 -1
- package/dist/commands/node-lifecycle-revive.d.ts +1 -1
- package/dist/commands/node-lifecycle-revive.js +3 -3
- package/dist/commands/push.js +1 -1
- package/dist/commands/surface/node/placement.d.ts +1 -1
- package/dist/commands/surface/node/placement.js +1 -1
- package/dist/commands/surface-edit.js +1 -4
- package/dist/commands/sys/panels/panel.d.ts +3 -3
- package/dist/commands/sys/panels/panel.js +3 -3
- package/dist/commands/sys/setup-core.js +1 -7
- package/dist/commands/sys/sync-deps.js +1 -3
- package/dist/commands/sys/sync-project-guidance.js +2 -11
- package/dist/commands/sys/sysprompt.js +1 -3
- package/dist/core/__tests__/fixtures/fake-engine.js +1 -1
- package/dist/core/__tests__/helpers/harness.d.ts +1 -1
- package/dist/core/__tests__/helpers/harness.js +1 -1
- package/dist/core/canvas/boot.js +1 -1
- package/dist/core/canvas/browse/app.js +2 -2
- package/dist/core/canvas/canvas.d.ts +3 -3
- package/dist/core/canvas/canvas.js +3 -3
- package/dist/core/canvas/daemon-owner.js +1 -2
- package/dist/core/canvas/db.js +7 -8
- package/dist/core/canvas/index.js +2 -2
- package/dist/core/canvas/pid.d.ts +12 -14
- package/dist/core/canvas/pid.js +16 -20
- package/dist/core/canvas/remote-transport.js +2 -2
- package/dist/core/canvas/status-glyph.d.ts +1 -1
- package/dist/core/canvas/status-glyph.js +1 -1
- package/dist/core/canvas/types.d.ts +1 -1
- package/dist/core/command-manifests/manifest.js +4 -6
- package/dist/core/command-manifests/schema.js +10 -12
- package/dist/core/command-plugins/transport/exec-invoke.js +5 -7
- package/dist/core/command-plugins/transport/http-invoke.js +4 -6
- package/dist/core/config.d.ts +1 -1
- package/dist/core/config.js +2 -2
- package/dist/core/events/read.js +1 -3
- package/dist/core/fault-classifier.js +1 -3
- package/dist/core/fs-utils.d.ts +7 -0
- package/dist/core/fs-utils.js +29 -2
- package/dist/core/host-exports/export.d.ts +4 -5
- package/dist/core/host-exports/export.js +4 -5
- package/dist/core/human/claim.js +3 -2
- package/dist/core/human/convention.d.ts +0 -1
- package/dist/core/human/convention.js +1 -9
- package/dist/core/human/scan.js +5 -4
- package/dist/core/profiles/manifest.d.ts +1 -1
- package/dist/core/profiles/manifest.js +1 -1
- package/dist/core/review/types.d.ts +1 -1
- package/dist/core/review/types.js +1 -1
- package/dist/core/runtime/broker/frame-dispatch.js +4 -4
- package/dist/core/runtime/broker-cli.js +1 -1
- package/dist/core/runtime/broker-protocol.d.ts +9 -10
- package/dist/core/runtime/broker-protocol.js +9 -10
- package/dist/core/runtime/broker-sdk.d.ts +1 -1
- package/dist/core/runtime/broker.js +6 -6
- package/dist/core/runtime/host.js +14 -14
- package/dist/core/runtime/launch.d.ts +1 -1
- package/dist/core/runtime/launch.js +1 -1
- package/dist/core/runtime/lifecycle.js +16 -21
- package/dist/core/runtime/node-read.js +2 -3
- package/dist/core/runtime/package-health.js +1 -8
- package/dist/core/runtime/persona.js +2 -2
- package/dist/core/runtime/pi-vendored.d.ts +4 -2
- package/dist/core/runtime/pi-vendored.js +5 -16
- package/dist/core/runtime/promote.js +1 -1
- package/dist/core/runtime/reopen.js +2 -2
- package/dist/core/runtime/revive-all.d.ts +3 -3
- package/dist/core/runtime/revive-all.js +6 -6
- package/dist/core/runtime/revive.js +1 -1
- package/dist/core/runtime/spawn.d.ts +1 -2
- package/dist/core/runtime/spawn.js +2 -3
- package/dist/core/runtime/structured-output.js +4 -6
- package/dist/core/runtime/tmux-driver.d.ts +2 -2
- package/dist/core/runtime/tmux-driver.js +3 -5
- package/dist/core/runtime/tool-group-summary.js +5 -4
- package/dist/core/runtime/warm-pool.js +1 -1
- package/dist/core/scope.js +2 -9
- package/dist/core/self-update.js +3 -3
- package/dist/core/spawn.d.ts +0 -1
- package/dist/core/spawn.js +1 -4
- package/dist/core/substrate/on-read.js +1 -9
- package/dist/core/wake.js +2 -2
- package/dist/core/worktree.d.ts +3 -3
- package/dist/core/worktree.js +5 -7
- package/dist/daemon/api/bridge.js +1 -1
- package/dist/daemon/api/handlers/broker-ops.js +1 -2
- package/dist/daemon/api/handlers/messages.js +2 -2
- package/dist/daemon/api/handlers/nodes.js +1 -1
- package/dist/daemon/api/handlers/reports.js +1 -1
- package/dist/daemon/api/handlers/validate.d.ts +2 -1
- package/dist/daemon/api/handlers/validate.js +2 -3
- package/dist/daemon/cron-run.js +7 -7
- package/dist/daemon/human/finish.js +3 -2
- package/dist/daemon/manage.d.ts +6 -6
- package/dist/daemon/manage.js +15 -16
- package/dist/pi-extensions/canvas-context-intro.js +1 -14
- package/dist/pi-extensions/canvas-doc-substrate.js +1 -1
- package/dist/pi-extensions/canvas-review-boundary.js +1 -14
- package/dist/pi-extensions/truncate.d.ts +5 -0
- package/dist/pi-extensions/truncate.js +14 -0
- package/dist/shared/predicates.d.ts +2 -0
- package/dist/shared/predicates.js +4 -0
- package/dist/shared/shell-quote.d.ts +3 -0
- package/dist/shared/shell-quote.js +5 -0
- package/dist/shared/tool-groups.d.ts +4 -2
- package/dist/shared/tool-groups.js +3 -3
- package/dist/types.d.ts +4 -5
- package/package.json +1 -1
- package/runtime.lock.json +2 -2
|
@@ -30,6 +30,7 @@ import { CONTEXT_INTRO_CUSTOM_TYPE } from '../shared/generated-context.js';
|
|
|
30
30
|
import { brokerExtensionState } from '../core/runtime/broker/daemon-ops.js';
|
|
31
31
|
import { buildContextBearingsFromState, buildForkBearingsFromState, buildProjectContextBlockForBroker } from '../core/runtime/broker-extension-render.js';
|
|
32
32
|
import { situationalContextBlock } from '../core/runtime/situational-context.js';
|
|
33
|
+
import { truncateToWidth } from './truncate.js';
|
|
33
34
|
/** The `customType` stamped on the injected session message. Used both to write
|
|
34
35
|
* the entry and to detect it on resume (the idempotency guard). Defined beside
|
|
35
36
|
* the block builder in `core/runtime/bearings.ts` because the warm-pool claim's
|
|
@@ -91,20 +92,6 @@ function wrapLine(line, width) {
|
|
|
91
92
|
out.push(chars.slice(i, i + width).join(''));
|
|
92
93
|
return out;
|
|
93
94
|
}
|
|
94
|
-
/** Truncate plain text to at most `width` columns, appending an ellipsis when it
|
|
95
|
-
* would overflow. Content here is ANSI-free plain text (label + prose), so a
|
|
96
|
-
* code-point count stands in for visible width. The renderer MUST keep every
|
|
97
|
-
* emitted line within the terminal width or pi's TUI aborts the whole render. */
|
|
98
|
-
function truncateToWidth(text, width) {
|
|
99
|
-
if (width <= 0)
|
|
100
|
-
return '';
|
|
101
|
-
const chars = Array.from(text);
|
|
102
|
-
if (chars.length <= width)
|
|
103
|
-
return text;
|
|
104
|
-
if (width === 1)
|
|
105
|
-
return '…';
|
|
106
|
-
return chars.slice(0, width - 1).join('') + '…';
|
|
107
|
-
}
|
|
108
95
|
/**
|
|
109
96
|
* Renderer for `crtr-context` messages. Collapsed (default) shows a one-line
|
|
110
97
|
* stub; expanded (Ctrl+O) shows the label + full body. Returns a plain object
|
|
@@ -76,7 +76,7 @@ export function registerCanvasDocSubstrate(pi) {
|
|
|
76
76
|
// (memory-usage guidance + preferences). The guidance frame is always
|
|
77
77
|
// present for a canvas node (the memory system always exists), so the block
|
|
78
78
|
// is never empty even when no preference is eligible. (The knowledge catalog
|
|
79
|
-
//
|
|
79
|
+
// does not enter the system prompt — it rides the bearings message via
|
|
80
80
|
// renderKnowledgeBlock.)
|
|
81
81
|
pi.on('before_agent_start', async (event) => {
|
|
82
82
|
try {
|
|
@@ -6,23 +6,10 @@
|
|
|
6
6
|
// inherited context.
|
|
7
7
|
import { brokerExtensionState } from '../core/runtime/broker/daemon-ops.js';
|
|
8
8
|
import { isReviewBoundary, REVIEW_BOUNDARY_CUSTOM_TYPE } from '../core/runtime/session-visibility.js';
|
|
9
|
+
import { truncateToWidth } from './truncate.js';
|
|
9
10
|
// ---------------------------------------------------------------------------
|
|
10
11
|
// Collapsed-by-default rendering
|
|
11
12
|
// ---------------------------------------------------------------------------
|
|
12
|
-
/** Truncate plain text to at most `width` columns, appending an ellipsis when it
|
|
13
|
-
* would overflow. Content here is ANSI-free plain text, so code-point count
|
|
14
|
-
* stands in for visible width. The renderer MUST keep every emitted line within
|
|
15
|
-
* the terminal width or pi's TUI aborts the whole render. */
|
|
16
|
-
function truncateToWidth(text, width) {
|
|
17
|
-
if (width <= 0)
|
|
18
|
-
return '';
|
|
19
|
-
const chars = Array.from(text);
|
|
20
|
-
if (chars.length <= width)
|
|
21
|
-
return text;
|
|
22
|
-
if (width === 1)
|
|
23
|
-
return '…';
|
|
24
|
-
return chars.slice(0, width - 1).join('') + '…';
|
|
25
|
-
}
|
|
26
13
|
/** Render the marker as a single compact divider; its full content remains in
|
|
27
14
|
* the message list for the model and generated-context presenters. */
|
|
28
15
|
export function renderReviewBoundary(_message, _options, theme) {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Hard-truncate to `width` columns with an ellipsis when the text would
|
|
2
|
+
* overflow. Extension-rendered content is ANSI-free plain text, so a
|
|
3
|
+
* code-point count stands in for visible width. Every renderer MUST keep its
|
|
4
|
+
* emitted lines within the terminal width or pi's TUI aborts the whole render. */
|
|
5
|
+
export declare function truncateToWidth(text: string, width: number): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Hard-truncate to `width` columns with an ellipsis when the text would
|
|
2
|
+
* overflow. Extension-rendered content is ANSI-free plain text, so a
|
|
3
|
+
* code-point count stands in for visible width. Every renderer MUST keep its
|
|
4
|
+
* emitted lines within the terminal width or pi's TUI aborts the whole render. */
|
|
5
|
+
export function truncateToWidth(text, width) {
|
|
6
|
+
if (width <= 0)
|
|
7
|
+
return '';
|
|
8
|
+
const chars = Array.from(text);
|
|
9
|
+
if (chars.length <= width)
|
|
10
|
+
return text;
|
|
11
|
+
if (width === 1)
|
|
12
|
+
return '…';
|
|
13
|
+
return chars.slice(0, width - 1).join('') + '…';
|
|
14
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
/** Broker-generated activity recap for one completed tool-call group.
|
|
1
|
+
/** Broker-generated activity recap for one completed tool-call group. Changed
|
|
2
|
+
* files are counted deterministically by the viewer's GroupActivityRecorder;
|
|
3
|
+
* deletions have no tool of their own, so only the model can evidence them. */
|
|
2
4
|
export interface ToolGroupSummary {
|
|
3
5
|
bullets: string[];
|
|
4
6
|
nodesSpawned: number;
|
|
5
|
-
|
|
7
|
+
filesDeleted: number;
|
|
6
8
|
}
|
|
7
9
|
export interface ToolGroupMessageLike {
|
|
8
10
|
role?: string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Keep this independent of renderer state: both live event tracking and snapshot
|
|
3
3
|
// reconstruction must agree on which prose closes a run of tools.
|
|
4
4
|
import { generatedContextPresentation, generatedContextText } from './generated-context.js';
|
|
5
|
-
const TOOL_GROUP_SUMMARY_KEYS = new Set(['bullets', 'nodesSpawned', '
|
|
5
|
+
const TOOL_GROUP_SUMMARY_KEYS = new Set(['bullets', 'nodesSpawned', 'filesDeleted']);
|
|
6
6
|
const MAX_TOOL_GROUP_BULLETS = 5;
|
|
7
7
|
const MAX_TOOL_GROUP_BULLET_LENGTH = 1_000;
|
|
8
8
|
/** Validate the one durable summary shape and cap its display-sized fields.
|
|
@@ -21,14 +21,14 @@ export function normalizeToolGroupSummary(value) {
|
|
|
21
21
|
return null;
|
|
22
22
|
if (typeof record.nodesSpawned !== 'number' || !Number.isSafeInteger(record.nodesSpawned) || record.nodesSpawned < 0)
|
|
23
23
|
return null;
|
|
24
|
-
if (typeof record.
|
|
24
|
+
if (typeof record.filesDeleted !== 'number' || !Number.isSafeInteger(record.filesDeleted) || record.filesDeleted < 0)
|
|
25
25
|
return null;
|
|
26
26
|
return {
|
|
27
27
|
bullets: record.bullets
|
|
28
28
|
.slice(0, MAX_TOOL_GROUP_BULLETS)
|
|
29
29
|
.map((bullet) => bullet.trim().slice(0, MAX_TOOL_GROUP_BULLET_LENGTH).trimEnd()),
|
|
30
30
|
nodesSpawned: record.nodesSpawned,
|
|
31
|
-
|
|
31
|
+
filesDeleted: record.filesDeleted,
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
/** Validate sidecar/snapshot entries independently so one malformed or legacy
|
package/dist/types.d.ts
CHANGED
|
@@ -128,13 +128,12 @@ export interface ModelRoutingConfig {
|
|
|
128
128
|
/** Launch metadata for one kind (a top-level kind like `developer`, or a full
|
|
129
129
|
* sub-kind string like `plan/reviewers/security`) — the settings-file
|
|
130
130
|
* replacement for per-kind persona frontmatter. `model`/`tools`/`extensions`
|
|
131
|
-
* are launch knobs consumed by `buildLaunchSpec
|
|
131
|
+
* are launch knobs consumed by `buildLaunchSpec`; `whenToUse` is the
|
|
132
132
|
* one-line gloss shown in `node new -h` / `node promote -h`. `availableTo` is
|
|
133
133
|
* VISIBILITY-ONLY (never launch validation): the list of top-level kind names
|
|
134
134
|
* whose spawn menus surface this sub-kind, `'*'` meaning every kind; omitted
|
|
135
135
|
* defaults to the sub-kind's own top-level ancestor (e.g.
|
|
136
|
-
* `plan/reviewers/security` defaults to `['plan']`)
|
|
137
|
-
* original sub-persona `availableTo` semantics. A direct launch by full kind
|
|
136
|
+
* `plan/reviewers/security` defaults to `['plan']`). A direct launch by full kind
|
|
138
137
|
* string is always valid regardless of `availableTo`. */
|
|
139
138
|
export interface KindConfig {
|
|
140
139
|
model?: string;
|
|
@@ -313,9 +312,9 @@ export interface InstalledMarketplace {
|
|
|
313
312
|
* (spec §2.1). A profile is an agent identity defined at the user root: it
|
|
314
313
|
* names N project directories and owns its own `memory/` store. `projects`
|
|
315
314
|
* are absolute, real-path-resolved directories in manifest order — the
|
|
316
|
-
* pointer set `findProjectScopeRoots` walks
|
|
315
|
+
* pointer set `findProjectScopeRoots` walks, after the node's own
|
|
317
316
|
* cwd. `name` is the mutable display name (and the gateable `profile` subject
|
|
318
|
-
* field
|
|
317
|
+
* field); `<slug>-<id>` in the directory name is the stable id and
|
|
319
318
|
* never changes on rename. See `src/core/profiles/manifest.ts` for every
|
|
320
319
|
* read/write of this file — it is the sole owner of path resolution and
|
|
321
320
|
* mutation. */
|
package/package.json
CHANGED
package/runtime.lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/crouter",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.177",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@north-light/crouter",
|
|
9
|
-
"version": "0.3.
|
|
9
|
+
"version": "0.3.177",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|