sysprom 1.0.0 → 1.0.6
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 +207 -0
- package/dist/schema.json +510 -0
- package/dist/src/canonical-json.d.ts +23 -0
- package/dist/src/canonical-json.js +120 -0
- package/dist/src/cli/commands/add.d.ts +22 -0
- package/dist/src/cli/commands/add.js +95 -0
- package/dist/src/cli/commands/check.d.ts +10 -0
- package/dist/src/cli/commands/check.js +33 -0
- package/dist/src/cli/commands/graph.d.ts +15 -0
- package/dist/src/cli/commands/graph.js +32 -0
- package/dist/src/cli/commands/init.d.ts +2 -0
- package/dist/src/cli/commands/init.js +44 -0
- package/dist/src/cli/commands/json2md.d.ts +2 -0
- package/dist/src/cli/commands/json2md.js +60 -0
- package/dist/src/cli/commands/md2json.d.ts +2 -0
- package/dist/src/cli/commands/md2json.js +29 -0
- package/dist/src/cli/commands/plan.d.ts +2 -0
- package/dist/src/cli/commands/plan.js +227 -0
- package/dist/src/cli/commands/query.d.ts +2 -0
- package/dist/src/cli/commands/query.js +275 -0
- package/dist/src/cli/commands/remove.d.ts +13 -0
- package/dist/src/cli/commands/remove.js +50 -0
- package/dist/src/cli/commands/rename.d.ts +14 -0
- package/dist/src/cli/commands/rename.js +34 -0
- package/dist/src/cli/commands/search.d.ts +11 -0
- package/dist/src/cli/commands/search.js +37 -0
- package/dist/src/cli/commands/speckit.d.ts +2 -0
- package/dist/src/cli/commands/speckit.js +318 -0
- package/dist/src/cli/commands/stats.d.ts +10 -0
- package/dist/src/cli/commands/stats.js +51 -0
- package/dist/src/cli/commands/task.d.ts +2 -0
- package/dist/src/cli/commands/task.js +162 -0
- package/dist/src/cli/commands/update.d.ts +2 -0
- package/dist/src/cli/commands/update.js +219 -0
- package/dist/src/cli/commands/validate.d.ts +10 -0
- package/dist/src/cli/commands/validate.js +30 -0
- package/dist/src/cli/define-command.d.ts +34 -0
- package/dist/src/cli/define-command.js +237 -0
- package/dist/src/cli/index.d.ts +2 -0
- package/dist/src/cli/index.js +3 -0
- package/dist/src/cli/program.d.ts +4 -0
- package/dist/src/cli/program.js +46 -0
- package/dist/src/cli/shared.d.ts +26 -0
- package/dist/src/cli/shared.js +41 -0
- package/dist/src/generate-schema.d.ts +1 -0
- package/dist/src/generate-schema.js +9 -0
- package/dist/src/index.d.ts +48 -0
- package/dist/src/index.js +99 -0
- package/dist/src/io.d.ts +22 -0
- package/dist/src/io.js +66 -0
- package/dist/src/json-to-md.d.ts +26 -0
- package/dist/src/json-to-md.js +498 -0
- package/dist/src/md-to-json.d.ts +22 -0
- package/dist/src/md-to-json.js +548 -0
- package/dist/src/operations/add-node.d.ts +887 -0
- package/dist/src/operations/add-node.js +21 -0
- package/dist/src/operations/add-plan-task.d.ts +594 -0
- package/dist/src/operations/add-plan-task.js +25 -0
- package/dist/src/operations/add-relationship.d.ts +635 -0
- package/dist/src/operations/add-relationship.js +25 -0
- package/dist/src/operations/check.d.ts +301 -0
- package/dist/src/operations/check.js +66 -0
- package/dist/src/operations/define-operation.d.ts +14 -0
- package/dist/src/operations/define-operation.js +21 -0
- package/dist/src/operations/graph.d.ts +303 -0
- package/dist/src/operations/graph.js +71 -0
- package/dist/src/operations/index.d.ts +38 -0
- package/dist/src/operations/index.js +45 -0
- package/dist/src/operations/init-document.d.ts +299 -0
- package/dist/src/operations/init-document.js +26 -0
- package/dist/src/operations/json-to-markdown.d.ts +298 -0
- package/dist/src/operations/json-to-markdown.js +13 -0
- package/dist/src/operations/mark-task-done.d.ts +594 -0
- package/dist/src/operations/mark-task-done.js +26 -0
- package/dist/src/operations/mark-task-undone.d.ts +594 -0
- package/dist/src/operations/mark-task-undone.js +26 -0
- package/dist/src/operations/markdown-to-json.d.ts +298 -0
- package/dist/src/operations/markdown-to-json.js +13 -0
- package/dist/src/operations/next-id.d.ts +322 -0
- package/dist/src/operations/next-id.js +29 -0
- package/dist/src/operations/node-history.d.ts +313 -0
- package/dist/src/operations/node-history.js +55 -0
- package/dist/src/operations/plan-add-task.d.ts +595 -0
- package/dist/src/operations/plan-add-task.js +18 -0
- package/dist/src/operations/plan-gate.d.ts +351 -0
- package/dist/src/operations/plan-gate.js +41 -0
- package/dist/src/operations/plan-init.d.ts +299 -0
- package/dist/src/operations/plan-init.js +17 -0
- package/dist/src/operations/plan-progress.d.ts +313 -0
- package/dist/src/operations/plan-progress.js +23 -0
- package/dist/src/operations/plan-status.d.ts +349 -0
- package/dist/src/operations/plan-status.js +41 -0
- package/dist/src/operations/query-node.d.ts +1065 -0
- package/dist/src/operations/query-node.js +27 -0
- package/dist/src/operations/query-nodes.d.ts +594 -0
- package/dist/src/operations/query-nodes.js +23 -0
- package/dist/src/operations/query-relationships.d.ts +343 -0
- package/dist/src/operations/query-relationships.js +27 -0
- package/dist/src/operations/remove-node.d.ts +895 -0
- package/dist/src/operations/remove-node.js +58 -0
- package/dist/src/operations/remove-relationship.d.ts +622 -0
- package/dist/src/operations/remove-relationship.js +26 -0
- package/dist/src/operations/rename.d.ts +594 -0
- package/dist/src/operations/rename.js +113 -0
- package/dist/src/operations/search.d.ts +593 -0
- package/dist/src/operations/search.js +39 -0
- package/dist/src/operations/speckit-diff.d.ts +330 -0
- package/dist/src/operations/speckit-diff.js +89 -0
- package/dist/src/operations/speckit-export.d.ts +300 -0
- package/dist/src/operations/speckit-export.js +17 -0
- package/dist/src/operations/speckit-import.d.ts +299 -0
- package/dist/src/operations/speckit-import.js +39 -0
- package/dist/src/operations/speckit-sync.d.ts +900 -0
- package/dist/src/operations/speckit-sync.js +116 -0
- package/dist/src/operations/state-at.d.ts +309 -0
- package/dist/src/operations/state-at.js +53 -0
- package/dist/src/operations/stats.d.ts +324 -0
- package/dist/src/operations/stats.js +85 -0
- package/dist/src/operations/task-list.d.ts +305 -0
- package/dist/src/operations/task-list.js +44 -0
- package/dist/src/operations/timeline.d.ts +312 -0
- package/dist/src/operations/timeline.js +46 -0
- package/dist/src/operations/trace-from-node.d.ts +1197 -0
- package/dist/src/operations/trace-from-node.js +36 -0
- package/dist/src/operations/update-metadata.d.ts +593 -0
- package/dist/src/operations/update-metadata.js +18 -0
- package/dist/src/operations/update-node.d.ts +957 -0
- package/dist/src/operations/update-node.js +24 -0
- package/dist/src/operations/update-plan-task.d.ts +595 -0
- package/dist/src/operations/update-plan-task.js +31 -0
- package/dist/src/operations/validate.d.ts +310 -0
- package/dist/src/operations/validate.js +82 -0
- package/dist/src/schema.d.ts +891 -0
- package/dist/src/schema.js +356 -0
- package/dist/src/speckit/generate.d.ts +7 -0
- package/dist/src/speckit/generate.js +546 -0
- package/dist/src/speckit/index.d.ts +4 -0
- package/dist/src/speckit/index.js +4 -0
- package/dist/src/speckit/parse.d.ts +11 -0
- package/dist/src/speckit/parse.js +712 -0
- package/dist/src/speckit/plan.d.ts +125 -0
- package/dist/src/speckit/plan.js +636 -0
- package/dist/src/speckit/project.d.ts +39 -0
- package/dist/src/speckit/project.js +141 -0
- package/dist/src/text.d.ts +23 -0
- package/dist/src/text.js +32 -0
- package/package.json +86 -8
- package/schema.json +510 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { SysProMDocument, Node } from "../schema.js";
|
|
2
|
+
export interface PlanStatus {
|
|
3
|
+
constitution: {
|
|
4
|
+
defined: boolean;
|
|
5
|
+
principleCount: number;
|
|
6
|
+
};
|
|
7
|
+
spec: {
|
|
8
|
+
defined: boolean;
|
|
9
|
+
userStoryCount: number;
|
|
10
|
+
storiesNeedingAcceptanceCriteria: string[];
|
|
11
|
+
};
|
|
12
|
+
plan: {
|
|
13
|
+
defined: boolean;
|
|
14
|
+
phaseCount: number;
|
|
15
|
+
};
|
|
16
|
+
tasks: {
|
|
17
|
+
total: number;
|
|
18
|
+
done: number;
|
|
19
|
+
};
|
|
20
|
+
checklist: {
|
|
21
|
+
defined: boolean;
|
|
22
|
+
total: number;
|
|
23
|
+
done: number;
|
|
24
|
+
};
|
|
25
|
+
nextStep: string;
|
|
26
|
+
}
|
|
27
|
+
export interface PhaseProgress {
|
|
28
|
+
phase: number;
|
|
29
|
+
name: string;
|
|
30
|
+
done: number;
|
|
31
|
+
total: number;
|
|
32
|
+
percent: number;
|
|
33
|
+
}
|
|
34
|
+
export type GateIssue = {
|
|
35
|
+
kind: "previous_tasks_incomplete";
|
|
36
|
+
phase: number;
|
|
37
|
+
remaining: number;
|
|
38
|
+
} | {
|
|
39
|
+
kind: "user_story_no_change";
|
|
40
|
+
storyId: string;
|
|
41
|
+
} | {
|
|
42
|
+
kind: "user_story_no_acceptance_criteria";
|
|
43
|
+
storyId: string;
|
|
44
|
+
} | {
|
|
45
|
+
kind: "fr_no_change";
|
|
46
|
+
frId: string;
|
|
47
|
+
};
|
|
48
|
+
export interface GateResult {
|
|
49
|
+
phase: number;
|
|
50
|
+
ready: boolean;
|
|
51
|
+
issues: GateIssue[];
|
|
52
|
+
}
|
|
53
|
+
export interface TaskCount {
|
|
54
|
+
total: number;
|
|
55
|
+
done: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Scaffold a new SysProMDocument with the standard spec-kit-compatible node
|
|
59
|
+
* structure for a given prefix and name.
|
|
60
|
+
*
|
|
61
|
+
* Creates four skeleton nodes:
|
|
62
|
+
* - {prefix}-CONST protocol (constitution)
|
|
63
|
+
* - {prefix}-SPEC artefact (specification)
|
|
64
|
+
* - {prefix}-PROT-IMPL protocol (implementation plan) — with empty subsystem
|
|
65
|
+
* - {prefix}-CHK gate (checklist)
|
|
66
|
+
*
|
|
67
|
+
* Relationships wired:
|
|
68
|
+
* - {prefix}-SPEC governed_by {prefix}-CONST
|
|
69
|
+
* - {prefix}-CHK governed_by {prefix}-PROT-IMPL
|
|
70
|
+
*
|
|
71
|
+
* Tasks are not pre-scaffolded; use addTask to add them.
|
|
72
|
+
*/
|
|
73
|
+
export declare function initDocument(prefix: string, name: string): SysProMDocument;
|
|
74
|
+
/**
|
|
75
|
+
* Immutably add a new task (change node) to PROT-IMPL.subsystem or to a parent
|
|
76
|
+
* change node's subsystem.
|
|
77
|
+
*
|
|
78
|
+
* - If parentId is not provided: adds CHG-{N} to PROT-IMPL.subsystem
|
|
79
|
+
* (where N = count of existing change nodes + 1)
|
|
80
|
+
* - If parentId is provided: recursively finds parent change node, adds {parentId}-{M}
|
|
81
|
+
* to parent's subsystem (creating subsystem if needed, where M = count of existing
|
|
82
|
+
* change children + 1)
|
|
83
|
+
*
|
|
84
|
+
* Wires must_follow to previous sibling change node at the same level.
|
|
85
|
+
* Default name: "Task N".
|
|
86
|
+
*/
|
|
87
|
+
export declare function addTask(doc: SysProMDocument, prefix: string, name?: string, parentId?: string): SysProMDocument;
|
|
88
|
+
/**
|
|
89
|
+
* Check if a change node's task is complete.
|
|
90
|
+
*
|
|
91
|
+
* If no subsystem or no change children in subsystem:
|
|
92
|
+
* - All items in node.plan must have done === true AND at least one item must exist
|
|
93
|
+
* If subsystem has change children:
|
|
94
|
+
* - All children must be recursively done AND own plan items (if any) must be done
|
|
95
|
+
*/
|
|
96
|
+
export declare function isTaskDone(node: Node): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Count total and completed tasks within a change node.
|
|
99
|
+
*
|
|
100
|
+
* Sums plan[] items from this node and recursively from all change nodes in
|
|
101
|
+
* subsystem (and their subsystems).
|
|
102
|
+
*/
|
|
103
|
+
export declare function countTasks(node: Node): TaskCount;
|
|
104
|
+
/**
|
|
105
|
+
* Inspect a document and return workflow completeness for a given prefix.
|
|
106
|
+
* Never throws — missing nodes are reported as "not defined".
|
|
107
|
+
*/
|
|
108
|
+
export declare function planStatus(doc: SysProMDocument, prefix: string): PlanStatus;
|
|
109
|
+
/**
|
|
110
|
+
* Return per-task completion data.
|
|
111
|
+
* Tasks (change nodes) are discovered from PROT-IMPL.subsystem, sorted topologically.
|
|
112
|
+
*/
|
|
113
|
+
export declare function planProgress(doc: SysProMDocument, prefix: string): PhaseProgress[];
|
|
114
|
+
/**
|
|
115
|
+
* Validate readiness to enter the given phase (1-indexed).
|
|
116
|
+
*
|
|
117
|
+
* Always checks:
|
|
118
|
+
* - Each capability ({prefix}-US-*) has a change node that implements it
|
|
119
|
+
* - Each capability has non-placeholder acceptance criteria
|
|
120
|
+
* - Each invariant ({prefix}-FR-*) has a change node that implements it
|
|
121
|
+
*
|
|
122
|
+
* Additionally for phase N > 1:
|
|
123
|
+
* - All tasks in phase N-1 must be done
|
|
124
|
+
*/
|
|
125
|
+
export declare function checkGate(doc: SysProMDocument, prefix: string, phase: number): GateResult;
|