@jungjaehoon/mama-os 0.32.0 → 0.32.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 +5 -1
- package/dist/agent/agent-loop.d.ts.map +1 -1
- package/dist/agent/agent-loop.js +62 -49
- package/dist/agent/agent-loop.js.map +1 -1
- package/dist/agent/code-act/host-bridge.d.ts.map +1 -1
- package/dist/agent/code-act/host-bridge.js +35 -74
- package/dist/agent/code-act/host-bridge.js.map +1 -1
- package/dist/agent/gateway-tool-catalog.d.ts +14 -0
- package/dist/agent/gateway-tool-catalog.d.ts.map +1 -0
- package/dist/agent/gateway-tool-catalog.js +41 -0
- package/dist/agent/gateway-tool-catalog.js.map +1 -0
- package/dist/agent/gateway-tool-executor.d.ts +12 -1
- package/dist/agent/gateway-tool-executor.d.ts.map +1 -1
- package/dist/agent/gateway-tool-executor.js +149 -15
- package/dist/agent/gateway-tool-executor.js.map +1 -1
- package/dist/agent/gateway-tools.md +5 -7
- package/dist/agent/tool-registry.d.ts +6 -4
- package/dist/agent/tool-registry.d.ts.map +1 -1
- package/dist/agent/tool-registry.js +62 -30
- package/dist/agent/tool-registry.js.map +1 -1
- package/dist/agent/types.d.ts +18 -2
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/api/index.d.ts +10 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +7 -16
- package/dist/api/index.js.map +1 -1
- package/dist/cli/commands/connector.d.ts +6 -1
- package/dist/cli/commands/connector.d.ts.map +1 -1
- package/dist/cli/commands/connector.js +61 -45
- package/dist/cli/commands/connector.js.map +1 -1
- package/dist/cli/commands/start.d.ts +11 -8
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +155 -88
- 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 +0 -4
- package/dist/cli/config/types.js.map +1 -1
- package/dist/cli/runtime/api-routes-init.d.ts +38 -1
- package/dist/cli/runtime/api-routes-init.d.ts.map +1 -1
- package/dist/cli/runtime/api-routes-init.js +150 -30
- package/dist/cli/runtime/api-routes-init.js.map +1 -1
- package/dist/cli/runtime/api-server-init.d.ts +4 -0
- package/dist/cli/runtime/api-server-init.d.ts.map +1 -1
- package/dist/cli/runtime/api-server-init.js +3 -1
- package/dist/cli/runtime/api-server-init.js.map +1 -1
- package/dist/cli/runtime/connector-bootstrap.d.ts +8 -0
- package/dist/cli/runtime/connector-bootstrap.d.ts.map +1 -0
- package/dist/cli/runtime/connector-bootstrap.js +14 -0
- package/dist/cli/runtime/connector-bootstrap.js.map +1 -0
- package/dist/cli/runtime/connector-init.d.ts +4 -1
- package/dist/cli/runtime/connector-init.d.ts.map +1 -1
- package/dist/cli/runtime/connector-init.js +2 -8
- package/dist/cli/runtime/connector-init.js.map +1 -1
- package/dist/cli/runtime/envelope-bootstrap.d.ts +2 -1
- package/dist/cli/runtime/envelope-bootstrap.d.ts.map +1 -1
- package/dist/cli/runtime/envelope-bootstrap.js +7 -15
- package/dist/cli/runtime/envelope-bootstrap.js.map +1 -1
- package/dist/connectors/index.d.ts +4 -1
- package/dist/connectors/index.d.ts.map +1 -1
- package/dist/connectors/index.js +3 -2
- package/dist/connectors/index.js.map +1 -1
- package/dist/connectors/private-connector-policy.d.ts +150 -0
- package/dist/connectors/private-connector-policy.d.ts.map +1 -0
- package/dist/connectors/private-connector-policy.js +289 -0
- package/dist/connectors/private-connector-policy.js.map +1 -0
- package/dist/connectors/private-prompt-overlay.d.ts +17 -0
- package/dist/connectors/private-prompt-overlay.d.ts.map +1 -0
- package/dist/connectors/private-prompt-overlay.js +156 -0
- package/dist/connectors/private-prompt-overlay.js.map +1 -0
- package/dist/db/migrations/operator-task-external-lifecycle.d.ts +8 -0
- package/dist/db/migrations/operator-task-external-lifecycle.d.ts.map +1 -0
- package/dist/db/migrations/operator-task-external-lifecycle.js +169 -0
- package/dist/db/migrations/operator-task-external-lifecycle.js.map +1 -0
- package/dist/envelope/enforcer.js +8 -7
- package/dist/envelope/enforcer.js.map +1 -1
- package/dist/envelope/reactive-config.d.ts.map +1 -1
- package/dist/envelope/reactive-config.js +2 -1
- package/dist/envelope/reactive-config.js.map +1 -1
- package/dist/envelope/tool-connector-scope.d.ts.map +1 -1
- package/dist/envelope/tool-connector-scope.js +4 -0
- package/dist/envelope/tool-connector-scope.js.map +1 -1
- package/dist/gateways/message-router.d.ts +11 -1
- package/dist/gateways/message-router.d.ts.map +1 -1
- package/dist/gateways/message-router.js +121 -41
- package/dist/gateways/message-router.js.map +1 -1
- package/dist/gateways/telegram-message-ledger.d.ts +8 -1
- package/dist/gateways/telegram-message-ledger.d.ts.map +1 -1
- package/dist/gateways/telegram-message-ledger.js +141 -24
- package/dist/gateways/telegram-message-ledger.js.map +1 -1
- package/dist/gateways/telegram.d.ts +2 -0
- package/dist/gateways/telegram.d.ts.map +1 -1
- package/dist/gateways/telegram.js +19 -12
- package/dist/gateways/telegram.js.map +1 -1
- package/dist/multi-agent/agent-process-manager.d.ts +9 -1
- package/dist/multi-agent/agent-process-manager.d.ts.map +1 -1
- package/dist/multi-agent/agent-process-manager.js +48 -20
- package/dist/multi-agent/agent-process-manager.js.map +1 -1
- package/dist/multi-agent/dashboard-agent-persona.d.ts +3 -3
- package/dist/multi-agent/dashboard-agent-persona.d.ts.map +1 -1
- package/dist/multi-agent/dashboard-agent-persona.js +10 -13
- package/dist/multi-agent/dashboard-agent-persona.js.map +1 -1
- package/dist/multi-agent/memory-agent-persona.d.ts +1 -1
- package/dist/multi-agent/memory-agent-persona.d.ts.map +1 -1
- package/dist/multi-agent/memory-agent-persona.js +1 -1
- package/dist/multi-agent/wiki-agent-persona.d.ts +2 -2
- package/dist/multi-agent/wiki-agent-persona.js +2 -2
- package/dist/operator/board-slot-instructions.d.ts +1 -1
- package/dist/operator/board-slot-instructions.js +2 -2
- package/dist/operator/board-slot-instructions.js.map +1 -1
- package/dist/operator/briefs.d.ts +3 -0
- package/dist/operator/briefs.d.ts.map +1 -1
- package/dist/operator/briefs.js +64 -3
- package/dist/operator/briefs.js.map +1 -1
- package/dist/operator/console-brief.d.ts +6 -3
- package/dist/operator/console-brief.d.ts.map +1 -1
- package/dist/operator/console-brief.js +39 -9
- package/dist/operator/console-brief.js.map +1 -1
- package/dist/operator/external-lifecycle-candidates.d.ts +56 -0
- package/dist/operator/external-lifecycle-candidates.d.ts.map +1 -0
- package/dist/operator/external-lifecycle-candidates.js +415 -0
- package/dist/operator/external-lifecycle-candidates.js.map +1 -0
- package/dist/operator/external-lifecycle.d.ts +82 -0
- package/dist/operator/external-lifecycle.d.ts.map +1 -0
- package/dist/operator/external-lifecycle.js +27 -0
- package/dist/operator/external-lifecycle.js.map +1 -0
- package/dist/operator/file-coordination.d.ts +7 -0
- package/dist/operator/file-coordination.d.ts.map +1 -0
- package/dist/operator/file-coordination.js +84 -0
- package/dist/operator/file-coordination.js.map +1 -0
- package/dist/operator/operator-trigger-loop.d.ts +19 -4
- package/dist/operator/operator-trigger-loop.d.ts.map +1 -1
- package/dist/operator/operator-trigger-loop.js +151 -23
- package/dist/operator/operator-trigger-loop.js.map +1 -1
- package/dist/operator/pending-report-store.d.ts +62 -3
- package/dist/operator/pending-report-store.d.ts.map +1 -1
- package/dist/operator/pending-report-store.js +297 -40
- package/dist/operator/pending-report-store.js.map +1 -1
- package/dist/operator/report-carry-delivery.d.ts +35 -0
- package/dist/operator/report-carry-delivery.d.ts.map +1 -0
- package/dist/operator/report-carry-delivery.js +55 -0
- package/dist/operator/report-carry-delivery.js.map +1 -0
- package/dist/operator/report-carry.d.ts +50 -30
- package/dist/operator/report-carry.d.ts.map +1 -1
- package/dist/operator/report-carry.js +323 -71
- package/dist/operator/report-carry.js.map +1 -1
- package/dist/operator/situation-report.d.ts +30 -11
- package/dist/operator/situation-report.d.ts.map +1 -1
- package/dist/operator/situation-report.js +42 -13
- package/dist/operator/situation-report.js.map +1 -1
- package/dist/operator/task-ledger.d.ts +101 -0
- package/dist/operator/task-ledger.d.ts.map +1 -1
- package/dist/operator/task-ledger.js +599 -124
- package/dist/operator/task-ledger.js.map +1 -1
- package/dist/operator/temporal-worker.js +1 -1
- package/dist/operator/worker-run.d.ts +1 -1
- package/dist/operator/worker-run.d.ts.map +1 -1
- package/dist/operator/worker-run.js +17 -5
- package/dist/operator/worker-run.js.map +1 -1
- package/dist/operator/workorder-consumer.d.ts +12 -1
- package/dist/operator/workorder-consumer.d.ts.map +1 -1
- package/dist/operator/workorder-consumer.js +125 -6
- package/dist/operator/workorder-consumer.js.map +1 -1
- package/dist/operator/workorder-hooks.d.ts +7 -2
- package/dist/operator/workorder-hooks.d.ts.map +1 -1
- package/dist/operator/workorder-hooks.js +22 -0
- package/dist/operator/workorder-hooks.js.map +1 -1
- package/dist/operator/workorder-publishers.d.ts +9 -2
- package/dist/operator/workorder-publishers.d.ts.map +1 -1
- package/dist/operator/workorder-publishers.js +167 -5
- package/dist/operator/workorder-publishers.js.map +1 -1
- package/package.json +2 -2
- package/scripts/generate-gateway-tools.ts +13 -3
package/dist/operator/briefs.js
CHANGED
|
@@ -15,6 +15,7 @@ exports.briefsDir = briefsDir;
|
|
|
15
15
|
exports.briefPath = briefPath;
|
|
16
16
|
exports.loadBrief = loadBrief;
|
|
17
17
|
exports.buildDefaultBrief = buildDefaultBrief;
|
|
18
|
+
exports.projectWorkOrderBriefForPrompt = projectWorkOrderBriefForPrompt;
|
|
18
19
|
exports.ensureBriefs = ensureBriefs;
|
|
19
20
|
const node_fs_1 = require("node:fs");
|
|
20
21
|
const node_os_1 = require("node:os");
|
|
@@ -25,6 +26,33 @@ const task_ledger_js_1 = require("./task-ledger.js");
|
|
|
25
26
|
const dashboard_agent_persona_js_1 = require("../multi-agent/dashboard-agent-persona.js");
|
|
26
27
|
const wiki_agent_persona_js_1 = require("../multi-agent/wiki-agent-persona.js");
|
|
27
28
|
const temporal_worker_js_1 = require("./temporal-worker.js");
|
|
29
|
+
const private_connector_policy_js_1 = require("../connectors/private-connector-policy.js");
|
|
30
|
+
const private_prompt_overlay_js_1 = require("../connectors/private-prompt-overlay.js");
|
|
31
|
+
const LEGACY_PRIVATE_LINES = {
|
|
32
|
+
board: new Set([
|
|
33
|
+
'- kagemusha_tasks({status?}) -- the bridge task board. Statuses are real lifecycle states: pending, in_progress, review, done, completed, cancelled, dismissed. Includes title, priority, deadline, source_room, confirmed.',
|
|
34
|
+
'- kagemusha_overview() -- room/task/message counts for the stat line',
|
|
35
|
+
'- kagemusha_entities({channel?, activeOnly?}) -- list rooms/people with activity stats; find the busiest rooms',
|
|
36
|
+
'- kagemusha_messages({channelId, since?, limit?}) -- read recent raw messages from a room for deltas and evidence',
|
|
37
|
+
"- context_compile({task, connectors?, limit?, max_tool_calls?, strictness?}) -- compile a scoped evidence packet for the board. Trello is external connector evidence and is available only through context_compile; when intentionally isolating Trello, pass connectors: ['trello']. Never treat kagemusha_* as Trello.",
|
|
38
|
+
'- kagemusha_tasks is the read-only project-task truth. task_list/task_create/task_update is YOUR task board (you maintain its data) and the pipeline projection source. Never infer or copy lifecycle status across those stores.',
|
|
39
|
+
'- Never copy Trello or Kagemusha lifecycle status into your task board.',
|
|
40
|
+
'- Project-task completion/progress comes ONLY from kagemusha_tasks. NEVER infer a project task\'s state from message archaeology ("no approval message found" is not a status).',
|
|
41
|
+
'- Never copy Trello or Kagemusha lifecycle status into the native ledger.',
|
|
42
|
+
'1. Read the REAL task state first: kagemusha_tasks({}) for open work, plus kagemusha_tasks({status: "review"}) and kagemusha_tasks({status: "pending"}) slices; kagemusha_overview() for the stat line',
|
|
43
|
+
'2. Gather deltas: kagemusha_entities({activeOnly: true}), then kagemusha_messages({channelId, since}) on the busiest 2-3 rooms (since = ISO timestamp for the last 24-48h) for what changed since the last board',
|
|
44
|
+
'- Use kagemusha_tasks for owner work.',
|
|
45
|
+
]),
|
|
46
|
+
wiki: new Set(),
|
|
47
|
+
'memory-curation': new Set([
|
|
48
|
+
'2. kagemusha_entities({activeOnly: true}) to find the rooms active since the',
|
|
49
|
+
'boundary, then kagemusha_messages({channelId, since: <boundary ISO>}) on',
|
|
50
|
+
'the busiest 3-4 rooms.',
|
|
51
|
+
]),
|
|
52
|
+
temporal: new Set([
|
|
53
|
+
'- Kagemusha is read-only project truth. Do not copy its lifecycle state into the native task.',
|
|
54
|
+
]),
|
|
55
|
+
};
|
|
28
56
|
function briefsDir(homeDir = (0, node_os_1.homedir)()) {
|
|
29
57
|
return (0, node_path_1.join)(homeDir, '.mama', 'briefs');
|
|
30
58
|
}
|
|
@@ -62,6 +90,16 @@ publish ONLY those, use task_create/task_update with source_channel and
|
|
|
62
90
|
source_event_id from the delta, or contract_no_update({reason, scope:
|
|
63
91
|
"reconcile:<channelKey>"}) when nothing is affected. Finish with exactly one
|
|
64
92
|
line: RECONCILED <comma-separated slots or none>.
|
|
93
|
+
|
|
94
|
+
When a reconcile payload contains candidates, they are host-authored immutable
|
|
95
|
+
evidence; deltaLines are only human-readable context. Name every candidate by
|
|
96
|
+
its candidateId and make exactly one candidate-bound decision per candidate:
|
|
97
|
+
use task_external_bind for a binding candidate (choose bind or decline), or
|
|
98
|
+
task_lifecycle_reconcile for a lifecycle candidate (choose apply or retain).
|
|
99
|
+
The available choices are bind/decline/apply/retain. Use your judgment; the
|
|
100
|
+
host does not prescribe an outcome or tool order. You must not use task_update for status or latest_event changes to a candidate task. Do not invent candidates, ids,
|
|
101
|
+
statuses, or evidence. When there are no candidates, preserve ordinary reconcile
|
|
102
|
+
behavior unchanged.
|
|
65
103
|
`;
|
|
66
104
|
const WIKI_WORKORDER_CONTRACT = `
|
|
67
105
|
## Work order contract (Stage 2)
|
|
@@ -80,9 +118,9 @@ scheduledAt as the current time reference.
|
|
|
80
118
|
1. agent_notices({limit: 100}): find your latest promotion notice (action
|
|
81
119
|
"promoted" or "no_update") and treat it as the boundary; default to the
|
|
82
120
|
last 24h when absent.
|
|
83
|
-
2.
|
|
84
|
-
boundary, then
|
|
85
|
-
the
|
|
121
|
+
2. Use the business-data readers present in this run's catalog to find active
|
|
122
|
+
channels since the boundary, then inspect the busiest 3-4 channels without
|
|
123
|
+
widening the boundary.
|
|
86
124
|
3. For each candidate judgment, mama_search first to find the existing topic;
|
|
87
125
|
reuse it so the evolution chain stays intact.
|
|
88
126
|
4. Promote at most 5 durable judgments per run via mama_save: pricing/scope
|
|
@@ -104,6 +142,29 @@ function buildDefaultBrief(kind) {
|
|
|
104
142
|
return (0, temporal_worker_js_1.buildTemporalWorkerBrief)();
|
|
105
143
|
}
|
|
106
144
|
}
|
|
145
|
+
function stripLegacyPrivateLines(kind, raw) {
|
|
146
|
+
const legacyLines = LEGACY_PRIVATE_LINES[kind];
|
|
147
|
+
const parts = raw.split(/(\r?\n)/);
|
|
148
|
+
let projected = '';
|
|
149
|
+
for (let index = 0; index < parts.length; index += 2) {
|
|
150
|
+
const line = parts[index] ?? '';
|
|
151
|
+
const separator = parts[index + 1] ?? '';
|
|
152
|
+
if (!legacyLines.has(line)) {
|
|
153
|
+
projected += line + separator;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return projected;
|
|
157
|
+
}
|
|
158
|
+
/** Project a user-owned work-order brief for one run without changing its file. */
|
|
159
|
+
function projectWorkOrderBriefForPrompt(kind, raw, policy) {
|
|
160
|
+
const overlay = (0, private_prompt_overlay_js_1.buildPrivatePromptOverlay)((0, private_connector_policy_js_1.resolveWorkOrderPrivateSurface)(kind), policy);
|
|
161
|
+
const projected = (0, private_prompt_overlay_js_1.stripDisabledPrivatePromptRecipes)(stripLegacyPrivateLines(kind, (0, private_prompt_overlay_js_1.stripMarkedPrivatePromptOverlays)(raw)), overlay.length > 0);
|
|
162
|
+
if (!overlay) {
|
|
163
|
+
return projected;
|
|
164
|
+
}
|
|
165
|
+
const separator = projected.endsWith('\n\n') ? '' : projected.endsWith('\n') ? '\n' : '\n\n';
|
|
166
|
+
return `${projected}${separator}${overlay}\n`;
|
|
167
|
+
}
|
|
107
168
|
/**
|
|
108
169
|
* Boot seeding (plan B2/C6/E9): write packaged defaults for MISSING briefs
|
|
109
170
|
* only - user/agent edits always win (existsSync guard). DELIBERATE deviation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"briefs.js","sourceRoot":"","sources":["../../src/operator/briefs.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;
|
|
1
|
+
{"version":3,"file":"briefs.js","sourceRoot":"","sources":["../../src/operator/briefs.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AA+CH,8BAEC;AAED,8BAEC;AAGD,8BAIC;AAuED,8CAWC;AAiBD,wEAeC;AASD,oCAgBC;AArMD,qCAAyF;AACzF,qCAAkC;AAClC,yCAAiC;AACjC,qDAAuE;AACvE,2EAA2E;AAC3E,2EAA2E;AAC3E,0FAAoF;AACpF,gFAA0E;AAC1E,6DAAgE;AAChE,2FAGmD;AACnD,uFAIiD;AAEjD,MAAM,oBAAoB,GAAyD;IACjF,KAAK,EAAE,IAAI,GAAG,CAAC;QACb,6NAA6N;QAC7N,sEAAsE;QACtE,gHAAgH;QAChH,mHAAmH;QACnH,2TAA2T;QAC3T,mOAAmO;QACnO,yEAAyE;QACzE,iLAAiL;QACjL,2EAA2E;QAC3E,wMAAwM;QACxM,kNAAkN;QAClN,uCAAuC;KACxC,CAAC;IACF,IAAI,EAAE,IAAI,GAAG,EAAE;IACf,iBAAiB,EAAE,IAAI,GAAG,CAAC;QACzB,8EAA8E;QAC9E,0EAA0E;QAC1E,wBAAwB;KACzB,CAAC;IACF,QAAQ,EAAE,IAAI,GAAG,CAAC;QAChB,+FAA+F;KAChG,CAAC;CACH,CAAC;AAEF,SAAgB,SAAS,CAAC,UAAkB,IAAA,iBAAO,GAAE;IACnD,OAAO,IAAA,gBAAI,EAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC1C,CAAC;AAED,SAAgB,SAAS,CAAC,IAAmB,EAAE,UAAkB,IAA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C,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACnD,MAAM,MAAM,GAAoB,EAAE,CAAC;IACnC,KAAK,MAAM,IAAI,IAAI,gCAAe,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACtC,IAAI,CAAC,IAAA,oBAAU,EAAC,IAAI,CAAC,EAAE,CAAC;YACtB,oEAAoE;YACpE,2DAA2D;YAC3D,MAAM,OAAO,GAAG,GAAG,IAAI,MAAM,CAAC;YAC9B,IAAA,uBAAa,EAAC,OAAO,EAAE,iBAAiB,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;YACzD,IAAA,oBAAU,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YAC1B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAClB,OAAO,CAAC,GAAG,CAAC,kCAAkC,IAAI,EAAE,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { type PrivateConnectorPolicy } from '../connectors/private-connector-policy.js';
|
|
2
|
+
/** Full-replace ceiling with headroom for a mature manual while preventing a
|
|
3
|
+
* runaway self-edit from bloating every future prompt. */
|
|
3
4
|
export declare const CONSOLE_BRIEF_MAX_CHARS = 32000;
|
|
4
|
-
export declare const CONSOLE_BRIEF_DEFAULT = "# Owner Console Operating Brief\n\nThis file is YOURS. It is seeded once and never overwritten by upgrades.\nWhen the owner corrects how you work, or a procedure fails and you learn the\nfix, record it with console_brief_update({lesson}) - one durable lesson per\ncall, appended below with today's date while everything above is preserved.\nThis is how your operating manual grows; losing a lesson means repeating the\nfailure.\n\n## Reporting philosophy\n\n- A report is analysis, not a listing. Cross-check at least two sources\n (board/tasks vs channel messages) before stating a situation.\n- Cite where each claim came from, with the source timestamp. An uncited\n claim is a guess.\n- Quote the key channel line when it drives a conclusion; name the room and\n sender exactly as the source shows them.\n- Lead with what changed and what needs the owner; keep the quiet parts to\n one line.\n\n## Procedure recipes (grow this section from experience)\n\n- Status questions: artifacts first (board_read, workorder_status,\n audit_findings_read), then live queries; memory recall last and cited.\n- Business data:
|
|
5
|
+
export declare const CONSOLE_BRIEF_DEFAULT = "# Owner Console Operating Brief\n\nThis file is YOURS. It is seeded once and never overwritten by upgrades.\nWhen the owner corrects how you work, or a procedure fails and you learn the\nfix, record it with console_brief_update({lesson}) - one durable lesson per\ncall, appended below with today's date while everything above is preserved.\nThis is how your operating manual grows; losing a lesson means repeating the\nfailure.\n\n## Reporting philosophy\n\n- A report is analysis, not a listing. Cross-check at least two sources\n (board/tasks vs channel messages) before stating a situation.\n- Cite where each claim came from, with the source timestamp. An uncited\n claim is a guess.\n- Quote the key channel line when it drives a conclusion; name the room and\n sender exactly as the source shows them.\n- Lead with what changed and what needs the owner; keep the quiet parts to\n one line.\n\n## Procedure recipes (grow this section from experience)\n\n- Status questions: artifacts first (board_read, workorder_status,\n audit_findings_read), then live queries; memory recall last and cited.\n- Business data: use only tools present in the current run catalog. Start with\n a broad summary, narrow to active entities or tasks, then inspect specific\n channels without widening a supplied time window.\n- Cross-channel synthesis: anchor items on their task id (relatedTaskId)\n so the same work seen in two rooms stays one item.\n\n## Situational awareness\n\n- Delta events name what changed since your last look; answer against the\n delta first, then the wider window.\n- After a context gap (compaction, restart), rebuild from storage - recall\n and artifacts - never from what you assume you remember.\n\n## Self-update rule\n\n- When the owner corrects your working style, or a recipe above proves\n wrong, call console_brief_update({lesson}) in the same turn and say you\n did. One concrete lesson per call; the file itself is curated by the\n owner - you only ever add.\n\n## Lessons\n";
|
|
5
6
|
export declare function consoleBriefPath(homeDir?: string): string;
|
|
6
7
|
/** Boot seeding - write the packaged default ONLY when missing (agent/user
|
|
7
8
|
* edits always win; deliberate no-auto-upgrade, mirroring ensureBriefs). */
|
|
8
9
|
export declare function ensureConsoleBrief(homeDir?: string): boolean;
|
|
9
10
|
/** Read the current brief; empty string when absent (caller seeds on boot). */
|
|
10
11
|
export declare function loadConsoleBrief(homeDir?: string): string;
|
|
12
|
+
/** Project a user-owned brief for one prompt without modifying its file. */
|
|
13
|
+
export declare function projectConsoleBriefForPrompt(raw: string, policy: PrivateConnectorPolicy): string;
|
|
11
14
|
/**
|
|
12
15
|
* Append one dated lesson for the agent's self-update tool. APPEND, never
|
|
13
16
|
* replace: on the loop's first live fire (2026-07-24) the model answered a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console-brief.d.ts","sourceRoot":"","sources":["../../src/operator/console-brief.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"console-brief.d.ts","sourceRoot":"","sources":["../../src/operator/console-brief.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AAOxF;0DAC0D;AAC1D,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAU9C,eAAO,MAAM,qBAAqB,i+DA6CjC,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,MAAkB,GAAG,MAAM,CAEpE;AAED;6EAC6E;AAC7E,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,MAAkB,GAAG,OAAO,CAQvE;AAED,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,MAAkB,GAAG,MAAM,CAIpE;AAeD,4EAA4E;AAC5E,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,sBAAsB,GAAG,MAAM,CAWhG;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,MAAkB,GAAG,MAAM,CA4B5F"}
|
|
@@ -4,13 +4,14 @@ exports.CONSOLE_BRIEF_DEFAULT = exports.CONSOLE_BRIEF_MAX_CHARS = void 0;
|
|
|
4
4
|
exports.consoleBriefPath = consoleBriefPath;
|
|
5
5
|
exports.ensureConsoleBrief = ensureConsoleBrief;
|
|
6
6
|
exports.loadConsoleBrief = loadConsoleBrief;
|
|
7
|
+
exports.projectConsoleBriefForPrompt = projectConsoleBriefForPrompt;
|
|
7
8
|
exports.appendConsoleBriefLesson = appendConsoleBriefLesson;
|
|
8
9
|
/**
|
|
9
10
|
* Owner-console operating brief - the agent-owned operations manual.
|
|
10
11
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* A mature operating prompt accretes one line per operational failure and
|
|
13
|
+
* owner correction. This module preserves that learning LOOP, not a private
|
|
14
|
+
* deployment's manual:
|
|
14
15
|
* the system seeds a mechanism skeleton once and provides the write path;
|
|
15
16
|
* the agent fills it from experience (console_brief_update, log-loud).
|
|
16
17
|
*
|
|
@@ -25,9 +26,17 @@ exports.appendConsoleBriefLesson = appendConsoleBriefLesson;
|
|
|
25
26
|
const node_fs_1 = require("node:fs");
|
|
26
27
|
const node_os_1 = require("node:os");
|
|
27
28
|
const node_path_1 = require("node:path");
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
const private_prompt_overlay_js_1 = require("../connectors/private-prompt-overlay.js");
|
|
30
|
+
/** Full-replace ceiling with headroom for a mature manual while preventing a
|
|
31
|
+
* runaway self-edit from bloating every future prompt. */
|
|
30
32
|
exports.CONSOLE_BRIEF_MAX_CHARS = 32_000;
|
|
33
|
+
const LEGACY_CONSOLE_PRIVATE_LINES = new Set([
|
|
34
|
+
'- Business data: progressive exploration - kagemusha_overview() then',
|
|
35
|
+
'kagemusha_entities({activeOnly:true}) then kagemusha_tasks({...}) then',
|
|
36
|
+
'kagemusha_messages({channelId, since}) on the busiest channels. Never',
|
|
37
|
+
'widen a since window you were given.',
|
|
38
|
+
'- Use kagemusha_tasks first.',
|
|
39
|
+
]);
|
|
31
40
|
exports.CONSOLE_BRIEF_DEFAULT = `# Owner Console Operating Brief
|
|
32
41
|
|
|
33
42
|
This file is YOURS. It is seeded once and never overwritten by upgrades.
|
|
@@ -52,10 +61,9 @@ failure.
|
|
|
52
61
|
|
|
53
62
|
- Status questions: artifacts first (board_read, workorder_status,
|
|
54
63
|
audit_findings_read), then live queries; memory recall last and cited.
|
|
55
|
-
- Business data:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
widen a since window you were given.
|
|
64
|
+
- Business data: use only tools present in the current run catalog. Start with
|
|
65
|
+
a broad summary, narrow to active entities or tasks, then inspect specific
|
|
66
|
+
channels without widening a supplied time window.
|
|
59
67
|
- Cross-channel synthesis: anchor items on their task id (relatedTaskId)
|
|
60
68
|
so the same work seen in two rooms stays one item.
|
|
61
69
|
|
|
@@ -97,6 +105,28 @@ function loadConsoleBrief(homeDir = (0, node_os_1.homedir)()) {
|
|
|
97
105
|
return '';
|
|
98
106
|
return (0, node_fs_1.readFileSync)(path, 'utf-8');
|
|
99
107
|
}
|
|
108
|
+
function removeLegacyConsolePrivateLines(raw) {
|
|
109
|
+
const parts = raw.split(/(\r?\n)/);
|
|
110
|
+
let projected = '';
|
|
111
|
+
for (let index = 0; index < parts.length; index += 2) {
|
|
112
|
+
const line = parts[index] ?? '';
|
|
113
|
+
const separator = parts[index + 1] ?? '';
|
|
114
|
+
if (!LEGACY_CONSOLE_PRIVATE_LINES.has(line)) {
|
|
115
|
+
projected += line + separator;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return projected;
|
|
119
|
+
}
|
|
120
|
+
/** Project a user-owned brief for one prompt without modifying its file. */
|
|
121
|
+
function projectConsoleBriefForPrompt(raw, policy) {
|
|
122
|
+
const overlay = (0, private_prompt_overlay_js_1.buildPrivatePromptOverlay)('owner_console', policy);
|
|
123
|
+
const projected = (0, private_prompt_overlay_js_1.stripDisabledPrivatePromptRecipes)(removeLegacyConsolePrivateLines((0, private_prompt_overlay_js_1.stripMarkedPrivatePromptOverlays)(raw)), overlay.length > 0);
|
|
124
|
+
if (!overlay) {
|
|
125
|
+
return projected;
|
|
126
|
+
}
|
|
127
|
+
const separator = projected.endsWith('\n\n') ? '' : projected.endsWith('\n') ? '\n' : '\n\n';
|
|
128
|
+
return `${projected}${separator}${overlay}\n`;
|
|
129
|
+
}
|
|
100
130
|
/**
|
|
101
131
|
* Append one dated lesson for the agent's self-update tool. APPEND, never
|
|
102
132
|
* replace: on the loop's first live fire (2026-07-24) the model answered a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console-brief.js","sourceRoot":"","sources":["../../src/operator/console-brief.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"console-brief.js","sourceRoot":"","sources":["../../src/operator/console-brief.ts"],"names":[],"mappings":";;;AAsFA,4CAEC;AAID,gDAQC;AAGD,4CAIC;AAgBD,oEAWC;AAcD,4DA4BC;AAhLD;;;;;;;;;;;;;;;;GAgBG;AACH,qCAAyF;AACzF,qCAAkC;AAClC,yCAAiC;AAEjC,uFAIiD;AAEjD;0DAC0D;AAC7C,QAAA,uBAAuB,GAAG,MAAM,CAAC;AAE9C,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAC;IAC3C,sEAAsE;IACtE,wEAAwE;IACxE,uEAAuE;IACvE,sCAAsC;IACtC,8BAA8B;CAC/B,CAAC,CAAC;AAEU,QAAA,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CpC,CAAC;AAEF,SAAgB,gBAAgB,CAAC,UAAkB,IAAA,iBAAO,GAAE;IAC1D,OAAO,IAAA,gBAAI,EAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,wBAAwB,CAAC,CAAC;AACpE,CAAC;AAED;6EAC6E;AAC7E,SAAgB,kBAAkB,CAAC,UAAkB,IAAA,iBAAO,GAAE;IAC5D,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACvC,IAAI,IAAA,oBAAU,EAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CA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AG,CAAC,EAAE,CAAC;IAChE,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG,GAAG,IAAI,KAAK,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB,GAAG,KAAK,IAAI,CAAC;IAC3F,IAAI,IAAI,CAAC,MAAM,GAAG,+BAAuB,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CACb,iCAAiC,IAAI,CAAC,MAAM,kBAAkB,+BAAuB,KAAK;YACxF,iEAAiE,CACpE,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACvC,IAAA,mBAAS,EAAC,IAAA,gBAAI,EAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACjE,MAAM,OAAO,GAAG,GAAG,IAAI,MAAM,CAAC;IAC9B,IAAA,uBAAa,EAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACtC,IAAA,oBAAU,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC1B,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { BindingCandidateIdentityInput, CandidateTaskSnapshot, ExistingExternalBindingSnapshot, ExternalLifecycleCandidateSet, ExternalLifecycleDiagnostic, ExternalLifecycleStatus, ExternalObservationSnapshot, LifecycleCandidateIdentityInput, TaskHintLookup } from './external-lifecycle.js';
|
|
2
|
+
export type { BindingCandidateIdentityInput, ExistingExternalBindingSnapshot, ExternalObservationSnapshot, TaskHintLookup, } from './external-lifecycle.js';
|
|
3
|
+
export declare const KAGEMUSHA_LIFECYCLE_OBSERVED_STATUSES: readonly ["pending", "in_progress", "review", "done", "completed", "cancelled", "dismissed"];
|
|
4
|
+
export interface RawExternalObservation {
|
|
5
|
+
event_index_id: unknown;
|
|
6
|
+
source_connector: unknown;
|
|
7
|
+
source_type: unknown;
|
|
8
|
+
source_id: unknown;
|
|
9
|
+
channel: unknown;
|
|
10
|
+
content_hash: unknown;
|
|
11
|
+
source_timestamp_ms: unknown;
|
|
12
|
+
operator_ingest_seq: unknown;
|
|
13
|
+
operator_observation_seq: unknown;
|
|
14
|
+
metadata_json: unknown;
|
|
15
|
+
}
|
|
16
|
+
export interface ExternalLifecycleDecisionInput {
|
|
17
|
+
readonly candidate_id: string;
|
|
18
|
+
readonly decision: 'bind' | 'decline' | 'apply' | 'retain';
|
|
19
|
+
readonly reason: string;
|
|
20
|
+
readonly expected_revision: number;
|
|
21
|
+
}
|
|
22
|
+
export interface ClassifiedKagemushaObservation {
|
|
23
|
+
readonly observation: ExternalObservationSnapshot | null;
|
|
24
|
+
readonly diagnostic: ExternalLifecycleDiagnostic | null;
|
|
25
|
+
}
|
|
26
|
+
/** Exact status spellings emitted by the private Kagemusha task connector. */
|
|
27
|
+
export declare function mapKagemushaLifecycle(value: string): ExternalLifecycleStatus | null;
|
|
28
|
+
/**
|
|
29
|
+
* Validates the agent-authored half of a candidate decision. Identity, task,
|
|
30
|
+
* event, and status stay host-owned and are recovered from the opaque ID.
|
|
31
|
+
*/
|
|
32
|
+
export declare function validateExternalLifecycleDecision(kind: 'binding' | 'lifecycle', value: unknown): asserts value is ExternalLifecycleDecisionInput;
|
|
33
|
+
/**
|
|
34
|
+
* Parses a single database row into an immutable, host-authored observation.
|
|
35
|
+
* The fixed summary intentionally derives from validated structured fields only.
|
|
36
|
+
*/
|
|
37
|
+
export declare function parseKagemushaObservation(row: RawExternalObservation): ExternalObservationSnapshot | null;
|
|
38
|
+
/**
|
|
39
|
+
* Classifies one untrusted database row once, so callers can preserve a
|
|
40
|
+
* bounded per-event diagnostic without re-parsing connector content.
|
|
41
|
+
*/
|
|
42
|
+
export declare function classifyKagemushaObservation(row: RawExternalObservation): ClassifiedKagemushaObservation;
|
|
43
|
+
/** Parses the only source identity accepted for private Kagemusha card evidence. */
|
|
44
|
+
export declare function parseKagemushaExternalSourceId(value: unknown): number | null;
|
|
45
|
+
/** Returns the sole permitted summary; malformed inputs cannot render arbitrary prose. */
|
|
46
|
+
export declare function kagemushaEvidenceSummary(taskId: unknown, observedStatus: unknown, sourceTimestampMs: unknown): string | null;
|
|
47
|
+
export declare function externalLifecycleCandidateId(input: BindingCandidateIdentityInput | LifecycleCandidateIdentityInput): string;
|
|
48
|
+
export declare function buildExternalLifecycleCandidateSet(input: {
|
|
49
|
+
eventIds: readonly string[];
|
|
50
|
+
observations: readonly ExternalObservationSnapshot[];
|
|
51
|
+
taskHints: TaskHintLookup;
|
|
52
|
+
tasksById: ReadonlyMap<number, CandidateTaskSnapshot>;
|
|
53
|
+
bindings: readonly ExistingExternalBindingSnapshot[];
|
|
54
|
+
receiptedCandidateIds: ReadonlySet<string>;
|
|
55
|
+
}): ExternalLifecycleCandidateSet;
|
|
56
|
+
//# sourceMappingURL=external-lifecycle-candidates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external-lifecycle-candidates.d.ts","sourceRoot":"","sources":["../../src/operator/external-lifecycle-candidates.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,6BAA6B,EAC7B,qBAAqB,EACrB,+BAA+B,EAC/B,6BAA6B,EAC7B,2BAA2B,EAC3B,uBAAuB,EACvB,2BAA2B,EAE3B,+BAA+B,EAC/B,cAAc,EACf,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EACV,6BAA6B,EAC7B,+BAA+B,EAC/B,2BAA2B,EAC3B,cAAc,GACf,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,qCAAqC,8FAQxC,CAAC;AA2BX,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,OAAO,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