@deftai/directive-core 0.91.0 → 0.93.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 (92) hide show
  1. package/dist/cache/fetch.js +3 -2
  2. package/dist/cache/io.d.ts +13 -2
  3. package/dist/cache/io.js +36 -7
  4. package/dist/cache/operations.js +5 -3
  5. package/dist/doctor/index.d.ts +1 -0
  6. package/dist/doctor/index.js +1 -0
  7. package/dist/doctor/main.js +49 -0
  8. package/dist/doctor/openclaw-l2-adapter.d.ts +26 -0
  9. package/dist/doctor/openclaw-l2-adapter.js +199 -0
  10. package/dist/hooks/dispatcher.d.ts +6 -1
  11. package/dist/hooks/dispatcher.js +30 -0
  12. package/dist/index.d.ts +2 -0
  13. package/dist/index.js +2 -0
  14. package/dist/init-deposit/gitignore.js +3 -0
  15. package/dist/init-deposit/hygiene.d.ts +43 -1
  16. package/dist/init-deposit/hygiene.js +134 -10
  17. package/dist/init-deposit/index.d.ts +3 -0
  18. package/dist/init-deposit/index.js +3 -0
  19. package/dist/init-deposit/init-deposit.js +10 -0
  20. package/dist/init-deposit/refresh.js +11 -0
  21. package/dist/init-deposit/scaffold.js +6 -134
  22. package/dist/init-deposit/skill-discovery-deposit.d.ts +65 -0
  23. package/dist/init-deposit/skill-discovery-deposit.js +287 -0
  24. package/dist/init-deposit/skill-discovery-hosts.d.ts +94 -0
  25. package/dist/init-deposit/skill-discovery-hosts.js +217 -0
  26. package/dist/init-deposit/slash-deposit.d.ts +46 -0
  27. package/dist/init-deposit/slash-deposit.js +174 -0
  28. package/dist/orchestration/probe-session.d.ts +5 -1
  29. package/dist/orchestration/probe-session.js +24 -13
  30. package/dist/platform/agents-md.js +1 -1
  31. package/dist/policy/deft-directive-disable.d.ts +86 -0
  32. package/dist/policy/deft-directive-disable.js +167 -0
  33. package/dist/policy/delivery-branch.d.ts +33 -0
  34. package/dist/policy/delivery-branch.js +124 -0
  35. package/dist/policy/host-slash-commands.d.ts +28 -0
  36. package/dist/policy/host-slash-commands.js +103 -0
  37. package/dist/policy/index.d.ts +3 -0
  38. package/dist/policy/index.js +61 -5
  39. package/dist/scope/brief-io.d.ts +3 -1
  40. package/dist/scope/brief-io.js +5 -3
  41. package/dist/scope/delivery-evidence.d.ts +112 -0
  42. package/dist/scope/delivery-evidence.js +419 -0
  43. package/dist/scope/index.d.ts +1 -0
  44. package/dist/scope/index.js +1 -0
  45. package/dist/scope/main.d.ts +5 -0
  46. package/dist/scope/main.js +98 -3
  47. package/dist/scope/registry-artifact-sync.js +4 -1
  48. package/dist/scope/transition.d.ts +11 -1
  49. package/dist/scope/transition.js +30 -4
  50. package/dist/session/ritual-sentinel.js +21 -12
  51. package/dist/session/session-start-hook.d.ts +3 -0
  52. package/dist/session/session-start-hook.js +21 -0
  53. package/dist/session/session-start.js +31 -0
  54. package/dist/slash/emitters.d.ts +102 -0
  55. package/dist/slash/emitters.js +148 -0
  56. package/dist/slash/generator.d.ts +98 -0
  57. package/dist/slash/generator.js +145 -0
  58. package/dist/slash/index.d.ts +16 -0
  59. package/dist/slash/index.js +16 -0
  60. package/dist/slash/openclaw-adapter.d.ts +64 -0
  61. package/dist/slash/openclaw-adapter.js +198 -0
  62. package/dist/slash/openclaw-deposit.d.ts +73 -0
  63. package/dist/slash/openclaw-deposit.js +279 -0
  64. package/dist/slash/openclaw-slugs.d.ts +52 -0
  65. package/dist/slash/openclaw-slugs.js +126 -0
  66. package/dist/slash/product-set.d.ts +50 -0
  67. package/dist/slash/product-set.js +142 -0
  68. package/dist/swarm/complete-cohort.d.ts +20 -1
  69. package/dist/swarm/complete-cohort.js +56 -9
  70. package/dist/swarm/finalize-cohort-cli.js +9 -0
  71. package/dist/swarm/finalize-cohort.d.ts +8 -0
  72. package/dist/swarm/finalize-cohort.js +217 -21
  73. package/dist/user-config/experimental-rules.d.ts +43 -0
  74. package/dist/user-config/experimental-rules.js +162 -0
  75. package/dist/user-config/index.d.ts +1 -0
  76. package/dist/user-config/index.js +1 -0
  77. package/dist/vbrief-validate/plan-hooks.d.ts +4 -0
  78. package/dist/vbrief-validate/plan-hooks.js +50 -0
  79. package/dist/verify-source/contained-writes.js +1 -1
  80. package/dist/xbrief/create.d.ts +36 -0
  81. package/dist/xbrief/create.js +285 -0
  82. package/dist/xbrief/index.d.ts +14 -0
  83. package/dist/xbrief/index.js +42 -0
  84. package/dist/xbrief/paths.d.ts +37 -0
  85. package/dist/xbrief/paths.js +123 -0
  86. package/dist/xbrief/styles.d.ts +36 -0
  87. package/dist/xbrief/styles.js +235 -0
  88. package/dist/xbrief/types.d.ts +50 -0
  89. package/dist/xbrief/types.js +17 -0
  90. package/dist/xbrief/verify.d.ts +30 -0
  91. package/dist/xbrief/verify.js +251 -0
  92. package/package.json +11 -3
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Portable path expand + project-root containment for xbrief:create/verify (#3057).
3
+ *
4
+ * Uses real path APIs (node:path / node:os) — no slash-only logic.
5
+ * Default containment under project root fails closed on escape.
6
+ */
7
+ import { homedir } from "node:os";
8
+ import { isAbsolute, join, normalize, relative, resolve, sep } from "node:path";
9
+ import { ContainedWriteError, ContainedWriteErrorCode, resolveContainedTarget, } from "../fs/contained-write.js";
10
+ export class XbriefPathError extends Error {
11
+ code;
12
+ constructor(message, code = "XBRIEF_PATH_ERROR") {
13
+ super(message);
14
+ this.name = "XbriefPathError";
15
+ this.code = code;
16
+ }
17
+ }
18
+ /**
19
+ * Expand simple user path forms portably:
20
+ * - `~` / `~/…` / `~\…` → home directory
21
+ * - `%VAR%` (Windows-class env expansion) when present in the string
22
+ *
23
+ * Relative paths are left relative (caller resolves against project root or cwd).
24
+ */
25
+ export function expandUserPath(input, options = {}) {
26
+ if (input.length === 0) {
27
+ throw new XbriefPathError("empty path", "XBRIEF_PATH_EMPTY");
28
+ }
29
+ const home = options.home ?? homedir();
30
+ const env = options.env ?? process.env;
31
+ let expanded = input.replace(/%([^%]+)%/g, (match, name) => {
32
+ const value = env[name];
33
+ return value !== undefined && value.length > 0 ? value : match;
34
+ });
35
+ if (expanded === "~") {
36
+ expanded = home;
37
+ }
38
+ else if (expanded.startsWith("~/") || expanded.startsWith("~\\")) {
39
+ expanded = join(home, expanded.slice(2));
40
+ }
41
+ // Env expansion may inject foreign separators (e.g. %USERPROFILE%\foo on Linux CI).
42
+ // Re-normalize with path.normalize after collapsing to platform-native separators.
43
+ const collapsed = expanded.replace(/\\/g, "/");
44
+ return normalize(collapsed);
45
+ }
46
+ /** Strip known xBRIEF suffixes to recover a write stem. */
47
+ export function stripXbriefSuffix(pathLike) {
48
+ const lower = pathLike.toLowerCase();
49
+ if (lower.endsWith(".xbrief.json")) {
50
+ return pathLike.slice(0, -".xbrief.json".length);
51
+ }
52
+ if (lower.endsWith(".xbrief.md")) {
53
+ return pathLike.slice(0, -".xbrief.md".length);
54
+ }
55
+ return pathLike;
56
+ }
57
+ /**
58
+ * Resolve `--out` under `projectRoot` with user-path expansion and fail-closed
59
+ * containment. Returns absolute stem + format-specific artifact paths.
60
+ */
61
+ export function resolveXbriefOutPaths(input) {
62
+ const projectRoot = resolve(input.projectRoot);
63
+ const expanded = expandUserPath(input.out, { home: input.home, env: input.env });
64
+ // Absolute (post-expand) paths must still nest under projectRoot.
65
+ // Relative paths resolve against projectRoot (not bare cwd) so containment is stable.
66
+ let candidate;
67
+ if (isAbsolute(expanded)) {
68
+ candidate = resolve(expanded);
69
+ }
70
+ else {
71
+ // When out is explicitly cwd-relative (./…), resolve against cwd then re-check root.
72
+ const cwd = input.cwd ?? process.cwd();
73
+ if (expanded === "." ||
74
+ expanded.startsWith(`.${sep}`) ||
75
+ expanded.startsWith("./") ||
76
+ expanded.startsWith(".\\")) {
77
+ candidate = resolve(cwd, expanded);
78
+ }
79
+ else {
80
+ candidate = resolve(projectRoot, expanded);
81
+ }
82
+ }
83
+ const stemRaw = stripXbriefSuffix(candidate);
84
+ let stemAbs;
85
+ try {
86
+ // resolveContainedTarget requires nested path (not the root itself).
87
+ // If stem equals root, fail with a clear message.
88
+ const rel = relative(projectRoot, stemAbsPlaceholder(projectRoot, stemRaw));
89
+ if (rel.length === 0) {
90
+ throw new XbriefPathError(`xbrief path refused: --out resolves to project root (need a file stem under the root)`, "XBRIEF_PATH_ESCAPE");
91
+ }
92
+ stemAbs = resolveContainedTarget(projectRoot, isAbsolute(stemRaw) ? stemRaw : relative(projectRoot, stemRaw));
93
+ }
94
+ catch (err) {
95
+ if (err instanceof XbriefPathError)
96
+ throw err;
97
+ if (err instanceof ContainedWriteError) {
98
+ throw new XbriefPathError(`xbrief path refused: --out escapes project root (${err.target})`, err.code === ContainedWriteErrorCode.ESCAPE ? "XBRIEF_PATH_ESCAPE" : err.code);
99
+ }
100
+ throw err;
101
+ }
102
+ const jsonAbs = input.format === "md" ? null : `${stemAbs}.xbrief.json`;
103
+ const mdAbs = input.format === "json" ? null : `${stemAbs}.xbrief.md`;
104
+ // Re-validate artifact paths under root (stem + suffix must stay nested).
105
+ for (const p of [jsonAbs, mdAbs]) {
106
+ if (p === null)
107
+ continue;
108
+ try {
109
+ resolveContainedTarget(projectRoot, p);
110
+ }
111
+ catch (err) {
112
+ if (err instanceof ContainedWriteError) {
113
+ throw new XbriefPathError(`xbrief path refused: artifact escapes project root (${p})`, "XBRIEF_PATH_ESCAPE");
114
+ }
115
+ throw err;
116
+ }
117
+ }
118
+ return { projectRoot, stemAbs, jsonAbs, mdAbs };
119
+ }
120
+ function stemAbsPlaceholder(projectRoot, stemRaw) {
121
+ return isAbsolute(stemRaw) ? resolve(stemRaw) : resolve(projectRoot, stemRaw);
122
+ }
123
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1,36 @@
1
+ /**
2
+ * P0 xBRIEF style templates and markdown section maps (#3057).
3
+ *
4
+ * One schema spine (xBRIEF v0.8); markdown is a dense render of the same plan,
5
+ * not a second dialect.
6
+ */
7
+ import type { XbriefDocument, XbriefStyle } from "./types.js";
8
+ /** Required H2 section titles in the markdown form per style. */
9
+ export declare const MD_REQUIRED_SECTIONS: Readonly<Record<XbriefStyle, readonly string[]>>;
10
+ export interface BuildDocumentInput {
11
+ style: XbriefStyle;
12
+ title: string;
13
+ id?: string;
14
+ status?: string;
15
+ description?: string;
16
+ now?: Date;
17
+ /** Optional narrative overrides merged over style defaults. */
18
+ narratives?: Record<string, string>;
19
+ items?: unknown[];
20
+ }
21
+ /** Build a minimal valid xBRIEF v0.8 document for the given P0 style. */
22
+ export declare function buildStyleDocument(input: BuildDocumentInput): XbriefDocument;
23
+ /** Render dense markdown from the JSON spine (one dialect). */
24
+ export declare function renderMarkdown(doc: XbriefDocument, style: XbriefStyle): string;
25
+ /**
26
+ * Lightweight parse of md form for verify: extract title, status, id, and H2 sections.
27
+ * Not a full reverse dialect — verify uses it for required-section + consistency checks.
28
+ */
29
+ export declare function parseMarkdownMeta(md: string): {
30
+ title: string | null;
31
+ status: string | null;
32
+ id: string | null;
33
+ style: string | null;
34
+ sections: Set<string>;
35
+ };
36
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1,235 @@
1
+ /**
2
+ * P0 xBRIEF style templates and markdown section maps (#3057).
3
+ *
4
+ * One schema spine (xBRIEF v0.8); markdown is a dense render of the same plan,
5
+ * not a second dialect.
6
+ */
7
+ /** Required H2 section titles in the markdown form per style. */
8
+ export const MD_REQUIRED_SECTIONS = {
9
+ scope: ["Title", "Status", "Overview", "Items"],
10
+ playbook: ["Title", "Status", "Overview", "Steps"],
11
+ mission: ["Title", "Status", "Outcome", "Evidence"],
12
+ project: ["Title", "Status", "Overview", "TechStack"],
13
+ };
14
+ function isoNow(now) {
15
+ return now.toISOString().replace(/\.\d{3}Z$/, "Z");
16
+ }
17
+ function defaultStatus(style) {
18
+ switch (style) {
19
+ case "scope":
20
+ return "draft";
21
+ case "playbook":
22
+ return "approved";
23
+ case "mission":
24
+ return "completed";
25
+ case "project":
26
+ return "approved";
27
+ }
28
+ }
29
+ function defaultNarratives(style, title) {
30
+ switch (style) {
31
+ case "scope":
32
+ return {
33
+ Overview: `Scope brief for ${title}.`,
34
+ Description: "",
35
+ };
36
+ case "playbook":
37
+ return {
38
+ Overview: `Playbook for ${title}.`,
39
+ Steps: "1. Inspect\n2. Act\n3. Verify",
40
+ };
41
+ case "mission":
42
+ return {
43
+ Outcome: `Mission outcome for ${title}.`,
44
+ Evidence: "",
45
+ };
46
+ case "project":
47
+ return {
48
+ Overview: `Project identity for ${title}.`,
49
+ TechStack: "",
50
+ };
51
+ }
52
+ }
53
+ function defaultItems(style) {
54
+ if (style === "playbook") {
55
+ return [
56
+ {
57
+ title: "Inspect",
58
+ status: "proposed",
59
+ narrative: { Acceptance: "Context is loaded and preconditions hold." },
60
+ },
61
+ {
62
+ title: "Act",
63
+ status: "proposed",
64
+ narrative: { Acceptance: "Primary steps complete." },
65
+ },
66
+ {
67
+ title: "Verify",
68
+ status: "proposed",
69
+ narrative: { Acceptance: "Checks pass or failures are recorded." },
70
+ },
71
+ ];
72
+ }
73
+ return [];
74
+ }
75
+ /** Build a minimal valid xBRIEF v0.8 document for the given P0 style. */
76
+ export function buildStyleDocument(input) {
77
+ const now = input.now ?? new Date();
78
+ const stamp = isoNow(now);
79
+ const status = input.status ?? defaultStatus(input.style);
80
+ const baseNarratives = defaultNarratives(input.style, input.title);
81
+ const narratives = { ...baseNarratives, ...(input.narratives ?? {}) };
82
+ const items = input.items ?? defaultItems(input.style);
83
+ const plan = {
84
+ title: input.title,
85
+ status,
86
+ narratives,
87
+ items,
88
+ metadata: {
89
+ kind: input.style,
90
+ xbriefCreate: true,
91
+ },
92
+ };
93
+ if (input.id !== undefined && input.id.length > 0) {
94
+ plan.id = input.id;
95
+ }
96
+ return {
97
+ xBRIEFInfo: {
98
+ version: "0.8",
99
+ description: input.description ?? `xBRIEF ${input.style} artifact (on-demand create)`,
100
+ created: stamp,
101
+ updated: stamp,
102
+ },
103
+ plan,
104
+ };
105
+ }
106
+ function sectionBody(doc, key) {
107
+ const narratives = doc.plan.narratives ?? {};
108
+ // Prefer exact key, then case-insensitive match.
109
+ if (typeof narratives[key] === "string")
110
+ return narratives[key];
111
+ const lower = key.toLowerCase();
112
+ for (const [k, v] of Object.entries(narratives)) {
113
+ if (k.toLowerCase() === lower && typeof v === "string")
114
+ return v;
115
+ }
116
+ return "";
117
+ }
118
+ function renderItemsList(doc, heading) {
119
+ const lines = [`## ${heading}`, ""];
120
+ const items = Array.isArray(doc.plan.items) ? doc.plan.items : [];
121
+ if (items.length === 0) {
122
+ lines.push("_(none)_", "");
123
+ return lines.join("\n");
124
+ }
125
+ for (const raw of items) {
126
+ if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
127
+ lines.push(`- ${String(raw)}`);
128
+ continue;
129
+ }
130
+ const item = raw;
131
+ const title = typeof item.title === "string" ? item.title : "(untitled)";
132
+ const status = typeof item.status === "string" ? item.status : "unknown";
133
+ lines.push(`- **${title}** (${status})`);
134
+ }
135
+ lines.push("");
136
+ return lines.join("\n");
137
+ }
138
+ /** Render dense markdown from the JSON spine (one dialect). */
139
+ export function renderMarkdown(doc, style) {
140
+ const idLine = typeof doc.plan.id === "string" && doc.plan.id.length > 0 ? `id: ${doc.plan.id}\n` : "";
141
+ const header = [
142
+ "---",
143
+ "xbrief: 0.8",
144
+ `style: ${style}`,
145
+ idLine.trimEnd() === "" ? null : idLine.trimEnd(),
146
+ "---",
147
+ "",
148
+ `# ${doc.plan.title}`,
149
+ "",
150
+ ]
151
+ .filter((line) => line !== null)
152
+ .join("\n");
153
+ const sections = MD_REQUIRED_SECTIONS[style];
154
+ const parts = [header];
155
+ for (const section of sections) {
156
+ if (section === "Title") {
157
+ parts.push("## Title", "", doc.plan.title, "");
158
+ continue;
159
+ }
160
+ if (section === "Status") {
161
+ parts.push("## Status", "", String(doc.plan.status), "");
162
+ continue;
163
+ }
164
+ if (section === "Items" || section === "Steps") {
165
+ parts.push(renderItemsList(doc, section));
166
+ // Also include narrative Steps when present for playbook density.
167
+ if (section === "Steps") {
168
+ const stepsNarrative = sectionBody(doc, "Steps");
169
+ if (stepsNarrative.length > 0) {
170
+ parts.push("### Steps narrative", "", stepsNarrative, "");
171
+ }
172
+ }
173
+ continue;
174
+ }
175
+ const body = sectionBody(doc, section);
176
+ parts.push(`## ${section}`, "", body.length > 0 ? body : "_(empty)_", "");
177
+ }
178
+ return `${parts
179
+ .join("\n")
180
+ .replace(/\n{3,}/g, "\n\n")
181
+ .trimEnd()}\n`;
182
+ }
183
+ /**
184
+ * Lightweight parse of md form for verify: extract title, status, id, and H2 sections.
185
+ * Not a full reverse dialect — verify uses it for required-section + consistency checks.
186
+ */
187
+ export function parseMarkdownMeta(md) {
188
+ const sections = new Set();
189
+ let title = null;
190
+ let status = null;
191
+ let id = null;
192
+ let style = null;
193
+ const lines = md.split(/\r?\n/);
194
+ let inFront = false;
195
+ let afterTitleH2 = false;
196
+ let afterStatusH2 = false;
197
+ for (const line of lines) {
198
+ if (line.trim() === "---") {
199
+ inFront = !inFront;
200
+ continue;
201
+ }
202
+ if (inFront) {
203
+ const idMatch = /^id:\s*(.+)\s*$/.exec(line);
204
+ if (idMatch?.[1] !== undefined)
205
+ id = idMatch[1].trim();
206
+ const styleMatch = /^style:\s*(.+)\s*$/.exec(line);
207
+ if (styleMatch?.[1] !== undefined)
208
+ style = styleMatch[1].trim();
209
+ continue;
210
+ }
211
+ const h1 = /^#\s+(.+)$/.exec(line);
212
+ if (h1?.[1] !== undefined && title === null) {
213
+ title = h1[1].trim();
214
+ }
215
+ const h2 = /^##\s+(.+)$/.exec(line);
216
+ if (h2?.[1] !== undefined) {
217
+ const name = h2[1].trim();
218
+ sections.add(name);
219
+ afterTitleH2 = name === "Title";
220
+ afterStatusH2 = name === "Status";
221
+ continue;
222
+ }
223
+ if (afterTitleH2 && line.trim().length > 0 && !line.startsWith("#")) {
224
+ // Prefer ## Title body over H1 when present.
225
+ title = line.trim();
226
+ afterTitleH2 = false;
227
+ }
228
+ if (afterStatusH2 && line.trim().length > 0 && !line.startsWith("#")) {
229
+ status = line.trim();
230
+ afterStatusH2 = false;
231
+ }
232
+ }
233
+ return { title, status, id, style, sections };
234
+ }
235
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Shared types for on-demand xBRIEF create/verify (#3057).
3
+ *
4
+ * create/verify write or check shaped SoT artifacts at an explicit path.
5
+ * They are NOT scope lifecycle verbs (scope:promote / activate / complete).
6
+ */
7
+ export declare const XBRIEF_FORMATS: readonly ["json", "md", "both"];
8
+ export type XbriefFormat = (typeof XBRIEF_FORMATS)[number];
9
+ export declare const XBRIEF_STYLES: readonly ["scope", "playbook", "mission", "project"];
10
+ export type XbriefStyle = (typeof XBRIEF_STYLES)[number];
11
+ /** Default size cap for create/verify payloads (bytes). */
12
+ export declare const DEFAULT_XBRIEF_SIZE_CAP_BYTES: number;
13
+ export interface XbriefCliResult {
14
+ readonly exitCode: number;
15
+ readonly stdout: string;
16
+ readonly stderr: string;
17
+ }
18
+ export interface XbriefPaths {
19
+ /** Absolute project root used for containment. */
20
+ readonly projectRoot: string;
21
+ /** Absolute stem path (no .xbrief.json / .xbrief.md suffix). */
22
+ readonly stemAbs: string;
23
+ /** Absolute JSON path when format includes json. */
24
+ readonly jsonAbs: string | null;
25
+ /** Absolute MD path when format includes md. */
26
+ readonly mdAbs: string | null;
27
+ }
28
+ export interface XbriefDocument {
29
+ readonly xBRIEFInfo: {
30
+ readonly version: "0.8";
31
+ readonly description?: string;
32
+ readonly created?: string;
33
+ readonly updated?: string;
34
+ readonly author?: string;
35
+ readonly [key: string]: unknown;
36
+ };
37
+ readonly plan: {
38
+ readonly title: string;
39
+ readonly status: string;
40
+ readonly id?: string;
41
+ readonly narratives?: Record<string, string>;
42
+ readonly items: unknown[];
43
+ readonly metadata?: Record<string, unknown>;
44
+ readonly [key: string]: unknown;
45
+ };
46
+ readonly [key: string]: unknown;
47
+ }
48
+ export declare function isXbriefFormat(value: string): value is XbriefFormat;
49
+ export declare function isXbriefStyle(value: string): value is XbriefStyle;
50
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Shared types for on-demand xBRIEF create/verify (#3057).
3
+ *
4
+ * create/verify write or check shaped SoT artifacts at an explicit path.
5
+ * They are NOT scope lifecycle verbs (scope:promote / activate / complete).
6
+ */
7
+ export const XBRIEF_FORMATS = ["json", "md", "both"];
8
+ export const XBRIEF_STYLES = ["scope", "playbook", "mission", "project"];
9
+ /** Default size cap for create/verify payloads (bytes). */
10
+ export const DEFAULT_XBRIEF_SIZE_CAP_BYTES = 512 * 1024;
11
+ export function isXbriefFormat(value) {
12
+ return XBRIEF_FORMATS.includes(value);
13
+ }
14
+ export function isXbriefStyle(value) {
15
+ return XBRIEF_STYLES.includes(value);
16
+ }
17
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,30 @@
1
+ /**
2
+ * xbrief:verify — fail-closed check of an xBRIEF artifact at --out (#3057).
3
+ *
4
+ * Required: --format (json|md|both), --out
5
+ * Checks: schema/parse, required fields, size cap, md sections per style,
6
+ * and stem/title/id consistency when format=both.
7
+ *
8
+ * Does NOT move lifecycle folders.
9
+ */
10
+ import { type XbriefCliResult, type XbriefFormat, type XbriefStyle } from "./types.js";
11
+ export declare const VERIFY_USAGE: string;
12
+ export interface VerifyOptions {
13
+ format: XbriefFormat;
14
+ out: string;
15
+ style?: XbriefStyle;
16
+ projectRoot: string;
17
+ sizeCapBytes?: number;
18
+ cwd?: string;
19
+ home?: string;
20
+ env?: NodeJS.ProcessEnv;
21
+ }
22
+ /** Parse verify CLI argv into options (or error string). */
23
+ export declare function parseVerifyArgv(argv: readonly string[]): VerifyOptions | {
24
+ error: string;
25
+ };
26
+ /** Core verify implementation (testable). */
27
+ export declare function verifyXbrief(options: VerifyOptions): XbriefCliResult;
28
+ /** CLI entry for dispatch wrapper. */
29
+ export declare function runXbriefVerifyCli(argv: string[]): XbriefCliResult;
30
+ //# sourceMappingURL=verify.d.ts.map