@deftai/directive-core 0.76.0 → 0.77.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.
Files changed (35) hide show
  1. package/dist/agents-md-budget/evaluate.d.ts +8 -1
  2. package/dist/agents-md-budget/evaluate.js +54 -19
  3. package/dist/content-contracts/skills/skill-frontmatter.js +4 -0
  4. package/dist/doctor/constants.js +3 -3
  5. package/dist/doctor/index.d.ts +1 -0
  6. package/dist/doctor/index.js +1 -0
  7. package/dist/doctor/main.js +2 -1
  8. package/dist/doctor/payload-staleness.js +62 -63
  9. package/dist/doctor/release-availability.d.ts +28 -0
  10. package/dist/doctor/release-availability.js +35 -0
  11. package/dist/eval/crud-telemetry.d.ts +5 -4
  12. package/dist/eval/crud-telemetry.js +9 -5
  13. package/dist/eval/health.d.ts +5 -4
  14. package/dist/eval/health.js +24 -16
  15. package/dist/eval/readback.js +2 -8
  16. package/dist/index.d.ts +1 -0
  17. package/dist/index.js +1 -0
  18. package/dist/metrics/index.d.ts +2 -0
  19. package/dist/metrics/index.js +2 -0
  20. package/dist/metrics/resolve-metrics-home.d.ts +50 -0
  21. package/dist/metrics/resolve-metrics-home.js +125 -0
  22. package/dist/plan-sequence/index.d.ts +3 -0
  23. package/dist/plan-sequence/index.js +3 -0
  24. package/dist/plan-sequence/store.d.ts +6 -0
  25. package/dist/plan-sequence/store.js +29 -0
  26. package/dist/plan-sequence/types.d.ts +79 -0
  27. package/dist/plan-sequence/types.js +220 -0
  28. package/dist/release/version.d.ts +2 -0
  29. package/dist/release/version.js +42 -0
  30. package/dist/release-e2e/npm-ops.js +20 -6
  31. package/dist/verify-env/command-spawn.d.ts +24 -0
  32. package/dist/verify-env/command-spawn.js +78 -0
  33. package/dist/verify-env/index.d.ts +1 -0
  34. package/dist/verify-env/index.js +1 -0
  35. package/package.json +7 -3
@@ -0,0 +1,24 @@
1
+ import type { SpawnResult } from "../release/types.js";
2
+ export interface ResolveCommandOnPathOptions {
3
+ readonly env?: NodeJS.ProcessEnv;
4
+ readonly platform?: NodeJS.Platform;
5
+ readonly exists?: (path: string) => boolean;
6
+ }
7
+ /** Windows command shims (.cmd/.bat) need a shell; native executables do not. */
8
+ export declare function shouldUseShellForCommand(command: string, platform?: NodeJS.Platform): boolean;
9
+ /**
10
+ * Resolve an executable on PATH with PATHEXT / Path awareness (#2467 / #2548).
11
+ * Mirrors ts-check-lane `resolvePnpm` and verify-tools `defaultProbe`.
12
+ */
13
+ export declare function resolveCommandOnPath(command: string, options?: ResolveCommandOnPathOptions): string | null;
14
+ export interface SpawnCommandTextOptions {
15
+ readonly cwd?: string;
16
+ readonly env?: NodeJS.ProcessEnv;
17
+ readonly timeoutMs?: number;
18
+ }
19
+ /**
20
+ * spawnSync wrapper that applies win32 PATHEXT / shell rules (#2467 / #2548).
21
+ * Retries with `shell: true` on win32 ENOENT (npm global `.cmd` shims).
22
+ */
23
+ export declare function spawnCommandText(cmd: string, args: readonly string[], options?: SpawnCommandTextOptions): SpawnResult;
24
+ //# sourceMappingURL=command-spawn.d.ts.map
@@ -0,0 +1,78 @@
1
+ import { spawnSync } from "node:child_process";
2
+ import { existsSync } from "node:fs";
3
+ import { posix, win32 } from "node:path";
4
+ import { SUBPROCESS_MAX_BUFFER } from "../subprocess/max-buffer.js";
5
+ /** Windows command shims (.cmd/.bat) need a shell; native executables do not. */
6
+ export function shouldUseShellForCommand(command, platform = process.platform) {
7
+ return platform === "win32" && /\.(?:cmd|bat)$/i.test(command);
8
+ }
9
+ /**
10
+ * Resolve an executable on PATH with PATHEXT / Path awareness (#2467 / #2548).
11
+ * Mirrors ts-check-lane `resolvePnpm` and verify-tools `defaultProbe`.
12
+ */
13
+ export function resolveCommandOnPath(command, options = {}) {
14
+ const env = options.env ?? process.env;
15
+ const platform = options.platform ?? process.platform;
16
+ const exists = options.exists ?? existsSync;
17
+ const pathValue = env.PATH ?? env.Path ?? "";
18
+ if (pathValue === "") {
19
+ return null;
20
+ }
21
+ const isWindows = platform === "win32";
22
+ const exts = isWindows ? (env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";") : [""];
23
+ const sep = isWindows ? ";" : ":";
24
+ const joinPath = isWindows ? win32.join : posix.join;
25
+ for (const dir of pathValue.split(sep)) {
26
+ if (dir === "")
27
+ continue;
28
+ for (const ext of exts) {
29
+ const candidate = joinPath(dir, `${command}${ext}`);
30
+ if (exists(candidate)) {
31
+ return candidate;
32
+ }
33
+ }
34
+ }
35
+ return null;
36
+ }
37
+ /**
38
+ * spawnSync wrapper that applies win32 PATHEXT / shell rules (#2467 / #2548).
39
+ * Retries with `shell: true` on win32 ENOENT (npm global `.cmd` shims).
40
+ */
41
+ export function spawnCommandText(cmd, args, options = {}) {
42
+ const trySpawn = (shell) => spawnSync(cmd, [...args], {
43
+ cwd: options.cwd,
44
+ env: options.env ?? process.env,
45
+ encoding: "utf8",
46
+ timeout: options.timeoutMs,
47
+ maxBuffer: SUBPROCESS_MAX_BUFFER,
48
+ stdio: ["ignore", "pipe", "pipe"],
49
+ shell,
50
+ });
51
+ let result = trySpawn(shouldUseShellForCommand(cmd));
52
+ const spawnErr = result.error;
53
+ if (spawnErr?.code === "ENOENT" && process.platform === "win32") {
54
+ result = trySpawn(true);
55
+ }
56
+ let status = result.status;
57
+ let stderr = typeof result.stderr === "string" ? result.stderr : "";
58
+ if (status === null) {
59
+ if (result.signal !== null && result.signal !== undefined) {
60
+ status = 128;
61
+ }
62
+ else if (result.error) {
63
+ status = 2;
64
+ if (stderr.trim().length === 0) {
65
+ stderr = result.error.message;
66
+ }
67
+ }
68
+ else {
69
+ status = 0;
70
+ }
71
+ }
72
+ return {
73
+ status,
74
+ stdout: typeof result.stdout === "string" ? result.stdout : "",
75
+ stderr,
76
+ };
77
+ }
78
+ //# sourceMappingURL=command-spawn.js.map
@@ -1,3 +1,4 @@
1
+ export * from "./command-spawn.js";
1
2
  export * from "./node-runtime.js";
2
3
  export * from "./toolchain-check.js";
3
4
  export * from "./verify-hooks-installed.js";
@@ -1,3 +1,4 @@
1
+ export * from "./command-spawn.js";
1
2
  export * from "./node-runtime.js";
2
3
  export * from "./toolchain-check.js";
3
4
  export * from "./verify-hooks-installed.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deftai/directive-core",
3
- "version": "0.76.0",
3
+ "version": "0.77.0",
4
4
  "description": "TypeScript engine core for the Directive framework.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -62,6 +62,10 @@
62
62
  "types": "./dist/session/index.d.ts",
63
63
  "default": "./dist/session/index.js"
64
64
  },
65
+ "./plan-sequence": {
66
+ "types": "./dist/plan-sequence/index.d.ts",
67
+ "default": "./dist/plan-sequence/index.js"
68
+ },
65
69
  "./slice": {
66
70
  "types": "./dist/slice/index.d.ts",
67
71
  "default": "./dist/slice/index.js"
@@ -285,8 +289,8 @@
285
289
  "provenance": true
286
290
  },
287
291
  "dependencies": {
288
- "@deftai/directive-content": "^0.76.0",
289
- "@deftai/directive-types": "^0.76.0",
292
+ "@deftai/directive-content": "^0.77.0",
293
+ "@deftai/directive-types": "^0.77.0",
290
294
  "archiver": "^8.0.0"
291
295
  },
292
296
  "scripts": {