@amodalai/core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/.last_build +0 -0
- package/dist/src/amodal-config.d.ts +194 -0
- package/dist/src/amodal-config.js +326 -0
- package/dist/src/amodal-config.js.map +1 -0
- package/dist/src/audit/audit-logger.d.ts +52 -0
- package/dist/src/audit/audit-logger.js +137 -0
- package/dist/src/audit/audit-logger.js.map +1 -0
- package/dist/src/audit/audit-outputs.d.ts +34 -0
- package/dist/src/audit/audit-outputs.js +73 -0
- package/dist/src/audit/audit-outputs.js.map +1 -0
- package/dist/src/audit/audit-redact.d.ts +14 -0
- package/dist/src/audit/audit-redact.js +55 -0
- package/dist/src/audit/audit-redact.js.map +1 -0
- package/dist/src/audit/audit-types.d.ts +122 -0
- package/dist/src/audit/audit-types.js +64 -0
- package/dist/src/audit/audit-types.js.map +1 -0
- package/dist/src/audit/index.d.ts +10 -0
- package/dist/src/audit/index.js +10 -0
- package/dist/src/audit/index.js.map +1 -0
- package/dist/src/eval/eval-cost.d.ts +33 -0
- package/dist/src/eval/eval-cost.js +73 -0
- package/dist/src/eval/eval-cost.js.map +1 -0
- package/dist/src/eval/eval-diff.d.ts +11 -0
- package/dist/src/eval/eval-diff.js +97 -0
- package/dist/src/eval/eval-diff.js.map +1 -0
- package/dist/src/eval/eval-formatter.d.ts +23 -0
- package/dist/src/eval/eval-formatter.js +221 -0
- package/dist/src/eval/eval-formatter.js.map +1 -0
- package/dist/src/eval/eval-judge.d.ts +26 -0
- package/dist/src/eval/eval-judge.js +76 -0
- package/dist/src/eval/eval-judge.js.map +1 -0
- package/dist/src/eval/eval-run-builder.d.ts +25 -0
- package/dist/src/eval/eval-run-builder.js +78 -0
- package/dist/src/eval/eval-run-builder.js.map +1 -0
- package/dist/src/eval/eval-runner.d.ts +36 -0
- package/dist/src/eval/eval-runner.js +92 -0
- package/dist/src/eval/eval-runner.js.map +1 -0
- package/dist/src/eval/eval-session-provider.d.ts +40 -0
- package/dist/src/eval/eval-session-provider.js +46 -0
- package/dist/src/eval/eval-session-provider.js.map +1 -0
- package/dist/src/eval/eval-types.d.ts +146 -0
- package/dist/src/eval/eval-types.js +7 -0
- package/dist/src/eval/eval-types.js.map +1 -0
- package/dist/src/eval/experiment-runner.d.ts +16 -0
- package/dist/src/eval/experiment-runner.js +73 -0
- package/dist/src/eval/experiment-runner.js.map +1 -0
- package/dist/src/eval/experiment-types.d.ts +56 -0
- package/dist/src/eval/experiment-types.js +7 -0
- package/dist/src/eval/experiment-types.js.map +1 -0
- package/dist/src/eval/index.d.ts +22 -0
- package/dist/src/eval/index.js +18 -0
- package/dist/src/eval/index.js.map +1 -0
- package/dist/src/eval/multi-model-runner.d.ts +42 -0
- package/dist/src/eval/multi-model-runner.js +70 -0
- package/dist/src/eval/multi-model-runner.js.map +1 -0
- package/dist/src/eval/platform-eval-client.d.ts +105 -0
- package/dist/src/eval/platform-eval-client.js +155 -0
- package/dist/src/eval/platform-eval-client.js.map +1 -0
- package/dist/src/index.d.ts +41 -0
- package/dist/src/index.js +68 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/knowledge/index.d.ts +11 -0
- package/dist/src/knowledge/index.js +12 -0
- package/dist/src/knowledge/index.js.map +1 -0
- package/dist/src/knowledge/kb-formatter.d.ts +15 -0
- package/dist/src/knowledge/kb-formatter.js +78 -0
- package/dist/src/knowledge/kb-formatter.js.map +1 -0
- package/dist/src/knowledge/kb-index.d.ts +27 -0
- package/dist/src/knowledge/kb-index.js +66 -0
- package/dist/src/knowledge/kb-index.js.map +1 -0
- package/dist/src/knowledge/kb-types.d.ts +54 -0
- package/dist/src/knowledge/kb-types.js +7 -0
- package/dist/src/knowledge/kb-types.js.map +1 -0
- package/dist/src/knowledge/knowledge-store.d.ts +56 -0
- package/dist/src/knowledge/knowledge-store.js +141 -0
- package/dist/src/knowledge/knowledge-store.js.map +1 -0
- package/dist/src/knowledge/load-knowledge.d.ts +30 -0
- package/dist/src/knowledge/load-knowledge.js +161 -0
- package/dist/src/knowledge/load-knowledge.js.map +1 -0
- package/dist/src/knowledge/propose-kb-update.d.ts +32 -0
- package/dist/src/knowledge/propose-kb-update.js +148 -0
- package/dist/src/knowledge/propose-kb-update.js.map +1 -0
- package/dist/src/knowledge/propose-knowledge.d.ts +34 -0
- package/dist/src/knowledge/propose-knowledge.js +163 -0
- package/dist/src/knowledge/propose-knowledge.js.map +1 -0
- package/dist/src/mcp/index.d.ts +7 -0
- package/dist/src/mcp/index.js +7 -0
- package/dist/src/mcp/index.js.map +1 -0
- package/dist/src/mcp/mcp-manager.d.ts +96 -0
- package/dist/src/mcp/mcp-manager.js +192 -0
- package/dist/src/mcp/mcp-manager.js.map +1 -0
- package/dist/src/packages/config-deps.d.ts +20 -0
- package/dist/src/packages/config-deps.js +77 -0
- package/dist/src/packages/config-deps.js.map +1 -0
- package/dist/src/packages/env-file.d.ts +28 -0
- package/dist/src/packages/env-file.js +143 -0
- package/dist/src/packages/env-file.js.map +1 -0
- package/dist/src/packages/frontmatter.d.ts +28 -0
- package/dist/src/packages/frontmatter.js +77 -0
- package/dist/src/packages/frontmatter.js.map +1 -0
- package/dist/src/packages/index.d.ts +16 -0
- package/dist/src/packages/index.js +17 -0
- package/dist/src/packages/index.js.map +1 -0
- package/dist/src/packages/lock-file.d.ts +35 -0
- package/dist/src/packages/lock-file.js +117 -0
- package/dist/src/packages/lock-file.js.map +1 -0
- package/dist/src/packages/manifest-reader.d.ts +19 -0
- package/dist/src/packages/manifest-reader.js +91 -0
- package/dist/src/packages/manifest-reader.js.map +1 -0
- package/dist/src/packages/merge-engine.d.ts +63 -0
- package/dist/src/packages/merge-engine.js +357 -0
- package/dist/src/packages/merge-engine.js.map +1 -0
- package/dist/src/packages/npm-context.d.ts +56 -0
- package/dist/src/packages/npm-context.js +235 -0
- package/dist/src/packages/npm-context.js.map +1 -0
- package/dist/src/packages/npm-registry.d.ts +35 -0
- package/dist/src/packages/npm-registry.js +107 -0
- package/dist/src/packages/npm-registry.js.map +1 -0
- package/dist/src/packages/package-error.d.ts +16 -0
- package/dist/src/packages/package-error.js +17 -0
- package/dist/src/packages/package-error.js.map +1 -0
- package/dist/src/packages/package-types.d.ts +477 -0
- package/dist/src/packages/package-types.js +156 -0
- package/dist/src/packages/package-types.js.map +1 -0
- package/dist/src/packages/resolver.d.ts +41 -0
- package/dist/src/packages/resolver.js +353 -0
- package/dist/src/packages/resolver.js.map +1 -0
- package/dist/src/platform/config-builder.d.ts +24 -0
- package/dist/src/platform/config-builder.js +70 -0
- package/dist/src/platform/config-builder.js.map +1 -0
- package/dist/src/platform/index.d.ts +8 -0
- package/dist/src/platform/index.js +9 -0
- package/dist/src/platform/index.js.map +1 -0
- package/dist/src/platform/platform-client.d.ts +160 -0
- package/dist/src/platform/platform-client.js +486 -0
- package/dist/src/platform/platform-client.js.map +1 -0
- package/dist/src/platform/platform-types.d.ts +81 -0
- package/dist/src/platform/platform-types.js +18 -0
- package/dist/src/platform/platform-types.js.map +1 -0
- package/dist/src/providers/content-generator/google-to-llm.d.ts +87 -0
- package/dist/src/providers/content-generator/google-to-llm.js +226 -0
- package/dist/src/providers/content-generator/google-to-llm.js.map +1 -0
- package/dist/src/providers/content-generator/index.d.ts +10 -0
- package/dist/src/providers/content-generator/index.js +9 -0
- package/dist/src/providers/content-generator/index.js.map +1 -0
- package/dist/src/providers/content-generator/llm-to-google.d.ts +59 -0
- package/dist/src/providers/content-generator/llm-to-google.js +178 -0
- package/dist/src/providers/content-generator/llm-to-google.js.map +1 -0
- package/dist/src/providers/content-generator/multi-provider-content-generator.d.ts +61 -0
- package/dist/src/providers/content-generator/multi-provider-content-generator.js +144 -0
- package/dist/src/providers/content-generator/multi-provider-content-generator.js.map +1 -0
- package/dist/src/providers/runtime/anthropic-provider.d.ts +18 -0
- package/dist/src/providers/runtime/anthropic-provider.js +253 -0
- package/dist/src/providers/runtime/anthropic-provider.js.map +1 -0
- package/dist/src/providers/runtime/azure-provider.d.ts +25 -0
- package/dist/src/providers/runtime/azure-provider.js +206 -0
- package/dist/src/providers/runtime/azure-provider.js.map +1 -0
- package/dist/src/providers/runtime/bedrock-provider.d.ts +22 -0
- package/dist/src/providers/runtime/bedrock-provider.js +276 -0
- package/dist/src/providers/runtime/bedrock-provider.js.map +1 -0
- package/dist/src/providers/runtime/failover-provider.d.ts +30 -0
- package/dist/src/providers/runtime/failover-provider.js +124 -0
- package/dist/src/providers/runtime/failover-provider.js.map +1 -0
- package/dist/src/providers/runtime/google-provider.d.ts +17 -0
- package/dist/src/providers/runtime/google-provider.js +239 -0
- package/dist/src/providers/runtime/google-provider.js.map +1 -0
- package/dist/src/providers/runtime/index.d.ts +16 -0
- package/dist/src/providers/runtime/index.js +16 -0
- package/dist/src/providers/runtime/index.js.map +1 -0
- package/dist/src/providers/runtime/openai-provider.d.ts +21 -0
- package/dist/src/providers/runtime/openai-provider.js +266 -0
- package/dist/src/providers/runtime/openai-provider.js.map +1 -0
- package/dist/src/providers/runtime/provider-errors.d.ts +39 -0
- package/dist/src/providers/runtime/provider-errors.js +50 -0
- package/dist/src/providers/runtime/provider-errors.js.map +1 -0
- package/dist/src/providers/runtime/provider-factory.d.ts +19 -0
- package/dist/src/providers/runtime/provider-factory.js +45 -0
- package/dist/src/providers/runtime/provider-factory.js.map +1 -0
- package/dist/src/providers/runtime/runtime-provider-types.d.ts +63 -0
- package/dist/src/providers/runtime/runtime-provider-types.js +7 -0
- package/dist/src/providers/runtime/runtime-provider-types.js.map +1 -0
- package/dist/src/providers/runtime/streaming-types.d.ts +40 -0
- package/dist/src/providers/runtime/streaming-types.js +7 -0
- package/dist/src/providers/runtime/streaming-types.js.map +1 -0
- package/dist/src/repo/config-schema.d.ts +238 -0
- package/dist/src/repo/config-schema.js +155 -0
- package/dist/src/repo/config-schema.js.map +1 -0
- package/dist/src/repo/connection-schemas.d.ts +449 -0
- package/dist/src/repo/connection-schemas.js +109 -0
- package/dist/src/repo/connection-schemas.js.map +1 -0
- package/dist/src/repo/connection-types.d.ts +29 -0
- package/dist/src/repo/connection-types.js +7 -0
- package/dist/src/repo/connection-types.js.map +1 -0
- package/dist/src/repo/drift-detector.d.ts +26 -0
- package/dist/src/repo/drift-detector.js +66 -0
- package/dist/src/repo/drift-detector.js.map +1 -0
- package/dist/src/repo/graphql-drift-detector.d.ts +27 -0
- package/dist/src/repo/graphql-drift-detector.js +66 -0
- package/dist/src/repo/graphql-drift-detector.js.map +1 -0
- package/dist/src/repo/graphql-parser.d.ts +30 -0
- package/dist/src/repo/graphql-parser.js +125 -0
- package/dist/src/repo/graphql-parser.js.map +1 -0
- package/dist/src/repo/graphql-surface-parser.d.ts +20 -0
- package/dist/src/repo/graphql-surface-parser.js +74 -0
- package/dist/src/repo/graphql-surface-parser.js.map +1 -0
- package/dist/src/repo/index.d.ts +30 -0
- package/dist/src/repo/index.js +29 -0
- package/dist/src/repo/index.js.map +1 -0
- package/dist/src/repo/local-reader.d.ts +10 -0
- package/dist/src/repo/local-reader.js +299 -0
- package/dist/src/repo/local-reader.js.map +1 -0
- package/dist/src/repo/openapi-parser.d.ts +35 -0
- package/dist/src/repo/openapi-parser.js +93 -0
- package/dist/src/repo/openapi-parser.js.map +1 -0
- package/dist/src/repo/parsers.d.ts +91 -0
- package/dist/src/repo/parsers.js +454 -0
- package/dist/src/repo/parsers.js.map +1 -0
- package/dist/src/repo/platform-reader.d.ts +10 -0
- package/dist/src/repo/platform-reader.js +206 -0
- package/dist/src/repo/platform-reader.js.map +1 -0
- package/dist/src/repo/repo-loader.d.ts +14 -0
- package/dist/src/repo/repo-loader.js +25 -0
- package/dist/src/repo/repo-loader.js.map +1 -0
- package/dist/src/repo/repo-types.d.ts +159 -0
- package/dist/src/repo/repo-types.js +17 -0
- package/dist/src/repo/repo-types.js.map +1 -0
- package/dist/src/repo/spec-syncer.d.ts +30 -0
- package/dist/src/repo/spec-syncer.js +85 -0
- package/dist/src/repo/spec-syncer.js.map +1 -0
- package/dist/src/repo/store-loader.d.ts +19 -0
- package/dist/src/repo/store-loader.js +94 -0
- package/dist/src/repo/store-loader.js.map +1 -0
- package/dist/src/repo/store-schemas.d.ts +313 -0
- package/dist/src/repo/store-schemas.js +103 -0
- package/dist/src/repo/store-schemas.js.map +1 -0
- package/dist/src/repo/store-tool-schema.d.ts +29 -0
- package/dist/src/repo/store-tool-schema.js +103 -0
- package/dist/src/repo/store-tool-schema.js.map +1 -0
- package/dist/src/repo/store-types.d.ts +91 -0
- package/dist/src/repo/store-types.js +7 -0
- package/dist/src/repo/store-types.js.map +1 -0
- package/dist/src/repo/surface-parser.d.ts +17 -0
- package/dist/src/repo/surface-parser.js +75 -0
- package/dist/src/repo/surface-parser.js.map +1 -0
- package/dist/src/repo/tool-loader.d.ts +33 -0
- package/dist/src/repo/tool-loader.js +240 -0
- package/dist/src/repo/tool-loader.js.map +1 -0
- package/dist/src/repo/tool-types.d.ts +205 -0
- package/dist/src/repo/tool-types.js +61 -0
- package/dist/src/repo/tool-types.js.map +1 -0
- package/dist/src/roles/index.d.ts +7 -0
- package/dist/src/roles/index.js +8 -0
- package/dist/src/roles/index.js.map +1 -0
- package/dist/src/roles/role-filter.d.ts +33 -0
- package/dist/src/roles/role-filter.js +55 -0
- package/dist/src/roles/role-filter.js.map +1 -0
- package/dist/src/roles/role-types.d.ts +76 -0
- package/dist/src/roles/role-types.js +38 -0
- package/dist/src/roles/role-types.js.map +1 -0
- package/dist/src/runtime/connection-bridge.d.ts +19 -0
- package/dist/src/runtime/connection-bridge.js +103 -0
- package/dist/src/runtime/connection-bridge.js.map +1 -0
- package/dist/src/runtime/context-compiler.d.ts +35 -0
- package/dist/src/runtime/context-compiler.js +183 -0
- package/dist/src/runtime/context-compiler.js.map +1 -0
- package/dist/src/runtime/default-prompt.d.ts +28 -0
- package/dist/src/runtime/default-prompt.js +71 -0
- package/dist/src/runtime/default-prompt.js.map +1 -0
- package/dist/src/runtime/explore-tool.d.ts +96 -0
- package/dist/src/runtime/explore-tool.js +111 -0
- package/dist/src/runtime/explore-tool.js.map +1 -0
- package/dist/src/runtime/index.d.ts +26 -0
- package/dist/src/runtime/index.js +19 -0
- package/dist/src/runtime/index.js.map +1 -0
- package/dist/src/runtime/output-pipeline.d.ts +62 -0
- package/dist/src/runtime/output-pipeline.js +69 -0
- package/dist/src/runtime/output-pipeline.js.map +1 -0
- package/dist/src/runtime/plan-mode.d.ts +39 -0
- package/dist/src/runtime/plan-mode.js +81 -0
- package/dist/src/runtime/plan-mode.js.map +1 -0
- package/dist/src/runtime/preference-client.d.ts +39 -0
- package/dist/src/runtime/preference-client.js +70 -0
- package/dist/src/runtime/preference-client.js.map +1 -0
- package/dist/src/runtime/preference-detector.d.ts +22 -0
- package/dist/src/runtime/preference-detector.js +95 -0
- package/dist/src/runtime/preference-detector.js.map +1 -0
- package/dist/src/runtime/request-integration.d.ts +18 -0
- package/dist/src/runtime/request-integration.js +36 -0
- package/dist/src/runtime/request-integration.js.map +1 -0
- package/dist/src/runtime/runtime-types.d.ts +48 -0
- package/dist/src/runtime/runtime-types.js +7 -0
- package/dist/src/runtime/runtime-types.js.map +1 -0
- package/dist/src/runtime/session-setup.d.ts +53 -0
- package/dist/src/runtime/session-setup.js +90 -0
- package/dist/src/runtime/session-setup.js.map +1 -0
- package/dist/src/runtime/telemetry-client.d.ts +39 -0
- package/dist/src/runtime/telemetry-client.js +87 -0
- package/dist/src/runtime/telemetry-client.js.map +1 -0
- package/dist/src/runtime/telemetry-hooks.d.ts +47 -0
- package/dist/src/runtime/telemetry-hooks.js +115 -0
- package/dist/src/runtime/telemetry-hooks.js.map +1 -0
- package/dist/src/runtime/token-allocator.d.ts +34 -0
- package/dist/src/runtime/token-allocator.js +86 -0
- package/dist/src/runtime/token-allocator.js.map +1 -0
- package/dist/src/runtime/user-context.d.ts +49 -0
- package/dist/src/runtime/user-context.js +135 -0
- package/dist/src/runtime/user-context.js.map +1 -0
- package/dist/src/sdk.d.ts +57 -0
- package/dist/src/sdk.js +377 -0
- package/dist/src/sdk.js.map +1 -0
- package/dist/src/security/action-gate.d.ts +23 -0
- package/dist/src/security/action-gate.js +78 -0
- package/dist/src/security/action-gate.js.map +1 -0
- package/dist/src/security/field-scrubber.d.ts +27 -0
- package/dist/src/security/field-scrubber.js +152 -0
- package/dist/src/security/field-scrubber.js.map +1 -0
- package/dist/src/security/index.d.ts +14 -0
- package/dist/src/security/index.js +15 -0
- package/dist/src/security/index.js.map +1 -0
- package/dist/src/security/leak-detector.d.ts +23 -0
- package/dist/src/security/leak-detector.js +51 -0
- package/dist/src/security/leak-detector.js.map +1 -0
- package/dist/src/security/output-guard.d.ts +33 -0
- package/dist/src/security/output-guard.js +118 -0
- package/dist/src/security/output-guard.js.map +1 -0
- package/dist/src/security/pattern-scanner.d.ts +19 -0
- package/dist/src/security/pattern-scanner.js +66 -0
- package/dist/src/security/pattern-scanner.js.map +1 -0
- package/dist/src/security/scope-checker.d.ts +27 -0
- package/dist/src/security/scope-checker.js +52 -0
- package/dist/src/security/scope-checker.js.map +1 -0
- package/dist/src/security/scrub-tracker.d.ts +21 -0
- package/dist/src/security/scrub-tracker.js +39 -0
- package/dist/src/security/scrub-tracker.js.map +1 -0
- package/dist/src/security/security-types.d.ts +69 -0
- package/dist/src/security/security-types.js +17 -0
- package/dist/src/security/security-types.js.map +1 -0
- package/dist/src/security/threshold-evaluator.d.ts +13 -0
- package/dist/src/security/threshold-evaluator.js +44 -0
- package/dist/src/security/threshold-evaluator.js.map +1 -0
- package/dist/src/snapshot/index.d.ts +8 -0
- package/dist/src/snapshot/index.js +9 -0
- package/dist/src/snapshot/index.js.map +1 -0
- package/dist/src/snapshot/snapshot-builder.d.ts +37 -0
- package/dist/src/snapshot/snapshot-builder.js +152 -0
- package/dist/src/snapshot/snapshot-builder.js.map +1 -0
- package/dist/src/snapshot/snapshot-loader.d.ts +29 -0
- package/dist/src/snapshot/snapshot-loader.js +188 -0
- package/dist/src/snapshot/snapshot-loader.js.map +1 -0
- package/dist/src/snapshot/snapshot-types.d.ts +1940 -0
- package/dist/src/snapshot/snapshot-types.js +145 -0
- package/dist/src/snapshot/snapshot-types.js.map +1 -0
- package/dist/src/stores/index.d.ts +6 -0
- package/dist/src/stores/index.js +7 -0
- package/dist/src/stores/index.js.map +1 -0
- package/dist/src/stores/store-backend.d.ts +135 -0
- package/dist/src/stores/store-backend.js +7 -0
- package/dist/src/stores/store-backend.js.map +1 -0
- package/dist/src/templates/connections.d.ts +14 -0
- package/dist/src/templates/connections.js +7 -0
- package/dist/src/templates/connections.js.map +1 -0
- package/dist/src/templates/index.d.ts +7 -0
- package/dist/src/templates/index.js +8 -0
- package/dist/src/templates/index.js.map +1 -0
- package/dist/src/templates/template-resolver.d.ts +45 -0
- package/dist/src/templates/template-resolver.js +121 -0
- package/dist/src/templates/template-resolver.js.map +1 -0
- package/dist/src/tool-context.d.ts +33 -0
- package/dist/src/tool-context.js +7 -0
- package/dist/src/tool-context.js.map +1 -0
- package/dist/src/tool-registration.d.ts +14 -0
- package/dist/src/tool-registration.js +51 -0
- package/dist/src/tool-registration.js.map +1 -0
- package/dist/src/tools/amodal-tool-errors.d.ts +24 -0
- package/dist/src/tools/amodal-tool-errors.js +28 -0
- package/dist/src/tools/amodal-tool-errors.js.map +1 -0
- package/dist/src/tools/amodal-tool-names.d.ts +14 -0
- package/dist/src/tools/amodal-tool-names.js +15 -0
- package/dist/src/tools/amodal-tool-names.js.map +1 -0
- package/dist/src/tools/chain-tool-registry.d.ts +20 -0
- package/dist/src/tools/chain-tool-registry.js +49 -0
- package/dist/src/tools/chain-tool-registry.js.map +1 -0
- package/dist/src/tools/chain-tool-types.d.ts +190 -0
- package/dist/src/tools/chain-tool-types.js +50 -0
- package/dist/src/tools/chain-tool-types.js.map +1 -0
- package/dist/src/tools/chain-tool.d.ts +34 -0
- package/dist/src/tools/chain-tool.js +294 -0
- package/dist/src/tools/chain-tool.js.map +1 -0
- package/dist/src/tools/custom-tool-registrar.d.ts +8 -0
- package/dist/src/tools/custom-tool-registrar.js +10 -0
- package/dist/src/tools/custom-tool-registrar.js.map +1 -0
- package/dist/src/tools/definitions/amodal-tools.d.ts +9 -0
- package/dist/src/tools/definitions/amodal-tools.js +192 -0
- package/dist/src/tools/definitions/amodal-tools.js.map +1 -0
- package/dist/src/tools/function-tool-registry.d.ts +22 -0
- package/dist/src/tools/function-tool-registry.js +45 -0
- package/dist/src/tools/function-tool-registry.js.map +1 -0
- package/dist/src/tools/function-tool-types.d.ts +76 -0
- package/dist/src/tools/function-tool-types.js +27 -0
- package/dist/src/tools/function-tool-types.js.map +1 -0
- package/dist/src/tools/function-tool.d.ts +34 -0
- package/dist/src/tools/function-tool.js +97 -0
- package/dist/src/tools/function-tool.js.map +1 -0
- package/dist/src/tools/http-tool-registry.d.ts +20 -0
- package/dist/src/tools/http-tool-registry.js +34 -0
- package/dist/src/tools/http-tool-registry.js.map +1 -0
- package/dist/src/tools/http-tool-types.d.ts +92 -0
- package/dist/src/tools/http-tool-types.js +44 -0
- package/dist/src/tools/http-tool-types.js.map +1 -0
- package/dist/src/tools/http-tool.d.ts +32 -0
- package/dist/src/tools/http-tool.js +176 -0
- package/dist/src/tools/http-tool.js.map +1 -0
- package/dist/src/tools/merge-template.d.ts +33 -0
- package/dist/src/tools/merge-template.js +65 -0
- package/dist/src/tools/merge-template.js.map +1 -0
- package/dist/src/tools/request-tool-types.d.ts +46 -0
- package/dist/src/tools/request-tool-types.js +20 -0
- package/dist/src/tools/request-tool-types.js.map +1 -0
- package/dist/src/tools/request-tool.d.ts +29 -0
- package/dist/src/tools/request-tool.js +268 -0
- package/dist/src/tools/request-tool.js.map +1 -0
- package/dist/src/tools/store-query-tool.d.ts +29 -0
- package/dist/src/tools/store-query-tool.js +82 -0
- package/dist/src/tools/store-query-tool.js.map +1 -0
- package/dist/src/tools/store-write-tool.d.ts +26 -0
- package/dist/src/tools/store-write-tool.js +84 -0
- package/dist/src/tools/store-write-tool.js.map +1 -0
- package/dist/src/tools/tool-definition-types.d.ts +21 -0
- package/dist/src/tools/tool-definition-types.js +7 -0
- package/dist/src/tools/tool-definition-types.js.map +1 -0
- package/dist/src/tools/tool-utils.d.ts +29 -0
- package/dist/src/tools/tool-utils.js +66 -0
- package/dist/src/tools/tool-utils.js.map +1 -0
- package/dist/src/versions/bundle-loader.d.ts +37 -0
- package/dist/src/versions/bundle-loader.js +99 -0
- package/dist/src/versions/bundle-loader.js.map +1 -0
- package/dist/src/versions/dependency-manager.d.ts +54 -0
- package/dist/src/versions/dependency-manager.js +132 -0
- package/dist/src/versions/dependency-manager.js.map +1 -0
- package/dist/src/versions/handler-loader.d.ts +27 -0
- package/dist/src/versions/handler-loader.js +62 -0
- package/dist/src/versions/handler-loader.js.map +1 -0
- package/dist/src/versions/index.d.ts +10 -0
- package/dist/src/versions/index.js +11 -0
- package/dist/src/versions/index.js.map +1 -0
- package/dist/src/versions/version-bundle-types.d.ts +1278 -0
- package/dist/src/versions/version-bundle-types.js +207 -0
- package/dist/src/versions/version-bundle-types.js.map +1 -0
- package/dist/src/versions/version-manager.d.ts +89 -0
- package/dist/src/versions/version-manager.js +124 -0
- package/dist/src/versions/version-manager.js.map +1 -0
- package/dist/src/widgets/index.d.ts +8 -0
- package/dist/src/widgets/index.js +8 -0
- package/dist/src/widgets/index.js.map +1 -0
- package/dist/src/widgets/present-tool.d.ts +21 -0
- package/dist/src/widgets/present-tool.js +107 -0
- package/dist/src/widgets/present-tool.js.map +1 -0
- package/dist/src/widgets/widget-types.d.ts +78 -0
- package/dist/src/widgets/widget-types.js +28 -0
- package/dist/src/widgets/widget-types.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { readFile, readdir, stat } from 'node:fs/promises';
|
|
7
|
+
import * as path from 'node:path';
|
|
8
|
+
import { parseConnection, parseSkill, parseKnowledge, parseAutomation } from '../repo/parsers.js';
|
|
9
|
+
import { parseJsonImport, parseMarkdownFrontmatter } from './frontmatter.js';
|
|
10
|
+
import { mergeAccessJson, mergeConcatenation, mergeEntities, mergeSpecJson, mergeSurface } from './merge-engine.js';
|
|
11
|
+
import { readPackageFile } from './manifest-reader.js';
|
|
12
|
+
import { getPackageDir } from './npm-context.js';
|
|
13
|
+
import { makePackageRef, parsePackageKey } from './package-types.js';
|
|
14
|
+
// --- Helpers ---
|
|
15
|
+
async function readOptionalFile(filePath) {
|
|
16
|
+
try {
|
|
17
|
+
return await readFile(filePath, 'utf-8');
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
21
|
+
if (err.code === 'ENOENT')
|
|
22
|
+
return null;
|
|
23
|
+
throw err;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
async function dirExists(dirPath) {
|
|
27
|
+
try {
|
|
28
|
+
const s = await stat(dirPath);
|
|
29
|
+
return s.isDirectory();
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async function listSubdirs(dirPath) {
|
|
36
|
+
try {
|
|
37
|
+
const entries = await readdir(dirPath, { withFileTypes: true });
|
|
38
|
+
return entries.filter((e) => e.isDirectory()).map((e) => e.name);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function hasImportHeader(content) {
|
|
45
|
+
// JSON import
|
|
46
|
+
if (content.trim().startsWith('{')) {
|
|
47
|
+
try {
|
|
48
|
+
const { import: imp } = parseJsonImport(content);
|
|
49
|
+
return imp !== undefined;
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// Markdown import
|
|
56
|
+
const { frontmatter } = parseMarkdownFrontmatter(content);
|
|
57
|
+
return frontmatter !== null && typeof frontmatter['import'] === 'string';
|
|
58
|
+
}
|
|
59
|
+
// --- Connection resolution ---
|
|
60
|
+
/**
|
|
61
|
+
* Resolve a single connection by merging package + repo files.
|
|
62
|
+
*/
|
|
63
|
+
export async function resolveConnection(name, repoDir, packageDir) {
|
|
64
|
+
if (!repoDir && !packageDir)
|
|
65
|
+
return null;
|
|
66
|
+
const location = repoDir ?? packageDir;
|
|
67
|
+
// Helper to read from package
|
|
68
|
+
async function readPkg(filename) {
|
|
69
|
+
if (!packageDir)
|
|
70
|
+
return null;
|
|
71
|
+
return readPackageFile(packageDir, filename);
|
|
72
|
+
}
|
|
73
|
+
// Helper to read from repo
|
|
74
|
+
async function readRepo(filename) {
|
|
75
|
+
if (!repoDir)
|
|
76
|
+
return null;
|
|
77
|
+
return readOptionalFile(path.join(repoDir, filename));
|
|
78
|
+
}
|
|
79
|
+
// Resolve each file type with merge logic
|
|
80
|
+
const repoSpec = await readRepo('spec.json');
|
|
81
|
+
const pkgSpec = await readPkg('spec.json');
|
|
82
|
+
let specJson;
|
|
83
|
+
if (repoSpec && pkgSpec && hasImportHeader(repoSpec)) {
|
|
84
|
+
const merged = mergeSpecJson(pkgSpec, repoSpec);
|
|
85
|
+
specJson = JSON.stringify(merged);
|
|
86
|
+
}
|
|
87
|
+
else if (repoSpec) {
|
|
88
|
+
specJson = repoSpec;
|
|
89
|
+
}
|
|
90
|
+
else if (pkgSpec) {
|
|
91
|
+
specJson = pkgSpec;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
return null; // spec.json is required
|
|
95
|
+
}
|
|
96
|
+
const repoAccess = await readRepo('access.json');
|
|
97
|
+
const pkgAccess = await readPkg('access.json');
|
|
98
|
+
let accessJson;
|
|
99
|
+
if (repoAccess && pkgAccess && hasImportHeader(repoAccess)) {
|
|
100
|
+
const merged = mergeAccessJson(pkgAccess, repoAccess);
|
|
101
|
+
accessJson = JSON.stringify(merged);
|
|
102
|
+
}
|
|
103
|
+
else if (repoAccess) {
|
|
104
|
+
accessJson = repoAccess;
|
|
105
|
+
}
|
|
106
|
+
else if (pkgAccess) {
|
|
107
|
+
accessJson = pkgAccess;
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
return null; // access.json is required
|
|
111
|
+
}
|
|
112
|
+
// surface.md (optional)
|
|
113
|
+
const repoSurface = await readRepo('surface.md');
|
|
114
|
+
const pkgSurface = await readPkg('surface.md');
|
|
115
|
+
let surfaceMd;
|
|
116
|
+
if (repoSurface && pkgSurface && hasImportHeader(repoSurface)) {
|
|
117
|
+
surfaceMd = mergeSurface(pkgSurface, repoSurface);
|
|
118
|
+
}
|
|
119
|
+
else if (repoSurface) {
|
|
120
|
+
surfaceMd = repoSurface;
|
|
121
|
+
}
|
|
122
|
+
else if (pkgSurface) {
|
|
123
|
+
surfaceMd = pkgSurface;
|
|
124
|
+
}
|
|
125
|
+
// entities.md (optional)
|
|
126
|
+
const repoEntities = await readRepo('entities.md');
|
|
127
|
+
const pkgEntities = await readPkg('entities.md');
|
|
128
|
+
let entitiesMd;
|
|
129
|
+
if (repoEntities && pkgEntities && hasImportHeader(repoEntities)) {
|
|
130
|
+
entitiesMd = mergeEntities(pkgEntities, repoEntities);
|
|
131
|
+
}
|
|
132
|
+
else if (repoEntities) {
|
|
133
|
+
entitiesMd = repoEntities;
|
|
134
|
+
}
|
|
135
|
+
else if (pkgEntities) {
|
|
136
|
+
entitiesMd = pkgEntities;
|
|
137
|
+
}
|
|
138
|
+
// rules.md (optional, concatenation)
|
|
139
|
+
const repoRules = await readRepo('rules.md');
|
|
140
|
+
const pkgRules = await readPkg('rules.md');
|
|
141
|
+
let rulesMd;
|
|
142
|
+
if (repoRules && pkgRules && hasImportHeader(repoRules)) {
|
|
143
|
+
rulesMd = mergeConcatenation(pkgRules, repoRules);
|
|
144
|
+
}
|
|
145
|
+
else if (repoRules) {
|
|
146
|
+
rulesMd = repoRules;
|
|
147
|
+
}
|
|
148
|
+
else if (pkgRules) {
|
|
149
|
+
rulesMd = pkgRules;
|
|
150
|
+
}
|
|
151
|
+
return parseConnection(name, { specJson, accessJson, surfaceMd, entitiesMd, rulesMd }, location);
|
|
152
|
+
}
|
|
153
|
+
// --- Skill resolution ---
|
|
154
|
+
/**
|
|
155
|
+
* Resolve a single skill by merging package + repo files.
|
|
156
|
+
*/
|
|
157
|
+
export async function resolveSkill(name, repoDir, packageDir) {
|
|
158
|
+
if (!repoDir && !packageDir)
|
|
159
|
+
return null;
|
|
160
|
+
const location = repoDir ?? packageDir;
|
|
161
|
+
const repoContent = repoDir
|
|
162
|
+
? await readOptionalFile(path.join(repoDir, 'SKILL.md'))
|
|
163
|
+
: null;
|
|
164
|
+
const pkgContent = packageDir
|
|
165
|
+
? await readPackageFile(packageDir, 'SKILL.md')
|
|
166
|
+
: null;
|
|
167
|
+
let content = null;
|
|
168
|
+
if (repoContent && pkgContent && hasImportHeader(repoContent)) {
|
|
169
|
+
content = mergeConcatenation(pkgContent, repoContent);
|
|
170
|
+
}
|
|
171
|
+
else if (repoContent) {
|
|
172
|
+
content = repoContent;
|
|
173
|
+
}
|
|
174
|
+
else if (pkgContent) {
|
|
175
|
+
content = pkgContent;
|
|
176
|
+
}
|
|
177
|
+
if (!content)
|
|
178
|
+
return null;
|
|
179
|
+
return parseSkill(content, location);
|
|
180
|
+
}
|
|
181
|
+
// --- Automation resolution ---
|
|
182
|
+
/**
|
|
183
|
+
* Resolve a single automation by merging package + repo file.
|
|
184
|
+
*/
|
|
185
|
+
export async function resolveAutomation(name, repoDir, packageDir) {
|
|
186
|
+
if (!repoDir && !packageDir)
|
|
187
|
+
return null;
|
|
188
|
+
const location = repoDir ?? packageDir;
|
|
189
|
+
const repoContent = repoDir
|
|
190
|
+
? await readOptionalFile(path.join(repoDir, `${name}.md`))
|
|
191
|
+
: null;
|
|
192
|
+
const pkgContent = packageDir
|
|
193
|
+
? await readPackageFile(packageDir, `${name}.md`)
|
|
194
|
+
: null;
|
|
195
|
+
let content = null;
|
|
196
|
+
if (repoContent && pkgContent && hasImportHeader(repoContent)) {
|
|
197
|
+
content = mergeConcatenation(pkgContent, repoContent);
|
|
198
|
+
}
|
|
199
|
+
else if (repoContent) {
|
|
200
|
+
content = repoContent;
|
|
201
|
+
}
|
|
202
|
+
else if (pkgContent) {
|
|
203
|
+
content = pkgContent;
|
|
204
|
+
}
|
|
205
|
+
if (!content)
|
|
206
|
+
return null;
|
|
207
|
+
return parseAutomation(content, name, location);
|
|
208
|
+
}
|
|
209
|
+
// --- Knowledge resolution ---
|
|
210
|
+
/**
|
|
211
|
+
* Resolve a single knowledge file by merging package + repo file.
|
|
212
|
+
*/
|
|
213
|
+
export async function resolveKnowledge(name, repoDir, packageDir) {
|
|
214
|
+
if (!repoDir && !packageDir)
|
|
215
|
+
return null;
|
|
216
|
+
const location = repoDir ?? packageDir;
|
|
217
|
+
const repoContent = repoDir
|
|
218
|
+
? await readOptionalFile(path.join(repoDir, `${name}.md`))
|
|
219
|
+
: null;
|
|
220
|
+
const pkgContent = packageDir
|
|
221
|
+
? await readPackageFile(packageDir, `${name}.md`)
|
|
222
|
+
: null;
|
|
223
|
+
let content = null;
|
|
224
|
+
if (repoContent && pkgContent && hasImportHeader(repoContent)) {
|
|
225
|
+
content = mergeConcatenation(pkgContent, repoContent);
|
|
226
|
+
}
|
|
227
|
+
else if (repoContent) {
|
|
228
|
+
content = repoContent;
|
|
229
|
+
}
|
|
230
|
+
else if (pkgContent) {
|
|
231
|
+
content = pkgContent;
|
|
232
|
+
}
|
|
233
|
+
if (!content)
|
|
234
|
+
return null;
|
|
235
|
+
return parseKnowledge(content, name, location);
|
|
236
|
+
}
|
|
237
|
+
// --- Full resolution ---
|
|
238
|
+
/**
|
|
239
|
+
* Resolve all packages: merge lock file packages with repo directories.
|
|
240
|
+
*/
|
|
241
|
+
export async function resolveAllPackages(options) {
|
|
242
|
+
const { repoPath, lockFile } = options;
|
|
243
|
+
const warnings = [];
|
|
244
|
+
const connections = new Map();
|
|
245
|
+
const skills = [];
|
|
246
|
+
const automations = [];
|
|
247
|
+
const knowledge = [];
|
|
248
|
+
// Build union of names from lock file + repo directories
|
|
249
|
+
const connectionNames = new Set();
|
|
250
|
+
const skillNames = new Set();
|
|
251
|
+
const automationNames = new Set();
|
|
252
|
+
const knowledgeNames = new Set();
|
|
253
|
+
// From lock file
|
|
254
|
+
if (lockFile) {
|
|
255
|
+
for (const key of Object.keys(lockFile.packages)) {
|
|
256
|
+
const parsed = parsePackageKey(key);
|
|
257
|
+
switch (parsed.type) {
|
|
258
|
+
case 'connection':
|
|
259
|
+
connectionNames.add(parsed.name);
|
|
260
|
+
break;
|
|
261
|
+
case 'skill':
|
|
262
|
+
skillNames.add(parsed.name);
|
|
263
|
+
break;
|
|
264
|
+
case 'automation':
|
|
265
|
+
automationNames.add(parsed.name);
|
|
266
|
+
break;
|
|
267
|
+
case 'knowledge':
|
|
268
|
+
knowledgeNames.add(parsed.name);
|
|
269
|
+
break;
|
|
270
|
+
default:
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
// From repo directories
|
|
276
|
+
const connDirs = await listSubdirs(path.join(repoPath, 'connections'));
|
|
277
|
+
for (const d of connDirs)
|
|
278
|
+
connectionNames.add(d);
|
|
279
|
+
const skillDirs = await listSubdirs(path.join(repoPath, 'skills'));
|
|
280
|
+
for (const d of skillDirs)
|
|
281
|
+
skillNames.add(d);
|
|
282
|
+
// For automations and knowledge, list .md files
|
|
283
|
+
const autoDir = path.join(repoPath, 'automations');
|
|
284
|
+
const knowledgeDir = path.join(repoPath, 'knowledge');
|
|
285
|
+
try {
|
|
286
|
+
const autoFiles = await readdir(autoDir);
|
|
287
|
+
for (const f of autoFiles) {
|
|
288
|
+
if (f.endsWith('.md'))
|
|
289
|
+
automationNames.add(f.replace(/\.md$/, ''));
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
catch {
|
|
293
|
+
// Directory doesn't exist
|
|
294
|
+
}
|
|
295
|
+
try {
|
|
296
|
+
const knowledgeFiles = await readdir(knowledgeDir);
|
|
297
|
+
for (const f of knowledgeFiles) {
|
|
298
|
+
if (f.endsWith('.md'))
|
|
299
|
+
knowledgeNames.add(f.replace(/\.md$/, ''));
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
catch {
|
|
303
|
+
// Directory doesn't exist
|
|
304
|
+
}
|
|
305
|
+
// Helper to get package directory for a name
|
|
306
|
+
async function getPkgDir(type, name) {
|
|
307
|
+
const ref = makePackageRef(type, name);
|
|
308
|
+
const dir = await getPackageDir(repoPath, ref);
|
|
309
|
+
if (!dir && lockFile && lockFile.packages[ref.key]) {
|
|
310
|
+
warnings.push(`Package ${ref.key} is in lock file but not installed (broken symlink?)`);
|
|
311
|
+
}
|
|
312
|
+
return dir;
|
|
313
|
+
}
|
|
314
|
+
// Resolve connections
|
|
315
|
+
const connTasks = [...connectionNames].map(async (name) => {
|
|
316
|
+
const repoDir = path.join(repoPath, 'connections', name);
|
|
317
|
+
const repoDirExists = await dirExists(repoDir);
|
|
318
|
+
const pkgDir = await getPkgDir('connection', name);
|
|
319
|
+
const result = await resolveConnection(name, repoDirExists ? repoDir : null, pkgDir);
|
|
320
|
+
if (result)
|
|
321
|
+
connections.set(name, result);
|
|
322
|
+
});
|
|
323
|
+
// Resolve skills
|
|
324
|
+
const skillTasks = [...skillNames].map(async (name) => {
|
|
325
|
+
const repoDir = path.join(repoPath, 'skills', name);
|
|
326
|
+
const repoDirExists = await dirExists(repoDir);
|
|
327
|
+
const pkgDir = await getPkgDir('skill', name);
|
|
328
|
+
const result = await resolveSkill(name, repoDirExists ? repoDir : null, pkgDir);
|
|
329
|
+
if (result)
|
|
330
|
+
skills.push(result);
|
|
331
|
+
});
|
|
332
|
+
// Resolve automations
|
|
333
|
+
const autoTasks = [...automationNames].map(async (name) => {
|
|
334
|
+
const repoDir = path.join(repoPath, 'automations');
|
|
335
|
+
const repoDirExists = await dirExists(repoDir);
|
|
336
|
+
const pkgDir = await getPkgDir('automation', name);
|
|
337
|
+
const result = await resolveAutomation(name, repoDirExists ? repoDir : null, pkgDir);
|
|
338
|
+
if (result)
|
|
339
|
+
automations.push(result);
|
|
340
|
+
});
|
|
341
|
+
// Resolve knowledge
|
|
342
|
+
const knowledgeTasks = [...knowledgeNames].map(async (name) => {
|
|
343
|
+
const repoDir = path.join(repoPath, 'knowledge');
|
|
344
|
+
const repoDirExists = await dirExists(repoDir);
|
|
345
|
+
const pkgDir = await getPkgDir('knowledge', name);
|
|
346
|
+
const result = await resolveKnowledge(name, repoDirExists ? repoDir : null, pkgDir);
|
|
347
|
+
if (result)
|
|
348
|
+
knowledge.push(result);
|
|
349
|
+
});
|
|
350
|
+
await Promise.all([...connTasks, ...skillTasks, ...autoTasks, ...knowledgeTasks]);
|
|
351
|
+
return { connections, skills, automations, knowledge, warnings };
|
|
352
|
+
}
|
|
353
|
+
//# sourceMappingURL=resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.js","sourceRoot":"","sources":["../../../src/packages/resolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAC,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAGlC,OAAO,EAAC,eAAe,EAAE,UAAU,EAAE,cAAc,EAAE,eAAe,EAAC,MAAM,oBAAoB,CAAC;AAGhG,OAAO,EAAC,eAAe,EAAE,wBAAwB,EAAC,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAC,eAAe,EAAE,kBAAkB,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAClH,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AA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MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QACjD,MAAM,aAAa,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC;QAC/C,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAClD,MAAM,MAAM,GAAG,MAAM,gBAAgB,CACnC,IAAI,EACJ,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAC9B,MAAM,CACP,CAAC;QACF,IAAI,MAAM;YAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,EAAE,GAAG,UAAU,EAAE,GAAG,SAAS,EAAE,GAAG,cAAc,CAAC,CAAC,CAAC;IAElF,OAAO,EAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAC,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import type { AmodalConfigExtensions } from '../amodal-config.js';
|
|
7
|
+
import type { VersionManager } from '../versions/version-manager.js';
|
|
8
|
+
import type { AgentSDKConfig } from './platform-types.js';
|
|
9
|
+
/**
|
|
10
|
+
* The subset of AmodalConfigExtensions that comes from version bundles
|
|
11
|
+
* and SDK-level settings, plus a versionBundleVersion string.
|
|
12
|
+
*/
|
|
13
|
+
export type PlatformConfigParams = AmodalConfigExtensions & {
|
|
14
|
+
versionBundleVersion?: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Merge version config (from VersionManager) and SDK config into
|
|
18
|
+
* fields suitable for the AmodalConfig constructor.
|
|
19
|
+
*
|
|
20
|
+
* Bundle-derived fields (tools, roles, handlers) come from versionConfig.
|
|
21
|
+
* Operational fields (connections, audit, activeRole) come from sdkConfig.
|
|
22
|
+
* The bundle version string is used as auditVersion.
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildPlatformConfigParams(versionConfig: ReturnType<VersionManager['getVersionConfig']>, sdkConfig: AgentSDKConfig): Partial<PlatformConfigParams>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Merge version config (from VersionManager) and SDK config into
|
|
8
|
+
* fields suitable for the AmodalConfig constructor.
|
|
9
|
+
*
|
|
10
|
+
* Bundle-derived fields (tools, roles, handlers) come from versionConfig.
|
|
11
|
+
* Operational fields (connections, audit, activeRole) come from sdkConfig.
|
|
12
|
+
* The bundle version string is used as auditVersion.
|
|
13
|
+
*/
|
|
14
|
+
export function buildPlatformConfigParams(versionConfig, sdkConfig) {
|
|
15
|
+
const params = {};
|
|
16
|
+
// Platform API credentials from SDK config
|
|
17
|
+
if (sdkConfig.platform) {
|
|
18
|
+
params.platformApiUrl = sdkConfig.platform.apiUrl;
|
|
19
|
+
params.platformApiKey = sdkConfig.platform.apiKey;
|
|
20
|
+
}
|
|
21
|
+
// Application and tenant IDs
|
|
22
|
+
if (sdkConfig.applicationId) {
|
|
23
|
+
params.applicationId = sdkConfig.applicationId;
|
|
24
|
+
}
|
|
25
|
+
if (sdkConfig.tenantId) {
|
|
26
|
+
params.tenantId = sdkConfig.tenantId;
|
|
27
|
+
}
|
|
28
|
+
// Agent context from SDK config (may be auto-detected from org)
|
|
29
|
+
if (sdkConfig.agentContext) {
|
|
30
|
+
params.agentContext = sdkConfig.agentContext;
|
|
31
|
+
}
|
|
32
|
+
// Disabled platform tools from SDK config (fetched from application)
|
|
33
|
+
if (sdkConfig.disabledPlatformTools && sdkConfig.disabledPlatformTools.length > 0) {
|
|
34
|
+
params.disabledBuiltInTools = sdkConfig.disabledPlatformTools;
|
|
35
|
+
}
|
|
36
|
+
// Connections from SDK config (local secrets, never from platform)
|
|
37
|
+
if (sdkConfig.connections) {
|
|
38
|
+
params.connections = sdkConfig.connections;
|
|
39
|
+
}
|
|
40
|
+
// Active role from SDK config
|
|
41
|
+
if (sdkConfig.activeRole) {
|
|
42
|
+
params.activeRole = sdkConfig.activeRole;
|
|
43
|
+
}
|
|
44
|
+
// Audit config from SDK config
|
|
45
|
+
if (sdkConfig.auditConfig != null) {
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- audit config from SDK
|
|
47
|
+
params.auditConfig = sdkConfig.auditConfig;
|
|
48
|
+
}
|
|
49
|
+
if (sdkConfig.auditUser) {
|
|
50
|
+
params.auditUser = sdkConfig.auditUser;
|
|
51
|
+
}
|
|
52
|
+
if (sdkConfig.auditSource) {
|
|
53
|
+
params.auditSource = sdkConfig.auditSource;
|
|
54
|
+
}
|
|
55
|
+
// Version bundle fields
|
|
56
|
+
if (versionConfig) {
|
|
57
|
+
params.httpToolConfigs = versionConfig.httpToolConfigs;
|
|
58
|
+
params.chainToolConfigs = versionConfig.chainToolConfigs;
|
|
59
|
+
params.functionToolConfigs = versionConfig.functionToolConfigs;
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- handler map from version manager
|
|
61
|
+
params.functionToolHandlers = versionConfig.functionToolHandlers;
|
|
62
|
+
params.roleDefinitions = versionConfig.roleDefinitions;
|
|
63
|
+
params.auditVersion = versionConfig.version;
|
|
64
|
+
params.versionBundleVersion = versionConfig.version;
|
|
65
|
+
params.bundleSkills = versionConfig.skills;
|
|
66
|
+
params.automationDefinitions = versionConfig.automations;
|
|
67
|
+
}
|
|
68
|
+
return params;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=config-builder.js.map
|
|
@@ -0,0 +1 @@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yright 2026 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import type { VersionBundle, BundleToolConfig, BundleSkill, SubagentConfig } from '../versions/version-bundle-types.js';
|
|
7
|
+
import type { PlatformConfig, ConnectionInfo } from './platform-types.js';
|
|
8
|
+
import type { KBDocument, ScopeType } from '../knowledge/kb-types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Organization record returned by the platform API.
|
|
11
|
+
*/
|
|
12
|
+
export interface OrgRecord {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
agent_context?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Application record returned by the platform API.
|
|
19
|
+
*/
|
|
20
|
+
export interface AppRecord {
|
|
21
|
+
id: string;
|
|
22
|
+
org_id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
base_prompt?: string;
|
|
25
|
+
agent_context?: string;
|
|
26
|
+
disabled_platform_tools?: string[];
|
|
27
|
+
model?: string;
|
|
28
|
+
simple_model?: string;
|
|
29
|
+
advanced_model?: string;
|
|
30
|
+
provider?: string;
|
|
31
|
+
provider_base_url?: string;
|
|
32
|
+
provider_api_key?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A resolved secret (name + decrypted value) returned by the platform API.
|
|
36
|
+
*/
|
|
37
|
+
export interface ResolvedSecret {
|
|
38
|
+
name: string;
|
|
39
|
+
value: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Request config for a connection, describing how to build HTTP requests.
|
|
43
|
+
*/
|
|
44
|
+
export interface RequestConfigRecord {
|
|
45
|
+
base_url_field: string;
|
|
46
|
+
auth: Array<{
|
|
47
|
+
header: string;
|
|
48
|
+
value_template: string;
|
|
49
|
+
}>;
|
|
50
|
+
default_headers: Record<string, string>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A resolved connection with credentials and optional request config.
|
|
54
|
+
*/
|
|
55
|
+
export interface ResolvedConnection {
|
|
56
|
+
credentials: Record<string, string>;
|
|
57
|
+
request_config?: RequestConfigRecord;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Map of connection names to their resolved credentials and request config.
|
|
61
|
+
*/
|
|
62
|
+
export type ResolvedConnectionMap = Record<string, ResolvedConnection>;
|
|
63
|
+
/**
|
|
64
|
+
* Client for communicating with the platform API.
|
|
65
|
+
* Fetches version bundles for a specific deployment.
|
|
66
|
+
*/
|
|
67
|
+
export declare class PlatformClient {
|
|
68
|
+
private readonly config;
|
|
69
|
+
constructor(config: PlatformConfig);
|
|
70
|
+
/**
|
|
71
|
+
* Fetch the latest version bundle for this deployment.
|
|
72
|
+
*/
|
|
73
|
+
fetchLatestBundle(timeout?: number): Promise<VersionBundle>;
|
|
74
|
+
/**
|
|
75
|
+
* Fetch knowledge base documents for a given scope.
|
|
76
|
+
*
|
|
77
|
+
* @param scopeType 'application' or 'tenant'
|
|
78
|
+
* @param scopeId The application or tenant ID
|
|
79
|
+
* @param timeout Request timeout in ms (default 30000)
|
|
80
|
+
*/
|
|
81
|
+
fetchDocuments(scopeType: ScopeType, scopeId: string, sessionType?: string, timeout?: number): Promise<KBDocument[]>;
|
|
82
|
+
/**
|
|
83
|
+
* Fetch documents matching any of the given tags.
|
|
84
|
+
*/
|
|
85
|
+
fetchDocumentsByTags(scopeType: ScopeType, scopeId: string, tags: string[], timeout?: number): Promise<KBDocument[]>;
|
|
86
|
+
/**
|
|
87
|
+
* Search documents by title keyword.
|
|
88
|
+
*/
|
|
89
|
+
searchDocuments(scopeType: ScopeType, scopeId: string, query: string, timeout?: number): Promise<KBDocument[]>;
|
|
90
|
+
/**
|
|
91
|
+
* Fetch specific documents by their IDs.
|
|
92
|
+
*/
|
|
93
|
+
fetchDocumentsByIds(scopeType: ScopeType, scopeId: string, ids: string[], timeout?: number): Promise<KBDocument[]>;
|
|
94
|
+
/**
|
|
95
|
+
* Internal helper: fetch documents with optional query params.
|
|
96
|
+
*/
|
|
97
|
+
private fetchDocumentsWithParams;
|
|
98
|
+
/**
|
|
99
|
+
* Fetch organization details.
|
|
100
|
+
*
|
|
101
|
+
* @param orgId The organization ID
|
|
102
|
+
* @param timeout Request timeout in ms (default 30000)
|
|
103
|
+
*/
|
|
104
|
+
fetchOrganization(orgId: string, timeout?: number): Promise<OrgRecord>;
|
|
105
|
+
/**
|
|
106
|
+
* Fetch application details (including base_prompt and agent_context).
|
|
107
|
+
*
|
|
108
|
+
* @param appId The application ID
|
|
109
|
+
* @param timeout Request timeout in ms (default 30000)
|
|
110
|
+
*/
|
|
111
|
+
fetchApplication(appId: string, timeout?: number): Promise<AppRecord>;
|
|
112
|
+
/**
|
|
113
|
+
* Fetch the active deployment snapshot blob.
|
|
114
|
+
* Returns the raw snapshot record or null if none is active.
|
|
115
|
+
*/
|
|
116
|
+
fetchActiveSnapshot(timeout?: number, deployId?: string): Promise<Record<string, unknown> | null>;
|
|
117
|
+
/**
|
|
118
|
+
* Resolve decrypted secrets for a tenant.
|
|
119
|
+
*
|
|
120
|
+
* @param tenantId The tenant ID
|
|
121
|
+
* @param timeout Request timeout in ms (default 30000)
|
|
122
|
+
*/
|
|
123
|
+
resolveSecrets(tenantId: string, timeout?: number): Promise<ResolvedSecret[]>;
|
|
124
|
+
/**
|
|
125
|
+
* Resolve connections for a tenant — returns per-connection credentials + request_config.
|
|
126
|
+
*
|
|
127
|
+
* @param tenantId The tenant ID
|
|
128
|
+
* @param timeout Request timeout in ms (default 30000)
|
|
129
|
+
*/
|
|
130
|
+
resolveConnections(tenantId: string, timeout?: number): Promise<ResolvedConnectionMap>;
|
|
131
|
+
/**
|
|
132
|
+
* Fetch custom tools for a deployment (application).
|
|
133
|
+
*
|
|
134
|
+
* @param appId The application/deployment ID
|
|
135
|
+
* @param timeout Request timeout in ms (default 30000)
|
|
136
|
+
*/
|
|
137
|
+
fetchTools(appId: string, sessionType?: string, timeout?: number): Promise<BundleToolConfig[]>;
|
|
138
|
+
/**
|
|
139
|
+
* Fetch skills for a deployment (application).
|
|
140
|
+
*
|
|
141
|
+
* @param appId The application/deployment ID
|
|
142
|
+
* @param timeout Request timeout in ms (default 30000)
|
|
143
|
+
*/
|
|
144
|
+
fetchSkills(appId: string, sessionType?: string, timeout?: number): Promise<BundleSkill[]>;
|
|
145
|
+
/**
|
|
146
|
+
* Fetch subagent (task agent) configurations for a deployment.
|
|
147
|
+
*
|
|
148
|
+
* @param appId The application/deployment ID
|
|
149
|
+
* @param timeout Request timeout in ms (default 30000)
|
|
150
|
+
*/
|
|
151
|
+
fetchSubagents(appId: string, sessionType?: string, timeout?: number): Promise<SubagentConfig[]>;
|
|
152
|
+
/**
|
|
153
|
+
* Fetch connection metadata for an application.
|
|
154
|
+
* Returns name, provider, and description for each connection — no credentials.
|
|
155
|
+
*
|
|
156
|
+
* @param appId The application ID
|
|
157
|
+
* @param timeout Request timeout in ms (default 30000)
|
|
158
|
+
*/
|
|
159
|
+
fetchConnections(appId: string, sessionType?: string, timeout?: number): Promise<ConnectionInfo[]>;
|
|
160
|
+
}
|