@kynetic-ai/spec 0.4.0 → 0.6.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/cli/commands/guard.d.ts +43 -0
- package/dist/cli/commands/guard.d.ts.map +1 -0
- package/dist/cli/commands/guard.js +200 -0
- package/dist/cli/commands/guard.js.map +1 -0
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +1 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/item.d.ts.map +1 -1
- package/dist/cli/commands/item.js +60 -23
- package/dist/cli/commands/item.js.map +1 -1
- package/dist/cli/commands/plan-import.js +51 -12
- package/dist/cli/commands/plan-import.js.map +1 -1
- package/dist/cli/commands/ralph.d.ts.map +1 -1
- package/dist/cli/commands/ralph.js +144 -329
- package/dist/cli/commands/ralph.js.map +1 -1
- package/dist/cli/commands/session/checkpoint.d.ts +19 -0
- package/dist/cli/commands/session/checkpoint.d.ts.map +1 -0
- package/dist/cli/commands/session/checkpoint.js +161 -0
- package/dist/cli/commands/session/checkpoint.js.map +1 -0
- package/dist/cli/commands/session/commands.d.ts +18 -0
- package/dist/cli/commands/session/commands.d.ts.map +1 -0
- package/dist/cli/commands/session/commands.js +259 -0
- package/dist/cli/commands/session/commands.js.map +1 -0
- package/dist/cli/commands/session/context.d.ts +17 -0
- package/dist/cli/commands/session/context.d.ts.map +1 -0
- package/dist/cli/commands/session/context.js +493 -0
- package/dist/cli/commands/session/context.js.map +1 -0
- package/dist/cli/commands/session/create.d.ts +29 -0
- package/dist/cli/commands/session/create.d.ts.map +1 -0
- package/dist/cli/commands/session/create.js +147 -0
- package/dist/cli/commands/session/create.js.map +1 -0
- package/dist/cli/commands/session/format.d.ts +27 -0
- package/dist/cli/commands/session/format.d.ts.map +1 -0
- package/dist/cli/commands/session/format.js +401 -0
- package/dist/cli/commands/session/format.js.map +1 -0
- package/dist/cli/commands/session/index.d.ts +13 -0
- package/dist/cli/commands/session/index.d.ts.map +1 -0
- package/dist/cli/commands/session/index.js +17 -0
- package/dist/cli/commands/session/index.js.map +1 -0
- package/dist/cli/commands/session/log.d.ts +52 -0
- package/dist/cli/commands/session/log.d.ts.map +1 -0
- package/dist/cli/commands/session/log.js +570 -0
- package/dist/cli/commands/session/log.js.map +1 -0
- package/dist/cli/commands/session/types.d.ts +230 -0
- package/dist/cli/commands/session/types.d.ts.map +1 -0
- package/dist/cli/commands/session/types.js +7 -0
- package/dist/cli/commands/session/types.js.map +1 -0
- package/dist/cli/commands/session.d.ts +4 -179
- package/dist/cli/commands/session.d.ts.map +1 -1
- package/dist/cli/commands/session.js +6 -1424
- package/dist/cli/commands/session.js.map +1 -1
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +69 -223
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/task.d.ts.map +1 -1
- package/dist/cli/commands/task.js +95 -37
- package/dist/cli/commands/task.js.map +1 -1
- package/dist/cli/commands/validate.d.ts.map +1 -1
- package/dist/cli/commands/validate.js +23 -7
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +14 -2
- package/dist/cli/output.js.map +1 -1
- package/dist/parser/file-lock.d.ts +14 -0
- package/dist/parser/file-lock.d.ts.map +1 -0
- package/dist/parser/file-lock.js +124 -0
- package/dist/parser/file-lock.js.map +1 -0
- package/dist/parser/index.d.ts +1 -0
- package/dist/parser/index.d.ts.map +1 -1
- package/dist/parser/index.js +1 -0
- package/dist/parser/index.js.map +1 -1
- package/dist/parser/plan-document.d.ts +36 -0
- package/dist/parser/plan-document.d.ts.map +1 -1
- package/dist/parser/plan-document.js +75 -8
- package/dist/parser/plan-document.js.map +1 -1
- package/dist/parser/plans.d.ts.map +1 -1
- package/dist/parser/plans.js +28 -102
- package/dist/parser/plans.js.map +1 -1
- package/dist/parser/shadow.d.ts +5 -1
- package/dist/parser/shadow.d.ts.map +1 -1
- package/dist/parser/shadow.js +29 -17
- package/dist/parser/shadow.js.map +1 -1
- package/dist/parser/validate.d.ts +4 -1
- package/dist/parser/validate.d.ts.map +1 -1
- package/dist/parser/validate.js +50 -35
- package/dist/parser/validate.js.map +1 -1
- package/dist/parser/yaml.d.ts.map +1 -1
- package/dist/parser/yaml.js +322 -297
- package/dist/parser/yaml.js.map +1 -1
- package/dist/schema/task.d.ts +22 -0
- package/dist/schema/task.d.ts.map +1 -1
- package/dist/schema/task.js +7 -0
- package/dist/schema/task.js.map +1 -1
- package/dist/sessions/store.d.ts +254 -1
- package/dist/sessions/store.d.ts.map +1 -1
- package/dist/sessions/store.js +621 -1
- package/dist/sessions/store.js.map +1 -1
- package/dist/sessions/types.d.ts +51 -2
- package/dist/sessions/types.d.ts.map +1 -1
- package/dist/sessions/types.js +25 -0
- package/dist/sessions/types.js.map +1 -1
- package/dist/strings/labels.d.ts +2 -0
- package/dist/strings/labels.d.ts.map +1 -1
- package/dist/strings/labels.js +2 -0
- package/dist/strings/labels.js.map +1 -1
- package/dist/utils/git.d.ts +2 -0
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +21 -5
- package/dist/utils/git.js.map +1 -1
- package/package.json +4 -1
- package/plugin/.claude-plugin/marketplace.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugins/kspec/skills/review/SKILL.md +37 -0
- package/plugin/plugins/kspec/skills/task-work/SKILL.md +16 -0
- package/plugin/plugins/kspec/skills/triage-inbox/SKILL.md +1 -1
- package/plugin/plugins/kspec/skills/writing-specs/SKILL.md +14 -0
- package/templates/agents-sections/05-commit-convention.md +14 -0
- package/templates/skills/review/SKILL.md +37 -0
- package/templates/skills/task-work/SKILL.md +16 -0
- package/templates/skills/triage-inbox/SKILL.md +1 -1
- package/templates/skills/writing-specs/SKILL.md +14 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native guard commands for kspec.
|
|
3
|
+
*
|
|
4
|
+
* Replaces bash shell script hooks with TypeScript CLI commands.
|
|
5
|
+
* `kspec guard worktree` replaces kspec-worktree-guard.sh.
|
|
6
|
+
*
|
|
7
|
+
* AC: @native-guard-commands ac-worktree-guard - blocks dangerous git ops in .kspec
|
|
8
|
+
* AC: @native-guard-commands ac-worktree-allow - allows safe commands
|
|
9
|
+
*/
|
|
10
|
+
import type { Command } from "commander";
|
|
11
|
+
/**
|
|
12
|
+
* Decision from a guard check
|
|
13
|
+
*/
|
|
14
|
+
export interface GuardDecision {
|
|
15
|
+
decision: "allow" | "block";
|
|
16
|
+
reason?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* PreToolUse hook input from Claude Code
|
|
20
|
+
*/
|
|
21
|
+
interface PreToolUseInput {
|
|
22
|
+
tool_name?: string;
|
|
23
|
+
tool_input?: {
|
|
24
|
+
command?: string;
|
|
25
|
+
};
|
|
26
|
+
cwd?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Evaluate a PreToolUse hook input and return a guard decision.
|
|
30
|
+
* This is the core logic, exported for testing.
|
|
31
|
+
*
|
|
32
|
+
* AC: @native-guard-commands ac-worktree-guard
|
|
33
|
+
* AC: @native-guard-commands ac-worktree-allow
|
|
34
|
+
*/
|
|
35
|
+
export declare function evaluateWorktreeGuard(input: PreToolUseInput): GuardDecision;
|
|
36
|
+
/**
|
|
37
|
+
* Register the guard command group.
|
|
38
|
+
*
|
|
39
|
+
* AC: @trait-semantic-exit-codes ac-8 - exit code meanings documented in code
|
|
40
|
+
*/
|
|
41
|
+
export declare function registerGuardCommand(program: Command): void;
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE;QACX,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AA2FD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,aAAa,CAiC3E;AAkBD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA4D3D"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native guard commands for kspec.
|
|
3
|
+
*
|
|
4
|
+
* Replaces bash shell script hooks with TypeScript CLI commands.
|
|
5
|
+
* `kspec guard worktree` replaces kspec-worktree-guard.sh.
|
|
6
|
+
*
|
|
7
|
+
* AC: @native-guard-commands ac-worktree-guard - blocks dangerous git ops in .kspec
|
|
8
|
+
* AC: @native-guard-commands ac-worktree-allow - allows safe commands
|
|
9
|
+
*/
|
|
10
|
+
import { EXIT_CODES } from "../exit-codes.js";
|
|
11
|
+
import { isJsonMode, output } from "../output.js";
|
|
12
|
+
/**
|
|
13
|
+
* Dangerous git patterns that should be blocked when operating in .kspec/ worktree.
|
|
14
|
+
* These can corrupt session data or disrupt the kspec-meta branch.
|
|
15
|
+
*/
|
|
16
|
+
const DANGEROUS_PATTERNS = [
|
|
17
|
+
// Branch creation
|
|
18
|
+
"git checkout -b",
|
|
19
|
+
"git checkout -B",
|
|
20
|
+
"git branch -c",
|
|
21
|
+
"git branch -C",
|
|
22
|
+
"git branch -m",
|
|
23
|
+
"git branch -M",
|
|
24
|
+
"git switch -c",
|
|
25
|
+
"git switch -C",
|
|
26
|
+
"git switch --create",
|
|
27
|
+
// History rewriting
|
|
28
|
+
"git reset",
|
|
29
|
+
"git rebase",
|
|
30
|
+
"git cherry-pick",
|
|
31
|
+
"git commit --amend",
|
|
32
|
+
// Force push
|
|
33
|
+
"git push --force",
|
|
34
|
+
"git push -f",
|
|
35
|
+
// Discarding changes
|
|
36
|
+
"git stash",
|
|
37
|
+
"git clean",
|
|
38
|
+
"git checkout -- ",
|
|
39
|
+
"git restore",
|
|
40
|
+
];
|
|
41
|
+
/**
|
|
42
|
+
* Check if a command targets the .kspec directory, either via cwd or cd commands.
|
|
43
|
+
*/
|
|
44
|
+
function isInKspec(command, cwd) {
|
|
45
|
+
if (cwd) {
|
|
46
|
+
// Normalize path separators for cross-platform support
|
|
47
|
+
const normalizedCwd = cwd.replace(/\\/g, "/");
|
|
48
|
+
if (normalizedCwd.includes("/.kspec") || normalizedCwd.endsWith("/.kspec")) {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (command.includes("cd .kspec") || /cd\s+.*\.kspec/.test(command)) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Check if a command attempts to delete the kspec-meta branch.
|
|
59
|
+
*/
|
|
60
|
+
function isKspecMetaDeletion(command) {
|
|
61
|
+
// Remove quote characters to catch split-quote bypasses like git "branch" -D kspec-meta
|
|
62
|
+
const unquoted = command.replace(/["']/g, "");
|
|
63
|
+
return (unquoted.includes("git branch -d kspec-meta") ||
|
|
64
|
+
unquoted.includes("git branch -D kspec-meta"));
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Check if a command matches any dangerous pattern when operating in .kspec.
|
|
68
|
+
*
|
|
69
|
+
* Uses two matching strategies (same as the original shell script):
|
|
70
|
+
* 1. STRIPPED: Remove entire quoted strings to ignore patterns in arguments
|
|
71
|
+
* (allows: echo "git reset", grep "git stash")
|
|
72
|
+
* 2. UNQUOTED + first-word check: Remove quote chars and check if first command is "git"
|
|
73
|
+
* (blocks: git "reset" --hard, git st'ash')
|
|
74
|
+
*/
|
|
75
|
+
function matchesDangerousPattern(command) {
|
|
76
|
+
// STRIPPED: remove quoted strings entirely to ignore patterns in args
|
|
77
|
+
const stripped = command.replace(/'[^']*'/g, "").replace(/"[^"]*"/g, "");
|
|
78
|
+
// UNQUOTED: remove quote chars to catch split-quote bypasses
|
|
79
|
+
const unquoted = command.replace(/["']/g, "");
|
|
80
|
+
// First command word (trimmed)
|
|
81
|
+
const firstCmd = command.trimStart().split(/\s+/)[0] || "";
|
|
82
|
+
for (const pattern of DANGEROUS_PATTERNS) {
|
|
83
|
+
// Block if pattern is in the stripped command (actual command, not in quotes)
|
|
84
|
+
// OR if pattern is in unquoted AND first command word is "git"
|
|
85
|
+
if (stripped.includes(pattern) ||
|
|
86
|
+
(unquoted.includes(pattern) && firstCmd === "git")) {
|
|
87
|
+
return pattern;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Evaluate a PreToolUse hook input and return a guard decision.
|
|
94
|
+
* This is the core logic, exported for testing.
|
|
95
|
+
*
|
|
96
|
+
* AC: @native-guard-commands ac-worktree-guard
|
|
97
|
+
* AC: @native-guard-commands ac-worktree-allow
|
|
98
|
+
*/
|
|
99
|
+
export function evaluateWorktreeGuard(input) {
|
|
100
|
+
const command = input.tool_input?.command;
|
|
101
|
+
// No command means not a Bash tool call — allow
|
|
102
|
+
if (!command) {
|
|
103
|
+
return { decision: "allow" };
|
|
104
|
+
}
|
|
105
|
+
// Block kspec-meta branch deletion from anywhere
|
|
106
|
+
if (isKspecMetaDeletion(command)) {
|
|
107
|
+
return {
|
|
108
|
+
decision: "block",
|
|
109
|
+
reason: "[kspec-worktree-guard] BLOCKED: Cannot delete kspec-meta branch. This is the main branch for the .kspec worktree.",
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
// If not operating in .kspec, allow everything
|
|
113
|
+
if (!isInKspec(command, input.cwd)) {
|
|
114
|
+
return { decision: "allow" };
|
|
115
|
+
}
|
|
116
|
+
// Check for dangerous patterns in .kspec context
|
|
117
|
+
const matched = matchesDangerousPattern(command);
|
|
118
|
+
if (matched) {
|
|
119
|
+
return {
|
|
120
|
+
decision: "block",
|
|
121
|
+
reason: "[kspec-worktree-guard] BLOCKED: Dangerous git operation in .kspec worktree. This worktree contains active session data and must stay on kspec-meta. Operations like reset, rebase, stash, and clean can corrupt session files.",
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
return { decision: "allow" };
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Read all stdin as a string (for hook JSON input).
|
|
128
|
+
*/
|
|
129
|
+
async function readStdin() {
|
|
130
|
+
return new Promise((resolve, reject) => {
|
|
131
|
+
const chunks = [];
|
|
132
|
+
process.stdin.on("data", (chunk) => chunks.push(chunk));
|
|
133
|
+
process.stdin.on("end", () => resolve(Buffer.concat(chunks).toString("utf-8")));
|
|
134
|
+
process.stdin.on("error", reject);
|
|
135
|
+
// If stdin is already ended (e.g., no pipe), resolve empty
|
|
136
|
+
if (process.stdin.readableEnded) {
|
|
137
|
+
resolve("");
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Register the guard command group.
|
|
143
|
+
*
|
|
144
|
+
* AC: @trait-semantic-exit-codes ac-8 - exit code meanings documented in code
|
|
145
|
+
*/
|
|
146
|
+
export function registerGuardCommand(program) {
|
|
147
|
+
const guard = program
|
|
148
|
+
.command("guard")
|
|
149
|
+
.description("Guard commands for protecting kspec state");
|
|
150
|
+
guard
|
|
151
|
+
.command("worktree")
|
|
152
|
+
.description("Guard against dangerous git operations in .kspec worktree (PreToolUse hook)")
|
|
153
|
+
.option("--json", "Output as JSON")
|
|
154
|
+
.action(async () => {
|
|
155
|
+
try {
|
|
156
|
+
const raw = await readStdin();
|
|
157
|
+
if (!raw.trim()) {
|
|
158
|
+
// No input — allow (not a tool call we need to guard)
|
|
159
|
+
// AC: @native-guard-commands ac-worktree-allow
|
|
160
|
+
const result = { decision: "allow" };
|
|
161
|
+
console.log(JSON.stringify(result));
|
|
162
|
+
process.exit(EXIT_CODES.SUCCESS);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
let input;
|
|
166
|
+
try {
|
|
167
|
+
input = JSON.parse(raw);
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
// Invalid JSON — this is a validation error
|
|
171
|
+
// AC: @trait-semantic-exit-codes ac-2 - validation error exit code 1
|
|
172
|
+
if (isJsonMode()) {
|
|
173
|
+
output({ error: "Invalid JSON input on stdin" });
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
// Guard hooks always output JSON for the hook protocol
|
|
177
|
+
console.log(JSON.stringify({
|
|
178
|
+
error: "Invalid JSON input on stdin",
|
|
179
|
+
}));
|
|
180
|
+
}
|
|
181
|
+
process.exit(EXIT_CODES.ERROR);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const decision = evaluateWorktreeGuard(input);
|
|
185
|
+
// Guard commands always output JSON (hook protocol requirement)
|
|
186
|
+
// AC: @trait-json-output ac-1 - valid JSON with no ANSI codes
|
|
187
|
+
console.log(JSON.stringify(decision));
|
|
188
|
+
// AC: @trait-semantic-exit-codes ac-1 - exit 0 on success
|
|
189
|
+
process.exit(EXIT_CODES.SUCCESS);
|
|
190
|
+
}
|
|
191
|
+
catch (err) {
|
|
192
|
+
// AC: @trait-semantic-exit-codes ac-4 - runtime error exit code 3
|
|
193
|
+
// AC: @trait-json-output ac-3 - error as JSON
|
|
194
|
+
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
195
|
+
console.log(JSON.stringify({ error: errorMsg }));
|
|
196
|
+
process.exit(EXIT_CODES.NOT_FOUND); // Using 3 for runtime errors
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
//# sourceMappingURL=guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guard.js","sourceRoot":"","sources":["../../../src/cli/commands/guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAqBlD;;;GAGG;AACH,MAAM,kBAAkB,GAAsB;IAC5C,kBAAkB;IAClB,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,eAAe;IACf,eAAe;IACf,eAAe;IACf,eAAe;IACf,eAAe;IACf,qBAAqB;IACrB,oBAAoB;IACpB,WAAW;IACX,YAAY;IACZ,iBAAiB;IACjB,oBAAoB;IACpB,aAAa;IACb,kBAAkB;IAClB,aAAa;IACb,qBAAqB;IACrB,WAAW;IACX,WAAW;IACX,kBAAkB;IAClB,aAAa;CACd,CAAC;AAEF;;GAEG;AACH,SAAS,SAAS,CAAC,OAAe,EAAE,GAAuB;IACzD,IAAI,GAAG,EAAE,CAAC;QACR,uDAAuD;QACvD,MAAM,aAAa,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC9C,IAAI,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3E,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACpE,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAS,m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A8D;YAC9D,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;YAEtC,0DAA0D;YAC1D,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,kEAAkE;YAClE,8CAA8C;YAC9C,MAAM,QAAQ,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAClE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;YACjD,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,6BAA6B;QACnE,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -4,6 +4,7 @@ export { registerCloneForTestingCommand } from "./clone-for-testing.js";
|
|
|
4
4
|
export { registerDeriveCommand } from "./derive.js";
|
|
5
5
|
export { registerDoctorCommand } from "./doctor.js";
|
|
6
6
|
export { registerExportCommand } from "./export.js";
|
|
7
|
+
export { registerGuardCommand } from "./guard.js";
|
|
7
8
|
export { registerHelpCommand } from "./help.js";
|
|
8
9
|
export { registerInboxCommands } from "./inbox.js";
|
|
9
10
|
export { registerInitCommand } from "./init.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,qBAAq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ACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -5,6 +5,7 @@ export { registerCloneForTestingCommand } from "./clone-for-testing.js";
|
|
|
5
5
|
export { registerDeriveCommand } from "./derive.js";
|
|
6
6
|
export { registerDoctorCommand } from "./doctor.js";
|
|
7
7
|
export { registerExportCommand } from "./export.js";
|
|
8
|
+
export { registerGuardCommand } from "./guard.js";
|
|
8
9
|
export { registerHelpCommand } from "./help.js";
|
|
9
10
|
export { registerInboxCommands } from "./inbox.js";
|
|
10
11
|
export { registerInitCommand } from "./init.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAE3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,qBAAqB,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W,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/item.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/item.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4QzC;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA6jD3D"}
|
|
@@ -3,6 +3,7 @@ import { markMutating } from "../command-annotations.js";
|
|
|
3
3
|
import { AlignmentIndex, addChildItem, buildIndexes, checkSlugUniqueness, createNote, createSpecItem, deleteSpecItem, findChildItems, findDescendantItems, findTraitImplementors, initContext, loadAllItems, loadAllTasks, patchSpecItems, ReferenceIndex, updateSpecItem, } from "../../parser/index.js";
|
|
4
4
|
import { commitIfShadow } from "../../parser/shadow.js";
|
|
5
5
|
import { SpecItemPatchSchema } from "../../schema/index.js";
|
|
6
|
+
import { ImplementationStatusSchema, MaturitySchema, } from "../../schema/common.js";
|
|
6
7
|
import { errors } from "../../strings/errors.js";
|
|
7
8
|
import { fieldLabels, sectionHeaders } from "../../strings/labels.js";
|
|
8
9
|
import { formatMatchedFields, grepItem } from "../../utils/grep.js";
|
|
@@ -217,7 +218,6 @@ export function registerItemCommands(program) {
|
|
|
217
218
|
// AC: @multi-value-status-filter ac-item-list-parity, ac-invalid-item-status
|
|
218
219
|
if (options.status) {
|
|
219
220
|
const { parseMultiStatus } = await import("./tasks.js");
|
|
220
|
-
const { ImplementationStatusSchema } = await import("../../schema/common.js");
|
|
221
221
|
const statuses = parseMultiStatus(options.status, ImplementationStatusSchema.options, "implementation status");
|
|
222
222
|
if (statuses) {
|
|
223
223
|
filter.implementation = statuses.length === 1 ? statuses[0] : statuses;
|
|
@@ -737,6 +737,23 @@ Examples:
|
|
|
737
737
|
updates.traits = options.trait;
|
|
738
738
|
if (options.description)
|
|
739
739
|
updates.description = options.description;
|
|
740
|
+
// AC: @implementation-states ac-reject-invalid
|
|
741
|
+
// AC: @maturity-states ac-reject-invalid
|
|
742
|
+
// Validate enum values before writing
|
|
743
|
+
if (options.status) {
|
|
744
|
+
const valid = ImplementationStatusSchema.options;
|
|
745
|
+
if (!valid.includes(options.status)) {
|
|
746
|
+
error(`Invalid implementation status: '${options.status}'. Valid values: ${valid.join(", ")}`);
|
|
747
|
+
process.exit(EXIT_CODES.USAGE_ERROR);
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
if (options.maturity) {
|
|
751
|
+
const valid = MaturitySchema.options;
|
|
752
|
+
if (!valid.includes(options.maturity)) {
|
|
753
|
+
error(`Invalid maturity: '${options.maturity}'. Valid values: ${valid.join(", ")}`);
|
|
754
|
+
process.exit(EXIT_CODES.USAGE_ERROR);
|
|
755
|
+
}
|
|
756
|
+
}
|
|
740
757
|
// Handle status updates
|
|
741
758
|
if (options.status || options.maturity) {
|
|
742
759
|
const currentStatus = foundItem.status && typeof foundItem.status === "object"
|
|
@@ -1476,22 +1493,32 @@ async function readStdinFully() {
|
|
|
1476
1493
|
}
|
|
1477
1494
|
return new Promise((resolve) => {
|
|
1478
1495
|
let data = "";
|
|
1479
|
-
const
|
|
1480
|
-
process.stdin.removeAllListeners();
|
|
1481
|
-
resolve(data || null);
|
|
1482
|
-
}, 5000); // 5 second timeout for bulk input
|
|
1483
|
-
process.stdin.setEncoding("utf8");
|
|
1484
|
-
process.stdin.on("data", (chunk) => {
|
|
1496
|
+
const onData = (chunk) => {
|
|
1485
1497
|
data += chunk;
|
|
1486
|
-
}
|
|
1487
|
-
|
|
1498
|
+
};
|
|
1499
|
+
const onEnd = () => {
|
|
1488
1500
|
clearTimeout(timeout);
|
|
1501
|
+
cleanup();
|
|
1489
1502
|
resolve(data || null);
|
|
1490
|
-
}
|
|
1491
|
-
|
|
1503
|
+
};
|
|
1504
|
+
const onError = () => {
|
|
1492
1505
|
clearTimeout(timeout);
|
|
1506
|
+
cleanup();
|
|
1493
1507
|
resolve(null);
|
|
1494
|
-
}
|
|
1508
|
+
};
|
|
1509
|
+
const cleanup = () => {
|
|
1510
|
+
process.stdin.removeListener("data", onData);
|
|
1511
|
+
process.stdin.removeListener("end", onEnd);
|
|
1512
|
+
process.stdin.removeListener("error", onError);
|
|
1513
|
+
};
|
|
1514
|
+
const timeout = setTimeout(() => {
|
|
1515
|
+
cleanup();
|
|
1516
|
+
resolve(data || null);
|
|
1517
|
+
}, 5000); // 5 second timeout for bulk input
|
|
1518
|
+
process.stdin.setEncoding("utf8");
|
|
1519
|
+
process.stdin.on("data", onData);
|
|
1520
|
+
process.stdin.on("end", onEnd);
|
|
1521
|
+
process.stdin.on("error", onError);
|
|
1495
1522
|
process.stdin.resume();
|
|
1496
1523
|
});
|
|
1497
1524
|
}
|
|
@@ -1505,22 +1532,32 @@ async function readStdinIfAvailable() {
|
|
|
1505
1532
|
}
|
|
1506
1533
|
return new Promise((resolve) => {
|
|
1507
1534
|
let data = "";
|
|
1508
|
-
const
|
|
1509
|
-
process.stdin.removeAllListeners();
|
|
1510
|
-
resolve(data || null);
|
|
1511
|
-
}, 100); // 100ms timeout for quick check
|
|
1512
|
-
process.stdin.setEncoding("utf8");
|
|
1513
|
-
process.stdin.on("data", (chunk) => {
|
|
1535
|
+
const onData = (chunk) => {
|
|
1514
1536
|
data += chunk;
|
|
1515
|
-
}
|
|
1516
|
-
|
|
1537
|
+
};
|
|
1538
|
+
const onEnd = () => {
|
|
1517
1539
|
clearTimeout(timeout);
|
|
1540
|
+
cleanup();
|
|
1518
1541
|
resolve(data || null);
|
|
1519
|
-
}
|
|
1520
|
-
|
|
1542
|
+
};
|
|
1543
|
+
const onError = () => {
|
|
1521
1544
|
clearTimeout(timeout);
|
|
1545
|
+
cleanup();
|
|
1522
1546
|
resolve(null);
|
|
1523
|
-
}
|
|
1547
|
+
};
|
|
1548
|
+
const cleanup = () => {
|
|
1549
|
+
process.stdin.removeListener("data", onData);
|
|
1550
|
+
process.stdin.removeListener("end", onEnd);
|
|
1551
|
+
process.stdin.removeListener("error", onError);
|
|
1552
|
+
};
|
|
1553
|
+
const timeout = setTimeout(() => {
|
|
1554
|
+
cleanup();
|
|
1555
|
+
resolve(data || null);
|
|
1556
|
+
}, 100); // 100ms timeout for quick check
|
|
1557
|
+
process.stdin.setEncoding("utf8");
|
|
1558
|
+
process.stdin.on("data", onData);
|
|
1559
|
+
process.stdin.on("end", onEnd);
|
|
1560
|
+
process.stdin.on("error", onError);
|
|
1524
1561
|
process.stdin.resume();
|
|
1525
1562
|
});
|
|
1526
1563
|
}
|