@jungjaehoon/mama-os 0.51.2 → 0.52.1
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/agent/agent-loop.d.ts +58 -0
- package/dist/agent/agent-loop.d.ts.map +1 -1
- package/dist/agent/agent-loop.js +503 -142
- package/dist/agent/agent-loop.js.map +1 -1
- package/dist/agent/claude-cli-wrapper.d.ts.map +1 -1
- package/dist/agent/claude-cli-wrapper.js +3 -2
- package/dist/agent/claude-cli-wrapper.js.map +1 -1
- package/dist/agent/cline-cli-adapter.d.ts +2 -0
- package/dist/agent/cline-cli-adapter.d.ts.map +1 -1
- package/dist/agent/cline-cli-adapter.js +2 -0
- package/dist/agent/cline-cli-adapter.js.map +1 -1
- package/dist/agent/code-act/constants.d.ts +1 -1
- package/dist/agent/code-act/constants.d.ts.map +1 -1
- package/dist/agent/code-act/constants.js +5 -2
- package/dist/agent/code-act/constants.js.map +1 -1
- package/dist/agent/code-act/host-bridge.d.ts.map +1 -1
- package/dist/agent/code-act/host-bridge.js +102 -4
- package/dist/agent/code-act/host-bridge.js.map +1 -1
- package/dist/agent/code-act/tool-catalog.d.ts +2 -0
- package/dist/agent/code-act/tool-catalog.d.ts.map +1 -1
- package/dist/agent/code-act/tool-catalog.js +20 -7
- package/dist/agent/code-act/tool-catalog.js.map +1 -1
- package/dist/agent/codex-app-server-process.d.ts +112 -0
- package/dist/agent/codex-app-server-process.d.ts.map +1 -1
- package/dist/agent/codex-app-server-process.js +518 -1
- package/dist/agent/codex-app-server-process.js.map +1 -1
- package/dist/agent/gateway-tool-executor.d.ts +17 -0
- package/dist/agent/gateway-tool-executor.d.ts.map +1 -1
- package/dist/agent/gateway-tool-executor.js +236 -53
- package/dist/agent/gateway-tool-executor.js.map +1 -1
- package/dist/agent/gateway-tools.md +9 -3
- package/dist/agent/model-runner.d.ts +16 -0
- package/dist/agent/model-runner.d.ts.map +1 -1
- package/dist/agent/model-runner.js.map +1 -1
- package/dist/agent/persistent-cli-adapter.d.ts +5 -0
- package/dist/agent/persistent-cli-adapter.d.ts.map +1 -1
- package/dist/agent/persistent-cli-adapter.js +7 -0
- package/dist/agent/persistent-cli-adapter.js.map +1 -1
- package/dist/agent/persistent-cli-process.d.ts.map +1 -1
- package/dist/agent/persistent-cli-process.js +27 -2
- package/dist/agent/persistent-cli-process.js.map +1 -1
- package/dist/agent/skill-loader.d.ts +7 -2
- package/dist/agent/skill-loader.d.ts.map +1 -1
- package/dist/agent/skill-loader.js +29 -8
- package/dist/agent/skill-loader.js.map +1 -1
- package/dist/agent/subagent-run-reconcile.d.ts +23 -0
- package/dist/agent/subagent-run-reconcile.d.ts.map +1 -0
- package/dist/agent/subagent-run-reconcile.js +56 -0
- package/dist/agent/subagent-run-reconcile.js.map +1 -0
- package/dist/agent/tool-registry.d.ts.map +1 -1
- package/dist/agent/tool-registry.js +126 -3
- package/dist/agent/tool-registry.js.map +1 -1
- package/dist/agent/types.d.ts +52 -2
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/api/graph-api.d.ts.map +1 -1
- package/dist/api/graph-api.js +0 -22
- package/dist/api/graph-api.js.map +1 -1
- package/dist/cli/commands/start.d.ts +8 -7
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +154 -74
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/config/types.d.ts.map +1 -1
- package/dist/cli/config/types.js +2 -1
- package/dist/cli/config/types.js.map +1 -1
- package/dist/cli/runtime/agent-loop-init.d.ts.map +1 -1
- package/dist/cli/runtime/agent-loop-init.js +1 -0
- package/dist/cli/runtime/agent-loop-init.js.map +1 -1
- package/dist/cli/runtime/api-routes-init.d.ts +1 -0
- package/dist/cli/runtime/api-routes-init.d.ts.map +1 -1
- package/dist/cli/runtime/api-routes-init.js +82 -58
- package/dist/cli/runtime/api-routes-init.js.map +1 -1
- package/dist/db/migrations/operator-procedures.d.ts +4 -0
- package/dist/db/migrations/operator-procedures.d.ts.map +1 -0
- package/dist/db/migrations/operator-procedures.js +63 -0
- package/dist/db/migrations/operator-procedures.js.map +1 -0
- package/dist/gateways/message-router.d.ts +6 -3
- package/dist/gateways/message-router.d.ts.map +1 -1
- package/dist/gateways/message-router.js +43 -131
- package/dist/gateways/message-router.js.map +1 -1
- package/dist/gateways/telegram-format.d.ts.map +1 -1
- package/dist/gateways/telegram-format.js +2 -0
- package/dist/gateways/telegram-format.js.map +1 -1
- package/dist/gateways/telegram-response-presenter.d.ts.map +1 -1
- package/dist/gateways/telegram-response-presenter.js +4 -0
- package/dist/gateways/telegram-response-presenter.js.map +1 -1
- package/dist/mcp/code-act-mcp-config.d.ts +49 -0
- package/dist/mcp/code-act-mcp-config.d.ts.map +1 -0
- package/dist/mcp/code-act-mcp-config.js +124 -0
- package/dist/mcp/code-act-mcp-config.js.map +1 -0
- package/dist/multi-agent/runtime-process.d.ts +10 -0
- package/dist/multi-agent/runtime-process.d.ts.map +1 -1
- package/dist/multi-agent/runtime-process.js +8 -0
- package/dist/multi-agent/runtime-process.js.map +1 -1
- package/dist/operator/board-delta-gate.d.ts +34 -10
- package/dist/operator/board-delta-gate.d.ts.map +1 -1
- package/dist/operator/board-delta-gate.js +68 -24
- package/dist/operator/board-delta-gate.js.map +1 -1
- package/dist/operator/board-refresh-gate.d.ts +11 -6
- package/dist/operator/board-refresh-gate.d.ts.map +1 -1
- package/dist/operator/board-refresh-gate.js +12 -11
- package/dist/operator/board-refresh-gate.js.map +1 -1
- package/dist/operator/board-slot-instructions.d.ts +30 -0
- package/dist/operator/board-slot-instructions.d.ts.map +1 -1
- package/dist/operator/board-slot-instructions.js +110 -6
- package/dist/operator/board-slot-instructions.js.map +1 -1
- package/dist/operator/console-brief.d.ts +26 -13
- package/dist/operator/console-brief.d.ts.map +1 -1
- package/dist/operator/console-brief.js +159 -83
- package/dist/operator/console-brief.js.map +1 -1
- package/dist/operator/experience-evidence.d.ts +18 -0
- package/dist/operator/experience-evidence.d.ts.map +1 -0
- package/dist/operator/experience-evidence.js +82 -0
- package/dist/operator/experience-evidence.js.map +1 -0
- package/dist/operator/experience-hints.d.ts +44 -0
- package/dist/operator/experience-hints.d.ts.map +1 -0
- package/dist/operator/experience-hints.js +98 -0
- package/dist/operator/experience-hints.js.map +1 -0
- package/dist/operator/mama-memory-port.js +1 -3
- package/dist/operator/mama-memory-port.js.map +1 -1
- package/dist/operator/operator-trigger-loop.d.ts.map +1 -1
- package/dist/operator/operator-trigger-loop.js +3 -2
- package/dist/operator/operator-trigger-loop.js.map +1 -1
- package/dist/operator/owner-action-effects.d.ts +13 -1
- package/dist/operator/owner-action-effects.d.ts.map +1 -1
- package/dist/operator/owner-action-effects.js +17 -4
- package/dist/operator/owner-action-effects.js.map +1 -1
- package/dist/operator/owner-event-inbox.d.ts +7 -1
- package/dist/operator/owner-event-inbox.d.ts.map +1 -1
- package/dist/operator/owner-event-inbox.js +8 -0
- package/dist/operator/owner-event-inbox.js.map +1 -1
- package/dist/operator/owner-event-loop.d.ts +28 -2
- package/dist/operator/owner-event-loop.d.ts.map +1 -1
- package/dist/operator/owner-event-loop.js +60 -2
- package/dist/operator/owner-event-loop.js.map +1 -1
- package/dist/operator/owner-event-policy.d.ts +20 -0
- package/dist/operator/owner-event-policy.d.ts.map +1 -1
- package/dist/operator/owner-event-policy.js +34 -5
- package/dist/operator/owner-event-policy.js.map +1 -1
- package/dist/operator/owner-event-prompt.d.ts +13 -4
- package/dist/operator/owner-event-prompt.d.ts.map +1 -1
- package/dist/operator/owner-event-prompt.js +31 -38
- package/dist/operator/owner-event-prompt.js.map +1 -1
- package/dist/operator/owner-runtime-journal.d.ts.map +1 -1
- package/dist/operator/owner-runtime-journal.js +7 -3
- package/dist/operator/owner-runtime-journal.js.map +1 -1
- package/dist/operator/owner-runtime.d.ts +6 -0
- package/dist/operator/owner-runtime.d.ts.map +1 -1
- package/dist/operator/owner-runtime.js +48 -5
- package/dist/operator/owner-runtime.js.map +1 -1
- package/dist/operator/procedure-activation.d.ts +7 -0
- package/dist/operator/procedure-activation.d.ts.map +1 -0
- package/dist/operator/procedure-activation.js +132 -0
- package/dist/operator/procedure-activation.js.map +1 -0
- package/dist/operator/procedure-projection.d.ts +25 -0
- package/dist/operator/procedure-projection.d.ts.map +1 -0
- package/dist/operator/procedure-projection.js +80 -0
- package/dist/operator/procedure-projection.js.map +1 -0
- package/dist/operator/procedure-runtime.d.ts +45 -0
- package/dist/operator/procedure-runtime.d.ts.map +1 -0
- package/dist/operator/procedure-runtime.js +496 -0
- package/dist/operator/procedure-runtime.js.map +1 -0
- package/dist/operator/procedure-store.d.ts +97 -0
- package/dist/operator/procedure-store.d.ts.map +1 -0
- package/dist/operator/procedure-store.js +368 -0
- package/dist/operator/procedure-store.js.map +1 -0
- package/dist/operator/subagent-stimulus.d.ts +34 -0
- package/dist/operator/subagent-stimulus.d.ts.map +1 -0
- package/dist/operator/subagent-stimulus.js +145 -0
- package/dist/operator/subagent-stimulus.js.map +1 -0
- package/dist/operator/task-ledger.d.ts +40 -3
- package/dist/operator/task-ledger.d.ts.map +1 -1
- package/dist/operator/task-ledger.js +63 -10
- package/dist/operator/task-ledger.js.map +1 -1
- package/dist/operator/thread-brief-memory.d.ts +29 -0
- package/dist/operator/thread-brief-memory.d.ts.map +1 -0
- package/dist/operator/thread-brief-memory.js +61 -0
- package/dist/operator/thread-brief-memory.js.map +1 -0
- package/dist/operator/trigger-author.d.ts +2 -1
- package/dist/operator/trigger-author.d.ts.map +1 -1
- package/dist/operator/trigger-author.js +23 -0
- package/dist/operator/trigger-author.js.map +1 -1
- package/dist/operator/trigger-matcher.js +1 -0
- package/dist/operator/trigger-matcher.js.map +1 -1
- package/dist/operator/trigger-registry.d.ts +5 -4
- package/dist/operator/trigger-registry.d.ts.map +1 -1
- package/dist/operator/trigger-registry.js +78 -24
- package/dist/operator/trigger-registry.js.map +1 -1
- package/dist/operator/trigger-review.d.ts +1 -1
- package/dist/operator/trigger-review.d.ts.map +1 -1
- package/dist/operator/trigger-review.js +24 -4
- package/dist/operator/trigger-review.js.map +1 -1
- package/dist/operator/trigger-types.d.ts +10 -1
- package/dist/operator/trigger-types.d.ts.map +1 -1
- package/dist/operator/worker-run.d.ts +13 -1
- package/dist/operator/worker-run.d.ts.map +1 -1
- package/dist/operator/worker-run.js +5 -2
- package/dist/operator/worker-run.js.map +1 -1
- package/dist/operator/workorder-consumer.d.ts +106 -14
- package/dist/operator/workorder-consumer.d.ts.map +1 -1
- package/dist/operator/workorder-consumer.js +295 -93
- package/dist/operator/workorder-consumer.js.map +1 -1
- package/dist/operator/workorder-hooks.d.ts +42 -9
- package/dist/operator/workorder-hooks.d.ts.map +1 -1
- package/dist/operator/workorder-hooks.js +52 -13
- package/dist/operator/workorder-hooks.js.map +1 -1
- package/dist/operator/workorder-publishers.d.ts +9 -1
- package/dist/operator/workorder-publishers.d.ts.map +1 -1
- package/dist/operator/workorder-publishers.js +21 -2
- package/dist/operator/workorder-publishers.js.map +1 -1
- package/package.json +2 -2
- package/dist/operator/learning-context.d.ts +0 -49
- package/dist/operator/learning-context.d.ts.map +0 -1
- package/dist/operator/learning-context.js +0 -129
- package/dist/operator/learning-context.js.map +0 -1
- package/dist/operator/learning-markers.d.ts +0 -19
- package/dist/operator/learning-markers.d.ts.map +0 -1
- package/dist/operator/learning-markers.js +0 -147
- package/dist/operator/learning-markers.js.map +0 -1
- package/dist/operator/learning-read.d.ts +0 -16
- package/dist/operator/learning-read.d.ts.map +0 -1
- package/dist/operator/learning-read.js +0 -18
- package/dist/operator/learning-read.js.map +0 -1
- package/dist/operator/turn-observer.d.ts +0 -34
- package/dist/operator/turn-observer.d.ts.map +0 -1
- package/dist/operator/turn-observer.js +0 -79
- package/dist/operator/turn-observer.js.map +0 -1
- package/templates/skills/heartbeat-report.md +0 -75
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-process.d.ts","sourceRoot":"","sources":["../../src/multi-agent/runtime-process.ts"],"names":[],"mappings":"AAA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C,EAAE,qBAAqB,GAChC,OAAO,CAAC,kBAAkB,CAAC;YAIhB,OAAO;IA0CrB,OAAO,CAAC,WAAW;IAYnB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAI9B,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAMrC,OAAO,IAAI,OAAO;IAIlB,SAAS,IAAI,OAAO;IAIpB,UAAU,IAAI,aAAa;IAUrB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAM3B,YAAY,IAAI,MAAM;CAGvB"}
|
|
@@ -15,6 +15,8 @@ const codex_auxiliary_tools_js_1 = require("../agent/codex-auxiliary-tools.js");
|
|
|
15
15
|
*/
|
|
16
16
|
class CodexRuntimeProcess extends events_1.EventEmitter {
|
|
17
17
|
backendType = 'codex';
|
|
18
|
+
/** codex app-server spawns native subagents and reports the spawn via onSubagentStart. */
|
|
19
|
+
supportsNativeSubagents = true;
|
|
18
20
|
options;
|
|
19
21
|
appServer;
|
|
20
22
|
auxiliaryToolBridge;
|
|
@@ -45,6 +47,11 @@ class CodexRuntimeProcess extends events_1.EventEmitter {
|
|
|
45
47
|
registryRoot: options.registryRoot,
|
|
46
48
|
mcpConfigPath: options.mcpConfigPath,
|
|
47
49
|
effort: options.effort,
|
|
50
|
+
// Codex-native subagent activity is observed, never gated: re-emit it for the host.
|
|
51
|
+
onSubagentEvent: (event) => {
|
|
52
|
+
this.emit('subagent', event);
|
|
53
|
+
},
|
|
54
|
+
createSubagentBridge: options.createSubagentBridge,
|
|
48
55
|
});
|
|
49
56
|
this.auxiliaryToolBridge = options.auxiliaryToolPolicy
|
|
50
57
|
? (0, codex_auxiliary_tools_js_1.createCodexAuxiliaryToolBridge)({
|
|
@@ -90,6 +97,7 @@ class CodexRuntimeProcess extends events_1.EventEmitter {
|
|
|
90
97
|
resumeSession: promptOptions?.resumeSession,
|
|
91
98
|
hostToolBridge: promptOptions?.hostToolBridge ?? this.auxiliaryToolBridge,
|
|
92
99
|
resumeInstructions: promptOptions?.resumeInstructions,
|
|
100
|
+
promptTelemetry: promptOptions?.promptTelemetry,
|
|
93
101
|
});
|
|
94
102
|
this._totalLatencyMs += Date.now() - startTime;
|
|
95
103
|
callbacks?.onFinal?.({ content: normalized.response, toolUseBlocks: [] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-process.js","sourceRoot":"","sources":["../../src/multi-agent/runtime-process.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AACtC,sFAA6E;
|
|
1
|
+
{"version":3,"file":"runtime-process.js","sourceRoot":"","sources":["../../src/multi-agent/runtime-process.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AACtC,sFAA6E;AAsB7E,gFAG2C;AAiC3C;;;;;;;;GAQG;AACH,MAAa,mBAAoB,SAAQ,qBAAY;IAC1C,WAAW,GAAG,OAAgB,CAAC;IAExC,0FAA0F;IACjF,uBAAuB,GAAG,IAAI,CAAC;IAEvB,OAAO,CAA6B;IACpC,SAAS,CAAwB;IACjC,mBAAmB,CAAC;IAC7B,iBAAiB,CAAS;IAC1B,YAAY,CAAS;IACrB,OAAO,GAAG,KAAK,CAAC;IAChB,cAAc,GAAG,CAAC,CAAC;IAE3B,2BAA2B;IACnB,aAAa,GAAG,CAAC,CAAC;IAClB,aAAa,GAAG,CAAC,CAAC;IAClB,eAAe,GAAG,CAAC,CAAC;IACpB,cAAc,GAAkB,IAAI,CAAC;IAE7C,YAAY,OAAmC;QAC7C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;QAC9B,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,IAAI,SAAS,CAAC;QAChE,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,EAAE,CAAC;QAC/C,IAAI,CAAC,SAAS,GAAG,IAAI,mDAAqB,CAAC;YACzC,UAAU,EAAE,IAAI,CAAC,iBAAiB;YAClC,KAAK,EAA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
|
* (`mama_search` with no query, compare created_at). A save always inserts.
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
25
|
+
*
|
|
26
|
+
* REMOVED (owner decision 2026-09-09): the agent-notice term. That ring is
|
|
27
|
+
* in-memory on the event bus, so it reset on every restart, read as a delta and
|
|
28
|
+
* bought one full run per boot - the same boot-forcing the repair gate's
|
|
29
|
+
* bootDirty did, and the reason the owner's first message after a restart waited
|
|
30
|
+
* on a maintenance turn. A term that cannot survive a process boundary cannot be
|
|
31
|
+
* a delta signal. The cost is stated rather than hidden: an agent notice alone
|
|
32
|
+
* no longer wakes the board.
|
|
29
33
|
*
|
|
30
34
|
* NOT COVERED, stated rather than hidden: anything the board reads that moves
|
|
31
|
-
* none of the
|
|
32
|
-
* deleted by retention, config/persona changes, and any future
|
|
35
|
+
* none of the three terms - agent notices, report slots edited out of band,
|
|
36
|
+
* connector rows deleted by retention, config/persona changes, and any future
|
|
37
|
+
* board input.
|
|
33
38
|
* Two independent escapes bound that blind spot: a run is never skipped while
|
|
34
39
|
* the last completed full run has no PUBLISHED board behind it, and never
|
|
35
40
|
* skipped once that run is older than DEFAULT_BOARD_FULL_MAX_STALENESS_MS.
|
|
36
41
|
*
|
|
37
42
|
* Availability beats the token saving: any broken or missing signal enqueues
|
|
38
43
|
* as before and logs a warning.
|
|
44
|
+
*
|
|
45
|
+
* The gate also decides HOW the enqueued run works (owner decision 2026-09-09). When there is a
|
|
46
|
+
* PUBLISHED board behind the baseline, the run is a `delta`: it edits that board from the
|
|
47
|
+
* accumulated state, anchored to the board's publish time. Only the cases with no trustworthy
|
|
48
|
+
* published board to edit - no baseline, unpublished, unreadable signal, owner-forced rebuild -
|
|
49
|
+
* still rebuild from the sources.
|
|
39
50
|
*/
|
|
40
51
|
/** Bound on a watermark string, matching the workorder payload field bound. */
|
|
41
52
|
export declare const BOARD_DELTA_WATERMARK_MAX_LENGTH = 1000;
|
|
@@ -58,10 +69,6 @@ export interface BoardDeltaDbLike {
|
|
|
58
69
|
export declare function connectorObservationTerm(db: BoardDeltaDbLike): string;
|
|
59
70
|
/** Memory recency term: a save or an evolution always inserts a decision row. */
|
|
60
71
|
export declare function memoryRecencyTerm(db: BoardDeltaDbLike): string;
|
|
61
|
-
/** Agent-notice term, read from the in-memory event-bus ring. */
|
|
62
|
-
export declare function agentNoticeTerm(notices: readonly {
|
|
63
|
-
timestamp: number;
|
|
64
|
-
}[]): string;
|
|
65
72
|
/**
|
|
66
73
|
* Fold the input terms into one comparable watermark. A change in ANY term
|
|
67
74
|
* changes the result; nothing else about the string is meaningful to the gate.
|
|
@@ -77,11 +84,28 @@ export interface BoardFullBaseline {
|
|
|
77
84
|
completedAt: number;
|
|
78
85
|
}
|
|
79
86
|
export type BoardFullDeltaReason = 'no-baseline' | 'unpublished' | 'stale' | 'delta' | 'no-delta' | 'signal-unavailable';
|
|
87
|
+
/**
|
|
88
|
+
* How the enqueued run must work.
|
|
89
|
+
*
|
|
90
|
+
* `full` rebuilds the board from the sources. `delta` UPDATES the published board from the
|
|
91
|
+
* accumulated state (owner decision 2026-09-09): a run that has a published baseline behind it
|
|
92
|
+
* already has the judgment of every event since - the owner-event turns wrote it into the task
|
|
93
|
+
* ledger - so re-reading raw connector data is re-judging what was already judged. Only the
|
|
94
|
+
* cases where there is no trustworthy published board to edit stay `full`.
|
|
95
|
+
*/
|
|
96
|
+
export type BoardRunMode = 'full' | 'delta';
|
|
80
97
|
export interface BoardFullDeltaDecision {
|
|
81
98
|
enqueue: boolean;
|
|
82
99
|
/** Watermark to carry on the workorder; null when the signal was unusable. */
|
|
83
100
|
watermark: string | null;
|
|
84
101
|
reason: BoardFullDeltaReason;
|
|
102
|
+
/** `delta` only when a PUBLISHED baseline exists to edit; `full` otherwise. */
|
|
103
|
+
mode: BoardRunMode;
|
|
104
|
+
/**
|
|
105
|
+
* The published board's write time (epoch ms) the delta run is anchored to; null whenever
|
|
106
|
+
* the mode is `full` (there is nothing published to anchor on, or we could not read it).
|
|
107
|
+
*/
|
|
108
|
+
anchorPublishedAt: number | null;
|
|
85
109
|
warning: string | null;
|
|
86
110
|
}
|
|
87
111
|
export interface BoardFullDeltaInput {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board-delta-gate.d.ts","sourceRoot":"","sources":["../../src/operator/board-delta-gate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"board-delta-gate.d.ts","sourceRoot":"","sources":["../../src/operator/board-delta-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAIH,+EAA+E;AAC/E,eAAO,MAAM,gCAAgC,OAAO,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,mCAAmC,QAAqB,CAAC;AAEtE;+DAC+D;AAC/D,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,GAAG,EAAE,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,KAAK,OAAO,EAAE,CAAA;KAAE,CAAC;CACpE;AAOD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,gBAAgB,GAAG,MAAM,CAWrE;AAED,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,gBAAgB,GAAG,MAAM,CAM9D;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAO3E;AAED,yEAAyE;AACzE,MAAM,WAAW,iBAAiB;IAChC,sFAAsF;IACtF,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,yEAAyE;IACzE,SAAS,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,oBAAoB,GAC5B,aAAa,GACb,aAAa,GACb,OAAO,GACP,OAAO,GACP,UAAU,GACV,oBAAoB,CAAC;AAEzB;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;AAE5C,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,8EAA8E;IAC9E,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,oBAAoB,CAAC;IAC7B,+EAA+E;IAC/E,IAAI,EAAE,YAAY,CAAC;IACnB;;;OAGG;IACH,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,mEAAmE;IACnE,aAAa,EAAE,MAAM,MAAM,CAAC;IAC5B,oDAAoD;IACpD,YAAY,EAAE,MAAM,iBAAiB,GAAG,IAAI,CAAC;IAC7C;;;;;OAKG;IACH,oBAAoB,EAAE,MAAM,MAAM,CAAC;IACnC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,mBAAmB,GAAG,sBAAsB,CA0EzF"}
|
|
@@ -23,26 +23,36 @@
|
|
|
23
23
|
* connector_event_index.
|
|
24
24
|
* - memory: `MAX(rowid)` over `decisions` - the brief's recency check
|
|
25
25
|
* (`mama_search` with no query, compare created_at). A save always inserts.
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
26
|
+
*
|
|
27
|
+
* REMOVED (owner decision 2026-09-09): the agent-notice term. That ring is
|
|
28
|
+
* in-memory on the event bus, so it reset on every restart, read as a delta and
|
|
29
|
+
* bought one full run per boot - the same boot-forcing the repair gate's
|
|
30
|
+
* bootDirty did, and the reason the owner's first message after a restart waited
|
|
31
|
+
* on a maintenance turn. A term that cannot survive a process boundary cannot be
|
|
32
|
+
* a delta signal. The cost is stated rather than hidden: an agent notice alone
|
|
33
|
+
* no longer wakes the board.
|
|
30
34
|
*
|
|
31
35
|
* NOT COVERED, stated rather than hidden: anything the board reads that moves
|
|
32
|
-
* none of the
|
|
33
|
-
* deleted by retention, config/persona changes, and any future
|
|
36
|
+
* none of the three terms - agent notices, report slots edited out of band,
|
|
37
|
+
* connector rows deleted by retention, config/persona changes, and any future
|
|
38
|
+
* board input.
|
|
34
39
|
* Two independent escapes bound that blind spot: a run is never skipped while
|
|
35
40
|
* the last completed full run has no PUBLISHED board behind it, and never
|
|
36
41
|
* skipped once that run is older than DEFAULT_BOARD_FULL_MAX_STALENESS_MS.
|
|
37
42
|
*
|
|
38
43
|
* Availability beats the token saving: any broken or missing signal enqueues
|
|
39
44
|
* as before and logs a warning.
|
|
45
|
+
*
|
|
46
|
+
* The gate also decides HOW the enqueued run works (owner decision 2026-09-09). When there is a
|
|
47
|
+
* PUBLISHED board behind the baseline, the run is a `delta`: it edits that board from the
|
|
48
|
+
* accumulated state, anchored to the board's publish time. Only the cases with no trustworthy
|
|
49
|
+
* published board to edit - no baseline, unpublished, unreadable signal, owner-forced rebuild -
|
|
50
|
+
* still rebuild from the sources.
|
|
40
51
|
*/
|
|
41
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
53
|
exports.DEFAULT_BOARD_FULL_MAX_STALENESS_MS = exports.BOARD_DELTA_WATERMARK_MAX_LENGTH = void 0;
|
|
43
54
|
exports.connectorObservationTerm = connectorObservationTerm;
|
|
44
55
|
exports.memoryRecencyTerm = memoryRecencyTerm;
|
|
45
|
-
exports.agentNoticeTerm = agentNoticeTerm;
|
|
46
56
|
exports.composeBoardInputWatermark = composeBoardInputWatermark;
|
|
47
57
|
exports.evaluateBoardFullDelta = evaluateBoardFullDelta;
|
|
48
58
|
const node_crypto_1 = require("node:crypto");
|
|
@@ -75,15 +85,6 @@ function memoryRecencyTerm(db) {
|
|
|
75
85
|
const row = rows[0];
|
|
76
86
|
return `m:${String(row?.max_rowid ?? 0)}/${String(row?.n ?? 0)}`;
|
|
77
87
|
}
|
|
78
|
-
/** Agent-notice term, read from the in-memory event-bus ring. */
|
|
79
|
-
function agentNoticeTerm(notices) {
|
|
80
|
-
let newest = 0;
|
|
81
|
-
for (const notice of notices) {
|
|
82
|
-
if (notice.timestamp > newest)
|
|
83
|
-
newest = notice.timestamp;
|
|
84
|
-
}
|
|
85
|
-
return `n:${String(newest)}/${String(notices.length)}`;
|
|
86
|
-
}
|
|
87
88
|
/**
|
|
88
89
|
* Fold the input terms into one comparable watermark. A change in ANY term
|
|
89
90
|
* changes the result; nothing else about the string is meaningful to the gate.
|
|
@@ -117,21 +118,64 @@ function evaluateBoardFullDelta(input) {
|
|
|
117
118
|
enqueue: true,
|
|
118
119
|
watermark: null,
|
|
119
120
|
reason: 'signal-unavailable',
|
|
121
|
+
// A run whose input signal we could not read cannot be anchored either: it rebuilds.
|
|
122
|
+
mode: 'full',
|
|
123
|
+
anchorPublishedAt: null,
|
|
120
124
|
warning: err instanceof Error ? err.message : String(err),
|
|
121
125
|
};
|
|
122
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Whether there is a published board to EDIT, as opposed to one to rebuild. The same
|
|
129
|
+
* evidence 'unpublished' rests on: a run that reached 'done' without writing the slots left
|
|
130
|
+
* nothing a delta turn could anchor on.
|
|
131
|
+
*/
|
|
132
|
+
const published = baseline !== null && publishedAt >= baseline.createdAt;
|
|
133
|
+
const anchored = (reason) => ({
|
|
134
|
+
enqueue: true,
|
|
135
|
+
watermark,
|
|
136
|
+
reason,
|
|
137
|
+
mode: published ? 'delta' : 'full',
|
|
138
|
+
anchorPublishedAt: published ? publishedAt : null,
|
|
139
|
+
warning: null,
|
|
140
|
+
});
|
|
123
141
|
if (baseline === null || baseline.watermark === null) {
|
|
124
|
-
return {
|
|
142
|
+
return {
|
|
143
|
+
enqueue: true,
|
|
144
|
+
watermark,
|
|
145
|
+
reason: 'no-baseline',
|
|
146
|
+
mode: 'full',
|
|
147
|
+
anchorPublishedAt: null,
|
|
148
|
+
warning: null,
|
|
149
|
+
};
|
|
125
150
|
}
|
|
126
|
-
|
|
127
|
-
|
|
151
|
+
// The INPUT delta is asked first, before the evidence-about-the-board reasons.
|
|
152
|
+
// 'unpublished' used to win here, and the caller requires in-memory dirt to agree with
|
|
153
|
+
// that one reason - so a real input delta arriving after an honestly-empty (and therefore
|
|
154
|
+
// permanently unpublished) full run was suppressed until the 2h staleness bound. A moved
|
|
155
|
+
// watermark is the strongest signal the gate has; it must not be reported as a weaker one.
|
|
156
|
+
if (baseline.watermark !== watermark) {
|
|
157
|
+
return anchored('delta');
|
|
128
158
|
}
|
|
129
|
-
if (
|
|
130
|
-
return {
|
|
159
|
+
if (!published) {
|
|
160
|
+
return {
|
|
161
|
+
enqueue: true,
|
|
162
|
+
watermark,
|
|
163
|
+
reason: 'unpublished',
|
|
164
|
+
mode: 'full',
|
|
165
|
+
anchorPublishedAt: null,
|
|
166
|
+
warning: null,
|
|
167
|
+
};
|
|
131
168
|
}
|
|
132
|
-
if (baseline.
|
|
133
|
-
return
|
|
169
|
+
if (now() - baseline.completedAt >= maxStalenessMs) {
|
|
170
|
+
return anchored('stale');
|
|
134
171
|
}
|
|
135
|
-
return {
|
|
172
|
+
return {
|
|
173
|
+
enqueue: false,
|
|
174
|
+
watermark,
|
|
175
|
+
reason: 'no-delta',
|
|
176
|
+
mode: 'full',
|
|
177
|
+
anchorPublishedAt: null,
|
|
178
|
+
warning: null,
|
|
179
|
+
};
|
|
136
180
|
}
|
|
137
181
|
//# sourceMappingURL=board-delta-gate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board-delta-gate.js","sourceRoot":"","sources":["../../src/operator/board-delta-gate.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"board-delta-gate.js","sourceRoot":"","sources":["../../src/operator/board-delta-gate.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;;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AI,QAAQ,KAAK,IAAI,IAAI,QAAQ,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;QACrD,OAAO;YACL,OAAO,EAAE,IAAI;YACb,SAAS;YACT,MAAM,EAAE,aAAa;YACrB,IAAI,EAAE,MAAM;YACZ,iBAAiB,EAAE,IAAI;YACvB,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IACD,+EAA+E;IAC/E,uFAAuF;IACvF,0FAA0F;IAC1F,yFAAyF;IACzF,2FAA2F;IAC3F,IAAI,QAAQ,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QACrC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IACD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE,IAAI;YACb,SAAS;YACT,MAAM,EAAE,aAAa;YACrB,IAAI,EAAE,MAAM;YACZ,iBAAiB,EAAE,IAAI;YACvB,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IACD,IAAI,GAAG,EAAE,GAAG,QAAQ,CAAC,WAAW,IAAI,cAAc,EAAE,CAAC;QACnD,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO;QACL,OAAO,EAAE,KAAK;QACd,SAAS;QACT,MAAM,EAAE,UAAU;QAClB,IAAI,EAAE,MAAM;QACZ,iBAAiB,EAAE,IAAI;QACvB,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* In-memory repair authority for the event-driven Board path (TG-06).
|
|
3
3
|
*
|
|
4
|
-
* The gate
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* The gate is dirt, and nothing else. It starts CLEAN: a boot is not evidence
|
|
5
|
+
* that anything the board reads moved, and the forced one-full-run-per-boot it
|
|
6
|
+
* used to buy is what made the owner's first message after a restart wait on a
|
|
7
|
+
* maintenance turn (owner decision 2026-09-09). Channel deltas receive
|
|
8
|
+
* monotonically increasing generations before debounce/budgeting. A completion
|
|
9
|
+
* may clear only the generation it captured; later ingress stays dirty and is
|
|
10
|
+
* repaired by a later reconcile or full pass.
|
|
11
|
+
*
|
|
12
|
+
* Staleness and "no board has ever been published" remain grounds for a full
|
|
13
|
+
* run, but they are EVIDENCE, read by the delta gate (board-delta-gate.ts),
|
|
14
|
+
* never state this gate invents at boot.
|
|
8
15
|
*/
|
|
9
16
|
export interface BoardRefreshGateOptions {
|
|
10
17
|
/** Test seam. Production seeds from epoch milliseconds to order across boots. */
|
|
@@ -18,8 +25,6 @@ export interface FullRepairCapture {
|
|
|
18
25
|
export declare function boardFullNoUpdateScope(repairGeneration: number): string;
|
|
19
26
|
export declare class BoardRefreshGate {
|
|
20
27
|
private generation;
|
|
21
|
-
private readonly bootGeneration;
|
|
22
|
-
private bootDirty;
|
|
23
28
|
private readonly channelGenerations;
|
|
24
29
|
constructor(options?: BoardRefreshGateOptions);
|
|
25
30
|
needsFullRepair(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board-refresh-gate.d.ts","sourceRoot":"","sources":["../../src/operator/board-refresh-gate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"board-refresh-gate.d.ts","sourceRoot":"","sources":["../../src/operator/board-refresh-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,uBAAuB;IACtC,iFAAiF;IACjF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,sBAAsB,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAGvE;AAQD,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA6B;gBAEpD,OAAO,GAAE,uBAA4B;IAMjD,eAAe,IAAI,OAAO;IAI1B,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAY5C,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAIlD,iBAAiB,IAAI,iBAAiB;IAOtC,yBAAyB,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,IAAI;IAI/E,4BAA4B,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,IAAI;IAIlF,oBAAoB,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI;IAStD,OAAO,CAAC,8BAA8B;CAOvC"}
|
|
@@ -2,10 +2,17 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* In-memory repair authority for the event-driven Board path (TG-06).
|
|
4
4
|
*
|
|
5
|
-
* The gate
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* The gate is dirt, and nothing else. It starts CLEAN: a boot is not evidence
|
|
6
|
+
* that anything the board reads moved, and the forced one-full-run-per-boot it
|
|
7
|
+
* used to buy is what made the owner's first message after a restart wait on a
|
|
8
|
+
* maintenance turn (owner decision 2026-09-09). Channel deltas receive
|
|
9
|
+
* monotonically increasing generations before debounce/budgeting. A completion
|
|
10
|
+
* may clear only the generation it captured; later ingress stays dirty and is
|
|
11
|
+
* repaired by a later reconcile or full pass.
|
|
12
|
+
*
|
|
13
|
+
* Staleness and "no board has ever been published" remain grounds for a full
|
|
14
|
+
* run, but they are EVIDENCE, read by the delta gate (board-delta-gate.ts),
|
|
15
|
+
* never state this gate invents at boot.
|
|
9
16
|
*/
|
|
10
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
18
|
exports.BoardRefreshGate = void 0;
|
|
@@ -21,17 +28,14 @@ function assertRepairGeneration(value) {
|
|
|
21
28
|
}
|
|
22
29
|
class BoardRefreshGate {
|
|
23
30
|
generation;
|
|
24
|
-
bootGeneration;
|
|
25
|
-
bootDirty = true;
|
|
26
31
|
channelGenerations = new Map();
|
|
27
32
|
constructor(options = {}) {
|
|
28
33
|
const initial = options.initialGeneration ?? (options.now ?? Date.now)();
|
|
29
34
|
assertRepairGeneration(initial);
|
|
30
35
|
this.generation = initial;
|
|
31
|
-
this.bootGeneration = initial;
|
|
32
36
|
}
|
|
33
37
|
needsFullRepair() {
|
|
34
|
-
return this.
|
|
38
|
+
return this.channelGenerations.size > 0;
|
|
35
39
|
}
|
|
36
40
|
markChannelDirty(channelKey) {
|
|
37
41
|
if (channelKey.length === 0) {
|
|
@@ -61,9 +65,6 @@ class BoardRefreshGate {
|
|
|
61
65
|
}
|
|
62
66
|
completeVerifiedFull(capturedGeneration) {
|
|
63
67
|
assertRepairGeneration(capturedGeneration);
|
|
64
|
-
if (capturedGeneration >= this.bootGeneration) {
|
|
65
|
-
this.bootDirty = false;
|
|
66
|
-
}
|
|
67
68
|
for (const [channelKey, generation] of this.channelGenerations) {
|
|
68
69
|
if (generation <= capturedGeneration) {
|
|
69
70
|
this.channelGenerations.delete(channelKey);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board-refresh-gate.js","sourceRoot":"","sources":["../../src/operator/board-refresh-gate.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"board-refresh-gate.js","sourceRoot":"","sources":["../../src/operator/board-refresh-gate.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAaH,wDAGC;AAHD,SAAgB,sBAAsB,CAAC,gBAAwB;IAC7D,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;IACzC,OAAO,QAAQ,gBAAgB,EAAE,CAAC;AACpC,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAa;IAC3C,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG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AkB,EAAE,kBAA0B;QACtE,IAAI,CAAC,8BAA8B,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;IACtE,CAAC;IAED,4BAA4B,CAAC,UAAkB,EAAE,kBAA0B;QACzE,IAAI,CAAC,8BAA8B,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;IACtE,CAAC;IAED,oBAAoB,CAAC,kBAA0B;QAC7C,sBAAsB,CAAC,kBAAkB,CAAC,CAAC;QAC3C,KAAK,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC/D,IAAI,UAAU,IAAI,kBAAkB,EAAE,CAAC;gBACrC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC;IACH,CAAC;IAEO,8BAA8B,CAAC,UAAkB,EAAE,kBAA0B;QACnF,sBAAsB,CAAC,kBAAkB,CAAC,CAAC;QAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACxD,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,IAAI,kBAAkB,EAAE,CAAC;YAC3D,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;CACF;AA7DD,4CA6DC"}
|
|
@@ -13,6 +13,36 @@
|
|
|
13
13
|
export declare const BOARD_SLOT_ORDER: readonly ["briefing", "action_required", "decisions", "pipeline"];
|
|
14
14
|
/** The exact HTML shapes the board stylesheet understands. */
|
|
15
15
|
export declare function buildBoardHtmlVocabulary(): string[];
|
|
16
|
+
/**
|
|
17
|
+
* Per-slot shape the board expects. Single source for the legacy persona's
|
|
18
|
+
* publish block and for the report_publish tool contract the standing owner
|
|
19
|
+
* runtime reads through tool_describe at publish time.
|
|
20
|
+
*/
|
|
21
|
+
export declare function buildBoardSlotShapeLines(): string[];
|
|
22
|
+
/**
|
|
23
|
+
* The report_publish tool description. The board's class vocabulary belongs
|
|
24
|
+
* with the tool that publishes it, not in per-turn prompt text: an agent that
|
|
25
|
+
* describes report_publish before calling it learns the shape the board styles.
|
|
26
|
+
*/
|
|
27
|
+
export declare function buildReportPublishToolContract(): string;
|
|
16
28
|
/** Instruction block that makes a report run also publish the board slots. */
|
|
17
29
|
export declare function buildBoardPublishLines(): string[];
|
|
30
|
+
/**
|
|
31
|
+
* The class tokens the board stylesheet understands, derived from the SAME
|
|
32
|
+
* vocabulary text the agent is shown. There is no second copy of the list: if
|
|
33
|
+
* a class is added to buildBoardHtmlVocabulary() it becomes recognised here.
|
|
34
|
+
* `structural` marks the subset that makes a slot count as board HTML.
|
|
35
|
+
*/
|
|
36
|
+
export declare function boardHtmlClassVocabulary(): Set<string> & {
|
|
37
|
+
structural: Set<string>;
|
|
38
|
+
};
|
|
39
|
+
/** The structural block classes, in vocabulary order. */
|
|
40
|
+
export declare function boardStructuralClasses(): readonly string[];
|
|
41
|
+
/**
|
|
42
|
+
* True when slot HTML carries at least one STRUCTURAL board class token.
|
|
43
|
+
* Exact: only class attribute tokens count, never substrings of prose. A slot
|
|
44
|
+
* built out of sub-element classes alone (badge-*, tag-*, summary-*, card-*)
|
|
45
|
+
* does NOT pass -- the board renders it as plain text.
|
|
46
|
+
*/
|
|
47
|
+
export declare function htmlUsesBoardVocabulary(html: string): boolean;
|
|
18
48
|
//# sourceMappingURL=board-slot-instructions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board-slot-instructions.d.ts","sourceRoot":"","sources":["../../src/operator/board-slot-instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,gBAAgB,mEAAoE,CAAC;AAElG,8DAA8D;AAC9D,wBAAgB,wBAAwB,IAAI,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"board-slot-instructions.d.ts","sourceRoot":"","sources":["../../src/operator/board-slot-instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,gBAAgB,mEAAoE,CAAC;AAElG,8DAA8D;AAC9D,wBAAgB,wBAAwB,IAAI,MAAM,EAAE,CAkBnD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,EAAE,CAQnD;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,IAAI,MAAM,CAcvD;AAED,8EAA8E;AAC9E,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CAUjD;AAiBD;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG;IAAE,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAAE,CAuBpF;AAED,yDAAyD;AACzD,wBAAgB,sBAAsB,IAAI,SAAS,MAAM,EAAE,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAU7D"}
|
|
@@ -14,7 +14,12 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.BOARD_SLOT_ORDER = void 0;
|
|
16
16
|
exports.buildBoardHtmlVocabulary = buildBoardHtmlVocabulary;
|
|
17
|
+
exports.buildBoardSlotShapeLines = buildBoardSlotShapeLines;
|
|
18
|
+
exports.buildReportPublishToolContract = buildReportPublishToolContract;
|
|
17
19
|
exports.buildBoardPublishLines = buildBoardPublishLines;
|
|
20
|
+
exports.boardHtmlClassVocabulary = boardHtmlClassVocabulary;
|
|
21
|
+
exports.boardStructuralClasses = boardStructuralClasses;
|
|
22
|
+
exports.htmlUsesBoardVocabulary = htmlUsesBoardVocabulary;
|
|
18
23
|
exports.BOARD_SLOT_ORDER = ['briefing', 'action_required', 'decisions', 'pipeline'];
|
|
19
24
|
/** The exact HTML shapes the board stylesheet understands. */
|
|
20
25
|
function buildBoardHtmlVocabulary() {
|
|
@@ -32,23 +37,122 @@ function buildBoardHtmlVocabulary() {
|
|
|
32
37
|
'- Temporal badges are separate facts: badge-danger (overdue), badge-warning (due today),',
|
|
33
38
|
' badge-info (upcoming), badge-success (closed).',
|
|
34
39
|
'- Pipeline table: <table class="report-table"><thead><tr><th>...</th></tr></thead><tbody>rows</tbody></table>',
|
|
35
|
-
'
|
|
40
|
+
'The board sanitizes script, iframe, object, embed, form, link, meta and base tags plus event',
|
|
41
|
+
'handlers out of every slot; inline styles fight the board stylesheet, so do not write them.',
|
|
36
42
|
];
|
|
37
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Per-slot shape the board expects. Single source for the legacy persona's
|
|
46
|
+
* publish block and for the report_publish tool contract the standing owner
|
|
47
|
+
* runtime reads through tool_describe at publish time.
|
|
48
|
+
*/
|
|
49
|
+
function buildBoardSlotShapeLines() {
|
|
50
|
+
return [
|
|
51
|
+
'- pipeline: rendered by the host from the task ledger and already published. Never write it.',
|
|
52
|
+
'- briefing: one report-summary block (title + stat highlights), then up to 4 report-cards for the key situations.',
|
|
53
|
+
'- action_required: a report-section-title, then up to 5 report-cards; every card-action states the concrete next step.',
|
|
54
|
+
'- decisions: report-cards for items waiting on an owner decision or confirmation; omit filler when none exist,',
|
|
55
|
+
' but still publish the slot with a one-line quiet note.',
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The report_publish tool description. The board's class vocabulary belongs
|
|
60
|
+
* with the tool that publishes it, not in per-turn prompt text: an agent that
|
|
61
|
+
* describes report_publish before calling it learns the shape the board styles.
|
|
62
|
+
*/
|
|
63
|
+
function buildReportPublishToolContract() {
|
|
64
|
+
const inline = (lines) => lines.join(' ').replace(/\s+/g, ' ').trim();
|
|
65
|
+
return inline([
|
|
66
|
+
'Publish dashboard analysis as HTML.',
|
|
67
|
+
'pipeline is a managed live task projection; change tasks instead.',
|
|
68
|
+
'Supply the task basis actually used for analysis; omission means its basis is unknown.',
|
|
69
|
+
'SLOT SHAPE:',
|
|
70
|
+
...buildBoardSlotShapeLines(),
|
|
71
|
+
...buildBoardHtmlVocabulary(),
|
|
72
|
+
"Write slot CONTENT in the owner's language; keep each slot under 6KB.",
|
|
73
|
+
'A slot that contains none of report-summary / report-card / report-section-title / report-table',
|
|
74
|
+
'is still published, but the result reports it back as a',
|
|
75
|
+
'warning because the board renders it as plain text.',
|
|
76
|
+
]);
|
|
77
|
+
}
|
|
38
78
|
/** Instruction block that makes a report run also publish the board slots. */
|
|
39
79
|
function buildBoardPublishLines() {
|
|
40
80
|
return [
|
|
41
81
|
'BEFORE writing your text report, update the operator board: call the report_publish',
|
|
42
82
|
'gateway tool EXACTLY once with the THREE judgment slots:',
|
|
43
83
|
' report_publish({ slots: { briefing: "<html>", action_required: "<html>", decisions: "<html>" } })',
|
|
44
|
-
|
|
45
|
-
'- briefing: one report-summary block (title + stat highlights), then up to 4 item cards for the key situations.',
|
|
46
|
-
'- action_required: a report-section-title, then up to 5 cards; every card-action states the concrete next step.',
|
|
47
|
-
'- decisions: cards for items waiting on an owner decision or confirmation; omit filler when none exist,',
|
|
48
|
-
' but still publish the slot with a one-line quiet note.',
|
|
84
|
+
...buildBoardSlotShapeLines(),
|
|
49
85
|
...buildBoardHtmlVocabulary(),
|
|
50
86
|
"Write all slot CONTENT in the owner's language (match the channels); keep each slot under 6KB.",
|
|
51
87
|
'The plain-text report you write afterwards is a separate output: no HTML in it.',
|
|
52
88
|
];
|
|
53
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* The STRUCTURAL block classes: the ones the board stylesheet needs in order to
|
|
92
|
+
* render a slot as a board block rather than plain text. Sub-element classes
|
|
93
|
+
* (card-header, card-title, card-badge, badge-*, tag-*, summary-*) only decorate
|
|
94
|
+
* a structural block, so they prove nothing on their own -- the live 19:59/20:06
|
|
95
|
+
* slots carried `card`/`card-grid`/`badge-info` and still rendered unstyled.
|
|
96
|
+
* Single source: `boardHtmlClassVocabulary().structural`.
|
|
97
|
+
*/
|
|
98
|
+
const BOARD_STRUCTURAL_CLASSES = [
|
|
99
|
+
'report-summary',
|
|
100
|
+
'report-section-title',
|
|
101
|
+
'report-card',
|
|
102
|
+
'report-table',
|
|
103
|
+
];
|
|
104
|
+
/**
|
|
105
|
+
* The class tokens the board stylesheet understands, derived from the SAME
|
|
106
|
+
* vocabulary text the agent is shown. There is no second copy of the list: if
|
|
107
|
+
* a class is added to buildBoardHtmlVocabulary() it becomes recognised here.
|
|
108
|
+
* `structural` marks the subset that makes a slot count as board HTML.
|
|
109
|
+
*/
|
|
110
|
+
function boardHtmlClassVocabulary() {
|
|
111
|
+
const classes = new Set();
|
|
112
|
+
for (const line of buildBoardHtmlVocabulary()) {
|
|
113
|
+
for (const match of line.matchAll(/class="([^"]*)"/g)) {
|
|
114
|
+
for (const token of match[1].split(/\s+/)) {
|
|
115
|
+
if (token)
|
|
116
|
+
classes.add(token);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// badge-*/tag-* variants are enumerated in prose, not inside a class attribute.
|
|
120
|
+
for (const match of line.matchAll(/\b(?:badge|tag)-[a-z]+\b/g)) {
|
|
121
|
+
classes.add(match[0]);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// The structural names must actually appear in the vocabulary the agent is
|
|
125
|
+
// shown; a silent drift would make the predicate unreachable.
|
|
126
|
+
const structural = new Set();
|
|
127
|
+
for (const name of BOARD_STRUCTURAL_CLASSES) {
|
|
128
|
+
if (!classes.has(name)) {
|
|
129
|
+
throw new Error(`Board vocabulary text no longer contains structural class ${name}`);
|
|
130
|
+
}
|
|
131
|
+
structural.add(name);
|
|
132
|
+
}
|
|
133
|
+
return Object.assign(classes, { structural });
|
|
134
|
+
}
|
|
135
|
+
/** The structural block classes, in vocabulary order. */
|
|
136
|
+
function boardStructuralClasses() {
|
|
137
|
+
return BOARD_STRUCTURAL_CLASSES;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* True when slot HTML carries at least one STRUCTURAL board class token.
|
|
141
|
+
* Exact: only class attribute tokens count, never substrings of prose. A slot
|
|
142
|
+
* built out of sub-element classes alone (badge-*, tag-*, summary-*, card-*)
|
|
143
|
+
* does NOT pass -- the board renders it as plain text.
|
|
144
|
+
*/
|
|
145
|
+
function htmlUsesBoardVocabulary(html) {
|
|
146
|
+
if (typeof html !== 'string' || html.length === 0)
|
|
147
|
+
return false;
|
|
148
|
+
const { structural } = boardHtmlClassVocabulary();
|
|
149
|
+
for (const match of html.matchAll(/class\s*=\s*(?:"([^"]*)"|'([^']*)')/g)) {
|
|
150
|
+
const value = match[1] ?? match[2] ?? '';
|
|
151
|
+
for (const token of value.split(/\s+/)) {
|
|
152
|
+
if (token && structural.has(token))
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
54
158
|
//# sourceMappingURL=board-slot-instructions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board-slot-instructions.js","sourceRoot":"","sources":["../../src/operator/board-slot-instructions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAKH,
|
|
1
|
+
{"version":3,"file":"board-slot-instructions.js","sourceRoot":"","sources":["../../src/operator/board-slot-instructions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAKH,4DAkBC;AAOD,4DAQC;AAOD,wEAcC;AAGD,wDAUC;AAuBD,4DAuBC;AAGD,wDAEC;AAQD,0DAUC;AA3IY,QAAA,gBAAgB,GAAG,CAAC,UAAU,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAU,CAAC;AAElG,8DAA8D;AAC9D,SAAgB,wBAAwB;IACtC,OAAO;QACL,qGAAqG;QACrG,sFAAsF;QACtF,oIAAoI;QACpI,oEAAoE;QACpE,oGAAoG;QACpG,6DAA6D;QAC7D,6EAA6E;QAC7E,6DAA6D;QAC7D,+FAA+F;QAC/F,yDAAyD;QACzD,0FAA0F;QAC1F,kDAAkD;QAClD,+GAA+G;QAC/G,8FAA8F;QAC9F,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