@jungjaehoon/mama-os 0.58.0 → 0.59.0

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.
Files changed (72) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +1 -1
  3. package/dist/api/code-act-actions.d.ts +28 -0
  4. package/dist/api/code-act-actions.d.ts.map +1 -0
  5. package/dist/api/code-act-actions.js +216 -0
  6. package/dist/api/code-act-actions.js.map +1 -0
  7. package/dist/api/help-actions.d.ts +11 -3
  8. package/dist/api/help-actions.d.ts.map +1 -1
  9. package/dist/api/help-actions.js +172 -29
  10. package/dist/api/help-actions.js.map +1 -1
  11. package/dist/api/judge-actions.d.ts +25 -0
  12. package/dist/api/judge-actions.d.ts.map +1 -0
  13. package/dist/api/judge-actions.js +157 -0
  14. package/dist/api/judge-actions.js.map +1 -0
  15. package/dist/api/report-source-actions.d.ts.map +1 -1
  16. package/dist/api/report-source-actions.js +64 -12
  17. package/dist/api/report-source-actions.js.map +1 -1
  18. package/dist/api/viewer-server.d.ts.map +1 -1
  19. package/dist/api/viewer-server.js +29 -16
  20. package/dist/api/viewer-server.js.map +1 -1
  21. package/dist/api/work-actions.d.ts.map +1 -1
  22. package/dist/api/work-actions.js +110 -27
  23. package/dist/api/work-actions.js.map +1 -1
  24. package/dist/cli/commands/daemon.d.ts.map +1 -1
  25. package/dist/cli/commands/daemon.js +1 -0
  26. package/dist/cli/commands/daemon.js.map +1 -1
  27. package/dist/cli/commands/init.d.ts.map +1 -1
  28. package/dist/cli/commands/init.js +15 -1
  29. package/dist/cli/commands/init.js.map +1 -1
  30. package/dist/replay/jev-client.d.ts +5 -1
  31. package/dist/replay/jev-client.d.ts.map +1 -1
  32. package/dist/replay/jev-client.js +1 -0
  33. package/dist/replay/jev-client.js.map +1 -1
  34. package/dist/runtime/action-mcp-server.d.ts.map +1 -1
  35. package/dist/runtime/action-mcp-server.js +29 -7
  36. package/dist/runtime/action-mcp-server.js.map +1 -1
  37. package/dist/runtime/action-surface.d.ts +6 -1
  38. package/dist/runtime/action-surface.d.ts.map +1 -1
  39. package/dist/runtime/action-surface.js +25 -6
  40. package/dist/runtime/action-surface.js.map +1 -1
  41. package/dist/runtime/config.d.ts +2 -0
  42. package/dist/runtime/config.d.ts.map +1 -1
  43. package/dist/runtime/config.js +5 -1
  44. package/dist/runtime/config.js.map +1 -1
  45. package/dist/runtime/owner-runtime.d.ts +5 -0
  46. package/dist/runtime/owner-runtime.d.ts.map +1 -1
  47. package/dist/runtime/owner-runtime.js +31 -3
  48. package/dist/runtime/owner-runtime.js.map +1 -1
  49. package/dist/runtime/owner-system-prompt.d.ts +9 -5
  50. package/dist/runtime/owner-system-prompt.d.ts.map +1 -1
  51. package/dist/runtime/owner-system-prompt.js +88 -45
  52. package/dist/runtime/owner-system-prompt.js.map +1 -1
  53. package/dist/runtime/session-start-context.d.ts +23 -0
  54. package/dist/runtime/session-start-context.d.ts.map +1 -0
  55. package/dist/runtime/session-start-context.js +63 -0
  56. package/dist/runtime/session-start-context.js.map +1 -0
  57. package/dist/runtime/stimulus-delivery.d.ts +7 -3
  58. package/dist/runtime/stimulus-delivery.d.ts.map +1 -1
  59. package/dist/runtime/stimulus-delivery.js +16 -12
  60. package/dist/runtime/stimulus-delivery.js.map +1 -1
  61. package/dist/runtime/turn-orders.d.ts +42 -6
  62. package/dist/runtime/turn-orders.d.ts.map +1 -1
  63. package/dist/runtime/turn-orders.js +144 -32
  64. package/dist/runtime/turn-orders.js.map +1 -1
  65. package/dist/utils/untrusted-content.d.ts.map +1 -1
  66. package/dist/utils/untrusted-content.js +4 -1
  67. package/dist/utils/untrusted-content.js.map +1 -1
  68. package/package.json +1 -1
  69. package/dist/runtime/recent-owner-exchanges.d.ts +0 -8
  70. package/dist/runtime/recent-owner-exchanges.d.ts.map +0 -1
  71. package/dist/runtime/recent-owner-exchanges.js +0 -27
  72. package/dist/runtime/recent-owner-exchanges.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.58.1] - 2026-09-29
11
+
12
+ ### Changed
13
+
14
+ - Each owner action is listed with its arguments; `help` returns types, descriptions and examples
15
+ as text; the tool-use example shows a targeted, filtered read. See the root CHANGELOG.
16
+
10
17
  ## [0.58.0] - 2026-09-29
11
18
 
12
19
  The owner agent runs in the reference operator's structure: a short session start, lessons that
package/README.md CHANGED
@@ -4,7 +4,7 @@ One owner agent on Claude or Codex watches connected work, keeps task revisions
4
4
  answers on Telegram, publishes reports and a board, and recalls corrections.
5
5
  [mama-core](../mama-core/README.md) supplies the shared engine.
6
6
 
7
- Current manifest: **0.58.0**. This README describes the unreleased `rebuild/owner-flow` source.
7
+ Current manifest: **0.59.0**. This README describes the unreleased `rebuild/owner-flow` source.
8
8
  Use [owner setup](../../docs/start/owner-setup.md) with Node.js 22.13+ and pnpm.
9
9
 
10
10
  ## Start and operate
@@ -0,0 +1,28 @@
1
+ import type { ActionContract, ActionDispatcher, ActionRegistration } from '@jungjaehoon/mama-core';
2
+ export interface CodeActHost {
3
+ /** The action names the code may call, e.g. `work.list`. */
4
+ functions: readonly {
5
+ name: string;
6
+ }[];
7
+ call(name: string, input: unknown): Promise<unknown>;
8
+ }
9
+ export interface CodeActResult {
10
+ success: boolean;
11
+ value?: unknown;
12
+ error?: {
13
+ name: string;
14
+ message: string;
15
+ };
16
+ logs: string[];
17
+ hostCallCount: number;
18
+ durationMs: number;
19
+ }
20
+ /** Run the code in a fresh worker process; host calls are answered by `host.call`. */
21
+ export declare function runCodeAct(code: string, host: CodeActHost, timeoutMs?: number): Promise<CodeActResult>;
22
+ export declare const CODE_ACT_CONTRACT: ActionContract;
23
+ /**
24
+ * The code_act action over a dispatcher built after it: the functions are the actions the
25
+ * caller is granted, and each call is dispatched with the caller's own context.
26
+ */
27
+ export declare function codeActRegistration(dispatcher: () => ActionDispatcher): ActionRegistration;
28
+ //# sourceMappingURL=code-act-actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-act-actions.d.ts","sourceRoot":"","sources":["../../src/api/code-act-actions.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAEV,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,wBAAwB,CAAC;AAgEhC,MAAM,WAAW,WAAW;IAC1B,4DAA4D;IAC5D,SAAS,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACvC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACtD;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAID,sFAAsF;AACtF,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,WAAW,EACjB,SAAS,SAAqB,GAC7B,OAAO,CAAC,aAAa,CAAC,CA+FxB;AAED,eAAO,MAAM,iBAAiB,EAAE,cAiB/B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,gBAAgB,GAAG,kBAAkB,CAoC1F"}
@@ -0,0 +1,216 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CODE_ACT_CONTRACT = void 0;
4
+ exports.runCodeAct = runCodeAct;
5
+ exports.codeActRegistration = codeActRegistration;
6
+ /**
7
+ * code_act: the agent runs one piece of JavaScript that calls several actions, instead of
8
+ * one model round trip per action.
9
+ *
10
+ * Mechanism ported from Kagemusha's code-act sandbox and worker. The code runs in its own
11
+ * Node process; every action it calls is relayed over IPC to this process and dispatched
12
+ * with the calling turn's own context, so the grant, session and traces are the caller's.
13
+ * The worker runs under Node's permission model: `vm` gives the code a clean namespace but
14
+ * is not a boundary, and an escaped script must reach no files, processes or network.
15
+ */
16
+ const node_child_process_1 = require("node:child_process");
17
+ const WORKER_SOURCE = `
18
+ const vm = require('node:vm');
19
+ const pending = new Map();
20
+ let nextId = 0;
21
+ function callTool(name, params) {
22
+ const id = String(++nextId);
23
+ return new Promise((resolve, reject) => {
24
+ pending.set(id, { resolve, reject });
25
+ process.send({ type: 'callTool', id, name, params });
26
+ });
27
+ }
28
+ function assignNested(root, path, fn) {
29
+ let cursor = root;
30
+ for (let i = 0; i < path.length - 1; i++) {
31
+ if (!cursor[path[i]] || typeof cursor[path[i]] !== 'object') cursor[path[i]] = {};
32
+ cursor = cursor[path[i]];
33
+ }
34
+ cursor[path[path.length - 1]] = fn;
35
+ }
36
+ process.on('disconnect', () => process.exit(1));
37
+ process.on('message', async (msg) => {
38
+ if (msg.type === 'toolResult') {
39
+ const call = pending.get(msg.id);
40
+ if (!call) return;
41
+ pending.delete(msg.id);
42
+ if (msg.error !== undefined) call.reject(new Error(msg.error));
43
+ else call.resolve(msg.result);
44
+ return;
45
+ }
46
+ if (msg.type !== 'execute') return;
47
+ const logs = [];
48
+ const sandbox = {
49
+ console: { log: (...args) => logs.push(args.map((a) => (typeof a === 'string' ? a : JSON.stringify(a))).join(' ')) },
50
+ callTool,
51
+ };
52
+ for (const name of msg.functionNames) {
53
+ const proxy = (params) => callTool(name, params);
54
+ if (name.includes('.')) assignNested(sandbox, name.split('.'), proxy);
55
+ else sandbox[name] = proxy;
56
+ }
57
+ sandbox.globalThis = sandbox;
58
+ try {
59
+ const trimmed = msg.code.trim();
60
+ // A single line with no statement keyword is returned; its closing semicolon is dropped.
61
+ const expression = trimmed.replace(/;$/, '');
62
+ const needsReturn =
63
+ !expression.startsWith('return ') && !expression.startsWith('return\\n') && !expression.includes('\\n') &&
64
+ !/^(if|for|while|var|let|const|switch|try|throw|class|function)\\b/.test(expression);
65
+ const body = needsReturn ? 'return ' + expression : msg.code;
66
+ const script = new vm.Script('(async () => { ' + body + '\\n})()', { filename: 'code_act.js' });
67
+ const value = await script.runInContext(vm.createContext(sandbox), { timeout: msg.timeoutMs });
68
+ process.send({ type: 'result', success: true, value, logs }, () => process.exit(0));
69
+ } catch (error) {
70
+ process.send(
71
+ { type: 'result', success: false, logs, error: { name: error && error.name ? error.name : 'Error', message: error && error.message ? error.message : String(error) } },
72
+ () => process.exit(0)
73
+ );
74
+ }
75
+ });
76
+ process.send({ type: 'ready' });
77
+ `;
78
+ const DEFAULT_TIMEOUT_MS = 300_000;
79
+ /** Run the code in a fresh worker process; host calls are answered by `host.call`. */
80
+ function runCodeAct(code, host, timeoutMs = DEFAULT_TIMEOUT_MS) {
81
+ const startedAt = Date.now();
82
+ let hostCallCount = 0;
83
+ return new Promise((resolve) => {
84
+ // An empty environment: --permission does not guard process.env, and the daemon's holds
85
+ // MAMA's own credentials (auth.env), which an escaped script must not read.
86
+ const child = (0, node_child_process_1.spawn)(process.execPath, ['--permission', '-e', WORKER_SOURCE], {
87
+ stdio: ['ignore', 'ignore', 'pipe', 'ipc'],
88
+ env: {},
89
+ });
90
+ let stderr = '';
91
+ let settled = false;
92
+ const settle = (result) => {
93
+ if (settled)
94
+ return;
95
+ settled = true;
96
+ clearTimeout(timer);
97
+ child.kill('SIGKILL');
98
+ resolve({ ...result, hostCallCount, durationMs: Date.now() - startedAt });
99
+ };
100
+ const timer = setTimeout(() => settle({
101
+ success: false,
102
+ error: { name: 'TimeoutError', message: `code_act timed out after ${timeoutMs}ms` },
103
+ logs: [],
104
+ }), timeoutMs);
105
+ child.stderr.on('data', (chunk) => {
106
+ // Keep the tail only: an escaped script could write to stderr for the whole timeout.
107
+ stderr = (stderr + chunk.toString('utf8')).slice(-2000);
108
+ });
109
+ child.on('message', async (msg) => {
110
+ if (msg.type === 'ready') {
111
+ child.send({
112
+ type: 'execute',
113
+ code,
114
+ functionNames: host.functions.map((fn) => fn.name),
115
+ timeoutMs,
116
+ });
117
+ return;
118
+ }
119
+ if (msg.type === 'callTool') {
120
+ // A call that arrives after a timeout must not start an action nobody will see.
121
+ if (settled)
122
+ return;
123
+ hostCallCount += 1;
124
+ try {
125
+ const result = await host.call(msg.name, msg.params);
126
+ if (child.connected)
127
+ child.send({ type: 'toolResult', id: msg.id, result });
128
+ }
129
+ catch (error) {
130
+ if (child.connected)
131
+ child.send({
132
+ type: 'toolResult',
133
+ id: msg.id,
134
+ error: error instanceof Error ? error.message : String(error),
135
+ });
136
+ }
137
+ return;
138
+ }
139
+ if (msg.type === 'result') {
140
+ settle(msg.success
141
+ ? { success: true, value: msg.value, logs: msg.logs ?? [] }
142
+ : { success: false, error: msg.error, logs: msg.logs ?? [] });
143
+ }
144
+ });
145
+ child.on('error', (error) => settle({ success: false, error: { name: 'WorkerError', message: error.message }, logs: [] }));
146
+ child.on('exit', (exitCode, signal) => {
147
+ // A clean exit follows the result message; anything else lost the result.
148
+ if (exitCode === 0 && signal === null)
149
+ return;
150
+ settle({
151
+ success: false,
152
+ error: {
153
+ name: 'WorkerError',
154
+ message: `code_act worker exited (code=${exitCode}, signal=${signal})${stderr ? `: ${stderr.trim().slice(0, 500)}` : ''}`,
155
+ },
156
+ logs: [],
157
+ });
158
+ });
159
+ });
160
+ }
161
+ exports.CODE_ACT_CONTRACT = {
162
+ name: 'code_act',
163
+ summary: 'Run JavaScript that calls MAMA actions and returns only what the turn needs. Every action is an async function by its name, e.g. `return (await work.list({ view: "items", text: "asset" })).tasks.map((task) => [task.title, task.status])`; a failed action throws with its error; independent calls go together with `Promise.all`; `help({ actions: ["work.revise"] })` returns an action\'s argument types and examples; a name with a colon is called as `memory["read:provenance"]({...})`. The code runs in a separate process with no file or process access and an empty environment; its return value, console.log lines and any error come back.',
164
+ inputSchema: {
165
+ type: 'object',
166
+ additionalProperties: false,
167
+ required: ['code'],
168
+ properties: {
169
+ code: {
170
+ type: 'string',
171
+ minLength: 1,
172
+ description: 'The body of an async function, e.g. const [recent, days] = await Promise.all([source.recent({ since: "24h ago" }), schedule.upcoming({ days: 14 })]); return { channels: recent.channels.length, events: days.events.length };',
173
+ },
174
+ },
175
+ },
176
+ };
177
+ /**
178
+ * The code_act action over a dispatcher built after it: the functions are the actions the
179
+ * caller is granted, and each call is dispatched with the caller's own context.
180
+ */
181
+ function codeActRegistration(dispatcher) {
182
+ return {
183
+ contract: exports.CODE_ACT_CONTRACT,
184
+ exec: async (input, context) => {
185
+ const dispatch = dispatcher();
186
+ const granted = new Set(context.access.actions ?? []);
187
+ const functions = dispatch.contracts
188
+ .filter((contract) => contract.name !== exports.CODE_ACT_CONTRACT.name && granted.has(contract.name))
189
+ .map((contract) => ({ name: contract.name }));
190
+ // Inner writes take their command ids from this one; without it two calls would collide.
191
+ const operationId = context.operationId;
192
+ if (!operationId)
193
+ throw new Error('code_act requires an operation id');
194
+ const callable = new Set(functions.map((fn) => fn.name));
195
+ let calls = 0;
196
+ return runCodeAct(input.code, {
197
+ functions,
198
+ call: async (name, params) => {
199
+ // callTool() takes any name; code_act itself would start a worker inside a worker.
200
+ if (!callable.has(name))
201
+ throw new Error(`action_not_granted: ${name}`);
202
+ calls += 1;
203
+ const result = await dispatch({
204
+ action: name,
205
+ input: params ?? {},
206
+ operationId: `${operationId}#${calls}`,
207
+ }, context);
208
+ if (result.status === 'completed')
209
+ return result.data;
210
+ throw new Error(`${result.error.code}: ${result.error.message}`);
211
+ },
212
+ });
213
+ },
214
+ };
215
+ }
216
+ //# sourceMappingURL=code-act-actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-act-actions.js","sourceRoot":"","sources":["../../src/api/code-act-actions.ts"],"names":[],"mappings":";;;AAkGA,gCAmGC;AAyBD,kDAoCC;AAlQD;;;;;;;;;GASG;AACH,2DAA2C;AAQ3C,MAAM,aA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AG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;YACzD,IAAI,KAAK,GAAG,CAAC,CAAC;YACd,OAAO,UAAU,CAAE,KAA0B,CAAC,IAAI,EAAE;gBAClD,SAAS;gBACT,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;oBAC3B,mFAAmF;oBACnF,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;wBAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC;oBACxE,KAAK,IAAI,CAAC,CAAC;oBACX,MAAM,MAAM,GAAG,MAAM,QAAQ,CAC3B;wBACE,MAAM,EAAE,IAAI;wBACZ,KAAK,EAAE,MAAM,IAAI,EAAE;wBACnB,WAAW,EAAE,GAAG,WAAW,IAAI,KAAK,EAAE;qBACvC,EACD,OAAO,CACR,CAAC;oBACF,IAAI,MAAM,CAAC,MAAM,KAAK,WAAW;wBAAE,OAAO,MAAM,CAAC,IAAI,CAAC;oBACtD,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;gBACnE,CAAC;aACF,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,12 +1,20 @@
1
1
  import type { ActionContract, ActionRegistration } from '@jungjaehoon/mama-core';
2
2
  /**
3
- * The first sentence of an action's summary: what every turn shows for it. The full contract is
4
- * one `help` call away, as Kagemusha keeps a one-line catalog and serves detail through `help()`.
3
+ * The argument list the agent calls with, as Kagemusha's code_act description lists
4
+ * `task_update({id, status, priority, deadline})`: top-level names, `?` for optional ones, the
5
+ * allowed values of a plain enum and the bound of a number, list or text.
5
6
  */
6
- export declare function actionCatalogLine(summary: string): string;
7
+ export declare function actionSignature(inputSchema: unknown): string;
8
+ /**
9
+ * What every turn shows for an action: its name and first sentence, an index entry. The
10
+ * arguments come from help({actions: [name]}) when the agent is about to call it.
11
+ */
12
+ export declare function actionCatalogLine(contract: Pick<ActionContract, 'name' | 'summary'>): string;
7
13
  export interface HelpActionPorts {
8
14
  /** The granted contracts, read when `help` runs so it sees the finished catalog. */
9
15
  contracts(): readonly ActionContract[];
16
+ /** The procedures a turn reads when it needs one, by topic name. */
17
+ topics?(): Readonly<Record<string, string>>;
10
18
  }
11
19
  export declare function helpActionRegistrations(ports: HelpActionPorts): ActionRegistration[];
12
20
  //# sourceMappingURL=help-actions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"help-actions.d.ts","sourceRoot":"","sources":["../../src/api/help-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKzD;AAQD,MAAM,WAAW,eAAe;IAC9B,oFAAoF;IACpF,SAAS,IAAI,SAAS,cAAc,EAAE,CAAC;CACxC;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,eAAe,GAAG,kBAAkB,EAAE,CAiDpF"}
1
+ {"version":3,"file":"help-actions.d.ts","sourceRoot":"","sources":["../../src/api/help-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AA8DjF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,CAU5D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,CAE5F;AA2ED,MAAM,WAAW,eAAe;IAC9B,oFAAoF;IACpF,SAAS,IAAI,SAAS,cAAc,EAAE,CAAC;IACvC,oEAAoE;IACpE,MAAM,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC7C;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,eAAe,GAAG,kBAAkB,EAAE,CAiEpF"}
@@ -1,17 +1,149 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.actionSignature = actionSignature;
3
4
  exports.actionCatalogLine = actionCatalogLine;
4
5
  exports.helpActionRegistrations = helpActionRegistrations;
5
- /**
6
- * The first sentence of an action's summary: what every turn shows for it. The full contract is
7
- * one `help` call away, as Kagemusha keeps a one-line catalog and serves detail through `help()`.
8
- */
9
- function actionCatalogLine(summary) {
6
+ function asSchema(value) {
7
+ return value !== null && typeof value === 'object' && !Array.isArray(value)
8
+ ? value
9
+ : null;
10
+ }
11
+ function firstSentence(summary) {
10
12
  const flat = summary.replace(/\s+/g, ' ').trim();
11
13
  const end = flat.search(/[.!?](\s|$)/);
12
14
  const first = end === -1 ? flat : flat.slice(0, end + 1);
13
15
  return first.length <= 160 ? first : `${first.slice(0, 157)}...`;
14
16
  }
17
+ /** Top-level arguments in schema order, required ones first; `?` marks an optional one. */
18
+ function orderedProperties(schema) {
19
+ const properties = asSchema(schema.properties);
20
+ if (!properties)
21
+ return [];
22
+ const required = new Set(Array.isArray(schema.required) ? schema.required : []);
23
+ const entries = Object.entries(properties);
24
+ return [
25
+ ...entries.filter(([name]) => required.has(name)).map(([name, value]) => [name, value, true]),
26
+ ...entries.filter(([name]) => !required.has(name)).map(([name, value]) => [name, value, false]),
27
+ ];
28
+ }
29
+ function enumText(schema) {
30
+ if ('const' in schema)
31
+ return JSON.stringify(schema.const);
32
+ return Array.isArray(schema.enum)
33
+ ? schema.enum.map((value) => JSON.stringify(value)).join('|')
34
+ : null;
35
+ }
36
+ /**
37
+ * The argument sets a top-level `oneOf`/`anyOf` requires, e.g. `observationRef | observationRefs`
38
+ * for `source.read`, when each alternative only names required arguments.
39
+ */
40
+ function requiredChoice(schema) {
41
+ const alternatives = Array.isArray(schema.oneOf) ? schema.oneOf : schema.anyOf;
42
+ if (!Array.isArray(alternatives))
43
+ return null;
44
+ const sets = alternatives.map((alternative) => {
45
+ const required = asSchema(alternative)?.required;
46
+ return Array.isArray(required) && required.length > 0 ? required.join(' + ') : null;
47
+ });
48
+ return sets.every((set) => set !== null) ? sets.join(' | ') : null;
49
+ }
50
+ /**
51
+ * The bound a caller cannot guess from the name, e.g. `≤50` for a limit, `≤4 items` for a list or
52
+ * `≤1024 chars` for a caption:
53
+ * on the first live day the agent sent `limit: 100` to `work.list`, whose maximum is 50.
54
+ */
55
+ function boundText(schema) {
56
+ if (typeof schema.maximum === 'number')
57
+ return `≤${schema.maximum}`;
58
+ if (typeof schema.maxItems === 'number')
59
+ return `≤${schema.maxItems} items`;
60
+ if (typeof schema.maxLength === 'number')
61
+ return `≤${schema.maxLength} chars`;
62
+ return null;
63
+ }
64
+ /**
65
+ * The argument list the agent calls with, as Kagemusha's code_act description lists
66
+ * `task_update({id, status, priority, deadline})`: top-level names, `?` for optional ones, the
67
+ * allowed values of a plain enum and the bound of a number, list or text.
68
+ */
69
+ function actionSignature(inputSchema) {
70
+ const schema = asSchema(inputSchema);
71
+ if (!schema)
72
+ return '{}';
73
+ const parts = orderedProperties(schema).map(([name, value, required]) => {
74
+ const property = asSchema(value);
75
+ const detail = property ? (enumText(property) ?? boundText(property)) : null;
76
+ return `${name}${required ? '' : '?'}${detail ? `: ${detail}` : ''}`;
77
+ });
78
+ const choice = requiredChoice(schema);
79
+ return `{${parts.join(', ')}${choice ? `; one of: ${choice}` : ''}}`;
80
+ }
81
+ /**
82
+ * What every turn shows for an action: its name and first sentence, an index entry. The
83
+ * arguments come from help({actions: [name]}) when the agent is about to call it.
84
+ */
85
+ function actionCatalogLine(contract) {
86
+ return `${contract.name} — ${firstSentence(contract.summary)}`;
87
+ }
88
+ function typeText(value, depth) {
89
+ const schema = asSchema(value);
90
+ if (!schema)
91
+ return 'any';
92
+ const values = enumText(schema);
93
+ if (values)
94
+ return values;
95
+ const alternatives = Array.isArray(schema.oneOf) ? schema.oneOf : schema.anyOf;
96
+ if (Array.isArray(alternatives))
97
+ return alternatives.map((alternative) => typeText(alternative, depth)).join(' | ');
98
+ if (Array.isArray(schema.type))
99
+ return schema.type.join(' | ');
100
+ if (schema.type === 'array') {
101
+ const item = typeText(schema.items, depth);
102
+ return `${/[ |]/.test(item) ? `(${item})` : item}[]`;
103
+ }
104
+ if (schema.type === 'object' || schema.properties !== undefined) {
105
+ const properties = orderedProperties(schema);
106
+ // Two levels show an argument's shape; deeper parts are named `object`, and the argument's
107
+ // description gives an example of the whole value. Keeping help short is what help is for.
108
+ if (properties.length === 0 || depth >= 3)
109
+ return 'object';
110
+ return `{${properties
111
+ .map(([name, property, required]) => `${name}${required ? '' : '?'}: ${typeText(property, depth + 1)}`)
112
+ .join(', ')}}`;
113
+ }
114
+ return typeof schema.type === 'string' ? schema.type : 'any';
115
+ }
116
+ const items = (count) => `${count} item${count === 1 ? '' : 's'}`;
117
+ /** The limits the dispatcher enforces on one argument, e.g. ` (at most 4 items)`. */
118
+ function limitsText(value) {
119
+ const schema = asSchema(value);
120
+ if (!schema)
121
+ return '';
122
+ const limits = [
123
+ typeof schema.minItems === 'number' ? `at least ${items(schema.minItems)}` : null,
124
+ typeof schema.maxItems === 'number' ? `at most ${items(schema.maxItems)}` : null,
125
+ typeof schema.minimum === 'number' ? `min ${schema.minimum}` : null,
126
+ typeof schema.maximum === 'number' ? `max ${schema.maximum}` : null,
127
+ typeof schema.maxLength === 'number' ? `at most ${schema.maxLength} chars` : null,
128
+ typeof schema.pattern === 'string' ? `pattern ${schema.pattern}` : null,
129
+ ].filter((limit) => limit !== null);
130
+ return limits.length === 0 ? '' : ` (${limits.join(', ')})`;
131
+ }
132
+ /** One action's contract as plain lines: signature, summary, each argument and the examples. */
133
+ function helpText(contract) {
134
+ const schema = asSchema(contract.inputSchema) ?? {};
135
+ const lines = [`${contract.name}(${actionSignature(schema)})`, contract.summary];
136
+ for (const [name, property, required] of orderedProperties(schema)) {
137
+ const description = asSchema(property)?.description;
138
+ lines.push(`- ${name}${required ? ' (required)' : ''}: ${typeText(property, 1)}${limitsText(property)}${typeof description === 'string' ? `. ${description}` : ''}`);
139
+ }
140
+ const alternatives = [schema.oneOf, schema.anyOf].find(Array.isArray);
141
+ if (alternatives)
142
+ lines.push(`- one of: ${requiredChoice(schema) ?? alternatives.map((alternative) => typeText(alternative, 1)).join(' | ')}`);
143
+ for (const example of contract.examples ?? [])
144
+ lines.push(`example (${example.title}): ${JSON.stringify(example.input)}`);
145
+ return lines.join('\n');
146
+ }
15
147
  function invalidInput(message) {
16
148
  const error = new Error(message);
17
149
  error.name = 'invalid_input';
@@ -22,47 +154,58 @@ function helpActionRegistrations(ports) {
22
154
  {
23
155
  contract: {
24
156
  name: 'help',
25
- summary: "Read actions' full contracts (summary, input schema, examples) before first use; with no names, list every action with its one-line summary.",
157
+ summary: "Read what you need next, one level at a time: several actions give each one's call signature (arguments, allowed values, bounds) and purpose; one action gives its whole contract with argument descriptions and examples; a topic gives a procedure; with neither, list the topics and actions.",
26
158
  inputSchema: {
27
159
  type: 'object',
28
160
  additionalProperties: false,
29
161
  properties: {
30
- actions: { type: 'array', items: { type: 'string', minLength: 1 } },
162
+ actions: { type: 'array', minItems: 1, items: { type: 'string', minLength: 1 } },
163
+ topic: { type: 'string', minLength: 1 },
31
164
  },
32
165
  },
33
166
  examples: [
34
- { title: 'Read two contracts', input: { actions: ['work.list', 'report.publish'] } },
167
+ { title: 'Read one contract', input: { actions: ['report.publish'] } },
168
+ { title: 'Read a procedure', input: { topic: 'full-report' } },
35
169
  ],
36
170
  },
37
171
  exec: (input) => {
38
- const requested = input.actions;
172
+ const { actions: requested, topic } = input;
39
173
  const contracts = ports.contracts();
40
- if (requested === undefined)
41
- return {
42
- actions: contracts.map((contract) => ({
43
- name: contract.name,
44
- summary: actionCatalogLine(contract.summary),
45
- })),
46
- };
174
+ const topics = ports.topics?.() ?? {};
175
+ const parts = [];
176
+ if (topic !== undefined) {
177
+ const text = typeof topic === 'string' && Object.hasOwn(topics, topic) ? topics[topic] : undefined;
178
+ if (text === undefined)
179
+ throw invalidInput(`unknown topic: ${String(topic)}; topics: ${Object.keys(topics).join(', ')}`);
180
+ parts.push(text);
181
+ }
182
+ if (requested === undefined) {
183
+ if (topic !== undefined)
184
+ return parts.join('\n\n');
185
+ return [
186
+ `Topics: ${Object.keys(topics).join(', ')}`,
187
+ 'Actions:',
188
+ ...contracts.map(actionCatalogLine),
189
+ ].join('\n');
190
+ }
47
191
  if (!Array.isArray(requested))
48
192
  throw invalidInput('actions must be a list of action names');
49
- // The model sees tools.work_list (Codex) or mcp__mama__work_list (Claude); both name work.list.
50
- const key = (name) => name.replace(/^mcp__mama__/, '').replace(/[.:]/g, '_');
193
+ // Codex sees tools.work_list and Claude calls work.list inside code_act; both name work.list.
194
+ const key = (name) => name.replace(/[.:]/g, '_');
51
195
  const byName = new Map(contracts.map((contract) => [key(contract.name), contract]));
52
196
  const unknown = requested.filter((name) => !byName.has(key(String(name))));
53
197
  if (unknown.length > 0)
54
198
  throw invalidInput(`unknown actions: ${unknown.join(', ')}`);
55
- return {
56
- actions: requested.map((name) => {
57
- const contract = byName.get(key(String(name)));
58
- return {
59
- name: contract.name,
60
- summary: contract.summary,
61
- inputSchema: contract.inputSchema,
62
- ...(contract.examples === undefined ? {} : { examples: contract.examples }),
63
- };
64
- }),
65
- };
199
+ const asked = requested.map((name) => byName.get(key(String(name))));
200
+ // One level at a time: several actions give their call lines; one gives its contract.
201
+ if (asked.length === 1)
202
+ parts.push(helpText(asked[0]));
203
+ else
204
+ parts.push([
205
+ ...asked.map((contract) => `${contract.name}(${actionSignature(contract.inputSchema)}) — ${firstSentence(contract.summary)}`),
206
+ 'Ask for one action by itself for its argument descriptions and examples.',
207
+ ].join('\n'));
208
+ return parts.join('\n\n');
66
209
  },
67
210
  },
68
211
  ];
@@ -1 +1 @@
1
- {"version":3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OAAO,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CACpG;wBACD,0EAA0E;qBAC3E,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;gBACJ,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC5B,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { ActionRegistration } from '@jungjaehoon/mama-core';
2
+ import type { JevQuestions } from '../replay/jev-client.js';
3
+ /** The Jev call the action makes; the daemon passes the configured client. */
4
+ export interface JudgePorts {
5
+ ask(request: {
6
+ state: unknown;
7
+ questions: JevQuestions;
8
+ /** The turn's signal: a cancelled turn cancels its Jev request. */
9
+ signal?: AbortSignal;
10
+ }): Promise<Record<string, unknown>>;
11
+ }
12
+ /**
13
+ * The most state one call may carry. Jev's documented rough edge: accuracy falls when the state
14
+ * holds details unrelated to the question. On 2026-09-29 the agent put the whole open ledger in
15
+ * each of 24 calls and read their unfiltered results back; one item's record and its few messages
16
+ * fit well inside this.
17
+ */
18
+ export declare const JUDGE_STATE_LIMIT = 6000;
19
+ /**
20
+ * Jev as the agent's own filter: a script reads many candidates, asks narrow typed questions and
21
+ * returns only the ones that matter, so the rows never enter the model's context. The agent writes
22
+ * the questions and weighs the answers; the host only carries them to Jev.
23
+ */
24
+ export declare function judgeActionRegistrations(ports: JudgePorts): ActionRegistration[];
25
+ //# sourceMappingURL=judge-actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"judge-actions.d.ts","sourceRoot":"","sources":["../../src/api/judge-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,8EAA8E;AAC9E,MAAM,WAAW,UAAU;IACzB,GAAG,CAAC,OAAO,EAAE;QACX,KAAK,EAAE,OAAO,CAAC;QACf,SAAS,EAAE,YAAY,CAAC;QACxB,mEAAmE;QACnE,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACtC;AAID;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,OAAQ,CAAC;AAYvC;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,UAAU,GAAG,kBAAkB,EAAE,CA0IhF"}