@myagentroam/agent 0.14.15 → 0.14.16
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.
|
@@ -31,7 +31,6 @@ export const codeModeToolDefinition = {
|
|
|
31
31
|
- Single-tool cells are valid. Keep loops and retries bounded, and do not blindly replay operations with side effects.
|
|
32
32
|
- Evaluates source in a fresh restricted ECMAScript runtime with top-level await and Promise.all. It is not Node.js or a browser. JavaScript globals do not survive between cells; bounded JSON state is available through state.
|
|
33
33
|
- Accepts JavaScript source text. When exposed as a freeform tool, send the source directly; when exposed with a JSON input schema, put the source in its code field. JSON input example: \`{"code":"observe.text(1);"}\`. Do not add another JSON wrapper, quoted string, or markdown code fence inside the source.
|
|
34
|
-
- When passing scripts, patches, or other embedded text to tools, prefer a form that preserves the original text without unnecessary escaping. \`String.raw\` is often a good fit for multiline text. If the text contains backticks or literal \${...}, consider a properly escaped JavaScript string or a direct text input, if available.
|
|
35
34
|
- Do not paste Python literals such as None into JavaScript expressions.
|
|
36
35
|
- Use only standard ECMAScript built-ins and the explicitly documented tools, observe, state, catalog and cell namespaces. Do not use Node.js, browser or Web APIs. Module imports, filesystem and network APIs are unavailable. Obtain external capabilities only through available tools. Use tools.exec to start managed processes when permitted; follow exec_wait's calling guidance for process control.
|
|
37
36
|
|
|
@@ -68,22 +67,8 @@ Inspect before a dependent edit; successful await needs no invented success flag
|
|
|
68
67
|
const inspected = await tools.read({ reads: [{ path: "source.txt" }] });
|
|
69
68
|
const sourceText = inspected.data.results[0].text;
|
|
70
69
|
if (!sourceText?.includes("original=1")) throw new Error("Unexpected source");
|
|
71
|
-
const
|
|
72
|
-
*** Update File: source.txt
|
|
73
|
-
@@
|
|
74
|
-
original=1
|
|
75
|
-
+updated=2
|
|
76
|
-
+pattern=\\bword\\b
|
|
77
|
-
*** End Patch\`;
|
|
78
|
-
const patched = await tools.apply_patch({ input: patch });
|
|
70
|
+
const patched = await tools.apply_patch({ input: "*** Begin Patch\\n*** Update File: source.txt\\n@@\\n original=1\\n+updated=2\\n*** End Patch" });
|
|
79
71
|
observe.result(patched);
|
|
80
|
-
\`\`\`
|
|
81
|
-
Pass literal backslashes to a script (POSIX shell with Python installed):
|
|
82
|
-
\`\`\`js
|
|
83
|
-
const command = String.raw\`python3 - <<'PY'
|
|
84
|
-
print('a\\0b'.split('\\0'))
|
|
85
|
-
PY\`;
|
|
86
|
-
observe.result(await tools.exec({ command }));
|
|
87
72
|
\`\`\``,
|
|
88
73
|
inputMode: 'freeform',
|
|
89
74
|
inputSchema: {
|
package/dist/tools/local/exec.js
CHANGED
|
@@ -32,6 +32,7 @@ export function formatExecResult(result) {
|
|
|
32
32
|
export const execToolDefinition = {
|
|
33
33
|
name: 'exec',
|
|
34
34
|
allowedCallers: ['direct', 'programmatic'],
|
|
35
|
+
codeModeExposure: 'both',
|
|
35
36
|
parallelSafety: 'safe',
|
|
36
37
|
description: 'Start a platform-native command, script, or program in workspace/default cwd. Returns a stable processId (p_ plus 12 lowercase hex characters), status, bounded stdout/stderr, cumulative byte counts, dropped-byte counts, exitCode and truncated. A completed status does not imply exitCode 0; inspect stderr/exitCode. For subsequent waiting, stdin writes or cancellation, use exec_wait with processId, not exec. Truncation does not stop the process. Cancelling the initial wait does not terminate the process. waitOutcome distinguishes completion from a wait timeout. A direct foreground call may return interrupted with reason=steer. Inside a cell, steer interrupts only the outer foreground wait, not the inner exec wait. In either case the process keeps running.',
|
|
37
38
|
outputSchema: {
|