@arbidocs/sdk 0.5.146 → 0.5.147
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/{browser-C2Fm_iTe.d.cts → browser-8ZBWzFtx.d.cts} +245 -33
- package/dist/{browser-Cnw8-hVH.d.ts → browser-DKHZ8Q9X.d.ts} +245 -33
- package/dist/browser.cjs +219 -80
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +215 -81
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +289 -149
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +281 -146
- package/dist/index.js.map +1 -1
- package/examples/human-review/package.json +1 -1
- package/examples/react-chat/package.json +2 -2
- package/package.json +2 -2
package/dist/browser.cjs
CHANGED
|
@@ -3707,7 +3707,7 @@ async function authenticatedFetch(options) {
|
|
|
3707
3707
|
const {
|
|
3708
3708
|
baseUrl,
|
|
3709
3709
|
accessToken,
|
|
3710
|
-
path:
|
|
3710
|
+
path: path3,
|
|
3711
3711
|
method,
|
|
3712
3712
|
body,
|
|
3713
3713
|
headers,
|
|
@@ -3716,7 +3716,7 @@ async function authenticatedFetch(options) {
|
|
|
3716
3716
|
} = options;
|
|
3717
3717
|
let res;
|
|
3718
3718
|
try {
|
|
3719
|
-
res = await send(`${baseUrl}${
|
|
3719
|
+
res = await send(`${baseUrl}${path3}`, {
|
|
3720
3720
|
method: method ?? (body ? "POST" : "GET"),
|
|
3721
3721
|
headers: {
|
|
3722
3722
|
Authorization: `Bearer ${accessToken}`,
|
|
@@ -4163,6 +4163,7 @@ async function streamSSE(response, callbacks = {}) {
|
|
|
4163
4163
|
let assistantMessageExtId = null;
|
|
4164
4164
|
const agentSteps = [];
|
|
4165
4165
|
let toolCallCount = 0;
|
|
4166
|
+
let agentStepCount = 0;
|
|
4166
4167
|
const errors = [];
|
|
4167
4168
|
const artifacts = [];
|
|
4168
4169
|
let userMessage = null;
|
|
@@ -4242,7 +4243,8 @@ async function streamSSE(response, callbacks = {}) {
|
|
|
4242
4243
|
if (item?.type === "function_call" || item?.type === "reasoning") {
|
|
4243
4244
|
const label = formatItemLabel(item);
|
|
4244
4245
|
if (label) agentSteps.push(label);
|
|
4245
|
-
if (item.type === "function_call") toolCallCount += 1;
|
|
4246
|
+
if (item.type === "function_call" && item.name) toolCallCount += 1;
|
|
4247
|
+
if (item.type === "reasoning" && item.arbi?.step !== "goal") agentStepCount += 1;
|
|
4246
4248
|
}
|
|
4247
4249
|
callbacks.onOutputItemDone?.(data);
|
|
4248
4250
|
if (data.t != null) callbacks.onElapsedTime?.(data.t);
|
|
@@ -4410,6 +4412,7 @@ async function streamSSE(response, callbacks = {}) {
|
|
|
4410
4412
|
assistantMessageExtId,
|
|
4411
4413
|
agentSteps,
|
|
4412
4414
|
toolCallCount,
|
|
4415
|
+
agentStepCount,
|
|
4413
4416
|
errors,
|
|
4414
4417
|
userMessage,
|
|
4415
4418
|
metadata,
|
|
@@ -5037,7 +5040,7 @@ async function diagnoseSetup(options) {
|
|
|
5037
5040
|
);
|
|
5038
5041
|
return { ok: false, checks };
|
|
5039
5042
|
}
|
|
5040
|
-
const request = (
|
|
5043
|
+
const request = (path3, authenticated = false) => (options.fetch ?? globalThis.fetch)(`${base.href.replace(/\/$/, "")}${path3}`, {
|
|
5041
5044
|
method: "GET",
|
|
5042
5045
|
credentials: "omit",
|
|
5043
5046
|
redirect: "error",
|
|
@@ -6740,12 +6743,12 @@ async function prepareSecureMail(compose, sender, { requestId, senderPublicKey,
|
|
|
6740
6743
|
async function claimSecureMail(mail, id, fragmentKey, recipientPublicKey) {
|
|
6741
6744
|
const key = client.decodeSecureMailKey(fragmentKey);
|
|
6742
6745
|
try {
|
|
6743
|
-
const
|
|
6744
|
-
const response = await mail(
|
|
6746
|
+
const path3 = `/secure/${encodeURIComponent(id)}`;
|
|
6747
|
+
const response = await mail(path3);
|
|
6745
6748
|
const { raw } = await client.openSecureMail(await response.json(), key);
|
|
6746
6749
|
raw.fill(0);
|
|
6747
6750
|
const claim = await client.secureMailClaim(key, recipientPublicKey);
|
|
6748
|
-
const claimed = await mail(`${
|
|
6751
|
+
const claimed = await mail(`${path3}/claim`, { method: "POST", body: JSON.stringify(claim) });
|
|
6749
6752
|
return await claimed.json();
|
|
6750
6753
|
} finally {
|
|
6751
6754
|
key.fill(0);
|
|
@@ -9102,43 +9105,112 @@ async function confirmSpendLimits(arbi, projectExtId, body) {
|
|
|
9102
9105
|
"Failed to confirm spending limits"
|
|
9103
9106
|
);
|
|
9104
9107
|
}
|
|
9105
|
-
|
|
9108
|
+
|
|
9109
|
+
// src/operations/pages.ts
|
|
9110
|
+
var pages_exports = {};
|
|
9111
|
+
__export(pages_exports, {
|
|
9112
|
+
PagePrivateContentError: () => PagePrivateContentError,
|
|
9113
|
+
createPage: () => createPage,
|
|
9114
|
+
deletePage: () => deletePage,
|
|
9115
|
+
getPage: () => getPage,
|
|
9116
|
+
listPages: () => listPages,
|
|
9117
|
+
sharePage: () => sharePage,
|
|
9118
|
+
updatePage: () => updatePage
|
|
9119
|
+
});
|
|
9120
|
+
var PagePrivateContentError = class extends ArbiApiError {
|
|
9121
|
+
views;
|
|
9122
|
+
documents;
|
|
9123
|
+
constructor(message, views, documents, apiError) {
|
|
9124
|
+
super(message, apiError, 409, { code: "page_uses_private_content" });
|
|
9125
|
+
this.name = "PagePrivateContentError";
|
|
9126
|
+
this.views = views;
|
|
9127
|
+
this.documents = documents;
|
|
9128
|
+
}
|
|
9129
|
+
};
|
|
9106
9130
|
var decoder = new TextDecoder();
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
const
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9131
|
+
function refusal3(result, fallback) {
|
|
9132
|
+
if (!result.error) return null;
|
|
9133
|
+
const detail = result.error.detail;
|
|
9134
|
+
if (result.response?.status === 409 && detail?.code === "page_uses_private_content") {
|
|
9135
|
+
return new PagePrivateContentError(
|
|
9136
|
+
detail.message ?? fallback,
|
|
9137
|
+
detail.views ?? [],
|
|
9138
|
+
detail.documents ?? [],
|
|
9139
|
+
result.error
|
|
9140
|
+
);
|
|
9141
|
+
}
|
|
9142
|
+
return null;
|
|
9143
|
+
}
|
|
9144
|
+
function pageOf(row, keypair) {
|
|
9145
|
+
let legacyJson = null;
|
|
9146
|
+
if (row.sealed && keypair) {
|
|
9115
9147
|
try {
|
|
9116
|
-
|
|
9148
|
+
legacyJson = decoder.decode(client.sealedBoxDecrypt(row.sealed, keypair.secretKey));
|
|
9117
9149
|
} catch {
|
|
9118
9150
|
}
|
|
9119
|
-
|
|
9120
|
-
|
|
9151
|
+
}
|
|
9152
|
+
return {
|
|
9153
|
+
id: row.external_id,
|
|
9154
|
+
workspaceId: row.workspace_id ?? null,
|
|
9155
|
+
shared: row.shared,
|
|
9156
|
+
spec: row.spec ?? null,
|
|
9157
|
+
legacyJson,
|
|
9158
|
+
unreadable: !!row.sealed && legacyJson === null,
|
|
9159
|
+
viewIds: row.view_ids ?? [],
|
|
9160
|
+
documentIds: row.document_ids ?? [],
|
|
9161
|
+
createdBy: row.created_by ?? null,
|
|
9162
|
+
updatedBy: row.updated_by ?? null,
|
|
9163
|
+
createdAt: row.created_at,
|
|
9164
|
+
updatedAt: row.updated_at
|
|
9165
|
+
};
|
|
9121
9166
|
}
|
|
9122
|
-
async function
|
|
9123
|
-
const
|
|
9124
|
-
|
|
9125
|
-
|
|
9126
|
-
|
|
9127
|
-
|
|
9128
|
-
}),
|
|
9129
|
-
"Failed to
|
|
9130
|
-
)
|
|
9131
|
-
|
|
9132
|
-
|
|
9167
|
+
async function pagesOf(rows, keypair) {
|
|
9168
|
+
const key = rows.some((r2) => r2.sealed) ? await keypair().catch(() => null) : null;
|
|
9169
|
+
return rows.map((r2) => pageOf(r2, key));
|
|
9170
|
+
}
|
|
9171
|
+
async function listPages(arbi, keypair, query2 = {}) {
|
|
9172
|
+
const rows = requireData(
|
|
9173
|
+
await arbi.fetch.GET("/v1/pages", { params: { query: query2 } }),
|
|
9174
|
+
"Failed to load the pages"
|
|
9175
|
+
);
|
|
9176
|
+
return pagesOf(rows, keypair);
|
|
9177
|
+
}
|
|
9178
|
+
async function getPage(arbi, keypair, id) {
|
|
9179
|
+
const row = requireData(
|
|
9180
|
+
await arbi.fetch.GET("/v1/pages/{page_id}", { params: { path: { page_id: id } } }),
|
|
9181
|
+
"Failed to open the page"
|
|
9133
9182
|
);
|
|
9134
|
-
return
|
|
9183
|
+
return (await pagesOf([row], keypair))[0];
|
|
9184
|
+
}
|
|
9185
|
+
async function createPage(arbi, page) {
|
|
9186
|
+
const result = await arbi.fetch.POST("/v1/pages", {
|
|
9187
|
+
body: { spec: page.spec, shared: page.shared ?? false }
|
|
9188
|
+
});
|
|
9189
|
+
const refused = refusal3(result, "The page could not be shared");
|
|
9190
|
+
if (refused) throw refused;
|
|
9191
|
+
return pageOf(requireData(result, "Failed to save the page"), null);
|
|
9192
|
+
}
|
|
9193
|
+
async function updatePage(arbi, id, spec) {
|
|
9194
|
+
const result = await arbi.fetch.PUT("/v1/pages/{page_id}", {
|
|
9195
|
+
params: { path: { page_id: id } },
|
|
9196
|
+
body: { spec }
|
|
9197
|
+
});
|
|
9198
|
+
const refused = refusal3(result, "The page could not be saved");
|
|
9199
|
+
if (refused) throw refused;
|
|
9200
|
+
return pageOf(requireData(result, "Failed to save the page"), null);
|
|
9135
9201
|
}
|
|
9136
|
-
async function
|
|
9202
|
+
async function sharePage(arbi, id) {
|
|
9203
|
+
const result = await arbi.fetch.POST("/v1/pages/{page_id}/share", {
|
|
9204
|
+
params: { path: { page_id: id } }
|
|
9205
|
+
});
|
|
9206
|
+
const refused = refusal3(result, "The page could not be shared");
|
|
9207
|
+
if (refused) throw refused;
|
|
9208
|
+
return pageOf(requireData(result, "Failed to share the page"), null);
|
|
9209
|
+
}
|
|
9210
|
+
async function deletePage(arbi, id) {
|
|
9137
9211
|
requireOk(
|
|
9138
|
-
await arbi.fetch.DELETE("/v1/
|
|
9139
|
-
|
|
9140
|
-
}),
|
|
9141
|
-
"Failed to delete the dashboard"
|
|
9212
|
+
await arbi.fetch.DELETE("/v1/pages/{page_id}", { params: { path: { page_id: id } } }),
|
|
9213
|
+
"Failed to delete the page"
|
|
9142
9214
|
);
|
|
9143
9215
|
}
|
|
9144
9216
|
|
|
@@ -9157,7 +9229,6 @@ __export(work_exports, {
|
|
|
9157
9229
|
listConversationPeople: () => listConversationPeople,
|
|
9158
9230
|
notifyConversation: () => notifyConversation,
|
|
9159
9231
|
planWork: () => planWork,
|
|
9160
|
-
removeConversationPerson: () => removeConversationPerson,
|
|
9161
9232
|
runConversation: () => runConversation,
|
|
9162
9233
|
sendBackStep: () => sendBackStep,
|
|
9163
9234
|
skipStep: () => skipStep,
|
|
@@ -9915,14 +9986,6 @@ async function listConversationPeople(arbi, conversationId) {
|
|
|
9915
9986
|
"Failed to fetch the people of the conversation"
|
|
9916
9987
|
);
|
|
9917
9988
|
}
|
|
9918
|
-
async function removeConversationPerson(arbi, conversationId, userId) {
|
|
9919
|
-
requireOk(
|
|
9920
|
-
await arbi.fetch.DELETE("/v1/conversation/{conversation_ext_id}/people/{user_ext_id}", {
|
|
9921
|
-
params: { path: { conversation_ext_id: conversationId, user_ext_id: userId } }
|
|
9922
|
-
}),
|
|
9923
|
-
"Failed to remove the person from the conversation"
|
|
9924
|
-
);
|
|
9925
|
-
}
|
|
9926
9989
|
async function getActivity(arbi, conversationId) {
|
|
9927
9990
|
return requireData(
|
|
9928
9991
|
await arbi.fetch.GET("/v1/conversation/{conversation_ext_id}/activity", byId(conversationId)),
|
|
@@ -10206,13 +10269,13 @@ async function addDatabaseRows(arbi, databaseId, rows, options = {}) {
|
|
|
10206
10269
|
"Failed to add rows"
|
|
10207
10270
|
);
|
|
10208
10271
|
}
|
|
10209
|
-
async function shareDatabaseRow(arbi, databaseId, rowId
|
|
10272
|
+
async function shareDatabaseRow(arbi, databaseId, rowId) {
|
|
10210
10273
|
return requireData(
|
|
10211
10274
|
await arbi.fetch.POST("/v1/databases/{database_id}/rows/{row_id}/share", {
|
|
10212
10275
|
params: { path: { database_id: databaseId, row_id: rowId } },
|
|
10213
|
-
body: { shared }
|
|
10276
|
+
body: { shared: true }
|
|
10214
10277
|
}),
|
|
10215
|
-
|
|
10278
|
+
"Failed to submit the row"
|
|
10216
10279
|
);
|
|
10217
10280
|
}
|
|
10218
10281
|
async function updateDatabaseRow(arbi, databaseId, rowId, values) {
|
|
@@ -10261,6 +10324,63 @@ async function exportDatabase(arbi, databaseId, format) {
|
|
|
10261
10324
|
);
|
|
10262
10325
|
}
|
|
10263
10326
|
|
|
10327
|
+
// src/operations/views.ts
|
|
10328
|
+
var views_exports = {};
|
|
10329
|
+
__export(views_exports, {
|
|
10330
|
+
DOCUMENTS_VIEW_TARGET: () => DOCUMENTS_VIEW_TARGET,
|
|
10331
|
+
createTableView: () => createTableView,
|
|
10332
|
+
deleteTableView: () => deleteTableView,
|
|
10333
|
+
filterText: () => filterText,
|
|
10334
|
+
getTableView: () => getTableView,
|
|
10335
|
+
listTableViews: () => listTableViews,
|
|
10336
|
+
shareTableView: () => shareTableView,
|
|
10337
|
+
updateTableView: () => updateTableView
|
|
10338
|
+
});
|
|
10339
|
+
var DOCUMENTS_VIEW_TARGET = "documents";
|
|
10340
|
+
var path2 = (viewId) => ({ path: { view_id: viewId } });
|
|
10341
|
+
async function listTableViews(arbi, target) {
|
|
10342
|
+
return requireData(
|
|
10343
|
+
await arbi.fetch.GET("/v1/views", { params: { query: target ? { target } : {} } }),
|
|
10344
|
+
"Failed to list the views"
|
|
10345
|
+
);
|
|
10346
|
+
}
|
|
10347
|
+
async function getTableView(arbi, viewId) {
|
|
10348
|
+
return requireData(
|
|
10349
|
+
await arbi.fetch.GET("/v1/views/{view_id}", { params: path2(viewId) }),
|
|
10350
|
+
"Failed to read the view"
|
|
10351
|
+
);
|
|
10352
|
+
}
|
|
10353
|
+
async function createTableView(arbi, target, spec, options = {}) {
|
|
10354
|
+
return requireData(
|
|
10355
|
+
await arbi.fetch.POST("/v1/views", {
|
|
10356
|
+
body: { target, spec, shared: options.shared ?? false }
|
|
10357
|
+
}),
|
|
10358
|
+
"Failed to save the view"
|
|
10359
|
+
);
|
|
10360
|
+
}
|
|
10361
|
+
async function updateTableView(arbi, viewId, spec) {
|
|
10362
|
+
return requireData(
|
|
10363
|
+
await arbi.fetch.PATCH("/v1/views/{view_id}", { params: path2(viewId), body: { spec } }),
|
|
10364
|
+
"Failed to update the view"
|
|
10365
|
+
);
|
|
10366
|
+
}
|
|
10367
|
+
async function shareTableView(arbi, viewId) {
|
|
10368
|
+
return requireData(
|
|
10369
|
+
await arbi.fetch.POST("/v1/views/{view_id}/share", { params: path2(viewId) }),
|
|
10370
|
+
"Failed to share the view"
|
|
10371
|
+
);
|
|
10372
|
+
}
|
|
10373
|
+
async function deleteTableView(arbi, viewId) {
|
|
10374
|
+
requireOk(
|
|
10375
|
+
await arbi.fetch.DELETE("/v1/views/{view_id}", { params: path2(viewId) }),
|
|
10376
|
+
"Failed to delete the view"
|
|
10377
|
+
);
|
|
10378
|
+
}
|
|
10379
|
+
function filterText(filter) {
|
|
10380
|
+
const value = filter.value;
|
|
10381
|
+
return value === null || value === void 0 || value === "" ? `${filter.column}:${filter.op}` : `${filter.column}:${filter.op}:${String(value)}`;
|
|
10382
|
+
}
|
|
10383
|
+
|
|
10264
10384
|
// src/operations/mail.ts
|
|
10265
10385
|
var mail_exports = {};
|
|
10266
10386
|
__export(mail_exports, {
|
|
@@ -10294,9 +10414,9 @@ __export(mail_exports, {
|
|
|
10294
10414
|
});
|
|
10295
10415
|
var NATIVE_ACCOUNT = "native";
|
|
10296
10416
|
function createMailFetch(auth) {
|
|
10297
|
-
return (
|
|
10417
|
+
return (path3, init = {}) => authenticatedFetch({
|
|
10298
10418
|
...auth,
|
|
10299
|
-
path: `/v1/mail${
|
|
10419
|
+
path: `/v1/mail${path3}`,
|
|
10300
10420
|
method: init.method,
|
|
10301
10421
|
body: init.body,
|
|
10302
10422
|
headers: {
|
|
@@ -10436,8 +10556,8 @@ function getMessage2(mail, messageId2, accountId = NATIVE_ACCOUNT) {
|
|
|
10436
10556
|
return json(mail(`${accountPath(accountId)}/messages/${encodeURIComponent(messageId2)}`));
|
|
10437
10557
|
}
|
|
10438
10558
|
async function downloadAttachment(mail, messageId2, attachmentId, accountId = NATIVE_ACCOUNT) {
|
|
10439
|
-
const
|
|
10440
|
-
return new Uint8Array(await (await mail(
|
|
10559
|
+
const path3 = `${accountPath(accountId)}/messages/${encodeURIComponent(messageId2)}/attachments/${encodeURIComponent(attachmentId)}`;
|
|
10560
|
+
return new Uint8Array(await (await mail(path3)).arrayBuffer());
|
|
10441
10561
|
}
|
|
10442
10562
|
async function updateMessage(mail, messageId2, update, accountId = NATIVE_ACCOUNT) {
|
|
10443
10563
|
await mail(`${accountPath(accountId)}/messages/${encodeURIComponent(messageId2)}`, {
|
|
@@ -12293,21 +12413,22 @@ var Arbi = class {
|
|
|
12293
12413
|
*/
|
|
12294
12414
|
me: () => getCurrentUser(this.requireClient())
|
|
12295
12415
|
};
|
|
12296
|
-
// ──
|
|
12297
|
-
|
|
12298
|
-
/** The
|
|
12299
|
-
|
|
12300
|
-
|
|
12301
|
-
|
|
12302
|
-
|
|
12303
|
-
|
|
12304
|
-
|
|
12305
|
-
|
|
12306
|
-
|
|
12307
|
-
|
|
12308
|
-
),
|
|
12309
|
-
remove: (id) => deleteUserDashboard(this.requireClient(), id)
|
|
12416
|
+
// ── Pages (the open workspace's; private until shared) ──
|
|
12417
|
+
pages = {
|
|
12418
|
+
/** The open workspace's pages the user can see, oldest first (with their dashboards from
|
|
12419
|
+
* before pages, opened with their key). */
|
|
12420
|
+
list: (query2) => listPages(this.requireClient(), this.sealedPageKey, query2),
|
|
12421
|
+
get: (id) => getPage(this.requireClient(), this.sealedPageKey, id),
|
|
12422
|
+
/** Create a page, private unless `shared`. */
|
|
12423
|
+
create: (page) => createPage(this.requireClient(), page),
|
|
12424
|
+
/** Replace a page's spec (a dashboard from before pages is placed in the open workspace). */
|
|
12425
|
+
update: (id, spec) => updatePage(this.requireClient(), id, spec),
|
|
12426
|
+
/** Share a page with the workspace (one-way: a shared page stays shared). */
|
|
12427
|
+
share: (id) => sharePage(this.requireClient(), id),
|
|
12428
|
+
remove: (id) => deletePage(this.requireClient(), id)
|
|
12310
12429
|
};
|
|
12430
|
+
/** The user's own key, which opens their dashboards from before pages. */
|
|
12431
|
+
sealedPageKey = async () => (await this.requireChatCrypto()).encryptionKeypair;
|
|
12311
12432
|
// ── Firm ──────────────────────────────────────────────────────────────
|
|
12312
12433
|
firm = {
|
|
12313
12434
|
/** The firm's pooled monthly £ of AI usage (`has_pool` false where there is none). */
|
|
@@ -12717,9 +12838,9 @@ var Arbi = class {
|
|
|
12717
12838
|
await this.requireTargetWorkspace(options?.workspaceId)
|
|
12718
12839
|
),
|
|
12719
12840
|
/**
|
|
12720
|
-
* Patch a conversation: `title`, `shared` (
|
|
12721
|
-
* (`bound_document_ext_id`, `null` unbinds), and the work fields (`description`,
|
|
12722
|
-
* `parent_conversation_ext_id`, `status`, `plan`). The one call behind rename, share
|
|
12841
|
+
* Patch a conversation: `title`, `shared: true` (its creator only; sharing is one-way), its
|
|
12842
|
+
* bound document (`bound_document_ext_id`, `null` unbinds), and the work fields (`description`,
|
|
12843
|
+
* `due_at`, `parent_conversation_ext_id`, `status`, `plan`). The one call behind rename, share
|
|
12723
12844
|
* and attaching a thread to a document.
|
|
12724
12845
|
*/
|
|
12725
12846
|
update: (conversationId, body) => updateConversation(this.requireClient(), conversationId, body),
|
|
@@ -12755,8 +12876,6 @@ var Arbi = class {
|
|
|
12755
12876
|
notify: (conversationId, userIds) => notifyConversation(this.requireClient(), conversationId, userIds),
|
|
12756
12877
|
/** The people a conversation is shared with by name (cc'd or @mentioned). */
|
|
12757
12878
|
people: (conversationId) => listConversationPeople(this.requireClient(), conversationId),
|
|
12758
|
-
/** Take a named person off a conversation (a workspace owner only). */
|
|
12759
|
-
removePerson: (conversationId, userId) => removeConversationPerson(this.requireClient(), conversationId, userId),
|
|
12760
12879
|
/** Draft an editable plan from an objective, in the current workspace or `options.workspaceId`. */
|
|
12761
12880
|
plan: async (body, options) => planWork(
|
|
12762
12881
|
this.requireClient(),
|
|
@@ -12839,11 +12958,11 @@ var Arbi = class {
|
|
|
12839
12958
|
};
|
|
12840
12959
|
/** Authenticated native Word transport, with normal session recovery. */
|
|
12841
12960
|
editor = {
|
|
12842
|
-
request: (
|
|
12961
|
+
request: (path3, options = {}) => this.recovering(async () => {
|
|
12843
12962
|
const { baseUrl, accessToken, fetch: send = globalThis.fetch } = this.getAuthHeaders();
|
|
12844
12963
|
const headers = new Headers(options.headers);
|
|
12845
12964
|
headers.set("Authorization", `Bearer ${accessToken}`);
|
|
12846
|
-
const response = await send(`${baseUrl}/v1/editor${
|
|
12965
|
+
const response = await send(`${baseUrl}/v1/editor${path3}`, { ...options, headers });
|
|
12847
12966
|
if (!response.ok) {
|
|
12848
12967
|
const body = await response.json().catch(() => null);
|
|
12849
12968
|
throw new ArbiApiError(body?.detail || `Document request failed (${response.status})`, {
|
|
@@ -12866,10 +12985,10 @@ var Arbi = class {
|
|
|
12866
12985
|
* With no token yet (a new tab) the session is restored first; a 401 re-logs in and is sent
|
|
12867
12986
|
* again once.
|
|
12868
12987
|
*/
|
|
12869
|
-
fetch: (
|
|
12870
|
-
const nativeRead =
|
|
12988
|
+
fetch: (path3, init = {}, { nativeUnlocked = false } = {}) => this.recovering(async () => {
|
|
12989
|
+
const nativeRead = path3.startsWith("/accounts/native/") && (init.method ?? "GET").toUpperCase() !== "POST";
|
|
12871
12990
|
if (nativeRead && !nativeUnlocked) await this.mail.unlockNative();
|
|
12872
|
-
return this.mailRequest(
|
|
12991
|
+
return this.mailRequest(path3, init);
|
|
12873
12992
|
}),
|
|
12874
12993
|
/**
|
|
12875
12994
|
* Unlock the signed-in user's native inbox for this server session (see `unlockNativeMail`).
|
|
@@ -12912,7 +13031,7 @@ var Arbi = class {
|
|
|
12912
13031
|
/** The native inbox unlock in flight (`mail.unlockNative`). */
|
|
12913
13032
|
nativeUnlock = null;
|
|
12914
13033
|
/** One request under `/v1/mail` on the session's token (see `mail.fetch`). */
|
|
12915
|
-
async mailRequest(
|
|
13034
|
+
async mailRequest(path3, init) {
|
|
12916
13035
|
const client = this.requireClient();
|
|
12917
13036
|
let token = client.session.getState().accessToken;
|
|
12918
13037
|
if (!token) token = await client.auth.relogin();
|
|
@@ -12922,7 +13041,7 @@ var Arbi = class {
|
|
|
12922
13041
|
const headers = new Headers(init.headers);
|
|
12923
13042
|
headers.set("Authorization", `Bearer ${bearer}`);
|
|
12924
13043
|
if (init.body && !headers.has("Content-Type")) headers.set("Content-Type", "application/json");
|
|
12925
|
-
return send(`${this.options.url}/v1/mail${
|
|
13044
|
+
return send(`${this.options.url}/v1/mail${path3}`, { ...init, headers });
|
|
12926
13045
|
};
|
|
12927
13046
|
let response = await request(token);
|
|
12928
13047
|
if (response.status === 401) {
|
|
@@ -14077,14 +14196,29 @@ var Arbi = class {
|
|
|
14077
14196
|
update: (databaseId, body) => updateDatabase(this.requireClient(), databaseId, body),
|
|
14078
14197
|
delete: (databaseId) => deleteDatabase(this.requireClient(), databaseId),
|
|
14079
14198
|
addRows: (databaseId, rows, options) => addDatabaseRows(this.requireClient(), databaseId, rows, options),
|
|
14080
|
-
/** Submit a draft row
|
|
14081
|
-
shareRow: (databaseId, rowId
|
|
14199
|
+
/** Submit a draft row: share it with the workspace (one-way: it never becomes a draft again). */
|
|
14200
|
+
shareRow: (databaseId, rowId) => shareDatabaseRow(this.requireClient(), databaseId, rowId),
|
|
14082
14201
|
updateRow: (databaseId, rowId, values) => updateDatabaseRow(this.requireClient(), databaseId, rowId, values),
|
|
14083
14202
|
deleteRows: (databaseId, ids) => deleteDatabaseRows(this.requireClient(), databaseId, ids),
|
|
14084
14203
|
import: (file, name) => importDatabase(this.requireClient(), file, name),
|
|
14085
14204
|
importRows: (databaseId, file) => importDatabaseRows(this.requireClient(), databaseId, file),
|
|
14086
14205
|
export: (databaseId, format) => exportDatabase(this.requireClient(), databaseId, format)
|
|
14087
14206
|
};
|
|
14207
|
+
// ── Table views (saved views of a database grid or the document table) ──
|
|
14208
|
+
/**
|
|
14209
|
+
* Saved views: private to their creator until shared with the workspace, for good (sharing is one
|
|
14210
|
+
* way); only a workspace owner deletes a shared view. `target` is a database id or `documents`.
|
|
14211
|
+
*/
|
|
14212
|
+
views = {
|
|
14213
|
+
/** The views the caller can see: of one table, or of every table of the open workspace. */
|
|
14214
|
+
list: (target) => listTableViews(this.requireClient(), target),
|
|
14215
|
+
get: (viewId) => getTableView(this.requireClient(), viewId),
|
|
14216
|
+
create: (target, spec, options) => createTableView(this.requireClient(), target, spec, options),
|
|
14217
|
+
update: (viewId, spec) => updateTableView(this.requireClient(), viewId, spec),
|
|
14218
|
+
/** Share with the workspace (one way: it is never made private again). */
|
|
14219
|
+
share: (viewId) => shareTableView(this.requireClient(), viewId),
|
|
14220
|
+
remove: (viewId) => deleteTableView(this.requireClient(), viewId)
|
|
14221
|
+
};
|
|
14088
14222
|
// ── Workspace facts ─────────────────────────────────────────────────
|
|
14089
14223
|
/**
|
|
14090
14224
|
* Notes. Create, list and search act in the current workspace, or `workspaceId` (opened for this
|
|
@@ -14897,6 +15031,7 @@ exports.ArbiWorkspaceSupersededError = ArbiWorkspaceSupersededError;
|
|
|
14897
15031
|
exports.ArbiWorkspaceUnavailableError = ArbiWorkspaceUnavailableError;
|
|
14898
15032
|
exports.CallApiError = CallApiError;
|
|
14899
15033
|
exports.DEFAULT_AI_USD_PER_GBP = DEFAULT_AI_USD_PER_GBP;
|
|
15034
|
+
exports.DOCUMENTS_VIEW_TARGET = DOCUMENTS_VIEW_TARGET;
|
|
14900
15035
|
exports.DRIVE_SYNC_VENDORS = DRIVE_SYNC_VENDORS;
|
|
14901
15036
|
exports.DuplicateContactError = DuplicateContactError;
|
|
14902
15037
|
exports.ENTITY_KINDS = ENTITY_KINDS;
|
|
@@ -14908,6 +15043,7 @@ exports.MAX_RETRIEVE_DOC_IDS = MAX_RETRIEVE_DOC_IDS;
|
|
|
14908
15043
|
exports.MICROSOFT_VENDORS = MICROSOFT_VENDORS;
|
|
14909
15044
|
exports.PRESENCE_KINDS = PRESENCE_KINDS;
|
|
14910
15045
|
exports.PROMPT_CONTEXT_CHARS = PROMPT_CONTEXT_CHARS;
|
|
15046
|
+
exports.PagePrivateContentError = PagePrivateContentError;
|
|
14911
15047
|
exports.PlanStepsError = PlanStepsError;
|
|
14912
15048
|
exports.PublicBookingError = PublicBookingError;
|
|
14913
15049
|
exports.ResponseStream = ResponseStream;
|
|
@@ -14963,6 +15099,7 @@ exports.facts = facts_exports;
|
|
|
14963
15099
|
exports.files = files_exports;
|
|
14964
15100
|
exports.filterDocumentTags = filterDocumentTags;
|
|
14965
15101
|
exports.filterSkills = filterSkills;
|
|
15102
|
+
exports.filterText = filterText;
|
|
14966
15103
|
exports.findLeafForTaskMessage = findLeafForTaskMessage;
|
|
14967
15104
|
exports.findMainSiblingLeaf = findMainSiblingLeaf;
|
|
14968
15105
|
exports.findReplyTarget = findReplyTarget;
|
|
@@ -15017,6 +15154,7 @@ exports.mcpTools = mcpTools;
|
|
|
15017
15154
|
exports.mergeAgentSteps = mergeAgentSteps;
|
|
15018
15155
|
exports.modelConnections = model_connections_exports;
|
|
15019
15156
|
exports.notifications = notifications_exports;
|
|
15157
|
+
exports.pages = pages_exports;
|
|
15020
15158
|
exports.parseSSEEvents = parseSSEEvents;
|
|
15021
15159
|
exports.parseSlashCommand = parseSlashCommand;
|
|
15022
15160
|
exports.parseSlashTokenInProgress = parseSlashTokenInProgress;
|
|
@@ -15056,6 +15194,7 @@ exports.tagsForScope = tagsForScope;
|
|
|
15056
15194
|
exports.tagsOfGroup = tagsOfGroup;
|
|
15057
15195
|
exports.topLevelAgentSteps = topLevelAgentSteps;
|
|
15058
15196
|
exports.usdToGbp = usdToGbp;
|
|
15197
|
+
exports.views = views_exports;
|
|
15059
15198
|
exports.work = work_exports;
|
|
15060
15199
|
exports.workflowSteps = workflow_steps_exports;
|
|
15061
15200
|
exports.workflows = workflows_exports;
|