@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,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `syrin init` command implementation.
|
|
3
|
+
* Initializes a new Syrin project with configuration.
|
|
4
|
+
*/
|
|
5
|
+
import { generateConfigFile, isProjectInitialized } from '../../config/generator.js';
|
|
6
|
+
import { promptInitOptions, getDefaultInitOptions, } from '../../cli/prompts/init-prompt.js';
|
|
7
|
+
import { ConfigurationError } from '../../utils/errors.js';
|
|
8
|
+
import { logger } from '../../utils/logger.js';
|
|
9
|
+
import { Messages, Paths } from '../../constants/index.js';
|
|
10
|
+
import { ensureGitignorePattern } from '../../utils/gitignore.js';
|
|
11
|
+
import { displayAlreadyInitialized, displayInitSuccess, } from '../../presentation/init-ui.js';
|
|
12
|
+
import { showVersionBanner } from '../../cli/utils/version-banner.js';
|
|
13
|
+
/**
|
|
14
|
+
* Execute the init command.
|
|
15
|
+
* @param options - Command options
|
|
16
|
+
*/
|
|
17
|
+
export async function executeInit(options = {}) {
|
|
18
|
+
await showVersionBanner();
|
|
19
|
+
const projectRoot = options.projectRoot || process.cwd();
|
|
20
|
+
// Check if project is already initialized
|
|
21
|
+
if (isProjectInitialized(projectRoot)) {
|
|
22
|
+
displayAlreadyInitialized();
|
|
23
|
+
// Exit gracefully without showing error stack
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
let initOptions;
|
|
27
|
+
if (options.yes) {
|
|
28
|
+
// Non-interactive mode: use defaults
|
|
29
|
+
logger.info('Initializing project with default values (non-interactive mode)');
|
|
30
|
+
initOptions = getDefaultInitOptions(projectRoot);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
// Interactive mode: prompt user
|
|
34
|
+
logger.info('Starting interactive project initialization');
|
|
35
|
+
try {
|
|
36
|
+
initOptions = await promptInitOptions();
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
if (error instanceof Error && error.name === 'ExitPromptError') {
|
|
40
|
+
// User cancelled
|
|
41
|
+
logger.info('Initialization cancelled by user');
|
|
42
|
+
process.exit(0);
|
|
43
|
+
}
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
// Generate config file
|
|
49
|
+
const configPath = generateConfigFile(initOptions, projectRoot);
|
|
50
|
+
logger.info('Configuration file created successfully', {
|
|
51
|
+
configPath,
|
|
52
|
+
projectName: initOptions.projectName,
|
|
53
|
+
transport: initOptions.transport,
|
|
54
|
+
});
|
|
55
|
+
// Update .gitignore to exclude event files and dev history
|
|
56
|
+
try {
|
|
57
|
+
const eventsPatternAdded = await ensureGitignorePattern(projectRoot, Paths.EVENTS_DIR);
|
|
58
|
+
if (eventsPatternAdded) {
|
|
59
|
+
logger.info(`Added ${Paths.EVENTS_DIR} to .gitignore`);
|
|
60
|
+
}
|
|
61
|
+
const historyPatternAdded = await ensureGitignorePattern(projectRoot, Paths.DEV_HISTORY_FILE);
|
|
62
|
+
if (historyPatternAdded) {
|
|
63
|
+
logger.info('Added .syrin/.dev-history to .gitignore');
|
|
64
|
+
}
|
|
65
|
+
const dataPatternAdded = await ensureGitignorePattern(projectRoot, Paths.DATA_DIR);
|
|
66
|
+
if (dataPatternAdded) {
|
|
67
|
+
logger.info(`Added ${Paths.DATA_DIR} to .gitignore`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
// Log but don't fail initialization if .gitignore update fails
|
|
72
|
+
logger.warn('Failed to update .gitignore', {
|
|
73
|
+
error: error instanceof Error ? error.message : String(error),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
// Display success message
|
|
77
|
+
displayInitSuccess(configPath);
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
const configError = error instanceof ConfigurationError
|
|
81
|
+
? error
|
|
82
|
+
: new ConfigurationError(Messages.ERROR_GENERATE_CONFIG, {
|
|
83
|
+
cause: error instanceof Error ? error : new Error(String(error)),
|
|
84
|
+
context: { projectRoot },
|
|
85
|
+
});
|
|
86
|
+
logger.error('Failed to initialize project', configError);
|
|
87
|
+
throw configError;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `syrin list` command implementation.
|
|
3
|
+
* Lists tools, resources, or prompts from an MCP server.
|
|
4
|
+
*/
|
|
5
|
+
import { type TransportCommandOptions } from '../../cli/utils/index.js';
|
|
6
|
+
import type { ListType } from '../../constants/list.js';
|
|
7
|
+
interface ListCommandOptions extends TransportCommandOptions {
|
|
8
|
+
type?: ListType;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Execute the list command.
|
|
12
|
+
*/
|
|
13
|
+
export declare function executeList(options: ListCommandOptions): Promise<void>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `syrin list` command implementation.
|
|
3
|
+
* Lists tools, resources, or prompts from an MCP server.
|
|
4
|
+
*/
|
|
5
|
+
import { listTools, listResources, listPrompts } from '../../runtime/mcp/index.js';
|
|
6
|
+
import { handleCommandError, resolveTransportConfig, establishConnection, safeCloseConnection, } from '../../cli/utils/index.js';
|
|
7
|
+
import { Messages, ListTypes } from '../../constants/index.js';
|
|
8
|
+
import { displayTools, displayResources, displayPrompts, } from '../../presentation/list-ui.js';
|
|
9
|
+
/**
|
|
10
|
+
* Execute the list command.
|
|
11
|
+
*/
|
|
12
|
+
export async function executeList(options) {
|
|
13
|
+
try {
|
|
14
|
+
const { type = ListTypes.TOOLS } = options;
|
|
15
|
+
// Resolve transport configuration from options and config
|
|
16
|
+
const { transport: finalTransport, url: mcpUrl, script: mcpCommand, urlSource, env, authHeaders, } = resolveTransportConfig(options);
|
|
17
|
+
// Connect to MCP server with centralized error handling
|
|
18
|
+
const { client, transport: mcpTransport } = await establishConnection({
|
|
19
|
+
transport: finalTransport,
|
|
20
|
+
url: mcpUrl,
|
|
21
|
+
script: mcpCommand,
|
|
22
|
+
urlSource,
|
|
23
|
+
env,
|
|
24
|
+
authHeaders,
|
|
25
|
+
});
|
|
26
|
+
try {
|
|
27
|
+
// List based on type
|
|
28
|
+
if (type === ListTypes.TOOLS) {
|
|
29
|
+
const toolsResult = await listTools(client);
|
|
30
|
+
await displayTools(toolsResult.tools);
|
|
31
|
+
}
|
|
32
|
+
else if (type === ListTypes.RESOURCES) {
|
|
33
|
+
const resourcesResult = await listResources(client);
|
|
34
|
+
await displayResources(resourcesResult.resources);
|
|
35
|
+
}
|
|
36
|
+
else if (type === ListTypes.PROMPTS) {
|
|
37
|
+
const promptsResult = await listPrompts(client);
|
|
38
|
+
await displayPrompts(promptsResult.prompts);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
finally {
|
|
42
|
+
// Always close the connection safely
|
|
43
|
+
await safeCloseConnection(mcpTransport);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
handleCommandError(error, Messages.LIST_ERROR_FAILED(options.type || 'items'));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `syrin rollback` command implementation.
|
|
3
|
+
* Rolls back Syrin to a previous version.
|
|
4
|
+
*/
|
|
5
|
+
export interface RollbackCommandOptions {
|
|
6
|
+
version: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Execute the rollback command.
|
|
10
|
+
*/
|
|
11
|
+
export declare function executeRollback(options: RollbackCommandOptions): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=rollback.d.ts.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `syrin rollback` command implementation.
|
|
3
|
+
* Rolls back Syrin to a previous version.
|
|
4
|
+
*/
|
|
5
|
+
import { getCurrentVersion, fetchPackageInfo, compareVersions, } from '../../utils/version-checker.js';
|
|
6
|
+
import { installPackageVersion, isValidVersion, normalizeVersion, detectInstallType, } from '../../utils/package-manager.js';
|
|
7
|
+
import { handleCommandError } from '../../cli/utils/index.js';
|
|
8
|
+
import { Messages } from '../../constants/index.js';
|
|
9
|
+
import { Icons } from '../../constants/index.js';
|
|
10
|
+
import { SYRIN_LINKS } from '../../constants/links.js';
|
|
11
|
+
import { ConfigurationError } from '../../utils/errors.js';
|
|
12
|
+
import { log } from '../../utils/logger.js';
|
|
13
|
+
import { PACKAGE_NAME } from '../../constants/app.js';
|
|
14
|
+
/**
|
|
15
|
+
* Execute the rollback command.
|
|
16
|
+
*/
|
|
17
|
+
export async function executeRollback(options) {
|
|
18
|
+
try {
|
|
19
|
+
const { version } = options;
|
|
20
|
+
// Validate version format
|
|
21
|
+
if (!isValidVersion(version)) {
|
|
22
|
+
throw new ConfigurationError(Messages.ROLLBACK_INVALID_VERSION(version));
|
|
23
|
+
}
|
|
24
|
+
const normalizedVersion = normalizeVersion(version);
|
|
25
|
+
const currentVersion = getCurrentVersion();
|
|
26
|
+
// Check if trying to rollback to current version
|
|
27
|
+
if (normalizedVersion === currentVersion) {
|
|
28
|
+
log.info(`Already on version v${normalizedVersion}`);
|
|
29
|
+
log.blank();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
// Verify version exists on npm registry
|
|
33
|
+
log.info(`Verifying version v${normalizedVersion} exists on npm registry...`);
|
|
34
|
+
try {
|
|
35
|
+
const packageInfo = await fetchPackageInfo(PACKAGE_NAME);
|
|
36
|
+
if (!packageInfo.versions ||
|
|
37
|
+
!(normalizedVersion in packageInfo.versions)) {
|
|
38
|
+
throw new ConfigurationError(Messages.ROLLBACK_VERSION_NOT_FOUND(`v${normalizedVersion}`));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
if (error instanceof ConfigurationError) {
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
// If it's a network error, warn but continue
|
|
46
|
+
log.warning('Could not verify version on registry (continuing anyway...)');
|
|
47
|
+
log.blank();
|
|
48
|
+
}
|
|
49
|
+
// Compare versions to warn about rolling back
|
|
50
|
+
const comparison = compareVersions(currentVersion, normalizedVersion);
|
|
51
|
+
if (comparison > 0) {
|
|
52
|
+
log.warning(`Warning: Rolling back to an older version (v${currentVersion} -> v${normalizedVersion})`);
|
|
53
|
+
log.blank();
|
|
54
|
+
}
|
|
55
|
+
// Determine install type for better error messages
|
|
56
|
+
const installType = detectInstallType();
|
|
57
|
+
log.info(Messages.ROLLBACK_IN_PROGRESS(`v${normalizedVersion}`, PACKAGE_NAME));
|
|
58
|
+
// Install the specific version
|
|
59
|
+
const result = await installPackageVersion(normalizedVersion, PACKAGE_NAME);
|
|
60
|
+
if (result.success) {
|
|
61
|
+
const installedVersion = result.version || normalizedVersion;
|
|
62
|
+
log.blank();
|
|
63
|
+
log.success(`${Icons.CHECK} ${Messages.ROLLBACK_SUCCESS(`v${installedVersion}`)}`);
|
|
64
|
+
log.blank();
|
|
65
|
+
// Show helpful message about config compatibility
|
|
66
|
+
log.info('Make sure your config.yaml is compatible with this version.');
|
|
67
|
+
log.plain(` Documentation: ${SYRIN_LINKS.DOCS}`);
|
|
68
|
+
log.blank();
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
const errorMessage = result.error || Messages.ROLLBACK_FAILED;
|
|
72
|
+
// Check if it's a permission error
|
|
73
|
+
if (errorMessage.includes('EACCES') ||
|
|
74
|
+
errorMessage.includes('permission')) {
|
|
75
|
+
const sudoCommand = installType === 'global'
|
|
76
|
+
? `sudo npm install -g ${PACKAGE_NAME}@${normalizedVersion}`
|
|
77
|
+
: `npm install ${PACKAGE_NAME}@${normalizedVersion}`;
|
|
78
|
+
log.blank();
|
|
79
|
+
log.error(Messages.UPDATE_PERMISSION_HINT(sudoCommand));
|
|
80
|
+
log.blank();
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
log.blank();
|
|
84
|
+
log.error(Messages.ROLLBACK_ERROR(errorMessage));
|
|
85
|
+
log.blank();
|
|
86
|
+
}
|
|
87
|
+
process.exit(1);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
if (error instanceof ConfigurationError) {
|
|
92
|
+
log.blank();
|
|
93
|
+
log.error(error.message);
|
|
94
|
+
log.blank();
|
|
95
|
+
process.exit(1);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
handleCommandError(error, Messages.ROLLBACK_FAILED);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=rollback.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `syrin test` command implementation.
|
|
3
|
+
* Tests MCP connection and validates tool contracts.
|
|
4
|
+
*/
|
|
5
|
+
import { type TransportCommandOptions } from '../../cli/utils/index.js';
|
|
6
|
+
interface TestCommandOptions extends TransportCommandOptions {
|
|
7
|
+
/** Test connection only (legacy behavior) */
|
|
8
|
+
connection?: boolean;
|
|
9
|
+
/** Test specific tool only */
|
|
10
|
+
tool?: string;
|
|
11
|
+
/** Test all tools in a specific path (relative to tools directory) */
|
|
12
|
+
path?: string;
|
|
13
|
+
/** Strict mode (treat warnings as errors) */
|
|
14
|
+
strict?: boolean;
|
|
15
|
+
/** JSON output */
|
|
16
|
+
json?: boolean;
|
|
17
|
+
/** CI mode (minimal output, exit code 1 on errors) */
|
|
18
|
+
ci?: boolean;
|
|
19
|
+
/** Show sandbox process error output (stderr from MCP server) */
|
|
20
|
+
showErrors?: boolean;
|
|
21
|
+
/** Tools directory */
|
|
22
|
+
toolsDir?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Execute the test command.
|
|
26
|
+
*
|
|
27
|
+
* @param options - Command options
|
|
28
|
+
*/
|
|
29
|
+
export declare function executeTest(options: TestCommandOptions): Promise<void>;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=test.d.ts.map
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `syrin test` command implementation.
|
|
3
|
+
* Tests MCP connection and validates tool contracts.
|
|
4
|
+
*/
|
|
5
|
+
import { connectMCP } from '../../runtime/mcp/index.js';
|
|
6
|
+
import { handleCommandError, resolveTransportConfig, } from '../../cli/utils/index.js';
|
|
7
|
+
import { displayTestResults, formatCLIResults, formatCIResults, formatJSONResults, } from '../../presentation/test-ui.js';
|
|
8
|
+
import { TestOrchestrator } from '../../runtime/test/orchestrator.js';
|
|
9
|
+
import { log } from '../../utils/logger.js';
|
|
10
|
+
/**
|
|
11
|
+
* Execute the test command.
|
|
12
|
+
*
|
|
13
|
+
* @param options - Command options
|
|
14
|
+
*/
|
|
15
|
+
export async function executeTest(options) {
|
|
16
|
+
try {
|
|
17
|
+
// If --connection flag is set, use legacy connection testing
|
|
18
|
+
if (options.connection) {
|
|
19
|
+
await executeConnectionTest(options);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
// Otherwise, run tool validation
|
|
23
|
+
const exitCode = await executeToolValidation(options);
|
|
24
|
+
process.exit(exitCode);
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
handleCommandError(error);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Execute connection test (legacy behavior).
|
|
32
|
+
*/
|
|
33
|
+
async function executeConnectionTest(options) {
|
|
34
|
+
// Resolve transport configuration from options and config
|
|
35
|
+
const { transport, url, script, env, authHeaders } = resolveTransportConfig(options);
|
|
36
|
+
// Perform the test
|
|
37
|
+
const result = await connectMCP({
|
|
38
|
+
transport,
|
|
39
|
+
url,
|
|
40
|
+
command: script,
|
|
41
|
+
env,
|
|
42
|
+
headers: authHeaders,
|
|
43
|
+
});
|
|
44
|
+
// Display results using Ink UI
|
|
45
|
+
await displayTestResults({
|
|
46
|
+
result,
|
|
47
|
+
transport,
|
|
48
|
+
});
|
|
49
|
+
// Exit with appropriate code
|
|
50
|
+
if (!result.success) {
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Execute tool validation.
|
|
56
|
+
* @returns Exit code (0 for pass, 1 for fail)
|
|
57
|
+
*/
|
|
58
|
+
async function executeToolValidation(options) {
|
|
59
|
+
const projectRoot = options.projectRoot || process.cwd();
|
|
60
|
+
// Create orchestrator
|
|
61
|
+
const orchestrator = new TestOrchestrator({
|
|
62
|
+
projectRoot,
|
|
63
|
+
toolsDir: options.toolsDir,
|
|
64
|
+
toolName: options.tool,
|
|
65
|
+
toolPath: options.path,
|
|
66
|
+
strictMode: options.strict,
|
|
67
|
+
ci: options.ci,
|
|
68
|
+
showErrors: options.showErrors,
|
|
69
|
+
// MCP command will be resolved from config
|
|
70
|
+
env: options.env,
|
|
71
|
+
});
|
|
72
|
+
// Run tests
|
|
73
|
+
const result = await orchestrator.run();
|
|
74
|
+
// Format output
|
|
75
|
+
if (options.json) {
|
|
76
|
+
const jsonOutput = formatJSONResults(result);
|
|
77
|
+
log.plain(jsonOutput);
|
|
78
|
+
}
|
|
79
|
+
else if (options.ci) {
|
|
80
|
+
formatCIResults(result);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
formatCLIResults(result);
|
|
84
|
+
}
|
|
85
|
+
// Return exit code (0 for pass, 1 for fail)
|
|
86
|
+
return result.verdict === 'pass' ? 0 : 1;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=test.js.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `syrin update` command implementation.
|
|
3
|
+
* Updates Syrin to the latest version.
|
|
4
|
+
*/
|
|
5
|
+
import { checkSyrinVersion, getCurrentVersion } from '../../utils/version-checker.js';
|
|
6
|
+
import { updatePackage, detectInstallType } from '../../utils/package-manager.js';
|
|
7
|
+
import { handleCommandError } from '../../cli/utils/index.js';
|
|
8
|
+
import { Messages } from '../../constants/index.js';
|
|
9
|
+
import { Icons } from '../../constants/index.js';
|
|
10
|
+
import { SYRIN_LINKS } from '../../constants/links.js';
|
|
11
|
+
import { log } from '../../utils/logger.js';
|
|
12
|
+
import { PACKAGE_NAME } from '../../constants/app.js';
|
|
13
|
+
/**
|
|
14
|
+
* Execute the update command.
|
|
15
|
+
*/
|
|
16
|
+
export async function executeUpdate() {
|
|
17
|
+
try {
|
|
18
|
+
const currentVersion = getCurrentVersion();
|
|
19
|
+
log.info(Messages.UPDATE_CHECKING);
|
|
20
|
+
log.info(Messages.UPDATE_CURRENT_VERSION(`v${currentVersion}`));
|
|
21
|
+
log.blank();
|
|
22
|
+
// Check for latest version
|
|
23
|
+
const versionInfo = await checkSyrinVersion();
|
|
24
|
+
if (!versionInfo.latest) {
|
|
25
|
+
log.warning('Could not check for updates (network error or registry unavailable)');
|
|
26
|
+
log.plain(`Current version: v${currentVersion}`);
|
|
27
|
+
log.blank();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (versionInfo.isLatest) {
|
|
31
|
+
log.success(Messages.UPDATE_ALREADY_LATEST(`v${currentVersion}`));
|
|
32
|
+
log.blank();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
log.info(Messages.UPDATE_LATEST_VERSION(`v${versionInfo.latest}`));
|
|
36
|
+
log.blank();
|
|
37
|
+
log.info(Messages.UPDATE_IN_PROGRESS(PACKAGE_NAME));
|
|
38
|
+
// Determine install type for better error messages
|
|
39
|
+
const installType = detectInstallType();
|
|
40
|
+
// Update the package
|
|
41
|
+
const result = await updatePackage(PACKAGE_NAME);
|
|
42
|
+
if (result.success) {
|
|
43
|
+
const newVersion = result.version || versionInfo.latest;
|
|
44
|
+
log.blank();
|
|
45
|
+
log.success(`${Icons.CHECK} ${Messages.UPDATE_SUCCESS(`v${newVersion}`)}`);
|
|
46
|
+
log.blank();
|
|
47
|
+
// Show helpful message about config migration if needed
|
|
48
|
+
log.info('If your config.yaml structure changed, check the migration guide.');
|
|
49
|
+
log.plain(` Documentation: ${SYRIN_LINKS.DOCS}`);
|
|
50
|
+
log.blank();
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
const errorMessage = result.error || Messages.UPDATE_FAILED;
|
|
54
|
+
// Check if it's a permission error
|
|
55
|
+
if (errorMessage.includes('EACCES') ||
|
|
56
|
+
errorMessage.includes('permission')) {
|
|
57
|
+
const sudoCommand = installType === 'global'
|
|
58
|
+
? `sudo npm install -g ${PACKAGE_NAME}@latest`
|
|
59
|
+
: `npm install ${PACKAGE_NAME}@latest`;
|
|
60
|
+
log.blank();
|
|
61
|
+
log.error(Messages.UPDATE_PERMISSION_HINT(sudoCommand));
|
|
62
|
+
log.blank();
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
log.blank();
|
|
66
|
+
log.error(Messages.UPDATE_ERROR(errorMessage));
|
|
67
|
+
log.blank();
|
|
68
|
+
}
|
|
69
|
+
process.exit(1);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
handleCommandError(error, Messages.UPDATE_FAILED);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI entry point for Syrin.
|
|
3
|
+
* Sets up command parsing and routes to command handlers.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Initialize the CLI program.
|
|
7
|
+
*/
|
|
8
|
+
export declare function setupCLI(): void;
|
|
9
|
+
/**
|
|
10
|
+
* Run the CLI.
|
|
11
|
+
*/
|
|
12
|
+
export declare function run(): void;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|