@arbidocs/client 0.3.146 → 0.3.147

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 (3) hide show
  1. package/dist/index.d.cts +102 -187
  2. package/dist/index.d.ts +102 -187
  3. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -885,15 +885,37 @@ interface paths {
885
885
  put?: never;
886
886
  /**
887
887
  * Copy Workspace Data
888
- * @description Copy documents from source workspace (current) to target workspace.
888
+ * @description Copy selected items from the source workspace (current) to a target workspace.
889
889
  *
890
890
  * Requires workspace-scoped JWT for the source workspace.
891
891
  * Target workspace key is provided in the request body (SecretBox-encrypted with session key).
892
892
  *
893
- * Copies:
894
- * - Document metadata (title, doc_date, shared status, etc.)
895
- * - MinIO encrypted files (downloaded to server memory, re-encrypted, uploaded)
896
- * - Qdrant vectors (with updated doc_ext_id and chunk_ext_id references)
893
+ * ``items`` is a flat, heterogeneous list of external IDs; the prefix selects
894
+ * what is copied, and **exactly** the listed items are copied — nothing rides
895
+ * along:
896
+ *
897
+ * - ``doc-`` document — row + MinIO files + Qdrant vectors, all re-encrypted
898
+ * with the target workspace key. Chunk external IDs are preserved.
899
+ * - ``tag-`` tag — merged into a same-named tag already in the target if there
900
+ * is one, otherwise created. A parent tag that is not in the target flattens
901
+ * the copy to a root tag.
902
+ * - ``dtj-`` doctag — requires BOTH its document (selected in the same request)
903
+ * and its tag (selected, or already present by name) in the target; RLS makes
904
+ * any other combination impossible. Fails with a reason otherwise.
905
+ * - ``fct-`` fact — content, date span, timezone and citations preserved; pins
906
+ * are not (a pin is the pinning account's own state).
907
+ * - ``con-`` chat — conversation + every message, with the parent/child tree
908
+ * and the encrypted ``tools`` blob rebuilt.
909
+ *
910
+ * Facts and chats need no vector copy: both live in pointer-only collections
911
+ * keyed by external ID and are indexed on write / by the lazy backfill.
912
+ *
913
+ * ``created_by`` is NOT preserved. Every content table's RLS ``WITH CHECK``
914
+ * forces it to the copying user, so copies are attributed to whoever ran the
915
+ * copy, never to the original author.
916
+ *
917
+ * Each item is copied in its own savepoint, so one failure does not abort the
918
+ * batch; per-item outcomes are in ``results``.
897
919
  */
898
920
  post: operations['copy_workspace_data'];
899
921
  delete?: never;
@@ -930,28 +952,6 @@ interface paths {
930
952
  patch: operations['update_workspace'];
931
953
  trace?: never;
932
954
  };
933
- '/v1/workspace/{workspace_ext_id}/chronology': {
934
- parameters: {
935
- query?: never;
936
- header?: never;
937
- path?: never;
938
- cookie?: never;
939
- };
940
- /**
941
- * Get Workspace Chronology
942
- * @description Return the last-generated chronology for a workspace.
943
- *
944
- * Returns all-null fields when no chronology has been generated yet.
945
- */
946
- get: operations['get_workspace_chronology'];
947
- put?: never;
948
- post?: never;
949
- delete?: never;
950
- options?: never;
951
- head?: never;
952
- patch?: never;
953
- trace?: never;
954
- };
955
955
  '/v1/document/list': {
956
956
  parameters: {
957
957
  query?: never;
@@ -1345,30 +1345,6 @@ interface paths {
1345
1345
  patch?: never;
1346
1346
  trace?: never;
1347
1347
  };
1348
- '/v1/document/chronology': {
1349
- parameters: {
1350
- query?: never;
1351
- header?: never;
1352
- path?: never;
1353
- cookie?: never;
1354
- };
1355
- get?: never;
1356
- put?: never;
1357
- /**
1358
- * Generate Workspace Chronology
1359
- * @description Generate a chronological timeline of events from the specified documents.
1360
- *
1361
- * Runs LLM analysis over the selected documents and persists the result in the
1362
- * workspace_chronology table (one row per workspace, upserted on each generation).
1363
- * Returns the generated events alongside metadata about when they were produced.
1364
- */
1365
- post: operations['generate_chronology'];
1366
- delete?: never;
1367
- options?: never;
1368
- head?: never;
1369
- patch?: never;
1370
- trace?: never;
1371
- };
1372
1348
  '/v1/conversation/list': {
1373
1349
  parameters: {
1374
1350
  query?: never;
@@ -3656,6 +3632,24 @@ interface components {
3656
3632
  * @default 10
3657
3633
  */
3658
3634
  AGENT_MAX_PARALLEL_TOOL_CALLS: number;
3635
+ /**
3636
+ * Agent Max Total Tool Calls
3637
+ * @description Run-wide cap on tool executions across the main agent AND all nested sub-agents (deep_research / run_skill / sub_agent) in a single user query. When reached, further tool calls are refused and the agent is forced to answer from what it has gathered; at 2x the run is hard-stopped. 0 = disabled.
3638
+ * @default 80
3639
+ */
3640
+ AGENT_MAX_TOTAL_TOOL_CALLS: number;
3641
+ /**
3642
+ * Agent Max Run Tokens
3643
+ * @description Run-wide cap on total tokens (input+output+reasoning, provider-reported) across every LLM call in a single user query — agent iterations, nested sub-agents, and helper calls (evaluator, reranker, goal judge). When reached the agent is forced to answer from what it has gathered; at 2x the run is hard-stopped. Best-effort metering — the exact AGENT_MAX_TOTAL_TOOL_CALLS meter backs it up. 0 = disabled.
3644
+ * @default 1500000
3645
+ */
3646
+ AGENT_MAX_RUN_TOKENS: number;
3647
+ /**
3648
+ * Agent Max Subagent Spawns
3649
+ * @description Run-wide cap on nested sub-agent spawns (deep_research / run_skill / sub_agent) in a single user query. Past the cap, spawning tools are refused while direct tools keep working until the tool-call cap. 0 = no spawns.
3650
+ * @default 4
3651
+ */
3652
+ AGENT_MAX_SUBAGENT_SPAWNS: number;
3659
3653
  /**
3660
3654
  * Agent History Char Threshold
3661
3655
  * @description Char threshold for conversation history injected into the agent context. Below: verbatim user/assistant pairs. Above: summarized by SummariseLLM.
@@ -3674,14 +3668,17 @@ interface components {
3674
3668
  * DOCUMENT INDEX:
3675
3669
  * The "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.
3676
3670
  *
3677
- * DOCUMENT STRATEGY:
3678
- * - For listing/cataloguing documents: use the document index already in your prompt — no tool calls needed.
3679
- * - For overview/summary requests: use get_table_of_contents first, then read key sections with read_document.
3680
- * - For specific questions: use search_inside_documents to find relevant sections, then read those sections with read_document.
3681
- * - For translation, deep analysis, or detailed summaries of a single document: use read_document with no ranges to load the complete text.
3682
- * - For extracting structured findings from passages: use read_document with digest=true or search_inside_documents with digest=true.
3683
- * - For 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.
3684
- * - Never search for meta-queries like "summary", "overview", or "all documents" — search for the actual subject matter.
3671
+ * READING TOOL RESULTS:
3672
+ * Every 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.
3673
+ *
3674
+ * DOCUMENT STRATEGY, in order:
3675
+ * 1. Listing or cataloguing documents: use the document index already in your prompt — no tool calls needed.
3676
+ * 2. 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.
3677
+ * 3. Specific questions across several documents: search_inside_documents to locate the passages, then read_document on the pages it points to.
3678
+ * 4. 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.
3679
+ * 5. 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.
3680
+ * 6. 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.
3681
+ * 7. Never search for meta-queries like "summary", "overview", or "all documents" — search for the actual subject matter.
3685
3682
  *
3686
3683
  * FORMATTING:
3687
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).
@@ -3692,14 +3689,14 @@ interface components {
3692
3689
  * - Bold text for critical conclusions or decision points
3693
3690
  *
3694
3691
  * TOOL CALLING:
3695
- * - Your job is to gather context by calling tools, then answer only once every reasonable tool call has been made. Do not give a final answer while there is still relevant context you could retrieve.
3692
+ * - 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.
3696
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).
3697
3694
  * - If you intend to search or read, issue the tool call immediately. Do not narrate your intent first.
3698
3695
  *
3699
3696
  * EFFICIENCY:
3700
3697
  * 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.
3701
3698
  * 2. Call multiple tools in parallel when a query has several aspects.
3702
- * 3. NEVER repeat a tool call with the same arguments.
3699
+ * 3. 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.
3703
3700
  * 4. Use targeted queries and narrow page ranges per retrieval call.
3704
3701
  * 5. Stop when you have sufficient evidence — do not over-research.
3705
3702
  */
@@ -3893,8 +3890,11 @@ interface components {
3893
3890
  * "AGENT_MAX_ITERATIONS": 20,
3894
3891
  * "AGENT_TURN_CREDIT_BUDGET": 50,
3895
3892
  * "AGENT_MAX_PARALLEL_TOOL_CALLS": 10,
3893
+ * "AGENT_MAX_TOTAL_TOOL_CALLS": 80,
3894
+ * "AGENT_MAX_RUN_TOKENS": 1500000,
3895
+ * "AGENT_MAX_SUBAGENT_SPAWNS": 4,
3896
3896
  * "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\nDOCUMENT STRATEGY:\n- For listing/cataloguing documents: use the document index already in your prompt — no tool calls needed.\n- For overview/summary requests: use get_table_of_contents first, then read key sections with read_document.\n- For specific questions: use search_inside_documents to find relevant sections, then read those sections with read_document.\n- For translation, deep analysis, or detailed summaries of a single document: use read_document with no ranges to load the complete text.\n- For extracting structured findings from passages: use read_document with digest=true or search_inside_documents with digest=true.\n- For 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.\n- 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 context by calling tools, then answer only once every reasonable tool call has been made. Do not give a final answer while there is still relevant context you could retrieve.\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.\n4. Use targeted queries and narrow page ranges per retrieval call.\n5. Stop when you have sufficient evidence — do not over-research."
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."
3898
3898
  * }
3899
3899
  */
3900
3900
  Agents: components['schemas']['AgentsConfig'];
@@ -4250,7 +4250,7 @@ interface components {
4250
4250
  type: 'arbi.error';
4251
4251
  /**
4252
4252
  * Code
4253
- * @description Error code, e.g. 'QUOTA_EXCEEDED'
4253
+ * @description Error code, e.g. 'QUOTA_EXCEEDED' (billing — opens upgrade modal) or 'RUN_BUDGET_EXCEEDED' (per-run safety cap — generic error display).
4254
4254
  */
4255
4255
  code: string;
4256
4256
  /**
@@ -4286,6 +4286,11 @@ interface components {
4286
4286
  * field) while ours reads it. The item itself stays byte-for-byte standard.
4287
4287
  */
4288
4288
  ArbiItemMeta: {
4289
+ /**
4290
+ * Step
4291
+ * @description Which lifecycle moment this item IS — stated, not inferred. A Responses item type (message / function_call / reasoning) is too coarse for the trace: three different reasoning items are the goal, the plan and a goal check, and the answer is a `message` item that is nonetheless a trace row. Clients previously sniffed `label` prefixes to tell them apart, which broke the moment a label was reworded or localised. Absent on plain tool calls (they carry `detail`) and on narration messages (which are body text, not a step).
4292
+ */
4293
+ step?: ('goal' | 'skill' | 'interjection' | 'planning' | 'tool_progress' | 'goal_progress' | 'answering' | 'evaluation') | null;
4289
4294
  /**
4290
4295
  * Label
4291
4296
  * @description Human display label. Backend-owned.
@@ -4645,11 +4650,6 @@ interface components {
4645
4650
  } & {
4646
4651
  [key: string]: unknown;
4647
4652
  };
4648
- /** ChronologyRequest */
4649
- ChronologyRequest: {
4650
- /** Doc Ext Ids */
4651
- doc_ext_ids: string[];
4652
- };
4653
4653
  /** Chunk */
4654
4654
  Chunk: {
4655
4655
  metadata: components['schemas']['ChunkMetadata'];
@@ -5349,7 +5349,15 @@ interface components {
5349
5349
  /** Title */
5350
5350
  title: string;
5351
5351
  };
5352
- /** CopyDocumentResult */
5352
+ /**
5353
+ * CopyDocumentResult
5354
+ * @description Outcome of copying ONE selected item.
5355
+ *
5356
+ * Named for documents because that is all ``/workspace/copy`` used to move;
5357
+ * the field names are kept so existing clients keep parsing the response.
5358
+ * ``source_doc_ext_id`` / ``new_doc_ext_id`` carry the source and new external
5359
+ * ID of whatever ``kind`` the item is.
5360
+ */
5353
5361
  CopyDocumentResult: {
5354
5362
  /** Source Doc Ext Id */
5355
5363
  source_doc_ext_id: string;
@@ -5359,7 +5367,17 @@ interface components {
5359
5367
  new_doc_ext_id?: string | null;
5360
5368
  /** Error */
5361
5369
  error?: string | null;
5370
+ /** @default document */
5371
+ kind: components['schemas']['CopyItemKind'];
5372
+ /** Warning */
5373
+ warning?: string | null;
5362
5374
  };
5375
+ /**
5376
+ * CopyItemKind
5377
+ * @description Which entity a copy result refers to — derived from the ext-id prefix.
5378
+ * @enum {string}
5379
+ */
5380
+ CopyItemKind: 'document' | 'tag' | 'doctag' | 'fact' | 'chat' | 'unknown';
5363
5381
  /** CopyRequest */
5364
5382
  CopyRequest: {
5365
5383
  /** Target Workspace Ext Id */
@@ -5371,7 +5389,7 @@ interface components {
5371
5389
  target_workspace_key: string;
5372
5390
  /**
5373
5391
  * Items
5374
- * @description List of document external IDs to copy (e.g., ['doc-a1b2c3d4', 'doc-e5f6g7h8'])
5392
+ * @description External IDs to copy. Heterogeneous: documents (doc-), tags (tag-), doctags (dtj-), facts (fct-) and chats (con-) may be mixed in one call — the server dispatches on the prefix and copies them in dependency order (tags → documents → doctags/facts → chats). Selection is exact: nothing is copied that was not listed.
5375
5393
  */
5376
5394
  items: string[];
5377
5395
  };
@@ -5384,6 +5402,18 @@ interface components {
5384
5402
  * @default 0
5385
5403
  */
5386
5404
  documents_copied: number;
5405
+ /**
5406
+ * Items Copied
5407
+ * @default 0
5408
+ */
5409
+ items_copied: number;
5410
+ /**
5411
+ * Copied By Kind
5412
+ * @default {}
5413
+ */
5414
+ copied_by_kind: {
5415
+ [key: string]: number;
5416
+ };
5387
5417
  /**
5388
5418
  * Results
5389
5419
  * @default []
@@ -5881,6 +5911,8 @@ interface components {
5881
5911
  /** Note */
5882
5912
  note?: string | null;
5883
5913
  citations?: components['schemas']['CitationSources'] | null;
5914
+ /** External Id */
5915
+ external_id: string;
5884
5916
  /** Doc Ext Id */
5885
5917
  doc_ext_id: string;
5886
5918
  /** Tag Ext Id */
@@ -6292,17 +6324,6 @@ interface components {
6292
6324
  /** Message */
6293
6325
  message: string;
6294
6326
  };
6295
- /**
6296
- * EvaluationDetail
6297
- * @description Detail for an evaluation learning entry.
6298
- */
6299
- EvaluationDetail: {
6300
- /**
6301
- * Statement
6302
- * @description Citation/finding statement
6303
- */
6304
- statement: string;
6305
- };
6306
6327
  /** EvaluatorLLMConfig */
6307
6328
  EvaluatorLLMConfig: {
6308
6329
  /**
@@ -9491,8 +9512,6 @@ interface components {
9491
9512
  detail_run_code?: components['schemas']['RunCodeDetail'] | null;
9492
9513
  detail_create_artifact?: components['schemas']['CreateArtifactDetail'] | null;
9493
9514
  detail_ask_user?: components['schemas']['AskUserDetail'] | null;
9494
- detail_evaluation?: components['schemas']['EvaluationDetail'] | null;
9495
- detail_tool_progress?: components['schemas']['ToolProgressDetail'] | null;
9496
9515
  detail_goal_progress?: components['schemas']['GoalProgressDetail'] | null;
9497
9516
  };
9498
9517
  /**
@@ -10493,22 +10512,6 @@ interface components {
10493
10512
  /** @description Aggregate usage across all LLM calls in the request */
10494
10513
  all_llm_calls?: components['schemas']['AllLlmCallsAggregate'] | null;
10495
10514
  };
10496
- /**
10497
- * ToolProgressDetail
10498
- * @description Detail for a tool progress update.
10499
- */
10500
- ToolProgressDetail: {
10501
- /**
10502
- * Tool
10503
- * @description Tool name
10504
- */
10505
- tool: string;
10506
- /**
10507
- * Message
10508
- * @description Progress message
10509
- */
10510
- message: string;
10511
- };
10512
10515
  /**
10513
10516
  * TraceTool
10514
10517
  * @description Execution trace tool that captures the full execution history of a request.
@@ -11020,11 +11023,6 @@ interface components {
11020
11023
  * @default false
11021
11024
  */
11022
11025
  show_skills: boolean;
11023
- /**
11024
- * Show Chronology
11025
- * @default false
11026
- */
11027
- show_chronology: boolean;
11028
11026
  /**
11029
11027
  * Show Pa Mode
11030
11028
  * @default false
@@ -11148,8 +11146,6 @@ interface components {
11148
11146
  show_templates?: boolean | null;
11149
11147
  /** Show Skills */
11150
11148
  show_skills?: boolean | null;
11151
- /** Show Chronology */
11152
- show_chronology?: boolean | null;
11153
11149
  /** Show Pa Mode */
11154
11150
  show_pa_mode?: boolean | null;
11155
11151
  /** Show Conversation Search */
@@ -11358,23 +11354,6 @@ interface components {
11358
11354
  auth?: components['schemas']['AuthMessage'] | null;
11359
11355
  send_message?: components['schemas']['SendMessageRequest'] | null;
11360
11356
  };
11361
- /**
11362
- * WorkspaceChronologyOut
11363
- * @description API response for both POST /v1/document/chronology and GET /v1/workspace/chronology.
11364
- *
11365
- * For POST: all fields are always populated (generation just happened).
11366
- * For GET: all fields are null when no chronology has been generated yet.
11367
- */
11368
- WorkspaceChronologyOut: {
11369
- /** Events */
11370
- events?: {
11371
- [key: string]: unknown;
11372
- }[] | null;
11373
- /** Generated At */
11374
- generated_at?: string | null;
11375
- /** Doc Count */
11376
- doc_count?: number | null;
11377
- };
11378
11357
  /** WorkspaceCreateRequest */
11379
11358
  WorkspaceCreateRequest: {
11380
11359
  /** Name */
@@ -12935,37 +12914,6 @@ interface operations {
12935
12914
  };
12936
12915
  };
12937
12916
  };
12938
- get_workspace_chronology: {
12939
- parameters: {
12940
- query?: never;
12941
- header?: never;
12942
- path: {
12943
- workspace_ext_id: string;
12944
- };
12945
- cookie?: never;
12946
- };
12947
- requestBody?: never;
12948
- responses: {
12949
- /** @description Successful Response */
12950
- 200: {
12951
- headers: {
12952
- [name: string]: unknown;
12953
- };
12954
- content: {
12955
- 'application/json': components['schemas']['WorkspaceChronologyOut'];
12956
- };
12957
- };
12958
- /** @description Validation Error */
12959
- 422: {
12960
- headers: {
12961
- [name: string]: unknown;
12962
- };
12963
- content: {
12964
- 'application/json': components['schemas']['HTTPValidationError'];
12965
- };
12966
- };
12967
- };
12968
- };
12969
12917
  list_documents: {
12970
12918
  parameters: {
12971
12919
  query?: {
@@ -13575,39 +13523,6 @@ interface operations {
13575
13523
  };
13576
13524
  };
13577
13525
  };
13578
- generate_chronology: {
13579
- parameters: {
13580
- query?: never;
13581
- header?: never;
13582
- path?: never;
13583
- cookie?: never;
13584
- };
13585
- requestBody: {
13586
- content: {
13587
- 'application/json': components['schemas']['ChronologyRequest'];
13588
- };
13589
- };
13590
- responses: {
13591
- /** @description Successful Response */
13592
- 200: {
13593
- headers: {
13594
- [name: string]: unknown;
13595
- };
13596
- content: {
13597
- 'application/json': components['schemas']['WorkspaceChronologyOut'];
13598
- };
13599
- };
13600
- /** @description Validation Error */
13601
- 422: {
13602
- headers: {
13603
- [name: string]: unknown;
13604
- };
13605
- content: {
13606
- 'application/json': components['schemas']['HTTPValidationError'];
13607
- };
13608
- };
13609
- };
13610
- };
13611
13526
  list_conversations: {
13612
13527
  parameters: {
13613
13528
  query?: never;
package/dist/index.d.ts CHANGED
@@ -885,15 +885,37 @@ interface paths {
885
885
  put?: never;
886
886
  /**
887
887
  * Copy Workspace Data
888
- * @description Copy documents from source workspace (current) to target workspace.
888
+ * @description Copy selected items from the source workspace (current) to a target workspace.
889
889
  *
890
890
  * Requires workspace-scoped JWT for the source workspace.
891
891
  * Target workspace key is provided in the request body (SecretBox-encrypted with session key).
892
892
  *
893
- * Copies:
894
- * - Document metadata (title, doc_date, shared status, etc.)
895
- * - MinIO encrypted files (downloaded to server memory, re-encrypted, uploaded)
896
- * - Qdrant vectors (with updated doc_ext_id and chunk_ext_id references)
893
+ * ``items`` is a flat, heterogeneous list of external IDs; the prefix selects
894
+ * what is copied, and **exactly** the listed items are copied — nothing rides
895
+ * along:
896
+ *
897
+ * - ``doc-`` document — row + MinIO files + Qdrant vectors, all re-encrypted
898
+ * with the target workspace key. Chunk external IDs are preserved.
899
+ * - ``tag-`` tag — merged into a same-named tag already in the target if there
900
+ * is one, otherwise created. A parent tag that is not in the target flattens
901
+ * the copy to a root tag.
902
+ * - ``dtj-`` doctag — requires BOTH its document (selected in the same request)
903
+ * and its tag (selected, or already present by name) in the target; RLS makes
904
+ * any other combination impossible. Fails with a reason otherwise.
905
+ * - ``fct-`` fact — content, date span, timezone and citations preserved; pins
906
+ * are not (a pin is the pinning account's own state).
907
+ * - ``con-`` chat — conversation + every message, with the parent/child tree
908
+ * and the encrypted ``tools`` blob rebuilt.
909
+ *
910
+ * Facts and chats need no vector copy: both live in pointer-only collections
911
+ * keyed by external ID and are indexed on write / by the lazy backfill.
912
+ *
913
+ * ``created_by`` is NOT preserved. Every content table's RLS ``WITH CHECK``
914
+ * forces it to the copying user, so copies are attributed to whoever ran the
915
+ * copy, never to the original author.
916
+ *
917
+ * Each item is copied in its own savepoint, so one failure does not abort the
918
+ * batch; per-item outcomes are in ``results``.
897
919
  */
898
920
  post: operations['copy_workspace_data'];
899
921
  delete?: never;
@@ -930,28 +952,6 @@ interface paths {
930
952
  patch: operations['update_workspace'];
931
953
  trace?: never;
932
954
  };
933
- '/v1/workspace/{workspace_ext_id}/chronology': {
934
- parameters: {
935
- query?: never;
936
- header?: never;
937
- path?: never;
938
- cookie?: never;
939
- };
940
- /**
941
- * Get Workspace Chronology
942
- * @description Return the last-generated chronology for a workspace.
943
- *
944
- * Returns all-null fields when no chronology has been generated yet.
945
- */
946
- get: operations['get_workspace_chronology'];
947
- put?: never;
948
- post?: never;
949
- delete?: never;
950
- options?: never;
951
- head?: never;
952
- patch?: never;
953
- trace?: never;
954
- };
955
955
  '/v1/document/list': {
956
956
  parameters: {
957
957
  query?: never;
@@ -1345,30 +1345,6 @@ interface paths {
1345
1345
  patch?: never;
1346
1346
  trace?: never;
1347
1347
  };
1348
- '/v1/document/chronology': {
1349
- parameters: {
1350
- query?: never;
1351
- header?: never;
1352
- path?: never;
1353
- cookie?: never;
1354
- };
1355
- get?: never;
1356
- put?: never;
1357
- /**
1358
- * Generate Workspace Chronology
1359
- * @description Generate a chronological timeline of events from the specified documents.
1360
- *
1361
- * Runs LLM analysis over the selected documents and persists the result in the
1362
- * workspace_chronology table (one row per workspace, upserted on each generation).
1363
- * Returns the generated events alongside metadata about when they were produced.
1364
- */
1365
- post: operations['generate_chronology'];
1366
- delete?: never;
1367
- options?: never;
1368
- head?: never;
1369
- patch?: never;
1370
- trace?: never;
1371
- };
1372
1348
  '/v1/conversation/list': {
1373
1349
  parameters: {
1374
1350
  query?: never;
@@ -3656,6 +3632,24 @@ interface components {
3656
3632
  * @default 10
3657
3633
  */
3658
3634
  AGENT_MAX_PARALLEL_TOOL_CALLS: number;
3635
+ /**
3636
+ * Agent Max Total Tool Calls
3637
+ * @description Run-wide cap on tool executions across the main agent AND all nested sub-agents (deep_research / run_skill / sub_agent) in a single user query. When reached, further tool calls are refused and the agent is forced to answer from what it has gathered; at 2x the run is hard-stopped. 0 = disabled.
3638
+ * @default 80
3639
+ */
3640
+ AGENT_MAX_TOTAL_TOOL_CALLS: number;
3641
+ /**
3642
+ * Agent Max Run Tokens
3643
+ * @description Run-wide cap on total tokens (input+output+reasoning, provider-reported) across every LLM call in a single user query — agent iterations, nested sub-agents, and helper calls (evaluator, reranker, goal judge). When reached the agent is forced to answer from what it has gathered; at 2x the run is hard-stopped. Best-effort metering — the exact AGENT_MAX_TOTAL_TOOL_CALLS meter backs it up. 0 = disabled.
3644
+ * @default 1500000
3645
+ */
3646
+ AGENT_MAX_RUN_TOKENS: number;
3647
+ /**
3648
+ * Agent Max Subagent Spawns
3649
+ * @description Run-wide cap on nested sub-agent spawns (deep_research / run_skill / sub_agent) in a single user query. Past the cap, spawning tools are refused while direct tools keep working until the tool-call cap. 0 = no spawns.
3650
+ * @default 4
3651
+ */
3652
+ AGENT_MAX_SUBAGENT_SPAWNS: number;
3659
3653
  /**
3660
3654
  * Agent History Char Threshold
3661
3655
  * @description Char threshold for conversation history injected into the agent context. Below: verbatim user/assistant pairs. Above: summarized by SummariseLLM.
@@ -3674,14 +3668,17 @@ interface components {
3674
3668
  * DOCUMENT INDEX:
3675
3669
  * The "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.
3676
3670
  *
3677
- * DOCUMENT STRATEGY:
3678
- * - For listing/cataloguing documents: use the document index already in your prompt — no tool calls needed.
3679
- * - For overview/summary requests: use get_table_of_contents first, then read key sections with read_document.
3680
- * - For specific questions: use search_inside_documents to find relevant sections, then read those sections with read_document.
3681
- * - For translation, deep analysis, or detailed summaries of a single document: use read_document with no ranges to load the complete text.
3682
- * - For extracting structured findings from passages: use read_document with digest=true or search_inside_documents with digest=true.
3683
- * - For 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.
3684
- * - Never search for meta-queries like "summary", "overview", or "all documents" — search for the actual subject matter.
3671
+ * READING TOOL RESULTS:
3672
+ * Every 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.
3673
+ *
3674
+ * DOCUMENT STRATEGY, in order:
3675
+ * 1. Listing or cataloguing documents: use the document index already in your prompt — no tool calls needed.
3676
+ * 2. 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.
3677
+ * 3. Specific questions across several documents: search_inside_documents to locate the passages, then read_document on the pages it points to.
3678
+ * 4. 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.
3679
+ * 5. 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.
3680
+ * 6. 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.
3681
+ * 7. Never search for meta-queries like "summary", "overview", or "all documents" — search for the actual subject matter.
3685
3682
  *
3686
3683
  * FORMATTING:
3687
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).
@@ -3692,14 +3689,14 @@ interface components {
3692
3689
  * - Bold text for critical conclusions or decision points
3693
3690
  *
3694
3691
  * TOOL CALLING:
3695
- * - Your job is to gather context by calling tools, then answer only once every reasonable tool call has been made. Do not give a final answer while there is still relevant context you could retrieve.
3692
+ * - 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.
3696
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).
3697
3694
  * - If you intend to search or read, issue the tool call immediately. Do not narrate your intent first.
3698
3695
  *
3699
3696
  * EFFICIENCY:
3700
3697
  * 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.
3701
3698
  * 2. Call multiple tools in parallel when a query has several aspects.
3702
- * 3. NEVER repeat a tool call with the same arguments.
3699
+ * 3. 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.
3703
3700
  * 4. Use targeted queries and narrow page ranges per retrieval call.
3704
3701
  * 5. Stop when you have sufficient evidence — do not over-research.
3705
3702
  */
@@ -3893,8 +3890,11 @@ interface components {
3893
3890
  * "AGENT_MAX_ITERATIONS": 20,
3894
3891
  * "AGENT_TURN_CREDIT_BUDGET": 50,
3895
3892
  * "AGENT_MAX_PARALLEL_TOOL_CALLS": 10,
3893
+ * "AGENT_MAX_TOTAL_TOOL_CALLS": 80,
3894
+ * "AGENT_MAX_RUN_TOKENS": 1500000,
3895
+ * "AGENT_MAX_SUBAGENT_SPAWNS": 4,
3896
3896
  * "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\nDOCUMENT STRATEGY:\n- For listing/cataloguing documents: use the document index already in your prompt — no tool calls needed.\n- For overview/summary requests: use get_table_of_contents first, then read key sections with read_document.\n- For specific questions: use search_inside_documents to find relevant sections, then read those sections with read_document.\n- For translation, deep analysis, or detailed summaries of a single document: use read_document with no ranges to load the complete text.\n- For extracting structured findings from passages: use read_document with digest=true or search_inside_documents with digest=true.\n- For 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.\n- 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 context by calling tools, then answer only once every reasonable tool call has been made. Do not give a final answer while there is still relevant context you could retrieve.\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.\n4. Use targeted queries and narrow page ranges per retrieval call.\n5. Stop when you have sufficient evidence — do not over-research."
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."
3898
3898
  * }
3899
3899
  */
3900
3900
  Agents: components['schemas']['AgentsConfig'];
@@ -4250,7 +4250,7 @@ interface components {
4250
4250
  type: 'arbi.error';
4251
4251
  /**
4252
4252
  * Code
4253
- * @description Error code, e.g. 'QUOTA_EXCEEDED'
4253
+ * @description Error code, e.g. 'QUOTA_EXCEEDED' (billing — opens upgrade modal) or 'RUN_BUDGET_EXCEEDED' (per-run safety cap — generic error display).
4254
4254
  */
4255
4255
  code: string;
4256
4256
  /**
@@ -4286,6 +4286,11 @@ interface components {
4286
4286
  * field) while ours reads it. The item itself stays byte-for-byte standard.
4287
4287
  */
4288
4288
  ArbiItemMeta: {
4289
+ /**
4290
+ * Step
4291
+ * @description Which lifecycle moment this item IS — stated, not inferred. A Responses item type (message / function_call / reasoning) is too coarse for the trace: three different reasoning items are the goal, the plan and a goal check, and the answer is a `message` item that is nonetheless a trace row. Clients previously sniffed `label` prefixes to tell them apart, which broke the moment a label was reworded or localised. Absent on plain tool calls (they carry `detail`) and on narration messages (which are body text, not a step).
4292
+ */
4293
+ step?: ('goal' | 'skill' | 'interjection' | 'planning' | 'tool_progress' | 'goal_progress' | 'answering' | 'evaluation') | null;
4289
4294
  /**
4290
4295
  * Label
4291
4296
  * @description Human display label. Backend-owned.
@@ -4645,11 +4650,6 @@ interface components {
4645
4650
  } & {
4646
4651
  [key: string]: unknown;
4647
4652
  };
4648
- /** ChronologyRequest */
4649
- ChronologyRequest: {
4650
- /** Doc Ext Ids */
4651
- doc_ext_ids: string[];
4652
- };
4653
4653
  /** Chunk */
4654
4654
  Chunk: {
4655
4655
  metadata: components['schemas']['ChunkMetadata'];
@@ -5349,7 +5349,15 @@ interface components {
5349
5349
  /** Title */
5350
5350
  title: string;
5351
5351
  };
5352
- /** CopyDocumentResult */
5352
+ /**
5353
+ * CopyDocumentResult
5354
+ * @description Outcome of copying ONE selected item.
5355
+ *
5356
+ * Named for documents because that is all ``/workspace/copy`` used to move;
5357
+ * the field names are kept so existing clients keep parsing the response.
5358
+ * ``source_doc_ext_id`` / ``new_doc_ext_id`` carry the source and new external
5359
+ * ID of whatever ``kind`` the item is.
5360
+ */
5353
5361
  CopyDocumentResult: {
5354
5362
  /** Source Doc Ext Id */
5355
5363
  source_doc_ext_id: string;
@@ -5359,7 +5367,17 @@ interface components {
5359
5367
  new_doc_ext_id?: string | null;
5360
5368
  /** Error */
5361
5369
  error?: string | null;
5370
+ /** @default document */
5371
+ kind: components['schemas']['CopyItemKind'];
5372
+ /** Warning */
5373
+ warning?: string | null;
5362
5374
  };
5375
+ /**
5376
+ * CopyItemKind
5377
+ * @description Which entity a copy result refers to — derived from the ext-id prefix.
5378
+ * @enum {string}
5379
+ */
5380
+ CopyItemKind: 'document' | 'tag' | 'doctag' | 'fact' | 'chat' | 'unknown';
5363
5381
  /** CopyRequest */
5364
5382
  CopyRequest: {
5365
5383
  /** Target Workspace Ext Id */
@@ -5371,7 +5389,7 @@ interface components {
5371
5389
  target_workspace_key: string;
5372
5390
  /**
5373
5391
  * Items
5374
- * @description List of document external IDs to copy (e.g., ['doc-a1b2c3d4', 'doc-e5f6g7h8'])
5392
+ * @description External IDs to copy. Heterogeneous: documents (doc-), tags (tag-), doctags (dtj-), facts (fct-) and chats (con-) may be mixed in one call — the server dispatches on the prefix and copies them in dependency order (tags → documents → doctags/facts → chats). Selection is exact: nothing is copied that was not listed.
5375
5393
  */
5376
5394
  items: string[];
5377
5395
  };
@@ -5384,6 +5402,18 @@ interface components {
5384
5402
  * @default 0
5385
5403
  */
5386
5404
  documents_copied: number;
5405
+ /**
5406
+ * Items Copied
5407
+ * @default 0
5408
+ */
5409
+ items_copied: number;
5410
+ /**
5411
+ * Copied By Kind
5412
+ * @default {}
5413
+ */
5414
+ copied_by_kind: {
5415
+ [key: string]: number;
5416
+ };
5387
5417
  /**
5388
5418
  * Results
5389
5419
  * @default []
@@ -5881,6 +5911,8 @@ interface components {
5881
5911
  /** Note */
5882
5912
  note?: string | null;
5883
5913
  citations?: components['schemas']['CitationSources'] | null;
5914
+ /** External Id */
5915
+ external_id: string;
5884
5916
  /** Doc Ext Id */
5885
5917
  doc_ext_id: string;
5886
5918
  /** Tag Ext Id */
@@ -6292,17 +6324,6 @@ interface components {
6292
6324
  /** Message */
6293
6325
  message: string;
6294
6326
  };
6295
- /**
6296
- * EvaluationDetail
6297
- * @description Detail for an evaluation learning entry.
6298
- */
6299
- EvaluationDetail: {
6300
- /**
6301
- * Statement
6302
- * @description Citation/finding statement
6303
- */
6304
- statement: string;
6305
- };
6306
6327
  /** EvaluatorLLMConfig */
6307
6328
  EvaluatorLLMConfig: {
6308
6329
  /**
@@ -9491,8 +9512,6 @@ interface components {
9491
9512
  detail_run_code?: components['schemas']['RunCodeDetail'] | null;
9492
9513
  detail_create_artifact?: components['schemas']['CreateArtifactDetail'] | null;
9493
9514
  detail_ask_user?: components['schemas']['AskUserDetail'] | null;
9494
- detail_evaluation?: components['schemas']['EvaluationDetail'] | null;
9495
- detail_tool_progress?: components['schemas']['ToolProgressDetail'] | null;
9496
9515
  detail_goal_progress?: components['schemas']['GoalProgressDetail'] | null;
9497
9516
  };
9498
9517
  /**
@@ -10493,22 +10512,6 @@ interface components {
10493
10512
  /** @description Aggregate usage across all LLM calls in the request */
10494
10513
  all_llm_calls?: components['schemas']['AllLlmCallsAggregate'] | null;
10495
10514
  };
10496
- /**
10497
- * ToolProgressDetail
10498
- * @description Detail for a tool progress update.
10499
- */
10500
- ToolProgressDetail: {
10501
- /**
10502
- * Tool
10503
- * @description Tool name
10504
- */
10505
- tool: string;
10506
- /**
10507
- * Message
10508
- * @description Progress message
10509
- */
10510
- message: string;
10511
- };
10512
10515
  /**
10513
10516
  * TraceTool
10514
10517
  * @description Execution trace tool that captures the full execution history of a request.
@@ -11020,11 +11023,6 @@ interface components {
11020
11023
  * @default false
11021
11024
  */
11022
11025
  show_skills: boolean;
11023
- /**
11024
- * Show Chronology
11025
- * @default false
11026
- */
11027
- show_chronology: boolean;
11028
11026
  /**
11029
11027
  * Show Pa Mode
11030
11028
  * @default false
@@ -11148,8 +11146,6 @@ interface components {
11148
11146
  show_templates?: boolean | null;
11149
11147
  /** Show Skills */
11150
11148
  show_skills?: boolean | null;
11151
- /** Show Chronology */
11152
- show_chronology?: boolean | null;
11153
11149
  /** Show Pa Mode */
11154
11150
  show_pa_mode?: boolean | null;
11155
11151
  /** Show Conversation Search */
@@ -11358,23 +11354,6 @@ interface components {
11358
11354
  auth?: components['schemas']['AuthMessage'] | null;
11359
11355
  send_message?: components['schemas']['SendMessageRequest'] | null;
11360
11356
  };
11361
- /**
11362
- * WorkspaceChronologyOut
11363
- * @description API response for both POST /v1/document/chronology and GET /v1/workspace/chronology.
11364
- *
11365
- * For POST: all fields are always populated (generation just happened).
11366
- * For GET: all fields are null when no chronology has been generated yet.
11367
- */
11368
- WorkspaceChronologyOut: {
11369
- /** Events */
11370
- events?: {
11371
- [key: string]: unknown;
11372
- }[] | null;
11373
- /** Generated At */
11374
- generated_at?: string | null;
11375
- /** Doc Count */
11376
- doc_count?: number | null;
11377
- };
11378
11357
  /** WorkspaceCreateRequest */
11379
11358
  WorkspaceCreateRequest: {
11380
11359
  /** Name */
@@ -12935,37 +12914,6 @@ interface operations {
12935
12914
  };
12936
12915
  };
12937
12916
  };
12938
- get_workspace_chronology: {
12939
- parameters: {
12940
- query?: never;
12941
- header?: never;
12942
- path: {
12943
- workspace_ext_id: string;
12944
- };
12945
- cookie?: never;
12946
- };
12947
- requestBody?: never;
12948
- responses: {
12949
- /** @description Successful Response */
12950
- 200: {
12951
- headers: {
12952
- [name: string]: unknown;
12953
- };
12954
- content: {
12955
- 'application/json': components['schemas']['WorkspaceChronologyOut'];
12956
- };
12957
- };
12958
- /** @description Validation Error */
12959
- 422: {
12960
- headers: {
12961
- [name: string]: unknown;
12962
- };
12963
- content: {
12964
- 'application/json': components['schemas']['HTTPValidationError'];
12965
- };
12966
- };
12967
- };
12968
- };
12969
12917
  list_documents: {
12970
12918
  parameters: {
12971
12919
  query?: {
@@ -13575,39 +13523,6 @@ interface operations {
13575
13523
  };
13576
13524
  };
13577
13525
  };
13578
- generate_chronology: {
13579
- parameters: {
13580
- query?: never;
13581
- header?: never;
13582
- path?: never;
13583
- cookie?: never;
13584
- };
13585
- requestBody: {
13586
- content: {
13587
- 'application/json': components['schemas']['ChronologyRequest'];
13588
- };
13589
- };
13590
- responses: {
13591
- /** @description Successful Response */
13592
- 200: {
13593
- headers: {
13594
- [name: string]: unknown;
13595
- };
13596
- content: {
13597
- 'application/json': components['schemas']['WorkspaceChronologyOut'];
13598
- };
13599
- };
13600
- /** @description Validation Error */
13601
- 422: {
13602
- headers: {
13603
- [name: string]: unknown;
13604
- };
13605
- content: {
13606
- 'application/json': components['schemas']['HTTPValidationError'];
13607
- };
13608
- };
13609
- };
13610
- };
13611
13526
  list_conversations: {
13612
13527
  parameters: {
13613
13528
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbidocs/client",
3
- "version": "0.3.146",
3
+ "version": "0.3.147",
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",