@lssm/lib.contracts 0.0.0-canary-20251216033905 → 0.0.0-canary-20251216062412
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.
- package/dist/app-config/app-config.feature.js +1 -0
- package/dist/app-config/index.js +1 -1
- package/dist/docs/index.js +1 -1
- package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.js +14 -14
- package/dist/docs/tech/llm/llm-integration.docblock.js +289 -0
- package/dist/index.js +1 -1
- package/dist/integrations/index.js +1 -1
- package/dist/integrations/openbanking/contracts/index.js +1 -1
- package/dist/integrations/openbanking/openbanking.feature.js +1 -0
- package/dist/llm/exporters.js +8 -0
- package/dist/llm/index.js +1 -0
- package/dist/llm/prompts.js +220 -0
- package/dist/llm/types.js +0 -0
- package/package.json +15 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={meta:{key:`app-config`,title:`App Configuration`,description:`Tenant app configuration lifecycle management with draft, preview, and publish stages`,domain:`platform`,owners:[`@platform.sigil`],tags:[`app-config`,`lifecycle`,`configuration`,`tenant`],stability:`beta`},operations:[],events:[{name:`app_config.draft_created`,version:1},{name:`app_config.promoted_to_preview`,version:1},{name:`app_config.published`,version:1},{name:`app_config.rolled_back`,version:1}],presentations:[],opToPresentation:[],presentationsTargets:[],capabilities:{provides:[{key:`app-config`,version:1}],requires:[]}};export{e as AppConfigFeature};
|
package/dist/app-config/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AppBlueprintRegistry as e,makeAppBlueprintKey as t}from"./spec.js";import{composeAppConfig as n,resolveAppConfig as r}from"./runtime.js";import{ConfigDraftCreatedEvent as
|
|
1
|
+
import{AppBlueprintRegistry as e,makeAppBlueprintKey as t}from"./spec.js";import{composeAppConfig as n,resolveAppConfig as r}from"./runtime.js";import{AppConfigFeature as i}from"./app-config.feature.js";import{ConfigDraftCreatedEvent as a,ConfigPromotedToPreviewEvent as o,ConfigPublishedEvent as s,ConfigRolledBackEvent as c}from"./events.js";import{validateBlueprint as l,validateConfig as u,validateResolvedConfig as d,validateTenantConfig as f}from"./validation.js";import{CreateTenantConfigDraftCommand as p,GetTenantConfigVersionQuery as m,ListTenantConfigVersionsQuery as h,PromoteTenantConfigToPreviewCommand as g,PublishTenantConfigCommand as _,RollbackTenantConfigCommand as v,lifecycleContracts as y,registerAppConfigLifecycleContracts as b}from"./lifecycle-contracts.js";export{e as AppBlueprintRegistry,i as AppConfigFeature,a as ConfigDraftCreatedEvent,o as ConfigPromotedToPreviewEvent,s as ConfigPublishedEvent,c as ConfigRolledBackEvent,p as CreateTenantConfigDraftCommand,m as GetTenantConfigVersionQuery,h as ListTenantConfigVersionsQuery,g as PromoteTenantConfigToPreviewCommand,_ as PublishTenantConfigCommand,v as RollbackTenantConfigCommand,n as composeAppConfig,y as lifecycleContracts,t as makeAppBlueprintKey,b as registerAppConfigLifecycleContracts,r as resolveAppConfig,l as validateBlueprint,u as validateConfig,d as validateResolvedConfig,f as validateTenantConfig};
|
package/dist/docs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{docBlockToPresentationSpec as e,docBlockToPresentationV2 as t,docBlocksToPresentationRoutes as n,docBlocksToPresentationSpecs as r,mapDocRoutes as i}from"./presentations.js";import{DocRegistry as a,defaultDocRegistry as o,docId as s,listRegisteredDocBlocks as c,registerDocBlocks as l}from"./registry.js";import{techContractsDocs as u}from"./tech-contracts.docs.js";import{metaDocs as d}from"./meta.docs.js";import"./PUBLISHING.docblock.js";import"./accessibility_wcag_compliance_specs.docblock.js";import"./tech/PHASE_1_QUICKSTART.docblock.js";import"./tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js";import"./tech/PHASE_3_AUTO_EVOLUTION.docblock.js";import"./tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js";import"./tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js";import"./tech/lifecycle-stage-system.docblock.js";import"./tech/presentation-runtime.docblock.js";import"./tech/auth/better-auth-nextjs.docblock.js";import"./tech/schema/README.docblock.js";import"./tech/templates/runtime.docblock.js";import"./tech/workflows/overview.docblock.js";import"./tech/mcp-endpoints.docblock.js";import"./tech/vscode-extension.docblock.js";import"./tech/telemetry-ingest.docblock.js";import"./tech/contracts/openapi-export.docblock.js";import"./tech/studio/workspaces.docblock.js";import"./tech/studio/sandbox-unlogged.docblock.js";import"./tech/studio/workspace-ops.docblock.js";import"./tech/studio/project-routing.docblock.js";import"./tech/studio/platform-admin-panel.docblock.js";import"./tech/studio/learning-events.docblock.js";import"./tech/studio/learning-journeys.docblock.js";import"./tech/studio/project-access-teams.docblock.js";import"./tech/studio/team-invitations.docblock.js";export{a as DocRegistry,o as defaultDocRegistry,e as docBlockToPresentationSpec,t as docBlockToPresentationV2,n as docBlocksToPresentationRoutes,r as docBlocksToPresentationSpecs,s as docId,c as listRegisteredDocBlocks,i as mapDocRoutes,d as metaDocs,l as registerDocBlocks,u as techContractsDocs};
|
|
1
|
+
import{docBlockToPresentationSpec as e,docBlockToPresentationV2 as t,docBlocksToPresentationRoutes as n,docBlocksToPresentationSpecs as r,mapDocRoutes as i}from"./presentations.js";import{DocRegistry as a,defaultDocRegistry as o,docId as s,listRegisteredDocBlocks as c,registerDocBlocks as l}from"./registry.js";import{techContractsDocs as u}from"./tech-contracts.docs.js";import{metaDocs as d}from"./meta.docs.js";import"./PUBLISHING.docblock.js";import"./accessibility_wcag_compliance_specs.docblock.js";import"./tech/PHASE_1_QUICKSTART.docblock.js";import"./tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js";import"./tech/PHASE_3_AUTO_EVOLUTION.docblock.js";import"./tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js";import"./tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js";import"./tech/lifecycle-stage-system.docblock.js";import"./tech/presentation-runtime.docblock.js";import"./tech/auth/better-auth-nextjs.docblock.js";import"./tech/schema/README.docblock.js";import"./tech/templates/runtime.docblock.js";import"./tech/workflows/overview.docblock.js";import"./tech/mcp-endpoints.docblock.js";import"./tech/vscode-extension.docblock.js";import"./tech/telemetry-ingest.docblock.js";import"./tech/contracts/openapi-export.docblock.js";import"./tech/studio/workspaces.docblock.js";import"./tech/studio/sandbox-unlogged.docblock.js";import"./tech/studio/workspace-ops.docblock.js";import"./tech/studio/project-routing.docblock.js";import"./tech/studio/platform-admin-panel.docblock.js";import"./tech/studio/learning-events.docblock.js";import"./tech/studio/learning-journeys.docblock.js";import"./tech/studio/project-access-teams.docblock.js";import"./tech/studio/team-invitations.docblock.js";import"./tech/llm/llm-integration.docblock.js";export{a as DocRegistry,o as defaultDocRegistry,e as docBlockToPresentationSpec,t as docBlockToPresentationV2,n as docBlocksToPresentationRoutes,r as docBlocksToPresentationSpecs,s as docId,c as listRegisteredDocBlocks,i as mapDocRoutes,d as metaDocs,l as registerDocBlocks,u as techContractsDocs};
|
|
@@ -6,43 +6,43 @@ This document explains how operations (ContractSpec) are linked to Presentations
|
|
|
6
6
|
- Field: \`FeatureModuleSpec.opToPresentation?: { op: { name; version }; pres: { name; version } }[]\`
|
|
7
7
|
- Validation: \`installFeature()\` validates that linked ops exist in \`SpecRegistry\` and linked presentations exist in the registry, and that declared targets are present.
|
|
8
8
|
|
|
9
|
-
Example
|
|
9
|
+
Example:
|
|
10
10
|
|
|
11
11
|
\`\`\`ts
|
|
12
12
|
import type { SpecRegistry } from '@lssm/lib.contracts/src/registry';
|
|
13
13
|
import { FeatureRegistry, createFeatureModule } from '@lssm/lib.contracts';
|
|
14
14
|
|
|
15
|
-
export function
|
|
15
|
+
export function buildFeaturesWithOps(ops: SpecRegistry) {
|
|
16
16
|
const features = new FeatureRegistry();
|
|
17
17
|
features.register(
|
|
18
18
|
createFeatureModule(
|
|
19
19
|
{
|
|
20
|
-
key: '
|
|
21
|
-
title: '
|
|
20
|
+
key: 'myapp.widgets.linkage',
|
|
21
|
+
title: 'Widgets (linked)',
|
|
22
22
|
description: 'Links create/update ops to UI presentations',
|
|
23
|
-
domain: '
|
|
24
|
-
tags: ['
|
|
23
|
+
domain: 'widgets',
|
|
24
|
+
tags: ['widgets', 'linkage'],
|
|
25
25
|
stability: 'beta',
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
operations: [
|
|
29
|
-
{ name: '
|
|
30
|
-
{ name: '
|
|
29
|
+
{ name: 'widgets.create', version: 1 },
|
|
30
|
+
{ name: 'widgets.update', version: 1 },
|
|
31
31
|
],
|
|
32
|
-
presentations: [{ name: '
|
|
32
|
+
presentations: [{ name: 'myapp.widgets.editor.page', version: 1 }],
|
|
33
33
|
opToPresentation: [
|
|
34
34
|
{
|
|
35
|
-
op: { name: '
|
|
36
|
-
pres: { name: '
|
|
35
|
+
op: { name: 'widgets.create', version: 1 },
|
|
36
|
+
pres: { name: 'myapp.widgets.editor.page', version: 1 },
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
op: { name: '
|
|
40
|
-
pres: { name: '
|
|
39
|
+
op: { name: 'widgets.update', version: 1 },
|
|
40
|
+
pres: { name: 'myapp.widgets.editor.page', version: 1 },
|
|
41
41
|
},
|
|
42
42
|
],
|
|
43
43
|
presentationsTargets: [
|
|
44
44
|
{
|
|
45
|
-
name: '
|
|
45
|
+
name: 'myapp.widgets.editor.page',
|
|
46
46
|
version: 1,
|
|
47
47
|
targets: ['react', 'markdown'],
|
|
48
48
|
},
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import{registerDocBlocks as e}from"../../registry.js";const t=[{id:`docs.tech.llm.overview`,title:`LLM Integration Overview`,summary:`Export specs to LLM-friendly formats, generate implementation guides, and verify implementations.`,kind:`reference`,visibility:`public`,route:`/docs/tech/llm/overview`,tags:[`llm`,`ai`,`export`,`guide`,`verify`],body:`# LLM Integration
|
|
2
|
+
|
|
3
|
+
ContractSpec provides first-class LLM integration to bridge specifications and AI coding agents.
|
|
4
|
+
|
|
5
|
+
## Core Features
|
|
6
|
+
|
|
7
|
+
### 1. Multi-Format Export
|
|
8
|
+
|
|
9
|
+
Export specs to markdown in formats optimized for LLM consumption:
|
|
10
|
+
|
|
11
|
+
- **Context format**: Summary for understanding (goal, context, acceptance criteria)
|
|
12
|
+
- **Full format**: Complete spec with all details (I/O schemas, policy, events)
|
|
13
|
+
- **Prompt format**: Actionable prompt with implementation instructions
|
|
14
|
+
|
|
15
|
+
### 2. Implementation Guidance
|
|
16
|
+
|
|
17
|
+
Generate agent-specific implementation plans:
|
|
18
|
+
|
|
19
|
+
- **Claude Code**: Extended thinking mode with structured prompts
|
|
20
|
+
- **Cursor CLI**: Background/composer mode with .mdc rules generation
|
|
21
|
+
- **Generic MCP**: Standard format for any MCP-compatible agent
|
|
22
|
+
|
|
23
|
+
### 3. Tiered Verification
|
|
24
|
+
|
|
25
|
+
Verify implementations against specs:
|
|
26
|
+
|
|
27
|
+
- **Tier 1 (Structure)**: Types, exports, imports validation
|
|
28
|
+
- **Tier 2 (Behavior)**: Scenario coverage, error handling, events
|
|
29
|
+
- **Tier 3 (AI Review)**: Semantic compliance analysis via LLM
|
|
30
|
+
|
|
31
|
+
## Access Points
|
|
32
|
+
|
|
33
|
+
| Surface | Commands/Tools |
|
|
34
|
+
|---------|---------------|
|
|
35
|
+
| CLI | \`contractspec llm export\`, \`guide\`, \`verify\`, \`copy\` |
|
|
36
|
+
| MCP | \`llm.export\`, \`llm.guide\`, \`llm.verify\` tools |
|
|
37
|
+
| VSCode | Export to LLM, Generate Guide, Verify, Copy commands |
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
### CLI Usage
|
|
42
|
+
|
|
43
|
+
\`\`\`bash
|
|
44
|
+
# Export spec as markdown
|
|
45
|
+
contractspec llm export path/to/my.spec.ts --format full
|
|
46
|
+
|
|
47
|
+
# Generate implementation guide
|
|
48
|
+
contractspec llm guide path/to/my.spec.ts --agent claude-code
|
|
49
|
+
|
|
50
|
+
# Verify implementation
|
|
51
|
+
contractspec llm verify path/to/my.spec.ts path/to/impl.ts --tier 2
|
|
52
|
+
|
|
53
|
+
# Copy spec to clipboard
|
|
54
|
+
contractspec llm copy path/to/my.spec.ts --format context
|
|
55
|
+
\`\`\`
|
|
56
|
+
|
|
57
|
+
### MCP Usage
|
|
58
|
+
|
|
59
|
+
\`\`\`
|
|
60
|
+
# Export spec
|
|
61
|
+
llm.export { specPath: "path/to/my.spec.ts", format: "full" }
|
|
62
|
+
|
|
63
|
+
# Generate guide
|
|
64
|
+
llm.guide { specPath: "path/to/my.spec.ts", agent: "cursor-cli" }
|
|
65
|
+
|
|
66
|
+
# Verify implementation
|
|
67
|
+
llm.verify { specPath: "path/to/my.spec.ts", implementationPath: "path/to/impl.ts", tier: "2" }
|
|
68
|
+
\`\`\`
|
|
69
|
+
|
|
70
|
+
### Programmatic Usage
|
|
71
|
+
|
|
72
|
+
\`\`\`typescript
|
|
73
|
+
import { specToFullMarkdown, specToAgentPrompt } from '@lssm/lib.contracts/llm';
|
|
74
|
+
import { createAgentGuideService, createVerifyService } from '@lssm/bundle.contractspec-workspace';
|
|
75
|
+
|
|
76
|
+
// Export
|
|
77
|
+
const markdown = specToFullMarkdown(mySpec);
|
|
78
|
+
|
|
79
|
+
// Generate guide
|
|
80
|
+
const guideService = createAgentGuideService({ defaultAgent: 'claude-code' });
|
|
81
|
+
const guide = guideService.generateGuide(mySpec);
|
|
82
|
+
|
|
83
|
+
// Verify
|
|
84
|
+
const verifyService = createVerifyService();
|
|
85
|
+
const result = await verifyService.verify(mySpec, implementationCode, {
|
|
86
|
+
tiers: ['structure', 'behavior']
|
|
87
|
+
});
|
|
88
|
+
\`\`\`
|
|
89
|
+
`},{id:`docs.tech.llm.export-formats`,title:`LLM Export Formats`,summary:`Detailed explanation of the three export formats for LLM consumption.`,kind:`reference`,visibility:`public`,route:`/docs/tech/llm/export-formats`,tags:[`llm`,`export`,`markdown`],body:`# LLM Export Formats
|
|
90
|
+
|
|
91
|
+
ContractSpec provides three export formats optimized for different LLM use cases.
|
|
92
|
+
|
|
93
|
+
## Context Format
|
|
94
|
+
|
|
95
|
+
Best for: Understanding what a spec does, providing background to LLMs.
|
|
96
|
+
|
|
97
|
+
Includes:
|
|
98
|
+
- Spec name, version, type
|
|
99
|
+
- Goal and context
|
|
100
|
+
- Description
|
|
101
|
+
- Acceptance scenarios
|
|
102
|
+
|
|
103
|
+
Example:
|
|
104
|
+
|
|
105
|
+
\`\`\`markdown
|
|
106
|
+
# users.createUser (v1)
|
|
107
|
+
|
|
108
|
+
> Create a new user account with email verification.
|
|
109
|
+
|
|
110
|
+
**Type:** command | **Stability:** stable
|
|
111
|
+
|
|
112
|
+
## Goal
|
|
113
|
+
Create a new user in the system and trigger email verification.
|
|
114
|
+
|
|
115
|
+
## Context
|
|
116
|
+
Part of the user onboarding flow. Called after signup form submission.
|
|
117
|
+
|
|
118
|
+
## Acceptance Criteria
|
|
119
|
+
### Happy path
|
|
120
|
+
**Given:** Valid email and password
|
|
121
|
+
**When:** User submits registration
|
|
122
|
+
**Then:** Account is created, verification email is sent
|
|
123
|
+
\`\`\`
|
|
124
|
+
|
|
125
|
+
## Full Format
|
|
126
|
+
|
|
127
|
+
Best for: Complete documentation, implementation reference.
|
|
128
|
+
|
|
129
|
+
Includes everything:
|
|
130
|
+
- All metadata
|
|
131
|
+
- JSON schemas for I/O
|
|
132
|
+
- Error definitions
|
|
133
|
+
- Policy (auth, rate limits, PII)
|
|
134
|
+
- Events emitted
|
|
135
|
+
- Examples
|
|
136
|
+
- Transport configuration
|
|
137
|
+
|
|
138
|
+
## Prompt Format
|
|
139
|
+
|
|
140
|
+
Best for: Feeding directly to coding agents.
|
|
141
|
+
|
|
142
|
+
Includes:
|
|
143
|
+
- Task header with clear instructions
|
|
144
|
+
- Full spec context
|
|
145
|
+
- Implementation requirements
|
|
146
|
+
- Task-specific guidance (implement/test/refactor/review)
|
|
147
|
+
- Expected output format
|
|
148
|
+
|
|
149
|
+
The prompt format adapts based on task type:
|
|
150
|
+
- **implement**: Full implementation with tests
|
|
151
|
+
- **test**: Test generation for existing code
|
|
152
|
+
- **refactor**: Refactoring while maintaining behavior
|
|
153
|
+
- **review**: Code review against spec
|
|
154
|
+
`},{id:`docs.tech.llm.agent-adapters`,title:`Agent Adapters`,summary:`Adapters for different AI coding agents (Claude, Cursor, MCP).`,kind:`reference`,visibility:`public`,route:`/docs/tech/llm/agent-adapters`,tags:[`llm`,`agents`,`claude`,`cursor`,`mcp`],body:`# Agent Adapters
|
|
155
|
+
|
|
156
|
+
ContractSpec provides specialized adapters for different AI coding agents.
|
|
157
|
+
|
|
158
|
+
## Claude Code Adapter
|
|
159
|
+
|
|
160
|
+
Optimized for Anthropic Claude's extended thinking and code generation.
|
|
161
|
+
|
|
162
|
+
Features:
|
|
163
|
+
- Structured markdown with clear sections
|
|
164
|
+
- Checklists for steps and verification
|
|
165
|
+
- Icons for file operations (📝 create, ✏️ modify)
|
|
166
|
+
- System prompt for ContractSpec context
|
|
167
|
+
|
|
168
|
+
Usage:
|
|
169
|
+
\`\`\`typescript
|
|
170
|
+
const guideService = createAgentGuideService({ defaultAgent: 'claude-code' });
|
|
171
|
+
const result = guideService.generateGuide(spec, { agent: 'claude-code' });
|
|
172
|
+
// result.prompt.systemPrompt - Claude system context
|
|
173
|
+
// result.prompt.taskPrompt - Task-specific instructions
|
|
174
|
+
\`\`\`
|
|
175
|
+
|
|
176
|
+
## Cursor CLI Adapter
|
|
177
|
+
|
|
178
|
+
Optimized for Cursor's background/composer mode.
|
|
179
|
+
|
|
180
|
+
Features:
|
|
181
|
+
- Compact format for context efficiency
|
|
182
|
+
- .mdc cursor rules generation
|
|
183
|
+
- Integration with Cursor's file system
|
|
184
|
+
- Concise step lists
|
|
185
|
+
|
|
186
|
+
Generate Cursor Rules:
|
|
187
|
+
\`\`\`typescript
|
|
188
|
+
const cursorRules = guideService.generateAgentConfig(spec, 'cursor-cli');
|
|
189
|
+
// Save to .cursor/rules/my-spec.mdc
|
|
190
|
+
\`\`\`
|
|
191
|
+
|
|
192
|
+
## Generic MCP Adapter
|
|
193
|
+
|
|
194
|
+
Works with any MCP-compatible agent (Cline, Aider, etc.).
|
|
195
|
+
|
|
196
|
+
Features:
|
|
197
|
+
- Standard markdown format
|
|
198
|
+
- Table-based metadata
|
|
199
|
+
- JSON resource format support
|
|
200
|
+
- Prompt message format
|
|
201
|
+
|
|
202
|
+
The generic adapter is the default and works across all agents.
|
|
203
|
+
|
|
204
|
+
## Choosing an Adapter
|
|
205
|
+
|
|
206
|
+
| Agent | Best For | Key Features |
|
|
207
|
+
|-------|----------|--------------|
|
|
208
|
+
| Claude Code | Complex implementations | Extended thinking, detailed steps |
|
|
209
|
+
| Cursor CLI | IDE-integrated work | Cursor rules, compact format |
|
|
210
|
+
| Generic MCP | Any MCP agent | Universal compatibility |
|
|
211
|
+
`},{id:`docs.tech.llm.verification`,title:`Implementation Verification`,summary:`Tiered verification of implementations against specifications.`,kind:`reference`,visibility:`public`,route:`/docs/tech/llm/verification`,tags:[`llm`,`verify`,`validation`,`testing`],body:`# Implementation Verification
|
|
212
|
+
|
|
213
|
+
ContractSpec provides tiered verification to check if implementations comply with specs.
|
|
214
|
+
|
|
215
|
+
## Verification Tiers
|
|
216
|
+
|
|
217
|
+
### Tier 1: Structure (Fast)
|
|
218
|
+
|
|
219
|
+
Checks TypeScript structure against spec requirements:
|
|
220
|
+
|
|
221
|
+
| Check | What it validates |
|
|
222
|
+
|-------|------------------|
|
|
223
|
+
| Handler export | Function is properly exported |
|
|
224
|
+
| Contracts import | Imports from @lssm/lib.contracts |
|
|
225
|
+
| Schema import | Imports from @lssm/lib.schema |
|
|
226
|
+
| No \`any\` type | TypeScript strict compliance |
|
|
227
|
+
| Error handling | Error codes are referenced |
|
|
228
|
+
| Event emission | Event patterns exist |
|
|
229
|
+
| Input validation | Validation patterns used |
|
|
230
|
+
| Async patterns | Async/await for commands |
|
|
231
|
+
|
|
232
|
+
### Tier 2: Behavior (Comprehensive)
|
|
233
|
+
|
|
234
|
+
Checks implementation coverage of spec behaviors:
|
|
235
|
+
|
|
236
|
+
| Check | What it validates |
|
|
237
|
+
|-------|------------------|
|
|
238
|
+
| Scenario coverage | Acceptance scenarios implemented |
|
|
239
|
+
| Example coverage | Example I/O values referenced |
|
|
240
|
+
| Error cases | All error conditions handled |
|
|
241
|
+
| Event conditions | Events emitted correctly |
|
|
242
|
+
| Idempotency | Idempotent patterns (if required) |
|
|
243
|
+
|
|
244
|
+
### Tier 3: AI Review (Deep)
|
|
245
|
+
|
|
246
|
+
Uses LLM for semantic analysis:
|
|
247
|
+
|
|
248
|
+
- Does the implementation fulfill the spec's intent?
|
|
249
|
+
- Are edge cases properly handled?
|
|
250
|
+
- Is the code quality acceptable?
|
|
251
|
+
- Are there any subtle violations?
|
|
252
|
+
|
|
253
|
+
Requires AI API key configuration.
|
|
254
|
+
|
|
255
|
+
## Running Verification
|
|
256
|
+
|
|
257
|
+
\`\`\`typescript
|
|
258
|
+
const verifyService = createVerifyService({
|
|
259
|
+
aiApiKey: process.env.ANTHROPIC_API_KEY, // Optional, for Tier 3
|
|
260
|
+
aiProvider: 'anthropic',
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
const result = await verifyService.verify(spec, implementationCode, {
|
|
264
|
+
tiers: ['structure', 'behavior'],
|
|
265
|
+
failFast: false,
|
|
266
|
+
includeSuggestions: true,
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
console.log(result.passed); // true/false
|
|
270
|
+
console.log(result.score); // 0-100
|
|
271
|
+
console.log(result.summary); // Human-readable summary
|
|
272
|
+
\`\`\`
|
|
273
|
+
|
|
274
|
+
## Verification Report
|
|
275
|
+
|
|
276
|
+
The report includes:
|
|
277
|
+
|
|
278
|
+
- **passed**: Overall compliance
|
|
279
|
+
- **score**: 0-100 score
|
|
280
|
+
- **issues**: Array of problems found
|
|
281
|
+
- **suggestions**: Recommended fixes
|
|
282
|
+
- **coverage**: Metrics on scenario/error/field coverage
|
|
283
|
+
|
|
284
|
+
Each issue has:
|
|
285
|
+
- **severity**: error, warning, or info
|
|
286
|
+
- **category**: type, export, import, scenario, error_handling, semantic
|
|
287
|
+
- **message**: Description of the issue
|
|
288
|
+
- **suggestion**: How to fix it
|
|
289
|
+
`}];e(t);export{t as tech_llm_integration_DocBlocks};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CapabilityRegistry as e,capabilityKey as t,defineCapability as n}from"./capabilities.js";import{DataViewRegistry as r,dataViewKey as i}from"./data-views.js";import{defineEvent as a,eventKey as o}from"./events.js";import{FeatureRegistry as s,installFeature as c,validateFeatureTargetsV2 as l}from"./features.js";import{FormRegistry as u,buildZodWithRelations as d,defineFormSpec as f,evalPredicate as p}from"./forms.js";import{schemaToMarkdown as m,schemaToMarkdownDetail as h,schemaToMarkdownList as g,schemaToMarkdownSummary as _,schemaToMarkdownTable as v}from"./schema-to-markdown.js";import{TransformEngine as y,createDefaultTransformEngine as b,registerBasicValidation as x,registerDefaultReactRenderer as S,registerReactToMarkdownRenderer as C}from"./presentations.v2.js";import{createEngineWithDefaults as w,createFeatureModule as T,registerFeature as E,renderFeaturePresentation as D}from"./client/react/feature-render.js";import{createFormRenderer as O}from"./client/react/form-render.js";import{shadcnDriver as k}from"./client/react/drivers/shadcn.js";import{rnReusablesDriver as A}from"./client/react/drivers/rn-reusables.js";import"./client/index.js";import{defaultGqlField as j,defaultMcpTool as M,defaultRestPath as N,jsonSchemaForSpec as P}from"./jsonschema.js";import{registerContractsOnBuilder as F}from"./server/graphql-pothos.js";import{PresentationRegistry as I,jsonSchemaForPresentation as L}from"./presentations.js";import{createMcpServer as R}from"./server/mcp/createMcpServer.js";import{createFetchHandler as z}from"./server/rest-generic.js";import{elysiaPlugin as B}from"./server/rest-elysia.js";import{expressRouter as V}from"./server/rest-express.js";import{makeNextAppHandler as H}from"./server/rest-next-app.js";import{makeNextPagesHandler as U}from"./server/rest-next-pages.js";import"./server/index.js";import{defineCommand as W,defineQuery as G,isEmitDeclRef as K}from"./spec.js";import{docBlockToPresentationSpec as q,docBlockToPresentationV2 as J,docBlocksToPresentationRoutes as Y,docBlocksToPresentationSpecs as X,mapDocRoutes as Z}from"./docs/presentations.js";import{DocRegistry as Q,defaultDocRegistry as $,docId as ee,listRegisteredDocBlocks as te,registerDocBlocks as ne}from"./docs/registry.js";import{SpecRegistry as re,opKey as ie}from"./registry.js";import{Owners as ae,OwnersEnum as oe,StabilityEnum as se,Tags as ce,TagsEnum as le}from"./ownership.js";import{ContractRegistryFileSchema as ue,ContractRegistryItemSchema as de,ContractRegistryItemTypeSchema as fe,ContractRegistryManifestSchema as pe}from"./contract-registry/schemas.js";import"./contract-registry/index.js";import{installOp as me,makeEmit as he,op as ge}from"./install.js";import{openApiForRegistry as _e}from"./openapi.js";import{definePrompt as ve}from"./prompt.js";import{PromptRegistry as ye}from"./promptRegistry.js";import{ResourceRegistry as be,defineResourceTemplate as xe,isResourceRef as Se,resourceRef as Ce}from"./resources.js";import{toV2FromV1 as we}from"./presentations.backcompat.js";import{CompleteOnboardingBaseInput as Te,CompleteOnboardingBaseOutput as Ee,CompleteOnboardingBaseSpec as De,DeleteOnboardingDraftBaseSpec as Oe,DeleteOnboardingDraftOutput as ke,GetOnboardingDraftBaseSpec as Ae,GetOnboardingDraftOutput as je,SaveOnboardingDraftBaseSpec as Me,SaveOnboardingDraftInput as Ne,SaveOnboardingDraftOutput as Pe}from"./onboarding-base.js";import{openBankingAccountsReadCapability as Fe,openBankingBalancesReadCapability as Ie,openBankingTransactionsReadCapability as Le,registerOpenBankingCapabilities as Re}from"./capabilities/openbanking.js";import{PolicyRegistry as ze,makePolicyKey as Be}from"./policy/spec.js";import{PolicyEngine as Ve}from"./policy/engine.js";import{OPAPolicyAdapter as He,buildOPAInput as Ue}from"./policy/opa-adapter.js";import{ThemeRegistry as We,makeThemeRef as Ge}from"./themes.js";import{MigrationRegistry as Ke}from"./migrations.js";import{TelemetryRegistry as qe,makeTelemetryKey as Je}from"./telemetry/spec.js";import{TelemetryTracker as Ye}from"./telemetry/tracker.js";import{TelemetryAnomalyMonitor as Xe}from"./telemetry/anomaly.js";import"./telemetry/index.js";import{TestRegistry as Ze,makeTestKey as Qe}from"./tests/spec.js";import{TestRunner as $e}from"./tests/runner.js";import"./tests/index.js";import{ExperimentRegistry as et,makeExperimentKey as tt}from"./experiments/spec.js";import{ExperimentEvaluator as nt}from"./experiments/evaluator.js";import{AppBlueprintRegistry as rt,makeAppBlueprintKey as it}from"./app-config/spec.js";import{composeAppConfig as at,resolveAppConfig as ot}from"./app-config/runtime.js";import{IntegrationSpecRegistry as st,makeIntegrationSpecKey as ct}from"./integrations/spec.js";import{registerStripeIntegration as lt,stripeIntegrationSpec as ut}from"./integrations/providers/stripe.js";import{postmarkIntegrationSpec as dt,registerPostmarkIntegration as ft}from"./integrations/providers/postmark.js";import{qdrantIntegrationSpec as pt,registerQdrantIntegration as mt}from"./integrations/providers/qdrant.js";import{mistralIntegrationSpec as ht,registerMistralIntegration as gt}from"./integrations/providers/mistral.js";import{elevenLabsIntegrationSpec as _t,registerElevenLabsIntegration as vt}from"./integrations/providers/elevenlabs.js";import{gmailIntegrationSpec as yt,registerGmailIntegration as bt}from"./integrations/providers/gmail.js";import{googleCalendarIntegrationSpec as xt,registerGoogleCalendarIntegration as St}from"./integrations/providers/google-calendar.js";import{registerTwilioSmsIntegration as Ct,twilioSmsIntegrationSpec as wt}from"./integrations/providers/twilio-sms.js";import{gcsStorageIntegrationSpec as Tt,registerGcsStorageIntegration as Et}from"./integrations/providers/gcs-storage.js";import{powensIntegrationSpec as Dt,registerPowensIntegration as Ot}from"./integrations/providers/powens.js";import{createDefaultIntegrationSpecRegistry as kt}from"./integrations/providers/registry.js";import{AccountBalanceRecord as At,BankAccountRecord as jt,BankTransactionRecord as Mt}from"./integrations/openbanking/models.js";import{OPENBANKING_PII_FIELDS as Nt,OPENBANKING_TELEMETRY_EVENTS as Pt,redactOpenBankingTelemetryPayload as Ft}from"./integrations/openbanking/telemetry.js";import{OpenBankingGetAccount as It,OpenBankingListAccounts as Lt,OpenBankingSyncAccounts as Rt}from"./integrations/openbanking/contracts/accounts.js";import{OpenBankingListTransactions as zt,OpenBankingSyncTransactions as Bt}from"./integrations/openbanking/contracts/transactions.js";import{OpenBankingGetBalances as Vt,OpenBankingRefreshBalances as Ht}from"./integrations/openbanking/contracts/balances.js";import{registerOpenBankingContracts as Ut}from"./integrations/openbanking/contracts/index.js";import{assertPrimaryOpenBankingReady as Wt,ensurePrimaryOpenBankingIntegration as Gt}from"./integrations/openbanking/guards.js";import"./integrations/index.js";import{KnowledgeSpaceRegistry as Kt,makeKnowledgeSpaceKey as qt}from"./knowledge/spec.js";import{productCanonKnowledgeSpace as Jt,registerProductCanonKnowledgeSpace as Yt}from"./knowledge/spaces/product-canon.js";import{registerSupportFaqKnowledgeSpace as Xt,supportFaqKnowledgeSpace as Zt}from"./knowledge/spaces/support-faq.js";import{emailThreadsKnowledgeSpace as Qt,registerEmailThreadsKnowledgeSpace as $t}from"./knowledge/spaces/email-threads.js";import{registerUploadedDocsKnowledgeSpace as en,uploadedDocsKnowledgeSpace as tn}from"./knowledge/spaces/uploaded-docs.js";import{financialDocsKnowledgeSpace as nn,registerFinancialDocsKnowledgeSpace as rn}from"./knowledge/spaces/financial-docs.js";import{financialOverviewKnowledgeSpace as an,registerFinancialOverviewKnowledgeSpace as on}from"./knowledge/spaces/financial-overview.js";import"./knowledge/index.js";import{CreateIntegrationConnection as sn,DeleteIntegrationConnection as cn,ListIntegrationConnections as ln,TestIntegrationConnection as un,UpdateIntegrationConnection as dn,integrationContracts as fn,registerIntegrationContracts as pn}from"./integrations/contracts.js";import{CreateKnowledgeSource as mn,DeleteKnowledgeSource as hn,ListKnowledgeSources as gn,TriggerKnowledgeSourceSync as _n,UpdateKnowledgeSource as vn,knowledgeContracts as yn,registerKnowledgeContracts as bn}from"./knowledge/contracts.js";import{behaviorToEnvelope as xn,errorToEnvelope as Sn,telemetryToEnvelope as Cn}from"./regenerator/utils.js";import{RegeneratorService as wn}from"./regenerator/service.js";import{ProposalExecutor as Tn}from"./regenerator/executor.js";import{ExecutorProposalSink as En}from"./regenerator/sinks.js";import"./regenerator/index.js";import{WorkflowRegistry as Dn}from"./workflow/spec.js";import{WorkflowValidationError as On,assertWorkflowSpecValid as kn,validateWorkflowSpec as An}from"./workflow/validation.js";import{evaluateExpression as jn}from"./workflow/expression.js";import{WorkflowPreFlightError as Mn,WorkflowRunner as Nn}from"./workflow/runner.js";import{InMemoryStateStore as Pn}from"./workflow/adapters/memory-store.js";import{PrismaStateStore as Fn}from"./workflow/adapters/db-adapter.js";import{createFileStateStore as In}from"./workflow/adapters/file-adapter.js";import"./workflow/index.js";import{techContractsDocs as Ln}from"./docs/tech-contracts.docs.js";import{metaDocs as Rn}from"./docs/meta.docs.js";import"./docs/index.js";import{defineSchemaModel as zn}from"@lssm/lib.schema";export{At as AccountBalanceRecord,rt as AppBlueprintRegistry,jt as BankAccountRecord,Mt as BankTransactionRecord,e as CapabilityRegistry,Te as CompleteOnboardingBaseInput,Ee as CompleteOnboardingBaseOutput,De as CompleteOnboardingBaseSpec,ue as ContractRegistryFileSchema,de as ContractRegistryItemSchema,fe as ContractRegistryItemTypeSchema,pe as ContractRegistryManifestSchema,sn as CreateIntegrationConnection,mn as CreateKnowledgeSource,r as DataViewRegistry,cn as DeleteIntegrationConnection,hn as DeleteKnowledgeSource,Oe as DeleteOnboardingDraftBaseSpec,ke as DeleteOnboardingDraftOutput,Q as DocRegistry,En as ExecutorProposalSink,nt as ExperimentEvaluator,et as ExperimentRegistry,s as FeatureRegistry,u as FormRegistry,Ae as GetOnboardingDraftBaseSpec,je as GetOnboardingDraftOutput,Pn as InMemoryStateStore,st as IntegrationSpecRegistry,Kt as KnowledgeSpaceRegistry,ln as ListIntegrationConnections,gn as ListKnowledgeSources,Ke as MigrationRegistry,He as OPAPolicyAdapter,Nt as OPENBANKING_PII_FIELDS,Pt as OPENBANKING_TELEMETRY_EVENTS,It as OpenBankingGetAccount,Vt as OpenBankingGetBalances,Lt as OpenBankingListAccounts,zt as OpenBankingListTransactions,Ht as OpenBankingRefreshBalances,Rt as OpenBankingSyncAccounts,Bt as OpenBankingSyncTransactions,ae as Owners,oe as OwnersEnum,Ve as PolicyEngine,ze as PolicyRegistry,I as PresentationRegistry,Fn as PrismaStateStore,ye as PromptRegistry,Tn as ProposalExecutor,wn as RegeneratorService,be as ResourceRegistry,Me as SaveOnboardingDraftBaseSpec,Ne as SaveOnboardingDraftInput,Pe as SaveOnboardingDraftOutput,re as SpecRegistry,se as StabilityEnum,ce as Tags,le as TagsEnum,Xe as TelemetryAnomalyMonitor,qe as TelemetryRegistry,Ye as TelemetryTracker,un as TestIntegrationConnection,Ze as TestRegistry,$e as TestRunner,We as ThemeRegistry,y as TransformEngine,_n as TriggerKnowledgeSourceSync,dn as UpdateIntegrationConnection,vn as UpdateKnowledgeSource,Mn as WorkflowPreFlightError,Dn as WorkflowRegistry,Nn as WorkflowRunner,On as WorkflowValidationError,Wt as assertPrimaryOpenBankingReady,kn as assertWorkflowSpecValid,xn as behaviorToEnvelope,Ue as buildOPAInput,d as buildZodWithRelations,t as capabilityKey,at as composeAppConfig,kt as createDefaultIntegrationSpecRegistry,b as createDefaultTransformEngine,w as createEngineWithDefaults,T as createFeatureModule,z as createFetchHandler,In as createFileStateStore,O as createFormRenderer,R as createMcpServer,i as dataViewKey,$ as defaultDocRegistry,j as defaultGqlField,M as defaultMcpTool,N as defaultRestPath,n as defineCapability,W as defineCommand,a as defineEvent,f as defineFormSpec,ve as definePrompt,G as defineQuery,xe as defineResourceTemplate,zn as defineSchemaModel,q as docBlockToPresentationSpec,J as docBlockToPresentationV2,Y as docBlocksToPresentationRoutes,X as docBlocksToPresentationSpecs,ee as docId,_t as elevenLabsIntegrationSpec,B as elysiaPlugin,Qt as emailThreadsKnowledgeSpace,Gt as ensurePrimaryOpenBankingIntegration,Sn as errorToEnvelope,p as evalPredicate,jn as evaluateExpression,o as eventKey,V as expressRouter,nn as financialDocsKnowledgeSpace,an as financialOverviewKnowledgeSpace,Tt as gcsStorageIntegrationSpec,yt as gmailIntegrationSpec,xt as googleCalendarIntegrationSpec,c as installFeature,me as installOp,fn as integrationContracts,K as isEmitDeclRef,Se as isResourceRef,L as jsonSchemaForPresentation,P as jsonSchemaForSpec,yn as knowledgeContracts,te as listRegisteredDocBlocks,it as makeAppBlueprintKey,he as makeEmit,tt as makeExperimentKey,ct as makeIntegrationSpecKey,qt as makeKnowledgeSpaceKey,H as makeNextAppHandler,U as makeNextPagesHandler,Be as makePolicyKey,Je as makeTelemetryKey,Qe as makeTestKey,Ge as makeThemeRef,Z as mapDocRoutes,Rn as metaDocs,ht as mistralIntegrationSpec,ge as op,ie as opKey,_e as openApiForRegistry,Fe as openBankingAccountsReadCapability,Ie as openBankingBalancesReadCapability,Le as openBankingTransactionsReadCapability,dt as postmarkIntegrationSpec,Dt as powensIntegrationSpec,Jt as productCanonKnowledgeSpace,pt as qdrantIntegrationSpec,Ft as redactOpenBankingTelemetryPayload,x as registerBasicValidation,F as registerContractsOnBuilder,S as registerDefaultReactRenderer,ne as registerDocBlocks,vt as registerElevenLabsIntegration,$t as registerEmailThreadsKnowledgeSpace,E as registerFeature,rn as registerFinancialDocsKnowledgeSpace,on as registerFinancialOverviewKnowledgeSpace,Et as registerGcsStorageIntegration,bt as registerGmailIntegration,St as registerGoogleCalendarIntegration,pn as registerIntegrationContracts,bn as registerKnowledgeContracts,gt as registerMistralIntegration,Re as registerOpenBankingCapabilities,Ut as registerOpenBankingContracts,ft as registerPostmarkIntegration,Ot as registerPowensIntegration,Yt as registerProductCanonKnowledgeSpace,mt as registerQdrantIntegration,C as registerReactToMarkdownRenderer,lt as registerStripeIntegration,Xt as registerSupportFaqKnowledgeSpace,Ct as registerTwilioSmsIntegration,en as registerUploadedDocsKnowledgeSpace,D as renderFeaturePresentation,ot as resolveAppConfig,Ce as resourceRef,A as rnReusablesDriver,m as schemaToMarkdown,h as schemaToMarkdownDetail,g as schemaToMarkdownList,_ as schemaToMarkdownSummary,v as schemaToMarkdownTable,k as shadcnDriver,ut as stripeIntegrationSpec,Zt as supportFaqKnowledgeSpace,Ln as techContractsDocs,Cn as telemetryToEnvelope,we as toV2FromV1,wt as twilioSmsIntegrationSpec,tn as uploadedDocsKnowledgeSpace,l as validateFeatureTargetsV2,An as validateWorkflowSpec};
|
|
1
|
+
import{CapabilityRegistry as e,capabilityKey as t,defineCapability as n}from"./capabilities.js";import{DataViewRegistry as r,dataViewKey as i}from"./data-views.js";import{defineEvent as a,eventKey as o}from"./events.js";import{FeatureRegistry as s,installFeature as c,validateFeatureTargetsV2 as l}from"./features.js";import{FormRegistry as u,buildZodWithRelations as d,defineFormSpec as f,evalPredicate as p}from"./forms.js";import{schemaToMarkdown as m,schemaToMarkdownDetail as h,schemaToMarkdownList as g,schemaToMarkdownSummary as _,schemaToMarkdownTable as v}from"./schema-to-markdown.js";import{TransformEngine as y,createDefaultTransformEngine as b,registerBasicValidation as x,registerDefaultReactRenderer as S,registerReactToMarkdownRenderer as C}from"./presentations.v2.js";import{createEngineWithDefaults as w,createFeatureModule as T,registerFeature as E,renderFeaturePresentation as D}from"./client/react/feature-render.js";import{createFormRenderer as O}from"./client/react/form-render.js";import{shadcnDriver as k}from"./client/react/drivers/shadcn.js";import{rnReusablesDriver as A}from"./client/react/drivers/rn-reusables.js";import"./client/index.js";import{defaultGqlField as j,defaultMcpTool as M,defaultRestPath as N,jsonSchemaForSpec as P}from"./jsonschema.js";import{registerContractsOnBuilder as F}from"./server/graphql-pothos.js";import{PresentationRegistry as I,jsonSchemaForPresentation as L}from"./presentations.js";import{createMcpServer as R}from"./server/mcp/createMcpServer.js";import{createFetchHandler as z}from"./server/rest-generic.js";import{elysiaPlugin as B}from"./server/rest-elysia.js";import{expressRouter as V}from"./server/rest-express.js";import{makeNextAppHandler as H}from"./server/rest-next-app.js";import{makeNextPagesHandler as U}from"./server/rest-next-pages.js";import"./server/index.js";import{defineCommand as W,defineQuery as G,isEmitDeclRef as K}from"./spec.js";import{docBlockToPresentationSpec as q,docBlockToPresentationV2 as J,docBlocksToPresentationRoutes as Y,docBlocksToPresentationSpecs as X,mapDocRoutes as Z}from"./docs/presentations.js";import{DocRegistry as Q,defaultDocRegistry as $,docId as ee,listRegisteredDocBlocks as te,registerDocBlocks as ne}from"./docs/registry.js";import{SpecRegistry as re,opKey as ie}from"./registry.js";import{Owners as ae,OwnersEnum as oe,StabilityEnum as se,Tags as ce,TagsEnum as le}from"./ownership.js";import{ContractRegistryFileSchema as ue,ContractRegistryItemSchema as de,ContractRegistryItemTypeSchema as fe,ContractRegistryManifestSchema as pe}from"./contract-registry/schemas.js";import"./contract-registry/index.js";import{installOp as me,makeEmit as he,op as ge}from"./install.js";import{openApiForRegistry as _e}from"./openapi.js";import{definePrompt as ve}from"./prompt.js";import{PromptRegistry as ye}from"./promptRegistry.js";import{ResourceRegistry as be,defineResourceTemplate as xe,isResourceRef as Se,resourceRef as Ce}from"./resources.js";import{toV2FromV1 as we}from"./presentations.backcompat.js";import{CompleteOnboardingBaseInput as Te,CompleteOnboardingBaseOutput as Ee,CompleteOnboardingBaseSpec as De,DeleteOnboardingDraftBaseSpec as Oe,DeleteOnboardingDraftOutput as ke,GetOnboardingDraftBaseSpec as Ae,GetOnboardingDraftOutput as je,SaveOnboardingDraftBaseSpec as Me,SaveOnboardingDraftInput as Ne,SaveOnboardingDraftOutput as Pe}from"./onboarding-base.js";import{openBankingAccountsReadCapability as Fe,openBankingBalancesReadCapability as Ie,openBankingTransactionsReadCapability as Le,registerOpenBankingCapabilities as Re}from"./capabilities/openbanking.js";import{PolicyRegistry as ze,makePolicyKey as Be}from"./policy/spec.js";import{PolicyEngine as Ve}from"./policy/engine.js";import{OPAPolicyAdapter as He,buildOPAInput as Ue}from"./policy/opa-adapter.js";import{ThemeRegistry as We,makeThemeRef as Ge}from"./themes.js";import{MigrationRegistry as Ke}from"./migrations.js";import{TelemetryRegistry as qe,makeTelemetryKey as Je}from"./telemetry/spec.js";import{TelemetryTracker as Ye}from"./telemetry/tracker.js";import{TelemetryAnomalyMonitor as Xe}from"./telemetry/anomaly.js";import"./telemetry/index.js";import{TestRegistry as Ze,makeTestKey as Qe}from"./tests/spec.js";import{TestRunner as $e}from"./tests/runner.js";import"./tests/index.js";import{ExperimentRegistry as et,makeExperimentKey as tt}from"./experiments/spec.js";import{ExperimentEvaluator as nt}from"./experiments/evaluator.js";import{AppBlueprintRegistry as rt,makeAppBlueprintKey as it}from"./app-config/spec.js";import{composeAppConfig as at,resolveAppConfig as ot}from"./app-config/runtime.js";import{IntegrationSpecRegistry as st,makeIntegrationSpecKey as ct}from"./integrations/spec.js";import{registerStripeIntegration as lt,stripeIntegrationSpec as ut}from"./integrations/providers/stripe.js";import{postmarkIntegrationSpec as dt,registerPostmarkIntegration as ft}from"./integrations/providers/postmark.js";import{qdrantIntegrationSpec as pt,registerQdrantIntegration as mt}from"./integrations/providers/qdrant.js";import{mistralIntegrationSpec as ht,registerMistralIntegration as gt}from"./integrations/providers/mistral.js";import{elevenLabsIntegrationSpec as _t,registerElevenLabsIntegration as vt}from"./integrations/providers/elevenlabs.js";import{gmailIntegrationSpec as yt,registerGmailIntegration as bt}from"./integrations/providers/gmail.js";import{googleCalendarIntegrationSpec as xt,registerGoogleCalendarIntegration as St}from"./integrations/providers/google-calendar.js";import{registerTwilioSmsIntegration as Ct,twilioSmsIntegrationSpec as wt}from"./integrations/providers/twilio-sms.js";import{gcsStorageIntegrationSpec as Tt,registerGcsStorageIntegration as Et}from"./integrations/providers/gcs-storage.js";import{powensIntegrationSpec as Dt,registerPowensIntegration as Ot}from"./integrations/providers/powens.js";import{createDefaultIntegrationSpecRegistry as kt}from"./integrations/providers/registry.js";import{AccountBalanceRecord as At,BankAccountRecord as jt,BankTransactionRecord as Mt}from"./integrations/openbanking/models.js";import{OPENBANKING_PII_FIELDS as Nt,OPENBANKING_TELEMETRY_EVENTS as Pt,redactOpenBankingTelemetryPayload as Ft}from"./integrations/openbanking/telemetry.js";import{OpenBankingGetAccount as It,OpenBankingListAccounts as Lt,OpenBankingSyncAccounts as Rt}from"./integrations/openbanking/contracts/accounts.js";import{OpenBankingListTransactions as zt,OpenBankingSyncTransactions as Bt}from"./integrations/openbanking/contracts/transactions.js";import{OpenBankingGetBalances as Vt,OpenBankingRefreshBalances as Ht}from"./integrations/openbanking/contracts/balances.js";import{OpenBankingFeature as Ut}from"./integrations/openbanking/openbanking.feature.js";import{registerOpenBankingContracts as Wt}from"./integrations/openbanking/contracts/index.js";import{assertPrimaryOpenBankingReady as Gt,ensurePrimaryOpenBankingIntegration as Kt}from"./integrations/openbanking/guards.js";import"./integrations/index.js";import{KnowledgeSpaceRegistry as qt,makeKnowledgeSpaceKey as Jt}from"./knowledge/spec.js";import{productCanonKnowledgeSpace as Yt,registerProductCanonKnowledgeSpace as Xt}from"./knowledge/spaces/product-canon.js";import{registerSupportFaqKnowledgeSpace as Zt,supportFaqKnowledgeSpace as Qt}from"./knowledge/spaces/support-faq.js";import{emailThreadsKnowledgeSpace as $t,registerEmailThreadsKnowledgeSpace as en}from"./knowledge/spaces/email-threads.js";import{registerUploadedDocsKnowledgeSpace as tn,uploadedDocsKnowledgeSpace as nn}from"./knowledge/spaces/uploaded-docs.js";import{financialDocsKnowledgeSpace as rn,registerFinancialDocsKnowledgeSpace as an}from"./knowledge/spaces/financial-docs.js";import{financialOverviewKnowledgeSpace as on,registerFinancialOverviewKnowledgeSpace as sn}from"./knowledge/spaces/financial-overview.js";import"./knowledge/index.js";import{CreateIntegrationConnection as cn,DeleteIntegrationConnection as ln,ListIntegrationConnections as un,TestIntegrationConnection as dn,UpdateIntegrationConnection as fn,integrationContracts as pn,registerIntegrationContracts as mn}from"./integrations/contracts.js";import{CreateKnowledgeSource as hn,DeleteKnowledgeSource as gn,ListKnowledgeSources as _n,TriggerKnowledgeSourceSync as vn,UpdateKnowledgeSource as yn,knowledgeContracts as bn,registerKnowledgeContracts as xn}from"./knowledge/contracts.js";import{behaviorToEnvelope as Sn,errorToEnvelope as Cn,telemetryToEnvelope as wn}from"./regenerator/utils.js";import{RegeneratorService as Tn}from"./regenerator/service.js";import{ProposalExecutor as En}from"./regenerator/executor.js";import{ExecutorProposalSink as Dn}from"./regenerator/sinks.js";import"./regenerator/index.js";import{WorkflowRegistry as On}from"./workflow/spec.js";import{WorkflowValidationError as kn,assertWorkflowSpecValid as An,validateWorkflowSpec as jn}from"./workflow/validation.js";import{evaluateExpression as Mn}from"./workflow/expression.js";import{WorkflowPreFlightError as Nn,WorkflowRunner as Pn}from"./workflow/runner.js";import{InMemoryStateStore as Fn}from"./workflow/adapters/memory-store.js";import{PrismaStateStore as In}from"./workflow/adapters/db-adapter.js";import{createFileStateStore as Ln}from"./workflow/adapters/file-adapter.js";import"./workflow/index.js";import{techContractsDocs as Rn}from"./docs/tech-contracts.docs.js";import{metaDocs as zn}from"./docs/meta.docs.js";import"./docs/index.js";import{docBlockToMarkdown as Bn,eventToMarkdown as Vn,exportFeature as Hn,exportSpec as Un,featureToMarkdown as Wn,presentationToMarkdown as Gn,specToAgentPrompt as Kn,specToContextMarkdown as qn,specToFullMarkdown as Jn}from"./llm/exporters.js";import{AGENT_SYSTEM_PROMPTS as Yn,formatPlanForAgent as Xn,generateFixViolationsPrompt as Zn,generateImplementationPlan as Qn,generateImplementationPrompt as $n,generateReviewPrompt as er,generateTestPrompt as tr,generateVerificationPrompt as nr}from"./llm/prompts.js";import"./llm/index.js";import{defineSchemaModel as rr}from"@lssm/lib.schema";export{Yn as AGENT_SYSTEM_PROMPTS,At as AccountBalanceRecord,rt as AppBlueprintRegistry,jt as BankAccountRecord,Mt as BankTransactionRecord,e as CapabilityRegistry,Te as CompleteOnboardingBaseInput,Ee as CompleteOnboardingBaseOutput,De as CompleteOnboardingBaseSpec,ue as ContractRegistryFileSchema,de as ContractRegistryItemSchema,fe as ContractRegistryItemTypeSchema,pe as ContractRegistryManifestSchema,cn as CreateIntegrationConnection,hn as CreateKnowledgeSource,r as DataViewRegistry,ln as DeleteIntegrationConnection,gn as DeleteKnowledgeSource,Oe as DeleteOnboardingDraftBaseSpec,ke as DeleteOnboardingDraftOutput,Q as DocRegistry,Dn as ExecutorProposalSink,nt as ExperimentEvaluator,et as ExperimentRegistry,s as FeatureRegistry,u as FormRegistry,Ae as GetOnboardingDraftBaseSpec,je as GetOnboardingDraftOutput,Fn as InMemoryStateStore,st as IntegrationSpecRegistry,qt as KnowledgeSpaceRegistry,un as ListIntegrationConnections,_n as ListKnowledgeSources,Ke as MigrationRegistry,He as OPAPolicyAdapter,Nt as OPENBANKING_PII_FIELDS,Pt as OPENBANKING_TELEMETRY_EVENTS,Ut as OpenBankingFeature,It as OpenBankingGetAccount,Vt as OpenBankingGetBalances,Lt as OpenBankingListAccounts,zt as OpenBankingListTransactions,Ht as OpenBankingRefreshBalances,Rt as OpenBankingSyncAccounts,Bt as OpenBankingSyncTransactions,ae as Owners,oe as OwnersEnum,Ve as PolicyEngine,ze as PolicyRegistry,I as PresentationRegistry,In as PrismaStateStore,ye as PromptRegistry,En as ProposalExecutor,Tn as RegeneratorService,be as ResourceRegistry,Me as SaveOnboardingDraftBaseSpec,Ne as SaveOnboardingDraftInput,Pe as SaveOnboardingDraftOutput,re as SpecRegistry,se as StabilityEnum,ce as Tags,le as TagsEnum,Xe as TelemetryAnomalyMonitor,qe as TelemetryRegistry,Ye as TelemetryTracker,dn as TestIntegrationConnection,Ze as TestRegistry,$e as TestRunner,We as ThemeRegistry,y as TransformEngine,vn as TriggerKnowledgeSourceSync,fn as UpdateIntegrationConnection,yn as UpdateKnowledgeSource,Nn as WorkflowPreFlightError,On as WorkflowRegistry,Pn as WorkflowRunner,kn as WorkflowValidationError,Gt as assertPrimaryOpenBankingReady,An as assertWorkflowSpecValid,Sn as behaviorToEnvelope,Ue as buildOPAInput,d as buildZodWithRelations,t as capabilityKey,at as composeAppConfig,kt as createDefaultIntegrationSpecRegistry,b as createDefaultTransformEngine,w as createEngineWithDefaults,T as createFeatureModule,z as createFetchHandler,Ln as createFileStateStore,O as createFormRenderer,R as createMcpServer,i as dataViewKey,$ as defaultDocRegistry,j as defaultGqlField,M as defaultMcpTool,N as defaultRestPath,n as defineCapability,W as defineCommand,a as defineEvent,f as defineFormSpec,ve as definePrompt,G as defineQuery,xe as defineResourceTemplate,rr as defineSchemaModel,Bn as docBlockToMarkdown,q as docBlockToPresentationSpec,J as docBlockToPresentationV2,Y as docBlocksToPresentationRoutes,X as docBlocksToPresentationSpecs,ee as docId,_t as elevenLabsIntegrationSpec,B as elysiaPlugin,$t as emailThreadsKnowledgeSpace,Kt as ensurePrimaryOpenBankingIntegration,Cn as errorToEnvelope,p as evalPredicate,Mn as evaluateExpression,o as eventKey,Vn as eventToMarkdown,Hn as exportFeature,Un as exportSpec,V as expressRouter,Wn as featureToMarkdown,rn as financialDocsKnowledgeSpace,on as financialOverviewKnowledgeSpace,Xn as formatPlanForAgent,Tt as gcsStorageIntegrationSpec,Zn as generateFixViolationsPrompt,Qn as generateImplementationPlan,$n as generateImplementationPrompt,er as generateReviewPrompt,tr as generateTestPrompt,nr as generateVerificationPrompt,yt as gmailIntegrationSpec,xt as googleCalendarIntegrationSpec,c as installFeature,me as installOp,pn as integrationContracts,K as isEmitDeclRef,Se as isResourceRef,L as jsonSchemaForPresentation,P as jsonSchemaForSpec,bn as knowledgeContracts,te as listRegisteredDocBlocks,it as makeAppBlueprintKey,he as makeEmit,tt as makeExperimentKey,ct as makeIntegrationSpecKey,Jt as makeKnowledgeSpaceKey,H as makeNextAppHandler,U as makeNextPagesHandler,Be as makePolicyKey,Je as makeTelemetryKey,Qe as makeTestKey,Ge as makeThemeRef,Z as mapDocRoutes,zn as metaDocs,ht as mistralIntegrationSpec,ge as op,ie as opKey,_e as openApiForRegistry,Fe as openBankingAccountsReadCapability,Ie as openBankingBalancesReadCapability,Le as openBankingTransactionsReadCapability,dt as postmarkIntegrationSpec,Dt as powensIntegrationSpec,Gn as presentationToMarkdown,Yt as productCanonKnowledgeSpace,pt as qdrantIntegrationSpec,Ft as redactOpenBankingTelemetryPayload,x as registerBasicValidation,F as registerContractsOnBuilder,S as registerDefaultReactRenderer,ne as registerDocBlocks,vt as registerElevenLabsIntegration,en as registerEmailThreadsKnowledgeSpace,E as registerFeature,an as registerFinancialDocsKnowledgeSpace,sn as registerFinancialOverviewKnowledgeSpace,Et as registerGcsStorageIntegration,bt as registerGmailIntegration,St as registerGoogleCalendarIntegration,mn as registerIntegrationContracts,xn as registerKnowledgeContracts,gt as registerMistralIntegration,Re as registerOpenBankingCapabilities,Wt as registerOpenBankingContracts,ft as registerPostmarkIntegration,Ot as registerPowensIntegration,Xt as registerProductCanonKnowledgeSpace,mt as registerQdrantIntegration,C as registerReactToMarkdownRenderer,lt as registerStripeIntegration,Zt as registerSupportFaqKnowledgeSpace,Ct as registerTwilioSmsIntegration,tn as registerUploadedDocsKnowledgeSpace,D as renderFeaturePresentation,ot as resolveAppConfig,Ce as resourceRef,A as rnReusablesDriver,m as schemaToMarkdown,h as schemaToMarkdownDetail,g as schemaToMarkdownList,_ as schemaToMarkdownSummary,v as schemaToMarkdownTable,k as shadcnDriver,Kn as specToAgentPrompt,qn as specToContextMarkdown,Jn as specToFullMarkdown,ut as stripeIntegrationSpec,Qt as supportFaqKnowledgeSpace,Rn as techContractsDocs,wn as telemetryToEnvelope,we as toV2FromV1,wt as twilioSmsIntegrationSpec,nn as uploadedDocsKnowledgeSpace,l as validateFeatureTargetsV2,jn as validateWorkflowSpec};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IntegrationSpecRegistry as e,makeIntegrationSpecKey as t}from"./spec.js";import{registerStripeIntegration as n,stripeIntegrationSpec as r}from"./providers/stripe.js";import{postmarkIntegrationSpec as i,registerPostmarkIntegration as a}from"./providers/postmark.js";import{qdrantIntegrationSpec as o,registerQdrantIntegration as s}from"./providers/qdrant.js";import{mistralIntegrationSpec as c,registerMistralIntegration as l}from"./providers/mistral.js";import{elevenLabsIntegrationSpec as u,registerElevenLabsIntegration as d}from"./providers/elevenlabs.js";import{gmailIntegrationSpec as f,registerGmailIntegration as p}from"./providers/gmail.js";import{googleCalendarIntegrationSpec as m,registerGoogleCalendarIntegration as h}from"./providers/google-calendar.js";import{registerTwilioSmsIntegration as g,twilioSmsIntegrationSpec as _}from"./providers/twilio-sms.js";import{gcsStorageIntegrationSpec as v,registerGcsStorageIntegration as y}from"./providers/gcs-storage.js";import{powensIntegrationSpec as b,registerPowensIntegration as x}from"./providers/powens.js";import{createDefaultIntegrationSpecRegistry as S}from"./providers/registry.js";import"./providers/index.js";import{AccountBalanceRecord as C,BankAccountRecord as w,BankTransactionRecord as T}from"./openbanking/models.js";import{OPENBANKING_PII_FIELDS as E,OPENBANKING_TELEMETRY_EVENTS as D,redactOpenBankingTelemetryPayload as O}from"./openbanking/telemetry.js";import{OpenBankingGetAccount as k,OpenBankingListAccounts as A,OpenBankingSyncAccounts as j}from"./openbanking/contracts/accounts.js";import{OpenBankingListTransactions as M,OpenBankingSyncTransactions as N}from"./openbanking/contracts/transactions.js";import{OpenBankingGetBalances as P,OpenBankingRefreshBalances as F}from"./openbanking/contracts/balances.js";import{
|
|
1
|
+
import{IntegrationSpecRegistry as e,makeIntegrationSpecKey as t}from"./spec.js";import{registerStripeIntegration as n,stripeIntegrationSpec as r}from"./providers/stripe.js";import{postmarkIntegrationSpec as i,registerPostmarkIntegration as a}from"./providers/postmark.js";import{qdrantIntegrationSpec as o,registerQdrantIntegration as s}from"./providers/qdrant.js";import{mistralIntegrationSpec as c,registerMistralIntegration as l}from"./providers/mistral.js";import{elevenLabsIntegrationSpec as u,registerElevenLabsIntegration as d}from"./providers/elevenlabs.js";import{gmailIntegrationSpec as f,registerGmailIntegration as p}from"./providers/gmail.js";import{googleCalendarIntegrationSpec as m,registerGoogleCalendarIntegration as h}from"./providers/google-calendar.js";import{registerTwilioSmsIntegration as g,twilioSmsIntegrationSpec as _}from"./providers/twilio-sms.js";import{gcsStorageIntegrationSpec as v,registerGcsStorageIntegration as y}from"./providers/gcs-storage.js";import{powensIntegrationSpec as b,registerPowensIntegration as x}from"./providers/powens.js";import{createDefaultIntegrationSpecRegistry as S}from"./providers/registry.js";import"./providers/index.js";import{AccountBalanceRecord as C,BankAccountRecord as w,BankTransactionRecord as T}from"./openbanking/models.js";import{OPENBANKING_PII_FIELDS as E,OPENBANKING_TELEMETRY_EVENTS as D,redactOpenBankingTelemetryPayload as O}from"./openbanking/telemetry.js";import{OpenBankingGetAccount as k,OpenBankingListAccounts as A,OpenBankingSyncAccounts as j}from"./openbanking/contracts/accounts.js";import{OpenBankingListTransactions as M,OpenBankingSyncTransactions as N}from"./openbanking/contracts/transactions.js";import{OpenBankingGetBalances as P,OpenBankingRefreshBalances as F}from"./openbanking/contracts/balances.js";import{OpenBankingFeature as I}from"./openbanking/openbanking.feature.js";import{registerOpenBankingContracts as L}from"./openbanking/contracts/index.js";import{assertPrimaryOpenBankingReady as R,ensurePrimaryOpenBankingIntegration as z}from"./openbanking/guards.js";export{C as AccountBalanceRecord,w as BankAccountRecord,T as BankTransactionRecord,e as IntegrationSpecRegistry,E as OPENBANKING_PII_FIELDS,D as OPENBANKING_TELEMETRY_EVENTS,I as OpenBankingFeature,k as OpenBankingGetAccount,P as OpenBankingGetBalances,A as OpenBankingListAccounts,M as OpenBankingListTransactions,F as OpenBankingRefreshBalances,j as OpenBankingSyncAccounts,N as OpenBankingSyncTransactions,R as assertPrimaryOpenBankingReady,S as createDefaultIntegrationSpecRegistry,u as elevenLabsIntegrationSpec,z as ensurePrimaryOpenBankingIntegration,v as gcsStorageIntegrationSpec,f as gmailIntegrationSpec,m as googleCalendarIntegrationSpec,t as makeIntegrationSpecKey,c as mistralIntegrationSpec,i as postmarkIntegrationSpec,b as powensIntegrationSpec,o as qdrantIntegrationSpec,O as redactOpenBankingTelemetryPayload,d as registerElevenLabsIntegration,y as registerGcsStorageIntegration,p as registerGmailIntegration,h as registerGoogleCalendarIntegration,l as registerMistralIntegration,L as registerOpenBankingContracts,a as registerPostmarkIntegration,x as registerPowensIntegration,s as registerQdrantIntegration,n as registerStripeIntegration,g as registerTwilioSmsIntegration,r as stripeIntegrationSpec,_ as twilioSmsIntegrationSpec};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{OpenBankingGetAccount as e,OpenBankingListAccounts as t,OpenBankingSyncAccounts as n,registerOpenBankingAccountContracts as r}from"./accounts.js";import{OpenBankingListTransactions as i,OpenBankingSyncTransactions as a,registerOpenBankingTransactionContracts as o}from"./transactions.js";import{OpenBankingGetBalances as s,OpenBankingRefreshBalances as c,registerOpenBankingBalanceContracts as l}from"./balances.js";function
|
|
1
|
+
import{OpenBankingGetAccount as e,OpenBankingListAccounts as t,OpenBankingSyncAccounts as n,registerOpenBankingAccountContracts as r}from"./accounts.js";import{OpenBankingListTransactions as i,OpenBankingSyncTransactions as a,registerOpenBankingTransactionContracts as o}from"./transactions.js";import{OpenBankingGetBalances as s,OpenBankingRefreshBalances as c,registerOpenBankingBalanceContracts as l}from"./balances.js";import{OpenBankingFeature as u}from"../openbanking.feature.js";function d(e){return l(o(r(e)))}export{u as OpenBankingFeature,e as OpenBankingGetAccount,s as OpenBankingGetBalances,t as OpenBankingListAccounts,i as OpenBankingListTransactions,c as OpenBankingRefreshBalances,n as OpenBankingSyncAccounts,a as OpenBankingSyncTransactions,d as registerOpenBankingContracts};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={meta:{key:`openbanking`,title:`Open Banking Integration`,description:`Open banking account sync, balance refresh, and transaction synchronization`,domain:`integrations`,owners:[`@platform.finance`],tags:[`open-banking`,`powens`,`finance`,`banking`],stability:`experimental`},operations:[{name:`openbanking.accounts.sync`,version:1},{name:`openbanking.accounts.list`,version:1},{name:`openbanking.accounts.get`,version:1},{name:`openbanking.balances.refresh`,version:1},{name:`openbanking.balances.get`,version:1},{name:`openbanking.transactions.sync`,version:1},{name:`openbanking.transactions.list`,version:1}],events:[],presentations:[],opToPresentation:[],presentationsTargets:[],capabilities:{provides:[{key:`openbanking`,version:1}],requires:[{key:`identity`,version:1}]}};export{e as OpenBankingFeature};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{jsonSchemaForSpec as e}from"../jsonschema.js";import{isEmitDeclRef as t}from"../spec.js";const n={format:`full`,includeSchemas:!0,includeScenarios:!0,includeExamples:!0,includePolicy:!0,includeSideEffects:!0},r={...n,includeRelatedSpecs:!0,includeRelatedEvents:!0,includeRelatedPresentations:!0};function i(e){let t=e.meta,n=[];if(n.push(`# ${t.name} (v${t.version})`),n.push(``),n.push(`> ${t.description}`),n.push(``),n.push(`**Type:** ${t.kind} | **Stability:** ${t.stability}`),n.push(``),n.push(`## Goal`),n.push(``),n.push(t.goal),n.push(``),n.push(`## Context`),n.push(``),n.push(t.context),n.push(``),e.acceptance?.scenarios?.length){n.push(`## Acceptance Criteria`),n.push(``);for(let t of e.acceptance.scenarios){n.push(`### ${t.name}`),n.push(``),n.push(`**Given:**`);for(let e of t.given)n.push(`- ${e}`);n.push(``),n.push(`**When:**`);for(let e of t.when)n.push(`- ${e}`);n.push(``),n.push(`**Then:**`);for(let e of t.then)n.push(`- ${e}`);n.push(``)}}return n.join(`
|
|
2
|
+
`)}function a(r,i={}){let a={...n,...i},o=r.meta,s=[];if(s.push(`# ${o.name}.v${o.version}`),s.push(``),s.push(`> ${o.description}`),s.push(``),s.push(`## Metadata`),s.push(``),s.push(`| Field | Value |`),s.push(`|-------|-------|`),s.push(`| Kind | ${o.kind} |`),s.push(`| Stability | ${o.stability} |`),s.push(`| Owners | ${o.owners.join(`, `)} |`),s.push(`| Tags | ${o.tags.join(`, `)} |`),s.push(``),s.push(`## Goal`),s.push(``),s.push(o.goal),s.push(``),s.push(`## Context`),s.push(``),s.push(o.context),s.push(``),a.includeSchemas){if(s.push(`## Input/Output`),s.push(``),r.io.input){s.push(`### Input Schema`),s.push(``),s.push("```json");try{let t=e(r);s.push(JSON.stringify(t.input??{},null,2))}catch{s.push(`// Schema generation not available`)}s.push("```"),s.push(``)}s.push(`### Output Schema`),s.push(``),s.push("```json");try{let t=e(r);s.push(JSON.stringify(t.output??{},null,2))}catch{s.push(`// Schema generation not available`)}if(s.push("```"),s.push(``),r.io.errors&&Object.keys(r.io.errors).length){s.push(`### Error Codes`),s.push(``),s.push(`| Code | HTTP | Description | When |`),s.push(`|------|------|-------------|------|`);for(let[e,t]of Object.entries(r.io.errors))s.push(`| \`${e}\` | ${t.http??400} | ${t.description} | ${t.when} |`);s.push(``)}}if(a.includePolicy&&(s.push(`## Policy`),s.push(``),s.push(`- **Auth Required:** ${r.policy.auth}`),s.push(`- **Idempotent:** ${r.policy.idempotent??o.kind===`query`}`),r.policy.rateLimit&&s.push(`- **Rate Limit:** ${r.policy.rateLimit.rpm} rpm per ${r.policy.rateLimit.key}`),r.policy.flags?.length&&s.push(`- **Feature Flags:** ${r.policy.flags.join(`, `)}`),r.policy.pii?.length&&s.push(`- **PII Fields:** ${r.policy.pii.join(`, `)}`),r.policy.escalate&&s.push(`- **Escalation:** ${r.policy.escalate}`),s.push(``)),a.includeSideEffects&&r.sideEffects){if(r.sideEffects.emits?.length){s.push(`## Events Emitted`),s.push(``);for(let e of r.sideEffects.emits)t(e)?s.push(`- \`${e.ref.name}.v${e.ref.version}\` — ${e.when}`):s.push(`- \`${e.name}.v${e.version}\` — ${e.when}`);s.push(``)}if(r.sideEffects.analytics?.length){s.push(`## Analytics Events`),s.push(``);for(let e of r.sideEffects.analytics)s.push(`- ${e}`);s.push(``)}}if(a.includeScenarios&&r.acceptance?.scenarios?.length){s.push(`## Acceptance Scenarios`),s.push(``);for(let e of r.acceptance.scenarios){s.push(`### ${e.name}`),s.push(``),s.push(`**Given:**`);for(let t of e.given)s.push(`- ${t}`);s.push(``),s.push(`**When:**`);for(let t of e.when)s.push(`- ${t}`);s.push(``),s.push(`**Then:**`);for(let t of e.then)s.push(`- ${t}`);s.push(``)}}if(a.includeExamples&&r.acceptance?.examples?.length){s.push(`## Examples`),s.push(``);for(let e of r.acceptance.examples)s.push(`### ${e.name}`),s.push(``),s.push(`**Input:**`),s.push("```json"),s.push(JSON.stringify(e.input,null,2)),s.push("```"),s.push(``),s.push(`**Output:**`),s.push("```json"),s.push(JSON.stringify(e.output,null,2)),s.push("```"),s.push(``)}return r.transport&&(s.push(`## Transport Configuration`),s.push(``),r.transport.rest&&s.push(`- **REST:** ${r.transport.rest.method??`POST`} ${r.transport.rest.path??`auto`}`),r.transport.gql&&s.push(`- **GraphQL:** ${r.transport.gql.field??`auto`}`),r.transport.mcp&&s.push(`- **MCP Tool:** ${r.transport.mcp.toolName??`auto`}`),s.push(``)),s.join(`
|
|
3
|
+
`)}function o(e,t){let n=t?.taskType??`implement`,r=e.meta,i=[],o={implement:`Implement`,test:`Write tests for`,refactor:`Refactor`,review:`Review`}[n];if(i.push(`# Task: ${o} ${r.name}.v${r.version}`),i.push(``),i.push(`## Context`),i.push(``),i.push(`You are working on a ContractSpec-driven codebase. This spec defines a ${r.kind} operation.`),i.push(``),i.push(`**Goal:** ${r.goal}`),i.push(``),i.push(`**Background:** ${r.context}`),i.push(``),i.push(`## Specification`),i.push(``),i.push(a(e)),i.push(``),i.push(`## Instructions`),i.push(``),n===`implement`){if(i.push(`Implement this specification following these requirements:`),i.push(``),i.push("1. **Type Safety**: Use TypeScript with strict typing. No `any` types."),i.push(`2. **Input Validation**: Validate input against the schema before processing.`),i.push(`3. **Error Handling**: Implement all error cases defined in the spec.`),i.push(`4. **Events**: Emit events as specified in sideEffects.emits.`),i.push(`5. **Policy**: Respect auth, rate limits, and feature flags.`),i.push(`6. **Idempotency**: `+(e.policy.idempotent?`This operation MUST be idempotent.`:`This operation may have side effects.`)),i.push(``),e.policy.pii?.length){i.push(`**PII Handling**: The following fields contain PII and must be handled carefully:`);for(let t of e.policy.pii)i.push(`- ${t}`);i.push(``)}}else n===`test`?(i.push(`Write comprehensive tests for this specification:`),i.push(``),i.push(`1. Test all acceptance scenarios defined in the spec.`),i.push(`2. Test all error cases with appropriate assertions.`),i.push(`3. Test edge cases and boundary conditions.`),i.push(`4. Verify events are emitted correctly.`),i.push(`5. Use descriptive test names following the pattern: "should [behavior] when [condition]"`),i.push(``)):n===`refactor`?(i.push(`Refactor this implementation while preserving all behavior:`),i.push(``),i.push(`1. Maintain compliance with the specification.`),i.push(`2. Improve code clarity and maintainability.`),i.push(`3. Reduce complexity where possible.`),i.push(`4. Ensure all existing tests still pass.`),i.push(``)):n===`review`&&(i.push(`Review this implementation against the specification:`),i.push(``),i.push(`1. Verify input/output types match the schema.`),i.push(`2. Check all error cases are handled.`),i.push(`3. Verify events are emitted as specified.`),i.push(`4. Check policy compliance (auth, rate limits).`),i.push(`5. Report any deviations from the spec.`),i.push(``));return t?.existingCode&&(i.push(`## Existing Code`),i.push(``),i.push("```typescript"),i.push(t.existingCode),i.push("```"),i.push(``)),i.push(`## Expected Output`),i.push(``),n===`implement`||n===`refactor`?(i.push(`Provide a complete TypeScript implementation. Include:`),i.push(`- Type definitions for input/output`),i.push(`- Handler function with proper error handling`),i.push(`- JSDoc comments explaining the implementation`)):n===`test`?i.push(`Provide a complete test file using the testing framework available (prefer Vitest).`):n===`review`&&(i.push(`Provide a structured review with:`),i.push(`- Compliance status (pass/fail for each requirement)`),i.push(`- Issues found with severity (error/warning/info)`),i.push(`- Suggestions for improvement`)),i.push(``),i.join(`
|
|
4
|
+
`)}function s(e,t,n={}){let i={...r,...n},o=e.meta,s=[];if(s.push(`# Feature: ${o.title??o.key}`),s.push(``),o.description&&(s.push(`> ${o.description}`),s.push(``)),s.push(`## Overview`),s.push(``),s.push(`- **Key:** \`${o.key}\``),s.push(`- **Stability:** ${o.stability}`),s.push(`- **Owners:** ${o.owners.join(`, `)}`),o.tags?.length&&s.push(`- **Tags:** ${o.tags.join(`, `)}`),s.push(``),e.operations?.length){s.push(`## Operations`),s.push(``),s.push(`| Name | Version | Type |`),s.push(`|------|---------|------|`);for(let n of e.operations){let e=(t?.specs?.getSpec(n.name,n.version))?.meta.kind??`unknown`;s.push(`| ${n.name} | v${n.version} | ${e} |`)}if(s.push(``),i.includeRelatedSpecs&&t?.specs){s.push(`### Operation Details`),s.push(``);for(let n of e.operations){let e=t.specs.getSpec(n.name,n.version);e&&(s.push(`---`),s.push(``),s.push(a(e,i)))}}}if(e.events?.length){s.push(`## Events`),s.push(``),s.push(`| Name | Version |`),s.push(`|------|---------|`);for(let t of e.events)s.push(`| ${t.name} | v${t.version} |`);s.push(``)}if(e.presentations?.length){s.push(`## Presentations`),s.push(``),s.push(`| Name | Version |`),s.push(`|------|---------|`);for(let t of e.presentations)s.push(`| ${t.name} | v${t.version} |`);if(s.push(``),i.includeRelatedPresentations&&t?.presentations){s.push(`### Presentation Details`),s.push(``);for(let n of e.presentations){let e=t.presentations.get(n.name,n.version);e&&(s.push(`#### ${n.name}.v${n.version}`),s.push(``),s.push(`- **Kind:** ${e.content.kind??`unknown`}`),`componentKey`in e.content&&s.push(`- **Component:** ${e.content.componentKey}`),s.push(``))}}}if(e.capabilities){if(e.capabilities.provides?.length){s.push(`## Capabilities Provided`),s.push(``);for(let t of e.capabilities.provides)s.push(`- \`${t.key}.v${t.version}\``);s.push(``)}if(e.capabilities.requires?.length){s.push(`## Capabilities Required`),s.push(``);for(let t of e.capabilities.requires)s.push(`- \`${t.key}\`${t.version?`.v${t.version}`:``} (${t.optional?`optional`:`required`})`);s.push(``)}}return s.join(`
|
|
5
|
+
`)}function c(e){let t=e.meta,n=[];n.push(`# Presentation: ${t.name}.v${t.version}`),n.push(``),t.description&&(n.push(`> ${t.description}`),n.push(``)),n.push(`## Metadata`),n.push(``),n.push(`- **Name:** ${t.name}`),n.push(`- **Version:** ${t.version}`),t.stability&&n.push(`- **Stability:** ${t.stability}`),t.owners?.length&&n.push(`- **Owners:** ${t.owners.join(`, `)}`),t.tags?.length&&n.push(`- **Tags:** ${t.tags.join(`, `)}`),n.push(``),n.push(`## Source`),n.push(``),n.push(`- **Type:** ${e.source.type}`),e.source.type===`component`&&(n.push(`- **Framework:** ${e.source.framework}`),n.push(`- **Component Key:** ${e.source.componentKey}`)),n.push(``),n.push(`## Supported Targets`),n.push(``);for(let t of e.targets)n.push(`- ${t}`);return n.push(``),e.policy&&(n.push(`## Policy`),n.push(``),e.policy.flags?.length&&n.push(`- **Feature Flags:** ${e.policy.flags.join(`, `)}`),e.policy.pii?.length&&n.push(`- **PII Fields:** ${e.policy.pii.join(`, `)}`),n.push(``)),n.join(`
|
|
6
|
+
`)}function l(e){let t=[];t.push(`# Event: ${e.name}.v${e.version}`),t.push(``),t.push(`## Metadata`),t.push(``),t.push(`- **Name:** ${e.name}`),t.push(`- **Version:** ${e.version}`),e.description&&t.push(`- **Description:** ${e.description}`),t.push(``),t.push(`## Payload Schema`),t.push(``),t.push("```json");try{let n=e.payload.getZod();if(`shape`in n&&n.shape){let e=n.shape,r=Object.keys(e);t.push(JSON.stringify({fields:r},null,2))}else t.push(`// Payload schema available at runtime`)}catch{t.push(`// Schema details available at runtime`)}return t.push("```"),t.push(``),t.join(`
|
|
7
|
+
`)}function u(e){let t=[];if(t.push(`# ${e.title}`),t.push(``),e.summary&&(t.push(`> ${e.summary}`),t.push(``)),t.push(`## Metadata`),t.push(``),t.push(`- **ID:** ${e.id}`),t.push(`- **Kind:** ${e.kind??`reference`}`),t.push(`- **Visibility:** ${e.visibility??`public`}`),e.tags?.length&&t.push(`- **Tags:** ${e.tags.join(`, `)}`),e.owners?.length&&t.push(`- **Owners:** ${e.owners.join(`, `)}`),e.domain&&t.push(`- **Domain:** ${e.domain}`),t.push(``),t.push(`## Content`),t.push(``),t.push(e.body),t.push(``),e.links?.length){t.push(`## Related Links`),t.push(``);for(let n of e.links)t.push(`- [${n.label}](${n.href})`);t.push(``)}return t.join(`
|
|
8
|
+
`)}function d(e,t={}){let n=t.format??`full`,r;switch(n){case`context`:r=i(e);break;case`prompt`:r=o(e);break;case`full`:default:r=a(e,t);break}return{spec:e,markdown:r,format:n,meta:{specName:e.meta.name,specVersion:e.meta.version,exportedAt:new Date().toISOString(),wordCount:r.split(/\s+/).length}}}function f(e,t,n={}){let r=n.format??`full`;return{feature:e,markdown:s(e,t,n),format:r,includedSpecs:e.operations?.map(e=>`${e.name}.v${e.version}`)??[],includedEvents:e.events?.map(e=>`${e.name}.v${e.version}`)??[],includedPresentations:e.presentations?.map(e=>`${e.name}.v${e.version}`)??[]}}export{u as docBlockToMarkdown,l as eventToMarkdown,f as exportFeature,d as exportSpec,s as featureToMarkdown,c as presentationToMarkdown,o as specToAgentPrompt,i as specToContextMarkdown,a as specToFullMarkdown};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{docBlockToMarkdown as e,eventToMarkdown as t,exportFeature as n,exportSpec as r,featureToMarkdown as i,presentationToMarkdown as a,specToAgentPrompt as o,specToContextMarkdown as s,specToFullMarkdown as c}from"./exporters.js";import{AGENT_SYSTEM_PROMPTS as l,formatPlanForAgent as u,generateFixViolationsPrompt as d,generateImplementationPlan as f,generateImplementationPrompt as p,generateReviewPrompt as m,generateTestPrompt as h,generateVerificationPrompt as g}from"./prompts.js";export{l as AGENT_SYSTEM_PROMPTS,e as docBlockToMarkdown,t as eventToMarkdown,n as exportFeature,r as exportSpec,i as featureToMarkdown,u as formatPlanForAgent,d as generateFixViolationsPrompt,f as generateImplementationPlan,p as generateImplementationPrompt,m as generateReviewPrompt,h as generateTestPrompt,g as generateVerificationPrompt,a as presentationToMarkdown,o as specToAgentPrompt,s as specToContextMarkdown,c as specToFullMarkdown};
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import{specToAgentPrompt as e,specToFullMarkdown as t}from"./exporters.js";const n={"claude-code":`You are an expert TypeScript developer working with ContractSpec, a spec-first development framework.
|
|
2
|
+
|
|
3
|
+
Your code follows these principles:
|
|
4
|
+
- Type-safe with comprehensive TypeScript types (no \`any\`)
|
|
5
|
+
- Well-documented with JSDoc comments
|
|
6
|
+
- Production-ready with proper error handling
|
|
7
|
+
- Following SOLID principles and clean code practices
|
|
8
|
+
- Modular and testable
|
|
9
|
+
|
|
10
|
+
When implementing specs:
|
|
11
|
+
1. Validate input against the schema before processing
|
|
12
|
+
2. Handle all error cases defined in the spec
|
|
13
|
+
3. Emit events as specified in sideEffects
|
|
14
|
+
4. Respect policy constraints (auth, rate limits, PII handling)
|
|
15
|
+
5. Follow the acceptance scenarios as your implementation guide
|
|
16
|
+
|
|
17
|
+
Generate clean, idiomatic TypeScript that exactly matches the specification.`,"cursor-cli":`You are implementing features for a ContractSpec-driven codebase.
|
|
18
|
+
|
|
19
|
+
ContractSpec is a spec-first framework where specifications define:
|
|
20
|
+
- Operations (commands and queries) with typed I/O
|
|
21
|
+
- Events that operations emit
|
|
22
|
+
- Presentations for UI components
|
|
23
|
+
- Features that group related specs
|
|
24
|
+
|
|
25
|
+
When working with specs:
|
|
26
|
+
- Read the spec carefully before implementing
|
|
27
|
+
- Match the input/output types exactly
|
|
28
|
+
- Implement all error cases
|
|
29
|
+
- Follow the acceptance scenarios
|
|
30
|
+
- Respect policy constraints
|
|
31
|
+
|
|
32
|
+
Use the project's existing patterns and conventions.`,"generic-mcp":`You are a code generation assistant working with ContractSpec specifications.
|
|
33
|
+
|
|
34
|
+
ContractSpec specs define:
|
|
35
|
+
- meta: name, version, kind (command/query), description, goal, context
|
|
36
|
+
- io: input schema, output schema, error definitions
|
|
37
|
+
- policy: auth level, rate limits, feature flags, PII handling
|
|
38
|
+
- sideEffects: events to emit, analytics, audit
|
|
39
|
+
- acceptance: scenarios and examples
|
|
40
|
+
|
|
41
|
+
Your task is to generate or modify code that complies with the given specification.
|
|
42
|
+
Follow the spec exactly and handle all defined cases.`};function r(r,i,a){let o=n[i],s=t(r),c;return c=i===`claude-code`?`## Implementation Task
|
|
43
|
+
|
|
44
|
+
Implement the following ContractSpec operation:
|
|
45
|
+
|
|
46
|
+
${s}
|
|
47
|
+
|
|
48
|
+
${a?.targetPath?`**Target file:** \`${a.targetPath}\`\n`:``}
|
|
49
|
+
${a?.existingCode?`**Existing code to modify:**\n\`\`\`typescript\n${a.existingCode}\n\`\`\`\n`:``}
|
|
50
|
+
|
|
51
|
+
Generate a complete, production-ready TypeScript implementation that:
|
|
52
|
+
1. Exports a handler function matching the spec signature
|
|
53
|
+
2. Validates input using the schema
|
|
54
|
+
3. Handles all defined error cases
|
|
55
|
+
4. Emits events as specified
|
|
56
|
+
5. Includes JSDoc documentation
|
|
57
|
+
|
|
58
|
+
Provide ONLY the TypeScript code.`:i===`cursor-cli`?`Implement this ContractSpec operation.
|
|
59
|
+
|
|
60
|
+
${s}
|
|
61
|
+
|
|
62
|
+
${a?.targetPath?`Target: ${a.targetPath}\n`:``}
|
|
63
|
+
|
|
64
|
+
Requirements:
|
|
65
|
+
- TypeScript with strict types
|
|
66
|
+
- Handle all error cases
|
|
67
|
+
- Emit specified events
|
|
68
|
+
- Follow acceptance scenarios`:e(r,{taskType:`implement`,existingCode:a?.existingCode}),{agent:i,systemPrompt:o,taskPrompt:c}}function i(e,r,i){let a=i?.testFramework??`vitest`,o=`## Test Generation Task
|
|
69
|
+
|
|
70
|
+
Generate comprehensive tests for this specification:
|
|
71
|
+
|
|
72
|
+
${t(e)}
|
|
73
|
+
|
|
74
|
+
${i?.implementationCode?`**Implementation:**\n\`\`\`typescript\n${i.implementationCode}\n\`\`\`\n`:``}
|
|
75
|
+
|
|
76
|
+
**Test Framework:** ${a}
|
|
77
|
+
|
|
78
|
+
Generate tests that:
|
|
79
|
+
1. Cover all acceptance scenarios from the spec
|
|
80
|
+
2. Test all defined error cases
|
|
81
|
+
3. Verify input validation
|
|
82
|
+
4. Check event emissions
|
|
83
|
+
5. Test edge cases
|
|
84
|
+
|
|
85
|
+
Use descriptive test names: "should [behavior] when [condition]"
|
|
86
|
+
|
|
87
|
+
Provide a complete test file.`;return{agent:r,systemPrompt:n[r],taskPrompt:o}}function a(e,r,i){let a=`## Code Review Task
|
|
88
|
+
|
|
89
|
+
Review this implementation against its specification:
|
|
90
|
+
|
|
91
|
+
**Specification:**
|
|
92
|
+
${t(e)}
|
|
93
|
+
|
|
94
|
+
**Implementation:**
|
|
95
|
+
\`\`\`typescript
|
|
96
|
+
${i}
|
|
97
|
+
\`\`\`
|
|
98
|
+
|
|
99
|
+
Provide a structured review:
|
|
100
|
+
|
|
101
|
+
### Compliance Check
|
|
102
|
+
- [ ] Input types match spec
|
|
103
|
+
- [ ] Output types match spec
|
|
104
|
+
- [ ] All error cases handled
|
|
105
|
+
- [ ] Events emitted correctly
|
|
106
|
+
- [ ] Policy constraints respected
|
|
107
|
+
|
|
108
|
+
### Issues Found
|
|
109
|
+
List any issues with severity (error/warning/info)
|
|
110
|
+
|
|
111
|
+
### Suggestions
|
|
112
|
+
List improvements and recommendations
|
|
113
|
+
|
|
114
|
+
Be thorough and precise. Focus on spec compliance first, then code quality.`;return{agent:r,systemPrompt:n[r],taskPrompt:a}}function o(e,n){return{agent:`generic-mcp`,taskPrompt:`## Semantic Verification Task
|
|
115
|
+
|
|
116
|
+
Verify that this implementation fulfills the specification's intent.
|
|
117
|
+
|
|
118
|
+
**Specification:**
|
|
119
|
+
${t(e)}
|
|
120
|
+
|
|
121
|
+
**Implementation:**
|
|
122
|
+
\`\`\`typescript
|
|
123
|
+
${n}
|
|
124
|
+
\`\`\`
|
|
125
|
+
|
|
126
|
+
Analyze and respond with JSON:
|
|
127
|
+
|
|
128
|
+
\`\`\`json
|
|
129
|
+
{
|
|
130
|
+
"passed": true/false,
|
|
131
|
+
"score": 0-100,
|
|
132
|
+
"compliance": {
|
|
133
|
+
"inputTypes": { "match": true/false, "issues": [] },
|
|
134
|
+
"outputTypes": { "match": true/false, "issues": [] },
|
|
135
|
+
"errorHandling": { "coverage": "full/partial/none", "missing": [] },
|
|
136
|
+
"eventEmission": { "correct": true/false, "issues": [] },
|
|
137
|
+
"policyCompliance": { "auth": true/false, "rateLimit": true/false, "pii": true/false }
|
|
138
|
+
},
|
|
139
|
+
"scenarios": [
|
|
140
|
+
{ "name": "scenario name", "covered": true/false, "notes": "" }
|
|
141
|
+
],
|
|
142
|
+
"issues": [
|
|
143
|
+
{ "severity": "error/warning/info", "category": "type/export/import/scenario/error_handling/semantic", "message": "", "suggestion": "" }
|
|
144
|
+
],
|
|
145
|
+
"summary": "Brief summary of verification results"
|
|
146
|
+
}
|
|
147
|
+
\`\`\``}}function s(e,n){let r=e.meta,i=[],a=n?.projectRoot??`src`,o=r.name.replace(/\./g,`/`);(r.kind===`command`||r.kind===`query`)&&i.push({path:`${a}/${o}/handler.ts`,purpose:`Main handler implementation`,type:`create`},{path:`${a}/${o}/types.ts`,purpose:`Type definitions`,type:`create`},{path:`${a}/${o}/handler.test.ts`,purpose:`Handler tests`,type:`create`});let s=[],c=1;s.push({order:c++,title:`Define Types`,description:`Create TypeScript types for input, output, and internal data structures`,acceptanceCriteria:[`Input type matches spec schema exactly`,`Output type matches spec schema exactly`,`Error types defined for all error cases`]}),s.push({order:c++,title:`Implement Input Validation`,description:`Add validation logic for the input payload`,acceptanceCriteria:[`All required fields are validated`,`Type constraints are enforced`,`Validation errors return appropriate error codes`]}),s.push({order:c++,title:`Implement Core Logic`,description:`Implement the main business logic of the operation`,acceptanceCriteria:e.acceptance?.scenarios?.map(e=>e.name)??[`Operation completes successfully for valid input`]}),e.io.errors&&Object.keys(e.io.errors).length>0&&s.push({order:c++,title:`Implement Error Handling`,description:`Handle all defined error cases`,acceptanceCriteria:Object.entries(e.io.errors).map(([e,t])=>`Handle ${e}: ${t.when}`)}),e.sideEffects?.emits?.length&&s.push({order:c++,title:`Implement Event Emission`,description:`Emit events as specified`,acceptanceCriteria:e.sideEffects.emits.map(e=>`ref`in e?`Emit ${e.ref.name}.v${e.ref.version} when ${e.when}`:`Emit ${e.name}.v${e.version} when ${e.when}`)}),s.push({order:c++,title:`Write Tests`,description:`Create comprehensive test suite`,acceptanceCriteria:[`All acceptance scenarios covered`,`All error cases tested`,`Edge cases handled`,`Events verified`]});let l={policy:[],security:[],pii:[]};return l.policy.push(`Auth level: ${e.policy.auth}`),e.policy.idempotent!==void 0&&l.policy.push(`Idempotent: ${e.policy.idempotent}`),e.policy.rateLimit&&l.policy.push(`Rate limit: ${e.policy.rateLimit.rpm} rpm per ${e.policy.rateLimit.key}`),e.policy.flags?.length&&l.policy.push(`Feature flags required: ${e.policy.flags.join(`, `)}`),e.policy.escalate&&l.security.push(`Escalation required: ${e.policy.escalate}`),e.policy.pii?.length&&(l.pii=e.policy.pii),{target:{type:`spec`,name:r.name,version:r.version},context:{goal:r.goal,description:r.description,background:r.context},specMarkdown:t(e),fileStructure:i,steps:s,constraints:l,verificationChecklist:[`Input validation works for all cases`,`Output matches expected schema`,`All error cases return correct codes`,`Events are emitted with correct payloads`,`Auth requirements are enforced`,`Rate limiting is applied (if applicable)`,`PII fields are handled correctly`,`All acceptance scenarios pass`,`Tests provide adequate coverage`]}}function c(e,t){let r;return r=t===`claude-code`?`## Implementation Plan: ${e.target.name}.v${e.target.version}
|
|
148
|
+
|
|
149
|
+
### Context
|
|
150
|
+
**Goal:** ${e.context.goal}
|
|
151
|
+
|
|
152
|
+
**Background:** ${e.context.background}
|
|
153
|
+
|
|
154
|
+
### Specification
|
|
155
|
+
${e.specMarkdown}
|
|
156
|
+
|
|
157
|
+
### File Structure
|
|
158
|
+
${e.fileStructure.map(e=>`- \`${e.path}\` (${e.type}): ${e.purpose}`).join(`
|
|
159
|
+
`)}
|
|
160
|
+
|
|
161
|
+
### Implementation Steps
|
|
162
|
+
${e.steps.map(e=>`
|
|
163
|
+
#### Step ${e.order}: ${e.title}
|
|
164
|
+
${e.description}
|
|
165
|
+
|
|
166
|
+
**Acceptance Criteria:**
|
|
167
|
+
${e.acceptanceCriteria.map(e=>`- [ ] ${e}`).join(`
|
|
168
|
+
`)}
|
|
169
|
+
`).join(`
|
|
170
|
+
`)}
|
|
171
|
+
|
|
172
|
+
### Constraints
|
|
173
|
+
${e.constraints.policy.length?`**Policy:**\n${e.constraints.policy.map(e=>`- ${e}`).join(`
|
|
174
|
+
`)}\n`:``}
|
|
175
|
+
${e.constraints.security.length?`**Security:**\n${e.constraints.security.map(e=>`- ${e}`).join(`
|
|
176
|
+
`)}\n`:``}
|
|
177
|
+
${e.constraints.pii.length?`**PII Handling:**\n${e.constraints.pii.map(e=>`- ${e}`).join(`
|
|
178
|
+
`)}\n`:``}
|
|
179
|
+
|
|
180
|
+
### Verification Checklist
|
|
181
|
+
${e.verificationChecklist.map(e=>`- [ ] ${e}`).join(`
|
|
182
|
+
`)}
|
|
183
|
+
|
|
184
|
+
Implement this plan step by step.`:t===`cursor-cli`?`# ${e.target.name}.v${e.target.version}
|
|
185
|
+
|
|
186
|
+
${e.context.goal}
|
|
187
|
+
|
|
188
|
+
## Spec
|
|
189
|
+
${e.specMarkdown}
|
|
190
|
+
|
|
191
|
+
## Files to create
|
|
192
|
+
${e.fileStructure.map(e=>`${e.type}: ${e.path}`).join(`
|
|
193
|
+
`)}
|
|
194
|
+
|
|
195
|
+
## Steps
|
|
196
|
+
${e.steps.map(e=>`${e.order}. ${e.title}`).join(`
|
|
197
|
+
`)}`:`Implementation plan for ${e.target.name}.v${e.target.version}
|
|
198
|
+
|
|
199
|
+
${e.specMarkdown}
|
|
200
|
+
|
|
201
|
+
Steps:
|
|
202
|
+
${e.steps.map(e=>`${e.order}. ${e.title}: ${e.description}`).join(`
|
|
203
|
+
`)}`,{agent:t,systemPrompt:n[t],taskPrompt:r}}function l(e,n,r){return{agent:`generic-mcp`,taskPrompt:`## Fix Specification Violations
|
|
204
|
+
|
|
205
|
+
The following implementation has violations against its specification:
|
|
206
|
+
|
|
207
|
+
**Specification:**
|
|
208
|
+
${t(e)}
|
|
209
|
+
|
|
210
|
+
**Current Implementation:**
|
|
211
|
+
\`\`\`typescript
|
|
212
|
+
${n}
|
|
213
|
+
\`\`\`
|
|
214
|
+
|
|
215
|
+
**Violations Found:**
|
|
216
|
+
${r.map((e,t)=>`${t+1}. ${e.message}${e.suggestion?`\n Suggestion: ${e.suggestion}`:``}`).join(`
|
|
217
|
+
`)}
|
|
218
|
+
|
|
219
|
+
Fix ALL violations while maintaining existing functionality.
|
|
220
|
+
Provide the corrected implementation.`}}export{n as AGENT_SYSTEM_PROMPTS,c as formatPlanForAgent,l as generateFixViolationsPrompt,s as generateImplementationPlan,r as generateImplementationPrompt,a as generateReviewPrompt,i as generateTestPrompt,o as generateVerificationPrompt};
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/lib.contracts",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20251216062412",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
|
|
6
6
|
"build": "bun build:bundle && bun build:types",
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
"exports": {
|
|
66
66
|
".": "./src/index.ts",
|
|
67
67
|
"./app-config": "./src/app-config/index.ts",
|
|
68
|
+
"./app-config/app-config.feature": "./src/app-config/app-config.feature.ts",
|
|
68
69
|
"./app-config/branding": "./src/app-config/branding.ts",
|
|
69
70
|
"./app-config/contracts": "./src/app-config/contracts.ts",
|
|
70
71
|
"./app-config/docs/app-config.docblock": "./src/app-config/docs/app-config.docblock.ts",
|
|
@@ -111,6 +112,7 @@
|
|
|
111
112
|
"./docs/tech/contracts/themes.docblock": "./src/docs/tech/contracts/themes.docblock.ts",
|
|
112
113
|
"./docs/tech/contracts/vertical-pocket-family-office.docblock": "./src/docs/tech/contracts/vertical-pocket-family-office.docblock.ts",
|
|
113
114
|
"./docs/tech/lifecycle-stage-system.docblock": "./src/docs/tech/lifecycle-stage-system.docblock.ts",
|
|
115
|
+
"./docs/tech/llm/llm-integration.docblock": "./src/docs/tech/llm/llm-integration.docblock.ts",
|
|
114
116
|
"./docs/tech/mcp-endpoints.docblock": "./src/docs/tech/mcp-endpoints.docblock.ts",
|
|
115
117
|
"./docs/tech/PHASE_1_QUICKSTART.docblock": "./src/docs/tech/PHASE_1_QUICKSTART.docblock.ts",
|
|
116
118
|
"./docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock": "./src/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.ts",
|
|
@@ -154,6 +156,7 @@
|
|
|
154
156
|
"./integrations/openbanking/contracts/transactions": "./src/integrations/openbanking/contracts/transactions.ts",
|
|
155
157
|
"./integrations/openbanking/guards": "./src/integrations/openbanking/guards.ts",
|
|
156
158
|
"./integrations/openbanking/models": "./src/integrations/openbanking/models.ts",
|
|
159
|
+
"./integrations/openbanking/openbanking.feature": "./src/integrations/openbanking/openbanking.feature.ts",
|
|
157
160
|
"./integrations/openbanking/telemetry": "./src/integrations/openbanking/telemetry.ts",
|
|
158
161
|
"./integrations/providers": "./src/integrations/providers/index.ts",
|
|
159
162
|
"./integrations/providers/calendar": "./src/integrations/providers/calendar.ts",
|
|
@@ -235,6 +238,10 @@
|
|
|
235
238
|
"./knowledge/spaces/support-faq": "./src/knowledge/spaces/support-faq.ts",
|
|
236
239
|
"./knowledge/spaces/uploaded-docs": "./src/knowledge/spaces/uploaded-docs.ts",
|
|
237
240
|
"./knowledge/spec": "./src/knowledge/spec.ts",
|
|
241
|
+
"./llm": "./src/llm/index.ts",
|
|
242
|
+
"./llm/exporters": "./src/llm/exporters.ts",
|
|
243
|
+
"./llm/prompts": "./src/llm/prompts.ts",
|
|
244
|
+
"./llm/types": "./src/llm/types.ts",
|
|
238
245
|
"./markdown": "./src/markdown.ts",
|
|
239
246
|
"./migrations": "./src/migrations.ts",
|
|
240
247
|
"./onboarding-base": "./src/onboarding-base.ts",
|
|
@@ -309,6 +316,7 @@
|
|
|
309
316
|
"exports": {
|
|
310
317
|
".": "./dist/index.js",
|
|
311
318
|
"./app-config": "./dist/app-config/index.js",
|
|
319
|
+
"./app-config/app-config.feature": "./dist/app-config/app-config.feature.js",
|
|
312
320
|
"./app-config/branding": "./dist/app-config/branding.js",
|
|
313
321
|
"./app-config/contracts": "./dist/app-config/contracts.js",
|
|
314
322
|
"./app-config/docs/app-config.docblock": "./dist/app-config/docs/app-config.docblock.js",
|
|
@@ -355,6 +363,7 @@
|
|
|
355
363
|
"./docs/tech/contracts/themes.docblock": "./dist/docs/tech/contracts/themes.docblock.js",
|
|
356
364
|
"./docs/tech/contracts/vertical-pocket-family-office.docblock": "./dist/docs/tech/contracts/vertical-pocket-family-office.docblock.js",
|
|
357
365
|
"./docs/tech/lifecycle-stage-system.docblock": "./dist/docs/tech/lifecycle-stage-system.docblock.js",
|
|
366
|
+
"./docs/tech/llm/llm-integration.docblock": "./dist/docs/tech/llm/llm-integration.docblock.js",
|
|
358
367
|
"./docs/tech/mcp-endpoints.docblock": "./dist/docs/tech/mcp-endpoints.docblock.js",
|
|
359
368
|
"./docs/tech/PHASE_1_QUICKSTART.docblock": "./dist/docs/tech/PHASE_1_QUICKSTART.docblock.js",
|
|
360
369
|
"./docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock": "./dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js",
|
|
@@ -398,6 +407,7 @@
|
|
|
398
407
|
"./integrations/openbanking/contracts/transactions": "./dist/integrations/openbanking/contracts/transactions.js",
|
|
399
408
|
"./integrations/openbanking/guards": "./dist/integrations/openbanking/guards.js",
|
|
400
409
|
"./integrations/openbanking/models": "./dist/integrations/openbanking/models.js",
|
|
410
|
+
"./integrations/openbanking/openbanking.feature": "./dist/integrations/openbanking/openbanking.feature.js",
|
|
401
411
|
"./integrations/openbanking/telemetry": "./dist/integrations/openbanking/telemetry.js",
|
|
402
412
|
"./integrations/providers": "./dist/integrations/providers/index.js",
|
|
403
413
|
"./integrations/providers/calendar": "./dist/integrations/providers/calendar.js",
|
|
@@ -479,6 +489,10 @@
|
|
|
479
489
|
"./knowledge/spaces/support-faq": "./dist/knowledge/spaces/support-faq.js",
|
|
480
490
|
"./knowledge/spaces/uploaded-docs": "./dist/knowledge/spaces/uploaded-docs.js",
|
|
481
491
|
"./knowledge/spec": "./dist/knowledge/spec.js",
|
|
492
|
+
"./llm": "./dist/llm/index.js",
|
|
493
|
+
"./llm/exporters": "./dist/llm/exporters.js",
|
|
494
|
+
"./llm/prompts": "./dist/llm/prompts.js",
|
|
495
|
+
"./llm/types": "./dist/llm/types.js",
|
|
482
496
|
"./markdown": "./dist/markdown.js",
|
|
483
497
|
"./migrations": "./dist/migrations.js",
|
|
484
498
|
"./onboarding-base": "./dist/onboarding-base.js",
|