@myagentroam/agent 0.11.52 → 0.11.54

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.
Files changed (46) hide show
  1. package/dist/model/anthropic-messages.d.ts +4 -0
  2. package/dist/model/anthropic-messages.js +1 -1
  3. package/dist/model/native-context.d.ts +6 -0
  4. package/dist/model/native-context.js +15 -0
  5. package/dist/runtime/compaction/retained-context.d.ts +5 -0
  6. package/dist/runtime/compaction/retained-context.js +44 -1
  7. package/dist/runtime/context/gc-candidates-code.js +36 -21
  8. package/dist/runtime/context/gc-candidates-exec.js +33 -56
  9. package/dist/runtime/context/gc-candidates-read-patch.d.ts +1 -1
  10. package/dist/runtime/context/gc-candidates-read-patch.js +98 -15
  11. package/dist/runtime/context/gc-candidates-web.js +172 -8
  12. package/dist/runtime/context/gc-contracts.d.ts +2 -0
  13. package/dist/runtime/context/gc-economics.d.ts +0 -6
  14. package/dist/runtime/context/gc-economics.js +1 -23
  15. package/dist/runtime/context/gc-tokens.js +18 -8
  16. package/dist/runtime/context/gc.d.ts +1 -3
  17. package/dist/runtime/context/gc.js +19 -96
  18. package/dist/runtime/context/projection.js +11 -1
  19. package/dist/sdk/execution-compact-commit.d.ts +4 -2
  20. package/dist/sdk/execution-compact-commit.js +7 -3
  21. package/dist/sdk/execution-compaction.d.ts +1 -1
  22. package/dist/sdk/execution-compaction.js +21 -16
  23. package/dist/sdk/session-execution-factory.js +2 -1
  24. package/dist/session/code-mode-search-projection.d.ts +5 -0
  25. package/dist/session/code-mode-search-projection.js +46 -0
  26. package/dist/session/context-gc-checkpoint.js +233 -17
  27. package/dist/session/context-gc-contract.d.ts +3 -2
  28. package/dist/session/context-gc-exec-lifecycle.d.ts +11 -0
  29. package/dist/session/context-gc-exec-lifecycle.js +41 -0
  30. package/dist/session/context-gc-markup.d.ts +1 -0
  31. package/dist/session/context-gc-markup.js +4 -1
  32. package/dist/session/context-gc-observations.d.ts +5 -1
  33. package/dist/session/context-gc-observations.js +186 -33
  34. package/dist/session/context-gc-protection.d.ts +8 -0
  35. package/dist/session/context-gc-protection.js +83 -0
  36. package/dist/session/context-gc-replacements.d.ts +6 -1
  37. package/dist/session/context-gc-replacements.js +54 -6
  38. package/dist/session/context-gc-todo.d.ts +13 -0
  39. package/dist/session/context-gc-todo.js +47 -0
  40. package/dist/session/tool-callers.d.ts +7 -0
  41. package/dist/session/tool-callers.js +28 -0
  42. package/dist/tools/callers.d.ts +1 -7
  43. package/dist/tools/callers.js +1 -28
  44. package/dist/tools/code-mode/index.d.ts +1 -3
  45. package/dist/tools/code-mode/index.js +3 -45
  46. 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 { orderToolDefinitions, stableToolSchema, stableToolDefinition } from '../definition-projection.js';
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');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myagentroam/agent",
3
- "version": "0.11.52",
3
+ "version": "0.11.54",
4
4
  "description": "Embeddable MAR coding agent SDK and CLI.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",