@syrin/cli 1.3.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 +15 -0
- package/README.md +302 -0
- package/dist/cli/commands/analyse.d.ts +16 -0
- package/dist/cli/commands/analyse.js +61 -0
- package/dist/cli/commands/dev.d.ts +23 -0
- package/dist/cli/commands/dev.js +419 -0
- package/dist/cli/commands/doctor.d.ts +10 -0
- package/dist/cli/commands/doctor.js +195 -0
- package/dist/cli/commands/index.d.ts +12 -0
- package/dist/cli/commands/index.js +12 -0
- package/dist/cli/commands/init.d.ts +16 -0
- package/dist/cli/commands/init.js +90 -0
- package/dist/cli/commands/list.d.ts +15 -0
- package/dist/cli/commands/list.js +50 -0
- package/dist/cli/commands/rollback.d.ts +12 -0
- package/dist/cli/commands/rollback.js +101 -0
- package/dist/cli/commands/test.d.ts +31 -0
- package/dist/cli/commands/test.js +88 -0
- package/dist/cli/commands/update.d.ts +9 -0
- package/dist/cli/commands/update.js +76 -0
- package/dist/cli/index.d.ts +13 -0
- package/dist/cli/index.js +342 -0
- package/dist/cli/prompts/index.d.ts +5 -0
- package/dist/cli/prompts/index.js +5 -0
- package/dist/cli/prompts/init-prompt.d.ts +17 -0
- package/dist/cli/prompts/init-prompt.js +263 -0
- package/dist/cli/utils/command-error-handler.d.ts +14 -0
- package/dist/cli/utils/command-error-handler.js +35 -0
- package/dist/cli/utils/common-types.d.ts +24 -0
- package/dist/cli/utils/common-types.js +6 -0
- package/dist/cli/utils/connection-handler.d.ts +37 -0
- package/dist/cli/utils/connection-handler.js +90 -0
- package/dist/cli/utils/index.d.ts +11 -0
- package/dist/cli/utils/index.js +11 -0
- package/dist/cli/utils/option-parsers.d.ts +41 -0
- package/dist/cli/utils/option-parsers.js +92 -0
- package/dist/cli/utils/output-utils.d.ts +12 -0
- package/dist/cli/utils/output-utils.js +21 -0
- package/dist/cli/utils/transport-resolver.d.ts +33 -0
- package/dist/cli/utils/transport-resolver.js +82 -0
- package/dist/cli/utils/version-banner.d.ts +10 -0
- package/dist/cli/utils/version-banner.js +26 -0
- package/dist/config/env-checker.d.ts +37 -0
- package/dist/config/env-checker.js +136 -0
- package/dist/config/generator.d.ts +19 -0
- package/dist/config/generator.js +196 -0
- package/dist/config/index.d.ts +9 -0
- package/dist/config/index.js +9 -0
- package/dist/config/loader.d.ts +19 -0
- package/dist/config/loader.js +57 -0
- package/dist/config/schema.d.ts +42 -0
- package/dist/config/schema.js +181 -0
- package/dist/config/syrin.template.yaml +127 -0
- package/dist/config/types.d.ts +87 -0
- package/dist/config/types.js +6 -0
- package/dist/constants/app.d.ts +9 -0
- package/dist/constants/app.js +9 -0
- package/dist/constants/commands.d.ts +43 -0
- package/dist/constants/commands.js +43 -0
- package/dist/constants/defaults.d.ts +18 -0
- package/dist/constants/defaults.js +18 -0
- package/dist/constants/env-vars.d.ts +11 -0
- package/dist/constants/env-vars.js +11 -0
- package/dist/constants/icons.d.ts +23 -0
- package/dist/constants/icons.js +23 -0
- package/dist/constants/index.d.ts +17 -0
- package/dist/constants/index.js +17 -0
- package/dist/constants/labels.d.ts +38 -0
- package/dist/constants/labels.js +42 -0
- package/dist/constants/links.d.ts +10 -0
- package/dist/constants/links.js +11 -0
- package/dist/constants/list.d.ts +10 -0
- package/dist/constants/list.js +9 -0
- package/dist/constants/llm.d.ts +26 -0
- package/dist/constants/llm.js +25 -0
- package/dist/constants/messages.d.ts +107 -0
- package/dist/constants/messages.js +138 -0
- package/dist/constants/paths.d.ts +29 -0
- package/dist/constants/paths.js +29 -0
- package/dist/constants/transport.d.ts +9 -0
- package/dist/constants/transport.js +8 -0
- package/dist/events/emitter.d.ts +64 -0
- package/dist/events/emitter.js +142 -0
- package/dist/events/event-type.d.ts +66 -0
- package/dist/events/event-type.js +81 -0
- package/dist/events/payloads/diagnostics.d.ts +24 -0
- package/dist/events/payloads/diagnostics.js +5 -0
- package/dist/events/payloads/index.d.ts +15 -0
- package/dist/events/payloads/index.js +6 -0
- package/dist/events/payloads/llm.d.ts +58 -0
- package/dist/events/payloads/llm.js +6 -0
- package/dist/events/payloads/registry.d.ts +28 -0
- package/dist/events/payloads/registry.js +5 -0
- package/dist/events/payloads/session.d.ts +32 -0
- package/dist/events/payloads/session.js +5 -0
- package/dist/events/payloads/testing.d.ts +17 -0
- package/dist/events/payloads/testing.js +5 -0
- package/dist/events/payloads/tool.d.ts +29 -0
- package/dist/events/payloads/tool.js +5 -0
- package/dist/events/payloads/transport.d.ts +30 -0
- package/dist/events/payloads/transport.js +5 -0
- package/dist/events/payloads/validation.d.ts +37 -0
- package/dist/events/payloads/validation.js +5 -0
- package/dist/events/payloads/workflow.d.ts +45 -0
- package/dist/events/payloads/workflow.js +5 -0
- package/dist/events/store/file-store.d.ts +37 -0
- package/dist/events/store/file-store.js +113 -0
- package/dist/events/store/index.d.ts +7 -0
- package/dist/events/store/index.js +6 -0
- package/dist/events/store/memory-store.d.ts +26 -0
- package/dist/events/store/memory-store.js +39 -0
- package/dist/events/store.d.ts +11 -0
- package/dist/events/store.js +2 -0
- package/dist/events/types.d.ts +14 -0
- package/dist/events/types.js +2 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +30 -0
- package/dist/presentation/analysis-ui.d.ts +24 -0
- package/dist/presentation/analysis-ui.js +158 -0
- package/dist/presentation/dev/chat-ui-types.d.ts +68 -0
- package/dist/presentation/dev/chat-ui-types.js +5 -0
- package/dist/presentation/dev/chat-ui.d.ts +61 -0
- package/dist/presentation/dev/chat-ui.js +714 -0
- package/dist/presentation/dev/components/assistant-message.d.ts +19 -0
- package/dist/presentation/dev/components/assistant-message.js +36 -0
- package/dist/presentation/dev/components/header.d.ts +16 -0
- package/dist/presentation/dev/components/header.js +22 -0
- package/dist/presentation/dev/components/index.d.ts +13 -0
- package/dist/presentation/dev/components/index.js +13 -0
- package/dist/presentation/dev/components/input-panel.d.ts +22 -0
- package/dist/presentation/dev/components/input-panel.js +43 -0
- package/dist/presentation/dev/components/message-component.d.ts +16 -0
- package/dist/presentation/dev/components/message-component.js +51 -0
- package/dist/presentation/dev/components/messages-list.d.ts +24 -0
- package/dist/presentation/dev/components/messages-list.js +48 -0
- package/dist/presentation/dev/components/system-message.d.ts +16 -0
- package/dist/presentation/dev/components/system-message.js +26 -0
- package/dist/presentation/dev/components/user-message.d.ts +21 -0
- package/dist/presentation/dev/components/user-message.js +35 -0
- package/dist/presentation/dev/components/welcome-banner.d.ts +24 -0
- package/dist/presentation/dev/components/welcome-banner.js +146 -0
- package/dist/presentation/dev/goodbye-messages.d.ts +31 -0
- package/dist/presentation/dev/goodbye-messages.js +100 -0
- package/dist/presentation/dev/index.d.ts +5 -0
- package/dist/presentation/dev/index.js +5 -0
- package/dist/presentation/dev/text-wrapper.d.ts +30 -0
- package/dist/presentation/dev/text-wrapper.js +74 -0
- package/dist/presentation/dev-ui.d.ts +33 -0
- package/dist/presentation/dev-ui.js +246 -0
- package/dist/presentation/doctor-ui.d.ts +40 -0
- package/dist/presentation/doctor-ui.js +157 -0
- package/dist/presentation/init-ui.d.ts +14 -0
- package/dist/presentation/init-ui.js +41 -0
- package/dist/presentation/list-ui.d.ts +44 -0
- package/dist/presentation/list-ui.js +139 -0
- package/dist/presentation/test-ui.d.ts +49 -0
- package/dist/presentation/test-ui.js +358 -0
- package/dist/runtime/analysis/analyser.d.ts +14 -0
- package/dist/runtime/analysis/analyser.js +88 -0
- package/dist/runtime/analysis/dependencies.d.ts +10 -0
- package/dist/runtime/analysis/dependencies.js +140 -0
- package/dist/runtime/analysis/index.d.ts +10 -0
- package/dist/runtime/analysis/index.js +10 -0
- package/dist/runtime/analysis/indexer.d.ts +10 -0
- package/dist/runtime/analysis/indexer.js +62 -0
- package/dist/runtime/analysis/loader.d.ts +15 -0
- package/dist/runtime/analysis/loader.js +47 -0
- package/dist/runtime/analysis/normalizer.d.ts +14 -0
- package/dist/runtime/analysis/normalizer.js +184 -0
- package/dist/runtime/analysis/rules/__test-helpers__.d.ts +18 -0
- package/dist/runtime/analysis/rules/__test-helpers__.js +40 -0
- package/dist/runtime/analysis/rules/base.d.ts +38 -0
- package/dist/runtime/analysis/rules/base.js +23 -0
- package/dist/runtime/analysis/rules/error-codes.d.ts +64 -0
- package/dist/runtime/analysis/rules/error-codes.js +73 -0
- package/dist/runtime/analysis/rules/errors/e000-tool-not-found.d.ts +35 -0
- package/dist/runtime/analysis/rules/errors/e000-tool-not-found.js +32 -0
- package/dist/runtime/analysis/rules/errors/e001-missing-output-schema.d.ts +22 -0
- package/dist/runtime/analysis/rules/errors/e001-missing-output-schema.js +30 -0
- package/dist/runtime/analysis/rules/errors/e002-underspecified-input.d.ts +24 -0
- package/dist/runtime/analysis/rules/errors/e002-underspecified-input.js +52 -0
- package/dist/runtime/analysis/rules/errors/e003-type-mismatch.d.ts +23 -0
- package/dist/runtime/analysis/rules/errors/e003-type-mismatch.js +73 -0
- package/dist/runtime/analysis/rules/errors/e004-free-text-propagation.d.ts +23 -0
- package/dist/runtime/analysis/rules/errors/e004-free-text-propagation.js +47 -0
- package/dist/runtime/analysis/rules/errors/e005-tool-ambiguity.d.ts +25 -0
- package/dist/runtime/analysis/rules/errors/e005-tool-ambiguity.js +73 -0
- package/dist/runtime/analysis/rules/errors/e006-param-not-in-description.d.ts +22 -0
- package/dist/runtime/analysis/rules/errors/e006-param-not-in-description.js +57 -0
- package/dist/runtime/analysis/rules/errors/e007-output-not-guaranteed.d.ts +23 -0
- package/dist/runtime/analysis/rules/errors/e007-output-not-guaranteed.js +56 -0
- package/dist/runtime/analysis/rules/errors/e008-circular-dependency.d.ts +22 -0
- package/dist/runtime/analysis/rules/errors/e008-circular-dependency.js +84 -0
- package/dist/runtime/analysis/rules/errors/e009-implicit-user-input.d.ts +23 -0
- package/dist/runtime/analysis/rules/errors/e009-implicit-user-input.js +89 -0
- package/dist/runtime/analysis/rules/errors/e010-non-serializable.d.ts +25 -0
- package/dist/runtime/analysis/rules/errors/e010-non-serializable.js +46 -0
- package/dist/runtime/analysis/rules/errors/e011-missing-tool-description.d.ts +24 -0
- package/dist/runtime/analysis/rules/errors/e011-missing-tool-description.js +33 -0
- package/dist/runtime/analysis/rules/errors/e012-side-effect-detected.d.ts +39 -0
- package/dist/runtime/analysis/rules/errors/e012-side-effect-detected.js +40 -0
- package/dist/runtime/analysis/rules/errors/e013-non-deterministic-output.d.ts +37 -0
- package/dist/runtime/analysis/rules/errors/e013-non-deterministic-output.js +34 -0
- package/dist/runtime/analysis/rules/errors/e013-output-explosion.d.ts +39 -0
- package/dist/runtime/analysis/rules/errors/e013-output-explosion.js +36 -0
- package/dist/runtime/analysis/rules/errors/e014-hidden-dependency.d.ts +42 -0
- package/dist/runtime/analysis/rules/errors/e014-hidden-dependency.js +46 -0
- package/dist/runtime/analysis/rules/errors/e014-output-explosion.d.ts +39 -0
- package/dist/runtime/analysis/rules/errors/e014-output-explosion.js +36 -0
- package/dist/runtime/analysis/rules/errors/e015-hidden-dependency.d.ts +42 -0
- package/dist/runtime/analysis/rules/errors/e015-hidden-dependency.js +46 -0
- package/dist/runtime/analysis/rules/errors/e015-unbounded-execution.d.ts +44 -0
- package/dist/runtime/analysis/rules/errors/e015-unbounded-execution.js +66 -0
- package/dist/runtime/analysis/rules/errors/e016-output-validation-failed.d.ts +43 -0
- package/dist/runtime/analysis/rules/errors/e016-output-validation-failed.js +42 -0
- package/dist/runtime/analysis/rules/errors/e016-unbounded-execution.d.ts +44 -0
- package/dist/runtime/analysis/rules/errors/e016-unbounded-execution.js +66 -0
- package/dist/runtime/analysis/rules/errors/e017-input-validation-failed.d.ts +57 -0
- package/dist/runtime/analysis/rules/errors/e017-input-validation-failed.js +80 -0
- package/dist/runtime/analysis/rules/errors/e017-output-validation-failed.d.ts +43 -0
- package/dist/runtime/analysis/rules/errors/e017-output-validation-failed.js +42 -0
- package/dist/runtime/analysis/rules/errors/e018-input-validation-failed.d.ts +57 -0
- package/dist/runtime/analysis/rules/errors/e018-input-validation-failed.js +80 -0
- package/dist/runtime/analysis/rules/errors/e018-tool-execution-failed.d.ts +38 -0
- package/dist/runtime/analysis/rules/errors/e018-tool-execution-failed.js +37 -0
- package/dist/runtime/analysis/rules/errors/e019-tool-execution-failed.d.ts +38 -0
- package/dist/runtime/analysis/rules/errors/e019-tool-execution-failed.js +37 -0
- package/dist/runtime/analysis/rules/errors/e019-unexpected-test-result.d.ts +65 -0
- package/dist/runtime/analysis/rules/errors/e019-unexpected-test-result.js +109 -0
- package/dist/runtime/analysis/rules/errors/e020-unexpected-test-result.d.ts +65 -0
- package/dist/runtime/analysis/rules/errors/e020-unexpected-test-result.js +109 -0
- package/dist/runtime/analysis/rules/errors/e100-missing-output-schema.d.ts +22 -0
- package/dist/runtime/analysis/rules/errors/e100-missing-output-schema.js +30 -0
- package/dist/runtime/analysis/rules/errors/e101-missing-tool-description.d.ts +24 -0
- package/dist/runtime/analysis/rules/errors/e101-missing-tool-description.js +33 -0
- package/dist/runtime/analysis/rules/errors/e102-underspecified-input.d.ts +24 -0
- package/dist/runtime/analysis/rules/errors/e102-underspecified-input.js +52 -0
- package/dist/runtime/analysis/rules/errors/e103-type-mismatch.d.ts +23 -0
- package/dist/runtime/analysis/rules/errors/e103-type-mismatch.js +72 -0
- package/dist/runtime/analysis/rules/errors/e104-param-not-in-description.d.ts +22 -0
- package/dist/runtime/analysis/rules/errors/e104-param-not-in-description.js +57 -0
- package/dist/runtime/analysis/rules/errors/e105-free-text-propagation.d.ts +23 -0
- package/dist/runtime/analysis/rules/errors/e105-free-text-propagation.js +47 -0
- package/dist/runtime/analysis/rules/errors/e106-output-not-guaranteed.d.ts +23 -0
- package/dist/runtime/analysis/rules/errors/e106-output-not-guaranteed.js +58 -0
- package/dist/runtime/analysis/rules/errors/e107-circular-dependency.d.ts +22 -0
- package/dist/runtime/analysis/rules/errors/e107-circular-dependency.js +84 -0
- package/dist/runtime/analysis/rules/errors/e108-implicit-user-input.d.ts +23 -0
- package/dist/runtime/analysis/rules/errors/e108-implicit-user-input.js +94 -0
- package/dist/runtime/analysis/rules/errors/e109-non-serializable.d.ts +25 -0
- package/dist/runtime/analysis/rules/errors/e109-non-serializable.js +44 -0
- package/dist/runtime/analysis/rules/errors/e110-tool-ambiguity.d.ts +25 -0
- package/dist/runtime/analysis/rules/errors/e110-tool-ambiguity.js +73 -0
- package/dist/runtime/analysis/rules/errors/e200-input-validation-failed.d.ts +57 -0
- package/dist/runtime/analysis/rules/errors/e200-input-validation-failed.js +71 -0
- package/dist/runtime/analysis/rules/errors/e300-output-validation-failed.d.ts +43 -0
- package/dist/runtime/analysis/rules/errors/e300-output-validation-failed.js +44 -0
- package/dist/runtime/analysis/rules/errors/e301-output-explosion.d.ts +39 -0
- package/dist/runtime/analysis/rules/errors/e301-output-explosion.js +36 -0
- package/dist/runtime/analysis/rules/errors/e400-tool-execution-failed.d.ts +38 -0
- package/dist/runtime/analysis/rules/errors/e400-tool-execution-failed.js +37 -0
- package/dist/runtime/analysis/rules/errors/e403-unbounded-execution.d.ts +44 -0
- package/dist/runtime/analysis/rules/errors/e403-unbounded-execution.js +66 -0
- package/dist/runtime/analysis/rules/errors/e500-side-effect-detected.d.ts +39 -0
- package/dist/runtime/analysis/rules/errors/e500-side-effect-detected.js +40 -0
- package/dist/runtime/analysis/rules/errors/e501-hidden-dependency.d.ts +47 -0
- package/dist/runtime/analysis/rules/errors/e501-hidden-dependency.js +46 -0
- package/dist/runtime/analysis/rules/errors/e600-unexpected-test-result.d.ts +65 -0
- package/dist/runtime/analysis/rules/errors/e600-unexpected-test-result.js +109 -0
- package/dist/runtime/analysis/rules/index.d.ts +18 -0
- package/dist/runtime/analysis/rules/index.js +94 -0
- package/dist/runtime/analysis/rules/warnings/w001-implicit-dependency.d.ts +22 -0
- package/dist/runtime/analysis/rules/warnings/w001-implicit-dependency.js +39 -0
- package/dist/runtime/analysis/rules/warnings/w002-free-text-without-normalization.d.ts +24 -0
- package/dist/runtime/analysis/rules/warnings/w002-free-text-without-normalization.js +40 -0
- package/dist/runtime/analysis/rules/warnings/w003-missing-examples.d.ts +22 -0
- package/dist/runtime/analysis/rules/warnings/w003-missing-examples.js +84 -0
- package/dist/runtime/analysis/rules/warnings/w004-overloaded-responsibility.d.ts +23 -0
- package/dist/runtime/analysis/rules/warnings/w004-overloaded-responsibility.js +96 -0
- package/dist/runtime/analysis/rules/warnings/w005-generic-description.d.ts +53 -0
- package/dist/runtime/analysis/rules/warnings/w005-generic-description.js +108 -0
- package/dist/runtime/analysis/rules/warnings/w006-optional-as-required.d.ts +22 -0
- package/dist/runtime/analysis/rules/warnings/w006-optional-as-required.js +44 -0
- package/dist/runtime/analysis/rules/warnings/w007-broad-output-schema.d.ts +23 -0
- package/dist/runtime/analysis/rules/warnings/w007-broad-output-schema.js +37 -0
- package/dist/runtime/analysis/rules/warnings/w008-multiple-entry-points.d.ts +22 -0
- package/dist/runtime/analysis/rules/warnings/w008-multiple-entry-points.js +97 -0
- package/dist/runtime/analysis/rules/warnings/w009-hidden-side-effects.d.ts +23 -0
- package/dist/runtime/analysis/rules/warnings/w009-hidden-side-effects.js +88 -0
- package/dist/runtime/analysis/rules/warnings/w010-output-not-reusable.d.ts +22 -0
- package/dist/runtime/analysis/rules/warnings/w010-output-not-reusable.js +81 -0
- package/dist/runtime/analysis/rules/warnings/w021-weak-schema.d.ts +40 -0
- package/dist/runtime/analysis/rules/warnings/w021-weak-schema.js +32 -0
- package/dist/runtime/analysis/rules/warnings/w022-high-entropy-output.d.ts +39 -0
- package/dist/runtime/analysis/rules/warnings/w022-high-entropy-output.js +36 -0
- package/dist/runtime/analysis/rules/warnings/w023-unstable-defaults.d.ts +38 -0
- package/dist/runtime/analysis/rules/warnings/w023-unstable-defaults.js +36 -0
- package/dist/runtime/analysis/rules/warnings/w100-implicit-dependency.d.ts +22 -0
- package/dist/runtime/analysis/rules/warnings/w100-implicit-dependency.js +89 -0
- package/dist/runtime/analysis/rules/warnings/w101-free-text-without-normalization.d.ts +24 -0
- package/dist/runtime/analysis/rules/warnings/w101-free-text-without-normalization.js +40 -0
- package/dist/runtime/analysis/rules/warnings/w102-missing-examples.d.ts +22 -0
- package/dist/runtime/analysis/rules/warnings/w102-missing-examples.js +76 -0
- package/dist/runtime/analysis/rules/warnings/w103-overloaded-responsibility.d.ts +23 -0
- package/dist/runtime/analysis/rules/warnings/w103-overloaded-responsibility.js +91 -0
- package/dist/runtime/analysis/rules/warnings/w104-generic-description.d.ts +53 -0
- package/dist/runtime/analysis/rules/warnings/w104-generic-description.js +108 -0
- package/dist/runtime/analysis/rules/warnings/w105-optional-as-required.d.ts +22 -0
- package/dist/runtime/analysis/rules/warnings/w105-optional-as-required.js +45 -0
- package/dist/runtime/analysis/rules/warnings/w106-broad-output-schema.d.ts +23 -0
- package/dist/runtime/analysis/rules/warnings/w106-broad-output-schema.js +37 -0
- package/dist/runtime/analysis/rules/warnings/w107-multiple-entry-points.d.ts +22 -0
- package/dist/runtime/analysis/rules/warnings/w107-multiple-entry-points.js +97 -0
- package/dist/runtime/analysis/rules/warnings/w108-hidden-side-effects.d.ts +23 -0
- package/dist/runtime/analysis/rules/warnings/w108-hidden-side-effects.js +94 -0
- package/dist/runtime/analysis/rules/warnings/w109-output-not-reusable.d.ts +22 -0
- package/dist/runtime/analysis/rules/warnings/w109-output-not-reusable.js +63 -0
- package/dist/runtime/analysis/rules/warnings/w110-weak-schema.d.ts +40 -0
- package/dist/runtime/analysis/rules/warnings/w110-weak-schema.js +32 -0
- package/dist/runtime/analysis/rules/warnings/w300-high-entropy-output.d.ts +39 -0
- package/dist/runtime/analysis/rules/warnings/w300-high-entropy-output.js +47 -0
- package/dist/runtime/analysis/rules/warnings/w301-unstable-defaults.d.ts +38 -0
- package/dist/runtime/analysis/rules/warnings/w301-unstable-defaults.js +36 -0
- package/dist/runtime/analysis/strict-mode.d.ts +21 -0
- package/dist/runtime/analysis/strict-mode.js +44 -0
- package/dist/runtime/analysis/types.d.ts +133 -0
- package/dist/runtime/analysis/types.js +6 -0
- package/dist/runtime/analysis/utils.d.ts +19 -0
- package/dist/runtime/analysis/utils.js +21 -0
- package/dist/runtime/dev/data-manager.d.ts +55 -0
- package/dist/runtime/dev/data-manager.js +87 -0
- package/dist/runtime/dev/event-mapper.d.ts +100 -0
- package/dist/runtime/dev/event-mapper.js +400 -0
- package/dist/runtime/dev/formatter.d.ts +94 -0
- package/dist/runtime/dev/formatter.js +236 -0
- package/dist/runtime/dev/index.d.ts +9 -0
- package/dist/runtime/dev/index.js +9 -0
- package/dist/runtime/dev/repl.d.ts +114 -0
- package/dist/runtime/dev/repl.js +310 -0
- package/dist/runtime/dev/session.d.ts +86 -0
- package/dist/runtime/dev/session.js +447 -0
- package/dist/runtime/dev/stack-trace.d.ts +77 -0
- package/dist/runtime/dev/stack-trace.js +286 -0
- package/dist/runtime/dev/types.d.ts +54 -0
- package/dist/runtime/dev/types.js +5 -0
- package/dist/runtime/llm/claude.d.ts +27 -0
- package/dist/runtime/llm/claude.js +150 -0
- package/dist/runtime/llm/factory.d.ts +30 -0
- package/dist/runtime/llm/factory.js +78 -0
- package/dist/runtime/llm/index.d.ts +10 -0
- package/dist/runtime/llm/index.js +10 -0
- package/dist/runtime/llm/ollama.d.ts +45 -0
- package/dist/runtime/llm/ollama.js +449 -0
- package/dist/runtime/llm/openai.d.ts +27 -0
- package/dist/runtime/llm/openai.js +170 -0
- package/dist/runtime/llm/provider.d.ts +32 -0
- package/dist/runtime/llm/provider.js +6 -0
- package/dist/runtime/llm/types.d.ts +55 -0
- package/dist/runtime/llm/types.js +6 -0
- package/dist/runtime/mcp/client/base.d.ts +40 -0
- package/dist/runtime/mcp/client/base.js +157 -0
- package/dist/runtime/mcp/client/manager.d.ts +91 -0
- package/dist/runtime/mcp/client/manager.js +248 -0
- package/dist/runtime/mcp/client/process.d.ts +31 -0
- package/dist/runtime/mcp/client/process.js +82 -0
- package/dist/runtime/mcp/connection.d.ts +63 -0
- package/dist/runtime/mcp/connection.js +449 -0
- package/dist/runtime/mcp/index.d.ts +9 -0
- package/dist/runtime/mcp/index.js +9 -0
- package/dist/runtime/mcp/list.d.ts +50 -0
- package/dist/runtime/mcp/list.js +65 -0
- package/dist/runtime/mcp/stdio-transport.d.ts +23 -0
- package/dist/runtime/mcp/stdio-transport.js +71 -0
- package/dist/runtime/mcp/types.d.ts +85 -0
- package/dist/runtime/mcp/types.js +6 -0
- package/dist/runtime/sandbox/executor.d.ts +102 -0
- package/dist/runtime/sandbox/executor.js +537 -0
- package/dist/runtime/sandbox/index.d.ts +9 -0
- package/dist/runtime/sandbox/index.js +9 -0
- package/dist/runtime/sandbox/io-monitor.d.ts +78 -0
- package/dist/runtime/sandbox/io-monitor.js +98 -0
- package/dist/runtime/sandbox/time-parser.d.ts +19 -0
- package/dist/runtime/sandbox/time-parser.js +67 -0
- package/dist/runtime/sandbox/types.d.ts +58 -0
- package/dist/runtime/sandbox/types.js +23 -0
- package/dist/runtime/test/behavior-observer.d.ts +61 -0
- package/dist/runtime/test/behavior-observer.js +140 -0
- package/dist/runtime/test/contract-loader.d.ts +41 -0
- package/dist/runtime/test/contract-loader.js +158 -0
- package/dist/runtime/test/contract-schema.d.ts +46 -0
- package/dist/runtime/test/contract-schema.js +107 -0
- package/dist/runtime/test/contract-types.d.ts +106 -0
- package/dist/runtime/test/contract-types.js +6 -0
- package/dist/runtime/test/dependency-tracker.d.ts +66 -0
- package/dist/runtime/test/dependency-tracker.js +80 -0
- package/dist/runtime/test/formatters.d.ts +18 -0
- package/dist/runtime/test/formatters.js +172 -0
- package/dist/runtime/test/index.d.ts +12 -0
- package/dist/runtime/test/index.js +13 -0
- package/dist/runtime/test/input-generator.d.ts +33 -0
- package/dist/runtime/test/input-generator.js +498 -0
- package/dist/runtime/test/mcp-root-detector.d.ts +31 -0
- package/dist/runtime/test/mcp-root-detector.js +105 -0
- package/dist/runtime/test/orchestrator.d.ts +131 -0
- package/dist/runtime/test/orchestrator.js +738 -0
- package/dist/runtime/test/output-validator.d.ts +44 -0
- package/dist/runtime/test/output-validator.js +262 -0
- package/dist/runtime/test/retry-tester.d.ts +44 -0
- package/dist/runtime/test/retry-tester.js +103 -0
- package/dist/runtime/test/runner.d.ts +28 -0
- package/dist/runtime/test/runner.js +55 -0
- package/dist/runtime/test/synthetic-input-generator.d.ts +11 -0
- package/dist/runtime/test/synthetic-input-generator.js +154 -0
- package/dist/runtime/test/test-runner.d.ts +28 -0
- package/dist/runtime/test/test-runner.js +55 -0
- package/dist/types/factories.d.ts +16 -0
- package/dist/types/factories.js +43 -0
- package/dist/types/ids.d.ts +16 -0
- package/dist/types/ids.js +2 -0
- package/dist/types/opaque.d.ts +4 -0
- package/dist/types/opaque.js +2 -0
- package/dist/utils/errors.d.ts +92 -0
- package/dist/utils/errors.js +97 -0
- package/dist/utils/gitignore.d.ts +11 -0
- package/dist/utils/gitignore.js +59 -0
- package/dist/utils/json-file-saver.d.ts +17 -0
- package/dist/utils/json-file-saver.js +81 -0
- package/dist/utils/json-formatter.d.ts +63 -0
- package/dist/utils/json-formatter.js +344 -0
- package/dist/utils/logger.d.ts +184 -0
- package/dist/utils/logger.js +330 -0
- package/dist/utils/package-manager.d.ts +30 -0
- package/dist/utils/package-manager.js +157 -0
- package/dist/utils/version-checker.d.ts +47 -0
- package/dist/utils/version-checker.js +167 -0
- package/dist/utils/version-display.d.ts +10 -0
- package/dist/utils/version-display.js +20 -0
- package/package.json +106 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP listing utilities.
|
|
3
|
+
* Provides functions to list tools, resources, and prompts from MCP servers.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Helper function to handle errors consistently across list functions.
|
|
7
|
+
*/
|
|
8
|
+
function handleListError(operation, error) {
|
|
9
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
10
|
+
throw new Error(`Failed to list ${operation}: ${errorMessage}`);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* List all tools available from the MCP server.
|
|
14
|
+
*/
|
|
15
|
+
export async function listTools(client) {
|
|
16
|
+
try {
|
|
17
|
+
const response = await client.listTools();
|
|
18
|
+
return {
|
|
19
|
+
tools: response.tools || [],
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
handleListError('tools', error);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* List all resources available from the MCP server.
|
|
28
|
+
*/
|
|
29
|
+
export async function listResources(client) {
|
|
30
|
+
try {
|
|
31
|
+
const response = await client.listResources();
|
|
32
|
+
return {
|
|
33
|
+
resources: response.resources || [],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
handleListError('resources', error);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* List all prompts available from the MCP server.
|
|
42
|
+
*/
|
|
43
|
+
export async function listPrompts(client) {
|
|
44
|
+
try {
|
|
45
|
+
const response = await client.listPrompts();
|
|
46
|
+
return {
|
|
47
|
+
prompts: response.prompts || [],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
handleListError('prompts', error);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Close the MCP transport connection.
|
|
56
|
+
*/
|
|
57
|
+
export async function closeConnection(transport) {
|
|
58
|
+
try {
|
|
59
|
+
await transport.close();
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
// Ignore errors during cleanup
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stdio transport utilities for MCP.
|
|
3
|
+
* Provides functions to get connected clients via stdio transport.
|
|
4
|
+
*/
|
|
5
|
+
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
6
|
+
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
|
|
7
|
+
import * as childProcess from 'child_process';
|
|
8
|
+
import type { Command } from '../../types/ids.js';
|
|
9
|
+
/**
|
|
10
|
+
* Get a connected MCP client via stdio transport that stays open for operations.
|
|
11
|
+
* Use this when you need to perform multiple operations with the same connection.
|
|
12
|
+
* Remember to call close() on the transport when done.
|
|
13
|
+
*
|
|
14
|
+
* @param command - The command to execute (e.g., "python3 server.py")
|
|
15
|
+
* @param timeout - Connection timeout in milliseconds (default: 10000)
|
|
16
|
+
* @returns Connected client and transport instances
|
|
17
|
+
*/
|
|
18
|
+
export declare function getConnectedStdioClient(command: Command | string, timeout?: number): Promise<{
|
|
19
|
+
client: Client;
|
|
20
|
+
transport: StdioClientTransport;
|
|
21
|
+
process: childProcess.ChildProcess;
|
|
22
|
+
}>;
|
|
23
|
+
//# sourceMappingURL=stdio-transport.d.ts.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stdio transport utilities for MCP.
|
|
3
|
+
* Provides functions to get connected clients via stdio transport.
|
|
4
|
+
*/
|
|
5
|
+
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
6
|
+
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
|
|
7
|
+
import * as childProcess from 'child_process';
|
|
8
|
+
/**
|
|
9
|
+
* Get a connected MCP client via stdio transport that stays open for operations.
|
|
10
|
+
* Use this when you need to perform multiple operations with the same connection.
|
|
11
|
+
* Remember to call close() on the transport when done.
|
|
12
|
+
*
|
|
13
|
+
* @param command - The command to execute (e.g., "python3 server.py")
|
|
14
|
+
* @param timeout - Connection timeout in milliseconds (default: 10000)
|
|
15
|
+
* @returns Connected client and transport instances
|
|
16
|
+
*/
|
|
17
|
+
export async function getConnectedStdioClient(command, timeout = 10000) {
|
|
18
|
+
// Split command into executable and arguments
|
|
19
|
+
const parts = command.trim().split(/\s+/);
|
|
20
|
+
const executable = parts[0];
|
|
21
|
+
const args = parts.slice(1);
|
|
22
|
+
if (!executable) {
|
|
23
|
+
throw new Error('Command is empty');
|
|
24
|
+
}
|
|
25
|
+
// Create MCP client
|
|
26
|
+
const client = new Client({
|
|
27
|
+
name: 'syrin',
|
|
28
|
+
version: '1.0.0',
|
|
29
|
+
}, {
|
|
30
|
+
capabilities: {},
|
|
31
|
+
});
|
|
32
|
+
// Spawn the process
|
|
33
|
+
const childProc = childProcess.spawn(executable, args, {
|
|
34
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
35
|
+
env: process.env,
|
|
36
|
+
});
|
|
37
|
+
// Create stdio transport
|
|
38
|
+
const transport = new StdioClientTransport({
|
|
39
|
+
command: executable,
|
|
40
|
+
args,
|
|
41
|
+
env: process.env,
|
|
42
|
+
});
|
|
43
|
+
// Set up error handler
|
|
44
|
+
client.onerror = () => {
|
|
45
|
+
// Error handler - errors are logged but we'll catch them in try-catch
|
|
46
|
+
};
|
|
47
|
+
// Set up process error handler
|
|
48
|
+
childProc.on('error', (error) => {
|
|
49
|
+
throw new Error(`Failed to start process: ${error.message}`);
|
|
50
|
+
});
|
|
51
|
+
// Try to connect with timeout
|
|
52
|
+
const connectionPromise = client.connect(transport);
|
|
53
|
+
// Create a timeout promise
|
|
54
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
55
|
+
setTimeout(() => {
|
|
56
|
+
childProc.kill();
|
|
57
|
+
reject(new Error(`Connection timeout after ${timeout}ms`));
|
|
58
|
+
}, timeout);
|
|
59
|
+
});
|
|
60
|
+
// Race between connection and timeout
|
|
61
|
+
try {
|
|
62
|
+
await Promise.race([connectionPromise, timeoutPromise]);
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
// Clean up on error
|
|
66
|
+
childProc.kill();
|
|
67
|
+
throw error;
|
|
68
|
+
}
|
|
69
|
+
return { client, transport, process: childProc };
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=stdio-transport.js.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for MCP connections.
|
|
3
|
+
* These types represent the structure of MCP connection results and connection information.
|
|
4
|
+
*/
|
|
5
|
+
import type { MCPURL, Command } from '../../types/ids.js';
|
|
6
|
+
import type { TransportType } from '../../config/types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Result of connecting to an MCP server.
|
|
9
|
+
*/
|
|
10
|
+
export interface MCPConnectionResult {
|
|
11
|
+
/** Whether the connection was successful */
|
|
12
|
+
success: boolean;
|
|
13
|
+
/** Transport type used */
|
|
14
|
+
transport: TransportType;
|
|
15
|
+
/** Error message if connection failed */
|
|
16
|
+
error?: string;
|
|
17
|
+
/** Connection details */
|
|
18
|
+
details?: MCPConnectionDetails;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Request/response information for debugging.
|
|
22
|
+
*/
|
|
23
|
+
export interface MCPRequestInfo {
|
|
24
|
+
/** HTTP method used */
|
|
25
|
+
method?: string;
|
|
26
|
+
/** URL endpoint */
|
|
27
|
+
url?: string;
|
|
28
|
+
/** Headers sent */
|
|
29
|
+
headers?: Record<string, string>;
|
|
30
|
+
/** Request body/payload */
|
|
31
|
+
body?: unknown;
|
|
32
|
+
}
|
|
33
|
+
export interface MCPResponseInfo {
|
|
34
|
+
/** HTTP status code */
|
|
35
|
+
statusCode?: number;
|
|
36
|
+
/** Response headers */
|
|
37
|
+
headers?: Record<string, string>;
|
|
38
|
+
/** Response body */
|
|
39
|
+
body?: unknown;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Detailed information about an MCP connection.
|
|
43
|
+
*/
|
|
44
|
+
export interface MCPConnectionDetails {
|
|
45
|
+
/** The MCP URL (for HTTP transport) */
|
|
46
|
+
mcpUrl?: string;
|
|
47
|
+
/** The command (for stdio transport) */
|
|
48
|
+
command?: string;
|
|
49
|
+
/** Discovery URL (if applicable) */
|
|
50
|
+
discoveryUrl?: string;
|
|
51
|
+
/** Protocol version (if available) */
|
|
52
|
+
protocolVersion?: string;
|
|
53
|
+
/** Server capabilities (if available) - keys are capability names */
|
|
54
|
+
capabilities?: Record<string, unknown>;
|
|
55
|
+
/** Additional metadata */
|
|
56
|
+
metadata?: Record<string, unknown>;
|
|
57
|
+
/** Client instance (for reuse in other commands) */
|
|
58
|
+
client?: unknown;
|
|
59
|
+
/** Transport instance (for reuse in other commands) */
|
|
60
|
+
transport?: unknown;
|
|
61
|
+
/** Initialize request information */
|
|
62
|
+
initializeRequest?: MCPRequestInfo;
|
|
63
|
+
/** Initialize response information */
|
|
64
|
+
initializeResponse?: MCPResponseInfo;
|
|
65
|
+
/** Session ID if available */
|
|
66
|
+
sessionId?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Options for connecting to an MCP server.
|
|
70
|
+
*/
|
|
71
|
+
export interface MCPConnectionOptions {
|
|
72
|
+
/** Transport type to use */
|
|
73
|
+
transport: TransportType;
|
|
74
|
+
/** MCP URL (for http transport) */
|
|
75
|
+
url?: MCPURL | string;
|
|
76
|
+
/** Command to execute (for stdio transport) */
|
|
77
|
+
command?: Command | string;
|
|
78
|
+
/** Timeout in milliseconds */
|
|
79
|
+
timeout?: number;
|
|
80
|
+
/** Environment variables (for stdio transport) */
|
|
81
|
+
env?: Record<string, string>;
|
|
82
|
+
/** Authentication headers (for http transport) */
|
|
83
|
+
headers?: Record<string, string>;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox executor for isolated tool execution.
|
|
3
|
+
* Provides isolated execution environment with process reuse for performance.
|
|
4
|
+
* This module is reusable for any sandboxed execution needs, not just testing.
|
|
5
|
+
*/
|
|
6
|
+
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
7
|
+
import type { Command } from '../../types/ids.js';
|
|
8
|
+
import type { ToolExecutionResult } from './types.js';
|
|
9
|
+
export * from './types.js';
|
|
10
|
+
/**
|
|
11
|
+
* Options for sandbox execution.
|
|
12
|
+
*/
|
|
13
|
+
export interface SandboxOptions {
|
|
14
|
+
/** Timeout for tool execution in milliseconds */
|
|
15
|
+
timeout: number;
|
|
16
|
+
/** Memory limit in MB (enforced via command wrapping).
|
|
17
|
+
*
|
|
18
|
+
* Memory limits are enforced by wrapping the command:
|
|
19
|
+
* - POSIX systems: Wraps command with `ulimit -v <memoryMB>M &&`
|
|
20
|
+
* - Node.js commands: Injects `--max-old-space-size=<memoryMB>` into node args
|
|
21
|
+
* - Other commands: Uses ulimit wrapper on POSIX systems
|
|
22
|
+
*/
|
|
23
|
+
memoryLimitMB?: number;
|
|
24
|
+
/** MCP server command to execute */
|
|
25
|
+
mcpCommand: Command | string;
|
|
26
|
+
/** Environment variables for the process */
|
|
27
|
+
env?: Record<string, string>;
|
|
28
|
+
/** Project root directory (for detecting side effects) */
|
|
29
|
+
projectRoot: string;
|
|
30
|
+
/** Suppress stderr output (redirect to /dev/null) */
|
|
31
|
+
suppressStderr?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Sandbox executor with process reuse.
|
|
35
|
+
* Starts MCP server once, executes multiple tools, then closes.
|
|
36
|
+
*/
|
|
37
|
+
export declare class SandboxExecutor {
|
|
38
|
+
private client;
|
|
39
|
+
private transport;
|
|
40
|
+
private tempDir;
|
|
41
|
+
private initialized;
|
|
42
|
+
private readonly options;
|
|
43
|
+
constructor(options: SandboxOptions);
|
|
44
|
+
/**
|
|
45
|
+
* Initialize the sandbox (start MCP server process).
|
|
46
|
+
* This should be called once before testing multiple tools.
|
|
47
|
+
*/
|
|
48
|
+
initialize(): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Parse MCP protocol response and extract output or error.
|
|
51
|
+
* Handles various response formats from MCP SDK.
|
|
52
|
+
* @param rawResult - Raw result from MCP SDK
|
|
53
|
+
* @param timedOut - Whether execution timed out
|
|
54
|
+
* @returns Object with output and error (mutually exclusive)
|
|
55
|
+
*/
|
|
56
|
+
private parseMcpResponse;
|
|
57
|
+
/**
|
|
58
|
+
* Check if text content looks like an error message.
|
|
59
|
+
* This handles cases where MCP servers return errors as text instead of proper error responses.
|
|
60
|
+
*/
|
|
61
|
+
private isErrorText;
|
|
62
|
+
/**
|
|
63
|
+
* Classify error type from error message and MCP protocol response.
|
|
64
|
+
*/
|
|
65
|
+
private classifyError;
|
|
66
|
+
/**
|
|
67
|
+
* Execute a tool with the given inputs.
|
|
68
|
+
* @param toolName - Name of the tool to execute
|
|
69
|
+
* @param inputs - Array of input objects to test
|
|
70
|
+
* @param timeoutMs - Optional per-tool timeout in milliseconds (overrides default)
|
|
71
|
+
* @returns Array of execution results (one per input)
|
|
72
|
+
*/
|
|
73
|
+
executeTool(toolName: string, inputs: Array<Record<string, unknown>>, timeoutMs?: number): Promise<ToolExecutionResult[]>;
|
|
74
|
+
/**
|
|
75
|
+
* Format timeout in milliseconds to human-readable string.
|
|
76
|
+
*/
|
|
77
|
+
private formatTimeout;
|
|
78
|
+
/**
|
|
79
|
+
* Get the MCP client instance (for reuse by orchestrator).
|
|
80
|
+
* @returns The MCP client, or null if not initialized
|
|
81
|
+
*/
|
|
82
|
+
getClient(): Client | null;
|
|
83
|
+
/**
|
|
84
|
+
* Get current process memory usage (if available).
|
|
85
|
+
* @returns Memory usage in MB, or undefined if not available
|
|
86
|
+
*/
|
|
87
|
+
private getProcessMemoryUsage;
|
|
88
|
+
/**
|
|
89
|
+
* Cleanup sandbox resources.
|
|
90
|
+
* Should be called after all tools are tested.
|
|
91
|
+
*/
|
|
92
|
+
cleanup(): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Check if sandbox is initialized.
|
|
95
|
+
*/
|
|
96
|
+
isInitialized(): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Get the temp directory path.
|
|
99
|
+
*/
|
|
100
|
+
getTempDir(): string | null;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=executor.d.ts.map
|