@boyingliu01/dsh-plugin-xp-gate 0.31.4 → 0.32.2

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 (58) hide show
  1. package/README.md +51 -2
  2. package/lib/client.js +760 -0
  3. package/lib/command.d.ts +11 -5
  4. package/lib/command.d.ts.map +1 -1
  5. package/lib/command.js +19 -13
  6. package/lib/command.js.map +1 -1
  7. package/lib/credentials.d.ts +39 -0
  8. package/lib/credentials.d.ts.map +1 -0
  9. package/lib/credentials.js +57 -0
  10. package/lib/credentials.js.map +1 -0
  11. package/lib/delphi-config.d.ts +34 -3
  12. package/lib/delphi-config.d.ts.map +1 -1
  13. package/lib/delphi-config.js +117 -48
  14. package/lib/delphi-config.js.map +1 -1
  15. package/lib/delphi-run.d.ts +1 -1
  16. package/lib/delphi-run.d.ts.map +1 -1
  17. package/lib/delphi-run.js +24 -3
  18. package/lib/delphi-run.js.map +1 -1
  19. package/lib/delphi-settings.d.ts +52 -0
  20. package/lib/delphi-settings.d.ts.map +1 -0
  21. package/lib/delphi-settings.js +76 -0
  22. package/lib/delphi-settings.js.map +1 -0
  23. package/lib/delphi.d.ts +6 -0
  24. package/lib/delphi.d.ts.map +1 -1
  25. package/lib/delphi.js +101 -55
  26. package/lib/delphi.js.map +1 -1
  27. package/lib/evidence.d.ts +70 -0
  28. package/lib/evidence.d.ts.map +1 -0
  29. package/lib/evidence.js +92 -0
  30. package/lib/evidence.js.map +1 -0
  31. package/lib/gate-runner.d.ts +33 -2
  32. package/lib/gate-runner.d.ts.map +1 -1
  33. package/lib/gate-runner.js +53 -4
  34. package/lib/gate-runner.js.map +1 -1
  35. package/lib/git-context.d.ts +26 -0
  36. package/lib/git-context.d.ts.map +1 -0
  37. package/lib/git-context.js +30 -0
  38. package/lib/git-context.js.map +1 -0
  39. package/lib/hooks.d.ts +55 -0
  40. package/lib/hooks.d.ts.map +1 -0
  41. package/lib/hooks.js +152 -0
  42. package/lib/hooks.js.map +1 -0
  43. package/lib/index.d.ts +79 -1
  44. package/lib/index.d.ts.map +1 -1
  45. package/lib/index.js +385 -12
  46. package/lib/index.js.map +1 -1
  47. package/lib/skill-provider.d.ts +15 -0
  48. package/lib/skill-provider.d.ts.map +1 -0
  49. package/lib/skill-provider.js +205 -0
  50. package/lib/skill-provider.js.map +1 -0
  51. package/lib/sprint.d.ts +60 -0
  52. package/lib/sprint.d.ts.map +1 -0
  53. package/lib/sprint.js +92 -0
  54. package/lib/sprint.js.map +1 -0
  55. package/package.json +26 -10
  56. package/skills/delphi-review/AGENTS.md +3 -3
  57. package/skills/sprint-flow/AGENTS.md +3 -3
  58. package/skills/test-specification-alignment/AGENTS.md +3 -3
package/lib/index.js CHANGED
@@ -1,14 +1,49 @@
1
+ import { writeFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ import { fileURLToPath } from "node:url";
1
4
  import { defineTool } from "@deepseek-ai/dsh-tools";
5
+ import z from "@deepseek-ai/schemastery";
2
6
  import { GATE_WHITELIST, buildCommand, detectDialect, resolveTarget } from "./command.js";
3
7
  import { runXpGate } from "./gate-runner.js";
4
- import { DelphiSetupError, loadDelphiConfig, toDelphiOptions } from "./delphi-config.js";
8
+ import { DelphiSetupError, expandEnvDetailed, listCredentialReferences, loadDelphiConfig, toDelphiOptions, } from "./delphi-config.js";
9
+ import { DelphiConfigError } from "./delphi.js";
10
+ import { seatsFromSettings } from "./delphi-settings.js";
5
11
  import { formatOutcome, runReview } from "./delphi-run.js";
12
+ import { buildEvidence } from "./evidence.js";
13
+ import { readGitContext } from "./git-context.js";
14
+ import { delphiGuardDecision, isCheckablePath, isEditTool } from "./hooks.js";
15
+ import { PHASE_STATUSES, SPRINT_SUBCOMMANDS, buildSprintCommand } from "./sprint.js";
16
+ import { createSkillProvider } from "./skill-provider.js";
17
+ import { createCredentialResolver } from "./credentials.js";
6
18
  export const name = "tool-xp-gate";
7
- export const inject = ["tools", "shell"];
19
+ // "skills" is required: the bundled skill provider registers during apply(), and
20
+ // without it ctx.skills may not be mounted yet when this plugin starts.
21
+ export const inject = ["tools", "shell", "skills"];
22
+ /**
23
+ * Absolute path to the skills directory shipped alongside this module.
24
+ *
25
+ * Resolved from `import.meta.url` rather than `process.cwd()`: after an npm
26
+ * install the plugin lives in the profile's node_modules, so the working
27
+ * directory says nothing about where its assets are. This is the same
28
+ * resolution the official `@deepseek-ai/dsh-skill-office` uses.
29
+ */
30
+ function bundledSkillsRoot() {
31
+ return fileURLToPath(new URL("../skills/", import.meta.url));
32
+ }
8
33
  const DEFAULT_TIMEOUT_MS = 120_000;
9
34
  // Multi-round reviews over large inputs are slow; the transport applies its
10
35
  // own per-request timeout on top of this ceiling.
11
36
  const DELPHI_TIMEOUT_MS = 900_000;
37
+ /** The document Gate MW reads at push time. */
38
+ const EVIDENCE_FILE = ".code-walkthrough-result.json";
39
+ /**
40
+ * Files already reported on in this process.
41
+ *
42
+ * Server-lifetime rather than session-lifetime on purpose: the addon outlives any
43
+ * one session, and re-reporting the same unchanged file to a second session would
44
+ * spend a subprocess to repeat something already said.
45
+ */
46
+ const checkedThisSession = new Set();
12
47
  // Boy Scout (#447): gate-check's `gates` parameter nests one level too deep
13
48
  // inline (parameters → gates → items), so the schema lives at module scope.
14
49
  const GATES_PARAMETER = {
@@ -100,25 +135,143 @@ function gateArchTool(shell, dialect) {
100
135
  // Boy Scout (#447): the review body used to sit inline in execute() at 5 brace
101
136
  // levels (defineTool → execute → try → runReview options). Module scope keeps
102
137
  // the try/catch semantics identical while dropping two levels.
103
- async function runDelphiReview(subject, addressed, maxRounds, cwd) {
138
+ /**
139
+ * Write .code-walkthrough-result.json for Gate MW, or explain why it cannot.
140
+ *
141
+ * Returns a suffix for the tool's output rather than throwing: the review itself
142
+ * succeeded, and losing its text because evidence could not be written would be a
143
+ * worse outcome than a clear note that the push gate will not be satisfied.
144
+ */
145
+ async function writeWalkthroughEvidence(cwd, cfg, outcome) {
146
+ try {
147
+ const lastRound = outcome.rounds[outcome.rounds.length - 1];
148
+ const seats = lastRound.verdicts.map((v) => ({
149
+ role: v.role,
150
+ model: v.requestedModel,
151
+ resolved: v.resolvedModel ?? "",
152
+ }));
153
+ const git = readGitContext(cwd);
154
+ const evidence = buildEvidence({
155
+ head: git.head,
156
+ branch: git.branch,
157
+ seats,
158
+ verdict: outcome.consensus ? "APPROVED" : "REQUEST_CHANGES",
159
+ now: new Date(),
160
+ baseUrl: cfg.baseUrl,
161
+ consensusRatio: outcome.finalRatio,
162
+ });
163
+ const target = join(cwd, EVIDENCE_FILE);
164
+ await writeFile(target, `${JSON.stringify(evidence, null, 2)}\n`, "utf8");
165
+ return `\nEvidence: ${EVIDENCE_FILE} written for ${evidence.commit.slice(0, 8)}.`;
166
+ }
167
+ catch (error) {
168
+ return `\nEvidence: not written — ${error.message}`;
169
+ }
170
+ }
171
+ /**
172
+ * Build the review options from whichever source is configured.
173
+ *
174
+ * The settings page wins when it holds seats: it is the more recent edit, and a
175
+ * user who just saved three models expects the next run to use them. When it holds
176
+ * none, `.delphi-config.json` applies exactly as before — which is what keeps every
177
+ * existing project working without opening the page.
178
+ *
179
+ * Both paths end in the same `validateSeats`, so neither can produce a panel the
180
+ * skill would reject.
181
+ */
182
+ async function reviewOptions(request, resolveApiKey) {
183
+ const fromSettings = seatsFromSettings(request.settings);
184
+ if (fromSettings) {
185
+ // The seat list is already validated; only the key still has to be resolved,
186
+ // and only the credential store (not this process's environment) knows it.
187
+ const key = await resolveExpressionKey(fromSettings.apiKeyExpression, resolveApiKey);
188
+ return {
189
+ options: {
190
+ baseUrl: fromSettings.baseUrl,
191
+ apiKey: key,
192
+ seats: fromSettings.seats,
193
+ thresholdPercent: fromSettings.thresholdPercent,
194
+ maxRounds: request.maxRounds ?? fromSettings.maxRounds,
195
+ },
196
+ provider: "settings",
197
+ described: fromSettings.seats.map((s) => s.model).join(", "),
198
+ };
199
+ }
200
+ // Resolve credentials BEFORE loading the config: the loader is synchronous and
201
+ // throws as soon as a referenced variable has no value. Reading the reference
202
+ // names first turns "the DSH process never inherited WHALECLOUD_API_KEY" from a
203
+ // hard failure into a lookup in the credential store.
204
+ const apiKeyOverrides = {};
205
+ for (const name of listCredentialReferences(request.cwd)) {
206
+ const value = await resolveApiKey(name);
207
+ if (value !== undefined && value.length > 0)
208
+ apiKeyOverrides[name] = value;
209
+ }
210
+ const cfg = loadDelphiConfig(request.cwd, process.env, undefined, apiKeyOverrides);
211
+ const options = toDelphiOptions(cfg);
212
+ return {
213
+ options: { ...options, maxRounds: request.maxRounds ?? cfg.maxRounds },
214
+ provider: cfg.provider,
215
+ described: cfg.seats.map((s) => s.model).join(", "),
216
+ cfg,
217
+ };
218
+ }
219
+ /**
220
+ * Resolve a settings-supplied `api_key` expression to a usable token.
221
+ *
222
+ * Accepts the same two placeholder spellings the JSON loader accepts. A literal
223
+ * value is rejected rather than used: a bearer token typed into a settings field is
224
+ * a credential written to a profile file in plain text.
225
+ */
226
+ async function resolveExpressionKey(expression, resolveApiKey) {
227
+ const placeholder = findPlaceholderName(expression);
228
+ if (placeholder === undefined) {
229
+ if (expression.trim() !== "") {
230
+ throw new DelphiSetupError("The Delphi settings hold a literal api key. Use a credential reference instead, " +
231
+ 'e.g. "${WHALECLOUD_API_KEY}", so the token never lands in the profile file.');
232
+ }
233
+ throw new DelphiSetupError('The Delphi settings have no api key. Set it to "${YOUR_KEY_VAR}".');
234
+ }
235
+ const fromStore = await resolveApiKey(placeholder);
236
+ if (fromStore !== undefined && fromStore.length > 0)
237
+ return fromStore;
238
+ const fromEnv = expandEnvDetailed(expression, process.env);
239
+ if (fromEnv.value.trim() !== "")
240
+ return fromEnv.value;
241
+ throw new DelphiSetupError(`API key variable ${placeholder} has no value. Set it, or store it in DSH's credential store.`);
242
+ }
243
+ /** The first `${VAR}` / `{env:VAR}` name in a config value, or undefined. */
244
+ function findPlaceholderName(value) {
245
+ const shell = /\$\{([A-Za-z_][A-Za-z0-9_]*)\}/.exec(value);
246
+ if (shell)
247
+ return shell[1];
248
+ const envStyle = /\{env:([A-Za-z_][A-Za-z0-9_]*)\}/.exec(value);
249
+ return envStyle ? envStyle[1] : undefined;
250
+ }
251
+ async function runDelphiReview(subject, request) {
252
+ const { addressed, cwd, resolveApiKey, signal, writeEvidence } = request;
104
253
  try {
105
- const cfg = loadDelphiConfig(cwd);
106
- const outcome = await runReview({ ...toDelphiOptions(cfg), maxRounds: maxRounds ?? cfg.maxRounds }, subject, addressed);
107
- const seats = cfg.seats.map((s) => s.model).join(", ");
108
- return `${formatOutcome(outcome)}\n\nProvider: ${cfg.provider}\nSeats: ${seats}`;
254
+ const { options, provider, described, cfg } = await reviewOptions(request, resolveApiKey);
255
+ const outcome = await runReview(options, subject, addressed, signal);
256
+ const suffix = writeEvidence && cfg !== undefined
257
+ ? await writeWalkthroughEvidence(cwd, cfg, outcome)
258
+ : "";
259
+ return `${formatOutcome(outcome)}\n\nProvider: ${provider}\nSeats: ${described}${suffix}`;
109
260
  }
110
261
  catch (e) {
111
262
  // Config problems are the common failure; report them as guidance
112
263
  // rather than a stack trace.
113
264
  if (e instanceof DelphiSetupError)
114
265
  return `Delphi review not started: ${e.message}`;
266
+ if (e instanceof DelphiConfigError)
267
+ return `Delphi review not started: ${e.message}`;
115
268
  throw e;
116
269
  }
117
270
  }
118
- function delphiReviewTool() {
271
+ function delphiReviewTool(resolveApiKey, settings) {
119
272
  return defineTool({
120
273
  name: "delphi-review",
121
- description: "Run a Delphi cross-review of a subject (a diff, a design, a spec) using three DISTINCT models from an external OpenAI-compatible provider configured in .delphi-config.json. Round 1 is anonymous and concurrent; later rounds feed back the aggregate until the approval ratio reaches the configured threshold (default 90%) or the round cap (default 5). Use this whenever a change needs independent multi-model review rather than a single model's opinion.",
274
+ description: "Run a Delphi cross-review of a subject (a diff, a design, a spec) using three DISTINCT models from an external OpenAI-compatible provider. The seats come from the plugin's settings page (Plugins -> xp-gate -> Configure) when it holds any, otherwise from .delphi-config.json. Round 1 is anonymous and concurrent; later rounds feed back the aggregate until the approval ratio reaches the configured threshold (default 90%) or the round cap (default 5). Use this whenever a change needs independent multi-model review rather than a single model's opinion.",
122
275
  parameters: {
123
276
  subject: {
124
277
  type: "string",
@@ -137,6 +290,10 @@ function delphiReviewTool() {
137
290
  type: "string",
138
291
  description: "Project root containing .delphi-config.json (defaults to the session cwd).",
139
292
  },
293
+ writeEvidence: {
294
+ type: "boolean",
295
+ description: "Write .code-walkthrough-result.json for the Gate MW pre-push check. Off by default because it is a file side effect; requires an APPROVED review.",
296
+ },
140
297
  },
141
298
  output: {
142
299
  schema: { type: "string" },
@@ -145,18 +302,234 @@ function delphiReviewTool() {
145
302
  timeoutMs: DELPHI_TIMEOUT_MS,
146
303
  async execute(args, exec) {
147
304
  const cwd = args.cwd ?? exec.agent?.session?.header?.cwd ?? process.cwd();
148
- return runDelphiReview(args.subject, args.addressed ?? "", args.maxRounds, cwd);
305
+ return runDelphiReview(args.subject, {
306
+ addressed: args.addressed ?? "",
307
+ maxRounds: args.maxRounds,
308
+ cwd,
309
+ resolveApiKey,
310
+ signal: exec.signal,
311
+ writeEvidence: args.writeEvidence ?? false,
312
+ settings,
313
+ });
314
+ },
315
+ });
316
+ }
317
+ /**
318
+ * Sprint-flow state commands.
319
+ *
320
+ * The sprint-flow skill tells the model to run these by name; without a tool the
321
+ * instruction was unfollowable. Deliberately narrow: the subcommand and the
322
+ * phase-transition status are enumerated, and paths are quoted, so this does not
323
+ * become a passthrough to the whole CLI.
324
+ */
325
+ function sprintTool(shell, dialect) {
326
+ return defineTool({
327
+ name: "sprint",
328
+ description: "Inspect and advance XP-Gate Sprint Flow state: sprint-status, phase-transition, retro, ui-review, sprint-init, sprint-audit, next-sprint.",
329
+ parameters: {
330
+ subcommand: {
331
+ type: "string",
332
+ required: true,
333
+ description: `One of: ${SPRINT_SUBCOMMANDS.join(", ")}.`,
334
+ // Enumerated rather than free text: the schema rejects anything else before
335
+ // the value could ever reach a shell.
336
+ enum: SPRINT_SUBCOMMANDS.slice(),
337
+ },
338
+ phase: { type: "string", description: "phase-transition only: phase number, 1-6." },
339
+ status: {
340
+ type: "string",
341
+ description: "phase-transition only: phase status.",
342
+ enum: PHASE_STATUSES.slice(),
343
+ },
344
+ dir: { type: "string", description: "Project directory (absolute or relative)." },
345
+ json: { type: "boolean", description: "Request JSON output where supported." },
346
+ days: { type: "number", description: "retro only: days to look back." },
347
+ all: { type: "boolean", description: "retro only: cover every sprint." },
348
+ },
349
+ output: {
350
+ schema: { type: "string" },
351
+ render: (_args, value) => [{ type: "text", text: value }],
352
+ },
353
+ timeoutMs: DEFAULT_TIMEOUT_MS,
354
+ async execute(args, exec) {
355
+ const cwd = exec.agent?.session?.header?.cwd ?? process.cwd();
356
+ const command = buildSprintCommand(args.subcommand, args, dialect);
357
+ return runXpGate(shell, exec.signal, command, cwd, DEFAULT_TIMEOUT_MS);
149
358
  },
150
359
  });
151
360
  }
152
- export function apply(ctx, _config = {}) {
361
+ /**
362
+ * One Delphi seat, as the settings page stores it.
363
+ *
364
+ * `model` is a free string rather than an enum: the catalog the page offers comes
365
+ * from the Host's configured providers, which this schema cannot enumerate, and a
366
+ * model id that is not in the catalog yet must still be accepted so an operator can
367
+ * pin a gateway alias. The invariants that matter are checked by
368
+ * `seatsFromSettings` on every run, not by the schema.
369
+ */
370
+ const DelphiSeatSchema = z.object({
371
+ role: z.string().default(""),
372
+ model: z.string().default("").description("Model id sent to the gateway, e.g. g-glm-5.3-flash."),
373
+ maxTokens: z.number().min(0).description("Per-seat token budget; raise it for reasoning models."),
374
+ });
375
+ /**
376
+ * Runtime schema for the keys above.
377
+ *
378
+ * Exported as a schema, not just a type: DSH validates against it and surfaces the
379
+ * keys in the profile schema, so a user can discover and set them. A bare interface
380
+ * is invisible to the harness.
381
+ *
382
+ * The `delphi` block is `.volatile()`: the settings page edits it live, and DSH
383
+ * refuses to write a path that is not beneath a volatile node. The two hook
384
+ * switches stay ordinary fields — they are read at mount and remounting a hook is
385
+ * what "off" is supposed to require.
386
+ */
387
+ export const Config = z.object({
388
+ principlesCheck: z
389
+ .union([z.const("auto"), z.const("off")])
390
+ .default("auto")
391
+ .description("Save-time principles check: auto = on for source files, once per file; off = do not register the hook."),
392
+ delphiGuard: z
393
+ .union([z.const("auto"), z.const("off")])
394
+ .default("auto")
395
+ .description("Sprint write guard: auto = deny edits until delphi-review is APPROVED; off = do not register the hook."),
396
+ delphi: z
397
+ .object({
398
+ baseUrl: z.string().default("").description("OpenAI-compatible gateway, e.g. https://host/gpt-proxy."),
399
+ apiKey: z
400
+ .string()
401
+ .default("")
402
+ .description("Credential reference such as ${WHALECLOUD_API_KEY}; never a literal key."),
403
+ seats: z.array(DelphiSeatSchema).default([]).description("The three Delphi reviewers."),
404
+ thresholdPercent: z.number().min(0).max(100).description("Approval bar; 3 seats at 90% means 3/3."),
405
+ maxRounds: z.number().min(1).max(20).description("Round cap before the review reports NO CONSENSUS."),
406
+ })
407
+ .volatile()
408
+ .description("Delphi seats edited on the Plugins page. Leave seats empty to use .delphi-config.json."),
409
+ });
410
+ export function apply(ctx, config = {}) {
411
+ const cfg = config;
153
412
  // DSH runs a POSIX shell off-Windows and PowerShell on Windows; generating the
154
413
  // wrong dialect makes every tool fail to parse rather than degrade gracefully.
155
414
  const dialect = detectDialect();
156
415
  const shell = ctx.shell;
416
+ // ctx.credentials is optional: outside DSH there is no store, and the resolver
417
+ // then reads the process environment directly. Inside DSH this is what makes
418
+ // delphi-review work on a machine whose key lives in the credential store rather
419
+ // than in the host process's inherited environment.
420
+ //
421
+ // The cast is needed because the service is attached by a peer package's module
422
+ // augmentation, which only applies when that package is in the compilation; a
423
+ // consumer may install this plugin without it.
424
+ const credentials = ctx.credentials;
425
+ const resolveApiKey = createCredentialResolver(credentials, process.env);
157
426
  ctx.tools.register(gateCheckTool(shell, dialect));
158
427
  ctx.tools.register(gatePrinciplesTool(shell, dialect));
159
428
  ctx.tools.register(gateArchTool(shell, dialect));
160
- ctx.tools.register(delphiReviewTool());
429
+ ctx.tools.register(delphiReviewTool(resolveApiKey, cfg.delphi));
430
+ ctx.tools.register(sprintTool(shell, dialect));
431
+ // Publishing the 12 bundled skills is what makes them visible to the model.
432
+ // They ship in the tarball either way, but without a provider no discovery
433
+ // root points at the plugin directory and the model never sees them — the v1
434
+ // bug this provider exists to fix.
435
+ ctx.skills.registerProvider(() => createSkillProvider(bundledSkillsRoot()));
436
+ registerHooks(ctx, shell, dialect, cfg);
437
+ }
438
+ /**
439
+ * Attach the advisory principles result to an accepted tool result.
440
+ *
441
+ * Best effort by contract: a throwing post-execute fails the tool call, which is a
442
+ * much worse outcome than skipping one advisory check, so nothing here propagates.
443
+ */
444
+ async function enrichWithPrinciples(shell, dialect, exec, result, next) {
445
+ try {
446
+ const note = await principlesNote(shell, dialect, exec, result);
447
+ if (note === undefined)
448
+ return next();
449
+ const accepted = await next();
450
+ if (accepted.kind !== "accept" || accepted.value !== undefined)
451
+ return accepted;
452
+ // Appended to the tool's own output rather than as a separate message: the model
453
+ // reads it immediately, with no dependency on message identity.
454
+ return {
455
+ ...accepted,
456
+ content: [...(accepted.content ?? []), { type: "text", text: note }],
457
+ };
458
+ }
459
+ catch {
460
+ return next();
461
+ }
462
+ }
463
+ /**
464
+ * Register the pre/post-execute hooks.
465
+ *
466
+ * Both default to on and are individually switchable, because each is a policy a
467
+ * repository may reasonably reject: the guard blocks writes, and the save check
468
+ * costs a subprocess per file.
469
+ */
470
+ function registerHooks(ctx, shell, dialect, cfg) {
471
+ if (cfg.delphiGuard !== "off") {
472
+ ctx.on("tools/pre-execute", async (exec, next) => {
473
+ const cwd = sessionCwd(exec) ?? process.cwd();
474
+ // Deny before dispatch so the edit never reaches the filesystem.
475
+ return delphiGuardDecision(cwd, exec.name) ?? next();
476
+ });
477
+ }
478
+ if (cfg.principlesCheck !== "off") {
479
+ ctx.on("tools/post-execute", (exec, result, next) => enrichWithPrinciples(shell, dialect, exec, result, next));
480
+ }
481
+ }
482
+ /** The session cwd, if the execution carries one. */
483
+ function sessionCwd(exec) {
484
+ return exec.agent?.session?.header?.cwd;
485
+ }
486
+ /**
487
+ * Advisory principles result for a just-written file, or undefined to stay silent.
488
+ *
489
+ * Cost is the whole design here. `xp-gate principles` is a Node CLI with a
490
+ * 200-400ms cold start, and an editing session makes dozens of edits, so two
491
+ * filters cut nearly all of the calls:
492
+ *
493
+ * - extension allowlist: the engine covers source files, not .md/.json/.yaml,
494
+ * which are a large share of the edits in repositories that use xp-gate
495
+ * - per-process dedupe: the model often edits the same file ten times in a row, and
496
+ * those later edits are it fixing what the first check reported
497
+ *
498
+ * Anything unexpected returns undefined. Blocking the tool call to report an
499
+ * advisory violation would be far worse than missing the report.
500
+ */
501
+ async function principlesNote(shell, dialect, exec, result) {
502
+ if (!isEditTool(exec.name) || result.isError)
503
+ return undefined;
504
+ const path = writtenPath(exec.arguments);
505
+ if (path === undefined || !isCheckablePath(path))
506
+ return undefined;
507
+ const cwd = sessionCwd(exec) ?? process.cwd();
508
+ const absolute = resolveTarget(path, cwd);
509
+ if (checkedThisSession.has(absolute))
510
+ return undefined;
511
+ checkedThisSession.add(absolute);
512
+ try {
513
+ // No caller signal reaches a post-execute hook; the hook's own ceiling is enough,
514
+ // and it is the shell that enforces it.
515
+ const report = await runXpGate(shell, AbortSignal.timeout(DEFAULT_TIMEOUT_MS), buildCommand({ subcommand: "principles", target: absolute, dialect }), cwd, DEFAULT_TIMEOUT_MS);
516
+ return `[XP-Gate] principles for ${path}:\n${report}`;
517
+ }
518
+ catch {
519
+ return undefined;
520
+ }
521
+ }
522
+ /**
523
+ * The file a write/edit touched.
524
+ *
525
+ * Both shapes appear across DSH's file tools, so both are read rather than assuming
526
+ * one: `file_path` from the fs tools, `path` from str-replace-editor.
527
+ */
528
+ function writtenPath(args) {
529
+ if (typeof args !== "object" || args === null)
530
+ return undefined;
531
+ const record = args;
532
+ const candidate = record.file_path ?? record.path;
533
+ return typeof candidate === "string" && candidate.length > 0 ? candidate : undefined;
161
534
  }
162
535
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED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AO,SAAS,CAAA;IAElE,MAAM,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,CAAA;IAC7C,MAAM,QAAQ,GAAG,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IACzC,IAAI,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC;QAAE,OAAO,SAAS,CAAA;IACtD,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IAEhC,IAAI,CAAC;QACH,kFAAkF;QAClF,wCAAwC;QACxC,MAAM,MAAM,GAAG,MAAM,SAAS,CAC5B,KAAK,EACL,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC,EACvC,YAAY,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EACrE,GAAG,EACH,kBAAkB,CACnB,CAAA;QACD,OAAO,4BAA4B,IAAI,MAAM,MAAM,EAAE,CAAA;IACvD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAS,WAAW,CAAC,IAAa;IAChC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,SAAS,CAAA;IAC/D,MAAM,MAAM,GAAG,IAA+C,CAAA;IAC9D,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,IAAI,CAAA;IACjD,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAA;AACtF,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { SkillCandidate, SkillProvider } from "@deepseek-ai/dsh-skill";
2
+ /**
3
+ * Build the DSH skill candidates for every skill bundled under `root`.
4
+ * Exposed for tests and for callers that need the catalog without a provider.
5
+ */
6
+ export declare function listBundledSkills(root: string): SkillCandidate[];
7
+ /**
8
+ * Create the XP-Gate skill provider for a given skills root.
9
+ *
10
+ * Mirrors the shape of the official `@deepseek-ai/dsh-skill-office` provider:
11
+ * candidates are scanned once, bodies are re-read on every `get()` so editing a
12
+ * skill takes effect without restarting the host.
13
+ */
14
+ export declare function createSkillProvider(root: string): SkillProvider;
15
+ //# sourceMappingURL=skill-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-provider.d.ts","sourceRoot":"","sources":["../src/skill-provider.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,cAAc,EAGd,aAAa,EACd,MAAM,wBAAwB,CAAA;AA8I/B;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,EAAE,CAahE;AA6CD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAS/D"}