@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,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assistant message component factory for Chat UI.
|
|
3
|
+
* Creates an assistant message component that works with dynamically imported React/Ink.
|
|
4
|
+
*/
|
|
5
|
+
import type { ChatUIOptions } from '../chat-ui-types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Creates an Assistant Message component element.
|
|
8
|
+
* @param React - React module (dynamically imported)
|
|
9
|
+
* @param Box - Box component from Ink
|
|
10
|
+
* @param Text - Text component from Ink
|
|
11
|
+
* @param index - Message index
|
|
12
|
+
* @param options - Chat UI options
|
|
13
|
+
* @param markdownElements - Parsed markdown elements
|
|
14
|
+
* @returns Assistant message component element
|
|
15
|
+
*/
|
|
16
|
+
export declare function createAssistantMessage(React: {
|
|
17
|
+
createElement: (type: unknown, props?: unknown, ...children: unknown[]) => unknown;
|
|
18
|
+
}, Box: unknown, Text: unknown, index: number, options: ChatUIOptions, markdownElements: unknown[]): unknown;
|
|
19
|
+
//# sourceMappingURL=assistant-message.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assistant message component factory for Chat UI.
|
|
3
|
+
* Creates an assistant message component that works with dynamically imported React/Ink.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Creates an Assistant Message component element.
|
|
7
|
+
* @param React - React module (dynamically imported)
|
|
8
|
+
* @param Box - Box component from Ink
|
|
9
|
+
* @param Text - Text component from Ink
|
|
10
|
+
* @param index - Message index
|
|
11
|
+
* @param options - Chat UI options
|
|
12
|
+
* @param markdownElements - Parsed markdown elements
|
|
13
|
+
* @returns Assistant message component element
|
|
14
|
+
*/
|
|
15
|
+
export function createAssistantMessage(React, Box, Text, index, options, markdownElements) {
|
|
16
|
+
const { createElement } = React;
|
|
17
|
+
// LLM-generated messages: minimalistic bordered rectangle style
|
|
18
|
+
return createElement(Box, {
|
|
19
|
+
key: index,
|
|
20
|
+
flexDirection: 'column',
|
|
21
|
+
alignItems: 'flex-start',
|
|
22
|
+
marginY: 1,
|
|
23
|
+
}, createElement(Box, {
|
|
24
|
+
flexDirection: 'row',
|
|
25
|
+
marginBottom: 0,
|
|
26
|
+
marginLeft: 1,
|
|
27
|
+
}, createElement(Text, { color: 'cyan', bold: true }, `🤖 ${options.llmProviderName || 'AI'}: `)), createElement(Box, {
|
|
28
|
+
flexDirection: 'column',
|
|
29
|
+
borderStyle: 'round',
|
|
30
|
+
borderColor: 'gray',
|
|
31
|
+
paddingX: 1,
|
|
32
|
+
paddingY: 1,
|
|
33
|
+
marginLeft: 1,
|
|
34
|
+
}, ...markdownElements));
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=assistant-message.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Header component factory for Chat UI.
|
|
3
|
+
* Creates a header component that works with dynamically imported React/Ink.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Creates a Header component factory function.
|
|
7
|
+
* @param React - React module (dynamically imported)
|
|
8
|
+
* @param Box - Box component from Ink
|
|
9
|
+
* @param Text - Text component from Ink
|
|
10
|
+
* @param options - Chat UI options
|
|
11
|
+
* @returns Header component element
|
|
12
|
+
*/
|
|
13
|
+
export declare function createHeader(React: {
|
|
14
|
+
createElement: (type: unknown, props?: unknown, ...children: unknown[]) => unknown;
|
|
15
|
+
}, Box: unknown, Text: unknown): unknown;
|
|
16
|
+
//# sourceMappingURL=header.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Header component factory for Chat UI.
|
|
3
|
+
* Creates a header component that works with dynamically imported React/Ink.
|
|
4
|
+
*/
|
|
5
|
+
import { App } from '../../../constants/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* Creates a Header component factory function.
|
|
8
|
+
* @param React - React module (dynamically imported)
|
|
9
|
+
* @param Box - Box component from Ink
|
|
10
|
+
* @param Text - Text component from Ink
|
|
11
|
+
* @param options - Chat UI options
|
|
12
|
+
* @returns Header component element
|
|
13
|
+
*/
|
|
14
|
+
export function createHeader(React, Box, Text) {
|
|
15
|
+
const { createElement } = React;
|
|
16
|
+
return createElement(Box, {
|
|
17
|
+
width: '100%',
|
|
18
|
+
borderStyle: 'single',
|
|
19
|
+
borderColor: 'blue',
|
|
20
|
+
}, createElement(Text, { color: 'white', bold: true }, ` ${App.NAME} Dev Mode `), createElement(Text, { color: 'white', dimColor: true }, '| Enter /exit or /quit to exit'));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=header.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI Component factories for Chat UI.
|
|
3
|
+
* All components use factory functions to work with dynamically imported React/Ink.
|
|
4
|
+
*/
|
|
5
|
+
export { createHeader } from './header.js';
|
|
6
|
+
export { createWelcomeBanner } from './welcome-banner.js';
|
|
7
|
+
export { createUserMessage } from './user-message.js';
|
|
8
|
+
export { createAssistantMessage } from './assistant-message.js';
|
|
9
|
+
export { createSystemMessage } from './system-message.js';
|
|
10
|
+
export { createInputPanel } from './input-panel.js';
|
|
11
|
+
export { createMessageComponent } from './message-component.js';
|
|
12
|
+
export { createMessagesList } from './messages-list.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI Component factories for Chat UI.
|
|
3
|
+
* All components use factory functions to work with dynamically imported React/Ink.
|
|
4
|
+
*/
|
|
5
|
+
export { createHeader } from './header.js';
|
|
6
|
+
export { createWelcomeBanner } from './welcome-banner.js';
|
|
7
|
+
export { createUserMessage } from './user-message.js';
|
|
8
|
+
export { createAssistantMessage } from './assistant-message.js';
|
|
9
|
+
export { createSystemMessage } from './system-message.js';
|
|
10
|
+
export { createInputPanel } from './input-panel.js';
|
|
11
|
+
export { createMessageComponent } from './message-component.js';
|
|
12
|
+
export { createMessagesList } from './messages-list.js';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input panel component factory for Chat UI.
|
|
3
|
+
* Creates an input panel component that works with dynamically imported React/Ink.
|
|
4
|
+
*/
|
|
5
|
+
import type { ChatUIOptions } from '../chat-ui-types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Creates an Input Panel component element.
|
|
8
|
+
* @param React - React module (dynamically imported)
|
|
9
|
+
* @param Box - Box component from Ink
|
|
10
|
+
* @param Text - Text component from Ink
|
|
11
|
+
* @param TextInput - TextInput component from ink-text-input
|
|
12
|
+
* @param options - Chat UI options
|
|
13
|
+
* @param input - Current input value
|
|
14
|
+
* @param isProcessing - Whether the UI is processing
|
|
15
|
+
* @param setInput - Function to update input value
|
|
16
|
+
* @param handleSubmit - Function to handle form submission
|
|
17
|
+
* @returns Input panel component element
|
|
18
|
+
*/
|
|
19
|
+
export declare function createInputPanel(React: {
|
|
20
|
+
createElement: (type: unknown, props?: unknown, ...children: unknown[]) => unknown;
|
|
21
|
+
}, Box: unknown, Text: unknown, TextInput: unknown, options: ChatUIOptions, input: string, isProcessing: boolean, setInput: (value: string) => void, handleSubmit: (value: string) => void): unknown;
|
|
22
|
+
//# sourceMappingURL=input-panel.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input panel component factory for Chat UI.
|
|
3
|
+
* Creates an input panel component that works with dynamically imported React/Ink.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Creates an Input Panel component element.
|
|
7
|
+
* @param React - React module (dynamically imported)
|
|
8
|
+
* @param Box - Box component from Ink
|
|
9
|
+
* @param Text - Text component from Ink
|
|
10
|
+
* @param TextInput - TextInput component from ink-text-input
|
|
11
|
+
* @param options - Chat UI options
|
|
12
|
+
* @param input - Current input value
|
|
13
|
+
* @param isProcessing - Whether the UI is processing
|
|
14
|
+
* @param setInput - Function to update input value
|
|
15
|
+
* @param handleSubmit - Function to handle form submission
|
|
16
|
+
* @returns Input panel component element
|
|
17
|
+
*/
|
|
18
|
+
export function createInputPanel(React, Box, Text, TextInput, options, input, isProcessing, setInput, handleSubmit) {
|
|
19
|
+
const { createElement } = React;
|
|
20
|
+
// Input area - fixed at bottom, modern minimal design with border and black background
|
|
21
|
+
// flexShrink: 0 ensures it never shrinks, keeping it always visible at bottom
|
|
22
|
+
return createElement(Box, {
|
|
23
|
+
width: '100%',
|
|
24
|
+
flexShrink: 0,
|
|
25
|
+
flexGrow: 0,
|
|
26
|
+
borderStyle: 'round',
|
|
27
|
+
borderColor: 'gray',
|
|
28
|
+
backgroundColor: 'black',
|
|
29
|
+
paddingX: 1,
|
|
30
|
+
paddingY: 1,
|
|
31
|
+
}, createElement(Box, {
|
|
32
|
+
flexDirection: 'row',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
}, createElement(Text, { color: 'white', dimColor: true }, `${options.agentName || 'You'} > `), isProcessing
|
|
35
|
+
? createElement(Text, { color: 'white', dimColor: true }, 'Processing...')
|
|
36
|
+
: createElement(TextInput, {
|
|
37
|
+
value: input,
|
|
38
|
+
onChange: setInput,
|
|
39
|
+
onSubmit: handleSubmit,
|
|
40
|
+
placeholder: 'Type your message...',
|
|
41
|
+
})));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=input-panel.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message component wrapper factory for Chat UI.
|
|
3
|
+
* Creates a memoized message component that works with dynamically imported React/Ink.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Creates a memoized Message Component factory function.
|
|
7
|
+
* @param React - React module (dynamically imported)
|
|
8
|
+
* @param Box - Box component from Ink
|
|
9
|
+
* @param Text - Text component from Ink
|
|
10
|
+
* @param memo - memo function from React
|
|
11
|
+
* @returns Factory function that creates MessageComponent given parseMarkdown and wrapText
|
|
12
|
+
*/
|
|
13
|
+
export declare function createMessageComponent(React: {
|
|
14
|
+
createElement: (type: unknown, props?: unknown, ...children: unknown[]) => unknown;
|
|
15
|
+
}, Box: unknown, Text: unknown, memo: (component: unknown, areEqual?: unknown) => unknown): (parseMarkdown: (text: string, defaultColor?: string) => unknown[], wrapText: (text: string, width: number) => string[]) => unknown;
|
|
16
|
+
//# sourceMappingURL=message-component.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message component wrapper factory for Chat UI.
|
|
3
|
+
* Creates a memoized message component that works with dynamically imported React/Ink.
|
|
4
|
+
*/
|
|
5
|
+
import { createUserMessage, createAssistantMessage, createSystemMessage, } from './index.js';
|
|
6
|
+
/**
|
|
7
|
+
* Creates a memoized Message Component factory function.
|
|
8
|
+
* @param React - React module (dynamically imported)
|
|
9
|
+
* @param Box - Box component from Ink
|
|
10
|
+
* @param Text - Text component from Ink
|
|
11
|
+
* @param memo - memo function from React
|
|
12
|
+
* @returns Factory function that creates MessageComponent given parseMarkdown and wrapText
|
|
13
|
+
*/
|
|
14
|
+
export function createMessageComponent(React, Box, Text, memo) {
|
|
15
|
+
return (parseMarkdown, wrapText) => {
|
|
16
|
+
// Message component - only re-renders when message content changes
|
|
17
|
+
const MessageComponentInner = (props) => {
|
|
18
|
+
const { message, index, options } = props;
|
|
19
|
+
const timestamp = options.showTimestamps
|
|
20
|
+
? `[${message.timestamp?.toLocaleTimeString() || ''}] `
|
|
21
|
+
: '';
|
|
22
|
+
if (message.role === 'user') {
|
|
23
|
+
// User messages: minimalistic bordered rectangle with blue background
|
|
24
|
+
const wrappedLines = wrapText(message.content, 60);
|
|
25
|
+
return createUserMessage(React, Box, Text, message, index, options, timestamp, wrappedLines);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
// Assistant and system messages: parse markdown (cached via parseMarkdown)
|
|
29
|
+
const markdownElements = parseMarkdown(message.content, message.role === 'system' ? 'yellow' : undefined);
|
|
30
|
+
if (message.role === 'assistant') {
|
|
31
|
+
// LLM-generated messages: minimalistic bordered rectangle style
|
|
32
|
+
return createAssistantMessage(React, Box, Text, index, options, markdownElements);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
// System messages: styled with bright yellow color to make them pop (no prefix)
|
|
36
|
+
return createSystemMessage(React, Box, index, markdownElements);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
// Wrap with memo for performance
|
|
41
|
+
const MessageComponent = memo(MessageComponentInner, (prevProps, nextProps) => {
|
|
42
|
+
// Custom comparison: re-render if message content, role, index, or options changed
|
|
43
|
+
return (prevProps.message.content === nextProps.message.content &&
|
|
44
|
+
prevProps.message.role === nextProps.message.role &&
|
|
45
|
+
prevProps.index === nextProps.index &&
|
|
46
|
+
prevProps.options.showTimestamps === nextProps.options.showTimestamps);
|
|
47
|
+
});
|
|
48
|
+
return MessageComponent;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=message-component.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Messages list component factory for Chat UI.
|
|
3
|
+
* Creates a messages list component that works with dynamically imported React/Ink.
|
|
4
|
+
*/
|
|
5
|
+
import type { ChatMessage, ChatUIOptions } from '../chat-ui-types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Creates a Messages List component element.
|
|
8
|
+
* @param React - React module (dynamically imported)
|
|
9
|
+
* @param Box - Box component from Ink
|
|
10
|
+
* @param Text - Text component from Ink
|
|
11
|
+
* @param messages - Array of chat messages
|
|
12
|
+
* @param maxVisibleMessages - Maximum number of messages to display
|
|
13
|
+
* @param MessageComponent - The memoized message component to use
|
|
14
|
+
* @param options - Chat UI options
|
|
15
|
+
* @returns Messages list component element
|
|
16
|
+
*/
|
|
17
|
+
export declare function createMessagesList(React: {
|
|
18
|
+
createElement: (type: unknown, props?: unknown, ...children: unknown[]) => unknown;
|
|
19
|
+
}, Box: unknown, Text: unknown, messages: ChatMessage[], maxVisibleMessages: number, MessageComponent: (props: {
|
|
20
|
+
message: ChatMessage;
|
|
21
|
+
index: number;
|
|
22
|
+
options: ChatUIOptions;
|
|
23
|
+
}) => unknown, options: ChatUIOptions): unknown;
|
|
24
|
+
//# sourceMappingURL=messages-list.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Messages list component factory for Chat UI.
|
|
3
|
+
* Creates a messages list component that works with dynamically imported React/Ink.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Creates a Messages List component element.
|
|
7
|
+
* @param React - React module (dynamically imported)
|
|
8
|
+
* @param Box - Box component from Ink
|
|
9
|
+
* @param Text - Text component from Ink
|
|
10
|
+
* @param messages - Array of chat messages
|
|
11
|
+
* @param maxVisibleMessages - Maximum number of messages to display
|
|
12
|
+
* @param MessageComponent - The memoized message component to use
|
|
13
|
+
* @param options - Chat UI options
|
|
14
|
+
* @returns Messages list component element
|
|
15
|
+
*/
|
|
16
|
+
export function createMessagesList(React, Box, Text, messages, maxVisibleMessages, MessageComponent, options) {
|
|
17
|
+
const { createElement } = React;
|
|
18
|
+
// Determine which messages to show (always show last N messages)
|
|
19
|
+
const visibleMessages = messages.slice(-maxVisibleMessages);
|
|
20
|
+
const hiddenCount = messages.length - visibleMessages.length;
|
|
21
|
+
const startIndex = Math.max(0, messages.length - maxVisibleMessages);
|
|
22
|
+
return createElement(Box, {
|
|
23
|
+
flexDirection: 'column',
|
|
24
|
+
flexGrow: 1,
|
|
25
|
+
flexShrink: 1,
|
|
26
|
+
paddingX: 1,
|
|
27
|
+
minHeight: 0, // Allow shrinking below content size
|
|
28
|
+
},
|
|
29
|
+
// Show message if there are hidden messages
|
|
30
|
+
hiddenCount > 0
|
|
31
|
+
? createElement(Box, {
|
|
32
|
+
key: 'viewport-info',
|
|
33
|
+
marginY: 0.5,
|
|
34
|
+
paddingX: 1,
|
|
35
|
+
}, createElement(Text, { color: 'yellow', dimColor: true }, `... ${hiddenCount} earlier message${hiddenCount > 1 ? 's' : ''} hidden (showing last ${maxVisibleMessages} messages).`))
|
|
36
|
+
: null,
|
|
37
|
+
// Render visible messages
|
|
38
|
+
...visibleMessages.map((message, localIndex) => {
|
|
39
|
+
const globalIndex = startIndex + localIndex;
|
|
40
|
+
return createElement(MessageComponent, {
|
|
41
|
+
key: `${message.role}-${globalIndex}`,
|
|
42
|
+
message,
|
|
43
|
+
index: globalIndex,
|
|
44
|
+
options,
|
|
45
|
+
});
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=messages-list.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* System message component factory for Chat UI.
|
|
3
|
+
* Creates a system message component that works with dynamically imported React/Ink.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Creates a System Message component element.
|
|
7
|
+
* @param React - React module (dynamically imported)
|
|
8
|
+
* @param Box - Box component from Ink
|
|
9
|
+
* @param index - Message index
|
|
10
|
+
* @param markdownElements - Parsed markdown elements
|
|
11
|
+
* @returns System message component element
|
|
12
|
+
*/
|
|
13
|
+
export declare function createSystemMessage(React: {
|
|
14
|
+
createElement: (type: unknown, props?: unknown, ...children: unknown[]) => unknown;
|
|
15
|
+
}, Box: unknown, index: number, markdownElements: unknown[]): unknown;
|
|
16
|
+
//# sourceMappingURL=system-message.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* System message component factory for Chat UI.
|
|
3
|
+
* Creates a system message component that works with dynamically imported React/Ink.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Creates a System Message component element.
|
|
7
|
+
* @param React - React module (dynamically imported)
|
|
8
|
+
* @param Box - Box component from Ink
|
|
9
|
+
* @param index - Message index
|
|
10
|
+
* @param markdownElements - Parsed markdown elements
|
|
11
|
+
* @returns System message component element
|
|
12
|
+
*/
|
|
13
|
+
export function createSystemMessage(React, Box, index, markdownElements) {
|
|
14
|
+
const { createElement } = React;
|
|
15
|
+
// System messages: no prefix; color is applied by parseMarkdown in message-component.tsx
|
|
16
|
+
return createElement(Box, {
|
|
17
|
+
key: index,
|
|
18
|
+
flexDirection: 'column',
|
|
19
|
+
marginY: 0.5,
|
|
20
|
+
}, createElement(Box, {
|
|
21
|
+
flexDirection: 'column',
|
|
22
|
+
paddingX: 1,
|
|
23
|
+
paddingY: 0.5,
|
|
24
|
+
}, ...markdownElements));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=system-message.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User message component factory for Chat UI.
|
|
3
|
+
* Creates a user message component that works with dynamically imported React/Ink.
|
|
4
|
+
*/
|
|
5
|
+
import type { ChatMessage, ChatUIOptions } from '../chat-ui-types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Creates a User Message component element.
|
|
8
|
+
* @param React - React module (dynamically imported)
|
|
9
|
+
* @param Box - Box component from Ink
|
|
10
|
+
* @param Text - Text component from Ink
|
|
11
|
+
* @param _message - The chat message (unused but required for interface compatibility)
|
|
12
|
+
* @param index - Message index
|
|
13
|
+
* @param _options - Chat UI options (unused but required for interface compatibility)
|
|
14
|
+
* @param timestamp - Formatted timestamp string
|
|
15
|
+
* @param wrappedLines - Wrapped text lines
|
|
16
|
+
* @returns User message component element
|
|
17
|
+
*/
|
|
18
|
+
export declare function createUserMessage(React: {
|
|
19
|
+
createElement: (type: unknown, props?: unknown, ...children: unknown[]) => unknown;
|
|
20
|
+
}, Box: unknown, Text: unknown, _message: ChatMessage, index: number, _options: ChatUIOptions, timestamp: string, wrappedLines: string[]): unknown;
|
|
21
|
+
//# sourceMappingURL=user-message.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User message component factory for Chat UI.
|
|
3
|
+
* Creates a user message component that works with dynamically imported React/Ink.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Creates a User Message component element.
|
|
7
|
+
* @param React - React module (dynamically imported)
|
|
8
|
+
* @param Box - Box component from Ink
|
|
9
|
+
* @param Text - Text component from Ink
|
|
10
|
+
* @param _message - The chat message (unused but required for interface compatibility)
|
|
11
|
+
* @param index - Message index
|
|
12
|
+
* @param _options - Chat UI options (unused but required for interface compatibility)
|
|
13
|
+
* @param timestamp - Formatted timestamp string
|
|
14
|
+
* @param wrappedLines - Wrapped text lines
|
|
15
|
+
* @returns User message component element
|
|
16
|
+
*/
|
|
17
|
+
export function createUserMessage(React, Box, Text, _message, index, _options, timestamp, wrappedLines) {
|
|
18
|
+
const { createElement } = React;
|
|
19
|
+
// User messages: minimalistic bordered rectangle with blue background
|
|
20
|
+
return createElement(Box, {
|
|
21
|
+
key: index,
|
|
22
|
+
flexDirection: 'column',
|
|
23
|
+
alignItems: 'flex-end',
|
|
24
|
+
marginY: 1,
|
|
25
|
+
}, createElement(Box, {
|
|
26
|
+
flexDirection: 'column',
|
|
27
|
+
borderStyle: 'round',
|
|
28
|
+
borderColor: 'blue',
|
|
29
|
+
backgroundColor: 'blue',
|
|
30
|
+
paddingX: 1,
|
|
31
|
+
paddingY: 0.1,
|
|
32
|
+
marginRight: 1,
|
|
33
|
+
}, ...wrappedLines.map((line, lineIndex) => createElement(Text, { key: lineIndex, color: 'white' }, lineIndex === 0 ? timestamp + line : line))));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=user-message.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Welcome banner component factory for Chat UI.
|
|
3
|
+
* Creates a persistent welcome banner that displays Syrin branding and info.
|
|
4
|
+
*/
|
|
5
|
+
export interface WelcomeBannerOptions {
|
|
6
|
+
versionDisplay: string;
|
|
7
|
+
llmProvider: string;
|
|
8
|
+
toolCount: number;
|
|
9
|
+
transport: string;
|
|
10
|
+
mcpUrl?: string;
|
|
11
|
+
command?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Creates a Welcome Banner component factory function.
|
|
15
|
+
* @param React - React module (dynamically imported)
|
|
16
|
+
* @param Box - Box component from Ink
|
|
17
|
+
* @param Text - Text component from Ink
|
|
18
|
+
* @param options - Welcome banner options
|
|
19
|
+
* @returns Welcome banner component element
|
|
20
|
+
*/
|
|
21
|
+
export declare function createWelcomeBanner(React: {
|
|
22
|
+
createElement: (type: unknown, props?: unknown, ...children: unknown[]) => unknown;
|
|
23
|
+
}, Box: unknown, Text: unknown, options: WelcomeBannerOptions): unknown;
|
|
24
|
+
//# sourceMappingURL=welcome-banner.d.ts.map
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Welcome banner component factory for Chat UI.
|
|
3
|
+
* Creates a persistent welcome banner that displays Syrin branding and info.
|
|
4
|
+
*/
|
|
5
|
+
import { SYRIN_LINKS } from '../../../constants/links.js';
|
|
6
|
+
/**
|
|
7
|
+
* Creates a Welcome Banner component factory function.
|
|
8
|
+
* @param React - React module (dynamically imported)
|
|
9
|
+
* @param Box - Box component from Ink
|
|
10
|
+
* @param Text - Text component from Ink
|
|
11
|
+
* @param options - Welcome banner options
|
|
12
|
+
* @returns Welcome banner component element
|
|
13
|
+
*/
|
|
14
|
+
export function createWelcomeBanner(React, Box, Text, options) {
|
|
15
|
+
const { createElement } = React;
|
|
16
|
+
// ASCII art for "Syrin" - gradient style (similar to speed version)
|
|
17
|
+
// Using gradient colors from cyan -> blue -> magenta for visual effect
|
|
18
|
+
// Properly formatted ASCII art for "Syrin"
|
|
19
|
+
const syrinAscii = [
|
|
20
|
+
'________ _____',
|
|
21
|
+
'__ ___/____ ___________(_)______',
|
|
22
|
+
'_____ \\__ / / /_ ___/_ /__ __ \\',
|
|
23
|
+
'____/ /_ /_/ /_ / _ / _ / / /',
|
|
24
|
+
'/____/ _\\__, / /_/ /_/ /_/ /_/',
|
|
25
|
+
' /____/',
|
|
26
|
+
];
|
|
27
|
+
// Version display - already formatted by formatVersionWithUpdate in dev.ts
|
|
28
|
+
const versionDisplay = options.versionDisplay;
|
|
29
|
+
// Gradient effect: cyan -> blue -> magenta -> cyan -> blue -> magenta
|
|
30
|
+
// Allocated once and reused in map to avoid reallocation on every iteration
|
|
31
|
+
const gradientColors = ['cyan', 'blue', 'magenta', 'cyan', 'blue', 'magenta'];
|
|
32
|
+
return createElement(Box, {
|
|
33
|
+
width: '100%',
|
|
34
|
+
flexDirection: 'row',
|
|
35
|
+
justifyContent: 'center',
|
|
36
|
+
alignItems: 'flex-start',
|
|
37
|
+
},
|
|
38
|
+
// Centered container with max width
|
|
39
|
+
createElement(Box, {
|
|
40
|
+
width: '70%',
|
|
41
|
+
maxWidth: 90,
|
|
42
|
+
borderStyle: 'single',
|
|
43
|
+
borderColor: 'cyan',
|
|
44
|
+
paddingX: 1,
|
|
45
|
+
paddingY: 1,
|
|
46
|
+
},
|
|
47
|
+
// Outer container
|
|
48
|
+
createElement(Box, {
|
|
49
|
+
flexDirection: 'column',
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
width: '100%',
|
|
52
|
+
},
|
|
53
|
+
// ASCII art title - left aligned text in a centered container
|
|
54
|
+
createElement(Box, {
|
|
55
|
+
flexDirection: 'column',
|
|
56
|
+
alignItems: 'center',
|
|
57
|
+
marginBottom: 1,
|
|
58
|
+
width: '100%',
|
|
59
|
+
}, createElement(Box, {
|
|
60
|
+
flexDirection: 'column',
|
|
61
|
+
alignItems: 'flex-start',
|
|
62
|
+
}, ...syrinAscii.map((line, index) => {
|
|
63
|
+
const color = gradientColors[index % gradientColors.length] || 'cyan';
|
|
64
|
+
// Trim the line to remove any trailing spaces that could cause alignment issues
|
|
65
|
+
const trimmedLine = line.trimEnd();
|
|
66
|
+
return createElement(Text, {
|
|
67
|
+
key: index,
|
|
68
|
+
color,
|
|
69
|
+
bold: true,
|
|
70
|
+
}, trimmedLine);
|
|
71
|
+
}))),
|
|
72
|
+
// Version
|
|
73
|
+
createElement(Box, {
|
|
74
|
+
flexDirection: 'row',
|
|
75
|
+
justifyContent: 'center',
|
|
76
|
+
marginBottom: 1,
|
|
77
|
+
}, createElement(Text, { color: 'white', bold: true }, versionDisplay)),
|
|
78
|
+
// Details section - centered container with left-aligned content
|
|
79
|
+
createElement(Box, {
|
|
80
|
+
flexDirection: 'column',
|
|
81
|
+
alignItems: 'center',
|
|
82
|
+
marginTop: 1,
|
|
83
|
+
width: '100%',
|
|
84
|
+
}, createElement(Box, {
|
|
85
|
+
flexDirection: 'column',
|
|
86
|
+
alignItems: 'flex-start',
|
|
87
|
+
width: '100%',
|
|
88
|
+
minWidth: 0,
|
|
89
|
+
paddingX: 0,
|
|
90
|
+
paddingRight: 1,
|
|
91
|
+
},
|
|
92
|
+
// Transport info
|
|
93
|
+
createElement(Box, {
|
|
94
|
+
flexDirection: 'row',
|
|
95
|
+
marginBottom: 0.5,
|
|
96
|
+
width: '100%',
|
|
97
|
+
}, createElement(Text, { color: 'yellow' }, '📦 Transport: '), createElement(Text, { color: 'white' }, options.transport.toUpperCase())),
|
|
98
|
+
// MCP URL or command
|
|
99
|
+
options.mcpUrl
|
|
100
|
+
? createElement(Box, {
|
|
101
|
+
flexDirection: 'row',
|
|
102
|
+
marginBottom: 0.5,
|
|
103
|
+
width: '100%',
|
|
104
|
+
}, createElement(Text, { color: 'yellow' }, '🔗 Server URL: '), createElement(Text, { color: 'white' }, options.mcpUrl))
|
|
105
|
+
: options.command
|
|
106
|
+
? createElement(Box, {
|
|
107
|
+
flexDirection: 'row',
|
|
108
|
+
marginBottom: 0.5,
|
|
109
|
+
width: '100%',
|
|
110
|
+
}, createElement(Text, { color: 'yellow' }, '⚙️ Command: '), createElement(Text, { color: 'white' }, options.command))
|
|
111
|
+
: null,
|
|
112
|
+
// LLM and Tools info
|
|
113
|
+
createElement(Box, {
|
|
114
|
+
flexDirection: 'row',
|
|
115
|
+
marginBottom: 0.5,
|
|
116
|
+
width: '100%',
|
|
117
|
+
}, createElement(Text, { color: 'yellow' }, '🤖 LLM: '), createElement(Text, { color: 'white' }, options.llmProvider)), createElement(Box, {
|
|
118
|
+
flexDirection: 'row',
|
|
119
|
+
marginBottom: 0.5,
|
|
120
|
+
width: '100%',
|
|
121
|
+
}, createElement(Text, { color: 'yellow' }, '🔨 Tools: '), createElement(Text, { color: 'white' }, options.toolCount.toString()), createElement(Text, { color: 'yellow', dimColor: true }, ' (/tools to see)')),
|
|
122
|
+
// Links
|
|
123
|
+
createElement(Box, {
|
|
124
|
+
flexDirection: 'row',
|
|
125
|
+
marginTop: 1,
|
|
126
|
+
marginBottom: 0.5,
|
|
127
|
+
width: '100%',
|
|
128
|
+
}, createElement(Text, { color: 'yellow' }, '📚 Docs: '), createElement(Text, { color: 'cyan' }, SYRIN_LINKS.DOCS)), createElement(Box, {
|
|
129
|
+
flexDirection: 'row',
|
|
130
|
+
marginBottom: 0.5,
|
|
131
|
+
width: '100%',
|
|
132
|
+
}, createElement(Text, { color: 'yellow' }, '📦 NPM: '), createElement(Text, { color: 'cyan' }, SYRIN_LINKS.NPM)), createElement(Box, {
|
|
133
|
+
flexDirection: 'row',
|
|
134
|
+
marginBottom: 0.5,
|
|
135
|
+
width: '100%',
|
|
136
|
+
}, createElement(Text, { color: 'yellow' }, '🐙 GitHub: '), createElement(Text, { color: 'cyan' }, SYRIN_LINKS.GITHUB)),
|
|
137
|
+
// Help message
|
|
138
|
+
createElement(Box, {
|
|
139
|
+
flexDirection: 'row',
|
|
140
|
+
marginTop: 1,
|
|
141
|
+
marginBottom: 0.5,
|
|
142
|
+
width: '100%',
|
|
143
|
+
justifyContent: 'center',
|
|
144
|
+
}, createElement(Text, { color: 'yellow', dimColor: true }, '💡 Send /help command to find out chat commands and how to use them')))))));
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=welcome-banner.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Goodbye message generator for dev mode.
|
|
3
|
+
* Generates funny, shareable goodbye messages when users exit.
|
|
4
|
+
*/
|
|
5
|
+
import type { LLMProvider } from '../../runtime/llm/provider.js';
|
|
6
|
+
import type { DevSessionState } from '../../runtime/dev/types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Minimal LLM interface for goodbye message generation.
|
|
9
|
+
*/
|
|
10
|
+
interface MinimalLLMProvider {
|
|
11
|
+
chat: (request: {
|
|
12
|
+
messages: Array<{
|
|
13
|
+
role: string;
|
|
14
|
+
content: string;
|
|
15
|
+
}>;
|
|
16
|
+
temperature?: number;
|
|
17
|
+
maxTokens?: number;
|
|
18
|
+
}) => Promise<{
|
|
19
|
+
content: string;
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Generate an appropriate goodbye message based on session activity.
|
|
24
|
+
*
|
|
25
|
+
* @param llmProvider - LLM provider to use for generating funny messages (can be minimal interface)
|
|
26
|
+
* @param sessionState - Current session state
|
|
27
|
+
* @returns Promise resolving to goodbye message string
|
|
28
|
+
*/
|
|
29
|
+
export declare function generateGoodbyeMessage(llmProvider: LLMProvider | MinimalLLMProvider | null, sessionState: DevSessionState): Promise<string>;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=goodbye-messages.d.ts.map
|