@deftai/directive-core 0.55.1 → 0.55.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.
@@ -8,8 +8,14 @@ export function checkCodebaseMapFresh(projectRoot, options) {
8
8
  const resolvedOutput = isAbsolute(options.outputPath)
9
9
  ? options.outputPath
10
10
  : join(projectRoot, options.outputPath);
11
+ // #1932: the generated MAP is an on-demand, gitignored artifact. An absent
12
+ // projection is OK (advisory) -- the gate must not force per-branch regeneration
13
+ // + commit, which guaranteed mechanical MAP.md collisions across concurrent
14
+ // branches. When a MAP IS present locally the freshness check below still flags
15
+ // it if stale; the durable plan.architecture.codeStructure stays gated by
16
+ // codebase:validate-structure.
11
17
  if (!existsSync(resolvedOutput)) {
12
- return [`generated codebase MAP is missing: ${resolvedOutput}`];
18
+ return [];
13
19
  }
14
20
  let current;
15
21
  try {
@@ -0,0 +1,3 @@
1
+ /** Reads `@deftai/directive-core` version from the installed package.json adjacent to dist/ or src/. */
2
+ export declare function readCorePackageVersion(): string;
3
+ //# sourceMappingURL=engine-version.d.ts.map
@@ -0,0 +1,23 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { dirname, join } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ const FALLBACK_VERSION = "0.0.0";
5
+ function parsePackageVersion(raw) {
6
+ const parsed = JSON.parse(raw);
7
+ if (parsed === null || typeof parsed !== "object") {
8
+ return FALLBACK_VERSION;
9
+ }
10
+ const version = parsed.version;
11
+ return typeof version === "string" && version.length > 0 ? version : FALLBACK_VERSION;
12
+ }
13
+ /** Reads `@deftai/directive-core` version from the installed package.json adjacent to dist/ or src/. */
14
+ export function readCorePackageVersion() {
15
+ try {
16
+ const pkgPath = join(dirname(fileURLToPath(import.meta.url)), "..", "package.json");
17
+ return parsePackageVersion(readFileSync(pkgPath, "utf8"));
18
+ }
19
+ catch {
20
+ return FALLBACK_VERSION;
21
+ }
22
+ }
23
+ //# sourceMappingURL=engine-version.js.map
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { readCorePackageVersion } from "./engine-version.js";
1
2
  /**
2
3
  * `@deftai/directive-core` — the deft directive engine core.
3
4
  *
@@ -50,6 +51,6 @@ export * as wipCap from "./wip-cap/index.js";
50
51
  export const CORE_PACKAGE = "@deftai/directive-core";
51
52
  /** Returns identifying metadata for the core engine package. */
52
53
  export function engineInfo() {
53
- return { name: CORE_PACKAGE, version: "0.0.0" };
54
+ return { name: CORE_PACKAGE, version: readCorePackageVersion() };
54
55
  }
55
56
  //# sourceMappingURL=index.js.map
@@ -11,6 +11,8 @@ export declare const REHEARSAL_VERSION = "0.0.1";
11
11
  * .github/workflows/npm-publish.yml (types -> core -> content -> cli).
12
12
  */
13
13
  export declare const NPM_PUBLISH_PACKAGES: readonly ["types", "core", "content", "cli"];
14
+ /** #1925: throwaway dist-tag so dry-run does not apply `latest` to 0.0.1. */
15
+ export declare const NPM_E2E_REHEARSAL_TAG = "e2e-rehearsal";
14
16
  export declare const NPM_INSTALL_TIMEOUT_SECONDS = 600;
15
17
  export declare const NPM_BUILD_TIMEOUT_SECONDS = 600;
16
18
  export declare const NPM_PUBLISH_DRYRUN_TIMEOUT_SECONDS = 180;
@@ -11,6 +11,8 @@ export const REHEARSAL_VERSION = "0.0.1";
11
11
  * .github/workflows/npm-publish.yml (types -> core -> content -> cli).
12
12
  */
13
13
  export const NPM_PUBLISH_PACKAGES = ["types", "core", "content", "cli"];
14
+ /** #1925: throwaway dist-tag so dry-run does not apply `latest` to 0.0.1. */
15
+ export const NPM_E2E_REHEARSAL_TAG = "e2e-rehearsal";
14
16
  export const NPM_INSTALL_TIMEOUT_SECONDS = 600;
15
17
  export const NPM_BUILD_TIMEOUT_SECONDS = 600;
16
18
  export const NPM_PUBLISH_DRYRUN_TIMEOUT_SECONDS = 180;
@@ -21,7 +21,9 @@ export declare function alignNpmPackageVersions(cloneDir: string, version: strin
21
21
  * 2. Resolve pnpm (or `corepack pnpm`) and `pnpm install --frozen-lockfile`.
22
22
  * 3. `pnpm -w run build`; dist/ must exist for the dist-only files allowlist.
23
23
  * 4. Align the four package.json versions + resolve the workspace protocol.
24
- * 5. `npm publish --dry-run --access public` per package in dependency order.
24
+ * 5. `npm publish --dry-run --access public --tag e2e-rehearsal` per package
25
+ * in dependency order (#1925 bypasses implicit-`latest` when the rehearsal
26
+ * sentinel is below the highest published version).
25
27
  *
26
28
  * Returns [ok, reason] like verifyDraftRelease / verifyTag.
27
29
  */
@@ -1,7 +1,7 @@
1
1
  import { readFileSync, writeFileSync } from "node:fs";
2
2
  import { join } from "node:path";
3
3
  import { defaultWhich, spawnText } from "../release/spawn.js";
4
- import { NPM_BUILD_TIMEOUT_SECONDS, NPM_INSTALL_TIMEOUT_SECONDS, NPM_PUBLISH_DRYRUN_TIMEOUT_SECONDS, NPM_PUBLISH_PACKAGES, } from "./constants.js";
4
+ import { NPM_BUILD_TIMEOUT_SECONDS, NPM_E2E_REHEARSAL_TAG, NPM_INSTALL_TIMEOUT_SECONDS, NPM_PUBLISH_DRYRUN_TIMEOUT_SECONDS, NPM_PUBLISH_PACKAGES, } from "./constants.js";
5
5
  /**
6
6
  * npm publish dry-run rehearsal (#1910) -- the TS port of the
7
7
  * scripts/release_e2e.py helpers of the same name. Mirrors
@@ -102,7 +102,9 @@ export function alignNpmPackageVersions(cloneDir, version) {
102
102
  * 2. Resolve pnpm (or `corepack pnpm`) and `pnpm install --frozen-lockfile`.
103
103
  * 3. `pnpm -w run build`; dist/ must exist for the dist-only files allowlist.
104
104
  * 4. Align the four package.json versions + resolve the workspace protocol.
105
- * 5. `npm publish --dry-run --access public` per package in dependency order.
105
+ * 5. `npm publish --dry-run --access public --tag e2e-rehearsal` per package
106
+ * in dependency order (#1925 bypasses implicit-`latest` when the rehearsal
107
+ * sentinel is below the highest published version).
106
108
  *
107
109
  * Returns [ok, reason] like verifyDraftRelease / verifyTag.
108
110
  */
@@ -135,7 +137,7 @@ export function rehearseNpmPublish(cloneDir, version, seams = {}) {
135
137
  }
136
138
  for (const pkg of NPM_PUBLISH_PACKAGES) {
137
139
  const pkgDir = join(cloneDir, "packages", pkg);
138
- [ok, reason] = runNpmStep([npmPath, "publish", "--dry-run", "--access", "public"], pkgDir, env, `npm publish --dry-run packages/${pkg}`, NPM_PUBLISH_DRYRUN_TIMEOUT_SECONDS, seams);
140
+ [ok, reason] = runNpmStep([npmPath, "publish", "--dry-run", "--access", "public", "--tag", NPM_E2E_REHEARSAL_TAG], pkgDir, env, `npm publish --dry-run --tag ${NPM_E2E_REHEARSAL_TAG} packages/${pkg}`, NPM_PUBLISH_DRYRUN_TIMEOUT_SECONDS, seams);
139
141
  if (!ok) {
140
142
  return [false, reason];
141
143
  }
@@ -73,7 +73,7 @@ export function verifyRouting(options) {
73
73
  if (undecided.length === 0 && invalid.length === 0) {
74
74
  return {
75
75
  exitCode: EXIT_OK,
76
- report: `[deft routing] provider '${provider}': all ${roles.length} gated role(s) decided.`,
76
+ report: `[deft routing] provider '${provider}': all ${roles.length} gated role(s) decided.\n[deft routing] NOTE: plan.policy.swarmSubagentBackend enum is deprecated (#1891); use 'task swarm:routing-set' / .deft/routing.local.json instead.`,
77
77
  };
78
78
  }
79
79
  const parts = [];
@@ -85,7 +85,7 @@ export function verifyRouting(options) {
85
85
  }
86
86
  return {
87
87
  exitCode: EXIT_OK,
88
- report: `[deft routing] provider '${provider}' -- ${parts.join("; ")}. Decide before swarm dispatch: ${ROUTING_SET_CMD}`,
88
+ report: `[deft routing] provider '${provider}' -- ${parts.join("; ")}. Decide before swarm dispatch: ${ROUTING_SET_CMD}\n[deft routing] NOTE: plan.policy.swarmSubagentBackend enum is deprecated (#1891); use 'task swarm:routing-set' / .deft/routing.local.json instead.`,
89
89
  };
90
90
  }
91
91
  if (undecided.length > 0) {
@@ -1,11 +1,27 @@
1
+ /**
2
+ * @deprecated This module is superseded by per-role operator model routing
3
+ * (`.deft/routing.local.json`) introduced in #1739 / #1863.
4
+ *
5
+ * Use `task swarm:routing-set` and `task verify:routing` instead.
6
+ * See `packages/core/src/swarm/routing.ts` for the current implementation.
7
+ *
8
+ * The enum and associated helpers remain functional for consumers that have not
9
+ * yet migrated; they will be removed in a future major cleanup tracked by #1860.
10
+ *
11
+ * @see {@link https://github.com/deftai/directive/issues/1739} Superseding PR
12
+ * @see {@link https://github.com/deftai/directive/issues/1860} Hard deletion tracking
13
+ */
1
14
  import { LEAF_CODING_WORKER_ROLE } from "./constants.js";
15
+ /** @deprecated Superseded by `.deft/routing.local.json` routing (#1739). Use `task swarm:routing-set`. */
2
16
  export declare const KNOWN_SUBAGENT_BACKEND_IDS: Set<string>;
17
+ /** @deprecated Superseded by `.deft/routing.local.json` routing (#1739). Use `task swarm:routing-set`. */
3
18
  export interface SubagentBackendDescriptor {
4
19
  readonly backend_id: string;
5
20
  readonly display_name: string;
6
21
  readonly roles: readonly string[];
7
22
  readonly available: boolean;
8
23
  }
24
+ /** @deprecated Superseded by `.deft/routing.local.json` routing (#1739). Use `task swarm:routing-set`. */
9
25
  export interface SwarmSubagentBackendResult {
10
26
  readonly backend_id: string | null;
11
27
  readonly source: string;
@@ -1,6 +1,20 @@
1
+ /**
2
+ * @deprecated This module is superseded by per-role operator model routing
3
+ * (`.deft/routing.local.json`) introduced in #1739 / #1863.
4
+ *
5
+ * Use `task swarm:routing-set` and `task verify:routing` instead.
6
+ * See `packages/core/src/swarm/routing.ts` for the current implementation.
7
+ *
8
+ * The enum and associated helpers remain functional for consumers that have not
9
+ * yet migrated; they will be removed in a future major cleanup tracked by #1860.
10
+ *
11
+ * @see {@link https://github.com/deftai/directive/issues/1739} Superseding PR
12
+ * @see {@link https://github.com/deftai/directive/issues/1860} Hard deletion tracking
13
+ */
1
14
  import { loadProjectDefinition } from "../policy/resolve.js";
2
15
  import { LEAF_CODING_WORKER_ROLE, SUBAGENT_BACKEND_SET_CMD } from "./constants.js";
3
16
  const TRUTHY = new Set(["1", "true", "yes", "on"]);
17
+ /** @deprecated Superseded by `.deft/routing.local.json` routing (#1739). Use `task swarm:routing-set`. */
4
18
  export const KNOWN_SUBAGENT_BACKEND_IDS = new Set(["composer", "grok-build", "cursor-cloud"]);
5
19
  const SUBAGENT_BACKEND_CATALOG = {
6
20
  composer: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deftai/directive-core",
3
- "version": "0.55.1",
3
+ "version": "0.55.2",
4
4
  "description": "TypeScript engine core for the Directive framework.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -197,7 +197,7 @@
197
197
  "provenance": true
198
198
  },
199
199
  "dependencies": {
200
- "@deftai/directive-types": "^0.55.1"
200
+ "@deftai/directive-types": "^0.55.2"
201
201
  },
202
202
  "scripts": {
203
203
  "build": "tsc -b",