js-bao-wss-client 3.4.0 → 3.5.0-alpha.0
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 +10 -3
- package/dist/JsBaoClient.d.ts +3 -15
- package/dist/JsBaoClient.js +6 -61
- package/dist/agents/sessionModels.generated.d.ts +13 -0
- package/dist/agents/sessionModels.generated.js +7 -0
- package/dist/agents/uiMessageTypes.d.ts +360 -0
- package/dist/agents/uiMessageTypes.js +15 -0
- package/dist/agents/uiMessages.d.ts +105 -0
- package/dist/agents/uiMessages.js +467 -0
- package/dist/api/blobBucketsApi.d.ts +0 -2
- package/dist/api/collectionTypeConfigsApi.d.ts +5 -5
- package/dist/api/collectionsApi.d.ts +0 -28
- package/dist/api/databaseTypeConfigsApi.d.ts +2 -2
- package/dist/api/databasesApi.d.ts +1 -30
- package/dist/api/databasesApi.js +0 -22
- package/dist/api/documentsApi.d.ts +0 -26
- package/dist/api/documentsApi.js +17 -31
- package/dist/api/functionsApi.d.ts +0 -7
- package/dist/api/groupsApi.d.ts +14 -1
- package/dist/api/groupsApi.js +3 -1
- package/dist/api/invitationsApi.d.ts +1 -8
- package/dist/api/invitationsApi.js +1 -2
- package/dist/api/listResult.d.ts +0 -2
- package/dist/api/locksApi.d.ts +6 -3
- package/dist/api/locksApi.js +18 -6
- package/dist/api/meApi.d.ts +7 -10
- package/dist/api/meApi.js +4 -5
- package/dist/api/notificationsApi.d.ts +6 -3
- package/dist/api/notificationsApi.js +2 -1
- package/dist/browser.umd.js +535 -150
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/internal/analyticsQueue.d.ts +0 -5
- package/dist/internal/blobManager.d.ts +0 -2
- package/dist/internal/listEnvelope.d.ts +8 -13
- package/dist/internal/listEnvelope.js +10 -21
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -889,7 +889,7 @@ Additional flags:
|
|
|
889
889
|
### Pagination and tags
|
|
890
890
|
|
|
891
891
|
- Paging params: `limit`, `cursor`, `forward`, `returnPage`. Default sort is by `grantedAt` (document permission grant time) descending; pass `forward: true` for ascending.
|
|
892
|
-
- `returnPage: true` returns `{ items,
|
|
892
|
+
- `returnPage: true` returns `{ items, hasMore, nextCursor }` (backward-compatible array when omitted). With `refreshFromServer: true`, a background page walker fetches the remaining pages and updates the cache/`documentMetadataChanged` events; set `refreshFromServer: false` if you only want the first page. Note: cursors come from server responses; local-only/local-first paths do not fabricate cursors or enforce `limit` sizing—use `returnPage: true` when you need a cursor even if data is cached. To synchronously walk all pages yourself, loop on `{ returnPage: true, limit, cursor }`, passing each page's `nextCursor` back as `cursor`, until `nextCursor` is absent. To hydrate the full cache in one call, use `client.syncMetadata({ scope: "all", pageSize, includeRoot })` and then list with `refreshFromServer: false`.
|
|
893
893
|
- Server page size defaults to 100 when `limit` is omitted; you can request smaller/larger pages within server limits.
|
|
894
894
|
- Tag filtering: `tag: string` performs an exact-match filter server-side. Responses include `tags: string[]` and `grantedAt`; both are cached locally and usable offline (e.g., list + `tag` will be filtered from cache when offline/local-only). Root is also considered for tag queries—if you tag the root, it can appear in tag-filtered results even when the default list filters root out. When `refreshFromServer` is true with a tag, the client still fetches the full dataset in the background to keep the cache complete, then filters locally for the tag.
|
|
895
895
|
- Tag CRUD: server endpoints exist (`POST /documents/:id/tags { tag }`, `DELETE /documents/:id/tags/:tag`) and document create accepts optional tags; the high-level client currently exposes tagging via HTTP helpers or `client.makeRequest`.
|
|
@@ -1410,8 +1410,8 @@ const page1 = await client.document(documentId).blobs().list({ limit: 10 });
|
|
|
1410
1410
|
page1.items.forEach((b) => {
|
|
1411
1411
|
console.log(b.blobId, b.filename, b.size);
|
|
1412
1412
|
});
|
|
1413
|
-
if (page1.
|
|
1414
|
-
const page2 = await blobs.list({ cursor: page1.
|
|
1413
|
+
if (page1.nextCursor) {
|
|
1414
|
+
const page2 = await blobs.list({ cursor: page1.nextCursor });
|
|
1415
1415
|
}
|
|
1416
1416
|
```
|
|
1417
1417
|
|
|
@@ -1941,6 +1941,13 @@ const group = await client.groups.create({
|
|
|
1941
1941
|
description: "All engineers",
|
|
1942
1942
|
});
|
|
1943
1943
|
|
|
1944
|
+
// Create a group and stamp resource metadata on it in the same call
|
|
1945
|
+
const readingGroup = await client.groups.create({
|
|
1946
|
+
groupType: "class-reading-group",
|
|
1947
|
+
name: "Reading group",
|
|
1948
|
+
initialMetadata: { classLink: { classId: "class-A" } },
|
|
1949
|
+
});
|
|
1950
|
+
|
|
1944
1951
|
// List groups
|
|
1945
1952
|
const groups = await client.groups.list();
|
|
1946
1953
|
const teams = await client.groups.list({ type: "team" });
|
package/dist/JsBaoClient.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export type { DocumentInfo, DocumentPermissionEntry, DocumentAccessResult, Docum
|
|
|
43
43
|
export type { UserProfile, SharedDocument, SharedDocumentListResult, SharedDocumentsOptions, OwnedDocumentsOptions, } from "./api/meApi";
|
|
44
44
|
export type { SessionInfo } from "./api/sessionApi";
|
|
45
45
|
export type { BasicUserInfo, BatchUserProfile } from "./api/usersApi";
|
|
46
|
-
export type { DatabaseInfo, DatabasePermissionEntry, DatabaseGroupPermissionEntry, GrantDatabaseGroupPermissionParams, DatabaseOwnershipTransferResult, DatabaseOperationInfo, AddManagerParams,
|
|
46
|
+
export type { DatabaseInfo, DatabasePermissionEntry, DatabaseGroupPermissionEntry, GrantDatabaseGroupPermissionParams, DatabaseOwnershipTransferResult, DatabaseOperationInfo, AddManagerParams, CsvImportOptions, CsvImportProgress, CsvImportResult, CelContextResult, ExecuteOperationOptions, DatabaseChangeEvent, DatabaseChangePayload, DatabaseSubscribeOptions, ListDatabasesOptions, DatabaseListPage, OperationType, OperationFilter, QueryDefinition, MutationOperation, MutationDefinition, CountDefinition, AggregateOperation, AggregateDefinition, PipelineStep, PipelineDefinition, ApplyToQuerySource, ApplyToQueryAction, ApplyToQueryDefinition, OperationDefinition, CreateOperationParams, UpdateOperationParams, } from "./api/databasesApi";
|
|
47
47
|
export type { GroupInfo, GroupMemberInfo, GroupMembershipInfo, GroupDocumentInfo, GroupDatabaseInfo, ListUserMembershipsOptions, DirectGroupAdd, DeferredGroupAdd, GroupAddMemberResult, } from "./api/groupsApi";
|
|
48
48
|
export type { CollectionInfo, CollectionDocumentInfo, CollectionGroupPermissionInfo, CollectionMemberInfo, CollectionAccessInfo, DocumentCollectionInfo, AddCollectionMemberParams, DirectCollectionAdd, DeferredCollectionAdd, CollectionAddMemberResult, PendingCollectionInvitationEntry, } from "./api/collectionsApi";
|
|
49
49
|
export type { RuleSetInfo, RuleSetSchema, RuleSetTestResult, RuleSetDebugResult, TraceEntry, TriggerDefInfo, ModelRulesInfo, PathDeclaration, RuleLoads, RuleExpression, CategoryRules, } from "./api/ruleSetsApi";
|
|
@@ -72,7 +72,7 @@ export type { CollectionTypeConfigsAPI } from "./api/collectionTypeConfigsApi";
|
|
|
72
72
|
export type { DatabaseTypeConfigsAPI } from "./api/databaseTypeConfigsApi";
|
|
73
73
|
export type { CronTriggersAPI } from "./api/cronTriggersApi";
|
|
74
74
|
export type { CronTriggerInfo, CreateCronTriggerParams, UpdateCronTriggerParams, CronTriggerListResult, ObjectStatus, } from "./api/cronTriggersApi";
|
|
75
|
-
export type { CreateDocumentOptions,
|
|
75
|
+
export type { CreateDocumentOptions, CreateWithAliasOptions, GetOrCreateWithAliasOptions, DeleteDocumentOptions, DocumentAccessRequest, DocumentAccessRequestResponse, DocumentListOptions, DocumentListPage, EvictAllDocumentsOptions, EvictDocumentOptions, GrantGroupPermissionParams, ResolveAliasParams, SetAliasParams, UpdateDocumentData, DocumentIngestSession, DocumentIngestCounterBucket, DocumentIngestStageCounters, DocumentIngestChunkUpload, DocumentIngestChunkUploadResult, DocumentIngestPage, DocumentSnapshotBuild, DocumentSnapshotPage, DocumentSnapshotRequest, } from "./api/documentsApi";
|
|
76
76
|
export type { CreateDatabaseParams, UpdateDatabaseParams } from "./api/databasesApi";
|
|
77
77
|
export type { CreateCollectionParams, UpdateCollectionParams, GrantCollectionGroupPermissionParams, ListCollectionsOptions, } from "./api/collectionsApi";
|
|
78
78
|
export type { ListResult } from "./api/listResult";
|
|
@@ -91,7 +91,7 @@ export type { DocumentDebugSnapshot, DocumentPermission, LocalDocumentEntry, Loc
|
|
|
91
91
|
export type { LogLevel } from "./internal/logger";
|
|
92
92
|
export type { RequestOptions } from "./internal/httpClient";
|
|
93
93
|
export type { LocksAPI } from "./api/locksApi";
|
|
94
|
-
export type { FunctionsAPI, FunctionInvokeOptions, FunctionInvokeResult, FunctionInvokeStatus, FunctionInvokeLimits, FunctionStartOptions, FunctionStartResult, FunctionRunRef,
|
|
94
|
+
export type { FunctionsAPI, FunctionInvokeOptions, FunctionInvokeResult, FunctionInvokeStatus, FunctionInvokeLimits, FunctionStartOptions, FunctionStartResult, FunctionRunRef, FunctionRun, FunctionRunError, FunctionRunErrorCode, FunctionRunSettled, FunctionRunSlice, FunctionRunStatus, FunctionRunStatusValue, FunctionRunTerminalStatus, FunctionWaitOptions, } from "./api/functionsApi";
|
|
95
95
|
export type { LockHandle, LockContention, AcquireResponse, AcquireOptions, BlockingAcquireOptions, ReleaseResult, RenewResult, LockStatus, LockListEntry, LockListResult, } from "./api/locksApi";
|
|
96
96
|
export type { ResourceMetadataAPI } from "./api/resourceMetadataApi";
|
|
97
97
|
export type { ResourceMetadataReadResult, ResourceMetadataWriteResult, ResourceMetadataBatchRequestItem, ResourceMetadataBatchParams, ResourceMetadataBatchCategoryResult, ResourceMetadataBatchResourceResult, ResourceMetadataBatchResult, ResourceMetadataListEntry, ResourceMetadataListResult, ResourceMetadataDeleteResult, ResourceMetadataResolveParams, ResourceMetadataResolveResult, } from "./api/resourceMetadataApi";
|
|
@@ -1388,8 +1388,6 @@ export interface ListWorkflowRunsResult {
|
|
|
1388
1388
|
nextCursor?: string;
|
|
1389
1389
|
/** True when a next page exists. */
|
|
1390
1390
|
hasMore?: boolean;
|
|
1391
|
-
/** @deprecated Alias of `nextCursor` kept for one deprecation window. */
|
|
1392
|
-
cursor?: string;
|
|
1393
1391
|
/**
|
|
1394
1392
|
* How many runs the server examined to produce this page.
|
|
1395
1393
|
*
|
|
@@ -3037,14 +3035,6 @@ export declare class JsBaoClient extends Observable<any> {
|
|
|
3037
3035
|
* @param documentId - The document to check for local persistence
|
|
3038
3036
|
* @group Offline & Sync */
|
|
3039
3037
|
hasIndexedDbPersistence(documentId: string): Promise<boolean>;
|
|
3040
|
-
/** Update the local snapshot flag for a document.
|
|
3041
|
-
* @param documentId - The document to update the snapshot flag for
|
|
3042
|
-
* @param hasSnapshot - Whether the document has a local IndexedDB snapshot
|
|
3043
|
-
* @deprecated No longer called internally — `hasIndexedDbSnapshot` is now
|
|
3044
|
-
* ignored in favour of checking live ydoc content via `ydocHasData()`.
|
|
3045
|
-
* Retained for external callers; will be removed in a future major version.
|
|
3046
|
-
* @group Offline & Sync */
|
|
3047
|
-
updateLocalSnapshotFlag(documentId: string, hasSnapshot: boolean): Promise<void>;
|
|
3048
3038
|
private sendAwarenessState;
|
|
3049
3039
|
/** Remove awareness states for specific clients.
|
|
3050
3040
|
* @param documentId - The document to remove awareness from
|
|
@@ -4487,8 +4477,6 @@ export declare class JsBaoClient extends Observable<any> {
|
|
|
4487
4477
|
* @param timeoutMs - Maximum time to wait before rejecting (ms, default 30000)
|
|
4488
4478
|
* @group Offline & Sync */
|
|
4489
4479
|
waitForInitialSync(documentId: string, timeoutMs?: number): Promise<void>;
|
|
4490
|
-
/** @deprecated Use {@link waitForInitialSync} instead. */
|
|
4491
|
-
waitForSync(documentId: string, timeoutMs?: number): Promise<void>;
|
|
4492
4480
|
/**
|
|
4493
4481
|
* Wait until the server confirms it has all of this client's writes.
|
|
4494
4482
|
* Polls {@link checkStateVector} until `includesWrites` is true.
|
package/dist/JsBaoClient.js
CHANGED
|
@@ -1755,14 +1755,12 @@ export class JsBaoClient extends Observable {
|
|
|
1755
1755
|
const path = `/${endpoint}${qs.length ? `?${qs.join("&")}` : ""}`;
|
|
1756
1756
|
const response = await this.makeRequest("GET", path);
|
|
1757
1757
|
if (Array.isArray(response)) {
|
|
1758
|
-
return { items: response,
|
|
1758
|
+
return { items: response, nextCursor: null };
|
|
1759
1759
|
}
|
|
1760
1760
|
const page = response;
|
|
1761
|
-
// #1316: prefer `nextCursor`; fall back to the deprecated `cursor`
|
|
1762
|
-
// alias for older servers.
|
|
1763
1761
|
return {
|
|
1764
1762
|
items: page.items || [],
|
|
1765
|
-
|
|
1763
|
+
nextCursor: page.nextCursor ?? null,
|
|
1766
1764
|
};
|
|
1767
1765
|
};
|
|
1768
1766
|
const allItems = [];
|
|
@@ -1782,7 +1780,7 @@ export class JsBaoClient extends Observable {
|
|
|
1782
1780
|
allIds.add(id);
|
|
1783
1781
|
allItems.push(item);
|
|
1784
1782
|
}
|
|
1785
|
-
cursor = page.
|
|
1783
|
+
cursor = page.nextCursor || null;
|
|
1786
1784
|
} while (cursor);
|
|
1787
1785
|
}
|
|
1788
1786
|
items = allItems;
|
|
@@ -2077,13 +2075,13 @@ export class JsBaoClient extends Observable {
|
|
|
2077
2075
|
// response says nothing about where the scope ends.
|
|
2078
2076
|
if (Array.isArray(response))
|
|
2079
2077
|
return null;
|
|
2080
|
-
const items = response?.items
|
|
2078
|
+
const items = response?.items;
|
|
2081
2079
|
// A body that never mentioned `items` is not a page of this scope, and
|
|
2082
2080
|
// an empty list read as the whole scope evicts everything.
|
|
2083
2081
|
if (!Array.isArray(items))
|
|
2084
2082
|
return null;
|
|
2085
2083
|
collected.push(...items);
|
|
2086
|
-
const next = response?.nextCursor ??
|
|
2084
|
+
const next = response?.nextCursor ?? null;
|
|
2087
2085
|
if (!next) {
|
|
2088
2086
|
// No continuation token. If the page nevertheless says more rows
|
|
2089
2087
|
// remain, the walk cannot ask for them and so never reached the end
|
|
@@ -3733,16 +3731,13 @@ export class JsBaoClient extends Observable {
|
|
|
3733
3731
|
const path = `/workflows/runs${params.length ? `?${params.join("&")}` : ""}`;
|
|
3734
3732
|
const response = await this.makeRequest("GET", path);
|
|
3735
3733
|
const page = response;
|
|
3736
|
-
|
|
3737
|
-
// for older servers.
|
|
3738
|
-
const nextCursor = page?.nextCursor ?? page?.cursor ?? undefined;
|
|
3734
|
+
const nextCursor = page?.nextCursor ?? undefined;
|
|
3739
3735
|
const result = {
|
|
3740
3736
|
items: page?.items ?? [],
|
|
3741
3737
|
hasMore: typeof page?.hasMore === "boolean" ? page.hasMore : !!nextCursor,
|
|
3742
3738
|
};
|
|
3743
3739
|
if (nextCursor != null) {
|
|
3744
3740
|
result.nextCursor = nextCursor;
|
|
3745
|
-
result.cursor = nextCursor;
|
|
3746
3741
|
}
|
|
3747
3742
|
// #2237: filtered listings report how far the server's walk got. Only
|
|
3748
3743
|
// surfaced when the server actually sent a number — `undefined` means
|
|
@@ -4701,52 +4696,6 @@ export class JsBaoClient extends Observable {
|
|
|
4701
4696
|
}
|
|
4702
4697
|
return false;
|
|
4703
4698
|
}
|
|
4704
|
-
/** Update the local snapshot flag for a document.
|
|
4705
|
-
* @param documentId - The document to update the snapshot flag for
|
|
4706
|
-
* @param hasSnapshot - Whether the document has a local IndexedDB snapshot
|
|
4707
|
-
* @deprecated No longer called internally — `hasIndexedDbSnapshot` is now
|
|
4708
|
-
* ignored in favour of checking live ydoc content via `ydocHasData()`.
|
|
4709
|
-
* Retained for external callers; will be removed in a future major version.
|
|
4710
|
-
* @group Offline & Sync */
|
|
4711
|
-
async updateLocalSnapshotFlag(documentId, hasSnapshot) {
|
|
4712
|
-
const metaIndex = this.docManager.metadataIndex;
|
|
4713
|
-
const existing = metaIndex.get(documentId);
|
|
4714
|
-
const currentFlag = existing?.hasIndexedDbSnapshot === true;
|
|
4715
|
-
if (hasSnapshot === currentFlag)
|
|
4716
|
-
return;
|
|
4717
|
-
const next = (existing || { documentId });
|
|
4718
|
-
const changedFields = ["hasIndexedDbSnapshot"];
|
|
4719
|
-
if (hasSnapshot) {
|
|
4720
|
-
next.hasIndexedDbSnapshot = true;
|
|
4721
|
-
if (typeof next.localBytes !== "number" || next.localBytes <= 0) {
|
|
4722
|
-
next.localBytes = 1;
|
|
4723
|
-
changedFields.push("localBytes");
|
|
4724
|
-
}
|
|
4725
|
-
}
|
|
4726
|
-
else {
|
|
4727
|
-
delete next.hasIndexedDbSnapshot;
|
|
4728
|
-
if (typeof next.localBytes === "number" && next.localBytes > 0) {
|
|
4729
|
-
next.localBytes = 0;
|
|
4730
|
-
changedFields.push("localBytes");
|
|
4731
|
-
}
|
|
4732
|
-
}
|
|
4733
|
-
metaIndex.set(documentId, next);
|
|
4734
|
-
try {
|
|
4735
|
-
await this._putMetadataToIdb(next);
|
|
4736
|
-
}
|
|
4737
|
-
catch (_) { }
|
|
4738
|
-
try {
|
|
4739
|
-
this.emit("documentMetadataChanged", [
|
|
4740
|
-
{
|
|
4741
|
-
documentId,
|
|
4742
|
-
metadata: next,
|
|
4743
|
-
changedFields,
|
|
4744
|
-
source: "local",
|
|
4745
|
-
},
|
|
4746
|
-
]);
|
|
4747
|
-
}
|
|
4748
|
-
catch (_) { }
|
|
4749
|
-
}
|
|
4750
4699
|
// Send awareness state to server
|
|
4751
4700
|
sendAwarenessState(documentId) {
|
|
4752
4701
|
if (!this.ws || !this.wsconnected)
|
|
@@ -11606,10 +11555,6 @@ export class JsBaoClient extends Observable {
|
|
|
11606
11555
|
this.on("sync", onSync);
|
|
11607
11556
|
});
|
|
11608
11557
|
}
|
|
11609
|
-
/** @deprecated Use {@link waitForInitialSync} instead. */
|
|
11610
|
-
waitForSync(documentId, timeoutMs = 30000) {
|
|
11611
|
-
return this.waitForInitialSync(documentId, timeoutMs);
|
|
11612
|
-
}
|
|
11613
11558
|
/**
|
|
11614
11559
|
* Wait until the server confirms it has all of this client's writes.
|
|
11615
11560
|
* Polls {@link checkStateVector} until `includesWrites` is true.
|
|
@@ -18,24 +18,31 @@ export { encodeJsonColumn, decodeJsonColumn } from "./sessionModelRuntime";
|
|
|
18
18
|
export type { PrimitiveQueueEntry } from "./sessionModelRuntime";
|
|
19
19
|
/** The schema version a session row carries in `schemaVersion`. */
|
|
20
20
|
export declare const AGENT_SESSION_SCHEMA_VERSION = 1;
|
|
21
|
+
/** Values this client recognizes for `PrimitiveSessionStatus`. */
|
|
21
22
|
export declare const PRIMITIVE_SESSION_STATUSES: readonly ["idle", "thinking", "running_tool", "awaiting_answer", "failed", "expired", "cancelled"];
|
|
22
23
|
/** `"unknown"` is a value a newer server sent that this client does not know. */
|
|
23
24
|
export type PrimitiveSessionStatus = (typeof PRIMITIVE_SESSION_STATUSES)[number] | "unknown";
|
|
25
|
+
/** Values this client recognizes for `PrimitivePartKind`. */
|
|
24
26
|
export declare const PRIMITIVE_PART_KINDS: readonly ["text", "reasoning", "tool_call", "file", "event"];
|
|
25
27
|
/** `"unknown"` is a value a newer server sent that this client does not know. */
|
|
26
28
|
export type PrimitivePartKind = (typeof PRIMITIVE_PART_KINDS)[number] | "unknown";
|
|
29
|
+
/** Values this client recognizes for `PrimitiveTextState`. */
|
|
27
30
|
export declare const PRIMITIVE_TEXT_STATES: readonly ["streaming", "done"];
|
|
28
31
|
/** `"unknown"` is a value a newer server sent that this client does not know. */
|
|
29
32
|
export type PrimitiveTextState = (typeof PRIMITIVE_TEXT_STATES)[number] | "unknown";
|
|
33
|
+
/** Values this client recognizes for `PrimitiveToolCallState`. */
|
|
30
34
|
export declare const PRIMITIVE_TOOL_CALL_STATES: readonly ["input-streaming", "input-available", "approval-requested", "approval-responded", "output-available", "output-error", "output-denied"];
|
|
31
35
|
/** `"unknown"` is a value a newer server sent that this client does not know. */
|
|
32
36
|
export type PrimitiveToolCallState = (typeof PRIMITIVE_TOOL_CALL_STATES)[number] | "unknown";
|
|
37
|
+
/** Values this client recognizes for `PrimitiveAuthorKind`. */
|
|
33
38
|
export declare const PRIMITIVE_AUTHOR_KINDS: readonly ["user", "agent", "app"];
|
|
34
39
|
/** `"unknown"` is a value a newer server sent that this client does not know. */
|
|
35
40
|
export type PrimitiveAuthorKind = (typeof PRIMITIVE_AUTHOR_KINDS)[number] | "unknown";
|
|
41
|
+
/** Values this client recognizes for `PrimitiveStepKind`. */
|
|
36
42
|
export declare const PRIMITIVE_STEP_KINDS: readonly ["model_call", "tool_call"];
|
|
37
43
|
/** `"unknown"` is a value a newer server sent that this client does not know. */
|
|
38
44
|
export type PrimitiveStepKind = (typeof PRIMITIVE_STEP_KINDS)[number] | "unknown";
|
|
45
|
+
/** Values this client recognizes for `PrimitiveStepStatus`. */
|
|
39
46
|
export declare const PRIMITIVE_STEP_STATUSES: readonly ["running", "completed", "failed"];
|
|
40
47
|
/** `"unknown"` is a value a newer server sent that this client does not know. */
|
|
41
48
|
export type PrimitiveStepStatus = (typeof PRIMITIVE_STEP_STATUSES)[number] | "unknown";
|
|
@@ -182,18 +189,21 @@ interface PrimitivePartRecordBase {
|
|
|
182
189
|
modifiedAt?: string;
|
|
183
190
|
row?: PrimitivePartRow;
|
|
184
191
|
}
|
|
192
|
+
/** A decoded `PrimitivePart` record with `kind: "text"`. */
|
|
185
193
|
export interface PrimitiveTextPartRecord extends PrimitivePartRecordBase {
|
|
186
194
|
kind: "text";
|
|
187
195
|
state?: PrimitiveTextState;
|
|
188
196
|
text?: string;
|
|
189
197
|
providerMetadata?: Record<string, unknown>;
|
|
190
198
|
}
|
|
199
|
+
/** A decoded `PrimitivePart` record with `kind: "reasoning"`. */
|
|
191
200
|
export interface PrimitiveReasoningPartRecord extends PrimitivePartRecordBase {
|
|
192
201
|
kind: "reasoning";
|
|
193
202
|
state?: PrimitiveTextState;
|
|
194
203
|
text?: string;
|
|
195
204
|
providerMetadata?: Record<string, unknown>;
|
|
196
205
|
}
|
|
206
|
+
/** A decoded `PrimitivePart` record with `kind: "tool_call"`. */
|
|
197
207
|
export interface PrimitiveToolCallPartRecord extends PrimitivePartRecordBase {
|
|
198
208
|
kind: "tool_call";
|
|
199
209
|
state?: PrimitiveToolCallState;
|
|
@@ -213,6 +223,7 @@ export interface PrimitiveToolCallPartRecord extends PrimitivePartRecordBase {
|
|
|
213
223
|
artifactBlobId?: string;
|
|
214
224
|
providerMetadata?: Record<string, unknown>;
|
|
215
225
|
}
|
|
226
|
+
/** A decoded `PrimitivePart` record with `kind: "file"`. */
|
|
216
227
|
export interface PrimitiveFilePartRecord extends PrimitivePartRecordBase {
|
|
217
228
|
kind: "file";
|
|
218
229
|
mediaType?: string;
|
|
@@ -220,6 +231,7 @@ export interface PrimitiveFilePartRecord extends PrimitivePartRecordBase {
|
|
|
220
231
|
blobId?: string;
|
|
221
232
|
sizeBytes?: number;
|
|
222
233
|
}
|
|
234
|
+
/** A decoded `PrimitivePart` record with `kind: "event"`. */
|
|
223
235
|
export interface PrimitiveEventPartRecord extends PrimitivePartRecordBase {
|
|
224
236
|
kind: "event";
|
|
225
237
|
eventKind?: string;
|
|
@@ -233,6 +245,7 @@ export interface PrimitiveUnknownPartRecord extends PrimitivePartRecordBase {
|
|
|
233
245
|
rawKind: string;
|
|
234
246
|
row: PrimitivePartRow;
|
|
235
247
|
}
|
|
248
|
+
/** A decoded `PrimitivePart` record, including unrecognized kinds. */
|
|
236
249
|
export type PrimitivePartRecord = PrimitiveTextPartRecord | PrimitiveReasoningPartRecord | PrimitiveToolCallPartRecord | PrimitiveFilePartRecord | PrimitiveEventPartRecord | PrimitiveUnknownPartRecord;
|
|
237
250
|
/** The attributes of a `PrimitivePart` model instance. */
|
|
238
251
|
export interface PrimitivePartAttrs {
|
|
@@ -20,6 +20,7 @@ import { decodeModelRow, encodeModelRecord, registerSessionModels, sessionRowInv
|
|
|
20
20
|
export { encodeJsonColumn, decodeJsonColumn } from "./sessionModelRuntime";
|
|
21
21
|
/** The schema version a session row carries in `schemaVersion`. */
|
|
22
22
|
export const AGENT_SESSION_SCHEMA_VERSION = 1;
|
|
23
|
+
/** Values this client recognizes for `PrimitiveSessionStatus`. */
|
|
23
24
|
export const PRIMITIVE_SESSION_STATUSES = [
|
|
24
25
|
"idle",
|
|
25
26
|
"thinking",
|
|
@@ -29,6 +30,7 @@ export const PRIMITIVE_SESSION_STATUSES = [
|
|
|
29
30
|
"expired",
|
|
30
31
|
"cancelled",
|
|
31
32
|
];
|
|
33
|
+
/** Values this client recognizes for `PrimitivePartKind`. */
|
|
32
34
|
export const PRIMITIVE_PART_KINDS = [
|
|
33
35
|
"text",
|
|
34
36
|
"reasoning",
|
|
@@ -36,7 +38,9 @@ export const PRIMITIVE_PART_KINDS = [
|
|
|
36
38
|
"file",
|
|
37
39
|
"event",
|
|
38
40
|
];
|
|
41
|
+
/** Values this client recognizes for `PrimitiveTextState`. */
|
|
39
42
|
export const PRIMITIVE_TEXT_STATES = ["streaming", "done"];
|
|
43
|
+
/** Values this client recognizes for `PrimitiveToolCallState`. */
|
|
40
44
|
export const PRIMITIVE_TOOL_CALL_STATES = [
|
|
41
45
|
"input-streaming",
|
|
42
46
|
"input-available",
|
|
@@ -46,8 +50,11 @@ export const PRIMITIVE_TOOL_CALL_STATES = [
|
|
|
46
50
|
"output-error",
|
|
47
51
|
"output-denied",
|
|
48
52
|
];
|
|
53
|
+
/** Values this client recognizes for `PrimitiveAuthorKind`. */
|
|
49
54
|
export const PRIMITIVE_AUTHOR_KINDS = ["user", "agent", "app"];
|
|
55
|
+
/** Values this client recognizes for `PrimitiveStepKind`. */
|
|
50
56
|
export const PRIMITIVE_STEP_KINDS = ["model_call", "tool_call"];
|
|
57
|
+
/** Values this client recognizes for `PrimitiveStepStatus`. */
|
|
51
58
|
export const PRIMITIVE_STEP_STATUSES = [
|
|
52
59
|
"running",
|
|
53
60
|
"completed",
|