@demicodes/agent 0.20.0 → 0.21.0

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 (2) hide show
  1. package/dist/index.mjs +5 -2
  2. package/package.json +5 -5
package/dist/index.mjs CHANGED
@@ -2597,7 +2597,7 @@ function formatShellToolResult(result, options) {
2597
2597
  lines.push(`metaPath: ${result.artifactDir}/meta.json`);
2598
2598
  }
2599
2599
  if (options.includePreview) appendPreview(lines, result, options.previewBudgetTokens ?? SMALL_CONTEXT_PREVIEW_TOKENS);
2600
- if (result.status === "running") lines.push("next: command is still running; check again with shell_status, or call yield to end this turn and be woken later, or shell_abort to stop it.");
2600
+ if (result.status === "running") lines.push(result.runningHint ?? "next: command is still running; check again with shell_status, or call yield to end this turn and be woken later, or shell_abort to stop it.");
2601
2601
  else if (result.status === "aborted") lines.push("next: command was intentionally stopped.");
2602
2602
  else if (exposeCommandHandle) lines.push("next: command is complete; read the artifact only if the preview is insufficient.");
2603
2603
  return lines.join("\n");
@@ -2656,6 +2656,7 @@ const MAX_LIVE_SUBAGENTS = 8;
2656
2656
  const MAX_ARCHIVED_SUBAGENTS = 16;
2657
2657
  const SUBAGENT_RESULT_MAX_BYTES = 32768;
2658
2658
  const SHOW_RECENT_TOOLS = 8;
2659
+ const SPAWN_RUNNING_HINT = "next: the child agent is still working; a long-running spawn is normal. shell_write steers it, shell_abort aborts it. Otherwise stop attending and end the turn — the child's completion returns as this command's result and wakes the session when it is idle. Do not poll with shell_status or timed yields; use `demi agent show` only to decide a steer or abort.";
2659
2660
  const SPAWN_PROMPT_DESCRIPTION = "The child's first user message and only task brief. The child starts with an empty transcript and cannot see this conversation: do not refer to prior turns, and do not paste this conversation or the product user's message unchanged. Include the goal for this child, applicable decisions and constraints, whether to edit or only report, how to verify, and every concrete identifier it needs (paths, ids, error text, commands already tried and their key results). State the exact shape of the last assistant text it should return.";
2660
2661
  /**
2661
2662
  * Per-parent subagent supervisor. Owns every child `AgentSession` this parent
@@ -2683,7 +2684,7 @@ var ChildSupervisor = class {
2683
2684
  const profileNames = this.configuredProfileNames();
2684
2685
  return {
2685
2686
  name: "agent",
2686
- summary: "Start an isolated child agent session and wait for its result. The command stays running until the child session ends; stdout is the child's last assistant text. While it is the foreground job, shell_write steers the child and shell_abort aborts it. Run several in separate shell_exec calls with short timeoutMs to fan out.",
2687
+ summary: "Start an isolated child agent session and wait for its result. The command stays running until the child session ends; stdout is the child's last assistant text. While it is the foreground job, shell_write steers the child and shell_abort aborts it. Run several in separate shell_exec calls with short timeoutMs to fan out, then end the turn — completion wakes an idle session; do not poll.",
2687
2688
  successOutput: "first stderr line is \"subagentId: <id>\" at start; stdout is the child's last assistant text (empty is valid), written only at exit",
2688
2689
  failureOutput: "non-zero exit with the abort or failure reason on stderr",
2689
2690
  input: {
@@ -2697,6 +2698,7 @@ var ChildSupervisor = class {
2697
2698
  subagentId: z.string(),
2698
2699
  text: z.string()
2699
2700
  }) },
2701
+ runningHint: SPAWN_RUNNING_HINT,
2700
2702
  run: async ({ parsed, io, signal, stdinStream }) => {
2701
2703
  const prompt = String(parsed.values.prompt ?? "").trim();
2702
2704
  if (!prompt) {
@@ -2791,6 +2793,7 @@ var ChildSupervisor = class {
2791
2793
  subagentId: z.string(),
2792
2794
  text: z.string()
2793
2795
  }) },
2796
+ runningHint: SPAWN_RUNNING_HINT,
2794
2797
  run: async ({ parsed, io, signal, stdinStream }) => {
2795
2798
  const id = String(parsed.values.id);
2796
2799
  const message = String(parsed.values.message ?? "").trim();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@demicodes/agent",
3
3
  "description": "Session runtime and transport-neutral client and server protocol for Demi.",
4
- "version": "0.20.0",
4
+ "version": "0.21.0",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "exports": {
@@ -19,10 +19,10 @@
19
19
  }
20
20
  },
21
21
  "dependencies": {
22
- "@demicodes/core": "^0.20.0",
23
- "@demicodes/provider": "^0.20.0",
24
- "@demicodes/shell": "^0.20.0",
25
- "@demicodes/utils": "^0.20.0",
22
+ "@demicodes/core": "^0.21.0",
23
+ "@demicodes/provider": "^0.21.0",
24
+ "@demicodes/shell": "^0.21.0",
25
+ "@demicodes/utils": "^0.21.0",
26
26
  "zod": "^4.0.0"
27
27
  },
28
28
  "license": "Apache-2.0",