@lssm/example.agent-console 0.0.0-canary-20251221132705 → 0.0.0-canary-20251221144710
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/.turbo/turbo-build$colon$bundle.log +69 -66
- package/.turbo/turbo-build.log +60 -57
- package/CHANGELOG.md +6 -6
- package/dist/agent/agent.entity.d.ts +36 -36
- package/dist/agent/agent.entity.d.ts.map +1 -1
- package/dist/agent/agent.enum.d.ts +4 -4
- package/dist/agent/agent.event.d.ts +31 -31
- package/dist/agent/agent.event.d.ts.map +1 -1
- package/dist/agent/agent.operation.d.ts +126 -126
- package/dist/agent/agent.operation.d.ts.map +1 -1
- package/dist/agent/agent.operation.js +2 -1
- package/dist/agent/agent.operation.js.map +1 -1
- package/dist/agent/agent.schema.d.ts +95 -95
- package/dist/libs/contracts/dist/capabilities/index.js +1 -0
- package/dist/libs/contracts/dist/client/react/feature-render.js +2 -1
- package/dist/libs/contracts/dist/client/react/form-render.js +1 -1
- package/dist/libs/contracts/dist/data-views/data-views.js +1 -0
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +2 -2
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js.map +1 -1
- package/dist/libs/contracts/dist/forms/forms.js +1 -0
- package/dist/libs/contracts/dist/index.js +15 -12
- package/dist/libs/contracts/dist/index.js.map +1 -1
- package/dist/libs/contracts/dist/install.js +1 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +2 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js.map +1 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +2 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js.map +1 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +2 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js.map +1 -1
- package/dist/libs/contracts/dist/integrations/{contracts.js → operations.js} +4 -3
- package/dist/libs/contracts/dist/integrations/operations.js.map +1 -0
- package/dist/libs/contracts/dist/knowledge/{contracts.js → operations.js} +4 -3
- package/dist/libs/contracts/dist/knowledge/operations.js.map +1 -0
- package/dist/libs/contracts/dist/llm/exporters.js +1 -0
- package/dist/libs/contracts/dist/llm/exporters.js.map +1 -1
- package/dist/libs/contracts/dist/onboarding-base.js +2 -1
- package/dist/libs/contracts/dist/onboarding-base.js.map +1 -1
- package/dist/libs/contracts/dist/operations/index.js +2 -0
- package/dist/libs/contracts/dist/{operation.js → operations/operation.js} +1 -1
- package/dist/libs/contracts/dist/operations/operation.js.map +1 -0
- package/dist/libs/contracts/dist/operations/registry.js +2 -0
- package/dist/libs/contracts/dist/presentations/index.js +2 -0
- package/dist/libs/contracts/dist/presentations/presentations.js +2 -0
- package/dist/libs/contracts/dist/{presentations.v2.js → presentations/transform-engine.js} +2 -2
- package/dist/libs/contracts/dist/presentations/transform-engine.js.map +1 -0
- package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +3 -2
- package/dist/run/run.entity.d.ts +56 -56
- package/dist/run/run.enum.d.ts +5 -5
- package/dist/run/run.enum.d.ts.map +1 -1
- package/dist/run/run.event.d.ts +71 -71
- package/dist/run/run.event.d.ts.map +1 -1
- package/dist/run/run.operation.d.ts +175 -175
- package/dist/run/run.operation.d.ts.map +1 -1
- package/dist/run/run.operation.js +2 -1
- package/dist/run/run.operation.js.map +1 -1
- package/dist/run/run.schema.d.ts +99 -99
- package/dist/tool/tool.entity.d.ts +24 -24
- package/dist/tool/tool.entity.d.ts.map +1 -1
- package/dist/tool/tool.enum.d.ts +4 -4
- package/dist/tool/tool.event.d.ts +25 -25
- package/dist/tool/tool.event.d.ts.map +1 -1
- package/dist/tool/tool.operation.d.ts +101 -101
- package/dist/tool/tool.operation.js +2 -1
- package/dist/tool/tool.operation.js.map +1 -1
- package/package.json +8 -8
- package/src/agent/agent.operation.ts +1 -1
- package/src/run/run.operation.ts +1 -1
- package/src/tool/tool.operation.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/libs/contracts/dist/data-views.js +0 -1
- package/dist/libs/contracts/dist/forms.js +0 -1
- package/dist/libs/contracts/dist/integrations/contracts.js.map +0 -1
- package/dist/libs/contracts/dist/knowledge/contracts.js.map +0 -1
- package/dist/libs/contracts/dist/operation.js.map +0 -1
- package/dist/libs/contracts/dist/presentations.js +0 -2
- package/dist/libs/contracts/dist/presentations.v2.js.map +0 -1
- package/dist/libs/contracts/dist/registry.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.operation.js","names":["defineSchemaModel","ScalarTypeEnum"],"sources":["../../src/agent/agent.operation.ts"],"sourcesContent":["import { defineCommand, defineQuery } from '@lssm/lib.contracts/operation';\nimport { defineSchemaModel, ScalarTypeEnum } from '@lssm/lib.schema';\nimport { AgentStatusEnum, ModelProviderEnum } from './agent.enum';\nimport {\n AgentSummaryModel,\n AgentWithToolsModel,\n CreateAgentInputModel,\n UpdateAgentInputModel,\n} from './agent.schema';\nimport { AgentCreatedEvent } from './agent.event';\n\nconst OWNERS = ['@agent-console-team'] as const;\n\n/**\n * CreateAgentCommand - Creates a new agent configuration.\n */\nexport const CreateAgentCommand = defineCommand({\n meta: {\n name: 'agent.agent.create',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'create'],\n description: 'Creates a new AI agent configuration.',\n goal: 'Allow users to define new AI agents with specific models and tools.',\n context: 'Called from the agent builder UI when creating a new agent.',\n },\n io: {\n input: CreateAgentInputModel,\n output: defineSchemaModel({\n name: 'CreateAgentOutput',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: AgentStatusEnum, isOptional: false },\n },\n }),\n errors: {\n SLUG_EXISTS: {\n description:\n 'An agent with this slug already exists in the organization',\n http: 409,\n gqlCode: 'SLUG_EXISTS',\n when: 'Slug is already taken',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n // name: 'agent.created',\n // version: 1,\n // payload: AgentSummaryModel,\n ref: AgentCreatedEvent,\n when: 'Agent is successfully created',\n },\n ],\n audit: ['agent.created'],\n },\n});\n\n/**\n * UpdateAgentCommand - Updates an existing agent.\n */\nexport const UpdateAgentCommand = defineCommand({\n meta: {\n name: 'agent.agent.update',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'update'],\n description: 'Updates an existing AI agent configuration.',\n goal: 'Allow users to modify agent settings and configuration.',\n context: 'Called from the agent settings UI.',\n },\n io: {\n input: UpdateAgentInputModel,\n output: defineSchemaModel({\n name: 'UpdateAgentOutput',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n status: { type: AgentStatusEnum, isOptional: false },\n updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n }),\n errors: {\n AGENT_NOT_FOUND: {\n description: 'The specified agent does not exist',\n http: 404,\n gqlCode: 'AGENT_NOT_FOUND',\n when: 'Agent ID is invalid',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n name: 'agent.updated',\n version: 1,\n when: 'Agent is updated',\n payload: AgentSummaryModel,\n },\n ],\n audit: ['agent.updated'],\n },\n});\n\n/**\n * GetAgentQuery - Retrieves an agent by ID.\n */\nexport const GetAgentQuery = defineQuery({\n meta: {\n name: 'agent.agent.get',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'get'],\n description: 'Retrieves an agent by its ID.',\n goal: 'View detailed agent configuration.',\n context: 'Called when viewing agent details or editing.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetAgentInput',\n fields: {\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n includeTools: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n },\n }),\n output: AgentWithToolsModel,\n errors: {\n AGENT_NOT_FOUND: {\n description: 'The specified agent does not exist',\n http: 404,\n gqlCode: 'AGENT_NOT_FOUND',\n when: 'Agent ID is invalid',\n },\n },\n },\n policy: { auth: 'user' },\n});\n\n/**\n * ListAgentsQuery - Lists agents for an organization.\n */\nexport const ListAgentsQuery = defineQuery({\n meta: {\n name: 'agent.agent.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'list'],\n description: 'Lists agents for an organization with optional filtering.',\n goal: 'Browse and search available agents.',\n context: 'Agent list/dashboard view.',\n },\n io: {\n input: defineSchemaModel({\n name: 'ListAgentsInput',\n fields: {\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n status: { type: AgentStatusEnum, isOptional: true },\n modelProvider: { type: ModelProviderEnum, isOptional: true },\n search: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n limit: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 20,\n },\n offset: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 0,\n },\n },\n }),\n output: defineSchemaModel({\n name: 'ListAgentsOutput',\n fields: {\n items: { type: AgentSummaryModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n hasMore: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n }),\n },\n policy: { auth: 'user' },\n});\n\n/**\n * AssignToolToAgentCommand - Assigns a tool to an agent.\n */\nexport const AssignToolToAgentCommand = defineCommand({\n meta: {\n name: 'agent.agent.assignTool',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'tool', 'assign'],\n description: 'Assigns a tool to an agent with optional configuration.',\n goal: 'Enable agents to use specific tools.',\n context: 'Agent configuration UI - tool selection.',\n },\n io: {\n input: defineSchemaModel({\n name: 'AssignToolToAgentInput',\n fields: {\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n config: { type: ScalarTypeEnum.JSONObject(), isOptional: true },\n order: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n }),\n output: defineSchemaModel({\n name: 'AssignToolToAgentOutput',\n fields: {\n agentToolId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n }),\n errors: {\n TOOL_ALREADY_ASSIGNED: {\n description: 'This tool is already assigned to the agent',\n http: 409,\n gqlCode: 'TOOL_ALREADY_ASSIGNED',\n when: 'Tool assignment already exists',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: { audit: ['agent.tool.assigned'] },\n});\n\n/**\n * RemoveToolFromAgentCommand - Removes a tool from an agent.\n */\nexport const RemoveToolFromAgentCommand = defineCommand({\n meta: {\n name: 'agent.agent.removeTool',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'tool', 'remove'],\n description: 'Removes a tool assignment from an agent.',\n goal: 'Disable specific tools for an agent.',\n context: 'Agent configuration UI - tool management.',\n },\n io: {\n input: defineSchemaModel({\n name: 'RemoveToolFromAgentInput',\n fields: {\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n }),\n output: defineSchemaModel({\n name: 'RemoveToolFromAgentOutput',\n fields: {\n success: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n }),\n },\n policy: { auth: 'user' },\n sideEffects: { audit: ['agent.tool.removed'] },\n});\n"],"mappings":";;;;;;;AAWA,MAAM,SAAS,CAAC,sBAAsB;;;;AAKtC,MAAa,qBAAqB,cAAc;CAC9C,MAAM;EACJ,MAAM;EACN,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM,CAAC,SAA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AAOD,GAAkB;GACvB,MAAM;GACN,QAAQ;IACN,SAAS;KAAE,MAAMC,GAAe,iBAAiB;KAAE,YAAY;KAAO;IACtE,QAAQ;KAAE,MAAMA,GAAe,iBAAiB;KAAE,YAAY;KAAO;IACtE;GACF,CAAC;EACF,QAAQD,GAAkB;GACxB,MAAM;GACN,QAAQ,EACN,SAAS;IAAE,MAAMC,GAAe,SAAS;IAAE,YAAY;IAAO,EAC/D;GACF,CAAC;EACH;CACD,QAAQ,EAAE,MAAM,QAAQ;CACxB,aAAa,EAAE,OAAO,CAAC,qBAAqB,EAAE;CAC/C,CAAC"}
|
|
1
|
+
{"version":3,"file":"agent.operation.js","names":["defineSchemaModel","ScalarTypeEnum"],"sources":["../../src/agent/agent.operation.ts"],"sourcesContent":["import { defineCommand, defineQuery } from '@lssm/lib.contracts/operations';\nimport { defineSchemaModel, ScalarTypeEnum } from '@lssm/lib.schema';\nimport { AgentStatusEnum, ModelProviderEnum } from './agent.enum';\nimport {\n AgentSummaryModel,\n AgentWithToolsModel,\n CreateAgentInputModel,\n UpdateAgentInputModel,\n} from './agent.schema';\nimport { AgentCreatedEvent } from './agent.event';\n\nconst OWNERS = ['@agent-console-team'] as const;\n\n/**\n * CreateAgentCommand - Creates a new agent configuration.\n */\nexport const CreateAgentCommand = defineCommand({\n meta: {\n name: 'agent.agent.create',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'create'],\n description: 'Creates a new AI agent configuration.',\n goal: 'Allow users to define new AI agents with specific models and tools.',\n context: 'Called from the agent builder UI when creating a new agent.',\n },\n io: {\n input: CreateAgentInputModel,\n output: defineSchemaModel({\n name: 'CreateAgentOutput',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: AgentStatusEnum, isOptional: false },\n },\n }),\n errors: {\n SLUG_EXISTS: {\n description:\n 'An agent with this slug already exists in the organization',\n http: 409,\n gqlCode: 'SLUG_EXISTS',\n when: 'Slug is already taken',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n // name: 'agent.created',\n // version: 1,\n // payload: AgentSummaryModel,\n ref: AgentCreatedEvent,\n when: 'Agent is successfully created',\n },\n ],\n audit: ['agent.created'],\n },\n});\n\n/**\n * UpdateAgentCommand - Updates an existing agent.\n */\nexport const UpdateAgentCommand = defineCommand({\n meta: {\n name: 'agent.agent.update',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'update'],\n description: 'Updates an existing AI agent configuration.',\n goal: 'Allow users to modify agent settings and configuration.',\n context: 'Called from the agent settings UI.',\n },\n io: {\n input: UpdateAgentInputModel,\n output: defineSchemaModel({\n name: 'UpdateAgentOutput',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n status: { type: AgentStatusEnum, isOptional: false },\n updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n }),\n errors: {\n AGENT_NOT_FOUND: {\n description: 'The specified agent does not exist',\n http: 404,\n gqlCode: 'AGENT_NOT_FOUND',\n when: 'Agent ID is invalid',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n name: 'agent.updated',\n version: 1,\n when: 'Agent is updated',\n payload: AgentSummaryModel,\n },\n ],\n audit: ['agent.updated'],\n },\n});\n\n/**\n * GetAgentQuery - Retrieves an agent by ID.\n */\nexport const GetAgentQuery = defineQuery({\n meta: {\n name: 'agent.agent.get',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'get'],\n description: 'Retrieves an agent by its ID.',\n goal: 'View detailed agent configuration.',\n context: 'Called when viewing agent details or editing.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetAgentInput',\n fields: {\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n includeTools: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n },\n }),\n output: AgentWithToolsModel,\n errors: {\n AGENT_NOT_FOUND: {\n description: 'The specified agent does not exist',\n http: 404,\n gqlCode: 'AGENT_NOT_FOUND',\n when: 'Agent ID is invalid',\n },\n },\n },\n policy: { auth: 'user' },\n});\n\n/**\n * ListAgentsQuery - Lists agents for an organization.\n */\nexport const ListAgentsQuery = defineQuery({\n meta: {\n name: 'agent.agent.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'list'],\n description: 'Lists agents for an organization with optional filtering.',\n goal: 'Browse and search available agents.',\n context: 'Agent list/dashboard view.',\n },\n io: {\n input: defineSchemaModel({\n name: 'ListAgentsInput',\n fields: {\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n status: { type: AgentStatusEnum, isOptional: true },\n modelProvider: { type: ModelProviderEnum, isOptional: true },\n search: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n limit: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 20,\n },\n offset: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 0,\n },\n },\n }),\n output: defineSchemaModel({\n name: 'ListAgentsOutput',\n fields: {\n items: { type: AgentSummaryModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n hasMore: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n }),\n },\n policy: { auth: 'user' },\n});\n\n/**\n * AssignToolToAgentCommand - Assigns a tool to an agent.\n */\nexport const AssignToolToAgentCommand = defineCommand({\n meta: {\n name: 'agent.agent.assignTool',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'tool', 'assign'],\n description: 'Assigns a tool to an agent with optional configuration.',\n goal: 'Enable agents to use specific tools.',\n context: 'Agent configuration UI - tool selection.',\n },\n io: {\n input: defineSchemaModel({\n name: 'AssignToolToAgentInput',\n fields: {\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n config: { type: ScalarTypeEnum.JSONObject(), isOptional: true },\n order: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n }),\n output: defineSchemaModel({\n name: 'AssignToolToAgentOutput',\n fields: {\n agentToolId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n }),\n errors: {\n TOOL_ALREADY_ASSIGNED: {\n description: 'This tool is already assigned to the agent',\n http: 409,\n gqlCode: 'TOOL_ALREADY_ASSIGNED',\n when: 'Tool assignment already exists',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: { audit: ['agent.tool.assigned'] },\n});\n\n/**\n * RemoveToolFromAgentCommand - Removes a tool from an agent.\n */\nexport const RemoveToolFromAgentCommand = defineCommand({\n meta: {\n name: 'agent.agent.removeTool',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['agent', 'tool', 'remove'],\n description: 'Removes a tool assignment from an agent.',\n goal: 'Disable specific tools for an agent.',\n context: 'Agent configuration UI - tool management.',\n },\n io: {\n input: defineSchemaModel({\n name: 'RemoveToolFromAgentInput',\n fields: {\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n }),\n output: defineSchemaModel({\n name: 'RemoveToolFromAgentOutput',\n fields: {\n success: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n }),\n },\n policy: { auth: 'user' },\n sideEffects: { audit: ['agent.tool.removed'] },\n});\n"],"mappings":";;;;;;;;AAWA,MAAM,SAAS,CAAC,sBAAsB;;;;AAKtC,MAAa,qBAAqB,cAAc;CAC9C,MAAM;EACJ,MAAM;EACN,SAAS;EACT,WAAW;EACX,QAAQ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ACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAOD,GAAkB;GACvB,MAAM;GACN,QAAQ;IACN,SAAS;KAAE,MAAMC,GAAe,iBAAiB;KAAE,YAAY;KAAO;IACtE,QAAQ;KAAE,MAAMA,GAAe,iBAAiB;KAAE,YAAY;KAAO;IACtE;GACF,CAAC;EACF,QAAQD,GAAkB;GACxB,MAAM;GACN,QAAQ,EACN,SAAS;IAAE,MAAMC,GAAe,SAAS;IAAE,YAAY;IAAO,EAC/D;GACF,CAAC;EACH;CACD,QAAQ,EAAE,MAAM,QAAQ;CACxB,aAAa,EAAE,OAAO,CAAC,qBAAqB,EAAE;CAC/C,CAAC"}
|
|
@@ -1,268 +1,268 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _lssm_lib_schema389 from "@lssm/lib.schema";
|
|
2
2
|
|
|
3
3
|
//#region src/agent/agent.schema.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* AI agent configuration schema.
|
|
6
6
|
*/
|
|
7
|
-
declare const AgentModel:
|
|
7
|
+
declare const AgentModel: _lssm_lib_schema389.SchemaModel<{
|
|
8
8
|
id: {
|
|
9
|
-
type:
|
|
9
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
10
10
|
isOptional: false;
|
|
11
11
|
};
|
|
12
12
|
organizationId: {
|
|
13
|
-
type:
|
|
13
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
14
14
|
isOptional: false;
|
|
15
15
|
};
|
|
16
16
|
name: {
|
|
17
|
-
type:
|
|
17
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
18
18
|
isOptional: false;
|
|
19
19
|
};
|
|
20
20
|
slug: {
|
|
21
|
-
type:
|
|
21
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
22
22
|
isOptional: false;
|
|
23
23
|
};
|
|
24
24
|
description: {
|
|
25
|
-
type:
|
|
25
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
26
26
|
isOptional: true;
|
|
27
27
|
};
|
|
28
28
|
status: {
|
|
29
|
-
type:
|
|
29
|
+
type: _lssm_lib_schema389.EnumType<[string, string, string, string]>;
|
|
30
30
|
isOptional: false;
|
|
31
31
|
};
|
|
32
32
|
modelProvider: {
|
|
33
|
-
type:
|
|
33
|
+
type: _lssm_lib_schema389.EnumType<[string, string, string, string, string]>;
|
|
34
34
|
isOptional: false;
|
|
35
35
|
};
|
|
36
36
|
modelName: {
|
|
37
|
-
type:
|
|
37
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
38
38
|
isOptional: false;
|
|
39
39
|
};
|
|
40
40
|
modelConfig: {
|
|
41
|
-
type:
|
|
41
|
+
type: _lssm_lib_schema389.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
42
42
|
isOptional: true;
|
|
43
43
|
};
|
|
44
44
|
systemPrompt: {
|
|
45
|
-
type:
|
|
45
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
46
46
|
isOptional: false;
|
|
47
47
|
};
|
|
48
48
|
userPromptTemplate: {
|
|
49
|
-
type:
|
|
49
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
50
50
|
isOptional: true;
|
|
51
51
|
};
|
|
52
52
|
toolIds: {
|
|
53
|
-
type:
|
|
53
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
54
54
|
isArray: true;
|
|
55
55
|
isOptional: true;
|
|
56
56
|
};
|
|
57
57
|
toolChoice: {
|
|
58
|
-
type:
|
|
58
|
+
type: _lssm_lib_schema389.EnumType<[string, string, string]>;
|
|
59
59
|
isOptional: false;
|
|
60
60
|
defaultValue: string;
|
|
61
61
|
};
|
|
62
62
|
maxIterations: {
|
|
63
|
-
type:
|
|
63
|
+
type: _lssm_lib_schema389.FieldType<number, number>;
|
|
64
64
|
isOptional: false;
|
|
65
65
|
defaultValue: number;
|
|
66
66
|
};
|
|
67
67
|
maxTokensPerRun: {
|
|
68
|
-
type:
|
|
68
|
+
type: _lssm_lib_schema389.FieldType<number, number>;
|
|
69
69
|
isOptional: true;
|
|
70
70
|
};
|
|
71
71
|
timeoutMs: {
|
|
72
|
-
type:
|
|
72
|
+
type: _lssm_lib_schema389.FieldType<number, number>;
|
|
73
73
|
isOptional: false;
|
|
74
74
|
defaultValue: number;
|
|
75
75
|
};
|
|
76
76
|
version: {
|
|
77
|
-
type:
|
|
77
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
78
78
|
isOptional: false;
|
|
79
79
|
};
|
|
80
80
|
tags: {
|
|
81
|
-
type:
|
|
81
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
82
82
|
isArray: true;
|
|
83
83
|
isOptional: true;
|
|
84
84
|
};
|
|
85
85
|
createdAt: {
|
|
86
|
-
type:
|
|
86
|
+
type: _lssm_lib_schema389.FieldType<Date, string>;
|
|
87
87
|
isOptional: false;
|
|
88
88
|
};
|
|
89
89
|
updatedAt: {
|
|
90
|
-
type:
|
|
90
|
+
type: _lssm_lib_schema389.FieldType<Date, string>;
|
|
91
91
|
isOptional: false;
|
|
92
92
|
};
|
|
93
93
|
}>;
|
|
94
94
|
/**
|
|
95
95
|
* Summary of an agent for list views.
|
|
96
96
|
*/
|
|
97
|
-
declare const AgentSummaryModel:
|
|
97
|
+
declare const AgentSummaryModel: _lssm_lib_schema389.SchemaModel<{
|
|
98
98
|
id: {
|
|
99
|
-
type:
|
|
99
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
100
100
|
isOptional: false;
|
|
101
101
|
};
|
|
102
102
|
name: {
|
|
103
|
-
type:
|
|
103
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
104
104
|
isOptional: false;
|
|
105
105
|
};
|
|
106
106
|
slug: {
|
|
107
|
-
type:
|
|
107
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
108
108
|
isOptional: false;
|
|
109
109
|
};
|
|
110
110
|
description: {
|
|
111
|
-
type:
|
|
111
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
112
112
|
isOptional: true;
|
|
113
113
|
};
|
|
114
114
|
status: {
|
|
115
|
-
type:
|
|
115
|
+
type: _lssm_lib_schema389.EnumType<[string, string, string, string]>;
|
|
116
116
|
isOptional: false;
|
|
117
117
|
};
|
|
118
118
|
modelProvider: {
|
|
119
|
-
type:
|
|
119
|
+
type: _lssm_lib_schema389.EnumType<[string, string, string, string, string]>;
|
|
120
120
|
isOptional: false;
|
|
121
121
|
};
|
|
122
122
|
modelName: {
|
|
123
|
-
type:
|
|
123
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
124
124
|
isOptional: false;
|
|
125
125
|
};
|
|
126
126
|
version: {
|
|
127
|
-
type:
|
|
127
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
128
128
|
isOptional: false;
|
|
129
129
|
};
|
|
130
130
|
createdAt: {
|
|
131
|
-
type:
|
|
131
|
+
type: _lssm_lib_schema389.FieldType<Date, string>;
|
|
132
132
|
isOptional: false;
|
|
133
133
|
};
|
|
134
134
|
}>;
|
|
135
135
|
/**
|
|
136
136
|
* Tool reference in agent context.
|
|
137
137
|
*/
|
|
138
|
-
declare const AgentToolRefModel:
|
|
138
|
+
declare const AgentToolRefModel: _lssm_lib_schema389.SchemaModel<{
|
|
139
139
|
id: {
|
|
140
|
-
type:
|
|
140
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
141
141
|
isOptional: false;
|
|
142
142
|
};
|
|
143
143
|
name: {
|
|
144
|
-
type:
|
|
144
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
145
145
|
isOptional: false;
|
|
146
146
|
};
|
|
147
147
|
slug: {
|
|
148
|
-
type:
|
|
148
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
149
149
|
isOptional: false;
|
|
150
150
|
};
|
|
151
151
|
description: {
|
|
152
|
-
type:
|
|
152
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
153
153
|
isOptional: false;
|
|
154
154
|
};
|
|
155
155
|
category: {
|
|
156
|
-
type:
|
|
156
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
157
157
|
isOptional: false;
|
|
158
158
|
};
|
|
159
159
|
}>;
|
|
160
160
|
/**
|
|
161
161
|
* Agent with associated tools.
|
|
162
162
|
*/
|
|
163
|
-
declare const AgentWithToolsModel:
|
|
163
|
+
declare const AgentWithToolsModel: _lssm_lib_schema389.SchemaModel<{
|
|
164
164
|
id: {
|
|
165
|
-
type:
|
|
165
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
166
166
|
isOptional: false;
|
|
167
167
|
};
|
|
168
168
|
organizationId: {
|
|
169
|
-
type:
|
|
169
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
170
170
|
isOptional: false;
|
|
171
171
|
};
|
|
172
172
|
name: {
|
|
173
|
-
type:
|
|
173
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
174
174
|
isOptional: false;
|
|
175
175
|
};
|
|
176
176
|
slug: {
|
|
177
|
-
type:
|
|
177
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
178
178
|
isOptional: false;
|
|
179
179
|
};
|
|
180
180
|
description: {
|
|
181
|
-
type:
|
|
181
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
182
182
|
isOptional: true;
|
|
183
183
|
};
|
|
184
184
|
status: {
|
|
185
|
-
type:
|
|
185
|
+
type: _lssm_lib_schema389.EnumType<[string, string, string, string]>;
|
|
186
186
|
isOptional: false;
|
|
187
187
|
};
|
|
188
188
|
modelProvider: {
|
|
189
|
-
type:
|
|
189
|
+
type: _lssm_lib_schema389.EnumType<[string, string, string, string, string]>;
|
|
190
190
|
isOptional: false;
|
|
191
191
|
};
|
|
192
192
|
modelName: {
|
|
193
|
-
type:
|
|
193
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
194
194
|
isOptional: false;
|
|
195
195
|
};
|
|
196
196
|
modelConfig: {
|
|
197
|
-
type:
|
|
197
|
+
type: _lssm_lib_schema389.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
198
198
|
isOptional: true;
|
|
199
199
|
};
|
|
200
200
|
systemPrompt: {
|
|
201
|
-
type:
|
|
201
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
202
202
|
isOptional: false;
|
|
203
203
|
};
|
|
204
204
|
userPromptTemplate: {
|
|
205
|
-
type:
|
|
205
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
206
206
|
isOptional: true;
|
|
207
207
|
};
|
|
208
208
|
toolIds: {
|
|
209
|
-
type:
|
|
209
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
210
210
|
isArray: true;
|
|
211
211
|
isOptional: true;
|
|
212
212
|
};
|
|
213
213
|
toolChoice: {
|
|
214
|
-
type:
|
|
214
|
+
type: _lssm_lib_schema389.EnumType<[string, string, string]>;
|
|
215
215
|
isOptional: false;
|
|
216
216
|
};
|
|
217
217
|
maxIterations: {
|
|
218
|
-
type:
|
|
218
|
+
type: _lssm_lib_schema389.FieldType<number, number>;
|
|
219
219
|
isOptional: false;
|
|
220
220
|
};
|
|
221
221
|
maxTokensPerRun: {
|
|
222
|
-
type:
|
|
222
|
+
type: _lssm_lib_schema389.FieldType<number, number>;
|
|
223
223
|
isOptional: true;
|
|
224
224
|
};
|
|
225
225
|
timeoutMs: {
|
|
226
|
-
type:
|
|
226
|
+
type: _lssm_lib_schema389.FieldType<number, number>;
|
|
227
227
|
isOptional: false;
|
|
228
228
|
};
|
|
229
229
|
version: {
|
|
230
|
-
type:
|
|
230
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
231
231
|
isOptional: false;
|
|
232
232
|
};
|
|
233
233
|
tags: {
|
|
234
|
-
type:
|
|
234
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
235
235
|
isArray: true;
|
|
236
236
|
isOptional: true;
|
|
237
237
|
};
|
|
238
238
|
createdAt: {
|
|
239
|
-
type:
|
|
239
|
+
type: _lssm_lib_schema389.FieldType<Date, string>;
|
|
240
240
|
isOptional: false;
|
|
241
241
|
};
|
|
242
242
|
updatedAt: {
|
|
243
|
-
type:
|
|
243
|
+
type: _lssm_lib_schema389.FieldType<Date, string>;
|
|
244
244
|
isOptional: false;
|
|
245
245
|
};
|
|
246
246
|
tools: {
|
|
247
|
-
type:
|
|
247
|
+
type: _lssm_lib_schema389.SchemaModel<{
|
|
248
248
|
id: {
|
|
249
|
-
type:
|
|
249
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
250
250
|
isOptional: false;
|
|
251
251
|
};
|
|
252
252
|
name: {
|
|
253
|
-
type:
|
|
253
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
254
254
|
isOptional: false;
|
|
255
255
|
};
|
|
256
256
|
slug: {
|
|
257
|
-
type:
|
|
257
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
258
258
|
isOptional: false;
|
|
259
259
|
};
|
|
260
260
|
description: {
|
|
261
|
-
type:
|
|
261
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
262
262
|
isOptional: false;
|
|
263
263
|
};
|
|
264
264
|
category: {
|
|
265
|
-
type:
|
|
265
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
266
266
|
isOptional: false;
|
|
267
267
|
};
|
|
268
268
|
}>;
|
|
@@ -273,66 +273,66 @@ declare const AgentWithToolsModel: _lssm_lib_schema611.SchemaModel<{
|
|
|
273
273
|
/**
|
|
274
274
|
* Input for creating an agent.
|
|
275
275
|
*/
|
|
276
|
-
declare const CreateAgentInputModel:
|
|
276
|
+
declare const CreateAgentInputModel: _lssm_lib_schema389.SchemaModel<{
|
|
277
277
|
organizationId: {
|
|
278
|
-
type:
|
|
278
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
279
279
|
isOptional: false;
|
|
280
280
|
};
|
|
281
281
|
name: {
|
|
282
|
-
type:
|
|
282
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
283
283
|
isOptional: false;
|
|
284
284
|
};
|
|
285
285
|
slug: {
|
|
286
|
-
type:
|
|
286
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
287
287
|
isOptional: false;
|
|
288
288
|
};
|
|
289
289
|
description: {
|
|
290
|
-
type:
|
|
290
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
291
291
|
isOptional: true;
|
|
292
292
|
};
|
|
293
293
|
modelProvider: {
|
|
294
|
-
type:
|
|
294
|
+
type: _lssm_lib_schema389.EnumType<[string, string, string, string, string]>;
|
|
295
295
|
isOptional: false;
|
|
296
296
|
};
|
|
297
297
|
modelName: {
|
|
298
|
-
type:
|
|
298
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
299
299
|
isOptional: false;
|
|
300
300
|
};
|
|
301
301
|
modelConfig: {
|
|
302
|
-
type:
|
|
302
|
+
type: _lssm_lib_schema389.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
303
303
|
isOptional: true;
|
|
304
304
|
};
|
|
305
305
|
systemPrompt: {
|
|
306
|
-
type:
|
|
306
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
307
307
|
isOptional: false;
|
|
308
308
|
};
|
|
309
309
|
userPromptTemplate: {
|
|
310
|
-
type:
|
|
310
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
311
311
|
isOptional: true;
|
|
312
312
|
};
|
|
313
313
|
toolIds: {
|
|
314
|
-
type:
|
|
314
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
315
315
|
isArray: true;
|
|
316
316
|
isOptional: true;
|
|
317
317
|
};
|
|
318
318
|
toolChoice: {
|
|
319
|
-
type:
|
|
319
|
+
type: _lssm_lib_schema389.EnumType<[string, string, string]>;
|
|
320
320
|
isOptional: true;
|
|
321
321
|
};
|
|
322
322
|
maxIterations: {
|
|
323
|
-
type:
|
|
323
|
+
type: _lssm_lib_schema389.FieldType<number, number>;
|
|
324
324
|
isOptional: true;
|
|
325
325
|
};
|
|
326
326
|
maxTokensPerRun: {
|
|
327
|
-
type:
|
|
327
|
+
type: _lssm_lib_schema389.FieldType<number, number>;
|
|
328
328
|
isOptional: true;
|
|
329
329
|
};
|
|
330
330
|
timeoutMs: {
|
|
331
|
-
type:
|
|
331
|
+
type: _lssm_lib_schema389.FieldType<number, number>;
|
|
332
332
|
isOptional: true;
|
|
333
333
|
};
|
|
334
334
|
tags: {
|
|
335
|
-
type:
|
|
335
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
336
336
|
isArray: true;
|
|
337
337
|
isOptional: true;
|
|
338
338
|
};
|
|
@@ -340,58 +340,58 @@ declare const CreateAgentInputModel: _lssm_lib_schema611.SchemaModel<{
|
|
|
340
340
|
/**
|
|
341
341
|
* Input for updating an agent.
|
|
342
342
|
*/
|
|
343
|
-
declare const UpdateAgentInputModel:
|
|
343
|
+
declare const UpdateAgentInputModel: _lssm_lib_schema389.SchemaModel<{
|
|
344
344
|
agentId: {
|
|
345
|
-
type:
|
|
345
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
346
346
|
isOptional: false;
|
|
347
347
|
};
|
|
348
348
|
name: {
|
|
349
|
-
type:
|
|
349
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
350
350
|
isOptional: true;
|
|
351
351
|
};
|
|
352
352
|
description: {
|
|
353
|
-
type:
|
|
353
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
354
354
|
isOptional: true;
|
|
355
355
|
};
|
|
356
356
|
status: {
|
|
357
|
-
type:
|
|
357
|
+
type: _lssm_lib_schema389.EnumType<[string, string, string, string]>;
|
|
358
358
|
isOptional: true;
|
|
359
359
|
};
|
|
360
360
|
modelConfig: {
|
|
361
|
-
type:
|
|
361
|
+
type: _lssm_lib_schema389.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
362
362
|
isOptional: true;
|
|
363
363
|
};
|
|
364
364
|
systemPrompt: {
|
|
365
|
-
type:
|
|
365
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
366
366
|
isOptional: true;
|
|
367
367
|
};
|
|
368
368
|
userPromptTemplate: {
|
|
369
|
-
type:
|
|
369
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
370
370
|
isOptional: true;
|
|
371
371
|
};
|
|
372
372
|
toolIds: {
|
|
373
|
-
type:
|
|
373
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
374
374
|
isArray: true;
|
|
375
375
|
isOptional: true;
|
|
376
376
|
};
|
|
377
377
|
toolChoice: {
|
|
378
|
-
type:
|
|
378
|
+
type: _lssm_lib_schema389.EnumType<[string, string, string]>;
|
|
379
379
|
isOptional: true;
|
|
380
380
|
};
|
|
381
381
|
maxIterations: {
|
|
382
|
-
type:
|
|
382
|
+
type: _lssm_lib_schema389.FieldType<number, number>;
|
|
383
383
|
isOptional: true;
|
|
384
384
|
};
|
|
385
385
|
maxTokensPerRun: {
|
|
386
|
-
type:
|
|
386
|
+
type: _lssm_lib_schema389.FieldType<number, number>;
|
|
387
387
|
isOptional: true;
|
|
388
388
|
};
|
|
389
389
|
timeoutMs: {
|
|
390
|
-
type:
|
|
390
|
+
type: _lssm_lib_schema389.FieldType<number, number>;
|
|
391
391
|
isOptional: true;
|
|
392
392
|
};
|
|
393
393
|
tags: {
|
|
394
|
-
type:
|
|
394
|
+
type: _lssm_lib_schema389.FieldType<string, string>;
|
|
395
395
|
isArray: true;
|
|
396
396
|
isOptional: true;
|
|
397
397
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./openbanking.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../registry-utils.js";
|
|
@@ -88,11 +88,11 @@ llm.verify { specPath: "path/to/my.spec.ts", implementationPath: "path/to/impl.t
|
|
|
88
88
|
### Programmatic Usage
|
|
89
89
|
|
|
90
90
|
\`\`\`typescript
|
|
91
|
-
import {
|
|
91
|
+
import { operationSpecToFullMarkdown, operationSpecToAgentPrompt } from '@lssm/lib.contracts/llm';
|
|
92
92
|
import { createAgentGuideService, createVerifyService } from '@lssm/bundle.contractspec-workspace';
|
|
93
93
|
|
|
94
94
|
// Export
|
|
95
|
-
const markdown =
|
|
95
|
+
const markdown = operationSpecToFullMarkdown(mySpec);
|
|
96
96
|
|
|
97
97
|
// Generate guide
|
|
98
98
|
const guideService = createAgentGuideService({ defaultAgent: 'claude-code' });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-integration.docblock.js","names":[],"sources":["../../../../../../../../../libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js"],"sourcesContent":["import { registerDocBlocks } from \"../../registry.js\";\n\n//#region src/docs/tech/llm/llm-integration.docblock.ts\nconst tech_llm_integration_DocBlocks = [\n\t{\n\t\tid: \"docs.tech.llm.overview\",\n\t\ttitle: \"LLM Integration Overview\",\n\t\tsummary: \"Export specs to LLM-friendly formats, generate implementation guides, and verify implementations.\",\n\t\tkind: \"reference\",\n\t\tvisibility: \"public\",\n\t\troute: \"/docs/tech/llm/overview\",\n\t\ttags: [\n\t\t\t\"llm\",\n\t\t\t\"ai\",\n\t\t\t\"export\",\n\t\t\t\"guide\",\n\t\t\t\"verify\"\n\t\t],\n\t\tbody: `# LLM Integration\n\nContractSpec provides first-class LLM integration to bridge specifications and AI coding agents.\n\n## Core Features\n\n### 1. Multi-Format Export\n\nExport specs to markdown in formats optimized for LLM consumption:\n\n- **Context format**: Summary for understanding (goal, context, acceptance criteria)\n- **Full format**: Complete spec with all details (I/O schemas, policy, events)\n- **Prompt format**: Actionable prompt with implementation instructions\n\n### 2. Implementation Guidance\n\nGenerate agent-specific implementation plans:\n\n- **Claude Code**: Extended thinking mode with structured prompts\n- **Cursor CLI**: Background/composer mode with .mdc rules generation\n- **Generic MCP**: Standard format for any MCP-compatible agent\n\n### 3. Tiered Verification\n\nVerify implementations against specs:\n\n- **Tier 1 (Structure)**: Types, exports, imports validation\n- **Tier 2 (Behavior)**: Scenario coverage, error handling, events\n- **Tier 3 (AI Review)**: Semantic compliance analysis via LLM\n\n## Access Points\n\n| Surface | Commands/Tools |\n|---------|---------------|\n| CLI | \\`contractspec llm export\\`, \\`guide\\`, \\`verify\\`, \\`copy\\` |\n| MCP | \\`llm.export\\`, \\`llm.guide\\`, \\`llm.verify\\` tools |\n| VSCode | Export to LLM, Generate Guide, Verify, Copy commands |\n\n## Quick Start\n\n### CLI Usage\n\n\\`\\`\\`bash\n# Export spec as markdown\ncontractspec llm export path/to/my.spec.ts --format full\n\n# Generate implementation guide\ncontractspec llm guide path/to/my.spec.ts --agent claude-code\n\n# Verify implementation\ncontractspec llm verify path/to/my.spec.ts path/to/impl.ts --tier 2\n\n# Copy spec to clipboard\ncontractspec llm copy path/to/my.spec.ts --format context\n\\`\\`\\`\n\n### MCP Usage\n\n\\`\\`\\`\n# Export spec\nllm.export { specPath: \"path/to/my.spec.ts\", format: \"full\" }\n\n# Generate guide\nllm.guide { specPath: \"path/to/my.spec.ts\", agent: \"cursor-cli\" }\n\n# Verify implementation\nllm.verify { specPath: \"path/to/my.spec.ts\", implementationPath: \"path/to/impl.ts\", tier: \"2\" }\n\\`\\`\\`\n\n### Programmatic Usage\n\n\\`\\`\\`typescript\nimport { specToFullMarkdown, specToAgentPrompt } from '@lssm/lib.contracts/llm';\nimport { createAgentGuideService, createVerifyService } from '@lssm/bundle.contractspec-workspace';\n\n// Export\nconst markdown = specToFullMarkdown(mySpec);\n\n// Generate guide\nconst guideService = createAgentGuideService({ defaultAgent: 'claude-code' });\nconst guide = guideService.generateGuide(mySpec);\n\n// Verify\nconst verifyService = createVerifyService();\nconst result = await verifyService.verify(mySpec, implementationCode, {\n tiers: ['structure', 'behavior']\n});\n\\`\\`\\`\n`\n\t},\n\t{\n\t\tid: \"docs.tech.llm.export-formats\",\n\t\ttitle: \"LLM Export Formats\",\n\t\tsummary: \"Detailed explanation of the three export formats for LLM consumption.\",\n\t\tkind: \"reference\",\n\t\tvisibility: \"public\",\n\t\troute: \"/docs/tech/llm/export-formats\",\n\t\ttags: [\n\t\t\t\"llm\",\n\t\t\t\"export\",\n\t\t\t\"markdown\"\n\t\t],\n\t\tbody: `# LLM Export Formats\n\nContractSpec provides three export formats optimized for different LLM use cases.\n\n## Context Format\n\nBest for: Understanding what a spec does, providing background to LLMs.\n\nIncludes:\n- Spec name, version, type\n- Goal and context\n- Description\n- Acceptance scenarios\n\nExample:\n\n\\`\\`\\`markdown\n# users.createUser (v1)\n\n> Create a new user account with email verification.\n\n**Type:** command | **Stability:** stable\n\n## Goal\nCreate a new user in the system and trigger email verification.\n\n## Context\nPart of the user onboarding flow. Called after signup form submission.\n\n## Acceptance Criteria\n### Happy path\n**Given:** Valid email and password\n**When:** User submits registration\n**Then:** Account is created, verification email is sent\n\\`\\`\\`\n\n## Full Format\n\nBest for: Complete documentation, implementation reference.\n\nIncludes everything:\n- All metadata\n- JSON schemas for I/O\n- Error definitions\n- Policy (auth, rate limits, PII)\n- Events emitted\n- Examples\n- Transport configuration\n\n## Prompt Format\n\nBest for: Feeding directly to coding agents.\n\nIncludes:\n- Task header with clear instructions\n- Full spec context\n- Implementation requirements\n- Task-specific guidance (implement/test/refactor/review)\n- Expected output format\n\nThe prompt format adapts based on task type:\n- **implement**: Full implementation with tests\n- **test**: Test generation for existing code\n- **refactor**: Refactoring while maintaining behavior\n- **review**: Code review against spec\n`\n\t},\n\t{\n\t\tid: \"docs.tech.llm.agent-adapters\",\n\t\ttitle: \"Agent Adapters\",\n\t\tsummary: \"Adapters for different AI coding agents (Claude, Cursor, MCP).\",\n\t\tkind: \"reference\",\n\t\tvisibility: \"public\",\n\t\troute: \"/docs/tech/llm/agent-adapters\",\n\t\ttags: [\n\t\t\t\"llm\",\n\t\t\t\"agents\",\n\t\t\t\"claude\",\n\t\t\t\"cursor\",\n\t\t\t\"mcp\"\n\t\t],\n\t\tbody: `# Agent Adapters\n\nContractSpec provides specialized adapters for different AI coding agents.\n\n## Claude Code Adapter\n\nOptimized for Anthropic Claude's extended thinking and code generation.\n\nFeatures:\n- Structured markdown with clear sections\n- Checklists for steps and verification\n- Icons for file operations (📝 create, ✏️ modify)\n- System prompt for ContractSpec context\n\nUsage:\n\\`\\`\\`typescript\nconst guideService = createAgentGuideService({ defaultAgent: 'claude-code' });\nconst result = guideService.generateGuide(spec, { agent: 'claude-code' });\n// result.prompt.systemPrompt - Claude system context\n// result.prompt.taskPrompt - Task-specific instructions\n\\`\\`\\`\n\n## Cursor CLI Adapter\n\nOptimized for Cursor's background/composer mode.\n\nFeatures:\n- Compact format for context efficiency\n- .mdc cursor rules generation\n- Integration with Cursor's file system\n- Concise step lists\n\nGenerate Cursor Rules:\n\\`\\`\\`typescript\nconst cursorRules = guideService.generateAgentConfig(spec, 'cursor-cli');\n// Save to .cursor/rules/my-spec.mdc\n\\`\\`\\`\n\n## Generic MCP Adapter\n\nWorks with any MCP-compatible agent (Cline, Aider, etc.).\n\nFeatures:\n- Standard markdown format\n- Table-based metadata\n- JSON resource format support\n- Prompt message format\n\nThe generic adapter is the default and works across all agents.\n\n## Choosing an Adapter\n\n| Agent | Best For | Key Features |\n|-------|----------|--------------|\n| Claude Code | Complex implementations | Extended thinking, detailed steps |\n| Cursor CLI | IDE-integrated work | Cursor rules, compact format |\n| Generic MCP | Any MCP agent | Universal compatibility |\n`\n\t},\n\t{\n\t\tid: \"docs.tech.llm.verification\",\n\t\ttitle: \"Implementation Verification\",\n\t\tsummary: \"Tiered verification of implementations against specifications.\",\n\t\tkind: \"reference\",\n\t\tvisibility: \"public\",\n\t\troute: \"/docs/tech/llm/verification\",\n\t\ttags: [\n\t\t\t\"llm\",\n\t\t\t\"verify\",\n\t\t\t\"validation\",\n\t\t\t\"testing\"\n\t\t],\n\t\tbody: `# Implementation Verification\n\nContractSpec provides tiered verification to check if implementations comply with specs.\n\n## Verification Tiers\n\n### Tier 1: Structure (Fast)\n\nChecks TypeScript structure against spec requirements:\n\n| Check | What it validates |\n|-------|------------------|\n| Handler export | Function is properly exported |\n| Contracts import | Imports from @lssm/lib.contracts |\n| Schema import | Imports from @lssm/lib.schema |\n| No \\`any\\` type | TypeScript strict compliance |\n| Error handling | Error codes are referenced |\n| Event emission | Event patterns exist |\n| Input validation | Validation patterns used |\n| Async patterns | Async/await for commands |\n\n### Tier 2: Behavior (Comprehensive)\n\nChecks implementation coverage of spec behaviors:\n\n| Check | What it validates |\n|-------|------------------|\n| Scenario coverage | Acceptance scenarios implemented |\n| Example coverage | Example I/O values referenced |\n| Error cases | All error conditions handled |\n| Event conditions | Events emitted correctly |\n| Idempotency | Idempotent patterns (if required) |\n\n### Tier 3: AI Review (Deep)\n\nUses LLM for semantic analysis:\n\n- Does the implementation fulfill the spec's intent?\n- Are edge cases properly handled?\n- Is the code quality acceptable?\n- Are there any subtle violations?\n\nRequires AI API key configuration.\n\n## Running Verification\n\n\\`\\`\\`typescript\nconst verifyService = createVerifyService({\n aiApiKey: process.env.ANTHROPIC_API_KEY, // Optional, for Tier 3\n aiProvider: 'anthropic',\n});\n\nconst result = await verifyService.verify(spec, implementationCode, {\n tiers: ['structure', 'behavior'],\n failFast: false,\n includeSuggestions: true,\n});\n\nconsole.log(result.passed); // true/false\nconsole.log(result.score); // 0-100\nconsole.log(result.summary); // Human-readable summary\n\\`\\`\\`\n\n## Verification Report\n\nThe report includes:\n\n- **passed**: Overall compliance\n- **score**: 0-100 score\n- **issues**: Array of problems found\n- **suggestions**: Recommended fixes\n- **coverage**: Metrics on scenario/error/field coverage\n\nEach issue has:\n- **severity**: error, warning, or info\n- **category**: type, export, import, scenario, error_handling, semantic\n- **message**: Description of the issue\n- **suggestion**: How to fix it\n`\n\t}\n];\nregisterDocBlocks(tech_llm_integration_DocBlocks);\n\n//#endregion\nexport { tech_llm_integration_DocBlocks };"],"mappings":";;;AAGA,MAAM,iCAAiC;CACtC;EACC,IAAI;EACJ,OAAO;EACP,SAAS;EACT,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM;GACL;GACA;GACA;GACA;GACA;GACA;EACD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyFN;CACD;EACC,IAAI;EACJ,OAAO;EACP,SAAS;EACT,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM;GACL;GACA;GACA;GACA;EACD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkEN;CACD;EACC,IAAI;EACJ,OAAO;EACP,SAAS;EACT,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM;GACL;GACA;GACA;GACA;GACA;GACA;EACD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0DN;CACD;EACC,IAAI;EACJ,OAAO;EACP,SAAS;EACT,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM;GACL;GACA;GACA;GACA;GACA;EACD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+EN;CACD;AACD,kBAAkB,+BAA+B"}
|
|
1
|
+
{"version":3,"file":"llm-integration.docblock.js","names":[],"sources":["../../../../../../../../../libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js"],"sourcesContent":["import { registerDocBlocks } from \"../../registry.js\";\n\n//#region src/docs/tech/llm/llm-integration.docblock.ts\nconst tech_llm_integration_DocBlocks = [\n\t{\n\t\tid: \"docs.tech.llm.overview\",\n\t\ttitle: \"LLM Integration Overview\",\n\t\tsummary: \"Export specs to LLM-friendly formats, generate implementation guides, and verify implementations.\",\n\t\tkind: \"reference\",\n\t\tvisibility: \"public\",\n\t\troute: \"/docs/tech/llm/overview\",\n\t\ttags: [\n\t\t\t\"llm\",\n\t\t\t\"ai\",\n\t\t\t\"export\",\n\t\t\t\"guide\",\n\t\t\t\"verify\"\n\t\t],\n\t\tbody: `# LLM Integration\n\nContractSpec provides first-class LLM integration to bridge specifications and AI coding agents.\n\n## Core Features\n\n### 1. Multi-Format Export\n\nExport specs to markdown in formats optimized for LLM consumption:\n\n- **Context format**: Summary for understanding (goal, context, acceptance criteria)\n- **Full format**: Complete spec with all details (I/O schemas, policy, events)\n- **Prompt format**: Actionable prompt with implementation instructions\n\n### 2. Implementation Guidance\n\nGenerate agent-specific implementation plans:\n\n- **Claude Code**: Extended thinking mode with structured prompts\n- **Cursor CLI**: Background/composer mode with .mdc rules generation\n- **Generic MCP**: Standard format for any MCP-compatible agent\n\n### 3. Tiered Verification\n\nVerify implementations against specs:\n\n- **Tier 1 (Structure)**: Types, exports, imports validation\n- **Tier 2 (Behavior)**: Scenario coverage, error handling, events\n- **Tier 3 (AI Review)**: Semantic compliance analysis via LLM\n\n## Access Points\n\n| Surface | Commands/Tools |\n|---------|---------------|\n| CLI | \\`contractspec llm export\\`, \\`guide\\`, \\`verify\\`, \\`copy\\` |\n| MCP | \\`llm.export\\`, \\`llm.guide\\`, \\`llm.verify\\` tools |\n| VSCode | Export to LLM, Generate Guide, Verify, Copy commands |\n\n## Quick Start\n\n### CLI Usage\n\n\\`\\`\\`bash\n# Export spec as markdown\ncontractspec llm export path/to/my.spec.ts --format full\n\n# Generate implementation guide\ncontractspec llm guide path/to/my.spec.ts --agent claude-code\n\n# Verify implementation\ncontractspec llm verify path/to/my.spec.ts path/to/impl.ts --tier 2\n\n# Copy spec to clipboard\ncontractspec llm copy path/to/my.spec.ts --format context\n\\`\\`\\`\n\n### MCP Usage\n\n\\`\\`\\`\n# Export spec\nllm.export { specPath: \"path/to/my.spec.ts\", format: \"full\" }\n\n# Generate guide\nllm.guide { specPath: \"path/to/my.spec.ts\", agent: \"cursor-cli\" }\n\n# Verify implementation\nllm.verify { specPath: \"path/to/my.spec.ts\", implementationPath: \"path/to/impl.ts\", tier: \"2\" }\n\\`\\`\\`\n\n### Programmatic Usage\n\n\\`\\`\\`typescript\nimport { operationSpecToFullMarkdown, operationSpecToAgentPrompt } from '@lssm/lib.contracts/llm';\nimport { createAgentGuideService, createVerifyService } from '@lssm/bundle.contractspec-workspace';\n\n// Export\nconst markdown = operationSpecToFullMarkdown(mySpec);\n\n// Generate guide\nconst guideService = createAgentGuideService({ defaultAgent: 'claude-code' });\nconst guide = guideService.generateGuide(mySpec);\n\n// Verify\nconst verifyService = createVerifyService();\nconst result = await verifyService.verify(mySpec, implementationCode, {\n tiers: ['structure', 'behavior']\n});\n\\`\\`\\`\n`\n\t},\n\t{\n\t\tid: \"docs.tech.llm.export-formats\",\n\t\ttitle: \"LLM Export Formats\",\n\t\tsummary: \"Detailed explanation of the three export formats for LLM consumption.\",\n\t\tkind: \"reference\",\n\t\tvisibility: \"public\",\n\t\troute: \"/docs/tech/llm/export-formats\",\n\t\ttags: [\n\t\t\t\"llm\",\n\t\t\t\"export\",\n\t\t\t\"markdown\"\n\t\t],\n\t\tbody: `# LLM Export Formats\n\nContractSpec provides three export formats optimized for different LLM use cases.\n\n## Context Format\n\nBest for: Understanding what a spec does, providing background to LLMs.\n\nIncludes:\n- Spec name, version, type\n- Goal and context\n- Description\n- Acceptance scenarios\n\nExample:\n\n\\`\\`\\`markdown\n# users.createUser (v1)\n\n> Create a new user account with email verification.\n\n**Type:** command | **Stability:** stable\n\n## Goal\nCreate a new user in the system and trigger email verification.\n\n## Context\nPart of the user onboarding flow. Called after signup form submission.\n\n## Acceptance Criteria\n### Happy path\n**Given:** Valid email and password\n**When:** User submits registration\n**Then:** Account is created, verification email is sent\n\\`\\`\\`\n\n## Full Format\n\nBest for: Complete documentation, implementation reference.\n\nIncludes everything:\n- All metadata\n- JSON schemas for I/O\n- Error definitions\n- Policy (auth, rate limits, PII)\n- Events emitted\n- Examples\n- Transport configuration\n\n## Prompt Format\n\nBest for: Feeding directly to coding agents.\n\nIncludes:\n- Task header with clear instructions\n- Full spec context\n- Implementation requirements\n- Task-specific guidance (implement/test/refactor/review)\n- Expected output format\n\nThe prompt format adapts based on task type:\n- **implement**: Full implementation with tests\n- **test**: Test generation for existing code\n- **refactor**: Refactoring while maintaining behavior\n- **review**: Code review against spec\n`\n\t},\n\t{\n\t\tid: \"docs.tech.llm.agent-adapters\",\n\t\ttitle: \"Agent Adapters\",\n\t\tsummary: \"Adapters for different AI coding agents (Claude, Cursor, MCP).\",\n\t\tkind: \"reference\",\n\t\tvisibility: \"public\",\n\t\troute: \"/docs/tech/llm/agent-adapters\",\n\t\ttags: [\n\t\t\t\"llm\",\n\t\t\t\"agents\",\n\t\t\t\"claude\",\n\t\t\t\"cursor\",\n\t\t\t\"mcp\"\n\t\t],\n\t\tbody: `# Agent Adapters\n\nContractSpec provides specialized adapters for different AI coding agents.\n\n## Claude Code Adapter\n\nOptimized for Anthropic Claude's extended thinking and code generation.\n\nFeatures:\n- Structured markdown with clear sections\n- Checklists for steps and verification\n- Icons for file operations (📝 create, ✏️ modify)\n- System prompt for ContractSpec context\n\nUsage:\n\\`\\`\\`typescript\nconst guideService = createAgentGuideService({ defaultAgent: 'claude-code' });\nconst result = guideService.generateGuide(spec, { agent: 'claude-code' });\n// result.prompt.systemPrompt - Claude system context\n// result.prompt.taskPrompt - Task-specific instructions\n\\`\\`\\`\n\n## Cursor CLI Adapter\n\nOptimized for Cursor's background/composer mode.\n\nFeatures:\n- Compact format for context efficiency\n- .mdc cursor rules generation\n- Integration with Cursor's file system\n- Concise step lists\n\nGenerate Cursor Rules:\n\\`\\`\\`typescript\nconst cursorRules = guideService.generateAgentConfig(spec, 'cursor-cli');\n// Save to .cursor/rules/my-spec.mdc\n\\`\\`\\`\n\n## Generic MCP Adapter\n\nWorks with any MCP-compatible agent (Cline, Aider, etc.).\n\nFeatures:\n- Standard markdown format\n- Table-based metadata\n- JSON resource format support\n- Prompt message format\n\nThe generic adapter is the default and works across all agents.\n\n## Choosing an Adapter\n\n| Agent | Best For | Key Features |\n|-------|----------|--------------|\n| Claude Code | Complex implementations | Extended thinking, detailed steps |\n| Cursor CLI | IDE-integrated work | Cursor rules, compact format |\n| Generic MCP | Any MCP agent | Universal compatibility |\n`\n\t},\n\t{\n\t\tid: \"docs.tech.llm.verification\",\n\t\ttitle: \"Implementation Verification\",\n\t\tsummary: \"Tiered verification of implementations against specifications.\",\n\t\tkind: \"reference\",\n\t\tvisibility: \"public\",\n\t\troute: \"/docs/tech/llm/verification\",\n\t\ttags: [\n\t\t\t\"llm\",\n\t\t\t\"verify\",\n\t\t\t\"validation\",\n\t\t\t\"testing\"\n\t\t],\n\t\tbody: `# Implementation Verification\n\nContractSpec provides tiered verification to check if implementations comply with specs.\n\n## Verification Tiers\n\n### Tier 1: Structure (Fast)\n\nChecks TypeScript structure against spec requirements:\n\n| Check | What it validates |\n|-------|------------------|\n| Handler export | Function is properly exported |\n| Contracts import | Imports from @lssm/lib.contracts |\n| Schema import | Imports from @lssm/lib.schema |\n| No \\`any\\` type | TypeScript strict compliance |\n| Error handling | Error codes are referenced |\n| Event emission | Event patterns exist |\n| Input validation | Validation patterns used |\n| Async patterns | Async/await for commands |\n\n### Tier 2: Behavior (Comprehensive)\n\nChecks implementation coverage of spec behaviors:\n\n| Check | What it validates |\n|-------|------------------|\n| Scenario coverage | Acceptance scenarios implemented |\n| Example coverage | Example I/O values referenced |\n| Error cases | All error conditions handled |\n| Event conditions | Events emitted correctly |\n| Idempotency | Idempotent patterns (if required) |\n\n### Tier 3: AI Review (Deep)\n\nUses LLM for semantic analysis:\n\n- Does the implementation fulfill the spec's intent?\n- Are edge cases properly handled?\n- Is the code quality acceptable?\n- Are there any subtle violations?\n\nRequires AI API key configuration.\n\n## Running Verification\n\n\\`\\`\\`typescript\nconst verifyService = createVerifyService({\n aiApiKey: process.env.ANTHROPIC_API_KEY, // Optional, for Tier 3\n aiProvider: 'anthropic',\n});\n\nconst result = await verifyService.verify(spec, implementationCode, {\n tiers: ['structure', 'behavior'],\n failFast: false,\n includeSuggestions: true,\n});\n\nconsole.log(result.passed); // true/false\nconsole.log(result.score); // 0-100\nconsole.log(result.summary); // Human-readable summary\n\\`\\`\\`\n\n## Verification Report\n\nThe report includes:\n\n- **passed**: Overall compliance\n- **score**: 0-100 score\n- **issues**: Array of problems found\n- **suggestions**: Recommended fixes\n- **coverage**: Metrics on scenario/error/field coverage\n\nEach issue has:\n- **severity**: error, warning, or info\n- **category**: type, export, import, scenario, error_handling, semantic\n- **message**: Description of the issue\n- **suggestion**: How to fix it\n`\n\t}\n];\nregisterDocBlocks(tech_llm_integration_DocBlocks);\n\n//#endregion\nexport { tech_llm_integration_DocBlocks };"],"mappings":";;;AAGA,MAAM,iCAAiC;CACtC;EACC,IAAI;EACJ,OAAO;EACP,SAAS;EACT,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM;GACL;GACA;GACA;GACA;GACA;GACA;EACD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyFN;CACD;EACC,IAAI;EACJ,OAAO;EACP,SAAS;EACT,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM;GACL;GACA;GACA;GACA;EACD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkEN;CACD;EACC,IAAI;EACJ,OAAO;EACP,SAAS;EACT,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM;GACL;GACA;GACA;GACA;GACA;GACA;EACD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0DN;CACD;EACC,IAAI;EACJ,OAAO;EACP,SAAS;EACT,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM;GACL;GACA;GACA;GACA;GACA;EACD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+EN;CACD;AACD,kBAAkB,+BAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../registry-utils.js";
|