maka-agent 0.2.0-dev.47.20260922 → 0.2.0-dev.48.20260923
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/runtime-host-capability-provider-command.js +25 -6
- package/dist/tui-mcp-control.js +37 -24
- package/native/runtime-host-windows-task-launcher/prebuilds/win32-x64/maka-runtime-host-task-launcher.exe +0 -0
- package/node_modules/@maka/acp-executor-plugin/dist/acp-errors.js +26 -0
- package/node_modules/@maka/acp-executor-plugin/dist/acp-filesystem.js +103 -0
- package/node_modules/@maka/acp-executor-plugin/dist/acp-process.js +119 -0
- package/node_modules/@maka/acp-executor-plugin/dist/acp-projection.js +146 -0
- package/node_modules/@maka/acp-executor-plugin/dist/index.js +653 -0
- package/node_modules/@maka/acp-executor-plugin/dist/plugin.mjs +24446 -0
- package/node_modules/@maka/acp-executor-plugin/package.json +15 -0
- package/node_modules/@maka/antigravity-acp-plugin/dist/index.js +88 -0
- package/node_modules/@maka/antigravity-acp-plugin/dist/model-presentation.js +53 -0
- package/node_modules/@maka/antigravity-acp-plugin/dist/plugin.mjs +115 -0
- package/node_modules/@maka/antigravity-acp-plugin/package.json +15 -0
- package/node_modules/@maka/core/dist/executor-catalog.js +106 -0
- package/node_modules/@maka/core/dist/mcp.js +4 -1
- package/node_modules/@maka/core/dist/model-metadata.js +28 -1
- package/node_modules/@maka/core/dist/runtime-event-store.js +25 -0
- package/node_modules/@maka/core/dist/runtime-invocation.js +5 -0
- package/node_modules/@maka/core/dist/runtime-policy/credential-vault-codec.js +6 -0
- package/node_modules/@maka/core/dist/runtime-policy/policy-codec.js +21 -0
- package/node_modules/@maka/core/dist/session.js +2 -0
- package/node_modules/@maka/core/dist/settings.js +1 -0
- package/node_modules/@maka/core/dist/tool-ledger-scanner.js +365 -104
- package/node_modules/@maka/core/dist/turn-origin.js +14 -0
- package/node_modules/@maka/core/package.json +2 -0
- package/node_modules/@maka/mcp/dist/credential-coordinator.js +6 -1
- package/node_modules/@maka/mcp/dist/index.js +31 -5
- package/node_modules/@maka/mcp/dist/oauth.js +54 -6
- package/node_modules/@maka/runtime/dist/agent-run-inspect.js +1 -1
- package/node_modules/@maka/runtime/dist/conversation-copy.js +56 -1
- package/node_modules/@maka/runtime/dist/mcp-tools.js +9 -2
- package/node_modules/@maka/runtime/dist/plugin-executor-backend.js +116 -3
- package/node_modules/@maka/runtime/dist/plugin-executor-service.js +212 -16
- package/node_modules/@maka/runtime/dist/runtime-ledger-repair.js +2 -2
- package/node_modules/@maka/runtime/dist/session-event-runtime-mapper.js +3 -0
- package/node_modules/@maka/runtime/dist/session-manager.js +170 -125
- package/node_modules/@maka/runtime/dist/shell-run-manager.js +3 -0
- package/node_modules/@maka/runtime/dist/stream-graph-coordinator.js +29 -4
- package/node_modules/@maka/runtime-host/dist/candidate-entry.js +8 -5
- package/node_modules/@maka/runtime-host/dist/client/index.js +1 -1
- package/node_modules/@maka/runtime-host/dist/client/reconnect-lifecycle.js +8 -1
- package/node_modules/@maka/runtime-host/dist/client/session-catalog-summary.js +6 -1
- package/node_modules/@maka/runtime-host/dist/composition-identity.js +19 -0
- package/node_modules/@maka/runtime-host/dist/protocol/index.js +10 -2
- package/node_modules/@maka/runtime-host/dist/protocol/plugin-platform.js +34 -0
- package/node_modules/@maka/runtime-host/dist/protocol/session-catalog.js +40 -2
- package/node_modules/@maka/runtime-host/dist/server/builtin-external-agent-plugins.js +188 -0
- package/node_modules/@maka/runtime-host/dist/server/candidate.js +12 -7
- package/node_modules/@maka/runtime-host/dist/server/client-capability-recovery.js +44 -46
- package/node_modules/@maka/runtime-host/dist/server/context-coordinator.js +2 -0
- package/node_modules/@maka/runtime-host/dist/server/execution-composition-factory.js +1 -1
- package/node_modules/@maka/runtime-host/dist/server/execution-composition.js +159 -19
- package/node_modules/@maka/runtime-host/dist/server/execution-model-authority.js +3 -0
- package/node_modules/@maka/runtime-host/dist/server/extension-bundle.js +4 -0
- package/node_modules/@maka/runtime-host/dist/server/host-composition-source.js +47 -0
- package/node_modules/@maka/runtime-host/dist/server/host-composition.js +1 -29
- package/node_modules/@maka/runtime-host/dist/server/host-kernel.js +2 -9
- package/node_modules/@maka/runtime-host/dist/server/hosted-execution-recovery.js +75 -9
- package/node_modules/@maka/runtime-host/dist/server/hosted-execution-tool-profile.js +4 -0
- package/node_modules/@maka/runtime-host/dist/server/interaction-coordinator.js +45 -0
- package/node_modules/@maka/runtime-host/dist/server/jev-routing-model.js +157 -0
- package/node_modules/@maka/runtime-host/dist/server/listener-set.js +2 -2
- package/node_modules/@maka/runtime-host/dist/server/message-coordinator.js +4 -0
- package/node_modules/@maka/runtime-host/dist/server/plugin-platform-coordinator.js +11 -1
- package/node_modules/@maka/runtime-host/dist/server/process-lifecycle.js +1 -1
- package/node_modules/@maka/runtime-host/dist/server/process-termination-error.js +27 -0
- package/node_modules/@maka/runtime-host/dist/server/root-turn-coordinator.js +91 -12
- package/node_modules/@maka/runtime-host/dist/server/runtime-policy-coordinator.js +2 -0
- package/node_modules/@maka/runtime-host/dist/server/session-catalog-coordinator.js +99 -12
- package/node_modules/@maka/runtime-host/dist/server/session-effect-coordinator.js +12 -6
- package/node_modules/@maka/runtime-host/dist/server/session-transcript-reader.js +33 -0
- package/node_modules/@maka/runtime-host/dist/server/workhub-coordination-coordinator.js +4 -0
- package/node_modules/@maka/runtime-host/dist/server/workhub-result-coordinator.js +173 -0
- package/node_modules/@maka/runtime-host/dist/server/workhub-result-runtime.js +293 -0
- package/node_modules/@maka/runtime-host/package.json +2 -0
- package/node_modules/@maka/storage/dist/agent-run-store-contract.js +8 -0
- package/node_modules/@maka/storage/dist/execution-stores.js +15 -3
- package/node_modules/@maka/storage/dist/mcp-config-store.js +91 -2
- package/node_modules/@maka/storage/dist/operational-state-store.js +15 -1
- package/node_modules/@maka/storage/dist/plan-authority.js +2 -0
- package/node_modules/@maka/storage/dist/plan-store.js +30 -0
- package/node_modules/@maka/storage/dist/runtime-event-persistence.js +1 -0
- package/node_modules/@maka/storage/dist/runtime-policy/credential-vault-document.js +4 -1
- package/node_modules/@maka/storage/dist/runtime-policy/policy-document.js +2 -0
- package/node_modules/@maka/storage/dist/session-store-values.js +16 -4
- package/node_modules/@maka/storage/dist/shell-run-authority.js +1 -0
- package/node_modules/@maka/storage/dist/shell-run-store.js +15 -0
- package/node_modules/@maka/storage/dist/sqlite-runtime-schema.js +74 -1
- package/node_modules/@maka/storage/dist/sqlite-runtime-store.js +724 -84
- package/node_modules/@maka/storage/dist/sqlite-session-metadata-store.js +16 -0
- package/package.json +1 -1
|
@@ -84,6 +84,8 @@ export function policySnapshot(document) {
|
|
|
84
84
|
}
|
|
85
85
|
function applyMutation(policy, operation) {
|
|
86
86
|
switch (operation.kind) {
|
|
87
|
+
case 'set_jev':
|
|
88
|
+
return { ...policy, jev: operation.value };
|
|
87
89
|
case 'set_network_proxy':
|
|
88
90
|
return { ...policy, networkProxy: operation.value };
|
|
89
91
|
case 'set_personalization':
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* specific language governing permissions and limitations
|
|
17
17
|
* under the License.
|
|
18
18
|
*/
|
|
19
|
+
import { isExecutorConfiguration } from '@maka/core/executor-catalog';
|
|
19
20
|
import { randomUUID } from 'node:crypto';
|
|
20
21
|
import { DEFAULT_SESSION_NAME, normalizeUserSessionName } from '@maka/core/session-name';
|
|
21
22
|
import { isExecutorId } from '@maka/core/executor-id';
|
|
@@ -72,7 +73,12 @@ export function buildSessionHeader(workspaceRoot, input, sessionId = randomUUID(
|
|
|
72
73
|
...(input.revisionState ? { revisionState: input.revisionState } : {}),
|
|
73
74
|
hasUnread: false,
|
|
74
75
|
backend: input.executorId ? 'plugin-executor' : 'ai-sdk',
|
|
75
|
-
...(input.executorId
|
|
76
|
+
...(input.executorId
|
|
77
|
+
? {
|
|
78
|
+
executorId: input.executorId,
|
|
79
|
+
...(input.executorConfig ? { executorConfig: input.executorConfig } : {}),
|
|
80
|
+
}
|
|
81
|
+
: {}),
|
|
76
82
|
...(input.llmConnectionId === undefined ? {} : { llmConnectionId: input.llmConnectionId }),
|
|
77
83
|
llmConnectionSlug: input.llmConnectionSlug,
|
|
78
84
|
// A subagent Session's route is chosen by the spawn that created it and is
|
|
@@ -273,9 +279,10 @@ function isPersistedBackendKind(value) {
|
|
|
273
279
|
}
|
|
274
280
|
function isValidExecutorSelection(header) {
|
|
275
281
|
if (header.backend === 'plugin-executor') {
|
|
276
|
-
return isExecutorId(header.executorId)
|
|
282
|
+
return (isExecutorId(header.executorId) &&
|
|
283
|
+
(header.executorConfig === undefined || isExecutorConfiguration(header.executorConfig)));
|
|
277
284
|
}
|
|
278
|
-
return header.executorId === undefined;
|
|
285
|
+
return header.executorId === undefined && header.executorConfig === undefined;
|
|
279
286
|
}
|
|
280
287
|
function isFiniteNumber(value) {
|
|
281
288
|
return typeof value === 'number' && Number.isFinite(value);
|
|
@@ -314,7 +321,12 @@ export function toSummary(header) {
|
|
|
314
321
|
...(header.revisionIndex !== undefined ? { revisionIndex: header.revisionIndex } : {}),
|
|
315
322
|
...(header.revisionState ? { revisionState: header.revisionState } : {}),
|
|
316
323
|
backend: header.backend,
|
|
317
|
-
...(header.executorId
|
|
324
|
+
...(header.executorId
|
|
325
|
+
? {
|
|
326
|
+
executorId: header.executorId,
|
|
327
|
+
...(header.executorConfig ? { executorConfig: header.executorConfig } : {}),
|
|
328
|
+
}
|
|
329
|
+
: {}),
|
|
318
330
|
...(header.llmConnectionId === undefined ? {} : { llmConnectionId: header.llmConnectionId }),
|
|
319
331
|
llmConnectionSlug: header.llmConnectionSlug,
|
|
320
332
|
connectionLocked: header.connectionLocked,
|
|
@@ -97,6 +97,7 @@ function createWriterFacade(lease, store) {
|
|
|
97
97
|
},
|
|
98
98
|
readShellRun: (sessionId, shellRunId) => run(() => store.readShellRun(sessionId, shellRunId)),
|
|
99
99
|
listSessionShellRuns: (sessionId) => run(() => store.listSessionShellRuns(sessionId)),
|
|
100
|
+
listShellRunRecoverySessionIds: () => run(() => store.listShellRunRecoverySessionIds()),
|
|
100
101
|
close: () => {
|
|
101
102
|
if (closed)
|
|
102
103
|
return;
|
|
@@ -90,6 +90,21 @@ class SqliteShellRunStore {
|
|
|
90
90
|
return normalizeShellRunRecord(JSON.parse(row.record_json), sessionId, row.shell_run_id);
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
|
+
async listShellRunRecoverySessionIds() {
|
|
94
|
+
const rows = this.#lease.database
|
|
95
|
+
.prepare(`
|
|
96
|
+
SELECT DISTINCT session_id
|
|
97
|
+
FROM core_shell_runs
|
|
98
|
+
WHERE json_extract(record_json, '$.status') IN ('starting', 'running')
|
|
99
|
+
ORDER BY session_id
|
|
100
|
+
`)
|
|
101
|
+
.all();
|
|
102
|
+
return rows.map((row) => {
|
|
103
|
+
if (typeof row.session_id !== 'string')
|
|
104
|
+
throw new Error('Invalid SQLite ShellRun row');
|
|
105
|
+
return row.session_id;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
93
108
|
close() {
|
|
94
109
|
this.#lease.close();
|
|
95
110
|
}
|
|
@@ -20,7 +20,7 @@ import { decodePersistedLegacyRunHeader, invocationOpeningFromLegacyRunHeader, }
|
|
|
20
20
|
import { encodeCanonicalRuntimeEvent } from '@maka/core/canonical-runtime-event';
|
|
21
21
|
import { rebuildTranscriptTurnExtents, TERMINAL_RUNTIME_EVENT_SQL, } from './runtime-transcript-query.js';
|
|
22
22
|
import { buildInvocationOpenedEvent, buildSyntheticTerminalRuntimeEvent, } from '@maka/core/runtime-invocation';
|
|
23
|
-
export const SQLITE_RUNTIME_SCHEMA_VERSION =
|
|
23
|
+
export const SQLITE_RUNTIME_SCHEMA_VERSION = 20;
|
|
24
24
|
export const RUNTIME_RECOVERY_AUTHORITY_CAPABILITY = 'runtime_recovery_authority';
|
|
25
25
|
export const RUNTIME_RECOVERY_AUTHORITY_CAPABILITY_VERSION = 1;
|
|
26
26
|
export const RUNTIME_CONTINUATION_AUTHORITY_CAPABILITY = 'runtime_continuation_authority';
|
|
@@ -624,6 +624,79 @@ const MIGRATIONS = new Map([
|
|
|
624
624
|
ON runtime_session_turn_extents(session_id, first_ordinal, last_ordinal);
|
|
625
625
|
`,
|
|
626
626
|
],
|
|
627
|
+
[
|
|
628
|
+
20,
|
|
629
|
+
`
|
|
630
|
+
CREATE INDEX runtime_events_recovery_user_message
|
|
631
|
+
ON runtime_events(
|
|
632
|
+
session_id,
|
|
633
|
+
turn_id,
|
|
634
|
+
event_id,
|
|
635
|
+
event_kind,
|
|
636
|
+
CASE
|
|
637
|
+
WHEN json_valid(payload_json)
|
|
638
|
+
THEN json_extract(payload_json, '$.partial')
|
|
639
|
+
END,
|
|
640
|
+
CASE
|
|
641
|
+
WHEN json_valid(payload_json)
|
|
642
|
+
THEN json_extract(payload_json, '$.role')
|
|
643
|
+
END,
|
|
644
|
+
coalesce(CASE
|
|
645
|
+
WHEN json_valid(payload_json)
|
|
646
|
+
THEN json_extract(payload_json, '$.content.steering')
|
|
647
|
+
END, 0)
|
|
648
|
+
)
|
|
649
|
+
WHERE event_kind = 'text'
|
|
650
|
+
AND CASE
|
|
651
|
+
WHEN json_valid(payload_json)
|
|
652
|
+
THEN json_extract(payload_json, '$.partial')
|
|
653
|
+
END = 0
|
|
654
|
+
AND CASE
|
|
655
|
+
WHEN json_valid(payload_json)
|
|
656
|
+
THEN json_extract(payload_json, '$.role')
|
|
657
|
+
END = 'user'
|
|
658
|
+
AND coalesce(CASE
|
|
659
|
+
WHEN json_valid(payload_json)
|
|
660
|
+
THEN json_extract(payload_json, '$.content.steering')
|
|
661
|
+
END, 0) = 0;
|
|
662
|
+
|
|
663
|
+
-- Historical duplicates must remain readable so the affected identity can
|
|
664
|
+
-- fail closed. This is intentionally non-unique. CASE keeps a malformed
|
|
665
|
+
-- legacy payload from aborting the whole schema migration.
|
|
666
|
+
CREATE INDEX runtime_events_steering_message
|
|
667
|
+
ON runtime_events(
|
|
668
|
+
session_id,
|
|
669
|
+
CASE
|
|
670
|
+
WHEN json_valid(payload_json)
|
|
671
|
+
THEN json_extract(payload_json, '$.refs.providerEventId')
|
|
672
|
+
END
|
|
673
|
+
)
|
|
674
|
+
WHERE event_kind = 'text'
|
|
675
|
+
AND CASE
|
|
676
|
+
WHEN json_valid(payload_json)
|
|
677
|
+
THEN json_extract(payload_json, '$.partial')
|
|
678
|
+
END = 0
|
|
679
|
+
AND CASE
|
|
680
|
+
WHEN json_valid(payload_json)
|
|
681
|
+
THEN json_extract(payload_json, '$.content.steering')
|
|
682
|
+
END = 1;
|
|
683
|
+
|
|
684
|
+
CREATE INDEX runtime_events_tool_dispatch_operation
|
|
685
|
+
ON runtime_events(
|
|
686
|
+
CASE
|
|
687
|
+
WHEN json_valid(payload_json)
|
|
688
|
+
THEN json_extract(payload_json, '$.actions.toolDispatch.operationId')
|
|
689
|
+
END
|
|
690
|
+
)
|
|
691
|
+
WHERE event_kind = 'tool_dispatch';
|
|
692
|
+
|
|
693
|
+
CREATE INDEX tool_operations_unsettled
|
|
694
|
+
ON tool_operations(invocation_id, operation_id)
|
|
695
|
+
WHERE current_state = 'prepared'
|
|
696
|
+
AND result_event_id IS NULL
|
|
697
|
+
AND dispatch_event_id IS NOT NULL;
|
|
698
|
+
`,
|
|
699
|
+
],
|
|
627
700
|
]);
|
|
628
701
|
/**
|
|
629
702
|
* Data migrations that a SQL statement cannot express, applied inside the same
|