@deskwork/studio 0.10.2 → 0.11.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/dist/lib/editorial-skills-catalogue.d.ts +15 -1
- package/dist/lib/editorial-skills-catalogue.d.ts.map +1 -1
- package/dist/lib/editorial-skills-catalogue.js +66 -59
- package/dist/lib/editorial-skills-catalogue.js.map +1 -1
- package/dist/lib/entry-resolver.d.ts +22 -0
- package/dist/lib/entry-resolver.d.ts.map +1 -0
- package/dist/lib/entry-resolver.js +42 -0
- package/dist/lib/entry-resolver.js.map +1 -0
- package/dist/lib/stage-affordances.d.ts +31 -0
- package/dist/lib/stage-affordances.d.ts.map +1 -0
- package/dist/lib/stage-affordances.js +37 -0
- package/dist/lib/stage-affordances.js.map +1 -0
- package/dist/pages/dashboard/affordances.d.ts +41 -0
- package/dist/pages/dashboard/affordances.d.ts.map +1 -0
- package/dist/pages/dashboard/affordances.js +87 -0
- package/dist/pages/dashboard/affordances.js.map +1 -0
- package/dist/pages/dashboard/affordances.ts +95 -0
- package/dist/pages/dashboard/data.d.ts +24 -0
- package/dist/pages/dashboard/data.d.ts.map +1 -0
- package/dist/pages/dashboard/data.js +49 -0
- package/dist/pages/dashboard/data.js.map +1 -0
- package/dist/pages/dashboard/data.ts +56 -0
- package/dist/pages/dashboard/header.d.ts +13 -0
- package/dist/pages/dashboard/header.d.ts.map +1 -0
- package/dist/pages/dashboard/header.js +70 -0
- package/dist/pages/dashboard/header.js.map +1 -0
- package/dist/pages/dashboard/header.ts +80 -0
- package/dist/pages/dashboard/section.d.ts +37 -0
- package/dist/pages/dashboard/section.d.ts.map +1 -0
- package/dist/pages/dashboard/section.js +117 -0
- package/dist/pages/dashboard/section.js.map +1 -0
- package/dist/pages/dashboard/section.ts +132 -0
- package/dist/pages/dashboard.d.ts +30 -21
- package/dist/pages/dashboard.d.ts.map +1 -1
- package/dist/pages/dashboard.js +34 -799
- package/dist/pages/dashboard.js.map +1 -1
- package/dist/pages/dashboard.ts +44 -980
- package/dist/pages/entry-review.d.ts +25 -0
- package/dist/pages/entry-review.d.ts.map +1 -0
- package/dist/pages/entry-review.js +148 -0
- package/dist/pages/entry-review.js.map +1 -0
- package/dist/pages/entry-review.ts +185 -0
- package/dist/pages/help.d.ts +10 -5
- package/dist/pages/help.d.ts.map +1 -1
- package/dist/pages/help.js +113 -99
- package/dist/pages/help.js.map +1 -1
- package/dist/pages/help.ts +113 -99
- package/dist/pages/index.d.ts +13 -1
- package/dist/pages/index.d.ts.map +1 -1
- package/dist/pages/index.js +39 -24
- package/dist/pages/index.js.map +1 -1
- package/dist/pages/index.ts +43 -27
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +23 -3
- package/dist/server.js.map +1 -1
- package/package.json +4 -4
|
@@ -11,6 +11,15 @@
|
|
|
11
11
|
* - mechanical → proof blue — state transition, disk write, no writing
|
|
12
12
|
* - readonly → faded ink — reports, audits, listings
|
|
13
13
|
* - voice → stamp purple — called by other skills, not directly
|
|
14
|
+
*
|
|
15
|
+
* Pipeline-redesign vocabulary (Phase 6, Task 37): the longform skill
|
|
16
|
+
* surface is the universal-verb set — `add`, `iterate`, `approve`,
|
|
17
|
+
* `publish`, `block`, `cancel`, `induct`, `status`, `doctor`. The
|
|
18
|
+
* stage-named skills of the prior model (`plan`, `outline`, `draft`,
|
|
19
|
+
* `pause`, `resume`, `review-start`, `review-cancel`) are retired; the
|
|
20
|
+
* same actions now flow through the universal verbs operating on the
|
|
21
|
+
* entry's current stage. Shortform + distribution skills still use the
|
|
22
|
+
* workflow-object model and keep their per-track names.
|
|
14
23
|
*/
|
|
15
24
|
export type SkillKind = 'cognitive' | 'mechanical' | 'readonly' | 'voice';
|
|
16
25
|
export interface Skill {
|
|
@@ -24,9 +33,14 @@ export interface Skill {
|
|
|
24
33
|
/** Display label per kind. Used by the help-page specimen stamps. */
|
|
25
34
|
export declare const KIND_LABEL: Readonly<Record<SkillKind, string>>;
|
|
26
35
|
/**
|
|
27
|
-
* The
|
|
36
|
+
* The editorial skills that ship with this repository, in the order
|
|
28
37
|
* they appear in `.claude/skills/` (alphabetical). Voice skills belong
|
|
29
38
|
* at the end of any UI listing — see `SKILLS_SORTED` below.
|
|
39
|
+
*
|
|
40
|
+
* `deskwork:iterate` and `deskwork:approve` cover both the entry
|
|
41
|
+
* pipeline (longform, universal verbs) and shortform review
|
|
42
|
+
* workflows; the specimen description names both cases so the
|
|
43
|
+
* catalogue reflects what the operator actually sees on the surface.
|
|
30
44
|
*/
|
|
31
45
|
export declare const SKILLS: readonly Skill[];
|
|
32
46
|
export declare const SKILLS_SORTED: readonly Skill[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorial-skills-catalogue.d.ts","sourceRoot":"","sources":["../../src/lib/editorial-skills-catalogue.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"editorial-skills-catalogue.d.ts","sourceRoot":"","sources":["../../src/lib/editorial-skills-catalogue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,OAAO,CAAC;AAE1E,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qEAAqE;AACrE,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAK1D,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM,EAAE,SAAS,KAAK,EAuKlC,CAAC;AAUF,eAAO,MAAM,aAAa,EAAE,SAAS,KAAK,EAA6B,CAAC"}
|
|
@@ -11,6 +11,15 @@
|
|
|
11
11
|
* - mechanical → proof blue — state transition, disk write, no writing
|
|
12
12
|
* - readonly → faded ink — reports, audits, listings
|
|
13
13
|
* - voice → stamp purple — called by other skills, not directly
|
|
14
|
+
*
|
|
15
|
+
* Pipeline-redesign vocabulary (Phase 6, Task 37): the longform skill
|
|
16
|
+
* surface is the universal-verb set — `add`, `iterate`, `approve`,
|
|
17
|
+
* `publish`, `block`, `cancel`, `induct`, `status`, `doctor`. The
|
|
18
|
+
* stage-named skills of the prior model (`plan`, `outline`, `draft`,
|
|
19
|
+
* `pause`, `resume`, `review-start`, `review-cancel`) are retired; the
|
|
20
|
+
* same actions now flow through the universal verbs operating on the
|
|
21
|
+
* entry's current stage. Shortform + distribution skills still use the
|
|
22
|
+
* workflow-object model and keep their per-track names.
|
|
14
23
|
*/
|
|
15
24
|
/** Display label per kind. Used by the help-page specimen stamps. */
|
|
16
25
|
export const KIND_LABEL = {
|
|
@@ -20,9 +29,14 @@ export const KIND_LABEL = {
|
|
|
20
29
|
voice: 'voice',
|
|
21
30
|
};
|
|
22
31
|
/**
|
|
23
|
-
* The
|
|
32
|
+
* The editorial skills that ship with this repository, in the order
|
|
24
33
|
* they appear in `.claude/skills/` (alphabetical). Voice skills belong
|
|
25
34
|
* at the end of any UI listing — see `SKILLS_SORTED` below.
|
|
35
|
+
*
|
|
36
|
+
* `deskwork:iterate` and `deskwork:approve` cover both the entry
|
|
37
|
+
* pipeline (longform, universal verbs) and shortform review
|
|
38
|
+
* workflows; the specimen description names both cases so the
|
|
39
|
+
* catalogue reflects what the operator actually sees on the surface.
|
|
26
40
|
*/
|
|
27
41
|
export const SKILLS = [
|
|
28
42
|
{
|
|
@@ -34,91 +48,76 @@ export const SKILLS = [
|
|
|
34
48
|
flags: '--site <slug>',
|
|
35
49
|
},
|
|
36
50
|
{
|
|
37
|
-
slug: '
|
|
51
|
+
slug: 'deskwork:status',
|
|
38
52
|
kind: 'readonly',
|
|
39
|
-
desc: 'Calendar status in a compact form —
|
|
53
|
+
desc: 'Calendar status in a compact form — entries grouped by stage, with the next move per row.',
|
|
40
54
|
when: 'Between sessions. Quick roll-call of what is where.',
|
|
41
55
|
changes: 'Nothing. Read-only.',
|
|
42
56
|
flags: '--site <slug>',
|
|
43
57
|
},
|
|
44
58
|
{
|
|
45
|
-
slug: 'deskwork:
|
|
46
|
-
kind: '
|
|
47
|
-
desc: '
|
|
48
|
-
when: '
|
|
49
|
-
changes: '
|
|
59
|
+
slug: 'deskwork:doctor',
|
|
60
|
+
kind: 'readonly',
|
|
61
|
+
desc: 'Run the calendar/sidecar consistency rules and report any drift between sidecar truth and the regenerated calendar.md.',
|
|
62
|
+
when: 'Periodically, or after manual edits to entries on disk.',
|
|
63
|
+
changes: 'Nothing. Read-only — reports drift; repairs are explicit.',
|
|
50
64
|
flags: '--site <slug>',
|
|
51
65
|
},
|
|
52
66
|
{
|
|
53
|
-
slug: 'deskwork:
|
|
54
|
-
kind: 'cognitive',
|
|
55
|
-
desc: 'Promote Ideas → Planned; set target keywords and topic tags.',
|
|
56
|
-
when: 'The idea has matured enough to point at a shape.',
|
|
57
|
-
changes: 'Moves the calendar row; writes keywords onto the entry.',
|
|
58
|
-
flags: '--site <slug> <slug>',
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
slug: 'deskwork:draft',
|
|
62
|
-
kind: 'mechanical',
|
|
63
|
-
desc: 'Scaffold the blog post directory + frontmatter from a Planned entry and advance to Drafting.',
|
|
64
|
-
when: 'Ready to begin writing. Can also be triggered from the studio button.',
|
|
65
|
-
changes: 'Creates src/sites/<site>/content/blog/<slug>.md with frontmatter (state: draft); calendar stage flips to Drafting.',
|
|
66
|
-
flags: '--site <slug> <slug>',
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
slug: 'deskwork:review-start',
|
|
67
|
+
slug: 'deskwork:add',
|
|
70
68
|
kind: 'mechanical',
|
|
71
|
-
desc: '
|
|
72
|
-
when: 'The
|
|
73
|
-
changes: '
|
|
74
|
-
flags: '--site <slug>
|
|
69
|
+
desc: 'Capture a new idea in the Ideas stage. Mints the entry sidecar (uuid + title + content type) and a stub idea.md.',
|
|
70
|
+
when: 'The instant an idea is worth persisting. Pre-commit, not post-draft.',
|
|
71
|
+
changes: 'Writes .deskwork/entries/<uuid>.json and the stage-1 idea.md; calendar.md is regenerated from sidecars.',
|
|
72
|
+
flags: '--site <slug>',
|
|
75
73
|
},
|
|
76
74
|
{
|
|
77
75
|
slug: 'deskwork:iterate',
|
|
78
76
|
kind: 'cognitive',
|
|
79
|
-
desc: '
|
|
80
|
-
when: 'After the operator
|
|
81
|
-
changes: '
|
|
82
|
-
flags: '<workflow-id>
|
|
77
|
+
desc: "Advance the entry's current-stage artifact one revision (entry pipeline) or append a new shortform draft version (shortform review). For entries: reads operator margin notes and writes the next iteration of the stage file (idea.md, plan.md, outline.md, or index.md).",
|
|
78
|
+
when: 'After the operator has left review feedback, or to continue work on the current stage.',
|
|
79
|
+
changes: 'Entry pipeline: writes the next stage-file version, bumps iterationByStage[currentStage], stage unchanged. Shortform: writes a new DraftVersion to the workflow journal, flips iterating → in-review.',
|
|
80
|
+
flags: '<uuid> | <workflow-id> | --site <slug> <slug>',
|
|
83
81
|
},
|
|
84
82
|
{
|
|
85
83
|
slug: 'deskwork:approve',
|
|
86
84
|
kind: 'mechanical',
|
|
87
|
-
desc:
|
|
88
|
-
when: '
|
|
89
|
-
changes: '
|
|
90
|
-
flags: '<workflow-id>',
|
|
85
|
+
desc: "Graduate the entry by exactly one stage (entry pipeline) or apply the approved shortform copy (shortform). Entry pipeline has no “approve but stay” — approve advances Ideas → Planned → Outlining → Drafting → Final → Published.",
|
|
86
|
+
when: 'When the current-stage artifact (or shortform draft) is ready to move on.',
|
|
87
|
+
changes: 'Entry pipeline: updates sidecar stage + history; next-stage artifact is initialised from the just-approved file. Shortform: workflow becomes applied; calendar shortform record is updated.',
|
|
88
|
+
flags: '<uuid> | <workflow-id>',
|
|
91
89
|
},
|
|
92
90
|
{
|
|
93
|
-
slug: 'deskwork:
|
|
91
|
+
slug: 'deskwork:publish',
|
|
94
92
|
kind: 'mechanical',
|
|
95
|
-
desc: '
|
|
96
|
-
when: '
|
|
97
|
-
changes: '
|
|
98
|
-
flags: '<
|
|
93
|
+
desc: 'Mark a Final entry as Published and stamp the publish date. Optionally writes the rendered file to the configured collection path.',
|
|
94
|
+
when: 'After Final is approved and the operator has done the human commit/push for the destination collection.',
|
|
95
|
+
changes: 'Sets stage to Published and stamps datePublished; calendar.md is regenerated.',
|
|
96
|
+
flags: '--site <slug> <uuid>',
|
|
99
97
|
},
|
|
100
98
|
{
|
|
101
|
-
slug: 'deskwork:
|
|
102
|
-
kind: '
|
|
103
|
-
desc: '
|
|
104
|
-
when: '
|
|
105
|
-
changes: '
|
|
99
|
+
slug: 'deskwork:block',
|
|
100
|
+
kind: 'mechanical',
|
|
101
|
+
desc: 'Move an entry off-pipeline as Blocked. Process flag — “resumable later, work paused.” Records priorStage so re-induct knows where to land it.',
|
|
102
|
+
when: 'Work paused for an external reason (waiting on a source, decision, dependency).',
|
|
103
|
+
changes: "Sets stage to Blocked; records priorStage and reason in the sidecar's stageHistory.",
|
|
104
|
+
flags: '<uuid> [--reason <text>]',
|
|
106
105
|
},
|
|
107
106
|
{
|
|
108
|
-
slug: 'deskwork:
|
|
109
|
-
kind: '
|
|
110
|
-
desc: '
|
|
111
|
-
when: '
|
|
112
|
-
changes: '
|
|
113
|
-
flags: '--
|
|
107
|
+
slug: 'deskwork:cancel',
|
|
108
|
+
kind: 'mechanical',
|
|
109
|
+
desc: 'Move an entry off-pipeline as Cancelled. Semantic flag — “intent: abandoned, rare resume.” Distinct from block; records priorStage for the rare re-induct case.',
|
|
110
|
+
when: 'Decision: this entry will not ship. Preserves history without deleting the sidecar.',
|
|
111
|
+
changes: 'Sets stage to Cancelled; records priorStage and reason.',
|
|
112
|
+
flags: '<uuid> [--reason <text>]',
|
|
114
113
|
},
|
|
115
114
|
{
|
|
116
|
-
slug: 'deskwork:
|
|
115
|
+
slug: 'deskwork:induct',
|
|
117
116
|
kind: 'mechanical',
|
|
118
|
-
desc:
|
|
119
|
-
when: '
|
|
120
|
-
changes:
|
|
121
|
-
flags: '
|
|
117
|
+
desc: "Re-admit an entry into the pipeline. Default destinations: Blocked/Cancelled → priorStage; Final → Drafting; any other pipeline stage requires explicit --to. Preserves iterationByStage so the operator picks up where they left off.",
|
|
118
|
+
when: 'Resuming a Blocked/Cancelled entry, or re-opening a Final entry for revision.',
|
|
119
|
+
changes: "Sets stage to the resolved destination; preserves iterationByStage; appends a re-induct event to the sidecar's history.",
|
|
120
|
+
flags: '<uuid> [--to <stage>]',
|
|
122
121
|
},
|
|
123
122
|
{
|
|
124
123
|
slug: 'deskwork:shortform-start',
|
|
@@ -136,6 +135,14 @@ export const SKILLS = [
|
|
|
136
135
|
changes: 'Appends a DistributionRecord to the calendar file.',
|
|
137
136
|
flags: '--site <slug> <slug> <platform> <url>',
|
|
138
137
|
},
|
|
138
|
+
{
|
|
139
|
+
slug: 'deskwork:customize',
|
|
140
|
+
kind: 'mechanical',
|
|
141
|
+
desc: 'Copy a built-in template, prompt, or doctor rule into <projectRoot>/.deskwork/<category>/<name>.ts so it can be customised in-project.',
|
|
142
|
+
when: 'You want to override a default template, prompt, or doctor rule for this project only.',
|
|
143
|
+
changes: 'Writes a new file under .deskwork/{templates,prompts,doctor}/. Subsequent runtime resolution prefers the project copy.',
|
|
144
|
+
flags: '<category> <name>',
|
|
145
|
+
},
|
|
139
146
|
{
|
|
140
147
|
slug: 'editorial-social-review',
|
|
141
148
|
kind: 'readonly',
|
|
@@ -147,7 +154,7 @@ export const SKILLS = [
|
|
|
147
154
|
{
|
|
148
155
|
slug: 'editorial-reddit-sync',
|
|
149
156
|
kind: 'mechanical',
|
|
150
|
-
desc:
|
|
157
|
+
desc: "Pull recent Reddit submissions via the API; upsert DistributionRecords for any that reference the site’s posts or videos.",
|
|
151
158
|
when: 'Reconciling distribution state without re-entering by hand.',
|
|
152
159
|
changes: 'Adds or updates DistributionRecord rows in the calendar.',
|
|
153
160
|
flags: '--site <slug>',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorial-skills-catalogue.js","sourceRoot":"","sources":["../../src/lib/editorial-skills-catalogue.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"editorial-skills-catalogue.js","sourceRoot":"","sources":["../../src/lib/editorial-skills-catalogue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAaH,qEAAqE;AACrE,MAAM,CAAC,MAAM,UAAU,GAAwC;IAC7D,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,WAAW;IACrB,KAAK,EAAE,OAAO;CACf,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,MAAM,GAAqB;IACtC;QACE,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,qEAAqE;QAC3E,IAAI,EAAE,qFAAqF;QAC3F,OAAO,EAAE,qBAAqB;QAC9B,KAAK,EAAE,eAAe;KACvB;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,2FAA2F;QACjG,IAAI,EAAE,qDAAqD;QAC3D,OAAO,EAAE,qBAAqB;QAC9B,KAAK,EAAE,eAAe;KACvB;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,wHAAwH;QAC9H,IAAI,EAAE,yDAAyD;QAC/D,OAAO,EAAE,2DAA2D;QACpE,KAAK,EAAE,eAAe;KACvB;IACD;QACE,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,kHAAkH;QACxH,IAAI,EAAE,sEAAsE;QAC5E,OAAO,EAAE,yGAAyG;QAClH,KAAK,EAAE,eAAe;KACvB;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,IAAI,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eAAe;KACvB;IACD;QACE,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,wGAAwG;QAC9G,IAAI,EAAE,yHAAyH;QAC/H,OAAO,EAAE,gDAAgD;KAC1D;IACD;QACE,IAAI,EAAE,wBAAwB;QAC9B,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,oGAAoG;QAC1G,IAAI,EAAE,6GAA6G;QACnH,OAAO,EAAE,gDAAgD;KAC1D;CACF,CAAC;AAEF;;;;;GAKG;AACH,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAChH,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5G,MAAM,CAAC,MAAM,aAAa,GAAqB,CAAC,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve an entry uuid to its sidecar + on-disk artifact body. Studio
|
|
3
|
+
* handlers use this when they need both metadata (from the sidecar) and
|
|
4
|
+
* the live document content (from the markdown artifact on disk).
|
|
5
|
+
*
|
|
6
|
+
* The artifact path depends on stage: scrapbook docs (idea/plan/outline)
|
|
7
|
+
* for early stages, the canonical `index.md` for Drafting / Final /
|
|
8
|
+
* Published. Off-pipeline stages (Blocked / Cancelled) carry their
|
|
9
|
+
* priorStage so the resolver can locate the artifact even when the
|
|
10
|
+
* entry is paused.
|
|
11
|
+
*
|
|
12
|
+
* Pipeline-redesign Task 33 — Phase 6 entry resolver.
|
|
13
|
+
*/
|
|
14
|
+
import type { Entry } from '@deskwork/core/schema/entry';
|
|
15
|
+
interface ResolveResult {
|
|
16
|
+
entry: Entry;
|
|
17
|
+
artifactBody: string;
|
|
18
|
+
artifactPath: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function resolveEntry(projectRoot: string, uuid: string): Promise<ResolveResult>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=entry-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-resolver.d.ts","sourceRoot":"","sources":["../../src/lib/entry-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAE,KAAK,EAAS,MAAM,6BAA6B,CAAC;AAEhE,UAAU,aAAa;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAaD,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAc5F"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve an entry uuid to its sidecar + on-disk artifact body. Studio
|
|
3
|
+
* handlers use this when they need both metadata (from the sidecar) and
|
|
4
|
+
* the live document content (from the markdown artifact on disk).
|
|
5
|
+
*
|
|
6
|
+
* The artifact path depends on stage: scrapbook docs (idea/plan/outline)
|
|
7
|
+
* for early stages, the canonical `index.md` for Drafting / Final /
|
|
8
|
+
* Published. Off-pipeline stages (Blocked / Cancelled) carry their
|
|
9
|
+
* priorStage so the resolver can locate the artifact even when the
|
|
10
|
+
* entry is paused.
|
|
11
|
+
*
|
|
12
|
+
* Pipeline-redesign Task 33 — Phase 6 entry resolver.
|
|
13
|
+
*/
|
|
14
|
+
import { readFile } from 'node:fs/promises';
|
|
15
|
+
import { join } from 'node:path';
|
|
16
|
+
import { readSidecar } from '@deskwork/core/sidecar';
|
|
17
|
+
const STAGE_ARTIFACT = {
|
|
18
|
+
Ideas: (s, d) => join(d, s, 'scrapbook', 'idea.md'),
|
|
19
|
+
Planned: (s, d) => join(d, s, 'scrapbook', 'plan.md'),
|
|
20
|
+
Outlining: (s, d) => join(d, s, 'scrapbook', 'outline.md'),
|
|
21
|
+
Drafting: (s, d) => join(d, s, 'index.md'),
|
|
22
|
+
Final: (s, d) => join(d, s, 'index.md'),
|
|
23
|
+
Published: (s, d) => join(d, s, 'index.md'),
|
|
24
|
+
Blocked: null,
|
|
25
|
+
Cancelled: null,
|
|
26
|
+
};
|
|
27
|
+
export async function resolveEntry(projectRoot, uuid) {
|
|
28
|
+
const entry = await readSidecar(projectRoot, uuid);
|
|
29
|
+
// TODO(pipeline-redesign Phase 6+): read content dir from .deskwork/config.json.
|
|
30
|
+
// Until config plumbing lands, default to `docs/` (matches every test fixture
|
|
31
|
+
// and the canonical layout in the redesign spec).
|
|
32
|
+
const contentDir = join(projectRoot, 'docs');
|
|
33
|
+
const stage = entry.priorStage ?? entry.currentStage;
|
|
34
|
+
const pathFn = STAGE_ARTIFACT[stage];
|
|
35
|
+
if (pathFn === null) {
|
|
36
|
+
throw new Error(`No artifact path for stage ${stage}`);
|
|
37
|
+
}
|
|
38
|
+
const artifactPath = pathFn(entry.slug, contentDir);
|
|
39
|
+
const artifactBody = await readFile(artifactPath, 'utf8');
|
|
40
|
+
return { entry, artifactBody, artifactPath };
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=entry-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-resolver.js","sourceRoot":"","sources":["../../src/lib/entry-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;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I,KAAK,CAAC,YAAY,CAAC;IACrD,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IACrC,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,8BAA8B,KAAK,EAAE,CAAC,CAAC;IACzD,CAAC;IACD,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACpD,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAC1D,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stage-affordance helper for the entry-centric review surface.
|
|
3
|
+
*
|
|
4
|
+
* The eight-stage entry model (pipeline-redesign Task 34) groups stages
|
|
5
|
+
* into three behavior shapes for the review UI:
|
|
6
|
+
*
|
|
7
|
+
* - Pipeline-mutable (Ideas .. Final): the document is being worked on;
|
|
8
|
+
* the review surface offers save/iterate/approve/reject + a
|
|
9
|
+
* historical-stage dropdown so the operator can navigate prior
|
|
10
|
+
* scrapbook docs (idea, plan, outline) for the same entry.
|
|
11
|
+
*
|
|
12
|
+
* - Published: terminal; the artifact is locked. The surface is
|
|
13
|
+
* view-only with a "fork" placeholder for the eventual revise-as-new
|
|
14
|
+
* branch — distinct from re-opening, which is intentionally not a
|
|
15
|
+
* supported transition for Published.
|
|
16
|
+
*
|
|
17
|
+
* - Blocked / Cancelled: off-pipeline. The artifact is paused; the
|
|
18
|
+
* only useful affordance is an "induct-to" stage picker that pulls
|
|
19
|
+
* the entry back into the linear pipeline at the operator's chosen
|
|
20
|
+
* stage.
|
|
21
|
+
*
|
|
22
|
+
* The helper is pure (no I/O, no side-effects) so it's safe to call from
|
|
23
|
+
* route handlers, page renderers, and tests.
|
|
24
|
+
*/
|
|
25
|
+
import type { Entry } from '@deskwork/core/schema/entry';
|
|
26
|
+
export interface Affordances {
|
|
27
|
+
mutable: boolean;
|
|
28
|
+
controls: string[];
|
|
29
|
+
}
|
|
30
|
+
export declare function getAffordances(entry: Entry): Affordances;
|
|
31
|
+
//# sourceMappingURL=stage-affordances.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stage-affordances.d.ts","sourceRoot":"","sources":["../../src/lib/stage-affordances.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAEzD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,WAAW,CAWxD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stage-affordance helper for the entry-centric review surface.
|
|
3
|
+
*
|
|
4
|
+
* The eight-stage entry model (pipeline-redesign Task 34) groups stages
|
|
5
|
+
* into three behavior shapes for the review UI:
|
|
6
|
+
*
|
|
7
|
+
* - Pipeline-mutable (Ideas .. Final): the document is being worked on;
|
|
8
|
+
* the review surface offers save/iterate/approve/reject + a
|
|
9
|
+
* historical-stage dropdown so the operator can navigate prior
|
|
10
|
+
* scrapbook docs (idea, plan, outline) for the same entry.
|
|
11
|
+
*
|
|
12
|
+
* - Published: terminal; the artifact is locked. The surface is
|
|
13
|
+
* view-only with a "fork" placeholder for the eventual revise-as-new
|
|
14
|
+
* branch — distinct from re-opening, which is intentionally not a
|
|
15
|
+
* supported transition for Published.
|
|
16
|
+
*
|
|
17
|
+
* - Blocked / Cancelled: off-pipeline. The artifact is paused; the
|
|
18
|
+
* only useful affordance is an "induct-to" stage picker that pulls
|
|
19
|
+
* the entry back into the linear pipeline at the operator's chosen
|
|
20
|
+
* stage.
|
|
21
|
+
*
|
|
22
|
+
* The helper is pure (no I/O, no side-effects) so it's safe to call from
|
|
23
|
+
* route handlers, page renderers, and tests.
|
|
24
|
+
*/
|
|
25
|
+
export function getAffordances(entry) {
|
|
26
|
+
if (entry.currentStage === 'Published') {
|
|
27
|
+
return { mutable: false, controls: ['view-only', 'fork-placeholder'] };
|
|
28
|
+
}
|
|
29
|
+
if (entry.currentStage === 'Blocked' || entry.currentStage === 'Cancelled') {
|
|
30
|
+
return { mutable: false, controls: ['induct-to'] };
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
mutable: true,
|
|
34
|
+
controls: ['save', 'iterate', 'approve', 'reject', 'historical-stage-dropdown'],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=stage-affordances.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stage-affordances.js","sourceRoot":"","sources":["../../src/lib/stage-affordances.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AASH,MAAM,UAAU,cAAc,CAAC,KAAY;IACzC,IAAI,KAAK,CAAC,YAAY,KAAK,WAAW,EAAE,CAAC;QACvC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,WAAW,EAAE,kBAAkB,CAAC,EAAE,CAAC;IACzE,CAAC;IACD,IAAI,KAAK,CAAC,YAAY,KAAK,SAAS,IAAI,KAAK,CAAC,YAAY,KAAK,WAAW,EAAE,CAAC;QAC3E,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC;IACrD,CAAC;IACD,OAAO;QACL,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,2BAA2B,CAAC;KAChF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-row affordance helpers for the dashboard.
|
|
3
|
+
*
|
|
4
|
+
* Pipeline-redesign Task 34. Buttons are static HTML — they link to
|
|
5
|
+
* the entry's review surface (`/dev/editorial-review/<uuid>`) or
|
|
6
|
+
* carry a `data-copy` payload that the existing studio client copies
|
|
7
|
+
* to the clipboard. No new backend handlers are wired here; the
|
|
8
|
+
* universal-verb skills are the canonical action path.
|
|
9
|
+
*/
|
|
10
|
+
import { type RawHtml } from '../html.ts';
|
|
11
|
+
import type { Entry, ReviewState } from '@deskwork/core/schema/entry';
|
|
12
|
+
/**
|
|
13
|
+
* Render the reviewState badge. When the entry has no reviewState
|
|
14
|
+
* (most pre-review stages), render an em-dash placeholder so the row
|
|
15
|
+
* stays grid-aligned with sibling rows that DO carry a badge.
|
|
16
|
+
*/
|
|
17
|
+
export declare function renderReviewStateBadge(state: ReviewState | undefined): RawHtml;
|
|
18
|
+
/**
|
|
19
|
+
* Iteration count for the entry's current stage. The sidecar's
|
|
20
|
+
* `iterationByStage` records every stage the entry has touched; this
|
|
21
|
+
* surfaces the count for the stage the entry is currently in. Defaults
|
|
22
|
+
* to 0 when the bucket is missing (a brand-new entry on its first tick
|
|
23
|
+
* before any iterate has fired).
|
|
24
|
+
*/
|
|
25
|
+
export declare function iterationForCurrentStage(entry: Entry): number;
|
|
26
|
+
/**
|
|
27
|
+
* Build the per-row action strip. Affordances vary by stage:
|
|
28
|
+
*
|
|
29
|
+
* - Linear pipeline stages (Ideas / Planned / Outlining / Drafting /
|
|
30
|
+
* Final): "open →" link to the review surface, plus an "iterate"
|
|
31
|
+
* copy-CLI button when reviewState is `iterating` and an
|
|
32
|
+
* "approve" copy-CLI button when reviewState is `approved`.
|
|
33
|
+
* - Published: "view →" (read-only review surface).
|
|
34
|
+
* - Blocked / Cancelled: "induct →" copy-CLI to bring the entry back.
|
|
35
|
+
*
|
|
36
|
+
* Each button's behavior is parked behind a `data-copy` attribute so
|
|
37
|
+
* the existing studio client (editorial-studio-client.ts) handles
|
|
38
|
+
* clipboard wiring without new server handlers.
|
|
39
|
+
*/
|
|
40
|
+
export declare function renderRowActions(entry: Entry): RawHtml;
|
|
41
|
+
//# sourceMappingURL=affordances.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affordances.d.ts","sourceRoot":"","sources":["../../../src/pages/dashboard/affordances.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAS,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAQ7E;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,CAK9E;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAE7D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CA4BtD"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-row affordance helpers for the dashboard.
|
|
3
|
+
*
|
|
4
|
+
* Pipeline-redesign Task 34. Buttons are static HTML — they link to
|
|
5
|
+
* the entry's review surface (`/dev/editorial-review/<uuid>`) or
|
|
6
|
+
* carry a `data-copy` payload that the existing studio client copies
|
|
7
|
+
* to the clipboard. No new backend handlers are wired here; the
|
|
8
|
+
* universal-verb skills are the canonical action path.
|
|
9
|
+
*/
|
|
10
|
+
import { html, unsafe } from "../html.js";
|
|
11
|
+
const REVIEW_STATE_LABEL = {
|
|
12
|
+
'in-review': 'in review',
|
|
13
|
+
iterating: 'iterating',
|
|
14
|
+
approved: 'approved',
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Render the reviewState badge. When the entry has no reviewState
|
|
18
|
+
* (most pre-review stages), render an em-dash placeholder so the row
|
|
19
|
+
* stays grid-aligned with sibling rows that DO carry a badge.
|
|
20
|
+
*/
|
|
21
|
+
export function renderReviewStateBadge(state) {
|
|
22
|
+
if (state === undefined) {
|
|
23
|
+
return unsafe('<span class="er-stamp er-stamp-none" data-review-state="none">—</span>');
|
|
24
|
+
}
|
|
25
|
+
return unsafe(html `<span class="er-stamp er-stamp-${state}" data-review-state="${state}">${REVIEW_STATE_LABEL[state]}</span>`);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Iteration count for the entry's current stage. The sidecar's
|
|
29
|
+
* `iterationByStage` records every stage the entry has touched; this
|
|
30
|
+
* surfaces the count for the stage the entry is currently in. Defaults
|
|
31
|
+
* to 0 when the bucket is missing (a brand-new entry on its first tick
|
|
32
|
+
* before any iterate has fired).
|
|
33
|
+
*/
|
|
34
|
+
export function iterationForCurrentStage(entry) {
|
|
35
|
+
return entry.iterationByStage[entry.currentStage] ?? 0;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Build the per-row action strip. Affordances vary by stage:
|
|
39
|
+
*
|
|
40
|
+
* - Linear pipeline stages (Ideas / Planned / Outlining / Drafting /
|
|
41
|
+
* Final): "open →" link to the review surface, plus an "iterate"
|
|
42
|
+
* copy-CLI button when reviewState is `iterating` and an
|
|
43
|
+
* "approve" copy-CLI button when reviewState is `approved`.
|
|
44
|
+
* - Published: "view →" (read-only review surface).
|
|
45
|
+
* - Blocked / Cancelled: "induct →" copy-CLI to bring the entry back.
|
|
46
|
+
*
|
|
47
|
+
* Each button's behavior is parked behind a `data-copy` attribute so
|
|
48
|
+
* the existing studio client (editorial-studio-client.ts) handles
|
|
49
|
+
* clipboard wiring without new server handlers.
|
|
50
|
+
*/
|
|
51
|
+
export function renderRowActions(entry) {
|
|
52
|
+
const buttons = [];
|
|
53
|
+
const stage = entry.currentStage;
|
|
54
|
+
const reviewLink = `/dev/editorial-review/${entry.uuid}`;
|
|
55
|
+
if (isLinearActiveStage(stage)) {
|
|
56
|
+
buttons.push(html `<a class="er-btn er-btn-small" href="${reviewLink}"
|
|
57
|
+
title="open the review surface for ${entry.slug}">open →</a>`);
|
|
58
|
+
if (entry.reviewState === 'iterating') {
|
|
59
|
+
buttons.push(html `<button class="er-btn er-btn-small er-btn-primary er-copy-btn" type="button"
|
|
60
|
+
data-copy="/deskwork:iterate ${entry.slug}"
|
|
61
|
+
title="operator clicked Iterate — run the iterate skill in Claude Code">iterate →</button>`);
|
|
62
|
+
}
|
|
63
|
+
if (entry.reviewState === 'approved') {
|
|
64
|
+
buttons.push(html `<button class="er-btn er-btn-small er-btn-approve er-copy-btn" type="button"
|
|
65
|
+
data-copy="/deskwork:approve ${entry.slug}"
|
|
66
|
+
title="approved — graduate to the next stage">approve →</button>`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else if (stage === 'Published') {
|
|
70
|
+
buttons.push(html `<a class="er-btn er-btn-small" href="${reviewLink}"
|
|
71
|
+
title="read-only review surface for the published entry">view →</a>`);
|
|
72
|
+
}
|
|
73
|
+
else if (stage === 'Blocked' || stage === 'Cancelled') {
|
|
74
|
+
buttons.push(html `<button class="er-btn er-btn-small er-copy-btn" type="button"
|
|
75
|
+
data-copy="/deskwork:induct ${entry.slug}"
|
|
76
|
+
title="bring this entry back into the pipeline">induct →</button>`);
|
|
77
|
+
}
|
|
78
|
+
return unsafe(`<span class="er-calendar-action">${buttons.join('')}</span>`);
|
|
79
|
+
}
|
|
80
|
+
function isLinearActiveStage(stage) {
|
|
81
|
+
return (stage === 'Ideas' ||
|
|
82
|
+
stage === 'Planned' ||
|
|
83
|
+
stage === 'Outlining' ||
|
|
84
|
+
stage === 'Drafting' ||
|
|
85
|
+
stage === 'Final');
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=affordances.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affordances.js","sourceRoot":"","sources":["../../../src/pages/dashboard/affordances.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,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