@cleanslop/cli 0.1.0-beta.0 → 0.1.0-beta.10
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/README.md +3 -2
- package/assets/skill-core.md +16 -5
- package/dist/action.d.ts +1 -0
- package/dist/action.js +24 -0
- package/dist/action.js.map +1 -1
- package/dist/args.d.ts +1 -1
- package/dist/args.js +16 -9
- package/dist/args.js.map +1 -1
- package/dist/commands/credits.d.ts +30 -1
- package/dist/commands/credits.js +252 -43
- package/dist/commands/credits.js.map +1 -1
- package/dist/commands/redeem.d.ts +7 -0
- package/dist/commands/redeem.js +33 -0
- package/dist/commands/redeem.js.map +1 -0
- package/dist/config.d.ts +2 -2
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/credentials.d.ts +6 -0
- package/dist/credentials.js.map +1 -1
- package/dist/exit.d.ts +24 -0
- package/dist/exit.js.map +1 -1
- package/dist/http.js +19 -1
- package/dist/http.js.map +1 -1
- package/dist/index.js +0 -0
- package/dist/link.d.ts +13 -5
- package/dist/link.js +57 -42
- package/dist/link.js.map +1 -1
- package/dist/main.js +3 -0
- package/dist/main.js.map +1 -1
- package/dist/skill.d.ts +1 -1
- package/dist/skill.js +1 -0
- package/dist/skill.js.map +1 -1
- package/dist/top-up.d.ts +8 -0
- package/dist/top-up.js +35 -0
- package/dist/top-up.js.map +1 -0
- package/dist/types.d.ts +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# cleanslop CLI (M4)
|
|
2
2
|
|
|
3
|
-
Private-beta CLI for agentic CleanSlop, published as `@cleanslop/cli` (bin `cleanslop`). Beta builds go out under the `beta` dist-tag from `.github/workflows/cli-beta.yml
|
|
3
|
+
Private-beta CLI for agentic CleanSlop, published as `@cleanslop/cli` (bin `cleanslop`). Beta builds go out under the `beta` dist-tag from `.github/workflows/cli-beta.yml`, and releases under `latest` from `.github/workflows/cli-release.yml` on every `master` change to `cli/` (versions from `scripts/release-version.mjs`); do not `npm publish` by hand except the one-time first publish in `docs/ops/agent-beta.md` (CLI beta).
|
|
4
4
|
|
|
5
5
|
## Install / run
|
|
6
6
|
|
|
@@ -35,6 +35,7 @@ The app TypeScript / ESLint / coverage gates exclude `cli/` (`tsconfig.json`, `t
|
|
|
35
35
|
| `status [id] [--wait]` | Poll scan status |
|
|
36
36
|
| `report [id] [--format md\|json] [--preview]` | Fetch `cleanslop.report.v1` |
|
|
37
37
|
| `setup` | Idempotent skill/rules. Never logs in, never writes a token |
|
|
38
|
+
| `redeem <code>` | Redeem a promo (invite) code the human gave you for free scans (`POST /api/agent/v1/credits/redeem`). One code per account; `promo_invalid` / `promo_already_redeemed` exit 12 with an `ask_human` block. |
|
|
38
39
|
|
|
39
40
|
### Wait
|
|
40
41
|
|
|
@@ -80,7 +81,7 @@ Skill / Cursor rules / AGENTS snippet are generated from [`assets/skill-core.md`
|
|
|
80
81
|
| 20 | Scan failed server-side |
|
|
81
82
|
| 75 | Still running; resume command printed |
|
|
82
83
|
|
|
83
|
-
`CLEANSLOP_ACTION_REQUIRED` blocks go to stderr. Never open, approve, or pay.
|
|
84
|
+
`CLEANSLOP_ACTION_REQUIRED` blocks go to stderr. Never open, approve, or pay. A block may end with a `CLEANSLOP_QUESTION:` JSON line (`id`, `header`, `question`, `options[]` with `value`, `label`, optional `description`, and `run` for the exact next command or `next` for a plain next step; neither means stop). Agents with a multiple-choice question tool (for example Claude Code's AskUserQuestion) should ask with it, using exactly those options, and never answer for the human. Consent questions never carry `--agree`.
|
|
84
85
|
|
|
85
86
|
## Tests
|
|
86
87
|
|
package/assets/skill-core.md
CHANGED
|
@@ -14,16 +14,27 @@ Use MCP if it is registered (`<origin>/mcp`); otherwise the CLI. Run it as `npx
|
|
|
14
14
|
|
|
15
15
|
Run Link and login commands in the foreground with `--no-wait`. When one prints an `approve` block, relay the link and code, wait for the human to approve, then rerun the same command with `--resume` instead of `--no-wait`.
|
|
16
16
|
|
|
17
|
-
1. Run `cleanslop login --link --no-wait`. The first run stops with an `ask_human` block quoting
|
|
18
|
-
2. If the human says yes
|
|
17
|
+
1. Run `cleanslop login --link --no-wait`. The first run stops with an `ask_human` block quoting one question (an account from the Link-verified email, plus the terms). Relay it **exactly as printed**.
|
|
18
|
+
2. If the human says yes, rerun with `--agree --no-wait`. If not, stop.
|
|
19
19
|
3. If Link is not signed in on this machine, the CLI prints an `approve` block with a Link link and a phrase and exits 10. Relay them; after the human approves in the Link app, rerun with `--resume` instead of `--no-wait`.
|
|
20
20
|
4. On success it prints “Connected as <masked email> (Link)”. Repeat that to the human.
|
|
21
|
-
5. `link_existing` means the Link email already belongs to a CleanSlop account. Run `cleanslop login --no-wait` (GitHub device login), then `cleanslop link-identity --no-wait`, each with the approve-then-`--resume` step above. `link-identity` asks its own email
|
|
21
|
+
5. `link_existing` means the Link email already belongs to a CleanSlop account. Run `cleanslop login --no-wait` (GitHub device login), then `cleanslop link-identity --no-wait`, each with the approve-then-`--resume` step above. `link-identity` asks its own email question (`--agree` after a yes).
|
|
22
22
|
6. `beta` means this Link email is not in the pilot yet. Tell the human and stop.
|
|
23
23
|
|
|
24
|
+
## Buy credits with Link
|
|
25
|
+
|
|
26
|
+
Run purchase commands in the foreground with `--no-wait`, the same way as Link sign-in. The human approves every payment in their Link app; never approve or pay yourself.
|
|
27
|
+
|
|
28
|
+
1. When a scan exits 11 with a `top-up` block, or `credits buy` without `--pack` asks which pack, ask the human to choose (the block lists each pack's scans, price, and price per scan). If they choose not to buy, stop. Never pick a pack for them.
|
|
29
|
+
2. Run `cleanslop credits buy --link --pack <pack> --no-wait` with their pack. It prints an `approve` block and exits 10. Relay its prompt: Link sends the approval to the human's Link app, and there is usually no link to open.
|
|
30
|
+
3. After the human approves in the Link app, run `cleanslop credits buy --link --resume`. If it prints `approve` again, they have not approved yet: relay the prompt again and wait. If it prints `ask_human`, relay it and follow it. Never start a second purchase while one is pending.
|
|
31
|
+
4. On success it prints “Added … scan credits. Balance: N”. Rerun the scan.
|
|
32
|
+
5. If the CLI says Link packs are not available or to contact us for credits, tell the human and stop. For a GitHub account, the `top-up` block is a checkout link instead: relay it and wait.
|
|
33
|
+
6. Promo codes: if the human gives you a CleanSlop promo code, run `cleanslop redeem <code>` (MCP: `promo_redeem`). Use only a code the human typed in this session; never guess, search for, or reuse one. Each account can use one code; if the CLI says the code is not valid or already used, tell the human and stop. When the account is out of scans and has not used a code yet, the out-of-scans question also offers "Use a promo code".
|
|
34
|
+
|
|
24
35
|
## Relay human actions
|
|
25
36
|
|
|
26
|
-
When the CLI prints a `CLEANSLOP_ACTION_REQUIRED` block, show the human the link and code **exactly as printed** and wait. Kinds: approve (device login
|
|
37
|
+
When the CLI prints a `CLEANSLOP_ACTION_REQUIRED` block, show the human the link and code **exactly as printed** and wait. Kinds: approve (device login, Link sign-in, or a Link payment), install (GitHub App), top-up (credits), beta (request access), reauth (reconnect GitHub), present_identity (Link), link_existing (connect Link to an existing account), ask_human (quoted terms or email-sharing question). Never open the link, never approve, never pay, never enter credentials. `cleanslop login --link` drives `link-cli` itself (Link sign-in, attestations, identity credential). Never run `link-cli … present`, `attestations pop`, or `spend-request` yourself, and never paste their output. When CleanSlop says the person must approve a payment in Link, tell them and wait. Pass `--agree` only after the human answers yes to the quoted question in this session. When a block includes a `CLEANSLOP_QUESTION:` line (a JSON question with options), ask it with your multiple-choice question tool if you have one (for example AskUserQuestion), offering exactly those options; otherwise ask in plain text. Never answer for the human. Then do what the chosen option says: run its `run` command, follow its `next` step, or stop if it has neither. After login, repeat “Connected as @login” or the masked Link email to the human.
|
|
27
38
|
|
|
28
39
|
## Waiting
|
|
29
40
|
|
|
@@ -47,7 +58,7 @@ Fix by priority, run the repo’s tests, ask the human about `needs_input`, get
|
|
|
47
58
|
|
|
48
59
|
## Stop conditions
|
|
49
60
|
|
|
50
|
-
Stop when all listed issues are resolved; the same fingerprints are still open after one rescan; the
|
|
61
|
+
Stop when all listed issues are resolved; the same fingerprints are still open after one rescan; the account is out of scans and the human does not buy more (or none can be bought); the human declines; or the commit has not changed.
|
|
51
62
|
|
|
52
63
|
## Report back
|
|
53
64
|
|
package/dist/action.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ import type { CliDeps } from "./deps.js";
|
|
|
2
2
|
import type { ActionRequired } from "./exit.js";
|
|
3
3
|
import type { AgentScan } from "./types.js";
|
|
4
4
|
export declare function writeAction(deps: CliDeps, action: ActionRequired): void;
|
|
5
|
+
export declare const QUESTION_TOOL_HINT = "Ask this with your multiple-choice question tool if you have one, offering exactly these options; otherwise ask in plain text. Never answer for the human. Then do what the chosen option says: run its command, follow its next step, or stop.";
|
|
5
6
|
export declare function writeResume(deps: CliDeps, scanId: string, scan?: Pick<AgentScan, "eta" | "elapsedSec">): void;
|
package/dist/action.js
CHANGED
|
@@ -11,9 +11,33 @@ export function writeAction(deps, action) {
|
|
|
11
11
|
if (action.code) {
|
|
12
12
|
lines.push("", `Code: ${action.code}`);
|
|
13
13
|
}
|
|
14
|
+
if (action.question) {
|
|
15
|
+
lines.push("", ...questionLines(action.question));
|
|
16
|
+
}
|
|
14
17
|
lines.push("", "Never open, approve, or pay yourself. Never enter credentials or payment details.");
|
|
15
18
|
deps.io.stderr(`${lines.join("\n")}\n`);
|
|
16
19
|
}
|
|
20
|
+
export const QUESTION_TOOL_HINT = "Ask this with your multiple-choice question tool if you have one, offering exactly these options; otherwise ask in plain text. Never answer for the human. Then do what the chosen option says: run its command, follow its next step, or stop.";
|
|
21
|
+
/** Numbered options, the machine-readable line, and how to ask. */
|
|
22
|
+
function questionLines(question) {
|
|
23
|
+
const options = question.options.map((option, i) => {
|
|
24
|
+
const detail = option.description ? ` (${option.description})` : "";
|
|
25
|
+
const next = option.run
|
|
26
|
+
? ` → run: ${option.run}`
|
|
27
|
+
: option.next
|
|
28
|
+
? ` → next: ${option.next}`
|
|
29
|
+
: " → stop";
|
|
30
|
+
return ` ${i + 1}. ${option.label}${detail}${next}`;
|
|
31
|
+
});
|
|
32
|
+
return [
|
|
33
|
+
`Options:`,
|
|
34
|
+
...options,
|
|
35
|
+
"",
|
|
36
|
+
`CLEANSLOP_QUESTION: ${JSON.stringify(question)}`,
|
|
37
|
+
"",
|
|
38
|
+
QUESTION_TOOL_HINT,
|
|
39
|
+
];
|
|
40
|
+
}
|
|
17
41
|
export function writeResume(deps, scanId, scan) {
|
|
18
42
|
const eta = scan ? formatEtaLine(scan) : null;
|
|
19
43
|
const head = eta ? `Still running (${eta}).` : "Still running.";
|
package/dist/action.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.js","sourceRoot":"","sources":["../src/action.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,MAAM,UAAU,WAAW,CAAC,IAAa,EAAE,MAAsB;IAC/D,MAAM,KAAK,GAAG;QACZ,8BAA8B,MAAM,CAAC,IAAI,EAAE;QAC3C,EAAE;QACF,MAAM,CAAC,WAAW;KACnB,CAAC;IACF,IAAI,MAAM,CAAC,GAAG,EAAE,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC;IACD,KAAK,CAAC,IAAI,CACR,EAAE,EACF,mFAAmF,CACpF,CAAC;IACF,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,IAAa,EACb,MAAc,EACd,IAA4C;IAE5C,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IA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AAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACjD,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACpE,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG;YACrB,CAAC,CAAC,WAAW,MAAM,CAAC,GAAG,EAAE;YACzB,CAAC,CAAC,MAAM,CAAC,IAAI;gBACX,CAAC,CAAC,YAAY,MAAM,CAAC,IAAI,EAAE;gBAC3B,CAAC,CAAC,SAAS,CAAC;QAChB,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,KAAK,GAAG,MAAM,GAAG,IAAI,EAAE,CAAC;IACvD,CAAC,CAAC,CAAC;IACH,OAAO;QACL,UAAU;QACV,GAAG,OAAO;QACV,EAAE;QACF,uBAAuB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;QACjD,EAAE;QACF,kBAAkB;KACnB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,IAAa,EACb,MAAc,EACd,IAA4C;IAE5C,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9C,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC;IAChE,IAAI,CAAC,EAAE,CAAC,MAAM,CACZ,GAAG,IAAI,qCAAqC,MAAM,WAAW,CAC9D,CAAC;AACJ,CAAC"}
|
package/dist/args.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ParsedArgs } from "./types.js";
|
|
2
2
|
export declare function parseWaitMs(raw: string, fallback?: number): number;
|
|
3
3
|
export declare function parseArgs(argv: string[], defaultWaitMs?: number): ParsedArgs;
|
|
4
|
-
export declare const HELP_TEXT = "cleanslop \u2014 CleanSlop agent CLI\n\nUsage:\n cleanslop [scan] [--wait [duration]] [--json] [--force] [--preview]\n cleanslop login [--link] [--
|
|
4
|
+
export declare const HELP_TEXT = "cleanslop \u2014 CleanSlop agent CLI\n\nUsage:\n cleanslop [scan] [--wait [duration]] [--json] [--force] [--preview]\n cleanslop login [--link] [--agree] [--no-wait | --resume]\n cleanslop link-identity [--agree] [--no-wait | --resume]\n cleanslop credits buy --link [--pack p5] [--no-wait | --resume]\n cleanslop redeem <code>\n cleanslop logout\n cleanslop whoami\n cleanslop status [id] [--wait [duration]]\n cleanslop report [id] [--format md|json] [--preview]\n cleanslop email <id> --consent \"<exact question>\" [--reply \"<human reply>\"]\n cleanslop setup [--dry-run] [--uninstall] [--project] [--yes]\n\nscan is the default command. GitHub App repos, or a packed upload when /me\nreports uploads:true (Link). --dry-run on scan lists the upload pack.\n\nWait:\n --wait poll until final or the budget (default 8 minutes)\n --wait 75m Claude Code background budget (hours/minutes/seconds: 1h, 75m, 30s)\n At the deadline: exit 75 and print a resume command. The scan keeps running.\n\nFlags:\n --json one JSON document on stdout\n --force skip same-commit dedupe (sends Idempotency-Key)\n --preview first-pass report before judgment is final\n --no-wait login / link-identity / credits buy: print what to approve and exit 10\n --resume login / link-identity / credits buy: continue a pending --no-wait approval\n --link login: Stripe Link sign-up / sign-in (requires link-cli)\n --agree login --link / link-identity: pass only after the human answers yes to the quoted question\n (--accept-terms --yes-share-email together still work for login --link; --yes-share-email for link-identity)\n --pack credits buy: p5, p15, or p40. Required without a terminal (the human picks); a terminal defaults to p5. Price and network id come from CleanSlop.\n --dry-run setup: print the plan. scan (Link): list the pack, upload nothing\n --uninstall setup: remove marker blocks / skill files\n --project setup: project files instead of user scope\n --yes setup: write in a non-TTY (otherwise non-TTY is a plan only)\n --consent email: the exact masked-recipient question you asked\n --reply email: optional verbatim human reply\n\nEnv:\n CLEANSLOP_ORIGIN API origin (default https://cleanslop.com)\n CLEANSLOP_TOKEN bearer token override (never printed)\n CLEANSLOP_LINK_CLI path to link-cli (default: link-cli on PATH)\n\nCredentials: $XDG_CONFIG_HOME/cleanslop/credentials.json or ~/.config/cleanslop/\nDirectory 0700, file 0600. Never stored inside the git worktree.\n\nExit codes: 0 ok \u00B7 1 unexpected \u00B7 2 usage \u00B7 10 human action \u00B7 11 payment\n 12 policy \u00B7 13 source \u00B7 20 scan failed \u00B7 75 still running\n\nNever open, approve, or pay yourself. Relay CLEANSLOP_ACTION_REQUIRED blocks.\nAsk a CLEANSLOP_QUESTION with your multiple-choice question tool if you have\none, using exactly its options. Never answer for the human.\n";
|
package/dist/args.js
CHANGED
|
@@ -11,6 +11,7 @@ const COMMANDS = [
|
|
|
11
11
|
"email",
|
|
12
12
|
"link-identity",
|
|
13
13
|
"credits",
|
|
14
|
+
"redeem",
|
|
14
15
|
];
|
|
15
16
|
function isCommand(value) {
|
|
16
17
|
return COMMANDS.includes(value);
|
|
@@ -49,6 +50,7 @@ function emptyArgs(defaultWaitMs) {
|
|
|
49
50
|
consent: null,
|
|
50
51
|
reply: null,
|
|
51
52
|
link: false,
|
|
53
|
+
agree: false,
|
|
52
54
|
acceptTerms: false,
|
|
53
55
|
yesShareEmail: false,
|
|
54
56
|
pack: null,
|
|
@@ -106,6 +108,9 @@ export function parseArgs(argv, defaultWaitMs = DEFAULT_WAIT_MS) {
|
|
|
106
108
|
case "--link":
|
|
107
109
|
out.link = true;
|
|
108
110
|
break;
|
|
111
|
+
case "--agree":
|
|
112
|
+
out.agree = true;
|
|
113
|
+
break;
|
|
109
114
|
case "--accept-terms":
|
|
110
115
|
out.acceptTerms = true;
|
|
111
116
|
break;
|
|
@@ -191,10 +196,10 @@ export const HELP_TEXT = `cleanslop — CleanSlop agent CLI
|
|
|
191
196
|
|
|
192
197
|
Usage:
|
|
193
198
|
cleanslop [scan] [--wait [duration]] [--json] [--force] [--preview]
|
|
194
|
-
cleanslop login [--link] [--
|
|
195
|
-
cleanslop link-identity [--
|
|
196
|
-
cleanslop credits buy --link [--pack p5]
|
|
197
|
-
cleanslop
|
|
199
|
+
cleanslop login [--link] [--agree] [--no-wait | --resume]
|
|
200
|
+
cleanslop link-identity [--agree] [--no-wait | --resume]
|
|
201
|
+
cleanslop credits buy --link [--pack p5] [--no-wait | --resume]
|
|
202
|
+
cleanslop redeem <code>
|
|
198
203
|
cleanslop logout
|
|
199
204
|
cleanslop whoami
|
|
200
205
|
cleanslop status [id] [--wait [duration]]
|
|
@@ -214,12 +219,12 @@ Flags:
|
|
|
214
219
|
--json one JSON document on stdout
|
|
215
220
|
--force skip same-commit dedupe (sends Idempotency-Key)
|
|
216
221
|
--preview first-pass report before judgment is final
|
|
217
|
-
--no-wait login / link-identity: print
|
|
218
|
-
--resume login / link-identity: continue a pending --no-wait approval
|
|
222
|
+
--no-wait login / link-identity / credits buy: print what to approve and exit 10
|
|
223
|
+
--resume login / link-identity / credits buy: continue a pending --no-wait approval
|
|
219
224
|
--link login: Stripe Link sign-up / sign-in (requires link-cli)
|
|
220
|
-
--
|
|
221
|
-
|
|
222
|
-
--pack credits buy: p5, p15, or p40 (
|
|
225
|
+
--agree login --link / link-identity: pass only after the human answers yes to the quoted question
|
|
226
|
+
(--accept-terms --yes-share-email together still work for login --link; --yes-share-email for link-identity)
|
|
227
|
+
--pack credits buy: p5, p15, or p40. Required without a terminal (the human picks); a terminal defaults to p5. Price and network id come from CleanSlop.
|
|
223
228
|
--dry-run setup: print the plan. scan (Link): list the pack, upload nothing
|
|
224
229
|
--uninstall setup: remove marker blocks / skill files
|
|
225
230
|
--project setup: project files instead of user scope
|
|
@@ -239,5 +244,7 @@ Exit codes: 0 ok · 1 unexpected · 2 usage · 10 human action · 11 payment
|
|
|
239
244
|
12 policy · 13 source · 20 scan failed · 75 still running
|
|
240
245
|
|
|
241
246
|
Never open, approve, or pay yourself. Relay CLEANSLOP_ACTION_REQUIRED blocks.
|
|
247
|
+
Ask a CLEANSLOP_QUESTION with your multiple-choice question tool if you have
|
|
248
|
+
one, using exactly its options. Never answer for the human.
|
|
242
249
|
`;
|
|
243
250
|
//# sourceMappingURL=args.js.map
|
package/dist/args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAGvC,MAAM,QAAQ,GAA2B;IACvC,MAAM;IACN,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,OAAO;IACP,eAAe;IACf,SAAS;
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAGvC,MAAM,QAAQ,GAA2B;IACvC,MAAM;IACN,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,OAAO;IACP,eAAe;IACf,SAAS;IACT,QAAQ;CACT,CAAC;AAEF,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAQ,QAA8B,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,GAAW,EACX,QAAQ,GAAG,eAAe;IAE1B,MAAM,KAAK,GAAG,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAClD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,UAAU,CAAC,4BAA4B,GAAG,yBAAyB,CAAC,CAAC;IAC7E,CAAC;IACD,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3B,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,WAAW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ACrE,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC;gBACjB,MAAM;YACR,CAAC;YACD;gBACE,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;oBAC1B,MAAM,UAAU,CAAC,iBAAiB,KAAK,EAAE,CAAC,CAAC;gBAC7C,CAAC;gBACD,IAAI,GAAG,CAAC,EAAE,EAAE,CAAC;oBACX,MAAM,UAAU,CAAC,8BAA8B,KAAK,EAAE,CAAC,CAAC;gBAC1D,CAAC;gBACD,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC;gBACf,MAAM;QACV,CAAC;IACH,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDxB,CAAC"}
|
|
@@ -12,18 +12,47 @@ export type StripeSptOffer = {
|
|
|
12
12
|
currency: string;
|
|
13
13
|
networkId: string;
|
|
14
14
|
purchaseUrl: string;
|
|
15
|
+
/** CleanSlop marks one pack as the best value. */
|
|
16
|
+
best?: boolean;
|
|
15
17
|
};
|
|
16
18
|
/** Fixed Link approval budget. Auto-buy ignores `scan --wait`. */
|
|
17
19
|
export declare const LINK_APPROVAL_WAIT_MS: number;
|
|
20
|
+
/**
|
|
21
|
+
* `--resume` budget. The human has usually approved already; anything longer
|
|
22
|
+
* would outlast an agent's foreground shell call.
|
|
23
|
+
*/
|
|
24
|
+
export declare const LINK_RESUME_WAIT_MS: number;
|
|
25
|
+
/**
|
|
26
|
+
* How long to poll Link for approval. `--no-wait` checks once, `--resume`
|
|
27
|
+
* polls briefly, and the default (a human at a terminal) waits 10 minutes.
|
|
28
|
+
*/
|
|
18
29
|
export declare function linkApprovalWaitMs(args: ParsedArgs, opts?: {
|
|
19
30
|
autoBuy?: boolean;
|
|
20
31
|
}): number;
|
|
32
|
+
/** Cents to a display price, e.g. `5.00 USD`. */
|
|
33
|
+
export declare function formatPackPrice(amount: number, currency: string): string;
|
|
34
|
+
/** `p15 (15 scans, 25.00 USD, 1.67 USD per scan, best value)`. */
|
|
35
|
+
export declare function describePackOffer(offer: StripeSptOffer): string;
|
|
36
|
+
/** Every `stripe_spt` offer in a 402 `out_of_scans` body, in server order. */
|
|
37
|
+
export declare function stripeSptOffersFromErrorBody(json: unknown): StripeSptOffer[];
|
|
21
38
|
/** Read a matching `stripe_spt` offer from a 402 `out_of_scans` body. */
|
|
22
39
|
export declare function stripeSptOfferFromErrorBody(json: unknown, packHint: string | null): StripeSptOffer | null;
|
|
40
|
+
/**
|
|
41
|
+
* Buys a Link credit pack. Default mode (a human at a terminal) creates the
|
|
42
|
+
* spend request and waits up to 10 minutes. `--no-wait` creates it (or checks
|
|
43
|
+
* the saved one), prints the approve block, and exits 10; `--resume` finishes
|
|
44
|
+
* the saved request. A saved request for this origin is always reused rather
|
|
45
|
+
* than replaced, so retries never send the person a second approval.
|
|
46
|
+
*/
|
|
23
47
|
export declare function buyLinkCredits(deps: CliDeps, args: ParsedArgs, offer?: StripeSptOffer | null, opts?: {
|
|
24
48
|
autoBuy?: boolean;
|
|
25
49
|
}): Promise<number>;
|
|
26
50
|
export declare function runCredits(deps: CliDeps, args: ParsedArgs): Promise<number>;
|
|
27
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* If a scan 402 offers `stripe_spt`: a human at a terminal buys that pack in
|
|
53
|
+
* place and the scan retries once. An agent (no TTY) gets a top-up block that
|
|
54
|
+
* sends it through `credits buy --link --no-wait` / `--resume`, because a
|
|
55
|
+
* 10-minute approval wait outlasts its shell call.
|
|
56
|
+
*/
|
|
28
57
|
export declare function recoverOutOfScansIfOffered(deps: CliDeps, args: ParsedArgs, result: HttpResult, retry: () => Promise<HttpResult>): Promise<HttpResult>;
|
|
29
58
|
export {};
|