busabase-sdk 0.9.13 → 0.9.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -739,7 +739,7 @@ declare const cloudContract: {
739
739
  createChangeRequest: _orpc_contract.ContractProcedure<z.ZodObject<{
740
740
  message: z.ZodDefault<z.ZodOptional<z.ZodString>>;
741
741
  submittedBy: z.ZodDefault<z.ZodOptional<z.ZodString>>;
742
- autoMerge: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
742
+ autoMerge: z.ZodOptional<z.ZodBoolean>;
743
743
  operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
744
744
  kind: z.ZodLiteral<"create">;
745
745
  ref: z.ZodOptional<z.ZodString>;
@@ -4458,7 +4458,7 @@ declare const cloudContract: {
4458
4458
  targetBaseSlug: z.ZodOptional<z.ZodString>;
4459
4459
  }, z.core.$strip>>>>;
4460
4460
  }, z.core.$strip>>>;
4461
- autoMerge: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
4461
+ autoMerge: z.ZodOptional<z.ZodBoolean>;
4462
4462
  }, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
4463
4463
  id: z.ZodString;
4464
4464
  nodeId: z.ZodString;
@@ -4942,7 +4942,7 @@ declare const cloudContract: {
4942
4942
  message: z.ZodDefault<z.ZodOptional<z.ZodString>>;
4943
4943
  submittedBy: z.ZodDefault<z.ZodOptional<z.ZodString>>;
4944
4944
  idempotencyKey: z.ZodOptional<z.ZodString>;
4945
- autoMerge: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
4945
+ autoMerge: z.ZodOptional<z.ZodBoolean>;
4946
4946
  baseId: z.ZodString;
4947
4947
  }, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
4948
4948
  id: z.ZodString;
@@ -9810,7 +9810,7 @@ declare const cloudContract: {
9810
9810
  content: z.ZodDefault<z.ZodString>;
9811
9811
  mimeType: z.ZodOptional<z.ZodString>;
9812
9812
  }, z.core.$strict>]>>>>;
9813
- autoMerge: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
9813
+ autoMerge: z.ZodOptional<z.ZodBoolean>;
9814
9814
  mergeMode: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
9815
9815
  replace: "replace";
9816
9816
  merge: "merge";
@@ -10724,7 +10724,7 @@ declare const cloudContract: {
10724
10724
  content: z.ZodDefault<z.ZodString>;
10725
10725
  mimeType: z.ZodOptional<z.ZodString>;
10726
10726
  }, z.core.$strict>]>>>>;
10727
- autoMerge: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
10727
+ autoMerge: z.ZodOptional<z.ZodBoolean>;
10728
10728
  mergeMode: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
10729
10729
  replace: "replace";
10730
10730
  merge: "merge";
@@ -11674,7 +11674,7 @@ declare const cloudContract: {
11674
11674
  content: z.ZodDefault<z.ZodString>;
11675
11675
  mimeType: z.ZodOptional<z.ZodString>;
11676
11676
  }, z.core.$strict>]>>>>;
11677
- autoMerge: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
11677
+ autoMerge: z.ZodOptional<z.ZodBoolean>;
11678
11678
  mergeMode: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
11679
11679
  replace: "replace";
11680
11680
  merge: "merge";
@@ -12579,7 +12579,7 @@ declare const cloudContract: {
12579
12579
  name: z.ZodString;
12580
12580
  description: z.ZodDefault<z.ZodOptional<z.ZodString>>;
12581
12581
  assetId: z.ZodString;
12582
- autoMerge: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
12582
+ autoMerge: z.ZodOptional<z.ZodBoolean>;
12583
12583
  }, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
12584
12584
  node: z.ZodType<NodeOutput, unknown, z.core.$ZodTypeInternals<NodeOutput, unknown>>;
12585
12585
  asset: z.ZodObject<{
@@ -13026,7 +13026,7 @@ declare const cloudContract: {
13026
13026
  name: z.ZodString;
13027
13027
  description: z.ZodDefault<z.ZodOptional<z.ZodString>>;
13028
13028
  body: z.ZodDefault<z.ZodOptional<z.ZodString>>;
13029
- autoMerge: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
13029
+ autoMerge: z.ZodOptional<z.ZodBoolean>;
13030
13030
  }, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
13031
13031
  node: z.ZodType<NodeOutput, unknown, z.core.$ZodTypeInternals<NodeOutput, unknown>>;
13032
13032
  storagePrefix: z.ZodString;
package/dist/index.js CHANGED
@@ -128,11 +128,11 @@ var createBaseInputSchema = z.object({
128
128
  options: fieldOptionsSchema.optional().default({})
129
129
  })
130
130
  ).default([]),
131
- // Review-first by default: without `autoMerge: true`, this proposes the Base
132
- // as a pending ChangeRequest (status "in_review") instead of creating it
133
- // immediately. Pass `autoMerge: true` only for callers that don't need human
134
- // review (seed/migration scripts, an explicit no-review agent task).
135
- autoMerge: z.boolean().optional().default(false)
131
+ // Permission-aware default: omitted merges immediately if the actor has
132
+ // write access on the parent node, otherwise falls back to a pending
133
+ // ChangeRequest (status "in_review"). Pass explicit `autoMerge: false` to
134
+ // force review even with write access.
135
+ autoMerge: z.boolean().optional()
136
136
  });
137
137
  var createBaseFieldInputSchema = z.object({
138
138
  name: fieldNameSchema,
@@ -762,8 +762,8 @@ var createNodeChangeRequestInputSchema = z.object({
762
762
  'Explanation shown to the human reviewer. Write a conventional-commit style subject \u2014 imperative verb + what + why, e.g. "Reorganize marketing docs under a Campaigns folder".'
763
763
  ),
764
764
  submittedBy: z.string().optional().default("local-producer"),
765
- autoMerge: z.boolean().optional().default(false).describe(
766
- "Whether to approve and merge this structural node change immediately. Defaults to false so node Change Request creation is review-first unless explicitly requested."
765
+ autoMerge: z.boolean().optional().describe(
766
+ "Whether to approve and merge this structural node change immediately. Omitted defaults to merging immediately if the actor has write access on every target node, otherwise falling back to a pending Change Request; pass explicit false to force review even with write access."
767
767
  ),
768
768
  operations: z.array(nodeOperationInputSchema).min(1)
769
769
  });
@@ -936,11 +936,11 @@ var createFileTreeInputSchema = z.object({
936
936
  visibility: z.enum(["private", "workspace", "public"]).optional().default("private"),
937
937
  version: z.string().optional().default("0.1.0"),
938
938
  files: z.array(z.union([assetFileInputSchema, textFileInputSchema])).optional().default([]),
939
- // Review-first by default: without `autoMerge: true`, this proposes the node
940
- // as a pending ChangeRequest (status "in_review") instead of creating it
941
- // immediately. Pass `autoMerge: true` only for callers that don't need human
942
- // review (seed/migration scripts, an explicit no-review agent task).
943
- autoMerge: z.boolean().optional().default(false),
939
+ // Permission-aware default: omitted merges immediately if the actor has
940
+ // write access on the parent node, otherwise falls back to a pending
941
+ // ChangeRequest (status "in_review"). Pass explicit `autoMerge: false` to
942
+ // force review even with write access.
943
+ autoMerge: z.boolean().optional(),
944
944
  // "merge" (default): `files` is layered on top of the config's default seed
945
945
  // files by path — a caller supplying just a couple of extra files (e.g. a
946
946
  // Skill's own reference doc) still gets the default scaffold (SKILL.md,
@@ -1540,12 +1540,14 @@ var createChangeRequestInputSchema = z.object({
1540
1540
  idempotencyKey: z.string().optional().describe(
1541
1541
  "Optional client-supplied key that dedupes retries. Scoped per base + submitter: calling this endpoint again with the SAME idempotencyKey (e.g. after a timeout or a 5xx where you couldn't tell if the first call succeeded) returns the change request created by the first call instead of creating a duplicate. Omit for normal one-shot calls; only set it when you might retry."
1542
1542
  ),
1543
- // Review-first by default: without `autoMerge: true`, this proposes the record
1544
- // as a pending ChangeRequest (status "in_review") instead of creating it
1545
- // immediately. Pass `autoMerge: true` only for callers that don't need human
1546
- // review approves and merges the change request right away, returning the
1547
- // materialized record instead of the pending ChangeRequest.
1548
- autoMerge: z.boolean().optional().default(false)
1543
+ // Permission-aware default: omitted merges immediately if the actor has
1544
+ // write access on the Base's node, otherwise falls back to a pending
1545
+ // ChangeRequest (status "in_review"). Pass explicit `autoMerge: false` to
1546
+ // force review even with write access; `autoMerge: true` approves and
1547
+ // merges right away, returning the materialized record instead of the
1548
+ // pending ChangeRequest (gracefully falls back to a pending CR if the
1549
+ // actor doesn't actually have write access).
1550
+ autoMerge: z.boolean().optional()
1549
1551
  });
1550
1552
  var createBulkChangeRequestInputSchema = z.object({
1551
1553
  records: z.array(z.record(z.string(), z.unknown())).min(1).max(1e3).describe(
@@ -1863,11 +1865,11 @@ var createDocInputSchema = z.object({
1863
1865
  name: z.string().min(1),
1864
1866
  description: z.string().optional().default(""),
1865
1867
  body: z.string().optional().default(""),
1866
- // Review-first by default: without `autoMerge: true`, this proposes the Doc
1867
- // as a pending ChangeRequest (status "in_review") instead of creating it
1868
- // immediately. Pass `autoMerge: true` only for callers that don't need human
1869
- // review (seed/migration scripts, an explicit no-review agent task).
1870
- autoMerge: z.boolean().optional().default(false)
1868
+ // Permission-aware default: omitted merges immediately if the actor has
1869
+ // write access on the parent node, otherwise falls back to a pending
1870
+ // ChangeRequest (status "in_review"). Pass explicit `autoMerge: false` to
1871
+ // force review even with write access.
1872
+ autoMerge: z.boolean().optional()
1871
1873
  });
1872
1874
  var updateDocInputSchema = z.object({
1873
1875
  body: z.string()
@@ -2073,11 +2075,11 @@ var createFileNodeInputSchema = z.object({
2073
2075
  name: z.string().min(1),
2074
2076
  description: z.string().optional().default(""),
2075
2077
  assetId: z.string().min(1),
2076
- // Review-first by default: without `autoMerge: true`, this proposes the File
2077
- // node as a pending ChangeRequest (status "in_review") instead of creating it
2078
- // immediately. Pass `autoMerge: true` only for callers that don't need human
2079
- // review (seed/migration scripts, an explicit no-review agent task).
2080
- autoMerge: z.boolean().optional().default(false)
2078
+ // Permission-aware default: omitted merges immediately if the actor has
2079
+ // write access on the parent node, otherwise falls back to a pending
2080
+ // ChangeRequest (status "in_review"). Pass explicit `autoMerge: false` to
2081
+ // force review even with write access.
2082
+ autoMerge: z.boolean().optional()
2081
2083
  });
2082
2084
  var fileContract = {
2083
2085
  list: oc.route({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "busabase-sdk",
3
- "version": "0.9.13",
3
+ "version": "0.9.14",
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",
@@ -41,9 +41,9 @@
41
41
  "tsx": "^4.20.5",
42
42
  "typescript": "^5.9.3",
43
43
  "vitest": "^2.1.8",
44
+ "busabase-contract": "0.9.14",
44
45
  "open-domains": "0.0.2",
45
- "openlib": "0.1.1",
46
- "busabase-contract": "0.9.13"
46
+ "openlib": "0.1.1"
47
47
  },
48
48
  "engines": {
49
49
  "node": ">=24.18.0"