@general-input/cli 0.14.1 → 0.16.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 +499 -123
- package/dist/cli.js.map +1 -1
- package/package.json +5 -5
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
|
|
2220
|
+
var z51 = [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
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2225
|
+
z51[0] ^= ah[0];
|
|
2226
|
+
z51[1] ^= ah[1];
|
|
2227
|
+
z51[2] ^= ah[2];
|
|
2228
|
+
z51[3] ^= ah[3];
|
|
2229
2229
|
}
|
|
2230
|
-
return
|
|
2230
|
+
return z51;
|
|
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,
|
|
5975
|
+
function bnpExp(e, z51) {
|
|
5976
5976
|
if (e > 4294967295 || e < 1) return BigInteger.ONE;
|
|
5977
|
-
var r = nbi(), r2 = nbi(), g =
|
|
5977
|
+
var r = nbi(), r2 = nbi(), g = z51.convert(this), i = nbits(e) - 1;
|
|
5978
5978
|
g.copyTo(r);
|
|
5979
5979
|
while (--i >= 0) {
|
|
5980
|
-
|
|
5981
|
-
if ((e & 1 << i) > 0)
|
|
5980
|
+
z51.sqrTo(r, r2);
|
|
5981
|
+
if ((e & 1 << i) > 0) z51.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
|
|
5988
|
+
return z51.revert(r);
|
|
5989
5989
|
}
|
|
5990
5990
|
function bnModPowInt(e, m) {
|
|
5991
|
-
var
|
|
5992
|
-
if (e < 256 || m.isEven())
|
|
5993
|
-
else
|
|
5994
|
-
return this.exp(e,
|
|
5991
|
+
var z51;
|
|
5992
|
+
if (e < 256 || m.isEven()) z51 = new Classic(m);
|
|
5993
|
+
else z51 = new Montgomery(m);
|
|
5994
|
+
return this.exp(e, z51);
|
|
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(),
|
|
6053
|
-
this.divRemTo(d, y,
|
|
6052
|
+
var d = nbv(a), y = nbi(), z51 = nbi(), r = "";
|
|
6053
|
+
this.divRemTo(d, y, z51);
|
|
6054
6054
|
while (y.signum() > 0) {
|
|
6055
|
-
r = (a +
|
|
6056
|
-
y.divRemTo(d, y,
|
|
6055
|
+
r = (a + z51.intValue()).toString(b).substr(1) + r;
|
|
6056
|
+
y.divRemTo(d, y, z51);
|
|
6057
6057
|
}
|
|
6058
|
-
return
|
|
6058
|
+
return z51.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),
|
|
6431
|
+
var i = e.bitLength(), k, r = nbv(1), z51;
|
|
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
|
-
|
|
6439
|
+
z51 = new Classic(m);
|
|
6440
6440
|
else if (m.isEven())
|
|
6441
|
-
|
|
6441
|
+
z51 = new Barrett(m);
|
|
6442
6442
|
else
|
|
6443
|
-
|
|
6443
|
+
z51 = new Montgomery(m);
|
|
6444
6444
|
var g = new Array(), n = 3, k1 = k - 1, km = (1 << k) - 1;
|
|
6445
|
-
g[1] =
|
|
6445
|
+
g[1] = z51.convert(this);
|
|
6446
6446
|
if (k > 1) {
|
|
6447
6447
|
var g2 = nbi();
|
|
6448
|
-
|
|
6448
|
+
z51.sqrTo(g[1], g2);
|
|
6449
6449
|
while (n <= km) {
|
|
6450
6450
|
g[n] = nbi();
|
|
6451
|
-
|
|
6451
|
+
z51.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
|
-
|
|
6478
|
-
|
|
6477
|
+
z51.sqrTo(r, r2);
|
|
6478
|
+
z51.sqrTo(r2, r);
|
|
6479
6479
|
n -= 2;
|
|
6480
6480
|
}
|
|
6481
|
-
if (n > 0)
|
|
6481
|
+
if (n > 0) z51.sqrTo(r, r2);
|
|
6482
6482
|
else {
|
|
6483
6483
|
t = r;
|
|
6484
6484
|
r = r2;
|
|
6485
6485
|
r2 = t;
|
|
6486
6486
|
}
|
|
6487
|
-
|
|
6487
|
+
z51.mulTo(r2, g[w], r);
|
|
6488
6488
|
}
|
|
6489
6489
|
while (j >= 0 && (e.data[j] & 1 << i) == 0) {
|
|
6490
|
-
|
|
6490
|
+
z51.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
|
|
6500
|
+
return z51.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.
|
|
18291
|
+
version: "0.16.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",
|
|
@@ -19790,6 +19790,13 @@ var CrmService = class {
|
|
|
19790
19790
|
async enrichPhones(args) {
|
|
19791
19791
|
return (await this.crm()).enrichPhones(args);
|
|
19792
19792
|
}
|
|
19793
|
+
// ── Playbooks ──────────────────────────────────────────────────────
|
|
19794
|
+
async listPlaybooks() {
|
|
19795
|
+
return (await this.crm()).listPlaybooks();
|
|
19796
|
+
}
|
|
19797
|
+
async runPlaybook(request) {
|
|
19798
|
+
return (await this.crm()).quickRunPlaybook(request);
|
|
19799
|
+
}
|
|
19793
19800
|
};
|
|
19794
19801
|
|
|
19795
19802
|
// src/clients/AuthApiClient.ts
|
|
@@ -20627,6 +20634,18 @@ var CrmApiClient = class {
|
|
|
20627
20634
|
body
|
|
20628
20635
|
});
|
|
20629
20636
|
}
|
|
20637
|
+
// ── Playbooks (agent launches — runner-session bearers only) ────────
|
|
20638
|
+
async listPlaybooks() {
|
|
20639
|
+
this.http.requireAuthed();
|
|
20640
|
+
return this.http.fetch(`${CRM}/playbooks`);
|
|
20641
|
+
}
|
|
20642
|
+
async quickRunPlaybook(body) {
|
|
20643
|
+
this.http.requireAuthed();
|
|
20644
|
+
return this.http.fetch(`${CRM}/threads/quick-run`, {
|
|
20645
|
+
method: "POST",
|
|
20646
|
+
body
|
|
20647
|
+
});
|
|
20648
|
+
}
|
|
20630
20649
|
};
|
|
20631
20650
|
|
|
20632
20651
|
// src/clients/SkillsApiClient.ts
|
|
@@ -20910,8 +20929,7 @@ var ChildProcessSpawner = class {
|
|
|
20910
20929
|
const stdoutClosed = pipeWithScrubbing(
|
|
20911
20930
|
child.stdout,
|
|
20912
20931
|
process.stdout,
|
|
20913
|
-
args.scrubber.stream()
|
|
20914
|
-
args.onStdoutChunk
|
|
20932
|
+
args.scrubber.stream()
|
|
20915
20933
|
);
|
|
20916
20934
|
const stderrClosed = pipeWithScrubbing(
|
|
20917
20935
|
child.stderr,
|
|
@@ -20940,13 +20958,12 @@ var ChildProcessSpawner = class {
|
|
|
20940
20958
|
}
|
|
20941
20959
|
}
|
|
20942
20960
|
};
|
|
20943
|
-
function pipeWithScrubbing(source, dest, scrubber
|
|
20961
|
+
function pipeWithScrubbing(source, dest, scrubber) {
|
|
20944
20962
|
return new Promise((resolve22) => {
|
|
20945
20963
|
let flushed = false;
|
|
20946
20964
|
const emit = (chunk) => {
|
|
20947
20965
|
if (chunk.length === 0) return;
|
|
20948
20966
|
dest.write(chunk);
|
|
20949
|
-
onChunk?.(chunk);
|
|
20950
20967
|
};
|
|
20951
20968
|
const finishOnce = () => {
|
|
20952
20969
|
if (flushed) return;
|
|
@@ -22035,6 +22052,7 @@ function registerWorkspaceCommands(program2) {
|
|
|
22035
22052
|
}
|
|
22036
22053
|
|
|
22037
22054
|
// src/commands/exec/bash.ts
|
|
22055
|
+
import { readFileSync as readFileSync6 } from "fs";
|
|
22038
22056
|
function registerExecBash(parent) {
|
|
22039
22057
|
parent.command("bash").description(
|
|
22040
22058
|
"Run `bash -lc <cmd>` locally with cloud-resolved credentials injected as env vars. Output is streamed back through a scrubber that replaces every registered secret with [REDACTED:credential_<id>]."
|
|
@@ -22048,6 +22066,9 @@ function registerExecBash(parent) {
|
|
|
22048
22066
|
"Why this credential is being accessed. Lands in the credential access log and is shown to the operator. Re-state on every call; the audit log is per-invocation.",
|
|
22049
22067
|
collect,
|
|
22050
22068
|
[]
|
|
22069
|
+
).option(
|
|
22070
|
+
"-f, --file <path>",
|
|
22071
|
+
"Read the command from a file instead of after `--`. Pass `-` to read it from stdin (heredoc or `< script.sh`). Preferred whenever the command has quotes or newlines: write the script to a file with your editor, then point --file at it \u2014 no shell-quoting layers to fight."
|
|
22051
22072
|
).option(
|
|
22052
22073
|
"--cwd <path>",
|
|
22053
22074
|
"Working directory for the command. Defaults to your current shell cwd."
|
|
@@ -22085,6 +22106,15 @@ Examples:
|
|
|
22085
22106
|
--cred cred_01HX --reason "Listing Slack channels" \\
|
|
22086
22107
|
-- 'curl -s -H "Authorization: Bearer $SLACK_ACCESS_TOKEN_01HX" https://slack.com/api/conversations.list'
|
|
22087
22108
|
|
|
22109
|
+
# Anything with nested quotes or a multi-line script: write it to a file,
|
|
22110
|
+
# then --file it. No shell-quoting layers, so inline jq/python just works:
|
|
22111
|
+
geni exec bash --cred cred_01HX --reason "Query QuickBooks" --file ./q.sh
|
|
22112
|
+
# ...or pipe it in via stdin:
|
|
22113
|
+
geni exec bash --cred cred_01HX --reason "Query QuickBooks" --file - <<'EOF'
|
|
22114
|
+
curl -s -H "Authorization: Bearer $QUICKBOOKS_ACCESS_TOKEN_01HX" "$URL" \\
|
|
22115
|
+
| jq '.QueryResponse.Account[] | {name: .Name, bal: .CurrentBalance}'
|
|
22116
|
+
EOF
|
|
22117
|
+
|
|
22088
22118
|
# Multiple credentials, fan-out (suffix keeps them distinct):
|
|
22089
22119
|
geni exec bash \\
|
|
22090
22120
|
--cred cred_slackA --reason "Posting to #engineering" \\
|
|
@@ -22105,11 +22135,37 @@ Exit codes:
|
|
|
22105
22135
|
function collect(value, prev) {
|
|
22106
22136
|
return [...prev, value];
|
|
22107
22137
|
}
|
|
22138
|
+
async function readStdin() {
|
|
22139
|
+
const chunks = [];
|
|
22140
|
+
for await (const chunk of process.stdin) {
|
|
22141
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
22142
|
+
}
|
|
22143
|
+
return Buffer.concat(chunks).toString("utf-8");
|
|
22144
|
+
}
|
|
22145
|
+
async function resolveCommand(opts, positional) {
|
|
22146
|
+
if (opts.file !== void 0) {
|
|
22147
|
+
if (positional.length > 0) {
|
|
22148
|
+
printError(
|
|
22149
|
+
"Pass the command with --file OR after `--`, not both. --file wins if you need quotes or newlines; drop the `-- ...` tail."
|
|
22150
|
+
);
|
|
22151
|
+
exit(ExitCode.InvalidArgs);
|
|
22152
|
+
}
|
|
22153
|
+
if (opts.file === "-") return readStdin();
|
|
22154
|
+
try {
|
|
22155
|
+
return readFileSync6(opts.file, "utf-8");
|
|
22156
|
+
} catch (error) {
|
|
22157
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
22158
|
+
printError(`Could not read --file ${opts.file}: ${detail}`);
|
|
22159
|
+
exit(ExitCode.InvalidArgs);
|
|
22160
|
+
}
|
|
22161
|
+
}
|
|
22162
|
+
return positional.join(" ").trim();
|
|
22163
|
+
}
|
|
22108
22164
|
async function runExecBash(opts, positional) {
|
|
22109
|
-
const command =
|
|
22110
|
-
if (!command) {
|
|
22165
|
+
const command = await resolveCommand(opts, positional);
|
|
22166
|
+
if (!command.trim()) {
|
|
22111
22167
|
printError(
|
|
22112
|
-
"Missing the bash command. Put it after a literal `--` (flags before `--` belong to geni). Example: `geni exec bash --cred cred_X --reason \"...\" -- 'curl ...'`."
|
|
22168
|
+
"Missing the bash command. Put it after a literal `--` (flags before `--` belong to geni), or pass `--file <path>` (`--file -` for stdin). Example: `geni exec bash --cred cred_X --reason \"...\" -- 'curl ...'`."
|
|
22113
22169
|
);
|
|
22114
22170
|
exit(ExitCode.InvalidArgs);
|
|
22115
22171
|
}
|
|
@@ -23964,13 +24020,13 @@ import {
|
|
|
23964
24020
|
mkdirSync as mkdirSync6,
|
|
23965
24021
|
writeFileSync as writeFileSync5,
|
|
23966
24022
|
existsSync as existsSync5,
|
|
23967
|
-
readFileSync as
|
|
24023
|
+
readFileSync as readFileSync7,
|
|
23968
24024
|
unlinkSync,
|
|
23969
24025
|
rmSync
|
|
23970
24026
|
} from "fs";
|
|
23971
24027
|
|
|
23972
24028
|
// src/skills/geni.md
|
|
23973
|
-
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, apps, and skills)\n\n`geni exec bash` is for one-off actions. When the user wants something\nsaved and reusable, build a **resource**. A resource is one of four\ntypes: a `code` **workflow** (deterministic, fixed steps, runs on a\nschedule or trigger), an `agent` **workflow** (LLM-driven, variable-length\ntasks like research or triage), an `app` (an interactive React mini-app\nwith server-side handlers, like a dashboard or internal tool), or a\n`skill` (a SKILL.md instruction bundle the platform's cloud agents load\nas context \u2014 not executed). The shared lifecycle lives under `geni\nresource`; type-specific tools under `geni workflow` and `geni app`.\n\nYou author the files locally with your own editor; the cloud validates,\nconfigures, publishes, and runs them. This is the same build loop as the\ngeni chat, just on the user's machine with your brain driving it. Same\nloop for every type; apps add a build step and handler tools (see\n\"Building apps\" below), skills drop the config step (see \"Building\nskills\" below).\n\n**Load the authoring skill first.** `geni skills load\n<code-workflow|agent-workflow|app|skill-authoring>` writes the platform's\nauthoring skill for that type into `geni-skills/<name>/`: `SKILL.md` (the\nmethod), `references/spec.md` (the full contract \u2014 required files, the\nruntime API, allowed and forbidden patterns), and `references/example/`\n(a complete, validated example to mirror). Read SKILL.md and the spec,\nand copy shapes from the example. (`skill-authoring` is the one type\nwhose short spec is inline in SKILL.md, with no example.) Don't write a\nsingle file before loading it.\n\nThe loop:\n\n1. `geni resource create --type code --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 + (code\n workflows) TypeScript check. Exit 9 means invalid; fix what it\n reports and re-run. For apps the compile gate is the publish build,\n not validate.\n4. `geni resource config set`: wire what the workflow needs. Find\n credential ids with `geni credential list`; set them with\n `--cred <service>=<credentialId>`. Set consts with `--const k=v`,\n schedules with `--schedule <triggerId>=<cron>`. `geni resource config\nget` shows the current state. Find trigger providers with\n `geni trigger list`.\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`; load the authoring skill with `geni skills load app` (its\n`references/` hold the contract, the component catalog, and a complete\nexample app). The shared commands work the same (validate, config set\nfor credential slots, publish), with these differences:\n\n- The scaffold is a whole Vite project. Edit only `app.json`, `src/App.tsx`,\n `src/pages/*`, your own `src/components/*`, and `handlers/*.ts`. Leave\n the platform-owned files alone.\n- `geni resource publish` builds the app; the result's `build` reports\n whether the Vite build passed. 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\n## Building skills\n\nA `skill` is a SKILL.md bundle (frontmatter `name` slug + `description`,\nthen the instructions body; optional `scripts/`, `references/`,\n`assets/`) that the platform's cloud agents load as context. It is not\nexecuted, so the loop is shorter: create --type skill -> edit SKILL.md ->\nvalidate -> publish. No `config set` (nothing to wire) and publish needs\nno `--summary`. The frontmatter `description` is the only thing agents\nsee before deciding to load it, so it must say what the skill does AND\nwhen to use it. Skill ids are `skl_`-prefixed; pull/validate/publish\nwork on them like any resource.\n\nA skill is never run and has no triggers. Once published, tell the user\nit's in their dashboard Skills page, ready for their agents to load into\nfuture work. Commands accept the skill id as a positional or infer it\nfrom the marker in the current directory.\n\n## 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- `79` \u2014 this geni is below the server's minimum version. Run\n `geni upgrade`, then `geni skills install`, and retry.\n\n## Don't\n\n- Don't construct a curl without reading the operation docs first.\n Guessing at URLs and env var names is the most common failure mode.\n- Don't hand-write resource files before loading the authoring skill\n (`geni skills load <code-workflow|agent-workflow|app|skill-authoring>`)\n and reading its spec + example. Don't try to compile or `npm install`\n them locally; let `geni resource validate` be the gate.\n- Use `--json` on list/get commands when you're going to parse the\n output. Table output is for humans.\n";
|
|
24029
|
+
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## Complex commands: write a file, don't fight quotes\n\nThe `-- '<command>'` form goes through a shell-quoting layer. For a\none-line `curl` that's fine. The moment the command has nested quotes\nor newlines \u2014 a `curl` piped into `jq` or `python3 -c`, a JSON body\nwith `\"keys\"` \u2014 that quoting silently mangles and the call fails in\nconfusing ways. Don't escalate escaping. Write the script to a file\nwith your normal editor, then run it as data:\n\n```\ngeni exec bash --cred <id> --reason \"<why>\" --file ./query.sh\n```\n\n`--file -` reads the script from stdin (heredoc / `< script.sh`).\n`jq` is available in the exec environment \u2014 prefer it over inline\n`python3 -c` for shaping JSON.\n\n## Connecting a missing credential\n\n`geni credential connect <service>` opens the integration's\ndashboard page in the 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, apps, and skills)\n\n`geni exec bash` is for one-off actions. When the user wants something\nsaved and reusable, build a **resource**. A resource is one of four\ntypes: a `code` **workflow** (deterministic, fixed steps, runs on a\nschedule or trigger), an `agent` **workflow** (LLM-driven, variable-length\ntasks like research or triage), an `app` (an interactive React mini-app\nwith server-side handlers, like a dashboard or internal tool), or a\n`skill` (a SKILL.md instruction bundle the platform's cloud agents load\nas context \u2014 not executed). The shared lifecycle lives under `geni\nresource`; type-specific tools under `geni workflow` and `geni app`.\n\nYou author the files locally with your own editor; the cloud validates,\nconfigures, publishes, and runs them. This is the same build loop as the\ngeni chat, just on the user's machine with your brain driving it. Same\nloop for every type; apps add a build step and handler tools (see\n\"Building apps\" below), skills drop the config step (see \"Building\nskills\" below).\n\n**Load the authoring skill first.** `geni skills load\n<code-workflow|agent-workflow|app|skill-authoring>` writes the platform's\nauthoring skill for that type into `geni-skills/<name>/`: `SKILL.md` (the\nmethod), `references/spec.md` (the full contract \u2014 required files, the\nruntime API, allowed and forbidden patterns), and `references/example/`\n(a complete, validated example to mirror). Read SKILL.md and the spec,\nand copy shapes from the example. (`skill-authoring` is the one type\nwhose short spec is inline in SKILL.md, with no example.) Don't write a\nsingle file before loading it.\n\nThe loop:\n\n1. `geni resource create --type code --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 + (code\n workflows) TypeScript check. Exit 9 means invalid; fix what it\n reports and re-run. For apps the compile gate is the publish build,\n not validate.\n4. `geni resource config set`: wire what the workflow needs. Find\n credential ids with `geni credential list`; set them with\n `--cred <service>=<credentialId>`. Set consts with `--const k=v`,\n schedules with `--schedule <triggerId>=<cron>`. `geni resource config\nget` shows the current state. Find trigger providers with\n `geni trigger list`.\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`; load the authoring skill with `geni skills load app` (its\n`references/` hold the contract, the component catalog, and a complete\nexample app). The shared commands work the same (validate, config set\nfor credential slots, publish), with these differences:\n\n- The scaffold is a whole Vite project. Edit only `app.json`, `src/App.tsx`,\n `src/pages/*`, your own `src/components/*`, and `handlers/*.ts`. Leave\n the platform-owned files alone.\n- `geni resource publish` builds the app; the result's `build` reports\n whether the Vite build passed. 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\n## Building skills\n\nA `skill` is a SKILL.md bundle (frontmatter `name` slug + `description`,\nthen the instructions body; optional `scripts/`, `references/`,\n`assets/`) that the platform's cloud agents load as context. It is not\nexecuted, so the loop is shorter: create --type skill -> edit SKILL.md ->\nvalidate -> publish. No `config set` (nothing to wire) and publish needs\nno `--summary`. The frontmatter `description` is the only thing agents\nsee before deciding to load it, so it must say what the skill does AND\nwhen to use it. Skill ids are `skl_`-prefixed; pull/validate/publish\nwork on them like any resource.\n\nA skill is never run and has no triggers. Once published, tell the user\nit's in their dashboard Skills page, ready for their agents to load into\nfuture work. Commands accept the skill id as a positional or infer it\nfrom the marker in the current directory.\n\n## 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- `79` \u2014 this geni is below the server's minimum version. Run\n `geni upgrade`, then `geni skills install`, and retry.\n\n## Don't\n\n- Don't construct a curl without reading the operation docs first.\n Guessing at URLs and env var names is the most common failure mode.\n- Don't hand-write resource files before loading the authoring skill\n (`geni skills load <code-workflow|agent-workflow|app|skill-authoring>`)\n and reading its spec + example. Don't try to compile or `npm install`\n them locally; let `geni resource validate` be the gate.\n- Use `--json` on list/get commands when you're going to parse the\n output. Table output is for humans.\n";
|
|
23974
24030
|
|
|
23975
24031
|
// src/skills/geni-crm.md
|
|
23976
24032
|
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), work outbound campaigns and their sequence drafts, 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, campaigns, and sequence drafts.\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, custom fields, and outbound campaigns with their sequence\ndrafts. 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`, `campaigns`,\n`sequences`, `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## Campaigns and sequences (draft here \u2014 the dashboard delivers)\n\nOutbound is prep + export: campaigns group people under one purpose, each\nmember gets a fully personalized per-person sequence **draft**, and the\noperator syncs the campaign to an external sequencer (Instantly, Smartlead,\nCSV) from the dashboard. There is no sending from General Input, and the CLI\ncannot sync \u2014 by design. When drafts are ready, tell the operator to review\nand sync from the campaign\'s page in the dashboard.\n\n- `geni crm campaigns [query]` lists campaigns with member/sequence rollups;\n `get <id>` shows one (its `purpose` is the messaging angle every draft in it\n must serve); `--person <id>` lists the campaigns a person is in.\n- `geni crm campaigns create --json \'{"name":"Q3 fintech CFOs","purpose":"Book intro calls about closing automation"}\'`.\n Names are unique per workspace. `update <id>` and `delete <id>` exist;\n deleting removes the campaign\'s drafts too.\n- Membership first: `geni crm campaigns add <campaignId> <personIds...>` adds\n people; `members <id>` shows who is in and who still has no draft.\n `remove` also deletes the member\'s synced leads from linked sequencers \u2014\n it\'s how "stop emailing them" propagates.\n- `geni crm sequences [query] [--person <id>] [--campaign <id>]` lists\n drafts; `get <id>` shows the steps.\n- Draft: `geni crm sequences create --person <id> --campaign <id> --json \'{"steps":[{"subject":"\u2026","body":"\u2026","waitDays":0},{"body":"\u2026","waitDays":3}]}\'`.\n The first step carries the subject; follow-ups reply in-thread after\n `waitDays` with no reply. Read the campaign\'s `purpose` first and write to\n it. A member has ONE draft per campaign \u2014 creating again rewrites it (and\n the next sync updates the lead instead of duplicating it).\n- `geni crm sequences update <id> --json \'\u2026\'` replaces a draft wholesale;\n `delete <id>` removes a draft (the person stays a member).\n- Consider `geni crm enrich validate` on recipients first so the operator\n isn\'t syncing 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';
|
|
@@ -24028,7 +24084,7 @@ function installSkills() {
|
|
|
24028
24084
|
const path = join7(dir, "SKILL.md");
|
|
24029
24085
|
try {
|
|
24030
24086
|
mkdirSync6(dir, { recursive: true });
|
|
24031
|
-
const previous = existsSync5(path) ?
|
|
24087
|
+
const previous = existsSync5(path) ? readFileSync7(path, "utf-8") : null;
|
|
24032
24088
|
const changed = previous !== skill.md;
|
|
24033
24089
|
writeFileSync5(path, skill.md);
|
|
24034
24090
|
for (const legacy of target.legacyPaths(skill.name)) {
|
|
@@ -24345,7 +24401,7 @@ function parseJsonObjectArg(raw) {
|
|
|
24345
24401
|
}
|
|
24346
24402
|
|
|
24347
24403
|
// src/lib/leadFilterArg.ts
|
|
24348
|
-
import { z as
|
|
24404
|
+
import { z as z49 } from "zod";
|
|
24349
24405
|
|
|
24350
24406
|
// ../../packages/crm-api/dist/types/enums.js
|
|
24351
24407
|
import { z as z12 } from "zod";
|
|
@@ -24392,6 +24448,10 @@ var CrmSubjectTypeSchema = z14.enum([
|
|
|
24392
24448
|
"pipeline",
|
|
24393
24449
|
"card"
|
|
24394
24450
|
]);
|
|
24451
|
+
var CrmSubjectRefSchema = z14.object({
|
|
24452
|
+
type: CrmSubjectTypeSchema,
|
|
24453
|
+
id: z14.uuid()
|
|
24454
|
+
});
|
|
24395
24455
|
|
|
24396
24456
|
// ../../packages/crm-api/dist/types/company.js
|
|
24397
24457
|
import { z as z15 } from "zod";
|
|
@@ -25572,6 +25632,183 @@ var PlaybookCampaignTargetValueSchema = z35.union([
|
|
|
25572
25632
|
]);
|
|
25573
25633
|
var PlaybookSeedValueSchema = z35.string().trim().min(1).max(2e3);
|
|
25574
25634
|
var PlaybookBriefValueSchema = z35.string().trim().min(1).max(2e3);
|
|
25635
|
+
var PLAYBOOK_META = {
|
|
25636
|
+
"fill-in-person": {
|
|
25637
|
+
name: "Enrich person",
|
|
25638
|
+
description: "Researches a person online and fills in their record: role, links, location, skills, education, and contact info.",
|
|
25639
|
+
subjectRequired: true,
|
|
25640
|
+
pinsToSubject: true,
|
|
25641
|
+
inputs: []
|
|
25642
|
+
},
|
|
25643
|
+
"fill-in-company": {
|
|
25644
|
+
name: "Enrich company",
|
|
25645
|
+
description: "Researches a company online, fills in its record (industry, size, funding, tech stack), and adds its key stakeholders.",
|
|
25646
|
+
subjectRequired: true,
|
|
25647
|
+
pinsToSubject: true,
|
|
25648
|
+
inputs: []
|
|
25649
|
+
},
|
|
25650
|
+
"fill-in-list": {
|
|
25651
|
+
name: "Grow list",
|
|
25652
|
+
description: "Researches new matches for a list\u2019s purpose, saves them with verified details, and adds them to the list.",
|
|
25653
|
+
subjectRequired: true,
|
|
25654
|
+
pinsToSubject: true,
|
|
25655
|
+
inputs: []
|
|
25656
|
+
},
|
|
25657
|
+
"draft-sequence-person": {
|
|
25658
|
+
name: "Draft sequence",
|
|
25659
|
+
description: "Researches a person and drafts a short, personalized email sequence into a campaign, left in draft for review.",
|
|
25660
|
+
subjectRequired: true,
|
|
25661
|
+
pinsToSubject: true,
|
|
25662
|
+
inputs: [
|
|
25663
|
+
{
|
|
25664
|
+
key: "brief",
|
|
25665
|
+
label: "What's this sequence for?",
|
|
25666
|
+
kind: "brief",
|
|
25667
|
+
placeholder: "e.g. book a 15-min intro about automating their candidate syncs; lead with the October contract renewal",
|
|
25668
|
+
optional: true
|
|
25669
|
+
},
|
|
25670
|
+
{
|
|
25671
|
+
key: "campaign",
|
|
25672
|
+
label: "Campaign",
|
|
25673
|
+
kind: "campaign_target"
|
|
25674
|
+
}
|
|
25675
|
+
]
|
|
25676
|
+
},
|
|
25677
|
+
"lookalike-person": {
|
|
25678
|
+
name: "Person lookalike list",
|
|
25679
|
+
description: "Distills what defines a seed person, finds people in the same seat at similar companies, and builds them into a list.",
|
|
25680
|
+
subjectRequired: false,
|
|
25681
|
+
pinsToSubject: false,
|
|
25682
|
+
inputs: [
|
|
25683
|
+
{
|
|
25684
|
+
key: "seed",
|
|
25685
|
+
label: "Seed person",
|
|
25686
|
+
kind: "seed",
|
|
25687
|
+
entityType: "person"
|
|
25688
|
+
},
|
|
25689
|
+
{
|
|
25690
|
+
key: "destination",
|
|
25691
|
+
label: "Add to list",
|
|
25692
|
+
kind: "list_target",
|
|
25693
|
+
entityType: "person"
|
|
25694
|
+
}
|
|
25695
|
+
]
|
|
25696
|
+
},
|
|
25697
|
+
"lookalike-company": {
|
|
25698
|
+
name: "Company lookalike list",
|
|
25699
|
+
description: "Distills what defines a seed company, finds similar companies, and builds them into a list.",
|
|
25700
|
+
subjectRequired: false,
|
|
25701
|
+
pinsToSubject: false,
|
|
25702
|
+
inputs: [
|
|
25703
|
+
{
|
|
25704
|
+
key: "seed",
|
|
25705
|
+
label: "Seed company",
|
|
25706
|
+
kind: "seed",
|
|
25707
|
+
entityType: "company"
|
|
25708
|
+
},
|
|
25709
|
+
{
|
|
25710
|
+
key: "destination",
|
|
25711
|
+
label: "Add to list",
|
|
25712
|
+
kind: "list_target",
|
|
25713
|
+
entityType: "company"
|
|
25714
|
+
}
|
|
25715
|
+
]
|
|
25716
|
+
},
|
|
25717
|
+
"add-enrich": {
|
|
25718
|
+
name: "Add & enrich",
|
|
25719
|
+
description: "Takes a name, domain, or short description, works out whether it\u2019s a person or a company, saves the record, and enriches it fully.",
|
|
25720
|
+
subjectRequired: false,
|
|
25721
|
+
pinsToSubject: false,
|
|
25722
|
+
inputs: [
|
|
25723
|
+
{
|
|
25724
|
+
key: "seed",
|
|
25725
|
+
label: "Who or what to add",
|
|
25726
|
+
kind: "seed",
|
|
25727
|
+
entityType: null
|
|
25728
|
+
}
|
|
25729
|
+
]
|
|
25730
|
+
},
|
|
25731
|
+
"build-list-person": {
|
|
25732
|
+
name: "Create people list",
|
|
25733
|
+
description: "Turns a description of who you want into a new list: decodes the target, hunts account-first, and fills it with verified people.",
|
|
25734
|
+
subjectRequired: false,
|
|
25735
|
+
pinsToSubject: false,
|
|
25736
|
+
inputs: [
|
|
25737
|
+
{
|
|
25738
|
+
key: "brief",
|
|
25739
|
+
label: "Who should be on it",
|
|
25740
|
+
kind: "brief",
|
|
25741
|
+
placeholder: "e.g. Heads of RevOps at Series A\u2013B fintechs in the US, ideally hiring SDRs\u2026"
|
|
25742
|
+
}
|
|
25743
|
+
]
|
|
25744
|
+
},
|
|
25745
|
+
"build-list-company": {
|
|
25746
|
+
name: "Create company list",
|
|
25747
|
+
description: "Turns a description of the companies you want into a new list: decodes the target and fills it with verified matches.",
|
|
25748
|
+
subjectRequired: false,
|
|
25749
|
+
pinsToSubject: false,
|
|
25750
|
+
inputs: [
|
|
25751
|
+
{
|
|
25752
|
+
key: "brief",
|
|
25753
|
+
label: "What companies to find",
|
|
25754
|
+
kind: "brief",
|
|
25755
|
+
placeholder: "e.g. B2B SaaS, 50\u2013200 people, selling to finance teams, raised in the last year\u2026"
|
|
25756
|
+
}
|
|
25757
|
+
]
|
|
25758
|
+
}
|
|
25759
|
+
};
|
|
25760
|
+
function quickRunPlaybookId(action, subjectType) {
|
|
25761
|
+
if (action === "fill_in") {
|
|
25762
|
+
if (subjectType === "person")
|
|
25763
|
+
return "fill-in-person";
|
|
25764
|
+
if (subjectType === "company")
|
|
25765
|
+
return "fill-in-company";
|
|
25766
|
+
if (subjectType === "list")
|
|
25767
|
+
return "fill-in-list";
|
|
25768
|
+
return null;
|
|
25769
|
+
}
|
|
25770
|
+
if (action === "draft_sequence" && subjectType === "person")
|
|
25771
|
+
return "draft-sequence-person";
|
|
25772
|
+
if (action === "create_lookalikes") {
|
|
25773
|
+
if (subjectType === "person")
|
|
25774
|
+
return "lookalike-person";
|
|
25775
|
+
if (subjectType === "company")
|
|
25776
|
+
return "lookalike-company";
|
|
25777
|
+
return null;
|
|
25778
|
+
}
|
|
25779
|
+
if (action === "add_enrich")
|
|
25780
|
+
return "add-enrich";
|
|
25781
|
+
if (action === "build_list") {
|
|
25782
|
+
if (subjectType === "person")
|
|
25783
|
+
return "build-list-person";
|
|
25784
|
+
if (subjectType === "company")
|
|
25785
|
+
return "build-list-company";
|
|
25786
|
+
return null;
|
|
25787
|
+
}
|
|
25788
|
+
return null;
|
|
25789
|
+
}
|
|
25790
|
+
function playbookQuickRunLaunch(playbookId) {
|
|
25791
|
+
for (const action of AgentQuickActionSchema.options) {
|
|
25792
|
+
for (const subjectType of [null, ...CrmSubjectTypeSchema.options]) {
|
|
25793
|
+
if (quickRunPlaybookId(action, subjectType) === playbookId) {
|
|
25794
|
+
return { action, subjectType };
|
|
25795
|
+
}
|
|
25796
|
+
}
|
|
25797
|
+
}
|
|
25798
|
+
throw new Error(`No quick-run launch resolves to playbook "${playbookId}"`);
|
|
25799
|
+
}
|
|
25800
|
+
var CrmQuickRunRequestSchema = z35.object({
|
|
25801
|
+
action: AgentQuickActionSchema,
|
|
25802
|
+
subject: CrmSubjectRefSchema.optional(),
|
|
25803
|
+
// Playbook resolution for subject-free launches of typed playbooks (Hub
|
|
25804
|
+
// brief/seed runs); absent = a type-inferring playbook.
|
|
25805
|
+
subjectType: CrmSubjectTypeSchema.optional(),
|
|
25806
|
+
inputs: z35.record(z35.string(), z35.unknown()).optional(),
|
|
25807
|
+
// Workspace skills riding along on this run; become the playbook's
|
|
25808
|
+
// remembered set for the next launch.
|
|
25809
|
+
skillIds: z35.array(z35.string().trim().min(1).max(32)).max(10).optional(),
|
|
25810
|
+
modelId: z35.string().optional()
|
|
25811
|
+
});
|
|
25575
25812
|
|
|
25576
25813
|
// ../../packages/api/dist/types/user.js
|
|
25577
25814
|
import { z as z36 } from "zod";
|
|
@@ -26118,7 +26355,7 @@ var SetNotificationChannelAddressRequestSchema = z44.object({
|
|
|
26118
26355
|
address: z44.string().min(1)
|
|
26119
26356
|
});
|
|
26120
26357
|
|
|
26121
|
-
// ../../packages/api/dist/types/
|
|
26358
|
+
// ../../packages/api/dist/types/oauthProviderCatalog.js
|
|
26122
26359
|
var OAUTH_PROVIDER_GROUPS = {
|
|
26123
26360
|
google: {
|
|
26124
26361
|
title: "Google",
|
|
@@ -26169,6 +26406,16 @@ var OAUTH_PROVIDER_GROUPS = {
|
|
|
26169
26406
|
iconUrl: "https://icons.generalinput.com/linear.png",
|
|
26170
26407
|
services: ["linear"]
|
|
26171
26408
|
},
|
|
26409
|
+
x: {
|
|
26410
|
+
title: "X (Twitter)",
|
|
26411
|
+
iconUrl: "https://icons.generalinput.com/x-twitter.png",
|
|
26412
|
+
services: ["twitter"]
|
|
26413
|
+
},
|
|
26414
|
+
linkedin: {
|
|
26415
|
+
title: "LinkedIn",
|
|
26416
|
+
iconUrl: "https://icons.generalinput.com/linkedin.png",
|
|
26417
|
+
services: ["linkedin", "linkedin-ad-library"]
|
|
26418
|
+
},
|
|
26172
26419
|
hubspot: {
|
|
26173
26420
|
title: "HubSpot",
|
|
26174
26421
|
iconUrl: "https://icons.generalinput.com/hubspot.png",
|
|
@@ -26209,6 +26456,11 @@ var OAUTH_PROVIDER_GROUPS = {
|
|
|
26209
26456
|
iconUrl: "https://icons.generalinput.com/calendly.png",
|
|
26210
26457
|
services: ["calendly"]
|
|
26211
26458
|
},
|
|
26459
|
+
strava: {
|
|
26460
|
+
title: "Strava",
|
|
26461
|
+
iconUrl: "https://icons.generalinput.com/strava.png",
|
|
26462
|
+
services: ["strava"]
|
|
26463
|
+
},
|
|
26212
26464
|
ramp: {
|
|
26213
26465
|
title: "Ramp",
|
|
26214
26466
|
iconUrl: "https://icons.generalinput.com/ramp.png",
|
|
@@ -26294,6 +26546,16 @@ var OAUTH_PROVIDER_GROUPS = {
|
|
|
26294
26546
|
iconUrl: "https://icons.generalinput.com/meta-ads.jpg",
|
|
26295
26547
|
services: ["meta-ads"]
|
|
26296
26548
|
},
|
|
26549
|
+
instagram: {
|
|
26550
|
+
title: "Instagram",
|
|
26551
|
+
iconUrl: "https://icons.generalinput.com/instagram.png",
|
|
26552
|
+
services: ["instagram"]
|
|
26553
|
+
},
|
|
26554
|
+
"facebook-pages": {
|
|
26555
|
+
title: "Facebook Pages",
|
|
26556
|
+
iconUrl: "https://icons.generalinput.com/facebook.png",
|
|
26557
|
+
services: ["facebook-pages"]
|
|
26558
|
+
},
|
|
26297
26559
|
"linkedin-ads": {
|
|
26298
26560
|
title: "LinkedIn Ads",
|
|
26299
26561
|
iconUrl: "https://icons.generalinput.com/linkedin-ads.png",
|
|
@@ -26334,6 +26596,11 @@ var OAUTH_PROVIDER_GROUPS = {
|
|
|
26334
26596
|
iconUrl: "https://icons.generalinput.com/tiktok-ads.webp",
|
|
26335
26597
|
services: ["tiktok-ads"]
|
|
26336
26598
|
},
|
|
26599
|
+
tiktok: {
|
|
26600
|
+
title: "TikTok",
|
|
26601
|
+
iconUrl: "https://icons.generalinput.com/tiktok.png",
|
|
26602
|
+
services: ["tiktok"]
|
|
26603
|
+
},
|
|
26337
26604
|
bamboohr: {
|
|
26338
26605
|
title: "BambooHR",
|
|
26339
26606
|
iconUrl: "https://icons.generalinput.com/bamboohr.png",
|
|
@@ -26371,25 +26638,6 @@ var OAUTH_PROVIDER_GROUPS = {
|
|
|
26371
26638
|
}
|
|
26372
26639
|
};
|
|
26373
26640
|
|
|
26374
|
-
// ../../packages/api/dist/types/personalOAuthConnection.js
|
|
26375
|
-
var PERSONAL_OAUTH_PROVIDER_GROUPS = {
|
|
26376
|
-
x: {
|
|
26377
|
-
title: "X (Twitter)",
|
|
26378
|
-
iconUrl: "https://icons.generalinput.com/x-twitter.png",
|
|
26379
|
-
services: ["twitter"]
|
|
26380
|
-
},
|
|
26381
|
-
linkedin: {
|
|
26382
|
-
title: "LinkedIn",
|
|
26383
|
-
iconUrl: "https://icons.generalinput.com/linkedin.png",
|
|
26384
|
-
services: ["linkedin", "linkedin-ad-library"]
|
|
26385
|
-
},
|
|
26386
|
-
strava: {
|
|
26387
|
-
title: "Strava",
|
|
26388
|
-
iconUrl: "https://icons.generalinput.com/strava.png",
|
|
26389
|
-
services: ["strava"]
|
|
26390
|
-
}
|
|
26391
|
-
};
|
|
26392
|
-
|
|
26393
26641
|
// ../../packages/api/dist/types/prompt.js
|
|
26394
26642
|
import { z as z45 } from "zod";
|
|
26395
26643
|
var PromptWorkflowTypeSchema = z45.enum(["code", "agent"]);
|
|
@@ -26499,60 +26747,16 @@ var CommandCenterTileLayoutSchema = z48.object({
|
|
|
26499
26747
|
h: z48.number().int().min(1)
|
|
26500
26748
|
});
|
|
26501
26749
|
|
|
26502
|
-
// ../../packages/api/dist/types/cli/exec.js
|
|
26503
|
-
import { z as z49 } from "zod";
|
|
26504
|
-
var CodeExecutionOutputLineSchema = z49.discriminatedUnion("type", [
|
|
26505
|
-
z49.object({
|
|
26506
|
-
type: z49.literal("log"),
|
|
26507
|
-
level: z49.enum(["info", "warn", "error"]),
|
|
26508
|
-
message: z49.string(),
|
|
26509
|
-
data: z49.unknown().optional()
|
|
26510
|
-
}),
|
|
26511
|
-
z49.object({
|
|
26512
|
-
type: z49.literal("result"),
|
|
26513
|
-
data: z49.unknown()
|
|
26514
|
-
}),
|
|
26515
|
-
z49.object({
|
|
26516
|
-
type: z49.literal("error"),
|
|
26517
|
-
error: z49.string(),
|
|
26518
|
-
stack: z49.string().optional()
|
|
26519
|
-
})
|
|
26520
|
-
]);
|
|
26521
|
-
var CodeExecutionResultSchema = z49.discriminatedUnion("success", [
|
|
26522
|
-
z49.object({
|
|
26523
|
-
success: z49.literal(true),
|
|
26524
|
-
result: z49.unknown(),
|
|
26525
|
-
logs: z49.array(z49.object({
|
|
26526
|
-
level: z49.string(),
|
|
26527
|
-
message: z49.string(),
|
|
26528
|
-
data: z49.unknown().optional()
|
|
26529
|
-
})),
|
|
26530
|
-
stderr: z49.string().optional()
|
|
26531
|
-
}),
|
|
26532
|
-
z49.object({
|
|
26533
|
-
success: z49.literal(false),
|
|
26534
|
-
error: z49.string(),
|
|
26535
|
-
logs: z49.array(z49.object({
|
|
26536
|
-
level: z49.string(),
|
|
26537
|
-
message: z49.string(),
|
|
26538
|
-
data: z49.unknown().optional()
|
|
26539
|
-
})),
|
|
26540
|
-
stderr: z49.string().optional()
|
|
26541
|
-
})
|
|
26542
|
-
]);
|
|
26543
|
-
|
|
26544
26750
|
// ../../packages/api/dist/oauthProviderLookup.js
|
|
26545
|
-
|
|
26546
|
-
|
|
26547
|
-
const provider = key;
|
|
26548
|
-
for (const service of group.services) {
|
|
26549
|
-
SERVICE_TO_PROVIDER.set(service, { type: "organization", provider });
|
|
26550
|
-
}
|
|
26751
|
+
function isValidOAuthConnectionProvider(value) {
|
|
26752
|
+
return value in OAUTH_PROVIDER_GROUPS;
|
|
26551
26753
|
}
|
|
26552
|
-
|
|
26553
|
-
|
|
26554
|
-
|
|
26555
|
-
|
|
26754
|
+
var SERVICE_TO_PROVIDER = /* @__PURE__ */ new Map();
|
|
26755
|
+
for (const provider of Object.keys(OAUTH_PROVIDER_GROUPS)) {
|
|
26756
|
+
if (!isValidOAuthConnectionProvider(provider))
|
|
26757
|
+
continue;
|
|
26758
|
+
for (const service of OAUTH_PROVIDER_GROUPS[provider].services) {
|
|
26759
|
+
SERVICE_TO_PROVIDER.set(service, provider);
|
|
26556
26760
|
}
|
|
26557
26761
|
}
|
|
26558
26762
|
|
|
@@ -26566,7 +26770,7 @@ function parseLeadFilterArg(raw) {
|
|
|
26566
26770
|
printError(`Invalid --filter: not valid JSON. Example: ${FILTER_EXAMPLE}`);
|
|
26567
26771
|
exit(ExitCode.InternalError);
|
|
26568
26772
|
}
|
|
26569
|
-
const parsed =
|
|
26773
|
+
const parsed = z49.array(LeadFilterConditionSchema).safeParse(value);
|
|
26570
26774
|
if (!parsed.success) {
|
|
26571
26775
|
const issue = parsed.error.issues[0];
|
|
26572
26776
|
const path = issue?.path.map(String).join(".");
|
|
@@ -28144,10 +28348,181 @@ function registerCrmEnrich(parent) {
|
|
|
28144
28348
|
});
|
|
28145
28349
|
}
|
|
28146
28350
|
|
|
28351
|
+
// src/commands/crm/playbooks.ts
|
|
28352
|
+
var UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
28353
|
+
var INPUT_FLAGS = {
|
|
28354
|
+
seed: "--seed",
|
|
28355
|
+
brief: "--brief",
|
|
28356
|
+
list_target: "--into-list",
|
|
28357
|
+
campaign_target: "--campaign"
|
|
28358
|
+
};
|
|
28359
|
+
function playbookIdOrExit(value) {
|
|
28360
|
+
const parsed = PlaybookIdSchema.safeParse(value);
|
|
28361
|
+
if (!parsed.success) {
|
|
28362
|
+
printError(
|
|
28363
|
+
`Unknown playbook "${value}". Available: ${PlaybookIdSchema.options.join(", ")}.`
|
|
28364
|
+
);
|
|
28365
|
+
exit(ExitCode.InvalidArgs);
|
|
28366
|
+
}
|
|
28367
|
+
return parsed.data;
|
|
28368
|
+
}
|
|
28369
|
+
function subjectOrExit(playbookId, opts) {
|
|
28370
|
+
const provided = [];
|
|
28371
|
+
if (opts.person) provided.push({ type: "person", id: opts.person });
|
|
28372
|
+
if (opts.company) provided.push({ type: "company", id: opts.company });
|
|
28373
|
+
if (opts.list) provided.push({ type: "list", id: opts.list });
|
|
28374
|
+
if (provided.length > 1) {
|
|
28375
|
+
printError("Pass at most one of --person, --company, --list.");
|
|
28376
|
+
exit(ExitCode.InvalidArgs);
|
|
28377
|
+
}
|
|
28378
|
+
const subject = provided[0];
|
|
28379
|
+
const meta = PLAYBOOK_META[playbookId];
|
|
28380
|
+
const launch = playbookQuickRunLaunch(playbookId);
|
|
28381
|
+
if (meta.subjectRequired && !subject) {
|
|
28382
|
+
printError(
|
|
28383
|
+
`"${playbookId}" runs on a pinned record. Pass --${launch.subjectType} <id>.`
|
|
28384
|
+
);
|
|
28385
|
+
exit(ExitCode.InvalidArgs);
|
|
28386
|
+
}
|
|
28387
|
+
if (subject && launch.subjectType && subject.type !== launch.subjectType) {
|
|
28388
|
+
printError(
|
|
28389
|
+
`"${playbookId}" takes --${launch.subjectType}, not --${subject.type}.`
|
|
28390
|
+
);
|
|
28391
|
+
exit(ExitCode.InvalidArgs);
|
|
28392
|
+
}
|
|
28393
|
+
return subject;
|
|
28394
|
+
}
|
|
28395
|
+
async function inputsOrExit(playbookId, opts) {
|
|
28396
|
+
const provided = [];
|
|
28397
|
+
if (opts.seed !== void 0) provided.push({ kind: "seed", value: opts.seed });
|
|
28398
|
+
if (opts.brief !== void 0) {
|
|
28399
|
+
provided.push({ kind: "brief", value: opts.brief });
|
|
28400
|
+
}
|
|
28401
|
+
if (opts.intoList !== void 0) {
|
|
28402
|
+
provided.push({ kind: "list_target", value: opts.intoList });
|
|
28403
|
+
}
|
|
28404
|
+
if (opts.campaign !== void 0) {
|
|
28405
|
+
provided.push({ kind: "campaign_target", value: opts.campaign });
|
|
28406
|
+
}
|
|
28407
|
+
const specs = PLAYBOOK_META[playbookId].inputs;
|
|
28408
|
+
const inputs = {};
|
|
28409
|
+
for (const { kind, value } of provided) {
|
|
28410
|
+
const spec = specs.find((candidate) => candidate.kind === kind);
|
|
28411
|
+
if (!spec) {
|
|
28412
|
+
printError(`"${playbookId}" does not take ${INPUT_FLAGS[kind]}.`);
|
|
28413
|
+
exit(ExitCode.InvalidArgs);
|
|
28414
|
+
}
|
|
28415
|
+
inputs[spec.key] = await resolveInputValue(spec, value);
|
|
28416
|
+
}
|
|
28417
|
+
return Object.keys(inputs).length > 0 ? inputs : void 0;
|
|
28418
|
+
}
|
|
28419
|
+
async function resolveInputValue(spec, value) {
|
|
28420
|
+
if (spec.kind === "seed" || spec.kind === "brief") return value;
|
|
28421
|
+
if (spec.kind === "list_target") {
|
|
28422
|
+
if (!UUID_PATTERN.test(value)) return { newListName: value };
|
|
28423
|
+
const list = await crmService.getList(value);
|
|
28424
|
+
return { listId: list.id, listName: list.name };
|
|
28425
|
+
}
|
|
28426
|
+
if (!UUID_PATTERN.test(value)) return { newCampaignName: value };
|
|
28427
|
+
const campaign = await crmService.getCampaign(value);
|
|
28428
|
+
return { campaignId: campaign.id, campaignName: campaign.name };
|
|
28429
|
+
}
|
|
28430
|
+
async function executePlaybooksList(opts) {
|
|
28431
|
+
try {
|
|
28432
|
+
const summaries = await crmService.listPlaybooks();
|
|
28433
|
+
const rows = summaries.map((summary) => {
|
|
28434
|
+
const meta = PLAYBOOK_META[summary.id];
|
|
28435
|
+
const launch = playbookQuickRunLaunch(summary.id);
|
|
28436
|
+
return {
|
|
28437
|
+
id: summary.id,
|
|
28438
|
+
name: meta.name,
|
|
28439
|
+
description: meta.description,
|
|
28440
|
+
runsOn: launch.subjectType,
|
|
28441
|
+
subjectRequired: meta.subjectRequired,
|
|
28442
|
+
inputs: meta.inputs.map((spec) => ({
|
|
28443
|
+
flag: INPUT_FLAGS[spec.kind],
|
|
28444
|
+
label: spec.label,
|
|
28445
|
+
optional: spec.kind === "brief" && spec.optional === true
|
|
28446
|
+
})),
|
|
28447
|
+
attachedSkills: summary.attachedSkills
|
|
28448
|
+
};
|
|
28449
|
+
});
|
|
28450
|
+
if (opts.json) {
|
|
28451
|
+
printJson({ playbooks: rows });
|
|
28452
|
+
return;
|
|
28453
|
+
}
|
|
28454
|
+
printTable(
|
|
28455
|
+
["PLAYBOOK", "NAME", "RUNS ON", "INPUTS", "REMEMBERED SKILLS"],
|
|
28456
|
+
rows.map((row) => [
|
|
28457
|
+
row.id,
|
|
28458
|
+
row.name,
|
|
28459
|
+
row.runsOn ? `--${row.runsOn}${row.subjectRequired ? "" : " (optional)"}` : "",
|
|
28460
|
+
row.inputs.map((input) => `${input.flag}${input.optional ? "?" : ""}`).join(" "),
|
|
28461
|
+
row.attachedSkills.map((skill) => skill.skillName).join(", ")
|
|
28462
|
+
]),
|
|
28463
|
+
{ colorFn: dimColumn(0) }
|
|
28464
|
+
);
|
|
28465
|
+
} catch (error) {
|
|
28466
|
+
exitOnApiError(error);
|
|
28467
|
+
}
|
|
28468
|
+
}
|
|
28469
|
+
function registerCrmPlaybooks(parent) {
|
|
28470
|
+
const playbooks = parent.command("playbooks").description(
|
|
28471
|
+
"List the one-click agent playbooks (default) or run one. Runs execute asynchronously as CRM agent threads; watch them in the dashboard."
|
|
28472
|
+
).option("--json", "Machine-readable output (includes descriptions).").action((opts) => executePlaybooksList(opts));
|
|
28473
|
+
playbooks.command("run").argument("<playbookId>", "Playbook id (see `geni crm playbooks`).").description(
|
|
28474
|
+
"Launch a playbook as a fresh agent run. The record flag (--person/--company/--list) pins or seeds it; attached --skill sets become the remembered defaults for the next launch."
|
|
28475
|
+
).option("--person <id>", "The person record it runs on.").option("--company <id>", "The company record it runs on.").option("--list <id>", "The list record it runs on.").option("--seed <text>", "Free-text seed when no record is pinned.").option("--brief <text>", "Free-text instructions for the run.").option(
|
|
28476
|
+
"--into-list <idOrName>",
|
|
28477
|
+
"Destination list: an existing list id, or a name to create."
|
|
28478
|
+
).option(
|
|
28479
|
+
"--campaign <idOrName>",
|
|
28480
|
+
"Campaign to work inside: an existing campaign id, or a name to create."
|
|
28481
|
+
).option(
|
|
28482
|
+
"--skill <id>",
|
|
28483
|
+
"Workspace skill to attach (repeatable, max 10). Replaces the remembered set.",
|
|
28484
|
+
(value, previous) => [...previous, value],
|
|
28485
|
+
[]
|
|
28486
|
+
).option("--json", "Machine-readable output.").action(async (playbookIdArg, opts) => {
|
|
28487
|
+
const playbookId = playbookIdOrExit(playbookIdArg);
|
|
28488
|
+
const meta = PLAYBOOK_META[playbookId];
|
|
28489
|
+
const launch = playbookQuickRunLaunch(playbookId);
|
|
28490
|
+
const subject = subjectOrExit(playbookId, opts);
|
|
28491
|
+
try {
|
|
28492
|
+
const inputs = await inputsOrExit(playbookId, opts);
|
|
28493
|
+
const result = await crmService.runPlaybook({
|
|
28494
|
+
action: launch.action,
|
|
28495
|
+
subject,
|
|
28496
|
+
subjectType: !subject && launch.subjectType ? launch.subjectType : void 0,
|
|
28497
|
+
inputs,
|
|
28498
|
+
skillIds: opts.skill.length > 0 ? opts.skill : void 0
|
|
28499
|
+
});
|
|
28500
|
+
if (opts.json) {
|
|
28501
|
+
printJson({ ...result, playbookId });
|
|
28502
|
+
return;
|
|
28503
|
+
}
|
|
28504
|
+
printSuccess(`Started "${meta.name}" (${playbookId})`);
|
|
28505
|
+
printInfo(`thread: ${result.id}`);
|
|
28506
|
+
printInfo(`run: ${result.runId}`);
|
|
28507
|
+
if (result.isQueued) {
|
|
28508
|
+
printInfo(
|
|
28509
|
+
"queued behind your running agents; it starts automatically"
|
|
28510
|
+
);
|
|
28511
|
+
}
|
|
28512
|
+
if (opts.skill.length > 0) {
|
|
28513
|
+
printInfo(`skills attached: ${opts.skill.join(", ")}`);
|
|
28514
|
+
}
|
|
28515
|
+
printInfo("Runs async. Watch it in the dashboard CRM hub.");
|
|
28516
|
+
} catch (error) {
|
|
28517
|
+
exitOnApiError(error);
|
|
28518
|
+
}
|
|
28519
|
+
});
|
|
28520
|
+
}
|
|
28521
|
+
|
|
28147
28522
|
// src/commands/crm/index.ts
|
|
28148
28523
|
function registerCrmCommands(program2) {
|
|
28149
28524
|
const crm = program2.command("crm").description(
|
|
28150
|
-
"Read and write the workspace's CRM: people, companies, pipelines, lists, tags, notes, tasks, and
|
|
28525
|
+
"Read and write the workspace's CRM: people, companies, pipelines, lists, tags, notes, tasks, enrichment, and playbook runs. Requires CRM access on the workspace."
|
|
28151
28526
|
);
|
|
28152
28527
|
registerCrmSearch(crm);
|
|
28153
28528
|
registerCrmPeople(crm);
|
|
@@ -28168,6 +28543,7 @@ function registerCrmCommands(program2) {
|
|
|
28168
28543
|
registerCrmSequences(crm);
|
|
28169
28544
|
registerCrmWaterfalls(crm);
|
|
28170
28545
|
registerCrmEnrich(crm);
|
|
28546
|
+
registerCrmPlaybooks(crm);
|
|
28171
28547
|
crm.action(() => crm.help());
|
|
28172
28548
|
crm.enablePositionalOptions();
|
|
28173
28549
|
for (const noun of crm.commands) noun.enablePositionalOptions();
|
|
@@ -28225,7 +28601,7 @@ function installHint(deps) {
|
|
|
28225
28601
|
}
|
|
28226
28602
|
|
|
28227
28603
|
// src/commands/doctor.ts
|
|
28228
|
-
import { existsSync as existsSync6, readFileSync as
|
|
28604
|
+
import { existsSync as existsSync6, readFileSync as readFileSync8 } from "fs";
|
|
28229
28605
|
function registerDoctorCommand(program2) {
|
|
28230
28606
|
program2.command("doctor").description(
|
|
28231
28607
|
"Diagnose your geni setup: required system tools, active session, network reach to the cloud, and skill installation across detected AI agents. Prints a checklist with \u2713/\u2717 for each."
|
|
@@ -28336,7 +28712,7 @@ function skillsCheck() {
|
|
|
28336
28712
|
});
|
|
28337
28713
|
continue;
|
|
28338
28714
|
}
|
|
28339
|
-
const onDisk =
|
|
28715
|
+
const onDisk = readFileSync8(target.path, "utf-8");
|
|
28340
28716
|
if (onDisk === target.expectedMd) {
|
|
28341
28717
|
out.push({
|
|
28342
28718
|
label: `${target.name}: ${target.skill} skill installed`,
|
|
@@ -28378,10 +28754,10 @@ function printReport(checks) {
|
|
|
28378
28754
|
import { spawn as spawn3, execFileSync } from "child_process";
|
|
28379
28755
|
import { realpathSync } from "fs";
|
|
28380
28756
|
import { sep as sep2 } from "path";
|
|
28381
|
-
import { z as
|
|
28757
|
+
import { z as z50 } from "zod";
|
|
28382
28758
|
import semver from "semver";
|
|
28383
28759
|
var PACKAGE_NAME = "@general-input/cli";
|
|
28384
|
-
var registryLatestSchema =
|
|
28760
|
+
var registryLatestSchema = z50.object({ version: z50.string() });
|
|
28385
28761
|
function registerUpgradeCommand(program2) {
|
|
28386
28762
|
program2.command("upgrade").description(
|
|
28387
28763
|
"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."
|