@myagentroam/agent 0.11.52 → 0.11.53
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/model/anthropic-messages.d.ts +4 -0
- package/dist/model/anthropic-messages.js +1 -1
- package/dist/model/native-context.d.ts +2 -0
- package/dist/model/native-context.js +26 -0
- package/dist/runtime/context/gc-candidates-code.js +36 -21
- package/dist/runtime/context/gc-candidates-exec.js +33 -56
- package/dist/runtime/context/gc-candidates-read-patch.d.ts +1 -1
- package/dist/runtime/context/gc-candidates-read-patch.js +98 -15
- package/dist/runtime/context/gc-candidates-web.js +172 -8
- package/dist/runtime/context/gc-contracts.d.ts +2 -0
- package/dist/runtime/context/gc-economics.d.ts +0 -6
- package/dist/runtime/context/gc-economics.js +1 -23
- package/dist/runtime/context/gc-tokens.js +18 -8
- package/dist/runtime/context/gc.d.ts +1 -3
- package/dist/runtime/context/gc.js +19 -96
- package/dist/runtime/context/projection.js +11 -1
- package/dist/session/code-mode-search-projection.d.ts +5 -0
- package/dist/session/code-mode-search-projection.js +46 -0
- package/dist/session/context-gc-checkpoint.js +233 -17
- package/dist/session/context-gc-contract.d.ts +3 -2
- package/dist/session/context-gc-exec-lifecycle.d.ts +11 -0
- package/dist/session/context-gc-exec-lifecycle.js +41 -0
- package/dist/session/context-gc-markup.d.ts +1 -0
- package/dist/session/context-gc-markup.js +4 -1
- package/dist/session/context-gc-observations.d.ts +5 -1
- package/dist/session/context-gc-observations.js +186 -33
- package/dist/session/context-gc-protection.d.ts +8 -0
- package/dist/session/context-gc-protection.js +83 -0
- package/dist/session/context-gc-replacements.d.ts +6 -1
- package/dist/session/context-gc-replacements.js +54 -6
- package/dist/session/context-gc-todo.d.ts +13 -0
- package/dist/session/context-gc-todo.js +47 -0
- package/dist/session/tool-callers.d.ts +7 -0
- package/dist/session/tool-callers.js +28 -0
- package/dist/tools/callers.d.ts +1 -7
- package/dist/tools/callers.js +1 -28
- package/dist/tools/code-mode/index.d.ts +1 -3
- package/dist/tools/code-mode/index.js +3 -45
- package/package.json +1 -1
|
@@ -7,7 +7,9 @@ import { StringDecoder } from 'node:string_decoder';
|
|
|
7
7
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
8
8
|
import { AgentError, describeAgentError } from '../../error.js';
|
|
9
9
|
import { allowsDirectTool, allowsToolCaller } from '../callers.js';
|
|
10
|
-
import {
|
|
10
|
+
import { projectProgrammaticTool } from '../../session/code-mode-search-projection.js';
|
|
11
|
+
export { projectCodeModeSearchResult } from '../../session/code-mode-search-projection.js';
|
|
12
|
+
import { orderToolDefinitions, stableToolDefinition } from '../definition-projection.js';
|
|
11
13
|
import { CodeCells } from './cells.js';
|
|
12
14
|
import { newObservationId } from './observations.js';
|
|
13
15
|
import { renderObservations } from '../../session/code-observation-projection.js';
|
|
@@ -107,13 +109,6 @@ export const codeExecWaitToolDefinition = {
|
|
|
107
109
|
allowedCallers: ['direct'],
|
|
108
110
|
parallelSafety: 'safe'
|
|
109
111
|
};
|
|
110
|
-
function projectProgrammaticTool(tool) {
|
|
111
|
-
return {
|
|
112
|
-
name: tool.name,
|
|
113
|
-
description: `${allowsDirectTool(tool, true) ? `Call directly or as tools.${tool.name} inside code_exec.` : `Call only as tools.${tool.name} inside code_exec, never as a direct model tool.`}\n${tool.description}`,
|
|
114
|
-
inputSchema: stableToolSchema(tool.inputSchema)
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
112
|
/** Deferred definitions travel in search results, not in the stable Code Mode description. */
|
|
118
113
|
export function projectCodeModeTools(tools, residentTools = tools) {
|
|
119
114
|
const codeModeEnabled = tools.some((tool) => tool.name === 'code_exec' && allowsToolCaller(tool, 'direct'));
|
|
@@ -136,43 +131,6 @@ export function projectCodeModeTools(tools, residentTools = tools) {
|
|
|
136
131
|
}
|
|
137
132
|
: tool);
|
|
138
133
|
}
|
|
139
|
-
/** Preserve native search definitions while providing the same discovery evidence to other protocols. */
|
|
140
|
-
export function projectCodeModeSearchResult(message, codeModeEnabled) {
|
|
141
|
-
if (!message.toolSearchTools)
|
|
142
|
-
return message;
|
|
143
|
-
if (!codeModeEnabled)
|
|
144
|
-
return {
|
|
145
|
-
...message,
|
|
146
|
-
toolSearchTools: message.toolSearchTools
|
|
147
|
-
.filter((tool) => allowsToolCaller(tool, 'direct'))
|
|
148
|
-
.map(stableToolDefinition)
|
|
149
|
-
};
|
|
150
|
-
const tools = message.toolSearchTools.map((tool) => ({
|
|
151
|
-
...(allowsToolCaller(tool, 'programmatic')
|
|
152
|
-
? {
|
|
153
|
-
...projectProgrammaticTool(tool),
|
|
154
|
-
...(allowsDirectTool(tool, true)
|
|
155
|
-
? { inputMode: tool.inputMode ?? 'json' }
|
|
156
|
-
: {})
|
|
157
|
-
}
|
|
158
|
-
: {
|
|
159
|
-
name: tool.name,
|
|
160
|
-
description: tool.description,
|
|
161
|
-
inputSchema: stableToolSchema(tool.inputSchema),
|
|
162
|
-
inputMode: tool.inputMode ?? 'json'
|
|
163
|
-
}),
|
|
164
|
-
caller: allowsToolCaller(tool, 'programmatic')
|
|
165
|
-
? allowsDirectTool(tool, true)
|
|
166
|
-
? 'both'
|
|
167
|
-
: 'programmatic'
|
|
168
|
-
: 'direct'
|
|
169
|
-
}));
|
|
170
|
-
return {
|
|
171
|
-
...message,
|
|
172
|
-
content: JSON.stringify({ tools }),
|
|
173
|
-
toolSearchTools: tools.map(({ caller: _caller, ...tool }) => tool)
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
134
|
function defaultEngineFactory() {
|
|
177
135
|
const core = import.meta.resolve('quickjs-emscripten-core');
|
|
178
136
|
const variant = import.meta.resolve('@jitl/quickjs-wasmfile-release-sync');
|