busabase-sdk 0.54.0 → 0.70.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/dist/airapp.d.ts +1 -1
- package/dist/{client-CaeGnNfw.d.ts → client-RSU_7-Nn.d.ts} +299 -65
- package/dist/index.d.ts +2 -1
- package/dist/index.js +154 -27
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as AssetTextStatus, A as NodeVO, At as GalleryCardSize, B as UpdatePreviewFileCredentialDTO, Bt as ViewSortVO, C as CommentVO, Ct as ListFormsDTO, D as MentionInboxItemVO, Dt as AssetAttachmentRef, E as LookupRollup, Et as UpdateFormDTO, F as SearchResponseVO, Ft as VIEW_FIELD_MAX_WIDTH, G as VaultItemKind, Gt as cloudContract, H as VaultAccessPolicy, Ht as ViewVO, I as SearchResultKind, It as VIEW_FIELD_MIN_WIDTH, J as VaultScopeType, Jt as CREATABLE_NODE_TYPES, K as VaultItemVO, Kt as NodeIcon, L as SearchResultVO, Lt as ViewConfigVO, M as OperationVO, Mt as GanttScale, N as ReviewVO, Nt as RecordLinkVO, O as MentionInboxPageVO, Ot as BaseFieldVO, P as ReviewVerdict, Pt as RecordVO, Q as AssetDetailVO, R as SourceAttributionVO, Rt as ViewFilterOperator, S as CommentSubjectType, St as FormVO, T as FieldType, Tt as SubmitFormDTO, U as VaultEnvironment, Ut as AttachmentRef, V as UpdateVaultSettingsDTO, Vt as ViewType, W as VaultItemInput, Wt as CloudContract, X as FileNodeMetadata, Xt as NodeType, Y as VaultSettingsVO, Yt as CreatableNodeType, Z as FileNodeVO, Zt as OperationKind, _ as ChangeRequestVO, _t as FormFieldBindingVO, a as createBusabaseClient, at as FilePreviewConfigurationStatus, b as CommentMentionTargetType, bt as FormSubmitResultVO, c as AuditAction, ct as FilePreviewUnavailableReason, d as ChangeRequestBatchFailureVO, dt as FileTreeNodeVO, et as AssetUsageVO, f as ChangeRequestCountsVO, ft as FileTreeReadFileVO, g as ChangeRequestTargetType, gt as FormBoundFieldVO, h as ChangeRequestStatus, ht as CreateFormDTO, i as ResolvedConfig, it as FilePreviewConfigVO, j as OperationStatus, jt as GalleryCoverFit, k as NodeSearchResultVO, kt as BaseVO, l as AuditEventVO, lt as FilePreviewVO, m as ChangeRequestReviewBatchResultVO, mt as ActivityItemVO, n as BusabaseConfig, nt as GrepInputDTO, o as resolveConfig, ot as FilePreviewCredentialSource, p as ChangeRequestMergeBatchResultVO, pt as NodeDetailVO, q as VaultRuntimeEnv, qt as NodeIconSchema, r as DEFAULT_BASE_URL, rt as GrepResultVO, s as AgentTaskVO, st as FilePreviewProvider, t as BusabaseClient, tt as AssetVO, u as BusabaseSourceChannel, ut as FileTreeFileVO, v as CommentMentionDispatchStatus, vt as FormPageSourceVO, w as CommitVO, wt as ListFormsVO, x as CommentMentionVO, xt as FormThemeVO, y as CommentMentionInputDTO, yt as FormShareVO, z as UserRefVO, zt as ViewFilterVO } from "./client-
|
|
1
|
+
import { $ as AssetTextStatus, A as NodeVO, At as GalleryCardSize, B as UpdatePreviewFileCredentialDTO, Bt as ViewSortVO, C as CommentVO, Ct as ListFormsDTO, D as MentionInboxItemVO, Dt as AssetAttachmentRef, E as LookupRollup, Et as UpdateFormDTO, F as SearchResponseVO, Ft as VIEW_FIELD_MAX_WIDTH, G as VaultItemKind, Gt as cloudContract, H as VaultAccessPolicy, Ht as ViewVO, I as SearchResultKind, It as VIEW_FIELD_MIN_WIDTH, J as VaultScopeType, Jt as CREATABLE_NODE_TYPES, K as VaultItemVO, Kt as NodeIcon, L as SearchResultVO, Lt as ViewConfigVO, M as OperationVO, Mt as GanttScale, N as ReviewVO, Nt as RecordLinkVO, O as MentionInboxPageVO, Ot as BaseFieldVO, P as ReviewVerdict, Pt as RecordVO, Q as AssetDetailVO, R as SourceAttributionVO, Rt as ViewFilterOperator, S as CommentSubjectType, St as FormVO, T as FieldType, Tt as SubmitFormDTO, U as VaultEnvironment, Ut as AttachmentRef, V as UpdateVaultSettingsDTO, Vt as ViewType, W as VaultItemInput, Wt as CloudContract, X as FileNodeMetadata, Xt as NodeType, Y as VaultSettingsVO, Yt as CreatableNodeType, Z as FileNodeVO, Zt as OperationKind, _ as ChangeRequestVO, _t as FormFieldBindingVO, a as createBusabaseClient, at as FilePreviewConfigurationStatus, b as CommentMentionTargetType, bt as FormSubmitResultVO, c as AuditAction, ct as FilePreviewUnavailableReason, d as ChangeRequestBatchFailureVO, dt as FileTreeNodeVO, et as AssetUsageVO, f as ChangeRequestCountsVO, ft as FileTreeReadFileVO, g as ChangeRequestTargetType, gt as FormBoundFieldVO, h as ChangeRequestStatus, ht as CreateFormDTO, i as ResolvedConfig, it as FilePreviewConfigVO, j as OperationStatus, jt as GalleryCoverFit, k as NodeSearchResultVO, kt as BaseVO, l as AuditEventVO, lt as FilePreviewVO, m as ChangeRequestReviewBatchResultVO, mt as ActivityItemVO, n as BusabaseConfig, nt as GrepInputDTO, o as resolveConfig, ot as FilePreviewCredentialSource, p as ChangeRequestMergeBatchResultVO, pt as NodeDetailVO, q as VaultRuntimeEnv, qt as NodeIconSchema, r as DEFAULT_BASE_URL, rt as GrepResultVO, s as AgentTaskVO, st as FilePreviewProvider, t as BusabaseClient, tt as AssetVO, u as BusabaseSourceChannel, ut as FileTreeFileVO, v as CommentMentionDispatchStatus, vt as FormPageSourceVO, w as CommitVO, wt as ListFormsVO, x as CommentMentionVO, xt as FormThemeVO, y as CommentMentionInputDTO, yt as FormShareVO, z as UserRefVO, zt as ViewFilterVO } from "./client-RSU_7-Nn.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/url.d.ts
|
|
4
4
|
/**
|
|
@@ -323,6 +323,7 @@ declare class Busabase {
|
|
|
323
323
|
eyebrow: string;
|
|
324
324
|
href: string;
|
|
325
325
|
updatedAt: string | null;
|
|
326
|
+
createdBy: string | null;
|
|
326
327
|
}[];
|
|
327
328
|
contentTruncated: boolean;
|
|
328
329
|
}, Error>;
|
package/dist/index.js
CHANGED
|
@@ -164,6 +164,15 @@ const AgentSessionVOSchema = z.object({
|
|
|
164
164
|
*/
|
|
165
165
|
modelOption: AgentSessionModelOptionVOSchema.nullable().default(null)
|
|
166
166
|
});
|
|
167
|
+
const ListAgentSessionsPagedInputSchema = z.object({
|
|
168
|
+
slug: z.string().min(1),
|
|
169
|
+
limit: z.number().int().min(1).max(50).default(20),
|
|
170
|
+
cursor: z.string().min(1).optional()
|
|
171
|
+
});
|
|
172
|
+
const AgentSessionsPageVOSchema = z.object({
|
|
173
|
+
items: AgentSessionVOSchema.array(),
|
|
174
|
+
nextCursor: z.string().nullable()
|
|
175
|
+
});
|
|
167
176
|
/** One connected agent backend visible in the requested workspace scope. */
|
|
168
177
|
const AgentConnectionVOSchema = z.object({
|
|
169
178
|
slug: z.string(),
|
|
@@ -171,6 +180,8 @@ const AgentConnectionVOSchema = z.object({
|
|
|
171
180
|
transport: AgentTransportSchema,
|
|
172
181
|
sessionCount: z.number().int().nonnegative(),
|
|
173
182
|
latest: AgentSessionVOSchema.nullable(),
|
|
183
|
+
/** Whether Busabase can start another conversation with this agent right now. */
|
|
184
|
+
connected: z.boolean(),
|
|
174
185
|
/** Controls owner-only actions such as deleting the saved OAuth grant. */
|
|
175
186
|
ownedByCurrentUser: z.boolean()
|
|
176
187
|
});
|
|
@@ -216,6 +227,9 @@ slug: z.string().min(1) });
|
|
|
216
227
|
const DisconnectAgentInputSchema = z.object({
|
|
217
228
|
/** The exact connected-agent slug shown by the sessions/catalog surfaces. */
|
|
218
229
|
slug: z.string().min(1) });
|
|
230
|
+
const DeleteAgentHistoryInputSchema = z.object({
|
|
231
|
+
/** Deletes only the current actor's sessions for this agent in the active space. */
|
|
232
|
+
slug: z.string().min(1) });
|
|
219
233
|
/**
|
|
220
234
|
* A base64 payload the browser attached.
|
|
221
235
|
*
|
|
@@ -268,6 +282,10 @@ const agentsContract = {
|
|
|
268
282
|
/** Connectable backends. Availability is resolved per request, not cached in the client. */
|
|
269
283
|
catalog: oc.output(AgentCatalogEntryVOSchema.array()),
|
|
270
284
|
disconnect: oc.input(DisconnectAgentInputSchema).output(z.object({
|
|
285
|
+
ok: z.boolean(),
|
|
286
|
+
endedSessionCount: z.number().int().nonnegative()
|
|
287
|
+
})),
|
|
288
|
+
deleteHistory: oc.input(DeleteAgentHistoryInputSchema).output(z.object({
|
|
271
289
|
ok: z.boolean(),
|
|
272
290
|
deletedSessionCount: z.number().int().nonnegative()
|
|
273
291
|
})),
|
|
@@ -276,11 +294,15 @@ const agentsContract = {
|
|
|
276
294
|
list: oc.input(ListAgentConnectionsInputSchema).output(AgentConnectionVOSchema.array()) },
|
|
277
295
|
sessions: {
|
|
278
296
|
list: oc.output(AgentSessionVOSchema.array()),
|
|
297
|
+
listPaged: oc.input(ListAgentSessionsPagedInputSchema).output(AgentSessionsPageVOSchema),
|
|
279
298
|
create: oc.input(CreateAgentSessionInputSchema).output(AgentSessionVOSchema),
|
|
280
299
|
/**
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
*
|
|
300
|
+
* Accept a message for asynchronous execution. `accepted: true` means the
|
|
301
|
+
* prompt is durable and the turn slot is owned; progress and completion
|
|
302
|
+
* arrive through `subscribe`, so this RPC never spans the whole agent run.
|
|
303
|
+
* A terminal session returns `accepted: false` instead of relying on error
|
|
304
|
+
* text; `promptRecorded` tells the caller whether automatic continuation
|
|
305
|
+
* can resend without duplicating a server echo.
|
|
284
306
|
*/
|
|
285
307
|
prompt: oc.input(PromptAgentSessionInputSchema).output(z.discriminatedUnion("accepted", [z.object({
|
|
286
308
|
accepted: z.literal(true),
|
|
@@ -447,6 +469,7 @@ const fieldTypeSchema = z.enum([
|
|
|
447
469
|
"html",
|
|
448
470
|
"attachment",
|
|
449
471
|
"relation",
|
|
472
|
+
"member",
|
|
450
473
|
"number",
|
|
451
474
|
"date",
|
|
452
475
|
"checkbox",
|
|
@@ -553,8 +576,7 @@ const baseSchema = z.object({
|
|
|
553
576
|
requiredApprovals: z.number()
|
|
554
577
|
}),
|
|
555
578
|
createdAt: z.string(),
|
|
556
|
-
fields: z.array(baseFieldSchema)
|
|
557
|
-
metadata: z.record(z.string(), z.unknown()).default({})
|
|
579
|
+
fields: z.array(baseFieldSchema)
|
|
558
580
|
});
|
|
559
581
|
const createBaseInputSchema = z.object({
|
|
560
582
|
parentNodeId: z.string().optional().describe("Parent node id. Must be a folder or the space root; container-incapable node types (Base, Doc, AirApp, etc.) cannot hold children."),
|
|
@@ -968,22 +990,34 @@ const formNodeType = {
|
|
|
968
990
|
label: "Form",
|
|
969
991
|
icon: "form",
|
|
970
992
|
/**
|
|
971
|
-
* `hidden
|
|
993
|
+
* No longer `hidden`. The two conditions that hid it are both met:
|
|
994
|
+
*
|
|
995
|
+
* 1. The New-item flow ASKS FOR THE TARGET BASE — `create-node-modal.tsx`
|
|
996
|
+
* renders a "Writes into" Base picker (plus the field checklist) whenever
|
|
997
|
+
* `form` is the selected type, and keeps its submit disabled until one is
|
|
998
|
+
* chosen, the same way it already does for `file` and its asset.
|
|
999
|
+
* 2. A MATERIALIZER WRITES THE CONFIG ROW — `materializeFormNode`
|
|
1000
|
+
* (busabase-core `domains/form/logic/form-ops.ts`) inserts the
|
|
1001
|
+
* `busabase_forms` row inside the merge transaction, from the
|
|
1002
|
+
* `node_create` operation's `metadata.targetBaseId` / `metadata.formBindings`.
|
|
1003
|
+
* Both create paths run it, so a Form merged after review is configured
|
|
1004
|
+
* exactly like one created immediately.
|
|
1005
|
+
*
|
|
1006
|
+
* A Form that still arrives unconfigured (an API caller that sent only the
|
|
1007
|
+
* generic node fields) is no longer a dead end either: the detail view's
|
|
1008
|
+
* "not set up yet" state now carries a "Connect this form to a Base" action.
|
|
972
1009
|
*
|
|
973
|
-
* `
|
|
974
|
-
* `
|
|
975
|
-
*
|
|
976
|
-
*
|
|
977
|
-
*
|
|
978
|
-
*
|
|
979
|
-
* entry point that cannot succeed. Drop this once the New-item flow asks for
|
|
980
|
-
* the target Base and a materializer writes the config row.
|
|
1010
|
+
* `hidden` is read by THREE create surfaces — web's `create-node-modal.tsx`,
|
|
1011
|
+
* `node-agent-prompts.ts`, and React Native's
|
|
1012
|
+
* `apps/busabase-mobile/.../CreateNodeModal.tsx`. Mobile has no Base picker,
|
|
1013
|
+
* so it names `form` in its own `UNSUPPORTED_TYPES` set (alongside `file`,
|
|
1014
|
+
* which is excluded there for the same "can't collect the required input"
|
|
1015
|
+
* reason) rather than re-creating the dead end on another platform.
|
|
981
1016
|
*/
|
|
982
1017
|
capabilities: {
|
|
983
1018
|
hasDetail: true,
|
|
984
1019
|
creatable: true,
|
|
985
|
-
publicAccess: "submit"
|
|
986
|
-
hidden: true
|
|
1020
|
+
publicAccess: "submit"
|
|
987
1021
|
},
|
|
988
1022
|
operations: []
|
|
989
1023
|
};
|
|
@@ -1179,17 +1213,17 @@ const NodeIconSchema = z.discriminatedUnion("type", [z.object({
|
|
|
1179
1213
|
//#endregion
|
|
1180
1214
|
//#region ../../packages/busabase-contract/src/contract/node-agent-prompt-schemas.ts
|
|
1181
1215
|
/**
|
|
1182
|
-
* Per-node custom scenario prompts (`node.
|
|
1216
|
+
* Per-node custom scenario prompts (`node.agentPrompts`) — the single
|
|
1183
1217
|
* schema shared by BOTH write and read paths, per the node-agent-prompts
|
|
1184
1218
|
* design (v2) §7.3:
|
|
1185
1219
|
*
|
|
1186
1220
|
* - Write: `busabase-cli nodes set-agent-prompts` validates a file against this
|
|
1187
|
-
* schema client-side, before calling `nodes.
|
|
1188
|
-
* never reaches the network.
|
|
1221
|
+
* schema client-side, before calling `nodes.updateAgentPrompts` — a malformed
|
|
1222
|
+
* file never reaches the network.
|
|
1189
1223
|
* - Read: `buildNodeAgentPrompts` (`packages/busabase-core/.../node-agent-prompts.ts`)
|
|
1190
|
-
* `.safeParse`s whatever is stored in `
|
|
1191
|
-
*
|
|
1192
|
-
*
|
|
1224
|
+
* `.safeParse`s whatever is stored in the node's `agentPrompts` column and
|
|
1225
|
+
* ignores invalid custom entries, so a bad write (or a manual jsonb edit) can
|
|
1226
|
+
* never crash the Agent Prompts dialog or hide its built-in scenarios.
|
|
1193
1227
|
*
|
|
1194
1228
|
* One schema, one place to edit the limits — do not duplicate this validation on
|
|
1195
1229
|
* either side.
|
|
@@ -1239,7 +1273,7 @@ const customPromptDefSchema = z.object({
|
|
|
1239
1273
|
body: customPromptBodySchema
|
|
1240
1274
|
});
|
|
1241
1275
|
/**
|
|
1242
|
-
* The full `
|
|
1276
|
+
* The full `agentPrompts` array. `.max` bounds the list; the
|
|
1243
1277
|
* `superRefine` catches duplicate keys with an issue path pointing at the
|
|
1244
1278
|
* offending entry, so a CLI/server validation error names which entry and
|
|
1245
1279
|
* which key collided instead of a bare "keys must be unique".
|
|
@@ -1677,7 +1711,16 @@ const searchResultSchema = z.object({
|
|
|
1677
1711
|
body: z.string(),
|
|
1678
1712
|
eyebrow: z.string(),
|
|
1679
1713
|
href: z.string(),
|
|
1680
|
-
updatedAt: z.string().nullable()
|
|
1714
|
+
updatedAt: z.string().nullable(),
|
|
1715
|
+
/**
|
|
1716
|
+
* The actor that created this, or null when the source cannot say.
|
|
1717
|
+
*
|
|
1718
|
+
* Present so a result can SHOW its author and so the author filter can be
|
|
1719
|
+
* driven by clicking one — you can only filter by a creator you can actually
|
|
1720
|
+
* see, which beats a free-text box you have to guess the spelling of. Null is
|
|
1721
|
+
* rendered as "unknown", never as a person.
|
|
1722
|
+
*/
|
|
1723
|
+
createdBy: z.string().nullable().default(null)
|
|
1681
1724
|
});
|
|
1682
1725
|
const searchResponseSchema = z.object({
|
|
1683
1726
|
query: z.string(),
|
|
@@ -1696,6 +1739,43 @@ const searchResponseSchema = z.object({
|
|
|
1696
1739
|
*/
|
|
1697
1740
|
contentTruncated: z.boolean().default(false)
|
|
1698
1741
|
});
|
|
1742
|
+
/**
|
|
1743
|
+
* Payload-free interaction events for search quality measurement.
|
|
1744
|
+
*
|
|
1745
|
+
* Every object is strict on purpose: accepting and stripping an accidental
|
|
1746
|
+
* `query` property would make the transport look privacy-safe while callers
|
|
1747
|
+
* were still sending search text over the wire.
|
|
1748
|
+
*/
|
|
1749
|
+
const searchInteractionInputSchema = z.discriminatedUnion("event", [
|
|
1750
|
+
z.object({
|
|
1751
|
+
event: z.literal("result_click"),
|
|
1752
|
+
sessionId: z.string().uuid(),
|
|
1753
|
+
surface: z.enum(["quick", "advanced"]),
|
|
1754
|
+
position: z.number().int().min(1).max(100),
|
|
1755
|
+
resultKind: z.enum([
|
|
1756
|
+
"record",
|
|
1757
|
+
"change_request",
|
|
1758
|
+
"base",
|
|
1759
|
+
"file",
|
|
1760
|
+
"node"
|
|
1761
|
+
])
|
|
1762
|
+
}).strict(),
|
|
1763
|
+
z.object({
|
|
1764
|
+
event: z.literal("quick_to_advanced"),
|
|
1765
|
+
sessionId: z.string().uuid(),
|
|
1766
|
+
surface: z.literal("quick"),
|
|
1767
|
+
resultCount: z.number().int().min(0).max(100)
|
|
1768
|
+
}).strict(),
|
|
1769
|
+
z.object({
|
|
1770
|
+
event: z.literal("results_shown"),
|
|
1771
|
+
sessionId: z.string().uuid(),
|
|
1772
|
+
surface: z.enum(["quick", "advanced"]),
|
|
1773
|
+
resultCount: z.number().int().min(0).max(100),
|
|
1774
|
+
durationMs: z.number().int().min(0).max(12e4),
|
|
1775
|
+
hasMore: z.boolean()
|
|
1776
|
+
}).strict()
|
|
1777
|
+
]);
|
|
1778
|
+
const searchInteractionResponseSchema = z.object({ accepted: z.literal(true) });
|
|
1699
1779
|
const liveEventSchema = z.object({
|
|
1700
1780
|
kind: z.enum([
|
|
1701
1781
|
"change_request.created",
|
|
@@ -1926,6 +2006,8 @@ const SearchSortSchema = z.enum([
|
|
|
1926
2006
|
]);
|
|
1927
2007
|
const searchInputSchema = z.object({
|
|
1928
2008
|
query: z.string().default("").describe("Full-text query. An empty string matches nothing."),
|
|
2009
|
+
mode: z.enum(["quick", "full"]).optional().default("full").describe("Search depth. `quick` skips live file-body scans for typeahead; `full` preserves complete search behavior."),
|
|
2010
|
+
surface: z.enum(["quick", "advanced"]).optional().describe("Optional first-party UI surface for aggregate quality metrics. API/CLI callers should omit it."),
|
|
1929
2011
|
limit: z.coerce.number().int().min(1).max(100).optional().default(20).describe("Results per page. Capped at 100; note the default is 20, not 50."),
|
|
1930
2012
|
offset: z.coerce.number().int().min(0).optional().default(0).describe("0-indexed skip count. This endpoint pages by offset, not by cursor."),
|
|
1931
2013
|
/**
|
|
@@ -1950,6 +2032,23 @@ const searchInputSchema = z.object({
|
|
|
1950
2032
|
updatedAfter: z.string().datetime({ offset: true }).optional().describe("Inclusive lower bound, ISO 8601. A UTC `Z` or an explicit offset; not a bare local time."),
|
|
1951
2033
|
updatedBefore: z.string().datetime({ offset: true }).optional().describe("Inclusive upper bound, ISO 8601. A UTC `Z` or an explicit offset; not a bare local time."),
|
|
1952
2034
|
/**
|
|
2035
|
+
* Restrict to what one actor created.
|
|
2036
|
+
*
|
|
2037
|
+
* Every source answers from a real column, which is what made this filter
|
|
2038
|
+
* shippable: records and assets carry their own `created_by`, node CONTENT
|
|
2039
|
+
* reads `busabase_nodes.created_by` (added with this change, backfilled from
|
|
2040
|
+
* each node's `node_create` commit), and Bases resolve through the owning
|
|
2041
|
+
* node the Base query already joins for its dates and sort.
|
|
2042
|
+
*
|
|
2043
|
+
* A free-form actor id, not a user id — agents and API keys create things
|
|
2044
|
+
* too, and filtering by "user" would silently drop everything an agent made.
|
|
2045
|
+
*
|
|
2046
|
+
* Nodes whose creating commit is gone have a NULL `created_by` and match no
|
|
2047
|
+
* author. That is deliberate: "this row cannot tell" must not render as
|
|
2048
|
+
* "nobody made it".
|
|
2049
|
+
*/
|
|
2050
|
+
createdBy: z.string().optional().describe("Restrict to one creator. Matches the actor id, which may be an agent or API key."),
|
|
2051
|
+
/**
|
|
1953
2052
|
* Restrict to a subtree: this node and everything beneath it.
|
|
1954
2053
|
*
|
|
1955
2054
|
* Resolved by walking the tree in application code (`collectSubtreeIds`),
|
|
@@ -2005,7 +2104,21 @@ const authInfoSchema = z.object({
|
|
|
2005
2104
|
/** Cloud only: the server created this user's first Space during this exact request. */
|
|
2006
2105
|
createdSpace: z.boolean().optional(),
|
|
2007
2106
|
/** Cloud only: this auto-created Space still needs its idempotent starter initialization. */
|
|
2008
|
-
bootstrapRequired: z.boolean().optional()
|
|
2107
|
+
bootstrapRequired: z.boolean().optional(),
|
|
2108
|
+
/** Cloud only: effective permission ceiling of the credential used for this request. */
|
|
2109
|
+
credentialPermissionLevel: z.enum([
|
|
2110
|
+
"read",
|
|
2111
|
+
"changeRequest",
|
|
2112
|
+
"write",
|
|
2113
|
+
"manage"
|
|
2114
|
+
]).optional(),
|
|
2115
|
+
/** Cloud only: credential ceiling capped by the selected Space membership role. */
|
|
2116
|
+
effectivePermissionLevel: z.enum([
|
|
2117
|
+
"read",
|
|
2118
|
+
"changeRequest",
|
|
2119
|
+
"write",
|
|
2120
|
+
"manage"
|
|
2121
|
+
]).optional()
|
|
2009
2122
|
});
|
|
2010
2123
|
//#endregion
|
|
2011
2124
|
//#region ../../packages/busabase-contract/src/domains/filetree/contract.ts
|
|
@@ -2806,6 +2919,7 @@ const recordSchema = z.object({
|
|
|
2806
2919
|
status: z.enum(["active", "archived"]),
|
|
2807
2920
|
createdBy: z.string(),
|
|
2808
2921
|
createdByUser: userRefSchema.nullable().optional().default(null),
|
|
2922
|
+
fieldUsers: z.record(z.string(), userRefSchema).optional().default({}),
|
|
2809
2923
|
archivedAt: z.string().nullable(),
|
|
2810
2924
|
createdAt: z.string(),
|
|
2811
2925
|
updatedAt: z.string(),
|
|
@@ -5175,6 +5289,7 @@ const busabaseContractRoutes = {
|
|
|
5175
5289
|
summary: "Search Busabase",
|
|
5176
5290
|
successDescription: "Paginated search results across records, change requests, Bases, File nodes, and Assets."
|
|
5177
5291
|
}).input(searchInputSchema).output(searchResponseSchema),
|
|
5292
|
+
searchMetrics: { report: oc.input(searchInteractionInputSchema).output(searchInteractionResponseSchema) },
|
|
5178
5293
|
grep: oc.route({
|
|
5179
5294
|
method: "POST",
|
|
5180
5295
|
path: "/grep",
|
|
@@ -5274,14 +5389,14 @@ const busabaseContractRoutes = {
|
|
|
5274
5389
|
path: "/nodes/{nodeId}/agent-prompts",
|
|
5275
5390
|
tags: ["Nodes"],
|
|
5276
5391
|
summary: "Get node custom agent prompts",
|
|
5277
|
-
successDescription: "This node's custom scenario prompts, which
|
|
5392
|
+
successDescription: "This node's custom scenario prompts, which appear alongside the node type's built-in prompts in the Ask-agent dialog. `null` means the node has never had any set, which is not the same as an empty list. Read separately from the node itself because the list is large enough (50 prompts x 8 KiB per locale) that carrying it on every node listing would be its own problem. Requires read access on the node."
|
|
5278
5393
|
}).input(getNodeAgentPromptsInputSchema).output(nodeAgentPromptsSchema),
|
|
5279
5394
|
updateAgentPrompts: oc.route({
|
|
5280
5395
|
method: "PUT",
|
|
5281
5396
|
path: "/nodes/{nodeId}/agent-prompts",
|
|
5282
5397
|
tags: ["Nodes"],
|
|
5283
5398
|
summary: "Replace node custom agent prompts",
|
|
5284
|
-
successDescription: "Replaced this node's custom scenario prompts — the whole list, not a merge. Send `null` to clear
|
|
5399
|
+
successDescription: "Replaced this node's custom scenario prompts — the whole custom list, not a merge. Send `null` to clear custom prompts; built-in prompts are always retained. Requires write access on the node."
|
|
5285
5400
|
}).input(updateNodeAgentPromptsInputSchema).output(nodeAgentPromptsSchema),
|
|
5286
5401
|
updateContent: oc.route({
|
|
5287
5402
|
method: "PUT",
|
|
@@ -5505,6 +5620,18 @@ const busabaseContractRoutes = {
|
|
|
5505
5620
|
summary: "List agent revision tasks",
|
|
5506
5621
|
successDescription: "Change requests awaiting an external agent (request-changes or @ai mentions)."
|
|
5507
5622
|
}).output(z.array(agentTaskSchema)) },
|
|
5623
|
+
spaces: {
|
|
5624
|
+
/**
|
|
5625
|
+
* The member roster of the space this request is scoped to — the people a
|
|
5626
|
+
* `member` field's picker may offer.
|
|
5627
|
+
*
|
|
5628
|
+
* RPC-only by design (no `.route(...)`). A procedure WITH a path is
|
|
5629
|
+
* published into `/api/v1` and into every agent's MCP tool catalog; a
|
|
5630
|
+
* workspace member directory belongs in neither. Resolution is delegated to
|
|
5631
|
+
* the host (`BusabaseContext.listMembers`), because membership lives in the
|
|
5632
|
+
* host, not in this engine.
|
|
5633
|
+
*/
|
|
5634
|
+
members: oc.output(z.array(userRefSchema)) },
|
|
5508
5635
|
live: { subscribe: oc.output(eventIterator(liveEventSchema)) },
|
|
5509
5636
|
bases: baseContract,
|
|
5510
5637
|
fileTrees: fileTreeContract,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "busabase-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.70.0",
|
|
4
4
|
"description": "Typed TypeScript/JavaScript SDK for the Busabase OpenAPI REST API. Talks to a local or remote `busabase server` (or Busabase Cloud).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/busabase/busabase/tree/main/apps/busabase-sdk",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"tsx": "^4.20.5",
|
|
68
68
|
"typescript": "^7.0.2",
|
|
69
69
|
"vitest": "^4.1.11",
|
|
70
|
-
"
|
|
70
|
+
"busabase-contract": "0.70.0",
|
|
71
71
|
"openlib": "0.1.1",
|
|
72
|
-
"
|
|
72
|
+
"open-domains": "0.0.2"
|
|
73
73
|
},
|
|
74
74
|
"engines": {
|
|
75
75
|
"node": ">=24.18.0"
|