@arbidocs/client 0.3.19 → 0.3.21

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.ts CHANGED
@@ -173,6 +173,87 @@ interface paths {
173
173
  patch?: never;
174
174
  trace?: never;
175
175
  };
176
+ '/v1/user/agents': {
177
+ parameters: {
178
+ query?: never;
179
+ header?: never;
180
+ path?: never;
181
+ cookie?: never;
182
+ };
183
+ /**
184
+ * List User Agents
185
+ * @description List current user's persistent agents.
186
+ */
187
+ get: operations['list_agents'];
188
+ put?: never;
189
+ post?: never;
190
+ /**
191
+ * Delete User Agents
192
+ * @description Delete agents by external ID.
193
+ *
194
+ * A BEFORE DELETE trigger on users reassigns created_by to parent_user_id,
195
+ * nulls updated_by, and deletes contacts. CASCADE handles WorkspaceUsers.
196
+ */
197
+ delete: operations['delete_agents'];
198
+ options?: never;
199
+ head?: never;
200
+ patch?: never;
201
+ trace?: never;
202
+ };
203
+ '/v1/user/authorize': {
204
+ parameters: {
205
+ query?: never;
206
+ header?: never;
207
+ path?: never;
208
+ cookie?: never;
209
+ };
210
+ get?: never;
211
+ put?: never;
212
+ /**
213
+ * Authorize Session Endpoint
214
+ * @description Create a delegated session with pre-populated workspace keys.
215
+ *
216
+ * Frontend sends workspace keys SealedBox-encrypted with the user's session public key.
217
+ * Server decrypts them, re-encrypts with a new session keypair, and creates a pending
218
+ * session keyed by a 3-word claim code. The recipient redeems the code via POST /user/token.
219
+ *
220
+ * If persist_identity is True, the claim also creates a persistent Agent identity
221
+ * with WorkspaceUsers rows so the agent can re-login later.
222
+ */
223
+ post: operations['authorize_session'];
224
+ delete?: never;
225
+ options?: never;
226
+ head?: never;
227
+ patch?: never;
228
+ trace?: never;
229
+ };
230
+ '/v1/user/token': {
231
+ parameters: {
232
+ query?: never;
233
+ header?: never;
234
+ path?: never;
235
+ cookie?: never;
236
+ };
237
+ get?: never;
238
+ put?: never;
239
+ /**
240
+ * Claim Agent Session Endpoint
241
+ * @description Claim an agent session using a 3-word code.
242
+ *
243
+ * Returns LoginResponse so the frontend can use the same auth code path as login.
244
+ * Workspaces are filtered to only those included in the delegation.
245
+ *
246
+ * If persist_identity was set on delegation:
247
+ * - signing_key is required in the request
248
+ * - Creates an Agent row and WorkspaceUsers rows (role=guest)
249
+ */
250
+ post: operations['claim_agent_session'];
251
+ delete?: never;
252
+ options?: never;
253
+ head?: never;
254
+ patch?: never;
255
+ trace?: never;
256
+ };
176
257
  '/v1/user/logout': {
177
258
  parameters: {
178
259
  query?: never;
@@ -193,6 +274,26 @@ interface paths {
193
274
  patch?: never;
194
275
  trace?: never;
195
276
  };
277
+ '/v1/user/sessions': {
278
+ parameters: {
279
+ query?: never;
280
+ header?: never;
281
+ path?: never;
282
+ cookie?: never;
283
+ };
284
+ /**
285
+ * List User Sessions
286
+ * @description List active sessions. Agents/delegated see only their own session; users see all.
287
+ */
288
+ get: operations['list_sessions'];
289
+ put?: never;
290
+ post?: never;
291
+ delete?: never;
292
+ options?: never;
293
+ head?: never;
294
+ patch?: never;
295
+ trace?: never;
296
+ };
196
297
  '/v1/user/change_password': {
197
298
  parameters: {
198
299
  query?: never;
@@ -257,8 +358,7 @@ interface paths {
257
358
  * Get Current User Workspaces
258
359
  * @description Retrieve the list of workspaces associated with the current authenticated user.
259
360
  * Includes wrapped_key, stats (conversation/document counts with shared/private breakdown),
260
- * and users for each workspace. All data is fetched efficiently using batch queries to avoid N+1 problems.
261
- * Leverages RLS to enforce access control.
361
+ * and users for each workspace. Leverages RLS to enforce access control.
262
362
  */
263
363
  get: operations['get_user_workspaces'];
264
364
  put?: never;
@@ -358,8 +458,9 @@ interface paths {
358
458
  * @description Create a new workspace with encryption and access controls.
359
459
  * Sets up vector storage and associates the creator as the initial workspace user.
360
460
  *
361
- * Server generates the workspace symmetric key and wraps it with the user's public key.
362
- * The wrapped key is returned in the response for client-side storage.
461
+ * Client generates the workspace symmetric key and sends it encrypted with the
462
+ * session key (SecretBox). Server decrypts and wraps it with the user's
463
+ * public key for storage. The wrapped key is returned in the response.
363
464
  *
364
465
  * Public workspaces are visible to all users and grant non-members limited access:
365
466
  * - Non-members can view shared documents and tags
@@ -387,13 +488,10 @@ interface paths {
387
488
  put?: never;
388
489
  /**
389
490
  * Open Workspace
390
- * @description Open a workspace: decrypt workspace key, issue a workspace-scoped JWT, and return workspace data.
391
- *
392
- * The workspace key is provided in the request body (same SealedBox-encrypted format as the
393
- * workspace-key header). A new JWT is issued with embedded workspace claims so subsequent API
394
- * calls only need the Authorization header — no workspace-key header required.
491
+ * @description Open a workspace: store encrypted workspace key in session, set active, return workspace data.
395
492
  *
396
- * Returns the workspace-scoped JWT along with conversations, documents, and tags.
493
+ * Users provide ``workspace_key`` (SealedBox-encrypted with session public key).
494
+ * Agents omit it — their keys are pre-populated via ``/agent-session``.
397
495
  */
398
496
  post: operations['open_workspace'];
399
497
  delete?: never;
@@ -456,7 +554,7 @@ interface paths {
456
554
  * @description Copy documents from source workspace (current) to target workspace.
457
555
  *
458
556
  * Requires workspace-scoped JWT for the source workspace.
459
- * Target workspace key is provided in the request body (SealedBox-encrypted).
557
+ * Target workspace key is provided in the request body (SecretBox-encrypted with session key).
460
558
  *
461
559
  * Copies:
462
560
  * - Document metadata (title, doc_date, shared status, etc.)
@@ -1416,6 +1514,19 @@ interface components {
1416
1514
  /** @default collaborator */
1417
1515
  role: components['schemas']['WorkspaceRole'];
1418
1516
  };
1517
+ /**
1518
+ * AgentSessionClaimRequest
1519
+ * @description Claim an agent session using a 3-word code.
1520
+ *
1521
+ * If the pending session has persist_identity=True, signing_key is required
1522
+ * to create the Agent identity. Otherwise it is accepted but ignored.
1523
+ */
1524
+ AgentSessionClaimRequest: {
1525
+ /** Claim Code */
1526
+ claim_code: string;
1527
+ /** Signing Key */
1528
+ signing_key?: string | null;
1529
+ };
1419
1530
  /**
1420
1531
  * AgentStepEvent
1421
1532
  * @description A single agent step with a sequential index.
@@ -1430,13 +1541,13 @@ interface components {
1430
1541
  * {"type": "arbi.agent_step", "index": 2,
1431
1542
  * "focus": "Searching for force majeure clauses across the selected contracts.",
1432
1543
  * "detail": [
1433
- * {"tool": "search_documents", "query": "force majeure", "search_mode": "hybrid"},
1434
- * {"tool": "get_table_of_contents", "doc_count": 2, "doc_ext_ids": ["doc-abc12345", "doc-def67890"]}
1544
+ * {"tool": "search_inside_documents", "query": "force majeure", "search_mode": "hybrid"},
1545
+ * {"tool": "get_table_of_contents", "doc_ext_id": "doc-abc12345"}
1435
1546
  * ]}
1436
1547
  * {"type": "arbi.agent_step", "index": 3,
1437
1548
  * "focus": "Comparing the provisions found in Contract A with Contract B.",
1438
1549
  * "detail": [
1439
- * {"tool": "get_document_passages", "doc_ext_id": "doc-abc12345", "from_ref": "5", "to_ref": "8"}
1550
+ * {"tool": "read_document", "doc_ext_id": "doc-abc12345", "range_count": 2, "digest": false}
1440
1551
  * ]}
1441
1552
  * {"type": "arbi.agent_step", "index": 3, "detail": [
1442
1553
  * {"tool": "web_search", "query": "latest arbitration developments 2026"}
@@ -1481,12 +1592,12 @@ interface components {
1481
1592
  step?: string | null;
1482
1593
  /**
1483
1594
  * Label
1484
- * @description Display label for the step (e.g. 'Searching documents'). Backend-driven.
1595
+ * @description Display label for the step. Backend-driven, no frontend mapping needed.
1485
1596
  */
1486
1597
  label?: string | null;
1487
1598
  /**
1488
1599
  * Icon
1489
- * @description Lucide icon name for the step (e.g. 'search'). Backend-driven.
1600
+ * @description Lucide icon name for the step (e.g. 'search'). Backend-driven, no frontend mapping needed.
1490
1601
  */
1491
1602
  icon?: string | null;
1492
1603
  /**
@@ -1525,6 +1636,16 @@ interface components {
1525
1636
  * @description Tool execution outcome (e.g. '15 chunks retrieved'). Sent as a follow-up event with the same index after tool execution.
1526
1637
  */
1527
1638
  outcome?: string | null;
1639
+ /**
1640
+ * Model Recommendation
1641
+ * @description Model tier recommended by FilterPlan in auto mode: 'fast', 'wise', or 'premium'. Present only on the goal step when auto mode is active.
1642
+ */
1643
+ model_recommendation?: string | null;
1644
+ /**
1645
+ * Selected Model
1646
+ * @description Actual model name selected after resolving the recommendation. Present only on the goal step when auto mode is active.
1647
+ */
1648
+ selected_model?: string | null;
1528
1649
  };
1529
1650
  /**
1530
1651
  * AgentsConfig
@@ -1577,18 +1698,6 @@ interface components {
1577
1698
  * @default false
1578
1699
  */
1579
1700
  VISION_ENABLED: boolean;
1580
- /**
1581
- * Doc Index Compact Threshold
1582
- * @description When the workspace has more documents than this, omit the Subject column from the document index to save tokens.
1583
- * @default 20
1584
- */
1585
- DOC_INDEX_COMPACT_THRESHOLD: number;
1586
- /**
1587
- * Doc Index Skip Threshold
1588
- * @description When the workspace has more documents than this, omit the document index entirely. The agent discovers documents via search_documents instead.
1589
- * @default 200
1590
- */
1591
- DOC_INDEX_SKIP_THRESHOLD: number;
1592
1701
  /**
1593
1702
  * Personal Agent
1594
1703
  * @description Enable the personal_agent tool for delegating tasks to an external agent via OpenClaw.
@@ -1628,7 +1737,7 @@ interface components {
1628
1737
  /**
1629
1738
  * Agent Model Name
1630
1739
  * @description The name of the model to be used for the agent decision-making.
1631
- * @default Fast
1740
+ * @default auto
1632
1741
  */
1633
1742
  AGENT_MODEL_NAME: string;
1634
1743
  /**
@@ -1650,6 +1759,12 @@ interface components {
1650
1759
  * @default 10000
1651
1760
  */
1652
1761
  AGENT_MAX_TOKENS: number;
1762
+ /**
1763
+ * Enable Thinking
1764
+ * @description Enable reasoning/thinking mode for the agentic loop LLM.
1765
+ * @default false
1766
+ */
1767
+ ENABLE_THINKING: boolean;
1653
1768
  /**
1654
1769
  * Agent Max Iterations
1655
1770
  * @description Maximum number of tool call iterations before forcing an answer.
@@ -1657,11 +1772,11 @@ interface components {
1657
1772
  */
1658
1773
  AGENT_MAX_ITERATIONS: number;
1659
1774
  /**
1660
- * Max Passage Pages
1661
- * @description Maximum number of pages allowed per get_document_passages call. Calls requesting a wider range are rejected, forcing the agent to use get_table_of_contents and target specific sections.
1775
+ * Agent Max Parallel Tool Calls
1776
+ * @description Maximum number of tool calls the agent can make in a single iteration. Extra calls beyond this limit are silently dropped.
1662
1777
  * @default 10
1663
1778
  */
1664
- MAX_PASSAGE_PAGES: number;
1779
+ AGENT_MAX_PARALLEL_TOOL_CALLS: number;
1665
1780
  /**
1666
1781
  * Agent History Char Threshold
1667
1782
  * @description Char threshold for conversation history injected into the agent context. Below: verbatim user/assistant pairs. Above: summarized by SummariseLLM.
@@ -1677,10 +1792,16 @@ interface components {
1677
1792
  *
1678
1793
  * 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.
1679
1794
  *
1795
+ * DOCUMENT INDEX:
1796
+ * The "Workspace Documents" table in your system prompt already lists every document with its Id, Title, Date, Pages, and Subject. 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.
1797
+ *
1680
1798
  * DOCUMENT STRATEGY:
1681
- * - For overview/summary requests: use get_table_of_contents first, then read key sections with get_document_passages.
1682
- * - For specific questions: use search_documents to find relevant sections, then read those sections.
1683
- * - Never search for meta-queries like "summary" or "overview" search for the actual subject matter.
1799
+ * - For listing/cataloguing documents: use the document index already in your prompt — no tool calls needed.
1800
+ * - For overview/summary requests: use get_table_of_contents first, then read key sections with read_document.
1801
+ * - For specific questions: use search_inside_documents to find relevant sections, then read those sections with read_document.
1802
+ * - For translation, deep analysis, or detailed summaries of a single document: use read_document with no ranges to load the complete text.
1803
+ * - For extracting structured findings from passages: use read_document with digest=true or search_inside_documents with digest=true.
1804
+ * - Never search for meta-queries like "summary", "overview", or "all documents" — search for the actual subject matter.
1684
1805
  *
1685
1806
  * FORMATTING:
1686
1807
  * - 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).
@@ -1721,28 +1842,28 @@ interface components {
1721
1842
  * "SUGGESTED_QUERIES": false,
1722
1843
  * "ARTIFACTS_ENABLED": false,
1723
1844
  * "VISION_ENABLED": false,
1724
- * "DOC_INDEX_COMPACT_THRESHOLD": 20,
1725
- * "DOC_INDEX_SKIP_THRESHOLD": 200,
1726
1845
  * "PERSONAL_AGENT": false,
1727
1846
  * "MEMORY_ENABLED": false,
1728
1847
  * "SKILLS_ENABLED": false,
1729
1848
  * "SKILL_CREATION": false,
1730
1849
  * "REVIEW_ENABLED": false,
1731
1850
  * "PERSONA": "You are ARBI, an AI assistant created by ARBI CITY. Be proactive, helpful and professional.",
1732
- * "AGENT_MODEL_NAME": "Fast",
1851
+ * "AGENT_MODEL_NAME": "auto",
1733
1852
  * "AGENT_API_TYPE": "remote",
1734
1853
  * "LLM_AGENT_TEMPERATURE": 1,
1735
1854
  * "AGENT_MAX_TOKENS": 10000,
1855
+ * "ENABLE_THINKING": false,
1736
1856
  * "AGENT_MAX_ITERATIONS": 20,
1737
- * "MAX_PASSAGE_PAGES": 10,
1857
+ * "AGENT_MAX_PARALLEL_TOOL_CALLS": 10,
1738
1858
  * "AGENT_HISTORY_CHAR_THRESHOLD": 8000,
1739
- * "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.\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 STRATEGY:\n- For overview/summary requests: use get_table_of_contents first, then read key sections with get_document_passages.\n- For specific questions: use search_documents to find relevant sections, then read those sections.\n- Never search for meta-queries like \"summary\" or \"overview\" — 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\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."
1859
+ * "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.\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 already lists every document with its Id, Title, Date, Pages, and Subject. 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- 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\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."
1740
1860
  * }
1741
1861
  */
1742
1862
  Agents: components['schemas']['AgentsConfig'];
1743
1863
  /**
1744
1864
  * @default {
1745
1865
  * "API_TYPE": "remote",
1866
+ * "ENABLE_THINKING": false,
1746
1867
  * "MODEL_NAME": "Fast",
1747
1868
  * "SYSTEM_INSTRUCTION": "You are ARBI, an AI assistant created by ARBI CITY. Be proactive, helpful and professional.Be concise. Use markdown where it helps readability. Cross-check information across sources before answering. Never fabricate facts. Not all assertions in the sources are factual — some are arguments by a party. Attribute claims to their source, especially where parties disagree.",
1748
1869
  * "MAX_CHAR_SIZE_TO_ANSWER": 200000,
@@ -1754,6 +1875,7 @@ interface components {
1754
1875
  /**
1755
1876
  * @default {
1756
1877
  * "API_TYPE": "remote",
1878
+ * "ENABLE_THINKING": false,
1757
1879
  * "MODEL_NAME": "Wise",
1758
1880
  * "SYSTEM_INSTRUCTION": "You are reviewing a draft answer prepared by a research agent. The draft was written based on summaries, but you now have access to the full source material.\n\nYour task:\n1. Review the draft answer against the source material provided\n2. Verify claims are supported by the sources\n3. Correct any inaccuracies or unsupported statements\n4. Add any important details from the sources that were missed\n5. Maintain formal, objective tone appropriate for professional contexts\n\nIf information is not found in the sources but the draft answer is based on web search results or general knowledge, preserve it and ensure it is clearly labelled as such. Only flag missing source support for claims that purport to come from the documents.\nDo not add inline citation markers - the system handles citations automatically.",
1759
1881
  * "TEMPERATURE": 0.1,
@@ -1765,6 +1887,7 @@ interface components {
1765
1887
  /**
1766
1888
  * @default {
1767
1889
  * "API_TYPE": "remote",
1890
+ * "ENABLE_THINKING": false,
1768
1891
  * "MODEL_NAME": "Fast",
1769
1892
  * "SYSTEM_INSTRUCTION": "You are a chunk evaluator. Analyze retrieved chunks to determine which are relevant to the user's query and extract key learnings from the RELEVANT chunks only. You must return your response as valid JSON matching the provided schema.",
1770
1893
  * "TEMPERATURE": 0.1,
@@ -1776,6 +1899,7 @@ interface components {
1776
1899
  /**
1777
1900
  * @default {
1778
1901
  * "API_TYPE": "remote",
1902
+ * "ENABLE_THINKING": false,
1779
1903
  * "MODEL_NAME": "Fast",
1780
1904
  * "SYSTEM_INSTRUCTION": "You are a title generator that creates concise, descriptive titles.",
1781
1905
  * "MAX_CHAR_SIZE_TO_ANSWER": 50,
@@ -1787,6 +1911,7 @@ interface components {
1787
1911
  /**
1788
1912
  * @default {
1789
1913
  * "API_TYPE": "remote",
1914
+ * "ENABLE_THINKING": false,
1790
1915
  * "MODEL_NAME": "Wise",
1791
1916
  * "SYSTEM_INSTRUCTION": "You are a conversation summariser. Condense the conversation history into a concise summary that preserves:\n- Key decisions and conclusions reached\n- Specific names, dates, numbers, and document references\n- Open questions and unresolved items\n- The user's goals and constraints\n\nWrite in past tense, third person. Be specific, not vague. Do not omit important details in favour of brevity.",
1792
1917
  * "TEMPERATURE": 0.1,
@@ -1800,6 +1925,7 @@ interface components {
1800
1925
  /**
1801
1926
  * @default {
1802
1927
  * "API_TYPE": "remote",
1928
+ * "ENABLE_THINKING": false,
1803
1929
  * "MODEL_NAME": "Fast",
1804
1930
  * "SYSTEM_INSTRUCTION": "You are a document analysis assistant. Answer questions based strictly on document content.\n\nGuidelines:\n- Only use information explicitly stated in the document\n- Do not infer or assume information not present\n- If information is not found, respond with \"Information not found in document.\"\n- Follow format instructions exactly for each answer\n- Be concise and precise",
1805
1931
  * "MAX_CHAR_CONTEXT_TO_ANSWER": 100000,
@@ -1858,6 +1984,7 @@ interface components {
1858
1984
  /**
1859
1985
  * @default {
1860
1986
  * "API_TYPE": "remote",
1987
+ * "ENABLE_THINKING": false,
1861
1988
  * "MODEL_NAME": "Wise",
1862
1989
  * "SYSTEM_INSTRUCTION": "You are a knowledge synthesizer. You receive the full agent scratchpad from a completed conversation and decide what, if anything, is worth saving.\n\n## Work Product Types\n- **\"memory\"**: Facts, findings, reference data — for *looking up* information.\n- **\"skill\"**: Procedures, workflows, step-by-step instructions — for *doing* something.\n\nWhen ambiguous, default to memory.\n\n## Rules\n- Return an empty work_products array if the conversation is trivial or produced nothing substantive.\n- Each work product must cover ONE coherent topic. Never combine disparate subjects into a single document — create separate documents for each distinct topic.\n- Ground everything in the provided context. Do not invent information.\n- Be concise. These are reference documents, not essays.\n\n## Output Format\nJSON with a `work_products` array. Each item has `wp_type`, `title`, and `content` (markdown).\n\nMemory content: `# Title`, date, source, key findings as bullets, source documents.\nSkill content: `# Title`, prerequisites, numbered steps, when to apply.",
1863
1990
  * "TEMPERATURE": 0.3,
@@ -1870,8 +1997,9 @@ interface components {
1870
1997
  /**
1871
1998
  * @default {
1872
1999
  * "API_TYPE": "remote",
2000
+ * "ENABLE_THINKING": true,
1873
2001
  * "MODEL_NAME": "Wise",
1874
- * "SYSTEM_INSTRUCTION": "You are a research planning assistant. Your job is to analyze a user query and produce a concise, numbered research plan.\n\nYou have access to a workspace of documents. The available tools for executing the plan are:\n- search_documents: Search workspace documents for relevant passages (semantic, keyword, or hybrid)\n- get_document_passages: Read a specific page range from a document\n- get_table_of_contents: Get document headings with page references\n\nConsider:\n- What information is needed to answer the query\n- Which documents are likely relevant based on the document index\n- What search queries and document passages to examine\n- What order of operations will be most efficient\n- Whether parallel searches can be used for different aspects\n\nRespond with ONLY the plan (numbered steps). Do not execute any steps.",
2002
+ * "SYSTEM_INSTRUCTION": "You are a research planning assistant. Your job is to analyze a user query and produce a concise, numbered research plan.\n\nYou have access to a workspace of documents. The available tools for executing the plan are:\n- search_inside_documents: Search workspace documents for relevant passages (semantic, keyword, or hybrid). Use digest=true to extract learnings.\n- read_document: Read page ranges or entire documents. Use digest=true to extract learnings with citations.\n- get_table_of_contents: Get document headings with page references\n\nConsider:\n- What information is needed to answer the query\n- Which documents are likely relevant based on the document index\n- What search queries and document passages to examine\n- What order of operations will be most efficient\n- Whether parallel searches can be used for different aspects\n\nRespond with ONLY the plan (numbered steps). Do not execute any steps.",
1875
2003
  * "TEMPERATURE": 0.3,
1876
2004
  * "MAX_TOKENS": 4000,
1877
2005
  * "MAX_CHAR_SIZE_TO_ANSWER": 200000,
@@ -1882,6 +2010,18 @@ interface components {
1882
2010
  /**
1883
2011
  * @default {
1884
2012
  * "API_TYPE": "remote",
2013
+ * "ENABLE_THINKING": false,
2014
+ * "MODEL_NAME": "Fast",
2015
+ * "SYSTEM_INSTRUCTION": "You are a context selector. Given a user's query, conversation history, and a table of available documents, determine the user's goal and select relevant context.\n\n## Instructions\n\n1. **goal**: 1-2 concise sentences describing the user's intent AND your filtering rationale. Explain what documents are needed and why. Examples:\n - \"The user is greeting the assistant. No documents are needed.\"\n - \"The user wants to find force majeure clauses. Only the three contracts are relevant, so I will keep only those.\"\n - \"The user wants a full timeline of the case. Most documents are relevant, so I will drop only the unrelated procedural orders.\"\n\n2. **doc_filter_mode** and **doc_ids**: Select which documents the agent needs.\n - `\"keep\"` mode: `doc_ids` lists the ONLY docs to keep. Everything else is dropped.\n - `\"drop\"` mode: `doc_ids` lists the ONLY docs to drop. Everything else is kept.\n - Pick whichever mode produces the **shorter `doc_ids` list**.\n - Doc IDs are in the **Id** column of the Available Documents table (e.g. `\"doc-abc12345\"`). Copy them **exactly** from the table — do not invent, guess, or modify IDs.\n\n | Scenario | doc_filter_mode | doc_ids |\n |----------|----------------|---------|\n | Need ALL docs | `\"drop\"` | `[]` |\n | Need NO docs | `\"keep\"` | `[]` |\n | Need 3 of 100 docs | `\"keep\"` | `[\"id1\",\"id2\",\"id3\"]` |\n | Drop 3 of 100 docs | `\"drop\"` | `[\"id1\",\"id2\",\"id3\"]` |\n\n3. **chat_range_start** and **chat_range_end**: 0-based inclusive range of earlier history messages that provide relevant context. The last 3 messages are always included automatically. Set both to -1 if no earlier history is needed.\n\n## Rules\n\n- **Never repeat a doc ID.** Each ID must appear at most once.\n- Before writing `doc_ids`, count how many you would keep vs drop, then pick the shorter list.\n- Greetings or meta-questions about the assistant (e.g. \"hello\", \"who are you?\", \"what can you do?\"): the agent does NOT need any documents → `\"keep\"` with `[]`.\n- Ambiguous references like \"the document\" or \"this contract\" without specifying which: keep all → `\"drop\"` with `[]`.\n- For follow-up questions, include history messages that establish the topic.\n- Always return valid JSON matching the schema.",
2016
+ * "TEMPERATURE": 0,
2017
+ * "MAX_TOKENS": 3000
2018
+ * }
2019
+ */
2020
+ FilterPlanLLM: components['schemas']['FilterPlanLLMConfig'];
2021
+ /**
2022
+ * @default {
2023
+ * "API_TYPE": "remote",
2024
+ * "ENABLE_THINKING": false,
1885
2025
  * "MODEL_NAME": "Fast",
1886
2026
  * "TEMPERATURE": 0.1,
1887
2027
  * "MAX_TOKENS": 4000,
@@ -1893,6 +2033,7 @@ interface components {
1893
2033
  /**
1894
2034
  * @default {
1895
2035
  * "API_TYPE": "remote",
2036
+ * "ENABLE_THINKING": true,
1896
2037
  * "MODEL_NAME": "Premium",
1897
2038
  * "SYSTEM_INSTRUCTION": "You are a code execution agent. You write and run code to accomplish tasks.\n\nYou have access to an execute_code tool that runs code in a sandboxed Docker container.\n\nThe sandbox has:\n- Python 3.12 with numpy, pandas, matplotlib, requests, beautifulsoup4,\n httpx, pillow, sympy, pyyaml (plus uv for installing more)\n- Node.js 22 with TypeScript (ts-node) and npm\n- Bash with git, curl, wget, jq, sqlite3, build-essential\n- Network access (can pip/npm install additional packages)\n\nInstructions:\n1. Write clean, correct code to accomplish the user's task\n2. Always call execute_code to run your code — never guess the output\n3. If execution errors, analyze the traceback, fix the code, and retry\n4. Once you have the correct output, respond with ONLY the final result\n\nKeep code simple and direct. Prefer Python unless the task specifically requires another language.",
1898
2039
  * "TEMPERATURE": 0.2,
@@ -1905,20 +2046,21 @@ interface components {
1905
2046
  * @default {
1906
2047
  * "SIM_THREASHOLD": 0.5,
1907
2048
  * "MIN_CHAR_SIZE_TO_ANSWER": 30,
1908
- * "MAX_NUMB_CITATIONS": 5
2049
+ * "MAX_NUMB_CITATIONS": 5,
2050
+ * "CITATION_INSTRUCTION": "Judge whether the passage contains evidence that directly supports or sources the claim made in the query. Only answer yes if the passage provides the basis for the statement"
1909
2051
  * }
1910
2052
  */
1911
2053
  ModelCitation: components['schemas']['ModelCitationConfig'];
1912
2054
  /**
1913
2055
  * @default {
1914
- * "MIN_RETRIEVAL_SIM_SCORE": 0.3,
2056
+ * "MIN_RETRIEVAL_SIM_SCORE": 0.1,
1915
2057
  * "MAX_DISTINCT_DOCUMENTS": 200,
1916
2058
  * "MAX_TOTAL_CHUNKS_TO_RETRIEVE": 400,
1917
2059
  * "GROUP_SIZE": 10000,
1918
2060
  * "SEARCH_MODE": "semantic",
2061
+ * "HYBRID_PREFETCH_LIMIT": 500,
1919
2062
  * "HYBRID_DENSE_WEIGHT": 0.7,
1920
- * "HYBRID_SPARSE_WEIGHT": 0.3,
1921
- * "HYBRID_RERANKER_WEIGHT": 0.5
2063
+ * "HYBRID_SPARSE_WEIGHT": 0.3
1922
2064
  * }
1923
2065
  */
1924
2066
  Retriever: components['schemas']['RetrieverConfig'];
@@ -1928,7 +2070,8 @@ interface components {
1928
2070
  * "MAX_NUMB_OF_CHUNKS": 30,
1929
2071
  * "MAX_CONCURRENT_REQUESTS": 64,
1930
2072
  * "MODEL_NAME": "Qwen/Qwen3-Reranker-0.6B",
1931
- * "API_TYPE": "remote"
2073
+ * "API_TYPE": "remote",
2074
+ * "RETRIEVAL_INSTRUCTION": "Judge whether the passage contains the specific facts, figures, names, or references mentioned in the query. Only answer yes if the passage directly contains these details"
1932
2075
  * }
1933
2076
  */
1934
2077
  Reranker: components['schemas']['RerankerConfig'];
@@ -2122,6 +2265,47 @@ interface components {
2122
2265
  /** Reason */
2123
2266
  reason?: string | null;
2124
2267
  };
2268
+ /**
2269
+ * AuthorizeRequest
2270
+ * @description Authorize a delegated session with workspace keys.
2271
+ *
2272
+ * Used by: POST /user/authorize (authenticated)
2273
+ *
2274
+ * Frontend sends workspace keys SealedBox-encrypted with the user's session public key.
2275
+ * Server decrypts them, re-encrypts with a new session keypair, and creates a pending
2276
+ * session keyed by a 3-word claim code. The recipient redeems the code via POST /user/token.
2277
+ *
2278
+ * If persist_identity is True, the claim creates a persistent Agent identity
2279
+ * with its own keypair and WorkspaceUsers rows. The agent can then re-login.
2280
+ */
2281
+ AuthorizeRequest: {
2282
+ /** Workspaces */
2283
+ workspaces: {
2284
+ [key: string]: string;
2285
+ };
2286
+ /** Active Workspace */
2287
+ active_workspace?: string | null;
2288
+ /**
2289
+ * Ttl
2290
+ * @default 3600
2291
+ */
2292
+ ttl: number;
2293
+ /**
2294
+ * Persist Identity
2295
+ * @default false
2296
+ */
2297
+ persist_identity: boolean;
2298
+ /** Name */
2299
+ name: string;
2300
+ };
2301
+ /**
2302
+ * AuthorizeResponse
2303
+ * @description Response containing a 3-word claim code for the recipient to retrieve a JWT.
2304
+ */
2305
+ AuthorizeResponse: {
2306
+ /** Claim Code */
2307
+ claim_code: string;
2308
+ };
2125
2309
  /**
2126
2310
  * BatchCompleteMessage
2127
2311
  * @description Notification that a batch operation (upload or doctag generation) completed.
@@ -2339,6 +2523,12 @@ interface components {
2339
2523
  * @enum {string}
2340
2524
  */
2341
2525
  API_TYPE: 'local' | 'remote';
2526
+ /**
2527
+ * Enable Thinking
2528
+ * @description Enable reasoning/thinking mode.
2529
+ * @default true
2530
+ */
2531
+ ENABLE_THINKING: boolean;
2342
2532
  /**
2343
2533
  * Model Name
2344
2534
  * @description Model for code generation. Should be a strong coding model.
@@ -2581,6 +2771,8 @@ interface components {
2581
2771
  is_shared: boolean;
2582
2772
  /** Message Count */
2583
2773
  message_count: number;
2774
+ /** Last Message Status */
2775
+ last_message_status?: string | null;
2584
2776
  };
2585
2777
  /** ConversationTitleUpdateRequest */
2586
2778
  ConversationTitleUpdateRequest: {
@@ -2617,7 +2809,7 @@ interface components {
2617
2809
  target_workspace_ext_id: string;
2618
2810
  /**
2619
2811
  * Target Workspace Key
2620
- * @description SealedBox-encrypted target workspace key (same format as WorkspaceOpenRequest.workspace_key)
2812
+ * @description SealedBox-encrypted target workspace key (encrypted with session public key)
2621
2813
  */
2622
2814
  target_workspace_key: string;
2623
2815
  /**
@@ -2728,6 +2920,14 @@ interface components {
2728
2920
  /** Parent Ext Id */
2729
2921
  parent_ext_id?: string | null;
2730
2922
  };
2923
+ /**
2924
+ * DeleteAgentsRequest
2925
+ * @description Request to delete agents by external ID.
2926
+ */
2927
+ DeleteAgentsRequest: {
2928
+ /** Agent Ext Ids */
2929
+ agent_ext_ids: string[];
2930
+ };
2731
2931
  /**
2732
2932
  * DeleteContactsRequest
2733
2933
  * @description Request model for deleting specific contacts.
@@ -2912,6 +3112,12 @@ interface components {
2912
3112
  * @enum {string}
2913
3113
  */
2914
3114
  API_TYPE: 'local' | 'remote';
3115
+ /**
3116
+ * Enable Thinking
3117
+ * @description Enable reasoning/thinking mode.
3118
+ * @default false
3119
+ */
3120
+ ENABLE_THINKING: boolean;
2915
3121
  /**
2916
3122
  * Model Name
2917
3123
  * @description The name of the non-reasoning model to be used.
@@ -3081,6 +3287,12 @@ interface components {
3081
3287
  * @enum {string}
3082
3288
  */
3083
3289
  API_TYPE: 'local' | 'remote';
3290
+ /**
3291
+ * Enable Thinking
3292
+ * @description Enable reasoning/thinking mode.
3293
+ * @default false
3294
+ */
3295
+ ENABLE_THINKING: boolean;
3084
3296
  /**
3085
3297
  * Model Name
3086
3298
  * @description The name of the non-reasoning model to be used.
@@ -3188,6 +3400,83 @@ interface components {
3188
3400
  /** Status Details */
3189
3401
  status_details?: string | null;
3190
3402
  };
3403
+ /**
3404
+ * FilterPlanLLMConfig
3405
+ * @description Configuration for FilterPlanLLM — pre-agentic context selector.
3406
+ *
3407
+ * Runs before the agent loop to select relevant history messages and documents,
3408
+ * plus produce a concise goal statement that primes the agent.
3409
+ * Always uses the fast model (LLM_MODEL_NAME). In auto mode, also recommends
3410
+ * a model tier (fast/wise/premium) for the agent loop.
3411
+ */
3412
+ FilterPlanLLMConfig: {
3413
+ /**
3414
+ * Api Type
3415
+ * @description The inference type (local or remote).
3416
+ * @default remote
3417
+ * @enum {string}
3418
+ */
3419
+ API_TYPE: 'local' | 'remote';
3420
+ /**
3421
+ * Enable Thinking
3422
+ * @description Enable reasoning/thinking mode.
3423
+ * @default false
3424
+ */
3425
+ ENABLE_THINKING: boolean;
3426
+ /**
3427
+ * Model Name
3428
+ * @description The name of the non-reasoning model to be used.
3429
+ * @default Fast
3430
+ */
3431
+ MODEL_NAME: string;
3432
+ /**
3433
+ * System Instruction
3434
+ * @description System prompt for the filter/plan LLM.
3435
+ * @default You are a context selector. Given a user's query, conversation history, and a table of available documents, determine the user's goal and select relevant context.
3436
+ *
3437
+ * ## Instructions
3438
+ *
3439
+ * 1. **goal**: 1-2 concise sentences describing the user's intent AND your filtering rationale. Explain what documents are needed and why. Examples:
3440
+ * - "The user is greeting the assistant. No documents are needed."
3441
+ * - "The user wants to find force majeure clauses. Only the three contracts are relevant, so I will keep only those."
3442
+ * - "The user wants a full timeline of the case. Most documents are relevant, so I will drop only the unrelated procedural orders."
3443
+ *
3444
+ * 2. **doc_filter_mode** and **doc_ids**: Select which documents the agent needs.
3445
+ * - `"keep"` mode: `doc_ids` lists the ONLY docs to keep. Everything else is dropped.
3446
+ * - `"drop"` mode: `doc_ids` lists the ONLY docs to drop. Everything else is kept.
3447
+ * - Pick whichever mode produces the **shorter `doc_ids` list**.
3448
+ * - Doc IDs are in the **Id** column of the Available Documents table (e.g. `"doc-abc12345"`). Copy them **exactly** from the table — do not invent, guess, or modify IDs.
3449
+ *
3450
+ * | Scenario | doc_filter_mode | doc_ids |
3451
+ * |----------|----------------|---------|
3452
+ * | Need ALL docs | `"drop"` | `[]` |
3453
+ * | Need NO docs | `"keep"` | `[]` |
3454
+ * | Need 3 of 100 docs | `"keep"` | `["id1","id2","id3"]` |
3455
+ * | Drop 3 of 100 docs | `"drop"` | `["id1","id2","id3"]` |
3456
+ *
3457
+ * 3. **chat_range_start** and **chat_range_end**: 0-based inclusive range of earlier history messages that provide relevant context. The last 3 messages are always included automatically. Set both to -1 if no earlier history is needed.
3458
+ *
3459
+ * ## Rules
3460
+ *
3461
+ * - **Never repeat a doc ID.** Each ID must appear at most once.
3462
+ * - Before writing `doc_ids`, count how many you would keep vs drop, then pick the shorter list.
3463
+ * - Greetings or meta-questions about the assistant (e.g. "hello", "who are you?", "what can you do?"): the agent does NOT need any documents → `"keep"` with `[]`.
3464
+ * - Ambiguous references like "the document" or "this contract" without specifying which: keep all → `"drop"` with `[]`.
3465
+ * - For follow-up questions, include history messages that establish the topic.
3466
+ * - Always return valid JSON matching the schema.
3467
+ */
3468
+ SYSTEM_INSTRUCTION: string;
3469
+ /**
3470
+ * Temperature
3471
+ * @default 0
3472
+ */
3473
+ TEMPERATURE: number;
3474
+ /**
3475
+ * Max Tokens
3476
+ * @default 3000
3477
+ */
3478
+ MAX_TOKENS: number;
3479
+ };
3191
3480
  /**
3192
3481
  * GenerateAnnotationsRequest
3193
3482
  * @description Request to generate AI annotations for documents using tag instructions.
@@ -3219,67 +3508,6 @@ interface components {
3219
3508
  */
3220
3509
  tag_ext_ids: string[];
3221
3510
  };
3222
- /**
3223
- * GetDocumentPassagesDetail
3224
- * @description Detail for a get_document_passages tool call.
3225
- */
3226
- GetDocumentPassagesDetail: {
3227
- /**
3228
- * Tool
3229
- * @default get_document_passages
3230
- * @constant
3231
- */
3232
- tool: 'get_document_passages';
3233
- /**
3234
- * Doc Ext Id
3235
- * @description Document external ID
3236
- */
3237
- doc_ext_id: string;
3238
- /**
3239
- * From Ref
3240
- * @description Start reference (page.chunk)
3241
- */
3242
- from_ref: string;
3243
- /**
3244
- * To Ref
3245
- * @description End reference (page.chunk)
3246
- */
3247
- to_ref: string;
3248
- /**
3249
- * Label
3250
- * @description Display label for the tool step
3251
- * @default Reading document
3252
- */
3253
- label: string;
3254
- /**
3255
- * Icon
3256
- * @description Lucide icon name for the tool step
3257
- * @default file-text
3258
- */
3259
- icon: string;
3260
- /**
3261
- * Summary
3262
- * @description Human-readable summary (e.g. 'Reading {doc-abc12345} pp. 5–10')
3263
- */
3264
- summary?: string | null;
3265
- };
3266
- /**
3267
- * GetFullDocumentDetail
3268
- * @description Detail for a get_full_document tool call.
3269
- */
3270
- GetFullDocumentDetail: {
3271
- /**
3272
- * Tool
3273
- * @default get_full_document
3274
- * @constant
3275
- */
3276
- tool: 'get_full_document';
3277
- /**
3278
- * Doc Ext Id
3279
- * @description Document external ID
3280
- */
3281
- doc_ext_id: string;
3282
- };
3283
3511
  /**
3284
3512
  * GetTableOfContentsDetail
3285
3513
  * @description Detail for a get_table_of_contents tool call.
@@ -3292,15 +3520,10 @@ interface components {
3292
3520
  */
3293
3521
  tool: 'get_table_of_contents';
3294
3522
  /**
3295
- * Doc Count
3296
- * @description Number of documents requested
3297
- */
3298
- doc_count: number;
3299
- /**
3300
- * Doc Ext Ids
3301
- * @description Document external IDs
3523
+ * Doc Ext Id
3524
+ * @description Document external ID
3302
3525
  */
3303
- doc_ext_ids: string[];
3526
+ doc_ext_id: string;
3304
3527
  /**
3305
3528
  * Label
3306
3529
  * @description Display label for the tool step
@@ -3362,23 +3585,24 @@ interface components {
3362
3585
  };
3363
3586
  /**
3364
3587
  * LoginRequest
3365
- * @description Unified login request (local and SSO).
3588
+ * @description Unified login request for users and agents.
3366
3589
  *
3367
3590
  * For local users: email + signature + timestamp
3368
3591
  * For SSO users: email + signature + timestamp + sso_token
3592
+ * For agents: agent_ext_id + signature + timestamp
3593
+ *
3594
+ * Exactly one of ``email`` or ``agent_ext_id`` must be provided.
3369
3595
  *
3370
3596
  * Authentication flow:
3371
- * 1. Client derives Ed25519 keypair from password
3372
- * 2. Client signs "email|timestamp" with Ed25519 private key
3597
+ * 1. Client derives Ed25519 keypair from password (users) or has stored key (agents)
3598
+ * 2. Client signs "identity|timestamp" with Ed25519 private key
3373
3599
  * 3. Server verifies signature using stored Ed25519 public key
3374
- * 4. Server derives X25519 from Ed25519 for session key encryption
3375
3600
  */
3376
3601
  LoginRequest: {
3377
- /**
3378
- * Email
3379
- * Format: email
3380
- */
3381
- email: string;
3602
+ /** Email */
3603
+ email?: string | null;
3604
+ /** Agent Ext Id */
3605
+ agent_ext_id?: string | null;
3382
3606
  /** Signature */
3383
3607
  signature: string;
3384
3608
  /** Timestamp */
@@ -3388,9 +3612,9 @@ interface components {
3388
3612
  };
3389
3613
  /**
3390
3614
  * LoginResponse
3391
- * @description Login response with access token, session key, and user info.
3615
+ * @description Login response with access token, session key, user info, and workspaces.
3392
3616
  *
3393
- * Used by: /user/login
3617
+ * Used by: /user/login, /user/token (claim agent session)
3394
3618
  */
3395
3619
  LoginResponse: {
3396
3620
  /** Access Token */
@@ -3398,6 +3622,13 @@ interface components {
3398
3622
  /** Session Key */
3399
3623
  session_key: string;
3400
3624
  user: components['schemas']['UserResponse'];
3625
+ /**
3626
+ * Workspaces
3627
+ * @default []
3628
+ */
3629
+ workspaces: {
3630
+ [key: string]: unknown;
3631
+ }[];
3401
3632
  };
3402
3633
  /** LogoutResponse */
3403
3634
  LogoutResponse: {
@@ -3434,6 +3665,12 @@ interface components {
3434
3665
  * @enum {string}
3435
3666
  */
3436
3667
  API_TYPE: 'local' | 'remote';
3668
+ /**
3669
+ * Enable Thinking
3670
+ * @description Enable reasoning/thinking mode.
3671
+ * @default false
3672
+ */
3673
+ ENABLE_THINKING: boolean;
3437
3674
  /**
3438
3675
  * Model Name
3439
3676
  * @description The model for memory synthesis. Defaults to reasoning model.
@@ -3712,6 +3949,12 @@ interface components {
3712
3949
  * @default 5
3713
3950
  */
3714
3951
  MAX_NUMB_CITATIONS: number;
3952
+ /**
3953
+ * Citation Instruction
3954
+ * @description Instruction for the <Instruct> tag when scoring chunks for citation attribution.
3955
+ * @default Judge whether the passage contains evidence that directly supports or sources the claim made in the query. Only answer yes if the passage provides the basis for the statement
3956
+ */
3957
+ CITATION_INSTRUCTION: string;
3715
3958
  };
3716
3959
  /** ModelCitationTool */
3717
3960
  ModelCitationTool: {
@@ -3833,7 +4076,7 @@ interface components {
3833
4076
  * Type is self-descriptive, no need to parse content field.
3834
4077
  * @enum {string}
3835
4078
  */
3836
- NotificationType: 'user_message' | 'workspaceuser_added_owner' | 'workspaceuser_added_collaborator' | 'workspaceuser_added_guest' | 'workspaceuser_removed' | 'workspaceuser_updated_owner' | 'workspaceuser_updated_collaborator' | 'workspaceuser_updated_guest' | 'contact_accepted' | 'email_reply';
4079
+ NotificationType: 'user_message' | 'workspaceuser_added_owner' | 'workspaceuser_added_collaborator' | 'workspaceuser_added_guest' | 'workspaceuser_removed' | 'workspaceuser_updated_owner' | 'workspaceuser_updated_collaborator' | 'workspaceuser_updated_guest' | 'contact_accepted' | 'access_request' | 'access_code' | 'email_reply';
3837
4080
  /**
3838
4081
  * NotificationUpdate
3839
4082
  * @description Single notification update for bulk PATCH.
@@ -4028,6 +4271,12 @@ interface components {
4028
4271
  * @enum {string}
4029
4272
  */
4030
4273
  API_TYPE: 'local' | 'remote';
4274
+ /**
4275
+ * Enable Thinking
4276
+ * @description Enable reasoning/thinking mode.
4277
+ * @default true
4278
+ */
4279
+ ENABLE_THINKING: boolean;
4031
4280
  /**
4032
4281
  * Model Name
4033
4282
  * @description The model for plan generation. Defaults to reasoning model.
@@ -4040,8 +4289,8 @@ interface components {
4040
4289
  * @default You are a research planning assistant. Your job is to analyze a user query and produce a concise, numbered research plan.
4041
4290
  *
4042
4291
  * You have access to a workspace of documents. The available tools for executing the plan are:
4043
- * - search_documents: Search workspace documents for relevant passages (semantic, keyword, or hybrid)
4044
- * - get_document_passages: Read a specific page range from a document
4292
+ * - search_inside_documents: Search workspace documents for relevant passages (semantic, keyword, or hybrid). Use digest=true to extract learnings.
4293
+ * - read_document: Read page ranges or entire documents. Use digest=true to extract learnings with citations.
4045
4294
  * - get_table_of_contents: Get document headings with page references
4046
4295
  *
4047
4296
  * Consider:
@@ -4141,6 +4390,12 @@ interface components {
4141
4390
  * @enum {string}
4142
4391
  */
4143
4392
  API_TYPE: 'local' | 'remote';
4393
+ /**
4394
+ * Enable Thinking
4395
+ * @description Enable reasoning/thinking mode.
4396
+ * @default false
4397
+ */
4398
+ ENABLE_THINKING: boolean;
4144
4399
  /**
4145
4400
  * Model Name
4146
4401
  * @description The model for query answering.
@@ -4172,6 +4427,50 @@ interface components {
4172
4427
  */
4173
4428
  MAX_TOKENS: number;
4174
4429
  };
4430
+ /**
4431
+ * ReadDocumentDetail
4432
+ * @description Detail for a read_document tool call.
4433
+ */
4434
+ ReadDocumentDetail: {
4435
+ /**
4436
+ * Tool
4437
+ * @default read_document
4438
+ * @constant
4439
+ */
4440
+ tool: 'read_document';
4441
+ /**
4442
+ * Doc Ext Id
4443
+ * @description Document external ID
4444
+ */
4445
+ doc_ext_id: string;
4446
+ /**
4447
+ * Range Count
4448
+ * @description Number of page ranges requested (0 = full document)
4449
+ */
4450
+ range_count: number;
4451
+ /**
4452
+ * Digest
4453
+ * @description Whether learnings extraction was requested
4454
+ */
4455
+ digest: boolean;
4456
+ /**
4457
+ * Label
4458
+ * @description Display label for the tool step
4459
+ * @default Reading document
4460
+ */
4461
+ label: string;
4462
+ /**
4463
+ * Icon
4464
+ * @description Lucide icon name for the tool step
4465
+ * @default file-text
4466
+ */
4467
+ icon: string;
4468
+ /**
4469
+ * Summary
4470
+ * @description Human-readable summary (e.g. 'Reading {doc-abc12345} pp. 5–10')
4471
+ */
4472
+ summary?: string | null;
4473
+ };
4175
4474
  /**
4176
4475
  * ReadUrlDetail
4177
4476
  * @description Detail for a read_url tool call.
@@ -4226,7 +4525,7 @@ interface components {
4226
4525
  };
4227
4526
  /**
4228
4527
  * RemoveWorkspaceUserItem
4229
- * @description A user to remove from a workspace.
4528
+ * @description A user or agent to remove from a workspace.
4230
4529
  */
4231
4530
  RemoveWorkspaceUserItem: {
4232
4531
  /** User Ext Id */
@@ -4273,6 +4572,12 @@ interface components {
4273
4572
  * @enum {string}
4274
4573
  */
4275
4574
  API_TYPE: 'local' | 'remote';
4575
+ /**
4576
+ * Retrieval Instruction
4577
+ * @description Instruction for the <Instruct> tag when reranking retrieval results against a user query.
4578
+ * @default Judge whether the passage contains the specific facts, figures, names, or references mentioned in the query. Only answer yes if the passage directly contains these details
4579
+ */
4580
+ RETRIEVAL_INSTRUCTION: string;
4276
4581
  };
4277
4582
  /**
4278
4583
  * ResponseCompleteMessage
@@ -4886,7 +5191,7 @@ interface components {
4886
5191
  /**
4887
5192
  * Min Retrieval Sim Score
4888
5193
  * @description Minimum similarity score for retrieval of a chunk.
4889
- * @default 0.3
5194
+ * @default 0.1
4890
5195
  */
4891
5196
  MIN_RETRIEVAL_SIM_SCORE: number;
4892
5197
  /**
@@ -4912,6 +5217,12 @@ interface components {
4912
5217
  * @default semantic
4913
5218
  */
4914
5219
  SEARCH_MODE: components['schemas']['SearchMode'];
5220
+ /**
5221
+ * Hybrid Prefetch Limit
5222
+ * @description Maximum number of candidates each prefetch (dense and sparse) returns in hybrid mode before RRF fusion. Caps the sparse BM25 prefetch to avoid returning tens of thousands of chunks for common tokens.
5223
+ * @default 500
5224
+ */
5225
+ HYBRID_PREFETCH_LIMIT: number;
4915
5226
  /**
4916
5227
  * Hybrid Dense Weight
4917
5228
  * @description Weight for dense vectors in hybrid mode
@@ -4924,12 +5235,6 @@ interface components {
4924
5235
  * @default 0.3
4925
5236
  */
4926
5237
  HYBRID_SPARSE_WEIGHT: number;
4927
- /**
4928
- * Hybrid Reranker Weight
4929
- * @description Weight for reranker score in hybrid mode score blending (0-1). RRF weight = 1 - this value
4930
- * @default 0.5
4931
- */
4932
- HYBRID_RERANKER_WEIGHT: number;
4933
5238
  };
4934
5239
  /**
4935
5240
  * ReviewLLMConfig
@@ -4943,6 +5248,12 @@ interface components {
4943
5248
  * @enum {string}
4944
5249
  */
4945
5250
  API_TYPE: 'local' | 'remote';
5251
+ /**
5252
+ * Enable Thinking
5253
+ * @description Enable reasoning/thinking mode.
5254
+ * @default false
5255
+ */
5256
+ ENABLE_THINKING: boolean;
4946
5257
  /**
4947
5258
  * Model Name
4948
5259
  * @description The model for reviewing agent draft answers. Defaults to reasoning model.
@@ -5068,11 +5379,10 @@ interface components {
5068
5379
  output_tokens_details?: components['schemas']['OutputTokensDetails'] | null;
5069
5380
  context_usage?: components['schemas']['ContextUsage'] | null;
5070
5381
  message_metadata?: components['schemas']['MessageMetadataPayload'] | null;
5071
- detail_search_documents?: components['schemas']['SearchDocumentsDetail'] | null;
5072
- detail_get_document_passages?: components['schemas']['GetDocumentPassagesDetail'] | null;
5382
+ detail_search_inside_documents?: components['schemas']['SearchInsideDocumentsDetail'] | null;
5383
+ detail_read_document?: components['schemas']['ReadDocumentDetail'] | null;
5073
5384
  detail_get_table_of_contents?: components['schemas']['GetTableOfContentsDetail'] | null;
5074
5385
  detail_view_document_pages?: components['schemas']['ViewDocumentPagesDetail'] | null;
5075
- detail_get_full_document?: components['schemas']['GetFullDocumentDetail'] | null;
5076
5386
  detail_web_search?: components['schemas']['WebSearchDetail'] | null;
5077
5387
  detail_personal_agent?: components['schemas']['PersonalAgentDetail'] | null;
5078
5388
  detail_read_url?: components['schemas']['ReadUrlDetail'] | null;
@@ -5189,16 +5499,16 @@ interface components {
5189
5499
  title: string;
5190
5500
  };
5191
5501
  /**
5192
- * SearchDocumentsDetail
5193
- * @description Detail for a search_documents tool call.
5502
+ * SearchInsideDocumentsDetail
5503
+ * @description Detail for a search_inside_documents tool call.
5194
5504
  */
5195
- SearchDocumentsDetail: {
5505
+ SearchInsideDocumentsDetail: {
5196
5506
  /**
5197
5507
  * Tool
5198
- * @default search_documents
5508
+ * @default search_inside_documents
5199
5509
  * @constant
5200
5510
  */
5201
- tool: 'search_documents';
5511
+ tool: 'search_inside_documents';
5202
5512
  /**
5203
5513
  * Query
5204
5514
  * @description Search query (truncated to 80 chars)
@@ -5257,6 +5567,34 @@ interface components {
5257
5567
  [key: string]: unknown;
5258
5568
  } | null;
5259
5569
  };
5570
+ /**
5571
+ * SessionInfoResponse
5572
+ * @description Active session info returned by GET /user/sessions.
5573
+ */
5574
+ SessionInfoResponse: {
5575
+ /** Session Id */
5576
+ session_id: string;
5577
+ /** External Id */
5578
+ external_id?: string | null;
5579
+ /** Name */
5580
+ name?: string | null;
5581
+ /** Ip Address */
5582
+ ip_address?: string | null;
5583
+ /** Active Workspace */
5584
+ active_workspace?: string | null;
5585
+ /**
5586
+ * Workspaces
5587
+ * @default []
5588
+ */
5589
+ workspaces: string[];
5590
+ /**
5591
+ * Status
5592
+ * @default user
5593
+ */
5594
+ status: string;
5595
+ /** Ttl */
5596
+ ttl: number;
5597
+ };
5260
5598
  /** ShareConversationResponse */
5261
5599
  ShareConversationResponse: {
5262
5600
  /**
@@ -5378,6 +5716,12 @@ interface components {
5378
5716
  * @enum {string}
5379
5717
  */
5380
5718
  API_TYPE: 'local' | 'remote';
5719
+ /**
5720
+ * Enable Thinking
5721
+ * @description Enable reasoning/thinking mode.
5722
+ * @default false
5723
+ */
5724
+ ENABLE_THINKING: boolean;
5381
5725
  /**
5382
5726
  * Model Name
5383
5727
  * @description The model for conversation summarisation. Defaults to reasoning model.
@@ -5556,6 +5900,12 @@ interface components {
5556
5900
  * @enum {string}
5557
5901
  */
5558
5902
  API_TYPE: 'local' | 'remote';
5903
+ /**
5904
+ * Enable Thinking
5905
+ * @description Enable reasoning/thinking mode.
5906
+ * @default false
5907
+ */
5908
+ ENABLE_THINKING: boolean;
5559
5909
  /**
5560
5910
  * Model Name
5561
5911
  * @description The name of the non-reasoning model to be used.
@@ -5798,9 +6148,10 @@ interface components {
5798
6148
  };
5799
6149
  /**
5800
6150
  * UpdateWorkspaceUserRolesRequest
5801
- * @description Request to update user roles in a workspace (PATCH /workspace/{id}/users).
6151
+ * @description Request to update user or agent roles in a workspace (PATCH /workspace/{id}/users).
5802
6152
  *
5803
- * All specified users are updated to the same role.
6153
+ * All specified users/agents are updated to the same role.
6154
+ * Accepts both usr-XXXXXXXX and agt-XXXXXXXX external IDs.
5804
6155
  */
5805
6156
  UpdateWorkspaceUserRolesRequest: {
5806
6157
  /** User Ext Ids */
@@ -5934,16 +6285,19 @@ interface components {
5934
6285
  * @description Standard user representation used across all endpoints.
5935
6286
  *
5936
6287
  * Used for: login response, workspace users, contacts (when registered).
6288
+ * Agents have agt- prefix and may have nullable name/email fields.
5937
6289
  */
5938
6290
  UserResponse: {
5939
6291
  /** External Id */
5940
6292
  external_id: string;
6293
+ /** Parent Ext Id */
6294
+ parent_ext_id?: string | null;
5941
6295
  /** Email */
5942
6296
  email: string;
5943
6297
  /** Given Name */
5944
6298
  given_name: string;
5945
6299
  /** Family Name */
5946
- family_name: string;
6300
+ family_name?: string | null;
5947
6301
  /** Picture */
5948
6302
  picture?: string | null;
5949
6303
  /** Encryption Public Key */
@@ -6017,6 +6371,11 @@ interface components {
6017
6371
  * @default false
6018
6372
  */
6019
6373
  show_pa_mode: boolean;
6374
+ /**
6375
+ * Show Agent Sessions
6376
+ * @default false
6377
+ */
6378
+ show_agent_sessions: boolean;
6020
6379
  /**
6021
6380
  * Hide Online Status
6022
6381
  * @default false
@@ -6027,6 +6386,10 @@ interface components {
6027
6386
  * @default []
6028
6387
  */
6029
6388
  muted_users: string[];
6389
+ /** Premium Model */
6390
+ premium_model?: string | null;
6391
+ /** Picture */
6392
+ picture?: string | null;
6030
6393
  } & {
6031
6394
  [key: string]: unknown;
6032
6395
  };
@@ -6061,10 +6424,16 @@ interface components {
6061
6424
  show_templates?: boolean | null;
6062
6425
  /** Show Pa Mode */
6063
6426
  show_pa_mode?: boolean | null;
6427
+ /** Show Agent Sessions */
6428
+ show_agent_sessions?: boolean | null;
6064
6429
  /** Hide Online Status */
6065
6430
  hide_online_status?: boolean | null;
6066
6431
  /** Muted Users */
6067
6432
  muted_users?: string[] | null;
6433
+ /** Premium Model */
6434
+ premium_model?: string | null;
6435
+ /** Picture */
6436
+ picture?: string | null;
6068
6437
  };
6069
6438
  /** ValidationError */
6070
6439
  ValidationError: {
@@ -6123,7 +6492,7 @@ interface components {
6123
6492
  * VisionLLMConfig
6124
6493
  * @description Configuration for VisionLLM — visually inspects document pages.
6125
6494
  *
6126
- * Used as a targeted fallback when text extraction (get_document_passages)
6495
+ * Used as a targeted fallback when text extraction (read_document)
6127
6496
  * is insufficient, e.g. for figures, charts, tables, scanned pages.
6128
6497
  * The prompt is constructed dynamically per call (no system instruction).
6129
6498
  */
@@ -6135,6 +6504,12 @@ interface components {
6135
6504
  * @enum {string}
6136
6505
  */
6137
6506
  API_TYPE: 'local' | 'remote';
6507
+ /**
6508
+ * Enable Thinking
6509
+ * @description Enable reasoning/thinking mode.
6510
+ * @default false
6511
+ */
6512
+ ENABLE_THINKING: boolean;
6138
6513
  /**
6139
6514
  * Model Name
6140
6515
  * @description The vision-capable model name (must support image inputs).
@@ -6232,22 +6607,25 @@ interface components {
6232
6607
  * @default false
6233
6608
  */
6234
6609
  is_public: boolean;
6610
+ /** Workspace Key */
6611
+ workspace_key: string;
6235
6612
  };
6236
6613
  /**
6237
6614
  * WorkspaceOpenRequest
6238
- * @description Request to open a workspace and get a workspace-scoped JWT.
6615
+ * @description Request to open a workspace stores encrypted key in session and sets active.
6616
+ *
6617
+ * workspace_key is required for users (SealedBox-encrypted with session public key).
6618
+ * Agents omit it — their workspace keys are pre-populated via /agent-session.
6239
6619
  */
6240
6620
  WorkspaceOpenRequest: {
6241
6621
  /** Workspace Key */
6242
- workspace_key: string;
6622
+ workspace_key?: string | null;
6243
6623
  };
6244
6624
  /**
6245
6625
  * WorkspaceOpenResponse
6246
- * @description Response from opening a workspace — includes workspace-scoped JWT and workspace data.
6626
+ * @description Response from opening a workspace — workspace data (no new JWT).
6247
6627
  */
6248
6628
  WorkspaceOpenResponse: {
6249
- /** Access Token */
6250
- access_token: string;
6251
6629
  workspace: components['schemas']['WorkspaceResponse'];
6252
6630
  /** Conversations */
6253
6631
  conversations: components['schemas']['ConversationResponse'][];
@@ -6330,7 +6708,9 @@ interface components {
6330
6708
  };
6331
6709
  /**
6332
6710
  * WorkspaceUserResponse
6333
- * @description User with their role in a workspace.
6711
+ * @description User (or agent) with their role in a workspace.
6712
+ *
6713
+ * For agents: agent_ext_id is set (agt-XXXXXXXX), name is user.given_name.
6334
6714
  */
6335
6715
  WorkspaceUserResponse: {
6336
6716
  user: components['schemas']['UserResponse'];
@@ -6350,6 +6730,8 @@ interface components {
6350
6730
  * @default 0
6351
6731
  */
6352
6732
  document_count: number;
6733
+ /** Agent Ext Id */
6734
+ agent_ext_id?: string | null;
6353
6735
  };
6354
6736
  };
6355
6737
  responses: never;
@@ -6596,6 +6978,127 @@ interface operations {
6596
6978
  };
6597
6979
  };
6598
6980
  };
6981
+ list_agents: {
6982
+ parameters: {
6983
+ query?: never;
6984
+ header?: never;
6985
+ path?: never;
6986
+ cookie?: never;
6987
+ };
6988
+ requestBody?: never;
6989
+ responses: {
6990
+ /** @description Successful Response */
6991
+ 200: {
6992
+ headers: {
6993
+ [name: string]: unknown;
6994
+ };
6995
+ content: {
6996
+ 'application/json': components['schemas']['UserResponse'][];
6997
+ };
6998
+ };
6999
+ };
7000
+ };
7001
+ delete_agents: {
7002
+ parameters: {
7003
+ query?: never;
7004
+ header?: never;
7005
+ path?: never;
7006
+ cookie?: never;
7007
+ };
7008
+ requestBody: {
7009
+ content: {
7010
+ 'application/json': components['schemas']['DeleteAgentsRequest'];
7011
+ };
7012
+ };
7013
+ responses: {
7014
+ /** @description Successful Response */
7015
+ 200: {
7016
+ headers: {
7017
+ [name: string]: unknown;
7018
+ };
7019
+ content: {
7020
+ 'application/json': {
7021
+ [key: string]: unknown;
7022
+ };
7023
+ };
7024
+ };
7025
+ /** @description Validation Error */
7026
+ 422: {
7027
+ headers: {
7028
+ [name: string]: unknown;
7029
+ };
7030
+ content: {
7031
+ 'application/json': components['schemas']['HTTPValidationError'];
7032
+ };
7033
+ };
7034
+ };
7035
+ };
7036
+ authorize_session: {
7037
+ parameters: {
7038
+ query?: never;
7039
+ header?: never;
7040
+ path?: never;
7041
+ cookie?: never;
7042
+ };
7043
+ requestBody: {
7044
+ content: {
7045
+ 'application/json': components['schemas']['AuthorizeRequest'];
7046
+ };
7047
+ };
7048
+ responses: {
7049
+ /** @description Successful Response */
7050
+ 200: {
7051
+ headers: {
7052
+ [name: string]: unknown;
7053
+ };
7054
+ content: {
7055
+ 'application/json': components['schemas']['AuthorizeResponse'];
7056
+ };
7057
+ };
7058
+ /** @description Validation Error */
7059
+ 422: {
7060
+ headers: {
7061
+ [name: string]: unknown;
7062
+ };
7063
+ content: {
7064
+ 'application/json': components['schemas']['HTTPValidationError'];
7065
+ };
7066
+ };
7067
+ };
7068
+ };
7069
+ claim_agent_session: {
7070
+ parameters: {
7071
+ query?: never;
7072
+ header?: never;
7073
+ path?: never;
7074
+ cookie?: never;
7075
+ };
7076
+ requestBody: {
7077
+ content: {
7078
+ 'application/json': components['schemas']['AgentSessionClaimRequest'];
7079
+ };
7080
+ };
7081
+ responses: {
7082
+ /** @description Successful Response */
7083
+ 200: {
7084
+ headers: {
7085
+ [name: string]: unknown;
7086
+ };
7087
+ content: {
7088
+ 'application/json': components['schemas']['LoginResponse'];
7089
+ };
7090
+ };
7091
+ /** @description Validation Error */
7092
+ 422: {
7093
+ headers: {
7094
+ [name: string]: unknown;
7095
+ };
7096
+ content: {
7097
+ 'application/json': components['schemas']['HTTPValidationError'];
7098
+ };
7099
+ };
7100
+ };
7101
+ };
6599
7102
  logout: {
6600
7103
  parameters: {
6601
7104
  query?: {
@@ -6628,6 +7131,26 @@ interface operations {
6628
7131
  };
6629
7132
  };
6630
7133
  };
7134
+ list_sessions: {
7135
+ parameters: {
7136
+ query?: never;
7137
+ header?: never;
7138
+ path?: never;
7139
+ cookie?: never;
7140
+ };
7141
+ requestBody?: never;
7142
+ responses: {
7143
+ /** @description Successful Response */
7144
+ 200: {
7145
+ headers: {
7146
+ [name: string]: unknown;
7147
+ };
7148
+ content: {
7149
+ 'application/json': components['schemas']['SessionInfoResponse'][];
7150
+ };
7151
+ };
7152
+ };
7153
+ };
6631
7154
  change_password: {
6632
7155
  parameters: {
6633
7156
  query?: never;
@@ -8634,22 +9157,9 @@ interface operations {
8634
9157
  interface TokenProvider {
8635
9158
  getAccessToken(): string | null;
8636
9159
  }
8637
- interface WorkspaceKeyProvider {
8638
- getWorkspaceKeyHeader(): string | null;
8639
- }
8640
- interface WorkspaceKeyUrlConfig {
8641
- /** URL substrings that NEVER need workspace key */
8642
- excludePatterns: string[];
8643
- /** URL substrings that DO need workspace key */
8644
- includePatterns: string[];
8645
- }
8646
9160
  interface BearerAuthMiddlewareConfig {
8647
9161
  tokenProvider: TokenProvider;
8648
9162
  }
8649
- interface WorkspaceKeyMiddlewareConfig {
8650
- workspaceKeyProvider: WorkspaceKeyProvider;
8651
- urlConfig: WorkspaceKeyUrlConfig;
8652
- }
8653
9163
  type ReloginHandler = () => Promise<string | null>;
8654
9164
  interface AutoReloginMiddlewareConfig {
8655
9165
  reloginHandler: ReloginHandler;
@@ -8672,7 +9182,7 @@ interface CryptoProvider {
8672
9182
  signMessage(message: string, privateKey: Uint8Array): string;
8673
9183
  deriveEncryptionKeypair(signingKeyPair: KeyPair$1): KeyPair$1;
8674
9184
  sealedBoxDecrypt(encryptedBase64: string, privateKey: Uint8Array): Uint8Array;
8675
- createWorkspaceKeyHeader(workspaceKey: Uint8Array, serverSessionKey: Uint8Array): Promise<string>;
9185
+ sealKeyForSession(workspaceKey: Uint8Array, serverSessionKey: Uint8Array): Promise<string>;
8676
9186
  fromBase64(base64: string): Uint8Array;
8677
9187
  }
8678
9188
  interface SessionKeys {
@@ -8694,8 +9204,6 @@ interface AuthStateProvider {
8694
9204
  };
8695
9205
  getSelectedWorkspaceId(): string | null;
8696
9206
  setAccessToken(token: string): void;
8697
- clearWorkspaceHeaders(): void;
8698
- setCachedWorkspaceHeader(workspaceId: string, header: string): void;
8699
9207
  }
8700
9208
  interface SsoTokenProvider {
8701
9209
  getToken(): Promise<string | null>;
@@ -8723,11 +9231,11 @@ interface WorkspaceKeyRefreshProvider {
8723
9231
  getWrappedKey(accessToken: string, workspaceId: string): Promise<string | null>;
8724
9232
  }
8725
9233
  /**
8726
- * Opens a workspace by calling the /open endpoint to get a workspace-scoped JWT.
8727
- * Returns the new workspace-scoped access token, or null on failure.
9234
+ * Opens a workspace by calling the /open endpoint to store keys on session.
9235
+ * Returns true on success, null on failure.
8728
9236
  */
8729
9237
  interface WorkspaceOpenProvider {
8730
- openWorkspace(accessToken: string, workspaceId: string, encryptedWorkspaceKey: string): Promise<string | null>;
9238
+ openWorkspace(accessToken: string, workspaceId: string, encryptedWorkspaceKey: string): Promise<boolean | null>;
8731
9239
  }
8732
9240
  type OnReloginSuccess = (data: {
8733
9241
  email: string;
@@ -8750,7 +9258,7 @@ interface ReloginDeps {
8750
9258
  * SessionManager - In-memory session state for SDK consumers
8751
9259
  *
8752
9260
  * Replaces Zustand for SDK consumers. Simple in-memory store with subscribe pattern.
8753
- * Implements TokenProvider, WorkspaceKeyProvider, and AuthStateProvider —
9261
+ * Implements TokenProvider and AuthStateProvider —
8754
9262
  * plugs directly into middleware and relogin handler without any framework.
8755
9263
  */
8756
9264
 
@@ -8759,7 +9267,6 @@ interface SessionState {
8759
9267
  userEmail: string | null;
8760
9268
  userExtId: string | null;
8761
9269
  selectedWorkspaceId: string | null;
8762
- cachedWorkspaceHeaders: Record<string, string>;
8763
9270
  isSsoMode: boolean;
8764
9271
  isAuth0Authenticated: boolean;
8765
9272
  auth0AccessToken: string | null;
@@ -8769,9 +9276,6 @@ interface SessionManager {
8769
9276
  setAccessToken(token: string | null): void;
8770
9277
  setUser(email: string, extId?: string): void;
8771
9278
  setSelectedWorkspace(id: string | null): void;
8772
- setCachedWorkspaceHeader(workspaceId: string, header: string): void;
8773
- clearWorkspaceHeaders(): void;
8774
- getWorkspaceKeyHeader(): string | null;
8775
9279
  setSsoState(opts: Partial<{
8776
9280
  isSsoMode: boolean;
8777
9281
  isAuth0Authenticated: boolean;
@@ -8845,9 +9349,10 @@ declare function generateKeyPairs(username: string, password: string, deployment
8845
9349
  */
8846
9350
  declare function signMessage(message: string, privateKey: Uint8Array): string;
8847
9351
  /**
8848
- * Create Workspace-Key header for API requests using SealedBox
9352
+ * Seal a workspace key with the session's X25519 public key (SealedBox).
9353
+ * The result is sent to the backend in the /open request body.
8849
9354
  */
8850
- declare function createWorkspaceKeyHeader(workspaceKey: Uint8Array, serverSessionPublicKey: Uint8Array): Promise<string>;
9355
+ declare function sealKeyForSession(workspaceKey: Uint8Array, serverSessionPublicKey: Uint8Array): Promise<string>;
8851
9356
  /**
8852
9357
  * Decrypt data using SealedBox (anonymous decryption).
8853
9358
  *
@@ -8874,6 +9379,11 @@ declare function derivePublicKey(privateKey: Uint8Array): Uint8Array;
8874
9379
  * Used when we have stored Ed25519 keys and need X25519 for encryption
8875
9380
  */
8876
9381
  declare function deriveEncryptionKeypairFromSigning(signingKeyPair: KeyPair): KeyPair;
9382
+ /**
9383
+ * Generate a random Ed25519 signing keypair.
9384
+ * Used for agent accounts that don't derive keys from a password.
9385
+ */
9386
+ declare function generateRandomSigningKeypair(): KeyPair;
8877
9387
  /**
8878
9388
  * Precompute shared secret for ECDH encryption.
8879
9389
  *
@@ -9171,6 +9681,8 @@ interface LoginWithKeyParams {
9171
9681
  interface LoginResult {
9172
9682
  accessToken: string;
9173
9683
  userExtId?: string;
9684
+ /** Owner's ext_id for agent accounts; null/undefined for human users */
9685
+ parentExtId?: string | null;
9174
9686
  signingPrivateKey: Uint8Array;
9175
9687
  serverSessionKey: Uint8Array;
9176
9688
  }
@@ -9211,8 +9723,6 @@ interface ArbiClientOptions {
9211
9723
  baseUrl: string;
9212
9724
  /** Deployment domain used for deterministic key derivation (e.g. "mydeployment.com") */
9213
9725
  deploymentDomain: string;
9214
- /** Optional custom URL patterns for workspace key injection */
9215
- workspaceKeyUrlConfig?: WorkspaceKeyUrlConfig;
9216
9726
  /** URL patterns that should never trigger re-login */
9217
9727
  reloginExcludePatterns?: string[];
9218
9728
  /** Include credentials (cookies) in requests. Default: true */
@@ -9251,8 +9761,9 @@ interface ArbiClient {
9251
9761
  signMessage: typeof signMessage;
9252
9762
  sealedBoxDecrypt: typeof sealedBoxDecrypt;
9253
9763
  sealedBoxEncrypt: typeof sealedBoxEncrypt;
9254
- createWorkspaceKeyHeader: typeof createWorkspaceKeyHeader;
9764
+ sealKeyForSession: typeof sealKeyForSession;
9255
9765
  deriveEncryptionKeypairFromSigning: typeof deriveEncryptionKeypairFromSigning;
9766
+ generateRandomSigningKeypair: typeof generateRandomSigningKeypair;
9256
9767
  derivePublicKey: typeof derivePublicKey;
9257
9768
  base64ToBytes: typeof base64ToBytes;
9258
9769
  bytesToBase64: typeof bytesToBase64;
@@ -9280,19 +9791,6 @@ declare function createArbiClient(options: ArbiClientOptions): ArbiClient;
9280
9791
 
9281
9792
  declare function createBearerAuthMiddleware(config: BearerAuthMiddlewareConfig): Middleware;
9282
9793
 
9283
- /**
9284
- * Workspace Key Middleware
9285
- *
9286
- * Injects Workspace-Key header on workspace-scoped requests.
9287
- * URL matching is data-driven via WorkspaceKeyUrlConfig.
9288
- */
9289
-
9290
- /**
9291
- * Check if a URL needs the Workspace-Key header based on URL patterns.
9292
- */
9293
- declare function needsWorkspaceKey(url: string, urlConfig: WorkspaceKeyUrlConfig): boolean;
9294
- declare function createWorkspaceKeyMiddleware(config: WorkspaceKeyMiddlewareConfig): Middleware;
9295
-
9296
9794
  /**
9297
9795
  * Auto Re-login Middleware
9298
9796
  *
@@ -9373,4 +9871,4 @@ declare function isMessageType<T extends WebSocketServerMessage>(msg: WebSocketS
9373
9871
  */
9374
9872
  declare function createReloginHandler(deps: ReloginDeps): () => Promise<string | null>;
9375
9873
 
9376
- export { type $defs, API_PREFIX, type ArbiClient, type ArbiClientOptions, type AuthStateProvider, type AutoReloginMiddlewareConfig, type BearerAuthMiddlewareConfig, type ChangePasswordParams, type ChangePasswordRequest, type ChangePasswordResult, type CryptoProvider, type KeyPair, type LoginCredentials, type LoginParams, type LoginProvider, type LoginRequest, type LoginResult, type LoginWithKeyParams, type OnReloginSuccess, type PasswordChangeCredentials, type RegisterParams, type RegisterRequest, type RegisterResult, type RegistrationCredentials, type ReloginDeps, type ReloginHandler, type SessionData, type SessionKeys, type SessionManager, type SessionState, type SessionStorageProvider, type SsoTokenProvider, type TokenProvider, type UserKeypairs, type WebSocketClientMessage, type WebSocketServerMessage, type WorkspaceKeyMiddlewareConfig, type WorkspaceKeyProvider, type WorkspaceKeyRefreshProvider, type WorkspaceKeyUrlConfig, type WorkspaceOpenProvider, type WsAuthMessage, type WsAuthResultMessage, type WsBatchCompleteMessage, type WsConnectionClosedMessage, type WsErrorMessage, type WsNotificationResponse, type WsPresenceUpdateMessage, type WsResponseCompleteMessage, type WsTaskUpdateMessage, base64Decode, base64Encode, base64ToBytes, buildWebSocketUrl, bytesToBase64, clearAllData, clearSession, type components, computeSharedSecret, createArbiClient, createAuthMessage, createAutoReloginMiddleware, createBearerAuthMiddleware, createReloginHandler, createSessionManager, createWorkspaceKeyHeader, createWorkspaceKeyMiddleware, decryptMessage, decryptMessageWithSharedSecret, deriveEncryptionKeypairFromSigning, derivePublicKey, encryptMessage, encryptMessageWithSharedSecret, generateKeyPairs, generateLoginCredentials, generateLoginCredentialsFromKey, generatePasswordChangeCredentials, generateRecoveryPasswordChangeCredentials, generateRegistrationCredentials, generateUserKeypairs, getSession, hasSession, initSodium, initializeDatabase, isMessageType, needsWorkspaceKey, type operations, parseServerMessage, type paths, saveSession, sealedBoxDecrypt, sealedBoxEncrypt, signMessage, updateSigningPrivateKey, type webhooks };
9874
+ export { type $defs, API_PREFIX, type ArbiClient, type ArbiClientOptions, type AuthStateProvider, type AutoReloginMiddlewareConfig, type BearerAuthMiddlewareConfig, type ChangePasswordParams, type ChangePasswordRequest, type ChangePasswordResult, type CryptoProvider, type KeyPair, type LoginCredentials, type LoginParams, type LoginProvider, type LoginRequest, type LoginResult, type LoginWithKeyParams, type OnReloginSuccess, type PasswordChangeCredentials, type RegisterParams, type RegisterRequest, type RegisterResult, type RegistrationCredentials, type ReloginDeps, type ReloginHandler, type SessionData, type SessionKeys, type SessionManager, type SessionState, type SessionStorageProvider, type SsoTokenProvider, type TokenProvider, type UserKeypairs, type WebSocketClientMessage, type WebSocketServerMessage, type WorkspaceKeyRefreshProvider, type WorkspaceOpenProvider, type WsAuthMessage, type WsAuthResultMessage, type WsBatchCompleteMessage, type WsConnectionClosedMessage, type WsErrorMessage, type WsNotificationResponse, type WsPresenceUpdateMessage, type WsResponseCompleteMessage, type WsTaskUpdateMessage, base64Decode, base64Encode, base64ToBytes, buildWebSocketUrl, bytesToBase64, clearAllData, clearSession, type components, computeSharedSecret, createArbiClient, createAuthMessage, createAutoReloginMiddleware, createBearerAuthMiddleware, createReloginHandler, createSessionManager, decryptMessage, decryptMessageWithSharedSecret, deriveEncryptionKeypairFromSigning, derivePublicKey, encryptMessage, encryptMessageWithSharedSecret, generateKeyPairs, generateLoginCredentials, generateLoginCredentialsFromKey, generatePasswordChangeCredentials, generateRandomSigningKeypair, generateRecoveryPasswordChangeCredentials, generateRegistrationCredentials, generateUserKeypairs, getSession, hasSession, initSodium, initializeDatabase, isMessageType, type operations, parseServerMessage, type paths, saveSession, sealKeyForSession, sealedBoxDecrypt, sealedBoxEncrypt, signMessage, updateSigningPrivateKey, type webhooks };