@workflow-cannon/workspace-kit 0.7.0 → 0.9.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/README.md +5 -4
- package/dist/cli/run-command.d.ts +11 -0
- package/dist/cli/run-command.js +138 -0
- package/dist/cli.js +18 -135
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/module-contract.d.ts +13 -0
- package/dist/core/config-cli.js +4 -4
- package/dist/core/config-metadata.js +199 -5
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.js +6 -0
- package/dist/core/instruction-template-mapper.d.ts +9 -0
- package/dist/core/instruction-template-mapper.js +35 -0
- package/dist/core/lineage-contract.d.ts +1 -1
- package/dist/core/lineage-contract.js +1 -1
- package/dist/core/policy.d.ts +13 -2
- package/dist/core/policy.js +42 -25
- package/dist/core/response-template-contract.d.ts +15 -0
- package/dist/core/response-template-contract.js +10 -0
- package/dist/core/response-template-registry.d.ts +4 -0
- package/dist/core/response-template-registry.js +44 -0
- package/dist/core/response-template-shaping.d.ts +6 -0
- package/dist/core/response-template-shaping.js +128 -0
- package/dist/core/session-policy.d.ts +18 -0
- package/dist/core/session-policy.js +57 -0
- package/dist/core/transcript-completion-hook.d.ts +7 -0
- package/dist/core/transcript-completion-hook.js +128 -0
- package/dist/core/workspace-kit-config.d.ts +2 -1
- package/dist/core/workspace-kit-config.js +19 -23
- package/dist/modules/approvals/index.js +2 -2
- package/dist/modules/documentation/runtime.js +413 -20
- package/dist/modules/improvement/generate-recommendations-runtime.d.ts +7 -0
- package/dist/modules/improvement/generate-recommendations-runtime.js +37 -4
- package/dist/modules/improvement/improvement-state.d.ts +10 -1
- package/dist/modules/improvement/improvement-state.js +36 -7
- package/dist/modules/improvement/index.js +70 -23
- package/dist/modules/improvement/ingest.js +2 -1
- package/dist/modules/improvement/transcript-redaction.d.ts +4 -0
- package/dist/modules/improvement/transcript-redaction.js +10 -0
- package/dist/modules/improvement/transcript-sync-runtime.d.ts +42 -1
- package/dist/modules/improvement/transcript-sync-runtime.js +215 -9
- package/dist/modules/index.d.ts +1 -1
- package/dist/modules/index.js +1 -1
- package/dist/modules/task-engine/index.d.ts +0 -2
- package/dist/modules/task-engine/index.js +4 -78
- package/package.json +6 -2
- package/src/modules/documentation/README.md +39 -0
- package/src/modules/documentation/RULES.md +70 -0
- package/src/modules/documentation/config.md +14 -0
- package/src/modules/documentation/index.ts +120 -0
- package/src/modules/documentation/instructions/document-project.md +44 -0
- package/src/modules/documentation/instructions/documentation-maintainer.md +81 -0
- package/src/modules/documentation/instructions/generate-document.md +44 -0
- package/src/modules/documentation/runtime.ts +870 -0
- package/src/modules/documentation/schemas/documentation-schema.md +54 -0
- package/src/modules/documentation/state.md +8 -0
- package/src/modules/documentation/templates/AGENTS.md +84 -0
- package/src/modules/documentation/templates/ARCHITECTURE.md +71 -0
- package/src/modules/documentation/templates/PRINCIPLES.md +122 -0
- package/src/modules/documentation/templates/RELEASING.md +96 -0
- package/src/modules/documentation/templates/ROADMAP.md +131 -0
- package/src/modules/documentation/templates/SECURITY.md +53 -0
- package/src/modules/documentation/templates/SUPPORT.md +40 -0
- package/src/modules/documentation/templates/TERMS.md +61 -0
- package/src/modules/documentation/templates/runbooks/consumer-cadence.md +55 -0
- package/src/modules/documentation/templates/runbooks/parity-validation-flow.md +68 -0
- package/src/modules/documentation/templates/runbooks/release-channels.md +30 -0
- package/src/modules/documentation/templates/workbooks/phase2-config-policy-workbook.md +42 -0
- package/src/modules/documentation/templates/workbooks/task-engine-workbook.md +42 -0
- package/src/modules/documentation/templates/workbooks/transcript-automation-baseline.md +68 -0
- package/src/modules/documentation/types.ts +51 -0
- package/dist/modules/task-engine/generator.d.ts +0 -3
- package/dist/modules/task-engine/generator.js +0 -118
- package/dist/modules/task-engine/importer.d.ts +0 -8
- package/dist/modules/task-engine/importer.js +0 -163
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs/promises";
|
|
2
|
-
import { TaskEngineError } from "./transitions.js";
|
|
3
|
-
const STATUS_MAP = {
|
|
4
|
-
"[p]": "proposed",
|
|
5
|
-
"[ ]": "ready",
|
|
6
|
-
"[~]": "in_progress",
|
|
7
|
-
"[!]": "blocked",
|
|
8
|
-
"[x]": "completed",
|
|
9
|
-
"[-]": "cancelled"
|
|
10
|
-
};
|
|
11
|
-
function parseTaskId(heading) {
|
|
12
|
-
const match = heading.match(/^###\s+\[[^\]]*\]\s+(T\d+)/);
|
|
13
|
-
return match?.[1] ?? null;
|
|
14
|
-
}
|
|
15
|
-
function parseStatus(heading) {
|
|
16
|
-
for (const [marker, status] of Object.entries(STATUS_MAP)) {
|
|
17
|
-
if (heading.includes(marker))
|
|
18
|
-
return status;
|
|
19
|
-
}
|
|
20
|
-
return "ready";
|
|
21
|
-
}
|
|
22
|
-
function parseTitle(heading) {
|
|
23
|
-
const match = heading.match(/^###\s+\[[^\]]*\]\s+T\d+\s+(.+)/);
|
|
24
|
-
return match?.[1]?.trim() ?? "Untitled";
|
|
25
|
-
}
|
|
26
|
-
function extractField(lines, prefix) {
|
|
27
|
-
for (const line of lines) {
|
|
28
|
-
const trimmed = line.trim();
|
|
29
|
-
if (trimmed.startsWith(prefix)) {
|
|
30
|
-
return trimmed.slice(prefix.length).trim();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
function extractListField(lines, fieldPrefix) {
|
|
36
|
-
const items = [];
|
|
37
|
-
let capturing = false;
|
|
38
|
-
for (const line of lines) {
|
|
39
|
-
const trimmed = line.trim();
|
|
40
|
-
if (trimmed.startsWith(fieldPrefix)) {
|
|
41
|
-
capturing = true;
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
if (capturing) {
|
|
45
|
-
if (/^\s{2,}-\s/.test(line)) {
|
|
46
|
-
items.push(line.replace(/^\s*-\s*/, "").trim());
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
if (trimmed.startsWith("- ")) {
|
|
50
|
-
capturing = false;
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
if (trimmed === "") {
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return items;
|
|
59
|
-
}
|
|
60
|
-
function parseTaskIds(text) {
|
|
61
|
-
if (!text || text.trim() === "none")
|
|
62
|
-
return [];
|
|
63
|
-
const ids = [];
|
|
64
|
-
const matches = text.matchAll(/`?(T\d+)`?/g);
|
|
65
|
-
for (const m of matches) {
|
|
66
|
-
ids.push(m[1]);
|
|
67
|
-
}
|
|
68
|
-
return ids;
|
|
69
|
-
}
|
|
70
|
-
function parsePriority(text) {
|
|
71
|
-
if (!text)
|
|
72
|
-
return undefined;
|
|
73
|
-
const match = text.match(/(P[123])/);
|
|
74
|
-
return match?.[1];
|
|
75
|
-
}
|
|
76
|
-
function parsePhase(sectionHeading) {
|
|
77
|
-
const match = sectionHeading.match(/^##\s+(.+)/);
|
|
78
|
-
return match?.[1]?.trim();
|
|
79
|
-
}
|
|
80
|
-
export async function importTasksFromMarkdown(sourcePath) {
|
|
81
|
-
let content;
|
|
82
|
-
try {
|
|
83
|
-
content = await fs.readFile(sourcePath, "utf8");
|
|
84
|
-
}
|
|
85
|
-
catch (err) {
|
|
86
|
-
throw new TaskEngineError("import-parse-error", `Failed to read TASKS.md: ${err.message}`);
|
|
87
|
-
}
|
|
88
|
-
const lines = content.split("\n");
|
|
89
|
-
const tasks = [];
|
|
90
|
-
const errors = [];
|
|
91
|
-
let skipped = 0;
|
|
92
|
-
let currentPhase;
|
|
93
|
-
const now = new Date().toISOString();
|
|
94
|
-
let taskStartIdx = -1;
|
|
95
|
-
let taskLines = [];
|
|
96
|
-
function flushTask() {
|
|
97
|
-
if (taskStartIdx === -1 || taskLines.length === 0)
|
|
98
|
-
return;
|
|
99
|
-
const heading = taskLines[0];
|
|
100
|
-
const id = parseTaskId(heading);
|
|
101
|
-
if (!id) {
|
|
102
|
-
errors.push(`Line ${taskStartIdx + 1}: Could not parse task ID from heading`);
|
|
103
|
-
skipped++;
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
const status = parseStatus(heading);
|
|
107
|
-
const title = parseTitle(heading);
|
|
108
|
-
const priorityStr = extractField(taskLines, "- Priority:");
|
|
109
|
-
const approach = extractField(taskLines, "- Approach:");
|
|
110
|
-
const dependsOnStr = extractField(taskLines, "- Depends on:");
|
|
111
|
-
const unblocksStr = extractField(taskLines, "- Unblocks:");
|
|
112
|
-
const technicalScope = extractListField(taskLines, "- Technical scope:");
|
|
113
|
-
const acceptanceCriteria = extractListField(taskLines, "- Acceptance criteria:");
|
|
114
|
-
const task = {
|
|
115
|
-
id,
|
|
116
|
-
status,
|
|
117
|
-
type: "workspace-kit",
|
|
118
|
-
title,
|
|
119
|
-
createdAt: now,
|
|
120
|
-
updatedAt: now,
|
|
121
|
-
priority: parsePriority(priorityStr),
|
|
122
|
-
dependsOn: parseTaskIds(dependsOnStr ?? ""),
|
|
123
|
-
unblocks: parseTaskIds(unblocksStr ?? ""),
|
|
124
|
-
phase: currentPhase,
|
|
125
|
-
approach: approach || undefined,
|
|
126
|
-
technicalScope: technicalScope.length > 0 ? technicalScope : undefined,
|
|
127
|
-
acceptanceCriteria: acceptanceCriteria.length > 0 ? acceptanceCriteria : undefined
|
|
128
|
-
};
|
|
129
|
-
tasks.push(task);
|
|
130
|
-
}
|
|
131
|
-
for (let i = 0; i < lines.length; i++) {
|
|
132
|
-
const line = lines[i];
|
|
133
|
-
if (line.startsWith("## ") && !line.startsWith("### ")) {
|
|
134
|
-
flushTask();
|
|
135
|
-
taskStartIdx = -1;
|
|
136
|
-
taskLines = [];
|
|
137
|
-
currentPhase = parsePhase(line);
|
|
138
|
-
continue;
|
|
139
|
-
}
|
|
140
|
-
if (line.startsWith("### ")) {
|
|
141
|
-
flushTask();
|
|
142
|
-
if (parseTaskId(line)) {
|
|
143
|
-
taskStartIdx = i;
|
|
144
|
-
taskLines = [line];
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
taskStartIdx = -1;
|
|
148
|
-
taskLines = [];
|
|
149
|
-
}
|
|
150
|
-
continue;
|
|
151
|
-
}
|
|
152
|
-
if (taskStartIdx !== -1) {
|
|
153
|
-
taskLines.push(line);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
flushTask();
|
|
157
|
-
return {
|
|
158
|
-
imported: tasks.length,
|
|
159
|
-
skipped,
|
|
160
|
-
errors,
|
|
161
|
-
tasks
|
|
162
|
-
};
|
|
163
|
-
}
|