@north-light/crouter 0.3.204 → 0.3.206
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/dto/broker.d.ts +2 -0
- package/dist/api/dto/messages.d.ts +22 -1
- package/dist/api/dto/nodes.d.ts +8 -5
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/clients/attach/__tests__/context-message.test.js +54 -19
- package/dist/clients/attach/__tests__/page-block.test.d.ts +1 -0
- package/dist/clients/attach/__tests__/page-block.test.js +54 -0
- package/dist/clients/attach/render/chat-view.d.ts +3 -0
- package/dist/clients/attach/render/chat-view.js +56 -27
- package/dist/clients/attach/render/context-message.d.ts +6 -0
- package/dist/clients/attach/render/context-message.js +21 -3
- package/dist/clients/attach/render/group-activity.d.ts +5 -3
- package/dist/clients/attach/render/group-activity.js +10 -6
- package/dist/clients/attach/render/page-block.js +11 -11
- package/dist/clients/attach/viewer.js +717 -703
- package/dist/clients/conversation/projection.js +7 -37
- package/dist/commands/node/create.js +1 -1
- package/dist/commands/profile/project.js +1 -1
- package/dist/commands/profile/show.js +1 -1
- package/dist/commands/profile.js +1 -1
- package/dist/core/__tests__/canvas-inbox-watcher.test.js +90 -23
- package/dist/core/__tests__/context-intro.test.js +7 -8
- package/dist/core/__tests__/human-deliver.test.js +32 -4
- package/dist/core/__tests__/kickoff.test.js +6 -6
- package/dist/core/__tests__/serial/broker-snapshot-history.test.js +5 -2
- package/dist/core/__tests__/serial/deferred-no-wake.test.js +7 -4
- package/dist/core/__tests__/serial/flagship-lifecycle.test.js +2 -1
- package/dist/core/__tests__/serial/human-deliver-e2e.test.js +4 -1
- package/dist/core/__tests__/serial/revive.test.js +8 -3
- package/dist/core/__tests__/session-cycles.test.js +10 -6
- package/dist/core/canvas/render-source.js +3 -0
- package/dist/core/feed/feed.d.ts +7 -1
- package/dist/core/feed/feed.js +8 -7
- package/dist/core/feed/inbox.d.ts +16 -12
- package/dist/core/feed/inbox.js +56 -56
- package/dist/core/human/page-eval.d.ts +9 -4
- package/dist/core/human/page-eval.js +3 -1
- package/dist/core/human/page-markdown.d.ts +3 -0
- package/dist/core/human/page-markdown.js +295 -0
- package/dist/core/human/page.js +4 -0
- package/dist/core/runtime/bearings.js +5 -4
- package/dist/core/runtime/broker/client-registry.d.ts +1 -0
- package/dist/core/runtime/broker/client-registry.js +1 -0
- package/dist/core/runtime/broker/fault-retry.js +8 -3
- package/dist/core/runtime/broker/frame-dispatch.d.ts +1 -1
- package/dist/core/runtime/broker/frame-dispatch.js +13 -2
- package/dist/core/runtime/broker/inbox.d.ts +20 -2
- package/dist/core/runtime/broker/inbox.js +68 -25
- package/dist/core/runtime/broker/passive.d.ts +1 -0
- package/dist/core/runtime/broker/tool-groups.js +3 -2
- package/dist/core/runtime/broker-extension-render.d.ts +3 -0
- package/dist/core/runtime/broker-extension-render.js +3 -0
- package/dist/core/runtime/broker-protocol.d.ts +14 -0
- package/dist/core/runtime/broker-protocol.js +11 -0
- package/dist/core/runtime/broker.d.ts +2 -2
- package/dist/core/runtime/broker.js +31 -6
- package/dist/core/runtime/deliver-live.js +2 -1
- package/dist/core/runtime/interactive-deliver.d.ts +3 -2
- package/dist/core/runtime/interactive-deliver.js +4 -3
- package/dist/core/runtime/kickoff.d.ts +3 -4
- package/dist/core/runtime/kickoff.js +27 -16
- package/dist/core/runtime/node-read.d.ts +2 -0
- package/dist/core/runtime/node-read.js +11 -3
- package/dist/core/runtime/session-cycles.d.ts +6 -1
- package/dist/core/runtime/session-cycles.js +17 -11
- package/dist/core/runtime/session-visibility.d.ts +7 -12
- package/dist/core/runtime/session-visibility.js +7 -13
- package/dist/core/runtime/situational-context.d.ts +14 -5
- package/dist/core/runtime/situational-context.js +39 -21
- package/dist/core/runtime/situational-live.d.ts +2 -2
- package/dist/core/runtime/situational-live.js +17 -16
- package/dist/core/runtime/spawn.js +4 -3
- package/dist/core/runtime/stop-guard.js +8 -4
- package/dist/core/runtime/warm-pool.d.ts +1 -1
- package/dist/core/runtime/warm-pool.js +6 -9
- package/dist/daemon/api/handlers/messages.js +101 -17
- package/dist/daemon/api/handlers/nodes.js +12 -8
- package/dist/daemon/human/finish.js +44 -4
- package/dist/daemon/messaging/node-message.d.ts +5 -0
- package/dist/daemon/messaging/node-message.js +6 -1
- package/dist/daemon/review/comment-notify.js +8 -0
- package/dist/daemon/review/deliver.js +2 -2
- package/dist/daemon/review/finish.js +1 -0
- package/dist/pi-extensions/__tests__/canvas-goal-capture-envelope.test.d.ts +1 -0
- package/dist/pi-extensions/__tests__/canvas-goal-capture-envelope.test.js +96 -0
- package/dist/pi-extensions/__tests__/canvas-stophook-agentend.test.js +1 -1
- package/dist/pi-extensions/__tests__/canvas-stophook-context-nudge.test.js +2 -2
- package/dist/pi-extensions/broker-local.d.ts +0 -2
- package/dist/pi-extensions/broker-local.js +0 -2
- package/dist/pi-extensions/canvas-context-intro.js +9 -8
- package/dist/pi-extensions/canvas-goal-capture.js +10 -6
- package/dist/pi-extensions/canvas-inbox-watcher.js +116 -69
- package/dist/pi-extensions/canvas-passive-context.d.ts +10 -0
- package/dist/pi-extensions/canvas-passive-context.js +23 -3
- package/dist/pi-extensions/canvas-review-boundary.d.ts +1 -1
- package/dist/pi-extensions/canvas-review-boundary.js +11 -3
- package/dist/pi-extensions/canvas-stophook.js +3 -3
- package/dist/shared/__tests__/generated-context-grammar.test.d.ts +1 -0
- package/dist/shared/__tests__/generated-context-grammar.test.js +85 -0
- package/dist/shared/generated-context.d.ts +68 -36
- package/dist/shared/generated-context.js +300 -174
- package/dist/shared/tool-groups.js +3 -2
- package/package.json +1 -1
- package/runtime.lock.json +2 -2
- package/scripts/postinstall.mjs +9 -0
|
@@ -1,62 +1,94 @@
|
|
|
1
|
-
import { REVIEW_BOUNDARY_CUSTOM_TYPE } from '../core/runtime/session-visibility.js';
|
|
2
|
-
export { REVIEW_BOUNDARY_CUSTOM_TYPE };
|
|
3
1
|
/** Custom message carrying the node's session-start bearings. */
|
|
4
2
|
export declare const CONTEXT_INTRO_CUSTOM_TYPE = "crtr-context";
|
|
5
3
|
/** Custom message carrying an ambient situational-context update. */
|
|
6
4
|
export declare const SITUATIONAL_CONTEXT_CUSTOM_TYPE = "crtr-situational-context";
|
|
7
5
|
/** Custom message used when a context-size nudge waits for the next turn. */
|
|
8
6
|
export declare const CONTEXT_NUDGE_CUSTOM_TYPE = "crtr-context-nudge";
|
|
9
|
-
/**
|
|
7
|
+
/** Custom message that opens a review companion's visible transcript. */
|
|
8
|
+
export declare const REVIEW_BOUNDARY_CUSTOM_TYPE = "crtr-review-boundary";
|
|
9
|
+
/** Opening text of a pre-envelope fresh-revive kickoff user message. */
|
|
10
10
|
export declare const REVIVE_KICKOFF_SENTINEL = "You have been revived fresh after a context refresh";
|
|
11
|
-
/** Prefix shared by the producer and the compatibility classifier for context nudges. */
|
|
12
|
-
export declare const CONTEXT_NUDGE_PREFIX = "[crtr] Context ~";
|
|
13
|
-
/** Runtime-authored continuation after a cleanly aborted turn survives a restart. */
|
|
14
|
-
export declare const RUNTIME_RESTART_CONTINUATION = "<runtime-restart-continuation>\ncontinue\n</runtime-restart-continuation>";
|
|
15
11
|
/** Generic completion mandate issued by the terminal-node stop guard. */
|
|
16
12
|
export declare const STALL_REPROMPT: string;
|
|
17
13
|
/** Static recovery prompts shared by the broker producer and display classifier. */
|
|
18
14
|
export declare const AUTH_FAULT_RECOVERY_BODY = "Provider credentials were just updated (a new login landed). Your previous turn stopped on a provider authentication failure. Continue from where you left off and retry the work that failed.";
|
|
19
15
|
export declare const CONNECTION_FAULT_RECOVERY_BODY = "The network connection is back online. Your previous turn stopped on a connection error (the network was down). Continue from where you left off and retry the work that failed.";
|
|
20
16
|
export declare const PROVIDER_FAULT_RECOVERY_BODY = "Your previous turn stopped on a provider fault. Continue from where you left off and retry the work that failed.";
|
|
21
|
-
|
|
22
|
-
export declare function formatPersonaTransition(guidance: string): string;
|
|
23
|
-
/** Mark a daemon-delivered review approval for compact viewer presentation. */
|
|
24
|
-
export declare function formatReviewApproval(body: string): string;
|
|
17
|
+
export type ModelFallbackRecoveryReason = 'credential' | 'not-found';
|
|
25
18
|
/** Format the stop guard's dynamic structured-output mandate. */
|
|
26
19
|
export declare function formatStructuredOutputReprompt(schema: string): string;
|
|
27
|
-
|
|
28
|
-
/** Mark a model-route fallback re-drive while retaining its full guidance. */
|
|
20
|
+
/** Keep model-fallback guidance editable without making it a reader contract. */
|
|
29
21
|
export declare function formatModelFallbackRecovery(previousModel: string, nextModel: string, reason: ModelFallbackRecoveryReason): string;
|
|
30
22
|
export interface GeneratedContextMessageLike {
|
|
31
23
|
role?: string;
|
|
32
24
|
customType?: string;
|
|
33
25
|
content?: unknown;
|
|
34
26
|
}
|
|
35
|
-
export
|
|
36
|
-
|
|
27
|
+
export type CardEntryDisposition = 'report' | 'human-answer' | 'human-canceled';
|
|
28
|
+
export interface CardEntry {
|
|
29
|
+
disposition: CardEntryDisposition;
|
|
30
|
+
kind: string;
|
|
31
|
+
body: string;
|
|
32
|
+
ref?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface CardSender {
|
|
35
|
+
id: string;
|
|
36
|
+
name?: string;
|
|
37
|
+
updates: number;
|
|
38
|
+
finished: boolean;
|
|
39
|
+
entries: CardEntry[];
|
|
40
|
+
}
|
|
41
|
+
/** An already-resolved inbox entry supplied to the pure digest formatter. */
|
|
42
|
+
export interface InboxCardEntry {
|
|
43
|
+
kind: string;
|
|
44
|
+
body: string;
|
|
45
|
+
ref?: string;
|
|
46
|
+
disposition?: CardEntryDisposition;
|
|
47
|
+
}
|
|
48
|
+
/** An already-resolved sender section supplied to the pure digest formatter. */
|
|
49
|
+
export interface InboxCardSection {
|
|
50
|
+
id: string;
|
|
51
|
+
name?: string;
|
|
52
|
+
entries: readonly InboxCardEntry[];
|
|
53
|
+
updates?: number;
|
|
54
|
+
finished?: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface GeneratedCard {
|
|
57
|
+
kind: string;
|
|
58
|
+
facts: Readonly<Record<string, string>>;
|
|
59
|
+
body: string;
|
|
60
|
+
senders: CardSender[];
|
|
37
61
|
label: string;
|
|
38
62
|
summary: string;
|
|
39
|
-
|
|
40
|
-
|
|
63
|
+
expandable: boolean;
|
|
64
|
+
}
|
|
65
|
+
type CardSummary = (facts: Readonly<Record<string, string>>) => string;
|
|
66
|
+
export interface CardKindDefinition {
|
|
67
|
+
label: string;
|
|
68
|
+
summary: CardSummary;
|
|
69
|
+
expandable: boolean;
|
|
70
|
+
customTypes?: Readonly<Record<string, Partial<Pick<CardKindDefinition, 'label' | 'summary' | 'expandable'>>>>;
|
|
41
71
|
}
|
|
42
|
-
|
|
72
|
+
/** The closed crouter vocabulary, plus custom-role aliases for the same cards. */
|
|
73
|
+
export declare const KIND_TABLE: Readonly<Record<string, CardKindDefinition>>;
|
|
74
|
+
/** Contribute presentation for namespaced kinds this process will render.
|
|
75
|
+
* Idempotent and last-write-wins, so a re-imported module cannot fail a boot.
|
|
76
|
+
* A process that never registers is not degraded: an unregistered kind still
|
|
77
|
+
* parses and only falls back to the generic label and summary. */
|
|
78
|
+
export declare function registerCardKinds(kinds: Readonly<Record<string, CardKindDefinition>>): void;
|
|
43
79
|
/** Plain text from a generated message's string or text-block content. */
|
|
44
80
|
export declare function generatedContextText(message: GeneratedContextMessageLike): string;
|
|
45
|
-
/**
|
|
46
|
-
export declare function
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
export declare function
|
|
53
|
-
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
* user messages use stable sentinels or the same exact formatter/constants as
|
|
60
|
-
* their producers. Ordinary user prompts remain ordinary user prompts.
|
|
61
|
-
*/
|
|
62
|
-
export declare function generatedContextPresentation(message: GeneratedContextMessageLike): GeneratedContextPresentation | null;
|
|
81
|
+
/** Wrap a user-role runtime message in its whole-message card envelope. */
|
|
82
|
+
export declare function formatCard(kind: string, facts: Record<string, string | number | boolean | undefined>, body: string): string;
|
|
83
|
+
/** Wrap a card whose body is DATA, not markup — the only escape on the API
|
|
84
|
+
* path, so a caller can neither emit a malformed card nor smuggle markup into
|
|
85
|
+
* one. `formatCard` keeps its raw body for the trusted crouter producers that
|
|
86
|
+
* deliberately nest markup (bearings blocks, the inbox `<from>`/`<entry>`
|
|
87
|
+
* grammar `parseInboxBody` depends on). */
|
|
88
|
+
export declare function formatDataCard(kind: string, facts: Record<string, string | number | boolean | undefined>, body: string): string;
|
|
89
|
+
/** Parse a runtime envelope, with pre-envelope customType compatibility. */
|
|
90
|
+
export declare function parseCard(message: GeneratedContextMessageLike): GeneratedCard | null;
|
|
91
|
+
/** Format a complete inbox card from report bodies resolved by the caller. */
|
|
92
|
+
export declare function formatInboxCard(sections: readonly InboxCardSection[]): string;
|
|
93
|
+
export declare function isLegacyRuntimeText(text: string): boolean;
|
|
94
|
+
export {};
|