@myagentroam/agent 0.9.140 → 0.9.142
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-core/host/contracts.d.ts +64 -0
- package/dist/{host → agent-core/host}/local-agent-host.d.ts +6 -5
- package/dist/{host → agent-core/host}/local-agent-host.js +4 -4
- package/dist/{model → agent-core/model}/anthropic-messages.js +24 -7
- package/dist/{model → agent-core/model}/contracts.d.ts +6 -16
- package/dist/{model → agent-core/model}/openai-responses.js +28 -10
- package/dist/agent-core/model/recovery.d.ts +4 -0
- package/dist/agent-core/model/recovery.js +71 -0
- package/dist/{model → agent-core/model}/sse.d.ts +2 -0
- package/dist/{model → agent-core/model}/sse.js +11 -1
- package/dist/{prompts → agent-core/prompts}/core.d.ts +3 -13
- package/dist/{prompts → agent-core/prompts}/index.d.ts +1 -1
- package/dist/{prompts → agent-core/prompts}/modes.d.ts +1 -1
- package/dist/{prompts → agent-core/prompts}/resources.d.ts +1 -1
- package/dist/{runtime/compact.d.ts → agent-core/runtime/compaction/history.d.ts} +2 -23
- package/dist/{runtime/compact.js → agent-core/runtime/compaction/history.js} +2 -92
- package/dist/agent-core/runtime/compaction/operation.d.ts +22 -0
- package/dist/agent-core/runtime/compaction/operation.js +91 -0
- package/dist/agent-core/runtime/context/contracts.d.ts +12 -0
- package/dist/{runtime/environment-context.d.ts → agent-core/runtime/context/environment.d.ts} +2 -2
- package/dist/{runtime/environment-context.js → agent-core/runtime/context/environment.js} +1 -1
- package/dist/{runtime/context-gc-runtime.d.ts → agent-core/runtime/context/gc-runtime.d.ts} +4 -4
- package/dist/{runtime/context-gc-runtime.js → agent-core/runtime/context/gc-runtime.js} +3 -3
- package/dist/{runtime/context-gc-tokens.d.ts → agent-core/runtime/context/gc-tokens.d.ts} +2 -2
- package/dist/{runtime/context-gc-tokens.js → agent-core/runtime/context/gc-tokens.js} +3 -3
- package/dist/{runtime/context-gc.d.ts → agent-core/runtime/context/gc.d.ts} +3 -3
- package/dist/{runtime/context-gc.js → agent-core/runtime/context/gc.js} +6 -6
- package/dist/{runtime → agent-core/runtime/context}/instructions.d.ts +1 -1
- package/dist/{runtime → agent-core/runtime/context}/instructions.js +1 -1
- package/dist/{runtime → agent-core/runtime/context}/normalize.d.ts +1 -1
- package/dist/{runtime/context-projection.d.ts → agent-core/runtime/context/projection.d.ts} +3 -3
- package/dist/{runtime/context-projection.js → agent-core/runtime/context/projection.js} +4 -4
- package/dist/agent-core/runtime/context/request-budget.d.ts +6 -0
- package/dist/agent-core/runtime/context/request-budget.js +22 -0
- package/dist/agent-core/runtime/context/restore.d.ts +15 -0
- package/dist/agent-core/runtime/context/restore.js +85 -0
- package/dist/agent-core/runtime/context/usage.d.ts +18 -0
- package/dist/agent-core/runtime/context/usage.js +138 -0
- package/dist/agent-core/runtime/context/world-state.d.ts +35 -0
- package/dist/agent-core/runtime/context/world-state.js +133 -0
- package/dist/agent-core/runtime/contracts.d.ts +37 -0
- package/dist/agent-core/runtime/event-projection.d.ts +5 -0
- package/dist/agent-core/runtime/event-projection.js +17 -0
- package/dist/agent-core/runtime/events.d.ts +142 -0
- package/dist/agent-core/runtime/execution.d.ts +50 -0
- package/dist/agent-core/runtime/execution.js +393 -0
- package/dist/{runtime → agent-core/runtime}/rollout-budget.d.ts +1 -1
- package/dist/agent-core/sdk/agent.js +209 -0
- package/dist/agent-core/sdk/model-runtime.d.ts +13 -0
- package/dist/agent-core/sdk/model-runtime.js +63 -0
- package/dist/agent-core/sdk/session-title.d.ts +3 -0
- package/dist/agent-core/sdk/session-title.js +42 -0
- package/dist/agent-core/sdk/session.d.ts +62 -0
- package/dist/agent-core/sdk/session.js +1147 -0
- package/dist/agent-core/sdk/subagent-backend.d.ts +3 -0
- package/dist/agent-core/sdk/subagent-backend.js +46 -0
- package/dist/agent-core/sdk/types.d.ts +56 -0
- package/dist/{session → agent-core/session}/catalog.d.ts +2 -1
- package/dist/{session → agent-core/session}/context-gc-checkpoint.js +1 -1
- package/dist/{session → agent-core/session}/jsonl-store.d.ts +2 -2
- package/dist/{session → agent-core/session}/jsonl-store.js +1 -1
- package/dist/agent-core/subagent/contracts.d.ts +91 -0
- package/dist/agent-core/subagent/contracts.js +1 -0
- package/dist/agent-core/subagent/scheduler.d.ts +117 -0
- package/dist/{subagent → agent-core/subagent}/session-controller.d.ts +3 -2
- package/dist/agent-core/tools/agent/agent-cancel.d.ts +7 -0
- package/dist/{tools → agent-core/tools/agent}/agent-cancel.js +1 -1
- package/dist/agent-core/tools/agent/agent-message.d.ts +7 -0
- package/dist/{tools → agent-core/tools/agent}/agent-message.js +2 -2
- package/dist/{tools → agent-core/tools/agent}/agent-start.d.ts +3 -3
- package/dist/{tools → agent-core/tools/agent}/agent-start.js +3 -3
- package/dist/agent-core/tools/agent/agent-wait.d.ts +7 -0
- package/dist/{tools → agent-core/tools/agent}/agent-wait.js +2 -2
- package/dist/{tools → agent-core/tools/agent}/question.d.ts +2 -2
- package/dist/{tools → agent-core/tools/agent}/question.js +2 -2
- package/dist/{tools → agent-core/tools/agent}/skill.d.ts +2 -2
- package/dist/{tools → agent-core/tools/agent}/skill.js +2 -2
- package/dist/{tools → agent-core/tools/agent}/todo-read.d.ts +2 -2
- package/dist/{tools → agent-core/tools/agent}/todo-write.d.ts +2 -2
- package/dist/{tools → agent-core/tools/agent}/todo-write.js +2 -2
- package/dist/{tools → agent-core/tools/agent}/todo.d.ts +2 -9
- package/dist/{tools → agent-core/tools/agent}/todo.js +1 -1
- package/dist/{tools → agent-core/tools}/code-mode/cells.d.ts +1 -1
- package/dist/{tools → agent-core/tools}/code-mode/dispatch.d.ts +2 -4
- package/dist/{tools → agent-core/tools}/code-mode/dispatch.js +5 -4
- package/dist/{tools → agent-core/tools}/code-mode/engine.d.ts +1 -1
- package/dist/agent-core/tools/code-mode/engine.js +1 -0
- package/dist/{tools/code-mode.d.ts → agent-core/tools/code-mode/index.d.ts} +7 -7
- package/dist/{tools/code-mode.js → agent-core/tools/code-mode/index.js} +15 -16
- package/dist/{tools → agent-core/tools}/code-mode/quickjs-engine.js +12 -2
- package/dist/{tools → agent-core/tools}/code-mode/state.d.ts +2 -13
- package/dist/agent-core/tools/code-mode/worker.d.ts +1 -0
- package/dist/agent-core/tools/contracts.d.ts +168 -0
- package/dist/agent-core/tools/contracts.js +1 -0
- package/dist/agent-core/tools/execution.d.ts +34 -0
- package/dist/agent-core/tools/execution.js +102 -0
- package/dist/agent-core/tools/local/apply-patch.d.ts +19 -0
- package/dist/{tools → agent-core/tools/local}/apply-patch.js +8 -2
- package/dist/{tools → agent-core/tools/local}/exec.d.ts +5 -17
- package/dist/{tools → agent-core/tools/local}/exec.js +4 -4
- package/dist/{tools → agent-core/tools/local}/read.d.ts +7 -15
- package/dist/{tools → agent-core/tools/local}/read.js +185 -2
- package/dist/{tools/local-registry.d.ts → agent-core/tools/local/registry.d.ts} +5 -5
- package/dist/agent-core/tools/local/registry.js +101 -0
- package/dist/{tools → agent-core/tools/local}/view-image.d.ts +4 -9
- package/dist/{tools → agent-core/tools/local}/view-image.js +2 -2
- package/dist/agent-core/tools/local/web-fetch.d.ts +4 -0
- package/dist/agent-core/tools/local/web-fetch.js +85 -0
- package/dist/agent-core/tools/local/web-search.d.ts +7 -0
- package/dist/agent-core/tools/local/web-search.js +34 -0
- package/dist/{tools/local-workspace-tools.js → agent-core/tools/local/workspace-tools.js} +1 -1
- package/dist/{sdk/mcp-catalog.d.ts → agent-core/tools/mcp/catalog.d.ts} +1 -2
- package/dist/{sdk/mcp-catalog.js → agent-core/tools/mcp/catalog.js} +1 -1
- package/dist/agent-core/tools/mcp/history.d.ts +4 -0
- package/dist/agent-core/tools/mcp/history.js +33 -0
- package/dist/{tools → agent-core/tools/mcp}/tool-search.d.ts +3 -3
- package/dist/{tools → agent-core/tools/mcp}/tool-search.js +4 -4
- package/dist/agent-core/tools/output-projection.d.ts +14 -0
- package/dist/agent-core/tools/output-projection.js +189 -0
- package/dist/{tools → agent-core/tools}/registry.d.ts +1 -1
- package/dist/agent-core/tools/registry.js +47 -0
- package/dist/{tools → agent-core/tools}/runtime-context.d.ts +8 -7
- package/dist/agent-core/tools/runtime-context.js +1 -0
- package/dist/{tools → agent-core/tools}/runtime.d.ts +1 -1
- package/dist/cli/codex-auth-file.d.ts +1 -1
- package/dist/cli/codex-auth-file.js +2 -2
- package/dist/cli/main.js +9 -9
- package/dist/index.d.ts +17 -15
- package/dist/index.js +8 -8
- package/dist/sandbox/linux/bubblewrap-sandbox-executor.d.ts +1 -1
- package/dist/sandbox/linux/bubblewrap-sandbox-executor.js +1 -1
- package/package.json +3 -3
- package/dist/host/contracts.d.ts +0 -21
- package/dist/sdk/agent.js +0 -2524
- package/dist/sdk/types.d.ts +0 -349
- package/dist/subagent/scheduler.d.ts +0 -206
- package/dist/tools/agent-cancel.d.ts +0 -7
- package/dist/tools/agent-message.d.ts +0 -7
- package/dist/tools/agent-wait.d.ts +0 -7
- package/dist/tools/apply-patch.d.ts +0 -32
- package/dist/tools/local-registry.js +0 -373
- package/dist/tools/registry.js +0 -47
- package/dist/tools/web-fetch.d.ts +0 -2
- package/dist/tools/web-fetch.js +0 -12
- package/dist/tools/web-search.d.ts +0 -2
- package/dist/tools/web-search.js +0 -15
- package/dist/{error.d.ts → agent-core/error.d.ts} +0 -0
- package/dist/{error.js → agent-core/error.js} +0 -0
- package/dist/{host → agent-core/host}/contracts.js +0 -0
- package/dist/{host → agent-core/host}/local-process-executor.d.ts +0 -0
- package/dist/{host → agent-core/host}/local-process-executor.js +0 -0
- package/dist/{host → agent-core/host}/network.d.ts +0 -0
- package/dist/{host → agent-core/host}/network.js +0 -0
- package/dist/{model → agent-core/model}/anthropic-messages.d.ts +0 -0
- package/dist/{model → agent-core/model}/anthropic-thinking.d.ts +0 -0
- package/dist/{model → agent-core/model}/anthropic-thinking.js +0 -0
- package/dist/{model → agent-core/model}/catalog-file.d.ts +0 -0
- package/dist/{model → agent-core/model}/catalog-file.js +0 -0
- package/dist/{model → agent-core/model}/configuration.d.ts +0 -0
- package/dist/{model → agent-core/model}/configuration.js +0 -0
- package/dist/{model → agent-core/model}/contracts.js +0 -0
- package/dist/{model → agent-core/model}/http.d.ts +0 -0
- package/dist/{model → agent-core/model}/http.js +0 -0
- package/dist/{model → agent-core/model}/openai-responses.d.ts +0 -0
- package/dist/{model → agent-core/model}/runtime-credential.d.ts +0 -0
- package/dist/{model → agent-core/model}/runtime-credential.js +0 -0
- package/dist/{model → agent-core/model}/transport-test.d.ts +0 -0
- package/dist/{model → agent-core/model}/transport-test.js +0 -0
- package/dist/{prompts → agent-core/prompts}/compact.d.ts +0 -0
- package/dist/{prompts → agent-core/prompts}/compact.js +0 -0
- package/dist/{prompts → agent-core/prompts}/core.js +0 -0
- package/dist/{prompts → agent-core/prompts}/execution-budget.d.ts +0 -0
- package/dist/{prompts → agent-core/prompts}/execution-budget.js +0 -0
- package/dist/{prompts → agent-core/prompts}/index.js +0 -0
- package/dist/{prompts → agent-core/prompts}/modes.js +0 -0
- package/dist/{prompts → agent-core/prompts}/output.d.ts +0 -0
- package/dist/{prompts → agent-core/prompts}/output.js +0 -0
- package/dist/{prompts → agent-core/prompts}/resources.js +0 -0
- package/dist/{prompts → agent-core/prompts}/subagent.d.ts +0 -0
- package/dist/{prompts → agent-core/prompts}/subagent.js +0 -0
- package/dist/{prompts → agent-core/prompts}/title.d.ts +0 -0
- package/dist/{prompts → agent-core/prompts}/title.js +0 -0
- package/dist/{prompts → agent-core/prompts}/workflow.d.ts +0 -0
- package/dist/{prompts → agent-core/prompts}/workflow.js +0 -0
- package/dist/{runtime → agent-core/runtime}/async-queue.d.ts +0 -0
- package/dist/{runtime → agent-core/runtime}/async-queue.js +0 -0
- package/dist/{sdk/types.js → agent-core/runtime/context/contracts.js} +0 -0
- package/dist/{runtime → agent-core/runtime/context}/normalize.js +0 -0
- package/dist/{session/types.js → agent-core/runtime/contracts.js} +0 -0
- package/dist/{tools/code-mode/engine.js → agent-core/runtime/events.js} +0 -0
- package/dist/{runtime → agent-core/runtime}/execution-policy.d.ts +0 -0
- package/dist/{runtime → agent-core/runtime}/execution-policy.js +0 -0
- package/dist/{runtime → agent-core/runtime}/plan-output.d.ts +0 -0
- package/dist/{runtime → agent-core/runtime}/plan-output.js +0 -0
- package/dist/{runtime → agent-core/runtime}/rollout-budget.js +0 -0
- package/dist/{runtime → agent-core/runtime}/token-budget.d.ts +0 -0
- package/dist/{runtime → agent-core/runtime}/token-budget.js +0 -0
- package/dist/{sdk → agent-core/sdk}/agent.d.ts +0 -0
- package/dist/{tools/code-mode/worker.d.ts → agent-core/sdk/types.js} +0 -0
- package/dist/{session → agent-core/session}/catalog.js +0 -0
- package/dist/{session → agent-core/session}/context-gc-checkpoint.d.ts +0 -0
- package/dist/{session → agent-core/session}/context-gc-replacements.d.ts +0 -0
- package/dist/{session → agent-core/session}/context-gc-replacements.js +0 -0
- package/dist/{session → agent-core/session}/context-gc-subagent.d.ts +0 -0
- package/dist/{session → agent-core/session}/context-gc-subagent.js +0 -0
- package/dist/{session → agent-core/session}/transaction-recovery.d.ts +0 -0
- package/dist/{session → agent-core/session}/transaction-recovery.js +0 -0
- package/dist/{session → agent-core/session}/types.d.ts +0 -0
- package/dist/{tools/runtime-context.js → agent-core/session/types.js} +0 -0
- package/dist/{subagent → agent-core/subagent}/scheduler.js +0 -0
- package/dist/{subagent → agent-core/subagent}/session-controller.js +0 -0
- package/dist/{tools → agent-core/tools/agent}/todo-read.js +0 -0
- package/dist/{tools → agent-core/tools}/callers.d.ts +0 -0
- package/dist/{tools → agent-core/tools}/callers.js +0 -0
- package/dist/{tools → agent-core/tools}/code-mode/cells.js +1 -1
- /package/dist/{tools → agent-core/tools}/code-mode/quickjs-engine.d.ts +0 -0
- /package/dist/{tools → agent-core/tools}/code-mode/state.js +0 -0
- /package/dist/{tools → agent-core/tools}/code-mode/text-output.d.ts +0 -0
- /package/dist/{tools → agent-core/tools}/code-mode/text-output.js +0 -0
- /package/dist/{tools → agent-core/tools}/code-mode/worker.js +0 -0
- /package/dist/{tools → agent-core/tools}/execution-limits.d.ts +0 -0
- /package/dist/{tools → agent-core/tools}/execution-limits.js +0 -0
- /package/dist/{tools → agent-core/tools/local}/read-context.d.ts +0 -0
- /package/dist/{tools → agent-core/tools/local}/read-context.js +0 -0
- /package/dist/{tools/local-workspace-tools.d.ts → agent-core/tools/local/workspace-tools.d.ts} +0 -0
- /package/dist/{tools → agent-core/tools}/runtime.js +0 -0
- /package/dist/{tools → agent-core/tools}/scheduler.d.ts +0 -0
- /package/dist/{tools → agent-core/tools}/scheduler.js +0 -0
- /package/dist/{tools → agent-core/tools}/shared/path-resolver.d.ts +0 -0
- /package/dist/{tools → agent-core/tools}/shared/path-resolver.js +0 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { MarAgentError } from '../error.js';
|
|
2
|
+
import { AGENT_EXECUTION_POLICY } from '../runtime/execution-policy.js';
|
|
3
|
+
import { countModelTokens, countTextLines, truncateModelText } from '../runtime/token-budget.js';
|
|
4
|
+
import { TOOL_EXECUTION_LIMITS } from './execution-limits.js';
|
|
5
|
+
export function currentExecutionImages(modelInputImages, toolImages) {
|
|
6
|
+
return [
|
|
7
|
+
...(modelInputImages ?? []).map((image) => ({
|
|
8
|
+
mimeType: image.mimeType,
|
|
9
|
+
data: Buffer.from(image.dataBase64, 'base64')
|
|
10
|
+
})),
|
|
11
|
+
...toolImages
|
|
12
|
+
]
|
|
13
|
+
.slice(-5)
|
|
14
|
+
.map((image) => ({ mimeType: image.mimeType, data: Buffer.from(image.data) }));
|
|
15
|
+
}
|
|
16
|
+
export function boundedModelToolOutput(toolName, value, data) {
|
|
17
|
+
const execDiagnostics = (toolName === 'exec' || toolName === 'exec_wait') &&
|
|
18
|
+
isRecord(data) &&
|
|
19
|
+
typeof data.stdout === 'string' &&
|
|
20
|
+
typeof data.stderr === 'string'
|
|
21
|
+
? {
|
|
22
|
+
originalTokenCount: countModelTokens(data.stdout) + countModelTokens(data.stderr),
|
|
23
|
+
totalLines: countTextLines(data.stdout) + countTextLines(data.stderr)
|
|
24
|
+
}
|
|
25
|
+
: undefined;
|
|
26
|
+
const result = truncateModelText(value, AGENT_EXECUTION_POLICY.modelToolOutputTokens, 'tool output', execDiagnostics);
|
|
27
|
+
return { content: result.content, truncated: result.truncated };
|
|
28
|
+
}
|
|
29
|
+
/** Project only known, validated tool result shapes into public structured events. */
|
|
30
|
+
export function structuredToolEventData(toolName, value) {
|
|
31
|
+
if (!isRecord(value))
|
|
32
|
+
return undefined;
|
|
33
|
+
if ((toolName === 'code_exec' || toolName === 'code_exec_wait') &&
|
|
34
|
+
typeof value.cellId === 'string' &&
|
|
35
|
+
['running', 'completed', 'failed', 'cancelled'].includes(String(value.status)))
|
|
36
|
+
return {
|
|
37
|
+
cellId: value.cellId,
|
|
38
|
+
status: value.status,
|
|
39
|
+
cached: value.cached === true
|
|
40
|
+
};
|
|
41
|
+
if ((toolName === 'agent_start' ||
|
|
42
|
+
toolName === 'agent_wait' ||
|
|
43
|
+
toolName === 'agent_message' ||
|
|
44
|
+
toolName === 'agent_cancel') &&
|
|
45
|
+
isSubagentTaskSnapshot(value))
|
|
46
|
+
return value;
|
|
47
|
+
if (toolName === 'read' &&
|
|
48
|
+
value.mode === 'batch' &&
|
|
49
|
+
Array.isArray(value.results) &&
|
|
50
|
+
typeof value.truncated === 'boolean' &&
|
|
51
|
+
value.results.every((result) => isRecord(result) &&
|
|
52
|
+
typeof result.path === 'string' &&
|
|
53
|
+
(result.startLine === undefined || isNonnegativeInteger(result.startLine)) &&
|
|
54
|
+
(result.endLine === undefined || isNonnegativeInteger(result.endLine)) &&
|
|
55
|
+
(result.error === undefined ||
|
|
56
|
+
(isRecord(result.error) &&
|
|
57
|
+
typeof result.error.code === 'string' &&
|
|
58
|
+
typeof result.error.message === 'string')))) {
|
|
59
|
+
const result = value;
|
|
60
|
+
return {
|
|
61
|
+
mode: 'batch',
|
|
62
|
+
truncated: result.truncated,
|
|
63
|
+
results: result.results.map((item) => ({
|
|
64
|
+
path: item.path,
|
|
65
|
+
...('startLine' in item && item.startLine !== undefined
|
|
66
|
+
? { startLine: item.startLine }
|
|
67
|
+
: {}),
|
|
68
|
+
...('endLine' in item && item.endLine !== undefined ? { endLine: item.endLine } : {}),
|
|
69
|
+
...('error' in item ? { error: { ...item.error } } : {})
|
|
70
|
+
}))
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
if (toolName === 'view_image' &&
|
|
74
|
+
typeof value.path === 'string' &&
|
|
75
|
+
(value.mimeType === 'image/png' ||
|
|
76
|
+
value.mimeType === 'image/jpeg' ||
|
|
77
|
+
value.mimeType === 'image/webp') &&
|
|
78
|
+
isNonnegativeInteger(value.bytes) &&
|
|
79
|
+
typeof value.sha256 === 'string' &&
|
|
80
|
+
/^[a-f0-9]{64}$/u.test(value.sha256))
|
|
81
|
+
return value;
|
|
82
|
+
if ((toolName === 'exec' || toolName === 'exec_wait') &&
|
|
83
|
+
(value.status === 'running' || value.status === 'completed' || value.status === 'cancelled') &&
|
|
84
|
+
typeof value.stdout === 'string' &&
|
|
85
|
+
typeof value.stderr === 'string' &&
|
|
86
|
+
typeof value.truncated === 'boolean' &&
|
|
87
|
+
(value.processId === undefined || typeof value.processId === 'string') &&
|
|
88
|
+
(value.exitCode === undefined ||
|
|
89
|
+
value.exitCode === null ||
|
|
90
|
+
(typeof value.exitCode === 'number' && Number.isInteger(value.exitCode))) &&
|
|
91
|
+
isNonnegativeInteger(value.stdoutBytes) &&
|
|
92
|
+
isNonnegativeInteger(value.stderrBytes) &&
|
|
93
|
+
isNonnegativeInteger(value.stdoutDroppedBytes) &&
|
|
94
|
+
isNonnegativeInteger(value.stderrDroppedBytes))
|
|
95
|
+
return value;
|
|
96
|
+
if (toolName === 'apply_patch' &&
|
|
97
|
+
Array.isArray(value.files) &&
|
|
98
|
+
value.files.every((file) => isRecord(file) &&
|
|
99
|
+
typeof file.path === 'string' &&
|
|
100
|
+
file.path.length > 0 &&
|
|
101
|
+
(file.targetPath === undefined || typeof file.targetPath === 'string') &&
|
|
102
|
+
(file.operation === 'added' ||
|
|
103
|
+
file.operation === 'modified' ||
|
|
104
|
+
file.operation === 'deleted' ||
|
|
105
|
+
file.operation === 'moved') &&
|
|
106
|
+
isNonnegativeInteger(file.addedLines) &&
|
|
107
|
+
isNonnegativeInteger(file.deletedLines)) &&
|
|
108
|
+
isRecord(value.totals) &&
|
|
109
|
+
isNonnegativeInteger(value.totals.files) &&
|
|
110
|
+
isNonnegativeInteger(value.totals.addedLines) &&
|
|
111
|
+
isNonnegativeInteger(value.totals.deletedLines))
|
|
112
|
+
return value;
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
export function structuredToolArtifacts(value) {
|
|
116
|
+
if (value === undefined)
|
|
117
|
+
return undefined;
|
|
118
|
+
if (value.length !== 1 ||
|
|
119
|
+
value.some((artifact) => artifact.kind !== 'image' ||
|
|
120
|
+
artifact.mimeType !== 'image/png' ||
|
|
121
|
+
typeof artifact.name !== 'string' ||
|
|
122
|
+
artifact.name.length === 0 ||
|
|
123
|
+
typeof artifact.fileName !== 'string' ||
|
|
124
|
+
!/^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}\.png$/u.test(artifact.fileName) ||
|
|
125
|
+
!isNonnegativeInteger(artifact.byteSize) ||
|
|
126
|
+
typeof artifact.sha256 !== 'string' ||
|
|
127
|
+
!/^[a-f0-9]{64}$/u.test(artifact.sha256)))
|
|
128
|
+
throw new MarAgentError('MAR_AGENT_TOOL_OUTPUT_INVALID', 'Tool image artifact is invalid.');
|
|
129
|
+
return value.map((artifact) => ({ ...artifact }));
|
|
130
|
+
}
|
|
131
|
+
function isRecord(value) {
|
|
132
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
133
|
+
}
|
|
134
|
+
function isSubagentTaskSnapshot(value) {
|
|
135
|
+
return (typeof value.agentId === 'string' &&
|
|
136
|
+
value.agentId.length > 0 &&
|
|
137
|
+
value.agentId.length <= 128 &&
|
|
138
|
+
typeof value.description === 'string' &&
|
|
139
|
+
value.description.length > 0 &&
|
|
140
|
+
value.description.length <= TOOL_EXECUTION_LIMITS.subagentDescriptionMaxCharacters &&
|
|
141
|
+
(value.status === 'queued' ||
|
|
142
|
+
value.status === 'running' ||
|
|
143
|
+
value.status === 'completed' ||
|
|
144
|
+
value.status === 'failed' ||
|
|
145
|
+
value.status === 'cancelled' ||
|
|
146
|
+
value.status === 'interrupted') &&
|
|
147
|
+
(value.modelId === undefined || typeof value.modelId === 'string') &&
|
|
148
|
+
(value.modelName === undefined || typeof value.modelName === 'string') &&
|
|
149
|
+
(value.reasoningEffort === undefined ||
|
|
150
|
+
(typeof value.reasoningEffort === 'string' &&
|
|
151
|
+
['low', 'medium', 'high', 'xhigh', 'max', 'ultra'].includes(value.reasoningEffort))) &&
|
|
152
|
+
(value.waitOutcome === undefined ||
|
|
153
|
+
value.waitOutcome === 'snapshot' ||
|
|
154
|
+
value.waitOutcome === 'message' ||
|
|
155
|
+
value.waitOutcome === 'completion' ||
|
|
156
|
+
value.waitOutcome === 'timeout') &&
|
|
157
|
+
(value.latestMessage === undefined ||
|
|
158
|
+
(isRecord(value.latestMessage) &&
|
|
159
|
+
typeof value.latestMessage.itemId === 'string' &&
|
|
160
|
+
typeof value.latestMessage.turnId === 'string' &&
|
|
161
|
+
(value.latestMessage.phase === 'commentary' ||
|
|
162
|
+
value.latestMessage.phase === 'final_answer') &&
|
|
163
|
+
typeof value.latestMessage.text === 'string' &&
|
|
164
|
+
typeof value.latestMessage.timestamp === 'string' &&
|
|
165
|
+
typeof value.latestMessage.truncated === 'boolean')) &&
|
|
166
|
+
(value.summary === undefined || typeof value.summary === 'string') &&
|
|
167
|
+
(value.changedFiles === undefined ||
|
|
168
|
+
(Array.isArray(value.changedFiles) &&
|
|
169
|
+
value.changedFiles.every((path) => typeof path === 'string'))) &&
|
|
170
|
+
(value.verification === undefined ||
|
|
171
|
+
(Array.isArray(value.verification) &&
|
|
172
|
+
value.verification.every((item) => typeof item === 'string'))) &&
|
|
173
|
+
(value.evidence === undefined ||
|
|
174
|
+
(Array.isArray(value.evidence) &&
|
|
175
|
+
value.evidence.every((item) => isRecord(item) &&
|
|
176
|
+
typeof item.path === 'string' &&
|
|
177
|
+
(item.startLine === undefined ||
|
|
178
|
+
(typeof item.startLine === 'number' &&
|
|
179
|
+
Number.isInteger(item.startLine) &&
|
|
180
|
+
item.startLine >= 1)) &&
|
|
181
|
+
(item.endLine === undefined ||
|
|
182
|
+
(typeof item.endLine === 'number' &&
|
|
183
|
+
Number.isInteger(item.endLine) &&
|
|
184
|
+
item.endLine >= 1))))) &&
|
|
185
|
+
(value.errorCode === undefined || typeof value.errorCode === 'string'));
|
|
186
|
+
}
|
|
187
|
+
function isNonnegativeInteger(value) {
|
|
188
|
+
return typeof value === 'number' && Number.isInteger(value) && value >= 0;
|
|
189
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ClientToolDefinition } from '../model/contracts.js';
|
|
2
|
-
import type { ToolExecutionResult } from '
|
|
2
|
+
import type { ToolExecutionResult } from './contracts.js';
|
|
3
3
|
import type { ToolRuntimeContext } from './runtime-context.js';
|
|
4
4
|
export declare const BUILTIN_TOOL_DEFINITIONS: readonly ClientToolDefinition[];
|
|
5
5
|
type RuntimeHandler = (arguments_: unknown, context: ToolRuntimeContext, callId: string) => Promise<ToolExecutionResult>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { agentCancelToolDefinition, executeAgentCancel } from './agent/agent-cancel.js';
|
|
2
|
+
import { agentMessageToolDefinition, executeAgentMessage } from './agent/agent-message.js';
|
|
3
|
+
import { agentStartToolDefinition, executeAgentStart } from './agent/agent-start.js';
|
|
4
|
+
import { agentWaitToolDefinition, executeAgentWait } from './agent/agent-wait.js';
|
|
5
|
+
import { applyPatchToolDefinition } from './local/apply-patch.js';
|
|
6
|
+
import { codeExecWaitToolDefinition, codeModeToolDefinition } from './code-mode/index.js';
|
|
7
|
+
import { execToolDefinition, execWaitToolDefinition } from './local/exec.js';
|
|
8
|
+
import { executeQuestion, questionToolDefinition } from './agent/question.js';
|
|
9
|
+
import { readToolDefinition } from './local/read.js';
|
|
10
|
+
import { executeSkill, skillToolDefinition } from './agent/skill.js';
|
|
11
|
+
import { executeTodoRead, todoReadToolDefinition } from './agent/todo-read.js';
|
|
12
|
+
import { executeTodoWrite, todoWriteToolDefinition } from './agent/todo-write.js';
|
|
13
|
+
import { executeToolSearch, toolSearchToolDefinition } from './mcp/tool-search.js';
|
|
14
|
+
import { viewImageToolDefinition } from './local/view-image.js';
|
|
15
|
+
import { webFetchToolDefinition } from './local/web-fetch.js';
|
|
16
|
+
import { webSearchToolDefinition } from './local/web-search.js';
|
|
17
|
+
export const BUILTIN_TOOL_DEFINITIONS = [
|
|
18
|
+
skillToolDefinition,
|
|
19
|
+
toolSearchToolDefinition,
|
|
20
|
+
readToolDefinition,
|
|
21
|
+
viewImageToolDefinition,
|
|
22
|
+
execToolDefinition,
|
|
23
|
+
execWaitToolDefinition,
|
|
24
|
+
codeModeToolDefinition,
|
|
25
|
+
codeExecWaitToolDefinition,
|
|
26
|
+
applyPatchToolDefinition,
|
|
27
|
+
questionToolDefinition,
|
|
28
|
+
todoReadToolDefinition,
|
|
29
|
+
todoWriteToolDefinition,
|
|
30
|
+
agentStartToolDefinition,
|
|
31
|
+
agentWaitToolDefinition,
|
|
32
|
+
agentMessageToolDefinition,
|
|
33
|
+
agentCancelToolDefinition,
|
|
34
|
+
webSearchToolDefinition,
|
|
35
|
+
webFetchToolDefinition
|
|
36
|
+
];
|
|
37
|
+
export const AGENT_TOOL_HANDLERS = new Map([
|
|
38
|
+
['skill', executeSkill],
|
|
39
|
+
['tool_search', executeToolSearch],
|
|
40
|
+
['question', executeQuestion],
|
|
41
|
+
['todo_read', (_arguments, context) => executeTodoRead(context)],
|
|
42
|
+
['todo_write', executeTodoWrite],
|
|
43
|
+
['agent_start', executeAgentStart],
|
|
44
|
+
['agent_wait', executeAgentWait],
|
|
45
|
+
['agent_message', executeAgentMessage],
|
|
46
|
+
['agent_cancel', executeAgentCancel]
|
|
47
|
+
]);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MarAgentHost } from '../host/contracts.js';
|
|
2
|
+
import type { ExecutionMode } from '../runtime/contracts.js';
|
|
3
|
+
import type { AgentSkill } from '../runtime/context/instructions.js';
|
|
2
4
|
import type { SubagentController, SubagentLatestMessage } from '../subagent/scheduler.js';
|
|
3
|
-
import type { TodoStore } from './todo.js';
|
|
4
|
-
import type { AgentSkill } from '../runtime/instructions.js';
|
|
5
|
+
import type { TodoStore } from './agent/todo.js';
|
|
5
6
|
export type ToolRuntimeEvent = {
|
|
6
7
|
type: 'todo.updated';
|
|
7
8
|
revision: number;
|
|
8
|
-
items: readonly import('./todo.js').TodoItem[];
|
|
9
|
+
items: readonly import('./agent/todo.js').TodoItem[];
|
|
9
10
|
} | {
|
|
10
11
|
type: 'user_input.requested';
|
|
11
12
|
requestId: string;
|
|
@@ -44,10 +45,10 @@ export interface ToolRuntimeContext {
|
|
|
44
45
|
sessionId: string;
|
|
45
46
|
executionId: string;
|
|
46
47
|
signal: AbortSignal;
|
|
47
|
-
codeMode?: import('
|
|
48
|
+
codeMode?: import('./contracts.js').ToolExecutionContext['codeMode'];
|
|
48
49
|
skills: ReadonlyMap<string, AgentSkill>;
|
|
49
50
|
recentImages?: readonly ToolRuntimeImage[];
|
|
50
|
-
searchMcpTools?: (input: unknown, signal: AbortSignal) => Promise<import('
|
|
51
|
-
expectedMcpTool?: import('
|
|
51
|
+
searchMcpTools?: (input: unknown, signal: AbortSignal) => Promise<import('./contracts.js').ToolExecutionResult>;
|
|
52
|
+
expectedMcpTool?: import('./contracts.js').McpToolCallContext['expectedTool'];
|
|
52
53
|
emit(event: ToolRuntimeEvent): Promise<void>;
|
|
53
54
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ToolRuntimeContext } from './runtime-context.js';
|
|
2
|
-
export declare function executeRegisteredTool(name: string, arguments_: unknown, callId: string, context: ToolRuntimeContext): Promise<import("
|
|
2
|
+
export declare function executeRegisteredTool(name: string, arguments_: unknown, callId: string, context: ToolRuntimeContext): Promise<import("./contracts.js").ToolExecutionResult>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ModelCredential, type ModelCredentialAcquireReason, type ModelCredentialProvider } from '../model/configuration.js';
|
|
1
|
+
import { type ModelCredential, type ModelCredentialAcquireReason, type ModelCredentialProvider } from '../agent-core/model/configuration.js';
|
|
2
2
|
export declare class CodexAuthFileCredentialProvider implements ModelCredentialProvider {
|
|
3
3
|
#private;
|
|
4
4
|
constructor(path: string);
|
|
@@ -3,8 +3,8 @@ import { constants } from 'node:fs';
|
|
|
3
3
|
import { lstat, open, readFile } from 'node:fs/promises';
|
|
4
4
|
import { promisify } from 'node:util';
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
import { MarAgentError } from '../error.js';
|
|
7
|
-
import { SecretValue } from '../model/configuration.js';
|
|
6
|
+
import { MarAgentError } from '../agent-core/error.js';
|
|
7
|
+
import { SecretValue } from '../agent-core/model/configuration.js';
|
|
8
8
|
const MAX_AUTH_FILE_BYTES = 1024 * 1024;
|
|
9
9
|
const TOKEN_MAX_BYTES = 131_072;
|
|
10
10
|
const AUTH_FALLBACK_LIFETIME_MS = 8 * 24 * 60 * 60 * 1000;
|
package/dist/cli/main.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { homedir } from 'node:os';
|
|
3
3
|
import { resolve } from 'node:path';
|
|
4
|
-
import { createInterface } from 'node:readline/promises';
|
|
5
4
|
import { stdin, stdout } from 'node:process';
|
|
5
|
+
import { createInterface } from 'node:readline/promises';
|
|
6
|
+
import { describeMarAgentError, MarAgentError } from '../agent-core/error.js';
|
|
7
|
+
import { LocalAgentHost } from '../agent-core/host/local-agent-host.js';
|
|
8
|
+
import { AnthropicMessagesAdapter } from '../agent-core/model/anthropic-messages.js';
|
|
9
|
+
import { readModelCatalog, writeModelCatalog } from '../agent-core/model/catalog-file.js';
|
|
10
|
+
import { marAgentReasoningEffortSchema, resolveModelDefaultReasoningEffort, SecretValue } from '../agent-core/model/configuration.js';
|
|
11
|
+
import { OpenAiResponsesAdapter } from '../agent-core/model/openai-responses.js';
|
|
12
|
+
import { DEFAULT_COMPACTION_FOCUS } from '../agent-core/runtime/compaction/history.js';
|
|
13
|
+
import { createMarAgent } from '../agent-core/sdk/agent.js';
|
|
6
14
|
import { CodexAuthFileCredentialProvider } from './codex-auth-file.js';
|
|
7
|
-
import { describeMarAgentError, MarAgentError } from '../error.js';
|
|
8
|
-
import { LocalAgentHost } from '../host/local-agent-host.js';
|
|
9
|
-
import { readModelCatalog, writeModelCatalog } from '../model/catalog-file.js';
|
|
10
|
-
import { marAgentReasoningEffortSchema, resolveModelDefaultReasoningEffort, SecretValue } from '../model/configuration.js';
|
|
11
|
-
import { AnthropicMessagesAdapter } from '../model/anthropic-messages.js';
|
|
12
|
-
import { OpenAiResponsesAdapter } from '../model/openai-responses.js';
|
|
13
|
-
import { DEFAULT_COMPACTION_FOCUS } from '../runtime/compact.js';
|
|
14
|
-
import { createMarAgent } from '../sdk/agent.js';
|
|
15
15
|
const HELP = `maragent - MAR coding agent
|
|
16
16
|
|
|
17
17
|
Usage:
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
export { MarAgentError } from './error.js';
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export type
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export type {
|
|
12
|
-
export type
|
|
13
|
-
export {
|
|
14
|
-
export type {
|
|
15
|
-
export
|
|
1
|
+
export { MarAgentError } from './agent-core/error.js';
|
|
2
|
+
export { MAR_AGENT_HOST_API_VERSION, negotiateHost, type HostDescription, type MarAgentHostCapability } from './agent-core/host/contracts.js';
|
|
3
|
+
export type { HostExecutionExtensions, HostSessionResourceSnapshot, HostSkill, MarAgentHost } from './agent-core/host/contracts.js';
|
|
4
|
+
export { LocalAgentHost, selectExecutionShell, type LocalAgentExecutionExtensions, type LocalAgentExecutionMcpBinding, type LocalAgentMcpBinding } from './agent-core/host/local-agent-host.js';
|
|
5
|
+
export type { LocalProcessExecutor, LocalProcessSpawnRequest } from './agent-core/host/local-process-executor.js';
|
|
6
|
+
export { SecretValue, marAgentReasoningEffortSchema, parseModelCatalog, resolveModelDefaultReasoningEffort, type MarAgentModelConfiguration, type MarAgentReasoningEffort, type ModelCatalog, type ModelCredential, type ModelCredentialAcquireReason, type ModelCredentialProvider, type ResponsesTransport } from './agent-core/model/configuration.js';
|
|
7
|
+
export { testMarAgentModelTransport } from './agent-core/model/transport-test.js';
|
|
8
|
+
export type { AccessMode, ExecutionMode, ExecutionResult, MarAgentImageMetadata, RolloutBudgetOptions, RunInput, RunInputImage } from './agent-core/runtime/contracts.js';
|
|
9
|
+
export type { MarAgentEvent } from './agent-core/runtime/events.js';
|
|
10
|
+
export { createMarAgent } from './agent-core/sdk/agent.js';
|
|
11
|
+
export type { CreateMarAgentOptions, CreateSessionInput, ExecutionHandle, MarAgent, MarAgentSession } from './agent-core/sdk/types.js';
|
|
12
|
+
export { openMarAgentSessionCatalog, type MarAgentContextUsage, type MarAgentHistoryEntry, type MarAgentHistoryPage, type MarAgentSessionCatalog, type MarAgentSessionDeleteResult, type MarAgentSessionImage, type MarAgentSessionPage, type MarAgentSessionSummary } from './agent-core/session/catalog.js';
|
|
13
|
+
export type { SessionListInput, SessionSource } from './agent-core/session/types.js';
|
|
14
|
+
export type { ApplyPatchFileResult, ApplyPatchResult, ClientToolDefinition, MarAgentToolArtifact, MarAgentToolImageArtifact, McpCatalogTool, McpToolCallContext, McpToolCatalog, McpToolCatalogContext, ToolCall, ToolCaller, ToolExecutionContext, ToolExecutionResult } from './agent-core/tools/contracts.js';
|
|
15
|
+
export { MCP_DEFINITION_LIMITS, assertMcpToolCatalog, assertMcpToolDefinition } from './agent-core/tools/mcp/catalog.js';
|
|
16
|
+
export type { WorkspacePathMount } from './agent-core/tools/shared/path-resolver.js';
|
|
17
|
+
export type { CodeModeEngine, CodeModeEngineFactory, CreateCodeModeEngine } from './agent-core/tools/code-mode/engine.js';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { MarAgentError } from './error.js';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export { testMarAgentModelTransport } from './model/transport-test.js';
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
1
|
+
export { MarAgentError } from './agent-core/error.js';
|
|
2
|
+
export { MAR_AGENT_HOST_API_VERSION, negotiateHost } from './agent-core/host/contracts.js';
|
|
3
|
+
export { LocalAgentHost, selectExecutionShell } from './agent-core/host/local-agent-host.js';
|
|
4
|
+
export { SecretValue, marAgentReasoningEffortSchema, parseModelCatalog, resolveModelDefaultReasoningEffort } from './agent-core/model/configuration.js';
|
|
5
|
+
export { testMarAgentModelTransport } from './agent-core/model/transport-test.js';
|
|
6
|
+
export { createMarAgent } from './agent-core/sdk/agent.js';
|
|
7
|
+
export { openMarAgentSessionCatalog } from './agent-core/session/catalog.js';
|
|
8
|
+
export { MCP_DEFINITION_LIMITS, assertMcpToolCatalog, assertMcpToolDefinition } from './agent-core/tools/mcp/catalog.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ChildProcessWithoutNullStreams } from 'node:child_process';
|
|
2
|
-
import type { LocalProcessExecutor, LocalProcessSpawnRequest } from '../../host/local-process-executor.js';
|
|
2
|
+
import type { LocalProcessExecutor, LocalProcessSpawnRequest } from '../../agent-core/host/local-process-executor.js';
|
|
3
3
|
import { type BubblewrapSandboxExecutorOptions } from './profile.js';
|
|
4
4
|
/** Compiles one process request into the fixed Linux Bubblewrap policy. */
|
|
5
5
|
export declare class BubblewrapSandboxExecutor implements LocalProcessExecutor {
|
|
@@ -4,7 +4,7 @@ import { lstat, mkdtemp, realpath, rm, writeFile } from 'node:fs/promises';
|
|
|
4
4
|
import { tmpdir } from 'node:os';
|
|
5
5
|
import { isAbsolute, join, posix, relative, resolve, sep } from 'node:path';
|
|
6
6
|
import { promisify } from 'node:util';
|
|
7
|
-
import { MarAgentError } from '../../error.js';
|
|
7
|
+
import { MarAgentError } from '../../agent-core/error.js';
|
|
8
8
|
import { LINUX_BUBBLEWRAP_SANDBOX_POLICY_VERSION } from './profile.js';
|
|
9
9
|
const execFileAsync = promisify(execFile);
|
|
10
10
|
const DEFAULT_BUBBLEWRAP_PATH = '/usr/bin/bwrap';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myagentroam/agent",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.142",
|
|
4
4
|
"description": "Embeddable MAR coding agent SDK and CLI.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"default": "./dist/sandbox/linux/index.js"
|
|
21
21
|
},
|
|
22
22
|
"./host/network": {
|
|
23
|
-
"types": "./dist/host/network.d.ts",
|
|
24
|
-
"default": "./dist/host/network.js"
|
|
23
|
+
"types": "./dist/agent-core/host/network.d.ts",
|
|
24
|
+
"default": "./dist/agent-core/host/network.js"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"bin": {
|
package/dist/host/contracts.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare const MAR_AGENT_HOST_API_VERSION = "1.0";
|
|
2
|
-
export type MarAgentHostCapability = 'workspace.read' | 'workspace.patch' | 'process.manage' | 'code.execute' | 'user-input.request' | 'event.publish' | 'session.store' | 'mcp.tools' | 'image.read' | 'web.search' | 'web.fetch';
|
|
3
|
-
export interface HostDescription {
|
|
4
|
-
apiVersion: string;
|
|
5
|
-
mode: 'normal' | 'node';
|
|
6
|
-
homeDirectory: string;
|
|
7
|
-
platform: 'linux' | 'darwin' | 'win32';
|
|
8
|
-
architecture?: string;
|
|
9
|
-
shell?: {
|
|
10
|
-
readonly name: string;
|
|
11
|
-
readonly path: string;
|
|
12
|
-
};
|
|
13
|
-
guaranteedCommands?: Readonly<Record<string, string>>;
|
|
14
|
-
capabilities: readonly MarAgentHostCapability[];
|
|
15
|
-
limits: {
|
|
16
|
-
maxProcesses: number;
|
|
17
|
-
maxOutputBytes: number;
|
|
18
|
-
maxExecutionMs: number;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export declare function negotiateHost(description: HostDescription): HostDescription;
|