@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,202 @@
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
+ import { existsSync, readFileSync } from 'node:fs';
33
+ import { readConfig } from '@deskwork/core/config';
34
+ import { resolveSite, resolveEntryFilePath, resolveShortformFilePath, } from '@deskwork/core/paths';
35
+ import { appendAnnotation, appendVersion, mintAnnotation, readAnnotations, readVersions, readWorkflows, transitionState, } from '@deskwork/core/review/pipeline';
36
+ import { isPlatform } from '@deskwork/core/types';
37
+ import { absolutize, emit, fail, parseArgs } from '@deskwork/core/cli-args';
38
+ export async function run(argv) {
39
+ const KNOWN_FLAGS = ['site', 'kind', 'platform', 'channel', 'dispositions'];
40
+ const DISPOSITIONS = new Set(['addressed', 'deferred', 'wontfix']);
41
+ const VALID_KINDS = ['longform', 'outline', 'shortform'];
42
+ const { positional, flags } = parse();
43
+ if (positional.length < 2) {
44
+ fail('Usage: deskwork-iterate <project-root> [--site <slug>] ' +
45
+ '[--kind longform|outline|shortform] [--platform <p>] [--channel <c>] ' +
46
+ '[--dispositions <path>] <slug>', 2);
47
+ }
48
+ const [rootArg, slug] = positional;
49
+ const projectRoot = absolutize(rootArg);
50
+ if (flags.kind !== undefined &&
51
+ !VALID_KINDS.includes(flags.kind)) {
52
+ fail(`Invalid --kind "${flags.kind}". Must be 'longform', 'outline', or 'shortform'.`);
53
+ }
54
+ const kind = (() => {
55
+ if (flags.kind === 'shortform')
56
+ return 'shortform';
57
+ if (flags.kind === 'outline')
58
+ return 'outline';
59
+ return 'longform';
60
+ })();
61
+ if (kind === 'shortform') {
62
+ if (flags.platform === undefined) {
63
+ fail('--platform is required when --kind=shortform.');
64
+ }
65
+ if (!isPlatform(flags.platform)) {
66
+ fail(`Invalid --platform "${flags.platform}".`);
67
+ }
68
+ }
69
+ else if (flags.platform !== undefined || flags.channel !== undefined) {
70
+ fail('--platform / --channel are only valid with --kind=shortform.');
71
+ }
72
+ let config;
73
+ try {
74
+ config = readConfig(projectRoot);
75
+ }
76
+ catch (err) {
77
+ fail(err instanceof Error ? err.message : String(err));
78
+ }
79
+ const site = resolveSite(config, flags.site);
80
+ // Find the workflow BEFORE resolving the file path. The workflow
81
+ // records the stable entry id, which the path resolver uses to
82
+ // prefer the UUID-bound file over the slug-template (Issue #67).
83
+ const workflow = readWorkflows(projectRoot, config).find((w) => w.site === site &&
84
+ w.slug === slug &&
85
+ w.contentKind === kind &&
86
+ (kind !== 'shortform' || w.platform === flags.platform) &&
87
+ (kind !== 'shortform' || (w.channel ?? null) === (flags.channel ?? null)) &&
88
+ w.state !== 'applied' &&
89
+ w.state !== 'cancelled');
90
+ if (!workflow) {
91
+ fail(`No active ${kind} workflow for ${site}/${slug}. ` +
92
+ `Run /deskwork:review-start <slug> to enqueue one first.`);
93
+ }
94
+ let file;
95
+ if (kind === 'shortform' && flags.platform !== undefined && isPlatform(flags.platform)) {
96
+ const channel = flags.channel;
97
+ const resolved = resolveShortformFilePath(projectRoot, config, site, workflow.entryId !== undefined && workflow.entryId !== ''
98
+ ? { id: workflow.entryId, slug }
99
+ : { slug }, flags.platform, channel);
100
+ if (resolved === undefined) {
101
+ fail(`Cannot resolve shortform file for site=${site} slug=${slug} platform=${flags.platform}. ` +
102
+ `Run /deskwork:shortform-start to scaffold it first.`);
103
+ }
104
+ file = resolved;
105
+ }
106
+ else {
107
+ file = resolveEntryFilePath(projectRoot, config, site, slug, workflow.entryId);
108
+ }
109
+ if (!existsSync(file)) {
110
+ fail(kind === 'shortform'
111
+ ? `No shortform file at ${file}. Run /deskwork:shortform-start first.`
112
+ : `No blog file at ${file}.`);
113
+ }
114
+ const diskMarkdown = readFileSync(file, 'utf8');
115
+ if (workflow.state !== 'iterating') {
116
+ fail(`Workflow state is '${workflow.state}', not 'iterating'.\n` +
117
+ `The studio must click 'Request iteration' to move the workflow to ` +
118
+ `'iterating' before this helper runs.`);
119
+ }
120
+ const versions = readVersions(projectRoot, config, workflow.id);
121
+ const current = versions.find((v) => v.version === workflow.currentVersion);
122
+ if (current && current.markdown === diskMarkdown) {
123
+ fail(`File on disk is identical to workflow v${workflow.currentVersion} — no revision to snapshot. ` +
124
+ `Write the revision to disk first (the agent does this), then re-run.`);
125
+ }
126
+ // Load dispositions file, if provided. Validate each entry.
127
+ let dispositions = null;
128
+ if (flags.dispositions !== undefined) {
129
+ const path = absolutize(flags.dispositions);
130
+ if (!existsSync(path)) {
131
+ fail(`--dispositions file not found: ${path}`);
132
+ }
133
+ let parsed;
134
+ try {
135
+ parsed = JSON.parse(readFileSync(path, 'utf8'));
136
+ }
137
+ catch (err) {
138
+ const reason = err instanceof Error ? err.message : String(err);
139
+ fail(`--dispositions: invalid JSON at ${path}: ${reason}`);
140
+ }
141
+ if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {
142
+ fail(`--dispositions: expected JSON object at ${path}`);
143
+ }
144
+ dispositions = {};
145
+ for (const [commentId, raw] of Object.entries(parsed)) {
146
+ if (typeof raw !== 'object' || raw === null) {
147
+ fail(`--dispositions[${commentId}]: must be an object`);
148
+ }
149
+ const d = raw;
150
+ if (typeof d.disposition !== 'string' || !DISPOSITIONS.has(d.disposition)) {
151
+ fail(`--dispositions[${commentId}].disposition: must be 'addressed' | 'deferred' | 'wontfix'`);
152
+ }
153
+ const entry = { disposition: d.disposition };
154
+ if (typeof d.reason === 'string' && d.reason.length > 0) {
155
+ entry.reason = d.reason;
156
+ }
157
+ dispositions[commentId] = entry;
158
+ }
159
+ }
160
+ // Append the new version from disk.
161
+ const newVersion = appendVersion(projectRoot, config, workflow.id, diskMarkdown, 'agent');
162
+ // Emit per-comment address annotations for the new version.
163
+ const addressed = [];
164
+ if (dispositions) {
165
+ const workflowComments = new Set(readAnnotations(projectRoot, config, workflow.id)
166
+ .filter((a) => a.type === 'comment')
167
+ .map((a) => a.id));
168
+ for (const [commentId, entry] of Object.entries(dispositions)) {
169
+ if (!workflowComments.has(commentId))
170
+ continue;
171
+ const ann = mintAnnotation({
172
+ type: 'address',
173
+ workflowId: workflow.id,
174
+ commentId,
175
+ version: newVersion.version,
176
+ disposition: entry.disposition,
177
+ ...(entry.reason !== undefined ? { reason: entry.reason } : {}),
178
+ });
179
+ appendAnnotation(projectRoot, config, ann);
180
+ addressed.push(commentId);
181
+ }
182
+ }
183
+ // Flip state back to in-review.
184
+ const updated = transitionState(projectRoot, config, workflow.id, 'in-review');
185
+ emit({
186
+ workflowId: workflow.id,
187
+ site: updated.site,
188
+ slug: updated.slug,
189
+ state: updated.state,
190
+ version: newVersion.version,
191
+ addressedComments: addressed,
192
+ });
193
+ function parse() {
194
+ try {
195
+ return parseArgs(argv, KNOWN_FLAGS);
196
+ }
197
+ catch (err) {
198
+ fail(err instanceof Error ? err.message : String(err), 2);
199
+ }
200
+ }
201
+ }
202
+ //# sourceMappingURL=iterate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iterate.js","sourceRoot":"","sources":["../../src/commands/iterate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,eAAe,EACf,YAAY,EACZ,aAAa,EACb,eAAe,GAChB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAE5E,MAAM,CAAC,KAAK,UAAU,GAAG,CAAC,IAAc;IACtC,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,CAAU,CAAC;IACrF,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,UAAU,EAAE,SAAS,CAAU,CAAC,CAAC;IAC5E,MAAM,WAAW,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,WAAW,CAAU,CAAC;IASlE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC;IAEtC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,IAAI,CACF,yDAAyD;YACvD,uEAAuE;YACvE,gCAAgC,EAClC,CAAC,CACF,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,OAAO,EAAE,I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AM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAChE,CAAC,CAAC;YACH,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;YAC3C,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,gCAAgC;IAChC,MAAM,OAAO,GAAG,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;IAE/E,IAAI,CAAC;QACH,UAAU,EAAE,QAAQ,CAAC,EAAE;QACvB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,iBAAiB,EAAE,SAAS;KAC7B,CAAC,CAAC;IAEH,SAAS,KAAK;QACZ,IAAI,CAAC;YACH,OAAO,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACtC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * deskwork-outline — move a Planned entry to Outlining.
3
+ *
4
+ * For blog entries, scaffolds the blog post markdown with frontmatter +
5
+ * (optionally) a `## Outline` section so the operator can shape the
6
+ * piece before the agent drafts the body. For youtube/tool entries,
7
+ * no filesystem artifact is created — the stage flip to Outlining
8
+ * still happens (the pipeline expects every content type to pass
9
+ * through Outlining before Drafting).
10
+ *
11
+ * Usage:
12
+ * deskwork-outline <project-root> [--site <slug>] [--author "Name"] <slug>
13
+ *
14
+ * Emits a JSON result:
15
+ * { slug, stage, contentType, scaffolded: {filePath, relativePath} | null,
16
+ * site, calendarPath }
17
+ */
18
+ export declare function run(argv: string[]): Promise<void>;
19
+ //# sourceMappingURL=outline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outline.d.ts","sourceRoot":"","sources":["../../src/commands/outline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAiBH,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA4FvD"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * deskwork-outline — move a Planned entry to Outlining.
3
+ *
4
+ * For blog entries, scaffolds the blog post markdown with frontmatter +
5
+ * (optionally) a `## Outline` section so the operator can shape the
6
+ * piece before the agent drafts the body. For youtube/tool entries,
7
+ * no filesystem artifact is created — the stage flip to Outlining
8
+ * still happens (the pipeline expects every content type to pass
9
+ * through Outlining before Drafting).
10
+ *
11
+ * Usage:
12
+ * deskwork-outline <project-root> [--site <slug>] [--author "Name"] <slug>
13
+ *
14
+ * Emits a JSON result:
15
+ * { slug, stage, contentType, scaffolded: {filePath, relativePath} | null,
16
+ * site, calendarPath }
17
+ */
18
+ import { readConfig } from '@deskwork/core/config';
19
+ import { readCalendar, writeCalendar } from '@deskwork/core/calendar';
20
+ import { outlineEntry, findEntry } from '@deskwork/core/calendar-mutations';
21
+ import { scaffoldBlogPost, } from '@deskwork/core/scaffold';
22
+ import { effectiveContentType, hasRepoContent, } from '@deskwork/core/types';
23
+ import { resolveSite, resolveCalendarPath } from '@deskwork/core/paths';
24
+ import { absolutize, emit, fail, parseArgs } from '@deskwork/core/cli-args';
25
+ export async function run(argv) {
26
+ const KNOWN_FLAGS = ['site', 'author', 'layout'];
27
+ const VALID_LAYOUTS = ['index', 'readme', 'flat'];
28
+ const { positional, flags } = parse();
29
+ if (positional.length < 2) {
30
+ fail('Usage: deskwork-outline <project-root> [--site <slug>] [--author "Name"] ' +
31
+ '[--layout index|readme|flat] <slug>', 2);
32
+ }
33
+ if (flags.layout !== undefined &&
34
+ !VALID_LAYOUTS.includes(flags.layout)) {
35
+ fail(`--layout must be one of ${VALID_LAYOUTS.join(', ')} (got "${flags.layout}")`, 2);
36
+ }
37
+ const layout = flags.layout;
38
+ const [rootArg, slug] = positional;
39
+ const projectRoot = absolutize(rootArg);
40
+ let config;
41
+ try {
42
+ config = readConfig(projectRoot);
43
+ }
44
+ catch (err) {
45
+ fail(err instanceof Error ? err.message : String(err));
46
+ }
47
+ const site = resolveSite(config, flags.site);
48
+ const calendarPath = resolveCalendarPath(projectRoot, config, site);
49
+ const calendar = readCalendar(calendarPath);
50
+ // Preflight: find the entry and verify stage before writing anything.
51
+ const existing = findEntry(calendar, slug);
52
+ if (!existing) {
53
+ const planned = calendar.entries
54
+ .filter((e) => e.stage === 'Planned')
55
+ .map((e) => e.slug)
56
+ .join(', ') || '(none)';
57
+ fail(`No calendar entry found with slug "${slug}". Planned entries: ${planned}`);
58
+ }
59
+ if (existing.stage !== 'Planned') {
60
+ fail(`Entry "${slug}" is in stage "${existing.stage}" — must be in Planned to outline.`);
61
+ }
62
+ const contentType = effectiveContentType(existing);
63
+ let scaffolded = null;
64
+ if (hasRepoContent(contentType)) {
65
+ const opts = {};
66
+ if (flags.author !== undefined)
67
+ opts.authorOverride = flags.author;
68
+ if (layout !== undefined)
69
+ opts.layout = layout;
70
+ try {
71
+ scaffolded = scaffoldBlogPost(projectRoot, config, site, existing, opts);
72
+ }
73
+ catch (err) {
74
+ fail(err instanceof Error ? err.message : String(err));
75
+ }
76
+ }
77
+ // Phase 19a removed CalendarEntry.filePath — path-encoding lives in
78
+ // the scaffolded file's frontmatter `id:` and is resolved through
79
+ // the content index at read time. The scaffolder still reports
80
+ // `contentRelativePath` in its result for the JSON emit so the
81
+ // caller can show the operator where the file was created.
82
+ const updated = outlineEntry(calendar, slug);
83
+ writeCalendar(calendarPath, calendar);
84
+ emit({
85
+ slug: updated.slug,
86
+ title: updated.title,
87
+ stage: updated.stage,
88
+ contentType,
89
+ scaffolded,
90
+ site,
91
+ calendarPath,
92
+ });
93
+ function parse() {
94
+ try {
95
+ return parseArgs(argv, KNOWN_FLAGS);
96
+ }
97
+ catch (err) {
98
+ fail(err instanceof Error ? err.message : String(err), 2);
99
+ }
100
+ }
101
+ }
102
+ //# sourceMappingURL=outline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outline.js","sourceRoot":"","sources":["../../src/commands/outline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EACL,gBAAgB,GAGjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,oBAAoB,EACpB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAE5E,MAAM,CAAC,KAAK,UAAU,GAAG,CAAC,IAAc;IACtC,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;IAC1D,MAAM,aAAa,GAA8B,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAE7E,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC;IAEtC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,IAAI,CACF,2EAA2E;YACzE,qCAAqC,EACvC,CAAC,CACF,CAAC;IACJ,CAAC;IAC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AW;QACX,UAAU;QACV,IAAI;QACJ,YAAY;KACb,CAAC,CAAC;IAEH,SAAS,KAAK;QACZ,IAAI,CAAC;YACH,OAAO,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACtC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * deskwork-pause — move a non-terminal entry to Paused.
3
+ *
4
+ * Records the prior stage on `pausedFrom` so `deskwork resume` can put
5
+ * the entry back where it came from. Refuses to pause Published or
6
+ * already-Paused entries (see core's `pauseEntry`). #27.
7
+ *
8
+ * Usage:
9
+ * deskwork-pause <project-root> [--site <slug>] <slug>
10
+ *
11
+ * Emits a JSON result:
12
+ * { slug, stage: "Paused", pausedFrom, site, calendarPath }
13
+ */
14
+ export declare function run(argv: string[]): Promise<void>;
15
+ //# sourceMappingURL=pause.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pause.d.ts","sourceRoot":"","sources":["../../src/commands/pause.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAQH,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA0DvD"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * deskwork-pause — move a non-terminal entry to Paused.
3
+ *
4
+ * Records the prior stage on `pausedFrom` so `deskwork resume` can put
5
+ * the entry back where it came from. Refuses to pause Published or
6
+ * already-Paused entries (see core's `pauseEntry`). #27.
7
+ *
8
+ * Usage:
9
+ * deskwork-pause <project-root> [--site <slug>] <slug>
10
+ *
11
+ * Emits a JSON result:
12
+ * { slug, stage: "Paused", pausedFrom, site, calendarPath }
13
+ */
14
+ import { readConfig } from '@deskwork/core/config';
15
+ import { readCalendar, writeCalendar } from '@deskwork/core/calendar';
16
+ import { findEntry, pauseEntry } from '@deskwork/core/calendar-mutations';
17
+ import { resolveSite, resolveCalendarPath } from '@deskwork/core/paths';
18
+ import { absolutize, emit, fail, parseArgs } from '@deskwork/core/cli-args';
19
+ export async function run(argv) {
20
+ const KNOWN_FLAGS = ['site'];
21
+ const { positional, flags } = parse();
22
+ if (positional.length < 2) {
23
+ fail('Usage: deskwork-pause <project-root> [--site <slug>] <slug>', 2);
24
+ }
25
+ const [rootArg, slug] = positional;
26
+ const projectRoot = absolutize(rootArg);
27
+ let config;
28
+ try {
29
+ config = readConfig(projectRoot);
30
+ }
31
+ catch (err) {
32
+ fail(err instanceof Error ? err.message : String(err));
33
+ }
34
+ const site = resolveSite(config, flags.site);
35
+ const calendarPath = resolveCalendarPath(projectRoot, config, site);
36
+ const calendar = readCalendar(calendarPath);
37
+ const existing = findEntry(calendar, slug);
38
+ if (!existing) {
39
+ const available = calendar.entries
40
+ .filter((e) => e.stage !== 'Published' && e.stage !== 'Paused')
41
+ .map((e) => e.slug)
42
+ .join(', ') || '(none)';
43
+ fail(`No calendar entry found with slug "${slug}". Pausable entries: ${available}`);
44
+ }
45
+ let paused;
46
+ try {
47
+ paused = pauseEntry(calendar, slug);
48
+ }
49
+ catch (err) {
50
+ fail(err instanceof Error ? err.message : String(err));
51
+ }
52
+ writeCalendar(calendarPath, calendar);
53
+ emit({
54
+ slug: paused.slug,
55
+ title: paused.title,
56
+ stage: paused.stage,
57
+ pausedFrom: paused.pausedFrom,
58
+ site,
59
+ calendarPath,
60
+ });
61
+ function parse() {
62
+ try {
63
+ return parseArgs(argv, KNOWN_FLAGS);
64
+ }
65
+ catch (err) {
66
+ fail(err instanceof Error ? err.message : String(err), 2);
67
+ }
68
+ }
69
+ }
70
+ //# sourceMappingURL=pause.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pause.js","sourceRoot":"","sources":["../../src/commands/p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C,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * deskwork-plan — move an Ideas entry to Planned and set target keywords.
3
+ *
4
+ * Usage:
5
+ * deskwork-plan <project-root> [--site <slug>] [--topics t1,t2,...]
6
+ * <slug> [<keyword1> <keyword2> ...]
7
+ *
8
+ * Keywords may be passed as separate positionals or a single
9
+ * comma-separated string. Emits a JSON result with the updated entry.
10
+ */
11
+ export declare function run(argv: string[]): Promise<void>;
12
+ //# sourceMappingURL=plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/commands/plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAoEvD"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * deskwork-plan — move an Ideas entry to Planned and set target keywords.
3
+ *
4
+ * Usage:
5
+ * deskwork-plan <project-root> [--site <slug>] [--topics t1,t2,...]
6
+ * <slug> [<keyword1> <keyword2> ...]
7
+ *
8
+ * Keywords may be passed as separate positionals or a single
9
+ * comma-separated string. Emits a JSON result with the updated entry.
10
+ */
11
+ import { readConfig } from '@deskwork/core/config';
12
+ import { readCalendar, writeCalendar } from '@deskwork/core/calendar';
13
+ import { planEntry } from '@deskwork/core/calendar-mutations';
14
+ import { resolveSite, resolveCalendarPath } from '@deskwork/core/paths';
15
+ import { absolutize, emit, fail, parseArgs } from '@deskwork/core/cli-args';
16
+ export async function run(argv) {
17
+ const KNOWN_FLAGS = ['site', 'topics'];
18
+ const { positional, flags } = parse();
19
+ if (positional.length < 2) {
20
+ fail('Usage: deskwork-plan <project-root> [--site <slug>] [--topics t1,t2,...] ' +
21
+ '<slug> [<keyword1> <keyword2> ...]', 2);
22
+ }
23
+ const [rootArg, slug, ...keywordArgs] = positional;
24
+ const projectRoot = absolutize(rootArg);
25
+ // Accept "a, b, c" as a single arg or separate positionals. Both shapes
26
+ // collapse to a flat string[] of non-empty trimmed keywords.
27
+ const keywords = keywordArgs
28
+ .flatMap((k) => k.split(','))
29
+ .map((k) => k.trim())
30
+ .filter((k) => k.length > 0);
31
+ let topics;
32
+ if (flags.topics !== undefined) {
33
+ topics = flags.topics
34
+ .split(',')
35
+ .map((t) => t.trim())
36
+ .filter((t) => t.length > 0);
37
+ }
38
+ let config;
39
+ try {
40
+ config = readConfig(projectRoot);
41
+ }
42
+ catch (err) {
43
+ fail(err instanceof Error ? err.message : String(err));
44
+ }
45
+ const site = resolveSite(config, flags.site);
46
+ const calendarPath = resolveCalendarPath(projectRoot, config, site);
47
+ const calendar = readCalendar(calendarPath);
48
+ let entry;
49
+ try {
50
+ entry = planEntry(calendar, slug, keywords, topics ? { topics } : undefined);
51
+ }
52
+ catch (err) {
53
+ fail(err instanceof Error ? err.message : String(err));
54
+ }
55
+ writeCalendar(calendarPath, calendar);
56
+ emit({
57
+ slug: entry.slug,
58
+ title: entry.title,
59
+ stage: entry.stage,
60
+ targetKeywords: entry.targetKeywords,
61
+ topics: entry.topics,
62
+ site,
63
+ calendarPath,
64
+ });
65
+ function parse() {
66
+ try {
67
+ return parseArgs(argv, KNOWN_FLAGS);
68
+ }
69
+ catch (err) {
70
+ fail(err instanceof Error ? err.message : String(err), 2);
71
+ }
72
+ }
73
+ }
74
+ //# sourceMappingURL=plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.js","sourceRoot":"","sources":["../../src/commands/plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAA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AC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * deskwork-publish — mark a Drafting/Review entry as Published.
3
+ *
4
+ * For blog entries, the helper verifies that `<contentDir>/<slug>/index.md`
5
+ * exists — refusing to publish a post whose file hasn't been written. For
6
+ * youtube/tool entries, the helper requires `contentUrl` to be set on the
7
+ * entry; if it's missing, pass --content-url to set it in the same call.
8
+ *
9
+ * Usage:
10
+ * deskwork-publish <project-root> [--site <slug>] [--date YYYY-MM-DD]
11
+ * [--content-url URL] <slug>
12
+ *
13
+ * Emits a JSON result:
14
+ * { slug, stage: "Published", datePublished, contentType, contentUrl?,
15
+ * issueNumber?, filePath?, site, calendarPath }
16
+ */
17
+ export declare function run(argv: string[]): Promise<void>;
18
+ //# sourceMappingURL=publish.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/commands/publish.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAsBH,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuGvD"}