maka-agent 0.2.0-dev.14.20260902 → 0.2.0-dev.16.20260903
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/cli-core.js +0 -1
- package/dist/pi-transcript.js +48 -0
- package/dist/pi-tui-form-interaction.js +497 -0
- package/dist/pi-tui-pickers.js +256 -55
- package/dist/pi-tui-runner.js +215 -12
- package/dist/runtime-host-cli.js +17 -42
- package/dist/runtime-host-lifecycle-transaction.js +31 -13
- package/dist/runtime-host-managed-lifecycle-manager.js +1 -1
- package/dist/runtime-host-onboarding.js +3 -1
- package/dist/runtime-host-openrc-service.js +469 -0
- package/dist/runtime-host-run-command.js +6 -2
- package/dist/runtime-host-service-command.js +3 -3
- package/dist/runtime-host-service-management-command.js +43 -15
- package/dist/runtime-host-session-channel.js +3 -0
- package/dist/runtime-host-session-driver.js +21 -6
- package/dist/runtime-host-setup-command.js +30 -31
- package/dist/tui-context-refresh.js +103 -0
- package/dist/tui-copy-catalog.js +73 -0
- package/native/runtime-host-peer/prebuilds/darwin-arm64/maka_runtime_host_peer.node +0 -0
- package/native/runtime-host-peer/prebuilds/linux-arm64/maka_runtime_host_peer.node +0 -0
- package/native/runtime-host-peer/prebuilds/linux-x64/maka_runtime_host_peer.node +0 -0
- package/native/runtime-host-peer/prebuilds/win32-x64/maka_runtime_host_peer.node +0 -0
- package/node_modules/@maka/core/dist/chat-model-choice.js +4 -0
- package/node_modules/@maka/core/dist/computer-use.js +27 -92
- package/node_modules/@maka/core/dist/interaction.js +577 -3
- package/node_modules/@maka/core/dist/llm-connections.js +4 -0
- package/node_modules/@maka/core/dist/local-memory.js +2 -2
- package/node_modules/@maka/core/dist/model-call-usage-projection.js +3 -0
- package/node_modules/@maka/core/dist/model-metadata.js +26 -7
- package/node_modules/@maka/core/dist/model-thinking.js +17 -0
- package/node_modules/@maka/core/dist/provider-registry.js +1 -0
- package/node_modules/@maka/core/dist/runtime-event.js +23 -1
- package/node_modules/@maka/core/dist/scheduled-task.js +4 -0
- package/node_modules/@maka/core/dist/session.js +95 -2
- package/node_modules/@maka/core/dist/text-sanitize.js +19 -0
- package/node_modules/@maka/core/dist/usage-ledger-merge.js +3 -0
- package/node_modules/@maka/core/dist/usage-record-schema.js +11 -5
- package/node_modules/@maka/core/dist/workhub-creation-intent.js +75 -9
- package/node_modules/@maka/core/dist/workhub-session-resolver.js +50 -0
- package/node_modules/@maka/core/package.json +2 -0
- package/node_modules/@maka/eval/dist/harbor-external-subject.js +2 -1
- package/node_modules/@maka/eval/dist/harness-executor.js +3 -2
- package/node_modules/@maka/eval/dist/install-preflight.js +39 -10
- package/node_modules/@maka/eval/dist/process-termination.js +83 -0
- package/node_modules/@maka/mcp/dist/sep-2243.js +3 -3
- package/node_modules/@maka/runtime/dist/agent-run.js +6 -3
- package/node_modules/@maka/runtime/dist/ai-sdk-backend.js +332 -118
- package/node_modules/@maka/runtime/dist/ai-sdk-compaction-contract.js +6 -1
- package/node_modules/@maka/runtime/dist/ai-sdk-compaction.js +171 -341
- package/node_modules/@maka/runtime/dist/bots/telegram-bridge.js +3 -26
- package/node_modules/@maka/runtime/dist/bundled-skill-catalog.generated.js +1 -1
- package/node_modules/@maka/runtime/dist/computer-use-codec.js +1 -141
- package/node_modules/@maka/runtime/dist/computer-use-tools.js +23 -105
- package/node_modules/@maka/runtime/dist/context-budget-policy.js +20 -26
- package/node_modules/@maka/runtime/dist/context-budget.js +18 -20
- package/node_modules/@maka/runtime/dist/conversation-copy.js +23 -19
- package/node_modules/@maka/runtime/dist/cua-frame-state.js +1 -69
- package/node_modules/@maka/runtime/dist/github-copilot-oauth-enrollment.js +267 -0
- package/node_modules/@maka/runtime/dist/history-compact-checkpoint.js +6 -9
- package/node_modules/@maka/runtime/dist/history-compact-summarizer.js +67 -23
- package/node_modules/@maka/runtime/dist/history-compact-summary-validation.js +11 -18
- package/node_modules/@maka/runtime/dist/history-compaction.js +66 -73
- package/node_modules/@maka/runtime/dist/interaction-authority.js +69 -0
- package/node_modules/@maka/runtime/dist/mcp-tools.js +13 -1
- package/node_modules/@maka/runtime/dist/memory-extraction.js +11 -11
- package/node_modules/@maka/runtime/dist/model-adapter.js +24 -6
- package/node_modules/@maka/runtime/dist/model-factory.js +14 -5
- package/node_modules/@maka/runtime/dist/oauth-provider-contracts.js +28 -1
- package/node_modules/@maka/runtime/dist/openai-codex-history-compactor.js +7 -6
- package/node_modules/@maka/runtime/dist/opencode-session-header.js +29 -0
- package/node_modules/@maka/runtime/dist/runtime-event-read-model.js +11 -1
- package/node_modules/@maka/runtime/dist/runtime-kernel.js +12 -11
- package/node_modules/@maka/runtime/dist/runtime-read-model.js +51 -13
- package/node_modules/@maka/runtime/dist/scheduled-task-tools.js +3 -0
- package/node_modules/@maka/runtime/dist/session-event-runtime-mapper.js +26 -0
- package/node_modules/@maka/runtime/dist/session-manager.js +1 -0
- package/node_modules/@maka/runtime/dist/session-projection-helpers.js +16 -1
- package/node_modules/@maka/runtime/dist/stream-graph-projection.js +6 -0
- package/node_modules/@maka/runtime/dist/stream-graph-read-model.js +5 -0
- package/node_modules/@maka/runtime/dist/stream-usage-fallback-fetch.js +74 -0
- package/node_modules/@maka/runtime/dist/subscription-credentials.js +51 -4
- package/node_modules/@maka/runtime/dist/subscription-model-fetch.js +47 -3
- package/node_modules/@maka/runtime/dist/system-prompt/main-session-prompt.js +20 -1
- package/node_modules/@maka/runtime/dist/test-connection.js +18 -11
- package/node_modules/@maka/runtime/dist/tool-runtime.js +183 -0
- package/node_modules/@maka/runtime/package.json +1 -0
- package/node_modules/@maka/runtime-host/dist/adapter/session-projector.js +14 -0
- package/node_modules/@maka/runtime-host/dist/client/client-capability-channel.js +84 -1
- package/node_modules/@maka/runtime-host/dist/client/host-profile.js +68 -51
- package/node_modules/@maka/runtime-host/dist/client/index.js +1 -1
- package/node_modules/@maka/runtime-host/dist/client/owner-connection-code.js +8 -5
- package/node_modules/@maka/runtime-host/dist/client/peer-client.js +342 -36
- package/node_modules/@maka/runtime-host/dist/client/reconnect-lifecycle.js +60 -4
- package/node_modules/@maka/runtime-host/dist/peer-mesh/index.js +3 -3
- package/node_modules/@maka/runtime-host/dist/peer-mesh/limits.js +1 -1
- package/node_modules/@maka/runtime-host/dist/peer-mesh/model.js +48 -60
- package/node_modules/@maka/runtime-host/dist/peer-mesh/node.js +847 -431
- package/node_modules/@maka/runtime-host/dist/peer-mesh/owner.js +33 -74
- package/node_modules/@maka/runtime-host/dist/peer-mesh/store.js +82 -69
- package/node_modules/@maka/runtime-host/dist/peer-reachability/index.js +21 -0
- package/node_modules/@maka/runtime-host/dist/peer-reachability/model.js +202 -0
- package/node_modules/@maka/runtime-host/dist/peer-reachability/owner.js +119 -0
- package/node_modules/@maka/runtime-host/dist/peer-reachability/publisher.js +245 -0
- package/node_modules/@maka/runtime-host/dist/protocol/agent-graph.js +4 -1
- package/node_modules/@maka/runtime-host/dist/protocol/client-capability.js +68 -0
- package/node_modules/@maka/runtime-host/dist/protocol/connection-effects.js +15 -8
- package/node_modules/@maka/runtime-host/dist/protocol/host-status.js +7 -23
- package/node_modules/@maka/runtime-host/dist/protocol/index.js +47 -1
- package/node_modules/@maka/runtime-host/dist/protocol/oauth.js +25 -1
- package/node_modules/@maka/runtime-host/dist/protocol/operations.js +1 -0
- package/node_modules/@maka/runtime-host/dist/protocol/peer-mesh.js +14 -31
- package/node_modules/@maka/runtime-host/dist/protocol/scheduled-task.js +19 -6
- package/node_modules/@maka/runtime-host/dist/protocol/session-collaboration.js +36 -1
- package/node_modules/@maka/runtime-host/dist/protocol/session-revision.js +11 -2
- package/node_modules/@maka/runtime-host/dist/protocol/usage-pricing.js +16 -2
- package/node_modules/@maka/runtime-host/dist/protocol/workhub-coordination.js +51 -2
- package/node_modules/@maka/runtime-host/dist/server/access-authority.js +35 -2
- package/node_modules/@maka/runtime-host/dist/server/access-credential-store.js +1 -0
- package/node_modules/@maka/runtime-host/dist/server/client-capability-coordinator.js +12 -10
- package/node_modules/@maka/runtime-host/dist/server/client-capability-invocation-broker.js +163 -30
- package/node_modules/@maka/runtime-host/dist/server/connection-effect-coordinator.js +38 -14
- package/node_modules/@maka/runtime-host/dist/server/daily-review-coordinator.js +45 -22
- package/node_modules/@maka/runtime-host/dist/server/execution-composition.js +78 -20
- package/node_modules/@maka/runtime-host/dist/server/execution-model-authority.js +4 -2
- package/node_modules/@maka/runtime-host/dist/server/execution-model-composition.js +2 -1
- package/node_modules/@maka/runtime-host/dist/server/execution-service.js +49 -28
- package/node_modules/@maka/runtime-host/dist/server/host-kernel.js +3 -6
- package/node_modules/@maka/runtime-host/dist/server/interaction-coordinator.js +130 -27
- package/node_modules/@maka/runtime-host/dist/server/interaction-projection.js +30 -1
- package/node_modules/@maka/runtime-host/dist/server/listener-set.js +2 -4
- package/node_modules/@maka/runtime-host/dist/server/message-coordinator.js +16 -3
- package/node_modules/@maka/runtime-host/dist/server/oauth-coordinator.js +66 -3
- package/node_modules/@maka/runtime-host/dist/server/oauth-execution-authority.js +20 -3
- package/node_modules/@maka/runtime-host/dist/server/peer-listener.js +8 -21
- package/node_modules/@maka/runtime-host/dist/server/peer-mesh-authority.js +1 -1
- package/node_modules/@maka/runtime-host/dist/server/root-turn-coordinator.js +6 -3
- package/node_modules/@maka/runtime-host/dist/server/scheduled-task-coordinator.js +72 -12
- package/node_modules/@maka/runtime-host/dist/server/session-revision-coordinator.js +48 -18
- package/node_modules/@maka/runtime-host/dist/server/session-turn-access-request-coordinator.js +43 -26
- package/node_modules/@maka/runtime-host/dist/server/usage-pricing-coordinator.js +15 -1
- package/node_modules/@maka/runtime-host/dist/server/workhub-coordination-action-gate.js +229 -4
- package/node_modules/@maka/runtime-host/dist/server/workhub-coordination-coordinator.js +146 -8
- package/node_modules/@maka/runtime-host/dist/transport/peer-native.js +32 -6
- package/node_modules/@maka/runtime-host/package.json +1 -0
- package/node_modules/@maka/storage/dist/agent-run-store.js +18 -5
- package/node_modules/@maka/storage/dist/codex-session-adapter.js +14 -0
- package/node_modules/@maka/storage/dist/execution-stores.js +5 -0
- package/node_modules/@maka/storage/dist/interaction-store.js +13 -1
- package/node_modules/@maka/storage/dist/runtime-policy/connection-catalog-document.js +9 -3
- package/node_modules/@maka/storage/dist/runtime-policy/coordinator.js +49 -19
- package/node_modules/@maka/storage/dist/runtime-policy/oauth-login-receipt-document.js +3 -1
- package/node_modules/@maka/storage/dist/runtime-policy/onboarding-transaction.js +13 -5
- package/node_modules/@maka/storage/dist/session-copy-cleanup.js +4 -2
- package/node_modules/@maka/storage/dist/session-store.js +39 -6
- package/node_modules/@maka/storage/dist/sqlite-runtime-store.js +16 -9
- package/node_modules/@maka/storage/dist/sqlite-session-metadata-schema.js +30 -3
- package/node_modules/@maka/storage/dist/sqlite-session-metadata-store.js +117 -0
- package/node_modules/@maka/storage/dist/sqlite-usage-store.js +29 -6
- package/node_modules/@maka/storage/dist/usage-stores.js +3 -1
- package/package.json +1 -1
|
@@ -28,6 +28,7 @@ import { decodeJsonObject } from './experiment.js';
|
|
|
28
28
|
import { BUNDLED_HARNESS_RELAY_ROOT, createHarnessPreparationEnvironment, resolveRealPathWithinRoot, } from './harness-environment.js';
|
|
29
29
|
import { preflightHarnessInstallation, } from './install-preflight.js';
|
|
30
30
|
import { MAKA_RUNTIME_ARTIFACT_PATH, MAKA_SUBJECT_STDERR_PATH, MAKA_SUBJECT_STDOUT_PATH, } from './maka-artifacts.js';
|
|
31
|
+
import { terminateProcess } from './process-termination.js';
|
|
31
32
|
const PIER_FRAMEWORK_LOG_MOUNTS = Object.freeze([
|
|
32
33
|
{ directory: 'agent', target: '/logs/agent' },
|
|
33
34
|
{ directory: 'verifier', target: '/logs/verifier' },
|
|
@@ -911,7 +912,7 @@ async function waitForTrial(child, wait) {
|
|
|
911
912
|
outcome: completed.code === 0 && completed.signal === null ? 'completed' : 'failed',
|
|
912
913
|
};
|
|
913
914
|
}
|
|
914
|
-
child
|
|
915
|
+
await terminateProcess(child, 'SIGTERM');
|
|
915
916
|
const terminated = await within(exit, wait.deadlineMs);
|
|
916
917
|
if (terminated) {
|
|
917
918
|
return {
|
|
@@ -921,7 +922,7 @@ async function waitForTrial(child, wait) {
|
|
|
921
922
|
outcome: terminated.code === 0 && terminated.signal === null ? 'confirmed' : 'terminated',
|
|
922
923
|
};
|
|
923
924
|
}
|
|
924
|
-
child
|
|
925
|
+
await terminateProcess(child, 'SIGKILL');
|
|
925
926
|
const killed = await within(exit, KILL_SETTLEMENT_DEADLINE_MS);
|
|
926
927
|
if (killed) {
|
|
927
928
|
return {
|
|
@@ -21,6 +21,7 @@ import { constants } from 'node:fs';
|
|
|
21
21
|
import { access, lstat, stat } from 'node:fs/promises';
|
|
22
22
|
import { dirname, isAbsolute, resolve } from 'node:path';
|
|
23
23
|
import { BUNDLED_HARNESS_RELAY_ROOT, createHarnessPreparationEnvironment, resolvePathWithinRoot, resolveRealPathWithinRoot, } from './harness-environment.js';
|
|
24
|
+
import { terminateProcess } from './process-termination.js';
|
|
24
25
|
const PREFLIGHT_TIMEOUT_MS = 10_000;
|
|
25
26
|
const PREFLIGHT_OUTPUT_LIMIT_BYTES = 16 * 1024;
|
|
26
27
|
const PYTHON_FRAMEWORK_PROBE = [
|
|
@@ -105,21 +106,49 @@ export async function preflightHarnessInstallation(input, dependencies = {}) {
|
|
|
105
106
|
async function runCheckedCommand(command, args, environment, cwd, signal) {
|
|
106
107
|
signal?.throwIfAborted();
|
|
107
108
|
await new Promise((resolvePromise, rejectPromise) => {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
109
|
+
let settled = false;
|
|
110
|
+
let timeout;
|
|
111
|
+
let child;
|
|
112
|
+
const onAbort = () => {
|
|
113
|
+
void terminateProcess(child, 'SIGTERM');
|
|
114
|
+
};
|
|
115
|
+
const settle = (error, stderr = '') => {
|
|
116
|
+
if (settled)
|
|
117
|
+
return;
|
|
118
|
+
settled = true;
|
|
119
|
+
if (timeout)
|
|
120
|
+
clearTimeout(timeout);
|
|
121
|
+
signal?.removeEventListener('abort', onAbort);
|
|
117
122
|
if (!error) {
|
|
118
123
|
resolvePromise();
|
|
119
124
|
return;
|
|
120
125
|
}
|
|
121
126
|
rejectPromise(new Error(stderr.trim() || error.message));
|
|
122
|
-
}
|
|
127
|
+
};
|
|
128
|
+
try {
|
|
129
|
+
child = execFile(command, [...args], {
|
|
130
|
+
env: environment,
|
|
131
|
+
cwd,
|
|
132
|
+
killSignal: 'SIGTERM',
|
|
133
|
+
maxBuffer: PREFLIGHT_OUTPUT_LIMIT_BYTES,
|
|
134
|
+
encoding: 'utf8',
|
|
135
|
+
}, (error, _stdout, stderr) => {
|
|
136
|
+
settle(error ?? undefined, stderr);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
settle(error instanceof Error ? error : new Error(String(error)));
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
timeout = setTimeout(() => {
|
|
144
|
+
void terminateProcess(child, 'SIGKILL');
|
|
145
|
+
}, PREFLIGHT_TIMEOUT_MS);
|
|
146
|
+
if (signal) {
|
|
147
|
+
if (signal.aborted)
|
|
148
|
+
onAbort();
|
|
149
|
+
else
|
|
150
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
151
|
+
}
|
|
123
152
|
});
|
|
124
153
|
}
|
|
125
154
|
async function requirePath(path, label, expected) {
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
import { spawn } from 'node:child_process';
|
|
20
|
+
const WINDOWS_TASKKILL_TIMEOUT_MS = 2_000;
|
|
21
|
+
/**
|
|
22
|
+
* Terminates a child using the platform's process lifecycle semantics.
|
|
23
|
+
* Windows does not implement POSIX signals, so every termination request must
|
|
24
|
+
* include descendants. Otherwise the root can exit before forced escalation
|
|
25
|
+
* and leave its workers running.
|
|
26
|
+
*/
|
|
27
|
+
export function terminateProcess(child, signal, options = {}) {
|
|
28
|
+
if (!child || child.exitCode !== null || child.signalCode !== null)
|
|
29
|
+
return Promise.resolve(false);
|
|
30
|
+
const platform = options.platform ?? process.platform;
|
|
31
|
+
if (platform === 'win32') {
|
|
32
|
+
const pid = child.pid;
|
|
33
|
+
if (typeof pid !== 'number' || !Number.isSafeInteger(pid) || pid <= 0) {
|
|
34
|
+
return killChild(child);
|
|
35
|
+
}
|
|
36
|
+
return (options.runTaskkill ?? killWindowsTree)(pid).then((killed) => killed ? true : killChild(child));
|
|
37
|
+
}
|
|
38
|
+
return killChild(child, signal);
|
|
39
|
+
}
|
|
40
|
+
function killChild(child, signal) {
|
|
41
|
+
try {
|
|
42
|
+
// Omitting the signal is intentional on Windows: Node uses its native
|
|
43
|
+
// graceful termination path instead of trying to emulate a POSIX signal.
|
|
44
|
+
return Promise.resolve(signal === undefined ? child.kill() : child.kill(signal));
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return Promise.resolve(false);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function killWindowsTree(pid) {
|
|
51
|
+
return new Promise((resolve) => {
|
|
52
|
+
let settled = false;
|
|
53
|
+
let timeout;
|
|
54
|
+
const finish = (succeeded) => {
|
|
55
|
+
if (settled)
|
|
56
|
+
return;
|
|
57
|
+
settled = true;
|
|
58
|
+
if (timeout)
|
|
59
|
+
clearTimeout(timeout);
|
|
60
|
+
resolve(succeeded);
|
|
61
|
+
};
|
|
62
|
+
try {
|
|
63
|
+
const killer = spawn('taskkill.exe', ['/PID', String(pid), '/T', '/F'], {
|
|
64
|
+
stdio: 'ignore',
|
|
65
|
+
windowsHide: true,
|
|
66
|
+
});
|
|
67
|
+
killer.once('error', () => finish(false));
|
|
68
|
+
killer.once('close', (code) => finish(code === 0));
|
|
69
|
+
timeout = setTimeout(() => {
|
|
70
|
+
try {
|
|
71
|
+
killer.kill();
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
/* taskkill already exited */
|
|
75
|
+
}
|
|
76
|
+
finish(false);
|
|
77
|
+
}, WINDOWS_TASKKILL_TIMEOUT_MS);
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
finish(false);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* specific language governing permissions and limitations
|
|
17
17
|
* under the License.
|
|
18
18
|
*/
|
|
19
|
+
import { truncateUtf16Safe } from '@maka/core/text-sanitize';
|
|
19
20
|
import { formatMcpDiagnosticText } from './diagnostic-text.js';
|
|
20
21
|
const X_MCP_HEADER = 'x-mcp-header';
|
|
21
22
|
const RFC_9110_TOKEN = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/u;
|
|
@@ -190,9 +191,8 @@ function valueAtPath(root, path) {
|
|
|
190
191
|
function truncateRenderedWarning(value) {
|
|
191
192
|
if (value.length <= MCP_HEADER_WARNING_LENGTH_LIMIT)
|
|
192
193
|
return value;
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
return `${value.slice(0, safeEnd)}\u2026`;
|
|
194
|
+
// The ellipsis is one BMP code unit, so it fits in the unit it reclaims.
|
|
195
|
+
return `${truncateUtf16Safe(value, MCP_HEADER_WARNING_LENGTH_LIMIT - 1)}\u2026`;
|
|
196
196
|
}
|
|
197
197
|
function isRecord(value) {
|
|
198
198
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
@@ -132,12 +132,13 @@ export class AgentRun {
|
|
|
132
132
|
: {}),
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
stop(source) {
|
|
135
|
+
stop(source, workHubActionId) {
|
|
136
|
+
const abortSource = normalizeStopSessionSource(source, workHubActionId);
|
|
136
137
|
if (this.terminalClaim)
|
|
137
138
|
return false;
|
|
138
139
|
this.terminalClaim = { owner: 'stop' };
|
|
139
140
|
this.stopped = true;
|
|
140
|
-
this.abortSource =
|
|
141
|
+
this.abortSource = abortSource;
|
|
141
142
|
return true;
|
|
142
143
|
}
|
|
143
144
|
isStopped() {
|
|
@@ -1542,7 +1543,9 @@ async function appendUserMessageOnce(store, sessionId, message) {
|
|
|
1542
1543
|
}
|
|
1543
1544
|
}
|
|
1544
1545
|
function isInteractionResumeAck(event) {
|
|
1545
|
-
return (event.type === 'sandbox_boundary_decision_ack' ||
|
|
1546
|
+
return (event.type === 'sandbox_boundary_decision_ack' ||
|
|
1547
|
+
event.type === 'user_question_answer_ack' ||
|
|
1548
|
+
event.type === 'form_answer_ack');
|
|
1546
1549
|
}
|
|
1547
1550
|
/**
|
|
1548
1551
|
* Non-terminal error content never reaches the ledger: the trailing terminal
|