@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,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event types organized by category.
|
|
3
|
+
* Total: 36 event types across 10 categories.
|
|
4
|
+
*/
|
|
5
|
+
// A. Session & Run Lifecycle Events (5)
|
|
6
|
+
export var SessionLifecycleEventType;
|
|
7
|
+
(function (SessionLifecycleEventType) {
|
|
8
|
+
SessionLifecycleEventType["SESSION_STARTED"] = "SESSION_STARTED";
|
|
9
|
+
SessionLifecycleEventType["PROMPT_VARIANT_STARTED"] = "PROMPT_VARIANT_STARTED";
|
|
10
|
+
SessionLifecycleEventType["SESSION_COMPLETED"] = "SESSION_COMPLETED";
|
|
11
|
+
SessionLifecycleEventType["SESSION_HALTED"] = "SESSION_HALTED";
|
|
12
|
+
SessionLifecycleEventType["WORKFLOW_RUN_SUMMARY"] = "WORKFLOW_RUN_SUMMARY";
|
|
13
|
+
})(SessionLifecycleEventType || (SessionLifecycleEventType = {}));
|
|
14
|
+
// B. Workflow & Step Events (5)
|
|
15
|
+
export var WorkflowEventType;
|
|
16
|
+
(function (WorkflowEventType) {
|
|
17
|
+
WorkflowEventType["WORKFLOW_DEFINED"] = "WORKFLOW_DEFINED";
|
|
18
|
+
WorkflowEventType["STEP_STARTED"] = "STEP_STARTED";
|
|
19
|
+
WorkflowEventType["STEP_COMPLETED"] = "STEP_COMPLETED";
|
|
20
|
+
WorkflowEventType["STEP_BLOCKED"] = "STEP_BLOCKED";
|
|
21
|
+
WorkflowEventType["STEP_SKIPPED"] = "STEP_SKIPPED";
|
|
22
|
+
})(WorkflowEventType || (WorkflowEventType = {}));
|
|
23
|
+
// C. LLM Context & Prompting Events (2)
|
|
24
|
+
export var LLMContextEventType;
|
|
25
|
+
(function (LLMContextEventType) {
|
|
26
|
+
LLMContextEventType["LLM_CONTEXT_BUILT"] = "LLM_CONTEXT_BUILT";
|
|
27
|
+
LLMContextEventType["POST_TOOL_LLM_PROMPT_BUILT"] = "POST_TOOL_LLM_PROMPT_BUILT";
|
|
28
|
+
})(LLMContextEventType || (LLMContextEventType = {}));
|
|
29
|
+
// D. LLM Proposal Events - Non-Authoritative (3)
|
|
30
|
+
export var LLMProposalEventType;
|
|
31
|
+
(function (LLMProposalEventType) {
|
|
32
|
+
LLMProposalEventType["LLM_PROPOSED_ACTION"] = "LLM_PROPOSED_ACTION";
|
|
33
|
+
LLMProposalEventType["LLM_PROPOSED_TOOL_CALL"] = "LLM_PROPOSED_TOOL_CALL";
|
|
34
|
+
LLMProposalEventType["LLM_FINAL_RESPONSE_GENERATED"] = "LLM_FINAL_RESPONSE_GENERATED";
|
|
35
|
+
})(LLMProposalEventType || (LLMProposalEventType = {}));
|
|
36
|
+
// E. Validation & Guardrail Events - Runtime Authority (5)
|
|
37
|
+
export var ValidationEventType;
|
|
38
|
+
(function (ValidationEventType) {
|
|
39
|
+
ValidationEventType["TOOL_CALL_VALIDATION_STARTED"] = "TOOL_CALL_VALIDATION_STARTED";
|
|
40
|
+
ValidationEventType["TOOL_CALL_VALIDATION_PASSED"] = "TOOL_CALL_VALIDATION_PASSED";
|
|
41
|
+
ValidationEventType["TOOL_CALL_VALIDATION_FAILED"] = "TOOL_CALL_VALIDATION_FAILED";
|
|
42
|
+
ValidationEventType["CALL_BUDGET_EXCEEDED"] = "CALL_BUDGET_EXCEEDED";
|
|
43
|
+
ValidationEventType["TOOL_LOOP_DETECTED"] = "TOOL_LOOP_DETECTED";
|
|
44
|
+
})(ValidationEventType || (ValidationEventType = {}));
|
|
45
|
+
// F. Tool Execution Events - Ground Truth (3)
|
|
46
|
+
export var ToolExecutionEventType;
|
|
47
|
+
(function (ToolExecutionEventType) {
|
|
48
|
+
ToolExecutionEventType["TOOL_EXECUTION_STARTED"] = "TOOL_EXECUTION_STARTED";
|
|
49
|
+
ToolExecutionEventType["TOOL_EXECUTION_COMPLETED"] = "TOOL_EXECUTION_COMPLETED";
|
|
50
|
+
ToolExecutionEventType["TOOL_EXECUTION_FAILED"] = "TOOL_EXECUTION_FAILED";
|
|
51
|
+
})(ToolExecutionEventType || (ToolExecutionEventType = {}));
|
|
52
|
+
// G. Transport Layer Events (4)
|
|
53
|
+
export var TransportEventType;
|
|
54
|
+
(function (TransportEventType) {
|
|
55
|
+
TransportEventType["TRANSPORT_INITIALIZED"] = "TRANSPORT_INITIALIZED";
|
|
56
|
+
TransportEventType["TRANSPORT_MESSAGE_SENT"] = "TRANSPORT_MESSAGE_SENT";
|
|
57
|
+
TransportEventType["TRANSPORT_MESSAGE_RECEIVED"] = "TRANSPORT_MESSAGE_RECEIVED";
|
|
58
|
+
TransportEventType["TRANSPORT_ERROR"] = "TRANSPORT_ERROR";
|
|
59
|
+
})(TransportEventType || (TransportEventType = {}));
|
|
60
|
+
// H. Tool Registry & Discovery Events (4)
|
|
61
|
+
export var ToolRegistryEventType;
|
|
62
|
+
(function (ToolRegistryEventType) {
|
|
63
|
+
ToolRegistryEventType["TOOL_REGISTRY_LOADED"] = "TOOL_REGISTRY_LOADED";
|
|
64
|
+
ToolRegistryEventType["TOOL_REGISTERED"] = "TOOL_REGISTERED";
|
|
65
|
+
ToolRegistryEventType["TOOL_REGISTRATION_FAILED"] = "TOOL_REGISTRATION_FAILED";
|
|
66
|
+
ToolRegistryEventType["TOOL_AVAILABILITY_CHECKED"] = "TOOL_AVAILABILITY_CHECKED";
|
|
67
|
+
})(ToolRegistryEventType || (ToolRegistryEventType = {}));
|
|
68
|
+
// I. Assertions & Testing Events (2)
|
|
69
|
+
export var TestingEventType;
|
|
70
|
+
(function (TestingEventType) {
|
|
71
|
+
TestingEventType["ASSERTION_PASSED"] = "ASSERTION_PASSED";
|
|
72
|
+
TestingEventType["ASSERTION_FAILED"] = "ASSERTION_FAILED";
|
|
73
|
+
})(TestingEventType || (TestingEventType = {}));
|
|
74
|
+
// J. Diagnostic & Internal Error Events (3)
|
|
75
|
+
export var DiagnosticEventType;
|
|
76
|
+
(function (DiagnosticEventType) {
|
|
77
|
+
DiagnosticEventType["RUNTIME_ERROR"] = "RUNTIME_ERROR";
|
|
78
|
+
DiagnosticEventType["ADAPTER_ERROR"] = "ADAPTER_ERROR";
|
|
79
|
+
DiagnosticEventType["CONTEXT_MUTATION_APPLIED"] = "CONTEXT_MUTATION_APPLIED";
|
|
80
|
+
})(DiagnosticEventType || (DiagnosticEventType = {}));
|
|
81
|
+
//# sourceMappingURL=event-type.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payload interfaces for Diagnostic & Internal Error Events
|
|
3
|
+
*/
|
|
4
|
+
export interface RuntimeErrorPayload {
|
|
5
|
+
message: string;
|
|
6
|
+
error_code: string;
|
|
7
|
+
stack_trace?: string;
|
|
8
|
+
context?: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
export interface AdapterErrorPayload {
|
|
11
|
+
adapter_type: string;
|
|
12
|
+
message: string;
|
|
13
|
+
error_code: string;
|
|
14
|
+
recoverable: boolean;
|
|
15
|
+
context?: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export interface ContextMutationAppliedPayload {
|
|
18
|
+
mutation_type: 'inject' | 'modify' | 'remove';
|
|
19
|
+
context_key: string;
|
|
20
|
+
old_value?: unknown;
|
|
21
|
+
new_value: unknown;
|
|
22
|
+
reason: string;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=diagnostics.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Central export for all event payload types.
|
|
3
|
+
* Organized by category for better maintainability.
|
|
4
|
+
*/
|
|
5
|
+
export type { SessionStartedPayload, PromptVariantStartedPayload, SessionCompletedPayload, SessionHaltedPayload, WorkflowRunSummaryPayload, } from './session.js';
|
|
6
|
+
export type { WorkflowDefinedPayload, StepDefinition, DependencyDefinition, StepStartedPayload, StepCompletedPayload, StepBlockedPayload, StepSkippedPayload, } from './workflow.js';
|
|
7
|
+
export type { LLMContextBuiltPayload, LLMContext, Message, ToolDefinition, ResourceReference, PostToolLLMPromptBuiltPayload, ToolCallResult, } from './llm.js';
|
|
8
|
+
export type { LLMProposedActionPayload, LLMProposedToolCallPayload, LLMFinalResponseGeneratedPayload, } from './llm.js';
|
|
9
|
+
export type { ToolCallValidationStartedPayload, ToolCallValidationPassedPayload, ToolCallValidationFailedPayload, ValidationError, CallBudgetExceededPayload, ToolLoopDetectedPayload, } from './validation.js';
|
|
10
|
+
export type { ToolExecutionStartedPayload, ToolExecutionCompletedPayload, ToolExecutionFailedPayload, ToolExecutionError, } from './tool.js';
|
|
11
|
+
export type { TransportInitializedPayload, TransportMessageSentPayload, TransportMessageReceivedPayload, TransportErrorPayload, } from './transport.js';
|
|
12
|
+
export type { ToolRegistryLoadedPayload, ToolRegisteredPayload, ToolSchema, ToolRegistrationFailedPayload, ToolAvailabilityCheckedPayload, } from './registry.js';
|
|
13
|
+
export type { AssertionPassedPayload, AssertionFailedPayload } from './testing.js';
|
|
14
|
+
export type { RuntimeErrorPayload, AdapterErrorPayload, ContextMutationAppliedPayload, } from './diagnostics.js';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payload interfaces for LLM Context & Prompting Events
|
|
3
|
+
* and LLM Proposal Events (Non-Authoritative)
|
|
4
|
+
*/
|
|
5
|
+
import type { PromptID } from '../../types/ids.js';
|
|
6
|
+
export interface LLMContextBuiltPayload {
|
|
7
|
+
prompt_id: PromptID;
|
|
8
|
+
context: LLMContext;
|
|
9
|
+
tool_definitions: ToolDefinition[];
|
|
10
|
+
system_prompt?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface LLMContext {
|
|
13
|
+
messages: Message[];
|
|
14
|
+
tools?: ToolDefinition[];
|
|
15
|
+
resources?: ResourceReference[];
|
|
16
|
+
}
|
|
17
|
+
export interface Message {
|
|
18
|
+
role: 'user' | 'assistant' | 'system';
|
|
19
|
+
content: string;
|
|
20
|
+
timestamp?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ToolDefinition {
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
input_schema: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
export interface ResourceReference {
|
|
28
|
+
uri: string;
|
|
29
|
+
name: string;
|
|
30
|
+
mime_type?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface PostToolLLMPromptBuiltPayload {
|
|
33
|
+
prompt_id: PromptID;
|
|
34
|
+
tool_call_result: ToolCallResult;
|
|
35
|
+
context: LLMContext;
|
|
36
|
+
}
|
|
37
|
+
export interface ToolCallResult {
|
|
38
|
+
tool_name: string;
|
|
39
|
+
arguments: Record<string, unknown>;
|
|
40
|
+
result: unknown;
|
|
41
|
+
duration_ms: number;
|
|
42
|
+
}
|
|
43
|
+
export interface LLMProposedActionPayload {
|
|
44
|
+
action_type: 'tool_call' | 'text_response' | 'none';
|
|
45
|
+
reasoning?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface LLMProposedToolCallPayload {
|
|
48
|
+
tool_name: string;
|
|
49
|
+
arguments: Record<string, unknown>;
|
|
50
|
+
reasoning?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface LLMFinalResponseGeneratedPayload {
|
|
53
|
+
response_text: string;
|
|
54
|
+
finish_reason: 'stop' | 'length' | 'tool_calls' | 'error';
|
|
55
|
+
token_count?: number;
|
|
56
|
+
duration_ms: number;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=llm.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payload interfaces for Tool Registry & Discovery Events
|
|
3
|
+
*/
|
|
4
|
+
export interface ToolRegistryLoadedPayload {
|
|
5
|
+
tool_count: number;
|
|
6
|
+
source: 'mcp_server' | 'config' | 'adapter';
|
|
7
|
+
}
|
|
8
|
+
export interface ToolRegisteredPayload {
|
|
9
|
+
tool_name: string;
|
|
10
|
+
tool_schema: ToolSchema;
|
|
11
|
+
source: 'mcp_server' | 'config' | 'adapter';
|
|
12
|
+
}
|
|
13
|
+
export interface ToolSchema {
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
input_schema: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
export interface ToolRegistrationFailedPayload {
|
|
19
|
+
tool_name: string;
|
|
20
|
+
failure_reason: string;
|
|
21
|
+
error_code: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ToolAvailabilityCheckedPayload {
|
|
24
|
+
tool_name: string;
|
|
25
|
+
available: boolean;
|
|
26
|
+
reason?: string;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payload interfaces for Session & Run Lifecycle Events
|
|
3
|
+
*/
|
|
4
|
+
export interface SessionStartedPayload {
|
|
5
|
+
project_name: string;
|
|
6
|
+
syrin_version: string;
|
|
7
|
+
}
|
|
8
|
+
export interface PromptVariantStartedPayload {
|
|
9
|
+
prompt_variant_id: string;
|
|
10
|
+
prompt_text: string;
|
|
11
|
+
}
|
|
12
|
+
export interface SessionCompletedPayload {
|
|
13
|
+
status: 'success';
|
|
14
|
+
duration_ms: number;
|
|
15
|
+
total_tool_calls: number;
|
|
16
|
+
total_llm_calls: number;
|
|
17
|
+
}
|
|
18
|
+
export interface SessionHaltedPayload {
|
|
19
|
+
reason: string;
|
|
20
|
+
error_code?: string;
|
|
21
|
+
last_event_id?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface WorkflowRunSummaryPayload {
|
|
24
|
+
workflow_id: string;
|
|
25
|
+
prompt_id: string;
|
|
26
|
+
status: 'completed' | 'halted' | 'failed';
|
|
27
|
+
duration_ms: number;
|
|
28
|
+
steps_completed: number;
|
|
29
|
+
steps_total: number;
|
|
30
|
+
tool_calls_count: number;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payload interfaces for Assertions & Testing Events
|
|
3
|
+
*/
|
|
4
|
+
export interface AssertionPassedPayload {
|
|
5
|
+
assertion_id: string;
|
|
6
|
+
assertion_type: 'event_sequence' | 'event_property' | 'tool_call' | 'custom';
|
|
7
|
+
description: string;
|
|
8
|
+
}
|
|
9
|
+
export interface AssertionFailedPayload {
|
|
10
|
+
assertion_id: string;
|
|
11
|
+
assertion_type: 'event_sequence' | 'event_property' | 'tool_call' | 'custom';
|
|
12
|
+
description: string;
|
|
13
|
+
expected: string | number | boolean | Record<string, unknown> | unknown[];
|
|
14
|
+
actual: string | number | boolean | Record<string, unknown> | unknown[];
|
|
15
|
+
failure_reason: string;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payload interfaces for Tool Execution Events (Ground Truth)
|
|
3
|
+
*/
|
|
4
|
+
export interface ToolExecutionStartedPayload {
|
|
5
|
+
tool_name: string;
|
|
6
|
+
arguments: Record<string, unknown>;
|
|
7
|
+
execution_id: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ToolExecutionCompletedPayload {
|
|
10
|
+
tool_name: string;
|
|
11
|
+
arguments: Record<string, unknown>;
|
|
12
|
+
result: unknown;
|
|
13
|
+
execution_id: string;
|
|
14
|
+
duration_ms: number;
|
|
15
|
+
}
|
|
16
|
+
export interface ToolExecutionFailedPayload {
|
|
17
|
+
tool_name: string;
|
|
18
|
+
arguments: Record<string, unknown>;
|
|
19
|
+
execution_id: string;
|
|
20
|
+
error: ToolExecutionError;
|
|
21
|
+
duration_ms: number;
|
|
22
|
+
}
|
|
23
|
+
export interface ToolExecutionError {
|
|
24
|
+
message: string;
|
|
25
|
+
code: string;
|
|
26
|
+
stack_trace?: string;
|
|
27
|
+
error_type: 'validation' | 'runtime' | 'timeout' | 'permission' | 'unknown';
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payload interfaces for Transport Layer Events
|
|
3
|
+
*/
|
|
4
|
+
export interface TransportInitializedPayload {
|
|
5
|
+
transport_type: 'stdio' | 'http' | 'websocket';
|
|
6
|
+
endpoint?: string;
|
|
7
|
+
command?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface TransportMessageSentPayload {
|
|
10
|
+
transport_type: 'stdio' | 'http' | 'websocket';
|
|
11
|
+
message_type: string;
|
|
12
|
+
message_id?: string;
|
|
13
|
+
size_bytes: number;
|
|
14
|
+
tool_name?: string;
|
|
15
|
+
tool_arguments?: Record<string, unknown>;
|
|
16
|
+
request_body?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface TransportMessageReceivedPayload {
|
|
19
|
+
transport_type: 'stdio' | 'http' | 'websocket';
|
|
20
|
+
message_type: string;
|
|
21
|
+
message_id?: string;
|
|
22
|
+
size_bytes: number;
|
|
23
|
+
}
|
|
24
|
+
export interface TransportErrorPayload {
|
|
25
|
+
transport_type: 'stdio' | 'http' | 'websocket';
|
|
26
|
+
error_message: string;
|
|
27
|
+
error_code: string;
|
|
28
|
+
recoverable: boolean;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payload interfaces for Validation & Guardrail Events (Runtime Authority)
|
|
3
|
+
*/
|
|
4
|
+
export interface ToolCallValidationStartedPayload {
|
|
5
|
+
tool_name: string;
|
|
6
|
+
arguments: Record<string, unknown>;
|
|
7
|
+
validation_rules: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface ToolCallValidationPassedPayload {
|
|
10
|
+
tool_name: string;
|
|
11
|
+
arguments: Record<string, unknown>;
|
|
12
|
+
validated_at: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ToolCallValidationFailedPayload {
|
|
15
|
+
tool_name: string;
|
|
16
|
+
arguments: Record<string, unknown>;
|
|
17
|
+
failure_reason: string;
|
|
18
|
+
validation_errors: ValidationError[];
|
|
19
|
+
}
|
|
20
|
+
export interface ValidationError {
|
|
21
|
+
field?: string;
|
|
22
|
+
message: string;
|
|
23
|
+
code: string;
|
|
24
|
+
}
|
|
25
|
+
export interface CallBudgetExceededPayload {
|
|
26
|
+
tool_name: string;
|
|
27
|
+
current_count: number;
|
|
28
|
+
max_allowed: number;
|
|
29
|
+
budget_type: 'per_tool' | 'total' | 'per_session';
|
|
30
|
+
}
|
|
31
|
+
export interface ToolLoopDetectedPayload {
|
|
32
|
+
tool_name: string;
|
|
33
|
+
loop_pattern: string[];
|
|
34
|
+
detection_method: 'pattern_match' | 'cycle_detection' | 'threshold_exceeded';
|
|
35
|
+
threshold?: number;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payload interfaces for Workflow & Step Events
|
|
3
|
+
*/
|
|
4
|
+
import type { WorkflowID } from '../../types/ids.js';
|
|
5
|
+
export interface WorkflowDefinedPayload {
|
|
6
|
+
workflow_id: WorkflowID;
|
|
7
|
+
steps: StepDefinition[];
|
|
8
|
+
dependencies: DependencyDefinition[];
|
|
9
|
+
}
|
|
10
|
+
export interface StepDefinition {
|
|
11
|
+
step_id: string;
|
|
12
|
+
step_name: string;
|
|
13
|
+
tool_name?: string;
|
|
14
|
+
required: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface DependencyDefinition {
|
|
17
|
+
step_id: string;
|
|
18
|
+
depends_on: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface StepStartedPayload {
|
|
21
|
+
step_id: string;
|
|
22
|
+
step_name: string;
|
|
23
|
+
workflow_id: WorkflowID;
|
|
24
|
+
}
|
|
25
|
+
export interface StepCompletedPayload {
|
|
26
|
+
step_id: string;
|
|
27
|
+
step_name: string;
|
|
28
|
+
workflow_id: WorkflowID;
|
|
29
|
+
duration_ms: number;
|
|
30
|
+
result?: unknown;
|
|
31
|
+
}
|
|
32
|
+
export interface StepBlockedPayload {
|
|
33
|
+
step_id: string;
|
|
34
|
+
step_name: string;
|
|
35
|
+
workflow_id: WorkflowID;
|
|
36
|
+
missing_dependencies: string[];
|
|
37
|
+
reason: string;
|
|
38
|
+
}
|
|
39
|
+
export interface StepSkippedPayload {
|
|
40
|
+
step_id: string;
|
|
41
|
+
step_name: string;
|
|
42
|
+
workflow_id: WorkflowID;
|
|
43
|
+
reason: string;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { EventEnvelope } from '../../events/types.js';
|
|
2
|
+
import type { EventStore } from '../../events/store.js';
|
|
3
|
+
import type { SessionID } from '../../types/ids.js';
|
|
4
|
+
/**
|
|
5
|
+
* File-based event store implementation.
|
|
6
|
+
* Stores events in JSONL (JSON Lines) format for append-only, streamable storage.
|
|
7
|
+
* Events are persisted to `.syrin/events/{sessionId}.jsonl`
|
|
8
|
+
*/
|
|
9
|
+
export declare class FileEventStore implements EventStore {
|
|
10
|
+
private readonly eventsDir;
|
|
11
|
+
private writeStreams;
|
|
12
|
+
constructor(eventsDir?: string);
|
|
13
|
+
/**
|
|
14
|
+
* Initialize the events directory if it doesn't exist.
|
|
15
|
+
*/
|
|
16
|
+
private ensureEventsDir;
|
|
17
|
+
/**
|
|
18
|
+
* Get the file path for a session's events.
|
|
19
|
+
*/
|
|
20
|
+
private getEventFilePath;
|
|
21
|
+
/**
|
|
22
|
+
* Get or create a write stream for a session.
|
|
23
|
+
*/
|
|
24
|
+
private getWriteStream;
|
|
25
|
+
append(event: EventEnvelope): Promise<void>;
|
|
26
|
+
load(sessionId: SessionID): Promise<EventEnvelope[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Close all open file handles.
|
|
29
|
+
* Should be called before process exit.
|
|
30
|
+
*/
|
|
31
|
+
close(): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Get all session IDs that have event files.
|
|
34
|
+
*/
|
|
35
|
+
getSessionIds(): Promise<SessionID[]>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=file-store.d.ts.map
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import * as fs from 'fs/promises';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { Paths, FileExtensions } from '../../constants/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* File-based event store implementation.
|
|
6
|
+
* Stores events in JSONL (JSON Lines) format for append-only, streamable storage.
|
|
7
|
+
* Events are persisted to `.syrin/events/{sessionId}.jsonl`
|
|
8
|
+
*/
|
|
9
|
+
export class FileEventStore {
|
|
10
|
+
eventsDir;
|
|
11
|
+
writeStreams = new Map();
|
|
12
|
+
constructor(eventsDir = Paths.EVENTS_DIR) {
|
|
13
|
+
this.eventsDir = eventsDir;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Initialize the events directory if it doesn't exist.
|
|
17
|
+
*/
|
|
18
|
+
async ensureEventsDir() {
|
|
19
|
+
try {
|
|
20
|
+
await fs.mkdir(this.eventsDir, { recursive: true });
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
// Directory might already exist, which is fine
|
|
24
|
+
const err = error;
|
|
25
|
+
if (err.code !== 'EEXIST') {
|
|
26
|
+
throw error;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the file path for a session's events.
|
|
32
|
+
*/
|
|
33
|
+
getEventFilePath(sessionId) {
|
|
34
|
+
return path.join(this.eventsDir, `${sessionId}${FileExtensions.JSONL}`);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get or create a write stream for a session.
|
|
38
|
+
*/
|
|
39
|
+
async getWriteStream(sessionId) {
|
|
40
|
+
if (this.writeStreams.has(sessionId)) {
|
|
41
|
+
return this.writeStreams.get(sessionId);
|
|
42
|
+
}
|
|
43
|
+
await this.ensureEventsDir();
|
|
44
|
+
const filePath = this.getEventFilePath(sessionId);
|
|
45
|
+
const handle = await fs.open(filePath, 'a'); // Append mode
|
|
46
|
+
this.writeStreams.set(sessionId, handle);
|
|
47
|
+
return handle;
|
|
48
|
+
}
|
|
49
|
+
async append(event) {
|
|
50
|
+
const handle = await this.getWriteStream(event.session_id);
|
|
51
|
+
const line = JSON.stringify(event) + '\n';
|
|
52
|
+
const buffer = Buffer.from(line, 'utf-8');
|
|
53
|
+
// Get file stats to determine write position (end of file)
|
|
54
|
+
const stats = await handle.stat();
|
|
55
|
+
await handle.write(buffer, 0, buffer.length, stats.size);
|
|
56
|
+
}
|
|
57
|
+
async load(sessionId) {
|
|
58
|
+
const filePath = this.getEventFilePath(sessionId);
|
|
59
|
+
try {
|
|
60
|
+
const content = await fs.readFile(filePath, 'utf-8');
|
|
61
|
+
const lines = content
|
|
62
|
+
.trim()
|
|
63
|
+
.split('\n')
|
|
64
|
+
.filter(line => line.length > 0);
|
|
65
|
+
return lines.map((line) => {
|
|
66
|
+
try {
|
|
67
|
+
return JSON.parse(line);
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
71
|
+
throw new Error(`Failed to parse event line in ${filePath}: ${err.message}`);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
const err = error;
|
|
77
|
+
if (err.code === 'ENOENT') {
|
|
78
|
+
// File doesn't exist yet, return empty array
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Close all open file handles.
|
|
86
|
+
* Should be called before process exit.
|
|
87
|
+
*/
|
|
88
|
+
async close() {
|
|
89
|
+
const closePromises = Array.from(this.writeStreams.values()).map(handle => handle.close());
|
|
90
|
+
await Promise.all(closePromises);
|
|
91
|
+
this.writeStreams.clear();
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Get all session IDs that have event files.
|
|
95
|
+
*/
|
|
96
|
+
async getSessionIds() {
|
|
97
|
+
await this.ensureEventsDir();
|
|
98
|
+
try {
|
|
99
|
+
const files = await fs.readdir(this.eventsDir);
|
|
100
|
+
return files
|
|
101
|
+
.filter((file) => file.endsWith(FileExtensions.JSONL))
|
|
102
|
+
.map((file) => file.replace(FileExtensions.JSONL, ''));
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
const err = error;
|
|
106
|
+
if (err.code === 'ENOENT') {
|
|
107
|
+
return [];
|
|
108
|
+
}
|
|
109
|
+
throw error;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=file-store.js.map
|