@north-light/crouter 0.3.161 → 0.3.163
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 +3 -1
- package/dist/api/client.js +6 -0
- package/dist/api/dto/modelauth.d.ts +32 -0
- package/dist/api/dto/modelauth.js +2 -1
- package/dist/api/routes.d.ts +1 -0
- package/dist/api/routes.js +1 -0
- package/dist/builtin-memory/00-runtime-base.md +1 -0
- package/dist/builtin-memory/04-orchestration-kernel.md +1 -0
- package/dist/builtin-memory/init.md +38 -0
- package/dist/builtin-memory/wedged-child-on-runaway-bash.md +2 -2
- package/dist/builtin-pi-packages/pi-crtr-extensions/README.md +0 -1
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/provider-rotation.test.ts +88 -396
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.ts +215 -419
- package/dist/clients/attach/__tests__/crtr-output.test.js +14 -9
- package/dist/clients/attach/__tests__/edit-diff.test.d.ts +1 -0
- package/dist/clients/attach/__tests__/edit-diff.test.js +34 -0
- package/dist/clients/attach/__tests__/editor-frame-title.test.d.ts +1 -0
- package/dist/clients/attach/__tests__/editor-frame-title.test.js +19 -0
- package/dist/clients/attach/render/chat-view.js +8 -3
- package/dist/clients/attach/render/crtr-output.js +31 -2
- package/dist/clients/attach/render/edit-diff.js +26 -2
- package/dist/clients/attach/render/tool-calls.d.ts +7 -2
- package/dist/clients/attach/render/tool-calls.js +25 -4
- package/dist/clients/attach/session/connection.d.ts +1 -1
- package/dist/clients/attach/session/editor-frame.d.ts +5 -1
- package/dist/clients/attach/session/editor-frame.js +21 -15
- package/dist/clients/attach/session/identity.d.ts +1 -1
- package/dist/clients/attach/viewer.js +441 -439
- package/dist/commands/__tests__/api-canvas-source.test.d.ts +1 -0
- package/dist/commands/__tests__/api-canvas-source.test.js +37 -0
- package/dist/commands/__tests__/human.test.js +2 -0
- package/dist/commands/__tests__/search-contents.test.d.ts +1 -0
- package/dist/commands/__tests__/search-contents.test.js +52 -0
- package/dist/commands/api-client.js +1 -0
- package/dist/commands/human/prompts.js +2 -2
- package/dist/commands/human/shared.d.ts +1 -0
- package/dist/commands/human/shared.js +7 -4
- package/dist/commands/memory/lint.d.ts +6 -0
- package/dist/commands/memory/lint.js +177 -35
- package/dist/commands/memory/read.js +22 -1
- package/dist/commands/memory/write.js +18 -4
- package/dist/commands/memory.js +1 -1
- package/dist/commands/search/contents.js +2 -2
- package/dist/commands/sys/__tests__/sync-deps.test.js +12 -21
- package/dist/commands/sys/__tests__/sync-import.test.js +30 -29
- package/dist/commands/sys/setup-wizard.d.ts +8 -1
- package/dist/commands/sys/setup-wizard.js +209 -58
- package/dist/commands/sys/sync-deps.js +14 -18
- package/dist/commands/sys/sync-project-guidance.js +16 -19
- package/dist/core/__tests__/broker-launch-candidates.test.js +13 -3
- package/dist/core/__tests__/broker-sdk-wiring.test.js +53 -25
- package/dist/core/__tests__/full/broker-provider-retry.test.js +6 -122
- package/dist/core/__tests__/migration.test.js +8 -3
- package/dist/core/__tests__/model-pin-durability.test.js +7 -5
- package/dist/core/__tests__/model-routes.test.d.ts +1 -0
- package/dist/core/__tests__/model-routes.test.js +41 -0
- package/dist/core/__tests__/on-read-crouter-home-fence.test.js +7 -10
- package/dist/core/__tests__/on-read-dedup-resume.test.js +13 -25
- package/dist/core/__tests__/on-read-identity.test.js +8 -15
- package/dist/core/__tests__/review-model-floor.test.js +2 -2
- package/dist/core/__tests__/revive.test.js +2 -2
- package/dist/core/__tests__/tmux-surface.test.js +10 -4
- package/dist/core/__tests__/worktree.test.js +3 -3
- package/dist/core/auth-file.d.ts +3 -2
- package/dist/core/auth-file.js +5 -3
- package/dist/core/canvas/extensions.d.ts +1 -1
- package/dist/core/canvas/extensions.js +18 -11
- package/dist/core/canvas/labels.d.ts +4 -5
- package/dist/core/canvas/labels.js +9 -9
- package/dist/core/canvas/types.d.ts +6 -1
- package/dist/core/command-manifests/schema.js +18 -5
- package/dist/core/command.js +17 -7
- package/dist/core/config.d.ts +3 -1
- package/dist/core/config.js +88 -2
- package/dist/core/configured-clis/invoker.js +2 -0
- package/dist/core/help.d.ts +3 -1
- package/dist/core/help.js +5 -2
- package/dist/core/keybindings/__tests__/resolve.test.js +5 -2
- package/dist/core/keybindings/catalog.d.ts +3 -2
- package/dist/core/keybindings/catalog.js +34 -25
- package/dist/core/keybindings/index.d.ts +1 -1
- package/dist/core/keybindings/resolve.js +8 -0
- package/dist/core/keybindings/types.d.ts +6 -1
- package/dist/core/memory/doc-link-grammar.d.ts +20 -0
- package/dist/core/memory/doc-link-grammar.js +110 -0
- package/dist/core/memory-resolver.d.ts +5 -0
- package/dist/core/memory-resolver.js +12 -1
- package/dist/core/model-routes.d.ts +37 -0
- package/dist/core/model-routes.js +140 -0
- package/dist/core/runtime/bearings.d.ts +8 -8
- package/dist/core/runtime/bearings.js +20 -16
- package/dist/core/runtime/broker.d.ts +0 -4
- package/dist/core/runtime/broker.js +119 -385
- package/dist/core/runtime/canvas-extensions.d.ts +1 -0
- package/dist/core/runtime/canvas-extensions.js +2 -0
- package/dist/core/runtime/launch.d.ts +10 -12
- package/dist/core/runtime/launch.js +16 -22
- package/dist/core/runtime/managed-provider-cooling.d.ts +0 -14
- package/dist/core/runtime/managed-provider-cooling.js +0 -19
- package/dist/core/runtime/model-swap.js +7 -1
- package/dist/core/runtime/promote.js +1 -0
- package/dist/core/runtime/tmux.js +136 -100
- package/dist/core/scope.js +4 -5
- package/dist/core/subscription-state.d.ts +12 -36
- package/dist/core/subscription-state.js +19 -203
- package/dist/core/substrate/ceiling.d.ts +3 -6
- package/dist/core/substrate/ceiling.js +13 -15
- package/dist/core/substrate/index.d.ts +2 -3
- package/dist/core/substrate/index.js +2 -2
- package/dist/core/substrate/on-read.d.ts +4 -13
- package/dist/core/substrate/on-read.js +142 -262
- package/dist/core/substrate/render.js +4 -4
- package/dist/core/substrate/schema.d.ts +3 -2
- package/dist/core/substrate/schema.js +5 -5
- package/dist/daemon/api/__tests__/full/api-server.test.js +9 -6
- package/dist/daemon/api/__tests__/full/b10-attach-modelauth.test.js +123 -1
- package/dist/daemon/api/handlers/modelauth.js +51 -2
- package/dist/daemon/api/handlers/nodes.js +2 -0
- package/dist/pi-extensions/__tests__/canvas-tool-guide.test.d.ts +1 -0
- package/dist/pi-extensions/__tests__/canvas-tool-guide.test.js +96 -0
- package/dist/pi-extensions/canvas-doc-substrate.js +7 -8
- package/dist/pi-extensions/canvas-tool-guide.d.ts +14 -0
- package/dist/pi-extensions/canvas-tool-guide.js +74 -0
- package/dist/types.d.ts +17 -0
- package/dist/web-client/assets/{index-B76ZKfT_.js → index-NIuSCOHM.js} +1 -1
- package/dist/web-client/index.html +1 -1
- package/dist/web-client/sw.js +1 -1
- package/package.json +1 -1
- package/runtime.lock.json +2 -2
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/crouter-help.ts +0 -95
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
// carries the <project_context> block (buildProjectContextBlock), which is
|
|
17
17
|
// now only the <environment> snapshot: a host/runtime line (platform,
|
|
18
18
|
// hostname, node, tmux-or-not), the cwd dir listing, and git status.
|
|
19
|
-
// Project guidance rides the
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
// <memory kind="knowledge">
|
|
23
|
-
//
|
|
24
|
-
//
|
|
19
|
+
// Project guidance rides the document substrate instead: a workspace's
|
|
20
|
+
// `.crouter/memory/INDEX.md` declares `applies-to: "."` and surfaces through
|
|
21
|
+
// an <auto-loaded-context> block when cwd/profile mounts that workspace;
|
|
22
|
+
// ordinary boot-routed knowledge remains in the <memory kind="knowledge">
|
|
23
|
+
// block below. No parallel project-context loader lives here (see
|
|
24
|
+
// `crtr memory read taste/document-substrate`);
|
|
25
25
|
// • promote.ts folds orchestratorContextNote() into the promotion guidance
|
|
26
26
|
// dump, so a node that becomes an orchestrator MID-LIFE gets the
|
|
27
27
|
// orchestrator framing it never received at spawn — it spawned as a base
|
|
@@ -45,7 +45,7 @@ import { readdirSync } from 'node:fs';
|
|
|
45
45
|
import { spawnSync } from 'node:child_process';
|
|
46
46
|
import { hostname } from 'node:os';
|
|
47
47
|
import { cadenceDisplay } from '../wake.js';
|
|
48
|
-
import { renderKnowledgeBlock } from '../substrate/index.js';
|
|
48
|
+
import { renderKnowledgeBlock, renderWorkspaceOpenDocs } from '../substrate/index.js';
|
|
49
49
|
import { loadProfileManifest } from '../profiles/manifest.js';
|
|
50
50
|
import { situationalContextBlock } from './situational-context.js';
|
|
51
51
|
function escapeAttribute(value) {
|
|
@@ -391,14 +391,14 @@ export function buildWakeBearings(origin) {
|
|
|
391
391
|
* note. The across-cycles context-dir framing is added ONLY for an
|
|
392
392
|
* orchestrator (by mode) — the one node whose dir a future cycle resumes
|
|
393
393
|
* from.
|
|
394
|
-
* 2. `<memory kind="knowledge">` — the consultable catalog, a SIBLING of
|
|
395
|
-
* bearings (never nested under the context dir). Dropped when empty.
|
|
396
|
-
* 3. `<
|
|
397
|
-
*
|
|
398
|
-
*
|
|
399
|
-
*
|
|
400
|
-
*
|
|
401
|
-
*
|
|
394
|
+
* 2. `<memory kind="knowledge">` — the consultable boot catalog, a SIBLING of
|
|
395
|
+
* the bearings (never nested under the context dir). Dropped when empty.
|
|
396
|
+
* 3. `<auto-loaded-context>` — memories whose `applies-to: "."` fires because
|
|
397
|
+
* cwd/profile mounted their owning project store. Dropped when empty.
|
|
398
|
+
* 4. `<project_context>` — the cwd/git environment snapshot. pi's own
|
|
399
|
+
* AGENTS.md/CLAUDE.md injection stays suppressed (`noContextFiles` in
|
|
400
|
+
* broker.ts); `crtr sys sync project-guidance` imports that guidance into
|
|
401
|
+
* the directory's `.crouter/memory/INDEX.md` front door. */
|
|
402
402
|
export function buildContextBearings(nodeId) {
|
|
403
403
|
const node = getNode(nodeId);
|
|
404
404
|
const bearings = ['<crtr-bearings>', buildIdentityAssertion(nodeId)];
|
|
@@ -420,10 +420,14 @@ export function buildContextBearings(nodeId) {
|
|
|
420
420
|
bearings.push('</crtr-bearings>');
|
|
421
421
|
// The consultable catalog rides BESIDE the bearings, not inside them.
|
|
422
422
|
const knowledge = renderKnowledgeBlock(nodeId);
|
|
423
|
+
// A workspace mount is the initial read of its root (`applies-to: "."`).
|
|
424
|
+
const workspaceContext = renderWorkspaceOpenDocs(nodeId);
|
|
423
425
|
// Hidden applet/situation-origin ambient context (see situational-context.ts)
|
|
424
426
|
// — a SIBLING block, never nested under <crtr-bearings>, and never routed
|
|
425
427
|
// through the visible chat/digest path. '' when nothing was ever set.
|
|
426
428
|
const situational = situationalContextBlock(nodeId);
|
|
427
429
|
const projectCtx = node?.cwd !== undefined ? buildProjectContextBlock(node.cwd) : '';
|
|
428
|
-
return [bearings.join('\n'), knowledge, situational, projectCtx]
|
|
430
|
+
return [bearings.join('\n'), knowledge, workspaceContext, situational, projectCtx]
|
|
431
|
+
.filter((s) => s !== '')
|
|
432
|
+
.join('\n');
|
|
429
433
|
}
|
|
@@ -3,7 +3,6 @@ import { type AgentSessionRuntime, type AgentSessionServices, type CreateAgentSe
|
|
|
3
3
|
import { type ImageContent } from '@earendil-works/pi-ai';
|
|
4
4
|
import { type BrokerSdkConfig } from './launch.js';
|
|
5
5
|
import { type BrokerEngine } from './broker-sdk.js';
|
|
6
|
-
import { type ManagedProviderRotationPolicyControl } from './managed-provider-cooling.js';
|
|
7
6
|
import { type KnownStreamWaitControl } from './stream-watchdog.js';
|
|
8
7
|
import { FrameDecoder, type BrokerSnapshot, type BrokerToClient, type ClientRole, type RpcExtensionUIRequest, type RpcExtensionUIResponse } from './broker-protocol.js';
|
|
9
8
|
/**
|
|
@@ -231,9 +230,6 @@ export interface BrokerDialogDeps {
|
|
|
231
230
|
/** Broadcast a non-blocking display frame (setStatus/setWidget/setTitle) to ALL
|
|
232
231
|
* viewers — the relay path for pi's fire-and-forget extension-UI surface. */
|
|
233
232
|
broadcast: (frame: BrokerToClient) => void;
|
|
234
|
-
/** Live provider-fallback policy. This is a callback because an explicit
|
|
235
|
-
* set_model updates the running broker's pin state without a revive. */
|
|
236
|
-
providerRotationPolicy?: ManagedProviderRotationPolicyControl;
|
|
237
233
|
/** Optional broker-owned control for a deliberate, deadline-bounded provider
|
|
238
234
|
* wait: pause the dead-stream watchdog while the provider extension sleeps to
|
|
239
235
|
* a known finite future deadline, returning a release fn that resumes it. Put
|