@jungjaehoon/mama-os 0.47.1 → 0.48.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.
- package/dist/agent/agent-loop.d.ts.map +1 -1
- package/dist/agent/agent-loop.js +9 -11
- package/dist/agent/agent-loop.js.map +1 -1
- package/dist/agent/code-act/constants.d.ts +2 -1
- package/dist/agent/code-act/constants.d.ts.map +1 -1
- package/dist/agent/code-act/constants.js +27 -92
- package/dist/agent/code-act/constants.js.map +1 -1
- package/dist/agent/code-act/host-bridge.d.ts +2 -1
- package/dist/agent/code-act/host-bridge.d.ts.map +1 -1
- package/dist/agent/code-act/host-bridge.js +225 -27
- package/dist/agent/code-act/host-bridge.js.map +1 -1
- package/dist/agent/code-act/sandbox.d.ts.map +1 -1
- package/dist/agent/code-act/sandbox.js +6 -2
- package/dist/agent/code-act/sandbox.js.map +1 -1
- package/dist/agent/code-act/tool-catalog.d.ts +28 -0
- package/dist/agent/code-act/tool-catalog.d.ts.map +1 -0
- package/dist/agent/code-act/tool-catalog.js +146 -0
- package/dist/agent/code-act/tool-catalog.js.map +1 -0
- package/dist/agent/code-act/tool-policy.d.ts +2 -1
- package/dist/agent/code-act/tool-policy.d.ts.map +1 -1
- package/dist/agent/code-act/tool-policy.js +2 -1
- package/dist/agent/code-act/tool-policy.js.map +1 -1
- package/dist/agent/code-act/type-definition-generator.d.ts +6 -0
- package/dist/agent/code-act/type-definition-generator.d.ts.map +1 -1
- package/dist/agent/code-act/type-definition-generator.js +40 -21
- package/dist/agent/code-act/type-definition-generator.js.map +1 -1
- package/dist/agent/gateway-tool-executor.d.ts +6 -0
- package/dist/agent/gateway-tool-executor.d.ts.map +1 -1
- package/dist/agent/gateway-tool-executor.js +81 -58
- package/dist/agent/gateway-tool-executor.js.map +1 -1
- package/dist/agent/gateway-tools.md +5 -5
- package/dist/agent/tool-registry.d.ts.map +1 -1
- package/dist/agent/tool-registry.js +10 -10
- package/dist/agent/tool-registry.js.map +1 -1
- package/dist/api/graph-api-types.d.ts +3 -0
- package/dist/api/graph-api-types.d.ts.map +1 -1
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +7 -0
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/runtime/code-act-executor.d.ts.map +1 -1
- package/dist/cli/runtime/code-act-executor.js +5 -0
- package/dist/cli/runtime/code-act-executor.js.map +1 -1
- package/dist/connectors/kagemusha/query-tools.d.ts +57 -0
- package/dist/connectors/kagemusha/query-tools.d.ts.map +1 -1
- package/dist/connectors/kagemusha/query-tools.js +247 -0
- package/dist/connectors/kagemusha/query-tools.js.map +1 -1
- package/dist/connectors/private-connector-policy.d.ts +32 -6
- package/dist/connectors/private-connector-policy.d.ts.map +1 -1
- package/dist/connectors/private-connector-policy.js +40 -5
- package/dist/connectors/private-connector-policy.js.map +1 -1
- package/dist/connectors/trello/query-tools.d.ts +148 -16
- package/dist/connectors/trello/query-tools.d.ts.map +1 -1
- package/dist/connectors/trello/query-tools.js +453 -65
- package/dist/connectors/trello/query-tools.js.map +1 -1
- package/dist/mcp/code-act-api-client.d.ts +1 -0
- package/dist/mcp/code-act-api-client.d.ts.map +1 -1
- package/dist/mcp/code-act-api-client.js.map +1 -1
- package/dist/mcp/code-act-server.js +6 -5
- package/dist/mcp/code-act-server.js.map +1 -1
- package/dist/mcp/code-act-terminal-transport.d.ts +2 -0
- package/dist/mcp/code-act-terminal-transport.d.ts.map +1 -1
- package/dist/mcp/code-act-terminal-transport.js +18 -6
- package/dist/mcp/code-act-terminal-transport.js.map +1 -1
- package/dist/multi-agent/agent-process-manager.d.ts.map +1 -1
- package/dist/multi-agent/agent-process-manager.js +1 -5
- package/dist/multi-agent/agent-process-manager.js.map +1 -1
- package/dist/operator/board-read-views.d.ts +49 -0
- package/dist/operator/board-read-views.d.ts.map +1 -0
- package/dist/operator/board-read-views.js +207 -0
- package/dist/operator/board-read-views.js.map +1 -0
- package/dist/operator/task-ledger.d.ts +85 -0
- package/dist/operator/task-ledger.d.ts.map +1 -1
- package/dist/operator/task-ledger.js +128 -0
- package/dist/operator/task-ledger.js.map +1 -1
- package/dist/operator/task-list-views.d.ts +91 -0
- package/dist/operator/task-list-views.d.ts.map +1 -0
- package/dist/operator/task-list-views.js +483 -0
- package/dist/operator/task-list-views.js.map +1 -0
- package/dist/operator/workorder-consumer.js +1 -1
- package/dist/operator/workorder-consumer.js.map +1 -1
- package/dist/sqlite.d.ts +7 -0
- package/dist/sqlite.d.ts.map +1 -1
- package/dist/sqlite.js +8 -0
- package/dist/sqlite.js.map +1 -1
- package/package.json +2 -1
|
@@ -49,6 +49,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
49
49
|
};
|
|
50
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
51
|
exports.GatewayToolExecutor = void 0;
|
|
52
|
+
exports.serializeCodeActModelResult = serializeCodeActModelResult;
|
|
52
53
|
const fs_1 = require("fs");
|
|
53
54
|
const async_hooks_1 = require("async_hooks");
|
|
54
55
|
const crypto_1 = require("crypto");
|
|
@@ -81,6 +82,8 @@ const agent_store_js_1 = require("../db/agent-store.js");
|
|
|
81
82
|
const index_js_1 = require("../envelope/index.js");
|
|
82
83
|
const wiki_publish_adapter_js_1 = require("../wiki-artifacts/wiki-publish-adapter.js");
|
|
83
84
|
const changes_projection_js_1 = require("../operator/changes-projection.js");
|
|
85
|
+
const task_list_views_js_1 = require("../operator/task-list-views.js");
|
|
86
|
+
const board_read_views_js_1 = require("../operator/board-read-views.js");
|
|
84
87
|
const read_js_1 = require("../evidence/read.js");
|
|
85
88
|
const private_connector_policy_js_1 = require("../connectors/private-connector-policy.js");
|
|
86
89
|
const member_candidate_store_js_1 = require("../gateways/member-candidate-store.js");
|
|
@@ -93,19 +96,6 @@ const DEFAULT_PRIVATE_CONNECTOR_POLICY = (0, private_connector_policy_js_1.resol
|
|
|
93
96
|
function isReportPublishResult(value) {
|
|
94
97
|
return value !== undefined && !Array.isArray(value);
|
|
95
98
|
}
|
|
96
|
-
function serializeTaskToolRecord(task) {
|
|
97
|
-
return {
|
|
98
|
-
...task,
|
|
99
|
-
due_at: task.dueAt === null ? null : new Date(task.dueAt).toISOString(),
|
|
100
|
-
deadline_offset_minutes: task.deadlineOffsetMinutes,
|
|
101
|
-
temporal_epoch: task.temporalEpoch,
|
|
102
|
-
temporal_reconciled_occurrence_key: task.temporalReconciledOccurrenceKey,
|
|
103
|
-
last_temporal_checked_at: task.lastTemporalCheckedAt,
|
|
104
|
-
next_temporal_check_at: task.nextTemporalCheckAt,
|
|
105
|
-
last_temporal_attempt_id: task.lastTemporalAttemptId,
|
|
106
|
-
temporal_state: task.temporalState,
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
99
|
function temporalContextPacketBinding(context) {
|
|
110
100
|
return `temporal:${context.taskId}:${context.generationKey}`;
|
|
111
101
|
}
|
|
@@ -255,6 +245,30 @@ const OWNER_CONSOLE_MEMBER_TOOLS = new Set([
|
|
|
255
245
|
]);
|
|
256
246
|
class ContextPacketProvenanceError extends Error {
|
|
257
247
|
}
|
|
248
|
+
/**
|
|
249
|
+
* Compact model boundary for Code-Act; internal receipts retain the richer result object.
|
|
250
|
+
* The JSON root (success, audit ledger, terminal codes) stays machine-readable; when the run
|
|
251
|
+
* read external evidence only the value/logs payload is fenced as untrusted data.
|
|
252
|
+
*/
|
|
253
|
+
function serializeCodeActModelResult(result) {
|
|
254
|
+
const record = result;
|
|
255
|
+
const { message, untrustedExternalEvidence, value, logs, ...modelResult } = record;
|
|
256
|
+
if (typeof message === 'string' && value === undefined && typeof modelResult.error !== 'string') {
|
|
257
|
+
modelResult.message = message;
|
|
258
|
+
}
|
|
259
|
+
const payload = {
|
|
260
|
+
...(value !== undefined ? { value } : {}),
|
|
261
|
+
...(logs !== undefined ? { logs } : {}),
|
|
262
|
+
};
|
|
263
|
+
if (untrustedExternalEvidence === true) {
|
|
264
|
+
return JSON.stringify({
|
|
265
|
+
...modelResult,
|
|
266
|
+
untrustedExternalEvidence: true,
|
|
267
|
+
payload: (0, untrusted_content_js_1.wrapUntrustedContent)('external-evidence-code-act', JSON.stringify(payload)),
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
return JSON.stringify({ ...modelResult, ...payload });
|
|
271
|
+
}
|
|
258
272
|
function asRecord(value) {
|
|
259
273
|
return value && typeof value === 'object' && !Array.isArray(value)
|
|
260
274
|
? value
|
|
@@ -2522,8 +2536,9 @@ class GatewayToolExecutor {
|
|
|
2522
2536
|
error: 'Report store not wired (board_read requires the API server report store).',
|
|
2523
2537
|
};
|
|
2524
2538
|
}
|
|
2525
|
-
|
|
2526
|
-
|
|
2539
|
+
// Default returns slot descriptors only; a named slot pages its text/html
|
|
2540
|
+
// by code points so a long slot is fully reachable, never silently sliced.
|
|
2541
|
+
return (0, board_read_views_js_1.readBoardView)(input, this.reportReader());
|
|
2527
2542
|
}
|
|
2528
2543
|
case 'audit_findings_read': {
|
|
2529
2544
|
const auditStatePath = (0, path_1.join)(process.env.HOME || (0, os_1.homedir)(), '.mama', 'state', 'audit-findings.json');
|
|
@@ -2618,14 +2633,17 @@ class GatewayToolExecutor {
|
|
|
2618
2633
|
// kagemusha_*: state questions read the source live, never the
|
|
2619
2634
|
// connector change-log projection (2026-07-24 incident chain).
|
|
2620
2635
|
case 'trello_search': {
|
|
2621
|
-
const {
|
|
2636
|
+
const { searchTrelloBoardCards } = await import('../connectors/trello/query-tools.js');
|
|
2622
2637
|
const searchInput = input;
|
|
2623
2638
|
try {
|
|
2624
|
-
|
|
2639
|
+
// Progressive: honest full match total + continuation + per-board coverage,
|
|
2640
|
+
// not a hidden 20-result cap. Paged over the cached board snapshot.
|
|
2641
|
+
const page = await searchTrelloBoardCards({
|
|
2625
2642
|
query: searchInput.query ?? '',
|
|
2626
2643
|
limit: searchInput.limit,
|
|
2644
|
+
cursor: searchInput.cursor,
|
|
2627
2645
|
});
|
|
2628
|
-
return { success: true,
|
|
2646
|
+
return { success: true, ...page };
|
|
2629
2647
|
}
|
|
2630
2648
|
catch (err) {
|
|
2631
2649
|
return {
|
|
@@ -2636,10 +2654,19 @@ class GatewayToolExecutor {
|
|
|
2636
2654
|
}
|
|
2637
2655
|
}
|
|
2638
2656
|
case 'trello_card': {
|
|
2639
|
-
const {
|
|
2657
|
+
const { getTrelloCardDetail } = await import('../connectors/trello/query-tools.js');
|
|
2640
2658
|
const cardInput = input;
|
|
2641
2659
|
try {
|
|
2642
|
-
|
|
2660
|
+
// Sectioned detail (summary|description|checklists|checklist_items) with
|
|
2661
|
+
// explicit continuation; the board allowlist is enforced before any field.
|
|
2662
|
+
const card = await getTrelloCardDetail({
|
|
2663
|
+
cardId: cardInput.cardId ?? '',
|
|
2664
|
+
section: cardInput.section,
|
|
2665
|
+
offset: cardInput.offset,
|
|
2666
|
+
limit: cardInput.limit,
|
|
2667
|
+
checklistId: cardInput.checklistId,
|
|
2668
|
+
readVersion: cardInput.readVersion,
|
|
2669
|
+
});
|
|
2643
2670
|
return { success: true, card };
|
|
2644
2671
|
}
|
|
2645
2672
|
catch (err) {
|
|
@@ -2651,16 +2678,23 @@ class GatewayToolExecutor {
|
|
|
2651
2678
|
}
|
|
2652
2679
|
}
|
|
2653
2680
|
case 'trello_kanban': {
|
|
2654
|
-
const {
|
|
2681
|
+
const { getTrelloBoardsOverview, getTrelloListCards } = await import('../connectors/trello/query-tools.js');
|
|
2655
2682
|
const kanbanInput = input;
|
|
2656
2683
|
try {
|
|
2657
|
-
//
|
|
2658
|
-
//
|
|
2659
|
-
//
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2684
|
+
// Default returns the board/list overview with counts and coverage - NO
|
|
2685
|
+
// card arrays. A named (boardId, listId) pages that list's open cards
|
|
2686
|
+
// beyond the old kanban ceiling, cursor pinned to the read snapshot.
|
|
2687
|
+
if (kanbanInput.boardId !== undefined || kanbanInput.listId !== undefined) {
|
|
2688
|
+
const cards = await getTrelloListCards({
|
|
2689
|
+
boardId: kanbanInput.boardId ?? '',
|
|
2690
|
+
listId: kanbanInput.listId ?? '',
|
|
2691
|
+
limit: kanbanInput.limit,
|
|
2692
|
+
cursor: kanbanInput.cursor,
|
|
2693
|
+
});
|
|
2694
|
+
return { success: true, ...cards };
|
|
2695
|
+
}
|
|
2696
|
+
const overview = await getTrelloBoardsOverview();
|
|
2697
|
+
return { success: true, ...overview };
|
|
2664
2698
|
}
|
|
2665
2699
|
catch (err) {
|
|
2666
2700
|
return {
|
|
@@ -2671,12 +2705,14 @@ class GatewayToolExecutor {
|
|
|
2671
2705
|
}
|
|
2672
2706
|
}
|
|
2673
2707
|
case 'kagemusha_messages': {
|
|
2674
|
-
const {
|
|
2708
|
+
const { queryMessagesPage } = await import('../connectors/kagemusha/query-tools.js');
|
|
2675
2709
|
const msgInput = input;
|
|
2676
2710
|
if (!msgInput.channelId) {
|
|
2677
2711
|
throw new types_js_1.AgentError('kagemusha_messages requires channelId', 'TOOL_ERROR', undefined, false);
|
|
2678
2712
|
}
|
|
2679
|
-
|
|
2713
|
+
// Progressive: (created_at,id) keyset over an append-only asOf bound with
|
|
2714
|
+
// total/returned/nextCursor; an unknown channel is a loud missing-source error.
|
|
2715
|
+
return { success: true, ...queryMessagesPage(msgInput) };
|
|
2680
2716
|
}
|
|
2681
2717
|
case 'changes_read': {
|
|
2682
2718
|
if (!this.taskLedger) {
|
|
@@ -2692,37 +2728,23 @@ class GatewayToolExecutor {
|
|
|
2692
2728
|
if (!this.taskLedger) {
|
|
2693
2729
|
return { success: false, error: 'Task ledger not configured' };
|
|
2694
2730
|
}
|
|
2731
|
+
// Under a Temporal work context the universe is exactly the one host-bound
|
|
2732
|
+
// owner task; the views observe/count only it and treat every other id as
|
|
2733
|
+
// generic missing. Fetch it here so an unavailable bound task stays the same
|
|
2734
|
+
// superseded signal it was before the progressive views.
|
|
2695
2735
|
const temporalContext = this.getExecutionState().temporalWorkContext;
|
|
2736
|
+
let boundTask;
|
|
2696
2737
|
if (temporalContext) {
|
|
2697
|
-
const
|
|
2698
|
-
if (!
|
|
2738
|
+
const found = this.taskLedger.getById(temporalContext.taskId);
|
|
2739
|
+
if (!found) {
|
|
2699
2740
|
throw new types_js_1.AgentError('Host-bound temporal owner task is unavailable', 'WORKORDER_SUPERSEDED', undefined, false);
|
|
2700
2741
|
}
|
|
2701
|
-
|
|
2702
|
-
success: true,
|
|
2703
|
-
tasks: [serializeTaskToolRecord(boundTask)],
|
|
2704
|
-
};
|
|
2742
|
+
boundTask = found;
|
|
2705
2743
|
}
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
// that says "the open items are..." from one page states more than it read.
|
|
2710
|
-
const page = this.taskLedger.listPage({
|
|
2711
|
-
status: listInput.status,
|
|
2712
|
-
includeTerminal: listInput.include_terminal,
|
|
2713
|
-
channel: listInput.channel,
|
|
2714
|
-
search: listInput.search,
|
|
2715
|
-
limit: listInput.limit,
|
|
2716
|
-
order: listInput.order ?? 'deadline_priority',
|
|
2717
|
-
cursor: listInput.cursor,
|
|
2744
|
+
return (0, task_list_views_js_1.runTaskListView)(input, {
|
|
2745
|
+
ledger: this.taskLedger,
|
|
2746
|
+
boundTask,
|
|
2718
2747
|
});
|
|
2719
|
-
return {
|
|
2720
|
-
success: true,
|
|
2721
|
-
tasks: page.tasks.map(serializeTaskToolRecord),
|
|
2722
|
-
total: page.total,
|
|
2723
|
-
returned: page.returned,
|
|
2724
|
-
nextCursor: page.nextCursor,
|
|
2725
|
-
};
|
|
2726
2748
|
}
|
|
2727
2749
|
case 'task_external_correlation': {
|
|
2728
2750
|
if (!this.taskLedger) {
|
|
@@ -2869,7 +2891,7 @@ class GatewayToolExecutor {
|
|
|
2869
2891
|
}
|
|
2870
2892
|
return {
|
|
2871
2893
|
success: true,
|
|
2872
|
-
task: serializeTaskToolRecord(
|
|
2894
|
+
task: (0, task_list_views_js_1.serializeTaskToolRecord)(
|
|
2873
2895
|
// The run id comes from trusted execution state, never from the tool call:
|
|
2874
2896
|
// an agent that can name its own run in the effect ledger can sign someone
|
|
2875
2897
|
// else's work with it.
|
|
@@ -2976,7 +2998,7 @@ class GatewayToolExecutor {
|
|
|
2976
2998
|
causeKind: this.getExecutionState().source === 'operator' ? 'clock' : 'owner_message',
|
|
2977
2999
|
...(verifiedReviewEvidence ? { verifiedReviewEvidence } : {}),
|
|
2978
3000
|
});
|
|
2979
|
-
return { success: true, task: serializeTaskToolRecord(updated) };
|
|
3001
|
+
return { success: true, task: (0, task_list_views_js_1.serializeTaskToolRecord)(updated) };
|
|
2980
3002
|
}
|
|
2981
3003
|
case 'task_temporal_reconcile': {
|
|
2982
3004
|
if (!this.taskLedger) {
|
|
@@ -3908,7 +3930,7 @@ class GatewayToolExecutor {
|
|
|
3908
3930
|
usedUntrustedExternalEvidence = true;
|
|
3909
3931
|
}
|
|
3910
3932
|
};
|
|
3911
|
-
bridge.injectInto(sandbox, policy
|
|
3933
|
+
bridge.injectInto(sandbox, policy);
|
|
3912
3934
|
const result = await sandbox.execute(input.code, { signal: state.signal });
|
|
3913
3935
|
const terminalMutationCodes = new Set([
|
|
3914
3936
|
CODE_ACT_MUTATION_COMMITTED_AFTER_ABORT,
|
|
@@ -3943,6 +3965,7 @@ class GatewayToolExecutor {
|
|
|
3943
3965
|
metrics: result.metrics,
|
|
3944
3966
|
hostToolExecutions,
|
|
3945
3967
|
hostToolsInvoked,
|
|
3968
|
+
...(usedUntrustedExternalEvidence ? { untrustedExternalEvidence: true } : {}),
|
|
3946
3969
|
message: result.success
|
|
3947
3970
|
? usedUntrustedExternalEvidence
|
|
3948
3971
|
? (0, untrusted_content_js_1.wrapUntrustedContent)('external-evidence-code-act', successfulMessage)
|