@arbidocs/client 0.5.68 → 0.5.69

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
@@ -1597,7 +1597,9 @@ interface paths {
1597
1597
  * SealedBox-encrypted workspace key (encrypted with their session public key).
1598
1598
  * The workspace need not be open/active on the session. This allows sharing any
1599
1599
  * workspace for which the caller holds a key (e.g. from their login response).
1600
- * 2. No body key: server falls back to the session's current active workspace.
1600
+ * 2. Neither: the session's current active workspace.
1601
+ *
1602
+ * Sending only one of ``workspace_ext_id`` / ``workspace_key`` is a 422, never a fallback to the active workspace.
1601
1603
  *
1602
1604
  * Wraps the workspace key with each recipient's X25519 public key (permanent grant)
1603
1605
  * or deposits it into their Redis session (temporary grant when session_pubkey_b64 is set).
@@ -2405,6 +2407,7 @@ interface paths {
2405
2407
  * Upload Documents From Url
2406
2408
  * @description Download and upload documents from URLs to a workspace with encryption.
2407
2409
  * Documents are queued for processing, parsed, and indexed for vector search.
2410
+ * ``workspace_ext_id`` may name a primed workspace; the active one is not changed.
2408
2411
  *
2409
2412
  * Requires active subscription if Stripe is configured.
2410
2413
  */
@@ -2439,6 +2442,11 @@ interface paths {
2439
2442
  * Call ``POST /v1/document/upload-commit`` once the PUTs succeed to flip
2440
2443
  * the rows to ``queued`` and enqueue the parser pipeline.
2441
2444
  *
2445
+ * ``workspace_ext_id`` may name a primed workspace (its key on the session,
2446
+ * else 409 ``workspace_key_required``) without changing the active one. The
2447
+ * client must encrypt with that workspace's key and commit into the same
2448
+ * workspace.
2449
+ *
2442
2450
  * See ``init_direct_uploads`` for the full side-effect ordering.
2443
2451
  *
2444
2452
  * Requires active subscription if Stripe is configured.
@@ -2474,6 +2482,10 @@ interface paths {
2474
2482
  * The response shape matches ``POST /v1/document/upload`` so the
2475
2483
  * frontend's existing post-upload UI (batch completion tracking etc.)
2476
2484
  * can consume it unchanged.
2485
+ *
2486
+ * ``workspace_ext_id`` must name the workspace the init reserved the rows in
2487
+ * (default: the active workspace). Rows reserved in another workspace are a
2488
+ * 409 ``workspace_mismatch``: they were encrypted with that workspace's key.
2477
2489
  */
2478
2490
  post: operations['upload_commit'];
2479
2491
  delete?: never;
@@ -8518,8 +8530,8 @@ interface components {
8518
8530
  * workspace_key + workspace_ext_id (optional): If provided, the caller supplies the
8519
8531
  * SealedBox-encrypted workspace key directly (encrypted with their session public key)
8520
8532
  * and the target workspace external ID. This allows sharing any workspace the caller
8521
- * holds a key for without needing to open/activate it first. If omitted, the server
8522
- * falls back to the current session's active workspace.
8533
+ * holds a key for without needing to open/activate it first. If both are omitted, the server
8534
+ * uses the current session's active workspace; sending only one of them is a 422.
8523
8535
  *
8524
8536
  * session_pubkey_b64 (optional): If set, the grant is temporary and scoped to the
8525
8537
  * recipient's current session (identified by this X25519 public key). The workspace
@@ -9480,7 +9492,7 @@ interface components {
9480
9492
  * @default {
9481
9493
  * "API_TYPE": "remote",
9482
9494
  * "ENABLE_THINKING": false,
9483
- * "MODEL_NAME": "dummy",
9495
+ * "MODEL_NAME": "Fast",
9484
9496
  * "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.",
9485
9497
  * "MAX_TOKEN_SIZE_TO_ANSWER": 200000,
9486
9498
  * "TEMPERATURE": 0.1,
@@ -9492,7 +9504,7 @@ interface components {
9492
9504
  * @default {
9493
9505
  * "API_TYPE": "remote",
9494
9506
  * "ENABLE_THINKING": false,
9495
- * "MODEL_NAME": "dummy",
9507
+ * "MODEL_NAME": "Wise",
9496
9508
  * "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.",
9497
9509
  * "TEMPERATURE": 0.1,
9498
9510
  * "MAX_TOKENS": 0,
@@ -9504,7 +9516,7 @@ interface components {
9504
9516
  * @default {
9505
9517
  * "API_TYPE": "remote",
9506
9518
  * "ENABLE_THINKING": false,
9507
- * "MODEL_NAME": "dummy",
9519
+ * "MODEL_NAME": "Fast",
9508
9520
  * "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.",
9509
9521
  * "TEMPERATURE": 0.1,
9510
9522
  * "MAX_TOKENS": 0,
@@ -9519,7 +9531,7 @@ interface components {
9519
9531
  * @default {
9520
9532
  * "API_TYPE": "remote",
9521
9533
  * "ENABLE_THINKING": false,
9522
- * "MODEL_NAME": "dummy",
9534
+ * "MODEL_NAME": "Fast",
9523
9535
  * "SYSTEM_INSTRUCTION": "You are a title generator that creates concise, descriptive titles.\n\nOutput the title as plain text only. Do not use Markdown or any other formatting. Specifically:\n- Do not bold, italicize, or otherwise emphasize any part of the title.\n- Do not include asterisks (*), underscores (_), backticks (`), or other Markdown markers.\n- Do not prefix the title with bullets, dashes (-), or numbered/lettered enumeration (e.g. \"1.\", \"a)\").\n- Do not wrap the title in quotes or brackets.",
9524
9536
  * "MAX_TOKEN_SIZE_TO_ANSWER": 20,
9525
9537
  * "TEMPERATURE": 0.3,
@@ -9531,7 +9543,7 @@ interface components {
9531
9543
  * @default {
9532
9544
  * "API_TYPE": "remote",
9533
9545
  * "ENABLE_THINKING": false,
9534
- * "MODEL_NAME": "dummy",
9546
+ * "MODEL_NAME": "Wise",
9535
9547
  * "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.",
9536
9548
  * "TEMPERATURE": 0.1,
9537
9549
  * "MAX_TOKENS": 0,
@@ -9545,7 +9557,7 @@ interface components {
9545
9557
  * @default {
9546
9558
  * "API_TYPE": "remote",
9547
9559
  * "ENABLE_THINKING": false,
9548
- * "MODEL_NAME": "dummy",
9560
+ * "MODEL_NAME": "Fast",
9549
9561
  * "SYSTEM_INSTRUCTION": "You are a document analysis assistant. Answer questions based on the document content.\n\nYour answers are displayed directly as cell values in a table, so keep every answer as short as possible.\n\nGuidelines:\n- Answer with the value only — never a full sentence. Do not restate the question or add lead-ins such as \"This document is...\" or \"The document describes...\". Good: \"German\". Bad: \"This document is written in German.\"\n- When an answer has multiple values, put each value on its own line: separate values with a newline character. Do not separate them with commas, bullets, dashes, numbering, or by writing them as a sentence.\n- Answer from the document. Reasonable inferences are fine; if the document gives no basis for an answer, the value is null and sources is empty.\n- Follow the format instructions exactly for each answer.\n- Output answers as plain text only. Do not use Markdown or any other formatting: no bold, italics, asterisks (*), underscores (_), backticks (`), bullets, or numbered/lettered enumeration.\n- Passages may be preceded by markers like [p3.2]: not document content. Cite them in \"sources\", never in a value.",
9550
9562
  * "MAX_TOKEN_CONTEXT_TO_ANSWER": 200000,
9551
9563
  * "METADATA_CONTEXT_TOKENS": 12000,
@@ -9607,7 +9619,7 @@ interface components {
9607
9619
  * @default {
9608
9620
  * "API_TYPE": "remote",
9609
9621
  * "ENABLE_THINKING": false,
9610
- * "MODEL_NAME": "dummy",
9622
+ * "MODEL_NAME": "Fast",
9611
9623
  * "SYSTEM_INSTRUCTION": "You are a professional translator of legal, commercial and technical documents.\n\nYou translate the numbered passages you are given into the target language, faithfully and completely:\n- Translate every passage in full. Never summarise, shorten, merge, split, reorder, explain or comment.\n- Keep the Markdown structure of each passage exactly: headings (#), lists, emphasis, tables (same rows and columns), links and line breaks.\n- Keep unchanged: numbers, dates as written, amounts, currencies, clause and section numbering, cross-references, citations, case names, statute names, email addresses, URLs and code.\n- Keep proper names of people, companies and places as they are written, unless the glossary gives a translation.\n- Use the glossary's translation for every glossary term, every time it occurs.\n- A defined term (a capitalised or quoted term given a meaning in the document) is translated the same way everywhere.\n- A passage already in the target language, or with nothing to translate (a number, a signature line, a blank form field), is returned as it is.\n- The context passages before and after are there only so the translation reads on from its neighbours. Never translate or return them.",
9612
9624
  * "TEMPERATURE": 0.2,
9613
9625
  * "MAX_TOKENS": 0,
@@ -9622,7 +9634,7 @@ interface components {
9622
9634
  * @default {
9623
9635
  * "API_TYPE": "remote",
9624
9636
  * "ENABLE_THINKING": false,
9625
- * "MODEL_NAME": "dummy",
9637
+ * "MODEL_NAME": "Wise",
9626
9638
  * "TEMPERATURE": 0.3,
9627
9639
  * "MAX_TOKENS": 0,
9628
9640
  * "MAX_TOKEN_CONTEXT": 200000,
@@ -9634,7 +9646,7 @@ interface components {
9634
9646
  * @default {
9635
9647
  * "API_TYPE": "remote",
9636
9648
  * "ENABLE_THINKING": true,
9637
- * "MODEL_NAME": "dummy",
9649
+ * "MODEL_NAME": "Wise",
9638
9650
  * "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.[[if search_inside_documents, read_document, get_table_of_contents: 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.",
9639
9651
  * "TEMPERATURE": 0.3,
9640
9652
  * "MAX_TOKENS": 0,
@@ -9647,7 +9659,7 @@ interface components {
9647
9659
  * @default {
9648
9660
  * "API_TYPE": "remote",
9649
9661
  * "ENABLE_THINKING": false,
9650
- * "MODEL_NAME": "dummy",
9662
+ * "MODEL_NAME": "Fast",
9651
9663
  * "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 - The agent that reads the goal does not see the history indices: refer to an earlier message by what it is (\"the investigation report in the previous answer\"), never by its [N] index.\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.",
9652
9664
  * "TEMPERATURE": 0,
9653
9665
  * "MAX_TOKENS": 0
@@ -9658,7 +9670,7 @@ interface components {
9658
9670
  * @default {
9659
9671
  * "API_TYPE": "remote",
9660
9672
  * "ENABLE_THINKING": false,
9661
- * "MODEL_NAME": "dummy",
9673
+ * "MODEL_NAME": "Fast",
9662
9674
  * "TEMPERATURE": 0.1,
9663
9675
  * "MAX_TOKENS": 0,
9664
9676
  * "MAX_PAGES_PER_CALL": 5,
@@ -9679,7 +9691,7 @@ interface components {
9679
9691
  * @default {
9680
9692
  * "API_TYPE": "remote",
9681
9693
  * "ENABLE_THINKING": true,
9682
- * "MODEL_NAME": "",
9694
+ * "MODEL_NAME": "Premium",
9683
9695
  * "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.",
9684
9696
  * "TEMPERATURE": 0.2,
9685
9697
  * "MAX_TOKENS": 0
@@ -9749,7 +9761,7 @@ interface components {
9749
9761
  * },
9750
9762
  * "MAX_CONCURRENT_REQUESTS": 256,
9751
9763
  * "MODEL_NAME": "Qwen/Qwen3-Reranker-0.6B",
9752
- * "API_TYPE": "local",
9764
+ * "API_TYPE": "remote",
9753
9765
  * "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"
9754
9766
  * }
9755
9767
  */
@@ -9770,7 +9782,7 @@ interface components {
9770
9782
  /**
9771
9783
  * @default {
9772
9784
  * "MODEL_NAME": "Qwen/Qwen3-Embedding-0.6B",
9773
- * "API_TYPE": "local",
9785
+ * "API_TYPE": "remote",
9774
9786
  * "BATCH_SIZE": 128,
9775
9787
  * "MAX_CONCURRENT_REQUESTS": 256,
9776
9788
  * "DOCUMENT_PREFIX": "",
@@ -12204,7 +12216,7 @@ interface components {
12204
12216
  /**
12205
12217
  * Model Name
12206
12218
  * @description Model for code generation. Should be a strong coding model.
12207
- * @default
12219
+ * @default Premium
12208
12220
  */
12209
12221
  MODEL_NAME: string;
12210
12222
  /**
@@ -14676,7 +14688,7 @@ interface components {
14676
14688
  /**
14677
14689
  * Model Name
14678
14690
  * @description The name of the non-reasoning model to be used.
14679
- * @default dummy
14691
+ * @default Fast
14680
14692
  */
14681
14693
  MODEL_NAME: string;
14682
14694
  /**
@@ -15020,7 +15032,7 @@ interface components {
15020
15032
  /**
15021
15033
  * Api Type
15022
15034
  * @description The inference type (local or remote).
15023
- * @default local
15035
+ * @default remote
15024
15036
  * @enum {string}
15025
15037
  */
15026
15038
  API_TYPE: 'local' | 'remote';
@@ -15143,7 +15155,7 @@ interface components {
15143
15155
  /**
15144
15156
  * Model Name
15145
15157
  * @description The name of the non-reasoning model to be used.
15146
- * @default dummy
15158
+ * @default Fast
15147
15159
  */
15148
15160
  MODEL_NAME: string;
15149
15161
  /**
@@ -15748,7 +15760,7 @@ interface components {
15748
15760
  /**
15749
15761
  * Model Name
15750
15762
  * @description The name of the non-reasoning model to be used.
15751
- * @default dummy
15763
+ * @default Fast
15752
15764
  */
15753
15765
  MODEL_NAME: string;
15754
15766
  /**
@@ -17451,7 +17463,7 @@ interface components {
17451
17463
  /**
17452
17464
  * Model Name
17453
17465
  * @description The model for note consolidation. Defaults to reasoning model.
17454
- * @default dummy
17466
+ * @default Wise
17455
17467
  */
17456
17468
  MODEL_NAME: string;
17457
17469
  /**
@@ -18550,7 +18562,7 @@ interface components {
18550
18562
  /**
18551
18563
  * Model Name
18552
18564
  * @description The model for plan generation. Defaults to reasoning model.
18553
- * @default dummy
18565
+ * @default Wise
18554
18566
  */
18555
18567
  MODEL_NAME: string;
18556
18568
  /**
@@ -19492,7 +19504,7 @@ interface components {
19492
19504
  /**
19493
19505
  * Model Name
19494
19506
  * @description The model for query answering.
19495
- * @default dummy
19507
+ * @default Fast
19496
19508
  */
19497
19509
  MODEL_NAME: string;
19498
19510
  /**
@@ -19916,7 +19928,7 @@ interface components {
19916
19928
  /**
19917
19929
  * Api Type
19918
19930
  * @description The inference type (local or remote).
19919
- * @default local
19931
+ * @default remote
19920
19932
  * @enum {string}
19921
19933
  */
19922
19934
  API_TYPE: 'local' | 'remote';
@@ -20776,7 +20788,7 @@ interface components {
20776
20788
  /**
20777
20789
  * Model Name
20778
20790
  * @description The model for reviewing agent draft answers. Defaults to reasoning model.
20779
- * @default dummy
20791
+ * @default Wise
20780
20792
  */
20781
20793
  MODEL_NAME: string;
20782
20794
  /**
@@ -22429,7 +22441,7 @@ interface components {
22429
22441
  /**
22430
22442
  * Model Name
22431
22443
  * @description The model for conversation summarisation. Defaults to reasoning model.
22432
- * @default dummy
22444
+ * @default Wise
22433
22445
  */
22434
22446
  MODEL_NAME: string;
22435
22447
  /**
@@ -23066,7 +23078,7 @@ interface components {
23066
23078
  /**
23067
23079
  * Model Name
23068
23080
  * @description The name of the non-reasoning model to be used.
23069
- * @default dummy
23081
+ * @default Fast
23070
23082
  */
23071
23083
  MODEL_NAME: string;
23072
23084
  /**
@@ -23501,7 +23513,7 @@ interface components {
23501
23513
  /**
23502
23514
  * Model Name
23503
23515
  * @description The name of the non-reasoning model to be used.
23504
- * @default dummy
23516
+ * @default Fast
23505
23517
  */
23506
23518
  MODEL_NAME: string;
23507
23519
  /**
@@ -24475,7 +24487,7 @@ interface components {
24475
24487
  /**
24476
24488
  * Model Name
24477
24489
  * @description The vision-capable model name (must support image inputs).
24478
- * @default dummy
24490
+ * @default Fast
24479
24491
  */
24480
24492
  MODEL_NAME: string;
24481
24493
  /**
@@ -28873,6 +28885,8 @@ interface operations {
28873
28885
  shared?: boolean;
28874
28886
  /** @description Configuration to use for processing */
28875
28887
  config_ext_id?: string | null;
28888
+ /** @description The workspace to act on; defaults to the active workspace */
28889
+ workspace_ext_id?: string | null;
28876
28890
  };
28877
28891
  header?: never;
28878
28892
  path?: never;
@@ -28902,7 +28916,10 @@ interface operations {
28902
28916
  };
28903
28917
  upload_init: {
28904
28918
  parameters: {
28905
- query?: never;
28919
+ query?: {
28920
+ /** @description The workspace to act on; defaults to the active workspace */
28921
+ workspace_ext_id?: string | null;
28922
+ };
28906
28923
  header?: never;
28907
28924
  path?: never;
28908
28925
  cookie?: never;
@@ -28935,7 +28952,10 @@ interface operations {
28935
28952
  };
28936
28953
  upload_commit: {
28937
28954
  parameters: {
28938
- query?: never;
28955
+ query?: {
28956
+ /** @description The workspace to act on; defaults to the active workspace */
28957
+ workspace_ext_id?: string | null;
28958
+ };
28939
28959
  header?: never;
28940
28960
  path?: never;
28941
28961
  cookie?: never;
package/dist/index.d.ts CHANGED
@@ -1597,7 +1597,9 @@ interface paths {
1597
1597
  * SealedBox-encrypted workspace key (encrypted with their session public key).
1598
1598
  * The workspace need not be open/active on the session. This allows sharing any
1599
1599
  * workspace for which the caller holds a key (e.g. from their login response).
1600
- * 2. No body key: server falls back to the session's current active workspace.
1600
+ * 2. Neither: the session's current active workspace.
1601
+ *
1602
+ * Sending only one of ``workspace_ext_id`` / ``workspace_key`` is a 422, never a fallback to the active workspace.
1601
1603
  *
1602
1604
  * Wraps the workspace key with each recipient's X25519 public key (permanent grant)
1603
1605
  * or deposits it into their Redis session (temporary grant when session_pubkey_b64 is set).
@@ -2405,6 +2407,7 @@ interface paths {
2405
2407
  * Upload Documents From Url
2406
2408
  * @description Download and upload documents from URLs to a workspace with encryption.
2407
2409
  * Documents are queued for processing, parsed, and indexed for vector search.
2410
+ * ``workspace_ext_id`` may name a primed workspace; the active one is not changed.
2408
2411
  *
2409
2412
  * Requires active subscription if Stripe is configured.
2410
2413
  */
@@ -2439,6 +2442,11 @@ interface paths {
2439
2442
  * Call ``POST /v1/document/upload-commit`` once the PUTs succeed to flip
2440
2443
  * the rows to ``queued`` and enqueue the parser pipeline.
2441
2444
  *
2445
+ * ``workspace_ext_id`` may name a primed workspace (its key on the session,
2446
+ * else 409 ``workspace_key_required``) without changing the active one. The
2447
+ * client must encrypt with that workspace's key and commit into the same
2448
+ * workspace.
2449
+ *
2442
2450
  * See ``init_direct_uploads`` for the full side-effect ordering.
2443
2451
  *
2444
2452
  * Requires active subscription if Stripe is configured.
@@ -2474,6 +2482,10 @@ interface paths {
2474
2482
  * The response shape matches ``POST /v1/document/upload`` so the
2475
2483
  * frontend's existing post-upload UI (batch completion tracking etc.)
2476
2484
  * can consume it unchanged.
2485
+ *
2486
+ * ``workspace_ext_id`` must name the workspace the init reserved the rows in
2487
+ * (default: the active workspace). Rows reserved in another workspace are a
2488
+ * 409 ``workspace_mismatch``: they were encrypted with that workspace's key.
2477
2489
  */
2478
2490
  post: operations['upload_commit'];
2479
2491
  delete?: never;
@@ -8518,8 +8530,8 @@ interface components {
8518
8530
  * workspace_key + workspace_ext_id (optional): If provided, the caller supplies the
8519
8531
  * SealedBox-encrypted workspace key directly (encrypted with their session public key)
8520
8532
  * and the target workspace external ID. This allows sharing any workspace the caller
8521
- * holds a key for without needing to open/activate it first. If omitted, the server
8522
- * falls back to the current session's active workspace.
8533
+ * holds a key for without needing to open/activate it first. If both are omitted, the server
8534
+ * uses the current session's active workspace; sending only one of them is a 422.
8523
8535
  *
8524
8536
  * session_pubkey_b64 (optional): If set, the grant is temporary and scoped to the
8525
8537
  * recipient's current session (identified by this X25519 public key). The workspace
@@ -9480,7 +9492,7 @@ interface components {
9480
9492
  * @default {
9481
9493
  * "API_TYPE": "remote",
9482
9494
  * "ENABLE_THINKING": false,
9483
- * "MODEL_NAME": "dummy",
9495
+ * "MODEL_NAME": "Fast",
9484
9496
  * "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.",
9485
9497
  * "MAX_TOKEN_SIZE_TO_ANSWER": 200000,
9486
9498
  * "TEMPERATURE": 0.1,
@@ -9492,7 +9504,7 @@ interface components {
9492
9504
  * @default {
9493
9505
  * "API_TYPE": "remote",
9494
9506
  * "ENABLE_THINKING": false,
9495
- * "MODEL_NAME": "dummy",
9507
+ * "MODEL_NAME": "Wise",
9496
9508
  * "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.",
9497
9509
  * "TEMPERATURE": 0.1,
9498
9510
  * "MAX_TOKENS": 0,
@@ -9504,7 +9516,7 @@ interface components {
9504
9516
  * @default {
9505
9517
  * "API_TYPE": "remote",
9506
9518
  * "ENABLE_THINKING": false,
9507
- * "MODEL_NAME": "dummy",
9519
+ * "MODEL_NAME": "Fast",
9508
9520
  * "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.",
9509
9521
  * "TEMPERATURE": 0.1,
9510
9522
  * "MAX_TOKENS": 0,
@@ -9519,7 +9531,7 @@ interface components {
9519
9531
  * @default {
9520
9532
  * "API_TYPE": "remote",
9521
9533
  * "ENABLE_THINKING": false,
9522
- * "MODEL_NAME": "dummy",
9534
+ * "MODEL_NAME": "Fast",
9523
9535
  * "SYSTEM_INSTRUCTION": "You are a title generator that creates concise, descriptive titles.\n\nOutput the title as plain text only. Do not use Markdown or any other formatting. Specifically:\n- Do not bold, italicize, or otherwise emphasize any part of the title.\n- Do not include asterisks (*), underscores (_), backticks (`), or other Markdown markers.\n- Do not prefix the title with bullets, dashes (-), or numbered/lettered enumeration (e.g. \"1.\", \"a)\").\n- Do not wrap the title in quotes or brackets.",
9524
9536
  * "MAX_TOKEN_SIZE_TO_ANSWER": 20,
9525
9537
  * "TEMPERATURE": 0.3,
@@ -9531,7 +9543,7 @@ interface components {
9531
9543
  * @default {
9532
9544
  * "API_TYPE": "remote",
9533
9545
  * "ENABLE_THINKING": false,
9534
- * "MODEL_NAME": "dummy",
9546
+ * "MODEL_NAME": "Wise",
9535
9547
  * "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.",
9536
9548
  * "TEMPERATURE": 0.1,
9537
9549
  * "MAX_TOKENS": 0,
@@ -9545,7 +9557,7 @@ interface components {
9545
9557
  * @default {
9546
9558
  * "API_TYPE": "remote",
9547
9559
  * "ENABLE_THINKING": false,
9548
- * "MODEL_NAME": "dummy",
9560
+ * "MODEL_NAME": "Fast",
9549
9561
  * "SYSTEM_INSTRUCTION": "You are a document analysis assistant. Answer questions based on the document content.\n\nYour answers are displayed directly as cell values in a table, so keep every answer as short as possible.\n\nGuidelines:\n- Answer with the value only — never a full sentence. Do not restate the question or add lead-ins such as \"This document is...\" or \"The document describes...\". Good: \"German\". Bad: \"This document is written in German.\"\n- When an answer has multiple values, put each value on its own line: separate values with a newline character. Do not separate them with commas, bullets, dashes, numbering, or by writing them as a sentence.\n- Answer from the document. Reasonable inferences are fine; if the document gives no basis for an answer, the value is null and sources is empty.\n- Follow the format instructions exactly for each answer.\n- Output answers as plain text only. Do not use Markdown or any other formatting: no bold, italics, asterisks (*), underscores (_), backticks (`), bullets, or numbered/lettered enumeration.\n- Passages may be preceded by markers like [p3.2]: not document content. Cite them in \"sources\", never in a value.",
9550
9562
  * "MAX_TOKEN_CONTEXT_TO_ANSWER": 200000,
9551
9563
  * "METADATA_CONTEXT_TOKENS": 12000,
@@ -9607,7 +9619,7 @@ interface components {
9607
9619
  * @default {
9608
9620
  * "API_TYPE": "remote",
9609
9621
  * "ENABLE_THINKING": false,
9610
- * "MODEL_NAME": "dummy",
9622
+ * "MODEL_NAME": "Fast",
9611
9623
  * "SYSTEM_INSTRUCTION": "You are a professional translator of legal, commercial and technical documents.\n\nYou translate the numbered passages you are given into the target language, faithfully and completely:\n- Translate every passage in full. Never summarise, shorten, merge, split, reorder, explain or comment.\n- Keep the Markdown structure of each passage exactly: headings (#), lists, emphasis, tables (same rows and columns), links and line breaks.\n- Keep unchanged: numbers, dates as written, amounts, currencies, clause and section numbering, cross-references, citations, case names, statute names, email addresses, URLs and code.\n- Keep proper names of people, companies and places as they are written, unless the glossary gives a translation.\n- Use the glossary's translation for every glossary term, every time it occurs.\n- A defined term (a capitalised or quoted term given a meaning in the document) is translated the same way everywhere.\n- A passage already in the target language, or with nothing to translate (a number, a signature line, a blank form field), is returned as it is.\n- The context passages before and after are there only so the translation reads on from its neighbours. Never translate or return them.",
9612
9624
  * "TEMPERATURE": 0.2,
9613
9625
  * "MAX_TOKENS": 0,
@@ -9622,7 +9634,7 @@ interface components {
9622
9634
  * @default {
9623
9635
  * "API_TYPE": "remote",
9624
9636
  * "ENABLE_THINKING": false,
9625
- * "MODEL_NAME": "dummy",
9637
+ * "MODEL_NAME": "Wise",
9626
9638
  * "TEMPERATURE": 0.3,
9627
9639
  * "MAX_TOKENS": 0,
9628
9640
  * "MAX_TOKEN_CONTEXT": 200000,
@@ -9634,7 +9646,7 @@ interface components {
9634
9646
  * @default {
9635
9647
  * "API_TYPE": "remote",
9636
9648
  * "ENABLE_THINKING": true,
9637
- * "MODEL_NAME": "dummy",
9649
+ * "MODEL_NAME": "Wise",
9638
9650
  * "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.[[if search_inside_documents, read_document, get_table_of_contents: 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.",
9639
9651
  * "TEMPERATURE": 0.3,
9640
9652
  * "MAX_TOKENS": 0,
@@ -9647,7 +9659,7 @@ interface components {
9647
9659
  * @default {
9648
9660
  * "API_TYPE": "remote",
9649
9661
  * "ENABLE_THINKING": false,
9650
- * "MODEL_NAME": "dummy",
9662
+ * "MODEL_NAME": "Fast",
9651
9663
  * "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 - The agent that reads the goal does not see the history indices: refer to an earlier message by what it is (\"the investigation report in the previous answer\"), never by its [N] index.\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.",
9652
9664
  * "TEMPERATURE": 0,
9653
9665
  * "MAX_TOKENS": 0
@@ -9658,7 +9670,7 @@ interface components {
9658
9670
  * @default {
9659
9671
  * "API_TYPE": "remote",
9660
9672
  * "ENABLE_THINKING": false,
9661
- * "MODEL_NAME": "dummy",
9673
+ * "MODEL_NAME": "Fast",
9662
9674
  * "TEMPERATURE": 0.1,
9663
9675
  * "MAX_TOKENS": 0,
9664
9676
  * "MAX_PAGES_PER_CALL": 5,
@@ -9679,7 +9691,7 @@ interface components {
9679
9691
  * @default {
9680
9692
  * "API_TYPE": "remote",
9681
9693
  * "ENABLE_THINKING": true,
9682
- * "MODEL_NAME": "",
9694
+ * "MODEL_NAME": "Premium",
9683
9695
  * "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.",
9684
9696
  * "TEMPERATURE": 0.2,
9685
9697
  * "MAX_TOKENS": 0
@@ -9749,7 +9761,7 @@ interface components {
9749
9761
  * },
9750
9762
  * "MAX_CONCURRENT_REQUESTS": 256,
9751
9763
  * "MODEL_NAME": "Qwen/Qwen3-Reranker-0.6B",
9752
- * "API_TYPE": "local",
9764
+ * "API_TYPE": "remote",
9753
9765
  * "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"
9754
9766
  * }
9755
9767
  */
@@ -9770,7 +9782,7 @@ interface components {
9770
9782
  /**
9771
9783
  * @default {
9772
9784
  * "MODEL_NAME": "Qwen/Qwen3-Embedding-0.6B",
9773
- * "API_TYPE": "local",
9785
+ * "API_TYPE": "remote",
9774
9786
  * "BATCH_SIZE": 128,
9775
9787
  * "MAX_CONCURRENT_REQUESTS": 256,
9776
9788
  * "DOCUMENT_PREFIX": "",
@@ -12204,7 +12216,7 @@ interface components {
12204
12216
  /**
12205
12217
  * Model Name
12206
12218
  * @description Model for code generation. Should be a strong coding model.
12207
- * @default
12219
+ * @default Premium
12208
12220
  */
12209
12221
  MODEL_NAME: string;
12210
12222
  /**
@@ -14676,7 +14688,7 @@ interface components {
14676
14688
  /**
14677
14689
  * Model Name
14678
14690
  * @description The name of the non-reasoning model to be used.
14679
- * @default dummy
14691
+ * @default Fast
14680
14692
  */
14681
14693
  MODEL_NAME: string;
14682
14694
  /**
@@ -15020,7 +15032,7 @@ interface components {
15020
15032
  /**
15021
15033
  * Api Type
15022
15034
  * @description The inference type (local or remote).
15023
- * @default local
15035
+ * @default remote
15024
15036
  * @enum {string}
15025
15037
  */
15026
15038
  API_TYPE: 'local' | 'remote';
@@ -15143,7 +15155,7 @@ interface components {
15143
15155
  /**
15144
15156
  * Model Name
15145
15157
  * @description The name of the non-reasoning model to be used.
15146
- * @default dummy
15158
+ * @default Fast
15147
15159
  */
15148
15160
  MODEL_NAME: string;
15149
15161
  /**
@@ -15748,7 +15760,7 @@ interface components {
15748
15760
  /**
15749
15761
  * Model Name
15750
15762
  * @description The name of the non-reasoning model to be used.
15751
- * @default dummy
15763
+ * @default Fast
15752
15764
  */
15753
15765
  MODEL_NAME: string;
15754
15766
  /**
@@ -17451,7 +17463,7 @@ interface components {
17451
17463
  /**
17452
17464
  * Model Name
17453
17465
  * @description The model for note consolidation. Defaults to reasoning model.
17454
- * @default dummy
17466
+ * @default Wise
17455
17467
  */
17456
17468
  MODEL_NAME: string;
17457
17469
  /**
@@ -18550,7 +18562,7 @@ interface components {
18550
18562
  /**
18551
18563
  * Model Name
18552
18564
  * @description The model for plan generation. Defaults to reasoning model.
18553
- * @default dummy
18565
+ * @default Wise
18554
18566
  */
18555
18567
  MODEL_NAME: string;
18556
18568
  /**
@@ -19492,7 +19504,7 @@ interface components {
19492
19504
  /**
19493
19505
  * Model Name
19494
19506
  * @description The model for query answering.
19495
- * @default dummy
19507
+ * @default Fast
19496
19508
  */
19497
19509
  MODEL_NAME: string;
19498
19510
  /**
@@ -19916,7 +19928,7 @@ interface components {
19916
19928
  /**
19917
19929
  * Api Type
19918
19930
  * @description The inference type (local or remote).
19919
- * @default local
19931
+ * @default remote
19920
19932
  * @enum {string}
19921
19933
  */
19922
19934
  API_TYPE: 'local' | 'remote';
@@ -20776,7 +20788,7 @@ interface components {
20776
20788
  /**
20777
20789
  * Model Name
20778
20790
  * @description The model for reviewing agent draft answers. Defaults to reasoning model.
20779
- * @default dummy
20791
+ * @default Wise
20780
20792
  */
20781
20793
  MODEL_NAME: string;
20782
20794
  /**
@@ -22429,7 +22441,7 @@ interface components {
22429
22441
  /**
22430
22442
  * Model Name
22431
22443
  * @description The model for conversation summarisation. Defaults to reasoning model.
22432
- * @default dummy
22444
+ * @default Wise
22433
22445
  */
22434
22446
  MODEL_NAME: string;
22435
22447
  /**
@@ -23066,7 +23078,7 @@ interface components {
23066
23078
  /**
23067
23079
  * Model Name
23068
23080
  * @description The name of the non-reasoning model to be used.
23069
- * @default dummy
23081
+ * @default Fast
23070
23082
  */
23071
23083
  MODEL_NAME: string;
23072
23084
  /**
@@ -23501,7 +23513,7 @@ interface components {
23501
23513
  /**
23502
23514
  * Model Name
23503
23515
  * @description The name of the non-reasoning model to be used.
23504
- * @default dummy
23516
+ * @default Fast
23505
23517
  */
23506
23518
  MODEL_NAME: string;
23507
23519
  /**
@@ -24475,7 +24487,7 @@ interface components {
24475
24487
  /**
24476
24488
  * Model Name
24477
24489
  * @description The vision-capable model name (must support image inputs).
24478
- * @default dummy
24490
+ * @default Fast
24479
24491
  */
24480
24492
  MODEL_NAME: string;
24481
24493
  /**
@@ -28873,6 +28885,8 @@ interface operations {
28873
28885
  shared?: boolean;
28874
28886
  /** @description Configuration to use for processing */
28875
28887
  config_ext_id?: string | null;
28888
+ /** @description The workspace to act on; defaults to the active workspace */
28889
+ workspace_ext_id?: string | null;
28876
28890
  };
28877
28891
  header?: never;
28878
28892
  path?: never;
@@ -28902,7 +28916,10 @@ interface operations {
28902
28916
  };
28903
28917
  upload_init: {
28904
28918
  parameters: {
28905
- query?: never;
28919
+ query?: {
28920
+ /** @description The workspace to act on; defaults to the active workspace */
28921
+ workspace_ext_id?: string | null;
28922
+ };
28906
28923
  header?: never;
28907
28924
  path?: never;
28908
28925
  cookie?: never;
@@ -28935,7 +28952,10 @@ interface operations {
28935
28952
  };
28936
28953
  upload_commit: {
28937
28954
  parameters: {
28938
- query?: never;
28955
+ query?: {
28956
+ /** @description The workspace to act on; defaults to the active workspace */
28957
+ workspace_ext_id?: string | null;
28958
+ };
28939
28959
  header?: never;
28940
28960
  path?: never;
28941
28961
  cookie?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbidocs/client",
3
- "version": "0.5.68",
3
+ "version": "0.5.69",
4
4
  "description": "TypeScript SDK for the ARBI API — zero-knowledge auth, E2E encryption, and type-safe REST client",
5
5
  "type": "module",
6
6
  "sideEffects": false,