@deskwork/cli 0.9.5

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 (85) hide show
  1. package/dist/cli.d.ts +19 -0
  2. package/dist/cli.d.ts.map +1 -0
  3. package/dist/cli.js +98 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/commands/add.d.ts +13 -0
  6. package/dist/commands/add.d.ts.map +1 -0
  7. package/dist/commands/add.js +91 -0
  8. package/dist/commands/add.js.map +1 -0
  9. package/dist/commands/approve.d.ts +18 -0
  10. package/dist/commands/approve.d.ts.map +1 -0
  11. package/dist/commands/approve.js +179 -0
  12. package/dist/commands/approve.js.map +1 -0
  13. package/dist/commands/customize.d.ts +47 -0
  14. package/dist/commands/customize.d.ts.map +1 -0
  15. package/dist/commands/customize.js +176 -0
  16. package/dist/commands/customize.js.map +1 -0
  17. package/dist/commands/distribute.d.ts +30 -0
  18. package/dist/commands/distribute.d.ts.map +1 -0
  19. package/dist/commands/distribute.js +148 -0
  20. package/dist/commands/distribute.js.map +1 -0
  21. package/dist/commands/doctor.d.ts +35 -0
  22. package/dist/commands/doctor.d.ts.map +1 -0
  23. package/dist/commands/doctor.js +354 -0
  24. package/dist/commands/doctor.js.map +1 -0
  25. package/dist/commands/draft.d.ts +17 -0
  26. package/dist/commands/draft.d.ts.map +1 -0
  27. package/dist/commands/draft.js +77 -0
  28. package/dist/commands/draft.js.map +1 -0
  29. package/dist/commands/ingest.d.ts +43 -0
  30. package/dist/commands/ingest.d.ts.map +1 -0
  31. package/dist/commands/ingest.js +321 -0
  32. package/dist/commands/ingest.js.map +1 -0
  33. package/dist/commands/install-preflight.d.ts +83 -0
  34. package/dist/commands/install-preflight.d.ts.map +1 -0
  35. package/dist/commands/install-preflight.js +300 -0
  36. package/dist/commands/install-preflight.js.map +1 -0
  37. package/dist/commands/install.d.ts +27 -0
  38. package/dist/commands/install.d.ts.map +1 -0
  39. package/dist/commands/install.js +132 -0
  40. package/dist/commands/install.js.map +1 -0
  41. package/dist/commands/iterate.d.ts +33 -0
  42. package/dist/commands/iterate.d.ts.map +1 -0
  43. package/dist/commands/iterate.js +202 -0
  44. package/dist/commands/iterate.js.map +1 -0
  45. package/dist/commands/outline.d.ts +19 -0
  46. package/dist/commands/outline.d.ts.map +1 -0
  47. package/dist/commands/outline.js +102 -0
  48. package/dist/commands/outline.js.map +1 -0
  49. package/dist/commands/pause.d.ts +15 -0
  50. package/dist/commands/pause.d.ts.map +1 -0
  51. package/dist/commands/pause.js +70 -0
  52. package/dist/commands/pause.js.map +1 -0
  53. package/dist/commands/plan.d.ts +12 -0
  54. package/dist/commands/plan.d.ts.map +1 -0
  55. package/dist/commands/plan.js +74 -0
  56. package/dist/commands/plan.js.map +1 -0
  57. package/dist/commands/publish.d.ts +18 -0
  58. package/dist/commands/publish.d.ts.map +1 -0
  59. package/dist/commands/publish.js +105 -0
  60. package/dist/commands/publish.js.map +1 -0
  61. package/dist/commands/resume.d.ts +16 -0
  62. package/dist/commands/resume.d.ts.map +1 -0
  63. package/dist/commands/resume.js +70 -0
  64. package/dist/commands/resume.js.map +1 -0
  65. package/dist/commands/review-cancel.d.ts +15 -0
  66. package/dist/commands/review-cancel.d.ts.map +1 -0
  67. package/dist/commands/review-cancel.js +88 -0
  68. package/dist/commands/review-cancel.js.map +1 -0
  69. package/dist/commands/review-help.d.ts +12 -0
  70. package/dist/commands/review-help.d.ts.map +1 -0
  71. package/dist/commands/review-help.js +52 -0
  72. package/dist/commands/review-help.js.map +1 -0
  73. package/dist/commands/review-report.d.ts +13 -0
  74. package/dist/commands/review-report.d.ts.map +1 -0
  75. package/dist/commands/review-report.js +53 -0
  76. package/dist/commands/review-report.js.map +1 -0
  77. package/dist/commands/review-start.d.ts +17 -0
  78. package/dist/commands/review-start.d.ts.map +1 -0
  79. package/dist/commands/review-start.js +121 -0
  80. package/dist/commands/review-start.js.map +1 -0
  81. package/dist/commands/shortform-start.d.ts +33 -0
  82. package/dist/commands/shortform-start.d.ts.map +1 -0
  83. package/dist/commands/shortform-start.js +127 -0
  84. package/dist/commands/shortform-start.js.map +1 -0
  85. package/package.json +45 -0
@@ -0,0 +1,300 @@
1
+ /**
2
+ * Install pre-flight checks (Issue #42 + #45, Phase 22).
3
+ *
4
+ * Two non-blocking probes that run after `.deskwork/config.json` is
5
+ * written, before the install command exits successfully:
6
+ *
7
+ * 1. detectExistingPipeline — heuristic walk for signals of a competing
8
+ * in-house editorial implementation (e.g. the audiocontrol journal
9
+ * layout deskwork was extracted from). When detected, the operator
10
+ * is warned that deskwork installs ALONGSIDE the existing pipeline
11
+ * rather than replacing it.
12
+ *
13
+ * 2. preflightSchema — for Astro sites only, statically inspect the
14
+ * host's content schema source for either a `deskwork` field
15
+ * declaration or a top-level `.passthrough()`. If neither matches
16
+ * (or the schema file is missing / ambiguous), the schema-patch
17
+ * instructions are printed inline at install time so the operator
18
+ * sees the requirement BEFORE the first deskwork write.
19
+ *
20
+ * Both probes are loud but non-blocking — they print to stdout and
21
+ * return without throwing. Install still completes successfully.
22
+ *
23
+ * Sibling-relative imports per the project convention.
24
+ */
25
+ import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
26
+ import { join } from 'node:path';
27
+ import { printSchemaPatchInstructions } from '@deskwork/core/doctor';
28
+ const ASTRO_CONFIG_NAMES = [
29
+ 'astro.config.mjs',
30
+ 'astro.config.ts',
31
+ 'astro.config.js',
32
+ 'astro.config.cjs',
33
+ ];
34
+ const CONTENT_SCHEMA_NAMES = [
35
+ // Newer Astro convention.
36
+ 'src/content.config.ts',
37
+ 'src/content.config.js',
38
+ 'src/content.config.mjs',
39
+ // Older Astro convention (used by the original audiocontrol tree).
40
+ 'src/content/config.ts',
41
+ 'src/content/config.js',
42
+ 'src/content/config.mjs',
43
+ ];
44
+ /**
45
+ * True when the project has any Astro config file at the root. Used to
46
+ * gate the schema preflight — non-Astro projects (Hugo / Jekyll / etc)
47
+ * don't need the patch.
48
+ */
49
+ function isAstroProject(projectRoot) {
50
+ return ASTRO_CONFIG_NAMES.some((name) => existsSync(join(projectRoot, name)));
51
+ }
52
+ /**
53
+ * Locate the host's content-schema source file. Returns the absolute
54
+ * path to the first matching candidate, or null when none exist.
55
+ */
56
+ function findContentSchemaFile(projectRoot) {
57
+ for (const rel of CONTENT_SCHEMA_NAMES) {
58
+ const abs = join(projectRoot, rel);
59
+ if (existsSync(abs))
60
+ return abs;
61
+ }
62
+ return null;
63
+ }
64
+ /**
65
+ * Probe the content-schema file for compatibility with deskwork's
66
+ * `deskwork:` namespace binding. Static text inspection — does NOT
67
+ * evaluate the TypeScript.
68
+ *
69
+ * Returns `compatible` when either a `deskwork`-named schema field
70
+ * declaration OR a top-level `.passthrough()` is detected. Anything
71
+ * else (file missing, no signal found) is `uncertain` — the caller
72
+ * surfaces patch instructions to the operator.
73
+ */
74
+ export function preflightSchemaForProject(projectRoot) {
75
+ if (!isAstroProject(projectRoot)) {
76
+ return {
77
+ kind: 'skipped',
78
+ reason: 'no Astro config detected at project root; non-Astro engines (Hugo / Jekyll / Eleventy / plain markdown) do not validate frontmatter',
79
+ };
80
+ }
81
+ const schemaPath = findContentSchemaFile(projectRoot);
82
+ if (schemaPath === null) {
83
+ return {
84
+ kind: 'uncertain',
85
+ schemaPath: null,
86
+ reason: 'no src/content/config.* or src/content.config.* file found',
87
+ };
88
+ }
89
+ let raw;
90
+ try {
91
+ raw = readFileSync(schemaPath, 'utf-8');
92
+ }
93
+ catch (err) {
94
+ const reason = err instanceof Error ? err.message : String(err);
95
+ return {
96
+ kind: 'uncertain',
97
+ schemaPath,
98
+ reason: `could not read schema file: ${reason}`,
99
+ };
100
+ }
101
+ // Heuristic 1: an explicit `deskwork:` field on the schema object.
102
+ // We accept any of:
103
+ // deskwork: z.object(...)
104
+ // deskwork: z.unknown()
105
+ // deskwork: z.any()
106
+ const explicitNamespace = /\bdeskwork\s*:\s*z\.[a-zA-Z]/u.test(raw);
107
+ if (explicitNamespace) {
108
+ return {
109
+ kind: 'compatible',
110
+ schemaPath,
111
+ reason: 'detected explicit `deskwork:` field in the schema',
112
+ };
113
+ }
114
+ // Heuristic 2: a `.passthrough()` call anywhere — this accepts
115
+ // unknown keys including the entire `deskwork:` namespace.
116
+ if (/\.passthrough\s*\(/u.test(raw)) {
117
+ return {
118
+ kind: 'compatible',
119
+ schemaPath,
120
+ reason: 'detected `.passthrough()` on the schema (accepts unknown keys)',
121
+ };
122
+ }
123
+ return {
124
+ kind: 'uncertain',
125
+ schemaPath,
126
+ reason: 'no `deskwork:` field declaration and no `.passthrough()` found',
127
+ };
128
+ }
129
+ /**
130
+ * Print the schema preflight result to stdout. Non-blocking — install
131
+ * continues regardless of outcome.
132
+ *
133
+ * The function is responsible for the entire textual surface of the
134
+ * check so the install command stays focused on its own concerns.
135
+ */
136
+ export function printSchemaPreflight(projectRoot, config) {
137
+ // The check applies project-wide (Astro config is at the root). We
138
+ // run the probe once and then describe the outcome in terms of the
139
+ // configured sites for the operator's mental model.
140
+ const outcome = preflightSchemaForProject(projectRoot);
141
+ const sites = Object.keys(config.sites);
142
+ if (outcome.kind === 'skipped') {
143
+ console.log(`Schema pre-flight: skipped (${outcome.reason}).`);
144
+ return;
145
+ }
146
+ if (outcome.kind === 'compatible') {
147
+ console.log(`Schema pre-flight: OK (${outcome.reason}).`);
148
+ console.log(` schema file: ${outcome.schemaPath}`);
149
+ if (sites.length > 0) {
150
+ console.log(` applies to sites: ${sites.join(', ')}`);
151
+ }
152
+ return;
153
+ }
154
+ // uncertain — surface the patch instructions inline. This is the
155
+ // operator-facing reminder so they don't discover the requirement
156
+ // mid-workflow at the first `/deskwork:outline`.
157
+ console.log('Schema pre-flight: UNCERTAIN — patch instructions follow.');
158
+ console.log(` reason: ${outcome.reason}`);
159
+ if (outcome.schemaPath !== null) {
160
+ console.log(` inspected: ${outcome.schemaPath}`);
161
+ }
162
+ if (sites.length > 0) {
163
+ console.log(` configured sites: ${sites.join(', ')}`);
164
+ }
165
+ console.log('');
166
+ console.log(printSchemaPatchInstructions());
167
+ }
168
+ /**
169
+ * The set of editorial-* skill names we consider strong signals when
170
+ * three or more land. Sourced from the in-house implementation
171
+ * deskwork was extracted from (audiocontrol). A coincidental single
172
+ * match (e.g. a project happens to have one `editorial-add` skill)
173
+ * doesn't trip the heuristic.
174
+ */
175
+ const EDITORIAL_SKILL_NAMES = new Set([
176
+ 'editorial-add',
177
+ 'editorial-plan',
178
+ 'editorial-outline',
179
+ 'editorial-draft',
180
+ 'editorial-publish',
181
+ 'editorial-iterate',
182
+ 'editorial-approve',
183
+ 'editorial-review-cancel',
184
+ 'editorial-review-help',
185
+ 'editorial-review-report',
186
+ 'editorial-distribute',
187
+ ]);
188
+ /** Minimum editorial-* skills present before we treat them as a real pipeline. */
189
+ const EDITORIAL_SKILL_SIGNAL_THRESHOLD = 3;
190
+ /**
191
+ * Walk the project for signals of a competing in-house editorial
192
+ * implementation. Each branch is independent — any one signal is mild,
193
+ * the combination is loud.
194
+ */
195
+ export function detectExistingPipeline(projectRoot) {
196
+ const out = [];
197
+ // Branch 1: audiocontrol-style journal tree.
198
+ if (existsSync(join(projectRoot, 'journal/editorial'))) {
199
+ out.push({
200
+ kind: 'journal-tree',
201
+ relativePath: 'journal/editorial/',
202
+ });
203
+ }
204
+ // Branch 2: editorial-* skills under .claude/skills/. We require
205
+ // EDITORIAL_SKILL_SIGNAL_THRESHOLD matches before reporting any of
206
+ // them — a single coincidental match shouldn't trip the heuristic.
207
+ const skillsDir = join(projectRoot, '.claude/skills');
208
+ const skillMatches = [];
209
+ if (existsSync(skillsDir)) {
210
+ let entries = [];
211
+ try {
212
+ entries = readdirSync(skillsDir);
213
+ }
214
+ catch {
215
+ entries = [];
216
+ }
217
+ for (const name of entries) {
218
+ if (EDITORIAL_SKILL_NAMES.has(name)) {
219
+ const abs = join(skillsDir, name);
220
+ try {
221
+ if (statSync(abs).isDirectory()) {
222
+ skillMatches.push(name);
223
+ }
224
+ }
225
+ catch {
226
+ // ignore stat errors — name was already matched
227
+ }
228
+ }
229
+ }
230
+ }
231
+ if (skillMatches.length >= EDITORIAL_SKILL_SIGNAL_THRESHOLD) {
232
+ for (const name of skillMatches) {
233
+ out.push({
234
+ kind: 'editorial-skill',
235
+ relativePath: `.claude/skills/${name}/`,
236
+ });
237
+ }
238
+ }
239
+ // Branch 3: src/sites/*/pages/dev/editorial-*.astro — the multi-site
240
+ // pattern. We don't enumerate every page; one match anywhere is
241
+ // enough to register the signal.
242
+ const sitesDir = join(projectRoot, 'src/sites');
243
+ if (existsSync(sitesDir)) {
244
+ let siteNames = [];
245
+ try {
246
+ siteNames = readdirSync(sitesDir);
247
+ }
248
+ catch {
249
+ siteNames = [];
250
+ }
251
+ for (const site of siteNames) {
252
+ const pagesDir = join(sitesDir, site, 'pages/dev');
253
+ if (!existsSync(pagesDir))
254
+ continue;
255
+ let pageEntries = [];
256
+ try {
257
+ pageEntries = readdirSync(pagesDir);
258
+ }
259
+ catch {
260
+ continue;
261
+ }
262
+ for (const page of pageEntries) {
263
+ if (page.startsWith('editorial-') && page.endsWith('.astro')) {
264
+ out.push({
265
+ kind: 'editorial-astro-page',
266
+ relativePath: `src/sites/${site}/pages/dev/${page}`,
267
+ });
268
+ }
269
+ }
270
+ }
271
+ }
272
+ // Branch 4: scripts/lib/editorial/ or scripts/lib/editorial-review/.
273
+ for (const candidate of ['scripts/lib/editorial', 'scripts/lib/editorial-review']) {
274
+ if (existsSync(join(projectRoot, candidate))) {
275
+ out.push({
276
+ kind: 'editorial-script-module',
277
+ relativePath: `${candidate}/`,
278
+ });
279
+ }
280
+ }
281
+ return out;
282
+ }
283
+ /**
284
+ * Print the existing-pipeline warning to stdout when signals were
285
+ * detected. No-op when nothing was found.
286
+ */
287
+ export function printExistingPipelineWarning(signals) {
288
+ if (signals.length === 0)
289
+ return;
290
+ console.log('');
291
+ console.log('Detected existing editorial-pipeline signals in this project:');
292
+ for (const s of signals) {
293
+ console.log(` - ${s.relativePath}`);
294
+ }
295
+ console.log('');
296
+ console.log('Deskwork will install ALONGSIDE the existing implementation, not replace it.');
297
+ console.log('Resolve overlap manually before driving both pipelines against the same calendar.');
298
+ console.log('');
299
+ }
300
+ //# sourceMappingURL=install-preflight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-preflight.js","sourceRoot":"","sources":["../../src/commands/install-preflight.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAGrE,MAAM,kBAAkB,GAAG;IACzB,kBAAkB;IAClB,iBAAiB;IACjB,iBAAiB;IACjB,kBAAkB;CACV,CAAC;AAEX,MAAM,oBAAoB,GAAG;IAC3B,0BAA0B;IAC1B,uBAAuB;IACvB,uBAAuB;IACvB,wBAAwB;IACxB,mEAAmE;IACnE,uBAAuB;IACvB,uBAAuB;IACvB,wBAAwB;CAChB,CAAC;AAEX;;;;GAIG;AACH,SAAS,cAAc,CAAC,WAAmB;IACzC,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CACtC,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CACpC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,qBAAqB,CAAC,WAAmB;IAChD,KAAK,MAAM,GAAG,IAAI,oBAAoB,EAAE,CAAC;QACvC,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;QACnC,IAAI,UAAU,CAAC,GAAG,CAAC;YAAE,OAAO,GAAG,CAAC;IAClC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAYD;;;;;;;;;GASG;AACH,MAAM,UAAU,yBAAyB,CACvC,WAAmB;IAEnB,IAAI,CAAC,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 * deskwork-install — validate a deskwork config, write it to disk, and seed
3
+ * empty calendar files for every configured site.
4
+ *
5
+ * Usage (one-arg, project-root defaults to cwd):
6
+ * deskwork install <config-file>
7
+ *
8
+ * Usage (two-arg, explicit project-root):
9
+ * deskwork install <project-root> <config-file>
10
+ *
11
+ * The agent inside Claude Code is already running in the host project's
12
+ * working directory, so the one-arg form is the natural call. The
13
+ * explicit two-arg form is preserved for scripted use (CI bootstrapping
14
+ * a project from outside, etc.).
15
+ *
16
+ * The config-file must contain valid JSON matching the DeskworkConfig
17
+ * schema (see lib/config.ts). On success the script:
18
+ * 1. Writes the validated config to <project-root>/.deskwork/config.json
19
+ * 2. Creates an empty calendar file at each site's calendarPath, but
20
+ * only when no file is already there
21
+ * 3. Prints a summary of what was written and what was left untouched
22
+ *
23
+ * Exits non-zero with an actionable message on any failure. Idempotent:
24
+ * re-running with the same config leaves existing calendars alone.
25
+ */
26
+ export declare function run(argv: string[]): Promise<void>;
27
+ //# sourceMappingURL=install.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAYH,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAgHvD"}
@@ -0,0 +1,132 @@
1
+ /**
2
+ * deskwork-install — validate a deskwork config, write it to disk, and seed
3
+ * empty calendar files for every configured site.
4
+ *
5
+ * Usage (one-arg, project-root defaults to cwd):
6
+ * deskwork install <config-file>
7
+ *
8
+ * Usage (two-arg, explicit project-root):
9
+ * deskwork install <project-root> <config-file>
10
+ *
11
+ * The agent inside Claude Code is already running in the host project's
12
+ * working directory, so the one-arg form is the natural call. The
13
+ * explicit two-arg form is preserved for scripted use (CI bootstrapping
14
+ * a project from outside, etc.).
15
+ *
16
+ * The config-file must contain valid JSON matching the DeskworkConfig
17
+ * schema (see lib/config.ts). On success the script:
18
+ * 1. Writes the validated config to <project-root>/.deskwork/config.json
19
+ * 2. Creates an empty calendar file at each site's calendarPath, but
20
+ * only when no file is already there
21
+ * 3. Prints a summary of what was written and what was left untouched
22
+ *
23
+ * Exits non-zero with an actionable message on any failure. Idempotent:
24
+ * re-running with the same config leaves existing calendars alone.
25
+ */
26
+ import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'node:fs';
27
+ import { dirname, isAbsolute, join, resolve } from 'node:path';
28
+ import { parseConfig, configPath } from '@deskwork/core/config';
29
+ import { renderEmptyCalendar } from '@deskwork/core/calendar';
30
+ import { detectExistingPipeline, printExistingPipelineWarning, printSchemaPreflight, } from "./install-preflight.js";
31
+ export async function run(argv) {
32
+ function usage() {
33
+ console.error('Usage: deskwork install [<project-root>] <config-file>');
34
+ process.exit(2);
35
+ }
36
+ // Two argv shapes possible after the cli dispatcher has run:
37
+ // [<config-file>] → project-root defaults to cwd
38
+ // [<project-root>, <config-file>] → explicit project-root
39
+ // The dispatcher's pathLike heuristic injects cwd for non-path-like
40
+ // first args, so `deskwork install bare.json` arrives here as the
41
+ // two-arg form `[cwd, bare.json]`. The one-arg form below only fires
42
+ // when the user passed an absolute or relative path as the single
43
+ // positional (e.g. `deskwork install /tmp/config.json`).
44
+ let projectRootArg;
45
+ let configFileArg;
46
+ if (argv.length === 1) {
47
+ projectRootArg = process.cwd();
48
+ configFileArg = argv[0];
49
+ }
50
+ else if (argv.length === 2) {
51
+ [projectRootArg, configFileArg] = argv;
52
+ }
53
+ else {
54
+ usage();
55
+ }
56
+ const projectRoot = isAbsolute(projectRootArg)
57
+ ? projectRootArg
58
+ : resolve(process.cwd(), projectRootArg);
59
+ const configFile = isAbsolute(configFileArg)
60
+ ? configFileArg
61
+ : resolve(process.cwd(), configFileArg);
62
+ // Heads-up so the operator (or the agent reading the output) can
63
+ // interrupt before any disk writes if the inferred project-root is
64
+ // wrong. Prints to stdout so it lands above the success summary.
65
+ console.log(`Installing into: ${projectRoot}`);
66
+ if (!existsSync(projectRoot)) {
67
+ console.error(`Project root does not exist: ${projectRoot}`);
68
+ process.exit(1);
69
+ }
70
+ if (!existsSync(configFile)) {
71
+ console.error(`Config file does not exist: ${configFile}`);
72
+ process.exit(1);
73
+ }
74
+ let rawConfig;
75
+ try {
76
+ rawConfig = JSON.parse(readFileSync(configFile, 'utf-8'));
77
+ }
78
+ catch (err) {
79
+ const reason = err instanceof Error ? err.message : String(err);
80
+ console.error(`Config file is not valid JSON: ${reason}`);
81
+ process.exit(1);
82
+ }
83
+ let config;
84
+ try {
85
+ config = parseConfig(rawConfig);
86
+ }
87
+ catch (err) {
88
+ const reason = err instanceof Error ? err.message : String(err);
89
+ console.error(reason);
90
+ process.exit(1);
91
+ }
92
+ // Issue #45: detect competing in-house editorial pipelines BEFORE
93
+ // writing the config file. The warning is non-blocking; install
94
+ // still proceeds. The operator gets an honest accounting of what
95
+ // they're about to be running alongside.
96
+ const pipelineSignals = detectExistingPipeline(projectRoot);
97
+ printExistingPipelineWarning(pipelineSignals);
98
+ const writtenConfigPath = configPath(projectRoot);
99
+ mkdirSync(dirname(writtenConfigPath), { recursive: true });
100
+ writeFileSync(writtenConfigPath, JSON.stringify(config, null, 2) + '\n', 'utf-8');
101
+ const createdCalendars = [];
102
+ const preservedCalendars = [];
103
+ for (const [slug, site] of Object.entries(config.sites)) {
104
+ const absPath = join(projectRoot, site.calendarPath);
105
+ if (existsSync(absPath)) {
106
+ preservedCalendars.push(`${slug}: ${site.calendarPath}`);
107
+ continue;
108
+ }
109
+ mkdirSync(dirname(absPath), { recursive: true });
110
+ writeFileSync(absPath, renderEmptyCalendar(), 'utf-8');
111
+ createdCalendars.push(`${slug}: ${site.calendarPath}`);
112
+ }
113
+ console.log(`Wrote config: ${writtenConfigPath}`);
114
+ console.log(`Sites configured: ${Object.keys(config.sites).join(', ')}`);
115
+ console.log(`Default site: ${config.defaultSite}`);
116
+ if (createdCalendars.length > 0) {
117
+ console.log(`Created calendars:`);
118
+ for (const c of createdCalendars)
119
+ console.log(` - ${c}`);
120
+ }
121
+ if (preservedCalendars.length > 0) {
122
+ console.log(`Left existing calendars untouched:`);
123
+ for (const c of preservedCalendars)
124
+ console.log(` - ${c}`);
125
+ }
126
+ // Issue #42: schema pre-flight. Loud-but-non-blocking probe for the
127
+ // host's content-collection schema. Skipped on non-Astro projects.
128
+ // When uncertain, the helper prints inline patch instructions so
129
+ // the operator sees the requirement before the first deskwork write.
130
+ printSchemaPreflight(projectRoot, config);
131
+ }
132
+ //# sourceMappingURL=install.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,CAAC,KAAK,UAAU,GAAG,CAAC,IAAc;IACtC,SAAS,KAAK;QACZ,OAAO,CAAC,KAAK,CACX,wDAAwD,CACzD,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,6DAA6D;IAC7D,sEAAsE;IACtE,+DAA+D;IAC/D,oEAAoE;IACpE,kEAAkE;IAClE,qEAAqE;IACrE,kEAAkE;IAClE,yDAAyD;IACzD,IAAI,cAAsB,CAAC;IAC3B,IAAI,aAAqB,CAAC;IAC1B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,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,qEAAqE;IACrE,oBAAoB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * deskwork-iterate — snapshot the agent's revised content file as a new
3
+ * workflow version and transition back to in-review.
4
+ *
5
+ * Call this AFTER the agent has rewritten the markdown on disk based on
6
+ * operator comments. The helper does the mechanical persist-and-transition
7
+ * step:
8
+ *
9
+ * 1. Read the workflow (must be in state `iterating`).
10
+ * 2. If disk differs from the workflow's current version, append a
11
+ * new version (originatedBy='agent') — this is the SSOT flow:
12
+ * disk is canonical, the journal captures snapshots.
13
+ * 3. Optionally read a dispositions JSON and emit address annotations
14
+ * (one per commentId) that the studio sidebar renders as badges.
15
+ * 4. Transition the workflow back to in-review.
16
+ *
17
+ * Phase 21a: `--kind shortform` is accepted alongside longform/outline.
18
+ * The mutation is kind-agnostic — it reads the workflow's on-disk file
19
+ * (longform: `<contentDir>/<slug>.md`; shortform:
20
+ * `<contentDir>/<slug>/scrapbook/shortform/<platform>[-<channel>].md`)
21
+ * and snapshots its body as the new version.
22
+ *
23
+ * Usage:
24
+ * deskwork-iterate <project-root> [--site <slug>]
25
+ * [--kind longform|outline|shortform]
26
+ * [--platform <p>] [--channel <c>]
27
+ * [--dispositions <path>] <slug>
28
+ *
29
+ * The dispositions file (optional) is a JSON object mapping commentId to
30
+ * { disposition: 'addressed'|'deferred'|'wontfix', reason?: string }.
31
+ */
32
+ export declare function run(argv: string[]): Promise<void>;
33
+ //# sourceMappingURL=iterate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iterate.d.ts","sourceRoot":"","sources":["../../src/commands/iterate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAqBH,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAgOvD"}