@general-input/cli 0.7.0 → 0.9.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
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env node
2
+ import { createRequire as __cliCreateRequire } from 'node:module'
3
+ const require = __cliCreateRequire(import.meta.url)
2
4
  var __create = Object.create;
3
5
  var __defProp = Object.defineProperty;
4
6
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -18286,7 +18288,7 @@ import chalk4 from "chalk";
18286
18288
  // package.json
18287
18289
  var package_default = {
18288
18290
  name: "@general-input/cli",
18289
- version: "0.7.0",
18291
+ version: "0.9.0",
18290
18292
  type: "module",
18291
18293
  description: "The agent-facing CLI for General Input. Authenticate, manage workflows, run bash with operator credentials injected by the cloud.",
18292
18294
  license: "SEE LICENSE IN LICENSE",
@@ -19319,6 +19321,32 @@ var CrmService = class {
19319
19321
  async deleteCompanies(ids) {
19320
19322
  return (await this.crm()).deleteCompanies(ids);
19321
19323
  }
19324
+ // ── Sequences (reads + draft CRUD; queueing is dashboard-only) ─────
19325
+ async listSequences(args) {
19326
+ return (await this.crm()).listSequences(args);
19327
+ }
19328
+ async listPersonSequences(personId) {
19329
+ return (await this.crm()).listPersonSequences(personId);
19330
+ }
19331
+ async getSequence(id) {
19332
+ return (await this.crm()).getSequence(id);
19333
+ }
19334
+ async createSequence(personId, body) {
19335
+ return (await this.crm()).createSequence(personId, body);
19336
+ }
19337
+ async updateSequence(id, body) {
19338
+ return (await this.crm()).updateSequence(id, body);
19339
+ }
19340
+ async deleteSequence(id) {
19341
+ await (await this.crm()).deleteSequence(id);
19342
+ }
19343
+ // ── Skills (read-only) ─────────────────────────────────────────────
19344
+ async listSkills() {
19345
+ return (await this.crm()).listSkills();
19346
+ }
19347
+ async getSkill(id) {
19348
+ return (await this.crm()).getSkill(id);
19349
+ }
19322
19350
  // ── Employments / contact points ───────────────────────────────────
19323
19351
  async addEmployment(personId, body) {
19324
19352
  return (await this.crm()).addEmployment(personId, body);
@@ -19980,6 +20008,54 @@ var CrmApiClient = class {
19980
20008
  body: { ids }
19981
20009
  });
19982
20010
  }
20011
+ // ── Sequences (reads + draft CRUD — queueing is dashboard-only) ─────
20012
+ async listSequences(args) {
20013
+ this.http.requireAuthed();
20014
+ const params = new URLSearchParams();
20015
+ if (args.status) params.set("status", args.status);
20016
+ if (args.query) params.set("q", args.query);
20017
+ const queryString = params.toString();
20018
+ return this.http.fetch(
20019
+ `${CRM}/sequences${queryString ? `?${queryString}` : ""}`
20020
+ );
20021
+ }
20022
+ async listPersonSequences(personId) {
20023
+ this.http.requireAuthed();
20024
+ return this.http.fetch(`${CRM}/sequences/people/${enc(personId)}`);
20025
+ }
20026
+ async getSequence(sequenceId) {
20027
+ this.http.requireAuthed();
20028
+ return this.http.fetch(`${CRM}/sequences/${enc(sequenceId)}`);
20029
+ }
20030
+ async createSequence(personId, body) {
20031
+ this.http.requireAuthed();
20032
+ return this.http.fetch(`${CRM}/sequences/people/${enc(personId)}`, {
20033
+ method: "POST",
20034
+ body
20035
+ });
20036
+ }
20037
+ async updateSequence(sequenceId, body) {
20038
+ this.http.requireAuthed();
20039
+ return this.http.fetch(`${CRM}/sequences/${enc(sequenceId)}`, {
20040
+ method: "PUT",
20041
+ body
20042
+ });
20043
+ }
20044
+ async deleteSequence(sequenceId) {
20045
+ this.http.requireAuthed();
20046
+ await this.http.fetch(`${CRM}/sequences/${enc(sequenceId)}`, {
20047
+ method: "DELETE"
20048
+ });
20049
+ }
20050
+ // ── Skills (read-only) ─────────────────────────────────────────────
20051
+ async listSkills() {
20052
+ this.http.requireAuthed();
20053
+ return this.http.fetch(`${CRM}/skills`);
20054
+ }
20055
+ async getSkill(skillId) {
20056
+ this.http.requireAuthed();
20057
+ return this.http.fetch(`${CRM}/skills/${enc(skillId)}`);
20058
+ }
19983
20059
  // ── Employments (person sub-records) ───────────────────────────────
19984
20060
  async addEmployment(personId, body) {
19985
20061
  this.http.requireAuthed();
@@ -23488,7 +23564,7 @@ import {
23488
23564
  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";
23489
23565
 
23490
23566
  // src/skills/geni-crm.md
23491
- 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), 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, and more.\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`, `waterfalls`,\n`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.\n - `geni crm people update --json \'[{"id":"<id>","currentTitle":"VP Eng"}]\'` (batch, ids inline). `companies update` mirrors it.\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\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## 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';
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';
23492
23568
 
23493
23569
  // src/lib/skills.ts
23494
23570
  var GENI_SKILL_NAME = "geni";
@@ -23833,6 +23909,45 @@ function parseJsonObjectArg(raw) {
23833
23909
  return value;
23834
23910
  }
23835
23911
 
23912
+ // src/lib/leadBatchOutput.ts
23913
+ function isSameName(left, right) {
23914
+ return left.trim().toLowerCase() === right.trim().toLowerCase();
23915
+ }
23916
+ function submittedName(input, key) {
23917
+ if (!isRecord(input)) return null;
23918
+ const value = input[key];
23919
+ return typeof value === "string" ? value : null;
23920
+ }
23921
+ function printPeopleCreateMatchWarnings(inputs, response) {
23922
+ response.results.forEach((result, index) => {
23923
+ if ("error" in result || result.created) return;
23924
+ const submitted = submittedName(inputs[index], "fullName");
23925
+ if (!submitted || isSameName(submitted, result.person.fullName)) return;
23926
+ printWarning(
23927
+ `people[${index}] "${submitted}" matched existing person "${result.person.fullName}" (${result.person.id}) via a shared identity key (email/LinkedIn) \u2014 no new record created.`
23928
+ );
23929
+ });
23930
+ }
23931
+ function printCompaniesCreateMatchWarnings(inputs, response) {
23932
+ response.results.forEach((result, index) => {
23933
+ if ("error" in result || result.created) return;
23934
+ const submitted = submittedName(inputs[index], "name");
23935
+ if (!submitted || isSameName(submitted, result.company.name)) return;
23936
+ printWarning(
23937
+ `companies[${index}] "${submitted}" matched existing company "${result.company.name}" (${result.company.id}) via a shared domain \u2014 no new record created.`
23938
+ );
23939
+ });
23940
+ }
23941
+ function printLeadBatchFailureSummary(results, noun) {
23942
+ const failedIndexes = results.flatMap(
23943
+ (result, index) => "error" in result ? [index] : []
23944
+ );
23945
+ if (failedIndexes.length === 0) return;
23946
+ printWarning(
23947
+ `${failedIndexes.length} of ${results.length} ${noun} failed (items ${failedIndexes.join(", ")}) \u2014 see the "error" entries in the JSON output.`
23948
+ );
23949
+ }
23950
+
23836
23951
  // src/commands/crm/people.ts
23837
23952
  function registerCrmPeople(parent) {
23838
23953
  const people = parent.command("people").description(
@@ -23863,19 +23978,27 @@ function registerCrmPeople(parent) {
23863
23978
  "Create people (find-or-create, deduped org-wide). --json is an array of person objects; each needs fullName, plus optional companyName/companyDomain, email, linkedinUrl, title, etc."
23864
23979
  ).requiredOption("--json <array>", "JSON array of people to create.").action(async (opts) => {
23865
23980
  try {
23866
- printJson(await crmService.createPeople(parseJsonArrayArg(opts.json)));
23981
+ const people2 = parseJsonArrayArg(opts.json);
23982
+ const response = await crmService.createPeople(people2);
23983
+ printJson(response);
23984
+ printPeopleCreateMatchWarnings(people2, response);
23985
+ printLeadBatchFailureSummary(response.results, "people");
23867
23986
  } catch (error) {
23868
23987
  exitOnApiError(error);
23869
23988
  }
23870
23989
  });
23871
23990
  people.command("update").description(
23872
- "Update people by id. --json is an array of { id, ...fields }."
23991
+ "Update people by id. --json is an array of { id, ...fields }. Fields take the write names from create (title, linkedinUrl, \u2026), not read names like currentTitle; unknown keys are rejected."
23873
23992
  ).requiredOption(
23874
23993
  "--json <array>",
23875
23994
  "JSON array of { id, ...fields } updates."
23876
23995
  ).action(async (opts) => {
23877
23996
  try {
23878
- printJson(await crmService.updatePeople(parseJsonArrayArg(opts.json)));
23997
+ const response = await crmService.updatePeople(
23998
+ parseJsonArrayArg(opts.json)
23999
+ );
24000
+ printJson(response);
24001
+ printLeadBatchFailureSummary(response.results, "people");
23879
24002
  } catch (error) {
23880
24003
  exitOnApiError(error);
23881
24004
  }
@@ -23953,23 +24076,27 @@ function registerCrmCompanies(parent) {
23953
24076
  "Create companies (find-or-create, deduped by domain). --json is an array of company objects; each needs name, plus optional domain and firmographics."
23954
24077
  ).requiredOption("--json <array>", "JSON array of companies to create.").action(async (opts) => {
23955
24078
  try {
23956
- printJson(
23957
- await crmService.createCompanies(parseJsonArrayArg(opts.json))
23958
- );
24079
+ const companies2 = parseJsonArrayArg(opts.json);
24080
+ const response = await crmService.createCompanies(companies2);
24081
+ printJson(response);
24082
+ printCompaniesCreateMatchWarnings(companies2, response);
24083
+ printLeadBatchFailureSummary(response.results, "companies");
23959
24084
  } catch (error) {
23960
24085
  exitOnApiError(error);
23961
24086
  }
23962
24087
  });
23963
24088
  companies.command("update").description(
23964
- "Update companies by id. --json is an array of { id, ...fields }."
24089
+ "Update companies by id. --json is an array of { id, ...fields }. Fields take the write names from create; unknown keys are rejected."
23965
24090
  ).requiredOption(
23966
24091
  "--json <array>",
23967
24092
  "JSON array of { id, ...fields } updates."
23968
24093
  ).action(async (opts) => {
23969
24094
  try {
23970
- printJson(
23971
- await crmService.updateCompanies(parseJsonArrayArg(opts.json))
24095
+ const response = await crmService.updateCompanies(
24096
+ parseJsonArrayArg(opts.json)
23972
24097
  );
24098
+ printJson(response);
24099
+ printLeadBatchFailureSummary(response.results, "companies");
23973
24100
  } catch (error) {
23974
24101
  exitOnApiError(error);
23975
24102
  }
@@ -24910,6 +25037,180 @@ function registerCrmContactPoints(parent) {
24910
25037
  });
24911
25038
  }
24912
25039
 
25040
+ // src/commands/crm/sequences.ts
25041
+ var SEQUENCE_STATUSES = [
25042
+ "draft",
25043
+ "queued",
25044
+ "sending",
25045
+ "completed",
25046
+ "stopped",
25047
+ "replied"
25048
+ ];
25049
+ function statusOrExit(value) {
25050
+ if (value === void 0) return void 0;
25051
+ const match = SEQUENCE_STATUSES.find((status) => status === value);
25052
+ if (match === void 0) {
25053
+ printError(
25054
+ `Unknown --status "${value}". Expected one of: ${SEQUENCE_STATUSES.join(", ")}.`
25055
+ );
25056
+ exit(ExitCode.InternalError);
25057
+ }
25058
+ return match;
25059
+ }
25060
+ function registerCrmSequences(parent) {
25061
+ const sequences = parent.command("sequences").description(
25062
+ "List email sequences (default), or get / create / update / delete drafts. Queueing and sending happen in the dashboard."
25063
+ ).option("--person <id>", "Only this person's sequences.").option(
25064
+ "--status <status>",
25065
+ "Filter: draft, queued, sending, completed, stopped, or replied."
25066
+ ).option("--json", "Machine-readable output.").action((opts) => executeSequencesList(opts));
25067
+ sequences.command("get").argument("<id>", "Sequence id.").description(
25068
+ "One sequence with its steps. Use --field to extract a value (e.g. status)."
25069
+ ).option("--field <path>", "Print one dotted-path value.").action(async (id, opts) => {
25070
+ try {
25071
+ printJsonOrField(await crmService.getSequence(id), opts.field);
25072
+ } catch (error) {
25073
+ exitOnApiError(error, {
25074
+ notFoundMessage: `No sequence with id "${id}" in this workspace.`
25075
+ });
25076
+ }
25077
+ });
25078
+ sequences.command("create").description(
25079
+ "Draft a sequence for a person. --json: { steps: [{ subject?, body, waitDays }], recipientContactPointId?, emailAccountId? }. The draft stays unsent until someone queues it in the dashboard."
25080
+ ).requiredOption("--person <id>", "Person the sequence targets.").requiredOption("--json <body>", "JSON sequence definition.").action(async (opts) => {
25081
+ try {
25082
+ printJson(
25083
+ await crmService.createSequence(
25084
+ opts.person,
25085
+ parseJsonObjectArg(opts.json)
25086
+ )
25087
+ );
25088
+ } catch (error) {
25089
+ exitOnApiError(error);
25090
+ }
25091
+ });
25092
+ sequences.command("update").argument("<id>", "Sequence id.").description(
25093
+ "Replace a draft wholesale (steps, recipient, inbox). Drafts only \u2014 queued or sent sequences cannot be edited."
25094
+ ).requiredOption("--json <body>", "JSON sequence definition.").action(async (id, opts) => {
25095
+ try {
25096
+ printJson(
25097
+ await crmService.updateSequence(id, parseJsonObjectArg(opts.json))
25098
+ );
25099
+ } catch (error) {
25100
+ exitOnApiError(error, {
25101
+ notFoundMessage: `No sequence with id "${id}" in this workspace.`
25102
+ });
25103
+ }
25104
+ });
25105
+ sequences.command("delete").argument("<id>", "Sequence id.").description("Delete a draft or finished sequence (active ones refuse).").action(async (id) => {
25106
+ try {
25107
+ await crmService.deleteSequence(id);
25108
+ printSuccess("Sequence deleted.");
25109
+ } catch (error) {
25110
+ exitOnApiError(error, {
25111
+ notFoundMessage: `No sequence with id "${id}" in this workspace.`
25112
+ });
25113
+ }
25114
+ });
25115
+ }
25116
+ async function executeSequencesList(opts) {
25117
+ const status = statusOrExit(opts.status);
25118
+ try {
25119
+ if (opts.person) {
25120
+ const all = await crmService.listPersonSequences(opts.person);
25121
+ const results2 = status ? all.filter((sequence) => sequence.status === status) : all;
25122
+ if (opts.json) {
25123
+ printJson(results2);
25124
+ return;
25125
+ }
25126
+ if (results2.length === 0) {
25127
+ process.stdout.write("No sequences match.\n");
25128
+ return;
25129
+ }
25130
+ printTable(
25131
+ ["ID", "STATUS", "STEPS", "RECIPIENT", "UPDATED"],
25132
+ results2.map((sequence) => [
25133
+ sequence.id,
25134
+ sequence.status,
25135
+ String(sequence.steps.length),
25136
+ sequence.recipientEmail ?? "",
25137
+ sequence.updatedAt.slice(0, 10)
25138
+ ]),
25139
+ { colorFn: dimColumn(0) }
25140
+ );
25141
+ return;
25142
+ }
25143
+ const results = await crmService.listSequences({ status });
25144
+ if (opts.json) {
25145
+ printJson(results);
25146
+ return;
25147
+ }
25148
+ if (results.length === 0) {
25149
+ process.stdout.write("No sequences match.\n");
25150
+ return;
25151
+ }
25152
+ printTable(
25153
+ ["ID", "PERSON", "STATUS", "STEPS", "RECIPIENT", "UPDATED"],
25154
+ results.map((sequence) => [
25155
+ sequence.id,
25156
+ sequence.personName,
25157
+ sequence.status,
25158
+ String(sequence.stepCount),
25159
+ sequence.recipientEmail ?? "",
25160
+ sequence.updatedAt.slice(0, 10)
25161
+ ]),
25162
+ { colorFn: dimColumn(0) }
25163
+ );
25164
+ } catch (error) {
25165
+ exitOnApiError(error);
25166
+ }
25167
+ }
25168
+
25169
+ // src/commands/crm/skills.ts
25170
+ function registerCrmSkills(parent) {
25171
+ const skills = parent.command("skills").description(
25172
+ "List the workspace's agent skill playbooks (default), or get one's content."
25173
+ ).option("--json", "Machine-readable output.").action((opts) => executeSkillsList(opts));
25174
+ skills.command("get").argument("<id>", "Skill id (e.g. draft-sequence-person).").description(
25175
+ "A skill's playbook content \u2014 the org's customized variant when one exists, else the default. --json for the full record."
25176
+ ).option("--json", "Full record: content, default content, customization.").action(async (id, opts) => {
25177
+ try {
25178
+ const skill = await crmService.getSkill(id);
25179
+ if (opts.json) {
25180
+ printJson(skill);
25181
+ return;
25182
+ }
25183
+ process.stdout.write(`${skill.content}
25184
+ `);
25185
+ } catch (error) {
25186
+ exitOnApiError(error, {
25187
+ notFoundMessage: `No skill "${id}". Run \`geni crm skills\` to list ids.`
25188
+ });
25189
+ }
25190
+ });
25191
+ }
25192
+ async function executeSkillsList(opts) {
25193
+ try {
25194
+ const results = await crmService.listSkills();
25195
+ if (opts.json) {
25196
+ printJson(results);
25197
+ return;
25198
+ }
25199
+ printTable(
25200
+ ["ID", "NAME", "CUSTOMIZED", "DESCRIPTION"],
25201
+ results.map((skill) => [
25202
+ skill.id,
25203
+ skill.name,
25204
+ skill.custom ? "yes" : "",
25205
+ skill.description
25206
+ ]),
25207
+ { colorFn: dimColumn(0) }
25208
+ );
25209
+ } catch (error) {
25210
+ exitOnApiError(error);
25211
+ }
25212
+ }
25213
+
24913
25214
  // src/commands/crm/waterfalls.ts
24914
25215
  function registerCrmWaterfalls(parent) {
24915
25216
  parent.command("waterfalls").description(
@@ -25070,9 +25371,13 @@ function registerCrmCommands(program2) {
25070
25371
  registerCrmFields(crm);
25071
25372
  registerCrmEmployments(crm);
25072
25373
  registerCrmContactPoints(crm);
25374
+ registerCrmSequences(crm);
25375
+ registerCrmSkills(crm);
25073
25376
  registerCrmWaterfalls(crm);
25074
25377
  registerCrmEnrich(crm);
25075
25378
  crm.action(() => crm.help());
25379
+ crm.enablePositionalOptions();
25380
+ for (const noun of crm.commands) noun.enablePositionalOptions();
25076
25381
  }
25077
25382
 
25078
25383
  // src/commands/doctor.ts
@@ -25277,12 +25582,18 @@ function printReport(checks) {
25277
25582
  }
25278
25583
 
25279
25584
  // src/cli.ts
25585
+ process.removeAllListeners("warning");
25586
+ process.on("warning", (warning) => {
25587
+ if (warning.name === "ExperimentalWarning") return;
25588
+ process.stderr.write(`${warning.name}: ${warning.message}
25589
+ `);
25590
+ });
25280
25591
  var program = new Command();
25281
25592
  program.name("geni").description(
25282
25593
  "The agent-facing CLI for General Input. Discover the integrations and credentials the operator has connected, then run shell commands with those credentials injected as env vars by the cloud (audit-logged, output-scrubbed)."
25283
- ).version(CLI_VERSION, "-v, --version", "Print the geni version and exit.").showHelpAfterError().option(
25594
+ ).version(CLI_VERSION, "-v, --version", "Print the geni version and exit.").showHelpAfterError().enablePositionalOptions().option(
25284
25595
  "--workspace <slug>",
25285
- "Override the active workspace for this invocation. Without it, commands run against the workspace set by `geni workspace switch`."
25596
+ "Override the active workspace for this invocation (place before the subcommand). Without it, commands run against the workspace set by `geni workspace switch`."
25286
25597
  );
25287
25598
  registerAuthCommands(program);
25288
25599
  registerWorkspaceCommands(program);