@planu/cli 8.2.17 → 8.2.19

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 (36) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +22 -2
  3. package/dist/sdd-engine/completion-guard.d.ts +28 -0
  4. package/dist/sdd-engine/completion-guard.js +320 -0
  5. package/dist/sdd-engine/completion-snapshot.d.ts +11 -0
  6. package/dist/sdd-engine/completion-snapshot.js +155 -0
  7. package/dist/sdd-engine/feature-authority.d.ts +20 -0
  8. package/dist/sdd-engine/feature-authority.js +199 -0
  9. package/dist/sdd-engine/feature-manifest.d.ts +6 -0
  10. package/dist/sdd-engine/feature-manifest.js +116 -0
  11. package/dist/sdd-engine/host-rule-pack.d.ts +1 -0
  12. package/dist/sdd-engine/host-rule-pack.js +67 -7
  13. package/dist/sdd-engine/lock-integrity.d.ts +3 -18
  14. package/dist/sdd-engine/lock-integrity.js +192 -217
  15. package/dist/sdd-engine/patch-sandbox.js +1 -1
  16. package/dist/sdd-engine/server.js +4 -6
  17. package/dist/sdd-engine/task-content.d.ts +8 -0
  18. package/dist/sdd-engine/task-content.js +132 -0
  19. package/dist/sdd-engine/task-failures.d.ts +12 -0
  20. package/dist/sdd-engine/task-failures.js +125 -0
  21. package/dist/sdd-engine/task-window.d.ts +10 -4
  22. package/dist/sdd-engine/task-window.js +177 -246
  23. package/dist/sdd-engine/tools/execution-tools.js +29 -26
  24. package/dist/sdd-engine/tools/feature-store.d.ts +11 -0
  25. package/dist/sdd-engine/tools/feature-store.js +224 -0
  26. package/dist/sdd-engine/tools/workspace-tools.js +65 -127
  27. package/dist/sdd-engine/workspace-root.d.ts +3 -1
  28. package/dist/sdd-engine/workspace-root.js +69 -3
  29. package/dist/types/completion.d.ts +77 -0
  30. package/dist/types/completion.js +2 -0
  31. package/package.json +2 -2
  32. package/templates/AGENTS.md +8 -0
  33. package/templates/host/planu-sdd.md +8 -0
  34. package/templates/skills/spec-architect.md +4 -0
  35. package/templates/skills/spec-executor.md +18 -0
  36. package/templates/skills/verification-auditor.md +6 -0
@@ -0,0 +1,199 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { constants as fsConstants } from 'node:fs';
3
+ import * as fs from 'node:fs/promises';
4
+ import * as path from 'node:path';
5
+ export class CompletionGuardError extends Error {
6
+ reason;
7
+ code;
8
+ constructor(reason, message, code) {
9
+ super(message);
10
+ this.reason = reason;
11
+ this.name = 'CompletionGuardError';
12
+ this.code =
13
+ code ??
14
+ (reason === 'contract_drift'
15
+ ? 'ERR_SPEC_DRIFT'
16
+ : reason === 'guard_present'
17
+ ? 'ERR_TASK_OUT_OF_SEQUENCE'
18
+ : 'ERR_VERIFICATION_FAILED');
19
+ }
20
+ }
21
+ export function guardFailure(reason, message, code) {
22
+ throw new CompletionGuardError(reason, message, code);
23
+ }
24
+ function decodeArtifact(bytes) {
25
+ try {
26
+ return new TextDecoder('utf-8', { fatal: true, ignoreBOM: true }).decode(bytes);
27
+ }
28
+ catch {
29
+ return guardFailure('contract_drift', 'Authoritative text is not valid UTF-8.', 'ERR_INVALID_ARTIFACT');
30
+ }
31
+ }
32
+ export function physicalIdentity(stat) {
33
+ return { dev: stat.dev, ino: stat.ino, mode: stat.mode, uid: stat.uid, nlink: stat.nlink };
34
+ }
35
+ export function sameIdentity(left, right) {
36
+ return (left.dev === right.dev &&
37
+ left.ino === right.ino &&
38
+ left.mode === right.mode &&
39
+ left.uid === right.uid &&
40
+ left.nlink === right.nlink);
41
+ }
42
+ function ownedRegular(stat) {
43
+ return (stat.isFile() &&
44
+ stat.nlink === 1 &&
45
+ (typeof process.getuid !== 'function' || stat.uid === process.getuid()));
46
+ }
47
+ export function checkWritable(stat) {
48
+ if ((stat.mode & 0o222) === 0 ||
49
+ (typeof process.getuid === 'function' &&
50
+ stat.uid === process.getuid() &&
51
+ (stat.mode & 0o200) === 0)) {
52
+ guardFailure('contract_drift', 'Authoritative artifact or directory has no writable mode.', 'ERR_PERMISSION_VIOLATION');
53
+ }
54
+ }
55
+ export async function captureDirectories(featDir, workspaceRoot) {
56
+ let absolute = path.resolve(featDir);
57
+ const marker = `${path.sep}.sdd${path.sep}`;
58
+ const offset = absolute.lastIndexOf(marker);
59
+ let authorityRoot;
60
+ if (offset >= 0) {
61
+ const physicalProject = await fs.realpath(absolute.slice(0, offset) || path.parse(absolute).root);
62
+ if (workspaceRoot && (await fs.realpath(workspaceRoot)) !== physicalProject) {
63
+ guardFailure('contract_drift', 'Feature is outside its authority directory.', 'ERR_PERMISSION_VIOLATION');
64
+ }
65
+ authorityRoot = path.join(physicalProject, '.sdd');
66
+ absolute = path.join(physicalProject, absolute.slice(offset + 1));
67
+ }
68
+ else {
69
+ const physicalParent = await fs.realpath(path.dirname(absolute));
70
+ absolute = path.join(physicalParent, path.basename(absolute));
71
+ authorityRoot = absolute;
72
+ if (workspaceRoot) {
73
+ guardFailure('contract_drift', 'Feature must be beneath the workspace authority directory.', 'ERR_PERMISSION_VIOLATION');
74
+ }
75
+ }
76
+ const relative = path.relative(authorityRoot, absolute);
77
+ if (relative.startsWith('..') || path.isAbsolute(relative)) {
78
+ guardFailure('contract_drift', 'Feature is outside its authority directory.');
79
+ }
80
+ const directories = [];
81
+ let current = authorityRoot;
82
+ for (const component of ['', ...relative.split(path.sep).filter(Boolean)]) {
83
+ if (component) {
84
+ current = path.join(current, component);
85
+ }
86
+ const stat = await fs.lstat(current);
87
+ if (!stat.isDirectory() || stat.isSymbolicLink()) {
88
+ guardFailure('contract_drift', 'Feature authority contains an unsafe directory component.', 'ERR_PERMISSION_VIOLATION');
89
+ }
90
+ directories.push({ directory: current, identity: physicalIdentity(stat) });
91
+ }
92
+ return directories;
93
+ }
94
+ export async function revalidateDirectories(directories) {
95
+ for (const captured of directories) {
96
+ const current = await fs.lstat(captured.directory);
97
+ if (!current.isDirectory() ||
98
+ captured.identity.dev !== current.dev ||
99
+ captured.identity.ino !== current.ino ||
100
+ captured.identity.mode !== current.mode ||
101
+ captured.identity.uid !== current.uid) {
102
+ guardFailure('contract_drift', 'Feature authority directory identity changed.');
103
+ }
104
+ }
105
+ }
106
+ export async function readArtifact(featDir, name, limit, nonRegularCode = 'ERR_PERMISSION_VIOLATION', initialStat) {
107
+ const filePath = path.join(featDir, name);
108
+ const before = initialStat ?? (await fs.lstat(filePath));
109
+ if (!before.isFile() && !before.isSymbolicLink()) {
110
+ guardFailure('contract_drift', 'Authoritative artifact is not a regular file.', nonRegularCode);
111
+ }
112
+ if (!ownedRegular(before)) {
113
+ guardFailure('contract_drift', 'Authoritative artifact is not an owned single-link regular file.', 'ERR_PERMISSION_VIOLATION');
114
+ }
115
+ const handle = await fs.open(filePath, fsConstants.O_RDONLY | fsConstants.O_NOFOLLOW | fsConstants.O_NONBLOCK);
116
+ try {
117
+ const opened = await handle.stat();
118
+ if (!ownedRegular(opened) ||
119
+ !sameIdentity(physicalIdentity(before), physicalIdentity(opened))) {
120
+ guardFailure('contract_drift', 'Authoritative artifact identity changed during open.');
121
+ }
122
+ const content = await readDescriptorContent(handle, opened, limit);
123
+ const after = await validateArtifactRead(filePath, handle, opened);
124
+ return { content, identity: physicalIdentity(after) };
125
+ }
126
+ finally {
127
+ await handle.close();
128
+ }
129
+ }
130
+ async function readDescriptorContent(handle, opened, limit) {
131
+ if (limit !== undefined) {
132
+ if (opened.size > limit) {
133
+ guardFailure('guard_present', 'Completion owner record exceeds its bounded size.');
134
+ }
135
+ const buffer = Buffer.alloc(limit);
136
+ const { bytesRead } = await handle.read(buffer, 0, buffer.length, 0);
137
+ if ((await handle.stat()).size > limit) {
138
+ guardFailure('guard_present', 'Completion owner record exceeds its bounded size.');
139
+ }
140
+ return decodeArtifact(buffer.subarray(0, bytesRead));
141
+ }
142
+ return decodeArtifact(await handle.readFile());
143
+ }
144
+ async function validateArtifactRead(filePath, handle, opened) {
145
+ const after = await handle.stat();
146
+ const named = await fs.lstat(filePath);
147
+ if (!sameIdentity(physicalIdentity(opened), physicalIdentity(after)) ||
148
+ !sameIdentity(physicalIdentity(after), physicalIdentity(named)) ||
149
+ opened.size !== after.size ||
150
+ opened.mtimeMs !== after.mtimeMs ||
151
+ opened.ctimeMs !== after.ctimeMs) {
152
+ guardFailure('contract_drift', 'Authoritative artifact changed during descriptor read.');
153
+ }
154
+ return after;
155
+ }
156
+ export async function readFeatureArtifact(featDir, name, workspaceRoot) {
157
+ const directories = await captureDirectories(featDir, workspaceRoot);
158
+ const artifact = await readArtifact(lastAuthorityDirectory(directories).directory, name);
159
+ await revalidateDirectories(directories);
160
+ return artifact.content;
161
+ }
162
+ export async function rewriteArtifact(featDir, name, expected, content, beforeWrite) {
163
+ const handle = await fs.open(path.join(featDir, name), fsConstants.O_RDWR | fsConstants.O_NOFOLLOW | fsConstants.O_NONBLOCK);
164
+ try {
165
+ const stat = await handle.stat();
166
+ checkWritable(stat);
167
+ if (!ownedRegular(stat) ||
168
+ !sameIdentity(expected.identity, physicalIdentity(stat)) ||
169
+ decodeArtifact(await handle.readFile()) !== expected.content) {
170
+ guardFailure('contract_drift', 'Authoritative write checkpoint changed.');
171
+ }
172
+ const bytes = Buffer.from(content);
173
+ beforeWrite?.();
174
+ const written = await handle.write(bytes, 0, bytes.length, 0);
175
+ if (written.bytesWritten !== bytes.length) {
176
+ guardFailure('persistence_uncertain', 'Authoritative artifact write was partial.');
177
+ }
178
+ await handle.truncate(bytes.length);
179
+ await handle.sync();
180
+ const named = await fs.lstat(path.join(featDir, name));
181
+ if (!sameIdentity(expected.identity, physicalIdentity(named))) {
182
+ guardFailure('persistence_uncertain', 'Authoritative write identity changed.');
183
+ }
184
+ }
185
+ finally {
186
+ await handle.close();
187
+ }
188
+ }
189
+ export function hashArtifact(content) {
190
+ return createHash('sha256').update(content).digest('hex');
191
+ }
192
+ export function lastAuthorityDirectory(directories) {
193
+ const feature = directories.at(-1);
194
+ if (!feature) {
195
+ guardFailure('contract_drift', 'Feature authority has no directory capture.');
196
+ }
197
+ return feature;
198
+ }
199
+ //# sourceMappingURL=feature-authority.js.map
@@ -0,0 +1,6 @@
1
+ import type { ParsedManifest } from '../types/sdd-engine.js';
2
+ import type { TrinityCompleteness } from '../types/completion.js';
3
+ export declare function assessTrinityCompleteness(specContent: string, planContent: string, tasksContent: string): TrinityCompleteness;
4
+ export declare function parseManifestContent(content: string): ParsedManifest;
5
+ export declare function toPosixPath(value: string): string;
6
+ //# sourceMappingURL=feature-manifest.d.ts.map
@@ -0,0 +1,116 @@
1
+ import * as path from 'node:path';
2
+ const CHECKBOX_TASK = /^[-*]\s*\[[ xX]\]/u;
3
+ const BDD_KEYWORDS = [/\bGIVEN\b/u, /\bWHEN\b/u, /\bTHEN\b/u];
4
+ export function assessTrinityCompleteness(specContent, planContent, tasksContent) {
5
+ const missing = [];
6
+ if (!hasHeading(specContent, 'Out-of-Scope')) {
7
+ missing.push('out_of_scope');
8
+ }
9
+ if (!hasHeading(specContent, 'Error Matrix')) {
10
+ missing.push('error_matrix');
11
+ }
12
+ if (!BDD_KEYWORDS.every((keyword) => keyword.test(specContent))) {
13
+ missing.push('bdd');
14
+ }
15
+ if (!hasHeading(planContent, 'Frozen Dependencies')) {
16
+ missing.push('frozen_dependencies');
17
+ }
18
+ const hasTask = tasksContent.split('\n').some((line) => CHECKBOX_TASK.test(line.trim()));
19
+ const manifest = scanManifest(planContent);
20
+ if (!manifest.hasPath) {
21
+ missing.push('manifest_path');
22
+ }
23
+ if (!hasTask) {
24
+ missing.push('checkbox_task');
25
+ }
26
+ if (manifest.globDelete) {
27
+ return {
28
+ ok: false,
29
+ code: 'ERR_TRINITY_INCOMPLETE',
30
+ message: 'DELETE File Manifest entries must be exact paths, not globs.',
31
+ };
32
+ }
33
+ if (manifest.protectedWrite !== null) {
34
+ return {
35
+ ok: false,
36
+ code: 'ERR_TRINITY_INCOMPLETE',
37
+ message: `File Manifest cannot grant writes on protected root path '${manifest.protectedWrite}' (.sdd, .git, planu/specs).`,
38
+ };
39
+ }
40
+ if (missing.length === 0) {
41
+ return { ok: true };
42
+ }
43
+ return {
44
+ ok: false,
45
+ code: 'ERR_TRINITY_INCOMPLETE',
46
+ message: 'Lock requires Out-of-Scope, Error Matrix, GIVEN/WHEN/THEN acceptance criteria, Frozen Dependencies, a File Manifest path, and at least one checkbox task.',
47
+ details: { missing },
48
+ };
49
+ }
50
+ function hasHeading(content, needle) {
51
+ const escaped = needle.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
52
+ return new RegExp(`^#{1,3}\\s+.*${escaped}`, 'imu').test(content);
53
+ }
54
+ const PROTECTED_ROOTS = ['.sdd', '.git', 'planu/specs'];
55
+ function scanManifest(planContent) {
56
+ const { allowedFiles } = parseManifestContent(planContent);
57
+ let globDelete = false;
58
+ let protectedWrite = null;
59
+ for (const [entryPath, permission] of allowedFiles) {
60
+ if (permission === 'DELETE' && entryPath.includes('*')) {
61
+ globDelete = true;
62
+ }
63
+ const normalized = path.posix.normalize(entryPath).toLowerCase();
64
+ if (permission !== 'READ_ONLY' &&
65
+ protectedWrite === null &&
66
+ PROTECTED_ROOTS.some((root) => normalized === root || normalized.startsWith(`${root}/`))) {
67
+ protectedWrite = entryPath;
68
+ }
69
+ }
70
+ return { hasPath: allowedFiles.size > 0, globDelete, protectedWrite };
71
+ }
72
+ export function parseManifestContent(content) {
73
+ const allowedFiles = new Map();
74
+ let inManifestSection = false;
75
+ for (const rawLine of content.split('\n')) {
76
+ const line = rawLine.trim();
77
+ if (/^#{1,3}\s+/.test(line)) {
78
+ inManifestSection = /^#{1,3}\s+.*file\s+manifest/i.test(line);
79
+ continue;
80
+ }
81
+ if (inManifestSection && /^[-*]\s+/.test(line)) {
82
+ parseManifestLine(line, allowedFiles);
83
+ }
84
+ }
85
+ return { allowedFiles };
86
+ }
87
+ function parseManifestLine(rawLine, allowedFiles) {
88
+ const item = rawLine.replace(/^[-*]\s+/, '').trim();
89
+ const prefixMatch = /^(CREATE|MODIFY|READ_ONLY|DELETE):\s*`?([^`\s#]+)`?\s*$/i.exec(item);
90
+ if (prefixMatch?.[1] && prefixMatch[2]) {
91
+ const prefixPath = toPosixPath(prefixMatch[2].trim());
92
+ if (prefixPath.toLowerCase() === 'none') {
93
+ return;
94
+ }
95
+ allowedFiles.set(prefixPath, prefixMatch[1].toUpperCase());
96
+ return;
97
+ }
98
+ const postfixMatch = /^`?([^`\s:#]+)`?:\s*(CREATE|MODIFY|READ_ONLY|DELETE)\s*$/i.exec(item);
99
+ if (postfixMatch?.[1] && postfixMatch[2]) {
100
+ const postfixPath = toPosixPath(postfixMatch[1].trim());
101
+ if (postfixPath.toLowerCase() === 'none') {
102
+ return;
103
+ }
104
+ allowedFiles.set(postfixPath, postfixMatch[2].toUpperCase());
105
+ }
106
+ }
107
+ export function toPosixPath(value) {
108
+ const posix = value.replaceAll('\\', '/');
109
+ const absolute = posix.startsWith('/');
110
+ const joined = posix
111
+ .split('/')
112
+ .filter((part) => part !== '' && part !== '.')
113
+ .join('/');
114
+ return absolute ? `/${joined}` : joined;
115
+ }
116
+ //# sourceMappingURL=feature-manifest.js.map
@@ -1,5 +1,6 @@
1
1
  export declare function isStaleV6HostDoc(content: string): boolean;
2
2
  export declare function copyGlobalRules(workspaceRoot: string, force?: boolean): Promise<'preserved' | 'replaced' | 'created'>;
3
+ export declare function inspectHostSkillPack(workspaceRoot: string): Promise<string | undefined>;
3
4
  export declare function installHostSkillPack(workspaceRoot: string): Promise<string[]>;
4
5
  export declare function installCursorGuard(workspaceRoot: string): Promise<string[]>;
5
6
  export declare function installHostRulePack(workspaceRoot: string): Promise<string[]>;
@@ -1,12 +1,21 @@
1
1
  import * as fs from 'node:fs/promises';
2
2
  import * as path from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
+ import { readTextInsideWorkspace } from './workspace-root.js';
4
5
  const moduleDir = path.dirname(fileURLToPath(import.meta.url));
5
6
  const TEMPLATES_ROOT = path.resolve(moduleDir, '..', '..', 'templates');
6
7
  const FALLBACK_HOST_BODY = `# Planu v8 host contract
7
8
 
8
9
  The only SDD contract is \`.sdd/features/{FEAT-*}/spec.md\`, \`plan.md\`, and \`tasks.md\`.
9
10
 
11
+ ## First use in this project
12
+
13
+ After the local client has registered the MCP server and the intended project is open, use \`sdd_list_features\` to inspect setup. A setup request authorizes \`sdd_init_workspace(scope="project")\` in that identified project; connecting or inspecting alone does not. Use the default \`force=false\` to preserve an existing current AGENTS.md. Read \`.agents/skills/planu-preflight-guardian/SKILL.md\` and the matching role immediately with \`sdd_read_file_slice\` before feature work. Initialization installs nine roles in four host formats. Matching files do not prove that the host has loaded them: a host/session catalog reload may be required, separately from restarting the MCP server. Do not promise automatic compliance by every client or model.
14
+
15
+ ## Delegation
16
+
17
+ Delegate useful independent work within the active TASK through available native agents; keep trivial/dependent work sequential. Load the bounded protocol from \`spec-executor.md\` on demand; use \`spec-architect.md\` for workstream routing and \`verification-auditor.md\` for provenance checks. The parent alone applies canonical patches and certifies. Preserve all nine tools, lock, File Manifest, limits and protected-root controls; host capabilities grant no extra authority.
18
+
10
19
  - Feature IDs are \`FEAT-*\`. \`SPEC-001\` is invalid.
11
20
  - Use the nine \`sdd_*\` tools. Never call deleted v6 tools (\`create_spec\`, \`challenge_spec\`, \`check_readiness\`, \`validate\`, \`planu_status\`, …).
12
21
  - Never create, thin, or copy files under \`planu/specs/\`. Planu does not read that tree.
@@ -69,6 +78,63 @@ description: ${description}
69
78
 
70
79
  ${body}`;
71
80
  }
81
+ function hostSkillTargets(slug) {
82
+ const hostSlug = `planu-${slug}`;
83
+ return [
84
+ path.join('.claude', 'skills', hostSlug, 'SKILL.md'),
85
+ path.join('.cursor', 'skills', hostSlug, 'SKILL.md'),
86
+ path.join('.agents', 'skills', hostSlug, 'SKILL.md'),
87
+ path.join('.gemini', 'skills', `${hostSlug}.md`),
88
+ ];
89
+ }
90
+ export async function inspectHostSkillPack(workspaceRoot) {
91
+ const advisory = 'Planu host skills are missing, different, or unreadable. Run sdd_init_workspace to refresh the bundled skill pack, then read the matching role before continuing.';
92
+ let files;
93
+ try {
94
+ files = (await fs.readdir(path.join(TEMPLATES_ROOT, 'skills'))).filter((file) => file.endsWith('.md'));
95
+ }
96
+ catch {
97
+ return advisory;
98
+ }
99
+ const expectedSlugs = Object.keys(HOST_SKILL_DESCRIPTIONS);
100
+ if (files.length !== expectedSlugs.length ||
101
+ files.some((file) => !expectedSlugs.includes(file.replace(/\.md$/u, '')))) {
102
+ return advisory;
103
+ }
104
+ let differs = false;
105
+ const expected = new Map();
106
+ // Each request rereads every body. Bound concurrent descriptors and drain each
107
+ // batch before advancing, including when a file is missing or a read rejects.
108
+ for (let offset = 0; offset < files.length; offset += 8) {
109
+ const settled = await Promise.allSettled(files.slice(offset, offset + 8).map(async (file) => {
110
+ const slug = file.replace(/\.md$/u, '');
111
+ const source = await readTextInsideWorkspace(TEMPLATES_ROOT, path.join(TEMPLATES_ROOT, 'skills', file), { maxBytes: 65_536 });
112
+ return { slug, body: source.ok ? toHostSkillMarkdown(slug, source.text) : undefined };
113
+ }));
114
+ for (const result of settled) {
115
+ if (result.status === 'fulfilled' && result.value.body !== undefined) {
116
+ expected.set(result.value.slug, result.value.body);
117
+ }
118
+ else {
119
+ differs = true;
120
+ }
121
+ }
122
+ }
123
+ const targets = files.flatMap((file) => {
124
+ const slug = file.replace(/\.md$/u, '');
125
+ return hostSkillTargets(slug).map((relative) => ({ slug, relative }));
126
+ });
127
+ for (let offset = 0; offset < targets.length; offset += 8) {
128
+ const settled = await Promise.allSettled(targets.slice(offset, offset + 8).map(async ({ slug, relative }) => {
129
+ const installed = await readTextInsideWorkspace(workspaceRoot, path.join(workspaceRoot, relative), { maxBytes: 65_536 });
130
+ return installed.ok && installed.text === expected.get(slug);
131
+ }));
132
+ if (settled.some((result) => result.status === 'rejected' || !result.value)) {
133
+ differs = true;
134
+ }
135
+ }
136
+ return differs ? advisory : undefined;
137
+ }
72
138
  async function readHostBody() {
73
139
  try {
74
140
  return await fs.readFile(path.join(TEMPLATES_ROOT, 'host', 'planu-sdd.md'), 'utf-8');
@@ -84,13 +150,7 @@ export async function installHostSkillPack(workspaceRoot) {
84
150
  for (const file of files) {
85
151
  const slug = file.replace(/\.md$/u, '');
86
152
  const body = toHostSkillMarkdown(slug, await fs.readFile(path.join(skillsDir, file), 'utf-8'));
87
- const hostSlug = `planu-${slug}`;
88
- const targets = [
89
- path.join('.claude', 'skills', hostSlug, 'SKILL.md'),
90
- path.join('.cursor', 'skills', hostSlug, 'SKILL.md'),
91
- path.join('.agents', 'skills', hostSlug, 'SKILL.md'),
92
- path.join('.gemini', 'skills', `${hostSlug}.md`),
93
- ];
153
+ const targets = hostSkillTargets(slug);
94
154
  for (const relative of targets) {
95
155
  const fullPath = path.join(workspaceRoot, relative);
96
156
  await fs.mkdir(path.dirname(fullPath), { recursive: true });
@@ -1,22 +1,7 @@
1
- import type { ErrorCode, FilePermission, LockIntegrityResult, ParsedManifest } from '../types/sdd-engine.js';
2
- export declare function hashArtifact(content: string): string;
1
+ import type { FilePermission, LockIntegrityResult } from '../types/sdd-engine.js';
2
+ import type { SealResult } from '../types/completion.js';
3
3
  export declare function verifyLockedTrinity(featDir: string): Promise<LockIntegrityResult>;
4
- export declare function parseManifestContent(content: string): ParsedManifest;
5
- export declare function toPosixPath(value: string): string;
6
- export declare function writeLockedTrinity(featDir: string, featureId: string, relock: boolean, reason: string | undefined): Promise<{
7
- ok: true;
8
- specHash: string;
9
- planHash: string;
10
- tasksHash: string;
11
- relocked: boolean;
12
- } | {
13
- ok: false;
14
- code: ErrorCode;
15
- message: string;
16
- details?: {
17
- missing: string[];
18
- };
19
- }>;
4
+ export declare function writeLockedTrinity(requestedFeatDir: string, featureId: string, relock: boolean, reason: string | undefined): Promise<SealResult>;
20
5
  export declare function executionCard(featDir: string): Promise<{
21
6
  locked: boolean;
22
7
  trinity: 'ready' | 'unlocked' | 'drift';