@lssm/bundle.contractspec-workspace 0.0.0-canary-20251217083314 → 1.41.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/rolldown_runtime.js +1 -22
- package/dist/adapters/ai.js +1 -82
- package/dist/adapters/factory.js +1 -36
- package/dist/adapters/fs.js +1 -118
- package/dist/adapters/git.js +1 -54
- package/dist/adapters/index.js +1 -7
- package/dist/adapters/logger.js +1 -80
- package/dist/adapters/watcher.js +1 -69
- package/dist/adapters/workspace.js +2 -190
- package/dist/ai/agents/claude-code-agent.js +9 -146
- package/dist/ai/agents/cursor-agent.js +17 -286
- package/dist/ai/agents/index.js +1 -5
- package/dist/ai/agents/openai-codex-agent.js +8 -140
- package/dist/ai/agents/orchestrator.js +1 -142
- package/dist/ai/agents/simple-agent.js +4 -80
- package/dist/ai/client.js +1 -162
- package/dist/ai/index.js +1 -27
- package/dist/ai/prompts/code-generation.js +13 -55
- package/dist/ai/prompts/index.js +1 -12
- package/dist/ai/prompts/spec-creation.js +20 -61
- package/dist/ai/providers.js +1 -40
- package/dist/formatters/index.js +1 -18
- package/dist/formatters/json.js +1 -71
- package/dist/formatters/sarif.js +1 -163
- package/dist/formatters/text.js +2 -208
- package/dist/index.js +1 -81
- package/dist/services/agent-guide/adapters/claude-code.js +3 -144
- package/dist/services/agent-guide/adapters/cursor-cli.js +3 -135
- package/dist/services/agent-guide/adapters/generic-mcp.js +3 -159
- package/dist/services/agent-guide/adapters/index.js +1 -30
- package/dist/services/agent-guide/agent-guide-service.js +1 -148
- package/dist/services/agent-guide/index.js +1 -5
- package/dist/services/build.js +1 -140
- package/dist/services/ci-check/ci-check-service.js +1 -393
- package/dist/services/ci-check/index.js +1 -2
- package/dist/services/ci-check/types.js +1 -28
- package/dist/services/clean.js +1 -71
- package/dist/services/config.js +1 -76
- package/dist/services/deps.js +1 -62
- package/dist/services/diff.js +1 -33
- package/dist/services/doctor/checks/ai.js +2 -118
- package/dist/services/doctor/checks/cli.js +1 -146
- package/dist/services/doctor/checks/config.js +1 -170
- package/dist/services/doctor/checks/deps.js +1 -180
- package/dist/services/doctor/checks/index.js +1 -6
- package/dist/services/doctor/checks/mcp.js +1 -144
- package/dist/services/doctor/checks/workspace.js +1 -243
- package/dist/services/doctor/doctor-service.js +2 -115
- package/dist/services/doctor/index.js +1 -2
- package/dist/services/doctor/types.js +1 -26
- package/dist/services/implementation/discovery.js +2 -143
- package/dist/services/implementation/index.js +1 -2
- package/dist/services/implementation/resolver.js +1 -223
- package/dist/services/index.js +1 -53
- package/dist/services/integrity-diagram.js +6 -274
- package/dist/services/integrity.js +1 -272
- package/dist/services/list.js +1 -35
- package/dist/services/openapi/export-service.js +2 -51
- package/dist/services/openapi/import-service.js +1 -75
- package/dist/services/openapi/index.js +1 -4
- package/dist/services/openapi/sync-service.js +1 -121
- package/dist/services/openapi/validate-service.js +1 -130
- package/dist/services/regenerator.js +1 -23
- package/dist/services/registry.js +1 -73
- package/dist/services/setup/config-generators.js +26 -113
- package/dist/services/setup/file-merger.js +2 -60
- package/dist/services/setup/index.js +1 -4
- package/dist/services/setup/setup-service.js +1 -95
- package/dist/services/setup/targets/agents-md.js +1 -46
- package/dist/services/setup/targets/cli-config.js +1 -59
- package/dist/services/setup/targets/cursor-rules.js +1 -47
- package/dist/services/setup/targets/mcp-claude.js +1 -59
- package/dist/services/setup/targets/mcp-cursor.js +1 -58
- package/dist/services/setup/targets/vscode-settings.js +1 -62
- package/dist/services/setup/types.js +1 -26
- package/dist/services/sync.js +1 -62
- package/dist/services/test.js +1 -30
- package/dist/services/validate-implementation.js +1 -69
- package/dist/services/validate.js +1 -47
- package/dist/services/verification-cache/adapters/filesystem.js +1 -121
- package/dist/services/verification-cache/adapters/in-memory.js +1 -45
- package/dist/services/verification-cache/adapters/index.js +1 -3
- package/dist/services/verification-cache/adapters/workspace-state.js +1 -90
- package/dist/services/verification-cache/cache-service.js +1 -255
- package/dist/services/verification-cache/index.js +1 -6
- package/dist/services/verification-cache/types.js +1 -15
- package/dist/services/verify/ai-verifier.js +9 -336
- package/dist/services/verify/behavior-verifier.js +1 -185
- package/dist/services/verify/index.js +1 -4
- package/dist/services/verify/structure-verifier.js +2 -195
- package/dist/services/verify/verify-service.js +3 -203
- package/dist/services/watch.js +1 -31
- package/dist/services/workspace-info.js +2 -102
- package/dist/templates/app-config.template.js +28 -101
- package/dist/templates/data-view.template.js +27 -42
- package/dist/templates/event.template.js +14 -29
- package/dist/templates/experiment.template.js +51 -77
- package/dist/templates/handler.template.js +17 -53
- package/dist/templates/index.js +1 -36
- package/dist/templates/integration.template.js +50 -134
- package/dist/templates/knowledge.template.js +21 -62
- package/dist/templates/migration.template.js +26 -50
- package/dist/templates/operation.template.js +28 -44
- package/dist/templates/presentation.template.js +20 -46
- package/dist/templates/telemetry.template.js +53 -74
- package/dist/templates/workflow-runner.template.js +6 -12
- package/dist/templates/workflow.template.js +24 -51
- package/package.json +10 -15
- package/dist/adapters/ai.d.ts +0 -11
- package/dist/adapters/factory.d.ts +0 -28
- package/dist/adapters/fs.d.ts +0 -10
- package/dist/adapters/git.d.ts +0 -10
- package/dist/adapters/logger.d.ts +0 -17
- package/dist/adapters/watcher.d.ts +0 -10
- package/dist/adapters/workspace.d.ts +0 -93
- package/dist/ai/agents/claude-code-agent.d.ts +0 -21
- package/dist/ai/agents/cursor-agent.d.ts +0 -67
- package/dist/ai/agents/openai-codex-agent.d.ts +0 -21
- package/dist/ai/agents/orchestrator.d.ts +0 -49
- package/dist/ai/agents/simple-agent.d.ts +0 -16
- package/dist/ai/agents/types.d.ts +0 -35
- package/dist/ai/client.d.ts +0 -82
- package/dist/ai/index.d.ts +0 -16
- package/dist/ai/prompts/code-generation.d.ts +0 -25
- package/dist/ai/prompts/index.d.ts +0 -9
- package/dist/ai/prompts/spec-creation.d.ts +0 -28
- package/dist/ai/providers.d.ts +0 -28
- package/dist/formatters/index.d.ts +0 -10
- package/dist/formatters/json.d.ts +0 -88
- package/dist/formatters/sarif.d.ts +0 -100
- package/dist/formatters/text.d.ts +0 -34
- package/dist/index.d.ts +0 -66
- package/dist/libs/ai-providers/dist/factory.js +0 -154
- package/dist/libs/ai-providers/dist/index.js +0 -4
- package/dist/libs/ai-providers/dist/legacy.js +0 -72
- package/dist/libs/ai-providers/dist/models.js +0 -287
- package/dist/libs/ai-providers/dist/validation.js +0 -1
- package/dist/libs/contracts/dist/capabilities/openbanking.js +0 -88
- package/dist/libs/contracts/dist/client/index.js +0 -5
- package/dist/libs/contracts/dist/client/react/feature-render.js +0 -2
- package/dist/libs/contracts/dist/client/react/form-render.js +0 -4
- package/dist/libs/contracts/dist/client/react/index.js +0 -4
- package/dist/libs/contracts/dist/contract-registry/index.js +0 -1
- package/dist/libs/contracts/dist/contract-registry/schemas.js +0 -60
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/index.js +0 -29
- package/dist/libs/contracts/dist/docs/presentations.js +0 -71
- package/dist/libs/contracts/dist/docs/registry.js +0 -44
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
- package/dist/libs/contracts/dist/events.js +0 -8
- package/dist/libs/contracts/dist/experiments/evaluator.js +0 -1
- package/dist/libs/contracts/dist/index.js +0 -72
- package/dist/libs/contracts/dist/install.js +0 -2
- package/dist/libs/contracts/dist/integrations/contracts.js +0 -377
- package/dist/libs/contracts/dist/integrations/index.js +0 -18
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +0 -242
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +0 -13
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +0 -52
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +0 -75
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +0 -87
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +0 -66
- package/dist/libs/contracts/dist/integrations/providers/index.js +0 -11
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +0 -68
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +0 -68
- package/dist/libs/contracts/dist/integrations/providers/powens.js +0 -116
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +0 -73
- package/dist/libs/contracts/dist/integrations/providers/registry.js +0 -10
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +0 -83
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +0 -61
- package/dist/libs/contracts/dist/jsonschema.js +0 -24
- package/dist/libs/contracts/dist/knowledge/contracts.js +0 -306
- package/dist/libs/contracts/dist/knowledge/index.js +0 -7
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
- package/dist/libs/contracts/dist/knowledge/spaces/index.js +0 -6
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +0 -37
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
- package/dist/libs/contracts/dist/llm/exporters.js +0 -352
- package/dist/libs/contracts/dist/llm/index.js +0 -2
- package/dist/libs/contracts/dist/llm/prompts.js +0 -211
- package/dist/libs/contracts/dist/onboarding-base.js +0 -196
- package/dist/libs/contracts/dist/openapi.js +0 -75
- package/dist/libs/contracts/dist/ownership.js +0 -21
- package/dist/libs/contracts/dist/presentations.js +0 -1
- package/dist/libs/contracts/dist/presentations.v2.js +0 -11
- package/dist/libs/contracts/dist/prompt.js +0 -1
- package/dist/libs/contracts/dist/promptRegistry.js +0 -1
- package/dist/libs/contracts/dist/regenerator/index.js +0 -2
- package/dist/libs/contracts/dist/regenerator/service.js +0 -92
- package/dist/libs/contracts/dist/regenerator/utils.js +0 -51
- package/dist/libs/contracts/dist/registry.js +0 -208
- package/dist/libs/contracts/dist/resources.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -2
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -49
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -34
- package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -2
- package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/index.js +0 -6
- package/dist/libs/contracts/dist/server/graphql-pothos.js +0 -6
- package/dist/libs/contracts/dist/server/index.js +0 -8
- package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +0 -4
- package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +0 -2
- package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +0 -1
- package/dist/libs/contracts/dist/server/mcp/registerResources.js +0 -2
- package/dist/libs/contracts/dist/server/mcp/registerTools.js +0 -1
- package/dist/libs/contracts/dist/server/provider-mcp.js +0 -1
- package/dist/libs/contracts/dist/server/rest-elysia.js +0 -1
- package/dist/libs/contracts/dist/server/rest-express.js +0 -1
- package/dist/libs/contracts/dist/server/rest-generic.js +0 -1
- package/dist/libs/contracts/dist/server/rest-next-app.js +0 -1
- package/dist/libs/contracts/dist/server/rest-next-pages.js +0 -1
- package/dist/libs/contracts/dist/spec.js +0 -35
- package/dist/libs/contracts/dist/telemetry/index.js +0 -1
- package/dist/libs/contracts/dist/telemetry/tracker.js +0 -1
- package/dist/libs/contracts/dist/tests/index.js +0 -1
- package/dist/libs/contracts/dist/tests/runner.js +0 -150
- package/dist/libs/contracts/dist/workflow/index.js +0 -1
- package/dist/libs/contracts/dist/workflow/runner.js +0 -1
- package/dist/libs/contracts-transformers/dist/common/utils.js +0 -47
- package/dist/libs/contracts-transformers/dist/openapi/exporter.js +0 -1
- package/dist/libs/contracts-transformers/dist/openapi/importer.js +0 -255
- package/dist/libs/contracts-transformers/dist/openapi/index.js +0 -4
- package/dist/libs/contracts-transformers/dist/openapi/parser.js +0 -231
- package/dist/libs/contracts-transformers/dist/openapi/schema-converter.js +0 -201
- package/dist/modules/contractspec-workspace/dist/ai/code-generation.js +0 -137
- package/dist/modules/contractspec-workspace/dist/ai/spec-creation.js +0 -101
- package/dist/modules/contractspec-workspace/dist/analysis/deps/graph.js +0 -84
- package/dist/modules/contractspec-workspace/dist/analysis/deps/parse-imports.js +0 -30
- package/dist/modules/contractspec-workspace/dist/analysis/diff/semantic.js +0 -96
- package/dist/modules/contractspec-workspace/dist/analysis/feature-scan.js +0 -151
- package/dist/modules/contractspec-workspace/dist/analysis/spec-scan.js +0 -344
- package/dist/modules/contractspec-workspace/dist/analysis/validate/spec-structure.js +0 -122
- package/dist/modules/contractspec-workspace/dist/templates/app-config.js +0 -105
- package/dist/modules/contractspec-workspace/dist/templates/data-view.js +0 -68
- package/dist/modules/contractspec-workspace/dist/templates/event.js +0 -38
- package/dist/modules/contractspec-workspace/dist/templates/experiment.js +0 -87
- package/dist/modules/contractspec-workspace/dist/templates/handler.js +0 -95
- package/dist/modules/contractspec-workspace/dist/templates/integration-utils.js +0 -104
- package/dist/modules/contractspec-workspace/dist/templates/integration.js +0 -62
- package/dist/modules/contractspec-workspace/dist/templates/knowledge.js +0 -68
- package/dist/modules/contractspec-workspace/dist/templates/migration.js +0 -60
- package/dist/modules/contractspec-workspace/dist/templates/operation.js +0 -100
- package/dist/modules/contractspec-workspace/dist/templates/presentation.js +0 -78
- package/dist/modules/contractspec-workspace/dist/templates/telemetry.js +0 -89
- package/dist/modules/contractspec-workspace/dist/templates/utils.js +0 -38
- package/dist/modules/contractspec-workspace/dist/templates/workflow-runner.js +0 -48
- package/dist/modules/contractspec-workspace/dist/templates/workflow.js +0 -67
- package/dist/modules/contractspec-workspace/dist/types/generation-types.js +0 -20
- package/dist/ports/ai.d.ts +0 -58
- package/dist/ports/fs.d.ts +0 -80
- package/dist/ports/git.d.ts +0 -32
- package/dist/ports/logger.d.ts +0 -87
- package/dist/ports/watcher.d.ts +0 -51
- package/dist/services/agent-guide/adapters/claude-code.d.ts +0 -34
- package/dist/services/agent-guide/adapters/cursor-cli.d.ts +0 -38
- package/dist/services/agent-guide/adapters/generic-mcp.d.ts +0 -52
- package/dist/services/agent-guide/adapters/index.d.ts +0 -22
- package/dist/services/agent-guide/agent-guide-service.d.ts +0 -55
- package/dist/services/agent-guide/types.d.ts +0 -57
- package/dist/services/build.d.ts +0 -58
- package/dist/services/ci-check/ci-check-service.d.ts +0 -15
- package/dist/services/ci-check/types.d.ts +0 -142
- package/dist/services/clean.d.ts +0 -40
- package/dist/services/config.d.ts +0 -25
- package/dist/services/deps.d.ts +0 -52
- package/dist/services/diff.d.ts +0 -33
- package/dist/services/doctor/doctor-service.d.ts +0 -23
- package/dist/services/doctor/types.d.ts +0 -117
- package/dist/services/implementation/discovery.d.ts +0 -29
- package/dist/services/implementation/resolver.d.ts +0 -43
- package/dist/services/implementation/types.d.ts +0 -78
- package/dist/services/integrity-diagram.d.ts +0 -35
- package/dist/services/integrity.d.ts +0 -133
- package/dist/services/list.d.ts +0 -30
- package/dist/services/openapi/export-service.d.ts +0 -52
- package/dist/services/openapi/import-service.d.ts +0 -15
- package/dist/services/openapi/sync-service.d.ts +0 -18
- package/dist/services/openapi/types.d.ts +0 -184
- package/dist/services/openapi/validate-service.d.ts +0 -15
- package/dist/services/regenerator.d.ts +0 -17
- package/dist/services/registry.d.ts +0 -52
- package/dist/services/setup/config-generators.d.ts +0 -41
- package/dist/services/setup/file-merger.d.ts +0 -26
- package/dist/services/setup/setup-service.d.ts +0 -11
- package/dist/services/setup/types.d.ts +0 -84
- package/dist/services/sync.d.ts +0 -40
- package/dist/services/test.d.ts +0 -14
- package/dist/services/validate-implementation.d.ts +0 -31
- package/dist/services/validate.d.ts +0 -40
- package/dist/services/verification-cache/adapters/filesystem.d.ts +0 -45
- package/dist/services/verification-cache/adapters/in-memory.d.ts +0 -26
- package/dist/services/verification-cache/adapters/workspace-state.d.ts +0 -48
- package/dist/services/verification-cache/cache-service.d.ts +0 -69
- package/dist/services/verification-cache/types.d.ts +0 -123
- package/dist/services/verify/ai-verifier.d.ts +0 -24
- package/dist/services/verify/behavior-verifier.d.ts +0 -11
- package/dist/services/verify/structure-verifier.d.ts +0 -11
- package/dist/services/verify/types.d.ts +0 -136
- package/dist/services/verify/verify-service.d.ts +0 -59
- package/dist/services/watch.d.ts +0 -24
- package/dist/services/workspace-info.d.ts +0 -61
- package/dist/templates/app-config.template.d.ts +0 -6
- package/dist/templates/data-view.template.d.ts +0 -6
- package/dist/templates/event.template.d.ts +0 -10
- package/dist/templates/experiment.template.d.ts +0 -6
- package/dist/templates/handler.template.d.ts +0 -15
- package/dist/templates/index.d.ts +0 -20
- package/dist/templates/integration.template.d.ts +0 -6
- package/dist/templates/knowledge.template.d.ts +0 -6
- package/dist/templates/migration.template.d.ts +0 -6
- package/dist/templates/operation.template.d.ts +0 -10
- package/dist/templates/presentation.template.d.ts +0 -10
- package/dist/templates/telemetry.template.d.ts +0 -6
- package/dist/templates/workflow-runner.template.d.ts +0 -15
- package/dist/templates/workflow.template.d.ts +0 -6
- package/dist/types/config.d.ts +0 -33
- package/dist/types.d.ts +0 -323
|
@@ -1,159 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const supportedModes = data.supportedModes.length ? data.supportedModes : ["managed"];
|
|
7
|
-
const supportedModesLine = supportedModes.map((mode) => `'${mode}'`).join(", ");
|
|
8
|
-
const provides = data.capabilitiesProvided.map((cap) => ` { key: '${cap.key}', version: ${cap.version} }`).join(",\n");
|
|
9
|
-
const requires = data.capabilitiesRequired.length > 0 ? ` requires: [
|
|
10
|
-
${data.capabilitiesRequired.map((req) => {
|
|
11
|
-
const version = typeof req.version === "number" ? `, version: ${req.version}` : "";
|
|
12
|
-
const optional = req.optional ? ", optional: true" : "";
|
|
13
|
-
const reason = req.reason ? `, reason: '${escape(req.reason)}'` : "";
|
|
14
|
-
return ` { key: '${req.key}'${version}${optional}${reason} }`;
|
|
15
|
-
}).join(",\n")}
|
|
16
|
-
],` : "";
|
|
17
|
-
const configSchema = renderConfigSchema(data.configFields);
|
|
18
|
-
const configExample = renderConfigExample(data.configFields);
|
|
19
|
-
const secretSchema = renderSecretSchema(data.secretFields);
|
|
20
|
-
const secretExample = renderSecretExample(data.secretFields);
|
|
21
|
-
const docsUrl = data.docsUrl ? ` docsUrl: '${escape(data.docsUrl)}',\n` : "";
|
|
22
|
-
const constraints = renderConstraints(data.rateLimitRpm, data.rateLimitRph);
|
|
23
|
-
const byokSetup = renderByokSetup(supportedModes, data.byokSetupInstructions, data.byokRequiredScopes);
|
|
24
|
-
return `import { StabilityEnum } from '@lssm/lib.contracts/ownership';
|
|
1
|
+
function e(e){let s=l(e.name.split(`.`).pop()??`Integration`),d=`${s}IntegrationSpec`,f=`register${s}Integration`,p=e.supportedModes.length?e.supportedModes:[`managed`],m=p.map(e=>`'${e}'`).join(`, `),h=e.capabilitiesProvided.map(e=>` { key: '${e.key}', version: ${e.version} }`).join(`,
|
|
2
|
+
`),g=e.capabilitiesRequired.length>0?` requires: [
|
|
3
|
+
${e.capabilitiesRequired.map(e=>{let t=typeof e.version==`number`?`, version: ${e.version}`:``,n=e.optional?`, optional: true`:``,r=e.reason?`, reason: '${u(e.reason)}'`:``;return` { key: '${e.key}'${t}${n}${r} }`}).join(`,
|
|
4
|
+
`)}
|
|
5
|
+
],`:``,_=t(e.configFields),v=r(e.configFields),y=n(e.secretFields),b=i(e.secretFields),x=e.docsUrl?` docsUrl: '${u(e.docsUrl)}',\n`:``,S=a(e.rateLimitRpm,e.rateLimitRph),C=o(p,e.byokSetupInstructions,e.byokRequiredScopes);return`import { StabilityEnum } from '@lssm/lib.contracts/ownership';
|
|
25
6
|
import type { IntegrationSpec } from '@lssm/lib.contracts/integrations/spec';
|
|
26
7
|
import type { IntegrationSpecRegistry } from '@lssm/lib.contracts/integrations/spec';
|
|
27
8
|
|
|
28
|
-
export const ${
|
|
9
|
+
export const ${d}: IntegrationSpec = {
|
|
29
10
|
meta: {
|
|
30
|
-
key: '${
|
|
31
|
-
version: ${
|
|
32
|
-
category: '${
|
|
33
|
-
displayName: '${
|
|
34
|
-
title: '${
|
|
35
|
-
description: '${
|
|
36
|
-
domain: '${
|
|
37
|
-
owners: [${
|
|
38
|
-
tags: [${
|
|
39
|
-
stability: StabilityEnum.${
|
|
11
|
+
key: '${e.name}',
|
|
12
|
+
version: ${e.version},
|
|
13
|
+
category: '${e.category}',
|
|
14
|
+
displayName: '${u(e.displayName)}',
|
|
15
|
+
title: '${u(e.title)}',
|
|
16
|
+
description: '${u(e.description)}',
|
|
17
|
+
domain: '${u(e.domain)}',
|
|
18
|
+
owners: [${e.owners.map(e=>`'${u(e)}'`).join(`, `)}],
|
|
19
|
+
tags: [${e.tags.map(e=>`'${u(e)}'`).join(`, `)}],
|
|
20
|
+
stability: StabilityEnum.${c(e.stability)},
|
|
40
21
|
},
|
|
41
|
-
supportedModes: [${
|
|
22
|
+
supportedModes: [${m}],
|
|
42
23
|
capabilities: {
|
|
43
24
|
provides: [
|
|
44
|
-
${
|
|
25
|
+
${h}
|
|
45
26
|
],
|
|
46
|
-
${
|
|
27
|
+
${g.length>0?`${g}\n`:``} },
|
|
47
28
|
configSchema: {
|
|
48
|
-
${
|
|
49
|
-
example: ${
|
|
29
|
+
${_}
|
|
30
|
+
example: ${v},
|
|
50
31
|
},
|
|
51
32
|
secretSchema: {
|
|
52
|
-
${
|
|
53
|
-
example: ${
|
|
33
|
+
${y}
|
|
34
|
+
example: ${b},
|
|
54
35
|
},
|
|
55
|
-
${
|
|
56
|
-
method: '${
|
|
57
|
-
timeoutMs: ${
|
|
36
|
+
${x}${S}${C} healthCheck: {
|
|
37
|
+
method: '${e.healthCheckMethod}',
|
|
38
|
+
timeoutMs: ${e.healthCheckTimeoutMs},
|
|
58
39
|
},
|
|
59
40
|
};
|
|
60
41
|
|
|
61
|
-
export function ${
|
|
42
|
+
export function ${f}(
|
|
62
43
|
registry: IntegrationSpecRegistry
|
|
63
44
|
): IntegrationSpecRegistry {
|
|
64
|
-
return registry.register(${
|
|
45
|
+
return registry.register(${d});
|
|
65
46
|
}
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
function renderConfigSchema(fields) {
|
|
69
|
-
const requiredFields = fields.filter((field) => field.required);
|
|
70
|
-
return ` schema: {
|
|
47
|
+
`}function t(e){let t=e.filter(e=>e.required);return` schema: {
|
|
71
48
|
type: 'object',
|
|
72
|
-
${
|
|
73
|
-
|
|
74
|
-
${(
|
|
75
|
-
|
|
76
|
-
return ` ${field.key}: { type: '${mapConfigType(field.type)}'${description} }`;
|
|
77
|
-
}).join(",\n") : "") || " "}
|
|
49
|
+
${t.length>0?` required: [${t.map(e=>`'${e.key}'`).join(`, `)}],
|
|
50
|
+
`:``} properties: {
|
|
51
|
+
${(e.length?e.map(e=>{let t=e.description?`, description: '${u(e.description)}'`:``;return` ${e.key}: { type: '${s(e.type)}'${t} }`}).join(`,
|
|
52
|
+
`):``)||` `}
|
|
78
53
|
},
|
|
79
|
-
},\n
|
|
80
|
-
}
|
|
81
|
-
function renderSecretSchema(fields) {
|
|
82
|
-
const requiredFields = fields.filter((field) => field.required);
|
|
83
|
-
return ` schema: {
|
|
54
|
+
},\n`}function n(e){let t=e.filter(e=>e.required);return` schema: {
|
|
84
55
|
type: 'object',
|
|
85
|
-
${
|
|
86
|
-
|
|
87
|
-
${(
|
|
88
|
-
|
|
89
|
-
return ` ${field.key}: { type: 'string'${description} }`;
|
|
90
|
-
}).join(",\n") : "") || " "}
|
|
56
|
+
${t.length>0?` required: [${t.map(e=>`'${e.key}'`).join(`, `)}],
|
|
57
|
+
`:``} properties: {
|
|
58
|
+
${(e.length?e.map(e=>{let t=e.description?`, description: '${u(e.description)}'`:``;return` ${e.key}: { type: 'string'${t} }`}).join(`,
|
|
59
|
+
`):``)||` `}
|
|
91
60
|
},
|
|
92
|
-
},\n
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
case "number": return ` ${field.key}: 0`;
|
|
100
|
-
case "boolean": return ` ${field.key}: true`;
|
|
101
|
-
case "string":
|
|
102
|
-
default: return ` ${field.key}: '${field.key.toUpperCase()}_VALUE'`;
|
|
103
|
-
}
|
|
104
|
-
}).join(",\n")}
|
|
105
|
-
}`;
|
|
106
|
-
}
|
|
107
|
-
function renderSecretExample(fields) {
|
|
108
|
-
if (fields.length === 0) return `{}`;
|
|
109
|
-
return `{
|
|
110
|
-
${fields.map((field) => ` ${field.key}: '${field.key.toUpperCase()}_SECRET'`).join(",\n")}
|
|
111
|
-
}`;
|
|
112
|
-
}
|
|
113
|
-
function renderConstraints(rpm, rph) {
|
|
114
|
-
if (rpm == null && rph == null) return "";
|
|
115
|
-
const entries = [];
|
|
116
|
-
if (rpm != null) entries.push(` rpm: ${rpm}`);
|
|
117
|
-
if (rph != null) entries.push(` rph: ${rph}`);
|
|
118
|
-
return ` constraints: {
|
|
61
|
+
},\n`}function r(e){return e.length===0?`{}`:`{
|
|
62
|
+
${e.map(e=>{switch(e.type){case`number`:return` ${e.key}: 0`;case`boolean`:return` ${e.key}: true`;case`string`:default:return` ${e.key}: '${e.key.toUpperCase()}_VALUE'`}}).join(`,
|
|
63
|
+
`)}
|
|
64
|
+
}`}function i(e){return e.length===0?`{}`:`{
|
|
65
|
+
${e.map(e=>` ${e.key}: '${e.key.toUpperCase()}_SECRET'`).join(`,
|
|
66
|
+
`)}
|
|
67
|
+
}`}function a(e,t){if(e==null&&t==null)return``;let n=[];return e!=null&&n.push(` rpm: ${e}`),t!=null&&n.push(` rph: ${t}`),` constraints: {
|
|
119
68
|
rateLimit: {
|
|
120
|
-
${
|
|
69
|
+
${n.join(`,
|
|
70
|
+
`)}
|
|
121
71
|
},
|
|
122
72
|
},
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
function
|
|
126
|
-
if (!modes.includes("byok")) return "";
|
|
127
|
-
const instructionsLine = instructions ? ` setupInstructions: '${escape(instructions)}',\n` : "";
|
|
128
|
-
const scopesLine = scopes && scopes.length ? ` requiredScopes: [${scopes.map((scope) => `'${escape(scope)}'`).join(", ")}],\n` : "";
|
|
129
|
-
if (!instructionsLine && !scopesLine) return "";
|
|
130
|
-
return ` byokSetup: {
|
|
131
|
-
${instructionsLine}${scopesLine} },
|
|
132
|
-
`;
|
|
133
|
-
}
|
|
134
|
-
function mapConfigType(type) {
|
|
135
|
-
switch (type) {
|
|
136
|
-
case "number": return "number";
|
|
137
|
-
case "boolean": return "boolean";
|
|
138
|
-
case "string":
|
|
139
|
-
default: return "string";
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
function stabilityToEnum(stability) {
|
|
143
|
-
switch (stability) {
|
|
144
|
-
case "beta": return "Beta";
|
|
145
|
-
case "stable": return "Stable";
|
|
146
|
-
case "deprecated": return "Deprecated";
|
|
147
|
-
case "experimental":
|
|
148
|
-
default: return "Experimental";
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
function toPascalCase(value) {
|
|
152
|
-
return value.split(/[-_.]/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
153
|
-
}
|
|
154
|
-
function escape(value) {
|
|
155
|
-
return value.replace(/`/g, "\\`").replace(/'/g, "\\'");
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
//#endregion
|
|
159
|
-
export { generateIntegrationSpec };
|
|
73
|
+
`}function o(e,t,n){if(!e.includes(`byok`))return``;let r=t?` setupInstructions: '${u(t)}',\n`:``,i=n&&n.length?` requiredScopes: [${n.map(e=>`'${u(e)}'`).join(`, `)}],\n`:``;return!r&&!i?``:` byokSetup: {
|
|
74
|
+
${r}${i} },
|
|
75
|
+
`}function s(e){switch(e){case`number`:return`number`;case`boolean`:return`boolean`;case`string`:default:return`string`}}function c(e){switch(e){case`beta`:return`Beta`;case`stable`:return`Stable`;case`deprecated`:return`Deprecated`;case`experimental`:default:return`Experimental`}}function l(e){return e.split(/[-_.]/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function u(e){return e.replace(/`/g,"\\`").replace(/'/g,`\\'`)}export{e as generateIntegrationSpec};
|
|
@@ -1,74 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
function generateKnowledgeSpaceSpec(data) {
|
|
3
|
-
const specName = toPascalCase(data.name.split(".").pop() ?? "KnowledgeSpace");
|
|
4
|
-
const varName = `${specName}KnowledgeSpace`;
|
|
5
|
-
const registerFn = `register${specName}KnowledgeSpace`;
|
|
6
|
-
const retention = renderRetention(data);
|
|
7
|
-
const access = renderAccess(data);
|
|
8
|
-
const indexing = renderIndexing(data);
|
|
9
|
-
const policyComment = data.policyName && !data.policyVersion ? ` // defaults to latest version` : "";
|
|
10
|
-
return `import { StabilityEnum } from '@lssm/lib.contracts/ownership';
|
|
1
|
+
function e(e){let s=a(e.name.split(`.`).pop()??`KnowledgeSpace`),c=`${s}KnowledgeSpace`,l=`register${s}KnowledgeSpace`,u=t(e),d=n(e),f=r(e),p=e.policyName&&!e.policyVersion?` // defaults to latest version`:``;return`import { StabilityEnum } from '@lssm/lib.contracts/ownership';
|
|
11
2
|
import type { KnowledgeSpaceSpec } from '@lssm/lib.contracts/knowledge/spec';
|
|
12
3
|
import type { KnowledgeSpaceRegistry } from '@lssm/lib.contracts/knowledge/spec';
|
|
13
4
|
|
|
14
|
-
export const ${
|
|
5
|
+
export const ${c}: KnowledgeSpaceSpec = {
|
|
15
6
|
meta: {
|
|
16
|
-
key: '${
|
|
17
|
-
version: ${
|
|
18
|
-
category: '${
|
|
19
|
-
displayName: '${
|
|
20
|
-
title: '${
|
|
21
|
-
description: '${
|
|
22
|
-
domain: '${
|
|
23
|
-
owners: [${
|
|
24
|
-
tags: [${
|
|
25
|
-
stability: StabilityEnum.${
|
|
7
|
+
key: '${e.name}',
|
|
8
|
+
version: ${e.version},
|
|
9
|
+
category: '${e.category}',
|
|
10
|
+
displayName: '${o(e.displayName)}',
|
|
11
|
+
title: '${o(e.title)}',
|
|
12
|
+
description: '${o(e.description)}',
|
|
13
|
+
domain: '${o(e.domain)}',
|
|
14
|
+
owners: [${e.owners.map(e=>`'${o(e)}'`).join(`, `)}],
|
|
15
|
+
tags: [${e.tags.map(e=>`'${o(e)}'`).join(`, `)}],
|
|
16
|
+
stability: StabilityEnum.${i(e.stability)},
|
|
26
17
|
},
|
|
27
|
-
retention: ${
|
|
18
|
+
retention: ${u},
|
|
28
19
|
access: {
|
|
29
|
-
${
|
|
30
|
-
${
|
|
20
|
+
${d}${e.policyName?` policy: { name: '${e.policyName}',${e.policyVersion?` version: ${e.policyVersion}`:``} },${p}\n`:``} },
|
|
21
|
+
${f} description: '${o(e.description||e.displayName)}',
|
|
31
22
|
};
|
|
32
23
|
|
|
33
|
-
export function ${
|
|
24
|
+
export function ${l}(
|
|
34
25
|
registry: KnowledgeSpaceRegistry
|
|
35
26
|
): KnowledgeSpaceRegistry {
|
|
36
|
-
return registry.register(${
|
|
27
|
+
return registry.register(${c});
|
|
37
28
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return `{ ttlDays: ${data.retention.ttlDays === null ? "null" : typeof data.retention.ttlDays === "number" ? String(data.retention.ttlDays) : "null"}${typeof data.retention.archiveAfterDays === "number" ? `, archiveAfterDays: ${data.retention.archiveAfterDays}` : ""} }`;
|
|
42
|
-
}
|
|
43
|
-
function renderAccess(data) {
|
|
44
|
-
return `${` trustLevel: '${data.trustLevel}',\n`}${` automationWritable: ${data.automationWritable},\n`}`;
|
|
45
|
-
}
|
|
46
|
-
function renderIndexing(data) {
|
|
47
|
-
const entries = [];
|
|
48
|
-
if (data.embeddingModel) entries.push(` embeddingModel: '${escape(data.embeddingModel)}'`);
|
|
49
|
-
if (typeof data.chunkSize === "number") entries.push(` chunkSize: ${data.chunkSize}`);
|
|
50
|
-
if (data.vectorDbIntegration) entries.push(` vectorDbIntegration: '${escape(data.vectorDbIntegration)}'`);
|
|
51
|
-
if (entries.length === 0) return "";
|
|
52
|
-
return ` indexing: {
|
|
53
|
-
${entries.join(",\n")}
|
|
29
|
+
`}function t(e){return`{ ttlDays: ${e.retention.ttlDays===null?`null`:typeof e.retention.ttlDays==`number`?String(e.retention.ttlDays):`null`}${typeof e.retention.archiveAfterDays==`number`?`, archiveAfterDays: ${e.retention.archiveAfterDays}`:``} }`}function n(e){return`${` trustLevel: '${e.trustLevel}',\n`}${` automationWritable: ${e.automationWritable},\n`}`}function r(e){let t=[];return e.embeddingModel&&t.push(` embeddingModel: '${o(e.embeddingModel)}'`),typeof e.chunkSize==`number`&&t.push(` chunkSize: ${e.chunkSize}`),e.vectorDbIntegration&&t.push(` vectorDbIntegration: '${o(e.vectorDbIntegration)}'`),t.length===0?``:` indexing: {
|
|
30
|
+
${t.join(`,
|
|
31
|
+
`)}
|
|
54
32
|
},
|
|
55
|
-
`;
|
|
56
|
-
}
|
|
57
|
-
function stabilityToEnum(stability) {
|
|
58
|
-
switch (stability) {
|
|
59
|
-
case "beta": return "Beta";
|
|
60
|
-
case "stable": return "Stable";
|
|
61
|
-
case "deprecated": return "Deprecated";
|
|
62
|
-
case "experimental":
|
|
63
|
-
default: return "Experimental";
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
function toPascalCase(value) {
|
|
67
|
-
return value.split(/[-_.]/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
68
|
-
}
|
|
69
|
-
function escape(value) {
|
|
70
|
-
return value.replace(/`/g, "\\`").replace(/'/g, "\\'");
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
//#endregion
|
|
74
|
-
export { generateKnowledgeSpaceSpec };
|
|
33
|
+
`}function i(e){switch(e){case`beta`:return`Beta`;case`stable`:return`Stable`;case`deprecated`:return`Deprecated`;case`experimental`:default:return`Experimental`}}function a(e){return e.split(/[-_.]/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function o(e){return e.replace(/`/g,"\\`").replace(/'/g,`\\'`)}export{e as generateKnowledgeSpaceSpec};
|
|
@@ -1,61 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
function generateMigrationSpec(data) {
|
|
3
|
-
const migrationVar = `${toPascalCase(data.name.split(".").pop() ?? "Migration")}Migration`;
|
|
4
|
-
const dependencies = data.dependencies.length > 0 ? `dependencies: [${data.dependencies.map((dep) => `'${dep}'`).join(", ")}],` : "";
|
|
5
|
-
return `import type { MigrationSpec } from '@lssm/lib.contracts/migrations';
|
|
1
|
+
function e(e){let i=`${n(e.name.split(`.`).pop()??`Migration`)}Migration`,a=e.dependencies.length>0?`dependencies: [${e.dependencies.map(e=>`'${e}'`).join(`, `)}],`:``;return`import type { MigrationSpec } from '@lssm/lib.contracts/migrations';
|
|
6
2
|
|
|
7
|
-
export const ${
|
|
3
|
+
export const ${i}: MigrationSpec = {
|
|
8
4
|
meta: {
|
|
9
|
-
name: '${
|
|
10
|
-
version: ${
|
|
11
|
-
title: '${
|
|
12
|
-
description: '${
|
|
13
|
-
domain: '${
|
|
14
|
-
owners: [${
|
|
15
|
-
tags: [${
|
|
16
|
-
stability: '${
|
|
5
|
+
name: '${e.name}',
|
|
6
|
+
version: ${e.version},
|
|
7
|
+
title: '${r(e.title)}',
|
|
8
|
+
description: '${r(e.description??``)}',
|
|
9
|
+
domain: '${r(e.domain)}',
|
|
10
|
+
owners: [${e.owners.map(e=>`'${e}'`).join(`, `)}],
|
|
11
|
+
tags: [${e.tags.map(e=>`'${e}'`).join(`, `)}],
|
|
12
|
+
stability: '${e.stability}',
|
|
17
13
|
},
|
|
18
14
|
plan: {
|
|
19
15
|
up: [
|
|
20
|
-
${
|
|
21
|
-
],${
|
|
16
|
+
${t(e.up)}
|
|
17
|
+
],${e.down&&e.down.length?`
|
|
22
18
|
down: [
|
|
23
|
-
${
|
|
24
|
-
]
|
|
19
|
+
${t(e.down)}
|
|
20
|
+
],`:``}
|
|
25
21
|
},
|
|
26
|
-
${
|
|
22
|
+
${a}
|
|
27
23
|
};
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
function renderSteps(steps) {
|
|
31
|
-
return steps.map((step) => {
|
|
32
|
-
const description = step.description ? `description: '${escape(step.description)}',` : "";
|
|
33
|
-
switch (step.kind) {
|
|
34
|
-
case "schema": return ` {
|
|
24
|
+
`}function t(e){return e.map(e=>{let t=e.description?`description: '${r(e.description)}',`:``;switch(e.kind){case`schema`:return` {
|
|
35
25
|
kind: 'schema',
|
|
36
|
-
${
|
|
37
|
-
sql: \`${
|
|
38
|
-
}`;
|
|
39
|
-
case "data": return ` {
|
|
26
|
+
${t}
|
|
27
|
+
sql: \`${r(e.sql??``)}\`,
|
|
28
|
+
}`;case`data`:return` {
|
|
40
29
|
kind: 'data',
|
|
41
|
-
${
|
|
42
|
-
script: \`${
|
|
43
|
-
}`;
|
|
44
|
-
case "validation":
|
|
45
|
-
default: return ` {
|
|
30
|
+
${t}
|
|
31
|
+
script: \`${r(e.script??``)}\`,
|
|
32
|
+
}`;case`validation`:default:return` {
|
|
46
33
|
kind: 'validation',
|
|
47
|
-
${
|
|
48
|
-
assertion: \`${
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
}).join(",\n");
|
|
52
|
-
}
|
|
53
|
-
function toPascalCase(value) {
|
|
54
|
-
return value.split(/[-_.]/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
55
|
-
}
|
|
56
|
-
function escape(value) {
|
|
57
|
-
return value.replace(/`/g, "\\`").replace(/'/g, "\\'");
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
//#endregion
|
|
61
|
-
export { generateMigrationSpec };
|
|
34
|
+
${t}
|
|
35
|
+
assertion: \`${r(e.assertion??``)}\`,
|
|
36
|
+
}`}}).join(`,
|
|
37
|
+
`)}function n(e){return e.split(/[-_.]/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function r(e){return e.replace(/`/g,"\\`").replace(/'/g,`\\'`)}export{e as generateMigrationSpec};
|
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Generate operation spec TypeScript code
|
|
4
|
-
*/
|
|
5
|
-
function generateOperationSpec(data) {
|
|
6
|
-
const { name, version, kind, description, goal, context, stability, owners, tags, auth, flags } = data;
|
|
7
|
-
const specVarName = toPascalCase(name.split(".").pop() || "Unknown") + "Spec";
|
|
8
|
-
const inputSchemaName = specVarName.replace("Spec", "Input");
|
|
9
|
-
const outputSchemaName = specVarName.replace("Spec", "Output");
|
|
10
|
-
return `import { define${capitalize(kind)} } from '@lssm/lib.contracts';
|
|
1
|
+
function e(e){let{name:r,version:i,kind:a,description:o,goal:s,context:c,stability:l,owners:u,tags:d,auth:f,flags:p}=e,m=n(r.split(`.`).pop()||`Unknown`)+`Spec`,h=m.replace(`Spec`,`Input`),g=m.replace(`Spec`,`Output`);return`import { define${t(a)} } from '@lssm/lib.contracts';
|
|
11
2
|
import { ScalarTypeEnum, SchemaModel } from '@lssm/lib.schema';
|
|
12
3
|
|
|
13
4
|
// TODO: Define input schema
|
|
14
|
-
export const ${
|
|
15
|
-
name: '${
|
|
16
|
-
description: 'Input for ${
|
|
5
|
+
export const ${h} = new SchemaModel({
|
|
6
|
+
name: '${h}',
|
|
7
|
+
description: 'Input for ${r}',
|
|
17
8
|
fields: {
|
|
18
9
|
// Add your fields here
|
|
19
10
|
// example: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
@@ -21,30 +12,30 @@ export const ${inputSchemaName} = new SchemaModel({
|
|
|
21
12
|
});
|
|
22
13
|
|
|
23
14
|
// TODO: Define output schema
|
|
24
|
-
export const ${
|
|
25
|
-
name: '${
|
|
26
|
-
description: 'Output for ${
|
|
15
|
+
export const ${g} = new SchemaModel({
|
|
16
|
+
name: '${g}',
|
|
17
|
+
description: 'Output for ${r}',
|
|
27
18
|
fields: {
|
|
28
19
|
// Add your fields here
|
|
29
20
|
ok: { type: ScalarTypeEnum.Boolean(), isOptional: false },
|
|
30
21
|
},
|
|
31
22
|
});
|
|
32
23
|
|
|
33
|
-
export const ${
|
|
24
|
+
export const ${m} = define${t(a)}({
|
|
34
25
|
meta: {
|
|
35
|
-
name: '${
|
|
36
|
-
version: ${
|
|
37
|
-
stability: '${
|
|
38
|
-
owners: [${
|
|
39
|
-
tags: [${
|
|
40
|
-
description: '${
|
|
41
|
-
goal: '${
|
|
42
|
-
context: '${
|
|
26
|
+
name: '${r}',
|
|
27
|
+
version: ${i},
|
|
28
|
+
stability: '${l}',
|
|
29
|
+
owners: [${u.map(e=>`'${e}'`).join(`, `)}],
|
|
30
|
+
tags: [${d.map(e=>`'${e}'`).join(`, `)}],
|
|
31
|
+
description: '${o}',
|
|
32
|
+
goal: '${s}',
|
|
33
|
+
context: '${c}',
|
|
43
34
|
},
|
|
44
35
|
|
|
45
36
|
io: {
|
|
46
|
-
input: ${
|
|
47
|
-
output: ${
|
|
37
|
+
input: ${h},
|
|
38
|
+
output: ${g},
|
|
48
39
|
errors: {
|
|
49
40
|
// Define possible errors
|
|
50
41
|
// EXAMPLE_ERROR: {
|
|
@@ -56,21 +47,24 @@ export const ${specVarName} = define${capitalize(kind)}({
|
|
|
56
47
|
},
|
|
57
48
|
|
|
58
49
|
policy: {
|
|
59
|
-
auth: '${
|
|
60
|
-
${
|
|
50
|
+
auth: '${f}',
|
|
51
|
+
${p.length>0?`flags: [${p.map(e=>`'${e}'`).join(`, `)}],`:`// flags: [],`}
|
|
61
52
|
},
|
|
62
53
|
|
|
63
54
|
sideEffects: {
|
|
64
|
-
${
|
|
55
|
+
${e.emitsEvents?`emits: [
|
|
56
|
+
// Define events to emit
|
|
57
|
+
// { ref: SomeEventSpec, when: 'always' }
|
|
58
|
+
],`:`// emits: [],`}
|
|
65
59
|
analytics: [
|
|
66
60
|
// Define analytics events
|
|
67
61
|
],
|
|
68
62
|
},
|
|
69
63
|
|
|
70
64
|
transport: {
|
|
71
|
-
rest: { method: '${
|
|
72
|
-
gql: { field: '${
|
|
73
|
-
mcp: { toolName: '${
|
|
65
|
+
rest: { method: '${a===`command`?`POST`:`GET`}' },
|
|
66
|
+
gql: { field: '${r.replace(/\./g,`_`)}' },
|
|
67
|
+
mcp: { toolName: '${r}.v${i}' },
|
|
74
68
|
},
|
|
75
69
|
|
|
76
70
|
acceptance: {
|
|
@@ -91,14 +85,4 @@ export const ${specVarName} = define${capitalize(kind)}({
|
|
|
91
85
|
],
|
|
92
86
|
},
|
|
93
87
|
});
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
function capitalize(str) {
|
|
97
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
98
|
-
}
|
|
99
|
-
function toPascalCase(str) {
|
|
100
|
-
return str.split(/[-_.]/).map(capitalize).join("");
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
//#endregion
|
|
104
|
-
export { generateOperationSpec };
|
|
88
|
+
`}function t(e){return e.charAt(0).toUpperCase()+e.slice(1)}function n(e){return e.split(/[-_.]/).map(t).join(``)}export{e as generateOperationSpec};
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Generate presentation spec TypeScript code
|
|
4
|
-
*/
|
|
5
|
-
function generatePresentationSpec(data) {
|
|
6
|
-
const { name, version, description, stability, owners, tags, presentationKind } = data;
|
|
7
|
-
const varName = toPascalCase(name.replace(/\./g, "_")) + "Presentation";
|
|
8
|
-
let contentBlock = "";
|
|
9
|
-
switch (presentationKind) {
|
|
10
|
-
case "web_component":
|
|
11
|
-
contentBlock = ` content: {
|
|
1
|
+
function e(e){let{name:n,version:r,description:i,stability:a,owners:o,tags:s,presentationKind:c}=e,l=t(n.replace(/\./g,`_`))+`Presentation`,u=``;switch(c){case`web_component`:u=` content: {
|
|
12
2
|
kind: 'web_component',
|
|
13
3
|
framework: 'react',
|
|
14
|
-
componentKey: '${
|
|
4
|
+
componentKey: '${n.replace(/\./g,`_`)}',
|
|
15
5
|
props: new SchemaModel({
|
|
16
|
-
name: '${
|
|
17
|
-
description: 'Props for ${
|
|
6
|
+
name: '${l}Props',
|
|
7
|
+
description: 'Props for ${n}',
|
|
18
8
|
fields: {
|
|
19
9
|
// TODO: Define component props
|
|
20
10
|
},
|
|
@@ -22,44 +12,35 @@ function generatePresentationSpec(data) {
|
|
|
22
12
|
analytics: [
|
|
23
13
|
// TODO: Define analytics events
|
|
24
14
|
],
|
|
25
|
-
},`;
|
|
26
|
-
break;
|
|
27
|
-
case "markdown":
|
|
28
|
-
contentBlock = ` content: {
|
|
15
|
+
},`;break;case`markdown`:u=` content: {
|
|
29
16
|
kind: 'markdown',
|
|
30
17
|
content: \`
|
|
31
|
-
# ${
|
|
18
|
+
# ${i}
|
|
32
19
|
|
|
33
20
|
TODO: Add markdown content here
|
|
34
21
|
\`,
|
|
35
|
-
// Or use resourceUri: 'feature://${
|
|
36
|
-
},`;
|
|
37
|
-
break;
|
|
38
|
-
case "data":
|
|
39
|
-
contentBlock = ` content: {
|
|
22
|
+
// Or use resourceUri: 'feature://${n}/guide.md'
|
|
23
|
+
},`;break;case`data`:u=` content: {
|
|
40
24
|
kind: 'data',
|
|
41
25
|
mimeType: 'application/json',
|
|
42
26
|
model: new SchemaModel({
|
|
43
|
-
name: '${
|
|
44
|
-
description: 'Data structure for ${
|
|
27
|
+
name: '${l}Data',
|
|
28
|
+
description: 'Data structure for ${n}',
|
|
45
29
|
fields: {
|
|
46
30
|
// TODO: Define data structure
|
|
47
31
|
},
|
|
48
32
|
}),
|
|
49
|
-
},`;
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
return `import type { PresentationSpec } from '@lssm/lib.contracts/presentations';
|
|
33
|
+
},`;break}return`import type { PresentationSpec } from '@lssm/lib.contracts/presentations';
|
|
53
34
|
import { SchemaModel, ScalarTypeEnum } from '@lssm/lib.schema';
|
|
54
35
|
|
|
55
|
-
export const ${
|
|
36
|
+
export const ${l}: PresentationSpec = {
|
|
56
37
|
meta: {
|
|
57
|
-
name: '${
|
|
58
|
-
version: ${
|
|
59
|
-
stability: '${
|
|
60
|
-
owners: [${
|
|
61
|
-
tags: [${
|
|
62
|
-
description: '${
|
|
38
|
+
name: '${n}',
|
|
39
|
+
version: ${r},
|
|
40
|
+
stability: '${a}',
|
|
41
|
+
owners: [${o.map(e=>`'${e}'`).join(`, `)}],
|
|
42
|
+
tags: [${s.map(e=>`'${e}'`).join(`, `)}],
|
|
43
|
+
description: '${i}',
|
|
63
44
|
},
|
|
64
45
|
|
|
65
46
|
policy: {
|
|
@@ -67,13 +48,6 @@ export const ${varName}: PresentationSpec = {
|
|
|
67
48
|
// pii: [],
|
|
68
49
|
},
|
|
69
50
|
|
|
70
|
-
${
|
|
51
|
+
${u}
|
|
71
52
|
};
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
function toPascalCase(str) {
|
|
75
|
-
return str.split(/[-_.]/).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
//#endregion
|
|
79
|
-
export { generatePresentationSpec };
|
|
53
|
+
`}function t(e){return e.split(/[-_.]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}export{e as generatePresentationSpec};
|