@myagentroam/agent 0.9.180 → 0.10.1
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/NOTICE +7 -0
- package/dist/agent-core/extensions/model-stream.js +1 -0
- package/dist/agent-core/extensions/processes.js +1 -0
- package/dist/agent-core/host/local-shell.js +2 -2
- package/dist/agent-core/runtime/context/gc-runtime.js +3 -1
- package/dist/agent-core/sdk/extension-models.js +1 -0
- package/dist/agent-core/sdk/session.js +0 -2
- package/dist/agent-core/subagent/session-controller.js +0 -17
- package/dist/agent-core/tools/code-mode/observations.js +6 -2
- package/dist/agent-core/tools/code-mode/worker.js +3 -1
- package/package.json +1 -1
package/NOTICE
CHANGED
|
@@ -2,3 +2,10 @@ MyAgentRoam
|
|
|
2
2
|
Copyright 2026 MyAgentRoam contributors
|
|
3
3
|
|
|
4
4
|
This product includes software developed by the MyAgentRoam project.
|
|
5
|
+
|
|
6
|
+
Enterprise implementation and product composition:
|
|
7
|
+
Copyright 2026 aCHAOS
|
|
8
|
+
Author and licensing contact: aCHAOS (achaosxyz@gmail.com)
|
|
9
|
+
Licensed under MyAgentRoam Enterprise Source-Available License 1.0; see
|
|
10
|
+
ee/LICENSE and LICENSING.md. Independent core and third-party notices remain
|
|
11
|
+
applicable; this attribution does not transfer any contributor's copyright.
|
|
@@ -47,6 +47,7 @@ export async function* transformCoreModelStream(start, parent, transform, diagno
|
|
|
47
47
|
await iterator.return?.();
|
|
48
48
|
}
|
|
49
49
|
catch (error) {
|
|
50
|
+
// eslint-disable-next-line no-unsafe-finally -- Preserve a primary failure; surface cleanup failures after success.
|
|
50
51
|
if (!failed)
|
|
51
52
|
throw error;
|
|
52
53
|
diagnoseCleanup?.();
|
|
@@ -273,6 +273,7 @@ export function bindCoreProcesses(backend, run, scope, hooks, diagnose) {
|
|
|
273
273
|
catch (error) {
|
|
274
274
|
if (failed)
|
|
275
275
|
diagnose();
|
|
276
|
+
// eslint-disable-next-line no-unsafe-finally -- Cleanup may fail only when there is no primary failure.
|
|
276
277
|
else
|
|
277
278
|
throw error;
|
|
278
279
|
}
|
|
@@ -45,12 +45,12 @@ export function prepareLocalShellProcess(request, platform = process.platform) {
|
|
|
45
45
|
: `[ "\${${privateKey}+x}" = x ] || { printf '%s\\n' 'Shell startup removed a protected environment value.' >&2; exit 1; }`);
|
|
46
46
|
restoration.push(powershell
|
|
47
47
|
? `[Environment]::SetEnvironmentVariable(${quotedKey}, $env:${privateKey}, 'Process'); Remove-Item Env:${privateKey}`
|
|
48
|
-
: `if [ "\${${key}+x}" != x ] || [ "\${${key}-}" != "
|
|
48
|
+
: `if [ "\${${key}+x}" != x ] || [ "\${${key}-}" != "$${privateKey}" ]; then export ${key}="$${privateKey}" || exit; else export ${key} || exit; fi; unset ${privateKey}`);
|
|
49
49
|
}
|
|
50
50
|
if (restoration.length && !powershell) {
|
|
51
51
|
const traceKey = `${privatePrefix}TRACE`;
|
|
52
52
|
// A profile may enable xtrace; do not print expanded private values during restoration.
|
|
53
|
-
script.push(`case $- in *x*) set +x; ${traceKey}=1 ;; *) ${traceKey}= ;; esac`, ...restoration, `if [ "
|
|
53
|
+
script.push(`case $- in *x*) set +x; ${traceKey}=1 ;; *) ${traceKey}= ;; esac`, ...restoration, `if [ "$${traceKey}" = 1 ]; then unset ${traceKey}; set -x; else unset ${traceKey}; fi`);
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
56
56
|
script.push(...restoration);
|
|
@@ -171,7 +171,9 @@ async function attemptContextGc(input) {
|
|
|
171
171
|
result: await matchingCheckpointWasPersisted(input.store, input.sessionId, draft, input.workspace)
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
|
-
catch {
|
|
174
|
+
catch {
|
|
175
|
+
// Keep the deferred result when the post-failure checkpoint cannot be read.
|
|
176
|
+
}
|
|
175
177
|
void commitError;
|
|
176
178
|
return deferred;
|
|
177
179
|
}
|
|
@@ -118,6 +118,7 @@ export function createExtensionModels(state, createAdapter, resolveSnapshot) {
|
|
|
118
118
|
await adapter.close?.();
|
|
119
119
|
}
|
|
120
120
|
catch (error) {
|
|
121
|
+
// eslint-disable-next-line no-unsafe-finally -- Preserve a primary failure; surface cleanup failures after success.
|
|
121
122
|
if (!failed)
|
|
122
123
|
throw error;
|
|
123
124
|
diagnoseCleanup?.('MAR_AGENT_MODEL_ADAPTER_CLEANUP_FAILED');
|
|
@@ -23,7 +23,6 @@ import { coreMcpCatalog } from '../extensions/mcp.js';
|
|
|
23
23
|
import { isDeepStrictEqual } from 'node:util';
|
|
24
24
|
import { MarAgentError, describeMarAgentError } from '../error.js';
|
|
25
25
|
import { usesResponsesConfigurationUpdates } from '../model/configuration.js';
|
|
26
|
-
import { buildEnvironmentContext } from '../prompts/core.js';
|
|
27
26
|
import { executionBudgetEnvironmentEntry } from '../prompts/execution-budget.js';
|
|
28
27
|
import { MAR_AGENT_PROMPT_VERSION, buildSystemPromptSections } from '../prompts/index.js';
|
|
29
28
|
import { renderPromptSections } from '../extensions/prompt-composition.js';
|
|
@@ -69,7 +68,6 @@ export function createSessionOpener(services) {
|
|
|
69
68
|
};
|
|
70
69
|
if (!restoreEnvironmentState({ version: 1, state: currentEnvironment }))
|
|
71
70
|
throw new MarAgentError('MAR_AGENT_HOST_INCOMPATIBLE', 'Host environment facts are invalid or exceed the context limit.');
|
|
72
|
-
const environmentContext = buildEnvironmentContext(currentEnvironment);
|
|
73
71
|
let sessionRuntime = sessionRuntimes.get(sessionId);
|
|
74
72
|
if (sessionRuntime === undefined) {
|
|
75
73
|
sessionRuntime = {
|
|
@@ -1118,23 +1118,6 @@ function latestMessageFromEvent(event) {
|
|
|
1118
1118
|
truncated: text !== event.text
|
|
1119
1119
|
};
|
|
1120
1120
|
}
|
|
1121
|
-
function latestMessageFromPayload(payload) {
|
|
1122
|
-
if (typeof payload.itemId !== 'string' ||
|
|
1123
|
-
typeof payload.turnId !== 'string' ||
|
|
1124
|
-
(payload.phase !== 'commentary' && payload.phase !== 'final_answer') ||
|
|
1125
|
-
typeof payload.text !== 'string' ||
|
|
1126
|
-
typeof payload.timestamp !== 'string')
|
|
1127
|
-
return undefined;
|
|
1128
|
-
const text = payload.text;
|
|
1129
|
-
return {
|
|
1130
|
-
itemId: payload.itemId,
|
|
1131
|
-
turnId: payload.turnId,
|
|
1132
|
-
phase: payload.phase,
|
|
1133
|
-
text,
|
|
1134
|
-
timestamp: payload.timestamp,
|
|
1135
|
-
truncated: text !== payload.text
|
|
1136
|
-
};
|
|
1137
|
-
}
|
|
1138
1121
|
function isReasoningEffort(value) {
|
|
1139
1122
|
return (value === 'low' ||
|
|
1140
1123
|
value === 'medium' ||
|
|
@@ -80,7 +80,9 @@ export function renderObservationResult(values, original) {
|
|
|
80
80
|
if (envelope && !Array.isArray(envelope) && typeof envelope === 'object')
|
|
81
81
|
return JSON.stringify({ ...envelope, observations: values.map(visibleObservation) });
|
|
82
82
|
}
|
|
83
|
-
catch {
|
|
83
|
+
catch {
|
|
84
|
+
// A non-JSON envelope falls back to the bounded observation rendering.
|
|
85
|
+
}
|
|
84
86
|
return renderObservations(values);
|
|
85
87
|
}
|
|
86
88
|
/** Truncate each body before encoding, never a JSON array or its trusted identity. */
|
|
@@ -171,7 +173,9 @@ export function observationModelParts(message) {
|
|
|
171
173
|
prefix.push({ type: 'text', text: JSON.stringify(metadata) });
|
|
172
174
|
}
|
|
173
175
|
}
|
|
174
|
-
catch {
|
|
176
|
+
catch {
|
|
177
|
+
// Malformed envelope metadata must not hide structured observations.
|
|
178
|
+
}
|
|
175
179
|
if (!message.observations.length && !prefix.length)
|
|
176
180
|
return undefined;
|
|
177
181
|
return [
|
|
@@ -63,7 +63,9 @@ lines.on('line', async (line) => {
|
|
|
63
63
|
try {
|
|
64
64
|
await engine?.dispose();
|
|
65
65
|
}
|
|
66
|
-
catch {
|
|
66
|
+
catch {
|
|
67
|
+
// Report the original engine failure even if disposal also fails.
|
|
68
|
+
}
|
|
67
69
|
await new Promise((resolve) => process.stdout.write(JSON.stringify({
|
|
68
70
|
kind: 'error',
|
|
69
71
|
code: typeof error?.code === 'string' ? error.code : 'MAR_AGENT_CODE_ENGINE_FAILED',
|