@deftai/directive-types 0.63.0 → 0.65.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.
@@ -0,0 +1,16 @@
1
+ /** Canonical vBRIEF schema version exported for downstream contract imports. */
2
+ export declare const VBRIEF_VERSION: "0.6";
3
+ export type VBriefVersion = typeof VBRIEF_VERSION;
4
+ /** npm package identity constant (stable across releases). */
5
+ export declare const TYPES_PACKAGE: "@deftai/directive-types";
6
+ /**
7
+ * vBRIEF#12 extension namespace — keys matching this pattern round-trip preserve-verbatim.
8
+ * Namespaced form: `x-<namespace>/<rest>` (e.g. `x-directive/trace`, `x-vbrief/context`).
9
+ * @see https://github.com/deftai/vBRIEF/issues/12
10
+ */
11
+ export declare const EXTENSION_KEY_PATTERN: RegExp;
12
+ /** Prefix for schema-conformant vBRIEF reference `type` values. */
13
+ export declare const VBRIEF_REFERENCE_PREFIX: "x-vbrief/";
14
+ /** JSON Schema `$id` for the v0.6 core document (published npm artifact). */
15
+ export declare const VBRIEF_CORE_SCHEMA_ID: "https://vbrief.dev/schemas/vbrief-core-0.6.schema.json";
16
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1,15 @@
1
+ /** Canonical vBRIEF schema version exported for downstream contract imports. */
2
+ export const VBRIEF_VERSION = "0.6";
3
+ /** npm package identity constant (stable across releases). */
4
+ export const TYPES_PACKAGE = "@deftai/directive-types";
5
+ /**
6
+ * vBRIEF#12 extension namespace — keys matching this pattern round-trip preserve-verbatim.
7
+ * Namespaced form: `x-<namespace>/<rest>` (e.g. `x-directive/trace`, `x-vbrief/context`).
8
+ * @see https://github.com/deftai/vBRIEF/issues/12
9
+ */
10
+ export const EXTENSION_KEY_PATTERN = /^x-[a-z0-9-]+\//;
11
+ /** Prefix for schema-conformant vBRIEF reference `type` values. */
12
+ export const VBRIEF_REFERENCE_PREFIX = "x-vbrief/";
13
+ /** JSON Schema `$id` for the v0.6 core document (published npm artifact). */
14
+ export const VBRIEF_CORE_SCHEMA_ID = "https://vbrief.dev/schemas/vbrief-core-0.6.schema.json";
15
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1,66 @@
1
+ import type { VBriefVersion } from "./constants.js";
2
+ import type { PlanPolicy } from "./policy.js";
3
+ import type { VBriefReference } from "./reference.js";
4
+ import type { Status } from "./status.js";
5
+ /** Top-level `vBRIEFInfo` block (v0.6). */
6
+ export interface VBriefInfo {
7
+ readonly version: VBriefVersion;
8
+ readonly author?: string;
9
+ readonly description?: string;
10
+ readonly metadata?: Record<string, unknown>;
11
+ readonly created?: string;
12
+ readonly updated?: string;
13
+ readonly timezone?: string;
14
+ readonly [key: `x-${string}`]: unknown;
15
+ }
16
+ /** Nested plan item (`PlanItem` in vbrief-core.schema.json). */
17
+ export interface PlanItem {
18
+ readonly id?: string;
19
+ readonly uid?: string;
20
+ readonly title: string;
21
+ readonly status: Status;
22
+ readonly narrative?: Readonly<Record<string, string>>;
23
+ readonly items?: readonly PlanItem[];
24
+ /** @deprecated Prefer `items`. Retained for schema compatibility. */
25
+ readonly subItems?: readonly PlanItem[];
26
+ readonly planRef?: string;
27
+ readonly tags?: readonly string[];
28
+ readonly metadata?: Record<string, unknown>;
29
+ readonly created?: string;
30
+ readonly updated?: string;
31
+ readonly completed?: string;
32
+ readonly [key: `x-${string}`]: unknown;
33
+ }
34
+ /** Authored architecture metadata on `plan.architecture`. */
35
+ export interface PlanArchitecture {
36
+ readonly codeStructure?: Record<string, unknown>;
37
+ readonly [key: string]: unknown;
38
+ }
39
+ /** Root `plan` object for scope and project-definition vBRIEFs. */
40
+ export interface Plan {
41
+ readonly id?: string;
42
+ readonly uid?: string;
43
+ readonly title: string;
44
+ readonly status: Status;
45
+ readonly items: readonly PlanItem[];
46
+ readonly policy?: PlanPolicy;
47
+ readonly architecture?: PlanArchitecture;
48
+ readonly narratives?: Readonly<Record<string, string>>;
49
+ readonly references?: readonly VBriefReference[];
50
+ readonly metadata?: Record<string, unknown>;
51
+ readonly planRef?: string;
52
+ readonly updated?: string;
53
+ readonly [key: `x-${string}`]: unknown;
54
+ }
55
+ /** Canonical v0.6 vBRIEF document shape. */
56
+ export interface VBriefDocument {
57
+ readonly vBRIEFInfo: VBriefInfo;
58
+ readonly plan: Plan;
59
+ readonly [key: `x-${string}`]: unknown;
60
+ }
61
+ /** Identifying metadata for a deft engine package (retained from Wave-1). */
62
+ export interface EngineInfo {
63
+ readonly name: string;
64
+ readonly version: string;
65
+ }
66
+ //# sourceMappingURL=document.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=document.js.map
@@ -0,0 +1,10 @@
1
+ /** Brand for vBRIEF#12 extension property keys (`x-*`). */
2
+ export type ExtensionKey = `x-${string}`;
3
+ /** Return true when `key` matches the vBRIEF#12 extension namespace. */
4
+ export declare function isExtensionKey(key: string): key is ExtensionKey;
5
+ /**
6
+ * Preserve-verbatim round-trip helper: copy extension keys without transformation.
7
+ * Core document keys are untouched; only `x-*` entries are collected.
8
+ */
9
+ export declare function collectExtensionProperties(source: Record<string, unknown>): Record<ExtensionKey, unknown>;
10
+ //# sourceMappingURL=extension.d.ts.map
@@ -0,0 +1,19 @@
1
+ import { EXTENSION_KEY_PATTERN } from "./constants.js";
2
+ /** Return true when `key` matches the vBRIEF#12 extension namespace. */
3
+ export function isExtensionKey(key) {
4
+ return EXTENSION_KEY_PATTERN.test(key);
5
+ }
6
+ /**
7
+ * Preserve-verbatim round-trip helper: copy extension keys without transformation.
8
+ * Core document keys are untouched; only `x-*` entries are collected.
9
+ */
10
+ export function collectExtensionProperties(source) {
11
+ const out = {};
12
+ for (const [key, value] of Object.entries(source)) {
13
+ if (isExtensionKey(key)) {
14
+ out[key] = value;
15
+ }
16
+ }
17
+ return out;
18
+ }
19
+ //# sourceMappingURL=extension.js.map
package/dist/gate.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ /** Three-state exit codes used by deterministic deft gates. */
2
+ export type GateExitCode = 0 | 1 | 2;
3
+ export declare const GATE_EXIT_OK: 0;
4
+ export declare const GATE_EXIT_VIOLATION: 1;
5
+ export declare const GATE_EXIT_CONFIG_ERROR: 2;
6
+ /** Minimal gate result envelope for downstream tooling. */
7
+ export interface GateResult {
8
+ readonly code: GateExitCode;
9
+ readonly message: string;
10
+ }
11
+ //# sourceMappingURL=gate.d.ts.map
package/dist/gate.js ADDED
@@ -0,0 +1,4 @@
1
+ export const GATE_EXIT_OK = 0;
2
+ export const GATE_EXIT_VIOLATION = 1;
3
+ export const GATE_EXIT_CONFIG_ERROR = 2;
4
+ //# sourceMappingURL=gate.js.map
package/dist/index.d.ts CHANGED
@@ -1,15 +1,18 @@
1
1
  /**
2
- * `@deftai/directive-types` — shared types for the deft directive TypeScript engine.
2
+ * `@deftai/directive-types` — canonical vBRIEF/policy contract for downstream consumers (#1799).
3
3
  *
4
- * Wave-1 skeleton (#1717): carries only the identity constant and a
5
- * placeholder metadata shape needed to prove the cross-package dependency
6
- * graph (types → core → cli). The real ported domain types arrive with the
7
- * `verify:encoding` tracer bullet and parity harness (#1718).
4
+ * Supported public API: this package and its published JSON Schema subpaths.
5
+ * Behavior access remains via the `deft` / `directive` CLI — not `@deftai/directive-core`.
8
6
  */
9
- export declare const TYPES_PACKAGE: "@deftai/directive-types";
10
- /** Identifying metadata for a deft engine package. */
11
- export interface EngineInfo {
12
- readonly name: string;
13
- readonly version: string;
14
- }
7
+ export { EXTENSION_KEY_PATTERN, TYPES_PACKAGE, VBRIEF_CORE_SCHEMA_ID, VBRIEF_REFERENCE_PREFIX, VBRIEF_VERSION, type VBriefVersion, } from "./constants.js";
8
+ export type { EngineInfo, Plan, PlanArchitecture, PlanItem, VBriefDocument, VBriefInfo, } from "./document.js";
9
+ export { collectExtensionProperties, type ExtensionKey, isExtensionKey, } from "./extension.js";
10
+ export { GATE_EXIT_CONFIG_ERROR, GATE_EXIT_OK, GATE_EXIT_VIOLATION, type GateExitCode, type GateResult, } from "./gate.js";
11
+ export { type PlanPolicy, type ProjectionProviderExpectation, type ProjectionProviderPolicy, REGISTERED_POLICY_FIELD_NAMES, type TriageScopeRule, } from "./policy.js";
12
+ export { isVBriefReferenceType, KNOWN_REFERENCE_TYPES, type KnownReferenceType, type TrustLevel, type VBriefReference, } from "./reference.js";
13
+ export { FOLDER_ALLOWED_STATUSES, type Status, VALID_STATUSES, } from "./status.js";
14
+ /** Relative path to the published v0.6 core JSON Schema inside the npm package. */
15
+ export declare const PUBLISHED_VBRIEF_CORE_SCHEMA_PATH: "schemas/vbrief-core-0.6.schema.json";
16
+ /** npm subpath export for the v0.6 core JSON Schema artifact. */
17
+ export declare const VBRIEF_CORE_SCHEMA_EXPORT: "./schemas/vbrief-core-0.6.schema.json";
15
18
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,10 +1,17 @@
1
1
  /**
2
- * `@deftai/directive-types` — shared types for the deft directive TypeScript engine.
2
+ * `@deftai/directive-types` — canonical vBRIEF/policy contract for downstream consumers (#1799).
3
3
  *
4
- * Wave-1 skeleton (#1717): carries only the identity constant and a
5
- * placeholder metadata shape needed to prove the cross-package dependency
6
- * graph (types → core → cli). The real ported domain types arrive with the
7
- * `verify:encoding` tracer bullet and parity harness (#1718).
4
+ * Supported public API: this package and its published JSON Schema subpaths.
5
+ * Behavior access remains via the `deft` / `directive` CLI — not `@deftai/directive-core`.
8
6
  */
9
- export const TYPES_PACKAGE = "@deftai/directive-types";
7
+ export { EXTENSION_KEY_PATTERN, TYPES_PACKAGE, VBRIEF_CORE_SCHEMA_ID, VBRIEF_REFERENCE_PREFIX, VBRIEF_VERSION, } from "./constants.js";
8
+ export { collectExtensionProperties, isExtensionKey, } from "./extension.js";
9
+ export { GATE_EXIT_CONFIG_ERROR, GATE_EXIT_OK, GATE_EXIT_VIOLATION, } from "./gate.js";
10
+ export { REGISTERED_POLICY_FIELD_NAMES, } from "./policy.js";
11
+ export { isVBriefReferenceType, KNOWN_REFERENCE_TYPES, } from "./reference.js";
12
+ export { FOLDER_ALLOWED_STATUSES, VALID_STATUSES, } from "./status.js";
13
+ /** Relative path to the published v0.6 core JSON Schema inside the npm package. */
14
+ export const PUBLISHED_VBRIEF_CORE_SCHEMA_PATH = "schemas/vbrief-core-0.6.schema.json";
15
+ /** npm subpath export for the v0.6 core JSON Schema artifact. */
16
+ export const VBRIEF_CORE_SCHEMA_EXPORT = "./schemas/vbrief-core-0.6.schema.json";
10
17
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Typed `plan.policy` surface — known fields mirror directive engine inspectors (#746 / #1148).
3
+ * Additional keys use the vBRIEF#12 extension namespace (`x-*`).
4
+ */
5
+ export interface TriageScopeRule {
6
+ readonly rule: string;
7
+ readonly [key: string]: unknown;
8
+ }
9
+ export interface PlanPolicy {
10
+ readonly allowDirectCommitsToMaster?: boolean;
11
+ readonly wipCap?: number;
12
+ readonly sessionRitualStalenessHours?: number | null;
13
+ readonly triageScope?: readonly TriageScopeRule[];
14
+ readonly triageScopeIgnores?: readonly unknown[];
15
+ readonly triageRankingLabels?: readonly string[];
16
+ readonly triageAutoClassify?: readonly unknown[];
17
+ readonly triageHoldMarkers?: readonly string[];
18
+ readonly swarmSubagentBackend?: string | null;
19
+ readonly projectionProviders?: Record<string, ProjectionProviderPolicy>;
20
+ readonly [key: `x-${string}`]: unknown;
21
+ }
22
+ export interface ProjectionProviderExpectation {
23
+ readonly provider?: string | Record<string, unknown>;
24
+ readonly name?: string;
25
+ readonly version?: string;
26
+ readonly providerVersion?: string;
27
+ readonly [key: `x-${string}`]: unknown;
28
+ }
29
+ export interface ProjectionProviderPolicy {
30
+ readonly artifactPath: string;
31
+ readonly expect?: ProjectionProviderExpectation;
32
+ readonly [key: `x-${string}`]: unknown;
33
+ }
34
+ /** Canonical dotted policy field names registered by the directive engine. */
35
+ export declare const REGISTERED_POLICY_FIELD_NAMES: readonly ["plan.policy.allowDirectCommitsToMaster", "plan.policy.wipCap", "plan.policy.sessionRitualStalenessHours", "plan.policy.triageScope", "plan.policy.triageScopeIgnores", "plan.policy.triageRankingLabels", "plan.policy.triageAutoClassify", "plan.policy.triageHoldMarkers", "plan.policy.swarmSubagentBackend"];
36
+ //# sourceMappingURL=policy.d.ts.map
package/dist/policy.js ADDED
@@ -0,0 +1,13 @@
1
+ /** Canonical dotted policy field names registered by the directive engine. */
2
+ export const REGISTERED_POLICY_FIELD_NAMES = [
3
+ "plan.policy.allowDirectCommitsToMaster",
4
+ "plan.policy.wipCap",
5
+ "plan.policy.sessionRitualStalenessHours",
6
+ "plan.policy.triageScope",
7
+ "plan.policy.triageScopeIgnores",
8
+ "plan.policy.triageRankingLabels",
9
+ "plan.policy.triageAutoClassify",
10
+ "plan.policy.triageHoldMarkers",
11
+ "plan.policy.swarmSubagentBackend",
12
+ ];
13
+ //# sourceMappingURL=policy.js.map
@@ -0,0 +1,19 @@
1
+ import { VBRIEF_REFERENCE_PREFIX } from "./constants.js";
2
+ /** Canonical reference types from conventions/references.md (non-exhaustive). */
3
+ export declare const KNOWN_REFERENCE_TYPES: readonly ["x-vbrief/plan", "x-vbrief/github-issue", "x-vbrief/github-pr", "x-vbrief/jira-ticket", "x-vbrief/user-request", "x-vbrief/spec-section", "x-vbrief/context", "x-vbrief/research"];
4
+ export type KnownReferenceType = (typeof KNOWN_REFERENCE_TYPES)[number];
5
+ export type TrustLevel = "internal" | "external";
6
+ /** Schema-conformant vBRIEF reference (`VBriefReference` in vbrief-core.schema.json). */
7
+ export interface VBriefReference {
8
+ readonly uri: string;
9
+ readonly type: `${typeof VBRIEF_REFERENCE_PREFIX}${string}` | KnownReferenceType;
10
+ readonly title?: string;
11
+ readonly description?: string;
12
+ readonly tags?: readonly string[];
13
+ /** Canonical JSON key per vbrief.md TrustLevel (#480); not camelCase `trustLevel`. */
14
+ readonly TrustLevel?: TrustLevel;
15
+ readonly [key: `x-${string}`]: unknown;
16
+ }
17
+ /** Return true when `type` is a schema-conformant `x-vbrief/*` reference type. */
18
+ export declare function isVBriefReferenceType(type: string): boolean;
19
+ //# sourceMappingURL=reference.d.ts.map
@@ -0,0 +1,17 @@
1
+ import { VBRIEF_REFERENCE_PREFIX } from "./constants.js";
2
+ /** Canonical reference types from conventions/references.md (non-exhaustive). */
3
+ export const KNOWN_REFERENCE_TYPES = [
4
+ "x-vbrief/plan",
5
+ "x-vbrief/github-issue",
6
+ "x-vbrief/github-pr",
7
+ "x-vbrief/jira-ticket",
8
+ "x-vbrief/user-request",
9
+ "x-vbrief/spec-section",
10
+ "x-vbrief/context",
11
+ "x-vbrief/research",
12
+ ];
13
+ /** Return true when `type` is a schema-conformant `x-vbrief/*` reference type. */
14
+ export function isVBriefReferenceType(type) {
15
+ return type.startsWith(VBRIEF_REFERENCE_PREFIX);
16
+ }
17
+ //# sourceMappingURL=reference.js.map
@@ -0,0 +1,6 @@
1
+ /** v0.6 lifecycle status enum — mirrors `Status` in vbrief-core.schema.json. */
2
+ export declare const VALID_STATUSES: readonly ["draft", "proposed", "approved", "pending", "running", "completed", "blocked", "failed", "cancelled"];
3
+ export type Status = (typeof VALID_STATUSES)[number];
4
+ /** Folder mapping used by lifecycle validators (informational for consumers). */
5
+ export declare const FOLDER_ALLOWED_STATUSES: Readonly<Record<string, readonly Status[]>>;
6
+ //# sourceMappingURL=status.d.ts.map
package/dist/status.js ADDED
@@ -0,0 +1,21 @@
1
+ /** v0.6 lifecycle status enum — mirrors `Status` in vbrief-core.schema.json. */
2
+ export const VALID_STATUSES = [
3
+ "draft",
4
+ "proposed",
5
+ "approved",
6
+ "pending",
7
+ "running",
8
+ "completed",
9
+ "blocked",
10
+ "failed",
11
+ "cancelled",
12
+ ];
13
+ /** Folder mapping used by lifecycle validators (informational for consumers). */
14
+ export const FOLDER_ALLOWED_STATUSES = {
15
+ proposed: ["draft", "proposed"],
16
+ pending: ["approved", "pending"],
17
+ active: ["running", "blocked"],
18
+ completed: ["completed", "failed"],
19
+ cancelled: ["cancelled"],
20
+ };
21
+ //# sourceMappingURL=status.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deftai/directive-types",
3
- "version": "0.63.0",
3
+ "version": "0.65.0",
4
4
  "description": "Shared TypeScript types for the Directive framework engine.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -9,11 +9,13 @@
9
9
  ".": {
10
10
  "types": "./dist/index.d.ts",
11
11
  "default": "./dist/index.js"
12
- }
12
+ },
13
+ "./schemas/vbrief-core-0.6.schema.json": "./schemas/vbrief-core-0.6.schema.json"
13
14
  },
14
15
  "files": [
15
16
  "dist/**/*.js",
16
- "dist/**/*.d.ts"
17
+ "dist/**/*.d.ts",
18
+ "schemas/**/*.json"
17
19
  ],
18
20
  "repository": {
19
21
  "type": "git",
@@ -25,6 +27,7 @@
25
27
  "provenance": true
26
28
  },
27
29
  "scripts": {
30
+ "prebuild": "node ./scripts/sync-schema.mjs",
28
31
  "build": "tsc -b"
29
32
  }
30
33
  }