@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.
Files changed (74) hide show
  1. package/README.md +5 -4
  2. package/dist/cli/run-command.d.ts +11 -0
  3. package/dist/cli/run-command.js +138 -0
  4. package/dist/cli.js +18 -135
  5. package/dist/contracts/index.d.ts +1 -1
  6. package/dist/contracts/module-contract.d.ts +13 -0
  7. package/dist/core/config-cli.js +4 -4
  8. package/dist/core/config-metadata.js +199 -5
  9. package/dist/core/index.d.ts +6 -0
  10. package/dist/core/index.js +6 -0
  11. package/dist/core/instruction-template-mapper.d.ts +9 -0
  12. package/dist/core/instruction-template-mapper.js +35 -0
  13. package/dist/core/lineage-contract.d.ts +1 -1
  14. package/dist/core/lineage-contract.js +1 -1
  15. package/dist/core/policy.d.ts +13 -2
  16. package/dist/core/policy.js +42 -25
  17. package/dist/core/response-template-contract.d.ts +15 -0
  18. package/dist/core/response-template-contract.js +10 -0
  19. package/dist/core/response-template-registry.d.ts +4 -0
  20. package/dist/core/response-template-registry.js +44 -0
  21. package/dist/core/response-template-shaping.d.ts +6 -0
  22. package/dist/core/response-template-shaping.js +128 -0
  23. package/dist/core/session-policy.d.ts +18 -0
  24. package/dist/core/session-policy.js +57 -0
  25. package/dist/core/transcript-completion-hook.d.ts +7 -0
  26. package/dist/core/transcript-completion-hook.js +128 -0
  27. package/dist/core/workspace-kit-config.d.ts +2 -1
  28. package/dist/core/workspace-kit-config.js +19 -23
  29. package/dist/modules/approvals/index.js +2 -2
  30. package/dist/modules/documentation/runtime.js +413 -20
  31. package/dist/modules/improvement/generate-recommendations-runtime.d.ts +7 -0
  32. package/dist/modules/improvement/generate-recommendations-runtime.js +37 -4
  33. package/dist/modules/improvement/improvement-state.d.ts +10 -1
  34. package/dist/modules/improvement/improvement-state.js +36 -7
  35. package/dist/modules/improvement/index.js +70 -23
  36. package/dist/modules/improvement/ingest.js +2 -1
  37. package/dist/modules/improvement/transcript-redaction.d.ts +4 -0
  38. package/dist/modules/improvement/transcript-redaction.js +10 -0
  39. package/dist/modules/improvement/transcript-sync-runtime.d.ts +42 -1
  40. package/dist/modules/improvement/transcript-sync-runtime.js +215 -9
  41. package/dist/modules/index.d.ts +1 -1
  42. package/dist/modules/index.js +1 -1
  43. package/dist/modules/task-engine/index.d.ts +0 -2
  44. package/dist/modules/task-engine/index.js +4 -78
  45. package/package.json +6 -2
  46. package/src/modules/documentation/README.md +39 -0
  47. package/src/modules/documentation/RULES.md +70 -0
  48. package/src/modules/documentation/config.md +14 -0
  49. package/src/modules/documentation/index.ts +120 -0
  50. package/src/modules/documentation/instructions/document-project.md +44 -0
  51. package/src/modules/documentation/instructions/documentation-maintainer.md +81 -0
  52. package/src/modules/documentation/instructions/generate-document.md +44 -0
  53. package/src/modules/documentation/runtime.ts +870 -0
  54. package/src/modules/documentation/schemas/documentation-schema.md +54 -0
  55. package/src/modules/documentation/state.md +8 -0
  56. package/src/modules/documentation/templates/AGENTS.md +84 -0
  57. package/src/modules/documentation/templates/ARCHITECTURE.md +71 -0
  58. package/src/modules/documentation/templates/PRINCIPLES.md +122 -0
  59. package/src/modules/documentation/templates/RELEASING.md +96 -0
  60. package/src/modules/documentation/templates/ROADMAP.md +131 -0
  61. package/src/modules/documentation/templates/SECURITY.md +53 -0
  62. package/src/modules/documentation/templates/SUPPORT.md +40 -0
  63. package/src/modules/documentation/templates/TERMS.md +61 -0
  64. package/src/modules/documentation/templates/runbooks/consumer-cadence.md +55 -0
  65. package/src/modules/documentation/templates/runbooks/parity-validation-flow.md +68 -0
  66. package/src/modules/documentation/templates/runbooks/release-channels.md +30 -0
  67. package/src/modules/documentation/templates/workbooks/phase2-config-policy-workbook.md +42 -0
  68. package/src/modules/documentation/templates/workbooks/task-engine-workbook.md +42 -0
  69. package/src/modules/documentation/templates/workbooks/transcript-automation-baseline.md +68 -0
  70. package/src/modules/documentation/types.ts +51 -0
  71. package/dist/modules/task-engine/generator.d.ts +0 -3
  72. package/dist/modules/task-engine/generator.js +0 -118
  73. package/dist/modules/task-engine/importer.d.ts +0 -8
  74. package/dist/modules/task-engine/importer.js +0 -163
@@ -0,0 +1,61 @@
1
+ {{{AI Documentation Directive}}}
2
+
3
+ # Workflow Cannon Terms
4
+
5
+ Project-specific glossary for consistent language across AI-agent guidance, planning, execution, and release workflows.
6
+
7
+ ## How to use this glossary
8
+
9
+ {{{
10
+ Rules for adopting and extending terms.
11
+ Method:
12
+ 1) Read the existing `docs/maintainers/TERMS.md` introduction if present.
13
+ 2) Emphasize operational definitions and single primary source per term.
14
+ Output format:
15
+ - 3-5 bullets.
16
+ Validation:
17
+ - Instruct readers to add terms here before broad adoption in other docs.
18
+ }}}
19
+
20
+ ## Definition surfaces
21
+
22
+ {{{
23
+ List where canonical definitions live vs enforcement surfaces.
24
+ Method:
25
+ 1) Reproduce structure from `docs/maintainers/TERMS.md`: glossary, principles, README/ROADMAP/ARCHITECTURE, TASKS, RELEASING, `.cursor/rules`, `tasks/*.md` as applicable.
26
+ 2) Verify paths exist before listing.
27
+ Output format:
28
+ - Bullet list; each bullet names a surface and its role with **bold** label.
29
+ Validation:
30
+ - Use consistent path formatting; no broken links.
31
+ }}}
32
+
33
+ ## Terms and definitions
34
+
35
+ {{{
36
+ Maintain the glossary entries for this project.
37
+ Method:
38
+ 1) Read the current `docs/maintainers/TERMS.md` term list and preserve entries unless superseded by `docs/maintainers/DECISIONS.md` or explicit renames.
39
+ 2) For each term, keep three sub-bullets aligned under the term:
40
+ - **Definition**: …
41
+ - **Defined in**: path(s)
42
+ - **Enforced in**: path(s) or mechanism
43
+ 3) Add new terms when they appear repeatedly in `.workspace-kit/tasks/state.json`, `ROADMAP.md`, or `.cursor/rules` without definitions.
44
+ 4) Fix indentation so **Definition** / **Defined in** / **Enforced in** are nested under the term bullet, not orphaned.
45
+ Output format:
46
+ - One top-level bullet per term with nested three-line pattern above.
47
+ Validation:
48
+ - Alphabetize or group by theme consistently with the prior file; do not duplicate term names.
49
+ }}}
50
+
51
+ ## Related docs
52
+
53
+ {{{
54
+ Cross-link README, principles, roadmap, tasks, releasing.
55
+ Method:
56
+ 1) Verify paths exist.
57
+ Output format:
58
+ - Bulleted list.
59
+ Validation:
60
+ - Include at least `README.md`, `.ai/PRINCIPLES.md`, `docs/maintainers/ROADMAP.md`, `.workspace-kit/tasks/state.json`, `docs/maintainers/RELEASING.md` when present.
61
+ }}}
@@ -0,0 +1,55 @@
1
+ {{{AI Documentation Directive}}}
2
+
3
+ # Consumer Update Cadence
4
+
5
+ Defines update cadence states for `@workflow-cannon/workspace-kit` consumers and transition validation requirements.
6
+
7
+ ## Cadence states
8
+
9
+ {{{
10
+ Document cadence states and channel intent.
11
+ Method:
12
+ 1) Read `docs/maintainers/runbooks/consumer-cadence.md`.
13
+ 2) Preserve state names and dist-tags.
14
+ Output format:
15
+ - Markdown table with state, meaning, npm dist-tag, and consumer action.
16
+ Validation:
17
+ - State names and tags must match release-channel policy docs.
18
+ }}}
19
+
20
+ ## State transitions
21
+
22
+ {{{
23
+ Describe allowed transition paths and recandidate flow.
24
+ Method:
25
+ 1) Read maintainer cadence runbook.
26
+ 2) Preserve candidate/stable/patch flow semantics.
27
+ Output format:
28
+ - Diagram block or concise bullets.
29
+ Validation:
30
+ - Do not introduce unsupported transition paths.
31
+ }}}
32
+
33
+ ## Required validation per transition
34
+
35
+ {{{
36
+ Capture required checks for each transition path.
37
+ Method:
38
+ 1) Read `docs/maintainers/release-gate-matrix.md` and cadence runbook.
39
+ Output format:
40
+ - Subsections by transition with numbered validation steps.
41
+ Validation:
42
+ - Keep parity and fixture validation requirements explicit.
43
+ }}}
44
+
45
+ ## Related documents
46
+
47
+ {{{
48
+ List gate/release/task references used for cadence decisions.
49
+ Method:
50
+ 1) Use related section from maintainer runbook.
51
+ Output format:
52
+ - Bullets with paths and short purpose.
53
+ Validation:
54
+ - Include only existing files.
55
+ }}}
@@ -0,0 +1,68 @@
1
+ {{{AI Documentation Directive}}}
2
+
3
+ # Parity Validation Flow
4
+
5
+ Canonical ordered command chain for validating packaged-artifact parity in `@workflow-cannon/workspace-kit`.
6
+
7
+ ## Purpose
8
+
9
+ {{{
10
+ State why parity validation exists and when it is required.
11
+ Method:
12
+ 1) Read `docs/maintainers/runbooks/parity-validation-flow.md` and `docs/maintainers/RELEASING.md`.
13
+ 2) Emphasize packaged-artifact truth and release-gate requirement.
14
+ Output format:
15
+ - One short paragraph.
16
+ Validation:
17
+ - Preserve release-gate intent; do not weaken fail-closed language.
18
+ }}}
19
+
20
+ ## Canonical command chain
21
+
22
+ {{{
23
+ Produce the ordered parity command sequence and expected outcomes.
24
+ Method:
25
+ 1) Read `docs/maintainers/runbooks/parity-validation-flow.md`.
26
+ 2) Preserve step ordering and command names exactly.
27
+ Output format:
28
+ - Markdown table: Step | Command | Expected exit | Output artifact | Machine-parseable.
29
+ Validation:
30
+ - Commands must match runnable scripts/paths in repository.
31
+ }}}
32
+
33
+ ## Failure behavior
34
+
35
+ {{{
36
+ Describe hard-failure handling for any non-zero parity step.
37
+ Method:
38
+ 1) Read `scripts/run-parity.mjs` behavior as documented in maintainer runbook.
39
+ Output format:
40
+ - 3-4 bullets.
41
+ Validation:
42
+ - Must indicate stop-on-fail behavior and evidence capture.
43
+ }}}
44
+
45
+ ## Evidence contract
46
+
47
+ {{{
48
+ Document parity evidence location and key fields.
49
+ Method:
50
+ 1) Read `docs/maintainers/runbooks/parity-validation-flow.md`.
51
+ 2) Validate schema reference path.
52
+ Output format:
53
+ - Bullets for location, schema, and key fields.
54
+ Validation:
55
+ - Keep artifact path and schema path exact.
56
+ }}}
57
+
58
+ ## Related documents
59
+
60
+ {{{
61
+ List closely related release and cadence docs.
62
+ Method:
63
+ 1) Read links from maintainer parity runbook.
64
+ Output format:
65
+ - Bulleted paths with short purpose notes.
66
+ Validation:
67
+ - Only include files that exist.
68
+ }}}
@@ -0,0 +1,30 @@
1
+ {{{AI Documentation Directive}}}
2
+
3
+ # Release Channels
4
+
5
+ Operational mapping for `canary`, `stable`, and `lts` channels.
6
+
7
+ ## Channel mapping
8
+
9
+ {{{
10
+ Produce channel to dist-tag/tag/label/compatibility mapping.
11
+ Method:
12
+ 1) Read `docs/maintainers/runbooks/release-channels.md`.
13
+ 2) Read `docs/maintainers/data/compatibility-matrix.json`.
14
+ Output format:
15
+ - Markdown table with channel columns used by maintainer doc.
16
+ Validation:
17
+ - Values must match compatibility matrix source.
18
+ }}}
19
+
20
+ ## Promotion and rollback
21
+
22
+ {{{
23
+ Describe promotion prerequisites and rollback strategy.
24
+ Method:
25
+ 1) Read channel runbook and release gate docs.
26
+ Output format:
27
+ - 3 concise bullets.
28
+ Validation:
29
+ - Preserve forward-fix rollback model (no tag mutation).
30
+ }}}
@@ -0,0 +1,42 @@
1
+ {{{AI Documentation Directive}}}
2
+
3
+ # Phase 2 workbook — config, policy, local task cutover
4
+
5
+ Binding design baseline for configuration and policy behavior in `v0.4.0`.
6
+
7
+ ## Scope and non-goals
8
+
9
+ {{{
10
+ Summarize Phase 2 scope and explicit non-goals.
11
+ Method:
12
+ 1) Read `docs/maintainers/workbooks/phase2-config-policy-workbook.md`.
13
+ 2) Preserve task coverage and non-goal statements.
14
+ Output format:
15
+ - Short scope line + 3-5 non-goal bullets.
16
+ Validation:
17
+ - Keep references aligned to current task-engine state.
18
+ }}}
19
+
20
+ ## Config precedence and merge semantics
21
+
22
+ {{{
23
+ Document layered precedence and merge model.
24
+ Method:
25
+ 1) Extract precedence stack and merge behavior from maintainer workbook.
26
+ Output format:
27
+ - Numbered precedence list and one merge-semantics note.
28
+ Validation:
29
+ - Order must remain exact and deterministic.
30
+ }}}
31
+
32
+ ## Policy and approvals baseline
33
+
34
+ {{{
35
+ Capture sensitive operation gating and approval model.
36
+ Method:
37
+ 1) Read workbook sections for sensitive operations and approvals.
38
+ Output format:
39
+ - Operation table + approval bullets.
40
+ Validation:
41
+ - Preserve fail-closed policy behavior and actor resolution order.
42
+ }}}
@@ -0,0 +1,42 @@
1
+ {{{AI Documentation Directive}}}
2
+
3
+ # Task Engine Schema Workbook
4
+
5
+ Design workbook for Task Engine lifecycle, transitions, persistence, and guard behavior.
6
+
7
+ ## Design decisions
8
+
9
+ {{{
10
+ Capture resolved design decisions and rationale.
11
+ Method:
12
+ 1) Read `docs/maintainers/workbooks/task-engine-workbook.md`.
13
+ 2) Preserve canonical choices for lifecycle, persistence, evidence, and command surfaces.
14
+ Output format:
15
+ - Markdown decision table.
16
+ Validation:
17
+ - Keep decisions consistent with current runtime behavior and tests.
18
+ }}}
19
+
20
+ ## State model and transitions
21
+
22
+ {{{
23
+ Document lifecycle states and transition contract.
24
+ Method:
25
+ 1) Use state/transition sections from maintainer workbook.
26
+ Output format:
27
+ - State list and allowed transition table.
28
+ Validation:
29
+ - Transition rules must match runtime guard behavior.
30
+ }}}
31
+
32
+ ## Persistence and evidence contract
33
+
34
+ {{{
35
+ Describe state store schema and transition evidence requirements.
36
+ Method:
37
+ 1) Read persistence/evidence sections from maintainer workbook.
38
+ Output format:
39
+ - Store schema summary and evidence field bullets.
40
+ Validation:
41
+ - Store path and required evidence fields must match implementation.
42
+ }}}
@@ -0,0 +1,68 @@
1
+ {{{AI Documentation Directive}}}
2
+
3
+ # Transcript Automation Baseline (Phase 5)
4
+
5
+ Canonical design baseline for transcript intelligence automation.
6
+
7
+ ## Scope
8
+
9
+ {{{
10
+ Capture baseline scope and compatibility expectation for follow-on tasks.
11
+ Method:
12
+ 1) Read `docs/maintainers/workbooks/transcript-automation-baseline.md` and `docs/maintainers/ROADMAP.md`.
13
+ 2) Preserve task ranges and compatibility constraints.
14
+ Output format:
15
+ - 2 bullets.
16
+ Validation:
17
+ - Task IDs must match task-engine state and roadmap wording.
18
+ }}}
19
+
20
+ ## Command model
21
+
22
+ {{{
23
+ Describe transcript automation commands and behavioral contract.
24
+ Method:
25
+ 1) Read improvement module docs and maintainer workbook.
26
+ 2) Preserve command names and policy sensitivity.
27
+ Output format:
28
+ - Bullets grouped by command.
29
+ Validation:
30
+ - Command names must exist in module instruction surfaces.
31
+ }}}
32
+
33
+ ## Config and cadence contract
34
+
35
+ {{{
36
+ Document config keys and cadence decision rules.
37
+ Method:
38
+ 1) Read `src/modules/improvement/config.md` and maintainer workbook.
39
+ 2) Preserve default values and skip/generate rules.
40
+ Output format:
41
+ - Key list plus cadence rule bullets.
42
+ Validation:
43
+ - Keys and defaults must match current config metadata.
44
+ }}}
45
+
46
+ ## Safety and observability boundaries
47
+
48
+ {{{
49
+ Summarize privacy/safety constraints and output diagnostics requirements.
50
+ Method:
51
+ 1) Read maintainer workbook and improvement module behavior docs.
52
+ Output format:
53
+ - 4-6 bullets.
54
+ Validation:
55
+ - Keep local-only transcript archive default and policy-gated generation behavior.
56
+ }}}
57
+
58
+ ## Rollout guardrails
59
+
60
+ {{{
61
+ State constraints for future changes to this baseline.
62
+ Method:
63
+ 1) Read roadmap + workbook guardrail language.
64
+ Output format:
65
+ - 2-3 bullets.
66
+ Validation:
67
+ - Require same-change updates for compatibility-impacting baseline changes.
68
+ }}}
@@ -0,0 +1,51 @@
1
+ export type DocumentationGenerateOptions = {
2
+ dryRun?: boolean;
3
+ overwrite?: boolean;
4
+ overwriteAi?: boolean;
5
+ overwriteHuman?: boolean;
6
+ strict?: boolean;
7
+ maxValidationAttempts?: number;
8
+ allowWithoutTemplate?: boolean;
9
+ };
10
+
11
+ export type DocumentationConflict = {
12
+ source: string;
13
+ reason: string;
14
+ severity: "warn" | "stop";
15
+ };
16
+
17
+ export type DocumentationValidationIssue = {
18
+ check: "schema" | "section-coverage" | "template-resolution" | "write-boundary" | "conflict";
19
+ message: string;
20
+ resolved: boolean;
21
+ };
22
+
23
+ export type DocumentationGenerationEvidence = {
24
+ documentType: string;
25
+ filesRead: string[];
26
+ filesWritten: string[];
27
+ filesSkipped: string[];
28
+ validationIssues: DocumentationValidationIssue[];
29
+ conflicts: DocumentationConflict[];
30
+ attemptsUsed: number;
31
+ timestamp: string;
32
+ };
33
+
34
+ export type DocumentationGenerateResult = {
35
+ ok: boolean;
36
+ aiOutputPath?: string;
37
+ humanOutputPath?: string;
38
+ evidence: DocumentationGenerationEvidence;
39
+ };
40
+
41
+ export type DocumentationBatchResult = {
42
+ ok: boolean;
43
+ results: DocumentationGenerateResult[];
44
+ summary: {
45
+ total: number;
46
+ succeeded: number;
47
+ failed: number;
48
+ skipped: number;
49
+ timestamp: string;
50
+ };
51
+ };
@@ -1,3 +0,0 @@
1
- import type { TaskEntity } from "./types.js";
2
- export declare function generateTasksMd(tasks: TaskEntity[]): string;
3
- export declare function syncTaskHeadingsInMarkdown(markdown: string, tasks: TaskEntity[]): string;
@@ -1,118 +0,0 @@
1
- const STATUS_MARKERS = {
2
- proposed: "[p]",
3
- ready: "[ ]",
4
- in_progress: "[~]",
5
- blocked: "[!]",
6
- completed: "[x]",
7
- cancelled: "[-]"
8
- };
9
- function groupByPhase(tasks) {
10
- const groups = new Map();
11
- for (const task of tasks) {
12
- const phase = task.phase ?? "Uncategorized";
13
- const group = groups.get(phase) ?? [];
14
- group.push(task);
15
- groups.set(phase, group);
16
- }
17
- return groups;
18
- }
19
- function buildReadyQueueLine(tasks) {
20
- const ready = tasks
21
- .filter((t) => t.status === "ready")
22
- .sort((a, b) => {
23
- const pa = a.priority ?? "P9";
24
- const pb = b.priority ?? "P9";
25
- return pa.localeCompare(pb);
26
- });
27
- if (ready.length === 0)
28
- return "- Ready queue: _(empty)_";
29
- return `- Ready queue: ${ready.map((t) => `\`${t.id}\``).join(", ")}`;
30
- }
31
- function buildCurrentPhase(tasks) {
32
- const inProgress = tasks.filter((t) => t.status === "in_progress");
33
- const ready = tasks.filter((t) => t.status === "ready");
34
- const active = [...inProgress, ...ready];
35
- if (active.length === 0)
36
- return "- Current phase in execution: _(no active tasks)_";
37
- const phases = [...new Set(active.map((t) => t.phase).filter(Boolean))];
38
- if (phases.length === 0)
39
- return "- Current phase in execution: _(unknown)_";
40
- return `- Current phase in execution: _${phases[0]}_`;
41
- }
42
- function renderTask(task) {
43
- const marker = STATUS_MARKERS[task.status] ?? "[ ]";
44
- const lines = [];
45
- lines.push(`### ${marker} ${task.id} ${task.title}`);
46
- if (task.priority) {
47
- lines.push(`- Priority: ${task.priority}`);
48
- }
49
- if (task.approach) {
50
- lines.push(`- Approach: ${task.approach}`);
51
- }
52
- const deps = task.dependsOn ?? [];
53
- lines.push(`- Depends on: ${deps.length > 0 ? deps.map((d) => `\`${d}\``).join(", ") : "none"}`);
54
- const unblocks = task.unblocks ?? [];
55
- if (unblocks.length > 0) {
56
- lines.push(`- Unblocks: ${unblocks.map((u) => `\`${u}\``).join(", ")}`);
57
- }
58
- if (task.technicalScope && task.technicalScope.length > 0) {
59
- lines.push("- Technical scope:");
60
- for (const item of task.technicalScope) {
61
- lines.push(` - ${item}`);
62
- }
63
- }
64
- if (task.acceptanceCriteria && task.acceptanceCriteria.length > 0) {
65
- lines.push("- Acceptance criteria:");
66
- for (const item of task.acceptanceCriteria) {
67
- lines.push(` - ${item}`);
68
- }
69
- }
70
- return lines.join("\n");
71
- }
72
- export function generateTasksMd(tasks) {
73
- const lines = [];
74
- lines.push("# Workflow Cannon Tasks");
75
- lines.push("");
76
- lines.push("> This file is generated by the Task Engine. Do not edit manually.");
77
- lines.push("");
78
- lines.push("Status markers:");
79
- lines.push("- `[p]` proposed");
80
- lines.push("- `[ ]` ready");
81
- lines.push("- `[~]` in progress");
82
- lines.push("- `[!]` blocked");
83
- lines.push("- `[x]` completed");
84
- lines.push("- `[-]` cancelled");
85
- lines.push("");
86
- lines.push("## Current execution state");
87
- lines.push("");
88
- lines.push(buildCurrentPhase(tasks));
89
- lines.push(buildReadyQueueLine(tasks));
90
- lines.push("");
91
- const phaseGroups = groupByPhase(tasks);
92
- for (const [phase, phaseTasks] of phaseGroups) {
93
- lines.push(`## ${phase}`);
94
- lines.push("");
95
- for (const task of phaseTasks) {
96
- lines.push(renderTask(task));
97
- lines.push("");
98
- }
99
- }
100
- return lines.join("\n");
101
- }
102
- export function syncTaskHeadingsInMarkdown(markdown, tasks) {
103
- const byId = new Map(tasks.map((task) => [task.id, task]));
104
- const lines = markdown.split("\n");
105
- for (let i = 0; i < lines.length; i++) {
106
- const line = lines[i];
107
- const match = line.match(/^###\s+\[[^\]]*\]\s+(T\d+)\s+(.+)$/);
108
- if (!match)
109
- continue;
110
- const id = match[1];
111
- const task = byId.get(id);
112
- if (!task)
113
- continue;
114
- const marker = STATUS_MARKERS[task.status] ?? "[ ]";
115
- lines[i] = `### ${marker} ${task.id} ${task.title}`;
116
- }
117
- return lines.join("\n");
118
- }
@@ -1,8 +0,0 @@
1
- import type { TaskEntity } from "./types.js";
2
- export type ImportResult = {
3
- imported: number;
4
- skipped: number;
5
- errors: string[];
6
- tasks: TaskEntity[];
7
- };
8
- export declare function importTasksFromMarkdown(sourcePath: string): Promise<ImportResult>;