@christang/keel 5.1.1
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/LICENSE +21 -0
- package/README.md +250 -0
- package/README.zh-CN.md +295 -0
- package/assets/bootstrap/AGENTS.md +9 -0
- package/assets/openspec/schemas/keel-spec-driven/schema.yaml +166 -0
- package/assets/openspec/schemas/keel-spec-driven/templates/design.md +52 -0
- package/assets/openspec/schemas/keel-spec-driven/templates/proposal.md +21 -0
- package/assets/openspec/schemas/keel-spec-driven/templates/spec.md +8 -0
- package/assets/openspec/schemas/keel-spec-driven/templates/tasks.md +68 -0
- package/bin/keel.js +1490 -0
- package/package.json +35 -0
- package/plugins/keel/.claude-plugin/plugin.json +17 -0
- package/plugins/keel/.codex-plugin/plugin.json +29 -0
- package/plugins/keel/agents/keel-single-task-goal-claude.md +16 -0
- package/plugins/keel/agents/keel-single-task-goal-codex.md +16 -0
- package/plugins/keel/hooks/hooks.json +30 -0
- package/plugins/keel/scripts/pretooluse-guard.js +156 -0
- package/plugins/keel/scripts/session-start.js +182 -0
- package/plugins/keel/skills/keel-align-expectations/SKILL.md +53 -0
- package/plugins/keel/skills/keel-align-expectations/references/hardware-dsl.md +21 -0
- package/plugins/keel/skills/keel-align-expectations/references/hardware.md +21 -0
- package/plugins/keel/skills/keel-align-expectations/references/web.md +21 -0
- package/plugins/keel/skills/keel-debug-failure/SKILL.md +41 -0
- package/plugins/keel/skills/keel-handoff/SKILL.md +45 -0
- package/plugins/keel/skills/keel-review-checklist/SKILL.md +73 -0
- package/plugins/keel/skills/keel-run-single-task-goal/SKILL.md +68 -0
- package/plugins/keel/skills/keel-tdd-or-test-first/SKILL.md +45 -0
- package/scripts/install_to_repo.py +1122 -0
- package/scripts/run_python.js +63 -0
- package/scripts/validate_plugin.py +9869 -0
- package/src/core/capabilities.js +291 -0
- package/src/core/context.js +514 -0
- package/src/core/gates.js +643 -0
- package/src/core/goal.js +230 -0
- package/src/core/guard.js +295 -0
- package/src/core/helper.js +319 -0
- package/src/core/projection.js +195 -0
- package/src/core/task-contract.js +736 -0
- package/src/core/tasksview.js +123 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Keel 4.2 disposable native tasks view.
|
|
4
|
+
//
|
|
5
|
+
// Compiles the selected change's tasks.md checklist into an ephemeral
|
|
6
|
+
// `keel-native-tasks/v1` payload for the current agent to mirror into
|
|
7
|
+
// host-native task tools. The view is compiled fresh on every invocation,
|
|
8
|
+
// never persisted, and never a second writer of OpenSpec state; host-side
|
|
9
|
+
// disagreement is projection evidence only.
|
|
10
|
+
|
|
11
|
+
const fs = require("fs");
|
|
12
|
+
const path = require("path");
|
|
13
|
+
const { resolveContext } = require("./context");
|
|
14
|
+
const { parseTasks } = require("./task-contract");
|
|
15
|
+
|
|
16
|
+
const TASKS_VIEW_VERSION = "keel-native-tasks/v1";
|
|
17
|
+
|
|
18
|
+
function blockedView(target, reasons, warnings = []) {
|
|
19
|
+
return {
|
|
20
|
+
version: TASKS_VIEW_VERSION,
|
|
21
|
+
status: "blocked",
|
|
22
|
+
target,
|
|
23
|
+
source: null,
|
|
24
|
+
view: null,
|
|
25
|
+
reasons,
|
|
26
|
+
warnings,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function compileTasksView(repo, options) {
|
|
31
|
+
const target = options.target;
|
|
32
|
+
if (target !== "claude") {
|
|
33
|
+
return blockedView(
|
|
34
|
+
target,
|
|
35
|
+
[
|
|
36
|
+
`The native tasks view supports the claude target only; `
|
|
37
|
+
+ `${target || "<missing>"} remains manual/compatibility-only.`,
|
|
38
|
+
]
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const context = resolveContext(repo, { change: options.change });
|
|
43
|
+
if (!context.selection || !context.selection.change) {
|
|
44
|
+
return blockedView(
|
|
45
|
+
target,
|
|
46
|
+
context.reasons.length > 0
|
|
47
|
+
? context.reasons
|
|
48
|
+
: ["Current OpenSpec context selects no change."],
|
|
49
|
+
context.warnings
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const change = context.selection.change;
|
|
54
|
+
const tasksPath = path.join(repo, "openspec", "changes", change, "tasks.md");
|
|
55
|
+
if (!fs.existsSync(tasksPath)) {
|
|
56
|
+
return blockedView(
|
|
57
|
+
target,
|
|
58
|
+
[`Selected change has no tasks artifact: ${change}.`],
|
|
59
|
+
context.warnings
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
const records = parseTasks(fs.readFileSync(tasksPath, "utf8"));
|
|
63
|
+
if (records.length === 0) {
|
|
64
|
+
return blockedView(
|
|
65
|
+
target,
|
|
66
|
+
[`Selected change has no checklist task to project: ${change}.`],
|
|
67
|
+
context.warnings
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const view = {
|
|
72
|
+
version: TASKS_VIEW_VERSION,
|
|
73
|
+
change,
|
|
74
|
+
tasks: records.map((record) => ({
|
|
75
|
+
id: record.id,
|
|
76
|
+
title: record.title,
|
|
77
|
+
checked: record.checked,
|
|
78
|
+
})),
|
|
79
|
+
defaultTask: context.selection.task || null,
|
|
80
|
+
fingerprint: context.contract ? context.contract.fingerprint : null,
|
|
81
|
+
mirroring: "current-agent-manual",
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
return {
|
|
85
|
+
version: TASKS_VIEW_VERSION,
|
|
86
|
+
status: "ready",
|
|
87
|
+
target,
|
|
88
|
+
source: {
|
|
89
|
+
authority: "OpenSpec",
|
|
90
|
+
owner: `openspec/changes/${change}/tasks.md`,
|
|
91
|
+
change,
|
|
92
|
+
},
|
|
93
|
+
view,
|
|
94
|
+
reasons: [],
|
|
95
|
+
warnings: context.warnings,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function renderTasksView(result) {
|
|
100
|
+
const lines = [
|
|
101
|
+
`Keel native tasks view: ${result.status}`,
|
|
102
|
+
`Target: ${result.target}`,
|
|
103
|
+
];
|
|
104
|
+
if (result.source) lines.push(`Owner: ${result.source.owner}`);
|
|
105
|
+
if (result.view) {
|
|
106
|
+
for (const task of result.view.tasks) {
|
|
107
|
+
const box = task.checked ? "x" : " ";
|
|
108
|
+
const marker = task.id === result.view.defaultTask ? " <- default" : "";
|
|
109
|
+
lines.push(`- [${box}] ${task.id} ${task.title}${marker}`);
|
|
110
|
+
}
|
|
111
|
+
lines.push("Mirroring: the current agent reflects this view manually; "
|
|
112
|
+
+ "host-side task state never writes back to OpenSpec.");
|
|
113
|
+
}
|
|
114
|
+
for (const reason of result.reasons) lines.push(`Reason: ${reason}`);
|
|
115
|
+
for (const warning of result.warnings) lines.push(`Warning: ${warning}`);
|
|
116
|
+
return `${lines.join("\n")}\n`;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
module.exports = {
|
|
120
|
+
TASKS_VIEW_VERSION,
|
|
121
|
+
compileTasksView,
|
|
122
|
+
renderTasksView,
|
|
123
|
+
};
|