@myagentroam/agent 0.10.4 → 0.10.5

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.
@@ -1,6 +1,6 @@
1
1
  import type { ExecutionMode } from '../runtime/contracts.js';
2
2
  import { type CorePromptPart } from '../extensions/prompt-composition.js';
3
- export declare const MAR_AGENT_PROMPT_VERSION = "1.61";
3
+ export declare const MAR_AGENT_PROMPT_VERSION = "1.62";
4
4
  interface SystemPromptInput {
5
5
  mode: ExecutionMode;
6
6
  platform: string;
@@ -5,7 +5,7 @@ import { modePrompt } from './modes.js';
5
5
  import { outputStylePrompt } from './output.js';
6
6
  import { subagentPrompt } from './subagent.js';
7
7
  import { interactionPrompt, longRunningPrompt, safetyPrompt, toolUsagePrompt, workflowPrompt } from './workflow.js';
8
- export const MAR_AGENT_PROMPT_VERSION = '1.61';
8
+ export const MAR_AGENT_PROMPT_VERSION = '1.62';
9
9
  export function buildSystemPrompt(input) {
10
10
  return renderPromptSections(buildSystemPromptSections(input));
11
11
  }
@@ -1,2 +1,2 @@
1
- export declare const subagentPrompt = "# Subagents\nCall agent_start, agent_wait, agent_message and agent_cancel directly, never inside code_exec; they are absent from the cell tools namespace. Use your own direct tools by default. Delegate only when a bounded task can proceed independently and parallelism has real value; do not delegate ordinary local search, a known-file read, a single verification command, a small edit, or sequential debugging. Give each child a self-contained objective, relevant paths and constraints, expected evidence, and a clear read/write boundary. Subagents cannot recurse and share the real filesystem; do not assign conflicting writes or assume isolation. Track background agent IDs, wait or cancel them, inspect their actual workspace effects, and verify every claim before incorporating it. Continue meaningful non-overlapping work after starting a background child. Wait for completion only when the next critical-path action is blocked on the final result, and then prefer one long wait measured in minutes rather than repeated short waits. Wait for a public message only when a fresh progress update would change the next decision; do not use message waits as heartbeat checks or request progress merely to confirm that a child is still running. The parent retains responsibility for the final result.";
2
- export declare const childSubagentInstruction = "You are a non-recursive subagent. Work only on the delegated objective and within its stated read/write scope. Do not broaden the parent task, ask the user, start another subagent, commit, or claim parent-level completion. Inspect relevant evidence, make only authorized changes, run proportional verification, and return a concise factual handoff containing findings, exact files changed, commands/tests actually run, failures or uncertainty, and anything the parent must verify.";
1
+ export declare const subagentPrompt: string;
2
+ export declare const childSubagentInstruction = "You are a non-recursive subagent. Complete only the delegated objective within its read/write scope. Other agents share your workspace: preserve their changes and report an exact conflict or blocker to the parent instead of expanding scope. Return a concise factual handoff with findings, useful evidence paths, files changed, tests actually run and their outcomes, and remaining blockers or uncertainty.";
@@ -1,2 +1,9 @@
1
- export const subagentPrompt = '# Subagents\nCall agent_start, agent_wait, agent_message and agent_cancel directly, never inside code_exec; they are absent from the cell tools namespace. Use your own direct tools by default. Delegate only when a bounded task can proceed independently and parallelism has real value; do not delegate ordinary local search, a known-file read, a single verification command, a small edit, or sequential debugging. Give each child a self-contained objective, relevant paths and constraints, expected evidence, and a clear read/write boundary. Subagents cannot recurse and share the real filesystem; do not assign conflicting writes or assume isolation. Track background agent IDs, wait or cancel them, inspect their actual workspace effects, and verify every claim before incorporating it. Continue meaningful non-overlapping work after starting a background child. Wait for completion only when the next critical-path action is blocked on the final result, and then prefer one long wait measured in minutes rather than repeated short waits. Wait for a public message only when a fresh progress update would change the next decision; do not use message waits as heartbeat checks or request progress merely to confirm that a child is still running. The parent retains responsibility for the final result.';
2
- export const childSubagentInstruction = 'You are a non-recursive subagent. Work only on the delegated objective and within its stated read/write scope. Do not broaden the parent task, ask the user, start another subagent, commit, or claim parent-level completion. Inspect relevant evidence, make only authorized changes, run proportional verification, and return a concise factual handoff containing findings, exact files changed, commands/tests actually run, failures or uncertainty, and anything the parent must verify.';
1
+ export const subagentPrompt = [
2
+ '# Subagents',
3
+ 'Call agent_start, agent_wait, agent_message and agent_cancel directly, never inside code_exec; they are absent from the cell tools namespace.',
4
+ 'Delegate bounded, self-contained tasks when independent progress or context savings materially helps. Keep simple or tightly coupled work local; do not split work merely to use agents.',
5
+ 'All agents share the filesystem. Give each child an objective, necessary context, expected output, and an exclusive write scope or a read-only boundary; avoid conflicting writes.',
6
+ 'While children run, continue meaningful non-overlapping work. Do not redo delegated work. Wait only when the next step needs the result; do not poll for reassurance.',
7
+ 'Use concise handoffs and independently verify consequential changes and claims. Track child IDs, join or cancel required child work before final delivery, and retain responsibility for the final result.'
8
+ ].join('\n');
9
+ export const childSubagentInstruction = 'You are a non-recursive subagent. Complete only the delegated objective within its read/write scope. Other agents share your workspace: preserve their changes and report an exact conflict or blocker to the parent instead of expanding scope. Return a concise factual handoff with findings, useful evidence paths, files changed, tests actually run and their outcomes, and remaining blockers or uncertainty.';
@@ -5,7 +5,7 @@ export const agentStartToolDefinition = {
5
5
  name: 'agent_start',
6
6
  allowedCallers: ['direct'],
7
7
  parallelSafety: 'serial',
8
- description: 'Start one bounded, non-recursive child agent with self-contained context. Use when an independent investigation would consume substantial main-context space or when safe parallel work has real value; keep small or tightly coupled work in the main context. All agents share the filesystem, so avoid conflicting writes. The optional reasoningEffort overrides the parent effort and must be supported by the selected model; omit it to inherit. Returns agentId for agent_wait, agent_message, or agent_cancel, description, queued/running/completed/failed/cancelled status, bounded summary, changedFiles, verification, and read evidence; background returns immediately while foreground waits for a terminal result.',
8
+ description: 'Start one bounded, non-recursive child agent with self-contained context. Startup does not wait for task completion. Returns agentId for agent_wait, agent_message, or agent_cancel, description, queued/running/completed/failed/cancelled/interrupted status, and effective model metadata, not task results. Use agent_wait to read results and verification evidence. The optional reasoningEffort overrides the parent effort and must be supported by the selected model; omit it to inherit.',
9
9
  inputSchema: {
10
10
  type: 'object',
11
11
  properties: {
@@ -13,7 +13,10 @@ export const agentStartToolDefinition = {
13
13
  type: 'string',
14
14
  maxLength: TOOL_EXECUTION_LIMITS.subagentDescriptionMaxCharacters
15
15
  },
16
- prompt: { type: 'string', description: 'Self-contained bounded task prompt.' },
16
+ prompt: {
17
+ type: 'string',
18
+ description: 'Self-contained bounded objective, necessary facts, relevant paths, read/write scope, constraints, expected output, and verification responsibility. The child does not inherit parent history.'
19
+ },
17
20
  role: { enum: ['general-purpose', 'explore'] },
18
21
  modelId: { type: 'string' },
19
22
  reasoningEffort: {
@@ -21,8 +24,7 @@ export const agentStartToolDefinition = {
21
24
  enum: marAgentReasoningEffortSchema.options,
22
25
  maxLength: TOOL_EXECUTION_LIMITS.subagentReasoningEffortMaxCharacters,
23
26
  description: 'Reasoning effort override for the subagent. Omit to inherit the parent effort.'
24
- },
25
- background: { type: 'boolean' }
27
+ }
26
28
  },
27
29
  required: ['description', 'prompt', 'role'],
28
30
  additionalProperties: false
@@ -72,7 +74,7 @@ function parseAgentStartInput(value) {
72
74
  if (!value || typeof value !== 'object' || Array.isArray(value))
73
75
  return invalidAgentStart();
74
76
  const input = value;
75
- if (Object.keys(input).some((key) => !['description', 'prompt', 'role', 'modelId', 'reasoningEffort', 'background'].includes(key)) ||
77
+ if (Object.keys(input).some((key) => !['description', 'prompt', 'role', 'modelId', 'reasoningEffort'].includes(key)) ||
76
78
  typeof input.description !== 'string' ||
77
79
  input.description.trim().length === 0 ||
78
80
  input.description.length > TOOL_EXECUTION_LIMITS.subagentDescriptionMaxCharacters ||
@@ -86,10 +88,7 @@ function parseAgentStartInput(value) {
86
88
  (input.reasoningEffort !== undefined &&
87
89
  input.reasoningEffort !== null &&
88
90
  (typeof input.reasoningEffort !== 'string' ||
89
- !marAgentReasoningEffortSchema.safeParse(input.reasoningEffort.trim()).success)) ||
90
- (input.background !== undefined &&
91
- input.background !== null &&
92
- typeof input.background !== 'boolean'))
91
+ !marAgentReasoningEffortSchema.safeParse(input.reasoningEffort.trim()).success)))
93
92
  return invalidAgentStart();
94
93
  return {
95
94
  description: input.description.trim(),
@@ -99,7 +98,7 @@ function parseAgentStartInput(value) {
99
98
  ...(typeof input.reasoningEffort === 'string'
100
99
  ? { reasoningEffort: marAgentReasoningEffortSchema.parse(input.reasoningEffort.trim()) }
101
100
  : {}),
102
- ...(typeof input.background === 'boolean' ? { background: input.background } : {})
101
+ background: true
103
102
  };
104
103
  }
105
104
  function invalidAgentStart() {
@@ -4,7 +4,7 @@ export const agentWaitToolDefinition = {
4
4
  name: 'agent_wait',
5
5
  allowedCallers: ['direct'],
6
6
  parallelSafety: 'serial',
7
- description: 'Read or wait a bounded time for a child agent result. waitFor defaults to "completion"; use "message" only when a fresh public commentary/final message would change the next decision. Omit agentId to wait for whichever live child returns first, matching Codex-style untargeted waiting and avoiding UUID transcription; provide the exact agentId returned by agent_start only when observing a specific child. If no child is live, untargeted waiting reads the most recently created child. For an exec processId, use exec_wait instead (tools.exec_wait in Code Mode). Omitting waitMs waits up to 30 seconds by default; waitMs=0 returns the current snapshot immediately. Positive waits range up to 5 minutes, and positive values below 10 seconds are raised to 10 seconds. When blocked on a live child result, prefer one 300000 ms completion wait rather than repeated short waits. Every result includes waitOutcome as snapshot, message, completion, or timeout plus the real agentId and description. A message, timeout with unread progress, or first terminal completion result includes the newly observed latest public commentary/final message; snapshots and repeated observations omit previously observed message text. latestActivity can still identify a public message or bounded tool started/completed/failed status. A queued or running result is not completion. A message wait consumes only the latest unread public message in the current Session runtime; tool activity does not wake it, and parent cancellation preserves unread progress for a later Execution. Do not use message waits as heartbeat checks or request progress merely to confirm that a child is still running. First terminal results include bounded summary, changedFiles, verification, and read evidence with path/line ranges; use that evidence to avoid repeating the full exploration, while independently checking consequential edits and claims.',
7
+ description: 'Read or wait a bounded time for a child agent result. Wait only when the next local step depends on the child result; otherwise continue useful non-overlapping work. waitFor defaults to "completion"; use "message" only when a fresh public commentary/final message would change the next decision. Omit agentId to wait for whichever live child returns first, matching Codex-style untargeted waiting and avoiding UUID transcription; provide the exact agentId returned by agent_start only when observing a specific child. If no child is live, untargeted waiting reads the most recently created child. For an exec processId, use exec_wait instead (tools.exec_wait in Code Mode). Omitting waitMs waits up to 30 seconds by default; waitMs=0 returns the current snapshot immediately. Positive waits range up to 5 minutes, and positive values below 10 seconds are raised to 10 seconds. When blocked on a live child result, prefer one 300000 ms completion wait rather than repeated short waits. Every result includes waitOutcome as snapshot, message, completion, or timeout plus the real agentId and description. A message, timeout with unread progress, or first terminal completion result includes the newly observed latest public commentary/final message; snapshots and repeated observations omit previously observed message text. latestActivity can still identify a public message or bounded tool started/completed/failed status. A queued or running result is not completion. A message wait consumes only the latest unread public message in the current Session runtime; tool activity does not wake it, and parent cancellation preserves unread progress for a later Execution. Do not use message waits as heartbeat checks or request progress merely to confirm that a child is still running. First terminal results include bounded summary, changedFiles, verification, and read evidence with path/line ranges; use that evidence to avoid repeating the full exploration, while independently checking consequential edits and claims.',
8
8
  inputSchema: {
9
9
  type: 'object',
10
10
  properties: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myagentroam/agent",
3
- "version": "0.10.4",
3
+ "version": "0.10.5",
4
4
  "description": "Embeddable MAR coding agent SDK and CLI.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",