@planu/cli 8.8.0 → 8.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.
- package/CHANGELOG.md +7 -0
- package/README.md +7 -3
- package/dist/sdd-engine/canonical-tools.d.ts +26 -0
- package/dist/sdd-engine/canonical-tools.js +31 -1
- package/dist/sdd-engine/client-workspace.d.ts +8 -1
- package/dist/sdd-engine/client-workspace.js +168 -1
- package/dist/sdd-engine/contracts.d.ts +1 -23
- package/dist/sdd-engine/contracts.js +1 -18
- package/dist/sdd-engine/host-rule-pack.js +4 -2
- package/dist/sdd-engine/host-skill-reader.d.ts +12 -11
- package/dist/sdd-engine/host-skill-reader.js +235 -225
- package/dist/sdd-engine/source-descriptor.d.ts +3 -0
- package/dist/sdd-engine/source-descriptor.js +332 -0
- package/dist/sdd-engine/tools/execution-tools.d.ts +2 -1
- package/dist/sdd-engine/tools/execution-tools.js +58 -33
- package/dist/sdd-engine/tools/workspace-tools.d.ts +2 -1
- package/dist/sdd-engine/tools/workspace-tools.js +2 -2
- package/dist/sdd-engine/tools.js +4 -2
- package/dist/sdd-engine/workspace-root.d.ts +33 -7
- package/dist/sdd-engine/workspace-root.js +204 -139
- package/dist/types/completion.d.ts +20 -2
- package/dist/types/resume-views.d.ts +21 -0
- package/dist/types/sdd-engine.d.ts +23 -60
- package/dist/types/verification.d.ts +59 -0
- package/package.json +1 -1
- package/templates/AGENTS.md +2 -0
- package/templates/host/planu-sdd.md +2 -0
- package/templates/skills/preflight-guardian.md +2 -0
- package/templates/skills/spec-executor.md +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [8.9.0]
|
|
2
|
+
|
|
3
|
+
- Add an opt-in bounded source view with strict UTF-8 and a cursor bound to the server, request and physical snapshot.
|
|
4
|
+
- Limit each request to 65,536 source bytes and 64 descriptor reads, at most 200 completed selected lines and an 8,192-byte UTF-8 JSON response.
|
|
5
|
+
- The snapshot digest is metadata-based, not a content checksum; a same-UID replacement after the final filesystem check is not transactionally excluded.
|
|
6
|
+
- Preserve the legacy default and nine tools. The cursor grants no permission, retry authority or verification time.
|
|
7
|
+
|
|
1
8
|
## [8.8.0]
|
|
2
9
|
|
|
3
10
|
- Add a version 1 server implementation capability descriptor to setup diagnostics for supported views and observations.
|
package/README.md
CHANGED
|
@@ -144,14 +144,18 @@ The reviewed operator procedure is in the repository guide `docs/verification-bu
|
|
|
144
144
|
|
|
145
145
|
## Read-only diagnostics
|
|
146
146
|
|
|
147
|
-
|
|
147
|
+
For an opt-in bounded source read, first require `engineCapabilities.version=1`, `views.sdd_read_file_slice` containing `bounded`, and `observations.sourceSlice=1` in setup diagnostics. Treat absent or unknown versions or capability values as unsupported; never probe a mutation. Request `sdd_read_file_slice` with `view="bounded"`, a path and line range, then follow each non-null `nextCursor` read-only on the same server instance with the same normalized path and range. The cursor binds the server, root, request and physical snapshot; the snapshot digest is not a checksum of file contents. The default legacy read remains unchanged.
|
|
148
|
+
|
|
149
|
+
Each request reads at most 65,536 source bytes in at most 64 descriptor read calls, completes at most 200 selected lines per page and returns a compact JSON text envelope of at most 8,192 UTF-8 bytes. A continuation grants no permission, retry authority or verification time. A same-UID replacement after the last filesystem check is not transactionally excluded.
|
|
150
|
+
|
|
151
|
+
The existing nine tools expose additive diagnostics since 8.4.0; 8.5.0 adds compact resume and history views, and 8.6.0 adds bounded execution views and explicit evidence checkpoints. 8.7.0 adds advisory budget observations and verification process evidence. 8.8.0 adds the server implementation capability descriptor version 1 to setup diagnostics. 8.9.0 adds the opt-in bounded source view. An ordinary `sdd_get_active_task` request keeps its previous response shape.
|
|
148
152
|
|
|
149
153
|
`sdd_list_features` includes `hostSkills`. For example, a missing installed role can produce this field (other installed files match the available bundled reference):
|
|
150
154
|
|
|
151
155
|
```json
|
|
152
156
|
{
|
|
153
157
|
"version": 1,
|
|
154
|
-
"bundledVersion": "8.
|
|
158
|
+
"bundledVersion": "8.9.0",
|
|
155
159
|
"baseline": "available",
|
|
156
160
|
"catalog": "unverified",
|
|
157
161
|
"issues": [{
|
|
@@ -384,7 +388,7 @@ See the [Planu Proprietary Free-Use License](LICENSE) and [planu.dev/license](ht
|
|
|
384
388
|
"mcpServers": {
|
|
385
389
|
"planu": {
|
|
386
390
|
"command": "npx",
|
|
387
|
-
"args": ["-y", "@planu/cli@8.
|
|
391
|
+
"args": ["-y", "@planu/cli@8.9.0"],
|
|
388
392
|
"cwd": ".",
|
|
389
393
|
"env": {
|
|
390
394
|
"PLANU_WORKSPACE": "."
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import type { EngineCapabilitiesV1 } from '../types/resume-views.js';
|
|
2
3
|
export declare const CANONICAL_SDD_TOOL_NAMES: readonly ['sdd_init_workspace', 'sdd_list_features', 'sdd_create_feature', 'sdd_lock_spec', 'sdd_read_spec_artifact', 'sdd_read_file_slice', 'sdd_get_active_task', 'sdd_apply_file_patch', 'sdd_complete_task'];
|
|
3
4
|
export declare const ENGINE_CAPABILITIES: EngineCapabilitiesV1;
|
|
@@ -30,4 +31,29 @@ export declare const TOOL_ANNOTATIONS: Readonly<{
|
|
|
30
31
|
readOnlyHint: false;
|
|
31
32
|
}>;
|
|
32
33
|
}>;
|
|
34
|
+
export declare const ListFeaturesInputSchema: z.ZodObject<{
|
|
35
|
+
status_filter: z.ZodOptional<z.ZodEnum<{
|
|
36
|
+
all: "all";
|
|
37
|
+
done: "done";
|
|
38
|
+
executing: "executing";
|
|
39
|
+
planning: "planning";
|
|
40
|
+
}>>;
|
|
41
|
+
view: z.ZodOptional<z.ZodEnum<{
|
|
42
|
+
setup_diagnostics: "setup_diagnostics";
|
|
43
|
+
}>>;
|
|
44
|
+
host: z.ZodOptional<z.ZodEnum<{
|
|
45
|
+
all: "all";
|
|
46
|
+
claude: "claude";
|
|
47
|
+
codex: "codex";
|
|
48
|
+
cursor: "cursor";
|
|
49
|
+
gemini: "gemini";
|
|
50
|
+
}>>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
export declare const ReadFileSliceInputSchema: z.ZodObject<{
|
|
53
|
+
path: z.ZodString;
|
|
54
|
+
start_line: z.ZodNumber;
|
|
55
|
+
end_line: z.ZodNumber;
|
|
56
|
+
view: z.ZodOptional<z.ZodLiteral<"bounded">>;
|
|
57
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, z.core.$strip>;
|
|
33
59
|
//# sourceMappingURL=canonical-tools.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
export const CANONICAL_SDD_TOOL_NAMES = [
|
|
2
3
|
'sdd_init_workspace',
|
|
3
4
|
'sdd_list_features',
|
|
@@ -20,6 +21,7 @@ export const ENGINE_CAPABILITIES = Object.freeze({
|
|
|
20
21
|
]),
|
|
21
22
|
views: Object.freeze({
|
|
22
23
|
sdd_list_features: Object.freeze(['setup_diagnostics']),
|
|
24
|
+
sdd_read_file_slice: Object.freeze(['bounded']),
|
|
23
25
|
sdd_get_active_task: Object.freeze([
|
|
24
26
|
'verification_preflight',
|
|
25
27
|
'resume',
|
|
@@ -33,6 +35,7 @@ export const ENGINE_CAPABILITIES = Object.freeze({
|
|
|
33
35
|
sdd_lock_spec: Object.freeze(['lock', 'evidence_checkpoint']),
|
|
34
36
|
}),
|
|
35
37
|
observations: Object.freeze({
|
|
38
|
+
sourceSlice: 1,
|
|
36
39
|
setupDiagnostics: 1,
|
|
37
40
|
verificationPreflight: 1,
|
|
38
41
|
resume: 1,
|
|
@@ -44,7 +47,14 @@ export const ENGINE_CAPABILITIES = Object.freeze({
|
|
|
44
47
|
verificationBudget: 1,
|
|
45
48
|
verificationProcess: 1,
|
|
46
49
|
}),
|
|
47
|
-
limits: Object.freeze({
|
|
50
|
+
limits: Object.freeze({
|
|
51
|
+
compactTextBytes: 8192,
|
|
52
|
+
defaultVerificationTimeoutMs: 180000,
|
|
53
|
+
sourceSliceBytes: 65536,
|
|
54
|
+
sourceSliceReadCalls: 64,
|
|
55
|
+
sourceSliceLines: 200,
|
|
56
|
+
sourceSliceCursorCharacters: 1024,
|
|
57
|
+
}),
|
|
48
58
|
});
|
|
49
59
|
export const TOOL_ANNOTATIONS = Object.freeze({
|
|
50
60
|
sdd_init_workspace: Object.freeze({ readOnlyHint: false }),
|
|
@@ -57,4 +67,24 @@ export const TOOL_ANNOTATIONS = Object.freeze({
|
|
|
57
67
|
sdd_apply_file_patch: Object.freeze({ readOnlyHint: false }),
|
|
58
68
|
sdd_complete_task: Object.freeze({ readOnlyHint: false }),
|
|
59
69
|
});
|
|
70
|
+
export const ListFeaturesInputSchema = z
|
|
71
|
+
.object({
|
|
72
|
+
status_filter: z.enum(['all', 'planning', 'executing', 'done']).optional(),
|
|
73
|
+
view: z.enum(['setup_diagnostics'], { error: 'Invalid setup diagnostic view.' }).optional(),
|
|
74
|
+
host: z
|
|
75
|
+
.enum(['all', 'claude', 'cursor', 'codex', 'gemini'], {
|
|
76
|
+
error: 'Invalid setup diagnostic host.',
|
|
77
|
+
})
|
|
78
|
+
.optional(),
|
|
79
|
+
})
|
|
80
|
+
.refine((input) => input.host === undefined || input.view === 'setup_diagnostics', {
|
|
81
|
+
message: 'Host requires setup diagnostics view.',
|
|
82
|
+
});
|
|
83
|
+
export const ReadFileSliceInputSchema = z.object({
|
|
84
|
+
path: z.string().min(1),
|
|
85
|
+
start_line: z.number().int().min(1),
|
|
86
|
+
end_line: z.number().int().min(1),
|
|
87
|
+
view: z.literal('bounded').optional(),
|
|
88
|
+
cursor: z.string().optional(),
|
|
89
|
+
});
|
|
60
90
|
//# sourceMappingURL=canonical-tools.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SetupDiagnostics } from '../types/resume-views.js';
|
|
3
|
+
import type { ResolvedSddWorkspace, ResolveSddWorkspaceInput, SddFailure, SddWorkspaceHandle } from '../types/sdd-engine.js';
|
|
3
4
|
export declare class McpClientWorkspace implements SddWorkspaceHandle {
|
|
4
5
|
private readonly server;
|
|
5
6
|
private readonly pinnedRoot;
|
|
@@ -11,4 +12,10 @@ export declare class McpClientWorkspace implements SddWorkspaceHandle {
|
|
|
11
12
|
private ensureRootsListener;
|
|
12
13
|
private loadRootUris;
|
|
13
14
|
}
|
|
15
|
+
export declare function parseMcpRootUri(uri: string): string | null;
|
|
16
|
+
export declare function resolveSddWorkspaceRoot(startDir?: string, env?: NodeJS.ProcessEnv, mcpRootUris?: readonly string[]): string;
|
|
17
|
+
export declare function resolveSddWorkspace(input?: ResolveSddWorkspaceInput): ResolvedSddWorkspace;
|
|
18
|
+
export declare function isHomeFallbackWorkspace(resolved: ResolvedSddWorkspace, env?: NodeJS.ProcessEnv): boolean;
|
|
19
|
+
export declare function homeFallbackFailure(resolved: ResolvedSddWorkspace, trigger: string, env?: NodeJS.ProcessEnv): SddFailure | null;
|
|
20
|
+
export declare function clientInfo(value: unknown): Pick<SetupDiagnostics, 'client' | 'clientMetadataCause'>;
|
|
14
21
|
//# sourceMappingURL=client-workspace.d.ts.map
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { RootsListChangedNotificationSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import {
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { dirname, join, resolve, sep } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
3
5
|
const LIST_ROOTS_TIMEOUT_MS = 2000;
|
|
4
6
|
export class McpClientWorkspace {
|
|
5
7
|
server;
|
|
@@ -54,4 +56,169 @@ export class McpClientWorkspace {
|
|
|
54
56
|
return this.rootUris;
|
|
55
57
|
}
|
|
56
58
|
}
|
|
59
|
+
const ERR_WORKSPACE_UNRESOLVED_MESSAGE = 'Resolved workspace is the user home directory without MCP roots or PLANU_WORKSPACE. Set the MCP server cwd to the project, advertise MCP roots, or set a per-process PLANU_WORKSPACE. Do not pin PLANU_WORKSPACE globally.';
|
|
60
|
+
export function parseMcpRootUri(uri) {
|
|
61
|
+
const trimmed = uri.trim();
|
|
62
|
+
if (!trimmed) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
if (trimmed.startsWith('file:')) {
|
|
67
|
+
return resolve(fileURLToPath(trimmed));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
if (trimmed.startsWith('/')) {
|
|
74
|
+
return resolve(trimmed);
|
|
75
|
+
}
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
export function resolveSddWorkspaceRoot(startDir = process.cwd(), env = process.env, mcpRootUris = []) {
|
|
79
|
+
return resolveSddWorkspace({ startDir, env, mcpRootUris }).workspaceRoot;
|
|
80
|
+
}
|
|
81
|
+
export function resolveSddWorkspace(input = {}) {
|
|
82
|
+
const env = input.env ?? process.env;
|
|
83
|
+
const startDir = resolve(input.startDir ?? process.cwd());
|
|
84
|
+
if (input.pinnedRoot?.trim()) {
|
|
85
|
+
return finish(resolve(input.pinnedRoot.trim()), 'pin');
|
|
86
|
+
}
|
|
87
|
+
const fromEnv = usablePlanuWorkspaceEnv(env);
|
|
88
|
+
if (fromEnv) {
|
|
89
|
+
return finish(fromEnv, 'env');
|
|
90
|
+
}
|
|
91
|
+
const mcpDirs = unique((input.mcpRootUris ?? [])
|
|
92
|
+
.map((uri) => parseMcpRootUri(uri))
|
|
93
|
+
.filter((dir) => dir !== null));
|
|
94
|
+
for (const dir of mcpDirs) {
|
|
95
|
+
const found = nearestProjectSdd(dir, env);
|
|
96
|
+
if (found) {
|
|
97
|
+
return finish(found, 'mcp_root');
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const fromCwd = nearestProjectSdd(startDir, env);
|
|
101
|
+
if (fromCwd) {
|
|
102
|
+
return finish(fromCwd, 'cwd_walk');
|
|
103
|
+
}
|
|
104
|
+
if (mcpDirs[0]) {
|
|
105
|
+
return finish(mcpDirs[0], 'fallback');
|
|
106
|
+
}
|
|
107
|
+
return finish(startDir, 'fallback');
|
|
108
|
+
}
|
|
109
|
+
export function isHomeFallbackWorkspace(resolved, env = process.env) {
|
|
110
|
+
return resolved.source === 'fallback' && isHomeDirectory(resolved.workspaceRoot, env);
|
|
111
|
+
}
|
|
112
|
+
export function homeFallbackFailure(resolved, trigger, env = process.env) {
|
|
113
|
+
if (!isHomeFallbackWorkspace(resolved, env)) {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
success: false,
|
|
118
|
+
error: {
|
|
119
|
+
code: 'ERR_WORKSPACE_UNRESOLVED',
|
|
120
|
+
message: ERR_WORKSPACE_UNRESOLVED_MESSAGE,
|
|
121
|
+
trigger,
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function finish(workspaceRoot, source) {
|
|
126
|
+
const sddDir = join(workspaceRoot, '.sdd');
|
|
127
|
+
return {
|
|
128
|
+
workspaceRoot,
|
|
129
|
+
sddDir,
|
|
130
|
+
sddPresent: existsSync(sddDir),
|
|
131
|
+
source,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
function nearestProjectSdd(startDir, env) {
|
|
135
|
+
let dir = resolve(startDir);
|
|
136
|
+
for (;;) {
|
|
137
|
+
if (existsSync(join(dir, '.sdd')) && !isHomeDirectory(dir, env)) {
|
|
138
|
+
return dir;
|
|
139
|
+
}
|
|
140
|
+
const parent = dirname(dir);
|
|
141
|
+
if (parent === dir) {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
dir = parent;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function isHomeDirectory(dir, env) {
|
|
148
|
+
const home = env.HOME?.trim() ?? env.USERPROFILE?.trim();
|
|
149
|
+
if (!home) {
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
return resolve(dir) === resolve(home);
|
|
153
|
+
}
|
|
154
|
+
function usablePlanuWorkspaceEnv(env) {
|
|
155
|
+
const fromEnv = env.PLANU_WORKSPACE?.trim();
|
|
156
|
+
if (!fromEnv || fromEnv.includes('${')) {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
const expanded = expandHomePrefix(fromEnv, env);
|
|
160
|
+
if (!expanded) {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
const resolved = resolve(expanded);
|
|
164
|
+
if (resolved.includes(`${sep}~${sep}`) || resolved.endsWith(`${sep}~`)) {
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
if (isHomeDirectory(resolved, env)) {
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
return resolved;
|
|
171
|
+
}
|
|
172
|
+
function expandHomePrefix(raw, env) {
|
|
173
|
+
if (raw === '~' || raw.startsWith('~/') || raw.startsWith('~\\')) {
|
|
174
|
+
const home = env.HOME?.trim() ?? env.USERPROFILE?.trim();
|
|
175
|
+
if (!home) {
|
|
176
|
+
return null;
|
|
177
|
+
}
|
|
178
|
+
if (raw === '~') {
|
|
179
|
+
return home;
|
|
180
|
+
}
|
|
181
|
+
return join(home, raw.slice(2));
|
|
182
|
+
}
|
|
183
|
+
return raw;
|
|
184
|
+
}
|
|
185
|
+
function unique(values) {
|
|
186
|
+
const seen = new Set();
|
|
187
|
+
const out = [];
|
|
188
|
+
for (const value of values) {
|
|
189
|
+
if (seen.has(value)) {
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
seen.add(value);
|
|
193
|
+
out.push(value);
|
|
194
|
+
}
|
|
195
|
+
return out;
|
|
196
|
+
}
|
|
197
|
+
export function clientInfo(value) {
|
|
198
|
+
if (value === undefined || value === null) {
|
|
199
|
+
return { client: null, clientMetadataCause: 'unavailable' };
|
|
200
|
+
}
|
|
201
|
+
if (typeof value !== 'object' ||
|
|
202
|
+
!('name' in value) ||
|
|
203
|
+
!('version' in value) ||
|
|
204
|
+
typeof value.name !== 'string' ||
|
|
205
|
+
typeof value.version !== 'string' ||
|
|
206
|
+
Array.from(value.name + value.version).some((char) => {
|
|
207
|
+
const code = char.codePointAt(0) ?? 0;
|
|
208
|
+
return code < 32 || (code >= 127 && code <= 159);
|
|
209
|
+
})) {
|
|
210
|
+
return { client: null, clientMetadataCause: 'invalid' };
|
|
211
|
+
}
|
|
212
|
+
if (Buffer.byteLength(value.name) > 128 || Buffer.byteLength(value.version) > 128) {
|
|
213
|
+
return { client: null, clientMetadataCause: 'over_limit' };
|
|
214
|
+
}
|
|
215
|
+
return {
|
|
216
|
+
client: {
|
|
217
|
+
name: value.name,
|
|
218
|
+
version: value.version,
|
|
219
|
+
source: 'initialize',
|
|
220
|
+
provenance: 'client_reported',
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
}
|
|
57
224
|
//# sourceMappingURL=client-workspace.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { ListFeaturesInputSchema, ReadFileSliceInputSchema } from './canonical-tools.js';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
import type { EvidenceCheckpointInput } from '../types/sdd-engine.js';
|
|
3
4
|
export type { ArtifactType, FilePermission, ErrorCode, SddErrorDetails, SddSuccess, SddFailure, SddResult, InitWorkspaceInput, ListFeaturesInput, CreateFeatureInput, LockSpecInput, ReadSpecArtifactInput, ReadFileSliceInput, GetActiveTaskInput, ApplyFilePatchInput, CompleteTaskInput, ParsedManifest, ActiveTaskDetails, ActiveTaskResult, CompleteTaskResult, FeatureSummary, } from '../types/sdd-engine.js';
|
|
@@ -37,24 +38,6 @@ export declare const InitWorkspaceInputSchema: z.ZodObject<{
|
|
|
37
38
|
}>;
|
|
38
39
|
force: z.ZodOptional<z.ZodBoolean>;
|
|
39
40
|
}, z.core.$strip>;
|
|
40
|
-
export declare const ListFeaturesInputSchema: z.ZodObject<{
|
|
41
|
-
status_filter: z.ZodOptional<z.ZodEnum<{
|
|
42
|
-
all: "all";
|
|
43
|
-
done: "done";
|
|
44
|
-
executing: "executing";
|
|
45
|
-
planning: "planning";
|
|
46
|
-
}>>;
|
|
47
|
-
view: z.ZodOptional<z.ZodEnum<{
|
|
48
|
-
setup_diagnostics: "setup_diagnostics";
|
|
49
|
-
}>>;
|
|
50
|
-
host: z.ZodOptional<z.ZodEnum<{
|
|
51
|
-
all: "all";
|
|
52
|
-
claude: "claude";
|
|
53
|
-
codex: "codex";
|
|
54
|
-
cursor: "cursor";
|
|
55
|
-
gemini: "gemini";
|
|
56
|
-
}>>;
|
|
57
|
-
}, z.core.$strip>;
|
|
58
41
|
export declare const CreateFeatureInputSchema: z.ZodObject<{
|
|
59
42
|
id: z.ZodOptional<z.ZodString>;
|
|
60
43
|
title: z.ZodString;
|
|
@@ -211,11 +194,6 @@ export declare const ReadSpecArtifactInputSchema: z.ZodObject<{
|
|
|
211
194
|
tasks: "tasks";
|
|
212
195
|
}>;
|
|
213
196
|
}, z.core.$strip>;
|
|
214
|
-
export declare const ReadFileSliceInputSchema: z.ZodObject<{
|
|
215
|
-
path: z.ZodString;
|
|
216
|
-
start_line: z.ZodNumber;
|
|
217
|
-
end_line: z.ZodNumber;
|
|
218
|
-
}, z.core.$strip>;
|
|
219
197
|
export declare const ApplyFilePatchInputSchema: z.ZodObject<{
|
|
220
198
|
feature_id: z.ZodString;
|
|
221
199
|
path: z.ZodString;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { ListFeaturesInputSchema, ReadFileSliceInputSchema } from './canonical-tools.js';
|
|
1
2
|
import { ExecutionCursorInputSchema, EvidenceCursorInputSchema } from './resume-history.js';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
export const FeatureIdSchema = z
|
|
@@ -29,19 +30,6 @@ export const InitWorkspaceInputSchema = z.object({
|
|
|
29
30
|
scope: z.enum(['global', 'project']),
|
|
30
31
|
force: z.boolean().optional(),
|
|
31
32
|
});
|
|
32
|
-
export const ListFeaturesInputSchema = z
|
|
33
|
-
.object({
|
|
34
|
-
status_filter: z.enum(['all', 'planning', 'executing', 'done']).optional(),
|
|
35
|
-
view: z.enum(['setup_diagnostics'], { error: 'Invalid setup diagnostic view.' }).optional(),
|
|
36
|
-
host: z
|
|
37
|
-
.enum(['all', 'claude', 'cursor', 'codex', 'gemini'], {
|
|
38
|
-
error: 'Invalid setup diagnostic host.',
|
|
39
|
-
})
|
|
40
|
-
.optional(),
|
|
41
|
-
})
|
|
42
|
-
.refine((input) => input.host === undefined || input.view === 'setup_diagnostics', {
|
|
43
|
-
message: 'Host requires setup diagnostics view.',
|
|
44
|
-
});
|
|
45
33
|
export const CreateFeatureInputSchema = z.object({
|
|
46
34
|
id: FeatureIdSchema.optional(),
|
|
47
35
|
title: z.string().min(3),
|
|
@@ -243,11 +231,6 @@ export const ReadSpecArtifactInputSchema = z.object({
|
|
|
243
231
|
feature_id: FeatureIdSchema,
|
|
244
232
|
artifact: ArtifactTypeSchema,
|
|
245
233
|
});
|
|
246
|
-
export const ReadFileSliceInputSchema = z.object({
|
|
247
|
-
path: z.string().min(1),
|
|
248
|
-
start_line: z.number().int().min(1),
|
|
249
|
-
end_line: z.number().int().min(1),
|
|
250
|
-
});
|
|
251
234
|
export const ApplyFilePatchInputSchema = z.object({
|
|
252
235
|
feature_id: FeatureIdSchema,
|
|
253
236
|
path: z.string().min(1),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as compact from './tools/compact-result.js';
|
|
2
|
-
import {
|
|
2
|
+
import { homeFallbackFailure } from './workspace-root.js';
|
|
3
3
|
import { CANONICAL_SDD_TOOL_NAMES, ENGINE_CAPABILITIES } from './canonical-tools.js';
|
|
4
4
|
import * as fs from 'node:fs/promises';
|
|
5
5
|
import * as path from 'node:path';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
|
-
import { scanPack, legacyIssue, diagnosticRow, clientInfo } from './host-skill-reader.js';
|
|
7
|
+
import { scanPack, legacyIssue, diagnosticRow, clientInfo, readTextInsideWorkspaceDetailed, } from './host-skill-reader.js';
|
|
8
8
|
const moduleDir = path.dirname(fileURLToPath(import.meta.url));
|
|
9
9
|
const TEMPLATES_ROOT = path.resolve(moduleDir, '..', '..', 'templates');
|
|
10
10
|
export const MISSING_SDD_HINT = 'No .sdd directory in the client project. Call sdd_init_workspace with scope=project. MCP hosts should advertise roots; do not pin PLANU_WORKSPACE globally.';
|
|
@@ -18,6 +18,8 @@ After the local client has registered the MCP server and the intended project is
|
|
|
18
18
|
|
|
19
19
|
## Read-only diagnostics
|
|
20
20
|
|
|
21
|
+
For an opt-in bounded source read, first require \`engineCapabilities.version=1\`, \`views.sdd_read_file_slice\` containing \`bounded\`, and \`observations.sourceSlice=1\` in setup diagnostics. Treat an absent or unknown descriptor version or capability value as unsupported; do not probe a mutation. Use \`sdd_read_file_slice\` with \`view="bounded"\` and the required path and line range. Follow a non-null \`nextCursor\` read-only on the same server instance, repeating the same normalized path and range; the cursor is bound to that server, root, request and physical snapshot. Stop when \`nextCursor\` is null. The physical snapshot digest is not a content checksum. A same-UID replacement after the last filesystem check is not transactionally excluded. This view and its cursor grant no permission, retry authority or verification time. The default legacy read remains unchanged.
|
|
22
|
+
|
|
21
23
|
Before optional views or observations, inspect setup diagnostics and require a recognized \`engineCapabilities.version=1\` and the relevant advertised value. An absent or unknown version means unsupported; never probe a mutation or fall back to lock/relock to discover support. This describes server implementation only: host catalogues remain unverified, and a host catalogue refresh is separate from restarting MCP.
|
|
22
24
|
|
|
23
25
|
Use \`sdd_list_features.hostSkills\` to identify fixed installed role paths, causes and the bundled reference version. \`catalog\` stays \`unverified\` even when files match. An unavailable baseline requires inspecting the installation; unsafe paths require inspection before authorized setup. Project setup and client catalogue reload are explicit, separate actions.
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
}): Promise<HostSkillReadResult>;
|
|
7
|
-
export declare function scanPack(workspaceRoot: string, templatesRoot: string, slugs: string[], targetsFor: (slug: string) => string[], render: (slug: string, source: string) => string, readTarget: typeof readTextInsideWorkspaceDetailed): Promise<{
|
|
1
|
+
import type * as Models from '../types/resume-views.js';
|
|
2
|
+
import type * as Engine from '../types/sdd-engine.js';
|
|
3
|
+
import * as root from './workspace-root.js';
|
|
4
|
+
export { readTextInsideWorkspaceDetailed } from './workspace-root.js';
|
|
5
|
+
export declare function scanPack(workspaceRoot: string, templatesRoot: string, slugs: string[], targetsFor: (slug: string) => string[], render: (slug: string, source: string) => string, readTarget: typeof root.readTextInsideWorkspaceDetailed): Promise<{
|
|
8
6
|
available: boolean;
|
|
9
|
-
rows: HostScanRow[];
|
|
7
|
+
rows: Models.HostScanRow[];
|
|
10
8
|
}>;
|
|
11
|
-
export declare function legacyIssue(row: HostScanRow, available: boolean): HostSkillIssue | undefined;
|
|
12
|
-
export declare function diagnosticRow(row: HostScanRow, version: string): SetupRow;
|
|
13
|
-
export
|
|
9
|
+
export declare function legacyIssue(row: Models.HostScanRow, available: boolean): Engine.HostSkillIssue | undefined;
|
|
10
|
+
export declare function diagnosticRow(row: Models.HostScanRow, version: string): Models.SetupRow;
|
|
11
|
+
export { clientInfo } from './client-workspace.js';
|
|
12
|
+
export declare function readBoundedSource(workspaceRoot: string, input: Engine.ReadFileSliceInput, codec: root.ReadCursorCodec, signal?: AbortSignal): Promise<Engine.SddResult<{
|
|
13
|
+
sourcePage: Engine.SourcePageV1;
|
|
14
|
+
}>>;
|
|
14
15
|
//# sourceMappingURL=host-skill-reader.d.ts.map
|