@general-input/cli 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -2217,17 +2217,17 @@ var require_cipherModes = __commonJS({
2217
2217
  }
2218
2218
  };
2219
2219
  modes.gcm.prototype.tableMultiply = function(x) {
2220
- var z11 = [0, 0, 0, 0];
2220
+ var z53 = [0, 0, 0, 0];
2221
2221
  for (var i = 0; i < 32; ++i) {
2222
2222
  var idx = i / 8 | 0;
2223
2223
  var x_i = x[idx] >>> (7 - i % 8) * 4 & 15;
2224
2224
  var ah = this._m[i][x_i];
2225
- z11[0] ^= ah[0];
2226
- z11[1] ^= ah[1];
2227
- z11[2] ^= ah[2];
2228
- z11[3] ^= ah[3];
2225
+ z53[0] ^= ah[0];
2226
+ z53[1] ^= ah[1];
2227
+ z53[2] ^= ah[2];
2228
+ z53[3] ^= ah[3];
2229
2229
  }
2230
- return z11;
2230
+ return z53;
2231
2231
  };
2232
2232
  modes.gcm.prototype.ghash = function(h, y, x) {
2233
2233
  y[0] ^= x[0];
@@ -5972,26 +5972,26 @@ var require_jsbn = __commonJS({
5972
5972
  function bnpIsEven() {
5973
5973
  return (this.t > 0 ? this.data[0] & 1 : this.s) == 0;
5974
5974
  }
5975
- function bnpExp(e, z11) {
5975
+ function bnpExp(e, z53) {
5976
5976
  if (e > 4294967295 || e < 1) return BigInteger.ONE;
5977
- var r = nbi(), r2 = nbi(), g = z11.convert(this), i = nbits(e) - 1;
5977
+ var r = nbi(), r2 = nbi(), g = z53.convert(this), i = nbits(e) - 1;
5978
5978
  g.copyTo(r);
5979
5979
  while (--i >= 0) {
5980
- z11.sqrTo(r, r2);
5981
- if ((e & 1 << i) > 0) z11.mulTo(r2, g, r);
5980
+ z53.sqrTo(r, r2);
5981
+ if ((e & 1 << i) > 0) z53.mulTo(r2, g, r);
5982
5982
  else {
5983
5983
  var t = r;
5984
5984
  r = r2;
5985
5985
  r2 = t;
5986
5986
  }
5987
5987
  }
5988
- return z11.revert(r);
5988
+ return z53.revert(r);
5989
5989
  }
5990
5990
  function bnModPowInt(e, m) {
5991
- var z11;
5992
- if (e < 256 || m.isEven()) z11 = new Classic(m);
5993
- else z11 = new Montgomery(m);
5994
- return this.exp(e, z11);
5991
+ var z53;
5992
+ if (e < 256 || m.isEven()) z53 = new Classic(m);
5993
+ else z53 = new Montgomery(m);
5994
+ return this.exp(e, z53);
5995
5995
  }
5996
5996
  BigInteger.prototype.copyTo = bnpCopyTo;
5997
5997
  BigInteger.prototype.fromInt = bnpFromInt;
@@ -6049,13 +6049,13 @@ var require_jsbn = __commonJS({
6049
6049
  if (this.signum() == 0 || b < 2 || b > 36) return "0";
6050
6050
  var cs = this.chunkSize(b);
6051
6051
  var a = Math.pow(b, cs);
6052
- var d = nbv(a), y = nbi(), z11 = nbi(), r = "";
6053
- this.divRemTo(d, y, z11);
6052
+ var d = nbv(a), y = nbi(), z53 = nbi(), r = "";
6053
+ this.divRemTo(d, y, z53);
6054
6054
  while (y.signum() > 0) {
6055
- r = (a + z11.intValue()).toString(b).substr(1) + r;
6056
- y.divRemTo(d, y, z11);
6055
+ r = (a + z53.intValue()).toString(b).substr(1) + r;
6056
+ y.divRemTo(d, y, z53);
6057
6057
  }
6058
- return z11.intValue().toString(b) + r;
6058
+ return z53.intValue().toString(b) + r;
6059
6059
  }
6060
6060
  function bnpFromRadix(s, b) {
6061
6061
  this.fromInt(0);
@@ -6428,7 +6428,7 @@ var require_jsbn = __commonJS({
6428
6428
  Barrett.prototype.mulTo = barrettMulTo;
6429
6429
  Barrett.prototype.sqrTo = barrettSqrTo;
6430
6430
  function bnModPow(e, m) {
6431
- var i = e.bitLength(), k, r = nbv(1), z11;
6431
+ var i = e.bitLength(), k, r = nbv(1), z53;
6432
6432
  if (i <= 0) return r;
6433
6433
  else if (i < 18) k = 1;
6434
6434
  else if (i < 48) k = 3;
@@ -6436,19 +6436,19 @@ var require_jsbn = __commonJS({
6436
6436
  else if (i < 768) k = 5;
6437
6437
  else k = 6;
6438
6438
  if (i < 8)
6439
- z11 = new Classic(m);
6439
+ z53 = new Classic(m);
6440
6440
  else if (m.isEven())
6441
- z11 = new Barrett(m);
6441
+ z53 = new Barrett(m);
6442
6442
  else
6443
- z11 = new Montgomery(m);
6443
+ z53 = new Montgomery(m);
6444
6444
  var g = new Array(), n = 3, k1 = k - 1, km = (1 << k) - 1;
6445
- g[1] = z11.convert(this);
6445
+ g[1] = z53.convert(this);
6446
6446
  if (k > 1) {
6447
6447
  var g2 = nbi();
6448
- z11.sqrTo(g[1], g2);
6448
+ z53.sqrTo(g[1], g2);
6449
6449
  while (n <= km) {
6450
6450
  g[n] = nbi();
6451
- z11.mulTo(g2, g[n - 2], g[n]);
6451
+ z53.mulTo(g2, g[n - 2], g[n]);
6452
6452
  n += 2;
6453
6453
  }
6454
6454
  }
@@ -6474,20 +6474,20 @@ var require_jsbn = __commonJS({
6474
6474
  is1 = false;
6475
6475
  } else {
6476
6476
  while (n > 1) {
6477
- z11.sqrTo(r, r2);
6478
- z11.sqrTo(r2, r);
6477
+ z53.sqrTo(r, r2);
6478
+ z53.sqrTo(r2, r);
6479
6479
  n -= 2;
6480
6480
  }
6481
- if (n > 0) z11.sqrTo(r, r2);
6481
+ if (n > 0) z53.sqrTo(r, r2);
6482
6482
  else {
6483
6483
  t = r;
6484
6484
  r = r2;
6485
6485
  r2 = t;
6486
6486
  }
6487
- z11.mulTo(r2, g[w], r);
6487
+ z53.mulTo(r2, g[w], r);
6488
6488
  }
6489
6489
  while (j >= 0 && (e.data[j] & 1 << i) == 0) {
6490
- z11.sqrTo(r, r2);
6490
+ z53.sqrTo(r, r2);
6491
6491
  t = r;
6492
6492
  r = r2;
6493
6493
  r2 = t;
@@ -6497,7 +6497,7 @@ var require_jsbn = __commonJS({
6497
6497
  }
6498
6498
  }
6499
6499
  }
6500
- return z11.revert(r);
6500
+ return z53.revert(r);
6501
6501
  }
6502
6502
  function bnGCD(a) {
6503
6503
  var x = this.s < 0 ? this.negate() : this.clone();
@@ -18288,7 +18288,7 @@ import chalk4 from "chalk";
18288
18288
  // package.json
18289
18289
  var package_default = {
18290
18290
  name: "@general-input/cli",
18291
- version: "0.9.0",
18291
+ version: "0.11.0",
18292
18292
  type: "module",
18293
18293
  description: "The agent-facing CLI for General Input. Authenticate, manage workflows, run bash with operator credentials injected by the cloud.",
18294
18294
  license: "SEE LICENSE IN LICENSE",
@@ -18332,6 +18332,7 @@ var package_default = {
18332
18332
  "@clack/prompts": "^0.7.0",
18333
18333
  chalk: "^5.3.0",
18334
18334
  commander: "^12.1.0",
18335
+ semver: "^7.8.0",
18335
18336
  tar: "^7.4.3",
18336
18337
  zod: "^4.3.6"
18337
18338
  },
@@ -18343,6 +18344,7 @@ var package_default = {
18343
18344
  "@packages/eslint-config": "workspace:*",
18344
18345
  "@packages/typescript-config": "workspace:*",
18345
18346
  "@types/node": "^24.12.2",
18347
+ "@types/semver": "^7.7.1",
18346
18348
  "@types/tar": "^6.1.13",
18347
18349
  eslint: "^9.39.4",
18348
18350
  tsup: "^8.3.5",
@@ -19285,7 +19287,11 @@ var CrmService = class {
19285
19287
  async searchPeople(args) {
19286
19288
  return (await this.crm()).searchPeople({
19287
19289
  query: args.query,
19288
- filters: { listId: args.listId, companyId: args.companyId },
19290
+ filters: {
19291
+ listId: args.listId,
19292
+ companyId: args.companyId,
19293
+ conditions: args.conditions
19294
+ },
19289
19295
  limit: args.limit
19290
19296
  });
19291
19297
  }
@@ -19305,7 +19311,7 @@ var CrmService = class {
19305
19311
  async searchCompanies(args) {
19306
19312
  return (await this.crm()).searchCompanies({
19307
19313
  query: args.query,
19308
- filters: { listId: args.listId },
19314
+ filters: { listId: args.listId, conditions: args.conditions },
19309
19315
  limit: args.limit
19310
19316
  });
19311
19317
  }
@@ -23564,7 +23570,7 @@ import {
23564
23570
  var geni_default = "---\nname: geni\ndescription: Use the operator'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 operator'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 teammate \u2014 the integration specialist 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.\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\n## Connecting a missing credential\n\n`geni credential connect <service>` opens the integration's\ndashboard page in the operator's browser. Tell the operator 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, send-email) without `--cred`.\n\n## --reason is per-call\n\nEvery `geni exec bash --cred ...` requires `--reason`. It lands in\nthe operator'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 and apps)\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 three\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), or an `app` (an interactive React mini-app\nwith server-side handlers, like a dashboard or internal tool). An app is\nnot a workflow, so the shared lifecycle lives under `geni resource` and\nthe 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 the\ngeni chat, just on the user's machine with your brain driving it. Same\nloop for all three types; apps add a build step and handler tools (see\n\"Building apps\" below).\n\n**Read the spec first.** `geni resource spec code` (or `agent`) prints\nthe full contract: required files, the runtime API, allowed and\nforbidden patterns. Don't write a single file before reading it.\n\nThe loop:\n\n1. `geni resource create --type code --name \"Daily Digest\"`: creates the\n resource in the cloud and scaffolds its files into the current\n directory, with a `.geni-resource.json` marker so later commands here\n 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 + TypeScript\n check. Exit 9 means invalid; fix what it reports and re-run. A green\n validate is the compile gate.\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`.\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 --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.\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\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\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`; read the contract with `geni resource spec app`. The shared\ncommands work the same (validate, config set for credential slots,\npublish), 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. You can't preview the UI from the CLI,\n so drive correctness through handlers and the build.\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\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\nWhen it works, tell the user it's in their dashboard, where they can see\nruns and turn its triggers on. Commands accept the workflow id as a\npositional or infer it from the marker in the current directory.\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 operator.\n- `78` \u2014 session expired. Tell the operator to run `geni login`.\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 workflow files before reading `geni resource spec\n<type>`. Don't try to compile or `npm install` them locally; let\n `geni resource validate` be the gate.\n- Use `--json` on list/get commands when you're going to parse the\n output. Table output is for humans.\n";
23565
23571
 
23566
23572
  // src/skills/geni-crm.md
23567
- var geni_crm_default = '---\nname: geni-crm\ndescription: Read and write the operator\'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), draft or review email sequences, 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, enrichment, sequence drafts, and the workspace\'s skill playbooks.\n---\n\n# geni crm\n\n`geni crm` reads and writes the operator\'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`, `sequences`,\n`skills`, `waterfalls`, `enrich`, plus a top-level `search`.\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|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`.\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## 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","type":"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 take multiple ids; most others take one).\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 operator 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 sequencing so you don\'t send to a bad address.\n\n## Workspace skills (read these before doing the job yourself)\n\n`geni crm skills` lists the workspace\'s skill playbooks \u2014 the canned prompts\nthe in-app agent runs for jobs like enriching a record, drafting a sequence, or\nbuilding a list. `geni crm skills get <id>` prints one; the org\'s customized\nvariant is returned when it exists, so it reflects how _this_ workspace wants\nthe job done. Before doing one of those jobs from the CLI (e.g. drafting a\nsequence, filling in a person, compiling a list), fetch the matching skill and\nfollow its instructions \u2014 tone, structure, and rules included.\n\n## Sequences (drafts only \u2014 the dashboard sends)\n\nPer-person email sequences. The CLI reads all of them and creates, edits, and\ndeletes **drafts**; it can never queue, unqueue, or send \u2014 the server refuses,\nby design. When a draft is ready, tell the operator to review and queue it from\nthe person\'s page in the dashboard.\n\n- `geni crm sequences [--person <id>] [--status draft|queued|sending|completed|stopped|replied]` lists; `get <id>` shows the steps.\n- Draft: `geni crm sequences create --person <id> --json \'{"steps":[{"subject":"\u2026","body":"\u2026","waitDays":0},{"body":"\u2026","waitDays":3}]}\'`. The first step carries the subject; follow-ups reply in-thread after `waitDays` with no reply.\n- `geni crm sequences update <id> --json \'\u2026\'` replaces a draft wholesale; `delete <id>` removes a draft.\n- Before drafting, read the workspace\'s playbook: `geni crm skills get draft-sequence-person`. Consider `geni crm enrich validate` on the recipient first so the operator isn\'t queueing mail to a dead 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 operator to run `geni login`.\n';
23573
+ var geni_crm_default = '---\nname: geni-crm\ndescription: Read and write the operator\'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), draft or review email sequences, 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, enrichment, sequence drafts, and the workspace\'s skill playbooks.\n---\n\n# geni crm\n\n`geni crm` reads and writes the operator\'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`, `sequences`,\n`skills`, `waterfalls`, `enrich`, plus a top-level `search`.\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|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":"seniority","operator":"any_of","values":["vp"]},{"field":"icpScore","operator":"gte","value":70}]\'` \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## 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","type":"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 take multiple ids; most others take one).\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 operator 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 sequencing so you don\'t send to a bad address.\n\n## Workspace skills (read these before doing the job yourself)\n\n`geni crm skills` lists the workspace\'s skill playbooks \u2014 the canned prompts\nthe in-app agent runs for jobs like enriching a record, drafting a sequence, or\nbuilding a list. `geni crm skills get <id>` prints one; the org\'s customized\nvariant is returned when it exists, so it reflects how _this_ workspace wants\nthe job done. Before doing one of those jobs from the CLI (e.g. drafting a\nsequence, filling in a person, compiling a list), fetch the matching skill and\nfollow its instructions \u2014 tone, structure, and rules included.\n\n## Sequences (drafts only \u2014 the dashboard sends)\n\nPer-person email sequences. The CLI reads all of them and creates, edits, and\ndeletes **drafts**; it can never queue, unqueue, or send \u2014 the server refuses,\nby design. When a draft is ready, tell the operator to review and queue it from\nthe person\'s page in the dashboard.\n\n- `geni crm sequences [--person <id>] [--status draft|queued|sending|completed|stopped|replied]` lists; `get <id>` shows the steps.\n- Draft: `geni crm sequences create --person <id> --json \'{"steps":[{"subject":"\u2026","body":"\u2026","waitDays":0},{"body":"\u2026","waitDays":3}]}\'`. The first step carries the subject; follow-ups reply in-thread after `waitDays` with no reply.\n- `geni crm sequences update <id> --json \'\u2026\'` replaces a draft wholesale; `delete <id>` removes a draft.\n- Before drafting, read the workspace\'s playbook: `geni crm skills get draft-sequence-person`. Consider `geni crm enrich validate` on the recipient first so the operator isn\'t queueing mail to a dead 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 operator to run `geni login`.\n';
23568
23574
 
23569
23575
  // src/lib/skills.ts
23570
23576
  var GENI_SKILL_NAME = "geni";
@@ -23909,6 +23915,2202 @@ function parseJsonObjectArg(raw) {
23909
23915
  return value;
23910
23916
  }
23911
23917
 
23918
+ // src/lib/leadFilterArg.ts
23919
+ import { z as z51 } from "zod";
23920
+
23921
+ // ../../packages/crm-api/dist/types/enums.js
23922
+ import { z as z11 } from "zod";
23923
+ var LeadSortDirectionSchema = z11.enum(["asc", "desc"]);
23924
+ var ContactPointKindSchema = z11.enum([
23925
+ "work_email",
23926
+ "personal_email",
23927
+ "mobile",
23928
+ "phone"
23929
+ ]);
23930
+ var ContactPointStatusSchema = z11.enum([
23931
+ "verified",
23932
+ "unverified",
23933
+ "unavailable",
23934
+ "bounced"
23935
+ ]);
23936
+ var EnrichmentOutcomeSchema = z11.enum([
23937
+ "matched",
23938
+ "no_match",
23939
+ "no_contact",
23940
+ // A validator answered without a definitive verdict — the next one ran.
23941
+ "inconclusive",
23942
+ "error"
23943
+ ]);
23944
+ var ReachabilitySchema = z11.enum([
23945
+ "both",
23946
+ "email_only",
23947
+ "mobile_only",
23948
+ "none"
23949
+ ]);
23950
+ var OutreachStatusSchema = z11.enum([
23951
+ "none",
23952
+ "queued",
23953
+ "contacted",
23954
+ "replied",
23955
+ "bounced",
23956
+ "unsubscribed"
23957
+ ]);
23958
+
23959
+ // ../../packages/crm-api/dist/types/concurrency.js
23960
+ import { z as z12 } from "zod";
23961
+ var ExpectedUpdatedAtSchema = z12.object({
23962
+ expectedUpdatedAt: z12.string()
23963
+ });
23964
+
23965
+ // ../../packages/crm-api/dist/types/subject.js
23966
+ import { z as z13 } from "zod";
23967
+ var CrmSubjectTypeSchema = z13.enum([
23968
+ "person",
23969
+ "company",
23970
+ "list",
23971
+ "conversation",
23972
+ "pipeline",
23973
+ "card"
23974
+ ]);
23975
+
23976
+ // ../../packages/crm-api/dist/types/company.js
23977
+ import { z as z14 } from "zod";
23978
+ var CompanyTypeSchema = z14.enum([
23979
+ "public",
23980
+ "private",
23981
+ "nonprofit",
23982
+ "government",
23983
+ "education",
23984
+ "other"
23985
+ ]);
23986
+
23987
+ // ../../packages/crm-api/dist/types/customField.js
23988
+ import { z as z16 } from "zod";
23989
+
23990
+ // ../../packages/crm-api/dist/types/tag.js
23991
+ import { z as z15 } from "zod";
23992
+ var TagEntityTypeSchema = z15.enum(["person", "company"]);
23993
+ var TagColorSchema = z15.enum([
23994
+ "stone",
23995
+ "charcoal",
23996
+ "red",
23997
+ "crimson",
23998
+ "maroon",
23999
+ "rose",
24000
+ "pink",
24001
+ "fuchsia",
24002
+ "orange",
24003
+ "bronze",
24004
+ "brown",
24005
+ "amber",
24006
+ "gold",
24007
+ "yellow",
24008
+ "lime",
24009
+ "olive",
24010
+ "green",
24011
+ "laurel",
24012
+ "forest",
24013
+ "emerald",
24014
+ "teal",
24015
+ "cyan",
24016
+ "sky",
24017
+ "blue",
24018
+ "navy",
24019
+ "indigo",
24020
+ "violet",
24021
+ "purple",
24022
+ "plum",
24023
+ "tyrian"
24024
+ ]);
24025
+ var CreateTagRequestSchema = z15.object({
24026
+ name: z15.string().min(1).max(100),
24027
+ color: TagColorSchema.default("stone"),
24028
+ entityType: TagEntityTypeSchema
24029
+ });
24030
+ var UpdateTagRequestSchema = z15.object({
24031
+ name: z15.string().min(1).max(100).optional(),
24032
+ color: TagColorSchema.optional()
24033
+ }).refine((req) => req.name !== void 0 || req.color !== void 0, {
24034
+ message: "Nothing to update"
24035
+ });
24036
+ var TagEntitiesRequestSchema = z15.object({
24037
+ entityIds: z15.array(z15.uuid()).min(1).max(1e3)
24038
+ });
24039
+
24040
+ // ../../packages/crm-api/dist/types/customField.js
24041
+ var CustomFieldTypeSchema = z16.enum([
24042
+ "text",
24043
+ "long_text",
24044
+ "number",
24045
+ "boolean",
24046
+ "date",
24047
+ "single_select",
24048
+ "multi_select",
24049
+ "url"
24050
+ ]);
24051
+ var CustomFieldEntityTypeSchema = z16.enum(["person", "company", "card"]);
24052
+ var CustomFieldOptionSchema = z16.object({
24053
+ value: z16.string().min(1).max(120),
24054
+ label: z16.string().min(1).max(120),
24055
+ color: TagColorSchema.optional()
24056
+ });
24057
+ var CustomFieldOptionInputSchema = z16.object({
24058
+ value: z16.string().max(120).optional(),
24059
+ label: z16.string().min(1).max(120),
24060
+ color: TagColorSchema.optional()
24061
+ });
24062
+ var CreateCustomFieldRequestSchema = z16.object({
24063
+ entityType: CustomFieldEntityTypeSchema,
24064
+ scopeId: z16.uuid().nullish(),
24065
+ label: z16.string().min(1).max(80),
24066
+ fieldType: CustomFieldTypeSchema,
24067
+ options: z16.array(CustomFieldOptionInputSchema).max(100).optional(),
24068
+ isRequired: z16.boolean().optional(),
24069
+ helpText: z16.string().max(200).nullish(),
24070
+ description: z16.string().max(1e3).nullish()
24071
+ }).refine((req) => req.entityType !== "card" || !!req.scopeId, {
24072
+ message: "Card custom fields require a pipeline scope"
24073
+ });
24074
+ var UpdateCustomFieldRequestSchema = z16.object({
24075
+ label: z16.string().min(1).max(80).optional(),
24076
+ options: z16.array(CustomFieldOptionInputSchema).max(100).optional(),
24077
+ isRequired: z16.boolean().optional(),
24078
+ helpText: z16.string().max(200).nullish(),
24079
+ description: z16.string().max(1e3).nullish(),
24080
+ position: z16.number().int().min(0).optional()
24081
+ }).refine((req) => Object.keys(req).length > 0, {
24082
+ message: "Nothing to update"
24083
+ });
24084
+ var ReorderCustomFieldsRequestSchema = z16.object({
24085
+ orderedIds: z16.array(z16.uuid()).min(1)
24086
+ });
24087
+ var CustomFieldValuesSchema = z16.record(z16.string(), z16.unknown());
24088
+
24089
+ // ../../packages/crm-api/dist/types/list.js
24090
+ import { z as z17 } from "zod";
24091
+ var ListTypeSchema = z17.enum(["person", "company"]);
24092
+ var ListSearchSortSchema = z17.enum([
24093
+ "relevance",
24094
+ "recent",
24095
+ "updated",
24096
+ "name",
24097
+ "members"
24098
+ ]);
24099
+ var ListSearchFiltersSchema = z17.object({
24100
+ type: ListTypeSchema.optional()
24101
+ });
24102
+ var ListSearchRequestSchema = z17.object({
24103
+ query: z17.string().optional(),
24104
+ filters: ListSearchFiltersSchema.optional(),
24105
+ sort: ListSearchSortSchema.default("relevance"),
24106
+ // Direction for the column sort; omitted falls back to the sort's default.
24107
+ direction: LeadSortDirectionSchema.optional(),
24108
+ cursor: z17.string().nullable().optional(),
24109
+ limit: z17.number().int().min(1).max(100).default(25)
24110
+ });
24111
+ var CreateListRequestSchema = z17.object({
24112
+ name: z17.string().min(1).max(200),
24113
+ purpose: z17.string().max(2e3).nullish(),
24114
+ type: ListTypeSchema
24115
+ });
24116
+ var UpdateListRequestSchema = z17.object({
24117
+ name: z17.string().min(1).max(200).optional(),
24118
+ purpose: z17.string().max(2e3).nullable().optional()
24119
+ }).refine((req) => req.name !== void 0 || req.purpose !== void 0, {
24120
+ message: "Nothing to update"
24121
+ });
24122
+ var AddListMembersRequestSchema = z17.object({
24123
+ entityIds: z17.array(z17.uuid()).min(1).max(1e3)
24124
+ });
24125
+ var DeleteListsRequestSchema = z17.object({
24126
+ ids: z17.array(z17.uuid()).min(1).max(100)
24127
+ });
24128
+
24129
+ // ../../packages/crm-api/dist/types/pipeline.js
24130
+ import { z as z18 } from "zod";
24131
+ var PipelineKindSchema = z18.enum(["sales", "recruiting", "custom"]);
24132
+ var PipelineTemplateKindSchema = z18.enum(["sales", "recruiting"]);
24133
+ var StagePhaseSchema = z18.enum(["acquisition", "fulfillment"]);
24134
+ var BallInCourtSchema = z18.enum(["us", "them", "mutual"]);
24135
+ var StageOutcomeSchema = z18.enum(["won", "lost"]);
24136
+ var CardStatusSchema = z18.enum(["open", "won", "lost"]);
24137
+ var CardActorKindSchema = z18.enum([
24138
+ "user",
24139
+ "agent",
24140
+ "automation",
24141
+ "system"
24142
+ ]);
24143
+ var CardEventKindSchema = z18.enum([
24144
+ "created",
24145
+ "stage_changed",
24146
+ "field_changed",
24147
+ "status_changed",
24148
+ "contact_added",
24149
+ "contact_removed",
24150
+ "archived",
24151
+ // Lifecycle of tasks linked to the card (to_label carries the task title).
24152
+ "task_created",
24153
+ "task_completed",
24154
+ "task_reopened",
24155
+ "task_dismissed",
24156
+ "task_deleted"
24157
+ ]);
24158
+ var CardEventFieldSchema = z18.enum([
24159
+ "title",
24160
+ "amount",
24161
+ "currency",
24162
+ "owner",
24163
+ "company",
24164
+ "close_date",
24165
+ "attribution"
24166
+ ]);
24167
+ var CreatePipelineFromTemplateRequestSchema = z18.object({
24168
+ kind: PipelineTemplateKindSchema,
24169
+ name: z18.string().min(1).max(200).optional()
24170
+ });
24171
+ var StageInputSchema = z18.object({
24172
+ name: z18.string().min(1).max(80),
24173
+ phase: StagePhaseSchema.default("acquisition"),
24174
+ ballInCourt: BallInCourtSchema.default("us"),
24175
+ isCommitted: z18.boolean().default(false),
24176
+ outcome: StageOutcomeSchema.nullish(),
24177
+ weight: z18.number().int().min(0).max(100).default(0),
24178
+ color: TagColorSchema.default("stone")
24179
+ });
24180
+ var CreatePipelineRequestSchema = z18.object({
24181
+ name: z18.string().min(1).max(200),
24182
+ cardLabel: z18.string().min(1).max(60),
24183
+ stages: z18.array(StageInputSchema).min(1).max(20)
24184
+ });
24185
+ var UpdatePipelineRequestSchema = z18.object({
24186
+ name: z18.string().min(1).max(200).optional(),
24187
+ cardLabel: z18.string().min(1).max(60).optional(),
24188
+ archived: z18.boolean().optional()
24189
+ }).refine((req) => req.name !== void 0 || req.cardLabel !== void 0 || req.archived !== void 0, { message: "Nothing to update" });
24190
+ var AddStageRequestSchema = StageInputSchema.extend({
24191
+ // 0-indexed insert position; appended when omitted.
24192
+ position: z18.number().int().min(0).optional()
24193
+ });
24194
+ var UpdateStageRequestSchema = z18.object({
24195
+ name: z18.string().min(1).max(80).optional(),
24196
+ phase: StagePhaseSchema.optional(),
24197
+ ballInCourt: BallInCourtSchema.optional(),
24198
+ isCommitted: z18.boolean().optional(),
24199
+ outcome: StageOutcomeSchema.nullable().optional(),
24200
+ weight: z18.number().int().min(0).max(100).optional(),
24201
+ color: TagColorSchema.optional()
24202
+ }).refine((req) => Object.keys(req).length > 0, {
24203
+ message: "Nothing to update"
24204
+ });
24205
+ var ReorderStagesRequestSchema = z18.object({
24206
+ stageIds: z18.array(z18.uuid()).min(1)
24207
+ });
24208
+ var CardPersonInputSchema = z18.object({
24209
+ personId: z18.uuid(),
24210
+ role: z18.string().max(120).nullish(),
24211
+ isPrimary: z18.boolean().default(false)
24212
+ });
24213
+ var CreateCardRequestSchema = z18.object({
24214
+ title: z18.string().min(1).max(200),
24215
+ // Defaults to the pipeline's first stage when omitted.
24216
+ stageId: z18.uuid().optional(),
24217
+ ownerMembershipId: z18.uuid().nullish(),
24218
+ primaryCompanyId: z18.uuid().nullish(),
24219
+ people: z18.array(CardPersonInputSchema).max(50).default([]),
24220
+ amount: z18.number().min(0).nullish(),
24221
+ currency: z18.string().max(8).nullish(),
24222
+ expectedCloseAt: z18.string().nullish(),
24223
+ attributionSourceId: z18.uuid().nullish()
24224
+ });
24225
+ var UpdateCardRequestSchema = z18.object({
24226
+ title: z18.string().min(1).max(200).optional(),
24227
+ ownerMembershipId: z18.uuid().nullable().optional(),
24228
+ primaryCompanyId: z18.uuid().nullable().optional(),
24229
+ amount: z18.number().min(0).nullable().optional(),
24230
+ currency: z18.string().max(8).nullable().optional(),
24231
+ expectedCloseAt: z18.string().nullable().optional(),
24232
+ attributionSourceId: z18.uuid().nullable().optional(),
24233
+ // Registry-defined custom fields; validated + merged server-side.
24234
+ custom: CustomFieldValuesSchema.optional()
24235
+ }).refine((req) => Object.keys(req).length > 0, {
24236
+ message: "Nothing to update"
24237
+ });
24238
+ var MoveCardRequestSchema = z18.object({
24239
+ toStageId: z18.uuid(),
24240
+ boardPosition: z18.number().optional()
24241
+ });
24242
+ var SetCardStatusRequestSchema = z18.object({
24243
+ status: CardStatusSchema,
24244
+ lostReason: z18.string().max(2e3).nullish()
24245
+ });
24246
+ var AddCardContactRequestSchema = z18.object({
24247
+ personId: z18.uuid()
24248
+ });
24249
+
24250
+ // ../../packages/crm-api/dist/types/attribution.js
24251
+ import { z as z19 } from "zod";
24252
+ var CreateAttributionSourceRequestSchema = z19.object({
24253
+ name: z19.string().min(1).max(100)
24254
+ });
24255
+ var UpdateAttributionSourceRequestSchema = z19.object({
24256
+ name: z19.string().min(1).max(100).optional(),
24257
+ isArchived: z19.boolean().optional()
24258
+ }).refine((req) => req.name !== void 0 || req.isArchived !== void 0, {
24259
+ message: "Nothing to update"
24260
+ });
24261
+ var ReorderAttributionSourcesRequestSchema = z19.object({
24262
+ orderedIds: z19.array(z19.uuid()).min(1)
24263
+ });
24264
+
24265
+ // ../../packages/crm-api/dist/types/note.js
24266
+ import { z as z20 } from "zod";
24267
+ var NoteEntityTypeSchema = z20.enum(["person", "company", "pipeline_card"]);
24268
+ var CreateNoteRequestSchema = z20.object({
24269
+ body: z20.string().min(1).max(1e4),
24270
+ // Stamped by the engine for agent writes — never user-supplied in the UI.
24271
+ draftedBy: z20.string().max(50).nullish()
24272
+ });
24273
+ var UpdateNoteRequestSchema = z20.object({
24274
+ body: z20.string().min(1).max(1e4)
24275
+ });
24276
+
24277
+ // ../../packages/crm-api/dist/types/task.js
24278
+ import { z as z21 } from "zod";
24279
+ var TaskStatusSchema = z21.enum(["open", "done", "dismissed"]);
24280
+ var TaskPrioritySchema = z21.enum(["low", "medium", "high"]);
24281
+ var TaskEntityTypeSchema = z21.enum([
24282
+ "person",
24283
+ "company",
24284
+ "pipeline_card"
24285
+ ]);
24286
+ var TaskEntityRefRequestSchema = z21.object({
24287
+ type: TaskEntityTypeSchema,
24288
+ id: z21.uuid()
24289
+ });
24290
+ var CreateTaskRequestSchema = z21.object({
24291
+ title: z21.string().min(1).max(500),
24292
+ description: z21.string().max(1e4).nullish(),
24293
+ dueAt: z21.iso.datetime().nullish(),
24294
+ // Omitted or null = no priority.
24295
+ priority: TaskPrioritySchema.nullish(),
24296
+ // Defaults to the calling member when omitted.
24297
+ ownerMembershipId: z21.uuid().nullish(),
24298
+ entity: TaskEntityRefRequestSchema.nullish(),
24299
+ // Stamped by the engine for agent writes — never user-supplied in the UI.
24300
+ createdByProvider: z21.string().max(50).nullish()
24301
+ });
24302
+ var UpdateTaskRequestSchema = z21.object({
24303
+ title: z21.string().min(1).max(500).optional(),
24304
+ description: z21.string().max(1e4).nullable().optional(),
24305
+ dueAt: z21.iso.datetime().nullable().optional(),
24306
+ priority: TaskPrioritySchema.nullable().optional(),
24307
+ ownerMembershipId: z21.uuid().optional()
24308
+ });
24309
+ var SetTaskStatusRequestSchema = z21.object({
24310
+ status: TaskStatusSchema
24311
+ });
24312
+
24313
+ // ../../packages/crm-api/dist/types/touchpoint.js
24314
+ import { z as z22 } from "zod";
24315
+ var TouchpointChannelSchema = z22.enum([
24316
+ "email",
24317
+ "slack",
24318
+ "call",
24319
+ "sms",
24320
+ "meeting",
24321
+ "linkedin",
24322
+ "note",
24323
+ "other"
24324
+ ]);
24325
+ var TouchpointDirectionSchema = z22.enum(["inbound", "outbound"]);
24326
+ var TouchpointSourceSchema = z22.enum(["manual", "agent", "sync"]);
24327
+ var HttpUrlSchema = z22.url().max(2e3).refine((value) => /^https?:\/\//i.test(value), {
24328
+ message: "Link must be an http or https URL"
24329
+ });
24330
+ var CreateTouchpointRequestSchema = z22.object({
24331
+ channel: TouchpointChannelSchema,
24332
+ direction: TouchpointDirectionSchema.nullish(),
24333
+ occurredAt: z22.iso.datetime(),
24334
+ summary: z22.string().max(1e4).nullish(),
24335
+ subject: z22.string().max(500).nullish(),
24336
+ // The contact this was with; company is derived from the card server-side.
24337
+ personId: z22.uuid().nullish(),
24338
+ externalRef: z22.string().max(500).nullish(),
24339
+ externalUrl: HttpUrlSchema.nullish(),
24340
+ // Stamped by the engine for agent writes — never user-supplied in the UI.
24341
+ loggedByProvider: z22.string().max(50).nullish()
24342
+ });
24343
+ var UpdateTouchpointRequestSchema = z22.object({
24344
+ channel: TouchpointChannelSchema.optional(),
24345
+ direction: TouchpointDirectionSchema.nullable().optional(),
24346
+ occurredAt: z22.iso.datetime().optional(),
24347
+ summary: z22.string().max(1e4).nullable().optional(),
24348
+ subject: z22.string().max(500).nullable().optional(),
24349
+ personId: z22.uuid().nullable().optional(),
24350
+ externalUrl: HttpUrlSchema.nullable().optional()
24351
+ });
24352
+
24353
+ // ../../packages/crm-api/dist/types/cardSync.js
24354
+ import { z as z23 } from "zod";
24355
+ var StartCardSyncRequestSchema = z23.object({
24356
+ // Credentials the agent is allowed to read for this run (at least one).
24357
+ // Credential ids are prefixed strings (cred_…), not uuids.
24358
+ credentialIds: z23.array(z23.string().min(1).max(40)).min(1).max(25),
24359
+ guidance: z23.string().max(2e3).nullish(),
24360
+ // Model to run on; omitted falls back to the member's Geni default.
24361
+ modelId: z23.string().optional()
24362
+ });
24363
+
24364
+ // ../../packages/crm-api/dist/types/scheduledAgent.js
24365
+ import { z as z24 } from "zod";
24366
+ var SCHEDULED_AGENT_STATUSES = ["active", "paused"];
24367
+ var PipelineMaintainerConfigSchema = z24.object({
24368
+ pipelineId: z24.string().min(1).max(40),
24369
+ // Connected credentials the maintainer may read (calendar/email/chat/CRM).
24370
+ credentialIds: z24.array(z24.string().min(1).max(40)).min(1).max(25),
24371
+ // The window each run scans for new correspondence; per-deal dedupe rides each
24372
+ // deal's last sync on top of this. Defaults to a day.
24373
+ lookbackHours: z24.number().int().min(1).max(720).default(24),
24374
+ guidance: z24.string().max(2e3).nullable().default(null),
24375
+ // Model + reasoning effort to run on; null falls back to the member's Geni
24376
+ // default at run time. Scoped to this agent — set in the wizard, not the
24377
+ // member's global default.
24378
+ modelId: z24.string().nullable().default(null),
24379
+ effort: z24.string().nullable().default(null)
24380
+ });
24381
+ var CreateScheduledAgentRequestSchema = z24.object({
24382
+ type: z24.literal("pipeline_maintainer"),
24383
+ name: z24.string().min(1).max(120),
24384
+ cronSchedule: z24.string().min(1).max(120),
24385
+ timezone: z24.string().max(64).nullable().default(null),
24386
+ config: PipelineMaintainerConfigSchema
24387
+ });
24388
+ var UpdateScheduledAgentRequestSchema = z24.object({
24389
+ name: z24.string().min(1).max(120).optional(),
24390
+ cronSchedule: z24.string().min(1).max(120).optional(),
24391
+ timezone: z24.string().max(64).nullable().optional(),
24392
+ status: z24.enum(SCHEDULED_AGENT_STATUSES).optional(),
24393
+ config: PipelineMaintainerConfigSchema.optional()
24394
+ }).merge(ExpectedUpdatedAtSchema);
24395
+
24396
+ // ../../packages/crm-api/dist/types/leadFilters.js
24397
+ import { z as z26 } from "zod";
24398
+
24399
+ // ../../packages/crm-api/dist/types/sequence.js
24400
+ import { z as z25 } from "zod";
24401
+ var PersonSequenceStatusSchema = z25.enum([
24402
+ "draft",
24403
+ "queued",
24404
+ "sending",
24405
+ "completed",
24406
+ "stopped",
24407
+ // The person replied — a positive terminal outcome, distinct from a halt.
24408
+ "replied"
24409
+ ]);
24410
+ var SequenceListSortSchema = z25.enum([
24411
+ "recent",
24412
+ "person",
24413
+ "company",
24414
+ "from",
24415
+ "to",
24416
+ "messages",
24417
+ "status",
24418
+ "activity"
24419
+ ]);
24420
+ var SequenceListRequestSchema = z25.object({
24421
+ status: PersonSequenceStatusSchema.optional(),
24422
+ query: z25.string().trim().min(1).optional(),
24423
+ sort: SequenceListSortSchema.default("recent"),
24424
+ // Direction for the column sort; omitted falls back to the sort's default.
24425
+ direction: LeadSortDirectionSchema.optional()
24426
+ });
24427
+ var SequenceStepInputSchema = z25.object({
24428
+ subject: z25.string().min(1).max(300).nullish(),
24429
+ body: z25.string().min(1).max(2e4),
24430
+ waitDays: z25.number().int().min(0).max(90)
24431
+ });
24432
+ var SetPersonSequenceRequestSchema = z25.object({
24433
+ steps: z25.array(SequenceStepInputSchema).min(1).max(10),
24434
+ emailAccountId: z25.string().nullish(),
24435
+ recipientContactPointId: z25.string().nullish()
24436
+ });
24437
+ var BulkSequenceIdsRequestSchema = z25.object({
24438
+ ids: z25.array(z25.uuid()).min(1).max(1e3)
24439
+ });
24440
+ function isValidTimeZone(timeZone) {
24441
+ try {
24442
+ new Intl.DateTimeFormat("en-US", { timeZone });
24443
+ return true;
24444
+ } catch {
24445
+ return false;
24446
+ }
24447
+ }
24448
+ var SequenceSendScheduleInputSchema = z25.object({
24449
+ name: z25.string().min(1).max(120),
24450
+ timezone: z25.string().refine(isValidTimeZone, "Unknown timezone"),
24451
+ startHour: z25.number().int().min(0).max(23),
24452
+ endHour: z25.number().int().min(1).max(24),
24453
+ sendDays: z25.array(z25.number().int().min(1).max(7)).min(1).max(7)
24454
+ }).refine((schedule) => schedule.startHour < schedule.endHour, {
24455
+ message: "Start must be before end"
24456
+ });
24457
+
24458
+ // ../../packages/crm-api/dist/types/leadFilters.js
24459
+ var LeadFilterFieldTypeSchema = z26.enum([
24460
+ "text",
24461
+ "number",
24462
+ "date",
24463
+ "enum",
24464
+ "stringArray",
24465
+ "boolean"
24466
+ ]);
24467
+ var LeadFilterOperatorSchema = z26.enum([
24468
+ // text
24469
+ "contains",
24470
+ "not_contains",
24471
+ "equals",
24472
+ "not_equals",
24473
+ "starts_with",
24474
+ "ends_with",
24475
+ // enum
24476
+ "any_of",
24477
+ "none_of",
24478
+ // number
24479
+ "gt",
24480
+ "gte",
24481
+ "lt",
24482
+ "lte",
24483
+ "between",
24484
+ // date (between is shared with number)
24485
+ "before",
24486
+ "after",
24487
+ "in_last_days",
24488
+ "not_in_last_days",
24489
+ // string array
24490
+ "includes_any",
24491
+ "includes_all",
24492
+ "excludes_all",
24493
+ // boolean
24494
+ "is_true",
24495
+ "is_false",
24496
+ // presence (every type)
24497
+ "is_empty",
24498
+ "is_not_empty"
24499
+ ]);
24500
+ var LeadFilterConditionSchema = z26.object({
24501
+ field: z26.string().min(1).max(200),
24502
+ operator: LeadFilterOperatorSchema,
24503
+ // Single-value operators (contains, gt, before, in_last_days, …).
24504
+ value: z26.union([z26.string().max(500), z26.number()]).optional(),
24505
+ // Multi-value operators (any_of, includes_any, …).
24506
+ values: z26.array(z26.string().max(500)).max(100).optional(),
24507
+ // `between` bounds — numbers, or ISO dates for date fields.
24508
+ min: z26.union([z26.string().max(100), z26.number()]).optional(),
24509
+ max: z26.union([z26.string().max(100), z26.number()]).optional()
24510
+ });
24511
+ function staticOptions(values) {
24512
+ return values.map((value) => ({
24513
+ value,
24514
+ label: value.replace(/_/g, " ")
24515
+ }));
24516
+ }
24517
+ var PERSON_FILTER_FIELDS = [
24518
+ { key: "name", label: "Name", type: "text", group: "Profile" },
24519
+ { key: "title", label: "Title", type: "text", group: "Profile" },
24520
+ { key: "headline", label: "Headline", type: "text", group: "Profile" },
24521
+ { key: "bio", label: "Bio", type: "text", group: "Profile" },
24522
+ { key: "department", label: "Department", type: "enum", group: "Profile" },
24523
+ {
24524
+ key: "yearsExperience",
24525
+ label: "Years of experience",
24526
+ type: "number",
24527
+ group: "Profile"
24528
+ },
24529
+ { key: "skills", label: "Skills", type: "stringArray", group: "Profile" },
24530
+ {
24531
+ key: "languages",
24532
+ label: "Languages",
24533
+ type: "stringArray",
24534
+ group: "Profile"
24535
+ },
24536
+ { key: "city", label: "City", type: "text", group: "Location" },
24537
+ { key: "region", label: "State / region", type: "text", group: "Location" },
24538
+ {
24539
+ key: "locationCountry",
24540
+ label: "Location country",
24541
+ type: "enum",
24542
+ group: "Location"
24543
+ },
24544
+ { key: "timezone", label: "Timezone", type: "enum", group: "Location" },
24545
+ {
24546
+ key: "roleCategory",
24547
+ label: "Role category",
24548
+ type: "enum",
24549
+ group: "Segmentation"
24550
+ },
24551
+ { key: "seniority", label: "Seniority", type: "enum", group: "Segmentation" },
24552
+ { key: "industry", label: "Industry", type: "enum", group: "Segmentation" },
24553
+ { key: "country", label: "Country", type: "enum", group: "Segmentation" },
24554
+ {
24555
+ key: "sizeBand",
24556
+ label: "Company size band",
24557
+ type: "enum",
24558
+ group: "Segmentation"
24559
+ },
24560
+ {
24561
+ key: "icpScore",
24562
+ label: "ICP score",
24563
+ type: "number",
24564
+ group: "Segmentation"
24565
+ },
24566
+ {
24567
+ key: "reachability",
24568
+ label: "Reachability",
24569
+ type: "enum",
24570
+ group: "Segmentation",
24571
+ options: staticOptions(ReachabilitySchema.options)
24572
+ },
24573
+ {
24574
+ key: "outreachStatus",
24575
+ label: "Outreach status",
24576
+ type: "enum",
24577
+ group: "Segmentation",
24578
+ options: staticOptions(OutreachStatusSchema.options)
24579
+ },
24580
+ { key: "companyName", label: "Company name", type: "text", group: "Company" },
24581
+ {
24582
+ key: "companyDomain",
24583
+ label: "Company domain",
24584
+ type: "text",
24585
+ group: "Company"
24586
+ },
24587
+ {
24588
+ key: "companyIndustry",
24589
+ label: "Company industry",
24590
+ type: "enum",
24591
+ group: "Company"
24592
+ },
24593
+ {
24594
+ key: "companyEmployeeCount",
24595
+ label: "Company employee count",
24596
+ type: "number",
24597
+ group: "Company"
24598
+ },
24599
+ { key: "email", label: "Email", type: "text", group: "Contact" },
24600
+ {
24601
+ key: "emailStatus",
24602
+ label: "Email status",
24603
+ type: "enum",
24604
+ group: "Contact",
24605
+ options: staticOptions(["verified", "unverified", "bounced"])
24606
+ },
24607
+ { key: "phone", label: "Phone", type: "text", group: "Contact" },
24608
+ {
24609
+ key: "phoneStatus",
24610
+ label: "Phone status",
24611
+ type: "enum",
24612
+ group: "Contact",
24613
+ options: staticOptions(["verified", "unverified", "bounced"])
24614
+ },
24615
+ { key: "linkedin", label: "LinkedIn", type: "text", group: "Links" },
24616
+ { key: "twitter", label: "Twitter / X", type: "text", group: "Links" },
24617
+ { key: "github", label: "GitHub", type: "text", group: "Links" },
24618
+ {
24619
+ key: "personalWebsite",
24620
+ label: "Personal website",
24621
+ type: "text",
24622
+ group: "Links"
24623
+ },
24624
+ { key: "facebook", label: "Facebook", type: "text", group: "Links" },
24625
+ { key: "youtube", label: "YouTube", type: "text", group: "Links" },
24626
+ { key: "instagram", label: "Instagram", type: "text", group: "Links" },
24627
+ {
24628
+ key: "sequenceStatus",
24629
+ label: "Sequence status",
24630
+ type: "enum",
24631
+ group: "Activity",
24632
+ options: staticOptions(PersonSequenceStatusSchema.options)
24633
+ },
24634
+ { key: "createdAt", label: "Added", type: "date", group: "Activity" },
24635
+ { key: "updatedAt", label: "Updated", type: "date", group: "Activity" },
24636
+ {
24637
+ key: "lastEnrichedAt",
24638
+ label: "Last enriched",
24639
+ type: "date",
24640
+ group: "Activity"
24641
+ }
24642
+ ];
24643
+ var COMPANY_FILTER_FIELDS = [
24644
+ { key: "name", label: "Name", type: "text", group: "Profile" },
24645
+ { key: "domain", label: "Domain", type: "text", group: "Profile" },
24646
+ { key: "description", label: "Description", type: "text", group: "Profile" },
24647
+ { key: "tagline", label: "Tagline", type: "text", group: "Profile" },
24648
+ { key: "industry", label: "Industry", type: "enum", group: "Profile" },
24649
+ { key: "subIndustry", label: "Sub-industry", type: "enum", group: "Profile" },
24650
+ {
24651
+ key: "companyType",
24652
+ label: "Company type",
24653
+ type: "enum",
24654
+ group: "Profile",
24655
+ options: staticOptions(CompanyTypeSchema.options)
24656
+ },
24657
+ { key: "keywords", label: "Keywords", type: "stringArray", group: "Profile" },
24658
+ {
24659
+ key: "employeeCount",
24660
+ label: "Employee count",
24661
+ type: "number",
24662
+ group: "Profile"
24663
+ },
24664
+ {
24665
+ key: "foundedYear",
24666
+ label: "Founded year",
24667
+ type: "number",
24668
+ group: "Profile"
24669
+ },
24670
+ {
24671
+ key: "peopleCount",
24672
+ label: "People in CRM",
24673
+ type: "number",
24674
+ group: "Profile"
24675
+ },
24676
+ { key: "ticker", label: "Ticker", type: "text", group: "Profile" },
24677
+ { key: "phone", label: "Phone", type: "text", group: "Profile" },
24678
+ { key: "hqCity", label: "HQ city", type: "text", group: "Location" },
24679
+ {
24680
+ key: "hqRegion",
24681
+ label: "HQ state / region",
24682
+ type: "text",
24683
+ group: "Location"
24684
+ },
24685
+ { key: "hqCountry", label: "HQ country", type: "enum", group: "Location" },
24686
+ {
24687
+ key: "annualRevenueUsd",
24688
+ label: "Annual revenue (USD)",
24689
+ type: "number",
24690
+ group: "Funding"
24691
+ },
24692
+ {
24693
+ key: "totalFundingUsd",
24694
+ label: "Total funding (USD)",
24695
+ type: "number",
24696
+ group: "Funding"
24697
+ },
24698
+ {
24699
+ key: "lastFundingRound",
24700
+ label: "Last funding round",
24701
+ type: "enum",
24702
+ group: "Funding"
24703
+ },
24704
+ {
24705
+ key: "lastFundingAt",
24706
+ label: "Last funding date",
24707
+ type: "date",
24708
+ group: "Funding"
24709
+ },
24710
+ {
24711
+ key: "investors",
24712
+ label: "Investors",
24713
+ type: "stringArray",
24714
+ group: "Funding"
24715
+ },
24716
+ {
24717
+ key: "techStack",
24718
+ label: "Tech stack",
24719
+ type: "stringArray",
24720
+ group: "Technology"
24721
+ },
24722
+ { key: "linkedin", label: "LinkedIn", type: "text", group: "Links" },
24723
+ { key: "twitter", label: "Twitter / X", type: "text", group: "Links" },
24724
+ { key: "github", label: "GitHub", type: "text", group: "Links" },
24725
+ { key: "crunchbase", label: "Crunchbase", type: "text", group: "Links" },
24726
+ { key: "facebook", label: "Facebook", type: "text", group: "Links" },
24727
+ { key: "youtube", label: "YouTube", type: "text", group: "Links" },
24728
+ { key: "instagram", label: "Instagram", type: "text", group: "Links" },
24729
+ { key: "createdAt", label: "Added", type: "date", group: "Activity" },
24730
+ { key: "updatedAt", label: "Updated", type: "date", group: "Activity" },
24731
+ {
24732
+ key: "lastEnrichedAt",
24733
+ label: "Last enriched",
24734
+ type: "date",
24735
+ group: "Activity"
24736
+ }
24737
+ ];
24738
+ function leadFilterConditionsDescription(fields) {
24739
+ const summary = fields.map((field) => `${field.key} (${field.type})`).join(", ");
24740
+ return `Column filter conditions (ANDed). Fields: ${summary}; org custom fields as custom.<key>. Operators by type \u2014 text: contains/not_contains/equals/not_equals/starts_with/ends_with; enum: any_of/none_of (values[]); number: equals/not_equals/gt/gte/lt/lte/between (min+max); date: before/after (value ISO date)/between/in_last_days/not_in_last_days (value days); stringArray: includes_any/includes_all/excludes_all (values[]); boolean: is_true/is_false; every field: is_empty/is_not_empty.`;
24741
+ }
24742
+
24743
+ // ../../packages/crm-api/dist/types/search.js
24744
+ import { z as z27 } from "zod";
24745
+ var PersonSearchFiltersSchema = z27.object({
24746
+ // Scope to one company's people (the company detail People tab).
24747
+ companyId: z27.uuid().optional(),
24748
+ // Scope to a person list's members.
24749
+ listId: z27.uuid().optional(),
24750
+ // Carrying ANY of these tags (OR-within, like the other array facets).
24751
+ tagIds: z27.array(z27.uuid()).optional(),
24752
+ roleCategory: z27.array(z27.string()).optional(),
24753
+ seniority: z27.array(z27.string()).optional(),
24754
+ sizeBand: z27.array(z27.string()).optional(),
24755
+ industry: z27.array(z27.string()).optional(),
24756
+ country: z27.array(z27.string()).optional(),
24757
+ reachability: z27.array(ReachabilitySchema).optional(),
24758
+ outreachStatus: z27.array(OutreachStatusSchema).optional(),
24759
+ minIcpScore: z27.number().min(0).max(100).optional(),
24760
+ minEmployeeCount: z27.number().int().min(0).optional(),
24761
+ maxEmployeeCount: z27.number().int().min(0).optional(),
24762
+ // Column conditions, ANDed together and with the keys above.
24763
+ conditions: z27.array(LeadFilterConditionSchema).max(20).optional().describe(leadFilterConditionsDescription(PERSON_FILTER_FIELDS))
24764
+ });
24765
+ var PersonSearchSortSchema = z27.enum([
24766
+ "relevance",
24767
+ "icp_score",
24768
+ "recent",
24769
+ "updated",
24770
+ "name",
24771
+ "title",
24772
+ "company",
24773
+ "location",
24774
+ "email",
24775
+ "phone",
24776
+ "linkedin",
24777
+ "enriched"
24778
+ ]);
24779
+ var PersonSearchRequestSchema = z27.object({
24780
+ // Free-text keyword query (FTS + fuzzy fallback). Omit for pure facet browse.
24781
+ query: z27.string().optional(),
24782
+ filters: PersonSearchFiltersSchema.optional(),
24783
+ sort: PersonSearchSortSchema.default("relevance"),
24784
+ // Direction for the column sort; omitted falls back to the sort's default.
24785
+ direction: LeadSortDirectionSchema.optional(),
24786
+ // Keyset pagination — opaque cursor from the previous response.
24787
+ cursor: z27.string().nullable().optional(),
24788
+ limit: z27.number().int().min(1).max(100).default(25),
24789
+ // Whether to compute facet counts for this query (extra work; off for paging).
24790
+ includeFacets: z27.boolean().default(false)
24791
+ });
24792
+ var CompanySearchFiltersSchema = z27.object({
24793
+ // Scope to a company list's members.
24794
+ listId: z27.uuid().optional(),
24795
+ // Carrying ANY of these tags (OR-within, like the other array facets).
24796
+ tagIds: z27.array(z27.uuid()).optional(),
24797
+ industry: z27.array(z27.string()).optional(),
24798
+ hqCountry: z27.array(z27.string()).optional(),
24799
+ minEmployeeCount: z27.number().int().min(0).optional(),
24800
+ maxEmployeeCount: z27.number().int().min(0).optional(),
24801
+ // Column conditions, ANDed together and with the keys above.
24802
+ conditions: z27.array(LeadFilterConditionSchema).max(20).optional().describe(leadFilterConditionsDescription(COMPANY_FILTER_FIELDS))
24803
+ });
24804
+ var CompanySearchSortSchema = z27.enum([
24805
+ "relevance",
24806
+ "employee_count",
24807
+ "recent",
24808
+ "updated",
24809
+ "name",
24810
+ "domain",
24811
+ "industry",
24812
+ "hq",
24813
+ "enriched"
24814
+ ]);
24815
+ var CompanySearchRequestSchema = z27.object({
24816
+ query: z27.string().optional(),
24817
+ filters: CompanySearchFiltersSchema.optional(),
24818
+ sort: CompanySearchSortSchema.default("relevance"),
24819
+ direction: LeadSortDirectionSchema.optional(),
24820
+ cursor: z27.string().nullable().optional(),
24821
+ limit: z27.number().int().min(1).max(100).default(25),
24822
+ includeFacets: z27.boolean().default(false)
24823
+ });
24824
+
24825
+ // ../../packages/crm-api/dist/types/globalSearch.js
24826
+ import { z as z28 } from "zod";
24827
+ var GlobalSearchRequestSchema = z28.object({
24828
+ query: z28.string().min(1).max(200),
24829
+ // Per-entity cap; the response holds up to 3 × this many results.
24830
+ limitPerType: z28.number().int().min(1).max(20).default(6)
24831
+ });
24832
+
24833
+ // ../../packages/crm-api/dist/types/leadTools.js
24834
+ import { z as z29 } from "zod";
24835
+ var LEAD_BATCH_MAX = 100;
24836
+ var companyEnrichmentFields = {
24837
+ legalName: z29.string().nullish(),
24838
+ tagline: z29.string().nullish(),
24839
+ linkedinUrl: z29.string().nullish(),
24840
+ logoUrl: z29.string().nullish(),
24841
+ companyType: CompanyTypeSchema.nullish(),
24842
+ industry: z29.string().nullish(),
24843
+ subIndustry: z29.string().nullish(),
24844
+ keywords: z29.array(z29.string()).max(50).nullish(),
24845
+ description: z29.string().nullish(),
24846
+ employeeCount: z29.number().int().min(0).nullish(),
24847
+ foundedYear: z29.number().int().nullish(),
24848
+ ticker: z29.string().nullish(),
24849
+ annualRevenueUsd: z29.number().min(0).nullish(),
24850
+ totalFundingUsd: z29.number().min(0).nullish(),
24851
+ lastFundingRound: z29.string().nullish(),
24852
+ // ISO date, e.g. 2025-03-01
24853
+ lastFundingAt: z29.string().nullish(),
24854
+ investors: z29.array(z29.string()).max(50).nullish(),
24855
+ hqCity: z29.string().nullish(),
24856
+ hqRegion: z29.string().nullish(),
24857
+ hqCountry: z29.string().nullish(),
24858
+ hqAddress: z29.string().nullish(),
24859
+ phone: z29.string().nullish(),
24860
+ twitterUrl: z29.string().nullish(),
24861
+ githubUrl: z29.string().nullish(),
24862
+ facebookUrl: z29.string().nullish(),
24863
+ youtubeUrl: z29.string().nullish(),
24864
+ instagramUrl: z29.string().nullish(),
24865
+ crunchbaseUrl: z29.string().nullish(),
24866
+ techStack: z29.array(z29.string()).max(100).nullish()
24867
+ };
24868
+ var CreateLeadCompanyRequestSchema = z29.strictObject({
24869
+ name: z29.string().min(1),
24870
+ domain: z29.string().optional(),
24871
+ ...companyEnrichmentFields
24872
+ });
24873
+ var LeadPersonEducationInputSchema = z29.strictObject({
24874
+ school: z29.string().min(1),
24875
+ degree: z29.string().optional(),
24876
+ field: z29.string().optional(),
24877
+ startYear: z29.number().int().optional(),
24878
+ endYear: z29.number().int().optional()
24879
+ });
24880
+ var personEnrichmentFields = {
24881
+ title: z29.string().nullish(),
24882
+ headline: z29.string().nullish(),
24883
+ bio: z29.string().nullish(),
24884
+ department: z29.string().nullish(),
24885
+ yearsExperience: z29.number().int().min(0).max(80).nullish(),
24886
+ skills: z29.array(z29.string()).max(50).nullish(),
24887
+ languages: z29.array(z29.string()).max(20).nullish(),
24888
+ photoUrl: z29.string().nullish(),
24889
+ linkedinUrl: z29.string().nullish(),
24890
+ twitterUrl: z29.string().nullish(),
24891
+ githubUrl: z29.string().nullish(),
24892
+ facebookUrl: z29.string().nullish(),
24893
+ youtubeUrl: z29.string().nullish(),
24894
+ instagramUrl: z29.string().nullish(),
24895
+ personalWebsiteUrl: z29.string().nullish(),
24896
+ email: z29.string().nullish(),
24897
+ locationCity: z29.string().nullish(),
24898
+ locationRegion: z29.string().nullish(),
24899
+ locationCountry: z29.string().nullish(),
24900
+ // IANA timezone, e.g. America/New_York
24901
+ timezone: z29.string().nullish(),
24902
+ // Full education history — REPLACES any previously saved entries.
24903
+ educations: z29.array(LeadPersonEducationInputSchema).max(10).optional()
24904
+ };
24905
+ var CreateLeadPersonRequestSchema = z29.strictObject({
24906
+ fullName: z29.string().min(1),
24907
+ ...personEnrichmentFields,
24908
+ companyId: z29.string().optional(),
24909
+ companyName: z29.string().optional(),
24910
+ companyDomain: z29.string().optional()
24911
+ });
24912
+ var UpdateLeadCompanyRequestSchema = z29.strictObject({
24913
+ id: z29.uuid(),
24914
+ name: z29.string().min(1).optional(),
24915
+ domain: z29.string().optional(),
24916
+ ...companyEnrichmentFields,
24917
+ // Registry-defined custom fields; validated + merged server-side.
24918
+ custom: CustomFieldValuesSchema.optional()
24919
+ });
24920
+ var UpdateLeadPersonRequestSchema = z29.strictObject({
24921
+ id: z29.uuid(),
24922
+ fullName: z29.string().min(1).optional(),
24923
+ ...personEnrichmentFields,
24924
+ // (re)assign current employment — companyId, or companyName/companyDomain
24925
+ // to find-or-create the company first
24926
+ companyId: z29.string().optional(),
24927
+ companyName: z29.string().optional(),
24928
+ companyDomain: z29.string().optional(),
24929
+ // Set the primary company directly (the people.current_company_id cache shown
24930
+ // in lists/header). Independent of the employment rows that hold the full set
24931
+ // of current roles; null clears it. Recompute overwrites it when the current
24932
+ // employment set changes.
24933
+ primaryCompanyId: z29.string().nullish(),
24934
+ // Registry-defined custom fields; validated + merged server-side.
24935
+ custom: CustomFieldValuesSchema.optional()
24936
+ });
24937
+ var LeadEmploymentInputSchema = z29.strictObject({
24938
+ companyId: z29.uuid().nullish(),
24939
+ companyName: z29.string().nullish(),
24940
+ title: z29.string().nullish(),
24941
+ startDate: z29.string().nullish(),
24942
+ endDate: z29.string().nullish(),
24943
+ isCurrent: z29.boolean().default(false)
24944
+ });
24945
+ var UpdateLeadEmploymentRequestSchema = z29.strictObject({
24946
+ companyId: z29.uuid().nullish(),
24947
+ companyName: z29.string().nullish(),
24948
+ title: z29.string().nullish(),
24949
+ startDate: z29.string().nullish(),
24950
+ endDate: z29.string().nullish(),
24951
+ isCurrent: z29.boolean().optional()
24952
+ });
24953
+ var LeadContactPointInputSchema = z29.strictObject({
24954
+ kind: ContactPointKindSchema,
24955
+ value: z29.string().min(1),
24956
+ status: ContactPointStatusSchema.optional(),
24957
+ isPrimary: z29.boolean().optional()
24958
+ });
24959
+ var UpdateLeadContactPointRequestSchema = z29.strictObject({
24960
+ kind: ContactPointKindSchema.optional(),
24961
+ value: z29.string().min(1).optional(),
24962
+ status: ContactPointStatusSchema.optional(),
24963
+ isPrimary: z29.boolean().optional()
24964
+ });
24965
+ var LeadCompanyPeopleRequestSchema = z29.object({
24966
+ limit: z29.coerce.number().int().min(1).max(100).default(50),
24967
+ cursor: z29.string().optional(),
24968
+ sort: PersonSearchSortSchema.default("recent"),
24969
+ direction: LeadSortDirectionSchema.optional()
24970
+ });
24971
+ var CreateLeadCompaniesRequestSchema = z29.strictObject({
24972
+ companies: z29.array(CreateLeadCompanyRequestSchema).min(1).max(LEAD_BATCH_MAX)
24973
+ });
24974
+ var CreateLeadPeopleRequestSchema = z29.strictObject({
24975
+ people: z29.array(CreateLeadPersonRequestSchema).min(1).max(LEAD_BATCH_MAX)
24976
+ });
24977
+ var UpdateLeadCompaniesRequestSchema = z29.strictObject({
24978
+ companies: z29.array(UpdateLeadCompanyRequestSchema).min(1).max(LEAD_BATCH_MAX)
24979
+ });
24980
+ var UpdateLeadPeopleRequestSchema = z29.strictObject({
24981
+ people: z29.array(UpdateLeadPersonRequestSchema).min(1).max(LEAD_BATCH_MAX)
24982
+ });
24983
+ var DeleteLeadCompaniesRequestSchema = z29.strictObject({
24984
+ ids: z29.array(z29.uuid()).min(1).max(LEAD_BATCH_MAX)
24985
+ });
24986
+ var DeleteLeadPeopleRequestSchema = z29.strictObject({
24987
+ ids: z29.array(z29.uuid()).min(1).max(LEAD_BATCH_MAX)
24988
+ });
24989
+
24990
+ // ../../packages/crm-api/dist/types/suppression.js
24991
+ import { z as z30 } from "zod";
24992
+ var SuppressionKindSchema = z30.enum(["email", "domain", "phone"]);
24993
+ var SuppressionReasonSchema = z30.enum([
24994
+ "unsubscribed",
24995
+ "complained",
24996
+ "hard_bounced",
24997
+ "manual"
24998
+ ]);
24999
+ var CreateSuppressionRequestSchema = z30.object({
25000
+ kind: SuppressionKindSchema,
25001
+ value: z30.string().min(1).max(320),
25002
+ reason: SuppressionReasonSchema,
25003
+ sourcePersonId: z30.uuid().nullish()
25004
+ });
25005
+
25006
+ // ../../packages/crm-api/dist/types/conversation.js
25007
+ import { z as z31 } from "zod";
25008
+ var ConversationChannelSchema = z31.enum(["email", "linkedin"]);
25009
+ var MessageDirectionSchema = z31.enum(["outbound", "inbound"]);
25010
+ var InboxFilterSchema = z31.enum(["all", "unread"]);
25011
+ var InboxListRequestSchema = z31.object({
25012
+ filter: InboxFilterSchema.default("all"),
25013
+ channel: ConversationChannelSchema.optional(),
25014
+ // Keyset cursor — last page's (lastMessageAt, id), opaque to clients.
25015
+ cursor: z31.string().nullable().optional(),
25016
+ limit: z31.number().int().min(1).max(100).default(30)
25017
+ });
25018
+ var SentListRequestSchema = z31.object({
25019
+ // Keyset cursor — last page's (sentAt, id), opaque to clients.
25020
+ cursor: z31.string().nullable().optional(),
25021
+ limit: z31.number().int().min(1).max(100).default(30)
25022
+ });
25023
+ var ReplyToConversationRequestSchema = z31.object({
25024
+ bodyText: z31.string().min(1).max(2e4)
25025
+ });
25026
+ var DraftReplyRequestSchema = z31.object({
25027
+ /** What the reply should say or avoid — optional steer from the sender. */
25028
+ guidance: z31.string().max(2e3).optional(),
25029
+ /** Composer text to revise; omitted on a fresh draft. */
25030
+ currentDraft: z31.string().max(2e4).optional()
25031
+ });
25032
+
25033
+ // ../../packages/crm-api/dist/types/enrichment.js
25034
+ import { z as z32 } from "zod";
25035
+ var ENRICHMENT_BATCH_LIMIT = 25;
25036
+ var EnrichPeopleRequestSchema = z32.object({
25037
+ personIds: z32.array(z32.uuid()).min(1).max(ENRICHMENT_BATCH_LIMIT),
25038
+ // A person with only an UNVERIFIED contact reruns the chain, excluding the
25039
+ // providers that sourced it. Verified contacts always short-circuit.
25040
+ retryUnverified: z32.boolean().optional()
25041
+ });
25042
+ var ENRICHMENT_RUN_PERSON_LIMIT = 500;
25043
+ var EnrichmentRunActionSchema = z32.enum([
25044
+ "emails",
25045
+ "validate",
25046
+ "phones"
25047
+ ]);
25048
+ var StartEnrichmentRunRequestSchema = z32.object({
25049
+ personIds: z32.array(z32.uuid()).min(1).max(ENRICHMENT_RUN_PERSON_LIMIT),
25050
+ actions: z32.array(EnrichmentRunActionSchema).min(1),
25051
+ retryUnverified: z32.boolean()
25052
+ });
25053
+ var UpdateContactPointStatusRequestSchema = z32.object({
25054
+ status: z32.enum(["verified", "unverified"])
25055
+ });
25056
+ var EnrichmentApprovalActionSchema = z32.enum([
25057
+ "enrich_emails",
25058
+ "validate_emails",
25059
+ "enrich_phones"
25060
+ ]);
25061
+ var ResolveEnrichmentApprovalRequestSchema = z32.object({
25062
+ approve: z32.boolean()
25063
+ });
25064
+
25065
+ // ../../packages/crm-api/dist/types/providers.js
25066
+ import { z as z33 } from "zod";
25067
+ var EmailEnrichmentProviderIdSchema = z33.enum([
25068
+ "hunter",
25069
+ "apollo",
25070
+ "prospeo",
25071
+ "findymail",
25072
+ "leadmagic",
25073
+ "datagma",
25074
+ "lusha",
25075
+ "peopledatalabs",
25076
+ "rocketreach",
25077
+ "snov",
25078
+ "uplead",
25079
+ "wiza",
25080
+ "crustdata"
25081
+ ]);
25082
+ var EmailValidationProviderIdSchema = z33.enum([
25083
+ "zerobounce",
25084
+ "neverbounce",
25085
+ "hunter",
25086
+ "findymail",
25087
+ "leadmagic",
25088
+ "snov"
25089
+ ]);
25090
+ var PhoneEnrichmentProviderIdSchema = z33.enum([
25091
+ "prospeo",
25092
+ "findymail",
25093
+ "leadmagic",
25094
+ "datagma",
25095
+ "lusha",
25096
+ "peopledatalabs",
25097
+ "rocketreach",
25098
+ "uplead",
25099
+ "wiza",
25100
+ "crustdata"
25101
+ ]);
25102
+ var IntegrationProviderIdSchema = z33.enum([
25103
+ "hunter",
25104
+ "apollo",
25105
+ "prospeo",
25106
+ "findymail",
25107
+ "leadmagic",
25108
+ "datagma",
25109
+ "lusha",
25110
+ "peopledatalabs",
25111
+ "zerobounce",
25112
+ "neverbounce",
25113
+ "rocketreach",
25114
+ "snov",
25115
+ "uplead",
25116
+ "wiza",
25117
+ "crustdata"
25118
+ ]);
25119
+ var UpdateEnrichmentWaterfallsRequestSchema = z33.object({
25120
+ emailEnrichment: z33.array(EmailEnrichmentProviderIdSchema).optional(),
25121
+ emailValidation: z33.array(EmailValidationProviderIdSchema).optional(),
25122
+ phoneEnrichment: z33.array(PhoneEnrichmentProviderIdSchema).optional()
25123
+ });
25124
+
25125
+ // ../../packages/crm-api/dist/types/skill.js
25126
+ import { z as z34 } from "zod";
25127
+ var SkillIdSchema = z34.enum([
25128
+ "fill-in-person",
25129
+ "fill-in-company",
25130
+ "fill-in-list",
25131
+ "draft-sequence-person",
25132
+ "lookalike-person",
25133
+ "lookalike-company",
25134
+ "add-enrich",
25135
+ "signal-sweep-list",
25136
+ "build-list-person",
25137
+ "build-list-company"
25138
+ ]);
25139
+ var AgentQuickActionSchema = z34.enum([
25140
+ "fill_in",
25141
+ "draft_sequence",
25142
+ "create_lookalikes",
25143
+ "add_enrich",
25144
+ "signal_sweep",
25145
+ "build_list"
25146
+ ]);
25147
+ var SkillEntityTypeSchema = z34.enum(["person", "company"]);
25148
+ var SkillListTargetValueSchema = z34.union([
25149
+ z34.object({
25150
+ listId: z34.uuid(),
25151
+ listName: z34.string().trim().min(1).max(200)
25152
+ }),
25153
+ z34.object({ newListName: z34.string().trim().min(1).max(200) })
25154
+ ]);
25155
+ var SkillSeedValueSchema = z34.string().trim().min(1).max(2e3);
25156
+ var SkillBriefValueSchema = z34.string().trim().min(1).max(2e3);
25157
+ var UpdateSkillRequestSchema = z34.object({
25158
+ content: z34.string().trim().min(1).max(1e5)
25159
+ });
25160
+
25161
+ // ../../packages/crm-api/dist/types/agentMail.js
25162
+ import { z as z35 } from "zod";
25163
+ var AgentMailAttachmentUploadSchema = z35.object({
25164
+ filename: z35.string().min(1).max(255),
25165
+ contentType: z35.string().min(1).max(255),
25166
+ dataBase64: z35.string().min(1).max(28e6)
25167
+ });
25168
+ var CreateAgentMailRequestSchema = z35.object({
25169
+ threadId: z35.string().min(1),
25170
+ subject: z35.string().trim().min(1).max(200),
25171
+ body: z35.string().trim().min(1).max(2e4),
25172
+ senderProvider: z35.string().max(50).nullable(),
25173
+ attachments: z35.array(AgentMailAttachmentUploadSchema).max(8)
25174
+ });
25175
+
25176
+ // ../../packages/crm-api/dist/types/workspaceEmail.js
25177
+ import { z as z36 } from "zod";
25178
+ var GoogleWorkspaceConnectionStatusSchema = z36.enum([
25179
+ "pending_grant",
25180
+ "active",
25181
+ "revoked"
25182
+ ]);
25183
+ var EmailAccountDirectoryStatusSchema = z36.enum([
25184
+ "active",
25185
+ "suspended",
25186
+ "removed"
25187
+ ]);
25188
+ var CreateWorkspaceConnectionRequestSchema = z36.object({
25189
+ adminEmail: z36.email().max(320)
25190
+ });
25191
+ var UpdateEmailAccountRequestSchema = z36.object({
25192
+ isSendingEnabled: z36.boolean().optional(),
25193
+ dailySendCap: z36.number().int().min(1).max(500).optional()
25194
+ });
25195
+
25196
+ // ../../packages/crm-api/dist/types/mailbox.js
25197
+ import { z as z37 } from "zod";
25198
+ var ConnectCrmMailboxRequestSchema = z37.object({
25199
+ credentialId: z37.string()
25200
+ });
25201
+ var UpdateCrmMailboxRequestSchema = z37.object({
25202
+ isSendingEnabled: z37.boolean().optional(),
25203
+ dailySendCap: z37.number().int().min(1).max(500).optional()
25204
+ });
25205
+
25206
+ // ../../packages/api/dist/types/user.js
25207
+ import { z as z38 } from "zod";
25208
+ var UserRoleSchema = z38.enum(["God", "Owner", "Admin", "Member"]);
25209
+
25210
+ // ../../packages/api/dist/types/credential.js
25211
+ import { z as z39 } from "zod";
25212
+ var CredentialTypeSchema2 = z39.enum([
25213
+ "oauth2",
25214
+ "apiKey",
25215
+ "platform",
25216
+ "noAuth"
25217
+ ]);
25218
+ var CredentialAuthSourceSchema = z39.enum([
25219
+ "personal_oauth",
25220
+ "organization_oauth",
25221
+ "managed_oauth",
25222
+ "api_key",
25223
+ "composio"
25224
+ ]);
25225
+
25226
+ // ../../packages/api/dist/types/agent.js
25227
+ import { z as z40 } from "zod";
25228
+ var GiAgentMessageTypeSchema = z40.enum([
25229
+ "text",
25230
+ "tool-call",
25231
+ "tool-result",
25232
+ "credential-access",
25233
+ "platform-tool-call",
25234
+ "database-tool-call",
25235
+ "background-task",
25236
+ // legacy: pre-rename display rows persisted 'delegating'; kept so old
25237
+ // threads still load (an unknown type drops the whole message on read).
25238
+ "delegating"
25239
+ ]);
25240
+ var GiAgentMessageRoleSchema = z40.enum([
25241
+ "user",
25242
+ "assistant",
25243
+ "system",
25244
+ "tool",
25245
+ "display"
25246
+ ]);
25247
+ var STORAGE_URI_PREFIX = "store://";
25248
+ var agentStorageUriSchema = z40.string().refine((v) => v.startsWith(STORAGE_URI_PREFIX) || v.startsWith("r2://"), {
25249
+ message: `Storage URI must start with ${STORAGE_URI_PREFIX}`
25250
+ });
25251
+ var AgentPersistedImagePartSchema = z40.object({
25252
+ type: z40.literal("image"),
25253
+ image: agentStorageUriSchema,
25254
+ mimeType: z40.string()
25255
+ }).loose();
25256
+ var AgentPersistedFilePartSchema = z40.object({
25257
+ type: z40.literal("file"),
25258
+ data: agentStorageUriSchema,
25259
+ mimeType: z40.string(),
25260
+ filename: z40.string()
25261
+ }).loose();
25262
+ var AgentPersistedTextPartSchema = z40.object({
25263
+ type: z40.literal("text"),
25264
+ text: z40.string()
25265
+ }).loose();
25266
+ var AgentPersistedReasoningPartSchema = z40.object({
25267
+ type: z40.literal("reasoning"),
25268
+ text: z40.string()
25269
+ }).loose();
25270
+ var AgentPersistedToolCallPartSchema = z40.object({
25271
+ type: z40.literal("tool-call"),
25272
+ toolCallId: z40.string(),
25273
+ toolName: z40.string(),
25274
+ input: z40.unknown()
25275
+ }).loose();
25276
+ var AgentPersistedToolResultPartSchema = z40.object({
25277
+ type: z40.literal("tool-result"),
25278
+ toolCallId: z40.string(),
25279
+ toolName: z40.string(),
25280
+ output: z40.object({
25281
+ type: z40.string(),
25282
+ value: z40.unknown()
25283
+ }).loose()
25284
+ }).loose();
25285
+ var AgentPersistedDisplayEventSchema = z40.object({
25286
+ type: z40.string()
25287
+ }).loose();
25288
+ var AgentPersistedUserContentSchema = z40.union([
25289
+ z40.string(),
25290
+ z40.array(z40.union([
25291
+ z40.object({ type: z40.literal("text"), text: z40.string() }).loose(),
25292
+ z40.object({ type: z40.literal("api-mention"), service: z40.string() }).loose(),
25293
+ z40.object({
25294
+ type: z40.literal("platform-api-mention"),
25295
+ service: z40.string()
25296
+ }).loose(),
25297
+ z40.object({ type: z40.literal("trigger-mention"), triggerId: z40.string() }).loose(),
25298
+ z40.object({
25299
+ type: z40.literal("credential-mention"),
25300
+ credentialId: z40.string(),
25301
+ credentialTitle: z40.string(),
25302
+ service: z40.string()
25303
+ }).loose(),
25304
+ AgentPersistedImagePartSchema,
25305
+ AgentPersistedFilePartSchema
25306
+ ])).min(1)
25307
+ ]);
25308
+ var AgentPersistedAssistantContentSchema = z40.union([
25309
+ z40.string(),
25310
+ z40.array(z40.union([
25311
+ AgentPersistedTextPartSchema,
25312
+ AgentPersistedReasoningPartSchema,
25313
+ AgentPersistedToolCallPartSchema
25314
+ ])).min(1)
25315
+ ]);
25316
+ var AgentPersistedToolContentSchema = z40.array(AgentPersistedToolResultPartSchema).min(1);
25317
+ var AgentPersistedSystemContentSchema = z40.string();
25318
+ var QuestionResumePayloadSchema = z40.object({
25319
+ answer: z40.string(),
25320
+ displayText: z40.string()
25321
+ });
25322
+ var CreateResourceResumePayloadSchema = z40.object({
25323
+ action: z40.enum(["create", "cancel"]),
25324
+ displayText: z40.string()
25325
+ });
25326
+ var RunWorkflowResumePayloadSchema = z40.object({
25327
+ action: z40.enum(["run", "cancel"]),
25328
+ displayText: z40.string()
25329
+ });
25330
+ var ConnectCredentialForAccountResumePayloadSchema = z40.object({
25331
+ credentialId: z40.string().nullable(),
25332
+ displayText: z40.string()
25333
+ });
25334
+ var CrmApprovalResumePayloadSchema = z40.object({
25335
+ decision: z40.enum(["approve", "deny"]),
25336
+ displayText: z40.string()
25337
+ });
25338
+ var HumanInputResumePayloadSchema = z40.union([
25339
+ QuestionResumePayloadSchema,
25340
+ CreateResourceResumePayloadSchema,
25341
+ RunWorkflowResumePayloadSchema,
25342
+ ConnectCredentialForAccountResumePayloadSchema,
25343
+ CrmApprovalResumePayloadSchema
25344
+ ]);
25345
+ var AgentUserContentSegmentSchema = z40.discriminatedUnion("type", [
25346
+ z40.object({ type: z40.literal("text"), text: z40.string() }),
25347
+ z40.object({ type: z40.literal("api-mention"), service: z40.string() }),
25348
+ z40.object({ type: z40.literal("platform-api-mention"), service: z40.string() }),
25349
+ z40.object({ type: z40.literal("trigger-mention"), triggerId: z40.string() }),
25350
+ z40.object({
25351
+ type: z40.literal("credential-mention"),
25352
+ credentialId: z40.string(),
25353
+ credentialTitle: z40.string(),
25354
+ service: z40.string()
25355
+ })
25356
+ ]);
25357
+ var AgentUserContentSchema = z40.array(AgentUserContentSegmentSchema).min(1);
25358
+ var MessageAttachmentSchema = z40.object({
25359
+ type: z40.enum(["image", "file"]),
25360
+ key: z40.string(),
25361
+ mimeType: z40.string(),
25362
+ filename: z40.string()
25363
+ });
25364
+
25365
+ // ../../packages/api/dist/types/balance.js
25366
+ import { z as z41 } from "zod";
25367
+ var UpdateAutofillSettingsRequestSchema = z41.discriminatedUnion("enabled", [
25368
+ z41.object({
25369
+ enabled: z41.literal(true),
25370
+ targetCredits: z41.number().positive(),
25371
+ thresholdCredits: z41.number().nonnegative()
25372
+ }),
25373
+ z41.object({
25374
+ enabled: z41.literal(false)
25375
+ })
25376
+ ]);
25377
+
25378
+ // ../../packages/api/dist/types/usage.js
25379
+ import { z as z42 } from "zod";
25380
+ var UsageEventTypeSchema = z42.enum([
25381
+ "llm_cost",
25382
+ "agent_llm_cost",
25383
+ "sandbox_runtime",
25384
+ "image_search",
25385
+ "chat_completion",
25386
+ "proxy_scrape",
25387
+ "internet_search",
25388
+ "generate_image",
25389
+ "geolocation",
25390
+ "weather",
25391
+ "crypto_data",
25392
+ "financial_research",
25393
+ "stock_data",
25394
+ "send_email",
25395
+ "user_database"
25396
+ ]);
25397
+
25398
+ // ../../packages/api/dist/types/dashboard.js
25399
+ import { z as z43 } from "zod";
25400
+ var DashboardArtifactLayoutSchema = z43.object({
25401
+ x: z43.number().int().min(0),
25402
+ y: z43.number().int().min(0),
25403
+ w: z43.number().int().min(1),
25404
+ h: z43.number().int().min(1)
25405
+ });
25406
+
25407
+ // ../../packages/api/dist/types/permission.js
25408
+ var OrgPermission = {
25409
+ // Billing
25410
+ BILLING_REFILL_BALANCE: "billing:refill_balance",
25411
+ BILLING_MANAGE_PAYMENT_METHODS: "billing:manage_payment_methods",
25412
+ // Organization settings
25413
+ ORG_UPDATE_NAME: "org:update_name",
25414
+ ORG_UPDATE_AUTOFILL: "org:update_autofill",
25415
+ // Member management
25416
+ MEMBERS_LIST_INVITES: "members:list_invites",
25417
+ MEMBERS_SEND_INVITE: "members:send_invite",
25418
+ MEMBERS_RESEND_INVITE: "members:resend_invite",
25419
+ MEMBERS_CANCEL_INVITE: "members:cancel_invite",
25420
+ MEMBERS_UPDATE_ROLE: "members:update_role",
25421
+ MEMBERS_ARCHIVE: "members:archive",
25422
+ MEMBERS_DEMOTE_ADMIN: "members:demote_admin",
25423
+ MEMBERS_TRANSFER_OWNERSHIP: "members:transfer_ownership",
25424
+ // OAuth connections
25425
+ ORG_MANAGE_OAUTH_CONNECTIONS: "org:manage_oauth_connections",
25426
+ // Notification channels — connect Slack/etc and match members to accounts
25427
+ ORG_MANAGE_NOTIFICATION_CHANNELS: "org:manage_notification_channels",
25428
+ // Egress policy — org-wide block rules per integration
25429
+ ORG_MANAGE_EGRESS_POLICY: "org:manage_egress_policy",
25430
+ // API keys
25431
+ API_KEYS_MANAGE: "api_keys:manage",
25432
+ // Knowledge base
25433
+ KNOWLEDGE_BASE_MODIFY: "knowledge_base:modify",
25434
+ // CRM — order the enrichment provider waterfalls (org-wide chains)
25435
+ CRM_CONFIGURE_WATERFALLS: "crm:configure_waterfalls",
25436
+ // Admin portal
25437
+ ADMIN_PORTAL_ACCESS: "admin:portal_access",
25438
+ // Security audit
25439
+ ORG_SECURITY_ACCESS: "audit:org_security_access",
25440
+ // Usage audit
25441
+ ORG_USAGE_ACCESS: "audit:org_usage_access",
25442
+ // Executions audit
25443
+ ORG_EXECUTIONS_ACCESS: "audit:org_executions_access",
25444
+ // Members directory — read-only browsing of every member's
25445
+ // workflows and credentials via the top-level Members page.
25446
+ // Distinct from the audit perms above (which gate workspace-wide
25447
+ // analytics) — these gate per-member detail pages.
25448
+ VIEW_ALL_WORKFLOWS: "members:view_all_workflows",
25449
+ VIEW_ALL_CREDENTIALS: "members:view_all_credentials",
25450
+ // Admin-implicit editor access. Holders get an `editor` floor on
25451
+ // every workflow in their organization via direct link, even
25452
+ // without an explicit collaborator row or org-grant — they can
25453
+ // view, run, and edit. Intentionally NOT plumbed into workflow
25454
+ // listing: the workflow does not appear in the admin's own list,
25455
+ // only on the direct detail page.
25456
+ EDIT_ANY_WORKFLOW: "workflows:edit_any"
25457
+ };
25458
+ var ORG_PERMISSIONS = [
25459
+ { id: OrgPermission.BILLING_REFILL_BALANCE, label: "Refill credit balance" },
25460
+ {
25461
+ id: OrgPermission.BILLING_MANAGE_PAYMENT_METHODS,
25462
+ label: "Manage payment methods"
25463
+ },
25464
+ { id: OrgPermission.ORG_UPDATE_NAME, label: "Update organization name" },
25465
+ { id: OrgPermission.ORG_UPDATE_AUTOFILL, label: "Update autofill settings" },
25466
+ { id: OrgPermission.MEMBERS_LIST_INVITES, label: "View pending invites" },
25467
+ { id: OrgPermission.MEMBERS_SEND_INVITE, label: "Send invites" },
25468
+ { id: OrgPermission.MEMBERS_RESEND_INVITE, label: "Resend invites" },
25469
+ { id: OrgPermission.MEMBERS_CANCEL_INVITE, label: "Cancel invites" },
25470
+ { id: OrgPermission.MEMBERS_UPDATE_ROLE, label: "Change member roles" },
25471
+ { id: OrgPermission.MEMBERS_ARCHIVE, label: "Deactivate members" },
25472
+ { id: OrgPermission.MEMBERS_DEMOTE_ADMIN, label: "Demote admins" },
25473
+ { id: OrgPermission.MEMBERS_TRANSFER_OWNERSHIP, label: "Transfer ownership" },
25474
+ {
25475
+ id: OrgPermission.ORG_MANAGE_OAUTH_CONNECTIONS,
25476
+ label: "Manage OAuth integrations"
25477
+ },
25478
+ {
25479
+ id: OrgPermission.ORG_MANAGE_NOTIFICATION_CHANNELS,
25480
+ label: "Manage notification channels"
25481
+ },
25482
+ {
25483
+ id: OrgPermission.ORG_MANAGE_EGRESS_POLICY,
25484
+ label: "Manage egress policy"
25485
+ },
25486
+ {
25487
+ id: OrgPermission.CRM_CONFIGURE_WATERFALLS,
25488
+ label: "Configure CRM waterfalls"
25489
+ },
25490
+ { id: OrgPermission.API_KEYS_MANAGE, label: "Manage API keys" },
25491
+ {
25492
+ id: OrgPermission.KNOWLEDGE_BASE_MODIFY,
25493
+ label: "Modify workspace knowledge base"
25494
+ },
25495
+ { id: OrgPermission.ADMIN_PORTAL_ACCESS, label: "Access admin portal" },
25496
+ {
25497
+ id: OrgPermission.ORG_SECURITY_ACCESS,
25498
+ label: "View workspace-wide security audit"
25499
+ },
25500
+ {
25501
+ id: OrgPermission.ORG_USAGE_ACCESS,
25502
+ label: "View workspace-wide usage audit"
25503
+ },
25504
+ {
25505
+ id: OrgPermission.ORG_EXECUTIONS_ACCESS,
25506
+ label: "View workspace-wide executions audit"
25507
+ },
25508
+ {
25509
+ id: OrgPermission.VIEW_ALL_WORKFLOWS,
25510
+ label: "View any member's workflows"
25511
+ },
25512
+ {
25513
+ id: OrgPermission.VIEW_ALL_CREDENTIALS,
25514
+ label: "View any member's credentials"
25515
+ },
25516
+ {
25517
+ id: OrgPermission.EDIT_ANY_WORKFLOW,
25518
+ label: "Edit any member's workflow via direct link"
25519
+ }
25520
+ ];
25521
+ var ROLES_BY_PERMISSION = {
25522
+ [OrgPermission.BILLING_REFILL_BALANCE]: ["Admin", "Owner"],
25523
+ [OrgPermission.BILLING_MANAGE_PAYMENT_METHODS]: ["Admin", "Owner"],
25524
+ [OrgPermission.ORG_UPDATE_NAME]: ["Admin", "Owner"],
25525
+ [OrgPermission.ORG_UPDATE_AUTOFILL]: ["Admin", "Owner"],
25526
+ [OrgPermission.MEMBERS_LIST_INVITES]: ["Admin", "Owner"],
25527
+ [OrgPermission.MEMBERS_SEND_INVITE]: ["Admin", "Owner"],
25528
+ [OrgPermission.MEMBERS_RESEND_INVITE]: ["Admin", "Owner"],
25529
+ [OrgPermission.MEMBERS_CANCEL_INVITE]: ["Admin", "Owner"],
25530
+ [OrgPermission.MEMBERS_UPDATE_ROLE]: ["Admin", "Owner"],
25531
+ [OrgPermission.MEMBERS_ARCHIVE]: ["Admin", "Owner"],
25532
+ [OrgPermission.MEMBERS_DEMOTE_ADMIN]: ["Owner"],
25533
+ [OrgPermission.MEMBERS_TRANSFER_OWNERSHIP]: ["Owner"],
25534
+ [OrgPermission.ORG_MANAGE_OAUTH_CONNECTIONS]: ["Admin", "Owner"],
25535
+ [OrgPermission.ORG_MANAGE_NOTIFICATION_CHANNELS]: ["Admin", "Owner"],
25536
+ [OrgPermission.ORG_MANAGE_EGRESS_POLICY]: ["Admin", "Owner"],
25537
+ [OrgPermission.CRM_CONFIGURE_WATERFALLS]: ["Admin", "Owner"],
25538
+ [OrgPermission.KNOWLEDGE_BASE_MODIFY]: ["Admin", "Owner"],
25539
+ // The two permissions that exist solely so cross-tenant operators
25540
+ // (God users) can do their job. They aren't tenant-admin powers and
25541
+ // shouldn't ever be granted to a regular workspace role.
25542
+ [OrgPermission.API_KEYS_MANAGE]: ["God"],
25543
+ [OrgPermission.ADMIN_PORTAL_ACCESS]: ["God"],
25544
+ [OrgPermission.ORG_SECURITY_ACCESS]: ["Admin", "Owner"],
25545
+ [OrgPermission.ORG_USAGE_ACCESS]: ["Admin", "Owner"],
25546
+ [OrgPermission.ORG_EXECUTIONS_ACCESS]: ["Admin", "Owner"],
25547
+ [OrgPermission.VIEW_ALL_WORKFLOWS]: ["Admin", "Owner"],
25548
+ [OrgPermission.VIEW_ALL_CREDENTIALS]: ["Admin", "Owner"],
25549
+ [OrgPermission.EDIT_ANY_WORKFLOW]: ["Admin", "Owner"]
25550
+ };
25551
+ var WORKFLOW_PERMISSION_ROLE_FLOOR = {
25552
+ [OrgPermission.EDIT_ANY_WORKFLOW]: "editor"
25553
+ };
25554
+
25555
+ // ../../packages/api/dist/types/audit.js
25556
+ import { z as z44 } from "zod";
25557
+ var AuditWindowSchema = z44.enum(["1d", "3d", "7d"]);
25558
+
25559
+ // ../../packages/api/dist/types/membershipApiKey.js
25560
+ import { z as z45 } from "zod";
25561
+ var API_KEY_SCOPES = ["all"];
25562
+ var ApiKeyScopeSchema = z45.enum(API_KEY_SCOPES);
25563
+ var CreateMembershipApiKeyRequestSchema = z45.object({
25564
+ name: z45.string().min(1).max(255),
25565
+ scopes: z45.array(ApiKeyScopeSchema).min(1).default(["all"])
25566
+ });
25567
+
25568
+ // ../../packages/api/dist/types/notification.js
25569
+ import { z as z46 } from "zod";
25570
+ var NotificationChannelProvider = z46.enum(["slack"]);
25571
+ var NotificationDeliveryChannel = z46.enum(["email", "slack"]);
25572
+ var NotificationType = z46.enum([
25573
+ "workflow_auto_disabled",
25574
+ "trigger_failed",
25575
+ "balance_auto_refilled",
25576
+ "balance_low",
25577
+ "credential_revoked",
25578
+ "workflow_shared",
25579
+ "credential_shared",
25580
+ "database_shared",
25581
+ "crm_reply_received",
25582
+ "crm_task_due"
25583
+ ]);
25584
+ var NotificationPreferencesSchema = z46.record(NotificationType, z46.array(NotificationDeliveryChannel));
25585
+ var WorkflowAutoDisabledPayloadSchema = z46.object({
25586
+ type: z46.literal("workflow_auto_disabled"),
25587
+ workflowId: z46.string(),
25588
+ workflowName: z46.string(),
25589
+ reason: z46.string()
25590
+ });
25591
+ var TriggerFailedPayloadSchema = z46.object({
25592
+ type: z46.literal("trigger_failed"),
25593
+ workflowId: z46.string(),
25594
+ workflowName: z46.string(),
25595
+ triggerId: z46.string(),
25596
+ reason: z46.string()
25597
+ });
25598
+ var BalanceAutoRefilledPayloadSchema = z46.object({
25599
+ type: z46.literal("balance_auto_refilled"),
25600
+ amountDollars: z46.number(),
25601
+ newBalanceDollars: z46.number()
25602
+ });
25603
+ var BalanceLowPayloadSchema = z46.object({
25604
+ type: z46.literal("balance_low"),
25605
+ balanceDollars: z46.number()
25606
+ });
25607
+ var CredentialRevokedPayloadSchema = z46.object({
25608
+ type: z46.literal("credential_revoked"),
25609
+ credentialTitle: z46.string(),
25610
+ service: z46.string()
25611
+ });
25612
+ var WorkflowSharedPayloadSchema = z46.object({
25613
+ type: z46.literal("workflow_shared"),
25614
+ workflowId: z46.string(),
25615
+ workflowName: z46.string(),
25616
+ /** The role the recipient was granted (`viewer` or `runner`).
25617
+ * Stored as a plain string so this schema doesn't have to import
25618
+ * the workflow-collaborator role enum and stay in lock-step with
25619
+ * it. The email service maps it to friendly copy. */
25620
+ role: z46.string(),
25621
+ /** Display name (or email fallback) of the user who shared. Used
25622
+ * in the email subject + subtitle copy. */
25623
+ sharedByName: z46.string()
25624
+ });
25625
+ var CredentialSharedPayloadSchema = z46.object({
25626
+ type: z46.literal("credential_shared"),
25627
+ credentialId: z46.string(),
25628
+ credentialTitle: z46.string(),
25629
+ service: z46.string(),
25630
+ /** Display name (or email fallback) of the user who shared. */
25631
+ sharedByName: z46.string()
25632
+ });
25633
+ var DatabaseSharedPayloadSchema = z46.object({
25634
+ type: z46.literal("database_shared"),
25635
+ databaseId: z46.string(),
25636
+ databaseName: z46.string(),
25637
+ /** The role the recipient was granted. Stored as a plain string so
25638
+ * this schema doesn't import the database-collaborator role enum. */
25639
+ role: z46.string(),
25640
+ /** Display name (or email fallback) of the user who shared. */
25641
+ sharedByName: z46.string()
25642
+ });
25643
+ var CrmReplyReceivedPayloadSchema = z46.object({
25644
+ type: z46.literal("crm_reply_received"),
25645
+ conversationId: z46.string(),
25646
+ /** Person's display name, or their email address as a fallback. */
25647
+ fromName: z46.string(),
25648
+ preview: z46.string()
25649
+ });
25650
+ var CrmTaskDuePayloadSchema = z46.object({
25651
+ type: z46.literal("crm_task_due"),
25652
+ taskId: z46.string(),
25653
+ taskTitle: z46.string()
25654
+ });
25655
+ var NotificationPayloadSchema = z46.discriminatedUnion("type", [
25656
+ WorkflowAutoDisabledPayloadSchema,
25657
+ TriggerFailedPayloadSchema,
25658
+ BalanceAutoRefilledPayloadSchema,
25659
+ BalanceLowPayloadSchema,
25660
+ CredentialRevokedPayloadSchema,
25661
+ WorkflowSharedPayloadSchema,
25662
+ CredentialSharedPayloadSchema,
25663
+ DatabaseSharedPayloadSchema,
25664
+ CrmReplyReceivedPayloadSchema,
25665
+ CrmTaskDuePayloadSchema
25666
+ ]);
25667
+ var ConnectNotificationChannelRequestSchema = z46.object({
25668
+ credentialId: z46.string().min(1)
25669
+ });
25670
+ var SetNotificationChannelAddressRequestSchema = z46.object({
25671
+ address: z46.string().min(1)
25672
+ });
25673
+
25674
+ // ../../packages/api/dist/types/organizationOAuthConnection.js
25675
+ var OAUTH_PROVIDER_GROUPS = {
25676
+ google: {
25677
+ title: "Google",
25678
+ iconUrl: "https://icons.generalinput.com/google.png",
25679
+ services: [
25680
+ "gmail",
25681
+ "google-sheets",
25682
+ "google-drive",
25683
+ "google-calendar",
25684
+ "google-docs",
25685
+ "google-tasks",
25686
+ "google-contacts",
25687
+ "google-meet",
25688
+ "google-photos",
25689
+ "google-analytics",
25690
+ "google-slides",
25691
+ "google-forms",
25692
+ "google-vault",
25693
+ "google-groups",
25694
+ "youtube",
25695
+ "google-search-console"
25696
+ ]
25697
+ },
25698
+ microsoft: {
25699
+ title: "Microsoft",
25700
+ iconUrl: "https://icons.generalinput.com/microsoft.png",
25701
+ services: [
25702
+ "microsoft-outlook",
25703
+ "microsoft-excel",
25704
+ "microsoft-onedrive",
25705
+ "microsoft-todo",
25706
+ "microsoft-sharepoint",
25707
+ "microsoft-planner"
25708
+ ]
25709
+ },
25710
+ github: {
25711
+ title: "GitHub",
25712
+ iconUrl: "https://icons.generalinput.com/github.png",
25713
+ services: ["github"]
25714
+ },
25715
+ linear: {
25716
+ title: "Linear",
25717
+ iconUrl: "https://icons.generalinput.com/linear.png",
25718
+ services: ["linear"]
25719
+ },
25720
+ hubspot: {
25721
+ title: "HubSpot",
25722
+ iconUrl: "https://icons.generalinput.com/hubspot.png",
25723
+ services: ["hubspot"]
25724
+ },
25725
+ salesforce: {
25726
+ title: "Salesforce",
25727
+ iconUrl: "https://icons.generalinput.com/salesforce.png",
25728
+ services: ["salesforce"]
25729
+ },
25730
+ attio: {
25731
+ title: "Attio",
25732
+ iconUrl: "https://icons.generalinput.com/attio.png",
25733
+ services: ["attio"]
25734
+ },
25735
+ zoho: {
25736
+ title: "Zoho",
25737
+ iconUrl: "https://icons.generalinput.com/zoho-crm.png",
25738
+ services: ["zoho-crm"]
25739
+ },
25740
+ dropbox: {
25741
+ title: "Dropbox",
25742
+ iconUrl: "https://icons.generalinput.com/dropbox.png",
25743
+ services: ["dropbox"]
25744
+ },
25745
+ box: {
25746
+ title: "Box",
25747
+ iconUrl: "https://icons.generalinput.com/box.png",
25748
+ services: ["box"]
25749
+ },
25750
+ airtable: {
25751
+ title: "Airtable",
25752
+ iconUrl: "https://icons.generalinput.com/airtable.png",
25753
+ services: ["airtable"]
25754
+ },
25755
+ calendly: {
25756
+ title: "Calendly",
25757
+ iconUrl: "https://icons.generalinput.com/calendly.png",
25758
+ services: ["calendly"]
25759
+ },
25760
+ ramp: {
25761
+ title: "Ramp",
25762
+ iconUrl: "https://icons.generalinput.com/ramp.png",
25763
+ services: ["ramp"]
25764
+ },
25765
+ shopify: {
25766
+ title: "Shopify",
25767
+ iconUrl: "https://icons.generalinput.com/shopify.png",
25768
+ services: ["shopify"]
25769
+ },
25770
+ gong: {
25771
+ title: "Gong",
25772
+ iconUrl: "https://icons.generalinput.com/gong.png",
25773
+ services: ["gong"]
25774
+ },
25775
+ zoominfo: {
25776
+ title: "ZoomInfo",
25777
+ iconUrl: "https://icons.generalinput.com/zoominfo.png",
25778
+ services: ["zoominfo"]
25779
+ },
25780
+ slack: {
25781
+ title: "Slack",
25782
+ iconUrl: "https://icons.generalinput.com/slack.png",
25783
+ services: ["slack", "slackbot"]
25784
+ },
25785
+ teams: {
25786
+ title: "Microsoft Teams",
25787
+ iconUrl: "https://icons.generalinput.com/microsoft-teams.png",
25788
+ services: ["microsoft-teams"]
25789
+ },
25790
+ basecamp: {
25791
+ title: "Basecamp",
25792
+ iconUrl: "https://icons.generalinput.com/basecamp.png",
25793
+ services: ["basecamp"]
25794
+ },
25795
+ docusign: {
25796
+ title: "Docusign",
25797
+ iconUrl: "https://icons.generalinput.com/docusign.png",
25798
+ services: ["docusign"]
25799
+ },
25800
+ jira: {
25801
+ title: "Jira",
25802
+ iconUrl: "https://icons.generalinput.com/jira-software-cloud.png",
25803
+ services: ["jira"]
25804
+ },
25805
+ asana: {
25806
+ title: "Asana",
25807
+ iconUrl: "https://icons.generalinput.com/asana.png",
25808
+ services: ["asana"]
25809
+ },
25810
+ "amazon-seller-partner": {
25811
+ title: "Amazon Seller Partner",
25812
+ iconUrl: "https://icons.generalinput.com/amazon-seller.png",
25813
+ services: ["amazon-seller-partner"]
25814
+ },
25815
+ webflow: {
25816
+ title: "Webflow",
25817
+ iconUrl: "https://icons.generalinput.com/webflow.png",
25818
+ services: ["webflow"]
25819
+ },
25820
+ "constant-contact": {
25821
+ title: "Constant Contact",
25822
+ iconUrl: "https://icons.generalinput.com/constant-contact.png",
25823
+ services: ["constant-contact"]
25824
+ },
25825
+ wrike: {
25826
+ title: "Wrike",
25827
+ iconUrl: "https://icons.generalinput.com/wrike.png",
25828
+ services: ["wrike"]
25829
+ },
25830
+ xero: {
25831
+ title: "Xero",
25832
+ iconUrl: "https://icons.generalinput.com/xero.png",
25833
+ services: ["xero"]
25834
+ },
25835
+ snowflake: {
25836
+ title: "Snowflake",
25837
+ iconUrl: "https://icons.generalinput.com/snowflake.png",
25838
+ services: ["snowflake"]
25839
+ },
25840
+ "meta-ads": {
25841
+ title: "Meta Ads",
25842
+ iconUrl: "https://icons.generalinput.com/meta-ads.jpg",
25843
+ services: ["meta-ads"]
25844
+ },
25845
+ "linkedin-ads": {
25846
+ title: "LinkedIn Ads",
25847
+ iconUrl: "https://icons.generalinput.com/linkedin-ads.png",
25848
+ services: ["linkedin-ads"]
25849
+ },
25850
+ canva: {
25851
+ title: "Canva",
25852
+ iconUrl: "https://icons.generalinput.com/canva.png",
25853
+ services: ["canva"]
25854
+ },
25855
+ clickup: {
25856
+ title: "ClickUp",
25857
+ iconUrl: "https://icons.generalinput.com/clickup.png",
25858
+ services: ["clickup"]
25859
+ },
25860
+ fitbit: {
25861
+ title: "Fitbit",
25862
+ iconUrl: "https://icons.generalinput.com/fitbit.svg",
25863
+ services: ["fitbit"]
25864
+ },
25865
+ zoom: {
25866
+ title: "Zoom",
25867
+ iconUrl: "https://icons.generalinput.com/zoom.png",
25868
+ services: ["zoom"]
25869
+ },
25870
+ "adobe-sign": {
25871
+ title: "Adobe Acrobat Sign",
25872
+ iconUrl: "https://icons.generalinput.com/adobe-sign.png",
25873
+ services: ["adobe-sign"]
25874
+ },
25875
+ pipedrive: {
25876
+ title: "Pipedrive",
25877
+ iconUrl: "https://icons.generalinput.com/pipedrive.png",
25878
+ services: ["pipedrive"]
25879
+ },
25880
+ "tiktok-ads": {
25881
+ title: "TikTok Ads",
25882
+ iconUrl: "https://icons.generalinput.com/tiktok-ads.webp",
25883
+ services: ["tiktok-ads"]
25884
+ },
25885
+ bamboohr: {
25886
+ title: "BambooHR",
25887
+ iconUrl: "https://icons.generalinput.com/bamboohr.png",
25888
+ services: ["bamboohr"]
25889
+ },
25890
+ addepar: {
25891
+ title: "Addepar",
25892
+ iconUrl: "https://icons.generalinput.com/addepar.jpg",
25893
+ services: ["addepar"]
25894
+ },
25895
+ "product-hunt": {
25896
+ title: "Product Hunt",
25897
+ iconUrl: "https://icons.generalinput.com/product-hunt.png",
25898
+ services: ["product-hunt"]
25899
+ },
25900
+ ironclad: {
25901
+ title: "Ironclad",
25902
+ iconUrl: "https://icons.generalinput.com/ironclad.png",
25903
+ services: ["ironclad"]
25904
+ },
25905
+ "dropbox-sign": {
25906
+ title: "Dropbox Sign",
25907
+ iconUrl: "https://icons.generalinput.com/dropbox-sign.png",
25908
+ services: ["dropbox-sign"]
25909
+ },
25910
+ bullhorn: {
25911
+ title: "Bullhorn",
25912
+ iconUrl: "https://icons.generalinput.com/bullhorn.png",
25913
+ services: ["bullhorn"]
25914
+ }
25915
+ };
25916
+
25917
+ // ../../packages/api/dist/types/personalOAuthConnection.js
25918
+ var PERSONAL_OAUTH_PROVIDER_GROUPS = {
25919
+ x: {
25920
+ title: "X (Twitter)",
25921
+ iconUrl: "https://icons.generalinput.com/x-twitter.png",
25922
+ services: ["twitter"]
25923
+ },
25924
+ linkedin: {
25925
+ title: "LinkedIn",
25926
+ iconUrl: "https://icons.generalinput.com/linkedin.png",
25927
+ services: ["linkedin", "linkedin-ad-library"]
25928
+ },
25929
+ strava: {
25930
+ title: "Strava",
25931
+ iconUrl: "https://icons.generalinput.com/strava.png",
25932
+ services: ["strava"]
25933
+ }
25934
+ };
25935
+
25936
+ // ../../packages/api/dist/types/prompt.js
25937
+ import { z as z47 } from "zod";
25938
+ var PromptWorkflowTypeSchema = z47.enum(["code", "agent"]);
25939
+ var PromptStatusSchema = z47.enum(["draft", "published"]);
25940
+ var PromptCachedServiceSchema = z47.object({
25941
+ slug: z47.string(),
25942
+ name: z47.string(),
25943
+ iconUrl: z47.string(),
25944
+ category: z47.string().optional()
25945
+ });
25946
+ var PromptIntegrationSchema = z47.object({
25947
+ service: z47.string(),
25948
+ title: z47.string(),
25949
+ iconUrl: z47.string()
25950
+ });
25951
+ var PromptFaqSchema = z47.object({
25952
+ question: z47.string(),
25953
+ answer: z47.string()
25954
+ });
25955
+ var PromptExampleOutputSchema = z47.object({
25956
+ kind: z47.enum(["text", "image"]),
25957
+ value: z47.string()
25958
+ });
25959
+ var PromptCategorySchema = z47.object({
25960
+ id: z47.string(),
25961
+ slug: z47.string(),
25962
+ name: z47.string(),
25963
+ description: z47.string().nullable(),
25964
+ ogImageUrl: z47.string().nullable(),
25965
+ icon: z47.string(),
25966
+ sortOrder: z47.number(),
25967
+ updatedAt: z47.string()
25968
+ });
25969
+ var PromptUseCaseSchema = z47.object({
25970
+ id: z47.string(),
25971
+ slug: z47.string(),
25972
+ name: z47.string(),
25973
+ description: z47.string().nullable(),
25974
+ ogImageUrl: z47.string().nullable(),
25975
+ icon: z47.string(),
25976
+ sortOrder: z47.number(),
25977
+ updatedAt: z47.string()
25978
+ });
25979
+ var PromptSummarySchema = z47.object({
25980
+ id: z47.string(),
25981
+ slug: z47.string(),
25982
+ title: z47.string(),
25983
+ subtitle: z47.string(),
25984
+ ogImageUrl: z47.string().nullable(),
25985
+ workflowType: PromptWorkflowTypeSchema,
25986
+ status: PromptStatusSchema,
25987
+ services: z47.array(PromptCachedServiceSchema),
25988
+ publishedAt: z47.string().nullable(),
25989
+ updatedAt: z47.string()
25990
+ });
25991
+ var PromptDetailSchema = z47.object({
25992
+ id: z47.string(),
25993
+ slug: z47.string(),
25994
+ title: z47.string(),
25995
+ metaTitle: z47.string().nullable(),
25996
+ subtitle: z47.string(),
25997
+ whatItDoes: z47.array(z47.string()),
25998
+ whatYoullNeed: z47.array(z47.string()),
25999
+ howToCustomize: z47.array(z47.string()),
26000
+ promptDoc: z47.unknown(),
26001
+ exampleOutput: PromptExampleOutputSchema.nullable(),
26002
+ faqs: z47.array(PromptFaqSchema),
26003
+ ctaTitle: z47.string().nullable(),
26004
+ ctaDescription: z47.string().nullable(),
26005
+ ogImageUrl: z47.string().nullable(),
26006
+ services: z47.array(PromptCachedServiceSchema),
26007
+ workflowType: PromptWorkflowTypeSchema,
26008
+ status: PromptStatusSchema,
26009
+ categories: z47.array(PromptCategorySchema),
26010
+ useCases: z47.array(PromptUseCaseSchema),
26011
+ relatedPrompts: z47.array(PromptSummarySchema),
26012
+ publishedAt: z47.string().nullable()
26013
+ });
26014
+
26015
+ // ../../packages/api/dist/types/globalSearch.js
26016
+ import { z as z48 } from "zod";
26017
+ var GlobalSearchRequestSchema2 = z48.object({
26018
+ query: z48.string().min(1).max(200),
26019
+ // Per-entity cap; the response holds up to one block of this many per type.
26020
+ limitPerType: z48.number().int().min(1).max(20).default(6)
26021
+ });
26022
+ var GlobalSearchRecentsRequestSchema = z48.object({
26023
+ limitPerType: z48.number().int().min(1).max(20).default(5)
26024
+ });
26025
+
26026
+ // ../../packages/api/dist/types/commandCenter.js
26027
+ import { z as z49 } from "zod";
26028
+ var CommandCenterTileLayoutSchema = z49.object({
26029
+ x: z49.number().int().min(0),
26030
+ y: z49.number().int().min(0),
26031
+ w: z49.number().int().min(1),
26032
+ h: z49.number().int().min(1)
26033
+ });
26034
+
26035
+ // ../../packages/api/dist/types/cli/exec.js
26036
+ import { z as z50 } from "zod";
26037
+ var CodeExecutionOutputLineSchema = z50.discriminatedUnion("type", [
26038
+ z50.object({
26039
+ type: z50.literal("log"),
26040
+ level: z50.enum(["info", "warn", "error"]),
26041
+ message: z50.string(),
26042
+ data: z50.unknown().optional()
26043
+ }),
26044
+ z50.object({
26045
+ type: z50.literal("result"),
26046
+ data: z50.unknown()
26047
+ }),
26048
+ z50.object({
26049
+ type: z50.literal("error"),
26050
+ error: z50.string(),
26051
+ stack: z50.string().optional()
26052
+ })
26053
+ ]);
26054
+ var CodeExecutionResultSchema = z50.discriminatedUnion("success", [
26055
+ z50.object({
26056
+ success: z50.literal(true),
26057
+ result: z50.unknown(),
26058
+ logs: z50.array(z50.object({
26059
+ level: z50.string(),
26060
+ message: z50.string(),
26061
+ data: z50.unknown().optional()
26062
+ })),
26063
+ stderr: z50.string().optional()
26064
+ }),
26065
+ z50.object({
26066
+ success: z50.literal(false),
26067
+ error: z50.string(),
26068
+ logs: z50.array(z50.object({
26069
+ level: z50.string(),
26070
+ message: z50.string(),
26071
+ data: z50.unknown().optional()
26072
+ })),
26073
+ stderr: z50.string().optional()
26074
+ })
26075
+ ]);
26076
+
26077
+ // ../../packages/api/dist/oauthProviderLookup.js
26078
+ var SERVICE_TO_PROVIDER = /* @__PURE__ */ new Map();
26079
+ for (const [key, group] of Object.entries(OAUTH_PROVIDER_GROUPS)) {
26080
+ const provider = key;
26081
+ for (const service of group.services) {
26082
+ SERVICE_TO_PROVIDER.set(service, { type: "organization", provider });
26083
+ }
26084
+ }
26085
+ for (const [key, group] of Object.entries(PERSONAL_OAUTH_PROVIDER_GROUPS)) {
26086
+ const provider = key;
26087
+ for (const service of group.services) {
26088
+ SERVICE_TO_PROVIDER.set(service, { type: "personal", provider });
26089
+ }
26090
+ }
26091
+
26092
+ // src/lib/leadFilterArg.ts
26093
+ var FILTER_EXAMPLE = `--filter '[{"field":"seniority","operator":"any_of","values":["vp"]}]'`;
26094
+ function parseLeadFilterArg(raw) {
26095
+ let value;
26096
+ try {
26097
+ value = JSON.parse(raw);
26098
+ } catch {
26099
+ printError(`Invalid --filter: not valid JSON. Example: ${FILTER_EXAMPLE}`);
26100
+ exit(ExitCode.InternalError);
26101
+ }
26102
+ const parsed = z51.array(LeadFilterConditionSchema).safeParse(value);
26103
+ if (!parsed.success) {
26104
+ const issue = parsed.error.issues[0];
26105
+ const path = issue?.path.map(String).join(".");
26106
+ printError(
26107
+ `Invalid --filter: ${path ? `${path}: ` : ""}${issue?.message ?? "malformed conditions"}. Example: ${FILTER_EXAMPLE}`
26108
+ );
26109
+ exit(ExitCode.InternalError);
26110
+ }
26111
+ return parsed.data;
26112
+ }
26113
+
23912
26114
  // src/lib/leadBatchOutput.ts
23913
26115
  function isSameName(left, right) {
23914
26116
  return left.trim().toLowerCase() === right.trim().toLowerCase();
@@ -23956,6 +26158,9 @@ function registerCrmPeople(parent) {
23956
26158
  "[query]",
23957
26159
  "Free-text search (name, title, company). Omit to browse."
23958
26160
  ).option("--list <id>", "Only people in this list.").option("--company <id>", "Only people at this company.").option(
26161
+ "--filter <json>",
26162
+ `Column filter conditions: JSON array of {field, operator, value|values|min+max}, e.g. '[{"field":"seniority","operator":"any_of","values":["vp"]}]'. Fields include title, city, country, icpScore, skills, emailStatus, createdAt, custom.<key>, and more.`
26163
+ ).option(
23959
26164
  "--limit <n>",
23960
26165
  "Max results (1 to 100, default 25).",
23961
26166
  parsePositiveIntOption
@@ -24017,6 +26222,7 @@ async function executePeopleSearch(query, opts) {
24017
26222
  query,
24018
26223
  listId: opts.list,
24019
26224
  companyId: opts.company,
26225
+ conditions: opts.filter ? parseLeadFilterArg(opts.filter) : void 0,
24020
26226
  limit: opts.limit
24021
26227
  });
24022
26228
  if (opts.json) {
@@ -24054,6 +26260,9 @@ function registerCrmCompanies(parent) {
24054
26260
  "[query]",
24055
26261
  "Free-text search (name, domain, industry). Omit to browse."
24056
26262
  ).option("--list <id>", "Only companies in this list.").option(
26263
+ "--filter <json>",
26264
+ `Column filter conditions: JSON array of {field, operator, value|values|min+max}, e.g. '[{"field":"employeeCount","operator":"gte","value":100}]'. Fields include industry, hqCountry, foundedYear, totalFundingUsd, techStack, createdAt, custom.<key>, and more.`
26265
+ ).option(
24057
26266
  "--limit <n>",
24058
26267
  "Max results (1 to 100, default 25).",
24059
26268
  parsePositiveIntOption
@@ -24114,6 +26323,7 @@ async function executeCompaniesSearch(query, opts) {
24114
26323
  const { results, nextCursor } = await crmService.searchCompanies({
24115
26324
  query,
24116
26325
  listId: opts.list,
26326
+ conditions: opts.filter ? parseLeadFilterArg(opts.filter) : void 0,
24117
26327
  limit: opts.limit
24118
26328
  });
24119
26329
  if (opts.json) {
@@ -25238,11 +27448,11 @@ function registerCrmWaterfalls(parent) {
25238
27448
  }
25239
27449
 
25240
27450
  // src/commands/crm/enrich.ts
25241
- var ENRICHMENT_BATCH_LIMIT = 25;
27451
+ var ENRICHMENT_BATCH_LIMIT2 = 25;
25242
27452
  function gateOrExit(personIds, yes) {
25243
- if (personIds.length > ENRICHMENT_BATCH_LIMIT) {
27453
+ if (personIds.length > ENRICHMENT_BATCH_LIMIT2) {
25244
27454
  printError(
25245
- `Too many people (${personIds.length}). Max ${ENRICHMENT_BATCH_LIMIT} per run.`
27455
+ `Too many people (${personIds.length}). Max ${ENRICHMENT_BATCH_LIMIT2} per run.`
25246
27456
  );
25247
27457
  exit(ExitCode.InvalidArgs);
25248
27458
  }
@@ -25266,7 +27476,7 @@ function registerCrmEnrich(parent) {
25266
27476
  const enrich = parent.command("enrich").description(
25267
27477
  "Find/verify contact info through the provider waterfalls. Paid: every verb spends credits and needs --yes."
25268
27478
  );
25269
- enrich.command("emails").argument("<personIds...>", `Person ids (max ${ENRICHMENT_BATCH_LIMIT}).`).description("Find work emails for people who don't have one yet.").option(
27479
+ enrich.command("emails").argument("<personIds...>", `Person ids (max ${ENRICHMENT_BATCH_LIMIT2}).`).description("Find work emails for people who don't have one yet.").option(
25270
27480
  "--retry-unverified",
25271
27481
  "Re-run people whose only email is unverified, skipping the providers that sourced it."
25272
27482
  ).option("--yes", "Confirm the paid run.").option("--json", "Machine-readable output.").action(async (personIds, opts) => {
@@ -25295,7 +27505,7 @@ function registerCrmEnrich(parent) {
25295
27505
  exitOnApiError(error);
25296
27506
  }
25297
27507
  });
25298
- enrich.command("phones").argument("<personIds...>", `Person ids (max ${ENRICHMENT_BATCH_LIMIT}).`).description("Find mobile numbers for people who don't have one yet.").option(
27508
+ enrich.command("phones").argument("<personIds...>", `Person ids (max ${ENRICHMENT_BATCH_LIMIT2}).`).description("Find mobile numbers for people who don't have one yet.").option(
25299
27509
  "--retry-unverified",
25300
27510
  "Re-run people whose only number is unverified, skipping the providers that sourced it."
25301
27511
  ).option("--yes", "Confirm the paid run.").option("--json", "Machine-readable output.").action(async (personIds, opts) => {
@@ -25324,7 +27534,7 @@ function registerCrmEnrich(parent) {
25324
27534
  exitOnApiError(error);
25325
27535
  }
25326
27536
  });
25327
- enrich.command("validate").argument("<personIds...>", `Person ids (max ${ENRICHMENT_BATCH_LIMIT}).`).description(
27537
+ enrich.command("validate").argument("<personIds...>", `Person ids (max ${ENRICHMENT_BATCH_LIMIT2}).`).description(
25328
27538
  "Verify deliverability of people's saved emails. Run before sequencing."
25329
27539
  ).option("--yes", "Confirm the paid run.").option("--json", "Machine-readable output.").action(async (personIds, opts) => {
25330
27540
  gateOrExit(personIds, opts.yes);
@@ -25581,6 +27791,110 @@ function printReport(checks) {
25581
27791
  }
25582
27792
  }
25583
27793
 
27794
+ // src/commands/upgrade.ts
27795
+ import { spawn as spawn3, execFileSync } from "child_process";
27796
+ import { realpathSync } from "fs";
27797
+ import { sep as sep2 } from "path";
27798
+ import { z as z52 } from "zod";
27799
+ import semver from "semver";
27800
+ var PACKAGE_NAME = "@general-input/cli";
27801
+ var registryLatestSchema = z52.object({ version: z52.string() });
27802
+ function registerUpgradeCommand(program2) {
27803
+ program2.command("upgrade").description(
27804
+ "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."
27805
+ ).option(
27806
+ "--check",
27807
+ "Report whether a newer version exists, without installing it."
27808
+ ).action(async (opts) => {
27809
+ const latest = await fetchLatestVersion();
27810
+ if (!semver.gt(latest, CLI_VERSION)) {
27811
+ printSuccess(`geni ${CLI_VERSION} is already the latest version.`);
27812
+ exit(ExitCode.Ok);
27813
+ }
27814
+ if (opts.check) {
27815
+ printInfo(
27816
+ `geni ${latest} is available (you have ${CLI_VERSION}). Run \`geni upgrade\` to install it.`
27817
+ );
27818
+ exit(ExitCode.UpgradeRequired);
27819
+ }
27820
+ const cliPath = resolveCliRealPath();
27821
+ const npmGlobalRoot = resolveNpmGlobalRoot();
27822
+ const isNpmManaged = cliPath !== null && npmGlobalRoot !== null && isInsideDirectory({ path: cliPath, directory: npmGlobalRoot });
27823
+ if (!isNpmManaged) {
27824
+ printError(
27825
+ `geni ${latest} is available (you have ${CLI_VERSION}), but this install isn't managed by \`npm install -g\` (binary resolves to ${cliPath ?? "an unknown path"}). Upgrade it the way it was installed \u2014 for a linked dev checkout: git pull && pnpm build.`
27826
+ );
27827
+ exit(ExitCode.GenericError);
27828
+ }
27829
+ printInfo(`Upgrading geni ${CLI_VERSION} \u2192 ${latest} \u2026`);
27830
+ const npmExitCode = await runNpmInstall();
27831
+ if (npmExitCode !== 0) {
27832
+ printError(
27833
+ `npm install failed (exit ${npmExitCode}). If that was a permissions error, retry with: sudo npm install -g ${PACKAGE_NAME}@latest`
27834
+ );
27835
+ exit(ExitCode.GenericError);
27836
+ }
27837
+ printSuccess(`geni upgraded to ${latest}.`);
27838
+ printInfo("Run `geni skills install` to refresh the agent-facing skills.");
27839
+ exit(ExitCode.Ok);
27840
+ });
27841
+ }
27842
+ async function fetchLatestVersion() {
27843
+ try {
27844
+ const response = await fetch(
27845
+ `https://registry.npmjs.org/${PACKAGE_NAME}/latest`,
27846
+ { signal: AbortSignal.timeout(1e4) }
27847
+ );
27848
+ if (!response.ok) {
27849
+ throw new Error(`npm registry responded ${response.status}`);
27850
+ }
27851
+ const parsed = registryLatestSchema.parse(await response.json());
27852
+ if (semver.valid(parsed.version) === null) {
27853
+ throw new Error(
27854
+ `npm registry returned invalid version "${parsed.version}"`
27855
+ );
27856
+ }
27857
+ return parsed.version;
27858
+ } catch (err) {
27859
+ const detail = err instanceof Error ? err.message : String(err);
27860
+ printError(
27861
+ `Could not check the npm registry for the latest version: ${detail}`
27862
+ );
27863
+ exit(ExitCode.GenericError);
27864
+ }
27865
+ }
27866
+ function resolveCliRealPath() {
27867
+ const binPath = process.argv[1];
27868
+ if (!binPath) return null;
27869
+ try {
27870
+ return realpathSync(binPath);
27871
+ } catch {
27872
+ return null;
27873
+ }
27874
+ }
27875
+ function resolveNpmGlobalRoot() {
27876
+ try {
27877
+ const root = execFileSync("npm", ["root", "-g"], {
27878
+ encoding: "utf-8"
27879
+ }).trim();
27880
+ return realpathSync(root);
27881
+ } catch {
27882
+ return null;
27883
+ }
27884
+ }
27885
+ function isInsideDirectory(args) {
27886
+ return args.path.startsWith(args.directory + sep2);
27887
+ }
27888
+ function runNpmInstall() {
27889
+ return new Promise((resolve20, reject) => {
27890
+ const child = spawn3("npm", ["install", "-g", `${PACKAGE_NAME}@latest`], {
27891
+ stdio: "inherit"
27892
+ });
27893
+ child.once("exit", (code) => resolve20(code ?? 1));
27894
+ child.once("error", (err) => reject(err));
27895
+ });
27896
+ }
27897
+
25584
27898
  // src/cli.ts
25585
27899
  process.removeAllListeners("warning");
25586
27900
  process.on("warning", (warning) => {
@@ -25608,6 +27922,7 @@ registerConfigCommands(program);
25608
27922
  registerSkillsCommands(program);
25609
27923
  registerCrmCommands(program);
25610
27924
  registerDoctorCommand(program);
27925
+ registerUpgradeCommand(program);
25611
27926
  program.addHelpText(
25612
27927
  "after",
25613
27928
  `
@@ -25631,6 +27946,7 @@ function shouldRunPreflight(argv) {
25631
27946
  const firstArg = argv[2];
25632
27947
  if (!firstArg) return false;
25633
27948
  if (firstArg === "doctor") return false;
27949
+ if (firstArg === "upgrade") return false;
25634
27950
  if (firstArg === "--help" || firstArg === "-h") return false;
25635
27951
  if (firstArg === "--version" || firstArg === "-v") return false;
25636
27952
  return true;