@deskwork/cli 0.12.1 → 0.14.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.
- package/package.json +4 -4
- package/dist/commands/draft.d.ts +0 -17
- package/dist/commands/draft.d.ts.map +0 -1
- package/dist/commands/draft.js +0 -77
- package/dist/commands/draft.js.map +0 -1
- package/dist/commands/outline.d.ts +0 -19
- package/dist/commands/outline.d.ts.map +0 -1
- package/dist/commands/outline.js +0 -102
- package/dist/commands/outline.js.map +0 -1
- package/dist/commands/pause.d.ts +0 -15
- package/dist/commands/pause.d.ts.map +0 -1
- package/dist/commands/pause.js +0 -70
- package/dist/commands/pause.js.map +0 -1
- package/dist/commands/plan.d.ts +0 -12
- package/dist/commands/plan.d.ts.map +0 -1
- package/dist/commands/plan.js +0 -74
- package/dist/commands/plan.js.map +0 -1
- package/dist/commands/resume.d.ts +0 -16
- package/dist/commands/resume.d.ts.map +0 -1
- package/dist/commands/resume.js +0 -70
- package/dist/commands/resume.js.map +0 -1
- package/dist/commands/review-cancel.d.ts +0 -15
- package/dist/commands/review-cancel.d.ts.map +0 -1
- package/dist/commands/review-cancel.js +0 -88
- package/dist/commands/review-cancel.js.map +0 -1
- package/dist/commands/review-help.d.ts +0 -12
- package/dist/commands/review-help.d.ts.map +0 -1
- package/dist/commands/review-help.js +0 -52
- package/dist/commands/review-help.js.map +0 -1
- package/dist/commands/review-report.d.ts +0 -13
- package/dist/commands/review-report.d.ts.map +0 -1
- package/dist/commands/review-report.js +0 -53
- package/dist/commands/review-report.js.map +0 -1
- package/dist/commands/review-start.d.ts +0 -17
- package/dist/commands/review-start.d.ts.map +0 -1
- package/dist/commands/review-start.js +0 -121
- package/dist/commands/review-start.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deskwork/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Editorial calendar + review CLI for the deskwork plugin",
|
|
6
6
|
"homepage": "https://github.com/audiocontrol-org/deskwork#readme",
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
"deskwork": "./dist/cli.js"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
|
-
"build": "tsc -b tsconfig.build.json",
|
|
30
|
-
"prepack": "tsc -b tsconfig.build.json",
|
|
29
|
+
"build": "tsc -b tsconfig.build.json && chmod +x dist/cli.js",
|
|
30
|
+
"prepack": "tsc -b tsconfig.build.json && chmod +x dist/cli.js",
|
|
31
31
|
"dev": "tsc -b tsconfig.build.json --watch",
|
|
32
32
|
"test": "vitest run",
|
|
33
33
|
"test:watch": "vitest",
|
|
34
34
|
"typecheck": "tsc --noEmit"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@deskwork/core": "0.
|
|
37
|
+
"@deskwork/core": "0.14.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^22.10.0",
|
package/dist/commands/draft.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* deskwork-draft — move an Outlining entry to Drafting.
|
|
3
|
-
*
|
|
4
|
-
* Blog file scaffolding happens in the outline step (see deskwork-outline).
|
|
5
|
-
* By the time this helper runs, the blog markdown already exists with an
|
|
6
|
-
* approved outline. Draft just flips the stage and optionally records a
|
|
7
|
-
* linked GitHub issue number (Claude invokes `gh issue create` separately
|
|
8
|
-
* and passes the resulting number via --issue).
|
|
9
|
-
*
|
|
10
|
-
* Usage:
|
|
11
|
-
* deskwork-draft <project-root> [--site <slug>] [--issue <n>] <slug>
|
|
12
|
-
*
|
|
13
|
-
* Emits a JSON result:
|
|
14
|
-
* { slug, stage, contentType, issueNumber?, site, calendarPath }
|
|
15
|
-
*/
|
|
16
|
-
export declare function run(argv: string[]): Promise<void>;
|
|
17
|
-
//# sourceMappingURL=draft.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"draft.d.ts","sourceRoot":"","sources":["../../src/commands/draft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAmEvD"}
|
package/dist/commands/draft.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* deskwork-draft — move an Outlining entry to Drafting.
|
|
3
|
-
*
|
|
4
|
-
* Blog file scaffolding happens in the outline step (see deskwork-outline).
|
|
5
|
-
* By the time this helper runs, the blog markdown already exists with an
|
|
6
|
-
* approved outline. Draft just flips the stage and optionally records a
|
|
7
|
-
* linked GitHub issue number (Claude invokes `gh issue create` separately
|
|
8
|
-
* and passes the resulting number via --issue).
|
|
9
|
-
*
|
|
10
|
-
* Usage:
|
|
11
|
-
* deskwork-draft <project-root> [--site <slug>] [--issue <n>] <slug>
|
|
12
|
-
*
|
|
13
|
-
* Emits a JSON result:
|
|
14
|
-
* { slug, stage, contentType, issueNumber?, site, calendarPath }
|
|
15
|
-
*/
|
|
16
|
-
import { readConfig } from '@deskwork/core/config';
|
|
17
|
-
import { readCalendar, writeCalendar } from '@deskwork/core/calendar';
|
|
18
|
-
import { draftEntry, findEntry } from '@deskwork/core/calendar-mutations';
|
|
19
|
-
import { effectiveContentType } from '@deskwork/core/types';
|
|
20
|
-
import { resolveSite, resolveCalendarPath } from '@deskwork/core/paths';
|
|
21
|
-
import { absolutize, emit, fail, parseArgs } from '@deskwork/core/cli-args';
|
|
22
|
-
export async function run(argv) {
|
|
23
|
-
const KNOWN_FLAGS = ['site', 'issue'];
|
|
24
|
-
const { positional, flags } = parse();
|
|
25
|
-
if (positional.length < 2) {
|
|
26
|
-
fail('Usage: deskwork-draft <project-root> [--site <slug>] [--issue <n>] <slug>', 2);
|
|
27
|
-
}
|
|
28
|
-
const [rootArg, slug] = positional;
|
|
29
|
-
const projectRoot = absolutize(rootArg);
|
|
30
|
-
let issueNumber;
|
|
31
|
-
if (flags.issue !== undefined) {
|
|
32
|
-
const n = parseInt(flags.issue, 10);
|
|
33
|
-
if (!Number.isFinite(n) || n <= 0) {
|
|
34
|
-
fail(`Invalid --issue "${flags.issue}". Must be a positive integer.`);
|
|
35
|
-
}
|
|
36
|
-
issueNumber = n;
|
|
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
|
-
const existing = findEntry(calendar, slug);
|
|
49
|
-
if (!existing) {
|
|
50
|
-
const outlining = calendar.entries
|
|
51
|
-
.filter((e) => e.stage === 'Outlining')
|
|
52
|
-
.map((e) => e.slug)
|
|
53
|
-
.join(', ') || '(none)';
|
|
54
|
-
fail(`No calendar entry found with slug "${slug}". Outlining entries: ${outlining}`);
|
|
55
|
-
}
|
|
56
|
-
const contentType = effectiveContentType(existing);
|
|
57
|
-
const updated = draftEntry(calendar, slug, issueNumber);
|
|
58
|
-
writeCalendar(calendarPath, calendar);
|
|
59
|
-
emit({
|
|
60
|
-
slug: updated.slug,
|
|
61
|
-
title: updated.title,
|
|
62
|
-
stage: updated.stage,
|
|
63
|
-
contentType,
|
|
64
|
-
issueNumber: updated.issueNumber,
|
|
65
|
-
site,
|
|
66
|
-
calendarPath,
|
|
67
|
-
});
|
|
68
|
-
function parse() {
|
|
69
|
-
try {
|
|
70
|
-
return parseArgs(argv, KNOWN_FLAGS);
|
|
71
|
-
}
|
|
72
|
-
catch (err) {
|
|
73
|
-
fail(err instanceof Error ? err.message : String(err), 2);
|
|
74
|
-
}
|
|
75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QACH,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,WAAW;QACX,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,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"}
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/commands/outline.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,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E,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,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;IAED,oEAAoE;IACpE,kEAAkE;IAClE,+DAA+D;IAC/D,+DAA+D;IAC/D,2DAA2D;IAE3D,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC7C,aAAa,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IAEtC,IAAI,CAAC;QACH,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,WAAW;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"}
|
package/dist/commands/pause.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/commands/pause.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pause.js","sourceRoot":"","sources":["../../src/commands/pause.ts"],"names":[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C,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/commands/plan.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/commands/plan.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,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,CAAU,CAAC;IAEhD,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC;IAEtC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,IAAI,CACF,2EAA2E;YACzE,oCAAoC,EACtC,CAAC,CACF,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,GAAG,WAAW,CAAC,GAAG,UAAU,CAAC;IACnD,MA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,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC/E,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,aAAa,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IAEtC,IAAI,CAAC;QACH,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,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"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* deskwork-resume — restore a Paused entry to its prior stage.
|
|
3
|
-
*
|
|
4
|
-
* Reads `pausedFrom` (recorded by `deskwork pause`) and moves the entry
|
|
5
|
-
* back to that stage. Refuses to resume an entry whose `pausedFrom` was
|
|
6
|
-
* lost (e.g. legacy hand-edit) — operator must move the entry by hand
|
|
7
|
-
* in that case. #27.
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
* deskwork-resume <project-root> [--site <slug>] <slug>
|
|
11
|
-
*
|
|
12
|
-
* Emits a JSON result:
|
|
13
|
-
* { slug, stage, site, calendarPath }
|
|
14
|
-
*/
|
|
15
|
-
export declare function run(argv: string[]): Promise<void>;
|
|
16
|
-
//# sourceMappingURL=resume.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resume.d.ts","sourceRoot":"","sources":["../../src/commands/resume.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAQH,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAyDvD"}
|
package/dist/commands/resume.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* deskwork-resume — restore a Paused entry to its prior stage.
|
|
3
|
-
*
|
|
4
|
-
* Reads `pausedFrom` (recorded by `deskwork pause`) and moves the entry
|
|
5
|
-
* back to that stage. Refuses to resume an entry whose `pausedFrom` was
|
|
6
|
-
* lost (e.g. legacy hand-edit) — operator must move the entry by hand
|
|
7
|
-
* in that case. #27.
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
* deskwork-resume <project-root> [--site <slug>] <slug>
|
|
11
|
-
*
|
|
12
|
-
* Emits a JSON result:
|
|
13
|
-
* { slug, stage, site, calendarPath }
|
|
14
|
-
*/
|
|
15
|
-
import { readConfig } from '@deskwork/core/config';
|
|
16
|
-
import { readCalendar, writeCalendar } from '@deskwork/core/calendar';
|
|
17
|
-
import { findEntry, unpauseEntry } from '@deskwork/core/calendar-mutations';
|
|
18
|
-
import { resolveSite, resolveCalendarPath } from '@deskwork/core/paths';
|
|
19
|
-
import { absolutize, emit, fail, parseArgs } from '@deskwork/core/cli-args';
|
|
20
|
-
export async function run(argv) {
|
|
21
|
-
const KNOWN_FLAGS = ['site'];
|
|
22
|
-
const { positional, flags } = parse();
|
|
23
|
-
if (positional.length < 2) {
|
|
24
|
-
fail('Usage: deskwork-resume <project-root> [--site <slug>] <slug>', 2);
|
|
25
|
-
}
|
|
26
|
-
const [rootArg, slug] = positional;
|
|
27
|
-
const projectRoot = absolutize(rootArg);
|
|
28
|
-
let config;
|
|
29
|
-
try {
|
|
30
|
-
config = readConfig(projectRoot);
|
|
31
|
-
}
|
|
32
|
-
catch (err) {
|
|
33
|
-
fail(err instanceof Error ? err.message : String(err));
|
|
34
|
-
}
|
|
35
|
-
const site = resolveSite(config, flags.site);
|
|
36
|
-
const calendarPath = resolveCalendarPath(projectRoot, config, site);
|
|
37
|
-
const calendar = readCalendar(calendarPath);
|
|
38
|
-
const existing = findEntry(calendar, slug);
|
|
39
|
-
if (!existing) {
|
|
40
|
-
const paused = calendar.entries
|
|
41
|
-
.filter((e) => e.stage === 'Paused')
|
|
42
|
-
.map((e) => e.slug)
|
|
43
|
-
.join(', ') || '(none)';
|
|
44
|
-
fail(`No calendar entry found with slug "${slug}". Paused entries: ${paused}`);
|
|
45
|
-
}
|
|
46
|
-
let resumed;
|
|
47
|
-
try {
|
|
48
|
-
resumed = unpauseEntry(calendar, slug);
|
|
49
|
-
}
|
|
50
|
-
catch (err) {
|
|
51
|
-
fail(err instanceof Error ? err.message : String(err));
|
|
52
|
-
}
|
|
53
|
-
writeCalendar(calendarPath, calendar);
|
|
54
|
-
emit({
|
|
55
|
-
slug: resumed.slug,
|
|
56
|
-
title: resumed.title,
|
|
57
|
-
stage: resumed.stage,
|
|
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=resume.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resume.js","sourceRoot":"","sources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C;QAC5D,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* deskwork-review-cancel — mark a review workflow as cancelled.
|
|
3
|
-
*
|
|
4
|
-
* Cancellation is a terminal state: the journal retains the workflow for
|
|
5
|
-
* audit but it no longer appears in listOpen. Use when a draft is
|
|
6
|
-
* abandoned, a workflow was enqueued by mistake, or a review has
|
|
7
|
-
* been superseded.
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
* deskwork-review-cancel <project-root> [--site <slug>] <slug>
|
|
11
|
-
* deskwork-review-cancel <project-root> [--site <slug>] <slug> --platform <p> [--channel <c>]
|
|
12
|
-
* deskwork-review-cancel <project-root> [--kind outline] <slug>
|
|
13
|
-
*/
|
|
14
|
-
export declare function run(argv: string[]): Promise<void>;
|
|
15
|
-
//# sourceMappingURL=review-cancel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"review-cancel.d.ts","sourceRoot":"","sources":["../../src/commands/review-cancel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAUH,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsFvD"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* deskwork-review-cancel — mark a review workflow as cancelled.
|
|
3
|
-
*
|
|
4
|
-
* Cancellation is a terminal state: the journal retains the workflow for
|
|
5
|
-
* audit but it no longer appears in listOpen. Use when a draft is
|
|
6
|
-
* abandoned, a workflow was enqueued by mistake, or a review has
|
|
7
|
-
* been superseded.
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
* deskwork-review-cancel <project-root> [--site <slug>] <slug>
|
|
11
|
-
* deskwork-review-cancel <project-root> [--site <slug>] <slug> --platform <p> [--channel <c>]
|
|
12
|
-
* deskwork-review-cancel <project-root> [--kind outline] <slug>
|
|
13
|
-
*/
|
|
14
|
-
import { readConfig } from '@deskwork/core/config';
|
|
15
|
-
import { resolveSite } from '@deskwork/core/paths';
|
|
16
|
-
import { handleGetWorkflow } from '@deskwork/core/review/handlers';
|
|
17
|
-
import { transitionState } from '@deskwork/core/review/pipeline';
|
|
18
|
-
import { isPlatform } from '@deskwork/core/types';
|
|
19
|
-
import { absolutize, emit, fail, parseArgs } from '@deskwork/core/cli-args';
|
|
20
|
-
export async function run(argv) {
|
|
21
|
-
const KNOWN_FLAGS = ['site', 'platform', 'channel', 'kind'];
|
|
22
|
-
const { positional, flags } = parse();
|
|
23
|
-
if (positional.length < 2) {
|
|
24
|
-
fail('Usage: deskwork-review-cancel <project-root> [--site <slug>] ' +
|
|
25
|
-
'[--platform <p>] [--channel <c>] [--kind longform|outline|shortform] <slug>', 2);
|
|
26
|
-
}
|
|
27
|
-
const [rootArg, slug] = positional;
|
|
28
|
-
const projectRoot = absolutize(rootArg);
|
|
29
|
-
if (flags.platform !== undefined && !isPlatform(flags.platform)) {
|
|
30
|
-
fail(`Invalid --platform "${flags.platform}".`);
|
|
31
|
-
}
|
|
32
|
-
let config;
|
|
33
|
-
try {
|
|
34
|
-
config = readConfig(projectRoot);
|
|
35
|
-
}
|
|
36
|
-
catch (err) {
|
|
37
|
-
fail(err instanceof Error ? err.message : String(err));
|
|
38
|
-
}
|
|
39
|
-
const site = resolveSite(config, flags.site);
|
|
40
|
-
const contentKind = flags.kind ?? (flags.platform ? 'shortform' : 'longform');
|
|
41
|
-
if (!['longform', 'shortform', 'outline'].includes(contentKind)) {
|
|
42
|
-
fail(`Invalid --kind "${contentKind}".`);
|
|
43
|
-
}
|
|
44
|
-
const fetched = handleGetWorkflow(projectRoot, config, {
|
|
45
|
-
id: null,
|
|
46
|
-
site,
|
|
47
|
-
slug,
|
|
48
|
-
contentKind,
|
|
49
|
-
platform: flags.platform ?? null,
|
|
50
|
-
channel: flags.channel ?? null,
|
|
51
|
-
});
|
|
52
|
-
if (fetched.status !== 200 || !isWorkflowBody(fetched.body)) {
|
|
53
|
-
fail(`no ${contentKind} workflow for ${site}/${slug}: ${errorMessage(fetched.body)}`);
|
|
54
|
-
}
|
|
55
|
-
const workflow = fetched.body.workflow;
|
|
56
|
-
if (workflow.state === 'applied' || workflow.state === 'cancelled') {
|
|
57
|
-
fail(`Workflow ${workflow.id} is in terminal state '${workflow.state}' — already resolved, nothing to cancel.`);
|
|
58
|
-
}
|
|
59
|
-
const updated = transitionState(projectRoot, config, workflow.id, 'cancelled');
|
|
60
|
-
emit({
|
|
61
|
-
workflowId: updated.id,
|
|
62
|
-
site: updated.site,
|
|
63
|
-
slug: updated.slug,
|
|
64
|
-
contentKind: updated.contentKind,
|
|
65
|
-
state: updated.state,
|
|
66
|
-
previousState: workflow.state,
|
|
67
|
-
});
|
|
68
|
-
function isWorkflowBody(body) {
|
|
69
|
-
return typeof body === 'object' && body !== null && 'workflow' in body;
|
|
70
|
-
}
|
|
71
|
-
function errorMessage(body) {
|
|
72
|
-
if (typeof body === 'object' && body !== null) {
|
|
73
|
-
const value = Reflect.get(body, 'error');
|
|
74
|
-
if (typeof value === 'string')
|
|
75
|
-
return value;
|
|
76
|
-
}
|
|
77
|
-
return 'unknown error';
|
|
78
|
-
}
|
|
79
|
-
function parse() {
|
|
80
|
-
try {
|
|
81
|
-
return parseArgs(argv, KNOWN_FLAGS);
|
|
82
|
-
}
|
|
83
|
-
catch (err) {
|
|
84
|
-
fail(err instanceof Error ? err.message : String(err), 2);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=review-cancel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"review-cancel.js","sourceRoot":"","sources":["../../src/commands/review-cancel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,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CAAC,IAAI;QAClB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,aAAa,EAAE,QAAQ,CAAC,KAAK;KAC9B,CAAC,CAAC;IAEH,SAAS,cAAc,CAAC,IAAa;QACnC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,UAAU,IAAI,IAAI,CAAC;IACzE,CAAC;IAED,SAAS,YAAY,CAAC,IAAa;QACjC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAC9C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACzC,IAAI,OAAO,KAAK,KAAK,QAAQ;gBAAE,OAAO,KAAK,CAAC;QAC9C,CAAC;QACD,OAAO,eAAe,CAAC;IACzB,CAAC;IAED,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"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* deskwork-review-help — list open review workflows.
|
|
3
|
-
*
|
|
4
|
-
* Reports every non-terminal workflow with its site, slug, state,
|
|
5
|
-
* current version, and content kind. Useful at session start to see
|
|
6
|
-
* what's in flight across the editorial pipeline.
|
|
7
|
-
*
|
|
8
|
-
* Usage:
|
|
9
|
-
* deskwork-review-help <project-root> [--site <slug>]
|
|
10
|
-
*/
|
|
11
|
-
export declare function run(argv: string[]): Promise<void>;
|
|
12
|
-
//# sourceMappingURL=review-help.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"review-help.d.ts","sourceRoot":"","sources":["../../src/commands/review-help.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA0CvD"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* deskwork-review-help — list open review workflows.
|
|
3
|
-
*
|
|
4
|
-
* Reports every non-terminal workflow with its site, slug, state,
|
|
5
|
-
* current version, and content kind. Useful at session start to see
|
|
6
|
-
* what's in flight across the editorial pipeline.
|
|
7
|
-
*
|
|
8
|
-
* Usage:
|
|
9
|
-
* deskwork-review-help <project-root> [--site <slug>]
|
|
10
|
-
*/
|
|
11
|
-
import { readConfig } from '@deskwork/core/config';
|
|
12
|
-
import { listOpen } from '@deskwork/core/review/pipeline';
|
|
13
|
-
import { absolutize, emit, fail, parseArgs } from '@deskwork/core/cli-args';
|
|
14
|
-
export async function run(argv) {
|
|
15
|
-
const KNOWN_FLAGS = ['site'];
|
|
16
|
-
const { positional, flags } = parse();
|
|
17
|
-
if (positional.length < 1) {
|
|
18
|
-
fail('Usage: deskwork-review-help <project-root> [--site <slug>]', 2);
|
|
19
|
-
}
|
|
20
|
-
const projectRoot = absolutize(positional[0]);
|
|
21
|
-
let config;
|
|
22
|
-
try {
|
|
23
|
-
config = readConfig(projectRoot);
|
|
24
|
-
}
|
|
25
|
-
catch (err) {
|
|
26
|
-
fail(err instanceof Error ? err.message : String(err));
|
|
27
|
-
}
|
|
28
|
-
const open = listOpen(projectRoot, config, flags.site);
|
|
29
|
-
emit({
|
|
30
|
-
count: open.length,
|
|
31
|
-
workflows: open.map((w) => ({
|
|
32
|
-
id: w.id,
|
|
33
|
-
site: w.site,
|
|
34
|
-
slug: w.slug,
|
|
35
|
-
contentKind: w.contentKind,
|
|
36
|
-
state: w.state,
|
|
37
|
-
version: w.currentVersion,
|
|
38
|
-
updatedAt: w.updatedAt,
|
|
39
|
-
platform: w.platform,
|
|
40
|
-
channel: w.channel,
|
|
41
|
-
})),
|
|
42
|
-
});
|
|
43
|
-
function parse() {
|
|
44
|
-
try {
|
|
45
|
-
return parseArgs(argv, KNOWN_FLAGS);
|
|
46
|
-
}
|
|
47
|
-
catch (err) {
|
|
48
|
-
fail(err instanceof Error ? err.message : String(err), 2);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=review-help.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"review-help.js","sourceRoot":"","sources":["../../src/commands/review-help.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,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,CAAU,CAAC;IAEtC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC;IAEtC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,IAAI,CAAC,4DAA4D,EAAE,CAAC,CAAC,CAAC;IACxE,CAAC;IAED,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAE9C,IAAI,MAAM,CAAC;IACX,IAAI,CAAC;QACH,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAEvD,IAAI,CAAC;QACH,KAAK,EAAE,IAAI,CAAC,MAAM;QAClB,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC1B,EAAE,EAAE,CAAC,CAAC,EAAE;YACR,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,OAAO,EAAE,CAAC,CAAC,cAAc;YACzB,SAAS,EAAE,CAAC,CAAC,SAAS;YACtB,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,OAAO,EAAE,CAAC,CAAC,OAAO;SACnB,CAAC,CAAC;KACJ,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"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* deskwork-review-report — voice-drift signal across completed reviews.
|
|
3
|
-
*
|
|
4
|
-
* Builds the report from the review journal. By default includes only
|
|
5
|
-
* terminal workflows (applied or cancelled) — in-flight workflows don't
|
|
6
|
-
* represent settled signal yet.
|
|
7
|
-
*
|
|
8
|
-
* Usage:
|
|
9
|
-
* deskwork-review-report <project-root> [--site <slug>] [--include-active]
|
|
10
|
-
* deskwork-review-report <project-root> --format text
|
|
11
|
-
*/
|
|
12
|
-
export declare function run(argv: string[]): Promise<void>;
|
|
13
|
-
//# sourceMappingURL=review-report.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"review-report.d.ts","sourceRoot":"","sources":["../../src/commands/review-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA4CvD"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* deskwork-review-report — voice-drift signal across completed reviews.
|
|
3
|
-
*
|
|
4
|
-
* Builds the report from the review journal. By default includes only
|
|
5
|
-
* terminal workflows (applied or cancelled) — in-flight workflows don't
|
|
6
|
-
* represent settled signal yet.
|
|
7
|
-
*
|
|
8
|
-
* Usage:
|
|
9
|
-
* deskwork-review-report <project-root> [--site <slug>] [--include-active]
|
|
10
|
-
* deskwork-review-report <project-root> --format text
|
|
11
|
-
*/
|
|
12
|
-
import { readConfig } from '@deskwork/core/config';
|
|
13
|
-
import { buildReport, renderReport } from '@deskwork/core/review/report';
|
|
14
|
-
import { absolutize, emit, fail, parseArgs } from '@deskwork/core/cli-args';
|
|
15
|
-
export async function run(argv) {
|
|
16
|
-
const KNOWN_FLAGS = ['site', 'format'];
|
|
17
|
-
const BOOLEAN_FLAGS = ['include-active'];
|
|
18
|
-
const { positional, flags, booleans } = parse();
|
|
19
|
-
if (positional.length < 1) {
|
|
20
|
-
fail('Usage: deskwork-review-report <project-root> [--site <slug>] [--include-active] [--format text|json]', 2);
|
|
21
|
-
}
|
|
22
|
-
const projectRoot = absolutize(positional[0]);
|
|
23
|
-
const format = flags.format ?? 'json';
|
|
24
|
-
if (format !== 'json' && format !== 'text') {
|
|
25
|
-
fail(`Invalid --format "${flags.format}". Must be "json" or "text".`);
|
|
26
|
-
}
|
|
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 report = buildReport(projectRoot, config, {
|
|
35
|
-
terminalOnly: !booleans.has('include-active'),
|
|
36
|
-
...(flags.site !== undefined ? { site: flags.site } : {}),
|
|
37
|
-
});
|
|
38
|
-
if (format === 'text') {
|
|
39
|
-
process.stdout.write(renderReport(report) + '\n');
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
emit(report);
|
|
43
|
-
}
|
|
44
|
-
function parse() {
|
|
45
|
-
try {
|
|
46
|
-
return parseArgs(argv, KNOWN_FLAGS, BOOLEAN_FLAGS);
|
|
47
|
-
}
|
|
48
|
-
catch (err) {
|
|
49
|
-
fail(err instanceof Error ? err.message : String(err), 2);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=review-report.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"review-report.js","sourceRoot":"","sources":["../../src/commands/review-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACzE,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,CAAU,CAAC;IAChD,MAAM,aAAa,GAAG,CAAC,gBAAgB,CAAU,CAAC;IAElD,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,CAAC;IAEhD,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,E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AE,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"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* deskwork-review-start — enqueue a longform draft for review.
|
|
3
|
-
*
|
|
4
|
-
* Reads the blog markdown from disk (honoring the site's
|
|
5
|
-
* blogFilenameTemplate) and creates a longform review workflow in state
|
|
6
|
-
* `open`. Idempotent on (site, slug, contentKind='longform'): if a
|
|
7
|
-
* non-terminal workflow already matches, the existing one is returned.
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
* deskwork-review-start <project-root> [--site <slug>] <slug>
|
|
11
|
-
*
|
|
12
|
-
* Emits a JSON result with the workflow id, the `existing` flag, and a
|
|
13
|
-
* report of any divergence between disk and the workflow's current
|
|
14
|
-
* version (agent iterate work mid-flight).
|
|
15
|
-
*/
|
|
16
|
-
export declare function run(argv: string[]): Promise<void>;
|
|
17
|
-
//# sourceMappingURL=review-start.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"review-start.d.ts","sourceRoot":"","sources":["../../src/commands/review-start.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAeH,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA6GvD"}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* deskwork-review-start — enqueue a longform draft for review.
|
|
3
|
-
*
|
|
4
|
-
* Reads the blog markdown from disk (honoring the site's
|
|
5
|
-
* blogFilenameTemplate) and creates a longform review workflow in state
|
|
6
|
-
* `open`. Idempotent on (site, slug, contentKind='longform'): if a
|
|
7
|
-
* non-terminal workflow already matches, the existing one is returned.
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
* deskwork-review-start <project-root> [--site <slug>] <slug>
|
|
11
|
-
*
|
|
12
|
-
* Emits a JSON result with the workflow id, the `existing` flag, and a
|
|
13
|
-
* report of any divergence between disk and the workflow's current
|
|
14
|
-
* version (agent iterate work mid-flight).
|
|
15
|
-
*/
|
|
16
|
-
import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
17
|
-
import { dirname } from 'node:path';
|
|
18
|
-
import { readConfig } from '@deskwork/core/config';
|
|
19
|
-
import { resolveSite, resolveCalendarPath, resolveEntryFilePath, } from '@deskwork/core/paths';
|
|
20
|
-
import { readCalendar } from '@deskwork/core/calendar';
|
|
21
|
-
import { createWorkflow, readVersions } from '@deskwork/core/review/pipeline';
|
|
22
|
-
import { bodyState } from '@deskwork/core/body-state';
|
|
23
|
-
import { absolutize, emit, fail, parseArgs } from '@deskwork/core/cli-args';
|
|
24
|
-
export async function run(argv) {
|
|
25
|
-
const KNOWN_FLAGS = ['site'];
|
|
26
|
-
const SLUG_RE = /^[a-z0-9][a-z0-9-]*(\/[a-z0-9][a-z0-9-]*)*$/;
|
|
27
|
-
const { positional, flags } = parse();
|
|
28
|
-
if (positional.length < 2) {
|
|
29
|
-
fail('Usage: deskwork-review-start <project-root> [--site <slug>] <slug>', 2);
|
|
30
|
-
}
|
|
31
|
-
const [rootArg, slug] = positional;
|
|
32
|
-
const projectRoot = absolutize(rootArg);
|
|
33
|
-
if (!SLUG_RE.test(slug)) {
|
|
34
|
-
fail(`invalid slug: ${slug} (must match ${SLUG_RE})`);
|
|
35
|
-
}
|
|
36
|
-
let config;
|
|
37
|
-
try {
|
|
38
|
-
config = readConfig(projectRoot);
|
|
39
|
-
}
|
|
40
|
-
catch (err) {
|
|
41
|
-
fail(err instanceof Error ? err.message : String(err));
|
|
42
|
-
}
|
|
43
|
-
const site = resolveSite(config, flags.site);
|
|
44
|
-
// Resolve entryId from the calendar BEFORE picking a file path. The
|
|
45
|
-
// entry id is what survives slug renames; the workflow records it,
|
|
46
|
-
// and the path resolver prefers the UUID-bound file to the slug
|
|
47
|
-
// template (Issue #67).
|
|
48
|
-
let entryId;
|
|
49
|
-
try {
|
|
50
|
-
const calendarPath = resolveCalendarPath(projectRoot, config, site);
|
|
51
|
-
if (existsSync(calendarPath)) {
|
|
52
|
-
const cal = readCalendar(calendarPath);
|
|
53
|
-
entryId = cal.entries.find((e) => e.slug === slug)?.id;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
catch {
|
|
57
|
-
entryId = undefined;
|
|
58
|
-
}
|
|
59
|
-
const file = resolveEntryFilePath(projectRoot, config, site, slug, entryId);
|
|
60
|
-
if (!existsSync(file)) {
|
|
61
|
-
const siblings = listSiblingSlugs(file);
|
|
62
|
-
const list = siblings.length > 0 ? siblings.join(', ') : '(none)';
|
|
63
|
-
fail(`No blog markdown at ${file}.\n` +
|
|
64
|
-
`Existing slugs on ${site}: ${list}.\n` +
|
|
65
|
-
`Run /deskwork:outline <slug> (or /deskwork:draft) to scaffold it first.`);
|
|
66
|
-
}
|
|
67
|
-
const initialMarkdown = readFileSync(file, 'utf8');
|
|
68
|
-
const body = bodyState(file);
|
|
69
|
-
// createWorkflow is idempotent. Capture `before` to detect whether a
|
|
70
|
-
// fresh workflow was created vs an existing one matched.
|
|
71
|
-
const before = Date.now();
|
|
72
|
-
const workflow = createWorkflow(projectRoot, config, {
|
|
73
|
-
site,
|
|
74
|
-
slug,
|
|
75
|
-
...(entryId !== undefined && entryId !== '' ? { entryId } : {}),
|
|
76
|
-
contentKind: 'longform',
|
|
77
|
-
initialMarkdown,
|
|
78
|
-
initialOriginatedBy: 'agent',
|
|
79
|
-
});
|
|
80
|
-
const fresh = Date.parse(workflow.createdAt) >= before;
|
|
81
|
-
// SSOT check: if disk differs from the workflow's current version, report
|
|
82
|
-
// — do NOT auto-commit (the iterate flow handles its own snapshot).
|
|
83
|
-
let divergence = null;
|
|
84
|
-
if (!fresh) {
|
|
85
|
-
const versions = readVersions(projectRoot, config, workflow.id);
|
|
86
|
-
const current = versions.find((v) => v.version === workflow.currentVersion);
|
|
87
|
-
if (current && current.markdown !== initialMarkdown) {
|
|
88
|
-
divergence = {
|
|
89
|
-
diskLen: initialMarkdown.length,
|
|
90
|
-
versionLen: current.markdown.length,
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
emit({
|
|
95
|
-
workflowId: workflow.id,
|
|
96
|
-
site: workflow.site,
|
|
97
|
-
slug: workflow.slug,
|
|
98
|
-
state: workflow.state,
|
|
99
|
-
version: workflow.currentVersion,
|
|
100
|
-
fresh,
|
|
101
|
-
bodyState: body,
|
|
102
|
-
divergence,
|
|
103
|
-
});
|
|
104
|
-
function parse() {
|
|
105
|
-
try {
|
|
106
|
-
return parseArgs(argv, KNOWN_FLAGS);
|
|
107
|
-
}
|
|
108
|
-
catch (err) {
|
|
109
|
-
fail(err instanceof Error ? err.message : String(err), 2);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
function listSiblingSlugs(blogFile) {
|
|
113
|
-
const dir = dirname(blogFile);
|
|
114
|
-
if (!existsSync(dir))
|
|
115
|
-
return [];
|
|
116
|
-
return readdirSync(dir)
|
|
117
|
-
.filter((name) => name.endsWith('.md'))
|
|
118
|
-
.map((name) => name.replace(/\.md$/, ''));
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
//# sourceMappingURL=review-start.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"review-start.js","sourceRoot":"","sources":["../../src/commands/review-start.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EACL,WAAW,EACX,mBAAmB,EAC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