@soleri/forge 5.14.10 → 8.0.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 (65) hide show
  1. package/dist/agent-schema.d.ts +323 -0
  2. package/dist/agent-schema.js +151 -0
  3. package/dist/agent-schema.js.map +1 -0
  4. package/dist/compose-claude-md.d.ts +24 -0
  5. package/dist/compose-claude-md.js +197 -0
  6. package/dist/compose-claude-md.js.map +1 -0
  7. package/dist/index.js +0 -0
  8. package/dist/lib.d.ts +12 -1
  9. package/dist/lib.js +10 -1
  10. package/dist/lib.js.map +1 -1
  11. package/dist/scaffold-filetree.d.ts +22 -0
  12. package/dist/scaffold-filetree.js +361 -0
  13. package/dist/scaffold-filetree.js.map +1 -0
  14. package/dist/scaffolder.js +261 -11
  15. package/dist/scaffolder.js.map +1 -1
  16. package/dist/templates/activate.js +39 -1
  17. package/dist/templates/activate.js.map +1 -1
  18. package/dist/templates/agents-md.d.ts +10 -1
  19. package/dist/templates/agents-md.js +76 -16
  20. package/dist/templates/agents-md.js.map +1 -1
  21. package/dist/templates/claude-md-template.js +9 -1
  22. package/dist/templates/claude-md-template.js.map +1 -1
  23. package/dist/templates/entry-point.js +83 -6
  24. package/dist/templates/entry-point.js.map +1 -1
  25. package/dist/templates/inject-claude-md.js +53 -0
  26. package/dist/templates/inject-claude-md.js.map +1 -1
  27. package/dist/templates/package-json.js +4 -1
  28. package/dist/templates/package-json.js.map +1 -1
  29. package/dist/templates/readme.js +4 -3
  30. package/dist/templates/readme.js.map +1 -1
  31. package/dist/templates/setup-script.js +109 -3
  32. package/dist/templates/setup-script.js.map +1 -1
  33. package/dist/templates/shared-rules.js +54 -17
  34. package/dist/templates/shared-rules.js.map +1 -1
  35. package/dist/templates/test-facades.js +151 -6
  36. package/dist/templates/test-facades.js.map +1 -1
  37. package/dist/types.d.ts +71 -6
  38. package/dist/types.js +39 -1
  39. package/dist/types.js.map +1 -1
  40. package/dist/utils/detect-domain-packs.d.ts +25 -0
  41. package/dist/utils/detect-domain-packs.js +104 -0
  42. package/dist/utils/detect-domain-packs.js.map +1 -0
  43. package/package.json +2 -1
  44. package/src/__tests__/detect-domain-packs.test.ts +178 -0
  45. package/src/__tests__/scaffold-filetree.test.ts +257 -0
  46. package/src/__tests__/scaffolder.test.ts +5 -3
  47. package/src/agent-schema.ts +184 -0
  48. package/src/compose-claude-md.ts +252 -0
  49. package/src/lib.ts +14 -1
  50. package/src/scaffold-filetree.ts +421 -0
  51. package/src/scaffolder.ts +299 -15
  52. package/src/templates/activate.ts +39 -0
  53. package/src/templates/agents-md.ts +78 -16
  54. package/src/templates/claude-md-template.ts +12 -1
  55. package/src/templates/entry-point.ts +90 -6
  56. package/src/templates/inject-claude-md.ts +53 -0
  57. package/src/templates/package-json.ts +4 -1
  58. package/src/templates/readme.ts +4 -3
  59. package/src/templates/setup-script.ts +110 -4
  60. package/src/templates/shared-rules.ts +55 -17
  61. package/src/templates/test-facades.ts +156 -6
  62. package/src/types.ts +44 -1
  63. package/src/utils/detect-domain-packs.ts +129 -0
  64. package/tsconfig.json +0 -1
  65. package/vitest.config.ts +1 -2
@@ -0,0 +1,323 @@
1
+ /**
2
+ * Soleri v7 — File-Tree Agent Schema
3
+ *
4
+ * Defines the agent.yaml format for file-tree agents.
5
+ * This replaces the old AgentConfigSchema that generated TypeScript projects.
6
+ *
7
+ * An agent is a folder. This schema defines agent.yaml — the single source
8
+ * of truth for identity and engine configuration.
9
+ */
10
+ import { z } from 'zod';
11
+ /** Communication tones */
12
+ export declare const TONES: readonly ["precise", "mentor", "pragmatic"];
13
+ export type Tone = (typeof TONES)[number];
14
+ /** Where to set up client integration */
15
+ export declare const SETUP_TARGETS: readonly ["claude", "codex", "opencode", "both", "all"];
16
+ export type SetupTarget = (typeof SETUP_TARGETS)[number];
17
+ /** Gate phases in a workflow */
18
+ export declare const GATE_PHASES: readonly ["brainstorming", "pre-execution", "post-task", "completion"];
19
+ export type GatePhase = (typeof GATE_PHASES)[number];
20
+ /** Workflow gate definition (maps to gates.yaml) */
21
+ export declare const WorkflowGateSchema: z.ZodObject<{
22
+ phase: z.ZodEnum<["brainstorming", "pre-execution", "post-task", "completion"]>;
23
+ requirement: z.ZodString;
24
+ check: z.ZodString;
25
+ }, "strip", z.ZodTypeAny, {
26
+ phase: "brainstorming" | "pre-execution" | "post-task" | "completion";
27
+ requirement: string;
28
+ check: string;
29
+ }, {
30
+ phase: "brainstorming" | "pre-execution" | "post-task" | "completion";
31
+ requirement: string;
32
+ check: string;
33
+ }>;
34
+ /** Task template ordering */
35
+ export declare const TASK_ORDERS: readonly ["before-implementation", "after-implementation", "parallel"];
36
+ /** Task template types */
37
+ export declare const TASK_TYPES: readonly ["implementation", "test", "story", "documentation", "verification"];
38
+ /** Workflow task template (injected during plan generation) */
39
+ export declare const WorkflowTaskTemplateSchema: z.ZodObject<{
40
+ taskType: z.ZodEnum<["implementation", "test", "story", "documentation", "verification"]>;
41
+ titleTemplate: z.ZodString;
42
+ acceptanceCriteria: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
43
+ tools: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
44
+ order: z.ZodEnum<["before-implementation", "after-implementation", "parallel"]>;
45
+ }, "strip", z.ZodTypeAny, {
46
+ taskType: "implementation" | "test" | "story" | "documentation" | "verification";
47
+ titleTemplate: string;
48
+ acceptanceCriteria: string[];
49
+ tools: string[];
50
+ order: "before-implementation" | "after-implementation" | "parallel";
51
+ }, {
52
+ taskType: "implementation" | "test" | "story" | "documentation" | "verification";
53
+ titleTemplate: string;
54
+ order: "before-implementation" | "after-implementation" | "parallel";
55
+ acceptanceCriteria?: string[] | undefined;
56
+ tools?: string[] | undefined;
57
+ }>;
58
+ /** Workflow intent types */
59
+ export declare const INTENTS: readonly ["BUILD", "FIX", "REVIEW", "PLAN", "IMPROVE", "DELIVER"];
60
+ export type Intent = (typeof INTENTS)[number];
61
+ /** Workflow definition (maps to workflow folder contents) */
62
+ export declare const WorkflowDefinitionSchema: z.ZodObject<{
63
+ /** Unique workflow ID (derived from folder name if not specified) */
64
+ id: z.ZodOptional<z.ZodString>;
65
+ /** generic or domain tier */
66
+ tier: z.ZodDefault<z.ZodOptional<z.ZodEnum<["generic", "domain"]>>>;
67
+ /** Human-readable title */
68
+ title: z.ZodString;
69
+ /** When to activate this workflow */
70
+ trigger: z.ZodOptional<z.ZodString>;
71
+ /** What this workflow does */
72
+ description: z.ZodOptional<z.ZodString>;
73
+ /** Numbered step-by-step process (from prompt.md, parsed at runtime) */
74
+ steps: z.ZodOptional<z.ZodString>;
75
+ /** Success criteria */
76
+ expectedOutcome: z.ZodOptional<z.ZodString>;
77
+ /** ID of generic workflow this domain workflow extends */
78
+ extends: z.ZodOptional<z.ZodString>;
79
+ /** Domain filtering: skip UI playbooks for backend tasks */
80
+ domain: z.ZodDefault<z.ZodOptional<z.ZodEnum<["ui", "backend", "any"]>>>;
81
+ /** Intents that trigger this workflow */
82
+ matchIntents: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<["BUILD", "FIX", "REVIEW", "PLAN", "IMPROVE", "DELIVER"]>, "many">>>;
83
+ /** Keywords in plan text that trigger this workflow */
84
+ matchKeywords: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
85
+ /** Lifecycle checkpoints */
86
+ gates: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
87
+ phase: z.ZodEnum<["brainstorming", "pre-execution", "post-task", "completion"]>;
88
+ requirement: z.ZodString;
89
+ check: z.ZodString;
90
+ }, "strip", z.ZodTypeAny, {
91
+ phase: "brainstorming" | "pre-execution" | "post-task" | "completion";
92
+ requirement: string;
93
+ check: string;
94
+ }, {
95
+ phase: "brainstorming" | "pre-execution" | "post-task" | "completion";
96
+ requirement: string;
97
+ check: string;
98
+ }>, "many">>>;
99
+ /** Task templates injected during plan generation */
100
+ taskTemplates: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
101
+ taskType: z.ZodEnum<["implementation", "test", "story", "documentation", "verification"]>;
102
+ titleTemplate: z.ZodString;
103
+ acceptanceCriteria: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
104
+ tools: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
105
+ order: z.ZodEnum<["before-implementation", "after-implementation", "parallel"]>;
106
+ }, "strip", z.ZodTypeAny, {
107
+ taskType: "implementation" | "test" | "story" | "documentation" | "verification";
108
+ titleTemplate: string;
109
+ acceptanceCriteria: string[];
110
+ tools: string[];
111
+ order: "before-implementation" | "after-implementation" | "parallel";
112
+ }, {
113
+ taskType: "implementation" | "test" | "story" | "documentation" | "verification";
114
+ titleTemplate: string;
115
+ order: "before-implementation" | "after-implementation" | "parallel";
116
+ acceptanceCriteria?: string[] | undefined;
117
+ tools?: string[] | undefined;
118
+ }>, "many">>>;
119
+ /** Tools auto-added to plan's tool chain */
120
+ toolInjections: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
121
+ /** Completion gate validation rules */
122
+ verificationCriteria: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
123
+ }, "strip", z.ZodTypeAny, {
124
+ domain: "ui" | "backend" | "any";
125
+ tier: "generic" | "domain";
126
+ title: string;
127
+ matchIntents: ("BUILD" | "FIX" | "REVIEW" | "PLAN" | "IMPROVE" | "DELIVER")[];
128
+ matchKeywords: string[];
129
+ gates: {
130
+ phase: "brainstorming" | "pre-execution" | "post-task" | "completion";
131
+ requirement: string;
132
+ check: string;
133
+ }[];
134
+ taskTemplates: {
135
+ taskType: "implementation" | "test" | "story" | "documentation" | "verification";
136
+ titleTemplate: string;
137
+ acceptanceCriteria: string[];
138
+ tools: string[];
139
+ order: "before-implementation" | "after-implementation" | "parallel";
140
+ }[];
141
+ toolInjections: string[];
142
+ verificationCriteria: string[];
143
+ id?: string | undefined;
144
+ trigger?: string | undefined;
145
+ description?: string | undefined;
146
+ steps?: string | undefined;
147
+ expectedOutcome?: string | undefined;
148
+ extends?: string | undefined;
149
+ }, {
150
+ title: string;
151
+ id?: string | undefined;
152
+ domain?: "ui" | "backend" | "any" | undefined;
153
+ tier?: "generic" | "domain" | undefined;
154
+ trigger?: string | undefined;
155
+ description?: string | undefined;
156
+ steps?: string | undefined;
157
+ expectedOutcome?: string | undefined;
158
+ extends?: string | undefined;
159
+ matchIntents?: ("BUILD" | "FIX" | "REVIEW" | "PLAN" | "IMPROVE" | "DELIVER")[] | undefined;
160
+ matchKeywords?: string[] | undefined;
161
+ gates?: {
162
+ phase: "brainstorming" | "pre-execution" | "post-task" | "completion";
163
+ requirement: string;
164
+ check: string;
165
+ }[] | undefined;
166
+ taskTemplates?: {
167
+ taskType: "implementation" | "test" | "story" | "documentation" | "verification";
168
+ titleTemplate: string;
169
+ order: "before-implementation" | "after-implementation" | "parallel";
170
+ acceptanceCriteria?: string[] | undefined;
171
+ tools?: string[] | undefined;
172
+ }[] | undefined;
173
+ toolInjections?: string[] | undefined;
174
+ verificationCriteria?: string[] | undefined;
175
+ }>;
176
+ /**
177
+ * agent.yaml schema — the single source of truth for a file-tree agent.
178
+ *
179
+ * This is what `soleri create` generates and what the engine reads on startup.
180
+ */
181
+ export declare const AgentYamlSchema: z.ZodObject<{
182
+ /** Agent identifier — kebab-case, used for directories and tool prefixes */
183
+ id: z.ZodString;
184
+ /** Human-readable display name */
185
+ name: z.ZodString;
186
+ /** One-line role description */
187
+ role: z.ZodString;
188
+ /** Longer description of capabilities */
189
+ description: z.ZodString;
190
+ /** Knowledge domains (1–20) */
191
+ domains: z.ZodArray<z.ZodString, "many">;
192
+ /** Core principles (1–10) */
193
+ principles: z.ZodArray<z.ZodString, "many">;
194
+ /** Communication tone */
195
+ tone: z.ZodDefault<z.ZodOptional<z.ZodEnum<["precise", "mentor", "pragmatic"]>>>;
196
+ /** Greeting message (auto-generated if omitted) */
197
+ greeting: z.ZodOptional<z.ZodString>;
198
+ /** Knowledge engine configuration */
199
+ engine: z.ZodDefault<z.ZodOptional<z.ZodObject<{
200
+ /** Path to agent's vault SQLite database. Default: ~/.{id}/vault.db */
201
+ vault: z.ZodOptional<z.ZodString>;
202
+ /** Enable brain/learning loop. Default: true */
203
+ learning: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
204
+ /** Enable Cognee vector search. Default: false */
205
+ cognee: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
206
+ }, "strip", z.ZodTypeAny, {
207
+ learning: boolean;
208
+ cognee: boolean;
209
+ vault?: string | undefined;
210
+ }, {
211
+ vault?: string | undefined;
212
+ learning?: boolean | undefined;
213
+ cognee?: boolean | undefined;
214
+ }>>>;
215
+ /** Link to external vaults for shared knowledge */
216
+ vaults: z.ZodOptional<z.ZodArray<z.ZodObject<{
217
+ /** Display name for this vault */
218
+ name: z.ZodString;
219
+ /** Absolute path to vault SQLite database */
220
+ path: z.ZodString;
221
+ /** Search priority (0–1). Higher = results ranked higher. Default: 0.5 */
222
+ priority: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
223
+ }, "strip", z.ZodTypeAny, {
224
+ path: string;
225
+ name: string;
226
+ priority: number;
227
+ }, {
228
+ path: string;
229
+ name: string;
230
+ priority?: number | undefined;
231
+ }>, "many">>;
232
+ /** LLM client integration settings */
233
+ setup: z.ZodDefault<z.ZodOptional<z.ZodObject<{
234
+ /** Target client for MCP registration */
235
+ target: z.ZodDefault<z.ZodOptional<z.ZodEnum<["claude", "codex", "opencode", "both", "all"]>>>;
236
+ /** Primary model for the client */
237
+ model: z.ZodDefault<z.ZodOptional<z.ZodString>>;
238
+ }, "strip", z.ZodTypeAny, {
239
+ target: "claude" | "codex" | "opencode" | "both" | "all";
240
+ model: string;
241
+ }, {
242
+ target?: "claude" | "codex" | "opencode" | "both" | "all" | undefined;
243
+ model?: string | undefined;
244
+ }>>>;
245
+ /** npm domain packs with custom ops and knowledge */
246
+ packs: z.ZodOptional<z.ZodArray<z.ZodObject<{
247
+ /** Domain name (e.g., "design", "code-review") */
248
+ name: z.ZodString;
249
+ /** npm package name (e.g., "@soleri/domain-design") */
250
+ package: z.ZodString;
251
+ /** Semver version constraint (optional) */
252
+ version: z.ZodOptional<z.ZodString>;
253
+ }, "strip", z.ZodTypeAny, {
254
+ name: string;
255
+ package: string;
256
+ version?: string | undefined;
257
+ }, {
258
+ name: string;
259
+ package: string;
260
+ version?: string | undefined;
261
+ }>, "many">>;
262
+ }, "strip", z.ZodTypeAny, {
263
+ id: string;
264
+ description: string;
265
+ name: string;
266
+ role: string;
267
+ domains: string[];
268
+ principles: string[];
269
+ tone: "precise" | "mentor" | "pragmatic";
270
+ engine: {
271
+ learning: boolean;
272
+ cognee: boolean;
273
+ vault?: string | undefined;
274
+ };
275
+ setup: {
276
+ target: "claude" | "codex" | "opencode" | "both" | "all";
277
+ model: string;
278
+ };
279
+ greeting?: string | undefined;
280
+ vaults?: {
281
+ path: string;
282
+ name: string;
283
+ priority: number;
284
+ }[] | undefined;
285
+ packs?: {
286
+ name: string;
287
+ package: string;
288
+ version?: string | undefined;
289
+ }[] | undefined;
290
+ }, {
291
+ id: string;
292
+ description: string;
293
+ name: string;
294
+ role: string;
295
+ domains: string[];
296
+ principles: string[];
297
+ tone?: "precise" | "mentor" | "pragmatic" | undefined;
298
+ greeting?: string | undefined;
299
+ engine?: {
300
+ vault?: string | undefined;
301
+ learning?: boolean | undefined;
302
+ cognee?: boolean | undefined;
303
+ } | undefined;
304
+ vaults?: {
305
+ path: string;
306
+ name: string;
307
+ priority?: number | undefined;
308
+ }[] | undefined;
309
+ setup?: {
310
+ target?: "claude" | "codex" | "opencode" | "both" | "all" | undefined;
311
+ model?: string | undefined;
312
+ } | undefined;
313
+ packs?: {
314
+ name: string;
315
+ package: string;
316
+ version?: string | undefined;
317
+ }[] | undefined;
318
+ }>;
319
+ export type AgentYaml = z.infer<typeof AgentYamlSchema>;
320
+ export type AgentYamlInput = z.input<typeof AgentYamlSchema>;
321
+ export type WorkflowDefinition = z.infer<typeof WorkflowDefinitionSchema>;
322
+ export type WorkflowGate = z.infer<typeof WorkflowGateSchema>;
323
+ export type WorkflowTaskTemplate = z.infer<typeof WorkflowTaskTemplateSchema>;
@@ -0,0 +1,151 @@
1
+ /**
2
+ * Soleri v7 — File-Tree Agent Schema
3
+ *
4
+ * Defines the agent.yaml format for file-tree agents.
5
+ * This replaces the old AgentConfigSchema that generated TypeScript projects.
6
+ *
7
+ * An agent is a folder. This schema defines agent.yaml — the single source
8
+ * of truth for identity and engine configuration.
9
+ */
10
+ import { z } from 'zod';
11
+ // ─── Constants ────────────────────────────────────────────────────────
12
+ /** Communication tones */
13
+ export const TONES = ['precise', 'mentor', 'pragmatic'];
14
+ /** Where to set up client integration */
15
+ export const SETUP_TARGETS = ['claude', 'codex', 'opencode', 'both', 'all'];
16
+ // ─── Sub-Schemas ──────────────────────────────────────────────────────
17
+ /** External vault connection */
18
+ const VaultConnectionSchema = z.object({
19
+ /** Display name for this vault */
20
+ name: z.string().min(1),
21
+ /** Absolute path to vault SQLite database */
22
+ path: z.string().min(1),
23
+ /** Search priority (0–1). Higher = results ranked higher. Default: 0.5 */
24
+ priority: z.number().min(0).max(1).optional().default(0.5),
25
+ });
26
+ /** Domain pack reference */
27
+ const DomainPackSchema = z.object({
28
+ /** Domain name (e.g., "design", "code-review") */
29
+ name: z.string().min(1),
30
+ /** npm package name (e.g., "@soleri/domain-design") */
31
+ package: z.string().min(1),
32
+ /** Semver version constraint (optional) */
33
+ version: z.string().optional(),
34
+ });
35
+ /** Engine configuration */
36
+ const EngineConfigSchema = z.object({
37
+ /** Path to agent's vault SQLite database. Default: ~/.{id}/vault.db */
38
+ vault: z.string().optional(),
39
+ /** Enable brain/learning loop. Default: true */
40
+ learning: z.boolean().optional().default(true),
41
+ /** Enable Cognee vector search. Default: false */
42
+ cognee: z.boolean().optional().default(false),
43
+ });
44
+ /** Client setup configuration */
45
+ const SetupConfigSchema = z.object({
46
+ /** Target client for MCP registration */
47
+ target: z.enum(SETUP_TARGETS).optional().default('claude'),
48
+ /** Primary model for the client */
49
+ model: z.string().optional().default('claude-code-sonnet-4'),
50
+ });
51
+ // ─── Workflow Sub-Schemas ─────────────────────────────────────────────
52
+ /** Gate phases in a workflow */
53
+ export const GATE_PHASES = ['brainstorming', 'pre-execution', 'post-task', 'completion'];
54
+ /** Workflow gate definition (maps to gates.yaml) */
55
+ export const WorkflowGateSchema = z.object({
56
+ phase: z.enum(GATE_PHASES),
57
+ requirement: z.string().min(1),
58
+ check: z.string().min(1),
59
+ });
60
+ /** Task template ordering */
61
+ export const TASK_ORDERS = ['before-implementation', 'after-implementation', 'parallel'];
62
+ /** Task template types */
63
+ export const TASK_TYPES = [
64
+ 'implementation',
65
+ 'test',
66
+ 'story',
67
+ 'documentation',
68
+ 'verification',
69
+ ];
70
+ /** Workflow task template (injected during plan generation) */
71
+ export const WorkflowTaskTemplateSchema = z.object({
72
+ taskType: z.enum(TASK_TYPES),
73
+ titleTemplate: z.string().min(1),
74
+ acceptanceCriteria: z.array(z.string()).optional().default([]),
75
+ tools: z.array(z.string()).optional().default([]),
76
+ order: z.enum(TASK_ORDERS),
77
+ });
78
+ /** Workflow intent types */
79
+ export const INTENTS = ['BUILD', 'FIX', 'REVIEW', 'PLAN', 'IMPROVE', 'DELIVER'];
80
+ /** Workflow definition (maps to workflow folder contents) */
81
+ export const WorkflowDefinitionSchema = z.object({
82
+ /** Unique workflow ID (derived from folder name if not specified) */
83
+ id: z.string().optional(),
84
+ /** generic or domain tier */
85
+ tier: z.enum(['generic', 'domain']).optional().default('generic'),
86
+ /** Human-readable title */
87
+ title: z.string().min(1),
88
+ /** When to activate this workflow */
89
+ trigger: z.string().optional(),
90
+ /** What this workflow does */
91
+ description: z.string().optional(),
92
+ /** Numbered step-by-step process (from prompt.md, parsed at runtime) */
93
+ steps: z.string().optional(),
94
+ /** Success criteria */
95
+ expectedOutcome: z.string().optional(),
96
+ /** ID of generic workflow this domain workflow extends */
97
+ extends: z.string().optional(),
98
+ /** Domain filtering: skip UI playbooks for backend tasks */
99
+ domain: z.enum(['ui', 'backend', 'any']).optional().default('any'),
100
+ /** Intents that trigger this workflow */
101
+ matchIntents: z.array(z.enum(INTENTS)).optional().default([]),
102
+ /** Keywords in plan text that trigger this workflow */
103
+ matchKeywords: z.array(z.string()).optional().default([]),
104
+ /** Lifecycle checkpoints */
105
+ gates: z.array(WorkflowGateSchema).optional().default([]),
106
+ /** Task templates injected during plan generation */
107
+ taskTemplates: z.array(WorkflowTaskTemplateSchema).optional().default([]),
108
+ /** Tools auto-added to plan's tool chain */
109
+ toolInjections: z.array(z.string()).optional().default([]),
110
+ /** Completion gate validation rules */
111
+ verificationCriteria: z.array(z.string()).optional().default([]),
112
+ });
113
+ // ─── Main Agent Schema ────────────────────────────────────────────────
114
+ /**
115
+ * agent.yaml schema — the single source of truth for a file-tree agent.
116
+ *
117
+ * This is what `soleri create` generates and what the engine reads on startup.
118
+ */
119
+ export const AgentYamlSchema = z.object({
120
+ // ─── Identity (required) ────────────────────────
121
+ /** Agent identifier — kebab-case, used for directories and tool prefixes */
122
+ id: z.string().regex(/^[a-z][a-z0-9-]*$/, 'Must be kebab-case (e.g., "gaudi", "my-agent")'),
123
+ /** Human-readable display name */
124
+ name: z.string().min(1).max(50),
125
+ /** One-line role description */
126
+ role: z.string().min(1).max(100),
127
+ /** Longer description of capabilities */
128
+ description: z.string().min(10).max(500),
129
+ /** Knowledge domains (1–20) */
130
+ domains: z.array(z.string().min(1)).min(1).max(20),
131
+ /** Core principles (1–10) */
132
+ principles: z.array(z.string().min(1)).min(1).max(10),
133
+ // ─── Personality (optional) ─────────────────────
134
+ /** Communication tone */
135
+ tone: z.enum(TONES).optional().default('pragmatic'),
136
+ /** Greeting message (auto-generated if omitted) */
137
+ greeting: z.string().min(10).max(300).optional(),
138
+ // ─── Engine ─────────────────────────────────────
139
+ /** Knowledge engine configuration */
140
+ engine: EngineConfigSchema.optional().default({}),
141
+ // ─── Vault Connections ──────────────────────────
142
+ /** Link to external vaults for shared knowledge */
143
+ vaults: z.array(VaultConnectionSchema).optional(),
144
+ // ─── Client Setup ──────────────────────────────
145
+ /** LLM client integration settings */
146
+ setup: SetupConfigSchema.optional().default({}),
147
+ // ─── Domain Packs ──────────────────────────────
148
+ /** npm domain packs with custom ops and knowledge */
149
+ packs: z.array(DomainPackSchema).optional(),
150
+ });
151
+ //# sourceMappingURL=agent-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-schema.js","sourceRoot":"","sources":["../src/agent-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,yEAAyE;AAEzE,0BAA0B;AAC1B,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,WAAW,CAAU,CAAC;AAGjE,yCAAyC;AACzC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAU,CAAC;AAGrF,yEAAyE;AAEzE,gCAAgC;AAChC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,kCAAkC;IAClC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,6CAA6C;IAC7C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,0EAA0E;IAC1E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC;CAC3D,CAAC,CAAC;AAEH,4BAA4B;AAC5B,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,kDAAkD;IAClD,IAAI,EAAE,CAAC,CAAC,MAAM,E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AI,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC;IACnD,mDAAmD;IACnD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAEhD,mDAAmD;IACnD,qCAAqC;IACrC,MAAM,EAAE,kBAAkB,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAEjD,mDAAmD;IACnD,mDAAmD;IACnD,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,QAAQ,EAAE;IAEjD,kDAAkD;IAClD,sCAAsC;IACtC,KAAK,EAAE,iBAAiB,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAE/C,kDAAkD;IAClD,qDAAqD;IACrD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Soleri v7 — CLAUDE.md Composer
3
+ *
4
+ * Auto-generates CLAUDE.md from agent.yaml + instructions/ + workflows/ + skills/.
5
+ * This file is never manually edited. `soleri dev` watches and regenerates on change.
6
+ */
7
+ export interface ComposedClaudeMd {
8
+ /** The full CLAUDE.md content */
9
+ content: string;
10
+ /** Files that contributed to this composition */
11
+ sources: string[];
12
+ }
13
+ export interface ToolEntry {
14
+ facade: string;
15
+ ops: string[];
16
+ }
17
+ /**
18
+ * Compose CLAUDE.md from an agent folder.
19
+ *
20
+ * @param agentDir - Path to the agent folder (containing agent.yaml)
21
+ * @param tools - Registered MCP tools (from engine introspection). Optional —
22
+ * if not provided, generates a placeholder table.
23
+ */
24
+ export declare function composeClaudeMd(agentDir: string, tools?: ToolEntry[]): ComposedClaudeMd;