pi-usereq 0.5.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/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/pi-usereq/docs/REFERENCES.md +364 -393
- package/pi-usereq/docs/REQUIREMENTS.md +20 -19
- package/pi-usereq/docs/WORKFLOW.md +21 -29
- package/src/core/agent-tool-json.ts +42 -193
- package/src/core/compress-payload.ts +7 -15
- package/src/core/find-payload.ts +21 -44
- package/src/core/reference-payload.ts +6 -14
- package/src/core/token-counter.ts +3 -121
- package/src/index.ts +64 -100
- package/tests/debug-extension-harness.test.ts +15 -21
- package/tests/extension-registration.test.ts +23 -86
package/src/index.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @brief Declares the extension version string.
|
|
9
9
|
* @details The value is exported for external inspection and packaging metadata alignment. Access complexity is O(1).
|
|
10
10
|
*/
|
|
11
|
-
export const VERSION = "0.
|
|
11
|
+
export const VERSION = "0.6.0"
|
|
12
12
|
|
|
13
13
|
import path from "node:path";
|
|
14
14
|
import type {
|
|
@@ -71,11 +71,7 @@ import {
|
|
|
71
71
|
type PiNotifyPushoverRequest,
|
|
72
72
|
type PiNotifySoundLevel,
|
|
73
73
|
} from "./core/pi-notify.js";
|
|
74
|
-
import {
|
|
75
|
-
buildRuntimePathContext,
|
|
76
|
-
buildRuntimePathFacts,
|
|
77
|
-
formatRuntimePathForDisplay,
|
|
78
|
-
} from "./core/path-context.js";
|
|
74
|
+
import { formatRuntimePathForDisplay } from "./core/path-context.js";
|
|
79
75
|
import { resolveRuntimeGitPath } from "./core/runtime-project-paths.js";
|
|
80
76
|
import { showPiUsereqSettingsMenu, type PiUsereqSettingsMenuChoice } from "./core/settings-menu.js";
|
|
81
77
|
import {
|
|
@@ -164,20 +160,6 @@ function getProjectBase(cwd: string): string {
|
|
|
164
160
|
return path.resolve(cwd);
|
|
165
161
|
}
|
|
166
162
|
|
|
167
|
-
/**
|
|
168
|
-
* @brief Builds the shared runtime path facts for the current command or tool context.
|
|
169
|
-
* @details Derives installation, execution, base, config, resource, docs, test, source, and optional git paths from the cwd-derived project configuration plus runtime-only repository probing, then converts them into prompt/tool-facing strings. Runtime is O(s + p) where s is configured source-directory count and p is aggregate path length. Side effects are limited to git subprocess execution.
|
|
170
|
-
* @param[in] cwd {string} Current working directory.
|
|
171
|
-
* @param[in] config {UseReqConfig} Effective project configuration.
|
|
172
|
-
* @return {import("./core/path-context.js").RuntimePathFacts} Shared runtime path facts.
|
|
173
|
-
* @satisfies REQ-145, REQ-146
|
|
174
|
-
*/
|
|
175
|
-
function buildSharedRuntimePathFacts(cwd: string, config: UseReqConfig): import("./core/path-context.js").RuntimePathFacts {
|
|
176
|
-
const projectBase = getProjectBase(cwd);
|
|
177
|
-
const gitPath = resolveRuntimeGitPath(projectBase);
|
|
178
|
-
return buildRuntimePathFacts(buildRuntimePathContext(projectBase, config, { gitPath }));
|
|
179
|
-
}
|
|
180
|
-
|
|
181
163
|
/**
|
|
182
164
|
* @brief Loads project configuration for the extension runtime.
|
|
183
165
|
* @details Resolves the project base, loads persisted config, and normalizes configured directory paths without reading or persisting runtime-derived `base-path` or `git-path` metadata. Runtime is dominated by config I/O. Side effects are limited to filesystem reads.
|
|
@@ -263,10 +245,12 @@ function collectProjectStaticCheckSelection(
|
|
|
263
245
|
* @return {string} Newline-delimited execution diagnostics.
|
|
264
246
|
*/
|
|
265
247
|
function buildTokenToolExecutionStderr(payload: TokenToolPayload): string {
|
|
266
|
-
const skippedLines = payload.
|
|
267
|
-
.
|
|
268
|
-
|
|
269
|
-
|
|
248
|
+
const skippedLines = payload.files
|
|
249
|
+
.filter((entry) => entry.status === "skipped" && entry.error_message)
|
|
250
|
+
.map((entry) => `skipped: ${entry.canonical_path}: ${entry.error_message!}`);
|
|
251
|
+
const errorLines = payload.files
|
|
252
|
+
.filter((entry) => entry.status === "error" && entry.error_message)
|
|
253
|
+
.map((entry) => `error: ${entry.canonical_path}: ${entry.error_message!}`);
|
|
270
254
|
return [...skippedLines, ...errorLines].join("\n");
|
|
271
255
|
}
|
|
272
256
|
|
|
@@ -284,10 +268,8 @@ function buildTokenToolExecuteResult(
|
|
|
284
268
|
details: TokenToolPayload & { execution: { code: number; stderr: string } };
|
|
285
269
|
} {
|
|
286
270
|
const details = {
|
|
287
|
-
request: payload.request,
|
|
288
271
|
summary: payload.summary,
|
|
289
272
|
files: payload.files,
|
|
290
|
-
guidance: payload.guidance,
|
|
291
273
|
execution: {
|
|
292
274
|
code: payload.summary.counted_file_count > 0 ? 0 : 1,
|
|
293
275
|
stderr: buildTokenToolExecutionStderr(payload),
|
|
@@ -310,7 +292,6 @@ function buildReferenceToolExecuteResult(
|
|
|
310
292
|
details: ReferenceToolPayload & { execution: { code: number; stderr: string } };
|
|
311
293
|
} {
|
|
312
294
|
const details = {
|
|
313
|
-
request: payload.request,
|
|
314
295
|
summary: payload.summary,
|
|
315
296
|
repository: payload.repository,
|
|
316
297
|
files: payload.files,
|
|
@@ -336,7 +317,6 @@ function buildCompressionToolExecuteResult(
|
|
|
336
317
|
details: CompressToolPayload & { execution: { code: number; stderr: string } };
|
|
337
318
|
} {
|
|
338
319
|
const details = {
|
|
339
|
-
request: payload.request,
|
|
340
320
|
summary: payload.summary,
|
|
341
321
|
repository: payload.repository,
|
|
342
322
|
files: payload.files,
|
|
@@ -423,7 +403,7 @@ function buildFindToolSchemaDescription(scope: FindToolScope): string {
|
|
|
423
403
|
const inputContract = scope === "explicit-files"
|
|
424
404
|
? "Input contract: tag + pattern + files[] + optional enableLineNumbers."
|
|
425
405
|
: "Input contract: tag + pattern + optional enableLineNumbers. Scope is the configured src-dir list resolved from the current project configuration.";
|
|
426
|
-
return `${inputContract} Output contract: JSON object with
|
|
406
|
+
return `${inputContract} Output contract: JSON object with summary, repository, files, and execution. Static supported-tag matrices are documented in tool registration metadata instead of runtime responses. File entries expose structured statuses, file_doxygen, and match records with typed line ranges, stripped code lines, and structured Doxygen fields. Regex matches construct names only.`;
|
|
427
407
|
}
|
|
428
408
|
|
|
429
409
|
/**
|
|
@@ -437,13 +417,13 @@ function buildFindToolPromptGuidelines(scope: FindToolScope): string[] {
|
|
|
437
417
|
? "Scope: explicit source files selected by files[]; caller order is preserved; each item may be project-relative or absolute."
|
|
438
418
|
: "Scope: resolve src-dir from the current project configuration and scan the configured source surface from the current working directory.";
|
|
439
419
|
const outputLine = scope === "explicit-files"
|
|
440
|
-
? "Output contract:
|
|
441
|
-
: "Output contract:
|
|
420
|
+
? "Output contract: summary + repository + files + execution. Repository exposes requested file scope only when it adds dynamic search context; supported tags remain documented in registration metadata. File entries expose status, line ranges, file_doxygen, and matches; match entries expose symbol_kind, signature_text, line ranges, code_lines, stripped_source_text, and structured Doxygen fields."
|
|
421
|
+
: "Output contract: summary + repository + files + execution. Repository exposes source_directory_paths and file_canonical_paths when project-scope search context varies; supported tags remain documented in registration metadata. File entries expose status, line ranges, file_doxygen, and matches; match entries expose symbol_kind, signature_text, line ranges, code_lines, stripped_source_text, and structured Doxygen fields.";
|
|
442
422
|
return [
|
|
443
423
|
scopeLine,
|
|
444
424
|
outputLine,
|
|
445
425
|
"Regex rule: pattern is applied to construct names only with JavaScript RegExp search semantics; it never matches construct bodies; use ^...$ for exact-name matching.",
|
|
446
|
-
"Tag rule: tag is pipe-separated and case-insensitive; unsupported tags are ignored; if no valid tag remains,
|
|
426
|
+
"Tag rule: tag is pipe-separated and case-insensitive; unsupported tags are ignored; if no valid tag remains, the response search_status becomes invalid_tag_filter.",
|
|
447
427
|
"Line-number behavior: enableLineNumbers changes only display_text and stripped_source_text rendering; numeric source_line_number and line_range facts remain dedicated fields.",
|
|
448
428
|
"Failure contract: invalid tag filters, invalid regex patterns, unsupported extensions, unsupported tag-language combinations, no-match files, and analysis failures are surfaced as structured statuses plus optional execution.stderr diagnostics.",
|
|
449
429
|
...buildFindToolSupportedTagGuidelines(),
|
|
@@ -465,7 +445,6 @@ function buildFindToolExecuteResult(
|
|
|
465
445
|
} {
|
|
466
446
|
const stderr = buildFindToolExecutionStderr(payload);
|
|
467
447
|
const details = {
|
|
468
|
-
request: payload.request,
|
|
469
448
|
summary: payload.summary,
|
|
470
449
|
repository: payload.repository,
|
|
471
450
|
files: payload.files,
|
|
@@ -1131,17 +1110,17 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1131
1110
|
const gitPathSchema = Type.Object(
|
|
1132
1111
|
{},
|
|
1133
1112
|
{
|
|
1134
|
-
description: "Input contract: no params. Output contract: JSON object with
|
|
1113
|
+
description: "Input contract: no params. Output contract: JSON object with result and execution. Result exposes path_value and path_present for the cwd-derived runtime git root.",
|
|
1135
1114
|
},
|
|
1136
1115
|
);
|
|
1137
1116
|
pi.registerTool({
|
|
1138
1117
|
name: "git-path",
|
|
1139
1118
|
label: "git-path",
|
|
1140
|
-
description: "Scope: current runtime path. Return a
|
|
1119
|
+
description: "Scope: current runtime path. Return a token-optimized JSON payload with result and execution sections. Result exposes the resolved `git-path` value through direct-access fields without request echoes.",
|
|
1141
1120
|
promptSnippet: "Return the structured runtime git-root payload for the current project.",
|
|
1142
1121
|
promptGuidelines: [
|
|
1143
1122
|
"Input contract: no params. Scope is the cwd-derived runtime path context.",
|
|
1144
|
-
"Output contract:
|
|
1123
|
+
"Output contract: result + execution. Result exposes path_value and path_present.",
|
|
1145
1124
|
"Behavior contract: git-path is derived at runtime from the current working directory and repository ancestry rules.",
|
|
1146
1125
|
"Failure contract: configuration-loading failures surface through execution.code and execution.stderr_lines.",
|
|
1147
1126
|
],
|
|
@@ -1150,14 +1129,12 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1150
1129
|
ensureBundledResourcesAccessible();
|
|
1151
1130
|
const projectBase = getProjectBase(process.cwd());
|
|
1152
1131
|
const config = loadProjectConfig(process.cwd());
|
|
1153
|
-
const runtimePaths = buildSharedRuntimePathFacts(process.cwd(), config);
|
|
1154
1132
|
const result = runGitPath(projectBase, config);
|
|
1155
1133
|
const payload = buildPathQueryToolPayload(
|
|
1156
1134
|
"git-path",
|
|
1157
1135
|
process.cwd(),
|
|
1158
1136
|
projectBase,
|
|
1159
1137
|
result.stdout.trimEnd(),
|
|
1160
|
-
runtimePaths,
|
|
1161
1138
|
buildToolExecutionSection(result),
|
|
1162
1139
|
);
|
|
1163
1140
|
return buildStructuredToolExecuteResult(payload);
|
|
@@ -1167,17 +1144,17 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1167
1144
|
const basePathSchema = Type.Object(
|
|
1168
1145
|
{},
|
|
1169
1146
|
{
|
|
1170
|
-
description: "Input contract: no params. Output contract: JSON object with
|
|
1147
|
+
description: "Input contract: no params. Output contract: JSON object with result and execution. Result exposes path_value and path_present for the cwd-derived runtime base path.",
|
|
1171
1148
|
},
|
|
1172
1149
|
);
|
|
1173
1150
|
pi.registerTool({
|
|
1174
1151
|
name: "get-base-path",
|
|
1175
1152
|
label: "get-base-path",
|
|
1176
|
-
description: "Scope: current runtime path. Return a
|
|
1153
|
+
description: "Scope: current runtime path. Return a token-optimized JSON payload with result and execution sections. Result exposes the resolved `base-path` value through direct-access fields without request echoes.",
|
|
1177
1154
|
promptSnippet: "Return the structured runtime project-base payload.",
|
|
1178
1155
|
promptGuidelines: [
|
|
1179
1156
|
"Input contract: no params. Scope is the cwd-derived runtime path context.",
|
|
1180
|
-
"Output contract:
|
|
1157
|
+
"Output contract: result + execution. Result exposes path_value and path_present.",
|
|
1181
1158
|
"Behavior contract: base-path equals the current working directory used by the extension command or tool.",
|
|
1182
1159
|
"Failure contract: configuration-loading failures surface through execution.code and execution.stderr_lines.",
|
|
1183
1160
|
],
|
|
@@ -1185,14 +1162,12 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1185
1162
|
async execute() {
|
|
1186
1163
|
const projectBase = getProjectBase(process.cwd());
|
|
1187
1164
|
const config = loadProjectConfig(process.cwd());
|
|
1188
|
-
const runtimePaths = buildSharedRuntimePathFacts(process.cwd(), config);
|
|
1189
1165
|
const result = runGetBasePath(projectBase, config);
|
|
1190
1166
|
const payload = buildPathQueryToolPayload(
|
|
1191
1167
|
"get-base-path",
|
|
1192
1168
|
process.cwd(),
|
|
1193
1169
|
projectBase,
|
|
1194
1170
|
result.stdout.trimEnd(),
|
|
1195
|
-
runtimePaths,
|
|
1196
1171
|
buildToolExecutionSection(result),
|
|
1197
1172
|
);
|
|
1198
1173
|
return buildStructuredToolExecuteResult(payload);
|
|
@@ -1207,7 +1182,7 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1207
1182
|
),
|
|
1208
1183
|
},
|
|
1209
1184
|
{
|
|
1210
|
-
description: "Input contract: files[]. Output contract: JSON object with
|
|
1185
|
+
description: "Input contract: files[]. Output contract: JSON object with summary, repository, files, and execution. File entries expose canonical paths, numeric line ranges, imports, symbols, structured Doxygen fields, standalone comments, and structured status facts. Missing or unsupported inputs become skipped entries. The tool fails when no source file can be analyzed.",
|
|
1211
1186
|
},
|
|
1212
1187
|
);
|
|
1213
1188
|
const multiFileSchema = Type.Object(
|
|
@@ -1218,7 +1193,7 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1218
1193
|
),
|
|
1219
1194
|
},
|
|
1220
1195
|
{
|
|
1221
|
-
description: "Input contract: files[]. Output contract: JSON object with
|
|
1196
|
+
description: "Input contract: files[]. Output contract: JSON object with summary, files, and execution. File entries expose canonical paths, detected language, configured checker modules, selection status, and error facts.",
|
|
1222
1197
|
},
|
|
1223
1198
|
);
|
|
1224
1199
|
const filesTokensSchema = Type.Object(
|
|
@@ -1229,19 +1204,19 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1229
1204
|
),
|
|
1230
1205
|
},
|
|
1231
1206
|
{
|
|
1232
|
-
description: "Input contract: files[]. Output contract: JSON object with
|
|
1207
|
+
description: "Input contract: files[]. Output contract: JSON object with summary, files, and execution. File entries expose direct-access facts, token metrics, and optional heading or Doxygen metadata. Missing or non-file inputs become skipped entries. The tool fails when no processable files remain.",
|
|
1233
1208
|
},
|
|
1234
1209
|
);
|
|
1235
1210
|
|
|
1236
1211
|
pi.registerTool({
|
|
1237
1212
|
name: "files-tokens",
|
|
1238
1213
|
label: "files-tokens",
|
|
1239
|
-
description: "Scope: explicit files. Return
|
|
1214
|
+
description: "Scope: explicit files. Return a token-optimized JSON payload with summary, files, and execution sections. File entries expose direct-access path facts, status, size metrics, and optional heading or Doxygen metadata.",
|
|
1240
1215
|
promptSnippet: "Return the structured token-analysis payload for caller-selected files.",
|
|
1241
1216
|
promptGuidelines: [
|
|
1242
1217
|
"Scope: explicit files selected by files[]; caller order is preserved; each item may be project-relative or absolute.",
|
|
1243
|
-
"Output contract:
|
|
1244
|
-
"Numeric contract: counts, sizes, shares, and line ranges remain in dedicated numeric fields;
|
|
1218
|
+
"Output contract: summary + files + execution. File entries expose canonical paths, absolute paths, existence, file status, line range, line count, byte count, character count, token count, shares, and optional primary-heading or Doxygen file metadata.",
|
|
1219
|
+
"Numeric contract: counts, sizes, shares, and line ranges remain in dedicated numeric fields; static request metadata and derived guidance are omitted from runtime responses.",
|
|
1245
1220
|
"Behavior contract: missing or non-file inputs become skipped entries; read failures become error entries; the tool fails only when no processable files remain.",
|
|
1246
1221
|
],
|
|
1247
1222
|
parameters: filesTokensSchema,
|
|
@@ -1260,11 +1235,11 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1260
1235
|
pi.registerTool({
|
|
1261
1236
|
name: "files-references",
|
|
1262
1237
|
label: "files-references",
|
|
1263
|
-
description: "Scope: explicit source files. Return
|
|
1238
|
+
description: "Scope: explicit source files. Return a token-optimized JSON payload with summary, repository, files, and execution sections. File entries expose canonical paths, numeric line ranges, imports, symbols, structured Doxygen fields, standalone comments, and structured status facts.",
|
|
1264
1239
|
promptSnippet: "Return the structured references payload for caller-selected source files.",
|
|
1265
1240
|
promptGuidelines: [
|
|
1266
1241
|
"Scope: explicit source files selected by files[]; caller order is preserved; each item may be project-relative or absolute.",
|
|
1267
|
-
"Output contract:
|
|
1242
|
+
"Output contract: summary + repository + files + execution. File entries expose canonical paths, absolute paths, file status, line counts, line ranges, imports, symbols, child relationships, standalone comments, and structured Doxygen metadata.",
|
|
1268
1243
|
"Numeric contract: line counts, line ranges, symbol counts, import counts, comment counts, and Doxygen counts remain in dedicated numeric fields; text is limited to residual comment or signature content that cannot be split safely.",
|
|
1269
1244
|
"Behavior contract: missing inputs, non-file inputs, and unsupported extensions become structured skipped entries; analysis failures become structured error entries; the tool fails only when no source file can be analyzed.",
|
|
1270
1245
|
],
|
|
@@ -1289,18 +1264,18 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1289
1264
|
enableLineNumbers: Type.Optional(Type.Boolean({ description: "When true, `compressed_source_text` and `compressed_lines[].display_text` include original source line-number prefixes" })),
|
|
1290
1265
|
},
|
|
1291
1266
|
{
|
|
1292
|
-
description: "Input contract: files[] plus optional enableLineNumbers. Output contract: JSON object with
|
|
1267
|
+
description: "Input contract: files[] plus optional enableLineNumbers. Output contract: JSON object with summary, repository, files, and execution. File entries expose path identifiers, source and compressed line metrics, structured compressed lines, symbols, structured Doxygen fields, and stable status facts. Missing, unsupported, or invalid inputs become structured skipped entries. The tool fails when no file is compressed.",
|
|
1293
1268
|
},
|
|
1294
1269
|
);
|
|
1295
1270
|
|
|
1296
1271
|
pi.registerTool({
|
|
1297
1272
|
name: "files-compress",
|
|
1298
1273
|
label: "files-compress",
|
|
1299
|
-
description: "Scope: explicit files. Return
|
|
1274
|
+
description: "Scope: explicit files. Return a token-optimized JSON payload with summary, repository, files, and execution sections. File entries expose canonical paths, source and compressed line metrics, structured compressed lines, symbols, structured Doxygen fields, and stable status facts.",
|
|
1300
1275
|
promptSnippet: "Return the structured compression payload for caller-selected source files.",
|
|
1301
1276
|
promptGuidelines: [
|
|
1302
1277
|
"Scope: explicit source files selected by files[]; caller order is preserved; each item may be project-relative or absolute.",
|
|
1303
|
-
"Output contract:
|
|
1278
|
+
"Output contract: summary + repository + files + execution. File entries expose canonical paths, absolute paths, line_number_mode, source line counts, source line ranges, compressed line counts, removed line counts, compressed_lines, compressed_source_text, symbols, and file_doxygen.",
|
|
1304
1279
|
"Line-number behavior: enableLineNumbers changes only rendered display strings; numeric source_line_number facts remain dedicated fields on compressed_lines for direct access.",
|
|
1305
1280
|
"Behavior contract: missing inputs, non-file inputs, and unsupported extensions become structured skipped entries; compression failures become structured error entries; symbol-analysis failures retain compressed output with symbol_analysis_status=error; the tool fails only when no file is compressed.",
|
|
1306
1281
|
],
|
|
@@ -1335,7 +1310,7 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1335
1310
|
pi.registerTool({
|
|
1336
1311
|
name: "files-find",
|
|
1337
1312
|
label: "files-find",
|
|
1338
|
-
description: "Scope: explicit source files. Return
|
|
1313
|
+
description: "Scope: explicit source files. Return a token-optimized JSON payload with summary, repository, files, and execution sections. File entries expose structured statuses and match records with typed location, symbol, stripped-code, and Doxygen facts.",
|
|
1339
1314
|
promptSnippet: "Return the structured construct-search payload for caller-selected source files.",
|
|
1340
1315
|
promptGuidelines: buildFindToolPromptGuidelines("explicit-files"),
|
|
1341
1316
|
parameters: filesFindSchema,
|
|
@@ -1356,24 +1331,24 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1356
1331
|
const referencesSchema = Type.Object(
|
|
1357
1332
|
{},
|
|
1358
1333
|
{
|
|
1359
|
-
description: "Input contract: no params. Scope is the configured src-dir list resolved from the current project configuration. Output contract: JSON object with
|
|
1334
|
+
description: "Input contract: no params. Scope is the configured src-dir list resolved from the current project configuration. Output contract: JSON object with summary, repository, files, and execution. Repository exposes the structured directory tree; file entries expose canonical paths, numeric line ranges, imports, symbols, structured Doxygen fields, and status facts. The tool fails when no configured source file can be analyzed.",
|
|
1360
1335
|
},
|
|
1361
1336
|
);
|
|
1362
1337
|
const tokensSchema = Type.Object(
|
|
1363
1338
|
{},
|
|
1364
1339
|
{
|
|
1365
|
-
description: "Input contract: no params. Scope is the configured docs-dir plus canonical docs REQUIREMENTS.md, WORKFLOW.md, and REFERENCES.md. Output contract: same
|
|
1340
|
+
description: "Input contract: no params. Scope is the configured docs-dir plus canonical docs REQUIREMENTS.md, WORKFLOW.md, and REFERENCES.md. Output contract: same token-optimized JSON shape as files-tokens. Missing canonical docs become skipped entries. The tool fails when no processable canonical docs remain.",
|
|
1366
1341
|
},
|
|
1367
1342
|
);
|
|
1368
1343
|
|
|
1369
1344
|
pi.registerTool({
|
|
1370
1345
|
name: "references",
|
|
1371
1346
|
label: "references",
|
|
1372
|
-
description: "Scope: configured project source directories. Return
|
|
1347
|
+
description: "Scope: configured project source directories. Return a token-optimized JSON payload with summary, repository, files, and execution sections. The repository section exposes the structured directory tree; file entries expose canonical paths, numeric line ranges, imports, symbols, structured Doxygen fields, standalone comments, and status facts.",
|
|
1373
1348
|
promptSnippet: "Return the structured project references payload from the configured source directories.",
|
|
1374
1349
|
promptGuidelines: [
|
|
1375
1350
|
"Scope: no params; resolve src-dir from the current project configuration and scan the configured source surface from the current working directory.",
|
|
1376
|
-
"Output contract:
|
|
1351
|
+
"Output contract: summary + repository + files + execution. Repository exposes source_directory_paths, file_canonical_paths, and directory_tree; file entries expose canonical paths, line counts, line ranges, imports, symbols, hierarchy, standalone comments, and structured Doxygen metadata.",
|
|
1377
1352
|
"Configuration contract: output changes with cwd-derived project config, src-dir values, and repository source discovery; the tool does not accept explicit file overrides.",
|
|
1378
1353
|
"Behavior contract: configured source files are analyzed in deterministic order, analysis failures become structured error entries, and the tool fails when no configured source file can be analyzed.",
|
|
1379
1354
|
],
|
|
@@ -1397,18 +1372,18 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1397
1372
|
enableLineNumbers: Type.Optional(Type.Boolean({ description: "When true, `compressed_source_text` and `compressed_lines[].display_text` include original source line-number prefixes" })),
|
|
1398
1373
|
},
|
|
1399
1374
|
{
|
|
1400
|
-
description: "Input contract: optional enableLineNumbers boolean. Scope is the configured src-dir list resolved from the current project configuration. Output contract: JSON object with
|
|
1375
|
+
description: "Input contract: optional enableLineNumbers boolean. Scope is the configured src-dir list resolved from the current project configuration. Output contract: JSON object with summary, repository, files, and execution. File entries expose path identifiers, source and compressed line metrics, structured compressed lines, symbols, structured Doxygen fields, and stable status facts. The tool fails when no configured source file is compressed.",
|
|
1401
1376
|
},
|
|
1402
1377
|
);
|
|
1403
1378
|
|
|
1404
1379
|
pi.registerTool({
|
|
1405
1380
|
name: "compress",
|
|
1406
1381
|
label: "compress",
|
|
1407
|
-
description: "Scope: configured project source directories. Return
|
|
1382
|
+
description: "Scope: configured project source directories. Return a token-optimized JSON payload with summary, repository, files, and execution sections. File entries expose canonical paths, source and compressed line metrics, structured compressed lines, symbols, structured Doxygen fields, and stable status facts.",
|
|
1408
1383
|
promptSnippet: "Return the structured project compression payload from the configured source directories.",
|
|
1409
1384
|
promptGuidelines: [
|
|
1410
1385
|
"Scope: resolve src-dir from the current project configuration and scan the configured source surface from the current working directory.",
|
|
1411
|
-
"Output contract:
|
|
1386
|
+
"Output contract: summary + repository + files + execution. Repository exposes source_directory_paths and file_canonical_paths; file entries expose line_number_mode, source line counts, source line ranges, compressed line counts, removed line counts, compressed_lines, compressed_source_text, symbols, and file_doxygen.",
|
|
1412
1387
|
"Configuration contract: output changes with cwd-derived project config, src-dir values, and repository source discovery; the tool does not accept explicit file overrides.",
|
|
1413
1388
|
"Behavior contract: configured source files are processed in deterministic order, compression failures become structured error entries, symbol-analysis failures retain compressed output with symbol_analysis_status=error, and the tool fails only when no configured source file is compressed.",
|
|
1414
1389
|
],
|
|
@@ -1443,7 +1418,7 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1443
1418
|
pi.registerTool({
|
|
1444
1419
|
name: "find",
|
|
1445
1420
|
label: "find",
|
|
1446
|
-
description: "Scope: configured project source directories. Return
|
|
1421
|
+
description: "Scope: configured project source directories. Return a token-optimized JSON payload with summary, repository, files, and execution sections. File entries expose structured statuses and match records with typed location, symbol, stripped-code, and Doxygen facts.",
|
|
1447
1422
|
promptSnippet: "Return the structured construct-search payload from the configured source directories.",
|
|
1448
1423
|
promptGuidelines: buildFindToolPromptGuidelines("configured-source-directories"),
|
|
1449
1424
|
parameters: findSchema,
|
|
@@ -1468,12 +1443,12 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1468
1443
|
pi.registerTool({
|
|
1469
1444
|
name: "tokens",
|
|
1470
1445
|
label: "tokens",
|
|
1471
|
-
description: "Scope: canonical docs from the configured docs-dir. Return the same
|
|
1446
|
+
description: "Scope: canonical docs from the configured docs-dir. Return the same token-optimized JSON contract as files-tokens, omitting canonical-doc request echoes from runtime responses.",
|
|
1472
1447
|
promptSnippet: "Return the structured token-analysis payload for canonical documentation files.",
|
|
1473
1448
|
promptGuidelines: [
|
|
1474
1449
|
"Scope: no params; resolve docs-dir from project config; target canonical docs REQUIREMENTS.md, WORKFLOW.md, and REFERENCES.md.",
|
|
1475
|
-
"Output contract:
|
|
1476
|
-
"Numeric contract: counts, sizes, shares, and line ranges remain in dedicated numeric fields; guidance
|
|
1450
|
+
"Output contract: summary + files + execution. Static docs-dir and canonical-doc selection facts remain documented in registration metadata; file entries expose direct-access path facts, line ranges, sizes, token metrics, and optional metadata.",
|
|
1451
|
+
"Numeric contract: counts, sizes, shares, and line ranges remain in dedicated numeric fields; derived guidance is omitted from runtime responses to reduce token cost.",
|
|
1477
1452
|
"Behavior contract: missing canonical docs become skipped entries; read failures become error entries; the tool fails only when no processable canonical docs remain.",
|
|
1478
1453
|
],
|
|
1479
1454
|
parameters: tokensSchema,
|
|
@@ -1498,11 +1473,11 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1498
1473
|
pi.registerTool({
|
|
1499
1474
|
name: "files-static-check",
|
|
1500
1475
|
label: "files-static-check",
|
|
1501
|
-
description: "Scope: explicit files. Return a
|
|
1476
|
+
description: "Scope: explicit files. Return a token-optimized JSON payload with summary, files, and execution sections. File entries expose canonical paths, detected language, configured checker modules, selection status, and stable error facts.",
|
|
1502
1477
|
promptSnippet: "Return the structured explicit-file static-check payload for the current project configuration.",
|
|
1503
1478
|
promptGuidelines: [
|
|
1504
1479
|
"Input contract: files[]. Scope is explicit caller-selected files resolved from the current working directory.",
|
|
1505
|
-
"Output contract:
|
|
1480
|
+
"Output contract: summary + files + execution. File entries expose canonical_path, language_name, configured_checker_modules, status, and error_message.",
|
|
1506
1481
|
"Configuration contract: checker selection is derived from the cwd-resolved static-check configuration and file extensions only.",
|
|
1507
1482
|
"Failure contract: execution.code mirrors aggregated checker failures; execution.stdout_lines and execution.stderr_lines preserve residual checker diagnostics.",
|
|
1508
1483
|
],
|
|
@@ -1510,7 +1485,6 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1510
1485
|
async execute(_toolCallId, params) {
|
|
1511
1486
|
const projectBase = getProjectBase(process.cwd());
|
|
1512
1487
|
const config = loadProjectConfig(process.cwd());
|
|
1513
|
-
const runtimePaths = buildSharedRuntimePathFacts(process.cwd(), config);
|
|
1514
1488
|
const staticCheckConfig = config["static-check"] ?? {};
|
|
1515
1489
|
const result = runFilesStaticCheck(params.files, projectBase, config);
|
|
1516
1490
|
const payload = buildStaticCheckToolPayload(
|
|
@@ -1521,7 +1495,6 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1521
1495
|
[],
|
|
1522
1496
|
[],
|
|
1523
1497
|
staticCheckConfig,
|
|
1524
|
-
runtimePaths,
|
|
1525
1498
|
buildToolExecutionSection(result),
|
|
1526
1499
|
);
|
|
1527
1500
|
return buildStructuredToolExecuteResult(payload);
|
|
@@ -1531,17 +1504,17 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1531
1504
|
const staticCheckSchema = Type.Object(
|
|
1532
1505
|
{},
|
|
1533
1506
|
{
|
|
1534
|
-
description: "Input contract: no params. Scope is the configured src-dir plus tests-dir selection after fixture exclusion. Output contract: JSON object with
|
|
1507
|
+
description: "Input contract: no params. Scope is the configured src-dir plus tests-dir selection after fixture exclusion. Output contract: JSON object with summary, files, and execution.",
|
|
1535
1508
|
},
|
|
1536
1509
|
);
|
|
1537
1510
|
pi.registerTool({
|
|
1538
1511
|
name: "static-check",
|
|
1539
1512
|
label: "static-check",
|
|
1540
|
-
description: "Scope: configured source and test directories. Return a
|
|
1513
|
+
description: "Scope: configured source and test directories. Return a token-optimized JSON payload with summary, files, and execution sections. File entries expose selected-path facts, checker coverage, selection status, and residual diagnostics metadata.",
|
|
1541
1514
|
promptSnippet: "Return the structured project static-check payload for the current configuration.",
|
|
1542
1515
|
promptGuidelines: [
|
|
1543
1516
|
"Input contract: no params. Scope is src-dir plus tests-dir from the cwd-derived project configuration.",
|
|
1544
|
-
"Output contract:
|
|
1517
|
+
"Output contract: summary + files + execution. Selection-directory rules remain documented in registration metadata; file entries expose configured_checker_modules and status.",
|
|
1545
1518
|
"Selection contract: tests/fixtures and <tests-dir>/fixtures are excluded before checker dispatch.",
|
|
1546
1519
|
"Failure contract: execution.code mirrors aggregated checker failures or selection failures; execution.stderr_lines preserve residual diagnostics.",
|
|
1547
1520
|
],
|
|
@@ -1549,7 +1522,6 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1549
1522
|
async execute() {
|
|
1550
1523
|
const projectBase = getProjectBase(process.cwd());
|
|
1551
1524
|
const config = loadProjectConfig(process.cwd());
|
|
1552
|
-
const runtimePaths = buildSharedRuntimePathFacts(process.cwd(), config);
|
|
1553
1525
|
const staticCheckConfig = config["static-check"] ?? {};
|
|
1554
1526
|
const selectionDirectoryPaths = [...config["src-dir"], config["tests-dir"]];
|
|
1555
1527
|
const testsDirRel = makeRelativeIfContainsProject(config["tests-dir"], projectBase)
|
|
@@ -1577,7 +1549,6 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1577
1549
|
selectionDirectoryPaths,
|
|
1578
1550
|
excludedDirectoryPaths,
|
|
1579
1551
|
staticCheckConfig,
|
|
1580
|
-
runtimePaths,
|
|
1581
1552
|
execution,
|
|
1582
1553
|
);
|
|
1583
1554
|
return buildStructuredToolExecuteResult(payload);
|
|
@@ -1587,17 +1558,17 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1587
1558
|
const gitCheckSchema = Type.Object(
|
|
1588
1559
|
{},
|
|
1589
1560
|
{
|
|
1590
|
-
description: "Input contract: no params. Output contract: JSON object with
|
|
1561
|
+
description: "Input contract: no params. Output contract: JSON object with result and execution. Result exposes git-path presence plus aggregate repository status fields.",
|
|
1591
1562
|
},
|
|
1592
1563
|
);
|
|
1593
1564
|
pi.registerTool({
|
|
1594
1565
|
name: "git-check",
|
|
1595
1566
|
label: "git-check",
|
|
1596
|
-
description: "Scope: current runtime path. Return a
|
|
1567
|
+
description: "Scope: current runtime path. Return a token-optimized JSON payload with result and execution sections. Result exposes repository validation status through direct fields without request echoes.",
|
|
1597
1568
|
promptSnippet: "Return the structured git-validation payload for the runtime repository.",
|
|
1598
1569
|
promptGuidelines: [
|
|
1599
1570
|
"Input contract: no params. Scope is the cwd-derived runtime path context.",
|
|
1600
|
-
"Output contract:
|
|
1571
|
+
"Output contract: result + execution. Result exposes git_path_present and aggregate status.",
|
|
1601
1572
|
"Behavior contract: the tool checks work-tree membership, porcelain cleanliness, and symbolic-or-detached HEAD validity.",
|
|
1602
1573
|
"Failure contract: execution.code and execution.stderr_lines surface git-path or repository-state errors.",
|
|
1603
1574
|
],
|
|
@@ -1605,14 +1576,13 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1605
1576
|
async execute() {
|
|
1606
1577
|
const projectBase = getProjectBase(process.cwd());
|
|
1607
1578
|
const config = loadProjectConfig(process.cwd());
|
|
1608
|
-
const runtimePaths = buildSharedRuntimePathFacts(process.cwd(), config);
|
|
1609
1579
|
let execution;
|
|
1610
1580
|
try {
|
|
1611
1581
|
execution = buildToolExecutionSection(runGitCheck(projectBase, config));
|
|
1612
1582
|
} catch (error) {
|
|
1613
1583
|
execution = buildToolExecutionSection(normalizeToolFailure(error));
|
|
1614
1584
|
}
|
|
1615
|
-
const payload = buildGitCheckToolPayload(projectBase, resolveRuntimeGitPath(projectBase),
|
|
1585
|
+
const payload = buildGitCheckToolPayload(projectBase, resolveRuntimeGitPath(projectBase), execution);
|
|
1616
1586
|
return buildStructuredToolExecuteResult(payload);
|
|
1617
1587
|
},
|
|
1618
1588
|
});
|
|
@@ -1620,17 +1590,17 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1620
1590
|
const docsCheckSchema = Type.Object(
|
|
1621
1591
|
{},
|
|
1622
1592
|
{
|
|
1623
|
-
description: "Input contract: no params. Output contract: JSON object with
|
|
1593
|
+
description: "Input contract: no params. Output contract: JSON object with summary, files, and execution. File entries expose canonical paths, prompt_command remediation, and presence status for canonical docs.",
|
|
1624
1594
|
},
|
|
1625
1595
|
);
|
|
1626
1596
|
pi.registerTool({
|
|
1627
1597
|
name: "docs-check",
|
|
1628
1598
|
label: "docs-check",
|
|
1629
|
-
description: "Scope: canonical docs. Return a
|
|
1599
|
+
description: "Scope: canonical docs. Return a token-optimized JSON payload with summary, files, and execution sections. File entries expose remediation prompt commands and direct presence facts for REQUIREMENTS.md, WORKFLOW.md, and REFERENCES.md.",
|
|
1630
1600
|
promptSnippet: "Return the structured canonical-document validation payload.",
|
|
1631
1601
|
promptGuidelines: [
|
|
1632
1602
|
"Input contract: no params. Scope is docs-dir from the cwd-derived project configuration.",
|
|
1633
|
-
"Output contract:
|
|
1603
|
+
"Output contract: summary + files + execution. File entries expose file_name, canonical_path, prompt_command, and status.",
|
|
1634
1604
|
"Specialization trigger: remediation differs per missing canonical file through prompt_command.",
|
|
1635
1605
|
"Failure contract: execution.code is non-zero when any canonical document is missing; execution.stderr_lines enumerate missing files.",
|
|
1636
1606
|
],
|
|
@@ -1638,8 +1608,7 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1638
1608
|
async execute() {
|
|
1639
1609
|
const projectBase = getProjectBase(process.cwd());
|
|
1640
1610
|
const config = loadProjectConfig(process.cwd());
|
|
1641
|
-
const
|
|
1642
|
-
const payload = buildDocsCheckToolPayload(projectBase, config["docs-dir"], runtimePaths);
|
|
1611
|
+
const payload = buildDocsCheckToolPayload(projectBase, config["docs-dir"]);
|
|
1643
1612
|
return buildStructuredToolExecuteResult(payload);
|
|
1644
1613
|
},
|
|
1645
1614
|
});
|
|
@@ -1647,17 +1616,17 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1647
1616
|
const gitWtNameSchema = Type.Object(
|
|
1648
1617
|
{},
|
|
1649
1618
|
{
|
|
1650
|
-
description: "Input contract: no params. Output contract: JSON object with
|
|
1619
|
+
description: "Input contract: no params. Output contract: JSON object with result and execution. Result exposes worktree_name when generation succeeds.",
|
|
1651
1620
|
},
|
|
1652
1621
|
);
|
|
1653
1622
|
pi.registerTool({
|
|
1654
1623
|
name: "git-wt-name",
|
|
1655
1624
|
label: "git-wt-name",
|
|
1656
|
-
description: "Scope: current runtime path. Return a
|
|
1625
|
+
description: "Scope: current runtime path. Return a token-optimized JSON payload with result and execution sections. Result exposes the generated worktree name while static naming rules remain in registration metadata.",
|
|
1657
1626
|
promptSnippet: "Return the structured worktree-name generation payload.",
|
|
1658
1627
|
promptGuidelines: [
|
|
1659
1628
|
"Input contract: no params. Scope is the cwd-derived runtime path context.",
|
|
1660
|
-
"Output contract:
|
|
1629
|
+
"Output contract: result + execution. Result exposes worktree_name.",
|
|
1661
1630
|
"Behavior contract: generation follows useReq-<project>-<sanitized-branch>-<YYYYMMDDHHMMSS>.",
|
|
1662
1631
|
"Failure contract: execution.code and execution.stderr_lines surface git-path or branch-resolution errors.",
|
|
1663
1632
|
],
|
|
@@ -1665,14 +1634,13 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1665
1634
|
async execute() {
|
|
1666
1635
|
const projectBase = getProjectBase(process.cwd());
|
|
1667
1636
|
const config = loadProjectConfig(process.cwd());
|
|
1668
|
-
const runtimePaths = buildSharedRuntimePathFacts(process.cwd(), config);
|
|
1669
1637
|
let execution;
|
|
1670
1638
|
try {
|
|
1671
1639
|
execution = buildToolExecutionSection(runGitWtName(projectBase, config));
|
|
1672
1640
|
} catch (error) {
|
|
1673
1641
|
execution = buildToolExecutionSection(normalizeToolFailure(error));
|
|
1674
1642
|
}
|
|
1675
|
-
const payload = buildWorktreeNameToolPayload(projectBase, resolveRuntimeGitPath(projectBase),
|
|
1643
|
+
const payload = buildWorktreeNameToolPayload(projectBase, resolveRuntimeGitPath(projectBase), execution);
|
|
1676
1644
|
return buildStructuredToolExecuteResult(payload);
|
|
1677
1645
|
},
|
|
1678
1646
|
});
|
|
@@ -1682,17 +1650,17 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1682
1650
|
wtName: Type.String({ description: "Exact target worktree name and branch name" }),
|
|
1683
1651
|
},
|
|
1684
1652
|
{
|
|
1685
|
-
description: "Input contract: wtName. Output contract: JSON object with
|
|
1653
|
+
description: "Input contract: wtName. Output contract: JSON object with result and execution. Result exposes worktree_name and derived worktree_path.",
|
|
1686
1654
|
},
|
|
1687
1655
|
);
|
|
1688
1656
|
pi.registerTool({
|
|
1689
1657
|
name: "git-wt-create",
|
|
1690
1658
|
label: "git-wt-create",
|
|
1691
|
-
description: "Scope: current runtime path. Return a
|
|
1659
|
+
description: "Scope: current runtime path. Return a token-optimized JSON payload with result and execution sections. Result exposes the exact worktree name and derived path without static operation echoes.",
|
|
1692
1660
|
promptSnippet: "Return the structured worktree-creation payload for the requested name.",
|
|
1693
1661
|
promptGuidelines: [
|
|
1694
1662
|
"Input contract: wtName is required and must match the exact worktree/branch name to create.",
|
|
1695
|
-
"Output contract:
|
|
1663
|
+
"Output contract: result + execution. Result exposes worktree_name and worktree_path.",
|
|
1696
1664
|
"Specialization trigger: worktree_path depends on the runtime git root parent directory.",
|
|
1697
1665
|
"Failure contract: execution.code and execution.stderr_lines surface invalid-name, git, or finalization errors.",
|
|
1698
1666
|
],
|
|
@@ -1700,7 +1668,6 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1700
1668
|
async execute(_toolCallId, params) {
|
|
1701
1669
|
const projectBase = getProjectBase(process.cwd());
|
|
1702
1670
|
const config = loadProjectConfig(process.cwd());
|
|
1703
|
-
const runtimePaths = buildSharedRuntimePathFacts(process.cwd(), config);
|
|
1704
1671
|
let execution;
|
|
1705
1672
|
try {
|
|
1706
1673
|
execution = buildToolExecutionSection(runGitWtCreate(projectBase, params.wtName, config));
|
|
@@ -1712,7 +1679,6 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1712
1679
|
projectBase,
|
|
1713
1680
|
resolveRuntimeGitPath(projectBase),
|
|
1714
1681
|
params.wtName,
|
|
1715
|
-
runtimePaths,
|
|
1716
1682
|
execution,
|
|
1717
1683
|
);
|
|
1718
1684
|
return buildStructuredToolExecuteResult(payload);
|
|
@@ -1724,17 +1690,17 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1724
1690
|
wtName: Type.String({ description: "Exact target worktree name and branch name" }),
|
|
1725
1691
|
},
|
|
1726
1692
|
{
|
|
1727
|
-
description: "Input contract: wtName. Output contract: JSON object with
|
|
1693
|
+
description: "Input contract: wtName. Output contract: JSON object with result and execution. Result exposes worktree_name and derived worktree_path.",
|
|
1728
1694
|
},
|
|
1729
1695
|
);
|
|
1730
1696
|
pi.registerTool({
|
|
1731
1697
|
name: "git-wt-delete",
|
|
1732
1698
|
label: "git-wt-delete",
|
|
1733
|
-
description: "Scope: current runtime path. Return a
|
|
1699
|
+
description: "Scope: current runtime path. Return a token-optimized JSON payload with result and execution sections. Result exposes the exact worktree name and derived path without static operation echoes.",
|
|
1734
1700
|
promptSnippet: "Return the structured worktree-deletion payload for the requested name.",
|
|
1735
1701
|
promptGuidelines: [
|
|
1736
1702
|
"Input contract: wtName is required and must match the exact worktree/branch name to delete.",
|
|
1737
|
-
"Output contract:
|
|
1703
|
+
"Output contract: result + execution. Result exposes worktree_name and worktree_path.",
|
|
1738
1704
|
"Specialization trigger: worktree_path depends on the runtime git root parent directory.",
|
|
1739
1705
|
"Failure contract: execution.code and execution.stderr_lines surface missing-target or deletion errors.",
|
|
1740
1706
|
],
|
|
@@ -1742,7 +1708,6 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1742
1708
|
async execute(_toolCallId, params) {
|
|
1743
1709
|
const projectBase = getProjectBase(process.cwd());
|
|
1744
1710
|
const config = loadProjectConfig(process.cwd());
|
|
1745
|
-
const runtimePaths = buildSharedRuntimePathFacts(process.cwd(), config);
|
|
1746
1711
|
let execution;
|
|
1747
1712
|
try {
|
|
1748
1713
|
execution = buildToolExecutionSection(runGitWtDelete(projectBase, params.wtName, config));
|
|
@@ -1754,7 +1719,6 @@ function registerAgentTools(pi: ExtensionAPI): void {
|
|
|
1754
1719
|
projectBase,
|
|
1755
1720
|
resolveRuntimeGitPath(projectBase),
|
|
1756
1721
|
params.wtName,
|
|
1757
|
-
runtimePaths,
|
|
1758
1722
|
execution,
|
|
1759
1723
|
);
|
|
1760
1724
|
return buildStructuredToolExecuteResult(payload);
|