@general-input/cli 0.22.0 → 0.23.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.
Files changed (3) hide show
  1. package/dist/cli.js +1092 -920
  2. package/dist/cli.js.map +1 -1
  3. package/package.json +5 -5
package/dist/cli.js CHANGED
@@ -2236,17 +2236,17 @@ var require_cipherModes = __commonJS({
2236
2236
  }
2237
2237
  };
2238
2238
  modes.gcm.prototype.tableMultiply = function(x) {
2239
- var z50 = [0, 0, 0, 0];
2239
+ var z52 = [0, 0, 0, 0];
2240
2240
  for (var i = 0; i < 32; ++i) {
2241
2241
  var idx = i / 8 | 0;
2242
2242
  var x_i = x[idx] >>> (7 - i % 8) * 4 & 15;
2243
2243
  var ah = this._m[i][x_i];
2244
- z50[0] ^= ah[0];
2245
- z50[1] ^= ah[1];
2246
- z50[2] ^= ah[2];
2247
- z50[3] ^= ah[3];
2244
+ z52[0] ^= ah[0];
2245
+ z52[1] ^= ah[1];
2246
+ z52[2] ^= ah[2];
2247
+ z52[3] ^= ah[3];
2248
2248
  }
2249
- return z50;
2249
+ return z52;
2250
2250
  };
2251
2251
  modes.gcm.prototype.ghash = function(h, y, x) {
2252
2252
  y[0] ^= x[0];
@@ -6139,26 +6139,26 @@ var require_jsbn = __commonJS({
6139
6139
  function bnpIsEven() {
6140
6140
  return (this.t > 0 ? this.data[0] & 1 : this.s) == 0;
6141
6141
  }
6142
- function bnpExp(e, z50) {
6142
+ function bnpExp(e, z52) {
6143
6143
  if (e > 4294967295 || e < 1) return BigInteger.ONE;
6144
- var r = nbi(), r2 = nbi(), g = z50.convert(this), i = nbits(e) - 1;
6144
+ var r = nbi(), r2 = nbi(), g = z52.convert(this), i = nbits(e) - 1;
6145
6145
  g.copyTo(r);
6146
6146
  while (--i >= 0) {
6147
- z50.sqrTo(r, r2);
6148
- if ((e & 1 << i) > 0) z50.mulTo(r2, g, r);
6147
+ z52.sqrTo(r, r2);
6148
+ if ((e & 1 << i) > 0) z52.mulTo(r2, g, r);
6149
6149
  else {
6150
6150
  var t = r;
6151
6151
  r = r2;
6152
6152
  r2 = t;
6153
6153
  }
6154
6154
  }
6155
- return z50.revert(r);
6155
+ return z52.revert(r);
6156
6156
  }
6157
6157
  function bnModPowInt(e, m) {
6158
- var z50;
6159
- if (e < 256 || m.isEven()) z50 = new Classic(m);
6160
- else z50 = new Montgomery(m);
6161
- return this.exp(e, z50);
6158
+ var z52;
6159
+ if (e < 256 || m.isEven()) z52 = new Classic(m);
6160
+ else z52 = new Montgomery(m);
6161
+ return this.exp(e, z52);
6162
6162
  }
6163
6163
  BigInteger.prototype.copyTo = bnpCopyTo;
6164
6164
  BigInteger.prototype.fromInt = bnpFromInt;
@@ -6216,13 +6216,13 @@ var require_jsbn = __commonJS({
6216
6216
  if (this.signum() == 0 || b < 2 || b > 36) return "0";
6217
6217
  var cs = this.chunkSize(b);
6218
6218
  var a = Math.pow(b, cs);
6219
- var d = nbv(a), y = nbi(), z50 = nbi(), r = "";
6220
- this.divRemTo(d, y, z50);
6219
+ var d = nbv(a), y = nbi(), z52 = nbi(), r = "";
6220
+ this.divRemTo(d, y, z52);
6221
6221
  while (y.signum() > 0) {
6222
- r = (a + z50.intValue()).toString(b).substr(1) + r;
6223
- y.divRemTo(d, y, z50);
6222
+ r = (a + z52.intValue()).toString(b).substr(1) + r;
6223
+ y.divRemTo(d, y, z52);
6224
6224
  }
6225
- return z50.intValue().toString(b) + r;
6225
+ return z52.intValue().toString(b) + r;
6226
6226
  }
6227
6227
  function bnpFromRadix(s, b) {
6228
6228
  this.fromInt(0);
@@ -6595,7 +6595,7 @@ var require_jsbn = __commonJS({
6595
6595
  Barrett.prototype.mulTo = barrettMulTo;
6596
6596
  Barrett.prototype.sqrTo = barrettSqrTo;
6597
6597
  function bnModPow(e, m) {
6598
- var i = e.bitLength(), k, r = nbv(1), z50;
6598
+ var i = e.bitLength(), k, r = nbv(1), z52;
6599
6599
  if (i <= 0) return r;
6600
6600
  else if (i < 18) k = 1;
6601
6601
  else if (i < 48) k = 3;
@@ -6603,19 +6603,19 @@ var require_jsbn = __commonJS({
6603
6603
  else if (i < 768) k = 5;
6604
6604
  else k = 6;
6605
6605
  if (i < 8)
6606
- z50 = new Classic(m);
6606
+ z52 = new Classic(m);
6607
6607
  else if (m.isEven())
6608
- z50 = new Barrett(m);
6608
+ z52 = new Barrett(m);
6609
6609
  else
6610
- z50 = new Montgomery(m);
6610
+ z52 = new Montgomery(m);
6611
6611
  var g = new Array(), n = 3, k1 = k - 1, km = (1 << k) - 1;
6612
- g[1] = z50.convert(this);
6612
+ g[1] = z52.convert(this);
6613
6613
  if (k > 1) {
6614
6614
  var g2 = nbi();
6615
- z50.sqrTo(g[1], g2);
6615
+ z52.sqrTo(g[1], g2);
6616
6616
  while (n <= km) {
6617
6617
  g[n] = nbi();
6618
- z50.mulTo(g2, g[n - 2], g[n]);
6618
+ z52.mulTo(g2, g[n - 2], g[n]);
6619
6619
  n += 2;
6620
6620
  }
6621
6621
  }
@@ -6641,20 +6641,20 @@ var require_jsbn = __commonJS({
6641
6641
  is1 = false;
6642
6642
  } else {
6643
6643
  while (n > 1) {
6644
- z50.sqrTo(r, r2);
6645
- z50.sqrTo(r2, r);
6644
+ z52.sqrTo(r, r2);
6645
+ z52.sqrTo(r2, r);
6646
6646
  n -= 2;
6647
6647
  }
6648
- if (n > 0) z50.sqrTo(r, r2);
6648
+ if (n > 0) z52.sqrTo(r, r2);
6649
6649
  else {
6650
6650
  t = r;
6651
6651
  r = r2;
6652
6652
  r2 = t;
6653
6653
  }
6654
- z50.mulTo(r2, g[w], r);
6654
+ z52.mulTo(r2, g[w], r);
6655
6655
  }
6656
6656
  while (j >= 0 && (e.data[j] & 1 << i) == 0) {
6657
- z50.sqrTo(r, r2);
6657
+ z52.sqrTo(r, r2);
6658
6658
  t = r;
6659
6659
  r = r2;
6660
6660
  r2 = t;
@@ -6664,7 +6664,7 @@ var require_jsbn = __commonJS({
6664
6664
  }
6665
6665
  }
6666
6666
  }
6667
- return z50.revert(r);
6667
+ return z52.revert(r);
6668
6668
  }
6669
6669
  function bnGCD(a) {
6670
6670
  var x = this.s < 0 ? this.negate() : this.clone();
@@ -18149,6 +18149,24 @@ import { Command as Command4 } from "commander";
18149
18149
  // src/commands/sharing.ts
18150
18150
  import { InvalidArgumentError, Option } from "commander";
18151
18151
 
18152
+ // ../../packages/api/dist/types/user.js
18153
+ import { z } from "zod";
18154
+ var UserRoleSchema = z.enum([
18155
+ "InstanceOperator",
18156
+ "Owner",
18157
+ "Admin",
18158
+ "Member"
18159
+ ]);
18160
+ function parseRoles(raw) {
18161
+ if (!raw)
18162
+ return ["Member"];
18163
+ const parsed = raw.split(",").map((s) => s.trim()).flatMap((s) => {
18164
+ const role = UserRoleSchema.safeParse(s);
18165
+ return role.success ? [role.data] : [];
18166
+ });
18167
+ return parsed.length > 0 ? parsed : ["Member"];
18168
+ }
18169
+
18152
18170
  // ../../packages/api/dist/types/workflowTypeTraits.js
18153
18171
  var WORKFLOW_TYPE_KINDS = ["workflow", "app", "design"];
18154
18172
  var WORKFLOW_TYPE_COLLECTIONS = [
@@ -18840,18 +18858,19 @@ function admitKnownRows(value, method) {
18840
18858
  }
18841
18859
 
18842
18860
  // ../../packages/core/dist/types/platform.js
18843
- import { z } from "zod";
18844
- var CredentialTypeSchema = z.enum([
18861
+ import { z as z2 } from "zod";
18862
+ var CredentialTypeSchema = z2.enum([
18845
18863
  "oauth2",
18846
18864
  "apiKey",
18847
18865
  "platform",
18848
18866
  "platformResource",
18849
18867
  "noAuth"
18850
18868
  ]);
18851
- var PlatformServiceSchema = z.enum([
18869
+ var PlatformServiceSchema = z2.enum([
18852
18870
  "chat-completion",
18853
18871
  "decision",
18854
18872
  "search-internet",
18873
+ "image-search",
18855
18874
  "proxy-scrape",
18856
18875
  "generate-image",
18857
18876
  "geolocation",
@@ -18862,75 +18881,75 @@ var PlatformServiceSchema = z.enum([
18862
18881
  "workspace-members",
18863
18882
  "notifications"
18864
18883
  ]);
18865
- var PlatformResourceKindSchema = z.enum([
18884
+ var PlatformResourceKindSchema = z2.enum([
18866
18885
  "user-database",
18867
18886
  "browser-profile",
18868
18887
  "user-storage"
18869
18888
  ]);
18870
18889
 
18871
18890
  // ../../packages/core/dist/types/proxyScrape.js
18872
- import { z as z2 } from "zod";
18873
- var ProxyScrapeResponseSchema = z2.object({
18874
- content: z2.string(),
18875
- statusCode: z2.number(),
18891
+ import { z as z3 } from "zod";
18892
+ var ProxyScrapeResponseSchema = z3.object({
18893
+ content: z3.string(),
18894
+ statusCode: z3.number(),
18876
18895
  /** Fetched without JS rendering and the page came back as an empty app shell. */
18877
- isLikelyJsShell: z2.boolean().optional()
18896
+ isLikelyJsShell: z3.boolean().optional()
18878
18897
  });
18879
- var ProxyScrapeFailureReasonSchema = z2.enum([
18898
+ var ProxyScrapeFailureReasonSchema = z3.enum([
18880
18899
  "blocked",
18881
18900
  "bad-request",
18882
18901
  "provider-error",
18883
18902
  "timeout",
18884
18903
  "not-offered"
18885
18904
  ]);
18886
- var ProxyScrapeErrorBodySchema = z2.object({
18887
- error: z2.string(),
18905
+ var ProxyScrapeErrorBodySchema = z3.object({
18906
+ error: z3.string(),
18888
18907
  reason: ProxyScrapeFailureReasonSchema
18889
18908
  });
18890
18909
 
18891
18910
  // ../../packages/core/dist/types/trigger.js
18892
- import { z as z3 } from "zod";
18893
- var TriggerTypeSchema = z3.enum(["webhook", "cron", "poll"]);
18894
- var TriggerConfigSchema = z3.discriminatedUnion("type", [
18895
- z3.object({
18896
- type: z3.literal("webhook"),
18897
- payloadSchema: z3.record(z3.string(), z3.unknown()).optional()
18911
+ import { z as z4 } from "zod";
18912
+ var TriggerTypeSchema = z4.enum(["webhook", "cron", "poll"]);
18913
+ var TriggerConfigSchema = z4.discriminatedUnion("type", [
18914
+ z4.object({
18915
+ type: z4.literal("webhook"),
18916
+ payloadSchema: z4.record(z4.string(), z4.unknown()).optional()
18898
18917
  }),
18899
- z3.object({
18900
- type: z3.literal("cron"),
18901
- schedule: z3.string(),
18902
- timezone: z3.string().optional()
18918
+ z4.object({
18919
+ type: z4.literal("cron"),
18920
+ schedule: z4.string(),
18921
+ timezone: z4.string().optional()
18903
18922
  }),
18904
- z3.object({
18905
- type: z3.literal("poll"),
18906
- triggerId: z3.string()
18923
+ z4.object({
18924
+ type: z4.literal("poll"),
18925
+ triggerId: z4.string()
18907
18926
  })
18908
18927
  ]);
18909
18928
 
18910
18929
  // ../../packages/core/dist/types/artifact.js
18911
- import { z as z4 } from "zod";
18912
- var ArtifactMetaSchema = z4.object({
18913
- filename: z4.string(),
18914
- mimeType: z4.string(),
18915
- label: z4.string(),
18916
- sizeBytes: z4.number().nullable()
18930
+ import { z as z5 } from "zod";
18931
+ var ArtifactMetaSchema = z5.object({
18932
+ filename: z5.string(),
18933
+ mimeType: z5.string(),
18934
+ label: z5.string(),
18935
+ sizeBytes: z5.number().nullable()
18917
18936
  });
18918
- var WriteArtifactOptionsSchema = z4.object({
18919
- filename: z4.string(),
18920
- mimeType: z4.string(),
18921
- label: z4.string(),
18937
+ var WriteArtifactOptionsSchema = z5.object({
18938
+ filename: z5.string(),
18939
+ mimeType: z5.string(),
18940
+ label: z5.string(),
18922
18941
  // `z.instanceof(Buffer)` evaluates the `Buffer` constructor at module
18923
18942
  // load — that crashes in the browser, where `Buffer` is undefined,
18924
18943
  // any time something pulls in `@general-input/core` transitively (e.g.
18925
18944
  // a value re-export from `@packages/api`). Use a guarded predicate
18926
18945
  // instead so the schema is safe to define anywhere; the check still
18927
18946
  // runs correctly when actually parsed in Node.
18928
- data: z4.custom((value) => typeof Buffer !== "undefined" && value instanceof Buffer, "Expected a Buffer")
18947
+ data: z5.custom((value) => typeof Buffer !== "undefined" && value instanceof Buffer, "Expected a Buffer")
18929
18948
  });
18930
18949
 
18931
18950
  // ../../packages/core/dist/types/run.js
18932
- import { z as z5 } from "zod";
18933
- var RunStatusSchema = z5.enum([
18951
+ import { z as z6 } from "zod";
18952
+ var RunStatusSchema = z6.enum([
18934
18953
  "pending",
18935
18954
  "running",
18936
18955
  "awaiting_input",
@@ -18940,57 +18959,57 @@ var RunStatusSchema = z5.enum([
18940
18959
  "filtered",
18941
18960
  "skipped"
18942
18961
  ]);
18943
- var LogEntrySchema = z5.object({
18944
- timestamp: z5.string(),
18945
- level: z5.enum(["debug", "info", "warn", "error"]),
18946
- message: z5.string(),
18947
- data: z5.unknown().optional()
18962
+ var LogEntrySchema = z6.object({
18963
+ timestamp: z6.string(),
18964
+ level: z6.enum(["debug", "info", "warn", "error"]),
18965
+ message: z6.string(),
18966
+ data: z6.unknown().optional()
18948
18967
  });
18949
- var ExecutionStepSchema = z5.object({
18950
- message: z5.string(),
18951
- timestamp: z5.string()
18968
+ var ExecutionStepSchema = z6.object({
18969
+ message: z6.string(),
18970
+ timestamp: z6.string()
18952
18971
  });
18953
- var CredentialSnapshotEntrySchema = z5.object({
18954
- inputKey: z5.string(),
18955
- service: z5.string(),
18956
- credentialId: z5.string(),
18957
- credentialTitle: z5.string(),
18958
- iconUrl: z5.string().optional()
18972
+ var CredentialSnapshotEntrySchema = z6.object({
18973
+ inputKey: z6.string(),
18974
+ service: z6.string(),
18975
+ credentialId: z6.string(),
18976
+ credentialTitle: z6.string(),
18977
+ iconUrl: z6.string().optional()
18959
18978
  });
18960
- var PlatformIntegrationSnapshotEntrySchema = z5.object({
18961
- service: z5.string(),
18962
- title: z5.string(),
18963
- iconUrl: z5.string(),
18964
- estimatedCostDisplay: z5.string()
18979
+ var PlatformIntegrationSnapshotEntrySchema = z6.object({
18980
+ service: z6.string(),
18981
+ title: z6.string(),
18982
+ iconUrl: z6.string(),
18983
+ estimatedCostDisplay: z6.string()
18965
18984
  });
18966
- var ConstSnapshotEntrySchema = z5.object({
18967
- key: z5.string(),
18968
- title: z5.string(),
18969
- value: z5.unknown()
18985
+ var ConstSnapshotEntrySchema = z6.object({
18986
+ key: z6.string(),
18987
+ title: z6.string(),
18988
+ value: z6.unknown()
18970
18989
  });
18971
- var WorkflowSnapshotSchema = z5.object({
18972
- id: z5.string(),
18973
- name: z5.string(),
18974
- description: z5.string()
18990
+ var WorkflowSnapshotSchema = z6.object({
18991
+ id: z6.string(),
18992
+ name: z6.string(),
18993
+ description: z6.string()
18975
18994
  });
18976
- var WorkflowTypeSchema = z5.enum(["code", "agent", "app", "design"]);
18977
- var HumanInLoopNotifyChannelSchema = z5.enum([
18995
+ var WorkflowTypeSchema = z6.enum(["code", "agent", "app", "design"]);
18996
+ var HumanInLoopNotifyChannelSchema = z6.enum([
18978
18997
  "email",
18979
18998
  "slack",
18980
18999
  "push",
18981
19000
  "browser"
18982
19001
  ]);
18983
19002
  var ALL_CONNECTED_NOTIFY = "all-connected";
18984
- var HumanInLoopNotifySchema = z5.union([
18985
- z5.literal(ALL_CONNECTED_NOTIFY),
18986
- z5.array(HumanInLoopNotifyChannelSchema)
19003
+ var HumanInLoopNotifySchema = z6.union([
19004
+ z6.literal(ALL_CONNECTED_NOTIFY),
19005
+ z6.array(HumanInLoopNotifyChannelSchema)
18987
19006
  ]);
18988
- var AgentHumanInLoopConfigSchema = z5.object({
18989
- enabled: z5.boolean(),
19007
+ var AgentHumanInLoopConfigSchema = z6.object({
19008
+ enabled: z6.boolean(),
18990
19009
  // Defaults to empty so `{ "enabled": false }` — the natural shorthand for a
18991
19010
  // fully autonomous workflow — validates without the ceremony of an empty
18992
19011
  // string the author has no reason to type.
18993
- instructions: z5.string().default(""),
19012
+ instructions: z6.string().default(""),
18994
19013
  // The default also covers configs written before the field, so a paused run reaches someone who never opens the app.
18995
19014
  notify: HumanInLoopNotifySchema.default(ALL_CONNECTED_NOTIFY)
18996
19015
  });
@@ -19001,200 +19020,200 @@ function autonomousHumanInLoopConfig() {
19001
19020
  notify: ALL_CONNECTED_NOTIFY
19002
19021
  };
19003
19022
  }
19004
- var AgentConfigSnapshotSchema = z5.object({
19005
- model: z5.string(),
19006
- modelDisplayName: z5.string(),
19023
+ var AgentConfigSnapshotSchema = z6.object({
19024
+ model: z6.string(),
19025
+ modelDisplayName: z6.string(),
19007
19026
  // Default keeps snapshots written before iconId was captured parseable.
19008
- modelIconId: z5.string().default("custom"),
19009
- maxTimeMinutes: z5.number(),
19010
- effort: z5.string().optional(),
19027
+ modelIconId: z6.string().default("custom"),
19028
+ maxTimeMinutes: z6.number(),
19029
+ effort: z6.string().optional(),
19011
19030
  // Default keeps run files written before HITL existed parseable.
19012
19031
  humanInLoop: AgentHumanInLoopConfigSchema.default(autonomousHumanInLoopConfig)
19013
19032
  });
19014
- var WorkflowRunStatusSchema = z5.object({
19015
- id: z5.string(),
19016
- workflowId: z5.string(),
19033
+ var WorkflowRunStatusSchema = z6.object({
19034
+ id: z6.string(),
19035
+ workflowId: z6.string(),
19017
19036
  workflowType: WorkflowTypeSchema.default("code"),
19018
19037
  workflow: WorkflowSnapshotSchema,
19019
19038
  status: RunStatusSchema,
19020
- trigger: z5.object({
19021
- id: z5.string(),
19022
- payload: z5.unknown()
19039
+ trigger: z6.object({
19040
+ id: z6.string(),
19041
+ payload: z6.unknown()
19023
19042
  }).optional(),
19024
19043
  // What the workflow received (trigger is what fired it; absent for
19025
19044
  // manual runs). Optional: run files written before this field exist.
19026
- input: z5.unknown().optional(),
19027
- startedAt: z5.string().optional(),
19028
- completedAt: z5.string().optional(),
19029
- error: z5.string().optional(),
19030
- steps: z5.array(ExecutionStepSchema).optional(),
19031
- logs: z5.array(LogEntrySchema),
19032
- artifacts: z5.array(ArtifactMetaSchema),
19033
- constSnapshot: z5.array(ConstSnapshotEntrySchema).optional(),
19034
- credentialSnapshot: z5.array(CredentialSnapshotEntrySchema).optional(),
19035
- platformIntegrationSnapshot: z5.array(PlatformIntegrationSnapshotEntrySchema).optional(),
19045
+ input: z6.unknown().optional(),
19046
+ startedAt: z6.string().optional(),
19047
+ completedAt: z6.string().optional(),
19048
+ error: z6.string().optional(),
19049
+ steps: z6.array(ExecutionStepSchema).optional(),
19050
+ logs: z6.array(LogEntrySchema),
19051
+ artifacts: z6.array(ArtifactMetaSchema),
19052
+ constSnapshot: z6.array(ConstSnapshotEntrySchema).optional(),
19053
+ credentialSnapshot: z6.array(CredentialSnapshotEntrySchema).optional(),
19054
+ platformIntegrationSnapshot: z6.array(PlatformIntegrationSnapshotEntrySchema).optional(),
19036
19055
  agentConfigSnapshot: AgentConfigSnapshotSchema.optional()
19037
19056
  });
19038
19057
 
19039
19058
  // ../../packages/core/dist/types/execution.js
19040
- import { z as z8 } from "zod";
19059
+ import { z as z9 } from "zod";
19041
19060
 
19042
19061
  // ../../packages/core/dist/types/filter.js
19043
- import { z as z6 } from "zod";
19044
- var WorkflowExecutionModeSchema = z6.enum(["run", "filter", "sources"]);
19045
- var WorkflowFilterDecisionSchema = z6.discriminatedUnion("decision", [
19046
- z6.object({
19047
- decision: z6.literal("skip"),
19048
- reason: z6.string().min(1)
19062
+ import { z as z7 } from "zod";
19063
+ var WorkflowExecutionModeSchema = z7.enum(["run", "filter", "sources"]);
19064
+ var WorkflowFilterDecisionSchema = z7.discriminatedUnion("decision", [
19065
+ z7.object({
19066
+ decision: z7.literal("skip"),
19067
+ reason: z7.string().min(1)
19049
19068
  }),
19050
- z6.object({
19051
- decision: z6.literal("run"),
19052
- reason: z6.string().optional(),
19069
+ z7.object({
19070
+ decision: z7.literal("run"),
19071
+ reason: z7.string().optional(),
19053
19072
  /** Replaces the trigger payload for the run. Omit to pass it through. */
19054
- input: z6.unknown().optional()
19073
+ input: z7.unknown().optional()
19055
19074
  })
19056
19075
  ]);
19057
19076
 
19058
19077
  // ../../packages/core/dist/types/designSources.js
19059
- import { z as z7 } from "zod";
19078
+ import { z as z8 } from "zod";
19060
19079
  var MAX_DESIGN_SOURCE_BYTES = 5 * 1024 * 1024;
19061
19080
  var DESIGN_SOURCE_TIMEOUT_MS = 2 * 6e4;
19062
- var DesignSourceOutcomeSchema = z7.discriminatedUnion("status", [
19063
- z7.object({
19064
- status: z7.literal("ok"),
19065
- value: z7.unknown(),
19066
- durationMs: z7.number()
19081
+ var DesignSourceOutcomeSchema = z8.discriminatedUnion("status", [
19082
+ z8.object({
19083
+ status: z8.literal("ok"),
19084
+ value: z8.unknown(),
19085
+ durationMs: z8.number()
19067
19086
  }),
19068
- z7.object({
19069
- status: z7.literal("failed"),
19070
- error: z7.string(),
19071
- durationMs: z7.number()
19087
+ z8.object({
19088
+ status: z8.literal("failed"),
19089
+ error: z8.string(),
19090
+ durationMs: z8.number()
19072
19091
  })
19073
19092
  ]);
19074
- var DesignSourceResultsSchema = z7.record(z7.string(), DesignSourceOutcomeSchema);
19093
+ var DesignSourceResultsSchema = z8.record(z8.string(), DesignSourceOutcomeSchema);
19075
19094
 
19076
19095
  // ../../packages/core/dist/types/execution.js
19077
- var EgressRequesterAllowerSchema = z8.object({ kind: z8.literal("requester") });
19078
- var EgressBlockSourceSchema = z8.discriminatedUnion("layer", [
19079
- z8.object({
19080
- layer: z8.literal("workspace"),
19081
- settingsUrl: z8.string(),
19082
- allower: z8.discriminatedUnion("kind", [
19096
+ var EgressRequesterAllowerSchema = z9.object({ kind: z9.literal("requester") });
19097
+ var EgressBlockSourceSchema = z9.discriminatedUnion("layer", [
19098
+ z9.object({
19099
+ layer: z9.literal("workspace"),
19100
+ settingsUrl: z9.string(),
19101
+ allower: z9.discriminatedUnion("kind", [
19083
19102
  EgressRequesterAllowerSchema,
19084
- z8.object({ kind: z8.literal("workspace_admins") })
19103
+ z9.object({ kind: z9.literal("workspace_admins") })
19085
19104
  ])
19086
19105
  }),
19087
- z8.object({
19088
- layer: z8.literal("credential"),
19089
- settingsUrl: z8.string(),
19090
- allower: z8.discriminatedUnion("kind", [
19106
+ z9.object({
19107
+ layer: z9.literal("credential"),
19108
+ settingsUrl: z9.string(),
19109
+ allower: z9.discriminatedUnion("kind", [
19091
19110
  EgressRequesterAllowerSchema,
19092
- z8.object({ kind: z8.literal("connection_owner"), name: z8.string() })
19111
+ z9.object({ kind: z9.literal("connection_owner"), name: z9.string() })
19093
19112
  ])
19094
19113
  })
19095
19114
  ]);
19096
- var ExecutionEgressPolicySchema = z8.object({
19097
- unmatched: z8.literal("allow_log"),
19098
- credentials: z8.array(z8.object({
19099
- inputKey: z8.string(),
19100
- service: z8.string(),
19101
- hosts: z8.array(z8.string()),
19102
- deny: z8.array(z8.object({
19103
- method: z8.string(),
19104
- pathTemplate: z8.string(),
19105
- opId: z8.string(),
19106
- title: z8.string(),
19115
+ var ExecutionEgressPolicySchema = z9.object({
19116
+ unmatched: z9.literal("allow_log"),
19117
+ credentials: z9.array(z9.object({
19118
+ inputKey: z9.string(),
19119
+ service: z9.string(),
19120
+ hosts: z9.array(z9.string()),
19121
+ deny: z9.array(z9.object({
19122
+ method: z9.string(),
19123
+ pathTemplate: z9.string(),
19124
+ opId: z9.string(),
19125
+ title: z9.string(),
19107
19126
  // Description only: missing (older server) or unreadable (newer one)
19108
19127
  // drops to [] so it can never void the policy and stop enforcement.
19109
- blockedBy: z8.array(EgressBlockSourceSchema).catch([])
19128
+ blockedBy: z9.array(EgressBlockSourceSchema).catch([])
19110
19129
  }))
19111
19130
  }))
19112
19131
  });
19113
- var ExecutionPayloadSchema = z8.object({
19114
- executionId: z8.string(),
19115
- workflowId: z8.string(),
19116
- input: z8.unknown(),
19117
- credentials: z8.record(z8.string(), z8.record(z8.string(), z8.unknown())),
19118
- platformCredentials: z8.record(z8.string(), z8.record(z8.string(), z8.unknown())),
19119
- consts: z8.record(z8.string(), z8.unknown()),
19120
- platformAuth: z8.object({
19121
- platformApiKey: z8.string(),
19122
- platformBaseUrl: z8.string(),
19123
- membershipId: z8.string(),
19132
+ var ExecutionPayloadSchema = z9.object({
19133
+ executionId: z9.string(),
19134
+ workflowId: z9.string(),
19135
+ input: z9.unknown(),
19136
+ credentials: z9.record(z9.string(), z9.record(z9.string(), z9.unknown())),
19137
+ platformCredentials: z9.record(z9.string(), z9.record(z9.string(), z9.unknown())),
19138
+ consts: z9.record(z9.string(), z9.unknown()),
19139
+ platformAuth: z9.object({
19140
+ platformApiKey: z9.string(),
19141
+ platformBaseUrl: z9.string(),
19142
+ membershipId: z9.string(),
19124
19143
  // The resources this key may touch. Null means the run declared no
19125
19144
  // resource slots and keeps unscoped access.
19126
- boundResourceIds: z8.array(z8.string()).nullable()
19145
+ boundResourceIds: z9.array(z9.string()).nullable()
19127
19146
  }),
19128
- trigger: z8.object({
19129
- id: z8.string(),
19130
- key: z8.string(),
19131
- payload: z8.unknown()
19147
+ trigger: z9.object({
19148
+ id: z9.string(),
19149
+ key: z9.string(),
19150
+ payload: z9.unknown()
19132
19151
  }).optional(),
19133
19152
  egressPolicy: ExecutionEgressPolicySchema.optional()
19134
19153
  });
19135
- var ExecutionEventSchema = z8.discriminatedUnion("type", [
19136
- z8.object({
19137
- type: z8.literal("run:started"),
19138
- executionId: z8.string(),
19139
- workflowId: z8.string()
19154
+ var ExecutionEventSchema = z9.discriminatedUnion("type", [
19155
+ z9.object({
19156
+ type: z9.literal("run:started"),
19157
+ executionId: z9.string(),
19158
+ workflowId: z9.string()
19140
19159
  }),
19141
- z8.object({ type: z8.literal("run:completed"), executionId: z8.string() }),
19142
- z8.object({
19143
- type: z8.literal("run:failed"),
19144
- executionId: z8.string(),
19145
- error: z8.string()
19160
+ z9.object({ type: z9.literal("run:completed"), executionId: z9.string() }),
19161
+ z9.object({
19162
+ type: z9.literal("run:failed"),
19163
+ executionId: z9.string(),
19164
+ error: z9.string()
19146
19165
  }),
19147
- z8.object({
19148
- type: z8.literal("step"),
19149
- executionId: z8.string(),
19150
- message: z8.string()
19166
+ z9.object({
19167
+ type: z9.literal("step"),
19168
+ executionId: z9.string(),
19169
+ message: z9.string()
19151
19170
  }),
19152
- z8.object({
19153
- type: z8.literal("artifact:written"),
19154
- executionId: z8.string(),
19171
+ z9.object({
19172
+ type: z9.literal("artifact:written"),
19173
+ executionId: z9.string(),
19155
19174
  artifact: ArtifactMetaSchema
19156
19175
  }),
19157
- z8.object({
19158
- type: z8.literal("log"),
19159
- executionId: z8.string(),
19176
+ z9.object({
19177
+ type: z9.literal("log"),
19178
+ executionId: z9.string(),
19160
19179
  entry: LogEntrySchema
19161
19180
  }),
19162
- z8.object({
19163
- type: z8.literal("filter:decision"),
19164
- executionId: z8.string(),
19181
+ z9.object({
19182
+ type: z9.literal("filter:decision"),
19183
+ executionId: z9.string(),
19165
19184
  decision: WorkflowFilterDecisionSchema
19166
19185
  }),
19167
19186
  // A large decision spills to an artifact rather than the stdout event stream:
19168
19187
  // a line long enough to span chunks can arrive corrupted, and one the consumer
19169
19188
  // cannot parse reads as "no decision" and fails the filter open.
19170
- z8.object({
19171
- type: z8.literal("filter:decision-artifact"),
19172
- executionId: z8.string(),
19173
- filename: z8.string()
19189
+ z9.object({
19190
+ type: z9.literal("filter:decision-artifact"),
19191
+ executionId: z9.string(),
19192
+ filename: z9.string()
19174
19193
  }),
19175
- z8.object({
19176
- type: z8.literal("sources:results"),
19177
- executionId: z8.string(),
19194
+ z9.object({
19195
+ type: z9.literal("sources:results"),
19196
+ executionId: z9.string(),
19178
19197
  results: DesignSourceResultsSchema
19179
19198
  }),
19180
19199
  // Large results spill to an artifact for the same reason a filter decision does.
19181
- z8.object({
19182
- type: z8.literal("sources:results-artifact"),
19183
- executionId: z8.string(),
19184
- filename: z8.string()
19200
+ z9.object({
19201
+ type: z9.literal("sources:results-artifact"),
19202
+ executionId: z9.string(),
19203
+ filename: z9.string()
19185
19204
  }),
19186
19205
  // An event line arrived unparseable. Emitted by the provider, never by the
19187
19206
  // sandbox: it means bytes were lost in transport, which is not the same thing
19188
19207
  // as the workflow having produced nothing.
19189
- z8.object({
19190
- type: z8.literal("stream:corrupt"),
19191
- executionId: z8.string(),
19192
- byteLength: z8.number()
19208
+ z9.object({
19209
+ type: z9.literal("stream:corrupt"),
19210
+ executionId: z9.string(),
19211
+ byteLength: z9.number()
19193
19212
  })
19194
19213
  ]);
19195
19214
 
19196
19215
  // ../../packages/core/dist/types/manifest.js
19197
- import { z as z9 } from "zod";
19216
+ import { z as z10 } from "zod";
19198
19217
 
19199
19218
  // ../../packages/workflow-doc-schema/dist/nodeTypes.js
19200
19219
  var WORKFLOW_CUSTOM_NODE_TYPES = {
@@ -19223,69 +19242,69 @@ var ALLOWED_NODE_TYPES = /* @__PURE__ */ new Set([
19223
19242
  ]);
19224
19243
 
19225
19244
  // ../../packages/core/dist/types/manifest.js
19226
- var TriggerBlockSchema = z9.object({
19227
- type: z9.literal(WORKFLOW_CUSTOM_NODE_TYPES.trigger),
19228
- attrs: z9.object({
19229
- id: z9.string(),
19230
- triggerId: z9.string().optional(),
19231
- service: z9.string(),
19232
- event: z9.string()
19245
+ var TriggerBlockSchema = z10.object({
19246
+ type: z10.literal(WORKFLOW_CUSTOM_NODE_TYPES.trigger),
19247
+ attrs: z10.object({
19248
+ id: z10.string(),
19249
+ triggerId: z10.string().optional(),
19250
+ service: z10.string(),
19251
+ event: z10.string()
19233
19252
  })
19234
19253
  });
19235
- var InputSchemaBlockSchema = z9.object({
19236
- type: z9.literal(WORKFLOW_CUSTOM_NODE_TYPES.inputSchema),
19237
- attrs: z9.object({
19238
- schema: z9.record(z9.string(), z9.unknown())
19254
+ var InputSchemaBlockSchema = z10.object({
19255
+ type: z10.literal(WORKFLOW_CUSTOM_NODE_TYPES.inputSchema),
19256
+ attrs: z10.object({
19257
+ schema: z10.record(z10.string(), z10.unknown())
19239
19258
  })
19240
19259
  });
19241
- var CredentialBlockSchema = z9.object({
19242
- type: z9.literal(WORKFLOW_CUSTOM_NODE_TYPES.credential),
19243
- attrs: z9.object({
19244
- service: z9.string(),
19245
- inputKey: z9.string(),
19260
+ var CredentialBlockSchema = z10.object({
19261
+ type: z10.literal(WORKFLOW_CUSTOM_NODE_TYPES.credential),
19262
+ attrs: z10.object({
19263
+ service: z10.string(),
19264
+ inputKey: z10.string(),
19246
19265
  // Absent or false = required. Optional credentials may be left unconnected;
19247
19266
  // the workflow handles their absence at runtime (hasCredential).
19248
- optional: z9.boolean().optional()
19267
+ optional: z10.boolean().optional()
19249
19268
  })
19250
19269
  });
19251
- var PlatformCredentialBlockSchema = z9.object({
19252
- type: z9.literal(WORKFLOW_CUSTOM_NODE_TYPES.platformCredential),
19253
- attrs: z9.object({
19270
+ var PlatformCredentialBlockSchema = z10.object({
19271
+ type: z10.literal(WORKFLOW_CUSTOM_NODE_TYPES.platformCredential),
19272
+ attrs: z10.object({
19254
19273
  service: PlatformServiceSchema,
19255
- inputKey: z9.string()
19274
+ inputKey: z10.string()
19256
19275
  })
19257
19276
  });
19258
- var ConstBlockSchema = z9.object({
19259
- type: z9.literal(WORKFLOW_CUSTOM_NODE_TYPES.const),
19260
- attrs: z9.object({
19261
- key: z9.string(),
19262
- schema: z9.record(z9.string(), z9.unknown())
19277
+ var ConstBlockSchema = z10.object({
19278
+ type: z10.literal(WORKFLOW_CUSTOM_NODE_TYPES.const),
19279
+ attrs: z10.object({
19280
+ key: z10.string(),
19281
+ schema: z10.record(z10.string(), z10.unknown())
19263
19282
  })
19264
19283
  });
19265
- var WorkflowManifestSchema = z9.object({
19266
- name: z9.string().optional(),
19267
- description: z9.string().optional(),
19284
+ var WorkflowManifestSchema = z10.object({
19285
+ name: z10.string().optional(),
19286
+ description: z10.string().optional(),
19268
19287
  /** The document declares a filter, so `filter.ts` gates every run. */
19269
- hasFilter: z9.boolean(),
19270
- triggers: z9.array(z9.object({
19271
- id: z9.string(),
19272
- triggerId: z9.string().optional(),
19273
- service: z9.string(),
19274
- event: z9.string()
19288
+ hasFilter: z10.boolean(),
19289
+ triggers: z10.array(z10.object({
19290
+ id: z10.string(),
19291
+ triggerId: z10.string().optional(),
19292
+ service: z10.string(),
19293
+ event: z10.string()
19275
19294
  })),
19276
- inputSchema: z9.record(z9.string(), z9.unknown()).optional(),
19277
- credentials: z9.array(z9.object({
19278
- service: z9.string(),
19279
- inputKey: z9.string(),
19280
- optional: z9.boolean().optional()
19295
+ inputSchema: z10.record(z10.string(), z10.unknown()).optional(),
19296
+ credentials: z10.array(z10.object({
19297
+ service: z10.string(),
19298
+ inputKey: z10.string(),
19299
+ optional: z10.boolean().optional()
19281
19300
  })),
19282
- platformCredentials: z9.array(z9.object({
19301
+ platformCredentials: z10.array(z10.object({
19283
19302
  service: PlatformServiceSchema,
19284
- inputKey: z9.string()
19303
+ inputKey: z10.string()
19285
19304
  })),
19286
- consts: z9.array(z9.object({
19287
- key: z9.string(),
19288
- schema: z9.record(z9.string(), z9.unknown())
19305
+ consts: z10.array(z10.object({
19306
+ key: z10.string(),
19307
+ schema: z10.record(z10.string(), z10.unknown())
19289
19308
  }))
19290
19309
  });
19291
19310
 
@@ -19486,6 +19505,10 @@ var Scrubber = class {
19486
19505
  redact(text) {
19487
19506
  return this.stream().redact(text, { final: true });
19488
19507
  }
19508
+ /** For a redactor that runs where this object cannot, such as inside a sandbox. */
19509
+ entries() {
19510
+ return [...this.redactions].map(([secret, marker]) => ({ secret, marker }));
19511
+ }
19489
19512
  /** Test-only: how many secrets are registered. */
19490
19513
  get size() {
19491
19514
  return this.redactions.size;
@@ -19606,6 +19629,8 @@ var OrgPermission = {
19606
19629
  MEMBERS_ARCHIVE: "members:archive",
19607
19630
  MEMBERS_DEMOTE_ADMIN: "members:demote_admin",
19608
19631
  MEMBERS_TRANSFER_OWNERSHIP: "members:transfer_ownership",
19632
+ // Teams: create, rename, delete, and choose who is on each and who leads
19633
+ TEAMS_MANAGE: "teams:manage",
19609
19634
  // OAuth connections
19610
19635
  ORG_MANAGE_OAUTH_CONNECTIONS: "org:manage_oauth_connections",
19611
19636
  // Notification channels — connect Slack/etc and match members to accounts
@@ -19620,6 +19645,8 @@ var OrgPermission = {
19620
19645
  MEMORY_MODIFY: "memory:modify",
19621
19646
  // CRM — order the enrichment provider waterfalls (org-wide chains)
19622
19647
  CRM_CONFIGURE_WATERFALLS: "crm:configure_waterfalls",
19648
+ // CRM: see and manage every record, whoever owns it and however it's shared
19649
+ CRM_ACCESS_ALL_RECORDS: "crm:access_all_records",
19623
19650
  INSTANCE_OPERATE: "instance:operate",
19624
19651
  // Security audit
19625
19652
  ORG_SECURITY_ACCESS: "audit:org_security_access",
@@ -19668,6 +19695,7 @@ var ORG_PERMISSIONS = [
19668
19695
  { id: OrgPermission.MEMBERS_ARCHIVE, label: "Deactivate members" },
19669
19696
  { id: OrgPermission.MEMBERS_DEMOTE_ADMIN, label: "Demote admins" },
19670
19697
  { id: OrgPermission.MEMBERS_TRANSFER_OWNERSHIP, label: "Transfer ownership" },
19698
+ { id: OrgPermission.TEAMS_MANAGE, label: "Manage teams" },
19671
19699
  {
19672
19700
  id: OrgPermission.ORG_MANAGE_OAUTH_CONNECTIONS,
19673
19701
  label: "Manage OAuth integrations"
@@ -19692,6 +19720,10 @@ var ORG_PERMISSIONS = [
19692
19720
  id: OrgPermission.CRM_CONFIGURE_WATERFALLS,
19693
19721
  label: "Configure CRM waterfalls"
19694
19722
  },
19723
+ {
19724
+ id: OrgPermission.CRM_ACCESS_ALL_RECORDS,
19725
+ label: "See and manage every CRM record"
19726
+ },
19695
19727
  {
19696
19728
  id: OrgPermission.MEMORY_MODIFY,
19697
19729
  label: "Modify workspace memory"
@@ -19750,12 +19782,14 @@ var ROLES_BY_PERMISSION = {
19750
19782
  [OrgPermission.MEMBERS_ARCHIVE]: ["Admin", "Owner"],
19751
19783
  [OrgPermission.MEMBERS_DEMOTE_ADMIN]: ["Owner"],
19752
19784
  [OrgPermission.MEMBERS_TRANSFER_OWNERSHIP]: ["Owner"],
19785
+ [OrgPermission.TEAMS_MANAGE]: ["Admin", "Owner"],
19753
19786
  [OrgPermission.ORG_MANAGE_OAUTH_CONNECTIONS]: ["Admin", "Owner"],
19754
19787
  [OrgPermission.ORG_MANAGE_NOTIFICATION_CHANNELS]: ["Admin", "Owner"],
19755
19788
  [OrgPermission.ORG_MANAGE_EGRESS_POLICY]: ["Admin", "Owner"],
19756
19789
  [OrgPermission.ORG_MANAGE_MODELS]: ["Admin", "Owner"],
19757
19790
  [OrgPermission.ORG_MANAGE_PLATFORM_SERVICES]: ["Admin", "Owner"],
19758
19791
  [OrgPermission.CRM_CONFIGURE_WATERFALLS]: ["Admin", "Owner"],
19792
+ [OrgPermission.CRM_ACCESS_ALL_RECORDS]: ["Admin", "Owner"],
19759
19793
  [OrgPermission.MEMORY_MODIFY]: ["Admin", "Owner"],
19760
19794
  [OrgPermission.INSTANCE_OPERATE]: ["InstanceOperator"],
19761
19795
  [OrgPermission.ORG_SECURITY_ACCESS]: ["Admin", "Owner"],
@@ -19768,17 +19802,25 @@ var ROLES_BY_PERMISSION = {
19768
19802
  [OrgPermission.VIEW_ANY_SKILL]: ["Admin", "Owner"],
19769
19803
  [OrgPermission.MEMBERS_TRANSFER_RESOURCES]: ["Admin", "Owner"]
19770
19804
  };
19771
- var WORKFLOW_PERMISSION_ROLE_FLOOR = {
19772
- [OrgPermission.EDIT_ANY_WORKFLOW]: "editor"
19773
- };
19805
+ var ORG_PERMISSION_VALUES = Object.values(OrgPermission);
19806
+ var OWNER_OR_INSTANCE_PERMISSIONS = /* @__PURE__ */ new Set([
19807
+ OrgPermission.ORG_DELETE,
19808
+ OrgPermission.MEMBERS_TRANSFER_OWNERSHIP,
19809
+ OrgPermission.MEMBERS_DEMOTE_ADMIN,
19810
+ OrgPermission.INSTANCE_OPERATE
19811
+ ]);
19812
+ var ASSIGNABLE_ORG_PERMISSIONS = ORG_PERMISSION_VALUES.filter((permission) => !OWNER_OR_INSTANCE_PERMISSIONS.has(permission));
19813
+ function baseRolePermissions(roles) {
19814
+ return ORG_PERMISSION_VALUES.filter((permission) => roles.some((role) => ROLES_BY_PERMISSION[permission].includes(role)));
19815
+ }
19774
19816
 
19775
19817
  // ../../packages/api/dist/types/workspaceModelPolicy.js
19776
- import { z as z10 } from "zod";
19777
- var WorkspaceModelManagerSchema = z10.enum([
19818
+ import { z as z11 } from "zod";
19819
+ var WorkspaceModelManagerSchema = z11.enum([
19778
19820
  "workspace",
19779
19821
  "instance-operators"
19780
19822
  ]);
19781
- var AgentModelChoiceSchema = z10.enum(["any", "auto-only"]);
19823
+ var AgentModelChoiceSchema = z11.enum(["any", "auto-only"]);
19782
19824
  var DEFAULT_WORKSPACE_MODEL_POLICY = {
19783
19825
  managedBy: "workspace",
19784
19826
  agentModelChoice: "any"
@@ -19936,6 +19978,13 @@ function workspaceDepartureOwnedKindsQuery() {
19936
19978
  return WORKSPACE_DEPARTURE_OWNED_KINDS.join(",");
19937
19979
  }
19938
19980
 
19981
+ // ../../packages/api/dist/types/legacyCreditsShown.js
19982
+ function fillLegacyCreditsShown(value) {
19983
+ if ("billingEnabled" in value && !("shouldShowCredits" in value)) {
19984
+ Reflect.set(value, "shouldShowCredits", true);
19985
+ }
19986
+ }
19987
+
19939
19988
  // ../../packages/api/dist/types/legacyOnboardingFirstSpecialist.js
19940
19989
  function fillLegacyOnboardingFirstSpecialist(state) {
19941
19990
  if (!("stage" in state) || !("stages" in state))
@@ -20091,6 +20140,31 @@ function fillLegacyWorkspaceModelPolicy(value) {
20091
20140
  }
20092
20141
  }
20093
20142
 
20143
+ // ../../packages/api/dist/types/legacyWorkspacePermissions.js
20144
+ function rolesOf(value) {
20145
+ if ("roles" in value && Array.isArray(value.roles)) {
20146
+ return value.roles.flatMap((role) => {
20147
+ const parsed = UserRoleSchema.safeParse(role);
20148
+ return parsed.success ? [parsed.data] : [];
20149
+ });
20150
+ }
20151
+ if ("role" in value && typeof value.role === "string") {
20152
+ return parseRoles(value.role);
20153
+ }
20154
+ return null;
20155
+ }
20156
+ function fillLegacyWorkspacePermissions(value) {
20157
+ const isMembership = "modelDefaults" in value && "organizationId" in value;
20158
+ const isActiveWorkspace = "onboardingStage" in value && "membershipId" in value;
20159
+ if (!isMembership && !isActiveWorkspace)
20160
+ return;
20161
+ if ("permissions" in value)
20162
+ return;
20163
+ const roles = rolesOf(value);
20164
+ if (roles)
20165
+ Reflect.set(value, "permissions", baseRolePermissions(roles));
20166
+ }
20167
+
20094
20168
  // ../../packages/api/dist/types/legacyHostedTunnelShareBlocker.js
20095
20169
  function fillLegacyHostedTunnelShareBlocker(value) {
20096
20170
  const isShareListWorkspace = "isShared" in value && "organizationId" in value && "organizationProfilePictureUrl" in value;
@@ -20178,6 +20252,33 @@ function fillLegacyMemberNames(value) {
20178
20252
  }
20179
20253
  }
20180
20254
 
20255
+ // ../../packages/api/dist/types/legacyMemberTeams.js
20256
+ function fillLegacyMemberTeams(value) {
20257
+ const isMember = "memberRoles" in value && "membershipId" in value;
20258
+ if (isMember && !("teams" in value))
20259
+ Reflect.set(value, "teams", []);
20260
+ }
20261
+
20262
+ // ../../packages/api/dist/types/legacyCrmRecordAccess.js
20263
+ function fillLegacyCrmRecordAccess(value) {
20264
+ if ("access" in value)
20265
+ return;
20266
+ const isPersonDetail = "person" in value && "employments" in value && "contactPoints" in value;
20267
+ const isCompanyDetail = "company" in value && "peopleCount" in value && "tags" in value;
20268
+ const isDeal = "pipelineId" in value && "boardPosition" in value && "staleness" in value;
20269
+ if (!isPersonDetail && !isCompanyDetail && !isDeal)
20270
+ return;
20271
+ const owner = (field) => isDeal ? Reflect.get(value, field) ?? null : null;
20272
+ Reflect.set(value, "access", {
20273
+ ownerMembershipId: owner("ownerMembershipId"),
20274
+ ownerName: owner("ownerName"),
20275
+ teamId: null,
20276
+ teamName: null,
20277
+ visibility: "workspace",
20278
+ canManage: false
20279
+ });
20280
+ }
20281
+
20181
20282
  // ../../packages/api/dist/types/legacyGettingStartedShown.js
20182
20283
  function fillLegacyGettingStartedShown(value) {
20183
20284
  if ("steps" in value && "completedCount" in value && "totalCount" in value && !("isShown" in value) && typeof value.completedCount === "number" && typeof value.totalCount === "number") {
@@ -20205,6 +20306,7 @@ var LEGACY_FILLS = [
20205
20306
  fillLegacyCredentialOutage,
20206
20307
  fillLegacyCredentialConnection,
20207
20308
  fillLegacyWorkspaceModelPolicy,
20309
+ fillLegacyWorkspacePermissions,
20208
20310
  fillLegacyHostedTunnelShareBlocker,
20209
20311
  fillLegacyDesignCounts,
20210
20312
  fillLegacySearchRecentDesigns,
@@ -20213,8 +20315,11 @@ var LEGACY_FILLS = [
20213
20315
  fillLegacyDesignVideo,
20214
20316
  fillLegacySpecialistFolders,
20215
20317
  fillLegacyMemberNames,
20318
+ fillLegacyMemberTeams,
20319
+ fillLegacyCrmRecordAccess,
20216
20320
  fillLegacyGettingStartedShown,
20217
- fillLegacySpecialistConversationSnoozes
20321
+ fillLegacySpecialistConversationSnoozes,
20322
+ fillLegacyCreditsShown
20218
20323
  ];
20219
20324
  function fillLegacyApiFields(value) {
20220
20325
  if (Array.isArray(value)) {
@@ -20242,7 +20347,7 @@ var SPECIALIST_TEMPLATE_SCOPES = [
20242
20347
  ];
20243
20348
 
20244
20349
  // ../../packages/api/dist/types/organizationCustomIntegration.js
20245
- import { z as z11 } from "zod";
20350
+ import { z as z12 } from "zod";
20246
20351
  var CUSTOM_API_AUTHORING_ACTIONS = defineCustomApiAuthoringActions({
20247
20352
  list: {
20248
20353
  toolId: "list_custom_apis",
@@ -20283,45 +20388,45 @@ var TOOL_ID_UPSERT_CUSTOM_API_OPERATION = CUSTOM_API_AUTHORING_ACTIONS.upsertOpe
20283
20388
  var TOOL_ID_DELETE_CUSTOM_API_OPERATION = CUSTOM_API_AUTHORING_ACTIONS.deleteOperation.toolId;
20284
20389
  var TOOL_ID_SET_CUSTOM_API_STATUS = CUSTOM_API_AUTHORING_ACTIONS.setStatus.toolId;
20285
20390
  var DEFAULT_CUSTOM_INTEGRATION_ICON_URL = "/icons/custom-api.svg";
20286
- var CustomIntegrationIconUrlSchema = z11.string().refine((value) => {
20391
+ var CustomIntegrationIconUrlSchema = z12.string().refine((value) => {
20287
20392
  if (value === DEFAULT_CUSTOM_INTEGRATION_ICON_URL)
20288
20393
  return true;
20289
- const parsed = z11.url().safeParse(value);
20394
+ const parsed = z12.url().safeParse(value);
20290
20395
  if (!parsed.success)
20291
20396
  return false;
20292
20397
  const protocol = new URL(value).protocol;
20293
20398
  return protocol === "http:" || protocol === "https:";
20294
20399
  }, "Icon URL must be the stock icon path or use HTTP or HTTPS");
20295
- var CustomIntegrationSecretFieldSchema = z11.object({
20296
- key: z11.string().regex(/^[A-Za-z][A-Za-z0-9]*$/).describe("Camel-case credential field key, e.g. apiKey"),
20297
- label: z11.string().trim().min(1).describe("Label shown in the credential form"),
20298
- description: z11.string().trim().min(1).optional().describe("Optional guidance about where to find the value"),
20299
- secret: z11.boolean().describe("Whether the value is masked and scrubbed")
20400
+ var CustomIntegrationSecretFieldSchema = z12.object({
20401
+ key: z12.string().regex(/^[A-Za-z][A-Za-z0-9]*$/).describe("Camel-case credential field key, e.g. apiKey"),
20402
+ label: z12.string().trim().min(1).describe("Label shown in the credential form"),
20403
+ description: z12.string().trim().min(1).optional().describe("Optional guidance about where to find the value"),
20404
+ secret: z12.boolean().describe("Whether the value is masked and scrubbed")
20300
20405
  });
20301
- var CreateCustomApiDraftRequestSchema = z11.object({
20302
- title: z11.string().trim().min(1),
20303
- description: z11.string().trim().min(1),
20406
+ var CreateCustomApiDraftRequestSchema = z12.object({
20407
+ title: z12.string().trim().min(1),
20408
+ description: z12.string().trim().min(1),
20304
20409
  iconUrl: CustomIntegrationIconUrlSchema.optional()
20305
20410
  });
20306
- var PatchOrganizationCustomIntegrationRequestSchema = z11.object({
20307
- title: z11.string().trim().min(1).optional(),
20308
- description: z11.string().trim().min(1).optional(),
20411
+ var PatchOrganizationCustomIntegrationRequestSchema = z12.object({
20412
+ title: z12.string().trim().min(1).optional(),
20413
+ description: z12.string().trim().min(1).optional(),
20309
20414
  iconUrl: CustomIntegrationIconUrlSchema.optional(),
20310
- credentialType: z11.enum(["apiKey", "noAuth"]).optional(),
20311
- secretFields: z11.array(CustomIntegrationSecretFieldSchema).optional(),
20312
- commonDocs: z11.string().nullable().optional(),
20313
- setupGuide: z11.string().nullable().optional()
20415
+ credentialType: z12.enum(["apiKey", "noAuth"]).optional(),
20416
+ secretFields: z12.array(CustomIntegrationSecretFieldSchema).optional(),
20417
+ commonDocs: z12.string().nullable().optional(),
20418
+ setupGuide: z12.string().nullable().optional()
20314
20419
  }).refine(hasCustomIntegrationDefinitionPatch, {
20315
20420
  message: "At least one field is required"
20316
20421
  });
20317
- var SetCustomIntegrationStatusRequestSchema = z11.object({
20318
- status: z11.enum(["draft", "live"])
20422
+ var SetCustomIntegrationStatusRequestSchema = z12.object({
20423
+ status: z12.enum(["draft", "live"])
20319
20424
  });
20320
- var UpsertCustomIntegrationOperationRequestSchema = z11.object({
20321
- operationId: z11.string().min(1).optional(),
20322
- title: z11.string().trim().min(1).optional(),
20323
- description: z11.string().trim().min(1).optional(),
20324
- documentation: z11.string().trim().min(1).optional()
20425
+ var UpsertCustomIntegrationOperationRequestSchema = z12.object({
20426
+ operationId: z12.string().min(1).optional(),
20427
+ title: z12.string().trim().min(1).optional(),
20428
+ description: z12.string().trim().min(1).optional(),
20429
+ documentation: z12.string().trim().min(1).optional()
20325
20430
  }).superRefine((value, context) => {
20326
20431
  if (value.operationId) {
20327
20432
  if (!value.title && !value.description && !value.documentation) {
@@ -20358,28 +20463,28 @@ function defineCustomApiAuthoringActions(actions) {
20358
20463
  }
20359
20464
 
20360
20465
  // ../../packages/api/dist/types/cli/resourceOperations.js
20361
- import { z as z12 } from "zod";
20362
- var FilterPreviewRequestSchema = z12.object({
20363
- triggerPayload: z12.record(z12.string(), z12.unknown()).optional(),
20364
- triggerKey: z12.string().min(1).optional(),
20365
- bundleKey: z12.string().min(1).max(1024).optional()
20466
+ import { z as z13 } from "zod";
20467
+ var FilterPreviewRequestSchema = z13.object({
20468
+ triggerPayload: z13.record(z13.string(), z13.unknown()).optional(),
20469
+ triggerKey: z13.string().min(1).optional(),
20470
+ bundleKey: z13.string().min(1).max(1024).optional()
20366
20471
  });
20367
- var AppScreenshotsRequestSchema = z12.object({
20368
- routes: z12.array(z12.string().min(1).max(2048)).min(1).max(6).default(["/"]),
20369
- viewport: z12.enum(["mobile", "desktop", "both"]).default("both")
20472
+ var AppScreenshotsRequestSchema = z13.object({
20473
+ routes: z13.array(z13.string().min(1).max(2048)).min(1).max(6).default(["/"]),
20474
+ viewport: z13.enum(["mobile", "desktop", "both"]).default("both")
20370
20475
  });
20371
- var TriggerActivityRequestSchema = z12.object({
20372
- limit: z12.coerce.number().int().min(1).max(100).default(20),
20373
- cursor: z12.string().optional(),
20374
- search: z12.string().optional()
20476
+ var TriggerActivityRequestSchema = z13.object({
20477
+ limit: z13.coerce.number().int().min(1).max(100).default(20),
20478
+ cursor: z13.string().optional(),
20479
+ search: z13.string().optional()
20375
20480
  });
20376
- var TriggerSyncRequestSchema = z12.object({
20377
- triggerId: z12.string().min(1).optional()
20481
+ var TriggerSyncRequestSchema = z13.object({
20482
+ triggerId: z13.string().min(1).optional()
20378
20483
  });
20379
- var TriggerReplayRequestSchema = z12.object({
20380
- itemId: z12.string().min(1),
20381
- kind: z12.enum(["execution", "poll_item"]),
20382
- triggerKey: z12.string().min(1).optional()
20484
+ var TriggerReplayRequestSchema = z13.object({
20485
+ itemId: z13.string().min(1),
20486
+ kind: z13.enum(["execution", "poll_item"]),
20487
+ triggerKey: z13.string().min(1).optional()
20383
20488
  });
20384
20489
 
20385
20490
  // ../../packages/api/dist/clients/v1/V1AuthApiClient.js
@@ -20679,19 +20784,6 @@ var V1HttpClient = class {
20679
20784
  read: async (response) => new Uint8Array(await response.arrayBuffer())
20680
20785
  });
20681
20786
  }
20682
- async sendBinary(path, options) {
20683
- return this.request({
20684
- path,
20685
- timeoutMs: options.timeoutMs,
20686
- init: {
20687
- method: options.method,
20688
- headers: { "Content-Type": options.contentType },
20689
- body: new Uint8Array(options.body),
20690
- signal: options.signal
20691
- },
20692
- read: (response) => response.json()
20693
- });
20694
- }
20695
20787
  get isAuthed() {
20696
20788
  return this.args.getAccessToken() !== null;
20697
20789
  }
@@ -20892,7 +20984,6 @@ var V1OperationsApiClient = class {
20892
20984
  };
20893
20985
 
20894
20986
  // ../../packages/api/dist/clients/v1/V1ProjectsApiClient.js
20895
- var BUNDLE_CONTENT_TYPE = "application/gzip";
20896
20987
  var FILE_UPLOAD_COMMIT_TIMEOUT_MS = 12e4;
20897
20988
  var V1ProjectsApiClient = class {
20898
20989
  http;
@@ -20973,16 +21064,6 @@ var V1ProjectsApiClient = class {
20973
21064
  this.http.requireAuthed();
20974
21065
  return this.http.fetch(`/v1/projects/${encodeURIComponent(args.projectId)}/files/link?path=${encodeURIComponent(args.path)}`, { signal: args.signal });
20975
21066
  }
20976
- /** Every project file as one gzipped tar. */
20977
- async downloadFilesBundle(id) {
20978
- this.http.requireAuthed();
20979
- return this.http.fetchBinary(`/v1/projects/${encodeURIComponent(id)}/files/bundle`);
20980
- }
20981
- /** Add or replace the paths the bundle carries; other files stay put. */
20982
- async uploadFilesBundle(id, bundle) {
20983
- this.http.requireAuthed();
20984
- return this.http.sendBinary(`/v1/projects/${encodeURIComponent(id)}/files/bundle`, { method: "POST", body: bundle, contentType: BUNDLE_CONTENT_TYPE });
20985
- }
20986
21067
  async deleteFile(id, path) {
20987
21068
  this.http.requireAuthed();
20988
21069
  return this.http.fetch(`/v1/projects/${encodeURIComponent(id)}/files?path=${encodeURIComponent(path)}`, { method: "DELETE" });
@@ -21156,11 +21237,6 @@ var V1SkillsApiClient = class {
21156
21237
  this.http.requireAuthed();
21157
21238
  return this.http.fetch(`/v1/skills/${encodeURIComponent(id)}/tree-url`);
21158
21239
  }
21159
- /** Presigned GET for the live bundle, for a server from before Tree pulls. */
21160
- async bundleUrl(id) {
21161
- this.http.requireAuthed();
21162
- return this.http.fetch(`/v1/skills/${encodeURIComponent(id)}/bundle-url`);
21163
- }
21164
21240
  /** Presigned PUT + staged `bundleKey` for a push bundle (validate/publish). */
21165
21241
  async bundleUploadUrl(id) {
21166
21242
  this.http.requireAuthed();
@@ -21231,10 +21307,6 @@ var V1WorkflowsApiClient = class {
21231
21307
  body
21232
21308
  });
21233
21309
  }
21234
- async bundleUrl(id) {
21235
- this.http.requireAuthed();
21236
- return this.http.fetch(`/v1/workflows/${encodeURIComponent(id)}/bundle-url`);
21237
- }
21238
21310
  async treeUrl(id) {
21239
21311
  this.http.requireAuthed();
21240
21312
  return this.http.fetch(`/v1/workflows/${encodeURIComponent(id)}/tree-url`);
@@ -21532,6 +21604,10 @@ var V1WorkspacesApiClient = class {
21532
21604
  this.http.requireAuthed();
21533
21605
  return this.http.fetch("/v1/workspaces");
21534
21606
  }
21607
+ async teams() {
21608
+ this.http.requireAuthed();
21609
+ return this.http.fetch("/v1/workspaces/teams");
21610
+ }
21535
21611
  async members(args) {
21536
21612
  this.http.requireAuthed();
21537
21613
  const params = new URLSearchParams();
@@ -21600,7 +21676,19 @@ var V1SharingApiClient = class {
21600
21676
  }
21601
21677
  async inspect(kind, id) {
21602
21678
  this.http.requireAuthed();
21603
- return this.http.fetch(`${subjectPath(kind, id)}/sharing`);
21679
+ const [direct, teamGrants] = await Promise.all([
21680
+ this.http.fetch(`${subjectPath(kind, id)}/sharing`),
21681
+ this.http.fetch(`${teamGrantsPath(kind, id)}`)
21682
+ ]);
21683
+ return {
21684
+ ...direct,
21685
+ teams: teamGrants.teamGrants.map((grant) => ({
21686
+ teamId: grant.team.id,
21687
+ name: grant.team.name,
21688
+ memberCount: grant.team.memberCount,
21689
+ role: grant.role
21690
+ }))
21691
+ };
21604
21692
  }
21605
21693
  async grant(args) {
21606
21694
  this.http.requireAuthed();
@@ -21614,24 +21702,31 @@ var V1SharingApiClient = class {
21614
21702
  throw new Error(`Role ${args.role} is not offered on ${noun.plural}; use ${collaboratorRoles.join(" or ")}.`);
21615
21703
  }
21616
21704
  const path = subjectPath(args.kind, args.id);
21617
- if (args.audience.type === "organization") {
21618
- await this.http.fetch(`${path}/org-grant`, {
21619
- method: "PUT",
21620
- body: { role: args.role }
21621
- });
21622
- } else {
21623
- await this.http.fetch(`${path}/collaborators`, {
21624
- method: "POST",
21625
- body: { membershipId: args.audience.membershipId, role: args.role }
21626
- });
21705
+ switch (args.audience.type) {
21706
+ case "organization":
21707
+ await this.http.fetch(`${path}/org-grant`, {
21708
+ method: "PUT",
21709
+ body: { role: args.role }
21710
+ });
21711
+ return;
21712
+ case "member":
21713
+ await this.http.fetch(`${path}/collaborators`, {
21714
+ method: "POST",
21715
+ body: { membershipId: args.audience.membershipId, role: args.role }
21716
+ });
21717
+ return;
21718
+ case "team":
21719
+ await this.http.fetch(`${teamGrantsPath(args.kind, args.id)}/${encodeURIComponent(args.audience.teamId)}`, { method: "PUT", body: { role: args.role } });
21720
+ return;
21721
+ default: {
21722
+ const exhaustive = args.audience;
21723
+ throw new Error(`Unknown audience ${JSON.stringify(exhaustive)}`);
21724
+ }
21627
21725
  }
21628
21726
  }
21629
21727
  async revoke(args) {
21630
21728
  this.http.requireAuthed();
21631
- const suffix = args.audience.type === "organization" ? "org-grant" : `collaborators/${encodeURIComponent(args.audience.membershipId)}`;
21632
- await this.http.fetch(`${subjectPath(args.kind, args.id)}/${suffix}`, {
21633
- method: "DELETE"
21634
- });
21729
+ await this.http.fetch(revokePath(args), { method: "DELETE" });
21635
21730
  }
21636
21731
  };
21637
21732
  var OTHER_SHARING_PATHS = {
@@ -21643,6 +21738,31 @@ function subjectPath(kind, id) {
21643
21738
  const path = isWorkflowTypeKind(kind) ? "workflows" : OTHER_SHARING_PATHS[kind];
21644
21739
  return `/v1/${path}/${encodeURIComponent(id)}`;
21645
21740
  }
21741
+ var OTHER_GRANT_TYPES = {
21742
+ specialist: "project",
21743
+ skill: "skill",
21744
+ credential: "credential"
21745
+ };
21746
+ function sharingGrantResourceType(kind) {
21747
+ return isWorkflowTypeKind(kind) ? "workflow" : OTHER_GRANT_TYPES[kind];
21748
+ }
21749
+ function teamGrantsPath(kind, id) {
21750
+ return `/v1/resource-grants/${sharingGrantResourceType(kind)}/${encodeURIComponent(id)}/teams`;
21751
+ }
21752
+ function revokePath(args) {
21753
+ switch (args.audience.type) {
21754
+ case "organization":
21755
+ return `${subjectPath(args.kind, args.id)}/org-grant`;
21756
+ case "member":
21757
+ return `${subjectPath(args.kind, args.id)}/collaborators/${encodeURIComponent(args.audience.membershipId)}`;
21758
+ case "team":
21759
+ return `${teamGrantsPath(args.kind, args.id)}/${encodeURIComponent(args.audience.teamId)}`;
21760
+ default: {
21761
+ const exhaustive = args.audience;
21762
+ throw new Error(`Unknown audience ${JSON.stringify(exhaustive)}`);
21763
+ }
21764
+ }
21765
+ }
21646
21766
 
21647
21767
  // src/lib/output.ts
21648
21768
  import chalk from "chalk";
@@ -22225,7 +22345,7 @@ async function fetchResourceTree(args) {
22225
22345
  }
22226
22346
 
22227
22347
  // src/lib/bundleArchive.ts
22228
- import { create, extract } from "tar";
22348
+ import { extract } from "tar";
22229
22349
 
22230
22350
  // src/lib/resourceFiles.ts
22231
22351
  import {
@@ -22330,15 +22450,6 @@ function dirHasResourceFiles(dir) {
22330
22450
  }
22331
22451
 
22332
22452
  // src/lib/bundleArchive.ts
22333
- async function packResourceDir(dir) {
22334
- const files = listResourceRelPaths(dir);
22335
- const stream = create({ gzip: true, cwd: dir, portable: true }, files);
22336
- const chunks = [];
22337
- for await (const chunk of stream) {
22338
- chunks.push(Buffer.from(chunk));
22339
- }
22340
- return Buffer.concat(chunks);
22341
- }
22342
22453
  async function extractBundle(dir, buffer) {
22343
22454
  mkdirSync2(dir, { recursive: true });
22344
22455
  await new Promise((resolve32, reject) => {
@@ -22370,39 +22481,22 @@ function readResourceFiles(dir) {
22370
22481
  );
22371
22482
  }
22372
22483
  async function stageResourceDir(args) {
22373
- const { target, dir } = args;
22374
- if (!target.tree) {
22375
- await putBytes({
22376
- url: target.uploadUrl,
22377
- body: await packResourceDir(dir),
22378
- contentType: target.contentType
22379
- });
22380
- return target.bundleKey;
22381
- }
22484
+ const { tree } = args.target;
22382
22485
  const { manifest, content } = packResourceTree({
22383
- files: readResourceFiles(dir),
22384
- object: target.tree.object
22486
+ files: readResourceFiles(args.dir),
22487
+ object: tree.object
22385
22488
  });
22386
22489
  await putBytes({
22387
- url: target.tree.packUploadUrl,
22490
+ url: tree.packUploadUrl,
22388
22491
  body: content,
22389
22492
  contentType: "application/octet-stream"
22390
22493
  });
22391
22494
  await putBytes({
22392
- url: target.tree.manifestUploadUrl,
22495
+ url: tree.manifestUploadUrl,
22393
22496
  body: serializeResourceTreeManifest(manifest),
22394
22497
  contentType: "application/json"
22395
22498
  });
22396
- return target.tree.bundleKey;
22397
- }
22398
- async function downloadResourceBundle(args) {
22399
- const response = await fetch(args.downloadUrl);
22400
- if (!response.ok) {
22401
- throw new Error(`Bundle download failed (HTTP ${response.status}).`);
22402
- }
22403
- const buffer = Buffer.from(await response.arrayBuffer());
22404
- await extractBundle(args.dir, buffer);
22405
- return listResourceRelPaths(args.dir).length;
22499
+ return tree.bundleKey;
22406
22500
  }
22407
22501
  function assertNoLinkOnPath(args) {
22408
22502
  let current = args.dir;
@@ -22442,25 +22536,10 @@ async function downloadResourceTree(args) {
22442
22536
  return listResourceRelPaths(args.dir).length;
22443
22537
  }
22444
22538
  async function pullResourceDir(args) {
22445
- try {
22446
- const pulled2 = await args.treeUrl();
22447
- return {
22448
- pulled: pulled2,
22449
- fileCount: await downloadResourceTree({
22450
- tree: pulled2.tree,
22451
- dir: args.dir
22452
- })
22453
- };
22454
- } catch (error) {
22455
- if (!(error instanceof ApiError) || error.status !== 404) throw error;
22456
- }
22457
- const pulled = await args.bundleUrl();
22539
+ const pulled = await args.treeUrl();
22458
22540
  return {
22459
22541
  pulled,
22460
- fileCount: await downloadResourceBundle({
22461
- downloadUrl: pulled.downloadUrl,
22462
- dir: args.dir
22463
- })
22542
+ fileCount: await downloadResourceTree({ tree: pulled.tree, dir: args.dir })
22464
22543
  };
22465
22544
  }
22466
22545
 
@@ -22510,6 +22589,11 @@ var WorkspaceService = class {
22510
22589
  const { client } = await this.sessionContext.requireAuthed();
22511
22590
  return client.workspaces.list();
22512
22591
  }
22592
+ /** The active workspace's teams, with what each carries and who is on it. */
22593
+ async teams() {
22594
+ const { client } = await this.sessionContext.requireAuthed();
22595
+ return client.workspaces.teams();
22596
+ }
22513
22597
  /** Active members of the active workspace; optional substring filter. */
22514
22598
  async members(args) {
22515
22599
  const { client } = await this.sessionContext.requireAuthed();
@@ -23061,22 +23145,22 @@ function rankOperations(operations, query) {
23061
23145
  }
23062
23146
 
23063
23147
  // src/types/config.ts
23064
- import { z as z13 } from "zod";
23065
- var CliConfigSchema = z13.object({
23066
- version: z13.literal(1),
23148
+ import { z as z14 } from "zod";
23149
+ var CliConfigSchema = z14.object({
23150
+ version: z14.literal(1),
23067
23151
  /**
23068
23152
  * Override for the cloud API base URL used at fresh `geni login`
23069
23153
  * time. Once a session exists, the URL stored on it takes
23070
23154
  * precedence — switching `apiUrl` after login does NOT reroute
23071
23155
  * existing tokens (the session knows which server minted it).
23072
23156
  */
23073
- apiUrl: z13.url().optional(),
23157
+ apiUrl: z14.url().optional(),
23074
23158
  /**
23075
23159
  * Override for the dashboard base URL used by browser-opening
23076
23160
  * commands (`geni credential connect`). Independent of `apiUrl`
23077
23161
  * because in dev they live on different ports.
23078
23162
  */
23079
- dashboardUrl: z13.url().optional()
23163
+ dashboardUrl: z14.url().optional()
23080
23164
  });
23081
23165
  var SETTABLE_CONFIG_KEYS = ["apiUrl", "dashboardUrl"];
23082
23166
  var SETTABLE_CONFIG_KEY_SET = new Set(
@@ -23238,8 +23322,7 @@ var WorkflowAuthoringService = class {
23238
23322
  fileCount
23239
23323
  } = await pullResourceDir({
23240
23324
  dir: args.dir,
23241
- treeUrl: () => client.workflows.treeUrl(detail.id),
23242
- bundleUrl: () => client.workflows.bundleUrl(detail.id)
23325
+ treeUrl: () => client.workflows.treeUrl(detail.id)
23243
23326
  });
23244
23327
  writeMarker(args.dir, {
23245
23328
  resourceId: detail.id,
@@ -23268,8 +23351,7 @@ var WorkflowAuthoringService = class {
23268
23351
  fileCount
23269
23352
  } = await pullResourceDir({
23270
23353
  dir: args.dir,
23271
- treeUrl: () => client.workflows.treeUrl(args.id),
23272
- bundleUrl: () => client.workflows.bundleUrl(args.id)
23354
+ treeUrl: () => client.workflows.treeUrl(args.id)
23273
23355
  });
23274
23356
  writeMarker(args.dir, {
23275
23357
  resourceId: args.id,
@@ -23520,8 +23602,7 @@ Write the instructions the loading agent should follow.
23520
23602
  fileCount
23521
23603
  } = await pullResourceDir({
23522
23604
  dir: args.dir,
23523
- treeUrl: () => client.skills.treeUrl(args.id),
23524
- bundleUrl: () => client.skills.bundleUrl(args.id)
23605
+ treeUrl: () => client.skills.treeUrl(args.id)
23525
23606
  });
23526
23607
  writeMarker(args.dir, {
23527
23608
  resourceId: args.id,
@@ -23565,7 +23646,7 @@ Write the instructions the loading agent should follow.
23565
23646
  }
23566
23647
  return { fileCount: skill.files.length, description: skill.description };
23567
23648
  }
23568
- /** Tar `dir`, PUT it to a presigned URL, return the staged `bundleKey`. */
23649
+ /** Stage `dir` for a push, return the staged `bundleKey`. */
23569
23650
  async uploadBundle(id, dir) {
23570
23651
  const { client } = await this.sessionContext.requireAuthed();
23571
23652
  return stageResourceDir({
@@ -23695,6 +23776,9 @@ var CrmService = class {
23695
23776
  async deleteTag(id) {
23696
23777
  return (await this.crm()).deleteTag(id);
23697
23778
  }
23779
+ async setRecordAccess(entityType, entityId, body) {
23780
+ return (await this.crm()).setRecordAccess(entityType, entityId, body);
23781
+ }
23698
23782
  async assignTag(id, entityIds) {
23699
23783
  return (await this.crm()).assignTag(id, entityIds);
23700
23784
  }
@@ -24196,21 +24280,21 @@ var CustomApiService = class {
24196
24280
  };
24197
24281
 
24198
24282
  // ../../packages/crm-api/dist/types/enums.js
24199
- import { z as z14 } from "zod";
24200
- var LeadSortDirectionSchema = z14.enum(["asc", "desc"]);
24201
- var ContactPointKindSchema = z14.enum([
24283
+ import { z as z15 } from "zod";
24284
+ var LeadSortDirectionSchema = z15.enum(["asc", "desc"]);
24285
+ var ContactPointKindSchema = z15.enum([
24202
24286
  "work_email",
24203
24287
  "personal_email",
24204
24288
  "mobile",
24205
24289
  "phone"
24206
24290
  ]);
24207
- var ContactPointStatusSchema = z14.enum([
24291
+ var ContactPointStatusSchema = z15.enum([
24208
24292
  "verified",
24209
24293
  "unverified",
24210
24294
  "unavailable",
24211
24295
  "bounced"
24212
24296
  ]);
24213
- var EnrichmentOutcomeSchema = z14.enum([
24297
+ var EnrichmentOutcomeSchema = z15.enum([
24214
24298
  "matched",
24215
24299
  "no_match",
24216
24300
  "no_contact",
@@ -24220,8 +24304,8 @@ var EnrichmentOutcomeSchema = z14.enum([
24220
24304
  ]);
24221
24305
 
24222
24306
  // ../../packages/crm-api/dist/types/entity.js
24223
- import { z as z15 } from "zod";
24224
- var CrmEntityTypeSchema = z15.enum([
24307
+ import { z as z16 } from "zod";
24308
+ var CrmEntityTypeSchema = z16.enum([
24225
24309
  "person",
24226
24310
  "company",
24227
24311
  "pipeline_card"
@@ -24229,14 +24313,14 @@ var CrmEntityTypeSchema = z15.enum([
24229
24313
  var CRM_ENTITY_TYPES = CrmEntityTypeSchema.options;
24230
24314
 
24231
24315
  // ../../packages/crm-api/dist/types/recordEvent.js
24232
- import { z as z16 } from "zod";
24233
- var CrmActorKindSchema = z16.enum([
24316
+ import { z as z17 } from "zod";
24317
+ var CrmActorKindSchema = z17.enum([
24234
24318
  "user",
24235
24319
  "agent",
24236
24320
  "automation",
24237
24321
  "system"
24238
24322
  ]);
24239
- var CrmRecordEventKindSchema = z16.enum([
24323
+ var CrmRecordEventKindSchema = z17.enum([
24240
24324
  "created",
24241
24325
  "field_changed",
24242
24326
  "stage_changed",
@@ -24250,6 +24334,7 @@ var CrmRecordEventKindSchema = z16.enum([
24250
24334
  "tag_removed",
24251
24335
  "list_added",
24252
24336
  "list_removed",
24337
+ "access_changed",
24253
24338
  "file_added",
24254
24339
  "file_removed",
24255
24340
  "task_created",
@@ -24258,21 +24343,32 @@ var CrmRecordEventKindSchema = z16.enum([
24258
24343
  "task_dismissed",
24259
24344
  "task_deleted"
24260
24345
  ]);
24261
- var CrmRecordEventFeedQuerySchema = z16.object({
24346
+ var CrmRecordEventFeedQuerySchema = z17.object({
24262
24347
  /** The cursor a previous read returned; omitted, the read returns the latest events. */
24263
- after: z16.string().regex(/^\d+$/).optional(),
24264
- limit: z16.coerce.number().int().min(1).max(500).default(100)
24348
+ after: z17.string().regex(/^\d+$/).optional(),
24349
+ limit: z17.coerce.number().int().min(1).max(500).default(100)
24350
+ });
24351
+
24352
+ // ../../packages/crm-api/dist/types/access.js
24353
+ import { z as z18 } from "zod";
24354
+ var CRM_RECORD_VISIBILITIES = ["private", "team", "workspace"];
24355
+ var CrmRecordVisibilitySchema = z18.enum(CRM_RECORD_VISIBILITIES);
24356
+ var SetCrmRecordAccessRequestSchema = z18.object({
24357
+ /** Null only for a pipeline card, which may be unassigned. */
24358
+ ownerMembershipId: z18.uuid().nullable(),
24359
+ teamId: z18.uuid().nullable(),
24360
+ visibility: CrmRecordVisibilitySchema
24265
24361
  });
24266
24362
 
24267
24363
  // ../../packages/crm-api/dist/types/concurrency.js
24268
- import { z as z17 } from "zod";
24269
- var ExpectedUpdatedAtSchema = z17.object({
24270
- expectedUpdatedAt: z17.string()
24364
+ import { z as z19 } from "zod";
24365
+ var ExpectedUpdatedAtSchema = z19.object({
24366
+ expectedUpdatedAt: z19.string()
24271
24367
  });
24272
24368
 
24273
24369
  // ../../packages/crm-api/dist/types/company.js
24274
- import { z as z18 } from "zod";
24275
- var CompanyTypeSchema = z18.enum([
24370
+ import { z as z20 } from "zod";
24371
+ var CompanyTypeSchema = z20.enum([
24276
24372
  "public",
24277
24373
  "private",
24278
24374
  "nonprofit",
@@ -24282,11 +24378,11 @@ var CompanyTypeSchema = z18.enum([
24282
24378
  ]);
24283
24379
 
24284
24380
  // ../../packages/crm-api/dist/types/customField.js
24285
- import { z as z20 } from "zod";
24381
+ import { z as z22 } from "zod";
24286
24382
 
24287
24383
  // ../../packages/crm-api/dist/types/tag.js
24288
- import { z as z19 } from "zod";
24289
- var TagColorSchema = z19.enum([
24384
+ import { z as z21 } from "zod";
24385
+ var TagColorSchema = z21.enum([
24290
24386
  "stone",
24291
24387
  "charcoal",
24292
24388
  "red",
@@ -24318,23 +24414,23 @@ var TagColorSchema = z19.enum([
24318
24414
  "plum",
24319
24415
  "tyrian"
24320
24416
  ]);
24321
- var CreateTagRequestSchema = z19.object({
24322
- name: z19.string().min(1).max(100),
24417
+ var CreateTagRequestSchema = z21.object({
24418
+ name: z21.string().min(1).max(100),
24323
24419
  color: TagColorSchema.default("stone"),
24324
24420
  entityType: CrmEntityTypeSchema
24325
24421
  });
24326
- var UpdateTagRequestSchema = z19.object({
24327
- name: z19.string().min(1).max(100).optional(),
24422
+ var UpdateTagRequestSchema = z21.object({
24423
+ name: z21.string().min(1).max(100).optional(),
24328
24424
  color: TagColorSchema.optional()
24329
24425
  }).refine((req) => req.name !== void 0 || req.color !== void 0, {
24330
24426
  message: "Nothing to update"
24331
24427
  });
24332
- var TagEntitiesRequestSchema = z19.object({
24333
- entityIds: z19.array(z19.uuid()).min(1).max(1e3)
24428
+ var TagEntitiesRequestSchema = z21.object({
24429
+ entityIds: z21.array(z21.uuid()).min(1).max(1e3)
24334
24430
  });
24335
24431
 
24336
24432
  // ../../packages/crm-api/dist/types/customField.js
24337
- var CustomFieldTypeSchema = z20.enum([
24433
+ var CustomFieldTypeSchema = z22.enum([
24338
24434
  "text",
24339
24435
  "long_text",
24340
24436
  "number",
@@ -24353,91 +24449,91 @@ var CustomFieldTypeSchema = z20.enum([
24353
24449
  function customFieldScopeKind(entityType) {
24354
24450
  return entityType === "pipeline_card" ? "pipeline" : null;
24355
24451
  }
24356
- var CustomFieldOptionSchema = z20.object({
24357
- value: z20.string().min(1).max(120),
24358
- label: z20.string().min(1).max(120),
24452
+ var CustomFieldOptionSchema = z22.object({
24453
+ value: z22.string().min(1).max(120),
24454
+ label: z22.string().min(1).max(120),
24359
24455
  color: TagColorSchema.optional()
24360
24456
  });
24361
- var CustomFieldOptionInputSchema = z20.object({
24362
- value: z20.string().max(120).optional(),
24363
- label: z20.string().min(1).max(120),
24457
+ var CustomFieldOptionInputSchema = z22.object({
24458
+ value: z22.string().max(120).optional(),
24459
+ label: z22.string().min(1).max(120),
24364
24460
  color: TagColorSchema.optional()
24365
24461
  });
24366
- var CreateCustomFieldRequestSchema = z20.object({
24462
+ var CreateCustomFieldRequestSchema = z22.object({
24367
24463
  entityType: CrmEntityTypeSchema,
24368
- scopeId: z20.uuid().nullish(),
24369
- label: z20.string().min(1).max(80),
24464
+ scopeId: z22.uuid().nullish(),
24465
+ label: z22.string().min(1).max(80),
24370
24466
  fieldType: CustomFieldTypeSchema,
24371
- options: z20.array(CustomFieldOptionInputSchema).max(100).optional(),
24372
- isRequired: z20.boolean().optional(),
24373
- helpText: z20.string().max(200).nullish(),
24374
- description: z20.string().max(1e3).nullish()
24467
+ options: z22.array(CustomFieldOptionInputSchema).max(100).optional(),
24468
+ isRequired: z22.boolean().optional(),
24469
+ helpText: z22.string().max(200).nullish(),
24470
+ description: z22.string().max(1e3).nullish()
24375
24471
  }).refine((req) => customFieldScopeKind(req.entityType) === "pipeline" === !!req.scopeId, {
24376
24472
  message: "A pipeline_card field needs its pipeline; no other field takes one"
24377
24473
  });
24378
- var UpdateCustomFieldRequestSchema = z20.object({
24379
- label: z20.string().min(1).max(80).optional(),
24380
- options: z20.array(CustomFieldOptionInputSchema).max(100).optional(),
24381
- isRequired: z20.boolean().optional(),
24382
- helpText: z20.string().max(200).nullish(),
24383
- description: z20.string().max(1e3).nullish(),
24384
- position: z20.number().int().min(0).optional()
24474
+ var UpdateCustomFieldRequestSchema = z22.object({
24475
+ label: z22.string().min(1).max(80).optional(),
24476
+ options: z22.array(CustomFieldOptionInputSchema).max(100).optional(),
24477
+ isRequired: z22.boolean().optional(),
24478
+ helpText: z22.string().max(200).nullish(),
24479
+ description: z22.string().max(1e3).nullish(),
24480
+ position: z22.number().int().min(0).optional()
24385
24481
  }).refine((req) => Object.keys(req).length > 0, {
24386
24482
  message: "Nothing to update"
24387
24483
  });
24388
- var ReorderCustomFieldsRequestSchema = z20.object({
24389
- orderedIds: z20.array(z20.uuid()).min(1)
24484
+ var ReorderCustomFieldsRequestSchema = z22.object({
24485
+ orderedIds: z22.array(z22.uuid()).min(1)
24390
24486
  });
24391
- var CustomFieldValuesSchema = z20.record(z20.string(), z20.unknown());
24487
+ var CustomFieldValuesSchema = z22.record(z22.string(), z22.unknown());
24392
24488
 
24393
24489
  // ../../packages/crm-api/dist/types/list.js
24394
- import { z as z21 } from "zod";
24395
- var ListSearchSortSchema = z21.enum([
24490
+ import { z as z23 } from "zod";
24491
+ var ListSearchSortSchema = z23.enum([
24396
24492
  "relevance",
24397
24493
  "recent",
24398
24494
  "updated",
24399
24495
  "name",
24400
24496
  "members"
24401
24497
  ]);
24402
- var ListSearchFiltersSchema = z21.object({
24498
+ var ListSearchFiltersSchema = z23.object({
24403
24499
  entityType: CrmEntityTypeSchema.optional()
24404
24500
  });
24405
- var ListSearchRequestSchema = z21.object({
24406
- query: z21.string().optional(),
24501
+ var ListSearchRequestSchema = z23.object({
24502
+ query: z23.string().optional(),
24407
24503
  filters: ListSearchFiltersSchema.optional(),
24408
24504
  sort: ListSearchSortSchema.default("relevance"),
24409
24505
  // Direction for the column sort; omitted falls back to the sort's default.
24410
24506
  direction: LeadSortDirectionSchema.optional(),
24411
- cursor: z21.string().nullable().optional(),
24412
- limit: z21.number().int().min(1).max(100).default(25)
24507
+ cursor: z23.string().nullable().optional(),
24508
+ limit: z23.number().int().min(1).max(100).default(25)
24413
24509
  });
24414
- var CreateListRequestSchema = z21.object({
24415
- name: z21.string().min(1).max(200),
24416
- purpose: z21.string().max(2e3).nullish(),
24510
+ var CreateListRequestSchema = z23.object({
24511
+ name: z23.string().min(1).max(200),
24512
+ purpose: z23.string().max(2e3).nullish(),
24417
24513
  entityType: CrmEntityTypeSchema
24418
24514
  });
24419
- var UpdateListRequestSchema = z21.object({
24420
- name: z21.string().min(1).max(200).optional(),
24421
- purpose: z21.string().max(2e3).nullable().optional()
24515
+ var UpdateListRequestSchema = z23.object({
24516
+ name: z23.string().min(1).max(200).optional(),
24517
+ purpose: z23.string().max(2e3).nullable().optional()
24422
24518
  }).refine((req) => req.name !== void 0 || req.purpose !== void 0, {
24423
24519
  message: "Nothing to update"
24424
24520
  });
24425
- var AddListMembersRequestSchema = z21.object({
24426
- entityIds: z21.array(z21.uuid()).min(1).max(1e3)
24521
+ var AddListMembersRequestSchema = z23.object({
24522
+ entityIds: z23.array(z23.uuid()).min(1).max(1e3)
24427
24523
  });
24428
- var DeleteListsRequestSchema = z21.object({
24429
- ids: z21.array(z21.uuid()).min(1).max(100)
24524
+ var DeleteListsRequestSchema = z23.object({
24525
+ ids: z23.array(z23.uuid()).min(1).max(100)
24430
24526
  });
24431
24527
 
24432
24528
  // ../../packages/crm-api/dist/types/pipeline.js
24433
- import { z as z22 } from "zod";
24434
- var PipelineKindSchema = z22.enum(["sales", "recruiting", "custom"]);
24435
- var PipelineTemplateKindSchema = z22.enum(["sales", "recruiting"]);
24436
- var StagePhaseSchema = z22.enum(["acquisition", "fulfillment"]);
24437
- var BallInCourtSchema = z22.enum(["us", "them", "mutual"]);
24438
- var StageOutcomeSchema = z22.enum(["won", "lost"]);
24439
- var CardStatusSchema = z22.enum(["open", "won", "lost"]);
24440
- var CardEventFieldSchema = z22.enum([
24529
+ import { z as z24 } from "zod";
24530
+ var PipelineKindSchema = z24.enum(["sales", "recruiting", "custom"]);
24531
+ var PipelineTemplateKindSchema = z24.enum(["sales", "recruiting"]);
24532
+ var StagePhaseSchema = z24.enum(["acquisition", "fulfillment"]);
24533
+ var BallInCourtSchema = z24.enum(["us", "them", "mutual"]);
24534
+ var StageOutcomeSchema = z24.enum(["won", "lost"]);
24535
+ var CardStatusSchema = z24.enum(["open", "won", "lost"]);
24536
+ var CardEventFieldSchema = z24.enum([
24441
24537
  "title",
24442
24538
  "amount",
24443
24539
  "currency",
@@ -24446,162 +24542,162 @@ var CardEventFieldSchema = z22.enum([
24446
24542
  "close_date",
24447
24543
  "attribution"
24448
24544
  ]);
24449
- var CardLinkedEntityTypeSchema = z22.enum(["person", "company"]);
24450
- var CreatePipelineFromTemplateRequestSchema = z22.object({
24545
+ var CardLinkedEntityTypeSchema = z24.enum(["person", "company"]);
24546
+ var CreatePipelineFromTemplateRequestSchema = z24.object({
24451
24547
  kind: PipelineTemplateKindSchema,
24452
- name: z22.string().min(1).max(200).optional()
24548
+ name: z24.string().min(1).max(200).optional()
24453
24549
  });
24454
- var StageInputSchema = z22.object({
24455
- name: z22.string().min(1).max(80),
24550
+ var StageInputSchema = z24.object({
24551
+ name: z24.string().min(1).max(80),
24456
24552
  phase: StagePhaseSchema.default("acquisition"),
24457
24553
  ballInCourt: BallInCourtSchema.default("us"),
24458
- isCommitted: z22.boolean().default(false),
24554
+ isCommitted: z24.boolean().default(false),
24459
24555
  outcome: StageOutcomeSchema.nullish(),
24460
- weight: z22.number().int().min(0).max(100).default(0),
24556
+ weight: z24.number().int().min(0).max(100).default(0),
24461
24557
  color: TagColorSchema.default("stone")
24462
24558
  });
24463
- var CreatePipelineRequestSchema = z22.object({
24464
- name: z22.string().min(1).max(200),
24465
- cardLabel: z22.string().min(1).max(60),
24466
- stages: z22.array(StageInputSchema).min(1).max(20)
24559
+ var CreatePipelineRequestSchema = z24.object({
24560
+ name: z24.string().min(1).max(200),
24561
+ cardLabel: z24.string().min(1).max(60),
24562
+ stages: z24.array(StageInputSchema).min(1).max(20)
24467
24563
  });
24468
- var UpdatePipelineRequestSchema = z22.object({
24469
- name: z22.string().min(1).max(200).optional(),
24470
- cardLabel: z22.string().min(1).max(60).optional(),
24471
- archived: z22.boolean().optional()
24564
+ var UpdatePipelineRequestSchema = z24.object({
24565
+ name: z24.string().min(1).max(200).optional(),
24566
+ cardLabel: z24.string().min(1).max(60).optional(),
24567
+ archived: z24.boolean().optional()
24472
24568
  }).refine((req) => req.name !== void 0 || req.cardLabel !== void 0 || req.archived !== void 0, { message: "Nothing to update" });
24473
24569
  var AddStageRequestSchema = StageInputSchema.extend({
24474
24570
  // 0-indexed insert position; appended when omitted.
24475
- position: z22.number().int().min(0).optional()
24571
+ position: z24.number().int().min(0).optional()
24476
24572
  });
24477
- var UpdateStageRequestSchema = z22.object({
24478
- name: z22.string().min(1).max(80).optional(),
24573
+ var UpdateStageRequestSchema = z24.object({
24574
+ name: z24.string().min(1).max(80).optional(),
24479
24575
  phase: StagePhaseSchema.optional(),
24480
24576
  ballInCourt: BallInCourtSchema.optional(),
24481
- isCommitted: z22.boolean().optional(),
24577
+ isCommitted: z24.boolean().optional(),
24482
24578
  outcome: StageOutcomeSchema.nullable().optional(),
24483
- weight: z22.number().int().min(0).max(100).optional(),
24579
+ weight: z24.number().int().min(0).max(100).optional(),
24484
24580
  color: TagColorSchema.optional()
24485
24581
  }).refine((req) => Object.keys(req).length > 0, {
24486
24582
  message: "Nothing to update"
24487
24583
  });
24488
- var ReorderStagesRequestSchema = z22.object({
24489
- stageIds: z22.array(z22.uuid()).min(1)
24584
+ var ReorderStagesRequestSchema = z24.object({
24585
+ stageIds: z24.array(z24.uuid()).min(1)
24490
24586
  });
24491
- var CardPersonInputSchema = z22.object({
24492
- personId: z22.uuid(),
24493
- role: z22.string().max(120).nullish(),
24494
- isPrimary: z22.boolean().default(false)
24587
+ var CardPersonInputSchema = z24.object({
24588
+ personId: z24.uuid(),
24589
+ role: z24.string().max(120).nullish(),
24590
+ isPrimary: z24.boolean().default(false)
24495
24591
  });
24496
- var CreateCardRequestSchema = z22.object({
24497
- title: z22.string().min(1).max(200),
24592
+ var CreateCardRequestSchema = z24.object({
24593
+ title: z24.string().min(1).max(200),
24498
24594
  // Defaults to the pipeline's first stage when omitted.
24499
- stageId: z22.uuid().optional(),
24500
- ownerMembershipId: z22.uuid().nullish(),
24501
- primaryCompanyId: z22.uuid().nullish(),
24502
- people: z22.array(CardPersonInputSchema).max(50).default([]),
24503
- amount: z22.number().min(0).nullish(),
24504
- currency: z22.string().max(8).nullish(),
24505
- expectedCloseAt: z22.string().nullish(),
24506
- attributionSourceId: z22.uuid().nullish()
24595
+ stageId: z24.uuid().optional(),
24596
+ ownerMembershipId: z24.uuid().nullish(),
24597
+ primaryCompanyId: z24.uuid().nullish(),
24598
+ people: z24.array(CardPersonInputSchema).max(50).default([]),
24599
+ amount: z24.number().min(0).nullish(),
24600
+ currency: z24.string().max(8).nullish(),
24601
+ expectedCloseAt: z24.string().nullish(),
24602
+ attributionSourceId: z24.uuid().nullish()
24507
24603
  });
24508
- var UpdateCardRequestSchema = z22.object({
24509
- title: z22.string().min(1).max(200).optional(),
24510
- ownerMembershipId: z22.uuid().nullable().optional(),
24511
- primaryCompanyId: z22.uuid().nullable().optional(),
24512
- amount: z22.number().min(0).nullable().optional(),
24513
- currency: z22.string().max(8).nullable().optional(),
24514
- expectedCloseAt: z22.string().nullable().optional(),
24515
- attributionSourceId: z22.uuid().nullable().optional(),
24604
+ var UpdateCardRequestSchema = z24.object({
24605
+ title: z24.string().min(1).max(200).optional(),
24606
+ ownerMembershipId: z24.uuid().nullable().optional(),
24607
+ primaryCompanyId: z24.uuid().nullable().optional(),
24608
+ amount: z24.number().min(0).nullable().optional(),
24609
+ currency: z24.string().max(8).nullable().optional(),
24610
+ expectedCloseAt: z24.string().nullable().optional(),
24611
+ attributionSourceId: z24.uuid().nullable().optional(),
24516
24612
  // Registry-defined custom fields; validated + merged server-side.
24517
24613
  custom: CustomFieldValuesSchema.optional()
24518
24614
  }).refine((req) => Object.keys(req).length > 0, {
24519
24615
  message: "Nothing to update"
24520
24616
  });
24521
- var MoveCardRequestSchema = z22.object({
24522
- toStageId: z22.uuid(),
24523
- boardPosition: z22.number().optional()
24617
+ var MoveCardRequestSchema = z24.object({
24618
+ toStageId: z24.uuid(),
24619
+ boardPosition: z24.number().optional()
24524
24620
  });
24525
- var SetCardStatusRequestSchema = z22.object({
24621
+ var SetCardStatusRequestSchema = z24.object({
24526
24622
  status: CardStatusSchema,
24527
- lostReason: z22.string().max(2e3).nullish()
24623
+ lostReason: z24.string().max(2e3).nullish()
24528
24624
  });
24529
- var AddCardContactRequestSchema = z22.object({
24530
- personId: z22.uuid()
24625
+ var AddCardContactRequestSchema = z24.object({
24626
+ personId: z24.uuid()
24531
24627
  });
24532
24628
  var CARD_BATCH_MAX = 100;
24533
- var DeleteCardsRequestSchema = z22.strictObject({
24534
- ids: z22.array(z22.uuid()).min(1).max(CARD_BATCH_MAX)
24629
+ var DeleteCardsRequestSchema = z24.strictObject({
24630
+ ids: z24.array(z24.uuid()).min(1).max(CARD_BATCH_MAX)
24535
24631
  });
24536
- var SetCardCreditsRequestSchema = z22.object({
24632
+ var SetCardCreditsRequestSchema = z24.object({
24537
24633
  /** Replaces every credit. Shares add up to 100, or the list is empty. */
24538
- credits: z22.array(z22.object({
24539
- membershipId: z22.uuid(),
24540
- role: z22.string().min(1).max(50),
24541
- percent: z22.number().positive().max(100)
24634
+ credits: z24.array(z24.object({
24635
+ membershipId: z24.uuid(),
24636
+ role: z24.string().min(1).max(50),
24637
+ percent: z24.number().positive().max(100)
24542
24638
  })).max(10)
24543
24639
  });
24544
24640
 
24545
24641
  // ../../packages/crm-api/dist/types/attribution.js
24546
- import { z as z23 } from "zod";
24547
- var CreateAttributionSourceRequestSchema = z23.object({
24548
- name: z23.string().min(1).max(100)
24642
+ import { z as z25 } from "zod";
24643
+ var CreateAttributionSourceRequestSchema = z25.object({
24644
+ name: z25.string().min(1).max(100)
24549
24645
  });
24550
- var UpdateAttributionSourceRequestSchema = z23.object({
24551
- name: z23.string().min(1).max(100).optional(),
24552
- isArchived: z23.boolean().optional()
24646
+ var UpdateAttributionSourceRequestSchema = z25.object({
24647
+ name: z25.string().min(1).max(100).optional(),
24648
+ isArchived: z25.boolean().optional()
24553
24649
  }).refine((req) => req.name !== void 0 || req.isArchived !== void 0, {
24554
24650
  message: "Nothing to update"
24555
24651
  });
24556
- var ReorderAttributionSourcesRequestSchema = z23.object({
24557
- orderedIds: z23.array(z23.uuid()).min(1)
24652
+ var ReorderAttributionSourcesRequestSchema = z25.object({
24653
+ orderedIds: z25.array(z25.uuid()).min(1)
24558
24654
  });
24559
24655
 
24560
24656
  // ../../packages/crm-api/dist/types/note.js
24561
- import { z as z24 } from "zod";
24562
- var CreateNoteRequestSchema = z24.object({
24563
- body: z24.string().min(1).max(1e4),
24657
+ import { z as z26 } from "zod";
24658
+ var CreateNoteRequestSchema = z26.object({
24659
+ body: z26.string().min(1).max(1e4),
24564
24660
  // Stamped by the engine for agent writes — never user-supplied in the UI.
24565
- draftedBy: z24.string().max(50).nullish()
24661
+ draftedBy: z26.string().max(50).nullish()
24566
24662
  });
24567
- var UpdateNoteRequestSchema = z24.object({
24568
- body: z24.string().min(1).max(1e4)
24663
+ var UpdateNoteRequestSchema = z26.object({
24664
+ body: z26.string().min(1).max(1e4)
24569
24665
  });
24570
24666
 
24571
24667
  // ../../packages/crm-api/dist/types/task.js
24572
- import { z as z25 } from "zod";
24573
- var TaskStatusSchema = z25.enum(["open", "done", "dismissed"]);
24574
- var TaskPrioritySchema = z25.enum(["low", "medium", "high"]);
24575
- var TaskEntityRefRequestSchema = z25.object({
24668
+ import { z as z27 } from "zod";
24669
+ var TaskStatusSchema = z27.enum(["open", "done", "dismissed"]);
24670
+ var TaskPrioritySchema = z27.enum(["low", "medium", "high"]);
24671
+ var TaskEntityRefRequestSchema = z27.object({
24576
24672
  type: CrmEntityTypeSchema,
24577
- id: z25.uuid()
24673
+ id: z27.uuid()
24578
24674
  });
24579
- var CreateTaskRequestSchema = z25.object({
24580
- title: z25.string().min(1).max(500),
24581
- description: z25.string().max(1e4).nullish(),
24582
- dueAt: z25.iso.datetime().nullish(),
24675
+ var CreateTaskRequestSchema = z27.object({
24676
+ title: z27.string().min(1).max(500),
24677
+ description: z27.string().max(1e4).nullish(),
24678
+ dueAt: z27.iso.datetime().nullish(),
24583
24679
  // Omitted or null = no priority.
24584
24680
  priority: TaskPrioritySchema.nullish(),
24585
24681
  // Defaults to the calling member when omitted.
24586
- ownerMembershipId: z25.uuid().nullish(),
24682
+ ownerMembershipId: z27.uuid().nullish(),
24587
24683
  entity: TaskEntityRefRequestSchema.nullish(),
24588
24684
  // Stamped by the engine for agent writes — never user-supplied in the UI.
24589
- createdByProvider: z25.string().max(50).nullish()
24685
+ createdByProvider: z27.string().max(50).nullish()
24590
24686
  });
24591
- var UpdateTaskRequestSchema = z25.object({
24592
- title: z25.string().min(1).max(500).optional(),
24593
- description: z25.string().max(1e4).nullable().optional(),
24594
- dueAt: z25.iso.datetime().nullable().optional(),
24687
+ var UpdateTaskRequestSchema = z27.object({
24688
+ title: z27.string().min(1).max(500).optional(),
24689
+ description: z27.string().max(1e4).nullable().optional(),
24690
+ dueAt: z27.iso.datetime().nullable().optional(),
24595
24691
  priority: TaskPrioritySchema.nullable().optional(),
24596
- ownerMembershipId: z25.uuid().optional()
24692
+ ownerMembershipId: z27.uuid().optional()
24597
24693
  });
24598
- var SetTaskStatusRequestSchema = z25.object({
24694
+ var SetTaskStatusRequestSchema = z27.object({
24599
24695
  status: TaskStatusSchema
24600
24696
  });
24601
24697
 
24602
24698
  // ../../packages/crm-api/dist/types/activity.js
24603
- import { z as z26 } from "zod";
24604
- var ActivityKindSchema = z26.enum([
24699
+ import { z as z28 } from "zod";
24700
+ var ActivityKindSchema = z28.enum([
24605
24701
  "note",
24606
24702
  "email",
24607
24703
  "slack",
@@ -24611,47 +24707,47 @@ var ActivityKindSchema = z26.enum([
24611
24707
  "linkedin",
24612
24708
  "other"
24613
24709
  ]);
24614
- var ActivityDirectionSchema = z26.enum(["inbound", "outbound"]);
24615
- var ActivitySourceSchema = z26.enum(["manual", "agent", "sync"]);
24616
- var ActivityUrlSchema = z26.url().max(2e3).refine((value) => /^https?:\/\//i.test(value), {
24710
+ var ActivityDirectionSchema = z28.enum(["inbound", "outbound"]);
24711
+ var ActivitySourceSchema = z28.enum(["manual", "agent", "sync"]);
24712
+ var ActivityUrlSchema = z28.url().max(2e3).refine((value) => /^https?:\/\//i.test(value), {
24617
24713
  message: "Link must be an http or https URL"
24618
24714
  });
24619
- var ActivityLinkRequestSchema = z26.object({
24715
+ var ActivityLinkRequestSchema = z28.object({
24620
24716
  type: CrmEntityTypeSchema,
24621
- id: z26.uuid()
24717
+ id: z28.uuid()
24622
24718
  });
24623
- var ActivityFieldsSchema = z26.object({
24719
+ var ActivityFieldsSchema = z28.object({
24624
24720
  kind: ActivityKindSchema,
24625
24721
  direction: ActivityDirectionSchema.nullish(),
24626
24722
  /** When it happened; a future time is a scheduled meeting or call. Omitted, now. */
24627
- occurredAt: z26.iso.datetime().nullish(),
24628
- subject: z26.string().max(500).nullish(),
24629
- body: z26.string().max(2e4).nullish(),
24723
+ occurredAt: z28.iso.datetime().nullish(),
24724
+ subject: z28.string().max(500).nullish(),
24725
+ body: z28.string().max(2e4).nullish(),
24630
24726
  externalUrl: ActivityUrlSchema.nullish(),
24631
- links: z26.array(ActivityLinkRequestSchema).min(1).max(25),
24727
+ links: z28.array(ActivityLinkRequestSchema).min(1).max(25),
24632
24728
  // Stamped by the engine for agent writes; never user-supplied in the UI.
24633
- draftedBy: z26.string().max(50).nullish()
24729
+ draftedBy: z28.string().max(50).nullish()
24634
24730
  });
24635
24731
  var CreateActivityRequestSchema = ActivityFieldsSchema.extend({
24636
- externalRef: z26.string().min(1).max(500).nullish()
24732
+ externalRef: z28.string().min(1).max(500).nullish()
24637
24733
  });
24638
24734
  var UpsertActivityRequestSchema = ActivityFieldsSchema.extend({
24639
- externalRef: z26.string().min(1).max(500)
24735
+ externalRef: z28.string().min(1).max(500)
24640
24736
  });
24641
- var UpdateActivityRequestSchema = z26.object({
24737
+ var UpdateActivityRequestSchema = z28.object({
24642
24738
  kind: ActivityKindSchema.optional(),
24643
24739
  direction: ActivityDirectionSchema.nullable().optional(),
24644
- occurredAt: z26.iso.datetime().optional(),
24645
- subject: z26.string().max(500).nullable().optional(),
24646
- body: z26.string().max(2e4).nullable().optional(),
24740
+ occurredAt: z28.iso.datetime().optional(),
24741
+ subject: z28.string().max(500).nullable().optional(),
24742
+ body: z28.string().max(2e4).nullable().optional(),
24647
24743
  externalUrl: ActivityUrlSchema.nullable().optional(),
24648
24744
  /** Replaces every link. */
24649
- links: z26.array(ActivityLinkRequestSchema).min(1).max(25).optional()
24745
+ links: z28.array(ActivityLinkRequestSchema).min(1).max(25).optional()
24650
24746
  });
24651
24747
 
24652
24748
  // ../../packages/crm-api/dist/types/recordFile.js
24653
- import { z as z27 } from "zod";
24654
- var CrmFileKindSchema = z27.enum([
24749
+ import { z as z29 } from "zod";
24750
+ var CrmFileKindSchema = z29.enum([
24655
24751
  "document",
24656
24752
  "resume",
24657
24753
  "contract",
@@ -24659,48 +24755,48 @@ var CrmFileKindSchema = z27.enum([
24659
24755
  "other"
24660
24756
  ]);
24661
24757
  var CRM_FILE_MAX_BYTES = 25 * 1024 * 1024;
24662
- var PrepareCrmFileUploadRequestSchema = z27.object({
24758
+ var PrepareCrmFileUploadRequestSchema = z29.object({
24663
24759
  entityType: CrmEntityTypeSchema,
24664
- entityId: z27.uuid(),
24665
- mimeType: z27.string().min(1).max(200)
24760
+ entityId: z29.uuid(),
24761
+ mimeType: z29.string().min(1).max(200)
24666
24762
  });
24667
- var CommitCrmFileUploadRequestSchema = z27.object({
24668
- uploadId: z27.uuid(),
24763
+ var CommitCrmFileUploadRequestSchema = z29.object({
24764
+ uploadId: z29.uuid(),
24669
24765
  entityType: CrmEntityTypeSchema,
24670
- entityId: z27.uuid(),
24671
- name: z27.string().min(1).max(255),
24672
- mimeType: z27.string().min(1).max(200),
24766
+ entityId: z29.uuid(),
24767
+ name: z29.string().min(1).max(255),
24768
+ mimeType: z29.string().min(1).max(200),
24673
24769
  kind: CrmFileKindSchema
24674
24770
  });
24675
24771
 
24676
24772
  // ../../packages/crm-api/dist/types/touchpoint.js
24677
- import { z as z28 } from "zod";
24678
- var CreateTouchpointRequestSchema = z28.object({
24773
+ import { z as z30 } from "zod";
24774
+ var CreateTouchpointRequestSchema = z30.object({
24679
24775
  channel: ActivityKindSchema,
24680
24776
  direction: ActivityDirectionSchema.nullish(),
24681
- occurredAt: z28.iso.datetime(),
24682
- summary: z28.string().max(1e4).nullish(),
24683
- subject: z28.string().max(500).nullish(),
24777
+ occurredAt: z30.iso.datetime(),
24778
+ summary: z30.string().max(1e4).nullish(),
24779
+ subject: z30.string().max(500).nullish(),
24684
24780
  // The contact this was with; company is derived from the card server-side.
24685
- personId: z28.uuid().nullish(),
24686
- externalRef: z28.string().max(500).nullish(),
24781
+ personId: z30.uuid().nullish(),
24782
+ externalRef: z30.string().max(500).nullish(),
24687
24783
  externalUrl: ActivityUrlSchema.nullish(),
24688
24784
  // Stamped by the engine for agent writes — never user-supplied in the UI.
24689
- loggedByProvider: z28.string().max(50).nullish()
24785
+ loggedByProvider: z30.string().max(50).nullish()
24690
24786
  });
24691
- var UpdateTouchpointRequestSchema = z28.object({
24787
+ var UpdateTouchpointRequestSchema = z30.object({
24692
24788
  channel: ActivityKindSchema.optional(),
24693
24789
  direction: ActivityDirectionSchema.nullable().optional(),
24694
- occurredAt: z28.iso.datetime().optional(),
24695
- summary: z28.string().max(1e4).nullable().optional(),
24696
- subject: z28.string().max(500).nullable().optional(),
24697
- personId: z28.uuid().nullable().optional(),
24790
+ occurredAt: z30.iso.datetime().optional(),
24791
+ summary: z30.string().max(1e4).nullable().optional(),
24792
+ subject: z30.string().max(500).nullable().optional(),
24793
+ personId: z30.uuid().nullable().optional(),
24698
24794
  externalUrl: ActivityUrlSchema.nullable().optional()
24699
24795
  });
24700
24796
 
24701
24797
  // ../../packages/crm-api/dist/types/leadFilters.js
24702
- import { z as z29 } from "zod";
24703
- var LeadFilterFieldTypeSchema = z29.enum([
24798
+ import { z as z31 } from "zod";
24799
+ var LeadFilterFieldTypeSchema = z31.enum([
24704
24800
  "text",
24705
24801
  "number",
24706
24802
  "date",
@@ -24708,7 +24804,7 @@ var LeadFilterFieldTypeSchema = z29.enum([
24708
24804
  "stringArray",
24709
24805
  "boolean"
24710
24806
  ]);
24711
- var LeadFilterOperatorSchema = z29.enum([
24807
+ var LeadFilterOperatorSchema = z31.enum([
24712
24808
  // text
24713
24809
  "contains",
24714
24810
  "not_contains",
@@ -24741,16 +24837,16 @@ var LeadFilterOperatorSchema = z29.enum([
24741
24837
  "is_empty",
24742
24838
  "is_not_empty"
24743
24839
  ]);
24744
- var LeadFilterConditionSchema = z29.object({
24745
- field: z29.string().min(1).max(200),
24840
+ var LeadFilterConditionSchema = z31.object({
24841
+ field: z31.string().min(1).max(200),
24746
24842
  operator: LeadFilterOperatorSchema,
24747
24843
  // Single-value operators (contains, gt, before, in_last_days, …).
24748
- value: z29.union([z29.string().max(500), z29.number()]).optional(),
24844
+ value: z31.union([z31.string().max(500), z31.number()]).optional(),
24749
24845
  // Multi-value operators (any_of, includes_any, …).
24750
- values: z29.array(z29.string().max(500)).max(100).optional(),
24846
+ values: z31.array(z31.string().max(500)).max(100).optional(),
24751
24847
  // `between` bounds — numbers, or ISO dates for date fields.
24752
- min: z29.union([z29.string().max(100), z29.number()]).optional(),
24753
- max: z29.union([z29.string().max(100), z29.number()]).optional()
24848
+ min: z31.union([z31.string().max(100), z31.number()]).optional(),
24849
+ max: z31.union([z31.string().max(100), z31.number()]).optional()
24754
24850
  });
24755
24851
  function staticOptions(values) {
24756
24852
  return values.map((value) => ({
@@ -24925,8 +25021,8 @@ var COMPANY_FILTER_FIELDS = [
24925
25021
  { key: "createdAt", label: "Added", type: "date", group: "Activity" },
24926
25022
  { key: "updatedAt", label: "Updated", type: "date", group: "Activity" }
24927
25023
  ];
24928
- var LeadFilterOptionsQuerySchema = z29.object({
24929
- listId: z29.uuid().optional()
25024
+ var LeadFilterOptionsQuerySchema = z31.object({
25025
+ listId: z31.uuid().optional()
24930
25026
  });
24931
25027
  function leadFilterConditionsDescription(fields) {
24932
25028
  const summary = fields.map((field) => `${field.key} (${field.type})`).join(", ");
@@ -24934,98 +25030,98 @@ function leadFilterConditionsDescription(fields) {
24934
25030
  }
24935
25031
 
24936
25032
  // ../../packages/crm-api/dist/types/savedView.js
24937
- import { z as z30 } from "zod";
24938
- var SavedViewConfigSchema = z30.object({
24939
- filters: z30.array(LeadFilterConditionSchema).max(50),
24940
- sort: z30.object({
24941
- field: z30.string().min(1).max(100),
25033
+ import { z as z32 } from "zod";
25034
+ var SavedViewConfigSchema = z32.object({
25035
+ filters: z32.array(LeadFilterConditionSchema).max(50),
25036
+ sort: z32.object({
25037
+ field: z32.string().min(1).max(100),
24942
25038
  direction: LeadSortDirectionSchema
24943
25039
  }).nullable(),
24944
- columns: z30.array(z30.string().min(1).max(100)).max(100).nullable(),
24945
- layout: z30.enum(["table", "board"]).nullable()
25040
+ columns: z32.array(z32.string().min(1).max(100)).max(100).nullable(),
25041
+ layout: z32.enum(["table", "board"]).nullable()
24946
25042
  });
24947
- var SavedViewListQuerySchema = z30.object({
25043
+ var SavedViewListQuerySchema = z32.object({
24948
25044
  entityType: CrmEntityTypeSchema,
24949
- pipelineId: z30.uuid().optional()
25045
+ pipelineId: z32.uuid().optional()
24950
25046
  });
24951
- var CreateSavedViewRequestSchema = z30.object({
25047
+ var CreateSavedViewRequestSchema = z32.object({
24952
25048
  entityType: CrmEntityTypeSchema,
24953
- pipelineId: z30.uuid().nullish(),
24954
- name: z30.string().min(1).max(100),
24955
- isShared: z30.boolean(),
25049
+ pipelineId: z32.uuid().nullish(),
25050
+ name: z32.string().min(1).max(100),
25051
+ isShared: z32.boolean(),
24956
25052
  config: SavedViewConfigSchema
24957
25053
  });
24958
- var UpdateSavedViewRequestSchema = z30.object({
24959
- name: z30.string().min(1).max(100).optional(),
24960
- isShared: z30.boolean().optional(),
25054
+ var UpdateSavedViewRequestSchema = z32.object({
25055
+ name: z32.string().min(1).max(100).optional(),
25056
+ isShared: z32.boolean().optional(),
24961
25057
  config: SavedViewConfigSchema.optional(),
24962
- position: z30.number().int().min(0).optional()
25058
+ position: z32.number().int().min(0).optional()
24963
25059
  });
24964
25060
 
24965
25061
  // ../../packages/crm-api/dist/types/privacy.js
24966
- import { z as z31 } from "zod";
24967
- var MergeRecordsRequestSchema = z31.object({
24968
- keepId: z31.uuid(),
24969
- mergeIds: z31.array(z31.uuid()).min(1).max(20)
25062
+ import { z as z33 } from "zod";
25063
+ var MergeRecordsRequestSchema = z33.object({
25064
+ keepId: z33.uuid(),
25065
+ mergeIds: z33.array(z33.uuid()).min(1).max(20)
24970
25066
  });
24971
- var SetDoNotContactRequestSchema = z31.object({
24972
- isDoNotContact: z31.boolean(),
24973
- reason: z31.string().max(500).nullish()
25067
+ var SetDoNotContactRequestSchema = z33.object({
25068
+ isDoNotContact: z33.boolean(),
25069
+ reason: z33.string().max(500).nullish()
24974
25070
  });
24975
- var SetContactPointOptOutRequestSchema = z31.object({
24976
- isOptedOut: z31.boolean(),
24977
- reason: z31.string().max(500).nullish()
25071
+ var SetContactPointOptOutRequestSchema = z33.object({
25072
+ isOptedOut: z33.boolean(),
25073
+ reason: z33.string().max(500).nullish()
24978
25074
  });
24979
- var ContactChannelSchema = z31.enum(["email", "phone"]);
24980
- var ContactConsentQuerySchema = z31.object({
24981
- personId: z31.uuid(),
25075
+ var ContactChannelSchema = z33.enum(["email", "phone"]);
25076
+ var ContactConsentQuerySchema = z33.object({
25077
+ personId: z33.uuid(),
24982
25078
  channel: ContactChannelSchema
24983
25079
  });
24984
25080
 
24985
25081
  // ../../packages/crm-api/dist/types/import.js
24986
- import { z as z32 } from "zod";
25082
+ import { z as z34 } from "zod";
24987
25083
  var CRM_IMPORT_MAX_BYTES = 10 * 1024 * 1024;
24988
- var ImportEntityTypeSchema = z32.enum(["person", "company"]);
24989
- var ImportMappingSchema = z32.record(z32.string(), z32.string().max(120));
24990
- var PreviewImportRequestSchema = z32.object({
25084
+ var ImportEntityTypeSchema = z34.enum(["person", "company"]);
25085
+ var ImportMappingSchema = z34.record(z34.string(), z34.string().max(120));
25086
+ var PreviewImportRequestSchema = z34.object({
24991
25087
  entityType: ImportEntityTypeSchema,
24992
- csv: z32.string().min(1).max(CRM_IMPORT_MAX_BYTES),
25088
+ csv: z34.string().min(1).max(CRM_IMPORT_MAX_BYTES),
24993
25089
  /** Omitted, the preview suggests one from the column names. */
24994
25090
  mapping: ImportMappingSchema.optional()
24995
25091
  });
24996
- var StartImportRequestSchema = z32.object({
25092
+ var StartImportRequestSchema = z34.object({
24997
25093
  entityType: ImportEntityTypeSchema,
24998
- csv: z32.string().min(1).max(CRM_IMPORT_MAX_BYTES),
25094
+ csv: z34.string().min(1).max(CRM_IMPORT_MAX_BYTES),
24999
25095
  mapping: ImportMappingSchema,
25000
25096
  /** A list of the same record type each imported record joins. */
25001
- listId: z32.uuid().nullish(),
25002
- tagIds: z32.array(z32.uuid()).max(20).optional()
25097
+ listId: z34.uuid().nullish(),
25098
+ tagIds: z34.array(z34.uuid()).max(20).optional()
25003
25099
  });
25004
- var ImportRunStatusSchema = z32.enum([
25100
+ var ImportRunStatusSchema = z34.enum([
25005
25101
  "pending",
25006
25102
  "running",
25007
25103
  "completed",
25008
25104
  "failed"
25009
25105
  ]);
25010
- var MatchPeopleRequestSchema = z32.object({
25011
- emails: z32.array(z32.string().min(3).max(320)).min(1).max(200)
25106
+ var MatchPeopleRequestSchema = z34.object({
25107
+ emails: z34.array(z34.string().min(3).max(320)).min(1).max(200)
25012
25108
  });
25013
25109
 
25014
25110
  // ../../packages/crm-api/dist/types/search.js
25015
- import { z as z33 } from "zod";
25016
- var PersonSearchFiltersSchema = z33.object({
25111
+ import { z as z35 } from "zod";
25112
+ var PersonSearchFiltersSchema = z35.object({
25017
25113
  // Scope to one company's people (the company detail People tab).
25018
- companyId: z33.uuid().optional(),
25114
+ companyId: z35.uuid().optional(),
25019
25115
  // Scope to a person list's members.
25020
- listId: z33.uuid().optional(),
25116
+ listId: z35.uuid().optional(),
25021
25117
  // Carrying ANY of these tags (OR-within, like the other array facets).
25022
- tagIds: z33.array(z33.uuid()).optional(),
25023
- minEmployeeCount: z33.number().int().min(0).optional(),
25024
- maxEmployeeCount: z33.number().int().min(0).optional(),
25118
+ tagIds: z35.array(z35.uuid()).optional(),
25119
+ minEmployeeCount: z35.number().int().min(0).optional(),
25120
+ maxEmployeeCount: z35.number().int().min(0).optional(),
25025
25121
  // Column conditions, ANDed together and with the keys above.
25026
- conditions: z33.array(LeadFilterConditionSchema).max(20).optional().describe(leadFilterConditionsDescription(PERSON_FILTER_FIELDS))
25122
+ conditions: z35.array(LeadFilterConditionSchema).max(20).optional().describe(leadFilterConditionsDescription(PERSON_FILTER_FIELDS))
25027
25123
  });
25028
- var PersonSearchSortSchema = z33.enum([
25124
+ var PersonSearchSortSchema = z35.enum([
25029
25125
  "relevance",
25030
25126
  "recent",
25031
25127
  "updated",
@@ -25037,30 +25133,30 @@ var PersonSearchSortSchema = z33.enum([
25037
25133
  "phone",
25038
25134
  "linkedin"
25039
25135
  ]);
25040
- var PersonSearchRequestSchema = z33.object({
25136
+ var PersonSearchRequestSchema = z35.object({
25041
25137
  // Free-text keyword query (FTS + fuzzy fallback). Omit for pure facet browse.
25042
- query: z33.string().optional(),
25138
+ query: z35.string().optional(),
25043
25139
  filters: PersonSearchFiltersSchema.optional(),
25044
25140
  sort: PersonSearchSortSchema.default("relevance"),
25045
25141
  // Direction for the column sort; omitted falls back to the sort's default.
25046
25142
  direction: LeadSortDirectionSchema.optional(),
25047
25143
  // Keyset pagination — opaque cursor from the previous response.
25048
- cursor: z33.string().nullable().optional(),
25049
- limit: z33.number().int().min(1).max(100).default(25)
25144
+ cursor: z35.string().nullable().optional(),
25145
+ limit: z35.number().int().min(1).max(100).default(25)
25050
25146
  });
25051
- var CompanySearchFiltersSchema = z33.object({
25147
+ var CompanySearchFiltersSchema = z35.object({
25052
25148
  // Scope to a company list's members.
25053
- listId: z33.uuid().optional(),
25149
+ listId: z35.uuid().optional(),
25054
25150
  // Carrying ANY of these tags (OR-within, like the other array facets).
25055
- tagIds: z33.array(z33.uuid()).optional(),
25056
- industry: z33.array(z33.string()).optional(),
25057
- hqCountry: z33.array(z33.string()).optional(),
25058
- minEmployeeCount: z33.number().int().min(0).optional(),
25059
- maxEmployeeCount: z33.number().int().min(0).optional(),
25151
+ tagIds: z35.array(z35.uuid()).optional(),
25152
+ industry: z35.array(z35.string()).optional(),
25153
+ hqCountry: z35.array(z35.string()).optional(),
25154
+ minEmployeeCount: z35.number().int().min(0).optional(),
25155
+ maxEmployeeCount: z35.number().int().min(0).optional(),
25060
25156
  // Column conditions, ANDed together and with the keys above.
25061
- conditions: z33.array(LeadFilterConditionSchema).max(20).optional().describe(leadFilterConditionsDescription(COMPANY_FILTER_FIELDS))
25157
+ conditions: z35.array(LeadFilterConditionSchema).max(20).optional().describe(leadFilterConditionsDescription(COMPANY_FILTER_FIELDS))
25062
25158
  });
25063
- var CompanySearchSortSchema = z33.enum([
25159
+ var CompanySearchSortSchema = z35.enum([
25064
25160
  "relevance",
25065
25161
  "employee_count",
25066
25162
  "recent",
@@ -25070,211 +25166,211 @@ var CompanySearchSortSchema = z33.enum([
25070
25166
  "industry",
25071
25167
  "hq"
25072
25168
  ]);
25073
- var CompanySearchRequestSchema = z33.object({
25074
- query: z33.string().optional(),
25169
+ var CompanySearchRequestSchema = z35.object({
25170
+ query: z35.string().optional(),
25075
25171
  filters: CompanySearchFiltersSchema.optional(),
25076
25172
  sort: CompanySearchSortSchema.default("relevance"),
25077
25173
  direction: LeadSortDirectionSchema.optional(),
25078
- cursor: z33.string().nullable().optional(),
25079
- limit: z33.number().int().min(1).max(100).default(25),
25080
- includeFacets: z33.boolean().default(false)
25174
+ cursor: z35.string().nullable().optional(),
25175
+ limit: z35.number().int().min(1).max(100).default(25),
25176
+ includeFacets: z35.boolean().default(false)
25081
25177
  });
25082
25178
 
25083
25179
  // ../../packages/crm-api/dist/types/globalSearch.js
25084
- import { z as z34 } from "zod";
25085
- var GlobalSearchRequestSchema = z34.object({
25086
- query: z34.string().min(1).max(200),
25180
+ import { z as z36 } from "zod";
25181
+ var GlobalSearchRequestSchema = z36.object({
25182
+ query: z36.string().min(1).max(200),
25087
25183
  // Per-entity cap; the response holds up to 3 × this many results.
25088
- limitPerType: z34.number().int().min(1).max(20).default(6)
25184
+ limitPerType: z36.number().int().min(1).max(20).default(6)
25089
25185
  });
25090
25186
 
25091
25187
  // ../../packages/crm-api/dist/types/leadTools.js
25092
- import { z as z35 } from "zod";
25188
+ import { z as z37 } from "zod";
25093
25189
  var LEAD_BATCH_MAX = 100;
25094
25190
  var companyEnrichmentFields = {
25095
- legalName: z35.string().nullish(),
25096
- tagline: z35.string().nullish(),
25097
- linkedinUrl: z35.string().nullish(),
25098
- logoUrl: z35.string().nullish(),
25191
+ legalName: z37.string().nullish(),
25192
+ tagline: z37.string().nullish(),
25193
+ linkedinUrl: z37.string().nullish(),
25194
+ logoUrl: z37.string().nullish(),
25099
25195
  companyType: CompanyTypeSchema.nullish(),
25100
- industry: z35.string().nullish(),
25101
- subIndustry: z35.string().nullish(),
25102
- keywords: z35.array(z35.string()).max(50).nullish(),
25103
- description: z35.string().nullish(),
25104
- employeeCount: z35.number().int().min(0).nullish(),
25105
- foundedYear: z35.number().int().nullish(),
25106
- ticker: z35.string().nullish(),
25107
- annualRevenueUsd: z35.number().min(0).nullish(),
25108
- totalFundingUsd: z35.number().min(0).nullish(),
25109
- lastFundingRound: z35.string().nullish(),
25196
+ industry: z37.string().nullish(),
25197
+ subIndustry: z37.string().nullish(),
25198
+ keywords: z37.array(z37.string()).max(50).nullish(),
25199
+ description: z37.string().nullish(),
25200
+ employeeCount: z37.number().int().min(0).nullish(),
25201
+ foundedYear: z37.number().int().nullish(),
25202
+ ticker: z37.string().nullish(),
25203
+ annualRevenueUsd: z37.number().min(0).nullish(),
25204
+ totalFundingUsd: z37.number().min(0).nullish(),
25205
+ lastFundingRound: z37.string().nullish(),
25110
25206
  // ISO date, e.g. 2025-03-01
25111
- lastFundingAt: z35.string().nullish(),
25112
- investors: z35.array(z35.string()).max(50).nullish(),
25113
- hqCity: z35.string().nullish(),
25114
- hqRegion: z35.string().nullish(),
25115
- hqCountry: z35.string().nullish(),
25116
- hqAddress: z35.string().nullish(),
25117
- phone: z35.string().nullish(),
25118
- twitterUrl: z35.string().nullish(),
25119
- githubUrl: z35.string().nullish(),
25120
- facebookUrl: z35.string().nullish(),
25121
- youtubeUrl: z35.string().nullish(),
25122
- instagramUrl: z35.string().nullish(),
25123
- crunchbaseUrl: z35.string().nullish(),
25124
- techStack: z35.array(z35.string()).max(100).nullish()
25207
+ lastFundingAt: z37.string().nullish(),
25208
+ investors: z37.array(z37.string()).max(50).nullish(),
25209
+ hqCity: z37.string().nullish(),
25210
+ hqRegion: z37.string().nullish(),
25211
+ hqCountry: z37.string().nullish(),
25212
+ hqAddress: z37.string().nullish(),
25213
+ phone: z37.string().nullish(),
25214
+ twitterUrl: z37.string().nullish(),
25215
+ githubUrl: z37.string().nullish(),
25216
+ facebookUrl: z37.string().nullish(),
25217
+ youtubeUrl: z37.string().nullish(),
25218
+ instagramUrl: z37.string().nullish(),
25219
+ crunchbaseUrl: z37.string().nullish(),
25220
+ techStack: z37.array(z37.string()).max(100).nullish()
25125
25221
  };
25126
- var CreateLeadCompanyRequestSchema = z35.strictObject({
25127
- name: z35.string().min(1),
25128
- domain: z35.string().optional(),
25222
+ var CreateLeadCompanyRequestSchema = z37.strictObject({
25223
+ name: z37.string().min(1),
25224
+ domain: z37.string().optional(),
25129
25225
  ...companyEnrichmentFields
25130
25226
  });
25131
- var LeadPersonEducationInputSchema = z35.strictObject({
25132
- school: z35.string().min(1),
25133
- degree: z35.string().optional(),
25134
- field: z35.string().optional(),
25135
- startYear: z35.number().int().optional(),
25136
- endYear: z35.number().int().optional()
25227
+ var LeadPersonEducationInputSchema = z37.strictObject({
25228
+ school: z37.string().min(1),
25229
+ degree: z37.string().optional(),
25230
+ field: z37.string().optional(),
25231
+ startYear: z37.number().int().optional(),
25232
+ endYear: z37.number().int().optional()
25137
25233
  });
25138
25234
  var personEnrichmentFields = {
25139
- title: z35.string().nullish(),
25140
- headline: z35.string().nullish(),
25141
- bio: z35.string().nullish(),
25142
- department: z35.string().nullish(),
25143
- yearsExperience: z35.number().int().min(0).max(80).nullish(),
25144
- skills: z35.array(z35.string()).max(50).nullish(),
25145
- languages: z35.array(z35.string()).max(20).nullish(),
25146
- photoUrl: z35.string().nullish(),
25147
- linkedinUrl: z35.string().nullish(),
25148
- twitterUrl: z35.string().nullish(),
25149
- githubUrl: z35.string().nullish(),
25150
- facebookUrl: z35.string().nullish(),
25151
- youtubeUrl: z35.string().nullish(),
25152
- instagramUrl: z35.string().nullish(),
25153
- personalWebsiteUrl: z35.string().nullish(),
25154
- email: z35.string().nullish(),
25155
- locationCity: z35.string().nullish(),
25156
- locationRegion: z35.string().nullish(),
25157
- locationCountry: z35.string().nullish(),
25235
+ title: z37.string().nullish(),
25236
+ headline: z37.string().nullish(),
25237
+ bio: z37.string().nullish(),
25238
+ department: z37.string().nullish(),
25239
+ yearsExperience: z37.number().int().min(0).max(80).nullish(),
25240
+ skills: z37.array(z37.string()).max(50).nullish(),
25241
+ languages: z37.array(z37.string()).max(20).nullish(),
25242
+ photoUrl: z37.string().nullish(),
25243
+ linkedinUrl: z37.string().nullish(),
25244
+ twitterUrl: z37.string().nullish(),
25245
+ githubUrl: z37.string().nullish(),
25246
+ facebookUrl: z37.string().nullish(),
25247
+ youtubeUrl: z37.string().nullish(),
25248
+ instagramUrl: z37.string().nullish(),
25249
+ personalWebsiteUrl: z37.string().nullish(),
25250
+ email: z37.string().nullish(),
25251
+ locationCity: z37.string().nullish(),
25252
+ locationRegion: z37.string().nullish(),
25253
+ locationCountry: z37.string().nullish(),
25158
25254
  // IANA timezone, e.g. America/New_York
25159
- timezone: z35.string().nullish(),
25255
+ timezone: z37.string().nullish(),
25160
25256
  // Full education history — REPLACES any previously saved entries.
25161
- educations: z35.array(LeadPersonEducationInputSchema).max(10).optional()
25257
+ educations: z37.array(LeadPersonEducationInputSchema).max(10).optional()
25162
25258
  };
25163
- var CreateLeadPersonRequestSchema = z35.strictObject({
25164
- fullName: z35.string().min(1),
25259
+ var CreateLeadPersonRequestSchema = z37.strictObject({
25260
+ fullName: z37.string().min(1),
25165
25261
  ...personEnrichmentFields,
25166
- companyId: z35.string().optional(),
25167
- companyName: z35.string().optional(),
25168
- companyDomain: z35.string().optional()
25262
+ companyId: z37.string().optional(),
25263
+ companyName: z37.string().optional(),
25264
+ companyDomain: z37.string().optional()
25169
25265
  });
25170
- var UpdateLeadCompanyRequestSchema = z35.strictObject({
25171
- id: z35.uuid(),
25172
- name: z35.string().min(1).optional(),
25173
- domain: z35.string().optional(),
25266
+ var UpdateLeadCompanyRequestSchema = z37.strictObject({
25267
+ id: z37.uuid(),
25268
+ name: z37.string().min(1).optional(),
25269
+ domain: z37.string().optional(),
25174
25270
  ...companyEnrichmentFields,
25175
25271
  // Registry-defined custom fields; validated + merged server-side.
25176
25272
  custom: CustomFieldValuesSchema.optional()
25177
25273
  });
25178
- var UpdateLeadPersonRequestSchema = z35.strictObject({
25179
- id: z35.uuid(),
25180
- fullName: z35.string().min(1).optional(),
25274
+ var UpdateLeadPersonRequestSchema = z37.strictObject({
25275
+ id: z37.uuid(),
25276
+ fullName: z37.string().min(1).optional(),
25181
25277
  ...personEnrichmentFields,
25182
25278
  // (re)assign current employment — companyId, or companyName/companyDomain
25183
25279
  // to find-or-create the company first
25184
- companyId: z35.string().optional(),
25185
- companyName: z35.string().optional(),
25186
- companyDomain: z35.string().optional(),
25280
+ companyId: z37.string().optional(),
25281
+ companyName: z37.string().optional(),
25282
+ companyDomain: z37.string().optional(),
25187
25283
  // Set the primary company directly (the people.current_company_id cache shown
25188
25284
  // in lists/header). Independent of the employment rows that hold the full set
25189
25285
  // of current roles; null clears it. Recompute overwrites it when the current
25190
25286
  // employment set changes.
25191
- primaryCompanyId: z35.string().nullish(),
25287
+ primaryCompanyId: z37.string().nullish(),
25192
25288
  // Registry-defined custom fields; validated + merged server-side.
25193
25289
  custom: CustomFieldValuesSchema.optional()
25194
25290
  });
25195
- var LeadEmploymentInputSchema = z35.strictObject({
25196
- companyId: z35.uuid().nullish(),
25197
- companyName: z35.string().nullish(),
25198
- title: z35.string().nullish(),
25199
- startDate: z35.string().nullish(),
25200
- endDate: z35.string().nullish(),
25201
- isCurrent: z35.boolean().default(false)
25291
+ var LeadEmploymentInputSchema = z37.strictObject({
25292
+ companyId: z37.uuid().nullish(),
25293
+ companyName: z37.string().nullish(),
25294
+ title: z37.string().nullish(),
25295
+ startDate: z37.string().nullish(),
25296
+ endDate: z37.string().nullish(),
25297
+ isCurrent: z37.boolean().default(false)
25202
25298
  });
25203
- var UpdateLeadEmploymentRequestSchema = z35.strictObject({
25204
- companyId: z35.uuid().nullish(),
25205
- companyName: z35.string().nullish(),
25206
- title: z35.string().nullish(),
25207
- startDate: z35.string().nullish(),
25208
- endDate: z35.string().nullish(),
25209
- isCurrent: z35.boolean().optional()
25299
+ var UpdateLeadEmploymentRequestSchema = z37.strictObject({
25300
+ companyId: z37.uuid().nullish(),
25301
+ companyName: z37.string().nullish(),
25302
+ title: z37.string().nullish(),
25303
+ startDate: z37.string().nullish(),
25304
+ endDate: z37.string().nullish(),
25305
+ isCurrent: z37.boolean().optional()
25210
25306
  });
25211
- var LeadContactPointInputSchema = z35.strictObject({
25307
+ var LeadContactPointInputSchema = z37.strictObject({
25212
25308
  kind: ContactPointKindSchema,
25213
- value: z35.string().min(1),
25309
+ value: z37.string().min(1),
25214
25310
  status: ContactPointStatusSchema.optional(),
25215
- isPrimary: z35.boolean().optional()
25311
+ isPrimary: z37.boolean().optional()
25216
25312
  });
25217
- var UpdateLeadContactPointRequestSchema = z35.strictObject({
25313
+ var UpdateLeadContactPointRequestSchema = z37.strictObject({
25218
25314
  kind: ContactPointKindSchema.optional(),
25219
- value: z35.string().min(1).optional(),
25315
+ value: z37.string().min(1).optional(),
25220
25316
  status: ContactPointStatusSchema.optional(),
25221
- isPrimary: z35.boolean().optional()
25317
+ isPrimary: z37.boolean().optional()
25222
25318
  });
25223
- var LeadCompanyPeopleRequestSchema = z35.object({
25224
- limit: z35.coerce.number().int().min(1).max(100).default(50),
25225
- cursor: z35.string().optional(),
25319
+ var LeadCompanyPeopleRequestSchema = z37.object({
25320
+ limit: z37.coerce.number().int().min(1).max(100).default(50),
25321
+ cursor: z37.string().optional(),
25226
25322
  sort: PersonSearchSortSchema.default("recent"),
25227
25323
  direction: LeadSortDirectionSchema.optional()
25228
25324
  });
25229
- var CreateLeadCompaniesRequestSchema = z35.strictObject({
25230
- companies: z35.array(CreateLeadCompanyRequestSchema).min(1).max(LEAD_BATCH_MAX)
25325
+ var CreateLeadCompaniesRequestSchema = z37.strictObject({
25326
+ companies: z37.array(CreateLeadCompanyRequestSchema).min(1).max(LEAD_BATCH_MAX)
25231
25327
  });
25232
- var CreateLeadPeopleRequestSchema = z35.strictObject({
25233
- people: z35.array(CreateLeadPersonRequestSchema).min(1).max(LEAD_BATCH_MAX)
25328
+ var CreateLeadPeopleRequestSchema = z37.strictObject({
25329
+ people: z37.array(CreateLeadPersonRequestSchema).min(1).max(LEAD_BATCH_MAX)
25234
25330
  });
25235
- var UpdateLeadCompaniesRequestSchema = z35.strictObject({
25236
- companies: z35.array(UpdateLeadCompanyRequestSchema).min(1).max(LEAD_BATCH_MAX)
25331
+ var UpdateLeadCompaniesRequestSchema = z37.strictObject({
25332
+ companies: z37.array(UpdateLeadCompanyRequestSchema).min(1).max(LEAD_BATCH_MAX)
25237
25333
  });
25238
- var UpdateLeadPeopleRequestSchema = z35.strictObject({
25239
- people: z35.array(UpdateLeadPersonRequestSchema).min(1).max(LEAD_BATCH_MAX)
25334
+ var UpdateLeadPeopleRequestSchema = z37.strictObject({
25335
+ people: z37.array(UpdateLeadPersonRequestSchema).min(1).max(LEAD_BATCH_MAX)
25240
25336
  });
25241
- var DeleteLeadCompaniesRequestSchema = z35.strictObject({
25242
- ids: z35.array(z35.uuid()).min(1).max(LEAD_BATCH_MAX)
25337
+ var DeleteLeadCompaniesRequestSchema = z37.strictObject({
25338
+ ids: z37.array(z37.uuid()).min(1).max(LEAD_BATCH_MAX)
25243
25339
  });
25244
- var DeleteLeadPeopleRequestSchema = z35.strictObject({
25245
- ids: z35.array(z35.uuid()).min(1).max(LEAD_BATCH_MAX)
25340
+ var DeleteLeadPeopleRequestSchema = z37.strictObject({
25341
+ ids: z37.array(z37.uuid()).min(1).max(LEAD_BATCH_MAX)
25246
25342
  });
25247
25343
 
25248
25344
  // ../../packages/crm-api/dist/types/enrichment.js
25249
- import { z as z36 } from "zod";
25345
+ import { z as z38 } from "zod";
25250
25346
  var ENRICHMENT_BATCH_LIMIT = 25;
25251
- var EnrichPeopleRequestSchema = z36.object({
25252
- personIds: z36.array(z36.uuid()).min(1).max(ENRICHMENT_BATCH_LIMIT),
25347
+ var EnrichPeopleRequestSchema = z38.object({
25348
+ personIds: z38.array(z38.uuid()).min(1).max(ENRICHMENT_BATCH_LIMIT),
25253
25349
  // A person with only an UNVERIFIED contact reruns the chain, excluding the
25254
25350
  // providers that sourced it. Verified contacts always short-circuit.
25255
- retryUnverified: z36.boolean().optional()
25351
+ retryUnverified: z38.boolean().optional()
25256
25352
  });
25257
25353
  var ENRICHMENT_RUN_PERSON_LIMIT = 500;
25258
- var EnrichmentRunActionSchema = z36.enum([
25354
+ var EnrichmentRunActionSchema = z38.enum([
25259
25355
  "emails",
25260
25356
  "validate",
25261
25357
  "phones"
25262
25358
  ]);
25263
- var StartEnrichmentRunRequestSchema = z36.object({
25264
- personIds: z36.array(z36.uuid()).min(1).max(ENRICHMENT_RUN_PERSON_LIMIT),
25265
- actions: z36.array(EnrichmentRunActionSchema).min(1),
25266
- retryUnverified: z36.boolean()
25359
+ var StartEnrichmentRunRequestSchema = z38.object({
25360
+ personIds: z38.array(z38.uuid()).min(1).max(ENRICHMENT_RUN_PERSON_LIMIT),
25361
+ actions: z38.array(EnrichmentRunActionSchema).min(1),
25362
+ retryUnverified: z38.boolean()
25267
25363
  });
25268
- var EnrichmentCoverageRequestSchema = z36.object({
25269
- personIds: z36.array(z36.uuid()).min(1).max(ENRICHMENT_RUN_PERSON_LIMIT)
25364
+ var EnrichmentCoverageRequestSchema = z38.object({
25365
+ personIds: z38.array(z38.uuid()).min(1).max(ENRICHMENT_RUN_PERSON_LIMIT)
25270
25366
  });
25271
- var UpdateContactPointStatusRequestSchema = z36.object({
25272
- status: z36.enum(["verified", "unverified"])
25367
+ var UpdateContactPointStatusRequestSchema = z38.object({
25368
+ status: z38.enum(["verified", "unverified"])
25273
25369
  });
25274
25370
 
25275
25371
  // ../../packages/crm-api/dist/types/providers.js
25276
- import { z as z37 } from "zod";
25277
- var EmailEnrichmentProviderIdSchema = z37.enum([
25372
+ import { z as z39 } from "zod";
25373
+ var EmailEnrichmentProviderIdSchema = z39.enum([
25278
25374
  "hunter",
25279
25375
  "apollo",
25280
25376
  "prospeo",
@@ -25289,7 +25385,7 @@ var EmailEnrichmentProviderIdSchema = z37.enum([
25289
25385
  "wiza",
25290
25386
  "crustdata"
25291
25387
  ]);
25292
- var EmailValidationProviderIdSchema = z37.enum([
25388
+ var EmailValidationProviderIdSchema = z39.enum([
25293
25389
  "zerobounce",
25294
25390
  "neverbounce",
25295
25391
  "hunter",
@@ -25297,7 +25393,7 @@ var EmailValidationProviderIdSchema = z37.enum([
25297
25393
  "leadmagic",
25298
25394
  "snov"
25299
25395
  ]);
25300
- var PhoneEnrichmentProviderIdSchema = z37.enum([
25396
+ var PhoneEnrichmentProviderIdSchema = z39.enum([
25301
25397
  "prospeo",
25302
25398
  "findymail",
25303
25399
  "leadmagic",
@@ -25309,7 +25405,7 @@ var PhoneEnrichmentProviderIdSchema = z37.enum([
25309
25405
  "wiza",
25310
25406
  "crustdata"
25311
25407
  ]);
25312
- var IntegrationProviderIdSchema = z37.enum([
25408
+ var IntegrationProviderIdSchema = z39.enum([
25313
25409
  "hunter",
25314
25410
  "apollo",
25315
25411
  "prospeo",
@@ -25326,10 +25422,10 @@ var IntegrationProviderIdSchema = z37.enum([
25326
25422
  "wiza",
25327
25423
  "crustdata"
25328
25424
  ]);
25329
- var UpdateEnrichmentWaterfallsRequestSchema = z37.object({
25330
- emailEnrichment: z37.array(EmailEnrichmentProviderIdSchema).optional(),
25331
- emailValidation: z37.array(EmailValidationProviderIdSchema).optional(),
25332
- phoneEnrichment: z37.array(PhoneEnrichmentProviderIdSchema).optional()
25425
+ var UpdateEnrichmentWaterfallsRequestSchema = z39.object({
25426
+ emailEnrichment: z39.array(EmailEnrichmentProviderIdSchema).optional(),
25427
+ emailValidation: z39.array(EmailValidationProviderIdSchema).optional(),
25428
+ phoneEnrichment: z39.array(PhoneEnrichmentProviderIdSchema).optional()
25333
25429
  });
25334
25430
 
25335
25431
  // ../../packages/crm-api/dist/clients/V1CrmApiClient.js
@@ -25905,6 +26001,14 @@ var V1CrmApiClient = class {
25905
26001
  method: "DELETE"
25906
26002
  });
25907
26003
  }
26004
+ // ── Record access ──────────────────────────────────────────────────
26005
+ async setRecordAccess(entityType, entityId, body) {
26006
+ this.http.requireAuthed();
26007
+ return this.http.fetch(`${CRM}/access/${entityType}/${enc(entityId)}`, {
26008
+ method: "PUT",
26009
+ body
26010
+ });
26011
+ }
25908
26012
  // ── Custom fields ──────────────────────────────────────────────────
25909
26013
  async createCustomField(body) {
25910
26014
  this.http.requireAuthed();
@@ -25961,7 +26065,7 @@ var V1CrmApiClient = class {
25961
26065
  // package.json
25962
26066
  var package_default = {
25963
26067
  name: "@general-input/cli",
25964
- version: "0.22.0",
26068
+ version: "0.23.0",
25965
26069
  type: "module",
25966
26070
  description: "The agent-facing CLI for General Input. Authenticate, manage workflows, run bash with operator credentials injected by the cloud.",
25967
26071
  license: "SEE LICENSE IN LICENSE",
@@ -26064,27 +26168,27 @@ var ApiClientFactory = class {
26064
26168
  import { mkdir, readFile, writeFile, unlink, chmod } from "fs/promises";
26065
26169
 
26066
26170
  // src/types/session.ts
26067
- import { z as z38 } from "zod";
26068
- var RunnerSessionFileSchema = z38.object({
26069
- version: z38.literal(1),
26070
- server: z38.url(),
26171
+ import { z as z40 } from "zod";
26172
+ var RunnerSessionFileSchema = z40.object({
26173
+ version: z40.literal(1),
26174
+ server: z40.url(),
26071
26175
  /** Plaintext runner-session token (`geni_rs_…`). */
26072
- token: z38.string().startsWith("geni_rs_"),
26073
- user: z38.object({
26074
- id: z38.string(),
26075
- email: z38.string().nullable(),
26076
- name: z38.string().nullable()
26176
+ token: z40.string().startsWith("geni_rs_"),
26177
+ user: z40.object({
26178
+ id: z40.string(),
26179
+ email: z40.string().nullable(),
26180
+ name: z40.string().nullable()
26077
26181
  }),
26078
- workspace: z38.object({
26079
- membershipId: z38.string(),
26080
- organizationId: z38.string(),
26081
- slug: z38.string(),
26082
- name: z38.string(),
26083
- profilePictureUrl: z38.string().nullable().optional(),
26084
- role: z38.string()
26182
+ workspace: z40.object({
26183
+ membershipId: z40.string(),
26184
+ organizationId: z40.string(),
26185
+ slug: z40.string(),
26186
+ name: z40.string(),
26187
+ profilePictureUrl: z40.string().nullable().optional(),
26188
+ role: z40.string()
26085
26189
  }),
26086
26190
  /** ISO 8601 — when the file was last written by login or workspace switch. */
26087
- savedAt: z38.string()
26191
+ savedAt: z40.string()
26088
26192
  });
26089
26193
 
26090
26194
  // src/clients/SessionStore.ts
@@ -26173,16 +26277,16 @@ function isErrnoCode(err, expected) {
26173
26277
  import { mkdir as mkdir2, readFile as readFile2, writeFile as writeFile2, unlink as unlink2 } from "fs/promises";
26174
26278
 
26175
26279
  // src/types/browserSession.ts
26176
- import { z as z39 } from "zod";
26177
- var BrowserSessionFileSchema = z39.object({
26178
- token: z39.string(),
26179
- cdpUrl: z39.string(),
26180
- provider: z39.string(),
26181
- liveViewUrl: z39.string().nullable(),
26280
+ import { z as z41 } from "zod";
26281
+ var BrowserSessionFileSchema = z41.object({
26282
+ token: z41.string(),
26283
+ cdpUrl: z41.string(),
26284
+ provider: z41.string(),
26285
+ liveViewUrl: z41.string().nullable(),
26182
26286
  /** API server the session was opened against, for diagnostics. */
26183
- server: z39.string(),
26184
- openedAt: z39.string(),
26185
- keepalivePid: z39.number().nullable()
26287
+ server: z41.string(),
26288
+ openedAt: z41.string(),
26289
+ keepalivePid: z41.number().nullable()
26186
26290
  });
26187
26291
 
26188
26292
  // src/clients/BrowserSessionStore.ts
@@ -26654,13 +26758,13 @@ function createEgressProxy(args) {
26654
26758
  // src/lib/egressCa.ts
26655
26759
  import { existsSync as existsSync3, readFileSync as readFileSync6 } from "fs";
26656
26760
  import { join as join5 } from "path";
26657
- import { z as z40 } from "zod";
26761
+ import { z as z42 } from "zod";
26658
26762
  var EGRESS_CA_CACHE_VERSION = 3;
26659
- var EgressCaCacheSchema = z40.object({
26660
- version: z40.literal(EGRESS_CA_CACHE_VERSION),
26661
- caKeyPem: z40.string().min(1),
26662
- caCertPem: z40.string().min(1),
26663
- leafKeyPem: z40.string().min(1)
26763
+ var EgressCaCacheSchema = z42.object({
26764
+ version: z42.literal(EGRESS_CA_CACHE_VERSION),
26765
+ caKeyPem: z42.string().min(1),
26766
+ caCertPem: z42.string().min(1),
26767
+ leafKeyPem: z42.string().min(1)
26664
26768
  });
26665
26769
  function loadOrCreateEgressCa() {
26666
26770
  const path = join5(ensureCacheDir(), "egress-ca.json");
@@ -26865,14 +26969,21 @@ function subject(command) {
26865
26969
  );
26866
26970
  }
26867
26971
  function audienceOptions(command) {
26868
- return command.option("--organization", "Apply to every workspace member.").option("--member <membershipId>", "Apply to one workspace membership id.");
26972
+ return command.option("--organization", "Apply to every workspace member.").option("--member <membershipId>", "Apply to one workspace membership id.").option(
26973
+ "--team <teamId>",
26974
+ "Apply to everyone on a team, now and later (`geni workspace teams` lists ids)."
26975
+ );
26869
26976
  }
26870
26977
  function audience(options) {
26871
- if (Boolean(options.organization) === Boolean(options.member))
26978
+ const chosen = [options.organization, options.member, options.team].filter(
26979
+ Boolean
26980
+ );
26981
+ if (chosen.length !== 1)
26872
26982
  throw new Error(
26873
- "Choose exactly one of --organization or --member <membershipId>."
26983
+ "Choose exactly one of --organization, --member <membershipId> or --team <teamId>."
26874
26984
  );
26875
26985
  if (options.member) return { type: "member", membershipId: options.member };
26986
+ if (options.team) return { type: "team", teamId: options.team };
26876
26987
  return { type: "organization" };
26877
26988
  }
26878
26989
  async function execute(action) {
@@ -26884,7 +26995,7 @@ async function execute(action) {
26884
26995
  }
26885
26996
  function registerSharingCommands(program2) {
26886
26997
  const sharing = program2.command("sharing").description(
26887
- "Inspect, grant and revoke direct specialist, resource and credential permissions. A specialist's grants also apply to everything inside it."
26998
+ "Inspect, grant and revoke who a specialist, resource or credential is shared with: one member, a team, or the whole workspace. A specialist's grants also apply to everything inside it."
26888
26999
  );
26889
27000
  subject(sharing.command("inspect <id>")).action(
26890
27001
  (id, options) => execute(
@@ -26914,7 +27025,7 @@ function registerSharingCommands(program2) {
26914
27025
  await (await sessionContextService.requireAuthed()).client.sharing.revoke({ id, kind: options.kind, audience: target });
26915
27026
  return {
26916
27027
  isRevoked: true,
26917
- note: "Other direct or inherited specialist grants may still provide access."
27028
+ note: "Other direct, team or inherited specialist grants may still provide access."
26918
27029
  };
26919
27030
  })
26920
27031
  );
@@ -27211,7 +27322,7 @@ async function run(opts) {
27211
27322
  // src/commands/workspace/members.ts
27212
27323
  function registerWorkspaceMembers(parent) {
27213
27324
  parent.command("members").description(
27214
- "List active members of the active workspace (name + email). Use to resolve a person to an exact address before emailing, assigning, or sharing."
27325
+ "List active members of the active workspace (name, email, and the teams each is on). Use to resolve a person to an exact address before emailing, assigning, or sharing."
27215
27326
  ).option("-q, --query <text>", "Substring filter on name and email.").option("--page <n>", "1-based page of 25. Default 1.").option("--json", "Machine-readable output.").action(async (opts) => {
27216
27327
  const page = opts.page ? Number.parseInt(opts.page, 10) : void 0;
27217
27328
  try {
@@ -27231,10 +27342,11 @@ function registerWorkspaceMembers(parent) {
27231
27342
  exit(ExitCode.Ok);
27232
27343
  }
27233
27344
  printTable(
27234
- ["NAME", "EMAIL"],
27345
+ ["NAME", "EMAIL", "TEAMS"],
27235
27346
  result.members.map((member) => [
27236
27347
  member.name ?? "(no name)",
27237
- member.email
27348
+ member.email,
27349
+ member.teams.length > 0 ? member.teams.join(", ") : "-"
27238
27350
  ])
27239
27351
  );
27240
27352
  if (result.hasMore) {
@@ -27250,6 +27362,44 @@ function registerWorkspaceMembers(parent) {
27250
27362
  });
27251
27363
  }
27252
27364
 
27365
+ // src/commands/workspace/teams.ts
27366
+ var PERMISSION_LABELS = new Map(
27367
+ ORG_PERMISSIONS.map((definition) => [definition.id, definition.label])
27368
+ );
27369
+ function registerWorkspaceTeams(parent) {
27370
+ parent.command("teams").description(
27371
+ "List the active workspace's teams: each team's id, the permissions everyone on it holds beyond their role, and who is on it. A team's id is what `geni sharing grant --team` takes. Admins change teams in Settings \u2192 Members."
27372
+ ).option("--json", "Machine-readable output.").action(async (opts) => {
27373
+ try {
27374
+ const { teams } = await workspaceService.teams();
27375
+ if (opts.json) {
27376
+ printJson({ teams });
27377
+ exit(ExitCode.Ok);
27378
+ }
27379
+ if (teams.length === 0) {
27380
+ process.stdout.write(
27381
+ "This workspace has no teams yet. Admins make them in Settings \u2192 Members.\n"
27382
+ );
27383
+ exit(ExitCode.Ok);
27384
+ }
27385
+ printTable(
27386
+ ["TEAM", "ID", "PERMISSIONS", "MEMBERS"],
27387
+ teams.map((team) => [
27388
+ team.name,
27389
+ team.id,
27390
+ team.permissions.length > 0 ? team.permissions.map(
27391
+ (permission) => PERMISSION_LABELS.get(permission) ?? permission
27392
+ ).join(", ") : "-",
27393
+ team.members.length > 0 ? team.members.map((member) => member.name ?? member.email).join(", ") : "-"
27394
+ ])
27395
+ );
27396
+ exit(ExitCode.Ok);
27397
+ } catch (error) {
27398
+ exitOnApiError(error);
27399
+ }
27400
+ });
27401
+ }
27402
+
27253
27403
  // src/commands/workspace/index.ts
27254
27404
  function registerWorkspaceCommands(program2) {
27255
27405
  const workspace = program2.command("workspace").alias("workspaces").description(
@@ -27259,6 +27409,7 @@ function registerWorkspaceCommands(program2) {
27259
27409
  registerWorkspaceSwitch(workspace);
27260
27410
  registerWorkspaceCurrent(workspace);
27261
27411
  registerWorkspaceMembers(workspace);
27412
+ registerWorkspaceTeams(workspace);
27262
27413
  }
27263
27414
 
27264
27415
  // src/commands/exec/bash.ts
@@ -28555,7 +28706,7 @@ function registerResourceLifecycle(parent) {
28555
28706
  // src/commands/resource/create.ts
28556
28707
  import { Option as Option2 } from "commander";
28557
28708
  import { resolve as resolve4 } from "path";
28558
- import { z as z41 } from "zod";
28709
+ import { z as z43 } from "zod";
28559
28710
 
28560
28711
  // src/lib/resourceTypeWords.ts
28561
28712
  var RESOURCE_TYPE_FLAG = {
@@ -28578,9 +28729,9 @@ var RESOURCE_KIND_WORD = {
28578
28729
  };
28579
28730
 
28580
28731
  // src/commands/resource/create.ts
28581
- var ResourceCreateTypeSchema = z41.preprocess(
28732
+ var ResourceCreateTypeSchema = z43.preprocess(
28582
28733
  (value) => value === "deliverable" ? "design" : value,
28583
- z41.union([WorkflowTypeSchema, z41.literal("skill")])
28734
+ z43.union([WorkflowTypeSchema, z43.literal("skill")])
28584
28735
  );
28585
28736
  function authoringSkillFor(workflowType) {
28586
28737
  switch (workflowType) {
@@ -28931,7 +29082,7 @@ function printConfig(snapshot) {
28931
29082
 
28932
29083
  // src/commands/resource/config/set.ts
28933
29084
  import { resolve as resolve9 } from "path";
28934
- import { z as z42 } from "zod";
29085
+ import { z as z44 } from "zod";
28935
29086
  function registerConfigSet(parent) {
28936
29087
  parent.command("set [id]").description(
28937
29088
  "Wire config. Repeat each flag as needed. Credentials: --cred <service>=<credentialId>. Consts: --const <key>=<value> (value JSON-parsed, else string). Schedules: --schedule <triggerId>=<cron>, --timezone <triggerId>=<tz>."
@@ -29049,7 +29200,7 @@ function buildPartial(opts) {
29049
29200
  } catch {
29050
29201
  inputValues = null;
29051
29202
  }
29052
- const parsed = z42.record(z42.string(), z42.unknown()).safeParse(inputValues);
29203
+ const parsed = z44.record(z44.string(), z44.unknown()).safeParse(inputValues);
29053
29204
  if (!parsed.success) {
29054
29205
  printError("--trigger-input expects <triggerId>=<JSON object>.");
29055
29206
  exit(ExitCode.InvalidArgs);
@@ -29267,7 +29418,7 @@ Commands accept the resource id as a positional, or infer it from the
29267
29418
 
29268
29419
  // src/commands/workflow/executionControls.ts
29269
29420
  import { resolve as resolve12 } from "path";
29270
- import { z as z43 } from "zod";
29421
+ import { z as z45 } from "zod";
29271
29422
  function registerExecutionControls(parent) {
29272
29423
  for (const action of [
29273
29424
  "pending-input",
@@ -29312,7 +29463,7 @@ function registerExecutionControls(parent) {
29312
29463
  if (action === "resume") {
29313
29464
  const answers = parseJson(
29314
29465
  options.answers,
29315
- z43.record(z43.string(), z43.string()),
29466
+ z45.record(z45.string(), z45.string()),
29316
29467
  "--answers"
29317
29468
  );
29318
29469
  await workflowAuthoringService.resumeExecution(
@@ -29350,7 +29501,7 @@ function registerExecutionControls(parent) {
29350
29501
 
29351
29502
  // src/commands/workflow/previewFilter.ts
29352
29503
  import { resolve as resolve13 } from "path";
29353
- import { z as z44 } from "zod";
29504
+ import { z as z46 } from "zod";
29354
29505
  function registerPreviewFilter(parent) {
29355
29506
  parent.command("preview-filter [id]").description(
29356
29507
  "Run filter.ts once and inspect its decision, transformed input and logs. Uses live credentials and persists any dedup state it writes; does not run the workflow body."
@@ -29369,7 +29520,7 @@ function registerPreviewFilter(parent) {
29369
29520
  const workflowId = resolveResourceId({ id, dir });
29370
29521
  const triggerPayload = parseJson(
29371
29522
  options.payload ?? "{}",
29372
- z44.record(z44.string(), z44.unknown()),
29523
+ z46.record(z46.string(), z46.unknown()),
29373
29524
  "--payload"
29374
29525
  );
29375
29526
  try {
@@ -29515,7 +29666,7 @@ function registerWorkflowSetType(parent) {
29515
29666
 
29516
29667
  // src/commands/workflow/test.ts
29517
29668
  import { resolve as resolve16 } from "path";
29518
- import { z as z45 } from "zod";
29669
+ import { z as z47 } from "zod";
29519
29670
  var TERMINAL = /* @__PURE__ */ new Set(["completed", "failed", "cancelled", "awaiting_input"]);
29520
29671
  var POLL_INTERVAL_MS = 2e3;
29521
29672
  function registerWorkflowTest(parent) {
@@ -29642,7 +29793,7 @@ function parsePayload(raw) {
29642
29793
  printError("--payload must be a JSON object, not an array.");
29643
29794
  exit(ExitCode.InvalidArgs);
29644
29795
  }
29645
- const result = z45.record(z45.string(), z45.unknown()).safeParse(parsed);
29796
+ const result = z47.record(z47.string(), z47.unknown()).safeParse(parsed);
29646
29797
  if (!result.success) {
29647
29798
  printError(`--payload must be a JSON object (e.g. '{"days":7}').`);
29648
29799
  exit(ExitCode.InvalidArgs);
@@ -29997,7 +30148,7 @@ function registerAppBuildStatus(parent) {
29997
30148
 
29998
30149
  // src/commands/app/runHandler.ts
29999
30150
  import { resolve as resolve24 } from "path";
30000
- import { z as z46 } from "zod";
30151
+ import { z as z48 } from "zod";
30001
30152
  function registerAppRunHandler(parent) {
30002
30153
  parent.command("run-handler <name> [id]").description(
30003
30154
  "Dispatch a handler against the live app with --input JSON (bypasses cache) and print the result. Publish first. Exits nonzero on handler error."
@@ -30052,7 +30203,7 @@ function parseInput(raw) {
30052
30203
  printError("--input must be a JSON object, not an array.");
30053
30204
  exit(ExitCode.InvalidArgs);
30054
30205
  }
30055
- const result = z46.record(z46.string(), z46.unknown()).safeParse(parsed);
30206
+ const result = z48.record(z48.string(), z48.unknown()).safeParse(parsed);
30056
30207
  if (!result.success) {
30057
30208
  printError(`--input must be a JSON object (e.g. '{"limit":50}').`);
30058
30209
  exit(ExitCode.InvalidArgs);
@@ -30071,7 +30222,7 @@ function parseTimeout2(raw) {
30071
30222
 
30072
30223
  // src/commands/app/runAgent.ts
30073
30224
  import { resolve as resolve25 } from "path";
30074
- import { z as z47 } from "zod";
30225
+ import { z as z49 } from "zod";
30075
30226
  function registerAppRunAgent(parent) {
30076
30227
  parent.command("run-agent <name> [id]").description(
30077
30228
  "Trigger a declared app agent (agents/<name>/ in app.json) as a test execution against the live app. Async: prints the execution id; poll `geni workflow executions [id]` and `geni workflow execution <executionId>` for the outcome. Publish first."
@@ -30123,7 +30274,7 @@ function parseVariables(raw) {
30123
30274
  printError(`--variables must be valid JSON. Got: ${raw}`);
30124
30275
  exit(ExitCode.InvalidArgs);
30125
30276
  }
30126
- const result = z47.record(z47.string(), z47.unknown()).safeParse(parsed);
30277
+ const result = z49.record(z49.string(), z49.unknown()).safeParse(parsed);
30127
30278
  if (!result.success) {
30128
30279
  printError(`--variables must be a JSON object (e.g. '{"limit":50}').`);
30129
30280
  exit(ExitCode.InvalidArgs);
@@ -30455,10 +30606,10 @@ import {
30455
30606
  } from "fs";
30456
30607
 
30457
30608
  // src/skills/geni.md
30458
- var geni_default = "---\nname: geni\ndescription: Use the user's connected services (Slack, Gmail, GitHub, Stripe, anything they've authorized in General Input) to fulfill their request, or build them a saved workflow (scheduled or event-driven automation). Load this whenever the user wants you to take an action on their behalf against an external SaaS account, fetch data from one of their tools, wire something up that crosses service boundaries, or set up a recurring/triggered automation.\n---\n\n# geni\n\n`geni` is a CLI that gives you credentialed access to the user's\nconnected accounts. The cloud injects their tokens into a fresh bash\nsubprocess as env vars; you write the `curl`, you never see the\nsecret. Run `geni --help` for the full command surface.\n\n## How to talk about geni\n\nTreat geni as a colleague \u2014 the integration expert who picks the\nright operation and runs the credentialed call. You're the one\nsynthesizing and replying.\n\nIn summaries of multi-step work, credit geni naturally: \"Geni pulled\nthe last 30 days of charges from Stripe; I rolled them into the report\nbelow.\" Skip the credit on trivial single calls; don't manufacture\nteam language (\"with geni's help\u2026\") to fill space. Lowercase `geni`\nin commands; capitalize \"Geni\" when personifying.\n\n## Request flow\n\nDiscovery first. Don't guess URLs, params, or env var names \u2014 the\noperation docs have them.\n\n1. `geni credential list [--service <slug>]` \u2014 find a connected\n credential id. If nothing's connected for the service, run\n `geni integration list -q \"<keyword>\"` to confirm the slug, then\n `geni credential connect <service>` (see \"Connecting a missing\n credential\" below).\n2. `geni integration operations <service> [-q \"<keyword>\"]` \u2014 find\n the operation you need. Not sure which service does it?\n `geni integration search \"<capability>\"` searches operations across\n every integration at once, grouped by service.\n3. `geni integration operation <id> --format markdown` \u2014 read the\n HTTP shape, params, and **exact env var names** this call will set.\n4. `geni exec bash --cred <cred_id> --reason \"<what + why>\" -- '<curl>'`\n\nNeed a workspace member's exact email (to notify, assign, or share to)? `geni\nworkspace members -q \"<name>\"`. General Input notifies members only\n(`POST $PLATFORM_BASE_URL/notifications`); anyone else is emailed from a\nconnected Gmail or Outlook.\n\nFor connection health, introspection refresh, labels, notes, dependent\nworkflows, access history, or disconnecting an account, use the dedicated\ncommands in `geni credential --help`. Inspect dependents before disconnecting.\n`geni sharing --help` covers direct member and organization grants on\nspecialists, resources, and credentials; inherited specialist access remains\nwhen a direct resource grant is removed.\n\n## Complex commands: write a file, don't fight quotes\n\nThe `-- '<command>'` form goes through a shell-quoting layer. For a\none-line `curl` that's fine. The moment the command has nested quotes\nor newlines \u2014 a `curl` piped into `jq` or `python3 -c`, a JSON body\nwith `\"keys\"` \u2014 that quoting silently mangles and the call fails in\nconfusing ways. Don't escalate escaping. Write the script to a file\nwith your normal editor, then run it as data:\n\n```\ngeni exec bash --cred <id> --reason \"<why>\" --file ./query.sh\n```\n\n`--file -` reads the script from stdin (heredoc / `< script.sh`).\n`jq` is available in the exec environment \u2014 prefer it over inline\n`python3 -c` for shaping JSON.\n\n## Connecting a missing credential\n\n`geni credential connect <service>` opens the integration's\ndashboard page in the user's browser. Tell the user to\nfinish the connection there and come back \u2014 then re-run `geni\ncredential list --service <service>` to pick up the new id. Don't\npoll, don't loop. In non-interactive shells, add `--print-url` so\nthe URL prints to stdout instead.\n\n## Env vars\n\nRead the names off the operation docs; never derive them. Two flavors\nemitted per credential:\n\n- **Suffixed**: `<SERVICE>_<FIELD>_<id>` (e.g. `$SLACK_BOT_TOKEN_ABC`,\n `$SALESFORCE_INSTANCE_URL_KG`). The `<id>` is the credential id with\n `cred_` stripped, uppercased. Use these when fanning out across\n multiple credentials of the same service in one call.\n- **Canonical aliases**: well-known SDK names (`$GH_TOKEN`,\n `$SLACK_BOT_TOKEN`, `$OPENAI_API_KEY`, `$STRIPE_API_KEY`, \u2026) for\n tools that hardcode them.\n\nPlus `$PLATFORM_API_KEY` and `$PLATFORM_BASE_URL` on every exec \u2014 use\nthem to call General Input's first-party services (web search, image\ngen, weather, notifications) without `--cred`.\n\n## --reason is per-call\n\nEvery `geni exec bash --cred ...` requires `--reason`. It lands in\nthe user's audit log and is shown to them. Be specific\n(\"Posting daily digest to #engineering\"), not generic (\"Slack call\").\nRe-state it on every call \u2014 the log is per-call, not per-session.\n\n## Output is scrubbed\n\nstdout and stderr pass through a streaming scrubber that replaces\nevery registered secret with `[REDACTED:credential_<id>]`. Don't try\nto exfiltrate via `echo $TOKEN | base64`; common encodings are\ncaught too. You don't need to see the secret to use it \u2014 the\nsubprocess can.\n\n## Building resources (workflows, apps, and skills)\n\n`geni exec bash` is for one-off actions. When the user wants something\nsaved and reusable, build a **resource**. A resource is one of four\ntypes: a `code` **workflow** (deterministic, fixed steps, runs on a\nschedule or trigger), an `agent` **workflow** (LLM-driven, variable-length\ntasks like research or triage), an `app` (an interactive React mini-app\nwith server-side handlers, like a dashboard or internal tool), or a\n`skill` (a SKILL.md instruction bundle the platform's cloud agents load\nas context \u2014 not executed). The shared lifecycle lives under `geni\nresource`; type-specific tools under `geni workflow` and `geni app`.\n\nYou author the files locally with your own editor; the cloud validates,\nconfigures, publishes, and runs them. This is the same build loop as a\nconversation with a specialist, just on the user's machine with your\nbrain driving it. Same\nloop for every type; apps add a build step and handler tools (see\n\"Building apps\" below), skills drop the config step (see \"Building\nskills\" below).\n\n**Load the authoring skill first.** `geni skills load\n<code-workflow|agent-workflow|app|skill-authoring>` writes the platform's\nauthoring skill for that type into `geni-skills/<name>/`: `SKILL.md` (the\nmethod), `references/spec.md` (the full contract \u2014 required files, the\nruntime API, allowed and forbidden patterns), and `references/example/`\n(a complete, validated example to mirror). Read SKILL.md and the spec,\nand copy shapes from the example. (`skill-authoring` is the one type\nwhose short spec is inline in SKILL.md, with no example.) Don't write a\nsingle file before loading it.\n\nThe loop:\n\n1. `geni resource create --type code --specialist <specialistId> --name \"Daily Digest\"`:\n creates the resource in that specialist (`geni specialist list` shows the ones\n you can edit, `geni specialist create` makes one) and scaffolds its files\n into the current directory, with a `.geni-resource.json` marker so later\n commands here resolve the id automatically.\n2. Edit the files (`workflow.json`, `main.ts`, `package.json`) with your\n normal Read/Write/Edit tools. **Don't run `npm install`, `tsc`, or\n `bun` locally**: `@general-input/core` only resolves server-side, so\n a local compile always fails on the missing module. That's not a real\n error.\n3. `geni resource validate`: server-side spec + wiring + (code\n workflows) TypeScript check. Exit 9 means invalid; fix what it\n reports and re-run. For apps the compile gate is the publish build,\n not validate.\n4. `geni resource config set`: wire what the workflow needs. Find\n credential ids with `geni credential list`; set them with\n `--cred <service>=<credentialId>`. Set consts with `--const k=v`,\n schedules with `--schedule <triggerId>=<cron>`. `geni resource config\nget` shows the current state. Find trigger providers with\n `geni trigger list`. Poll triggers also need `--trigger-cred\n <triggerId>=<credentialId>` and `--trigger-input '<triggerId>={...}'`;\n clear a poll binding with `--trigger-cred-clear <triggerId>`.\n Resource credential slots and poll trigger bindings are separate.\n5. `geni resource publish --summary \"<one plain sentence>\"`: promote\n your local files to the live version. Required before a test reflects\n your latest edits.\n6. `geni workflow test --trigger <key> --payload '{...}'`: run a real cloud test\n execution and wait for the result, output, and logs. Iterate from\n step 2 until it does what the user asked.\n7. `geni resource enable`: turn it on once it is verified. A workflow is\n validated first and the command exits 9 with the blockers when it is\n not ready; `geni resource disable` turns it off. Works for skills too.\n\nWhen a run misbehaves, `geni workflow execution <id> --download` writes\nits full trace to `executions/<id>/` (run.json, logs.txt, input.json, and\nthread.json). For an agent workflow, read `thread.json` to see every step\nthe agent took. Use `--thread` or `--input` to print those inline instead.\n\nFor a paused run, inspect `geni workflow pending-input <executionId>` and\nanswer every open question with `geni workflow resume <executionId>\n--answers '{\"toolCallId\":\"answer\"}'`. Finished and paused agent runs support\n`continue <executionId> --message \"...\"` (on a paused run it skips the open\nquestions); `cancel` stops active runs and `retry`\nrepeats a finished run with its original input and trigger. These commands\ninfer the workflow from the local marker or accept `--workflow <id>`.\n\n`geni resource versions` lists published snapshots; `geni resource revert\n<versionId>` restores one and rebuilds apps when needed. Pull fresh files\nbefore editing after a revert. `geni resource delete` archives one owned\nresource.\n\nUse the same discovery tools as exec: `geni integration operations\n<service>` and `geni integration operation <id>` to learn an API's shape\nbefore you write the `fetch` call in `main.ts`.\n\nFor a poll-triggered workflow, `geni workflow trigger-sample` returns\nlive sample records so you see the exact shape `input` receives before\nwriting `main.ts` (wire the trigger's credential and inputs with\n`config set` first). To test a file-type input, `geni workflow\nstage-input <file>` uploads a local file and prints a `store://` URI to\npass as that field's value in `--payload`.\n\nPass `--trigger <key>` to select the trigger for samples, tests and filter\npreviews. `geni workflow preview-filter --payload '{...}'` executes only\nthe filter; add `--draft` to preview local edits. It uses live credentials\nand can persist filter deduplication state. `trigger-activity` inspects live\npolling, filter decisions and captured events; `trigger-sync` polls now,\nand `trigger-replay` starts a real run from a captured event. Use each\ncommand's `--help` for selectors and pagination. Sync, retry and replay can\nrepeat external actions.\n\n## Building apps\n\nAn `app` workflow is a React SPA (rendered in the dashboard's iframe)\nthat calls server-side handlers. Create it with `geni resource create\n--type app --specialist <specialistId>`; load the authoring skill with `geni skills load app` (its\n`references/` hold the contract, the component catalog, and a complete\nexample app). The shared commands work the same (validate, config set\nfor credential slots, publish), with these differences:\n\n- The scaffold is a whole Vite project. Edit only `app.json`, `src/App.tsx`,\n `src/pages/*`, your own `src/components/*`, and `handlers/*.ts`. Leave\n the platform-owned files alone.\n- `geni resource publish` builds the app; the result's `build` reports\n whether the Vite build passed. `geni app screenshots` saves authenticated\n mobile and desktop captures; page loads can invoke live handlers.\n- `geni app run-handler <name> --input '{...}'` runs a handler\n against the live app (publish first). `geni app invocations`\n shows recent handler runs, `geni app errors` shows browser\n errors the iframe reported, `geni app build-status` shows the\n build, and `geni app clear-cache` flushes the handler cache.\n- `geni app run-agent <name> --variables '{...}'` triggers a declared\n app agent (`agents/<name>/` in app.json) as a test execution. Async:\n poll `geni workflow executions`, then `geni workflow execution <id>`.\n\nThe loop: create --type app -> edit handlers + pages -> validate ->\nconfig set (wire credential slots) -> publish (builds) -> app run-handler\nto verify -> tell the user to open it in their dashboard.\n\n## Building skills\n\nA `skill` is a SKILL.md bundle (frontmatter `name` slug + `description`,\nthen the instructions body; optional `scripts/`, `references/`,\n`assets/`) that the platform's cloud agents load as context. It is not\nexecuted, so the loop is shorter: create --type skill -> edit SKILL.md ->\nvalidate -> publish. No `config set` (nothing to wire) and publish needs\nno `--summary`. The frontmatter `description` is the only thing agents\nsee before deciding to load it, so it must say what the skill does AND\nwhen to use it. Skill ids are `skl_`-prefixed; pull/validate/publish\nwork on them like any resource.\n\nA skill is never run and has no triggers. Once published, tell the user\nit's in their dashboard Skills page, ready for their agents to load into\nfuture work. Commands accept the skill id as a positional or infer it\nfrom the marker in the current directory.\n\n## Building custom API integrations\n\nWhen the integration catalog has no service for an API-key or public REST\nAPI, load its authoring contract with `geni skills load custom-api`. Read that\nskill before creating anything. Gather the provider's official documentation,\nshow the user the proposed title and description, and wait for approval.\n\nCreate the private draft with\n`geni custom-api create --title \"...\" --description \"...\" --confirm`. The\n`--confirm` flag means the user approved those exact\ndetails. Then use `geni custom-api update`, `upsert-operation`,\n`delete-operation`, and `set-status`; each accepts the same fields as the\ncorresponding cloud-agent tool. Prefer `--file` for documentation-heavy JSON.\nPublish with `set-status <id> live --confirm` only after the user explicitly\nasks and the loaded skill's source inventory has no unresolved assumptions.\nOAuth-only services need an integration request in the dashboard instead.\n\n## Hosted browser (login-walled sites)\n\nFor sites with no API \u2014 or data behind a login wall \u2014 drive a hosted\nbrowser with a Playwright script, exactly like the platform's agents do.\n\n1. `geni browser profiles` \u2014 saved browsers and their logins. The\n user's own browser is always listed; shared ones appear too.\n2. `geni browser open [--profile <id>] [--url <url>]` \u2014 open a hosted session, on that page when given.\n With `--profile` it arrives signed in (cookies + storage); without,\n it's logged out. One session at a time.\n3. While it's open, `geni exec bash` exports `GI_BROWSER_CDP_URL`.\n Write a playwright-core script that\n `chromium.connectOverCDP(process.env.GI_BROWSER_CDP_URL)` and run it\n with `node` (not bun). No `--cred` needed for the browser itself.\n4. `geni browser close` \u2014 ALWAYS, including after failures: it saves\n the login back onto the profile and stops billing. A forgotten\n session auto-closes after 2 hours.\n\nWhen a script hits a real login wall (a restricted page bounced to a\nsign-in form \u2014 a homepage merely showing a Sign in button doesn't\ncount), first sign in with a provider: if the login is listed as\n\"signed in with github.com\", or the sign-in page offers a provider\nthe browser lists as signed in (\"Continue with GitHub\"), click that\nbutton once. If it lands signed in, carry on and record the way in\nwith `geni browser report-login <domain> active --signed-in-with\ngithub.com`. Stop at anything it asks for (a password, a code, an\nemail, a choice of account, approval for an app). Otherwise:\n\n- On the user's own browser: `geni browser request-login <domain>`\n opens a live view in their real browser; they sign in (2FA and all),\n the browser saves as they go, and the next `open --profile` arrives\n signed in.\n- On a shared browser: `geni browser report-login <domain> logged_out`\n and tell the user to ask its owner to reconnect it. Use\n `... active` when you confirmed a listed login works.\n\n## Workspace memory\n\nThe workspace carries a memory: standing instructions, conventions,\nand reference material the workspace's agents have accumulated. It is\nnot optional context \u2014 it holds decisions you would otherwise\nre-derive or contradict.\n\n**Read it at the start of any non-trivial task:**\n\n```\ngeni memory show # the workspace's\ngeni memory show --personal # the user's own preferences\n```\n\nUse `geni memory files` to list referenced files and `geni memory read\n<path>` to read one. `read <path> --out <file>` downloads an original\nupload without changing its bytes; `geni memory pull --dir <directory>`\ndownloads a side's guide, references and originals. Add `--personal` for\nthe user's own memory.\n\nStanding instructions there override your defaults. If memory says\nreports go in a specific format, or a service is off-limits, follow it\nwithout re-asking.\n\n**File what you learn back:**\n\n```\ngeni memory remember \"invoices are reconciled against Stripe, never the ledger\"\ngeni memory remember --personal \"prefers terse summaries, no preamble\"\n```\n\nThis does not edit memory. It queues the change for the workspace's\nmemory agent, which folds it in on its next run and reconciles it\nagainst everything else it knows. `geni memory show` lists what is\nalready queued, so you don't file the same thing twice.\n\nReach for `remember` when a correction or convention would still\nmatter next week and isn't already recorded. Skip it for one-off\ndetails, anything already in `geni memory show`, and anything you only\nhalf-know \u2014 a wrong memory is worse than a missing one. Most tasks\nneed no call at all. Phrase the note as the change you want made\n(\"deploys go out Tuesdays\"), not a summary of the session (\"we talked\nabout deploys\").\n\nWorkspace memory is shared with the whole team, so keep it about the\nbusiness and the work, never about a person. Anything specific to this\nuser goes to `--personal`. Workspace proposals require Admin or Owner;\nevery member can propose changes to their own personal memory.\n\n## Specialist files and portability\n\n`geni specialist files --help` covers shared text and binary files, and the\nfolders people see them in (`mkdir`, `mv`, `rename`, `rmdir`): a specialist's\nworkflows, apps, and skills sit in those folders beside its files. Specialist\nimport/export and template commands are listed in `geni specialist --help`.\nReview archive contents and template versions before installing. Exports\nand publications carry only the files and memory explicitly selected;\nchoose the intended publication audience before publishing a template.\n\n## Exit codes worth knowing\n\n- `0` \u2014 success; `1\u2013125` \u2014 subprocess's own exit (curl, jq, etc.)\n- `4` \u2014 resource not found (bad cred id, slug, operation id)\n- `77` \u2014 server refused to resolve a credential. Don't retry; surface\n to the user.\n- `78` \u2014 session expired. Tell the user to run `geni login`.\n- `79` \u2014 this geni is below the server's minimum version. Run\n `geni upgrade`, then `geni skills install`, and retry.\n\n## Don't\n\n- Don't construct a curl without reading the operation docs first.\n Guessing at URLs and env var names is the most common failure mode.\n- Don't hand-write resource files before loading the authoring skill\n (`geni skills load <code-workflow|agent-workflow|app|skill-authoring>`)\n and reading its spec + example. Don't try to compile or `npm install`\n them locally; let `geni resource validate` be the gate.\n- Don't create or publish a custom API before loading `custom-api`, reviewing\n sources, and getting the user's explicit approval.\n- Don't re-derive a convention `geni memory show` already states, and\n don't put anything about a named person into workspace memory.\n- Use `--json` on list/get commands when you're going to parse the\n output. Table output is for humans.\n";
30609
+ var geni_default = "---\nname: geni\ndescription: Use the user's connected services (Slack, Gmail, GitHub, Stripe, anything they've authorized in General Input) to fulfill their request, or build them a saved workflow (scheduled or event-driven automation). Load this whenever the user wants you to take an action on their behalf against an external SaaS account, fetch data from one of their tools, wire something up that crosses service boundaries, or set up a recurring/triggered automation.\n---\n\n# geni\n\n`geni` is a CLI that gives you credentialed access to the user's\nconnected accounts. The cloud injects their tokens into a fresh bash\nsubprocess as env vars; you write the `curl`, you never see the\nsecret. Run `geni --help` for the full command surface.\n\n## How to talk about geni\n\nTreat geni as a colleague \u2014 the integration expert who picks the\nright operation and runs the credentialed call. You're the one\nsynthesizing and replying.\n\nIn summaries of multi-step work, credit geni naturally: \"Geni pulled\nthe last 30 days of charges from Stripe; I rolled them into the report\nbelow.\" Skip the credit on trivial single calls; don't manufacture\nteam language (\"with geni's help\u2026\") to fill space. Lowercase `geni`\nin commands; capitalize \"Geni\" when personifying.\n\n## Request flow\n\nDiscovery first. Don't guess URLs, params, or env var names \u2014 the\noperation docs have them.\n\n1. `geni credential list [--service <slug>]` \u2014 find a connected\n credential id. If nothing's connected for the service, run\n `geni integration list -q \"<keyword>\"` to confirm the slug, then\n `geni credential connect <service>` (see \"Connecting a missing\n credential\" below).\n2. `geni integration operations <service> [-q \"<keyword>\"]` \u2014 find\n the operation you need. Not sure which service does it?\n `geni integration search \"<capability>\"` searches operations across\n every integration at once, grouped by service.\n3. `geni integration operation <id> --format markdown` \u2014 read the\n HTTP shape, params, and **exact env var names** this call will set.\n4. `geni exec bash --cred <cred_id> --reason \"<what + why>\" -- '<curl>'`\n\nNeed a workspace member's exact email (to notify, assign, or share to)? `geni\nworkspace members -q \"<name>\"`. General Input notifies members only\n(`POST $PLATFORM_BASE_URL/notifications`); anyone else is emailed from a\nconnected Gmail or Outlook.\n\nFor connection health, introspection refresh, labels, notes, dependent\nworkflows, access history, or disconnecting an account, use the dedicated\ncommands in `geni credential --help`. Inspect dependents before disconnecting.\n`geni sharing --help` covers member, team, and organization grants on\nspecialists, resources, and credentials (`inspect` lists all three); inherited\nspecialist access remains when a direct resource grant is removed. `geni\nworkspace teams` lists each team's id, what it carries, and who is on it.\n\n## Complex commands: write a file, don't fight quotes\n\nThe `-- '<command>'` form goes through a shell-quoting layer. For a\none-line `curl` that's fine. The moment the command has nested quotes\nor newlines \u2014 a `curl` piped into `jq` or `python3 -c`, a JSON body\nwith `\"keys\"` \u2014 that quoting silently mangles and the call fails in\nconfusing ways. Don't escalate escaping. Write the script to a file\nwith your normal editor, then run it as data:\n\n```\ngeni exec bash --cred <id> --reason \"<why>\" --file ./query.sh\n```\n\n`--file -` reads the script from stdin (heredoc / `< script.sh`).\n`jq` is available in the exec environment \u2014 prefer it over inline\n`python3 -c` for shaping JSON.\n\n## Connecting a missing credential\n\n`geni credential connect <service>` opens the integration's\ndashboard page in the user's browser. Tell the user to\nfinish the connection there and come back \u2014 then re-run `geni\ncredential list --service <service>` to pick up the new id. Don't\npoll, don't loop. In non-interactive shells, add `--print-url` so\nthe URL prints to stdout instead.\n\n## Env vars\n\nRead the names off the operation docs; never derive them. Two flavors\nemitted per credential:\n\n- **Suffixed**: `<SERVICE>_<FIELD>_<id>` (e.g. `$SLACK_BOT_TOKEN_ABC`,\n `$SALESFORCE_INSTANCE_URL_KG`). The `<id>` is the credential id with\n `cred_` stripped, uppercased. Use these when fanning out across\n multiple credentials of the same service in one call.\n- **Canonical aliases**: well-known SDK names (`$GH_TOKEN`,\n `$SLACK_BOT_TOKEN`, `$OPENAI_API_KEY`, `$STRIPE_API_KEY`, \u2026) for\n tools that hardcode them.\n\nPlus `$PLATFORM_API_KEY` and `$PLATFORM_BASE_URL` on every exec \u2014 use\nthem to call General Input's first-party services (web search, image\ngen, weather, notifications) without `--cred`.\n\n## --reason is per-call\n\nEvery `geni exec bash --cred ...` requires `--reason`. It lands in\nthe user's audit log and is shown to them. Be specific\n(\"Posting daily digest to #engineering\"), not generic (\"Slack call\").\nRe-state it on every call \u2014 the log is per-call, not per-session.\n\n## Output is scrubbed\n\nstdout and stderr pass through a streaming scrubber that replaces\nevery registered secret with `[REDACTED:credential_<id>]`. Don't try\nto exfiltrate via `echo $TOKEN | base64`; common encodings are\ncaught too. You don't need to see the secret to use it \u2014 the\nsubprocess can.\n\n## Building resources (workflows, apps, and skills)\n\n`geni exec bash` is for one-off actions. When the user wants something\nsaved and reusable, build a **resource**. A resource is one of four\ntypes: a `code` **workflow** (deterministic, fixed steps, runs on a\nschedule or trigger), an `agent` **workflow** (LLM-driven, variable-length\ntasks like research or triage), an `app` (an interactive React mini-app\nwith server-side handlers, like a dashboard or internal tool), or a\n`skill` (a SKILL.md instruction bundle the platform's cloud agents load\nas context \u2014 not executed). The shared lifecycle lives under `geni\nresource`; type-specific tools under `geni workflow` and `geni app`.\n\nYou author the files locally with your own editor; the cloud validates,\nconfigures, publishes, and runs them. This is the same build loop as a\nconversation with a specialist, just on the user's machine with your\nbrain driving it. Same\nloop for every type; apps add a build step and handler tools (see\n\"Building apps\" below), skills drop the config step (see \"Building\nskills\" below).\n\n**Load the authoring skill first.** `geni skills load\n<code-workflow|agent-workflow|app|skill-authoring>` writes the platform's\nauthoring skill for that type into `geni-skills/<name>/`: `SKILL.md` (the\nmethod), `references/spec.md` (the full contract \u2014 required files, the\nruntime API, allowed and forbidden patterns), and `references/example/`\n(a complete, validated example to mirror). Read SKILL.md and the spec,\nand copy shapes from the example. (`skill-authoring` is the one type\nwhose short spec is inline in SKILL.md, with no example.) Don't write a\nsingle file before loading it.\n\nThe loop:\n\n1. `geni resource create --type code --specialist <specialistId> --name \"Daily Digest\"`:\n creates the resource in that specialist (`geni specialist list` shows the ones\n you can edit, `geni specialist create` makes one) and scaffolds its files\n into the current directory, with a `.geni-resource.json` marker so later\n commands here resolve the id automatically.\n2. Edit the files (`workflow.json`, `main.ts`, `package.json`) with your\n normal Read/Write/Edit tools. **Don't run `npm install`, `tsc`, or\n `bun` locally**: `@general-input/core` only resolves server-side, so\n a local compile always fails on the missing module. That's not a real\n error.\n3. `geni resource validate`: server-side spec + wiring + (code\n workflows) TypeScript check. Exit 9 means invalid; fix what it\n reports and re-run. For apps the compile gate is the publish build,\n not validate.\n4. `geni resource config set`: wire what the workflow needs. Find\n credential ids with `geni credential list`; set them with\n `--cred <service>=<credentialId>`. Set consts with `--const k=v`,\n schedules with `--schedule <triggerId>=<cron>`. `geni resource config\nget` shows the current state. Find trigger providers with\n `geni trigger list`. Poll triggers also need `--trigger-cred\n <triggerId>=<credentialId>` and `--trigger-input '<triggerId>={...}'`;\n clear a poll binding with `--trigger-cred-clear <triggerId>`.\n Resource credential slots and poll trigger bindings are separate.\n5. `geni resource publish --summary \"<one plain sentence>\"`: promote\n your local files to the live version. Required before a test reflects\n your latest edits.\n6. `geni workflow test --trigger <key> --payload '{...}'`: run a real cloud test\n execution and wait for the result, output, and logs. Iterate from\n step 2 until it does what the user asked.\n7. `geni resource enable`: turn it on once it is verified. A workflow is\n validated first and the command exits 9 with the blockers when it is\n not ready; `geni resource disable` turns it off. Works for skills too.\n\nWhen a run misbehaves, `geni workflow execution <id> --download` writes\nits full trace to `executions/<id>/` (run.json, logs.txt, input.json, and\nthread.json). For an agent workflow, read `thread.json` to see every step\nthe agent took. Use `--thread` or `--input` to print those inline instead.\n\nFor a paused run, inspect `geni workflow pending-input <executionId>` and\nanswer every open question with `geni workflow resume <executionId>\n--answers '{\"toolCallId\":\"answer\"}'`. Finished and paused agent runs support\n`continue <executionId> --message \"...\"` (on a paused run it skips the open\nquestions); `cancel` stops active runs and `retry`\nrepeats a finished run with its original input and trigger. These commands\ninfer the workflow from the local marker or accept `--workflow <id>`.\n\n`geni resource versions` lists published snapshots; `geni resource revert\n<versionId>` restores one and rebuilds apps when needed. Pull fresh files\nbefore editing after a revert. `geni resource delete` archives one owned\nresource.\n\nUse the same discovery tools as exec: `geni integration operations\n<service>` and `geni integration operation <id>` to learn an API's shape\nbefore you write the `fetch` call in `main.ts`.\n\nFor a poll-triggered workflow, `geni workflow trigger-sample` returns\nlive sample records so you see the exact shape `input` receives before\nwriting `main.ts` (wire the trigger's credential and inputs with\n`config set` first). To test a file-type input, `geni workflow\nstage-input <file>` uploads a local file and prints a `store://` URI to\npass as that field's value in `--payload`.\n\nPass `--trigger <key>` to select the trigger for samples, tests and filter\npreviews. `geni workflow preview-filter --payload '{...}'` executes only\nthe filter; add `--draft` to preview local edits. It uses live credentials\nand can persist filter deduplication state. `trigger-activity` inspects live\npolling, filter decisions and captured events; `trigger-sync` polls now,\nand `trigger-replay` starts a real run from a captured event. Use each\ncommand's `--help` for selectors and pagination. Sync, retry and replay can\nrepeat external actions.\n\n## Building apps\n\nAn `app` workflow is a React SPA (rendered in the dashboard's iframe)\nthat calls server-side handlers. Create it with `geni resource create\n--type app --specialist <specialistId>`; load the authoring skill with `geni skills load app` (its\n`references/` hold the contract, the component catalog, and a complete\nexample app). The shared commands work the same (validate, config set\nfor credential slots, publish), with these differences:\n\n- The scaffold is a whole Vite project. Edit only `app.json`, `src/App.tsx`,\n `src/pages/*`, your own `src/components/*`, and `handlers/*.ts`. Leave\n the platform-owned files alone.\n- `geni resource publish` builds the app; the result's `build` reports\n whether the Vite build passed. `geni app screenshots` saves authenticated\n mobile and desktop captures; page loads can invoke live handlers.\n- `geni app run-handler <name> --input '{...}'` runs a handler\n against the live app (publish first). `geni app invocations`\n shows recent handler runs, `geni app errors` shows browser\n errors the iframe reported, `geni app build-status` shows the\n build, and `geni app clear-cache` flushes the handler cache.\n- `geni app run-agent <name> --variables '{...}'` triggers a declared\n app agent (`agents/<name>/` in app.json) as a test execution. Async:\n poll `geni workflow executions`, then `geni workflow execution <id>`.\n\nThe loop: create --type app -> edit handlers + pages -> validate ->\nconfig set (wire credential slots) -> publish (builds) -> app run-handler\nto verify -> tell the user to open it in their dashboard.\n\n## Building skills\n\nA `skill` is a SKILL.md bundle (frontmatter `name` slug + `description`,\nthen the instructions body; optional `scripts/`, `references/`,\n`assets/`) that the platform's cloud agents load as context. It is not\nexecuted, so the loop is shorter: create --type skill -> edit SKILL.md ->\nvalidate -> publish. No `config set` (nothing to wire) and publish needs\nno `--summary`. The frontmatter `description` is the only thing agents\nsee before deciding to load it, so it must say what the skill does AND\nwhen to use it. Skill ids are `skl_`-prefixed; pull/validate/publish\nwork on them like any resource.\n\nA skill is never run and has no triggers. Once published, tell the user\nit's in their dashboard Skills page, ready for their agents to load into\nfuture work. Commands accept the skill id as a positional or infer it\nfrom the marker in the current directory.\n\n## Building custom API integrations\n\nWhen the integration catalog has no service for an API-key or public REST\nAPI, load its authoring contract with `geni skills load custom-api`. Read that\nskill before creating anything. Gather the provider's official documentation,\nshow the user the proposed title and description, and wait for approval.\n\nCreate the private draft with\n`geni custom-api create --title \"...\" --description \"...\" --confirm`. The\n`--confirm` flag means the user approved those exact\ndetails. Then use `geni custom-api update`, `upsert-operation`,\n`delete-operation`, and `set-status`; each accepts the same fields as the\ncorresponding cloud-agent tool. Prefer `--file` for documentation-heavy JSON.\nPublish with `set-status <id> live --confirm` only after the user explicitly\nasks and the loaded skill's source inventory has no unresolved assumptions.\nOAuth-only services need an integration request in the dashboard instead.\n\n## Hosted browser (login-walled sites)\n\nFor sites with no API \u2014 or data behind a login wall \u2014 drive a hosted\nbrowser with a Playwright script, exactly like the platform's agents do.\n\n1. `geni browser profiles` \u2014 saved browsers and their logins. The\n user's own browser is always listed; shared ones appear too.\n2. `geni browser open [--profile <id>] [--url <url>]` \u2014 open a hosted session, on that page when given.\n With `--profile` it arrives signed in (cookies + storage); without,\n it's logged out. One session at a time.\n3. While it's open, `geni exec bash` exports `GI_BROWSER_CDP_URL`.\n Write a playwright-core script that\n `chromium.connectOverCDP(process.env.GI_BROWSER_CDP_URL)` and run it\n with `node` (not bun). No `--cred` needed for the browser itself.\n4. `geni browser close` \u2014 ALWAYS, including after failures: it saves\n the login back onto the profile and stops billing. A forgotten\n session auto-closes after 2 hours.\n\nWhen a script hits a real login wall (a restricted page bounced to a\nsign-in form \u2014 a homepage merely showing a Sign in button doesn't\ncount), first sign in with a provider: if the login is listed as\n\"signed in with github.com\", or the sign-in page offers a provider\nthe browser lists as signed in (\"Continue with GitHub\"), click that\nbutton once. If it lands signed in, carry on and record the way in\nwith `geni browser report-login <domain> active --signed-in-with\ngithub.com`. Stop at anything it asks for (a password, a code, an\nemail, a choice of account, approval for an app). Otherwise:\n\n- On the user's own browser: `geni browser request-login <domain>`\n opens a live view in their real browser; they sign in (2FA and all),\n the browser saves as they go, and the next `open --profile` arrives\n signed in.\n- On a shared browser: `geni browser report-login <domain> logged_out`\n and tell the user to ask its owner to reconnect it. Use\n `... active` when you confirmed a listed login works.\n\n## Workspace memory\n\nThe workspace carries a memory: standing instructions, conventions,\nand reference material the workspace's agents have accumulated. It is\nnot optional context \u2014 it holds decisions you would otherwise\nre-derive or contradict.\n\n**Read it at the start of any non-trivial task:**\n\n```\ngeni memory show # the workspace's\ngeni memory show --personal # the user's own preferences\n```\n\nUse `geni memory files` to list referenced files and `geni memory read\n<path>` to read one. `read <path> --out <file>` downloads an original\nupload without changing its bytes; `geni memory pull --dir <directory>`\ndownloads a side's guide, references and originals. Add `--personal` for\nthe user's own memory.\n\nStanding instructions there override your defaults. If memory says\nreports go in a specific format, or a service is off-limits, follow it\nwithout re-asking.\n\n**File what you learn back:**\n\n```\ngeni memory remember \"invoices are reconciled against Stripe, never the ledger\"\ngeni memory remember --personal \"prefers terse summaries, no preamble\"\n```\n\nThis does not edit memory. It queues the change for the workspace's\nmemory agent, which folds it in on its next run and reconciles it\nagainst everything else it knows. `geni memory show` lists what is\nalready queued, so you don't file the same thing twice.\n\nReach for `remember` when a correction or convention would still\nmatter next week and isn't already recorded. Skip it for one-off\ndetails, anything already in `geni memory show`, and anything you only\nhalf-know \u2014 a wrong memory is worse than a missing one. Most tasks\nneed no call at all. Phrase the note as the change you want made\n(\"deploys go out Tuesdays\"), not a summary of the session (\"we talked\nabout deploys\").\n\nWorkspace memory is shared with the whole team, so keep it about the\nbusiness and the work, never about a person. Anything specific to this\nuser goes to `--personal`. Workspace proposals require Admin or Owner;\nevery member can propose changes to their own personal memory.\n\n## Specialist files and portability\n\n`geni specialist files --help` covers shared text and binary files, and the\nfolders people see them in (`mkdir`, `mv`, `rename`, `rmdir`): a specialist's\nworkflows, apps, and skills sit in those folders beside its files. Specialist\nimport/export and template commands are listed in `geni specialist --help`.\nReview archive contents and template versions before installing. Exports\nand publications carry only the files and memory explicitly selected;\nchoose the intended publication audience before publishing a template.\n\n## Exit codes worth knowing\n\n- `0` \u2014 success; `1\u2013125` \u2014 subprocess's own exit (curl, jq, etc.)\n- `4` \u2014 resource not found (bad cred id, slug, operation id)\n- `77` \u2014 server refused to resolve a credential. Don't retry; surface\n to the user.\n- `78` \u2014 session expired. Tell the user to run `geni login`.\n- `79` \u2014 this geni is below the server's minimum version. Run\n `geni upgrade`, then `geni skills install`, and retry.\n\n## Don't\n\n- Don't construct a curl without reading the operation docs first.\n Guessing at URLs and env var names is the most common failure mode.\n- Don't hand-write resource files before loading the authoring skill\n (`geni skills load <code-workflow|agent-workflow|app|skill-authoring>`)\n and reading its spec + example. Don't try to compile or `npm install`\n them locally; let `geni resource validate` be the gate.\n- Don't create or publish a custom API before loading `custom-api`, reviewing\n sources, and getting the user's explicit approval.\n- Don't re-derive a convention `geni memory show` already states, and\n don't put anything about a named person into workspace memory.\n- Use `--json` on list/get commands when you're going to parse the\n output. Table output is for humans.\n";
30459
30610
 
30460
30611
  // src/skills/geni-crm.md
30461
- var geni_crm_default = '---\nname: geni-crm\ndescription: Read and write the user\'s General Input CRM from the command line. Load this whenever the user wants you to look something up in their CRM, pull a list of people or companies, check a deal pipeline, find or verify someone\'s email or phone (enrichment), OR change CRM data (create or update people/companies, manage lists and tags, add notes, create and resolve tasks, move deals through stages, log touchpoints). Full read/write access to people, companies, pipelines, deals, lists, tags, notes, tasks, and enrichment.\n---\n\n# geni crm\n\n`geni crm` reads and writes the user\'s General Input CRM: the lead database\n(people and companies), deal pipelines and their cards, lists, tags, notes,\ntasks, touchpoints, and custom fields. It is part of the same `geni` CLI, so it\nuses the same session and active workspace. The workspace must have CRM access,\nor these commands return a 403. Run `geni crm --help` for the full surface, and\n`geni crm <noun> --help` for a noun\'s verbs.\n\nThe shape is `geni crm <noun> <verb>`. Each noun is a group: `people`,\n`companies`, `lists`, `tags`, `notes`, `tasks`, `pipelines`, `stages`, `cards`,\n`touchpoints`, `fields`, `employments`, `contact-points`, `waterfalls`,\n`enrich`, `history`, `activities`, `files`, `views`, `merge`,\n`consent`, `privacy`, `credits`, `import`, plus top-level `search` and `match`.\n\nEvery command that names a record by type takes one of three record types:\n`person`, `company`, or `pipeline_card` (a card in any pipeline: a deal, or a\ncandidate in a recruiting pipeline). Tags, lists, notes, tasks, and custom\nfields work on all three.\n\nEveryone in the workspace sees and edits every person, company, and pipeline\ncard.\n\n## Finding things, then acting on them\n\nThe same two-step flow as the rest of geni: find an id, then read or write it.\n\n1. Find by name with one query across everything:\n `geni crm search "<text>" [--type person|company|list|pipeline|pipeline_card]`. Or\n list one kind: `geni crm people "<text>"`, `geni crm companies "<text>"`,\n `geni crm pipelines`, `geni crm lists`, `geni crm tags`, `geni crm tasks`.\n `people` and `companies` also take `--filter`, a JSON array of column\n conditions, e.g. `--filter \'[{"field":"title","operator":"contains","value":"vp"},{"field":"companyEmployeeCount","operator":"gte","value":50}]\'` \u2014\n see `--help` for the field and operator lists (custom fields filter as\n `custom.<key>`).\n2. Read one record: `geni crm people get <id>`, `geni crm companies get <id>`,\n `geni crm cards get <id>`, `geni crm pipelines get <id>` (add `--board` for\n its cards), `geni crm tasks get <id>`.\n\n## Activities\n\nNotes, calls, emails, meetings, Slack and LinkedIn messages are activities, and\none activity links to every record it concerns (a call with Ada about the\nAcme deal links Ada, Acme, and the deal card). Someone sees an activity only\nwhen they can see every record it links.\n\n- `geni crm activities list <entityType> <id> [--kind call email]` lists a record\'s activities, newest first.\n- `geni crm activities log --json \'{"kind":"call","direction":"outbound","body":"Walked through the offer","links":[{"type":"person","id":"<id>"},{"type":"pipeline_card","id":"<id>"}]}\'`. A future `occurredAt` schedules a meeting or call.\n- `geni crm activities sync --json \'{...,"externalRef":"<Message-ID>"}\'` creates or updates the activity that `externalRef` names and merges its links, so re-syncing a mailbox never duplicates a message. A message a teammate already logged stays as they logged it.\n- Only an activity\'s author edits or deletes it. Notes (`geni crm notes`) and card touchpoints are the same activities seen through one record.\n\n## Files\n\nA record can carry files (a resume on a person, a contract on a card), up to\n25 MB each. `geni crm files upload person <id> ./resume.pdf --kind resume`\nattaches one; `geni crm files list <entityType> <id>` lists them;\n`geni crm files text <fileId>` prints a text file\'s contents and\n`geni crm files download <fileId>` prints a short-lived link to any file.\nSomeone sees a file only when they can see its record.\n\n## Custom fields and saved views\n\nCustom fields (`geni crm fields`) can be text, long text, number, currency\n(`{"amount":1200,"currency":"USD"}`), checkbox, date, date and time (ISO),\nsingle select, multi-select, status, URL, email, phone, or member (a\nmembership id). Write values through the record\'s `custom` object.\n\nSaved views (`geni crm views`) are named filters, sort, and columns for one\nrecord type\'s table or board, personal or shared with the workspace.\n\n## Duplicates, consent, and privacy\n\n- **Merge duplicates**: `geni crm merge people <keepId> <dupeId...>` (and `companies`). The kept record takes every link, contact, file, and history line, and fills its empty fields from the duplicates.\n- **Before any outreach**, run `geni crm consent check <personId> --channel email` (or `phone`). Contact only the `reachable` values it returns, and nobody when `isAllowed` is false. Record a request with `geni crm consent do-not-contact <personId> --reason "..."` or `geni crm consent opt-out <contactPointId>`.\n- **Data requests**: `geni crm privacy export <personId>` returns everything held about them; `geni crm privacy erase <personId> --yes` deletes them for good, with anything merged into them.\n- **Credit splits** on a card: `geni crm credits set <cardId> --json \'{"credits":[{"membershipId":"<id>","role":"Recruiter","percent":60},{"membershipId":"<id>","role":"Account manager","percent":40}]}\'`.\n\n## Importing and syncing\n\n- **Import a CSV**: `geni crm import people leads.csv --dry-run` prints the suggested mapping (column to field, `custom.<key>` for a custom field) and the first rows that would fail. Then run it without `--dry-run`, optionally with `--map \'{...}\'`, `--list <listId>`, `--tag <tagId>`, and `--wait`. Rows match existing records by email, LinkedIn, or domain; a match only fills fields that are empty and never overwrites. `geni crm import status <importId>` shows counts and failed rows.\n- **Match addresses** before logging mail or meetings: `geni crm match a@x.com b@y.com` returns the person each address belongs to (any spelling, `+tags` ignored). Then log with `geni crm activities sync`.\n\n## History and triggers\n\nEvery change to a record is in its history: created, field changes (with the\nold and new value), stage and status moves, tags and lists, tasks, and\ndeletes. `geni crm history <entityType> <id>` prints one record\'s history,\nnewest first. `geni crm history feed [--after <cursor>]` reads the workspace\'s\nevents oldest first, and prints a cursor to pass back as `--after`.\n\nTo act when the CRM changes, build a workflow on a `general-input-crm` trigger\n(record created, field changed, card entered stage, tag added, task created,\nfile attached).\nIts payload is one history event: `entityType`, `entityId`, `kind`, `field`,\n`fromLabel`/`toLabel`, and `details` (stage ids for a stage move, the tag or\nlist id for a membership).\n\n## Writing\n\nCreates and updates take the record body as `--json`; the server validates it,\nso a 400 means the body was wrong (read the error and fix the JSON). Run\n`geni crm <noun> <verb> --help` to see the expected fields.\n\n- **Create / update records** (JSON body):\n - `geni crm people create --json \'[{"fullName":"Ada Lovelace","companyName":"Acme","email":"ada@acme.com"}]\'` (batch, find-or-create, deduped). `companies create` mirrors it. A `"created": false` result matched an existing record by identity key (email/LinkedIn; domain for companies) \u2014 the CLI warns on stderr when the matched name differs, e.g. a shared inbox collapsing distinct people.\n - `geni crm people update --json \'[{"id":"<id>","title":"VP Eng","linkedinUrl":"https://\u2026"}]\'` (batch, ids inline). `companies update` mirrors it. Writes take the create field names (`title`, `linkedinUrl`), not the read names you see on `get` (`currentTitle`, `primaryLinkedinUrl`); unknown keys are rejected with a 400 naming them.\n - `geni crm lists create --json \'{"name":"Q3 ICP","entityType":"company"}\'`, `geni crm tags create --json \'{"name":"Customer","entityType":"company"}\'`, `geni crm tasks create --json \'{"title":"Follow up","entity":{"type":"person","id":"<id>"}}\'`, `geni crm cards create <pipelineId> --json \'{"title":"Acme renewal","amount":50000}\'`.\n- **Notes** take the text directly: `geni crm notes create person <id> --body "Met at the conference"`.\n- **State-change verbs** (no JSON, just flags/ids):\n - Lists/tags: `geni crm lists add <listId> <entityIds...>`, `geni crm tags assign <tagId> <entityIds...>` (and `remove` / `unassign`).\n - Tasks: `geni crm tasks done <id>` (also `dismiss`, `reopen`, `delete`).\n - Cards: `geni crm cards move <id> --stage <stageId>`, `geni crm cards status <id> --status won|lost|open [--reason "..."]`, `geni crm cards archive <id>`, `geni crm cards add-contact <cardId> <personId>`.\n- **Deals/touchpoints**: `geni crm touchpoints log <cardId> --json \'{"channel":"call","occurredAt":"2026-07-01T15:00:00Z","summary":"Pricing call"}\'`.\n- **Delete** is `<noun> delete <id...>` (people/companies/lists/cards take multiple ids; most others take one). `geni crm cards delete <ids...>` is permanent \u2014 it takes the card\'s contacts, activity, notes, touchpoints, tasks, tags, and list entries with it, and reports which ids it actually matched. Prefer `cards archive <id>` when the record should survive.\n\nCard edits, moves, and status changes use optimistic concurrency. Pass\n`--expected-updated-at <ts>` to enforce it; omit it and the CLI reads the card\'s\ncurrent version first (last-write-wins), which is usually what you want from a\nscript. With the token, a stale card fails with an HTTP 409 conflict; re-read\nthe card and retry.\n\n## Output\n\nList commands print a table; pass `--json` to parse. `get` commands and all\nwrites print the affected record as JSON (state-change verbs print a short\nconfirmation). The single-record `get` commands take `--field <path>` to pull\none value, e.g. `geni crm cards get <id> --field status`.\n\nJSON shapes vary by verb: searches print `{"results": [...]}` (people/companies\nadd `nextCursor`), `people get` prints `{person, company, contactPoints, ...}`,\nand bare noun lists wrap in a named key (e.g. `{"lists": [...]}`) \u2014 check before\npiping into a parser.\n\n## Enrichment\n\nFind and verify contact info for people through the workspace\'s configured\nprovider waterfalls. This is **paid** (it spends credits per provider call), so\nevery verb requires `--yes` and a run is capped at 25 people. Only enrich when\nthe user has asked you to. Found emails and numbers save onto the person\'s\ncontact points automatically.\n\n- See what\'s wired first: `geni crm waterfalls` lists the provider chain for each\n capability (email-enrichment, email-validation, phone-enrichment). An empty\n chain finds nothing and spends nothing.\n- `geni crm enrich emails <personIds...> --yes` finds work emails;\n `geni crm enrich phones <personIds...> --yes` finds mobile numbers (both take\n `--retry-unverified`).\n- `geni crm enrich validate <personIds...> --yes` checks deliverability \u2014 run it\n before any outreach so nothing goes to a bad address.\n\n## Composing with the rest of geni\n\nThe CRM is the source of who and what; connected credentials are how you act on\nthe outside world. To add contact info, prefer `geni crm enrich` (it runs the\nworkspace\'s provider waterfalls and saves results). For anything else, pull\npeople or a company from the CRM, reach a service through `geni exec bash` (send\nan email, update an external system), and write the result back to the CRM (a\nnote, a task, a touchpoint, a moved card). Credit each tool naturally in your\nsummary.\n\n## Exit codes worth knowing\n\n- `0` success.\n- `4` not found (bad id, or it is not in the active workspace).\n- `5` forbidden (the workspace lacks CRM access, or the record is out of scope).\n- `9` stale write (a card changed since you read it; re-read and retry, or pass `--expected-updated-at`).\n- `78` session expired. Tell the user to run `geni login`.\n';
30612
+ var geni_crm_default = '---\nname: geni-crm\ndescription: Read and write the user\'s General Input CRM from the command line. Load this whenever the user wants you to look something up in their CRM, pull a list of people or companies, check a deal pipeline, find or verify someone\'s email or phone (enrichment), OR change CRM data (create or update people/companies, manage lists and tags, add notes, create and resolve tasks, move deals through stages, log touchpoints). Full read/write access to people, companies, pipelines, deals, lists, tags, notes, tasks, and enrichment.\n---\n\n# geni crm\n\n`geni crm` reads and writes the user\'s General Input CRM: the lead database\n(people and companies), deal pipelines and their cards, lists, tags, notes,\ntasks, touchpoints, and custom fields. It is part of the same `geni` CLI, so it\nuses the same session and active workspace. The workspace must have CRM access,\nor these commands return a 403. Run `geni crm --help` for the full surface, and\n`geni crm <noun> --help` for a noun\'s verbs.\n\nThe shape is `geni crm <noun> <verb>`. Each noun is a group: `people`,\n`companies`, `lists`, `tags`, `notes`, `tasks`, `pipelines`, `stages`, `cards`,\n`touchpoints`, `fields`, `employments`, `contact-points`, `waterfalls`,\n`enrich`, `access`, `history`, `activities`, `files`, `views`, `merge`,\n`consent`, `privacy`, `credits`, `import`, plus top-level `search` and `match`.\n\nEvery command that names a record by type takes one of three record types:\n`person`, `company`, or `pipeline_card` (a card in any pipeline: a deal, or a\ncandidate in a recruiting pipeline). Tags, lists, notes, tasks, custom fields,\nand access work on all three.\n\nPeople, companies, and pipeline cards have an owner and a visibility: everyone in the\nworkspace, a team, or only the owner (and admins, who see every record). You\nonly see records you have access to; a record you can\'t see is a 404, and\ncreating one whose email, LinkedIn, or domain is already on a record you can\'t\nsee fails with a 409 `record_not_shared` instead of merging into it.\n\n## Finding things, then acting on them\n\nThe same two-step flow as the rest of geni: find an id, then read or write it.\n\n1. Find by name with one query across everything:\n `geni crm search "<text>" [--type person|company|list|pipeline|pipeline_card]`. Or\n list one kind: `geni crm people "<text>"`, `geni crm companies "<text>"`,\n `geni crm pipelines`, `geni crm lists`, `geni crm tags`, `geni crm tasks`.\n `people` and `companies` also take `--filter`, a JSON array of column\n conditions, e.g. `--filter \'[{"field":"title","operator":"contains","value":"vp"},{"field":"companyEmployeeCount","operator":"gte","value":50}]\'` \u2014\n see `--help` for the field and operator lists (custom fields filter as\n `custom.<key>`).\n2. Read one record: `geni crm people get <id>`, `geni crm companies get <id>`,\n `geni crm cards get <id>`, `geni crm pipelines get <id>` (add `--board` for\n its cards), `geni crm tasks get <id>`.\n\n## Activities\n\nNotes, calls, emails, meetings, Slack and LinkedIn messages are activities, and\none activity links to every record it concerns (a call with Ada about the\nAcme deal links Ada, Acme, and the deal card). Someone sees an activity only\nwhen they can see every record it links.\n\n- `geni crm activities list <entityType> <id> [--kind call email]` lists a record\'s activities, newest first.\n- `geni crm activities log --json \'{"kind":"call","direction":"outbound","body":"Walked through the offer","links":[{"type":"person","id":"<id>"},{"type":"pipeline_card","id":"<id>"}]}\'`. A future `occurredAt` schedules a meeting or call.\n- `geni crm activities sync --json \'{...,"externalRef":"<Message-ID>"}\'` creates or updates the activity that `externalRef` names and merges its links, so re-syncing a mailbox never duplicates a message. A message a teammate already logged stays as they logged it; one logged on a record you can\'t see answers 409 `activity_not_shared`, which a sync treats as done.\n- Only an activity\'s author (or an admin) edits or deletes it. Notes (`geni crm notes`) and card touchpoints are the same activities seen through one record.\n\n## Files\n\nA record can carry files (a resume on a person, a contract on a card), up to\n25 MB each. `geni crm files upload person <id> ./resume.pdf --kind resume`\nattaches one; `geni crm files list <entityType> <id>` lists them;\n`geni crm files text <fileId>` prints a text file\'s contents and\n`geni crm files download <fileId>` prints a short-lived link to any file.\nSomeone sees a file only when they can see its record.\n\n## Custom fields and saved views\n\nCustom fields (`geni crm fields`) can be text, long text, number, currency\n(`{"amount":1200,"currency":"USD"}`), checkbox, date, date and time (ISO),\nsingle select, multi-select, status, URL, email, phone, or member (a\nmembership id). Write values through the record\'s `custom` object.\n\nSaved views (`geni crm views`) are named filters, sort, and columns for one\nrecord type\'s table or board, personal or shared with the workspace.\n\n## Duplicates, consent, and privacy\n\n- **Merge duplicates**: `geni crm merge people <keepId> <dupeId...>` (and `companies`). The kept record takes every link, contact, file, and history line, and fills its empty fields from the duplicates. It needs the owner or an admin.\n- **Before any outreach**, run `geni crm consent check <personId> --channel email` (or `phone`). Contact only the `reachable` values it returns, and nobody when `isAllowed` is false. Record a request with `geni crm consent do-not-contact <personId> --reason "..."` or `geni crm consent opt-out <contactPointId>`.\n- **Data requests**: `geni crm privacy export <personId>` returns everything held about them; `geni crm privacy erase <personId> --yes` deletes them for good, with anything merged into them.\n- **Credit splits** on a card: `geni crm credits set <cardId> --json \'{"credits":[{"membershipId":"<id>","role":"Recruiter","percent":60},{"membershipId":"<id>","role":"Account manager","percent":40}]}\'`.\n\n## Importing and syncing\n\n- **Import a CSV**: `geni crm import people leads.csv --dry-run` prints the suggested mapping (column to field, `custom.<key>` for a custom field) and the first rows that would fail. Then run it without `--dry-run`, optionally with `--map \'{...}\'`, `--list <listId>`, `--tag <tagId>`, and `--wait`. Rows match existing records by email, LinkedIn, or domain; a match only fills fields that are empty and never overwrites. `geni crm import status <importId>` shows counts and failed rows.\n- **Match addresses** before logging mail or meetings: `geni crm match a@x.com b@y.com` returns the person each address belongs to (any spelling, `+tags` ignored). Then log with `geni crm activities sync`.\n\n## History and triggers\n\nEvery change to a record is in its history: created, field changes (with the\nold and new value), stage and status moves, tags and lists, tasks, access, and\ndeletes. `geni crm history <entityType> <id>` prints one record\'s history,\nnewest first. `geni crm history feed [--after <cursor>]` reads the workspace\'s\nevents oldest first, and prints a cursor to pass back as `--after`.\n\nTo act when the CRM changes, build a workflow on a `general-input-crm` trigger\n(record created, field changed, card entered stage, tag added, task created,\nfile attached).\nIts payload is one history event: `entityType`, `entityId`, `kind`, `field`,\n`fromLabel`/`toLabel`, and `details` (stage ids for a stage move, the tag or\nlist id for a membership).\n\n## Writing\n\nCreates and updates take the record body as `--json`; the server validates it,\nso a 400 means the body was wrong (read the error and fix the JSON). Run\n`geni crm <noun> <verb> --help` to see the expected fields.\n\n- **Create / update records** (JSON body):\n - `geni crm people create --json \'[{"fullName":"Ada Lovelace","companyName":"Acme","email":"ada@acme.com"}]\'` (batch, find-or-create, deduped). `companies create` mirrors it. A `"created": false` result matched an existing record by identity key (email/LinkedIn; domain for companies) \u2014 the CLI warns on stderr when the matched name differs, e.g. a shared inbox collapsing distinct people.\n - `geni crm people update --json \'[{"id":"<id>","title":"VP Eng","linkedinUrl":"https://\u2026"}]\'` (batch, ids inline). `companies update` mirrors it. Writes take the create field names (`title`, `linkedinUrl`), not the read names you see on `get` (`currentTitle`, `primaryLinkedinUrl`); unknown keys are rejected with a 400 naming them.\n - `geni crm lists create --json \'{"name":"Q3 ICP","entityType":"company"}\'`, `geni crm tags create --json \'{"name":"Customer","entityType":"company"}\'`, `geni crm tasks create --json \'{"title":"Follow up","entity":{"type":"person","id":"<id>"}}\'`, `geni crm cards create <pipelineId> --json \'{"title":"Acme renewal","amount":50000}\'`.\n- **Notes** take the text directly: `geni crm notes create person <id> --body "Met at the conference"`.\n- **State-change verbs** (no JSON, just flags/ids):\n - Lists/tags: `geni crm lists add <listId> <entityIds...>`, `geni crm tags assign <tagId> <entityIds...>` (and `remove` / `unassign`).\n - Tasks: `geni crm tasks done <id>` (also `dismiss`, `reopen`, `delete`).\n - Cards: `geni crm cards move <id> --stage <stageId>`, `geni crm cards status <id> --status won|lost|open [--reason "..."]`, `geni crm cards archive <id>`, `geni crm cards add-contact <cardId> <personId>`.\n- **Access** (owner, team, and who sees it; the owner or an admin): `geni crm access person <id> --json \'{"ownerMembershipId":"<membershipId>","teamId":null,"visibility":"private"}\'`. `company` and `pipeline_card` work the same; `visibility` is `private`, `team` (needs `teamId`), or `workspace`. Deleting a record also needs this access.\n- **Deals/touchpoints**: `geni crm touchpoints log <cardId> --json \'{"channel":"call","occurredAt":"2026-07-01T15:00:00Z","summary":"Pricing call"}\'`.\n- **Delete** is `<noun> delete <id...>` (people/companies/lists/cards take multiple ids; most others take one). `geni crm cards delete <ids...>` is permanent \u2014 it takes the card\'s contacts, activity, notes, touchpoints, tasks, tags, and list entries with it, and reports which ids it actually matched. Prefer `cards archive <id>` when the record should survive.\n\nCard edits, moves, and status changes use optimistic concurrency. Pass\n`--expected-updated-at <ts>` to enforce it; omit it and the CLI reads the card\'s\ncurrent version first (last-write-wins), which is usually what you want from a\nscript. With the token, a stale card fails with an HTTP 409 conflict; re-read\nthe card and retry.\n\n## Output\n\nList commands print a table; pass `--json` to parse. `get` commands and all\nwrites print the affected record as JSON (state-change verbs print a short\nconfirmation). The single-record `get` commands take `--field <path>` to pull\none value, e.g. `geni crm cards get <id> --field status`.\n\nJSON shapes vary by verb: searches print `{"results": [...]}` (people/companies\nadd `nextCursor`), `people get` prints `{person, company, contactPoints, ...}`,\nand bare noun lists wrap in a named key (e.g. `{"lists": [...]}`) \u2014 check before\npiping into a parser.\n\n## Enrichment\n\nFind and verify contact info for people through the workspace\'s configured\nprovider waterfalls. This is **paid** (it spends credits per provider call), so\nevery verb requires `--yes` and a run is capped at 25 people. Only enrich when\nthe user has asked you to. Found emails and numbers save onto the person\'s\ncontact points automatically.\n\n- See what\'s wired first: `geni crm waterfalls` lists the provider chain for each\n capability (email-enrichment, email-validation, phone-enrichment). An empty\n chain finds nothing and spends nothing.\n- `geni crm enrich emails <personIds...> --yes` finds work emails;\n `geni crm enrich phones <personIds...> --yes` finds mobile numbers (both take\n `--retry-unverified`).\n- `geni crm enrich validate <personIds...> --yes` checks deliverability \u2014 run it\n before any outreach so nothing goes to a bad address.\n\n## Composing with the rest of geni\n\nThe CRM is the source of who and what; connected credentials are how you act on\nthe outside world. To add contact info, prefer `geni crm enrich` (it runs the\nworkspace\'s provider waterfalls and saves results). For anything else, pull\npeople or a company from the CRM, reach a service through `geni exec bash` (send\nan email, update an external system), and write the result back to the CRM (a\nnote, a task, a touchpoint, a moved card). Credit each tool naturally in your\nsummary.\n\n## Exit codes worth knowing\n\n- `0` success.\n- `4` not found (bad id, or it is not in the active workspace).\n- `5` forbidden (the workspace lacks CRM access, or the record is out of scope).\n- `9` stale write (a card changed since you read it; re-read and retry, or pass `--expected-updated-at`).\n- `78` session expired. Tell the user to run `geni login`.\n';
30462
30613
 
30463
30614
  // src/lib/skills.ts
30464
30615
  var GENI_SKILL_NAME = "geni";
@@ -30938,7 +31089,7 @@ function printJsonOrField(record, field) {
30938
31089
  }
30939
31090
 
30940
31091
  // src/lib/leadFilterArg.ts
30941
- import { z as z48 } from "zod";
31092
+ import { z as z50 } from "zod";
30942
31093
  var FILTER_EXAMPLE = `--filter '[{"field":"title","operator":"contains","value":"vp"}]'`;
30943
31094
  function parseLeadFilterArg(raw) {
30944
31095
  let value;
@@ -30948,7 +31099,7 @@ function parseLeadFilterArg(raw) {
30948
31099
  printError(`Invalid --filter: not valid JSON. Example: ${FILTER_EXAMPLE}`);
30949
31100
  exit(ExitCode.InternalError);
30950
31101
  }
30951
- const parsed = z48.array(LeadFilterConditionSchema).safeParse(value);
31102
+ const parsed = z50.array(LeadFilterConditionSchema).safeParse(value);
30952
31103
  if (!parsed.success) {
30953
31104
  const issue = parsed.error.issues[0];
30954
31105
  const path = issue?.path.map(String).join(".");
@@ -32250,6 +32401,26 @@ function registerCrmEnrich(parent) {
32250
32401
  });
32251
32402
  }
32252
32403
 
32404
+ // src/commands/crm/access.ts
32405
+ function registerCrmAccess(parent) {
32406
+ parent.command("access").argument("<entityType>", `${CRM_ENTITY_TYPE_WORDS}.`).argument("<id>", "Record id.").description(
32407
+ "Set a record's owner, team, and visibility. --json: { ownerMembershipId, teamId, visibility: private|team|workspace } (ownerMembershipId and teamId may be null; a pipeline_card may have no owner)."
32408
+ ).requiredOption("--json <body>", "JSON access settings.").action(async (entityType, id, opts) => {
32409
+ const parsedType = crmEntityTypeOrExit(entityType);
32410
+ try {
32411
+ printJson(
32412
+ await crmService.setRecordAccess(
32413
+ parsedType,
32414
+ id,
32415
+ parseJsonArg(opts.json)
32416
+ )
32417
+ );
32418
+ } catch (error) {
32419
+ exitOnApiError(error);
32420
+ }
32421
+ });
32422
+ }
32423
+
32253
32424
  // src/commands/crm/history.ts
32254
32425
  function describeChange(event) {
32255
32426
  const field = event.field ? `${event.field} ` : "";
@@ -32899,6 +33070,7 @@ function registerCrmCommands(program2) {
32899
33070
  registerCrmContactPoints(crm);
32900
33071
  registerCrmWaterfalls(crm);
32901
33072
  registerCrmEnrich(crm);
33073
+ registerCrmAccess(crm);
32902
33074
  crm.action(() => crm.help());
32903
33075
  crm.enablePositionalOptions();
32904
33076
  for (const noun of crm.commands) noun.enablePositionalOptions();
@@ -33721,10 +33893,10 @@ function printReport(checks) {
33721
33893
  import { spawn as spawn3, execFileSync } from "child_process";
33722
33894
  import { realpathSync } from "fs";
33723
33895
  import { sep as sep2 } from "path";
33724
- import { z as z49 } from "zod";
33896
+ import { z as z51 } from "zod";
33725
33897
  import semver from "semver";
33726
33898
  var PACKAGE_NAME = "@general-input/cli";
33727
- var registryLatestSchema = z49.object({ version: z49.string() });
33899
+ var registryLatestSchema = z51.object({ version: z51.string() });
33728
33900
  function registerUpgradeCommand(program2) {
33729
33901
  program2.command("upgrade").description(
33730
33902
  "Upgrade geni to the latest published version. Checks the npm registry and reinstalls via `npm install -g` when this install is npm-managed. Use --check to only report whether a newer version exists."