@arbidocs/client 0.3.19 → 0.3.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -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.
@@ -2617,7 +2807,7 @@ interface components {
2617
2807
  target_workspace_ext_id: string;
2618
2808
  /**
2619
2809
  * Target Workspace Key
2620
- * @description SealedBox-encrypted target workspace key (same format as WorkspaceOpenRequest.workspace_key)
2810
+ * @description SealedBox-encrypted target workspace key (encrypted with session public key)
2621
2811
  */
2622
2812
  target_workspace_key: string;
2623
2813
  /**
@@ -2728,6 +2918,14 @@ interface components {
2728
2918
  /** Parent Ext Id */
2729
2919
  parent_ext_id?: string | null;
2730
2920
  };
2921
+ /**
2922
+ * DeleteAgentsRequest
2923
+ * @description Request to delete agents by external ID.
2924
+ */
2925
+ DeleteAgentsRequest: {
2926
+ /** Agent Ext Ids */
2927
+ agent_ext_ids: string[];
2928
+ };
2731
2929
  /**
2732
2930
  * DeleteContactsRequest
2733
2931
  * @description Request model for deleting specific contacts.
@@ -2912,6 +3110,12 @@ interface components {
2912
3110
  * @enum {string}
2913
3111
  */
2914
3112
  API_TYPE: 'local' | 'remote';
3113
+ /**
3114
+ * Enable Thinking
3115
+ * @description Enable reasoning/thinking mode.
3116
+ * @default false
3117
+ */
3118
+ ENABLE_THINKING: boolean;
2915
3119
  /**
2916
3120
  * Model Name
2917
3121
  * @description The name of the non-reasoning model to be used.
@@ -3081,6 +3285,12 @@ interface components {
3081
3285
  * @enum {string}
3082
3286
  */
3083
3287
  API_TYPE: 'local' | 'remote';
3288
+ /**
3289
+ * Enable Thinking
3290
+ * @description Enable reasoning/thinking mode.
3291
+ * @default false
3292
+ */
3293
+ ENABLE_THINKING: boolean;
3084
3294
  /**
3085
3295
  * Model Name
3086
3296
  * @description The name of the non-reasoning model to be used.
@@ -3188,6 +3398,83 @@ interface components {
3188
3398
  /** Status Details */
3189
3399
  status_details?: string | null;
3190
3400
  };
3401
+ /**
3402
+ * FilterPlanLLMConfig
3403
+ * @description Configuration for FilterPlanLLM — pre-agentic context selector.
3404
+ *
3405
+ * Runs before the agent loop to select relevant history messages and documents,
3406
+ * plus produce a concise goal statement that primes the agent.
3407
+ * Always uses the fast model (LLM_MODEL_NAME). In auto mode, also recommends
3408
+ * a model tier (fast/wise/premium) for the agent loop.
3409
+ */
3410
+ FilterPlanLLMConfig: {
3411
+ /**
3412
+ * Api Type
3413
+ * @description The inference type (local or remote).
3414
+ * @default remote
3415
+ * @enum {string}
3416
+ */
3417
+ API_TYPE: 'local' | 'remote';
3418
+ /**
3419
+ * Enable Thinking
3420
+ * @description Enable reasoning/thinking mode.
3421
+ * @default false
3422
+ */
3423
+ ENABLE_THINKING: boolean;
3424
+ /**
3425
+ * Model Name
3426
+ * @description The name of the non-reasoning model to be used.
3427
+ * @default Fast
3428
+ */
3429
+ MODEL_NAME: string;
3430
+ /**
3431
+ * System Instruction
3432
+ * @description System prompt for the filter/plan LLM.
3433
+ * @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.
3434
+ *
3435
+ * ## Instructions
3436
+ *
3437
+ * 1. **goal**: 1-2 concise sentences describing the user's intent AND your filtering rationale. Explain what documents are needed and why. Examples:
3438
+ * - "The user is greeting the assistant. No documents are needed."
3439
+ * - "The user wants to find force majeure clauses. Only the three contracts are relevant, so I will keep only those."
3440
+ * - "The user wants a full timeline of the case. Most documents are relevant, so I will drop only the unrelated procedural orders."
3441
+ *
3442
+ * 2. **doc_filter_mode** and **doc_ids**: Select which documents the agent needs.
3443
+ * - `"keep"` mode: `doc_ids` lists the ONLY docs to keep. Everything else is dropped.
3444
+ * - `"drop"` mode: `doc_ids` lists the ONLY docs to drop. Everything else is kept.
3445
+ * - Pick whichever mode produces the **shorter `doc_ids` list**.
3446
+ * - 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.
3447
+ *
3448
+ * | Scenario | doc_filter_mode | doc_ids |
3449
+ * |----------|----------------|---------|
3450
+ * | Need ALL docs | `"drop"` | `[]` |
3451
+ * | Need NO docs | `"keep"` | `[]` |
3452
+ * | Need 3 of 100 docs | `"keep"` | `["id1","id2","id3"]` |
3453
+ * | Drop 3 of 100 docs | `"drop"` | `["id1","id2","id3"]` |
3454
+ *
3455
+ * 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.
3456
+ *
3457
+ * ## Rules
3458
+ *
3459
+ * - **Never repeat a doc ID.** Each ID must appear at most once.
3460
+ * - Before writing `doc_ids`, count how many you would keep vs drop, then pick the shorter list.
3461
+ * - 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 `[]`.
3462
+ * - Ambiguous references like "the document" or "this contract" without specifying which: keep all → `"drop"` with `[]`.
3463
+ * - For follow-up questions, include history messages that establish the topic.
3464
+ * - Always return valid JSON matching the schema.
3465
+ */
3466
+ SYSTEM_INSTRUCTION: string;
3467
+ /**
3468
+ * Temperature
3469
+ * @default 0
3470
+ */
3471
+ TEMPERATURE: number;
3472
+ /**
3473
+ * Max Tokens
3474
+ * @default 3000
3475
+ */
3476
+ MAX_TOKENS: number;
3477
+ };
3191
3478
  /**
3192
3479
  * GenerateAnnotationsRequest
3193
3480
  * @description Request to generate AI annotations for documents using tag instructions.
@@ -3219,67 +3506,6 @@ interface components {
3219
3506
  */
3220
3507
  tag_ext_ids: string[];
3221
3508
  };
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
3509
  /**
3284
3510
  * GetTableOfContentsDetail
3285
3511
  * @description Detail for a get_table_of_contents tool call.
@@ -3292,15 +3518,10 @@ interface components {
3292
3518
  */
3293
3519
  tool: 'get_table_of_contents';
3294
3520
  /**
3295
- * Doc Count
3296
- * @description Number of documents requested
3297
- */
3298
- doc_count: number;
3299
- /**
3300
- * Doc Ext Ids
3301
- * @description Document external IDs
3521
+ * Doc Ext Id
3522
+ * @description Document external ID
3302
3523
  */
3303
- doc_ext_ids: string[];
3524
+ doc_ext_id: string;
3304
3525
  /**
3305
3526
  * Label
3306
3527
  * @description Display label for the tool step
@@ -3362,23 +3583,24 @@ interface components {
3362
3583
  };
3363
3584
  /**
3364
3585
  * LoginRequest
3365
- * @description Unified login request (local and SSO).
3586
+ * @description Unified login request for users and agents.
3366
3587
  *
3367
3588
  * For local users: email + signature + timestamp
3368
3589
  * For SSO users: email + signature + timestamp + sso_token
3590
+ * For agents: agent_ext_id + signature + timestamp
3591
+ *
3592
+ * Exactly one of ``email`` or ``agent_ext_id`` must be provided.
3369
3593
  *
3370
3594
  * Authentication flow:
3371
- * 1. Client derives Ed25519 keypair from password
3372
- * 2. Client signs "email|timestamp" with Ed25519 private key
3595
+ * 1. Client derives Ed25519 keypair from password (users) or has stored key (agents)
3596
+ * 2. Client signs "identity|timestamp" with Ed25519 private key
3373
3597
  * 3. Server verifies signature using stored Ed25519 public key
3374
- * 4. Server derives X25519 from Ed25519 for session key encryption
3375
3598
  */
3376
3599
  LoginRequest: {
3377
- /**
3378
- * Email
3379
- * Format: email
3380
- */
3381
- email: string;
3600
+ /** Email */
3601
+ email?: string | null;
3602
+ /** Agent Ext Id */
3603
+ agent_ext_id?: string | null;
3382
3604
  /** Signature */
3383
3605
  signature: string;
3384
3606
  /** Timestamp */
@@ -3388,9 +3610,9 @@ interface components {
3388
3610
  };
3389
3611
  /**
3390
3612
  * LoginResponse
3391
- * @description Login response with access token, session key, and user info.
3613
+ * @description Login response with access token, session key, user info, and workspaces.
3392
3614
  *
3393
- * Used by: /user/login
3615
+ * Used by: /user/login, /user/token (claim agent session)
3394
3616
  */
3395
3617
  LoginResponse: {
3396
3618
  /** Access Token */
@@ -3398,6 +3620,13 @@ interface components {
3398
3620
  /** Session Key */
3399
3621
  session_key: string;
3400
3622
  user: components['schemas']['UserResponse'];
3623
+ /**
3624
+ * Workspaces
3625
+ * @default []
3626
+ */
3627
+ workspaces: {
3628
+ [key: string]: unknown;
3629
+ }[];
3401
3630
  };
3402
3631
  /** LogoutResponse */
3403
3632
  LogoutResponse: {
@@ -3434,6 +3663,12 @@ interface components {
3434
3663
  * @enum {string}
3435
3664
  */
3436
3665
  API_TYPE: 'local' | 'remote';
3666
+ /**
3667
+ * Enable Thinking
3668
+ * @description Enable reasoning/thinking mode.
3669
+ * @default false
3670
+ */
3671
+ ENABLE_THINKING: boolean;
3437
3672
  /**
3438
3673
  * Model Name
3439
3674
  * @description The model for memory synthesis. Defaults to reasoning model.
@@ -3712,6 +3947,12 @@ interface components {
3712
3947
  * @default 5
3713
3948
  */
3714
3949
  MAX_NUMB_CITATIONS: number;
3950
+ /**
3951
+ * Citation Instruction
3952
+ * @description Instruction for the <Instruct> tag when scoring chunks for citation attribution.
3953
+ * @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
3954
+ */
3955
+ CITATION_INSTRUCTION: string;
3715
3956
  };
3716
3957
  /** ModelCitationTool */
3717
3958
  ModelCitationTool: {
@@ -3833,7 +4074,7 @@ interface components {
3833
4074
  * Type is self-descriptive, no need to parse content field.
3834
4075
  * @enum {string}
3835
4076
  */
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';
4077
+ 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
4078
  /**
3838
4079
  * NotificationUpdate
3839
4080
  * @description Single notification update for bulk PATCH.
@@ -4028,6 +4269,12 @@ interface components {
4028
4269
  * @enum {string}
4029
4270
  */
4030
4271
  API_TYPE: 'local' | 'remote';
4272
+ /**
4273
+ * Enable Thinking
4274
+ * @description Enable reasoning/thinking mode.
4275
+ * @default true
4276
+ */
4277
+ ENABLE_THINKING: boolean;
4031
4278
  /**
4032
4279
  * Model Name
4033
4280
  * @description The model for plan generation. Defaults to reasoning model.
@@ -4040,8 +4287,8 @@ interface components {
4040
4287
  * @default You are a research planning assistant. Your job is to analyze a user query and produce a concise, numbered research plan.
4041
4288
  *
4042
4289
  * 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
4290
+ * - search_inside_documents: Search workspace documents for relevant passages (semantic, keyword, or hybrid). Use digest=true to extract learnings.
4291
+ * - read_document: Read page ranges or entire documents. Use digest=true to extract learnings with citations.
4045
4292
  * - get_table_of_contents: Get document headings with page references
4046
4293
  *
4047
4294
  * Consider:
@@ -4141,6 +4388,12 @@ interface components {
4141
4388
  * @enum {string}
4142
4389
  */
4143
4390
  API_TYPE: 'local' | 'remote';
4391
+ /**
4392
+ * Enable Thinking
4393
+ * @description Enable reasoning/thinking mode.
4394
+ * @default false
4395
+ */
4396
+ ENABLE_THINKING: boolean;
4144
4397
  /**
4145
4398
  * Model Name
4146
4399
  * @description The model for query answering.
@@ -4172,6 +4425,50 @@ interface components {
4172
4425
  */
4173
4426
  MAX_TOKENS: number;
4174
4427
  };
4428
+ /**
4429
+ * ReadDocumentDetail
4430
+ * @description Detail for a read_document tool call.
4431
+ */
4432
+ ReadDocumentDetail: {
4433
+ /**
4434
+ * Tool
4435
+ * @default read_document
4436
+ * @constant
4437
+ */
4438
+ tool: 'read_document';
4439
+ /**
4440
+ * Doc Ext Id
4441
+ * @description Document external ID
4442
+ */
4443
+ doc_ext_id: string;
4444
+ /**
4445
+ * Range Count
4446
+ * @description Number of page ranges requested (0 = full document)
4447
+ */
4448
+ range_count: number;
4449
+ /**
4450
+ * Digest
4451
+ * @description Whether learnings extraction was requested
4452
+ */
4453
+ digest: boolean;
4454
+ /**
4455
+ * Label
4456
+ * @description Display label for the tool step
4457
+ * @default Reading document
4458
+ */
4459
+ label: string;
4460
+ /**
4461
+ * Icon
4462
+ * @description Lucide icon name for the tool step
4463
+ * @default file-text
4464
+ */
4465
+ icon: string;
4466
+ /**
4467
+ * Summary
4468
+ * @description Human-readable summary (e.g. 'Reading {doc-abc12345} pp. 5–10')
4469
+ */
4470
+ summary?: string | null;
4471
+ };
4175
4472
  /**
4176
4473
  * ReadUrlDetail
4177
4474
  * @description Detail for a read_url tool call.
@@ -4226,7 +4523,7 @@ interface components {
4226
4523
  };
4227
4524
  /**
4228
4525
  * RemoveWorkspaceUserItem
4229
- * @description A user to remove from a workspace.
4526
+ * @description A user or agent to remove from a workspace.
4230
4527
  */
4231
4528
  RemoveWorkspaceUserItem: {
4232
4529
  /** User Ext Id */
@@ -4273,6 +4570,12 @@ interface components {
4273
4570
  * @enum {string}
4274
4571
  */
4275
4572
  API_TYPE: 'local' | 'remote';
4573
+ /**
4574
+ * Retrieval Instruction
4575
+ * @description Instruction for the <Instruct> tag when reranking retrieval results against a user query.
4576
+ * @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
4577
+ */
4578
+ RETRIEVAL_INSTRUCTION: string;
4276
4579
  };
4277
4580
  /**
4278
4581
  * ResponseCompleteMessage
@@ -4886,7 +5189,7 @@ interface components {
4886
5189
  /**
4887
5190
  * Min Retrieval Sim Score
4888
5191
  * @description Minimum similarity score for retrieval of a chunk.
4889
- * @default 0.3
5192
+ * @default 0.1
4890
5193
  */
4891
5194
  MIN_RETRIEVAL_SIM_SCORE: number;
4892
5195
  /**
@@ -4912,6 +5215,12 @@ interface components {
4912
5215
  * @default semantic
4913
5216
  */
4914
5217
  SEARCH_MODE: components['schemas']['SearchMode'];
5218
+ /**
5219
+ * Hybrid Prefetch Limit
5220
+ * @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.
5221
+ * @default 500
5222
+ */
5223
+ HYBRID_PREFETCH_LIMIT: number;
4915
5224
  /**
4916
5225
  * Hybrid Dense Weight
4917
5226
  * @description Weight for dense vectors in hybrid mode
@@ -4924,12 +5233,6 @@ interface components {
4924
5233
  * @default 0.3
4925
5234
  */
4926
5235
  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
5236
  };
4934
5237
  /**
4935
5238
  * ReviewLLMConfig
@@ -4943,6 +5246,12 @@ interface components {
4943
5246
  * @enum {string}
4944
5247
  */
4945
5248
  API_TYPE: 'local' | 'remote';
5249
+ /**
5250
+ * Enable Thinking
5251
+ * @description Enable reasoning/thinking mode.
5252
+ * @default false
5253
+ */
5254
+ ENABLE_THINKING: boolean;
4946
5255
  /**
4947
5256
  * Model Name
4948
5257
  * @description The model for reviewing agent draft answers. Defaults to reasoning model.
@@ -5068,11 +5377,10 @@ interface components {
5068
5377
  output_tokens_details?: components['schemas']['OutputTokensDetails'] | null;
5069
5378
  context_usage?: components['schemas']['ContextUsage'] | null;
5070
5379
  message_metadata?: components['schemas']['MessageMetadataPayload'] | null;
5071
- detail_search_documents?: components['schemas']['SearchDocumentsDetail'] | null;
5072
- detail_get_document_passages?: components['schemas']['GetDocumentPassagesDetail'] | null;
5380
+ detail_search_inside_documents?: components['schemas']['SearchInsideDocumentsDetail'] | null;
5381
+ detail_read_document?: components['schemas']['ReadDocumentDetail'] | null;
5073
5382
  detail_get_table_of_contents?: components['schemas']['GetTableOfContentsDetail'] | null;
5074
5383
  detail_view_document_pages?: components['schemas']['ViewDocumentPagesDetail'] | null;
5075
- detail_get_full_document?: components['schemas']['GetFullDocumentDetail'] | null;
5076
5384
  detail_web_search?: components['schemas']['WebSearchDetail'] | null;
5077
5385
  detail_personal_agent?: components['schemas']['PersonalAgentDetail'] | null;
5078
5386
  detail_read_url?: components['schemas']['ReadUrlDetail'] | null;
@@ -5189,16 +5497,16 @@ interface components {
5189
5497
  title: string;
5190
5498
  };
5191
5499
  /**
5192
- * SearchDocumentsDetail
5193
- * @description Detail for a search_documents tool call.
5500
+ * SearchInsideDocumentsDetail
5501
+ * @description Detail for a search_inside_documents tool call.
5194
5502
  */
5195
- SearchDocumentsDetail: {
5503
+ SearchInsideDocumentsDetail: {
5196
5504
  /**
5197
5505
  * Tool
5198
- * @default search_documents
5506
+ * @default search_inside_documents
5199
5507
  * @constant
5200
5508
  */
5201
- tool: 'search_documents';
5509
+ tool: 'search_inside_documents';
5202
5510
  /**
5203
5511
  * Query
5204
5512
  * @description Search query (truncated to 80 chars)
@@ -5257,6 +5565,34 @@ interface components {
5257
5565
  [key: string]: unknown;
5258
5566
  } | null;
5259
5567
  };
5568
+ /**
5569
+ * SessionInfoResponse
5570
+ * @description Active session info returned by GET /user/sessions.
5571
+ */
5572
+ SessionInfoResponse: {
5573
+ /** Session Id */
5574
+ session_id: string;
5575
+ /** External Id */
5576
+ external_id?: string | null;
5577
+ /** Name */
5578
+ name?: string | null;
5579
+ /** Ip Address */
5580
+ ip_address?: string | null;
5581
+ /** Active Workspace */
5582
+ active_workspace?: string | null;
5583
+ /**
5584
+ * Workspaces
5585
+ * @default []
5586
+ */
5587
+ workspaces: string[];
5588
+ /**
5589
+ * Status
5590
+ * @default user
5591
+ */
5592
+ status: string;
5593
+ /** Ttl */
5594
+ ttl: number;
5595
+ };
5260
5596
  /** ShareConversationResponse */
5261
5597
  ShareConversationResponse: {
5262
5598
  /**
@@ -5378,6 +5714,12 @@ interface components {
5378
5714
  * @enum {string}
5379
5715
  */
5380
5716
  API_TYPE: 'local' | 'remote';
5717
+ /**
5718
+ * Enable Thinking
5719
+ * @description Enable reasoning/thinking mode.
5720
+ * @default false
5721
+ */
5722
+ ENABLE_THINKING: boolean;
5381
5723
  /**
5382
5724
  * Model Name
5383
5725
  * @description The model for conversation summarisation. Defaults to reasoning model.
@@ -5556,6 +5898,12 @@ interface components {
5556
5898
  * @enum {string}
5557
5899
  */
5558
5900
  API_TYPE: 'local' | 'remote';
5901
+ /**
5902
+ * Enable Thinking
5903
+ * @description Enable reasoning/thinking mode.
5904
+ * @default false
5905
+ */
5906
+ ENABLE_THINKING: boolean;
5559
5907
  /**
5560
5908
  * Model Name
5561
5909
  * @description The name of the non-reasoning model to be used.
@@ -5798,9 +6146,10 @@ interface components {
5798
6146
  };
5799
6147
  /**
5800
6148
  * UpdateWorkspaceUserRolesRequest
5801
- * @description Request to update user roles in a workspace (PATCH /workspace/{id}/users).
6149
+ * @description Request to update user or agent roles in a workspace (PATCH /workspace/{id}/users).
5802
6150
  *
5803
- * All specified users are updated to the same role.
6151
+ * All specified users/agents are updated to the same role.
6152
+ * Accepts both usr-XXXXXXXX and agt-XXXXXXXX external IDs.
5804
6153
  */
5805
6154
  UpdateWorkspaceUserRolesRequest: {
5806
6155
  /** User Ext Ids */
@@ -5934,16 +6283,19 @@ interface components {
5934
6283
  * @description Standard user representation used across all endpoints.
5935
6284
  *
5936
6285
  * Used for: login response, workspace users, contacts (when registered).
6286
+ * Agents have agt- prefix and may have nullable name/email fields.
5937
6287
  */
5938
6288
  UserResponse: {
5939
6289
  /** External Id */
5940
6290
  external_id: string;
6291
+ /** Parent Ext Id */
6292
+ parent_ext_id?: string | null;
5941
6293
  /** Email */
5942
6294
  email: string;
5943
6295
  /** Given Name */
5944
6296
  given_name: string;
5945
6297
  /** Family Name */
5946
- family_name: string;
6298
+ family_name?: string | null;
5947
6299
  /** Picture */
5948
6300
  picture?: string | null;
5949
6301
  /** Encryption Public Key */
@@ -6017,6 +6369,11 @@ interface components {
6017
6369
  * @default false
6018
6370
  */
6019
6371
  show_pa_mode: boolean;
6372
+ /**
6373
+ * Show Agent Sessions
6374
+ * @default false
6375
+ */
6376
+ show_agent_sessions: boolean;
6020
6377
  /**
6021
6378
  * Hide Online Status
6022
6379
  * @default false
@@ -6061,6 +6418,8 @@ interface components {
6061
6418
  show_templates?: boolean | null;
6062
6419
  /** Show Pa Mode */
6063
6420
  show_pa_mode?: boolean | null;
6421
+ /** Show Agent Sessions */
6422
+ show_agent_sessions?: boolean | null;
6064
6423
  /** Hide Online Status */
6065
6424
  hide_online_status?: boolean | null;
6066
6425
  /** Muted Users */
@@ -6123,7 +6482,7 @@ interface components {
6123
6482
  * VisionLLMConfig
6124
6483
  * @description Configuration for VisionLLM — visually inspects document pages.
6125
6484
  *
6126
- * Used as a targeted fallback when text extraction (get_document_passages)
6485
+ * Used as a targeted fallback when text extraction (read_document)
6127
6486
  * is insufficient, e.g. for figures, charts, tables, scanned pages.
6128
6487
  * The prompt is constructed dynamically per call (no system instruction).
6129
6488
  */
@@ -6135,6 +6494,12 @@ interface components {
6135
6494
  * @enum {string}
6136
6495
  */
6137
6496
  API_TYPE: 'local' | 'remote';
6497
+ /**
6498
+ * Enable Thinking
6499
+ * @description Enable reasoning/thinking mode.
6500
+ * @default false
6501
+ */
6502
+ ENABLE_THINKING: boolean;
6138
6503
  /**
6139
6504
  * Model Name
6140
6505
  * @description The vision-capable model name (must support image inputs).
@@ -6232,22 +6597,25 @@ interface components {
6232
6597
  * @default false
6233
6598
  */
6234
6599
  is_public: boolean;
6600
+ /** Workspace Key */
6601
+ workspace_key: string;
6235
6602
  };
6236
6603
  /**
6237
6604
  * WorkspaceOpenRequest
6238
- * @description Request to open a workspace and get a workspace-scoped JWT.
6605
+ * @description Request to open a workspace stores encrypted key in session and sets active.
6606
+ *
6607
+ * workspace_key is required for users (SealedBox-encrypted with session public key).
6608
+ * Agents omit it — their workspace keys are pre-populated via /agent-session.
6239
6609
  */
6240
6610
  WorkspaceOpenRequest: {
6241
6611
  /** Workspace Key */
6242
- workspace_key: string;
6612
+ workspace_key?: string | null;
6243
6613
  };
6244
6614
  /**
6245
6615
  * WorkspaceOpenResponse
6246
- * @description Response from opening a workspace — includes workspace-scoped JWT and workspace data.
6616
+ * @description Response from opening a workspace — workspace data (no new JWT).
6247
6617
  */
6248
6618
  WorkspaceOpenResponse: {
6249
- /** Access Token */
6250
- access_token: string;
6251
6619
  workspace: components['schemas']['WorkspaceResponse'];
6252
6620
  /** Conversations */
6253
6621
  conversations: components['schemas']['ConversationResponse'][];
@@ -6330,7 +6698,9 @@ interface components {
6330
6698
  };
6331
6699
  /**
6332
6700
  * WorkspaceUserResponse
6333
- * @description User with their role in a workspace.
6701
+ * @description User (or agent) with their role in a workspace.
6702
+ *
6703
+ * For agents: agent_ext_id is set (agt-XXXXXXXX), name is user.given_name.
6334
6704
  */
6335
6705
  WorkspaceUserResponse: {
6336
6706
  user: components['schemas']['UserResponse'];
@@ -6350,6 +6720,8 @@ interface components {
6350
6720
  * @default 0
6351
6721
  */
6352
6722
  document_count: number;
6723
+ /** Agent Ext Id */
6724
+ agent_ext_id?: string | null;
6353
6725
  };
6354
6726
  };
6355
6727
  responses: never;
@@ -6596,6 +6968,127 @@ interface operations {
6596
6968
  };
6597
6969
  };
6598
6970
  };
6971
+ list_agents: {
6972
+ parameters: {
6973
+ query?: never;
6974
+ header?: never;
6975
+ path?: never;
6976
+ cookie?: never;
6977
+ };
6978
+ requestBody?: never;
6979
+ responses: {
6980
+ /** @description Successful Response */
6981
+ 200: {
6982
+ headers: {
6983
+ [name: string]: unknown;
6984
+ };
6985
+ content: {
6986
+ 'application/json': components['schemas']['UserResponse'][];
6987
+ };
6988
+ };
6989
+ };
6990
+ };
6991
+ delete_agents: {
6992
+ parameters: {
6993
+ query?: never;
6994
+ header?: never;
6995
+ path?: never;
6996
+ cookie?: never;
6997
+ };
6998
+ requestBody: {
6999
+ content: {
7000
+ 'application/json': components['schemas']['DeleteAgentsRequest'];
7001
+ };
7002
+ };
7003
+ responses: {
7004
+ /** @description Successful Response */
7005
+ 200: {
7006
+ headers: {
7007
+ [name: string]: unknown;
7008
+ };
7009
+ content: {
7010
+ 'application/json': {
7011
+ [key: string]: unknown;
7012
+ };
7013
+ };
7014
+ };
7015
+ /** @description Validation Error */
7016
+ 422: {
7017
+ headers: {
7018
+ [name: string]: unknown;
7019
+ };
7020
+ content: {
7021
+ 'application/json': components['schemas']['HTTPValidationError'];
7022
+ };
7023
+ };
7024
+ };
7025
+ };
7026
+ authorize_session: {
7027
+ parameters: {
7028
+ query?: never;
7029
+ header?: never;
7030
+ path?: never;
7031
+ cookie?: never;
7032
+ };
7033
+ requestBody: {
7034
+ content: {
7035
+ 'application/json': components['schemas']['AuthorizeRequest'];
7036
+ };
7037
+ };
7038
+ responses: {
7039
+ /** @description Successful Response */
7040
+ 200: {
7041
+ headers: {
7042
+ [name: string]: unknown;
7043
+ };
7044
+ content: {
7045
+ 'application/json': components['schemas']['AuthorizeResponse'];
7046
+ };
7047
+ };
7048
+ /** @description Validation Error */
7049
+ 422: {
7050
+ headers: {
7051
+ [name: string]: unknown;
7052
+ };
7053
+ content: {
7054
+ 'application/json': components['schemas']['HTTPValidationError'];
7055
+ };
7056
+ };
7057
+ };
7058
+ };
7059
+ claim_agent_session: {
7060
+ parameters: {
7061
+ query?: never;
7062
+ header?: never;
7063
+ path?: never;
7064
+ cookie?: never;
7065
+ };
7066
+ requestBody: {
7067
+ content: {
7068
+ 'application/json': components['schemas']['AgentSessionClaimRequest'];
7069
+ };
7070
+ };
7071
+ responses: {
7072
+ /** @description Successful Response */
7073
+ 200: {
7074
+ headers: {
7075
+ [name: string]: unknown;
7076
+ };
7077
+ content: {
7078
+ 'application/json': components['schemas']['LoginResponse'];
7079
+ };
7080
+ };
7081
+ /** @description Validation Error */
7082
+ 422: {
7083
+ headers: {
7084
+ [name: string]: unknown;
7085
+ };
7086
+ content: {
7087
+ 'application/json': components['schemas']['HTTPValidationError'];
7088
+ };
7089
+ };
7090
+ };
7091
+ };
6599
7092
  logout: {
6600
7093
  parameters: {
6601
7094
  query?: {
@@ -6628,6 +7121,26 @@ interface operations {
6628
7121
  };
6629
7122
  };
6630
7123
  };
7124
+ list_sessions: {
7125
+ parameters: {
7126
+ query?: never;
7127
+ header?: never;
7128
+ path?: never;
7129
+ cookie?: never;
7130
+ };
7131
+ requestBody?: never;
7132
+ responses: {
7133
+ /** @description Successful Response */
7134
+ 200: {
7135
+ headers: {
7136
+ [name: string]: unknown;
7137
+ };
7138
+ content: {
7139
+ 'application/json': components['schemas']['SessionInfoResponse'][];
7140
+ };
7141
+ };
7142
+ };
7143
+ };
6631
7144
  change_password: {
6632
7145
  parameters: {
6633
7146
  query?: never;
@@ -8634,22 +9147,9 @@ interface operations {
8634
9147
  interface TokenProvider {
8635
9148
  getAccessToken(): string | null;
8636
9149
  }
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
9150
  interface BearerAuthMiddlewareConfig {
8647
9151
  tokenProvider: TokenProvider;
8648
9152
  }
8649
- interface WorkspaceKeyMiddlewareConfig {
8650
- workspaceKeyProvider: WorkspaceKeyProvider;
8651
- urlConfig: WorkspaceKeyUrlConfig;
8652
- }
8653
9153
  type ReloginHandler = () => Promise<string | null>;
8654
9154
  interface AutoReloginMiddlewareConfig {
8655
9155
  reloginHandler: ReloginHandler;
@@ -8672,7 +9172,7 @@ interface CryptoProvider {
8672
9172
  signMessage(message: string, privateKey: Uint8Array): string;
8673
9173
  deriveEncryptionKeypair(signingKeyPair: KeyPair$1): KeyPair$1;
8674
9174
  sealedBoxDecrypt(encryptedBase64: string, privateKey: Uint8Array): Uint8Array;
8675
- createWorkspaceKeyHeader(workspaceKey: Uint8Array, serverSessionKey: Uint8Array): Promise<string>;
9175
+ sealKeyForSession(workspaceKey: Uint8Array, serverSessionKey: Uint8Array): Promise<string>;
8676
9176
  fromBase64(base64: string): Uint8Array;
8677
9177
  }
8678
9178
  interface SessionKeys {
@@ -8694,8 +9194,6 @@ interface AuthStateProvider {
8694
9194
  };
8695
9195
  getSelectedWorkspaceId(): string | null;
8696
9196
  setAccessToken(token: string): void;
8697
- clearWorkspaceHeaders(): void;
8698
- setCachedWorkspaceHeader(workspaceId: string, header: string): void;
8699
9197
  }
8700
9198
  interface SsoTokenProvider {
8701
9199
  getToken(): Promise<string | null>;
@@ -8723,11 +9221,11 @@ interface WorkspaceKeyRefreshProvider {
8723
9221
  getWrappedKey(accessToken: string, workspaceId: string): Promise<string | null>;
8724
9222
  }
8725
9223
  /**
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.
9224
+ * Opens a workspace by calling the /open endpoint to store keys on session.
9225
+ * Returns true on success, null on failure.
8728
9226
  */
8729
9227
  interface WorkspaceOpenProvider {
8730
- openWorkspace(accessToken: string, workspaceId: string, encryptedWorkspaceKey: string): Promise<string | null>;
9228
+ openWorkspace(accessToken: string, workspaceId: string, encryptedWorkspaceKey: string): Promise<boolean | null>;
8731
9229
  }
8732
9230
  type OnReloginSuccess = (data: {
8733
9231
  email: string;
@@ -8750,7 +9248,7 @@ interface ReloginDeps {
8750
9248
  * SessionManager - In-memory session state for SDK consumers
8751
9249
  *
8752
9250
  * Replaces Zustand for SDK consumers. Simple in-memory store with subscribe pattern.
8753
- * Implements TokenProvider, WorkspaceKeyProvider, and AuthStateProvider —
9251
+ * Implements TokenProvider and AuthStateProvider —
8754
9252
  * plugs directly into middleware and relogin handler without any framework.
8755
9253
  */
8756
9254
 
@@ -8759,7 +9257,6 @@ interface SessionState {
8759
9257
  userEmail: string | null;
8760
9258
  userExtId: string | null;
8761
9259
  selectedWorkspaceId: string | null;
8762
- cachedWorkspaceHeaders: Record<string, string>;
8763
9260
  isSsoMode: boolean;
8764
9261
  isAuth0Authenticated: boolean;
8765
9262
  auth0AccessToken: string | null;
@@ -8769,9 +9266,6 @@ interface SessionManager {
8769
9266
  setAccessToken(token: string | null): void;
8770
9267
  setUser(email: string, extId?: string): void;
8771
9268
  setSelectedWorkspace(id: string | null): void;
8772
- setCachedWorkspaceHeader(workspaceId: string, header: string): void;
8773
- clearWorkspaceHeaders(): void;
8774
- getWorkspaceKeyHeader(): string | null;
8775
9269
  setSsoState(opts: Partial<{
8776
9270
  isSsoMode: boolean;
8777
9271
  isAuth0Authenticated: boolean;
@@ -8845,9 +9339,10 @@ declare function generateKeyPairs(username: string, password: string, deployment
8845
9339
  */
8846
9340
  declare function signMessage(message: string, privateKey: Uint8Array): string;
8847
9341
  /**
8848
- * Create Workspace-Key header for API requests using SealedBox
9342
+ * Seal a workspace key with the session's X25519 public key (SealedBox).
9343
+ * The result is sent to the backend in the /open request body.
8849
9344
  */
8850
- declare function createWorkspaceKeyHeader(workspaceKey: Uint8Array, serverSessionPublicKey: Uint8Array): Promise<string>;
9345
+ declare function sealKeyForSession(workspaceKey: Uint8Array, serverSessionPublicKey: Uint8Array): Promise<string>;
8851
9346
  /**
8852
9347
  * Decrypt data using SealedBox (anonymous decryption).
8853
9348
  *
@@ -8874,6 +9369,11 @@ declare function derivePublicKey(privateKey: Uint8Array): Uint8Array;
8874
9369
  * Used when we have stored Ed25519 keys and need X25519 for encryption
8875
9370
  */
8876
9371
  declare function deriveEncryptionKeypairFromSigning(signingKeyPair: KeyPair): KeyPair;
9372
+ /**
9373
+ * Generate a random Ed25519 signing keypair.
9374
+ * Used for agent accounts that don't derive keys from a password.
9375
+ */
9376
+ declare function generateRandomSigningKeypair(): KeyPair;
8877
9377
  /**
8878
9378
  * Precompute shared secret for ECDH encryption.
8879
9379
  *
@@ -9171,6 +9671,8 @@ interface LoginWithKeyParams {
9171
9671
  interface LoginResult {
9172
9672
  accessToken: string;
9173
9673
  userExtId?: string;
9674
+ /** Owner's ext_id for agent accounts; null/undefined for human users */
9675
+ parentExtId?: string | null;
9174
9676
  signingPrivateKey: Uint8Array;
9175
9677
  serverSessionKey: Uint8Array;
9176
9678
  }
@@ -9211,8 +9713,6 @@ interface ArbiClientOptions {
9211
9713
  baseUrl: string;
9212
9714
  /** Deployment domain used for deterministic key derivation (e.g. "mydeployment.com") */
9213
9715
  deploymentDomain: string;
9214
- /** Optional custom URL patterns for workspace key injection */
9215
- workspaceKeyUrlConfig?: WorkspaceKeyUrlConfig;
9216
9716
  /** URL patterns that should never trigger re-login */
9217
9717
  reloginExcludePatterns?: string[];
9218
9718
  /** Include credentials (cookies) in requests. Default: true */
@@ -9251,8 +9751,9 @@ interface ArbiClient {
9251
9751
  signMessage: typeof signMessage;
9252
9752
  sealedBoxDecrypt: typeof sealedBoxDecrypt;
9253
9753
  sealedBoxEncrypt: typeof sealedBoxEncrypt;
9254
- createWorkspaceKeyHeader: typeof createWorkspaceKeyHeader;
9754
+ sealKeyForSession: typeof sealKeyForSession;
9255
9755
  deriveEncryptionKeypairFromSigning: typeof deriveEncryptionKeypairFromSigning;
9756
+ generateRandomSigningKeypair: typeof generateRandomSigningKeypair;
9256
9757
  derivePublicKey: typeof derivePublicKey;
9257
9758
  base64ToBytes: typeof base64ToBytes;
9258
9759
  bytesToBase64: typeof bytesToBase64;
@@ -9280,19 +9781,6 @@ declare function createArbiClient(options: ArbiClientOptions): ArbiClient;
9280
9781
 
9281
9782
  declare function createBearerAuthMiddleware(config: BearerAuthMiddlewareConfig): Middleware;
9282
9783
 
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
9784
  /**
9297
9785
  * Auto Re-login Middleware
9298
9786
  *
@@ -9373,4 +9861,4 @@ declare function isMessageType<T extends WebSocketServerMessage>(msg: WebSocketS
9373
9861
  */
9374
9862
  declare function createReloginHandler(deps: ReloginDeps): () => Promise<string | null>;
9375
9863
 
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 };
9864
+ 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 };