@scribe-platform/cli 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +28 -0
  2. package/dist/commands/login.d.ts.map +1 -1
  3. package/dist/commands/login.js +15 -1
  4. package/dist/commands/login.js.map +1 -1
  5. package/dist/commands/proof.d.ts +5 -0
  6. package/dist/commands/proof.d.ts.map +1 -0
  7. package/dist/commands/proof.js +440 -0
  8. package/dist/commands/proof.js.map +1 -0
  9. package/dist/commands/prospect.d.ts +27 -0
  10. package/dist/commands/prospect.d.ts.map +1 -0
  11. package/dist/commands/prospect.js +222 -0
  12. package/dist/commands/prospect.js.map +1 -0
  13. package/dist/commands/request.d.ts +38 -0
  14. package/dist/commands/request.d.ts.map +1 -0
  15. package/dist/commands/request.js +214 -0
  16. package/dist/commands/request.js.map +1 -0
  17. package/dist/commands/site.d.ts +11 -0
  18. package/dist/commands/site.d.ts.map +1 -1
  19. package/dist/commands/site.js +41 -3
  20. package/dist/commands/site.js.map +1 -1
  21. package/dist/commands/update.d.ts +10 -0
  22. package/dist/commands/update.d.ts.map +1 -1
  23. package/dist/commands/update.js +128 -31
  24. package/dist/commands/update.js.map +1 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +15 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/lib/claude-hook.d.ts +74 -0
  29. package/dist/lib/claude-hook.d.ts.map +1 -0
  30. package/dist/lib/claude-hook.js +108 -0
  31. package/dist/lib/claude-hook.js.map +1 -0
  32. package/dist/lib/client.d.ts +351 -0
  33. package/dist/lib/client.d.ts.map +1 -1
  34. package/dist/lib/client.js +159 -0
  35. package/dist/lib/client.js.map +1 -1
  36. package/dist/lib/proof-folder.d.ts +86 -0
  37. package/dist/lib/proof-folder.d.ts.map +1 -0
  38. package/dist/lib/proof-folder.js +226 -0
  39. package/dist/lib/proof-folder.js.map +1 -0
  40. package/dist/lib/proof-preview.d.ts +39 -0
  41. package/dist/lib/proof-preview.d.ts.map +1 -0
  42. package/dist/lib/proof-preview.js +318 -0
  43. package/dist/lib/proof-preview.js.map +1 -0
  44. package/dist/lib/proof-push.d.ts +42 -0
  45. package/dist/lib/proof-push.d.ts.map +1 -0
  46. package/dist/lib/proof-push.js +91 -0
  47. package/dist/lib/proof-push.js.map +1 -0
  48. package/dist/lib/skill.d.ts +13 -0
  49. package/dist/lib/skill.d.ts.map +1 -1
  50. package/dist/lib/skill.js +33 -2
  51. package/dist/lib/skill.js.map +1 -1
  52. package/dist/lib/update-check.d.ts +46 -0
  53. package/dist/lib/update-check.d.ts.map +1 -0
  54. package/dist/lib/update-check.js +103 -0
  55. package/dist/lib/update-check.js.map +1 -0
  56. package/package.json +5 -3
  57. package/runtime/proof.js +139 -0
  58. package/skills/scribe-site-builder/SKILL.md +175 -33
  59. package/skills/scribe-site-builder/recipes/README.md +11 -3
  60. package/skills/scribe-site-builder/recipes/domains.md +151 -0
  61. package/skills/scribe-site-builder/recipes/forms.md +5 -2
  62. package/skills/scribe-site-builder/recipes/proofs.md +311 -0
  63. package/skills/scribe-site-builder/recipes/prospects.md +192 -0
  64. package/skills/scribe-site-builder/recipes/requests.md +145 -0
  65. package/skills/scribe-site-builder/recipes/schema.md +24 -0
package/README.md CHANGED
@@ -197,6 +197,34 @@ Dispatches the site's build workflow and returns immediately. Debounced to once
197
197
  every five minutes. Prefer `scribe site deploy`, which waits for the build and
198
198
  then checks the result.
199
199
 
200
+ ### Proofs
201
+
202
+ ```
203
+ scribe proof create --client <slug> --title "Logo concepts" [--dir proofs/logos]
204
+ scribe proof check [dir]
205
+ scribe proof preview [dir]
206
+ scribe proof push [dir] [--note "What changed"]
207
+ scribe proof list [--client <slug>] [--status <status>]
208
+ scribe proof show [client/proof]
209
+ scribe proof pull [client/proof] [--version <n|draft>] [--dir <path>]
210
+ scribe proof close [client/proof] [--reason <text>]
211
+ scribe proof reopen [client/proof]
212
+ ```
213
+
214
+ A Proof is a small HTML page, plus its images, CSS and JS, sent to a client for
215
+ review: a logo board, a homepage direction. It belongs to a client, so the
216
+ prospect has to exist first. `create` links a folder to it with a
217
+ `.scribe-proof.json`, and inside that folder every other command needs no
218
+ argument.
219
+
220
+ Mark each thing the client can pick with `data-proof-option="<id>"` (and
221
+ optionally `data-proof-label`), and keep links relative. `check` flags any that
222
+ start with `/`, which would break for the client. `preview` serves the folder
223
+ on your machine exactly as the client will see it, with hearts, comments and
224
+ pins working, and saves nothing. `push` uploads only the files that changed and
225
+ makes them the Proof's draft, replacing any unsent draft. It sends nothing to
226
+ anyone. Sending to the client arrives in a later release.
227
+
200
228
  ## Programmatic use
201
229
 
202
230
  The API client and config helpers are exported for scripting:
@@ -1 +1 @@
1
- {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAU3D"}
1
+ {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuB3D"}
@@ -1,16 +1,30 @@
1
+ import { reportHookInstall } from '../lib/claude-hook.js';
1
2
  import { saveConfig } from '../lib/config.js';
3
+ import { reportSkillInstall } from '../lib/skill.js';
2
4
  // The hosted admin instance. Overridable per-machine with --api-url or
3
5
  // SCRIBE_API_URL (both needed when pointing at a local dev/Docker admin).
4
6
  const DEFAULT_API_URL = 'https://scribe.weaverdigital.io';
5
7
  export function registerLoginCommand(program) {
6
8
  program
7
9
  .command('login')
8
- .description('Store an API key for authenticating future commands')
10
+ .description('Set up this machine: store an API key, install the Claude Code skill, turn on auto-updates')
9
11
  .requiredOption('--token <key>', 'API key (admin UI: account menu -> API Tokens -> New token)')
10
12
  .option('--api-url <url>', 'Scribe admin API base URL', process.env.SCRIBE_API_URL ?? DEFAULT_API_URL)
11
13
  .action((opts) => {
12
14
  saveConfig({ token: opts.token, apiUrl: opts.apiUrl.replace(/\/+$/, '') });
13
15
  console.log(`Logged in. Config saved to ~/.scribe/config.json (api: ${opts.apiUrl})`);
16
+ // Setting up a machine is exactly when the skill and the auto-update
17
+ // hook should land, and `login` is the one command every machine runs.
18
+ // Leaving them to `scribe update` would mean the feature that removes
19
+ // manual steps had manual steps guarding it — and the person most helped
20
+ // by auto-updates is the least likely to know the flags exist.
21
+ //
22
+ // Both are safe to repeat. A second login — to change the token or
23
+ // point at a different admin — recopies the skill (a directory copy,
24
+ // and the copy staged-and-renamed so nothing sees a half-written one)
25
+ // and leaves the hook alone once it's correct.
26
+ reportSkillInstall();
27
+ reportHookInstall();
14
28
  });
15
29
  }
16
30
  //# sourceMappingURL=login.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,uEAAuE;AACvE,0EAA0E;AAC1E,MAAM,eAAe,GAAG,iCAAiC,CAAC;AAE1D,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,qDAAqD,CAAC;SAClE,cAAc,CAAC,eAAe,EAAE,6DAA6D,CAAC;SAC9F,MAAM,CAAC,iBAAiB,EAAE,2BAA2B,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,eAAe,CAAC;SACrG,MAAM,CAAC,CAAC,IAAuC,EAAE,EAAE;QAClD,UAAU,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;QAC3E,OAAO,CAAC,GAAG,CAAC,0DAA0D,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACxF,CAAC,CAAC,CAAC;AACP,CAAC"}
1
+ {"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,uEAAuE;AACvE,0EAA0E;AAC1E,MAAM,eAAe,GAAG,iCAAiC,CAAC;AAE1D,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,4FAA4F,CAAC;SACzG,cAAc,CAAC,eAAe,EAAE,6DAA6D,CAAC;SAC9F,MAAM,CAAC,iBAAiB,EAAE,2BAA2B,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,eAAe,CAAC;SACrG,MAAM,CAAC,CAAC,IAAuC,EAAE,EAAE;QAClD,UAAU,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;QAC3E,OAAO,CAAC,GAAG,CAAC,0DAA0D,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAEtF,qEAAqE;QACrE,uEAAuE;QACvE,sEAAsE;QACtE,yEAAyE;QACzE,+DAA+D;QAC/D,EAAE;QACF,mEAAmE;QACnE,qEAAqE;QACrE,sEAAsE;QACtE,+CAA+C;QAC/C,kBAAkB,EAAE,CAAC;QACrB,iBAAiB,EAAE,CAAC;IACtB,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Command } from 'commander';
2
+ declare function versionArg(value: string | undefined): number | 'draft' | null;
3
+ export declare function registerProofCommands(program: Command): void;
4
+ export { versionArg };
5
+ //# sourceMappingURL=proof.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proof.d.ts","sourceRoot":"","sources":["../../src/commands/proof.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkCpC,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAItE;AAwHD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0T5D;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,440 @@
1
+ import { existsSync, mkdirSync } from 'node:fs';
2
+ import { resolve } from 'node:path';
3
+ import { loadConfig } from '../lib/config.js';
4
+ import { ScribeClient } from '../lib/client.js';
5
+ import { CliExit, printResult, requireClient, runAction } from '../lib/cli-utils.js';
6
+ import { checkFolder, readProofConfig, resolveProofRef, writeProofConfig, PROOF_CONFIG_FILE } from '../lib/proof-folder.js';
7
+ import { defaultPullDir, pullProof, pushProof, PullRefused } from '../lib/proof-push.js';
8
+ import { startPreview } from '../lib/proof-preview.js';
9
+ /**
10
+ * RFC 0029 — `scribe proof`: building a Proof locally, pushing versions of it,
11
+ * sending one to a Client, reading what they said and replying.
12
+ *
13
+ * Everything here is reversible except `send`, which freezes a version and
14
+ * emails it — which is why the skill is required to ask Ashley first.
15
+ *
16
+ * A Proof is addressed `<client>/<proof>` — or, inside a Proof folder, by the
17
+ * folder's `.scribe-proof.json`, so most commands need no argument at all.
18
+ */
19
+ const STATUSES = ['draft', 'in-review', 'changes-requested', 'approved', 'closed'];
20
+ const ACCESS = ['link', 'sign-in'];
21
+ function fail(message) {
22
+ console.error(message);
23
+ process.exitCode = 1;
24
+ throw new CliExit();
25
+ }
26
+ function refOrFail(arg, dir) {
27
+ const resolved = resolveProofRef(arg, dir);
28
+ if (!resolved.ok)
29
+ fail(resolved.error);
30
+ return resolved.ref;
31
+ }
32
+ function versionArg(value) {
33
+ if (value === undefined)
34
+ return null;
35
+ if (value === 'draft')
36
+ return 'draft';
37
+ return /^[1-9]\d{0,5}$/.test(value) ? Number(value) : NaN;
38
+ }
39
+ /** Prints a check's findings; returns false if the push should not go ahead. */
40
+ function reportCheck(result, opts) {
41
+ for (const error of result.errors)
42
+ console.error(`✗ ${error}`);
43
+ for (const link of result.brokenLinks)
44
+ console.error(`${opts.force ? '!' : '✗'} ${link}`);
45
+ for (const warning of result.warnings)
46
+ console.error(`! ${warning}`);
47
+ if (result.errors.length > 0)
48
+ return false;
49
+ if (result.brokenLinks.length > 0 && !opts.force) {
50
+ console.error('\nLinks starting with / will be broken for the client. Make them relative, or pass --force to push anyway.');
51
+ return false;
52
+ }
53
+ return true;
54
+ }
55
+ function summarizeCheck(result) {
56
+ const size = result.totalBytes < 1024 * 1024
57
+ ? `${Math.max(1, Math.round(result.totalBytes / 1024))} KB`
58
+ : `${Math.round((result.totalBytes / (1024 * 1024)) * 10) / 10} MB`;
59
+ // A gallery's Options don't exist yet — the server names one per file at
60
+ // push — so saying "no options marked" would read as a problem.
61
+ const options = result.gallery
62
+ ? `a gallery: one option per file`
63
+ : result.options.length
64
+ ? `${result.options.length} option(s): ${result.options.map((o) => o.id).join(', ')}`
65
+ : 'no options marked';
66
+ return `${result.files.length} file(s), ${size}, ${options}`;
67
+ }
68
+ /** The last pushed version's Option ids, for check's "dropped" line. Quietly empty if offline or logged out. */
69
+ async function previousOptions(ref) {
70
+ const config = loadConfig();
71
+ if (!ref || !config)
72
+ return [];
73
+ try {
74
+ const proof = await new ScribeClient(config).getProof(ref.client, ref.proof);
75
+ const latest = proof.versions[proof.versions.length - 1];
76
+ return latest ? latest.options.map((o) => o.id) : [];
77
+ }
78
+ catch {
79
+ return [];
80
+ }
81
+ }
82
+ /**
83
+ * The human-readable form of `proof feedback`.
84
+ *
85
+ * Grouped by option, because that's how the next version gets drafted: an
86
+ * option nobody picked gets dropped, and one with a comment on it gets
87
+ * redrawn. `--json` carries the same shape for Claude to read.
88
+ */
89
+ function printFeedback(report) {
90
+ console.log(`${report.proof.title} — ${report.proof.clientName}, v${report.version}`);
91
+ if (report.viewers.length === 0) {
92
+ console.log('\nNobody has opened it yet.');
93
+ }
94
+ else {
95
+ console.log(`\nOpened by: ${report.viewers.map((v) => v.name).join(', ')}`);
96
+ }
97
+ const withFeedback = report.options.filter((o) => o.reactions.up.length + o.reactions.down.length > 0 || o.comments.length > 0);
98
+ if (report.options.length > 0) {
99
+ console.log('\nOptions:');
100
+ for (const option of report.options) {
101
+ const felt = [
102
+ option.reactions.up.length ? `👍 ${option.reactions.up.join(', ')}` : null,
103
+ option.reactions.down.length ? `👎 ${option.reactions.down.join(', ')}` : null,
104
+ ].filter(Boolean);
105
+ const liked = felt.length ? felt.join(' ') : 'no reactions';
106
+ const from = option.from ? ` (from ${option.from})` : '';
107
+ console.log(` ${option.optionId}${option.label ? ` — ${option.label}` : ''}${from}: ${liked}`);
108
+ for (const comment of option.comments)
109
+ printComment(comment, ' ');
110
+ }
111
+ if (withFeedback.length === 0)
112
+ console.log(' (nothing said about any of them yet)');
113
+ }
114
+ if (report.pinned.length > 0) {
115
+ console.log('\nOn the page:');
116
+ for (const comment of report.pinned)
117
+ printComment(comment, ' ');
118
+ }
119
+ if (report.general.length > 0) {
120
+ console.log('\nGeneral:');
121
+ for (const comment of report.general)
122
+ printComment(comment, ' ');
123
+ }
124
+ if (report.decisions.length > 0) {
125
+ console.log('\nDecisions:');
126
+ for (const decision of report.decisions) {
127
+ const what = decision.decision === 'approved' ? 'approved' : 'asked for changes';
128
+ console.log(` ${decision.reviewerName} ${what}${decision.body ? ` — "${decision.body}"` : ''}`);
129
+ }
130
+ }
131
+ }
132
+ function printComment(comment, indent) {
133
+ const who = comment.fromStaff ? `${comment.reviewerName} (you)` : comment.reviewerName;
134
+ // The id is printed so `scribe proof reply <id>` needs no --json round trip.
135
+ const where = comment.pin ? ' [pinned]' : '';
136
+ console.log(`${indent}${who}${where}: "${comment.body}" (${comment.id})`);
137
+ }
138
+ function printProof(proof) {
139
+ console.log(`${proof.title} — ${proof.clientName} (${proof.clientSlug}/${proof.slug})`);
140
+ console.log(`Status: ${proof.status}${proof.closedReason ? ` (${proof.closedReason})` : ''}`);
141
+ console.log(`Access: ${proof.access}${proof.siteSlug ? ` · site ${proof.siteSlug}` : ''}`);
142
+ if (proof.versions.length === 0) {
143
+ console.log('Versions: none yet — run `scribe proof push` in the Proof folder.');
144
+ }
145
+ else {
146
+ console.log('Versions:');
147
+ for (const v of proof.versions) {
148
+ const state = v.sentAt ? `sent ${v.sentAt}` : 'draft, not sent';
149
+ const options = v.options.length ? ` · ${v.options.map((o) => o.id).join(', ')}` : '';
150
+ console.log(` v${v.number} (${state}) · ${v.files} file(s)${options}${v.note ? `\n "${v.note}"` : ''}`);
151
+ }
152
+ }
153
+ if (proof.previewUrl)
154
+ console.log(`Staff preview (valid 24h, not for clients): ${proof.previewUrl}`);
155
+ }
156
+ export function registerProofCommands(program) {
157
+ const proof = program
158
+ .command('proof')
159
+ .description('Proofs — work sent to a client for review (logo boards, mockups). Build in a folder, preview, push versions');
160
+ proof
161
+ .command('create')
162
+ .description('Create a Proof for a client and link a folder to it (the client must exist — create the prospect first)')
163
+ .requiredOption('--client <slug>', 'The client or prospect this Proof is for')
164
+ .requiredOption('--title <title>', 'What the client will see it called, e.g. "Logo concepts"')
165
+ .option('--site <slug>', 'Attach it to one of the client\'s sites (defaults access to sign-in)')
166
+ .option('--access <mode>', `${ACCESS.join(' or ')} (default: link, or sign-in with --site)`)
167
+ .option('--slug <slug>', 'The Proof\'s short name in commands (default: from the title)')
168
+ .option('--dir <path>', 'The folder to link (created if missing)', '.')
169
+ .option('--force', `Re-link a folder that already has a ${PROOF_CONFIG_FILE}`)
170
+ .option('--json', 'Output as JSON')
171
+ .action(runAction(async (opts) => {
172
+ if (opts.access && !ACCESS.includes(opts.access))
173
+ fail(`--access must be ${ACCESS.join(' or ')}`);
174
+ const dir = resolve(opts.dir);
175
+ const existing = readProofConfig(dir);
176
+ if (existing && !opts.force) {
177
+ fail(`${dir} is already linked to ${existing.client}/${existing.proof}. Use a new folder, or pass --force.`);
178
+ }
179
+ const created = await requireClient().createProof({
180
+ client: opts.client,
181
+ title: opts.title,
182
+ site: opts.site,
183
+ access: opts.access,
184
+ slug: opts.slug,
185
+ });
186
+ if (!existsSync(dir))
187
+ mkdirSync(dir, { recursive: true });
188
+ writeProofConfig(dir, { client: created.clientSlug, proof: created.slug });
189
+ if (opts.json)
190
+ return printResult(created, true);
191
+ console.log(`Created ${created.clientSlug}/${created.slug} — "${created.title}" for ${created.clientName} (${created.access} access)`);
192
+ console.log(`Linked ${dir}. Build the page there, then \`scribe proof preview\` and \`scribe proof push\`.`);
193
+ }));
194
+ proof
195
+ .command('check')
196
+ .description('Report what a push would refuse or warn about, without uploading anything')
197
+ .argument('[dir]', 'The Proof folder', '.')
198
+ .action(runAction(async (dirArg) => {
199
+ const dir = resolve(dirArg);
200
+ const result = checkFolder(dir, await previousOptions(readProofConfig(dir)));
201
+ const ok = reportCheck(result, {});
202
+ console.log(`${ok ? '✓' : '✗'} ${summarizeCheck(result)}`);
203
+ if (!ok)
204
+ process.exitCode = 1;
205
+ }));
206
+ proof
207
+ .command('preview')
208
+ .description('Serve the folder locally exactly as the client will see it — hearts, comments and pins work, nothing is saved')
209
+ .argument('[dir]', 'The Proof folder', '.')
210
+ .option('--port <port>', 'Port to listen on (default: any free one)')
211
+ .action(runAction(async (dirArg, opts) => {
212
+ const dir = resolve(dirArg);
213
+ const result = checkFolder(dir);
214
+ reportCheck(result, { force: true });
215
+ const port = opts.port ? Number(opts.port) : undefined;
216
+ if (port !== undefined && (!Number.isInteger(port) || port < 0 || port > 65535))
217
+ fail('--port must be a port number');
218
+ const server = await startPreview({ dir, port, log: (line) => console.log(` ${line}`) });
219
+ console.log(`Previewing ${dir}`);
220
+ console.log(`Open ${server.url} — feedback you try there prints below. Ctrl-C to stop.`);
221
+ // Runs until interrupted; the process staying alive is the point.
222
+ await new Promise((done) => process.once('SIGINT', () => server.close().then(done)));
223
+ }));
224
+ proof
225
+ .command('push')
226
+ .description('Upload the folder as the Proof\'s draft version (replacing any unsent draft). Sends nothing to the client')
227
+ .argument('[dir]', 'The Proof folder', '.')
228
+ .option('--proof <client/proof>', `Which Proof, if the folder has no ${PROOF_CONFIG_FILE}`)
229
+ .option('--note <text>', 'What changed in this version — the client sees it, e.g. "Three simpler takes on the one you liked"')
230
+ .option('--force', 'Push even with links that start with / (they will be broken for the client)')
231
+ .option('--json', 'Output as JSON')
232
+ .action(runAction(async (dirArg, opts) => {
233
+ const dir = resolve(dirArg);
234
+ const ref = refOrFail(opts.proof, dir);
235
+ const client = requireClient();
236
+ const result = checkFolder(dir, await previousOptions(ref));
237
+ if (!reportCheck(result, { force: opts.force })) {
238
+ process.exitCode = 1;
239
+ return;
240
+ }
241
+ const outcome = await pushProof({
242
+ api: client,
243
+ ref,
244
+ files: result.files,
245
+ note: opts.note,
246
+ onUpload: opts.json ? undefined : (path) => console.log(` ↑ ${path}`),
247
+ });
248
+ if (opts.json)
249
+ return printResult(outcome, true);
250
+ console.log(`Pushed ${ref.client}/${ref.proof} as draft v${outcome.version.number}: ${outcome.uploaded} uploaded, ${outcome.reused} unchanged.`);
251
+ if (outcome.version.options.length)
252
+ console.log(`Options: ${outcome.version.options.map((o) => o.id).join(', ')}`);
253
+ console.log(`Staff preview (valid 24h, not for clients): ${outcome.previewUrl}`);
254
+ console.log('Nothing has been sent to the client.');
255
+ }));
256
+ proof
257
+ .command('list')
258
+ .description('List Proofs, most recently active first')
259
+ .option('--client <slug>', 'Only this client\'s Proofs')
260
+ .option('--status <status>', STATUSES.join(', '))
261
+ .option('--json', 'Output as JSON')
262
+ .action(runAction(async (opts) => {
263
+ if (opts.status && !STATUSES.includes(opts.status))
264
+ fail(`--status must be one of: ${STATUSES.join(', ')}`);
265
+ const items = await requireClient().listProofs(opts);
266
+ if (opts.json)
267
+ return printResult(items, true);
268
+ if (items.length === 0) {
269
+ console.log('No Proofs yet.');
270
+ return;
271
+ }
272
+ printResult(items.map((p) => ({
273
+ proof: `${p.clientSlug}/${p.slug}`,
274
+ title: p.title,
275
+ status: p.status,
276
+ sent: p.currentVersion ? `v${p.currentVersion}` : '—',
277
+ draft: p.draftVersion ? `v${p.draftVersion}` : '',
278
+ lastActivity: p.lastActivityAt,
279
+ })), false);
280
+ }));
281
+ proof
282
+ .command('show')
283
+ .description('Show a Proof: status, versions and their notes, and a staff preview link')
284
+ .argument('[proof]', `<client>/<proof> (default: this folder's ${PROOF_CONFIG_FILE})`)
285
+ .option('--json', 'Output as JSON')
286
+ .action(runAction(async (arg, opts) => {
287
+ const ref = refOrFail(arg, process.cwd());
288
+ const detail = await requireClient().getProof(ref.client, ref.proof);
289
+ if (opts.json)
290
+ return printResult(detail, true);
291
+ printProof(detail);
292
+ }));
293
+ proof
294
+ .command('pull')
295
+ .description('Download a version\'s files — to pick up on another machine, or bring back an older direction')
296
+ .argument('[proof]', `<client>/<proof> (default: this folder's ${PROOF_CONFIG_FILE})`)
297
+ .option('--version <n>', 'A version number, or "draft" (default: the newest)')
298
+ .option('--dir <path>', 'Where to put the files (default: a new <proof>-v<n> folder here)')
299
+ .option('--force', 'Write into a folder that already has files in it')
300
+ .action(runAction(async (arg, opts) => {
301
+ const ref = refOrFail(arg, process.cwd());
302
+ const client = requireClient();
303
+ let version = versionArg(opts.version);
304
+ if (Number.isNaN(version))
305
+ fail('--version must be a number or "draft"');
306
+ if (version === null) {
307
+ const detail = await client.getProof(ref.client, ref.proof);
308
+ version = detail.draftVersion ? 'draft' : detail.currentVersion || null;
309
+ if (version === null)
310
+ fail(`${ref.client}/${ref.proof} has no versions yet.`);
311
+ }
312
+ const dir = resolve(opts.dir ?? defaultPullDir(process.cwd(), ref, version));
313
+ try {
314
+ const pulled = await pullProof({ api: client, ref, version, dir, force: opts.force });
315
+ console.log(`Pulled v${pulled.number} (${pulled.manifest.length} file(s)) into ${dir}`);
316
+ }
317
+ catch (err) {
318
+ if (err instanceof PullRefused)
319
+ fail(err.message);
320
+ throw err;
321
+ }
322
+ }));
323
+ proof
324
+ .command('feedback')
325
+ .description('What the client said about a version — picks, comments and decisions, grouped by option')
326
+ .argument('[proof]', `<client>/<proof> (default: this folder's ${PROOF_CONFIG_FILE})`)
327
+ .option('--version <n>', 'Which version (default: the newest one the client was sent)')
328
+ .option('--json', 'Output as JSON')
329
+ .action(runAction(async (arg, opts) => {
330
+ const ref = refOrFail(arg, process.cwd());
331
+ let which;
332
+ if (opts.version !== undefined) {
333
+ const parsed = versionArg(opts.version);
334
+ if (parsed === null || Number.isNaN(parsed))
335
+ fail(`Unknown version "${opts.version}"`);
336
+ which = parsed;
337
+ }
338
+ const report = await requireClient().proofFeedback(ref.client, ref.proof, which);
339
+ if (opts.json) {
340
+ console.log(JSON.stringify(report, null, 2));
341
+ return;
342
+ }
343
+ printFeedback(report);
344
+ }));
345
+ proof
346
+ .command('reply')
347
+ .description('Reply to one of the client’s comments. They see it next time they open the proof')
348
+ .argument('<event-id>', 'The comment’s id, from `scribe proof feedback --json`')
349
+ .argument('<text>', 'What to say')
350
+ .option('--proof <proof>', `<client>/<proof> (default: this folder's ${PROOF_CONFIG_FILE})`)
351
+ .action(runAction(async (eventId, text, opts) => {
352
+ const ref = refOrFail(opts.proof, process.cwd());
353
+ await requireClient().replyToProofComment(ref.client, ref.proof, eventId, text);
354
+ console.log('Replied. They’ll see it the next time they open the proof.');
355
+ }));
356
+ proof
357
+ .command('send')
358
+ .description('Send the pushed draft to the client as the next version, by email. Outward-facing — ask first')
359
+ .argument('[proof]', `<client>/<proof> (default: this folder's ${PROOF_CONFIG_FILE})`)
360
+ .option('--to <email...>', 'Who to send it to (default: the client’s primary contact; remembered for next time)')
361
+ .option('--message <text>', 'A line for the email, instead of the version’s push note')
362
+ .option('--json', 'Output as JSON')
363
+ .action(runAction(async (arg, opts) => {
364
+ const ref = refOrFail(arg, process.cwd());
365
+ const sent = await requireClient().sendProof(ref.client, ref.proof, { to: opts.to, message: opts.message });
366
+ if (opts.json) {
367
+ console.log(JSON.stringify(sent, null, 2));
368
+ return;
369
+ }
370
+ console.log(`Sent ${ref.client}/${ref.proof} v${sent.version.number} to ${sent.sentTo.join(', ')}.`);
371
+ console.log(`Review link: ${sent.reviewUrl}`);
372
+ // Surfaced rather than swallowed: the version is frozen either way, so
373
+ // "it went out" would be a lie Ashley acts on.
374
+ for (const failure of sent.mailFailures)
375
+ console.error(`Email failed — ${failure}`);
376
+ }));
377
+ proof
378
+ .command('link')
379
+ .description('Show the client’s review link, or replace it so the old one stops working')
380
+ .argument('[proof]', `<client>/<proof> (default: this folder's ${PROOF_CONFIG_FILE})`)
381
+ .option('--rotate', 'Replace the link. The old URL stops working immediately — use after it’s been forwarded somewhere it shouldn’t')
382
+ .option('--expires <date>', 'Stop the link working after this date, or "never" to clear it')
383
+ .option('--access <mode>', `${ACCESS.join(' or ')} — sign-in needs the Proof to be on a site`)
384
+ .option('--json', 'Output as JSON')
385
+ .action(runAction(async (arg, opts) => {
386
+ const ref = refOrFail(arg, process.cwd());
387
+ if (opts.access && !ACCESS.includes(opts.access))
388
+ fail(`--access must be ${ACCESS.join(' or ')}`);
389
+ let expires;
390
+ if (opts.expires !== undefined) {
391
+ if (opts.expires === 'never') {
392
+ expires = null;
393
+ }
394
+ else if (Number.isNaN(new Date(opts.expires).getTime())) {
395
+ fail(`"${opts.expires}" isn't a date. Use YYYY-MM-DD, or "never" to clear it.`);
396
+ }
397
+ else {
398
+ expires = new Date(opts.expires).toISOString();
399
+ }
400
+ }
401
+ const changing = opts.rotate || expires !== undefined || opts.access;
402
+ const client = requireClient();
403
+ const link = changing
404
+ ? await client.updateProofLink(ref.client, ref.proof, {
405
+ rotate: opts.rotate,
406
+ expires,
407
+ access: opts.access,
408
+ })
409
+ : await client.getProofLink(ref.client, ref.proof);
410
+ if (opts.json) {
411
+ console.log(JSON.stringify(link, null, 2));
412
+ return;
413
+ }
414
+ if (opts.rotate)
415
+ console.log('Replaced the link — the old one no longer works. Send the new one:');
416
+ console.log(link.url);
417
+ console.log(`Access: ${link.proof.access}${link.expiresAt ? ` · expires ${link.expiresAt}` : ''}`);
418
+ }));
419
+ proof
420
+ .command('close')
421
+ .description('Close a Proof — delivered, or abandoned. It stays readable from its link')
422
+ .argument('[proof]', `<client>/<proof> (default: this folder's ${PROOF_CONFIG_FILE})`)
423
+ .option('--reason <text>', 'Why, e.g. "delivered"')
424
+ .action(runAction(async (arg, opts) => {
425
+ const ref = refOrFail(arg, process.cwd());
426
+ const closed = await requireClient().closeProof(ref.client, ref.proof, opts.reason);
427
+ console.log(`Closed ${ref.client}/${ref.proof}${closed.closedReason ? ` (${closed.closedReason})` : ''}.`);
428
+ }));
429
+ proof
430
+ .command('reopen')
431
+ .description('Reopen a closed Proof, to push and send another version')
432
+ .argument('[proof]', `<client>/<proof> (default: this folder's ${PROOF_CONFIG_FILE})`)
433
+ .action(runAction(async (arg) => {
434
+ const ref = refOrFail(arg, process.cwd());
435
+ const reopened = await requireClient().reopenProof(ref.client, ref.proof);
436
+ console.log(`Reopened ${ref.client}/${ref.proof} — status ${reopened.status}.`);
437
+ }));
438
+ }
439
+ export { versionArg };
440
+ //# sourceMappingURL=proof.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proof.js","sourceRoot":"","sources":["../../src/commands/proof.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAiE,MAAM,kBAAkB,CAAC;AAC/G,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAE,WAA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B,WAAW,CAAC,yDAAyD,CAAC;SACtE,QAAQ,CAAC,SAAS,EAAE,4CAA4C,iBAAiB,GAAG,CAAC;SACrF,MAAM,CACL,SAAS,CAAC,KAAK,EAAE,GAAuB,EAAE,EAAE;QAC1C,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAC1C,MAAM,QAAQ,GAAG,MAAM,aAAa,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;QAC1E,OAAO,CAAC,GAAG,CAAC,YAAY,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,KAAK,aAAa,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IAClF,CAAC,CAAC,CACH,CAAC;AACN,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { Command } from 'commander';
2
+ import { type CallOutcomeName } from '../lib/client.js';
3
+ declare function isValidStatus(status: string): boolean;
4
+ declare function isValidSort(sort: string): boolean;
5
+ declare function isValidOutcome(outcome: string): outcome is CallOutcomeName;
6
+ type FollowUpUpdate = {
7
+ ok: true;
8
+ value?: string | null;
9
+ } | {
10
+ ok: false;
11
+ error: string;
12
+ };
13
+ /** `--next` and `--clear-next` are mutually exclusive — a reschedule is to a date or to nothing, never both. */
14
+ declare function resolveFollowUpUpdate(opts: {
15
+ next?: string;
16
+ clearNext?: boolean;
17
+ }): FollowUpUpdate;
18
+ /**
19
+ * RFC 0027 — the nurture-loop primitive. `log` is one note plus, optionally,
20
+ * one reschedule of the next follow-up; `--next`/`--clear-next` are mutually
21
+ * exclusive because a reschedule is either to a date or to nothing, never
22
+ * both. No delete subcommand here or anywhere under `/api/v1/prospects` —
23
+ * deletion stays console-only.
24
+ */
25
+ export declare function registerProspectCommands(program: Command): void;
26
+ export { isValidOutcome, isValidSort, isValidStatus, resolveFollowUpUpdate };
27
+ //# sourceMappingURL=prospect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prospect.d.ts","sourceRoot":"","sources":["../../src/commands/prospect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAiB,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAKvE,iBAAS,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE9C;AAKD,iBAAS,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE1C;AAED,iBAAS,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,IAAI,eAAe,CAEnE;AAED,KAAK,cAAc,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzF,gHAAgH;AAChH,iBAAS,qBAAqB,CAAC,IAAI,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,cAAc,CAO3F;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyN/D;AAED,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,qBAAqB,EAAE,CAAC"}