@arbidocs/sdk 0.5.64 → 0.5.66
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/README.md +55 -6
- package/docs/compatibility.md +61 -0
- package/docs/getting-started.md +161 -0
- package/examples/react-chat/.env.example +1 -0
- package/examples/react-chat/README.md +6 -0
- package/examples/react-chat/gitignore +5 -0
- package/examples/react-chat/index.html +1 -0
- package/examples/react-chat/package.json +29 -0
- package/examples/react-chat/src/App.tsx +10 -0
- package/examples/react-chat/src/main.tsx +4 -0
- package/examples/react-chat/src/styles.css +5 -0
- package/examples/react-chat/vite.config.ts +4 -0
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
TypeScript SDK for the ARBI platform. Handles authentication, workspace encryption, and streaming AI queries.
|
|
4
4
|
|
|
5
|
+
Start below. The complete [developer quickstart](https://unpkg.com/@arbidocs/sdk/docs/getting-started.md) and
|
|
6
|
+
[compatibility table](https://unpkg.com/@arbidocs/sdk/docs/compatibility.md) also ship in the npm package at
|
|
7
|
+
`node_modules/@arbidocs/sdk/docs/`; no repository access is required.
|
|
8
|
+
|
|
5
9
|
## Quickstart
|
|
6
10
|
|
|
7
11
|
```bash
|
|
@@ -24,6 +28,36 @@ Browser-only code imports the same API from `@arbidocs/sdk/browser`. For a rende
|
|
|
24
28
|
import { Arbi } from '@arbidocs/sdk'
|
|
25
29
|
```
|
|
26
30
|
|
|
31
|
+
## Add a chat widget
|
|
32
|
+
|
|
33
|
+
The installed SDK includes a standalone React starter (in releases containing this guide):
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
cp -R node_modules/@arbidocs/sdk/examples/react-chat ./my-arbi-chat
|
|
37
|
+
cd my-arbi-chat
|
|
38
|
+
mv gitignore .gitignore
|
|
39
|
+
npm install
|
|
40
|
+
cp .env.example .env
|
|
41
|
+
# Set the public VITE_ARBI_URL, then:
|
|
42
|
+
npm run dev
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Sign in inside the widget and explicitly choose a workspace. To deploy, run `npm run build`
|
|
46
|
+
and serve `dist/` as a static site. Never put credentials in `VITE_` variables. The deployment
|
|
47
|
+
must allow this app's origin for API calls. The app uses `@arbidocs/blocks/embed`, with matching
|
|
48
|
+
package versions and stylesheet setup already supplied.
|
|
49
|
+
|
|
50
|
+
For a website without a React build pipeline, use the frontend deployment's hosted panel:
|
|
51
|
+
|
|
52
|
+
```html
|
|
53
|
+
<iframe src="https://YOUR-ARBI-FRONTEND/embed/chat" title="ARBI chat"
|
|
54
|
+
style="width:380px;height:640px;border:0" allow="clipboard-write"></iframe>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The panel owns sign-in and workspace choice. Your deployment must allow the host site to frame
|
|
58
|
+
this route; the parent CSP must allow the frontend in `frame-src`. This is authenticated
|
|
59
|
+
workspace chat. Embedded storage restrictions can require a separate sign-in.
|
|
60
|
+
|
|
27
61
|
## Lifecycle
|
|
28
62
|
|
|
29
63
|
```typescript
|
|
@@ -48,6 +82,7 @@ await arbi.logout()
|
|
|
48
82
|
| `arbi.workspaces` | `list()`, `create()`, `update()`, `delete()`, `listUsers()`, `addUsers()`, `removeUsers()` |
|
|
49
83
|
| `arbi.documents` | `list()`, `get()`, `uploadFile()`, `uploadUrl()`, `update()`, `delete()`, `download()` |
|
|
50
84
|
| `arbi.conversations` | `list()`, `getThreads()`, `updateTitle()`, `share()`, `delete()` |
|
|
85
|
+
| `arbi.responses` | `create()`, `parse()`, `retrieve()`, `attach()`, `cancel()` — start here for new integrations |
|
|
51
86
|
| `arbi.assistant` | `ask(request, handlers)`, `attachRun(responseId, handlers)`, `interject(messageId, text)`, `cancel(responseId)`, `retrieve(query, docIds)` |
|
|
52
87
|
| `arbi.tags` | `list()`, `create()`, `update()`, `delete()` |
|
|
53
88
|
| `arbi.doctags` | `assign()`, `remove()`, `generate()` |
|
|
@@ -56,6 +91,19 @@ await arbi.logout()
|
|
|
56
91
|
|
|
57
92
|
## Streaming AI queries
|
|
58
93
|
|
|
94
|
+
```typescript
|
|
95
|
+
const stream = await arbi.responses.create({ input: 'What does section 3 say?', stream: true })
|
|
96
|
+
for await (const event of stream) {
|
|
97
|
+
if (event.type === 'response.output_text.delta') console.log(event.delta)
|
|
98
|
+
if (event.type === 'response.failed') console.error(event.response.error)
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Existing callback integrations
|
|
103
|
+
|
|
104
|
+
`assistant.ask` remains supported and uses `/v1/responses`. New integrations can start with
|
|
105
|
+
`responses.create` above; keep the callback helper when your UI already uses it.
|
|
106
|
+
|
|
59
107
|
```typescript
|
|
60
108
|
const result = await arbi.assistant.ask(
|
|
61
109
|
{
|
|
@@ -108,7 +156,7 @@ The SDK also auto-recovers on 401 responses using the stored key.
|
|
|
108
156
|
|
|
109
157
|
## React
|
|
110
158
|
|
|
111
|
-
For React apps, use `@arbidocs/react` instead — it wraps this SDK with hooks and a context provider. See the [@arbidocs/react README](
|
|
159
|
+
For React apps, use `@arbidocs/react` instead — it wraps this SDK with hooks and a context provider. See the [@arbidocs/react README](https://www.npmjs.com/package/@arbidocs/react).
|
|
112
160
|
|
|
113
161
|
## Requirements
|
|
114
162
|
|
|
@@ -136,7 +184,8 @@ For latest-document digests, the first run covers the preceding 24 hours; later
|
|
|
136
184
|
|
|
137
185
|
## Releases
|
|
138
186
|
|
|
139
|
-
|
|
187
|
+
Published versions are listed on [npm](https://www.npmjs.com/package/@arbidocs/sdk?activeTab=versions).
|
|
188
|
+
Maintainers with repository access can also read the detailed GitHub release notes.
|
|
140
189
|
|
|
141
190
|
### Errors and streaming outcomes
|
|
142
191
|
|
|
@@ -295,12 +344,11 @@ const format = {
|
|
|
295
344
|
additionalProperties: false,
|
|
296
345
|
},
|
|
297
346
|
}
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
docIds: [invoiceId],
|
|
347
|
+
const response = await arbi.responses.parse<{ total: number }>({
|
|
348
|
+
input: 'Extract the total from: Invoice total 125.50',
|
|
301
349
|
text: { format },
|
|
302
350
|
})
|
|
303
|
-
//
|
|
351
|
+
// response.output_parsed.total is validated; output, usage and metadata are retained.
|
|
304
352
|
```
|
|
305
353
|
|
|
306
354
|
The same `text` option is accepted by `ask`, `startResponse` and background `submit`.
|
|
@@ -404,6 +452,7 @@ existing agent uses the existing `agent_ext_id`; authorizing its task remains a
|
|
|
404
452
|
| Same operations, browser-safe imports | `@arbidocs/sdk/browser` |
|
|
405
453
|
| Typed HTTP and advanced crypto/session access | `@arbidocs/client` |
|
|
406
454
|
| Headless React state and React Query hooks | `@arbidocs/react` |
|
|
455
|
+
| Standalone chat widget | `@arbidocs/blocks/embed` |
|
|
407
456
|
| Rendered composable views | `@arbidocs/blocks` and capability subpaths |
|
|
408
457
|
| Connected rendered views | `@arbidocs/blocks/connect` |
|
|
409
458
|
| Fake fetch, SSE frames, replay scenarios | `@arbidocs/sdk/testing` (tests only) |
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Supported API compatibility
|
|
2
|
+
|
|
3
|
+
ARBI uses `/v1/responses` as its canonical execution API. The TypeScript SDK adds familiar
|
|
4
|
+
Responses conveniences while preserving ARBI authentication, workspace authorization and
|
|
5
|
+
execution controls. This is a supported subset, not a drop-in replacement for every OpenAI,
|
|
6
|
+
Vercel or Claude SDK feature.
|
|
7
|
+
|
|
8
|
+
This table describes the current TypeScript SDK and backend contract. A deployment running an
|
|
9
|
+
older backend may not have a recently introduced capability. See its `/v1/docs` schema for the exact deployed fields.
|
|
10
|
+
|
|
11
|
+
| Surface | Supported behavior | Boundary |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| `responses.create({ input })` | Synchronous response envelope with `output_text` | SDK input is text. Backend normalization of input arrays is not full typed input-item, image/audio or tool-result compatibility. |
|
|
14
|
+
| `model` | Saved `cfg-` selection and existing deployment configuration resolution | A configuration is not an `agt-` identity or an arbitrary upstream-provider override. |
|
|
15
|
+
| `previous_response_id` | Continue from an existing assistant `msg-` response | A conversation is `con-`; a new run/conversation ID is not introduced by the SDK handle. |
|
|
16
|
+
| Response envelope | Preserve `output`, `metadata`, `usage`, status and errors; add `output_text` | A failed JSON response remains failed. Inspect its status. `_request_id` is available on create when the server supplies it. |
|
|
17
|
+
| `stream: true` | Async iterable with `event.type`, Responses lifecycle/text/output-item events | `arbi.*` events remain ARBI extensions. Connection loss throws; a failed terminal response remains an event. |
|
|
18
|
+
| `background: true` | Queued response ID, then `retrieve(id)` or ARBI `attach(id)` | The SDK rejects `stream: true` plus `background: true`. The backend returns queued JSON for that combination, not a live stream. |
|
|
19
|
+
| `responses.retrieve(id)` | Retrieve the existing response's status and output | Existing authentication, ownership and workspace checks apply. |
|
|
20
|
+
| `responses.parse({ text: { format } })` | One synchronous request, validated `output_parsed`, original envelope retained | JSON Schema draft 2020-12, local references only; no Zod helper, coercion, repair or automatic resubmission. Format annotations are not assertions. Client validation compiles schemas; a CSP that forbids compilation produces `STRUCTURED_OUTPUT_VALIDATOR_UNAVAILABLE` before a request. Raw server-validated Responses remain available. |
|
|
21
|
+
| Structured streaming/background | Server validates final output; standalone parser can validate a completed response | Live fragments are provisional. Native-agent and slash/delegation paths reject unsupported structured requests explicitly. `json_object` and text verbosity are outside this subset. |
|
|
22
|
+
| Tools | ARBI document/search/tool map and existing MCP capabilities | Standard OpenAI function-tool arrays and arbitrary local JavaScript function execution are not implemented. |
|
|
23
|
+
| Lifecycle controls | Cancel, attach, snapshots and outcomes through the existing response handle | Breaking iteration detaches the reader. ARBI controls need not have the same URL or method shape as another provider's controls. |
|
|
24
|
+
| Authentication | ARBI login/session and workspace-key flow; existing key and host integrations | Changing `base_url` and supplying an unrelated provider API key is insufficient. A deployment key is not a private-workspace credential. |
|
|
25
|
+
| Workspace context | Current workspace by default; explicit application switching and existing resource/permission checks | Examples do not add per-call workspace headers, grant access, or enable cross-workspace search. Advanced wire fields retain their existing server checks. |
|
|
26
|
+
| `agt-` execution | Existing authorized agent identity and task/grant lifecycle | Choosing an agent does not mint a session or create temporary/standing access. Deferred authorization is not a model failure. |
|
|
27
|
+
| React UI | Shared `ArbiChat`, connected views and React Query hooks | Does not implement Vercel `useChat`'s transport protocol or replace the host's session/cache. |
|
|
28
|
+
| Node | ESM/CommonJS, memory key storage by default, optional explicit persistence | A browser IndexedDB polyfill is not required. Node filesystem helpers remain separate from browser imports. |
|
|
29
|
+
| Retries | Bounded connection retries for generated GET/HEAD; existing explicit session/state recovery | Do not automatically repeat response creation after an ambiguous network failure. Check the existing `msg-` first. |
|
|
30
|
+
| Legacy assistant-query route | Logged temporary compatibility alias | New SDK/generated clients use Responses. Removal is a separate change after call-log review, planned for 2026-11-01. |
|
|
31
|
+
|
|
32
|
+
## Migrating an existing integration
|
|
33
|
+
|
|
34
|
+
1. Establish the ARBI session and explicitly select a permitted workspace.
|
|
35
|
+
2. Start with `responses.create({ input })`, then streaming if needed. Keep the raw envelope.
|
|
36
|
+
3. Map provider-specific tools to supported ARBI capabilities; do not cast an incompatible tool array.
|
|
37
|
+
4. Keep ARBI-specific controls and permissions above the basic request/response surface.
|
|
38
|
+
5. Verify refusal, incomplete, cancellation, disconnect and deferred-access outcomes in your app.
|
|
39
|
+
|
|
40
|
+
A direct OpenAI client can call the documented backend subset after ARBI authentication and
|
|
41
|
+
workspace setup. Vercel and Claude SDKs manage different runtime/tool/UI protocols; familiarity
|
|
42
|
+
of concepts does not make them interchangeable imports. Use the
|
|
43
|
+
[quickstart](getting-started.md) for a small native ARBI integration.
|
|
44
|
+
|
|
45
|
+
## Verify a release
|
|
46
|
+
|
|
47
|
+
Maintainers with repository access check local package tarballs in normal CI and
|
|
48
|
+
**published npm artifacts** after releases. From the repository root with Node 22.22+:
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
node scripts/sdk-node-smoke.mjs --published=0.5.62
|
|
52
|
+
node scripts/sdk-examples-smoke.mjs --published=0.5.62
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Substitute the exact release you are adopting. Omit `=VERSION` to use the version in the checked-out
|
|
56
|
+
SDK manifest; omit `--published` entirely to check locally built tarballs. The Node check covers
|
|
57
|
+
ESM/CommonJS/browser/testing imports, session recovery and response/stream/structured contracts
|
|
58
|
+
against a fake transport. The React check installs npm dependencies and builds the minimal app.
|
|
59
|
+
Developers do not need repository access to use the installed examples or guides.
|
|
60
|
+
These checks do not claim live authentication, model quality, or hosted SSO works on every deployment.
|
|
61
|
+
The release workflow repeats these fresh-consumer checks after publication.
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Build with ARBI
|
|
2
|
+
|
|
3
|
+
Use an existing ARBI deployment and account. You do not need to run the backend or clone
|
|
4
|
+
this monorepo to use the SDK. Your account needs access to the workspace you choose.
|
|
5
|
+
For a first Node integration, use an account with password sign-in; an SSO-only deployment
|
|
6
|
+
needs its existing SSO/session integration rather than a password workaround.
|
|
7
|
+
|
|
8
|
+
Choose one starting point:
|
|
9
|
+
|
|
10
|
+
| You want | Start here |
|
|
11
|
+
| --- | --- |
|
|
12
|
+
| Call ARBI from a script or service | [Node](#node) |
|
|
13
|
+
| Add a chat widget to a React app | [React](#react) |
|
|
14
|
+
| Add chat to a website without a build pipeline | [Website iframe](#website-iframe) |
|
|
15
|
+
| Control state and render your own UI | `@arbidocs/react` hooks and React Query; see the [React package](https://www.npmjs.com/package/@arbidocs/react) |
|
|
16
|
+
|
|
17
|
+
Start with the default/current workspace. Selecting a different workspace is an explicit
|
|
18
|
+
application choice. A configuration (`cfg-`) chooses behavior; an agent (`agt-`) is an
|
|
19
|
+
identity. Neither a model selection nor signing in grants workspace access.
|
|
20
|
+
|
|
21
|
+
## Node
|
|
22
|
+
|
|
23
|
+
Use Node 22.22+ with its bundled npm. Install in an empty directory:
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
npm init -y
|
|
27
|
+
npm install @arbidocs/sdk
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Create a private `.env` file (keep it out of source control):
|
|
31
|
+
|
|
32
|
+
```dotenv
|
|
33
|
+
ARBI_URL=https://YOUR-ARBI-DEPLOYMENT
|
|
34
|
+
ARBI_EMAIL=you@example.com
|
|
35
|
+
ARBI_PASSWORD=your-account-password
|
|
36
|
+
ARBI_WORKSPACE_ID=wrk-YOUR-WORKSPACE
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Use the deployment's public URL, without `/v1`. The workspace ID is the `wrk-` ID of a
|
|
40
|
+
workspace you can open in ARBI; after login, `await arbi.workspaces.list()` also lists your
|
|
41
|
+
available workspaces. If your API hostname differs from the account/key-derivation domain,
|
|
42
|
+
supply that deployment's public `deploymentDomain` setting when constructing `Arbi`.
|
|
43
|
+
|
|
44
|
+
Save this as `index.mjs`:
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
import { Arbi } from '@arbidocs/sdk'
|
|
48
|
+
|
|
49
|
+
const arbi = new Arbi({ url: process.env.ARBI_URL })
|
|
50
|
+
await arbi.login(process.env.ARBI_EMAIL, process.env.ARBI_PASSWORD)
|
|
51
|
+
try {
|
|
52
|
+
await arbi.selectWorkspace(process.env.ARBI_WORKSPACE_ID)
|
|
53
|
+
const response = await arbi.responses.create({ input: 'Say hello in one sentence.' })
|
|
54
|
+
if (response.status !== 'completed') throw new Error(`Response ${response.id}: ${response.status}`)
|
|
55
|
+
console.log(response.output_text)
|
|
56
|
+
} finally {
|
|
57
|
+
await arbi.logout()
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Run it:
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
node --env-file=.env index.mjs
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Expected result: one line of assistant text. No browser storage polyfill or framework is needed.
|
|
68
|
+
Keep the `.mjs` extension so Node treats the file as a module.
|
|
69
|
+
|
|
70
|
+
To stream, replace the response call with:
|
|
71
|
+
|
|
72
|
+
```js
|
|
73
|
+
const stream = await arbi.responses.create({ input: 'Say hello.', stream: true })
|
|
74
|
+
for await (const event of stream) {
|
|
75
|
+
if (event.type === 'response.output_text.delta') process.stdout.write(event.delta)
|
|
76
|
+
if (event.type === 'response.failed') throw new Error(`Response ${event.response.id} failed`)
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
A disconnected reader throws. Breaking the loop detaches your reader; it does not cancel server
|
|
81
|
+
execution. Use `responses.cancel(id)` to request cancellation. For follow-ups, send
|
|
82
|
+
`previous_response_id: response.id`. One response is `msg-`; a conversation can contain many responses.
|
|
83
|
+
|
|
84
|
+
The installed package includes runnable [streaming](../examples/stream-response.mjs),
|
|
85
|
+
[structured extraction](../examples/structured-extraction.mjs), and
|
|
86
|
+
[background inspection](../examples/background-response.mjs) examples. They use the same `.env`
|
|
87
|
+
variables; run, for example, `node --env-file=.env node_modules/@arbidocs/sdk/examples/stream-response.mjs`.
|
|
88
|
+
|
|
89
|
+
## React
|
|
90
|
+
|
|
91
|
+
The npm SDK package includes a standalone React starter. In an empty directory:
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
npm install @arbidocs/sdk
|
|
95
|
+
cp -R node_modules/@arbidocs/sdk/examples/react-chat ./my-arbi-chat
|
|
96
|
+
cd my-arbi-chat
|
|
97
|
+
mv gitignore .gitignore
|
|
98
|
+
npm install
|
|
99
|
+
cp .env.example .env
|
|
100
|
+
# Set VITE_ARBI_URL to your ARBI deployment's public URL.
|
|
101
|
+
npm run dev
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
`my-arbi-chat` is an independent app: move it into your own repository and keep `.env` private.
|
|
105
|
+
These steps require the SDK release that includes this guide; `0.5.62` predates the packaged
|
|
106
|
+
React starter. The existing minimal app has also been verified against published `0.5.62` packages.
|
|
107
|
+
|
|
108
|
+
It renders the shared widget:
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
import { ArbiChat } from '@arbidocs/blocks/embed'
|
|
112
|
+
|
|
113
|
+
export function App() {
|
|
114
|
+
return <div style={{ height: 640 }}><ArbiChat apiUrl="https://YOUR-ARBI-DEPLOYMENT" /></div>
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The example supplies the dependencies and Tailwind/Blocks stylesheet order. Keep all `@arbidocs`
|
|
119
|
+
packages on matching versions. Sign in inside the widget and choose a workspace explicitly;
|
|
120
|
+
never put passwords or session tokens in `VITE_` variables. The deployment must allow your app's
|
|
121
|
+
origin for API calls. SSO needs the deployment's existing supported callback/popup configuration.
|
|
122
|
+
|
|
123
|
+
To deploy: set `VITE_ARBI_URL`, run `npm run build`, and serve `dist/` on a static host. The URL is
|
|
124
|
+
public build configuration; no custom server is required by this example.
|
|
125
|
+
|
|
126
|
+
An app already using `ArbiHost` should use `ConnectedEmbeddedChat` inside that host, sharing its
|
|
127
|
+
session, current workspace and React Query cache. Do not create a second standalone widget to
|
|
128
|
+
bypass the host's workspace choice.
|
|
129
|
+
|
|
130
|
+
## Website iframe
|
|
131
|
+
|
|
132
|
+
Use your ARBI **frontend** origin:
|
|
133
|
+
|
|
134
|
+
```html
|
|
135
|
+
<iframe
|
|
136
|
+
src="https://YOUR-ARBI-FRONTEND/embed/chat"
|
|
137
|
+
title="ARBI chat"
|
|
138
|
+
style="width:380px;height:640px;border:0"
|
|
139
|
+
allow="clipboard-write"
|
|
140
|
+
></iframe>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
The panel owns sign-in, workspace choice and chat. This is authenticated workspace chat. The
|
|
144
|
+
parent page needs no ARBI packages, credentials or workspace keys. Your deployment must allow
|
|
145
|
+
this site to frame the embed route; the parent site's CSP must allow the frontend in `frame-src`.
|
|
146
|
+
Embedded storage restrictions can require a separate sign-in. Configure framing only for the embed route; keep restrictions on the API and other routes.
|
|
147
|
+
For host integration, use the connected widget described above.
|
|
148
|
+
|
|
149
|
+
## If something fails
|
|
150
|
+
|
|
151
|
+
| Symptom | Check |
|
|
152
|
+
| --- | --- |
|
|
153
|
+
| Login fails | Correct deployment URL and account domain? Password sign-in supported? Do not auto-register or disable SSO to recover. |
|
|
154
|
+
| No workspace selected / access denied | Sign in, list available workspaces, then explicitly select one you can open. Configuration or agent selection does not grant access. |
|
|
155
|
+
| Browser API requests blocked | Deployment CORS allowlist includes the app's exact origin. Never put a privileged server credential in the browser to bypass this. |
|
|
156
|
+
| Iframe blocked | Deployment `frame-ancestors` and parent `frame-src` permit the embed. Keep restrictions on other routes. |
|
|
157
|
+
| Structured output rejected | Check [supported modes](compatibility.md); native-agent and slash/delegation paths currently reject JSON Schema requests explicitly. |
|
|
158
|
+
| Request failed / stream disconnected | Keep error `code`, `status`, `requestId` and `responseId` when available. Inspect or attach to the existing response before creating another task. Do not log credentials or chat content. |
|
|
159
|
+
|
|
160
|
+
See the [compatibility table](compatibility.md) before moving an existing OpenAI, Vercel or Claude
|
|
161
|
+
integration. Familiar methods do not imply that every provider's fields or tool protocol are supported.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VITE_ARBI_URL=https://your-arbi-deployment.example
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# ARBI React chat starter
|
|
2
|
+
|
|
3
|
+
Use Node 22.22+. Rename gitignore to .gitignore, run npm install, copy .env.example to .env, set the public VITE_ARBI_URL,
|
|
4
|
+
then run npm run dev. Sign in inside the widget and explicitly choose a workspace.
|
|
5
|
+
Run npm run build and serve dist/ to deploy. Keep credentials out of VITE_ variables.
|
|
6
|
+
See the SDK README on https://www.npmjs.com/package/@arbidocs/sdk for the developer guide.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>ARBI chat</title></head><body><div id="root"></div><script type="module" src="/src/main.tsx"></script></body></html>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "arbi-react-chat-basic",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "vite",
|
|
7
|
+
"build": "vite build",
|
|
8
|
+
"preview": "vite preview"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@arbidocs/blocks": "0.5.66",
|
|
12
|
+
"@arbidocs/react": "0.5.66",
|
|
13
|
+
"@tanstack/react-query": "^5.90.5",
|
|
14
|
+
"react": "^19.2.0",
|
|
15
|
+
"react-dom": "^19.2.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/react": "^19.2.2",
|
|
19
|
+
"@types/react-dom": "^19.2.2",
|
|
20
|
+
"@vitejs/plugin-react": "^5.1.0",
|
|
21
|
+
"typescript": "^5.9.3",
|
|
22
|
+
"vite": "^7.1.12",
|
|
23
|
+
"@tailwindcss/vite": "^4.1.0",
|
|
24
|
+
"tailwindcss": "^4.1.0"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=22.13.0"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ArbiChat } from '@arbidocs/blocks/embed'
|
|
2
|
+
const apiUrl = import.meta.env.VITE_ARBI_URL
|
|
3
|
+
export function App() {
|
|
4
|
+
if (!apiUrl) return <p>Set VITE_ARBI_URL to your ARBI deployment and restart the app.</p>
|
|
5
|
+
return (
|
|
6
|
+
<main style={{ height: '100dvh' }}>
|
|
7
|
+
<ArbiChat apiUrl={apiUrl} />
|
|
8
|
+
</main>
|
|
9
|
+
)
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arbidocs/sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.66",
|
|
4
4
|
"description": "Shared operations layer for ARBI — auth, config, SSE, WebSocket, and API operations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -36,16 +36,17 @@
|
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
"dist",
|
|
39
|
-
"examples"
|
|
39
|
+
"examples",
|
|
40
|
+
"docs"
|
|
40
41
|
],
|
|
41
42
|
"scripts": {
|
|
42
|
-
"build": "tsup",
|
|
43
|
+
"build": "node ../../scripts/package-sdk-examples.mjs && tsup",
|
|
43
44
|
"test": "vitest run",
|
|
44
45
|
"test:integration": "vitest run src/integration.test.ts src/websocket.integration.test.ts",
|
|
45
46
|
"typecheck": "tsc --noEmit"
|
|
46
47
|
},
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"@arbidocs/client": "0.5.
|
|
49
|
+
"@arbidocs/client": "0.5.66",
|
|
49
50
|
"ajv": "^8.20.0",
|
|
50
51
|
"jszip": "^3.10.1"
|
|
51
52
|
},
|