@arbidocs/client 0.3.153 → 0.3.154

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/index.d.cts CHANGED
@@ -3454,7 +3454,7 @@ interface components {
3454
3454
  WEB_SEARCH_ENABLED: boolean;
3455
3455
  /**
3456
3456
  * Run Code Enabled
3457
- * @description Enable the run_code tool (sandboxed code execution). (Sandbox tuning lives in the developer-only RunCode config.)
3457
+ * @description Enable the spawn_coding_agent tool (sandboxed code execution). (Sandbox tuning lives in the developer-only RunCode config.)
3458
3458
  * @default true
3459
3459
  */
3460
3460
  RUN_CODE_ENABLED: boolean;
@@ -3622,7 +3622,7 @@ interface components {
3622
3622
  AGENT_MAX_ITERATIONS: number;
3623
3623
  /**
3624
3624
  * Agent Turn Credit Budget
3625
- * @description Maximum AI credits (1 credit = $0.01) a turn may spend, shared across the main agent and every deep_research/run_code/sub_agent child it spawns — priced per call using each call's own model, since different stages run different models. Enforced as a meter on the shared run budget alongside tool calls and tokens, so nearing it also nudges the agent to converge (70%), blocks new sub-agent spawns (90%), and offers the pause-and-extend prompt before forcing an answer. Default is half FREE_AI_CREDITS (100) — a free account's entire grant, so one turn can't consume it all. 0 = uncapped.
3625
+ * @description Maximum AI credits (1 credit = $0.01) a turn may spend, shared across the main agent and every deep_research/spawn_coding_agent/sub_agent child it spawns — priced per call using each call's own model, since different stages run different models. Enforced as a meter on the shared run budget alongside tool calls and tokens, so nearing it also nudges the agent to converge (70%), blocks new sub-agent spawns (90%), and offers the pause-and-extend prompt before forcing an answer. Default is half FREE_AI_CREDITS (100) — a free account's entire grant, so one turn can't consume it all. 0 = uncapped.
3626
3626
  * @default 50
3627
3627
  */
3628
3628
  AGENT_TURN_CREDIT_BUDGET: number;
@@ -3661,8 +3661,6 @@ interface components {
3661
3661
  * @description System prompt for the agent. Dynamic context is appended automatically.
3662
3662
  * @default Answer any question the user asks. You have access to workspace documents — use them when relevant. When no documents are relevant, answer from your own knowledge. Always provide a helpful answer.
3663
3663
  *
3664
- * IMPORTANT: Never say "I don't have information in the available documents" or refuse to answer. If documents are not relevant, just answer the question directly from your own knowledge. If the user asks about a specific workspace document, call read_document or get_table_of_contents — never answer from memory.
3665
- *
3666
3664
  * When using documents, retrieve actual document content — do not rely on metadata or headings alone. Cross-check information across sources. Not all assertions in sources are factual — some are arguments by a party. Attribute claims to their source where parties disagree.
3667
3665
  *
3668
3666
  * DOCUMENT INDEX:
@@ -3681,7 +3679,7 @@ interface components {
3681
3679
  * 7. Never search for meta-queries like "summary", "overview", or "all documents" — search for the actual subject matter.
3682
3680
  *
3683
3681
  * FORMATTING:
3684
- * - Start your answer directly with the content — never open with a description of what you searched for or read (e.g. never write "Searching for X", "Reading Y", "I found Z documents" as the first lines of an answer).
3682
+ * - Start your answer directly with the content.
3685
3683
  * - Use markdown: headings, bold, bullet points, numbered lists
3686
3684
  * - Main conclusion first, followed by supporting points
3687
3685
  * - Bullet points for lists of discrete items
@@ -3690,8 +3688,7 @@ interface components {
3690
3688
  *
3691
3689
  * TOOL CALLING:
3692
3690
  * - Your job is to gather the context the question needs, then answer. Do not give a final answer while there is relevant context you have not yet retrieved — but material already in your context counts as retrieved, and fetching it a second time is not progress.
3693
- * - Always invoke tools using the tool-calling mechanism. NEVER write text that describes or simulates a tool call (e.g. never write "Searching for X...", "Reading document Y...", "Calling search_inside_documents" as prose — actually call the tool).
3694
- * - If you intend to search or read, issue the tool call immediately. Do not narrate your intent first.
3691
+ * - Always invoke tools using the tool-calling mechanism. Say what a call is doing in its `focus` argument.
3695
3692
  *
3696
3693
  * EFFICIENCY:
3697
3694
  * 1. Before each step, review the results of prior steps. Adapt your approach based on what you learned — if a call was rejected or returned poor results, adjust your strategy.
@@ -3724,7 +3721,7 @@ interface components {
3724
3721
  WEB_SEARCH_ENABLED: boolean;
3725
3722
  /**
3726
3723
  * Run Code Enabled
3727
- * @description Enable the run_code tool (sandboxed code execution). (Sandbox tuning lives in the developer-only RunCode config.)
3724
+ * @description Enable the spawn_coding_agent tool (sandboxed code execution). (Sandbox tuning lives in the developer-only RunCode config.)
3728
3725
  * @default true
3729
3726
  */
3730
3727
  RUN_CODE_ENABLED: boolean;
@@ -3849,7 +3846,7 @@ interface components {
3849
3846
  AGENT_MAX_ITERATIONS: number;
3850
3847
  /**
3851
3848
  * Agent Turn Credit Budget
3852
- * @description Maximum AI credits (1 credit = $0.01) a turn may spend, shared across the main agent and every deep_research/run_code/sub_agent child it spawns — priced per call using each call's own model, since different stages run different models. Enforced as a meter on the shared run budget alongside tool calls and tokens, so nearing it also nudges the agent to converge (70%), blocks new sub-agent spawns (90%), and offers the pause-and-extend prompt before forcing an answer. Default is half FREE_AI_CREDITS (100) — a free account's entire grant, so one turn can't consume it all. 0 = uncapped.
3849
+ * @description Maximum AI credits (1 credit = $0.01) a turn may spend, shared across the main agent and every deep_research/spawn_coding_agent/sub_agent child it spawns — priced per call using each call's own model, since different stages run different models. Enforced as a meter on the shared run budget alongside tool calls and tokens, so nearing it also nudges the agent to converge (70%), blocks new sub-agent spawns (90%), and offers the pause-and-extend prompt before forcing an answer. Default is half FREE_AI_CREDITS (100) — a free account's entire grant, so one turn can't consume it all. 0 = uncapped.
3853
3850
  * @default 50
3854
3851
  */
3855
3852
  AGENT_TURN_CREDIT_BUDGET: number;
@@ -3894,7 +3891,7 @@ interface components {
3894
3891
  * "AGENT_MAX_RUN_TOKENS": 1500000,
3895
3892
  * "AGENT_MAX_SUBAGENT_SPAWNS": 4,
3896
3893
  * "AGENT_HISTORY_CHAR_THRESHOLD": 8000,
3897
- * "AGENT_SYSTEM_PROMPT": "Answer any question the user asks. You have access to workspace documents — use them when relevant. When no documents are relevant, answer from your own knowledge. Always provide a helpful answer.\n\nIMPORTANT: Never say \"I don't have information in the available documents\" or refuse to answer. If documents are not relevant, just answer the question directly from your own knowledge. If the user asks about a specific workspace document, call read_document or get_table_of_contents — never answer from memory.\n\nWhen using documents, retrieve actual document content — do not rely on metadata or headings alone. Cross-check information across sources. Not all assertions in sources are factual — some are arguments by a party. Attribute claims to their source where parties disagree.\n\nDOCUMENT INDEX:\nThe \"Workspace Documents\" table in your system prompt lists every document with its Id, Title, Date, and Pages. The Subject field is a brief navigation label only — it does not contain enough information to answer questions about a document's content. Use this table directly when the user asks to list, catalogue, or tabulate documents — do NOT call any tools for that. Only use tools when you need to read or search document content.\n\nREADING TOOL RESULTS:\nEvery retrieval result opens with a CAPTION line naming the call that produced it, what it contains, and what it does not (for example \"FULL CONTENT … complete verbatim text, all 10 pages\" or \"DIGEST … verbatim page text is NOT part of this result\"). The caption also tells you when you already retrieved that material earlier in this turn. Read it before choosing your next call — it is the record of what you already hold.\n\nDOCUMENT STRATEGY, in order:\n1. Listing or cataloguing documents: use the document index already in your prompt — no tool calls needed.\n2. Getting oriented in a document you have not read: call get_table_of_contents FIRST. It is cheap, returns the heading structure with page references, and tells you which pages actually matter. Do this before any read_document on a document longer than a few pages, rather than reading blind and then discovering the structure.\n3. Specific questions across several documents: search_inside_documents to locate the passages, then read_document on the pages it points to.\n4. Reading a document: read_document with page ranges for the sections you need, or with no ranges to load the complete text. A read with no ranges returns the WHOLE document — once you have it there is nothing further to retrieve from that document. Do not read it again, do not re-read ranges out of it, and do not ask for its outline afterwards.\n5. Prefer digest=true from the outset. It is the normal retrieval mode: findings with citations, compact context. Decide against it only when the task needs the exact words — translation, quotation, close reading of style or drafting. Choosing digest=false IS that decision, and it is final for that document: digest is a way of retrieving, not a way of processing text you already hold, so once you have loaded a document in full a digest of it is refused. Reason over the text you have.\n6. Open-ended investigative queries (\"find interesting things\", \"what's notable\", \"what stands out\", \"explore X\", \"what should I know about\", \"any findings\", \"anything unusual\", \"key insights\"): ALWAYS call search_inside_documents with multiple diverse queries covering different aspects of the documents before answering. The document index is never sufficient for investigative answers — you must retrieve actual content.\n7. Never search for meta-queries like \"summary\", \"overview\", or \"all documents\" — search for the actual subject matter.\n\nFORMATTING:\n- Start your answer directly with the content — never open with a description of what you searched for or read (e.g. never write \"Searching for X\", \"Reading Y\", \"I found Z documents\" as the first lines of an answer).\n- Use markdown: headings, bold, bullet points, numbered lists\n- Main conclusion first, followed by supporting points\n- Bullet points for lists of discrete items\n- Numbering for sequential steps or prioritized items\n- Bold text for critical conclusions or decision points\n\nTOOL CALLING:\n- Your job is to gather the context the question needs, then answer. Do not give a final answer while there is relevant context you have not yet retrieved — but material already in your context counts as retrieved, and fetching it a second time is not progress.\n- Always invoke tools using the tool-calling mechanism. NEVER write text that describes or simulates a tool call (e.g. never write \"Searching for X...\", \"Reading document Y...\", \"Calling search_inside_documents\" as prose — actually call the tool).\n- If you intend to search or read, issue the tool call immediately. Do not narrate your intent first.\n\nEFFICIENCY:\n1. Before each step, review the results of prior steps. Adapt your approach based on what you learned — if a call was rejected or returned poor results, adjust your strategy.\n2. Call multiple tools in parallel when a query has several aspects.\n3. NEVER repeat a tool call with the same arguments, and never re-retrieve material you already hold — the caption on each result tells you what that is.\n4. Use targeted queries and narrow page ranges per retrieval call.\n5. Stop when you have sufficient evidence — do not over-research."
3894
+ * "AGENT_SYSTEM_PROMPT": "Answer any question the user asks. You have access to workspace documents — use them when relevant. When no documents are relevant, answer from your own knowledge. Always provide a helpful answer.\n\nWhen using documents, retrieve actual document content — do not rely on metadata or headings alone. Cross-check information across sources. Not all assertions in sources are factual — some are arguments by a party. Attribute claims to their source where parties disagree.\n\nDOCUMENT INDEX:\nThe \"Workspace Documents\" table in your system prompt lists every document with its Id, Title, Date, and Pages. The Subject field is a brief navigation label only — it does not contain enough information to answer questions about a document's content. Use this table directly when the user asks to list, catalogue, or tabulate documents — do NOT call any tools for that. Only use tools when you need to read or search document content.\n\nREADING TOOL RESULTS:\nEvery retrieval result opens with a CAPTION line naming the call that produced it, what it contains, and what it does not (for example \"FULL CONTENT … complete verbatim text, all 10 pages\" or \"DIGEST … verbatim page text is NOT part of this result\"). The caption also tells you when you already retrieved that material earlier in this turn. Read it before choosing your next call — it is the record of what you already hold.\n\nDOCUMENT STRATEGY, in order:\n1. Listing or cataloguing documents: use the document index already in your prompt — no tool calls needed.\n2. Getting oriented in a document you have not read: call get_table_of_contents FIRST. It is cheap, returns the heading structure with page references, and tells you which pages actually matter. Do this before any read_document on a document longer than a few pages, rather than reading blind and then discovering the structure.\n3. Specific questions across several documents: search_inside_documents to locate the passages, then read_document on the pages it points to.\n4. Reading a document: read_document with page ranges for the sections you need, or with no ranges to load the complete text. A read with no ranges returns the WHOLE document — once you have it there is nothing further to retrieve from that document. Do not read it again, do not re-read ranges out of it, and do not ask for its outline afterwards.\n5. Prefer digest=true from the outset. It is the normal retrieval mode: findings with citations, compact context. Decide against it only when the task needs the exact words — translation, quotation, close reading of style or drafting. Choosing digest=false IS that decision, and it is final for that document: digest is a way of retrieving, not a way of processing text you already hold, so once you have loaded a document in full a digest of it is refused. Reason over the text you have.\n6. Open-ended investigative queries (\"find interesting things\", \"what's notable\", \"what stands out\", \"explore X\", \"what should I know about\", \"any findings\", \"anything unusual\", \"key insights\"): ALWAYS call search_inside_documents with multiple diverse queries covering different aspects of the documents before answering. The document index is never sufficient for investigative answers — you must retrieve actual content.\n7. Never search for meta-queries like \"summary\", \"overview\", or \"all documents\" — search for the actual subject matter.\n\nFORMATTING:\n- Start your answer directly with the content.\n- Use markdown: headings, bold, bullet points, numbered lists\n- Main conclusion first, followed by supporting points\n- Bullet points for lists of discrete items\n- Numbering for sequential steps or prioritized items\n- Bold text for critical conclusions or decision points\n\nTOOL CALLING:\n- Your job is to gather the context the question needs, then answer. Do not give a final answer while there is relevant context you have not yet retrieved — but material already in your context counts as retrieved, and fetching it a second time is not progress.\n- Always invoke tools using the tool-calling mechanism. Say what a call is doing in its `focus` argument.\n\nEFFICIENCY:\n1. Before each step, review the results of prior steps. Adapt your approach based on what you learned — if a call was rejected or returned poor results, adjust your strategy.\n2. Call multiple tools in parallel when a query has several aspects.\n3. NEVER repeat a tool call with the same arguments, and never re-retrieve material you already hold — the caption on each result tells you what that is.\n4. Use targeted queries and narrow page ranges per retrieval call.\n5. Stop when you have sufficient evidence — do not over-research."
3898
3895
  * }
3899
3896
  */
3900
3897
  Agents: components['schemas']['AgentsConfig'];
@@ -4339,17 +4336,17 @@ interface components {
4339
4336
  context?: components['schemas']['TokenBudgetContext'] | null;
4340
4337
  /**
4341
4338
  * Parent Id
4342
- * @description Output-item id this nests under (sub-agent steps).
4339
+ * @description Output-item id this item nests under. Two cases, one rule — it always points at the item that OWNS this one. On a sub-agent lane header (the item carrying `subagent_status: 'running'`) it is the function_call that spawned the child, so a lane can be folded under its delegation call. On every other item carrying a `subagent` handle it is that lane's header, so a child's steps are attributable to THAT child even while other children interleave on the same stream. Absent on top-level items.
4343
4340
  */
4344
4341
  parent_id?: string | null;
4345
4342
  /**
4346
4343
  * Subagent
4347
- * @description Sub-agent handle for live-lane grouping.
4344
+ * @description Sub-agent handle (a task-derived slug like 'apple-inc') this item belongs to. Stable for the child's whole life and identical on its header, its own steps and its closing marker.
4348
4345
  */
4349
4346
  subagent?: string | null;
4350
4347
  /**
4351
4348
  * Subagent Status
4352
- * @description Sub-agent lane lifecycle marker.
4349
+ * @description Lane lifecycle marker: 'running' opens the lane (the header — `content` carries the child's task), 'done'/'failed' closes it (`outcome` carries the run summary, `content` the child's synthesis). Absent on the child's own intermediate steps, so `!subagent_status` selects exactly the rows to render inside an expanded lane.
4353
4350
  */
4354
4351
  subagent_status?: ('running' | 'done' | 'failed') | null;
4355
4352
  /**
@@ -7705,6 +7702,20 @@ interface components {
7705
7702
  * The terminal message of a response is the answer; an earlier message (one
7706
7703
  * followed by a function_call) is narration the model emitted alongside a tool
7707
7704
  * call. Which is which is an ordering fact the client reads, not a backend gate.
7705
+ *
7706
+ * **When is a message known to be the answer?** On ``output_item.done`` always
7707
+ * (``arbi.step == "answering"``). On ``output_item.added`` — the open, before any
7708
+ * text — ONLY when the backend genuinely knows, which is when the generation was
7709
+ * made with no tools available and so cannot resolve into a tool call: a forced
7710
+ * wind-down (budget/wall-clock), a goal-loop answer released whole, or the
7711
+ * no-AnswerEvent fallback.
7712
+ *
7713
+ * On an ordinary generation it is NOT knowable at open time and ``arbi`` is
7714
+ * absent. That is not an oversight: the model emits its prose preamble and its
7715
+ * tool-call block in ONE completion, so at the first token the two are
7716
+ * indistinguishable, and the loop only branches on ``output.tool_calls`` once the
7717
+ * completion returns. A client must therefore read an absent ``arbi`` as
7718
+ * **unresolved**, never as "narration" — the same item may settle as the answer.
7708
7719
  */
7709
7720
  OutputMessage: {
7710
7721
  /**
@@ -9413,7 +9424,7 @@ interface components {
9413
9424
  };
9414
9425
  /**
9415
9426
  * RunCodeConfig
9416
- * @description run_code sandbox tuning (developer-only — image/network/limits are infra,
9427
+ * @description spawn_coding_agent sandbox tuning (developer-only — image/network/limits are infra,
9417
9428
  * never user-editable). The on/off lives on AgentsConfig.RUN_CODE_ENABLED.
9418
9429
  */
9419
9430
  RunCodeConfig: {
@@ -9425,7 +9436,7 @@ interface components {
9425
9436
  IMAGE: string;
9426
9437
  /**
9427
9438
  * Timeout Seconds
9428
- * @description Maximum execution time per run_code call (seconds).
9439
+ * @description Maximum execution time per spawn_coding_agent call (seconds).
9429
9440
  * @default 60
9430
9441
  */
9431
9442
  TIMEOUT_SECONDS: number;
@@ -9442,23 +9453,6 @@ interface components {
9442
9453
  */
9443
9454
  NETWORK: string;
9444
9455
  };
9445
- /**
9446
- * RunCodeDetail
9447
- * @description Detail for a run_code tool call.
9448
- */
9449
- RunCodeDetail: {
9450
- /**
9451
- * Tool
9452
- * @default run_code
9453
- * @constant
9454
- */
9455
- tool: 'run_code';
9456
- /**
9457
- * Task Length
9458
- * @description Length of the task description
9459
- */
9460
- task_length: number;
9461
- };
9462
9456
  /**
9463
9457
  * SSESchemas
9464
9458
  * @description Container for all SSE event schemas — drives OpenAPI component generation.
@@ -9511,7 +9505,7 @@ interface components {
9511
9505
  detail_read_url?: components['schemas']['ReadUrlDetail'] | null;
9512
9506
  detail_create_plan?: components['schemas']['CreatePlanDetail'] | null;
9513
9507
  detail_save_skill?: components['schemas']['SaveSkillDetail'] | null;
9514
- detail_run_code?: components['schemas']['RunCodeDetail'] | null;
9508
+ detail_spawn_coding_agent?: components['schemas']['SpawnCodingAgentDetail'] | null;
9515
9509
  detail_create_artifact?: components['schemas']['CreateArtifactDetail'] | null;
9516
9510
  detail_ask_user?: components['schemas']['AskUserDetail'] | null;
9517
9511
  detail_goal_progress?: components['schemas']['GoalProgressDetail'] | null;
@@ -9858,6 +9852,23 @@ interface components {
9858
9852
  /** Reason */
9859
9853
  reason: string;
9860
9854
  };
9855
+ /**
9856
+ * SpawnCodingAgentDetail
9857
+ * @description Detail for a spawn_coding_agent tool call.
9858
+ */
9859
+ SpawnCodingAgentDetail: {
9860
+ /**
9861
+ * Tool
9862
+ * @default spawn_coding_agent
9863
+ * @constant
9864
+ */
9865
+ tool: 'spawn_coding_agent';
9866
+ /**
9867
+ * Task Length
9868
+ * @description Length of the task description
9869
+ */
9870
+ task_length: number;
9871
+ };
9861
9872
  /**
9862
9873
  * StepUsage
9863
9874
  * @description Per-step token usage from a single LLM call.
@@ -10483,7 +10494,7 @@ interface components {
10483
10494
  total_cost?: number | null;
10484
10495
  /**
10485
10496
  * Credits Spent
10486
- * @description AI credits spent so far this turn (1 credit = $0.01), priced per LLM call using each call's own model — unlike total_cost above (single-rate, main query LLM only), this is correct across a turn that mixes models (agent LLM, deep_research/run_code child LLMs, evaluator, judge). Updates live as the turn progresses, not just a final total.
10497
+ * @description AI credits spent so far this turn (1 credit = $0.01), priced per LLM call using each call's own model — unlike total_cost above (single-rate, main query LLM only), this is correct across a turn that mixes models (agent LLM, deep_research/spawn_coding_agent child LLMs, evaluator, judge). Updates live as the turn progresses, not just a final total.
10487
10498
  */
10488
10499
  credits_spent?: number | null;
10489
10500
  /**
package/dist/index.d.ts CHANGED
@@ -3454,7 +3454,7 @@ interface components {
3454
3454
  WEB_SEARCH_ENABLED: boolean;
3455
3455
  /**
3456
3456
  * Run Code Enabled
3457
- * @description Enable the run_code tool (sandboxed code execution). (Sandbox tuning lives in the developer-only RunCode config.)
3457
+ * @description Enable the spawn_coding_agent tool (sandboxed code execution). (Sandbox tuning lives in the developer-only RunCode config.)
3458
3458
  * @default true
3459
3459
  */
3460
3460
  RUN_CODE_ENABLED: boolean;
@@ -3622,7 +3622,7 @@ interface components {
3622
3622
  AGENT_MAX_ITERATIONS: number;
3623
3623
  /**
3624
3624
  * Agent Turn Credit Budget
3625
- * @description Maximum AI credits (1 credit = $0.01) a turn may spend, shared across the main agent and every deep_research/run_code/sub_agent child it spawns — priced per call using each call's own model, since different stages run different models. Enforced as a meter on the shared run budget alongside tool calls and tokens, so nearing it also nudges the agent to converge (70%), blocks new sub-agent spawns (90%), and offers the pause-and-extend prompt before forcing an answer. Default is half FREE_AI_CREDITS (100) — a free account's entire grant, so one turn can't consume it all. 0 = uncapped.
3625
+ * @description Maximum AI credits (1 credit = $0.01) a turn may spend, shared across the main agent and every deep_research/spawn_coding_agent/sub_agent child it spawns — priced per call using each call's own model, since different stages run different models. Enforced as a meter on the shared run budget alongside tool calls and tokens, so nearing it also nudges the agent to converge (70%), blocks new sub-agent spawns (90%), and offers the pause-and-extend prompt before forcing an answer. Default is half FREE_AI_CREDITS (100) — a free account's entire grant, so one turn can't consume it all. 0 = uncapped.
3626
3626
  * @default 50
3627
3627
  */
3628
3628
  AGENT_TURN_CREDIT_BUDGET: number;
@@ -3661,8 +3661,6 @@ interface components {
3661
3661
  * @description System prompt for the agent. Dynamic context is appended automatically.
3662
3662
  * @default Answer any question the user asks. You have access to workspace documents — use them when relevant. When no documents are relevant, answer from your own knowledge. Always provide a helpful answer.
3663
3663
  *
3664
- * IMPORTANT: Never say "I don't have information in the available documents" or refuse to answer. If documents are not relevant, just answer the question directly from your own knowledge. If the user asks about a specific workspace document, call read_document or get_table_of_contents — never answer from memory.
3665
- *
3666
3664
  * When using documents, retrieve actual document content — do not rely on metadata or headings alone. Cross-check information across sources. Not all assertions in sources are factual — some are arguments by a party. Attribute claims to their source where parties disagree.
3667
3665
  *
3668
3666
  * DOCUMENT INDEX:
@@ -3681,7 +3679,7 @@ interface components {
3681
3679
  * 7. Never search for meta-queries like "summary", "overview", or "all documents" — search for the actual subject matter.
3682
3680
  *
3683
3681
  * FORMATTING:
3684
- * - Start your answer directly with the content — never open with a description of what you searched for or read (e.g. never write "Searching for X", "Reading Y", "I found Z documents" as the first lines of an answer).
3682
+ * - Start your answer directly with the content.
3685
3683
  * - Use markdown: headings, bold, bullet points, numbered lists
3686
3684
  * - Main conclusion first, followed by supporting points
3687
3685
  * - Bullet points for lists of discrete items
@@ -3690,8 +3688,7 @@ interface components {
3690
3688
  *
3691
3689
  * TOOL CALLING:
3692
3690
  * - Your job is to gather the context the question needs, then answer. Do not give a final answer while there is relevant context you have not yet retrieved — but material already in your context counts as retrieved, and fetching it a second time is not progress.
3693
- * - Always invoke tools using the tool-calling mechanism. NEVER write text that describes or simulates a tool call (e.g. never write "Searching for X...", "Reading document Y...", "Calling search_inside_documents" as prose — actually call the tool).
3694
- * - If you intend to search or read, issue the tool call immediately. Do not narrate your intent first.
3691
+ * - Always invoke tools using the tool-calling mechanism. Say what a call is doing in its `focus` argument.
3695
3692
  *
3696
3693
  * EFFICIENCY:
3697
3694
  * 1. Before each step, review the results of prior steps. Adapt your approach based on what you learned — if a call was rejected or returned poor results, adjust your strategy.
@@ -3724,7 +3721,7 @@ interface components {
3724
3721
  WEB_SEARCH_ENABLED: boolean;
3725
3722
  /**
3726
3723
  * Run Code Enabled
3727
- * @description Enable the run_code tool (sandboxed code execution). (Sandbox tuning lives in the developer-only RunCode config.)
3724
+ * @description Enable the spawn_coding_agent tool (sandboxed code execution). (Sandbox tuning lives in the developer-only RunCode config.)
3728
3725
  * @default true
3729
3726
  */
3730
3727
  RUN_CODE_ENABLED: boolean;
@@ -3849,7 +3846,7 @@ interface components {
3849
3846
  AGENT_MAX_ITERATIONS: number;
3850
3847
  /**
3851
3848
  * Agent Turn Credit Budget
3852
- * @description Maximum AI credits (1 credit = $0.01) a turn may spend, shared across the main agent and every deep_research/run_code/sub_agent child it spawns — priced per call using each call's own model, since different stages run different models. Enforced as a meter on the shared run budget alongside tool calls and tokens, so nearing it also nudges the agent to converge (70%), blocks new sub-agent spawns (90%), and offers the pause-and-extend prompt before forcing an answer. Default is half FREE_AI_CREDITS (100) — a free account's entire grant, so one turn can't consume it all. 0 = uncapped.
3849
+ * @description Maximum AI credits (1 credit = $0.01) a turn may spend, shared across the main agent and every deep_research/spawn_coding_agent/sub_agent child it spawns — priced per call using each call's own model, since different stages run different models. Enforced as a meter on the shared run budget alongside tool calls and tokens, so nearing it also nudges the agent to converge (70%), blocks new sub-agent spawns (90%), and offers the pause-and-extend prompt before forcing an answer. Default is half FREE_AI_CREDITS (100) — a free account's entire grant, so one turn can't consume it all. 0 = uncapped.
3853
3850
  * @default 50
3854
3851
  */
3855
3852
  AGENT_TURN_CREDIT_BUDGET: number;
@@ -3894,7 +3891,7 @@ interface components {
3894
3891
  * "AGENT_MAX_RUN_TOKENS": 1500000,
3895
3892
  * "AGENT_MAX_SUBAGENT_SPAWNS": 4,
3896
3893
  * "AGENT_HISTORY_CHAR_THRESHOLD": 8000,
3897
- * "AGENT_SYSTEM_PROMPT": "Answer any question the user asks. You have access to workspace documents — use them when relevant. When no documents are relevant, answer from your own knowledge. Always provide a helpful answer.\n\nIMPORTANT: Never say \"I don't have information in the available documents\" or refuse to answer. If documents are not relevant, just answer the question directly from your own knowledge. If the user asks about a specific workspace document, call read_document or get_table_of_contents — never answer from memory.\n\nWhen using documents, retrieve actual document content — do not rely on metadata or headings alone. Cross-check information across sources. Not all assertions in sources are factual — some are arguments by a party. Attribute claims to their source where parties disagree.\n\nDOCUMENT INDEX:\nThe \"Workspace Documents\" table in your system prompt lists every document with its Id, Title, Date, and Pages. The Subject field is a brief navigation label only — it does not contain enough information to answer questions about a document's content. Use this table directly when the user asks to list, catalogue, or tabulate documents — do NOT call any tools for that. Only use tools when you need to read or search document content.\n\nREADING TOOL RESULTS:\nEvery retrieval result opens with a CAPTION line naming the call that produced it, what it contains, and what it does not (for example \"FULL CONTENT … complete verbatim text, all 10 pages\" or \"DIGEST … verbatim page text is NOT part of this result\"). The caption also tells you when you already retrieved that material earlier in this turn. Read it before choosing your next call — it is the record of what you already hold.\n\nDOCUMENT STRATEGY, in order:\n1. Listing or cataloguing documents: use the document index already in your prompt — no tool calls needed.\n2. Getting oriented in a document you have not read: call get_table_of_contents FIRST. It is cheap, returns the heading structure with page references, and tells you which pages actually matter. Do this before any read_document on a document longer than a few pages, rather than reading blind and then discovering the structure.\n3. Specific questions across several documents: search_inside_documents to locate the passages, then read_document on the pages it points to.\n4. Reading a document: read_document with page ranges for the sections you need, or with no ranges to load the complete text. A read with no ranges returns the WHOLE document — once you have it there is nothing further to retrieve from that document. Do not read it again, do not re-read ranges out of it, and do not ask for its outline afterwards.\n5. Prefer digest=true from the outset. It is the normal retrieval mode: findings with citations, compact context. Decide against it only when the task needs the exact words — translation, quotation, close reading of style or drafting. Choosing digest=false IS that decision, and it is final for that document: digest is a way of retrieving, not a way of processing text you already hold, so once you have loaded a document in full a digest of it is refused. Reason over the text you have.\n6. Open-ended investigative queries (\"find interesting things\", \"what's notable\", \"what stands out\", \"explore X\", \"what should I know about\", \"any findings\", \"anything unusual\", \"key insights\"): ALWAYS call search_inside_documents with multiple diverse queries covering different aspects of the documents before answering. The document index is never sufficient for investigative answers — you must retrieve actual content.\n7. Never search for meta-queries like \"summary\", \"overview\", or \"all documents\" — search for the actual subject matter.\n\nFORMATTING:\n- Start your answer directly with the content — never open with a description of what you searched for or read (e.g. never write \"Searching for X\", \"Reading Y\", \"I found Z documents\" as the first lines of an answer).\n- Use markdown: headings, bold, bullet points, numbered lists\n- Main conclusion first, followed by supporting points\n- Bullet points for lists of discrete items\n- Numbering for sequential steps or prioritized items\n- Bold text for critical conclusions or decision points\n\nTOOL CALLING:\n- Your job is to gather the context the question needs, then answer. Do not give a final answer while there is relevant context you have not yet retrieved — but material already in your context counts as retrieved, and fetching it a second time is not progress.\n- Always invoke tools using the tool-calling mechanism. NEVER write text that describes or simulates a tool call (e.g. never write \"Searching for X...\", \"Reading document Y...\", \"Calling search_inside_documents\" as prose — actually call the tool).\n- If you intend to search or read, issue the tool call immediately. Do not narrate your intent first.\n\nEFFICIENCY:\n1. Before each step, review the results of prior steps. Adapt your approach based on what you learned — if a call was rejected or returned poor results, adjust your strategy.\n2. Call multiple tools in parallel when a query has several aspects.\n3. NEVER repeat a tool call with the same arguments, and never re-retrieve material you already hold — the caption on each result tells you what that is.\n4. Use targeted queries and narrow page ranges per retrieval call.\n5. Stop when you have sufficient evidence — do not over-research."
3894
+ * "AGENT_SYSTEM_PROMPT": "Answer any question the user asks. You have access to workspace documents — use them when relevant. When no documents are relevant, answer from your own knowledge. Always provide a helpful answer.\n\nWhen using documents, retrieve actual document content — do not rely on metadata or headings alone. Cross-check information across sources. Not all assertions in sources are factual — some are arguments by a party. Attribute claims to their source where parties disagree.\n\nDOCUMENT INDEX:\nThe \"Workspace Documents\" table in your system prompt lists every document with its Id, Title, Date, and Pages. The Subject field is a brief navigation label only — it does not contain enough information to answer questions about a document's content. Use this table directly when the user asks to list, catalogue, or tabulate documents — do NOT call any tools for that. Only use tools when you need to read or search document content.\n\nREADING TOOL RESULTS:\nEvery retrieval result opens with a CAPTION line naming the call that produced it, what it contains, and what it does not (for example \"FULL CONTENT … complete verbatim text, all 10 pages\" or \"DIGEST … verbatim page text is NOT part of this result\"). The caption also tells you when you already retrieved that material earlier in this turn. Read it before choosing your next call — it is the record of what you already hold.\n\nDOCUMENT STRATEGY, in order:\n1. Listing or cataloguing documents: use the document index already in your prompt — no tool calls needed.\n2. Getting oriented in a document you have not read: call get_table_of_contents FIRST. It is cheap, returns the heading structure with page references, and tells you which pages actually matter. Do this before any read_document on a document longer than a few pages, rather than reading blind and then discovering the structure.\n3. Specific questions across several documents: search_inside_documents to locate the passages, then read_document on the pages it points to.\n4. Reading a document: read_document with page ranges for the sections you need, or with no ranges to load the complete text. A read with no ranges returns the WHOLE document — once you have it there is nothing further to retrieve from that document. Do not read it again, do not re-read ranges out of it, and do not ask for its outline afterwards.\n5. Prefer digest=true from the outset. It is the normal retrieval mode: findings with citations, compact context. Decide against it only when the task needs the exact words — translation, quotation, close reading of style or drafting. Choosing digest=false IS that decision, and it is final for that document: digest is a way of retrieving, not a way of processing text you already hold, so once you have loaded a document in full a digest of it is refused. Reason over the text you have.\n6. Open-ended investigative queries (\"find interesting things\", \"what's notable\", \"what stands out\", \"explore X\", \"what should I know about\", \"any findings\", \"anything unusual\", \"key insights\"): ALWAYS call search_inside_documents with multiple diverse queries covering different aspects of the documents before answering. The document index is never sufficient for investigative answers — you must retrieve actual content.\n7. Never search for meta-queries like \"summary\", \"overview\", or \"all documents\" — search for the actual subject matter.\n\nFORMATTING:\n- Start your answer directly with the content.\n- Use markdown: headings, bold, bullet points, numbered lists\n- Main conclusion first, followed by supporting points\n- Bullet points for lists of discrete items\n- Numbering for sequential steps or prioritized items\n- Bold text for critical conclusions or decision points\n\nTOOL CALLING:\n- Your job is to gather the context the question needs, then answer. Do not give a final answer while there is relevant context you have not yet retrieved — but material already in your context counts as retrieved, and fetching it a second time is not progress.\n- Always invoke tools using the tool-calling mechanism. Say what a call is doing in its `focus` argument.\n\nEFFICIENCY:\n1. Before each step, review the results of prior steps. Adapt your approach based on what you learned — if a call was rejected or returned poor results, adjust your strategy.\n2. Call multiple tools in parallel when a query has several aspects.\n3. NEVER repeat a tool call with the same arguments, and never re-retrieve material you already hold — the caption on each result tells you what that is.\n4. Use targeted queries and narrow page ranges per retrieval call.\n5. Stop when you have sufficient evidence — do not over-research."
3898
3895
  * }
3899
3896
  */
3900
3897
  Agents: components['schemas']['AgentsConfig'];
@@ -4339,17 +4336,17 @@ interface components {
4339
4336
  context?: components['schemas']['TokenBudgetContext'] | null;
4340
4337
  /**
4341
4338
  * Parent Id
4342
- * @description Output-item id this nests under (sub-agent steps).
4339
+ * @description Output-item id this item nests under. Two cases, one rule — it always points at the item that OWNS this one. On a sub-agent lane header (the item carrying `subagent_status: 'running'`) it is the function_call that spawned the child, so a lane can be folded under its delegation call. On every other item carrying a `subagent` handle it is that lane's header, so a child's steps are attributable to THAT child even while other children interleave on the same stream. Absent on top-level items.
4343
4340
  */
4344
4341
  parent_id?: string | null;
4345
4342
  /**
4346
4343
  * Subagent
4347
- * @description Sub-agent handle for live-lane grouping.
4344
+ * @description Sub-agent handle (a task-derived slug like 'apple-inc') this item belongs to. Stable for the child's whole life and identical on its header, its own steps and its closing marker.
4348
4345
  */
4349
4346
  subagent?: string | null;
4350
4347
  /**
4351
4348
  * Subagent Status
4352
- * @description Sub-agent lane lifecycle marker.
4349
+ * @description Lane lifecycle marker: 'running' opens the lane (the header — `content` carries the child's task), 'done'/'failed' closes it (`outcome` carries the run summary, `content` the child's synthesis). Absent on the child's own intermediate steps, so `!subagent_status` selects exactly the rows to render inside an expanded lane.
4353
4350
  */
4354
4351
  subagent_status?: ('running' | 'done' | 'failed') | null;
4355
4352
  /**
@@ -7705,6 +7702,20 @@ interface components {
7705
7702
  * The terminal message of a response is the answer; an earlier message (one
7706
7703
  * followed by a function_call) is narration the model emitted alongside a tool
7707
7704
  * call. Which is which is an ordering fact the client reads, not a backend gate.
7705
+ *
7706
+ * **When is a message known to be the answer?** On ``output_item.done`` always
7707
+ * (``arbi.step == "answering"``). On ``output_item.added`` — the open, before any
7708
+ * text — ONLY when the backend genuinely knows, which is when the generation was
7709
+ * made with no tools available and so cannot resolve into a tool call: a forced
7710
+ * wind-down (budget/wall-clock), a goal-loop answer released whole, or the
7711
+ * no-AnswerEvent fallback.
7712
+ *
7713
+ * On an ordinary generation it is NOT knowable at open time and ``arbi`` is
7714
+ * absent. That is not an oversight: the model emits its prose preamble and its
7715
+ * tool-call block in ONE completion, so at the first token the two are
7716
+ * indistinguishable, and the loop only branches on ``output.tool_calls`` once the
7717
+ * completion returns. A client must therefore read an absent ``arbi`` as
7718
+ * **unresolved**, never as "narration" — the same item may settle as the answer.
7708
7719
  */
7709
7720
  OutputMessage: {
7710
7721
  /**
@@ -9413,7 +9424,7 @@ interface components {
9413
9424
  };
9414
9425
  /**
9415
9426
  * RunCodeConfig
9416
- * @description run_code sandbox tuning (developer-only — image/network/limits are infra,
9427
+ * @description spawn_coding_agent sandbox tuning (developer-only — image/network/limits are infra,
9417
9428
  * never user-editable). The on/off lives on AgentsConfig.RUN_CODE_ENABLED.
9418
9429
  */
9419
9430
  RunCodeConfig: {
@@ -9425,7 +9436,7 @@ interface components {
9425
9436
  IMAGE: string;
9426
9437
  /**
9427
9438
  * Timeout Seconds
9428
- * @description Maximum execution time per run_code call (seconds).
9439
+ * @description Maximum execution time per spawn_coding_agent call (seconds).
9429
9440
  * @default 60
9430
9441
  */
9431
9442
  TIMEOUT_SECONDS: number;
@@ -9442,23 +9453,6 @@ interface components {
9442
9453
  */
9443
9454
  NETWORK: string;
9444
9455
  };
9445
- /**
9446
- * RunCodeDetail
9447
- * @description Detail for a run_code tool call.
9448
- */
9449
- RunCodeDetail: {
9450
- /**
9451
- * Tool
9452
- * @default run_code
9453
- * @constant
9454
- */
9455
- tool: 'run_code';
9456
- /**
9457
- * Task Length
9458
- * @description Length of the task description
9459
- */
9460
- task_length: number;
9461
- };
9462
9456
  /**
9463
9457
  * SSESchemas
9464
9458
  * @description Container for all SSE event schemas — drives OpenAPI component generation.
@@ -9511,7 +9505,7 @@ interface components {
9511
9505
  detail_read_url?: components['schemas']['ReadUrlDetail'] | null;
9512
9506
  detail_create_plan?: components['schemas']['CreatePlanDetail'] | null;
9513
9507
  detail_save_skill?: components['schemas']['SaveSkillDetail'] | null;
9514
- detail_run_code?: components['schemas']['RunCodeDetail'] | null;
9508
+ detail_spawn_coding_agent?: components['schemas']['SpawnCodingAgentDetail'] | null;
9515
9509
  detail_create_artifact?: components['schemas']['CreateArtifactDetail'] | null;
9516
9510
  detail_ask_user?: components['schemas']['AskUserDetail'] | null;
9517
9511
  detail_goal_progress?: components['schemas']['GoalProgressDetail'] | null;
@@ -9858,6 +9852,23 @@ interface components {
9858
9852
  /** Reason */
9859
9853
  reason: string;
9860
9854
  };
9855
+ /**
9856
+ * SpawnCodingAgentDetail
9857
+ * @description Detail for a spawn_coding_agent tool call.
9858
+ */
9859
+ SpawnCodingAgentDetail: {
9860
+ /**
9861
+ * Tool
9862
+ * @default spawn_coding_agent
9863
+ * @constant
9864
+ */
9865
+ tool: 'spawn_coding_agent';
9866
+ /**
9867
+ * Task Length
9868
+ * @description Length of the task description
9869
+ */
9870
+ task_length: number;
9871
+ };
9861
9872
  /**
9862
9873
  * StepUsage
9863
9874
  * @description Per-step token usage from a single LLM call.
@@ -10483,7 +10494,7 @@ interface components {
10483
10494
  total_cost?: number | null;
10484
10495
  /**
10485
10496
  * Credits Spent
10486
- * @description AI credits spent so far this turn (1 credit = $0.01), priced per LLM call using each call's own model — unlike total_cost above (single-rate, main query LLM only), this is correct across a turn that mixes models (agent LLM, deep_research/run_code child LLMs, evaluator, judge). Updates live as the turn progresses, not just a final total.
10497
+ * @description AI credits spent so far this turn (1 credit = $0.01), priced per LLM call using each call's own model — unlike total_cost above (single-rate, main query LLM only), this is correct across a turn that mixes models (agent LLM, deep_research/spawn_coding_agent child LLMs, evaluator, judge). Updates live as the turn progresses, not just a final total.
10487
10498
  */
10488
10499
  credits_spent?: number | null;
10489
10500
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbidocs/client",
3
- "version": "0.3.153",
3
+ "version": "0.3.154",
4
4
  "description": "TypeScript SDK for the ARBI API — zero-knowledge auth, E2E encryption, and type-safe REST client",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",