@myagentroam/node 0.12.2 → 0.12.4
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/capabilities.js
CHANGED
package/dist/marctl/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"0.12.
|
|
1
|
+
{"type":"module","version":"0.12.4"}
|
|
@@ -12,6 +12,9 @@ const system = 'You summarize conversation evidence for the next agent invocatio
|
|
|
12
12
|
export function updateMarAgentCompactState(state, raw, models, visibleModelIds) {
|
|
13
13
|
state.revision++;
|
|
14
14
|
delete state.current;
|
|
15
|
+
state.unifiedCompactModelIds = models
|
|
16
|
+
.filter((model) => model.enabled && model.unifiedCompact === true)
|
|
17
|
+
.map((model) => model.id);
|
|
15
18
|
const parsed = marAgentRuntimeCompactConfigurationSchema.safeParse(raw);
|
|
16
19
|
if (!parsed.success)
|
|
17
20
|
return;
|
|
@@ -37,6 +40,7 @@ export function marAgentCompactExtensionSource(state) {
|
|
|
37
40
|
async resolve({ signal }) {
|
|
38
41
|
signal.throwIfAborted();
|
|
39
42
|
const selected = state.current;
|
|
43
|
+
const enabledModelIds = new Set(state.unifiedCompactModelIds);
|
|
40
44
|
return {
|
|
41
45
|
revision: `node-compact-${state.revision}`,
|
|
42
46
|
extensions: selected === undefined
|
|
@@ -49,7 +53,9 @@ export function marAgentCompactExtensionSource(state) {
|
|
|
49
53
|
? () => selected.model.credentialProvider?.close()
|
|
50
54
|
: undefined,
|
|
51
55
|
attachSession(context) {
|
|
52
|
-
context.hooks.intercept('compact.generate', (input, call) =>
|
|
56
|
+
context.hooks.intercept('compact.generate', (input, call, next) => input.modelId !== undefined && enabledModelIds.has(input.modelId)
|
|
57
|
+
? generateMarAgentCompact(input, selected, call.signal)
|
|
58
|
+
: next(input));
|
|
53
59
|
}
|
|
54
60
|
}
|
|
55
61
|
]
|
|
@@ -174,14 +174,27 @@ export class MarAgentConversationNormalizer {
|
|
|
174
174
|
const state = this.#tools.get(event.callId);
|
|
175
175
|
if (!state?.active ||
|
|
176
176
|
state.toolName !== event.toolName ||
|
|
177
|
-
|
|
177
|
+
state.executionId !== event.executionId ||
|
|
178
|
+
(state.turnId !== undefined && event.turnId !== undefined && state.turnId !== event.turnId))
|
|
178
179
|
return [];
|
|
179
|
-
|
|
180
|
-
if (
|
|
181
|
-
|
|
182
|
-
|
|
180
|
+
let data;
|
|
181
|
+
if (event.toolName === 'exec_wait' ||
|
|
182
|
+
event.toolName === 'code_exec_wait' ||
|
|
183
|
+
(event.toolName === 'exec' && state.commandOrigin === undefined)) {
|
|
184
|
+
const source = executionSource(record(event.data)?.executionSource).source;
|
|
185
|
+
if (!source)
|
|
186
|
+
return [];
|
|
187
|
+
data = { executionSource: source };
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
const operation = agentOperationPresentationSchema.safeParse(record(event.data)?.agentOperation);
|
|
191
|
+
if (!operation.success || operation.data.action !== agentOperationAction(event.toolName))
|
|
192
|
+
return [];
|
|
193
|
+
data = event.data;
|
|
194
|
+
}
|
|
195
|
+
this.#tools.set(event.callId, { ...state, presentationData: data });
|
|
183
196
|
return [
|
|
184
|
-
genericToolItem(state.itemId, state.toolName, 'IN_PROGRESS', state.input, null, null, false,
|
|
197
|
+
genericToolItem(state.itemId, state.toolName, 'IN_PROGRESS', state.input, null, null, false, data, state.subagentTitle, state.subagentDetails, undefined, undefined, state.inputTruncated)
|
|
185
198
|
];
|
|
186
199
|
}
|
|
187
200
|
if (event.type === 'sleep.started') {
|
|
@@ -323,6 +336,7 @@ export class MarAgentConversationNormalizer {
|
|
|
323
336
|
return [];
|
|
324
337
|
return [
|
|
325
338
|
genericToolItem(state.itemId, toolName, 'IN_PROGRESS', state.input, snapshot.outputPreview, null, snapshot.truncated, {
|
|
339
|
+
...record(state.presentationData),
|
|
326
340
|
processId: output.processId,
|
|
327
341
|
displayOutput: snapshot.displayOutput,
|
|
328
342
|
outputHeadTruncated: snapshot.displayOutput.stdoutDroppedBytes > 0 ||
|
|
@@ -397,7 +411,7 @@ export class MarAgentConversationNormalizer {
|
|
|
397
411
|
const command = target.commandOrigin === undefined ? undefined : this.#commands.get(target.commandOrigin);
|
|
398
412
|
const item = command
|
|
399
413
|
? commandItem(command, 'IN_PROGRESS')
|
|
400
|
-
: genericToolItem(target.itemId, target.toolName, 'IN_PROGRESS', target.input, null, null, false,
|
|
414
|
+
: genericToolItem(target.itemId, target.toolName, 'IN_PROGRESS', target.input, null, null, false, target.presentationData, undefined, undefined, undefined, undefined, target.inputTruncated);
|
|
401
415
|
const blocks = [
|
|
402
416
|
...(output.stdout ? [{ channel: 'STDOUT', text: output.stdout }] : []),
|
|
403
417
|
...(output.stderr ? [{ channel: 'STDERR', text: output.stderr }] : [])
|
|
@@ -451,6 +465,7 @@ export class MarAgentConversationNormalizer {
|
|
|
451
465
|
const bounded = publicOutputSnapshot(combined, entries.some((entry) => entry.truncated));
|
|
452
466
|
return [
|
|
453
467
|
genericToolItem(target.itemId, target.toolName, 'IN_PROGRESS', target.input, bounded.text, null, bounded.truncated, {
|
|
468
|
+
...record(target.presentationData),
|
|
454
469
|
outputHeadTruncated: entries.some((entry) => entry.displayOutput.stdoutDroppedBytes > 0 ||
|
|
455
470
|
entry.displayOutput.stderrDroppedBytes > 0),
|
|
456
471
|
displayOutput: {
|
|
@@ -687,7 +702,7 @@ export class MarAgentConversationNormalizer {
|
|
|
687
702
|
}
|
|
688
703
|
const item = genericToolItem(state?.itemId ?? itemId('tool', event.callId), event.toolName, 'COMPLETED', state?.input, generatedImages.length === 0
|
|
689
704
|
? event.summary
|
|
690
|
-
: generatedImages.map((image) => image.name).join(', '), null, event.outputTruncation !== undefined,
|
|
705
|
+
: generatedImages.map((image) => image.name).join(', '), null, event.outputTruncation !== undefined, mergeToolPresentationData(event.toolName, state?.presentationData, event.data), agentId === undefined ? state?.subagentTitle : this.#subagentTitles.get(agentId), details, state?.sleepStartedAt, event.outputTruncation, state?.inputTruncated, event.summaryTruncated === true);
|
|
691
706
|
return [
|
|
692
707
|
{
|
|
693
708
|
...item,
|
|
@@ -718,11 +733,7 @@ export class MarAgentConversationNormalizer {
|
|
|
718
733
|
return [
|
|
719
734
|
genericToolItem(state?.itemId ?? itemId('tool', event.callId), event.toolName, event.code === 'MAR_AGENT_CANCELLED' || event.code === 'MAR_AGENT_EXECUTION_CANCELLED'
|
|
720
735
|
? 'CANCELLED'
|
|
721
|
-
: 'FAILED', state?.input, event.message ?? event.code, event.code, event.truncated === true,
|
|
722
|
-
? mergeAgentOperationData(event.toolName, state?.presentationData, event.data)
|
|
723
|
-
: event.data === undefined
|
|
724
|
-
? state?.presentationData
|
|
725
|
-
: event.data, state?.subagentTitle, state?.subagentDetails, state?.sleepStartedAt, event.outputTruncation, state?.inputTruncated)
|
|
736
|
+
: 'FAILED', state?.input, event.message ?? event.code, event.code, event.truncated === true, mergeToolPresentationData(event.toolName, state?.presentationData, event.data === undefined ? state?.presentationData : event.data), state?.subagentTitle, state?.subagentDetails, state?.sleepStartedAt, event.outputTruncation, state?.inputTruncated)
|
|
726
737
|
];
|
|
727
738
|
}
|
|
728
739
|
#codeModeToolResults(event) {
|
|
@@ -1045,7 +1056,12 @@ function codeExecutionError(data) {
|
|
|
1045
1056
|
message: compactRunnerText(error.message, 1000)
|
|
1046
1057
|
};
|
|
1047
1058
|
}
|
|
1048
|
-
function
|
|
1059
|
+
function mergeToolPresentationData(toolName, previous, current) {
|
|
1060
|
+
if (toolName === 'exec_wait' || toolName === 'code_exec_wait' || toolName === 'exec') {
|
|
1061
|
+
const source = executionSource(record(current)?.executionSource).source ??
|
|
1062
|
+
executionSource(record(previous)?.executionSource).source;
|
|
1063
|
+
return source ? { ...record(current), executionSource: source } : current;
|
|
1064
|
+
}
|
|
1049
1065
|
if (!agentOperationAction(toolName))
|
|
1050
1066
|
return current;
|
|
1051
1067
|
const before = agentOperationPresentationSchema.safeParse(record(previous)?.agentOperation);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AgentError, SecretValue } from '@myagentroam/agent';
|
|
2
2
|
import { marAgentRuntimeModelConfigurationSchema, resolveMarAgentDefaultReasoningEffort } from '@myagentroam/protocol';
|
|
3
3
|
export function sdkModelConfigurations(models) {
|
|
4
|
-
return models.map(({ imageGeneration: _imageGeneration, ...model }) => model);
|
|
4
|
+
return models.map(({ imageGeneration: _imageGeneration, unifiedCompact: _unifiedCompact, ...model }) => model);
|
|
5
5
|
}
|
|
6
6
|
export async function closeImageCredentialProviders(models) {
|
|
7
7
|
const textProviders = new Set(models.map((model) => model.credentialProvider));
|
|
@@ -64,6 +64,7 @@ export class MarAgentRuntimeModelFactory {
|
|
|
64
64
|
defaultReasoningEffort: resolveMarAgentDefaultReasoningEffort(configuration.defaultReasoningEffort, configuration.reasoningEfforts),
|
|
65
65
|
conversationModel: configuration.conversationModel ?? true,
|
|
66
66
|
subagentModel: configuration.subagentModel ?? false,
|
|
67
|
+
unifiedCompact: configuration.unifiedCompact ?? false,
|
|
67
68
|
titleGeneration: configuration.titleGeneration,
|
|
68
69
|
codeMode: configuration.codeMode,
|
|
69
70
|
gcEnabled: configuration.gcEnabled ?? true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myagentroam/node",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.4",
|
|
4
4
|
"description": "MyAgentRoam Node runtime CLI.",
|
|
5
5
|
"license": "Apache-2.0 AND GPL-2.0-or-later",
|
|
6
6
|
"type": "module",
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
"turndown-plugin-gfm": "^1.0.2",
|
|
43
43
|
"ws": "^8.21.3",
|
|
44
44
|
"zod": "4.4.3",
|
|
45
|
-
"@myagentroam/
|
|
46
|
-
"@myagentroam/
|
|
45
|
+
"@myagentroam/agent": "0.12.4",
|
|
46
|
+
"@myagentroam/protocol": "0.12.4"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/turndown": "^5.0.6",
|
|
50
50
|
"@types/ws": "^8.18.1",
|
|
51
|
-
"@myagentroam/
|
|
52
|
-
"@myagentroam/
|
|
51
|
+
"@myagentroam/marctl": "0.12.4",
|
|
52
|
+
"@myagentroam/code-navigation": "0.11.1"
|
|
53
53
|
},
|
|
54
54
|
"exports": {
|
|
55
55
|
"./config": {
|