@scribe-platform/cli 0.7.0 → 0.8.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 (46) hide show
  1. package/dist/commands/login.d.ts.map +1 -1
  2. package/dist/commands/login.js +15 -1
  3. package/dist/commands/login.js.map +1 -1
  4. package/dist/commands/prospect.d.ts +27 -0
  5. package/dist/commands/prospect.d.ts.map +1 -0
  6. package/dist/commands/prospect.js +213 -0
  7. package/dist/commands/prospect.js.map +1 -0
  8. package/dist/commands/request.d.ts +38 -0
  9. package/dist/commands/request.d.ts.map +1 -0
  10. package/dist/commands/request.js +214 -0
  11. package/dist/commands/request.js.map +1 -0
  12. package/dist/commands/site.d.ts +11 -0
  13. package/dist/commands/site.d.ts.map +1 -1
  14. package/dist/commands/site.js +41 -3
  15. package/dist/commands/site.js.map +1 -1
  16. package/dist/commands/update.d.ts +10 -0
  17. package/dist/commands/update.d.ts.map +1 -1
  18. package/dist/commands/update.js +128 -31
  19. package/dist/commands/update.js.map +1 -1
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +4 -0
  22. package/dist/index.js.map +1 -1
  23. package/dist/lib/claude-hook.d.ts +74 -0
  24. package/dist/lib/claude-hook.d.ts.map +1 -0
  25. package/dist/lib/claude-hook.js +108 -0
  26. package/dist/lib/claude-hook.js.map +1 -0
  27. package/dist/lib/client.d.ts +182 -0
  28. package/dist/lib/client.d.ts.map +1 -1
  29. package/dist/lib/client.js +82 -0
  30. package/dist/lib/client.js.map +1 -1
  31. package/dist/lib/skill.d.ts +13 -0
  32. package/dist/lib/skill.d.ts.map +1 -1
  33. package/dist/lib/skill.js +33 -2
  34. package/dist/lib/skill.js.map +1 -1
  35. package/dist/lib/update-check.d.ts +46 -0
  36. package/dist/lib/update-check.d.ts.map +1 -0
  37. package/dist/lib/update-check.js +103 -0
  38. package/dist/lib/update-check.js.map +1 -0
  39. package/package.json +1 -1
  40. package/skills/scribe-site-builder/SKILL.md +155 -33
  41. package/skills/scribe-site-builder/recipes/README.md +10 -3
  42. package/skills/scribe-site-builder/recipes/domains.md +151 -0
  43. package/skills/scribe-site-builder/recipes/forms.md +5 -2
  44. package/skills/scribe-site-builder/recipes/prospects.md +192 -0
  45. package/skills/scribe-site-builder/recipes/requests.md +145 -0
  46. package/skills/scribe-site-builder/recipes/schema.md +24 -0
@@ -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,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,CAgN/D;AAED,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,qBAAqB,EAAE,CAAC"}
@@ -0,0 +1,213 @@
1
+ import { CALL_OUTCOMES } from '../lib/client.js';
2
+ import { printResult, requireClient, runAction } from '../lib/cli-utils.js';
3
+ const STATUSES = ['prospect', 'active', 'churned', 'lost'];
4
+ function isValidStatus(status) {
5
+ return STATUSES.includes(status);
6
+ }
7
+ /** Mirrors the console's sort dropdown — see RFC 0027. */
8
+ const SORTS = ['due', 'neglected', 'warm', 'name'];
9
+ function isValidSort(sort) {
10
+ return SORTS.includes(sort);
11
+ }
12
+ function isValidOutcome(outcome) {
13
+ return CALL_OUTCOMES.includes(outcome);
14
+ }
15
+ /** `--next` and `--clear-next` are mutually exclusive — a reschedule is to a date or to nothing, never both. */
16
+ function resolveFollowUpUpdate(opts) {
17
+ if (opts.next && opts.clearNext) {
18
+ return { ok: false, error: '--next and --clear-next are mutually exclusive' };
19
+ }
20
+ if (opts.clearNext)
21
+ return { ok: true, value: null };
22
+ if (opts.next)
23
+ return { ok: true, value: opts.next };
24
+ return { ok: true };
25
+ }
26
+ /**
27
+ * RFC 0027 — the nurture-loop primitive. `log` is one note plus, optionally,
28
+ * one reschedule of the next follow-up; `--next`/`--clear-next` are mutually
29
+ * exclusive because a reschedule is either to a date or to nothing, never
30
+ * both. No delete subcommand here or anywhere under `/api/v1/prospects` —
31
+ * deletion stays console-only.
32
+ */
33
+ export function registerProspectCommands(program) {
34
+ const prospect = program.command('prospect').description('Manage prospects and clients in the calling pipeline');
35
+ prospect
36
+ .command('list')
37
+ .description('List prospects, optionally filtered by status or search term')
38
+ .option('--status <status>', 'prospect, active, churned, or lost')
39
+ .option('--search <text>', 'Filter by name')
40
+ .option('--due', 'Only prospects with a follow-up due now or overdue, soonest/most-overdue first')
41
+ .option('--sort <sort>', `one of: ${SORTS.join(', ')} (default: due)`)
42
+ .option('--json', 'Output as JSON')
43
+ .action(runAction(async (opts) => {
44
+ if (opts.sort && !isValidSort(opts.sort)) {
45
+ console.error(`--sort must be one of: ${SORTS.join(', ')}`);
46
+ process.exitCode = 1;
47
+ return;
48
+ }
49
+ const items = await requireClient().listProspects(opts);
50
+ if (opts.json) {
51
+ printResult(items, true);
52
+ return;
53
+ }
54
+ printResult(items.map((p) => ({
55
+ id: p.id,
56
+ name: p.name,
57
+ status: p.status,
58
+ // The attempt count travels with the warmth because `cold` means
59
+ // something different after one try than after five.
60
+ warmth: p.warmth.warmth,
61
+ tries: p.warmth.attempts,
62
+ nextFollowUp: p.prospecting?.nextFollowUpAt ?? '',
63
+ lastContact: p.warmth.lastContactAt ?? '',
64
+ })), false);
65
+ }));
66
+ prospect
67
+ .command('show')
68
+ .description('Show one prospect, including its full call log')
69
+ .argument('<id>')
70
+ .option('--json', 'Output as JSON')
71
+ .action(runAction(async (id, opts) => {
72
+ const p = await requireClient().getProspect(id);
73
+ if (opts.json) {
74
+ printResult(p, true);
75
+ return;
76
+ }
77
+ console.log(`${p.name} (${p.status})`);
78
+ if (p.primaryContact) {
79
+ const contact = [p.primaryContact.name, p.primaryContact.email, p.primaryContact.phone].filter(Boolean).join(' / ');
80
+ if (contact)
81
+ console.log(`Contact: ${contact}`);
82
+ }
83
+ console.log(`Warmth: ${p.warmth.warmth} (${p.warmth.attempts} ${p.warmth.attempts === 1 ? 'attempt' : 'attempts'})`);
84
+ console.log(`Next follow-up: ${p.prospecting?.nextFollowUpAt ?? 'Not scheduled'}`);
85
+ console.log('Notes:');
86
+ if (p.notes.length === 0)
87
+ console.log(' (none yet)');
88
+ for (const note of [...p.notes].reverse()) {
89
+ console.log(` [${note.createdAt}]${note.outcome ? ` (${note.outcome})` : ''} ${note.body}`);
90
+ }
91
+ }));
92
+ prospect
93
+ .command('pipeline')
94
+ .description('The funnel\'s shape — counts by warmth, and how many prospects are still workable')
95
+ .option('--json', 'Output as JSON')
96
+ .action(runAction(async (opts) => {
97
+ const summary = await requireClient().prospectPipeline();
98
+ if (opts.json) {
99
+ printResult(summary, true);
100
+ return;
101
+ }
102
+ console.log(`${summary.workable} workable of ${summary.total} prospects`);
103
+ for (const warmth of ['hot', 'warm', 'untouched', 'cold', 'stalled']) {
104
+ const count = summary.counts[warmth];
105
+ if (count > 0)
106
+ console.log(` ${warmth.padEnd(10)} ${count}`);
107
+ }
108
+ // The actionable read, rather than leaving it to be inferred from the
109
+ // numbers: stalled is the only bucket that is genuinely spent.
110
+ if (summary.workable === 0 && summary.total > 0) {
111
+ console.log('\nEvery prospect has stalled — time to find more leads.');
112
+ }
113
+ }));
114
+ prospect
115
+ .command('create')
116
+ .description('Create a new prospect')
117
+ .argument('<name>')
118
+ .option('--status <status>', 'prospect, active, churned, or lost', 'prospect')
119
+ .option('--contact-name <name>')
120
+ .option('--email <email>')
121
+ .option('--phone <phone>')
122
+ .option('--note <text>', 'A seed note — e.g. how/where this prospect was found')
123
+ .option('--json', 'Output as JSON')
124
+ .action(runAction(async (name, opts) => {
125
+ if (!isValidStatus(opts.status)) {
126
+ console.error(`--status must be one of: ${STATUSES.join(', ')}`);
127
+ process.exitCode = 1;
128
+ return;
129
+ }
130
+ const hasContact = opts.contactName || opts.email || opts.phone;
131
+ const result = await requireClient().createProspect({
132
+ name,
133
+ status: opts.status,
134
+ primaryContact: hasContact
135
+ ? { name: opts.contactName ?? null, email: opts.email ?? null, phone: opts.phone ?? null }
136
+ : null,
137
+ note: opts.note,
138
+ });
139
+ printResult(result, opts.json);
140
+ }));
141
+ prospect
142
+ .command('update')
143
+ .description("Update a prospect's name or contact info")
144
+ .argument('<id>')
145
+ .option('--name <name>')
146
+ .option('--contact-name <name>')
147
+ .option('--email <email>')
148
+ .option('--phone <phone>')
149
+ .option('--json', 'Output as JSON')
150
+ .action(runAction(async (id, opts) => {
151
+ const hasContact = opts.contactName !== undefined || opts.email !== undefined || opts.phone !== undefined;
152
+ if (opts.name === undefined && !hasContact) {
153
+ console.error('Provide at least one field to update');
154
+ process.exitCode = 1;
155
+ return;
156
+ }
157
+ const result = await requireClient().updateProspect(id, {
158
+ name: opts.name,
159
+ primaryContact: hasContact
160
+ ? { name: opts.contactName ?? null, email: opts.email ?? null, phone: opts.phone ?? null }
161
+ : undefined,
162
+ });
163
+ printResult(result, opts.json);
164
+ }));
165
+ prospect
166
+ .command('log')
167
+ .description('Log a call — a note, and optionally a next follow-up date, together')
168
+ .argument('<id>')
169
+ .requiredOption('--note <text>', 'What happened')
170
+ .option('--outcome <outcome>', `how far it got — one of: ${CALL_OUTCOMES.join(', ')}`)
171
+ .option('--next <date>', 'ISO date (or anything Date can parse) for the next follow-up')
172
+ .option('--clear-next', 'Clear any scheduled follow-up')
173
+ .option('--json', 'Output as JSON')
174
+ .action(runAction(async (id, opts) => {
175
+ const followUp = resolveFollowUpUpdate(opts);
176
+ if (!followUp.ok) {
177
+ console.error(followUp.error);
178
+ process.exitCode = 1;
179
+ return;
180
+ }
181
+ if (opts.outcome !== undefined && !isValidOutcome(opts.outcome)) {
182
+ console.error(`--outcome must be one of: ${CALL_OUTCOMES.join(', ')}`);
183
+ process.exitCode = 1;
184
+ return;
185
+ }
186
+ const result = await requireClient().logProspectCall(id, {
187
+ note: opts.note,
188
+ nextFollowUpAt: followUp.value,
189
+ // Omitted means "not a contact attempt", which is what keeps a
190
+ // research note out of the attempt tally that decides stalling.
191
+ outcome: opts.outcome ?? null,
192
+ });
193
+ printResult(result, opts.json);
194
+ }));
195
+ prospect
196
+ .command('status')
197
+ .description('Move a prospect through prospect → active/lost (or a client through active ↔ churned)')
198
+ .argument('<id>')
199
+ .argument('<status>', 'prospect, active, churned, or lost')
200
+ .option('--reason <reason>', 'Carried with a lost or churned move')
201
+ .option('--json', 'Output as JSON')
202
+ .action(runAction(async (id, status, opts) => {
203
+ if (!isValidStatus(status)) {
204
+ console.error(`status must be one of: ${STATUSES.join(', ')}`);
205
+ process.exitCode = 1;
206
+ return;
207
+ }
208
+ const result = await requireClient().setProspectStatus(id, { status, reason: opts.reason });
209
+ printResult(result, opts.json);
210
+ }));
211
+ }
212
+ export { isValidOutcome, isValidSort, isValidStatus, resolveFollowUpUpdate };
213
+ //# sourceMappingURL=prospect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prospect.js","sourceRoot":"","sources":["../../src/commands/prospect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAwB,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,QAAQ,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AAE3D,SAAS,aAAa,CAAC,MAAc;IACnC,OAAO,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC;AAED,0DAA0D;AAC1D,MAAM,KAAK,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEnD,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED,SAAS,cAAc,CAAC,OAAe;IACrC,OAAQ,aAAmC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAChE,CAAC;AAID,gHAAgH;AAChH,SAAS,qBAAqB,CAAC,IAA4C;IACzE,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;QAChC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,gDAAgD,EAAE,CAAC;IAChF,CAAC;IACD,IAAI,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACrD,IAAI,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IACrD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE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@@ -0,0 +1,38 @@
1
+ import { Command } from 'commander';
2
+ declare function isValidRequestStatus(status: string): boolean;
3
+ declare function isValidRequestType(type: string): boolean;
4
+ /**
5
+ * Every status name is phrased from the **Client's** side, because that is who
6
+ * reads it on their own dashboard — so the one status an agency user is most
7
+ * likely to misread is `waiting-on-you`, which means waiting on *them*, not on
8
+ * you. Printed alongside the raw name rather than instead of it: the raw name
9
+ * is what goes back into `request status`.
10
+ */
11
+ declare const STAFF_LABELS: Record<string, string>;
12
+ type Assignment = {
13
+ ok: true;
14
+ value: 'any' | 'unassigned' | 'mine';
15
+ } | {
16
+ ok: false;
17
+ error: string;
18
+ };
19
+ /** `--mine` and `--unassigned` ask opposite questions, so passing both is a mistake rather than a narrowing. */
20
+ declare function resolveAssignment(opts: {
21
+ mine?: boolean;
22
+ unassigned?: boolean;
23
+ }): Assignment;
24
+ /**
25
+ * RFC 0005 — the Request queue, as the CLI sees it.
26
+ *
27
+ * A Request is a Client asking the Agency for work, so unlike every other
28
+ * command group here nothing about it lives in a Site's repo. The whole surface
29
+ * is staff-only for that reason: a thread carries internal notes, and claiming
30
+ * one only means something from inside the Agency.
31
+ *
32
+ * There is deliberately no `create` — a Request comes from the Client, through
33
+ * their own dashboard. Filing one on their behalf would put words in their mouth
34
+ * and make the queue's own numbers a measure of us rather than of them.
35
+ */
36
+ export declare function registerRequestCommands(program: Command): void;
37
+ export { isValidRequestStatus, isValidRequestType, resolveAssignment, STAFF_LABELS };
38
+ //# sourceMappingURL=request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/commands/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,iBAAS,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,iBAAS,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED;;;;;;GAMG;AACH,QAAA,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAMxC,CAAC;AAEF,KAAK,UAAU,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,KAAK,GAAG,YAAY,GAAG,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpG,gHAAgH;AAChH,iBAAS,iBAAiB,CAAC,IAAI,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,UAAU,CAOrF;AA+BD;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwK9D;AAED,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,214 @@
1
+ import { REQUEST_STATUSES, REQUEST_TYPES } from '../lib/client.js';
2
+ import { printResult, requireClient, runAction } from '../lib/cli-utils.js';
3
+ function isValidRequestStatus(status) {
4
+ return REQUEST_STATUSES.includes(status);
5
+ }
6
+ function isValidRequestType(type) {
7
+ return REQUEST_TYPES.includes(type);
8
+ }
9
+ /**
10
+ * Every status name is phrased from the **Client's** side, because that is who
11
+ * reads it on their own dashboard — so the one status an agency user is most
12
+ * likely to misread is `waiting-on-you`, which means waiting on *them*, not on
13
+ * you. Printed alongside the raw name rather than instead of it: the raw name
14
+ * is what goes back into `request status`.
15
+ */
16
+ const STAFF_LABELS = {
17
+ open: 'Open — nobody has picked it up',
18
+ 'in-progress': 'In progress',
19
+ 'waiting-on-you': 'Waiting on client',
20
+ done: 'Done',
21
+ cancelled: 'Cancelled',
22
+ };
23
+ /** `--mine` and `--unassigned` ask opposite questions, so passing both is a mistake rather than a narrowing. */
24
+ function resolveAssignment(opts) {
25
+ if (opts.mine && opts.unassigned) {
26
+ return { ok: false, error: '--mine and --unassigned are mutually exclusive' };
27
+ }
28
+ if (opts.mine)
29
+ return { ok: true, value: 'mine' };
30
+ if (opts.unassigned)
31
+ return { ok: true, value: 'unassigned' };
32
+ return { ok: true, value: 'any' };
33
+ }
34
+ function authorOf(thread, message) {
35
+ if (!message.authorUserId)
36
+ return 'Scribe';
37
+ return thread.actors[message.authorUserId]?.name ?? 'Someone';
38
+ }
39
+ function printThread(thread) {
40
+ const { request } = thread;
41
+ console.log(`${request.subject}`);
42
+ console.log(`Site: ${thread.site ?? request.siteId} Type: ${request.type}`);
43
+ console.log(`Status: ${request.status} (${STAFF_LABELS[request.status] ?? request.status})`);
44
+ console.log(`Assigned: ${request.assignedToUserId ? (thread.actors[request.assignedToUserId]?.name ?? 'someone') : 'nobody'}`);
45
+ if (request.page)
46
+ console.log(`Page: ${request.page}`);
47
+ console.log(`Opened: ${request.createdAt} Last activity: ${request.lastActivityAt}`);
48
+ console.log('');
49
+ console.log(request.body);
50
+ console.log('');
51
+ console.log('Thread:');
52
+ if (thread.messages.length === 0) {
53
+ console.log(' (nothing yet — the request body above is the whole of it)');
54
+ return;
55
+ }
56
+ for (const message of thread.messages) {
57
+ // The internal marker is first, not a suffix: it decides whether the line
58
+ // can be quoted back to the Client at all.
59
+ const tags = [message.internal ? 'INTERNAL' : null, message.kind === 'system' ? 'system' : null].filter(Boolean).join(' ');
60
+ console.log(` [${message.createdAt}] ${tags ? `(${tags}) ` : ''}${authorOf(thread, message)}: ${message.body}`);
61
+ }
62
+ }
63
+ /**
64
+ * RFC 0005 — the Request queue, as the CLI sees it.
65
+ *
66
+ * A Request is a Client asking the Agency for work, so unlike every other
67
+ * command group here nothing about it lives in a Site's repo. The whole surface
68
+ * is staff-only for that reason: a thread carries internal notes, and claiming
69
+ * one only means something from inside the Agency.
70
+ *
71
+ * There is deliberately no `create` — a Request comes from the Client, through
72
+ * their own dashboard. Filing one on their behalf would put words in their mouth
73
+ * and make the queue's own numbers a measure of us rather than of them.
74
+ */
75
+ export function registerRequestCommands(program) {
76
+ const request = program.command('request').description('Work the queue of requests clients have sent in');
77
+ request
78
+ .command('list')
79
+ .description('List requests, oldest activity first — the queue, worked from the end that has waited longest')
80
+ .option('--site <slug>', 'Only this site\'s requests')
81
+ .option('--status <status>', `one of: ${REQUEST_STATUSES.join(', ')}`)
82
+ .option('--type <type>', `one of: ${REQUEST_TYPES.join(', ')}`)
83
+ .option('--mine', 'Only requests this key\'s owner has claimed')
84
+ .option('--unassigned', 'Only requests nobody has claimed yet')
85
+ .option('--all', 'Include finished requests (done, cancelled), which are hidden by default')
86
+ .option('--sort <sort>', 'oldest (default) or newest, by last activity')
87
+ .option('--page <n>', 'Page number, 1-based')
88
+ .option('--json', 'Output as JSON')
89
+ .action(runAction(async (opts) => {
90
+ if (opts.status && !isValidRequestStatus(opts.status)) {
91
+ console.error(`--status must be one of: ${REQUEST_STATUSES.join(', ')}`);
92
+ process.exitCode = 1;
93
+ return;
94
+ }
95
+ if (opts.type && !isValidRequestType(opts.type)) {
96
+ console.error(`--type must be one of: ${REQUEST_TYPES.join(', ')}`);
97
+ process.exitCode = 1;
98
+ return;
99
+ }
100
+ if (opts.sort && opts.sort !== 'newest' && opts.sort !== 'oldest') {
101
+ console.error('--sort must be newest or oldest');
102
+ process.exitCode = 1;
103
+ return;
104
+ }
105
+ const assignment = resolveAssignment(opts);
106
+ if (!assignment.ok) {
107
+ console.error(assignment.error);
108
+ process.exitCode = 1;
109
+ return;
110
+ }
111
+ const result = await requireClient().listRequests({
112
+ site: opts.site,
113
+ status: opts.status,
114
+ type: opts.type,
115
+ assignment: assignment.value,
116
+ includeClosed: opts.all,
117
+ sort: opts.sort,
118
+ page: opts.page ? Number(opts.page) : undefined,
119
+ });
120
+ if (opts.json) {
121
+ printResult(result, true);
122
+ return;
123
+ }
124
+ // An empty queue is the most common answer there is, and
125
+ // `console.table([])` renders it as an empty frame that reads like a
126
+ // broken command rather than good news.
127
+ if (result.items.length === 0) {
128
+ console.log(opts.all || opts.status ? 'No requests match.' : 'Nothing in the queue.');
129
+ return;
130
+ }
131
+ printResult(result.items.map((item) => ({
132
+ id: item.id,
133
+ site: item.site ?? '',
134
+ subject: item.subject,
135
+ type: item.type,
136
+ status: item.status,
137
+ claimed: item.assignedToUserId ? 'yes' : 'no',
138
+ lastActivity: item.lastActivityAt,
139
+ })), false);
140
+ // The total is the only way to know there is a page 2, and a queue
141
+ // that silently showed its first 25 of 60 is the way one stops being
142
+ // believed.
143
+ if (result.total > result.items.length) {
144
+ console.log(`\nShowing ${result.items.length} of ${result.total} — pass --page 2 for more.`);
145
+ }
146
+ }));
147
+ request
148
+ .command('show')
149
+ .description('Show one request: the ask, its status, and the whole thread including internal notes')
150
+ .argument('<id>')
151
+ .option('--json', 'Output as JSON')
152
+ .action(runAction(async (id, opts) => {
153
+ const thread = await requireClient().getRequest(id);
154
+ if (opts.json) {
155
+ printResult(thread, true);
156
+ return;
157
+ }
158
+ printThread(thread);
159
+ }));
160
+ request
161
+ .command('claim')
162
+ .description("Claim a request for this key's owner, or release it with --release")
163
+ .argument('<id>')
164
+ .option('--release', 'Hand it back to nobody instead of claiming it')
165
+ .option('--json', 'Output as JSON')
166
+ .action(runAction(async (id, opts) => {
167
+ const thread = await requireClient().updateRequest(id, { assignTo: opts.release ? null : 'me' });
168
+ if (opts.json) {
169
+ printResult(thread, true);
170
+ return;
171
+ }
172
+ console.log(opts.release ? `Released: ${thread.request.subject}` : `Claimed: ${thread.request.subject}`);
173
+ }));
174
+ request
175
+ .command('reply')
176
+ .description('Reply to the client on a request, or add an Agency-only note with --internal')
177
+ .argument('<id>')
178
+ .requiredOption('--message <text>', 'What to say')
179
+ .option('--internal', 'An internal note: never shown to the client, and emails nobody')
180
+ .option('--json', 'Output as JSON')
181
+ .action(runAction(async (id, opts) => {
182
+ const thread = await requireClient().replyToRequest(id, { body: opts.message, internal: opts.internal });
183
+ if (opts.json) {
184
+ printResult(thread, true);
185
+ return;
186
+ }
187
+ console.log(opts.internal ? 'Note added (internal — the client will not see it).' : 'Replied — the client has been emailed.');
188
+ // A visible reply on an `open` request also picks it up, which is a
189
+ // status change the caller didn't ask for and should hear about.
190
+ if (thread.movedTo)
191
+ console.log(`Status is now: ${thread.movedTo}`);
192
+ }));
193
+ request
194
+ .command('status')
195
+ .description('Move a request to another status')
196
+ .argument('<id>')
197
+ .argument('<status>', REQUEST_STATUSES.join(', '))
198
+ .option('--json', 'Output as JSON')
199
+ .action(runAction(async (id, status, opts) => {
200
+ if (!isValidRequestStatus(status)) {
201
+ console.error(`status must be one of: ${REQUEST_STATUSES.join(', ')}`);
202
+ process.exitCode = 1;
203
+ return;
204
+ }
205
+ const thread = await requireClient().updateRequest(id, { status });
206
+ if (opts.json) {
207
+ printResult(thread, true);
208
+ return;
209
+ }
210
+ console.log(`${thread.request.subject} is now ${thread.request.status} (${STAFF_LABELS[thread.request.status] ?? ''}).`);
211
+ }));
212
+ }
213
+ export { isValidRequestStatus, isValidRequestType, resolveAssignment, STAFF_LABELS };
214
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/commands/request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAA2C,MAAM,kBAAkB,CAAC;AAC5G,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAE5E,SAAS,oBAAoB,CAAC,MAAc;IAC1C,OAAQ,gBAAsC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAClE,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAY;IACtC,OAAQ,aAAmC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,YAAY,GAA2B;IAC3C,IAAI,EAAE,gCAAgC;IACtC,aAAa,EAAE,aAAa;IAC5B,gBAAgB,EAAE,mBAAmB;IACrC,IAAI,EAAE,MAAM;IACZ,SAAS,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GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,WAAW,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3H,CAAC,CAAC,CACH,CAAC;AACN,CAAC;AAED,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC"}
@@ -1,3 +1,14 @@
1
1
  import { Command } from 'commander';
2
+ /**
3
+ * True when changing a Site's stored domain to `next` would be a **cutover**
4
+ * rather than a correction — i.e. the Site is still on its provisional
5
+ * `<owner>.github.io` Pages host and is being moved to a real hostname.
6
+ *
7
+ * `site update --domain` only rewrites the Mongo record and the Turnstile
8
+ * widget. It does not touch DNS, `public/CNAME`, or the repo's Pages settings,
9
+ * so using it for a cutover leaves the Site claiming a domain that serves
10
+ * nothing — the half-state `site promote` exists to prevent.
11
+ */
12
+ export declare function isDomainCutover(current: string, next: string, githubOwner: string): boolean;
2
13
  export declare function registerSiteCommands(program: Command): void;
3
14
  //# sourceMappingURL=site.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../../src/commands/site.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0CpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0V3D"}
1
+ {"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../../src/commands/site.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0CpC;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAG3F;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwX3D"}