@arbidocs/client 0.3.18 → 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.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"}
@@ -1479,6 +1590,16 @@ interface components {
1479
1590
  * @description Lifecycle step (planning, answering, reviewing). Absent for tool calls.
1480
1591
  */
1481
1592
  step?: string | null;
1593
+ /**
1594
+ * Label
1595
+ * @description Display label for the step. Backend-driven, no frontend mapping needed.
1596
+ */
1597
+ label?: string | null;
1598
+ /**
1599
+ * Icon
1600
+ * @description Lucide icon name for the step (e.g. 'search'). Backend-driven, no frontend mapping needed.
1601
+ */
1602
+ icon?: string | null;
1482
1603
  /**
1483
1604
  * Focus
1484
1605
  * @description Agent's current focus (single sentence). Present on tool call steps.
@@ -1498,8 +1619,33 @@ interface components {
1498
1619
  }[] | null;
1499
1620
  /** @description Token usage for the LLM call in this step. */
1500
1621
  usage?: components['schemas']['StepUsage'] | null;
1622
+ /**
1623
+ * Total Tokens
1624
+ * @description Cumulative total tokens across all steps in the agent loop.
1625
+ */
1626
+ total_tokens?: number | null;
1627
+ /**
1628
+ * Step Tokens
1629
+ * @description Per-step token cost (input + output + reasoning) for the LLM call that produced this step.
1630
+ */
1631
+ step_tokens?: number | null;
1501
1632
  /** @description Token budget context snapshot. Present when retrieval counts change. */
1502
1633
  context?: components['schemas']['TokenBudgetContext'] | null;
1634
+ /**
1635
+ * Outcome
1636
+ * @description Tool execution outcome (e.g. '15 chunks retrieved'). Sent as a follow-up event with the same index after tool execution.
1637
+ */
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;
1503
1649
  };
1504
1650
  /**
1505
1651
  * AgentsConfig
@@ -1552,18 +1698,6 @@ interface components {
1552
1698
  * @default false
1553
1699
  */
1554
1700
  VISION_ENABLED: boolean;
1555
- /**
1556
- * Doc Index Compact Threshold
1557
- * @description When the workspace has more documents than this, omit the Subject column from the document index to save tokens.
1558
- * @default 20
1559
- */
1560
- DOC_INDEX_COMPACT_THRESHOLD: number;
1561
- /**
1562
- * Doc Index Skip Threshold
1563
- * @description When the workspace has more documents than this, omit the document index entirely. The agent discovers documents via search_documents instead.
1564
- * @default 200
1565
- */
1566
- DOC_INDEX_SKIP_THRESHOLD: number;
1567
1701
  /**
1568
1702
  * Personal Agent
1569
1703
  * @description Enable the personal_agent tool for delegating tasks to an external agent via OpenClaw.
@@ -1603,7 +1737,7 @@ interface components {
1603
1737
  /**
1604
1738
  * Agent Model Name
1605
1739
  * @description The name of the model to be used for the agent decision-making.
1606
- * @default Fast
1740
+ * @default auto
1607
1741
  */
1608
1742
  AGENT_MODEL_NAME: string;
1609
1743
  /**
@@ -1625,6 +1759,12 @@ interface components {
1625
1759
  * @default 10000
1626
1760
  */
1627
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;
1628
1768
  /**
1629
1769
  * Agent Max Iterations
1630
1770
  * @description Maximum number of tool call iterations before forcing an answer.
@@ -1632,11 +1772,11 @@ interface components {
1632
1772
  */
1633
1773
  AGENT_MAX_ITERATIONS: number;
1634
1774
  /**
1635
- * Max Passage Pages
1636
- * @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.
1637
1777
  * @default 10
1638
1778
  */
1639
- MAX_PASSAGE_PAGES: number;
1779
+ AGENT_MAX_PARALLEL_TOOL_CALLS: number;
1640
1780
  /**
1641
1781
  * Agent History Char Threshold
1642
1782
  * @description Char threshold for conversation history injected into the agent context. Below: verbatim user/assistant pairs. Above: summarized by SummariseLLM.
@@ -1652,10 +1792,16 @@ interface components {
1652
1792
  *
1653
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.
1654
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
+ *
1655
1798
  * DOCUMENT STRATEGY:
1656
- * - For overview/summary requests: use get_table_of_contents first, then read key sections with get_document_passages.
1657
- * - For specific questions: use search_documents to find relevant sections, then read those sections.
1658
- * - 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.
1659
1805
  *
1660
1806
  * FORMATTING:
1661
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).
@@ -1696,28 +1842,28 @@ interface components {
1696
1842
  * "SUGGESTED_QUERIES": false,
1697
1843
  * "ARTIFACTS_ENABLED": false,
1698
1844
  * "VISION_ENABLED": false,
1699
- * "DOC_INDEX_COMPACT_THRESHOLD": 20,
1700
- * "DOC_INDEX_SKIP_THRESHOLD": 200,
1701
1845
  * "PERSONAL_AGENT": false,
1702
1846
  * "MEMORY_ENABLED": false,
1703
1847
  * "SKILLS_ENABLED": false,
1704
1848
  * "SKILL_CREATION": false,
1705
1849
  * "REVIEW_ENABLED": false,
1706
1850
  * "PERSONA": "You are ARBI, an AI assistant created by ARBI CITY. Be proactive, helpful and professional.",
1707
- * "AGENT_MODEL_NAME": "Fast",
1851
+ * "AGENT_MODEL_NAME": "auto",
1708
1852
  * "AGENT_API_TYPE": "remote",
1709
1853
  * "LLM_AGENT_TEMPERATURE": 1,
1710
1854
  * "AGENT_MAX_TOKENS": 10000,
1855
+ * "ENABLE_THINKING": false,
1711
1856
  * "AGENT_MAX_ITERATIONS": 20,
1712
- * "MAX_PASSAGE_PAGES": 10,
1857
+ * "AGENT_MAX_PARALLEL_TOOL_CALLS": 10,
1713
1858
  * "AGENT_HISTORY_CHAR_THRESHOLD": 8000,
1714
- * "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."
1715
1860
  * }
1716
1861
  */
1717
1862
  Agents: components['schemas']['AgentsConfig'];
1718
1863
  /**
1719
1864
  * @default {
1720
1865
  * "API_TYPE": "remote",
1866
+ * "ENABLE_THINKING": false,
1721
1867
  * "MODEL_NAME": "Fast",
1722
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.",
1723
1869
  * "MAX_CHAR_SIZE_TO_ANSWER": 200000,
@@ -1729,6 +1875,7 @@ interface components {
1729
1875
  /**
1730
1876
  * @default {
1731
1877
  * "API_TYPE": "remote",
1878
+ * "ENABLE_THINKING": false,
1732
1879
  * "MODEL_NAME": "Wise",
1733
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.",
1734
1881
  * "TEMPERATURE": 0.1,
@@ -1740,6 +1887,7 @@ interface components {
1740
1887
  /**
1741
1888
  * @default {
1742
1889
  * "API_TYPE": "remote",
1890
+ * "ENABLE_THINKING": false,
1743
1891
  * "MODEL_NAME": "Fast",
1744
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.",
1745
1893
  * "TEMPERATURE": 0.1,
@@ -1751,6 +1899,7 @@ interface components {
1751
1899
  /**
1752
1900
  * @default {
1753
1901
  * "API_TYPE": "remote",
1902
+ * "ENABLE_THINKING": false,
1754
1903
  * "MODEL_NAME": "Fast",
1755
1904
  * "SYSTEM_INSTRUCTION": "You are a title generator that creates concise, descriptive titles.",
1756
1905
  * "MAX_CHAR_SIZE_TO_ANSWER": 50,
@@ -1762,6 +1911,7 @@ interface components {
1762
1911
  /**
1763
1912
  * @default {
1764
1913
  * "API_TYPE": "remote",
1914
+ * "ENABLE_THINKING": false,
1765
1915
  * "MODEL_NAME": "Wise",
1766
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.",
1767
1917
  * "TEMPERATURE": 0.1,
@@ -1775,6 +1925,7 @@ interface components {
1775
1925
  /**
1776
1926
  * @default {
1777
1927
  * "API_TYPE": "remote",
1928
+ * "ENABLE_THINKING": false,
1778
1929
  * "MODEL_NAME": "Fast",
1779
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",
1780
1931
  * "MAX_CHAR_CONTEXT_TO_ANSWER": 100000,
@@ -1833,6 +1984,7 @@ interface components {
1833
1984
  /**
1834
1985
  * @default {
1835
1986
  * "API_TYPE": "remote",
1987
+ * "ENABLE_THINKING": false,
1836
1988
  * "MODEL_NAME": "Wise",
1837
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.",
1838
1990
  * "TEMPERATURE": 0.3,
@@ -1845,8 +1997,9 @@ interface components {
1845
1997
  /**
1846
1998
  * @default {
1847
1999
  * "API_TYPE": "remote",
2000
+ * "ENABLE_THINKING": true,
1848
2001
  * "MODEL_NAME": "Wise",
1849
- * "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.",
1850
2003
  * "TEMPERATURE": 0.3,
1851
2004
  * "MAX_TOKENS": 4000,
1852
2005
  * "MAX_CHAR_SIZE_TO_ANSWER": 200000,
@@ -1857,6 +2010,18 @@ interface components {
1857
2010
  /**
1858
2011
  * @default {
1859
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,
1860
2025
  * "MODEL_NAME": "Fast",
1861
2026
  * "TEMPERATURE": 0.1,
1862
2027
  * "MAX_TOKENS": 4000,
@@ -1868,6 +2033,7 @@ interface components {
1868
2033
  /**
1869
2034
  * @default {
1870
2035
  * "API_TYPE": "remote",
2036
+ * "ENABLE_THINKING": true,
1871
2037
  * "MODEL_NAME": "Premium",
1872
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.",
1873
2039
  * "TEMPERATURE": 0.2,
@@ -1880,20 +2046,21 @@ interface components {
1880
2046
  * @default {
1881
2047
  * "SIM_THREASHOLD": 0.5,
1882
2048
  * "MIN_CHAR_SIZE_TO_ANSWER": 30,
1883
- * "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"
1884
2051
  * }
1885
2052
  */
1886
2053
  ModelCitation: components['schemas']['ModelCitationConfig'];
1887
2054
  /**
1888
2055
  * @default {
1889
- * "MIN_RETRIEVAL_SIM_SCORE": 0.3,
2056
+ * "MIN_RETRIEVAL_SIM_SCORE": 0.1,
1890
2057
  * "MAX_DISTINCT_DOCUMENTS": 200,
1891
2058
  * "MAX_TOTAL_CHUNKS_TO_RETRIEVE": 400,
1892
2059
  * "GROUP_SIZE": 10000,
1893
2060
  * "SEARCH_MODE": "semantic",
2061
+ * "HYBRID_PREFETCH_LIMIT": 500,
1894
2062
  * "HYBRID_DENSE_WEIGHT": 0.7,
1895
- * "HYBRID_SPARSE_WEIGHT": 0.3,
1896
- * "HYBRID_RERANKER_WEIGHT": 0.5
2063
+ * "HYBRID_SPARSE_WEIGHT": 0.3
1897
2064
  * }
1898
2065
  */
1899
2066
  Retriever: components['schemas']['RetrieverConfig'];
@@ -1903,7 +2070,8 @@ interface components {
1903
2070
  * "MAX_NUMB_OF_CHUNKS": 30,
1904
2071
  * "MAX_CONCURRENT_REQUESTS": 64,
1905
2072
  * "MODEL_NAME": "Qwen/Qwen3-Reranker-0.6B",
1906
- * "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"
1907
2075
  * }
1908
2076
  */
1909
2077
  Reranker: components['schemas']['RerankerConfig'];
@@ -2097,6 +2265,47 @@ interface components {
2097
2265
  /** Reason */
2098
2266
  reason?: string | null;
2099
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
+ };
2100
2309
  /**
2101
2310
  * BatchCompleteMessage
2102
2311
  * @description Notification that a batch operation (upload or doctag generation) completed.
@@ -2314,6 +2523,12 @@ interface components {
2314
2523
  * @enum {string}
2315
2524
  */
2316
2525
  API_TYPE: 'local' | 'remote';
2526
+ /**
2527
+ * Enable Thinking
2528
+ * @description Enable reasoning/thinking mode.
2529
+ * @default true
2530
+ */
2531
+ ENABLE_THINKING: boolean;
2317
2532
  /**
2318
2533
  * Model Name
2319
2534
  * @description Model for code generation. Should be a strong coding model.
@@ -2592,7 +2807,7 @@ interface components {
2592
2807
  target_workspace_ext_id: string;
2593
2808
  /**
2594
2809
  * Target Workspace Key
2595
- * @description SealedBox-encrypted target workspace key (same format as WorkspaceOpenRequest.workspace_key)
2810
+ * @description SealedBox-encrypted target workspace key (encrypted with session public key)
2596
2811
  */
2597
2812
  target_workspace_key: string;
2598
2813
  /**
@@ -2703,6 +2918,14 @@ interface components {
2703
2918
  /** Parent Ext Id */
2704
2919
  parent_ext_id?: string | null;
2705
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
+ };
2706
2929
  /**
2707
2930
  * DeleteContactsRequest
2708
2931
  * @description Request model for deleting specific contacts.
@@ -2887,6 +3110,12 @@ interface components {
2887
3110
  * @enum {string}
2888
3111
  */
2889
3112
  API_TYPE: 'local' | 'remote';
3113
+ /**
3114
+ * Enable Thinking
3115
+ * @description Enable reasoning/thinking mode.
3116
+ * @default false
3117
+ */
3118
+ ENABLE_THINKING: boolean;
2890
3119
  /**
2891
3120
  * Model Name
2892
3121
  * @description The name of the non-reasoning model to be used.
@@ -3056,6 +3285,12 @@ interface components {
3056
3285
  * @enum {string}
3057
3286
  */
3058
3287
  API_TYPE: 'local' | 'remote';
3288
+ /**
3289
+ * Enable Thinking
3290
+ * @description Enable reasoning/thinking mode.
3291
+ * @default false
3292
+ */
3293
+ ENABLE_THINKING: boolean;
3059
3294
  /**
3060
3295
  * Model Name
3061
3296
  * @description The name of the non-reasoning model to be used.
@@ -3163,6 +3398,83 @@ interface components {
3163
3398
  /** Status Details */
3164
3399
  status_details?: string | null;
3165
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
+ };
3166
3478
  /**
3167
3479
  * GenerateAnnotationsRequest
3168
3480
  * @description Request to generate AI annotations for documents using tag instructions.
@@ -3195,70 +3507,38 @@ interface components {
3195
3507
  tag_ext_ids: string[];
3196
3508
  };
3197
3509
  /**
3198
- * GetDocumentPassagesDetail
3199
- * @description Detail for a get_document_passages tool call.
3200
- */
3201
- GetDocumentPassagesDetail: {
3202
- /**
3203
- * Tool
3204
- * @default get_document_passages
3205
- * @constant
3206
- */
3207
- tool: 'get_document_passages';
3208
- /**
3209
- * Doc Ext Id
3210
- * @description Document external ID
3211
- */
3212
- doc_ext_id: string;
3213
- /**
3214
- * From Ref
3215
- * @description Start reference (page.chunk)
3216
- */
3217
- from_ref: string;
3218
- /**
3219
- * To Ref
3220
- * @description End reference (page.chunk)
3221
- */
3222
- to_ref: string;
3223
- };
3224
- /**
3225
- * GetFullDocumentDetail
3226
- * @description Detail for a get_full_document tool call.
3510
+ * GetTableOfContentsDetail
3511
+ * @description Detail for a get_table_of_contents tool call.
3227
3512
  */
3228
- GetFullDocumentDetail: {
3513
+ GetTableOfContentsDetail: {
3229
3514
  /**
3230
3515
  * Tool
3231
- * @default get_full_document
3516
+ * @default get_table_of_contents
3232
3517
  * @constant
3233
3518
  */
3234
- tool: 'get_full_document';
3519
+ tool: 'get_table_of_contents';
3235
3520
  /**
3236
3521
  * Doc Ext Id
3237
3522
  * @description Document external ID
3238
3523
  */
3239
3524
  doc_ext_id: string;
3240
- };
3241
- /**
3242
- * GetTableOfContentsDetail
3243
- * @description Detail for a get_table_of_contents tool call.
3244
- */
3245
- GetTableOfContentsDetail: {
3246
3525
  /**
3247
- * Tool
3248
- * @default get_table_of_contents
3249
- * @constant
3526
+ * Label
3527
+ * @description Display label for the tool step
3528
+ * @default Getting table of contents
3250
3529
  */
3251
- tool: 'get_table_of_contents';
3530
+ label: string;
3252
3531
  /**
3253
- * Doc Count
3254
- * @description Number of documents requested
3532
+ * Icon
3533
+ * @description Lucide icon name for the tool step
3534
+ * @default list
3255
3535
  */
3256
- doc_count: number;
3536
+ icon: string;
3257
3537
  /**
3258
- * Doc Ext Ids
3259
- * @description Document external IDs
3538
+ * Summary
3539
+ * @description Human-readable summary (e.g. 'Table of contents: {doc-abc12345}')
3260
3540
  */
3261
- doc_ext_ids: string[];
3541
+ summary?: string | null;
3262
3542
  };
3263
3543
  /** HTTPValidationError */
3264
3544
  HTTPValidationError: {
@@ -3303,23 +3583,24 @@ interface components {
3303
3583
  };
3304
3584
  /**
3305
3585
  * LoginRequest
3306
- * @description Unified login request (local and SSO).
3586
+ * @description Unified login request for users and agents.
3307
3587
  *
3308
3588
  * For local users: email + signature + timestamp
3309
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.
3310
3593
  *
3311
3594
  * Authentication flow:
3312
- * 1. Client derives Ed25519 keypair from password
3313
- * 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
3314
3597
  * 3. Server verifies signature using stored Ed25519 public key
3315
- * 4. Server derives X25519 from Ed25519 for session key encryption
3316
3598
  */
3317
3599
  LoginRequest: {
3318
- /**
3319
- * Email
3320
- * Format: email
3321
- */
3322
- email: string;
3600
+ /** Email */
3601
+ email?: string | null;
3602
+ /** Agent Ext Id */
3603
+ agent_ext_id?: string | null;
3323
3604
  /** Signature */
3324
3605
  signature: string;
3325
3606
  /** Timestamp */
@@ -3329,9 +3610,9 @@ interface components {
3329
3610
  };
3330
3611
  /**
3331
3612
  * LoginResponse
3332
- * @description Login response with access token, session key, and user info.
3613
+ * @description Login response with access token, session key, user info, and workspaces.
3333
3614
  *
3334
- * Used by: /user/login
3615
+ * Used by: /user/login, /user/token (claim agent session)
3335
3616
  */
3336
3617
  LoginResponse: {
3337
3618
  /** Access Token */
@@ -3339,6 +3620,13 @@ interface components {
3339
3620
  /** Session Key */
3340
3621
  session_key: string;
3341
3622
  user: components['schemas']['UserResponse'];
3623
+ /**
3624
+ * Workspaces
3625
+ * @default []
3626
+ */
3627
+ workspaces: {
3628
+ [key: string]: unknown;
3629
+ }[];
3342
3630
  };
3343
3631
  /** LogoutResponse */
3344
3632
  LogoutResponse: {
@@ -3375,6 +3663,12 @@ interface components {
3375
3663
  * @enum {string}
3376
3664
  */
3377
3665
  API_TYPE: 'local' | 'remote';
3666
+ /**
3667
+ * Enable Thinking
3668
+ * @description Enable reasoning/thinking mode.
3669
+ * @default false
3670
+ */
3671
+ ENABLE_THINKING: boolean;
3378
3672
  /**
3379
3673
  * Model Name
3380
3674
  * @description The model for memory synthesis. Defaults to reasoning model.
@@ -3653,6 +3947,12 @@ interface components {
3653
3947
  * @default 5
3654
3948
  */
3655
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;
3656
3956
  };
3657
3957
  /** ModelCitationTool */
3658
3958
  ModelCitationTool: {
@@ -3774,7 +4074,7 @@ interface components {
3774
4074
  * Type is self-descriptive, no need to parse content field.
3775
4075
  * @enum {string}
3776
4076
  */
3777
- 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';
3778
4078
  /**
3779
4079
  * NotificationUpdate
3780
4080
  * @description Single notification update for bulk PATCH.
@@ -3969,6 +4269,12 @@ interface components {
3969
4269
  * @enum {string}
3970
4270
  */
3971
4271
  API_TYPE: 'local' | 'remote';
4272
+ /**
4273
+ * Enable Thinking
4274
+ * @description Enable reasoning/thinking mode.
4275
+ * @default true
4276
+ */
4277
+ ENABLE_THINKING: boolean;
3972
4278
  /**
3973
4279
  * Model Name
3974
4280
  * @description The model for plan generation. Defaults to reasoning model.
@@ -3981,8 +4287,8 @@ interface components {
3981
4287
  * @default You are a research planning assistant. Your job is to analyze a user query and produce a concise, numbered research plan.
3982
4288
  *
3983
4289
  * You have access to a workspace of documents. The available tools for executing the plan are:
3984
- * - search_documents: Search workspace documents for relevant passages (semantic, keyword, or hybrid)
3985
- * - 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.
3986
4292
  * - get_table_of_contents: Get document headings with page references
3987
4293
  *
3988
4294
  * Consider:
@@ -4082,6 +4388,12 @@ interface components {
4082
4388
  * @enum {string}
4083
4389
  */
4084
4390
  API_TYPE: 'local' | 'remote';
4391
+ /**
4392
+ * Enable Thinking
4393
+ * @description Enable reasoning/thinking mode.
4394
+ * @default false
4395
+ */
4396
+ ENABLE_THINKING: boolean;
4085
4397
  /**
4086
4398
  * Model Name
4087
4399
  * @description The model for query answering.
@@ -4113,6 +4425,50 @@ interface components {
4113
4425
  */
4114
4426
  MAX_TOKENS: number;
4115
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
+ };
4116
4472
  /**
4117
4473
  * ReadUrlDetail
4118
4474
  * @description Detail for a read_url tool call.
@@ -4167,7 +4523,7 @@ interface components {
4167
4523
  };
4168
4524
  /**
4169
4525
  * RemoveWorkspaceUserItem
4170
- * @description A user to remove from a workspace.
4526
+ * @description A user or agent to remove from a workspace.
4171
4527
  */
4172
4528
  RemoveWorkspaceUserItem: {
4173
4529
  /** User Ext Id */
@@ -4214,6 +4570,12 @@ interface components {
4214
4570
  * @enum {string}
4215
4571
  */
4216
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;
4217
4579
  };
4218
4580
  /**
4219
4581
  * ResponseCompleteMessage
@@ -4827,7 +5189,7 @@ interface components {
4827
5189
  /**
4828
5190
  * Min Retrieval Sim Score
4829
5191
  * @description Minimum similarity score for retrieval of a chunk.
4830
- * @default 0.3
5192
+ * @default 0.1
4831
5193
  */
4832
5194
  MIN_RETRIEVAL_SIM_SCORE: number;
4833
5195
  /**
@@ -4853,6 +5215,12 @@ interface components {
4853
5215
  * @default semantic
4854
5216
  */
4855
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;
4856
5224
  /**
4857
5225
  * Hybrid Dense Weight
4858
5226
  * @description Weight for dense vectors in hybrid mode
@@ -4865,12 +5233,6 @@ interface components {
4865
5233
  * @default 0.3
4866
5234
  */
4867
5235
  HYBRID_SPARSE_WEIGHT: number;
4868
- /**
4869
- * Hybrid Reranker Weight
4870
- * @description Weight for reranker score in hybrid mode score blending (0-1). RRF weight = 1 - this value
4871
- * @default 0.5
4872
- */
4873
- HYBRID_RERANKER_WEIGHT: number;
4874
5236
  };
4875
5237
  /**
4876
5238
  * ReviewLLMConfig
@@ -4884,6 +5246,12 @@ interface components {
4884
5246
  * @enum {string}
4885
5247
  */
4886
5248
  API_TYPE: 'local' | 'remote';
5249
+ /**
5250
+ * Enable Thinking
5251
+ * @description Enable reasoning/thinking mode.
5252
+ * @default false
5253
+ */
5254
+ ENABLE_THINKING: boolean;
4887
5255
  /**
4888
5256
  * Model Name
4889
5257
  * @description The model for reviewing agent draft answers. Defaults to reasoning model.
@@ -5009,11 +5377,10 @@ interface components {
5009
5377
  output_tokens_details?: components['schemas']['OutputTokensDetails'] | null;
5010
5378
  context_usage?: components['schemas']['ContextUsage'] | null;
5011
5379
  message_metadata?: components['schemas']['MessageMetadataPayload'] | null;
5012
- detail_search_documents?: components['schemas']['SearchDocumentsDetail'] | null;
5013
- 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;
5014
5382
  detail_get_table_of_contents?: components['schemas']['GetTableOfContentsDetail'] | null;
5015
5383
  detail_view_document_pages?: components['schemas']['ViewDocumentPagesDetail'] | null;
5016
- detail_get_full_document?: components['schemas']['GetFullDocumentDetail'] | null;
5017
5384
  detail_web_search?: components['schemas']['WebSearchDetail'] | null;
5018
5385
  detail_personal_agent?: components['schemas']['PersonalAgentDetail'] | null;
5019
5386
  detail_read_url?: components['schemas']['ReadUrlDetail'] | null;
@@ -5130,16 +5497,16 @@ interface components {
5130
5497
  title: string;
5131
5498
  };
5132
5499
  /**
5133
- * SearchDocumentsDetail
5134
- * @description Detail for a search_documents tool call.
5500
+ * SearchInsideDocumentsDetail
5501
+ * @description Detail for a search_inside_documents tool call.
5135
5502
  */
5136
- SearchDocumentsDetail: {
5503
+ SearchInsideDocumentsDetail: {
5137
5504
  /**
5138
5505
  * Tool
5139
- * @default search_documents
5506
+ * @default search_inside_documents
5140
5507
  * @constant
5141
5508
  */
5142
- tool: 'search_documents';
5509
+ tool: 'search_inside_documents';
5143
5510
  /**
5144
5511
  * Query
5145
5512
  * @description Search query (truncated to 80 chars)
@@ -5150,6 +5517,23 @@ interface components {
5150
5517
  * @description Search mode: hybrid, semantic, keyword
5151
5518
  */
5152
5519
  search_mode: string;
5520
+ /**
5521
+ * Label
5522
+ * @description Display label for the tool step
5523
+ * @default Searching documents
5524
+ */
5525
+ label: string;
5526
+ /**
5527
+ * Icon
5528
+ * @description Lucide icon name for the tool step
5529
+ * @default search
5530
+ */
5531
+ icon: string;
5532
+ /**
5533
+ * Summary
5534
+ * @description Human-readable summary (e.g. 'Search: "query" (hybrid)')
5535
+ */
5536
+ summary?: string | null;
5153
5537
  };
5154
5538
  /**
5155
5539
  * SearchMode
@@ -5181,6 +5565,34 @@ interface components {
5181
5565
  [key: string]: unknown;
5182
5566
  } | null;
5183
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
+ };
5184
5596
  /** ShareConversationResponse */
5185
5597
  ShareConversationResponse: {
5186
5598
  /**
@@ -5302,6 +5714,12 @@ interface components {
5302
5714
  * @enum {string}
5303
5715
  */
5304
5716
  API_TYPE: 'local' | 'remote';
5717
+ /**
5718
+ * Enable Thinking
5719
+ * @description Enable reasoning/thinking mode.
5720
+ * @default false
5721
+ */
5722
+ ENABLE_THINKING: boolean;
5305
5723
  /**
5306
5724
  * Model Name
5307
5725
  * @description The model for conversation summarisation. Defaults to reasoning model.
@@ -5480,6 +5898,12 @@ interface components {
5480
5898
  * @enum {string}
5481
5899
  */
5482
5900
  API_TYPE: 'local' | 'remote';
5901
+ /**
5902
+ * Enable Thinking
5903
+ * @description Enable reasoning/thinking mode.
5904
+ * @default false
5905
+ */
5906
+ ENABLE_THINKING: boolean;
5483
5907
  /**
5484
5908
  * Model Name
5485
5909
  * @description The name of the non-reasoning model to be used.
@@ -5722,9 +6146,10 @@ interface components {
5722
6146
  };
5723
6147
  /**
5724
6148
  * UpdateWorkspaceUserRolesRequest
5725
- * @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).
5726
6150
  *
5727
- * 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.
5728
6153
  */
5729
6154
  UpdateWorkspaceUserRolesRequest: {
5730
6155
  /** User Ext Ids */
@@ -5858,16 +6283,19 @@ interface components {
5858
6283
  * @description Standard user representation used across all endpoints.
5859
6284
  *
5860
6285
  * Used for: login response, workspace users, contacts (when registered).
6286
+ * Agents have agt- prefix and may have nullable name/email fields.
5861
6287
  */
5862
6288
  UserResponse: {
5863
6289
  /** External Id */
5864
6290
  external_id: string;
6291
+ /** Parent Ext Id */
6292
+ parent_ext_id?: string | null;
5865
6293
  /** Email */
5866
6294
  email: string;
5867
6295
  /** Given Name */
5868
6296
  given_name: string;
5869
6297
  /** Family Name */
5870
- family_name: string;
6298
+ family_name?: string | null;
5871
6299
  /** Picture */
5872
6300
  picture?: string | null;
5873
6301
  /** Encryption Public Key */
@@ -5941,6 +6369,11 @@ interface components {
5941
6369
  * @default false
5942
6370
  */
5943
6371
  show_pa_mode: boolean;
6372
+ /**
6373
+ * Show Agent Sessions
6374
+ * @default false
6375
+ */
6376
+ show_agent_sessions: boolean;
5944
6377
  /**
5945
6378
  * Hide Online Status
5946
6379
  * @default false
@@ -5985,6 +6418,8 @@ interface components {
5985
6418
  show_templates?: boolean | null;
5986
6419
  /** Show Pa Mode */
5987
6420
  show_pa_mode?: boolean | null;
6421
+ /** Show Agent Sessions */
6422
+ show_agent_sessions?: boolean | null;
5988
6423
  /** Hide Online Status */
5989
6424
  hide_online_status?: boolean | null;
5990
6425
  /** Muted Users */
@@ -6047,7 +6482,7 @@ interface components {
6047
6482
  * VisionLLMConfig
6048
6483
  * @description Configuration for VisionLLM — visually inspects document pages.
6049
6484
  *
6050
- * Used as a targeted fallback when text extraction (get_document_passages)
6485
+ * Used as a targeted fallback when text extraction (read_document)
6051
6486
  * is insufficient, e.g. for figures, charts, tables, scanned pages.
6052
6487
  * The prompt is constructed dynamically per call (no system instruction).
6053
6488
  */
@@ -6059,6 +6494,12 @@ interface components {
6059
6494
  * @enum {string}
6060
6495
  */
6061
6496
  API_TYPE: 'local' | 'remote';
6497
+ /**
6498
+ * Enable Thinking
6499
+ * @description Enable reasoning/thinking mode.
6500
+ * @default false
6501
+ */
6502
+ ENABLE_THINKING: boolean;
6062
6503
  /**
6063
6504
  * Model Name
6064
6505
  * @description The vision-capable model name (must support image inputs).
@@ -6156,22 +6597,25 @@ interface components {
6156
6597
  * @default false
6157
6598
  */
6158
6599
  is_public: boolean;
6600
+ /** Workspace Key */
6601
+ workspace_key: string;
6159
6602
  };
6160
6603
  /**
6161
6604
  * WorkspaceOpenRequest
6162
- * @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.
6163
6609
  */
6164
6610
  WorkspaceOpenRequest: {
6165
6611
  /** Workspace Key */
6166
- workspace_key: string;
6612
+ workspace_key?: string | null;
6167
6613
  };
6168
6614
  /**
6169
6615
  * WorkspaceOpenResponse
6170
- * @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).
6171
6617
  */
6172
6618
  WorkspaceOpenResponse: {
6173
- /** Access Token */
6174
- access_token: string;
6175
6619
  workspace: components['schemas']['WorkspaceResponse'];
6176
6620
  /** Conversations */
6177
6621
  conversations: components['schemas']['ConversationResponse'][];
@@ -6254,7 +6698,9 @@ interface components {
6254
6698
  };
6255
6699
  /**
6256
6700
  * WorkspaceUserResponse
6257
- * @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.
6258
6704
  */
6259
6705
  WorkspaceUserResponse: {
6260
6706
  user: components['schemas']['UserResponse'];
@@ -6274,6 +6720,8 @@ interface components {
6274
6720
  * @default 0
6275
6721
  */
6276
6722
  document_count: number;
6723
+ /** Agent Ext Id */
6724
+ agent_ext_id?: string | null;
6277
6725
  };
6278
6726
  };
6279
6727
  responses: never;
@@ -6520,6 +6968,127 @@ interface operations {
6520
6968
  };
6521
6969
  };
6522
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
+ };
6523
7092
  logout: {
6524
7093
  parameters: {
6525
7094
  query?: {
@@ -6552,6 +7121,26 @@ interface operations {
6552
7121
  };
6553
7122
  };
6554
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
+ };
6555
7144
  change_password: {
6556
7145
  parameters: {
6557
7146
  query?: never;
@@ -8558,22 +9147,9 @@ interface operations {
8558
9147
  interface TokenProvider {
8559
9148
  getAccessToken(): string | null;
8560
9149
  }
8561
- interface WorkspaceKeyProvider {
8562
- getWorkspaceKeyHeader(): string | null;
8563
- }
8564
- interface WorkspaceKeyUrlConfig {
8565
- /** URL substrings that NEVER need workspace key */
8566
- excludePatterns: string[];
8567
- /** URL substrings that DO need workspace key */
8568
- includePatterns: string[];
8569
- }
8570
9150
  interface BearerAuthMiddlewareConfig {
8571
9151
  tokenProvider: TokenProvider;
8572
9152
  }
8573
- interface WorkspaceKeyMiddlewareConfig {
8574
- workspaceKeyProvider: WorkspaceKeyProvider;
8575
- urlConfig: WorkspaceKeyUrlConfig;
8576
- }
8577
9153
  type ReloginHandler = () => Promise<string | null>;
8578
9154
  interface AutoReloginMiddlewareConfig {
8579
9155
  reloginHandler: ReloginHandler;
@@ -8596,7 +9172,7 @@ interface CryptoProvider {
8596
9172
  signMessage(message: string, privateKey: Uint8Array): string;
8597
9173
  deriveEncryptionKeypair(signingKeyPair: KeyPair$1): KeyPair$1;
8598
9174
  sealedBoxDecrypt(encryptedBase64: string, privateKey: Uint8Array): Uint8Array;
8599
- createWorkspaceKeyHeader(workspaceKey: Uint8Array, serverSessionKey: Uint8Array): Promise<string>;
9175
+ sealKeyForSession(workspaceKey: Uint8Array, serverSessionKey: Uint8Array): Promise<string>;
8600
9176
  fromBase64(base64: string): Uint8Array;
8601
9177
  }
8602
9178
  interface SessionKeys {
@@ -8618,8 +9194,6 @@ interface AuthStateProvider {
8618
9194
  };
8619
9195
  getSelectedWorkspaceId(): string | null;
8620
9196
  setAccessToken(token: string): void;
8621
- clearWorkspaceHeaders(): void;
8622
- setCachedWorkspaceHeader(workspaceId: string, header: string): void;
8623
9197
  }
8624
9198
  interface SsoTokenProvider {
8625
9199
  getToken(): Promise<string | null>;
@@ -8647,11 +9221,11 @@ interface WorkspaceKeyRefreshProvider {
8647
9221
  getWrappedKey(accessToken: string, workspaceId: string): Promise<string | null>;
8648
9222
  }
8649
9223
  /**
8650
- * Opens a workspace by calling the /open endpoint to get a workspace-scoped JWT.
8651
- * 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.
8652
9226
  */
8653
9227
  interface WorkspaceOpenProvider {
8654
- openWorkspace(accessToken: string, workspaceId: string, encryptedWorkspaceKey: string): Promise<string | null>;
9228
+ openWorkspace(accessToken: string, workspaceId: string, encryptedWorkspaceKey: string): Promise<boolean | null>;
8655
9229
  }
8656
9230
  type OnReloginSuccess = (data: {
8657
9231
  email: string;
@@ -8674,7 +9248,7 @@ interface ReloginDeps {
8674
9248
  * SessionManager - In-memory session state for SDK consumers
8675
9249
  *
8676
9250
  * Replaces Zustand for SDK consumers. Simple in-memory store with subscribe pattern.
8677
- * Implements TokenProvider, WorkspaceKeyProvider, and AuthStateProvider —
9251
+ * Implements TokenProvider and AuthStateProvider —
8678
9252
  * plugs directly into middleware and relogin handler without any framework.
8679
9253
  */
8680
9254
 
@@ -8683,7 +9257,6 @@ interface SessionState {
8683
9257
  userEmail: string | null;
8684
9258
  userExtId: string | null;
8685
9259
  selectedWorkspaceId: string | null;
8686
- cachedWorkspaceHeaders: Record<string, string>;
8687
9260
  isSsoMode: boolean;
8688
9261
  isAuth0Authenticated: boolean;
8689
9262
  auth0AccessToken: string | null;
@@ -8693,9 +9266,6 @@ interface SessionManager {
8693
9266
  setAccessToken(token: string | null): void;
8694
9267
  setUser(email: string, extId?: string): void;
8695
9268
  setSelectedWorkspace(id: string | null): void;
8696
- setCachedWorkspaceHeader(workspaceId: string, header: string): void;
8697
- clearWorkspaceHeaders(): void;
8698
- getWorkspaceKeyHeader(): string | null;
8699
9269
  setSsoState(opts: Partial<{
8700
9270
  isSsoMode: boolean;
8701
9271
  isAuth0Authenticated: boolean;
@@ -8769,9 +9339,10 @@ declare function generateKeyPairs(username: string, password: string, deployment
8769
9339
  */
8770
9340
  declare function signMessage(message: string, privateKey: Uint8Array): string;
8771
9341
  /**
8772
- * 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.
8773
9344
  */
8774
- declare function createWorkspaceKeyHeader(workspaceKey: Uint8Array, serverSessionPublicKey: Uint8Array): Promise<string>;
9345
+ declare function sealKeyForSession(workspaceKey: Uint8Array, serverSessionPublicKey: Uint8Array): Promise<string>;
8775
9346
  /**
8776
9347
  * Decrypt data using SealedBox (anonymous decryption).
8777
9348
  *
@@ -8798,6 +9369,11 @@ declare function derivePublicKey(privateKey: Uint8Array): Uint8Array;
8798
9369
  * Used when we have stored Ed25519 keys and need X25519 for encryption
8799
9370
  */
8800
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;
8801
9377
  /**
8802
9378
  * Precompute shared secret for ECDH encryption.
8803
9379
  *
@@ -9095,6 +9671,8 @@ interface LoginWithKeyParams {
9095
9671
  interface LoginResult {
9096
9672
  accessToken: string;
9097
9673
  userExtId?: string;
9674
+ /** Owner's ext_id for agent accounts; null/undefined for human users */
9675
+ parentExtId?: string | null;
9098
9676
  signingPrivateKey: Uint8Array;
9099
9677
  serverSessionKey: Uint8Array;
9100
9678
  }
@@ -9135,8 +9713,6 @@ interface ArbiClientOptions {
9135
9713
  baseUrl: string;
9136
9714
  /** Deployment domain used for deterministic key derivation (e.g. "mydeployment.com") */
9137
9715
  deploymentDomain: string;
9138
- /** Optional custom URL patterns for workspace key injection */
9139
- workspaceKeyUrlConfig?: WorkspaceKeyUrlConfig;
9140
9716
  /** URL patterns that should never trigger re-login */
9141
9717
  reloginExcludePatterns?: string[];
9142
9718
  /** Include credentials (cookies) in requests. Default: true */
@@ -9175,8 +9751,9 @@ interface ArbiClient {
9175
9751
  signMessage: typeof signMessage;
9176
9752
  sealedBoxDecrypt: typeof sealedBoxDecrypt;
9177
9753
  sealedBoxEncrypt: typeof sealedBoxEncrypt;
9178
- createWorkspaceKeyHeader: typeof createWorkspaceKeyHeader;
9754
+ sealKeyForSession: typeof sealKeyForSession;
9179
9755
  deriveEncryptionKeypairFromSigning: typeof deriveEncryptionKeypairFromSigning;
9756
+ generateRandomSigningKeypair: typeof generateRandomSigningKeypair;
9180
9757
  derivePublicKey: typeof derivePublicKey;
9181
9758
  base64ToBytes: typeof base64ToBytes;
9182
9759
  bytesToBase64: typeof bytesToBase64;
@@ -9204,19 +9781,6 @@ declare function createArbiClient(options: ArbiClientOptions): ArbiClient;
9204
9781
 
9205
9782
  declare function createBearerAuthMiddleware(config: BearerAuthMiddlewareConfig): Middleware;
9206
9783
 
9207
- /**
9208
- * Workspace Key Middleware
9209
- *
9210
- * Injects Workspace-Key header on workspace-scoped requests.
9211
- * URL matching is data-driven via WorkspaceKeyUrlConfig.
9212
- */
9213
-
9214
- /**
9215
- * Check if a URL needs the Workspace-Key header based on URL patterns.
9216
- */
9217
- declare function needsWorkspaceKey(url: string, urlConfig: WorkspaceKeyUrlConfig): boolean;
9218
- declare function createWorkspaceKeyMiddleware(config: WorkspaceKeyMiddlewareConfig): Middleware;
9219
-
9220
9784
  /**
9221
9785
  * Auto Re-login Middleware
9222
9786
  *
@@ -9297,4 +9861,4 @@ declare function isMessageType<T extends WebSocketServerMessage>(msg: WebSocketS
9297
9861
  */
9298
9862
  declare function createReloginHandler(deps: ReloginDeps): () => Promise<string | null>;
9299
9863
 
9300
- 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 };