@deftai/directive-core 0.75.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 (74) hide show
  1. package/dist/agents-md-budget/evaluate.d.ts +8 -1
  2. package/dist/agents-md-budget/evaluate.js +77 -22
  3. package/dist/agents-md-budget/skill-frontmatter.d.ts +2 -0
  4. package/dist/agents-md-budget/skill-frontmatter.js +4 -3
  5. package/dist/cache/operations.d.ts +2 -0
  6. package/dist/cache/operations.js +16 -1
  7. package/dist/content-contracts/skills/skill-frontmatter.js +4 -0
  8. package/dist/doctor/constants.js +3 -3
  9. package/dist/doctor/index.d.ts +1 -0
  10. package/dist/doctor/index.js +1 -0
  11. package/dist/doctor/main.js +2 -1
  12. package/dist/doctor/payload-staleness.js +62 -63
  13. package/dist/doctor/release-availability.d.ts +28 -0
  14. package/dist/doctor/release-availability.js +35 -0
  15. package/dist/eval/crud-telemetry.d.ts +5 -4
  16. package/dist/eval/crud-telemetry.js +9 -5
  17. package/dist/eval/health.d.ts +5 -4
  18. package/dist/eval/health.js +24 -16
  19. package/dist/eval/readback.js +2 -8
  20. package/dist/index.d.ts +1 -0
  21. package/dist/index.js +1 -0
  22. package/dist/init-deposit/scaffold.js +28 -17
  23. package/dist/intake/issue-ingest.js +23 -4
  24. package/dist/metrics/index.d.ts +2 -0
  25. package/dist/metrics/index.js +2 -0
  26. package/dist/metrics/resolve-metrics-home.d.ts +50 -0
  27. package/dist/metrics/resolve-metrics-home.js +125 -0
  28. package/dist/packaging/openpackage-tiers.d.ts +12 -0
  29. package/dist/packaging/openpackage-tiers.js +42 -0
  30. package/dist/plan-sequence/index.d.ts +3 -0
  31. package/dist/plan-sequence/index.js +3 -0
  32. package/dist/plan-sequence/store.d.ts +6 -0
  33. package/dist/plan-sequence/store.js +29 -0
  34. package/dist/plan-sequence/types.d.ts +79 -0
  35. package/dist/plan-sequence/types.js +220 -0
  36. package/dist/preflight/evaluate.d.ts +5 -2
  37. package/dist/preflight/evaluate.js +9 -4
  38. package/dist/preflight/index.d.ts +1 -1
  39. package/dist/preflight/index.js +1 -1
  40. package/dist/release/pipeline-fixture.d.ts +3 -0
  41. package/dist/release/pipeline-fixture.js +11 -0
  42. package/dist/release/pipeline.js +4 -0
  43. package/dist/release/version.d.ts +2 -0
  44. package/dist/release/version.js +42 -0
  45. package/dist/release-e2e/npm-ops.js +20 -6
  46. package/dist/scope/transition.js +17 -2
  47. package/dist/scope/vbrief-ref.d.ts +6 -0
  48. package/dist/scope/vbrief-ref.js +21 -2
  49. package/dist/session/index.d.ts +1 -0
  50. package/dist/session/index.js +1 -0
  51. package/dist/session/posture.d.ts +50 -0
  52. package/dist/session/posture.js +152 -0
  53. package/dist/session/ritual-sentinel.d.ts +2 -0
  54. package/dist/session/ritual-sentinel.js +3 -0
  55. package/dist/session/session-start.d.ts +8 -0
  56. package/dist/session/session-start.js +43 -0
  57. package/dist/session/verify-session-ritual.d.ts +6 -0
  58. package/dist/session/verify-session-ritual.js +67 -4
  59. package/dist/triage/bootstrap/gitignore.js +8 -4
  60. package/dist/triage/cache-path.js +16 -3
  61. package/dist/triage/welcome/writers.js +2 -0
  62. package/dist/ts-check-lane/index.d.ts +1 -1
  63. package/dist/ts-check-lane/index.js +1 -1
  64. package/dist/ts-check-lane/run-lane.d.ts +5 -0
  65. package/dist/ts-check-lane/run-lane.js +15 -0
  66. package/dist/vbrief-build/constants.d.ts +3 -3
  67. package/dist/vbrief-build/constants.js +4 -3
  68. package/dist/vbrief-build/index.d.ts +1 -1
  69. package/dist/vbrief-build/index.js +1 -1
  70. package/dist/verify-env/command-spawn.d.ts +24 -0
  71. package/dist/verify-env/command-spawn.js +78 -0
  72. package/dist/verify-env/index.d.ts +1 -0
  73. package/dist/verify-env/index.js +1 -0
  74. package/package.json +7 -3
@@ -1,8 +1,9 @@
1
- /** Canonical ``vBRIEFInfo.version`` emitted on scope vBRIEFs (#533). */
2
- export const EMITTED_VBRIEF_VERSION = "0.6";
1
+ import { VBRIEF_VERSION } from "@deftai/directive-types";
2
+ /** Canonical envelope version emitted on new scope xBRIEFs (#533, #2318). */
3
+ export const EMITTED_VBRIEF_VERSION = VBRIEF_VERSION;
3
4
  /** Migrator provenance namespace under ``plan.metadata`` (#616). */
4
5
  export const MIGRATOR_METADATA_KEY = "x-migrator";
5
- export const PROJECT_DEFINITION_REL_PATH = "vbrief/PROJECT-DEFINITION.vbrief.json";
6
+ /** Layout-aware PROJECT-DEFINITION paths live in ``project-definition-io.ts`` / ``policy/resolve.ts`` (#2302). */
6
7
  export const DEPRECATION_SENTINEL = "<!-- deft:deprecated-redirect -->";
7
8
  export const INTERNAL_REFERENCE_TYPES = new Set([
8
9
  "x-vbrief/plan",
@@ -1,5 +1,5 @@
1
1
  export { createScopeVbrief, referenceHasRequiredFields, referenceWithDefaultTrust, setTodayForTests, slugify, TODAY, } from "./build.js";
2
- export { DEFAULT_STATUS_FOR_FOLDER, DEPRECATION_SENTINEL, EMITTED_VBRIEF_VERSION, EXTERNAL_REFERENCE_TYPES, FOLDER_TO_STATUSES, INTERNAL_REFERENCE_TYPES, LIFECYCLE_FOLDERS, MIGRATOR_METADATA_KEY, PROJECT_DEFINITION_REL_PATH, STATUS_TO_FOLDER, } from "./constants.js";
2
+ export { DEFAULT_STATUS_FOR_FOLDER, DEPRECATION_SENTINEL, EMITTED_VBRIEF_VERSION, EXTERNAL_REFERENCE_TYPES, FOLDER_TO_STATUSES, INTERNAL_REFERENCE_TYPES, LIFECYCLE_FOLDERS, MIGRATOR_METADATA_KEY, STATUS_TO_FOLDER, } from "./constants.js";
3
3
  export { pythonJsonPretty } from "./json.js";
4
4
  export { cmdVbriefBuild, run, usage } from "./main.js";
5
5
  export { PARITY_SCENARIO_NAMES, renderScenarioOutput, runParityScenario, SAMPLE_PROJECT_MD, SAMPLE_ROADMAP_MD, SAMPLE_SPEC_MD, SAMPLE_SPEC_VBRIEF, } from "./parity-scenarios.js";
@@ -1,5 +1,5 @@
1
1
  export { createScopeVbrief, referenceHasRequiredFields, referenceWithDefaultTrust, setTodayForTests, slugify, TODAY, } from "./build.js";
2
- export { DEFAULT_STATUS_FOR_FOLDER, DEPRECATION_SENTINEL, EMITTED_VBRIEF_VERSION, EXTERNAL_REFERENCE_TYPES, FOLDER_TO_STATUSES, INTERNAL_REFERENCE_TYPES, LIFECYCLE_FOLDERS, MIGRATOR_METADATA_KEY, PROJECT_DEFINITION_REL_PATH, STATUS_TO_FOLDER, } from "./constants.js";
2
+ export { DEFAULT_STATUS_FOR_FOLDER, DEPRECATION_SENTINEL, EMITTED_VBRIEF_VERSION, EXTERNAL_REFERENCE_TYPES, FOLDER_TO_STATUSES, INTERNAL_REFERENCE_TYPES, LIFECYCLE_FOLDERS, MIGRATOR_METADATA_KEY, STATUS_TO_FOLDER, } from "./constants.js";
3
3
  export { pythonJsonPretty } from "./json.js";
4
4
  export { cmdVbriefBuild, run, usage } from "./main.js";
5
5
  export { PARITY_SCENARIO_NAMES, renderScenarioOutput, runParityScenario, SAMPLE_PROJECT_MD, SAMPLE_ROADMAP_MD, SAMPLE_SPEC_MD, SAMPLE_SPEC_VBRIEF, } from "./parity-scenarios.js";
@@ -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.75.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.75.0",
289
- "@deftai/directive-types": "^0.75.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": {