@specverse/engines 5.2.0 → 6.0.1

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 (37) hide show
  1. package/assets/prompts/core/standard/default/analyse.prompt.yaml +12 -3
  2. package/assets/prompts/core/standard/default/behavior.prompt.yaml +37 -30
  3. package/assets/prompts/core/standard/default/create.prompt.yaml +11 -3
  4. package/assets/prompts/core/standard/v9/analyse.prompt.yaml +12 -3
  5. package/assets/prompts/core/standard/v9/behavior.prompt.yaml +37 -30
  6. package/assets/prompts/core/standard/v9/create.prompt.yaml +11 -3
  7. package/dist/ai/behavior-ai-service.d.ts +35 -28
  8. package/dist/ai/behavior-ai-service.d.ts.map +1 -1
  9. package/dist/ai/behavior-ai-service.js +95 -128
  10. package/dist/ai/behavior-ai-service.js.map +1 -1
  11. package/dist/ai/index.d.ts +26 -26
  12. package/dist/ai/index.d.ts.map +1 -1
  13. package/dist/ai/index.js +40 -29
  14. package/dist/ai/index.js.map +1 -1
  15. package/dist/ai/model-resolver.d.ts +15 -0
  16. package/dist/ai/model-resolver.d.ts.map +1 -0
  17. package/dist/ai/model-resolver.js +87 -0
  18. package/dist/ai/model-resolver.js.map +1 -0
  19. package/dist/ai/providers/claude-cli.d.ts +25 -0
  20. package/dist/ai/providers/claude-cli.d.ts.map +1 -0
  21. package/dist/ai/providers/claude-cli.js +187 -0
  22. package/dist/ai/providers/claude-cli.js.map +1 -0
  23. package/dist/ai/providers/index.d.ts +8 -5
  24. package/dist/ai/providers/index.d.ts.map +1 -1
  25. package/dist/ai/providers/index.js +7 -5
  26. package/dist/ai/providers/index.js.map +1 -1
  27. package/dist/ai/providers/stub.d.ts +15 -0
  28. package/dist/ai/providers/stub.d.ts.map +1 -0
  29. package/dist/ai/providers/stub.js +64 -0
  30. package/dist/ai/providers/stub.js.map +1 -0
  31. package/dist/ai/skill-detection.d.ts +5 -0
  32. package/dist/ai/skill-detection.d.ts.map +1 -0
  33. package/dist/ai/skill-detection.js +27 -0
  34. package/dist/ai/skill-detection.js.map +1 -0
  35. package/dist/libs/instance-factories/tools/templates/mcp/mcp-server-generator.js +2 -2
  36. package/libs/instance-factories/tools/templates/mcp/mcp-server-generator.ts +2 -2
  37. package/package.json +8 -3
@@ -1,5 +1,5 @@
1
1
  name: analyse
2
- version: "9.0.0"
2
+ version: "9.2.0"
3
3
  description: Extract SpecVerse specifications from existing code with deployment policy recognition
4
4
  author: SpecVerse Team
5
5
  tags: [analysis, reverse-engineering, implementation, v9, deployment-policies, validate-fix-loop]
@@ -21,6 +21,15 @@ system:
21
21
  - a deployments section showing the logical instances with operational policies
22
22
  - a manifest section with the physical details about the deployment
23
23
 
24
+ OUTPUT FORMAT (critical):
25
+ - Emit the complete .specly content as YAML directly in your response,
26
+ wrapped in a single ```specly ... ``` code block.
27
+ - Do NOT use Write, Edit, or any file-saving tools — even if available.
28
+ The caller harvests the spec text from your response, not from disk.
29
+ - Do NOT prefix with prose, explanations, or status updates. Reply with
30
+ the code block as the primary output. Brief commentary AFTER the
31
+ block is OK.
32
+
24
33
  context: |
25
34
  Generate a FULL SpecVerse specification that represents the actual implementation
26
35
  - this specification will be validated so must be syntactically correct
@@ -388,7 +397,7 @@ user:
388
397
  - Use components: (plural) at top level
389
398
  - Use snake_case for lifecycle states (NOT kebab-case)
390
399
  - Include components, deployments (with policies), and manifest sections
391
- - Write to: spec.specly
400
+ - Output the spec inside a ```specly``` code block in your response (do not write to disk)
392
401
 
393
402
  Step 2: VALIDATE
394
403
  - Run: spv validate spec.specly --json
@@ -419,7 +428,7 @@ user:
419
428
  - incorrect operation policy nesting
420
429
  - invalid policy property names or values
421
430
  - missing 'policies' wrapper in operations
422
- * Fix the spec using Edit tool
431
+ * Update the spec inline in your response (do not edit a file on disk)
423
432
  * Go back to Step 2
424
433
 
425
434
  Continue the validate-fix loop until validation passes.
@@ -1,5 +1,5 @@
1
1
  name: behavior
2
- version: "9.1.0"
2
+ version: "9.2.0"
3
3
  description: Generate pure TypeScript function bodies for SpecVerse behavior steps that don't match convention patterns
4
4
  author: SpecVerse Team
5
5
  tags: [behavior, code-generation, pure-function, typescript, realize]
@@ -10,58 +10,65 @@ system:
10
10
  function bodies for behavior steps that couldn't be matched by the realize
11
11
  engine's convention patterns.
12
12
 
13
+ minimalContext: |
13
14
  PURE FUNCTION RULES (critical — violating these breaks the architecture):
14
15
  1. NO database access (no prisma, no queries)
15
16
  2. NO event publishing (no eventBus)
16
17
  3. NO external services (no fetch, no email providers, no payment gateways)
17
18
  4. NO imports, no require, no fs, no process
18
- 5. All data you need comes in via the `input` object parameter
19
+ 5. All data you need comes in via the `input` object parameter (already destructured — you have the fields directly)
19
20
  6. Return a plain result value (object, number, string) — the caller uses it
20
21
 
21
- The controller (deterministic, convention-matched code) fetches all data,
22
- calls your function, and then applies the result via convention code. Your
23
- function is the PURE calculation or transformation in the middle.
22
+ OUTPUT RULES:
23
+ 1. Output ONLY the function body code (between { and })
24
+ 2. First line: short comment summarising what the function does
25
+ 3. No markdown fences, no explanation before or after
26
+ 4. Throw Error('...') for failure cases with descriptive messages
27
+ 5. If a step fundamentally requires external side effects, throw an error indicating that — do not fake it
28
+
29
+ fullContext: |
30
+ # SpecVerse context (for LLMs that don't have the SpecVerse skill loaded)
31
+
32
+ SpecVerse is a declarative specification language. You describe WHAT a
33
+ system does in a .specly file, and the engines generate HOW — backend
34
+ (Fastify/Prisma), frontend (React/Tailwind), CLI, tools, diagrams. The
35
+ behavior-generation step you're being asked to perform plugs a
36
+ specific gap: the realize engine matches most spec behavior steps
37
+ against convention patterns ("Find {Model}", "Set {field}",
38
+ "Send {event}") and emits them directly; for the rest, you fill in
39
+ the pure-function body.
40
+
41
+ Where your function fits:
24
42
 
25
- Example flow:
26
43
  ```
27
- // Controller (convention code)
44
+ // Controller (convention-generated code — NOT your job)
28
45
  const order = await prisma.order.findUniqueOrThrow(...);
29
46
  const customer = await prisma.customer.findUniqueOrThrow(...);
30
47
 
31
- // Your function (pure)
48
+ // Your function — PURE calculation or transformation
32
49
  const discount = await applyDiscountBasedOnLoyaltyTier({ order, customer });
33
50
  // discount = { amount: 42, rate: 0.10 }
34
51
 
35
- // Controller (convention code)
52
+ // Controller (convention-generated code — NOT your job)
36
53
  await prisma.order.update({ where: { id }, data: { total: order.total - discount.amount } });
37
54
  await eventBus.publish('OrderDiscounted', { orderId, discount });
38
55
  ```
39
56
 
40
- Convention patterns that are ALREADY auto-generated (you don't handle these):
57
+ Convention patterns ALREADY auto-generated (don't re-implement these):
41
58
  - "Find {Model} by {field}", "Create {Model}", "Update {Model}..."
42
59
  - "Delete {Model}", "Transition {Model} to {state}"
43
60
  - "Set/Increment/Decrement {field}", "Send {event} event"
44
61
 
45
- You handle domain-specific logic: calculations, transformations, rules,
46
- scoring, categorisation, validation.
62
+ You handle: domain-specific calculations, transformations, rules,
63
+ scoring, categorisation, validation logic. Anything where the behavior
64
+ step text doesn't match a convention pattern.
47
65
 
48
- context: |
49
- OUTPUT RULES:
50
- 1. Output ONLY the function body code (between { and })
51
- 2. Destructure `input` at the top: `const { order, customer } = input;`
52
- (actually this is done for you — skip the destructure)
53
- 3. Perform the calculation/transformation
54
- 4. Return a meaningful result object
55
- 5. Throw Error('...') for failure cases with descriptive messages
56
- 6. NO await prisma.*, NO await eventBus.*, NO fetch, NO external calls
57
- 7. If the step fundamentally requires external side effects, throw an
58
- error indicating that — do not fake it
59
-
60
- OUTPUT FORMAT:
61
- - No markdown fences
62
- - No explanation before or after
63
- - Just the function body code
64
- - First line should be a comment summarizing what the function does
66
+ SpecVerse uses CURVED operations (Create, Update, Retrieve, Validate,
67
+ Evolve, Delete) on controllers. Validate is dry-run; Evolve handles
68
+ lifecycle state transitions. Models declare attributes, relationships,
69
+ and lifecycles. Full reference lives in the SpecVerse canonical guide
70
+ (`specverse://guide` resource, or `~/.claude/skills/specverse/reference/guide.md`
71
+ if the skill is installed).
65
72
 
66
73
  examples:
67
74
  - step: "Apply discount based on loyalty tier"
@@ -107,7 +114,7 @@ user:
107
114
 
108
115
  The function MUST return {{returnType}}. If that's `any`, return a
109
116
  reasonable result object describing what was computed. If it's a specific
110
- type (e.g., { cost: number; days: number }), return an object matching
117
+ type (e.g., "{ cost: number; days: number }"), return an object matching
111
118
  that shape exactly — the caller depends on those field names.
112
119
 
113
120
  Output ONLY the function body (the code that goes between { and }).
@@ -1,5 +1,5 @@
1
1
  name: create
2
- version: "9.0.0"
2
+ version: "9.2.0"
3
3
  description: Generate minimal SpecVerse specifications from natural language requirements with deployment policies
4
4
  author: SpecVerse Team
5
5
  tags: [creation, requirements, minimal-spec, v9, deployment-policies, validate-fix-loop]
@@ -15,6 +15,14 @@ system:
15
15
  Your task: Analyze requirements and generate the smallest possible valid specification that captures core business logic.
16
16
  The SpecVerse inference engine will later expand these minimal specs into complete architectures.
17
17
 
18
+ OUTPUT FORMAT (critical):
19
+ - Emit the complete .specly content as YAML directly in your response,
20
+ wrapped in a single ```specly ... ``` code block.
21
+ - Do NOT use Write, Edit, or any file-saving tools — even if available.
22
+ The caller harvests the spec text from your response, not from disk.
23
+ - Do NOT prefix with prose or status updates. Reply with the code block
24
+ as the primary output. Brief commentary AFTER the block is OK.
25
+
18
26
  context: |
19
27
  CORE PRINCIPLES:
20
28
  1. Extract core business entities and their relationships
@@ -310,7 +318,7 @@ user:
310
318
  - Use components: (plural) at top level
311
319
  - Use snake_case for lifecycle states (NOT kebab-case)
312
320
  - Add deployment policies appropriate for scale
313
- - Write to: spec.specly
321
+ - Output the spec inside a ```specly``` code block in your response (do not write to disk)
314
322
 
315
323
  Step 2: VALIDATE
316
324
  - Run: spv validate spec.specly --json
@@ -336,7 +344,7 @@ user:
336
344
  - invalid relationship syntax
337
345
  - invalid deployment policy structure
338
346
  - incorrect operation policy nesting
339
- * Fix the spec using Edit tool
347
+ * Update the spec inline in your response (do not edit a file on disk)
340
348
  * Go back to Step 2
341
349
 
342
350
  Continue the validate-fix loop until validation passes.
@@ -1,5 +1,5 @@
1
1
  name: analyse
2
- version: "9.0.0"
2
+ version: "9.2.0"
3
3
  description: Extract SpecVerse specifications from existing code with deployment policy recognition
4
4
  author: SpecVerse Team
5
5
  tags: [analysis, reverse-engineering, implementation, v9, deployment-policies, validate-fix-loop]
@@ -21,6 +21,15 @@ system:
21
21
  - a deployments section showing the logical instances with operational policies
22
22
  - a manifest section with the physical details about the deployment
23
23
 
24
+ OUTPUT FORMAT (critical):
25
+ - Emit the complete .specly content as YAML directly in your response,
26
+ wrapped in a single ```specly ... ``` code block.
27
+ - Do NOT use Write, Edit, or any file-saving tools — even if available.
28
+ The caller harvests the spec text from your response, not from disk.
29
+ - Do NOT prefix with prose, explanations, or status updates. Reply with
30
+ the code block as the primary output. Brief commentary AFTER the
31
+ block is OK.
32
+
24
33
  context: |
25
34
  Generate a FULL SpecVerse specification that represents the actual implementation
26
35
  - this specification will be validated so must be syntactically correct
@@ -388,7 +397,7 @@ user:
388
397
  - Use components: (plural) at top level
389
398
  - Use snake_case for lifecycle states (NOT kebab-case)
390
399
  - Include components, deployments (with policies), and manifest sections
391
- - Write to: spec.specly
400
+ - Output the spec inside a ```specly``` code block in your response (do not write to disk)
392
401
 
393
402
  Step 2: VALIDATE
394
403
  - Run: spv validate spec.specly --json
@@ -419,7 +428,7 @@ user:
419
428
  - incorrect operation policy nesting
420
429
  - invalid policy property names or values
421
430
  - missing 'policies' wrapper in operations
422
- * Fix the spec using Edit tool
431
+ * Update the spec inline in your response (do not edit a file on disk)
423
432
  * Go back to Step 2
424
433
 
425
434
  Continue the validate-fix loop until validation passes.
@@ -1,5 +1,5 @@
1
1
  name: behavior
2
- version: "9.1.0"
2
+ version: "9.2.0"
3
3
  description: Generate pure TypeScript function bodies for SpecVerse behavior steps that don't match convention patterns
4
4
  author: SpecVerse Team
5
5
  tags: [behavior, code-generation, pure-function, typescript, realize]
@@ -10,58 +10,65 @@ system:
10
10
  function bodies for behavior steps that couldn't be matched by the realize
11
11
  engine's convention patterns.
12
12
 
13
+ minimalContext: |
13
14
  PURE FUNCTION RULES (critical — violating these breaks the architecture):
14
15
  1. NO database access (no prisma, no queries)
15
16
  2. NO event publishing (no eventBus)
16
17
  3. NO external services (no fetch, no email providers, no payment gateways)
17
18
  4. NO imports, no require, no fs, no process
18
- 5. All data you need comes in via the `input` object parameter
19
+ 5. All data you need comes in via the `input` object parameter (already destructured — you have the fields directly)
19
20
  6. Return a plain result value (object, number, string) — the caller uses it
20
21
 
21
- The controller (deterministic, convention-matched code) fetches all data,
22
- calls your function, and then applies the result via convention code. Your
23
- function is the PURE calculation or transformation in the middle.
22
+ OUTPUT RULES:
23
+ 1. Output ONLY the function body code (between { and })
24
+ 2. First line: short comment summarising what the function does
25
+ 3. No markdown fences, no explanation before or after
26
+ 4. Throw Error('...') for failure cases with descriptive messages
27
+ 5. If a step fundamentally requires external side effects, throw an error indicating that — do not fake it
28
+
29
+ fullContext: |
30
+ # SpecVerse context (for LLMs that don't have the SpecVerse skill loaded)
31
+
32
+ SpecVerse is a declarative specification language. You describe WHAT a
33
+ system does in a .specly file, and the engines generate HOW — backend
34
+ (Fastify/Prisma), frontend (React/Tailwind), CLI, tools, diagrams. The
35
+ behavior-generation step you're being asked to perform plugs a
36
+ specific gap: the realize engine matches most spec behavior steps
37
+ against convention patterns ("Find {Model}", "Set {field}",
38
+ "Send {event}") and emits them directly; for the rest, you fill in
39
+ the pure-function body.
40
+
41
+ Where your function fits:
24
42
 
25
- Example flow:
26
43
  ```
27
- // Controller (convention code)
44
+ // Controller (convention-generated code — NOT your job)
28
45
  const order = await prisma.order.findUniqueOrThrow(...);
29
46
  const customer = await prisma.customer.findUniqueOrThrow(...);
30
47
 
31
- // Your function (pure)
48
+ // Your function — PURE calculation or transformation
32
49
  const discount = await applyDiscountBasedOnLoyaltyTier({ order, customer });
33
50
  // discount = { amount: 42, rate: 0.10 }
34
51
 
35
- // Controller (convention code)
52
+ // Controller (convention-generated code — NOT your job)
36
53
  await prisma.order.update({ where: { id }, data: { total: order.total - discount.amount } });
37
54
  await eventBus.publish('OrderDiscounted', { orderId, discount });
38
55
  ```
39
56
 
40
- Convention patterns that are ALREADY auto-generated (you don't handle these):
57
+ Convention patterns ALREADY auto-generated (don't re-implement these):
41
58
  - "Find {Model} by {field}", "Create {Model}", "Update {Model}..."
42
59
  - "Delete {Model}", "Transition {Model} to {state}"
43
60
  - "Set/Increment/Decrement {field}", "Send {event} event"
44
61
 
45
- You handle domain-specific logic: calculations, transformations, rules,
46
- scoring, categorisation, validation.
62
+ You handle: domain-specific calculations, transformations, rules,
63
+ scoring, categorisation, validation logic. Anything where the behavior
64
+ step text doesn't match a convention pattern.
47
65
 
48
- context: |
49
- OUTPUT RULES:
50
- 1. Output ONLY the function body code (between { and })
51
- 2. Destructure `input` at the top: `const { order, customer } = input;`
52
- (actually this is done for you — skip the destructure)
53
- 3. Perform the calculation/transformation
54
- 4. Return a meaningful result object
55
- 5. Throw Error('...') for failure cases with descriptive messages
56
- 6. NO await prisma.*, NO await eventBus.*, NO fetch, NO external calls
57
- 7. If the step fundamentally requires external side effects, throw an
58
- error indicating that — do not fake it
59
-
60
- OUTPUT FORMAT:
61
- - No markdown fences
62
- - No explanation before or after
63
- - Just the function body code
64
- - First line should be a comment summarizing what the function does
66
+ SpecVerse uses CURVED operations (Create, Update, Retrieve, Validate,
67
+ Evolve, Delete) on controllers. Validate is dry-run; Evolve handles
68
+ lifecycle state transitions. Models declare attributes, relationships,
69
+ and lifecycles. Full reference lives in the SpecVerse canonical guide
70
+ (`specverse://guide` resource, or `~/.claude/skills/specverse/reference/guide.md`
71
+ if the skill is installed).
65
72
 
66
73
  examples:
67
74
  - step: "Apply discount based on loyalty tier"
@@ -107,7 +114,7 @@ user:
107
114
 
108
115
  The function MUST return {{returnType}}. If that's `any`, return a
109
116
  reasonable result object describing what was computed. If it's a specific
110
- type (e.g., { cost: number; days: number }), return an object matching
117
+ type (e.g., "{ cost: number; days: number }"), return an object matching
111
118
  that shape exactly — the caller depends on those field names.
112
119
 
113
120
  Output ONLY the function body (the code that goes between { and }).
@@ -1,5 +1,5 @@
1
1
  name: create
2
- version: "9.0.0"
2
+ version: "9.2.0"
3
3
  description: Generate minimal SpecVerse specifications from natural language requirements with deployment policies
4
4
  author: SpecVerse Team
5
5
  tags: [creation, requirements, minimal-spec, v9, deployment-policies, validate-fix-loop]
@@ -15,6 +15,14 @@ system:
15
15
  Your task: Analyze requirements and generate the smallest possible valid specification that captures core business logic.
16
16
  The SpecVerse inference engine will later expand these minimal specs into complete architectures.
17
17
 
18
+ OUTPUT FORMAT (critical):
19
+ - Emit the complete .specly content as YAML directly in your response,
20
+ wrapped in a single ```specly ... ``` code block.
21
+ - Do NOT use Write, Edit, or any file-saving tools — even if available.
22
+ The caller harvests the spec text from your response, not from disk.
23
+ - Do NOT prefix with prose or status updates. Reply with the code block
24
+ as the primary output. Brief commentary AFTER the block is OK.
25
+
18
26
  context: |
19
27
  CORE PRINCIPLES:
20
28
  1. Extract core business entities and their relationships
@@ -310,7 +318,7 @@ user:
310
318
  - Use components: (plural) at top level
311
319
  - Use snake_case for lifecycle states (NOT kebab-case)
312
320
  - Add deployment policies appropriate for scale
313
- - Write to: spec.specly
321
+ - Output the spec inside a ```specly``` code block in your response (do not write to disk)
314
322
 
315
323
  Step 2: VALIDATE
316
324
  - Run: spv validate spec.specly --json
@@ -336,7 +344,7 @@ user:
336
344
  - invalid relationship syntax
337
345
  - invalid deployment policy structure
338
346
  - incorrect operation policy nesting
339
- * Fix the spec using Edit tool
347
+ * Update the spec inline in your response (do not edit a file on disk)
340
348
  * Go back to Step 2
341
349
 
342
350
  Continue the validate-fix loop until validation passes.
@@ -1,19 +1,28 @@
1
1
  /**
2
- * Behavior AI Service — session-based Claude conversation for generating
3
- * TypeScript function bodies for unmatched behavior steps.
2
+ * Behavior AI Service — generates pure TypeScript function bodies for
3
+ * behavior steps that weren't matched by the realize engine's convention
4
+ * patterns.
4
5
  *
5
- * Architecture (mirrors specverse-app-demo/src/ai/ai-service.ts):
6
- * - First call: spawns Claude with --session-id <uuid> --system-prompt <prompt>
7
- * - Subsequent calls: --resume <uuid> for cached context (98% token savings)
8
- * - All steps for a controller share one session — Claude builds understanding
9
- * of the spec across calls, generating coherent code
10
- * - Loads system prompt from assets/prompts/core/standard/v9/behavior.prompt.yaml
6
+ * Architecture (post AI-SDK replatform, 2026-04):
7
+ * - Delegates to the Vercel AI SDK via the model resolver. Provider choice
8
+ * is driven by SPECVERSE_AI_PROVIDER (claude-cli | anthropic |
9
+ * openai-compatible | stub) with sensible defaults per environment.
10
+ * - Claude-CLI provider preserves the Max-subscription zero-cost path
11
+ * (spawn claude --print --session-id/--resume). API provider uses
12
+ * Anthropic prompt caching for equivalent savings.
13
+ * - When claude-cli is active AND the SpecVerse skill is installed,
14
+ * Claude Code auto-loads the skill — we skip the fullContext block
15
+ * (saves ~2K tokens per session init).
16
+ * - For providers that don't have skill auto-load (anthropic, openai-
17
+ * compatible), we include the fullContext block in the system prompt
18
+ * so the model has the same grounding.
11
19
  *
12
20
  * Used by ai-behaviors-generator at realize time.
13
21
  */
14
22
  export interface BehaviorAIServiceOptions {
15
- claudePath?: string;
23
+ /** Model override. Passed through to the resolver; interpretation is provider-specific. */
16
24
  model?: string;
25
+ /** Per-call timeout (ms). Default 120_000. Only honoured by the claude-cli provider. */
17
26
  timeout?: number;
18
27
  }
19
28
  export interface BehaviorGenerateContext {
@@ -28,36 +37,34 @@ export interface BehaviorGenerateContext {
28
37
  returnType?: string;
29
38
  }
30
39
  /**
31
- * Session-based AI service for generating behavior implementations.
40
+ * Service class kept for API compatibility with ai-behaviors-generator.
41
+ * Internally delegates to the AI SDK via the model resolver.
32
42
  */
33
43
  export declare class BehaviorAIService {
34
- private claudePath;
35
44
  private model;
45
+ private providerId;
46
+ private prompt;
47
+ private system;
36
48
  private timeout;
37
- private sessionId;
38
- private initialized;
39
- private currentProcess;
40
- private systemPrompt;
41
- private userTemplate;
49
+ /** Non-null after generateBehavior() succeeds once. */
50
+ get isAvailable(): boolean;
42
51
  constructor(options?: BehaviorAIServiceOptions);
43
- private detectClaudePath;
44
52
  /**
45
- * Check if Claude CLI is available.
53
+ * Build the system prompt. When the active provider can auto-load the
54
+ * SpecVerse skill (claude-cli + installed skill), we emit role +
55
+ * minimalContext only. Otherwise we include fullContext for grounding.
46
56
  */
47
- get isAvailable(): boolean;
57
+ private assembleSystemPrompt;
48
58
  /**
49
- * Start a new session for a controller. All step generations within the
50
- * controller will share this session, accumulating spec context.
59
+ * Start a new session for a controller. Session semantics are now owned
60
+ * by the provider for claude-cli that's the spawn-with-session-id
61
+ * mechanism; for anthropic API it's the prompt-cache marker. We just
62
+ * record a no-op for callers that expect a session id to log.
51
63
  */
52
64
  startSession(controllerName: string): string;
53
- /**
54
- * Generate a function body for a behavior step.
55
- * First call creates the session with system prompt; subsequent calls resume.
56
- */
65
+ /** Generate a function body for a behavior step. */
57
66
  generateBehavior(ctx: BehaviorGenerateContext): Promise<string | null>;
58
- /**
59
- * End the current session.
60
- */
67
+ /** End the current session — no-op now that session state lives in the provider. */
61
68
  endSession(): void;
62
69
  private buildUserPrompt;
63
70
  private extractCode;
@@ -1 +1 @@
1
- {"version":3,"file":"behavior-ai-service.d.ts","sourceRoot":"","sources":["../../src/ai/behavior-ai-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AASH,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,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