@vibesdotdev/cli 0.0.1
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/README.md +41 -0
- package/SPEC.md +97 -0
- package/bin/vibes.ts +26 -0
- package/dist/api/client/factory.d.ts +29 -0
- package/dist/api/client/factory.d.ts.map +1 -0
- package/dist/api/client/factory.js +189 -0
- package/dist/api/client/factory.js.map +1 -0
- package/dist/api/schemas/common.d.ts +58 -0
- package/dist/api/schemas/common.d.ts.map +1 -0
- package/dist/api/schemas/common.js +48 -0
- package/dist/api/schemas/common.js.map +1 -0
- package/dist/api/schemas/types.d.ts +30 -0
- package/dist/api/schemas/types.d.ts.map +1 -0
- package/dist/api/schemas/types.js +2 -0
- package/dist/api/schemas/types.js.map +1 -0
- package/dist/api/services/api.d.ts +14 -0
- package/dist/api/services/api.d.ts.map +1 -0
- package/dist/api/services/api.js +110 -0
- package/dist/api/services/api.js.map +1 -0
- package/dist/api/types.d.ts +6 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +5 -0
- package/dist/api/types.js.map +1 -0
- package/dist/bin.d.ts +28 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +73 -0
- package/dist/bin.js.map +1 -0
- package/dist/bootstrap.d.ts +14 -0
- package/dist/bootstrap.d.ts.map +1 -0
- package/dist/bootstrap.js +14 -0
- package/dist/bootstrap.js.map +1 -0
- package/dist/cli.plugin.d.ts +20 -0
- package/dist/cli.plugin.d.ts.map +1 -0
- package/dist/cli.plugin.js +170 -0
- package/dist/cli.plugin.js.map +1 -0
- package/dist/commands/completion/bash.d.ts +8 -0
- package/dist/commands/completion/bash.d.ts.map +1 -0
- package/dist/commands/completion/bash.js +60 -0
- package/dist/commands/completion/bash.js.map +1 -0
- package/dist/commands/completion/completion.descriptor.d.ts +10 -0
- package/dist/commands/completion/completion.descriptor.d.ts.map +1 -0
- package/dist/commands/completion/completion.descriptor.js +41 -0
- package/dist/commands/completion/completion.descriptor.js.map +1 -0
- package/dist/commands/completion/completion.impl.d.ts +12 -0
- package/dist/commands/completion/completion.impl.d.ts.map +1 -0
- package/dist/commands/completion/completion.impl.js +167 -0
- package/dist/commands/completion/completion.impl.js.map +1 -0
- package/dist/commands/completion/fig.d.ts +12 -0
- package/dist/commands/completion/fig.d.ts.map +1 -0
- package/dist/commands/completion/fig.js +71 -0
- package/dist/commands/completion/fig.js.map +1 -0
- package/dist/commands/completion/fish.d.ts +8 -0
- package/dist/commands/completion/fish.d.ts.map +1 -0
- package/dist/commands/completion/fish.js +38 -0
- package/dist/commands/completion/fish.js.map +1 -0
- package/dist/commands/completion/tree.d.ts +33 -0
- package/dist/commands/completion/tree.d.ts.map +1 -0
- package/dist/commands/completion/tree.js +75 -0
- package/dist/commands/completion/tree.js.map +1 -0
- package/dist/commands/completion/zsh-widget.d.ts +13 -0
- package/dist/commands/completion/zsh-widget.d.ts.map +1 -0
- package/dist/commands/completion/zsh-widget.js +39 -0
- package/dist/commands/completion/zsh-widget.js.map +1 -0
- package/dist/commands/completion/zsh.d.ts +9 -0
- package/dist/commands/completion/zsh.d.ts.map +1 -0
- package/dist/commands/completion/zsh.js +146 -0
- package/dist/commands/completion/zsh.js.map +1 -0
- package/dist/commands/profile/_utils.d.ts +21 -0
- package/dist/commands/profile/_utils.d.ts.map +1 -0
- package/dist/commands/profile/_utils.js +61 -0
- package/dist/commands/profile/_utils.js.map +1 -0
- package/dist/commands/profile/profile-group.descriptor.d.ts +4 -0
- package/dist/commands/profile/profile-group.descriptor.d.ts.map +1 -0
- package/dist/commands/profile/profile-group.descriptor.js +12 -0
- package/dist/commands/profile/profile-group.descriptor.js.map +1 -0
- package/dist/commands/profile/profile.create.descriptor.d.ts +4 -0
- package/dist/commands/profile/profile.create.descriptor.d.ts.map +1 -0
- package/dist/commands/profile/profile.create.descriptor.js +22 -0
- package/dist/commands/profile/profile.create.descriptor.js.map +1 -0
- package/dist/commands/profile/profile.create.impl.d.ts +10 -0
- package/dist/commands/profile/profile.create.impl.d.ts.map +1 -0
- package/dist/commands/profile/profile.create.impl.js +29 -0
- package/dist/commands/profile/profile.create.impl.js.map +1 -0
- package/dist/commands/profile/profile.delete.descriptor.d.ts +4 -0
- package/dist/commands/profile/profile.delete.descriptor.d.ts.map +1 -0
- package/dist/commands/profile/profile.delete.descriptor.js +29 -0
- package/dist/commands/profile/profile.delete.descriptor.js.map +1 -0
- package/dist/commands/profile/profile.delete.impl.d.ts +11 -0
- package/dist/commands/profile/profile.delete.impl.d.ts.map +1 -0
- package/dist/commands/profile/profile.delete.impl.js +50 -0
- package/dist/commands/profile/profile.delete.impl.js.map +1 -0
- package/dist/commands/profile/profile.info.descriptor.d.ts +4 -0
- package/dist/commands/profile/profile.info.descriptor.d.ts.map +1 -0
- package/dist/commands/profile/profile.info.descriptor.js +23 -0
- package/dist/commands/profile/profile.info.descriptor.js.map +1 -0
- package/dist/commands/profile/profile.info.impl.d.ts +10 -0
- package/dist/commands/profile/profile.info.impl.d.ts.map +1 -0
- package/dist/commands/profile/profile.info.impl.js +33 -0
- package/dist/commands/profile/profile.info.impl.js.map +1 -0
- package/dist/commands/profile/profile.list.descriptor.d.ts +4 -0
- package/dist/commands/profile/profile.list.descriptor.d.ts.map +1 -0
- package/dist/commands/profile/profile.list.descriptor.js +16 -0
- package/dist/commands/profile/profile.list.descriptor.js.map +1 -0
- package/dist/commands/profile/profile.list.impl.d.ts +10 -0
- package/dist/commands/profile/profile.list.impl.d.ts.map +1 -0
- package/dist/commands/profile/profile.list.impl.js +33 -0
- package/dist/commands/profile/profile.list.impl.js.map +1 -0
- package/dist/commands/profile/profile.use.descriptor.d.ts +4 -0
- package/dist/commands/profile/profile.use.descriptor.d.ts.map +1 -0
- package/dist/commands/profile/profile.use.descriptor.js +23 -0
- package/dist/commands/profile/profile.use.descriptor.js.map +1 -0
- package/dist/commands/profile/profile.use.impl.d.ts +10 -0
- package/dist/commands/profile/profile.use.impl.d.ts.map +1 -0
- package/dist/commands/profile/profile.use.impl.js +24 -0
- package/dist/commands/profile/profile.use.impl.js.map +1 -0
- package/dist/commands/runtime/_logging.d.ts +11 -0
- package/dist/commands/runtime/_logging.d.ts.map +1 -0
- package/dist/commands/runtime/_logging.js +40 -0
- package/dist/commands/runtime/_logging.js.map +1 -0
- package/dist/commands/runtime/codegen.command.descriptor.d.ts +15 -0
- package/dist/commands/runtime/codegen.command.descriptor.d.ts.map +1 -0
- package/dist/commands/runtime/codegen.command.descriptor.js +18 -0
- package/dist/commands/runtime/codegen.command.descriptor.js.map +1 -0
- package/dist/commands/runtime/codegen.command.impl.d.ts +4 -0
- package/dist/commands/runtime/codegen.command.impl.d.ts.map +1 -0
- package/dist/commands/runtime/codegen.command.impl.js +39 -0
- package/dist/commands/runtime/codegen.command.impl.js.map +1 -0
- package/dist/commands/runtime/codegen.d.ts +17 -0
- package/dist/commands/runtime/codegen.d.ts.map +1 -0
- package/dist/commands/runtime/codegen.js +65 -0
- package/dist/commands/runtime/codegen.js.map +1 -0
- package/dist/commands/runtime/index.d.ts +4 -0
- package/dist/commands/runtime/index.d.ts.map +1 -0
- package/dist/commands/runtime/index.js +8 -0
- package/dist/commands/runtime/index.js.map +1 -0
- package/dist/commands/runtime/plugin.d.ts +2 -0
- package/dist/commands/runtime/plugin.d.ts.map +1 -0
- package/dist/commands/runtime/plugin.js +7 -0
- package/dist/commands/runtime/plugin.js.map +1 -0
- package/dist/commands/runtime/runtime-group.descriptor.d.ts +4 -0
- package/dist/commands/runtime/runtime-group.descriptor.d.ts.map +1 -0
- package/dist/commands/runtime/runtime-group.descriptor.js +10 -0
- package/dist/commands/runtime/runtime-group.descriptor.js.map +1 -0
- package/dist/config.d.ts +17 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +11 -0
- package/dist/config.js.map +1 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +5 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/namespace/hook.d.ts +12 -0
- package/dist/core/namespace/hook.d.ts.map +1 -0
- package/dist/core/namespace/hook.js +15 -0
- package/dist/core/namespace/hook.js.map +1 -0
- package/dist/core/namespace/index.d.ts +18 -0
- package/dist/core/namespace/index.d.ts.map +1 -0
- package/dist/core/namespace/index.js +214 -0
- package/dist/core/namespace/index.js.map +1 -0
- package/dist/core/namespace/schemas/index.d.ts +25 -0
- package/dist/core/namespace/schemas/index.d.ts.map +1 -0
- package/dist/core/namespace/schemas/index.js +2 -0
- package/dist/core/namespace/schemas/index.js.map +1 -0
- package/dist/core/plugins/types.d.ts +81 -0
- package/dist/core/plugins/types.d.ts.map +1 -0
- package/dist/core/plugins/types.js +6 -0
- package/dist/core/plugins/types.js.map +1 -0
- package/dist/core/runtime/context.d.ts +25 -0
- package/dist/core/runtime/context.d.ts.map +1 -0
- package/dist/core/runtime/context.js +30 -0
- package/dist/core/runtime/context.js.map +1 -0
- package/dist/core/runtime/hooks.d.ts +12 -0
- package/dist/core/runtime/hooks.d.ts.map +1 -0
- package/dist/core/runtime/hooks.js +2 -0
- package/dist/core/runtime/hooks.js.map +1 -0
- package/dist/core/runtime/shared/context.d.ts +33 -0
- package/dist/core/runtime/shared/context.d.ts.map +1 -0
- package/dist/core/runtime/shared/context.js +51 -0
- package/dist/core/runtime/shared/context.js.map +1 -0
- package/dist/core/runtime/shared/options.d.ts +20 -0
- package/dist/core/runtime/shared/options.d.ts.map +1 -0
- package/dist/core/runtime/shared/options.js +61 -0
- package/dist/core/runtime/shared/options.js.map +1 -0
- package/dist/core/schemas/manifest.d.ts +24 -0
- package/dist/core/schemas/manifest.d.ts.map +1 -0
- package/dist/core/schemas/manifest.js +6 -0
- package/dist/core/schemas/manifest.js.map +1 -0
- package/dist/core/schemas/types.d.ts +7 -0
- package/dist/core/schemas/types.d.ts.map +1 -0
- package/dist/core/schemas/types.js +2 -0
- package/dist/core/schemas/types.js.map +1 -0
- package/dist/core/ui/interface.d.ts +12 -0
- package/dist/core/ui/interface.d.ts.map +1 -0
- package/dist/core/ui/interface.js +6 -0
- package/dist/core/ui/interface.js.map +1 -0
- package/dist/docs/cli.commands.docs.descriptor.d.ts +4 -0
- package/dist/docs/cli.commands.docs.descriptor.d.ts.map +1 -0
- package/dist/docs/cli.commands.docs.descriptor.js +207 -0
- package/dist/docs/cli.commands.docs.descriptor.js.map +1 -0
- package/dist/docs/cli.groups.docs.descriptor.d.ts +4 -0
- package/dist/docs/cli.groups.docs.descriptor.d.ts.map +1 -0
- package/dist/docs/cli.groups.docs.descriptor.js +330 -0
- package/dist/docs/cli.groups.docs.descriptor.js.map +1 -0
- package/dist/docs/cli.output.docs.descriptor.d.ts +4 -0
- package/dist/docs/cli.output.docs.descriptor.d.ts.map +1 -0
- package/dist/docs/cli.output.docs.descriptor.js +442 -0
- package/dist/docs/cli.output.docs.descriptor.js.map +1 -0
- package/dist/docs/types.d.ts +19 -0
- package/dist/docs/types.d.ts.map +1 -0
- package/dist/docs/types.js +2 -0
- package/dist/docs/types.js.map +1 -0
- package/dist/errors.d.ts +74 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +113 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/logging/cli-startup.logger.descriptor.d.ts +7 -0
- package/dist/logging/cli-startup.logger.descriptor.d.ts.map +1 -0
- package/dist/logging/cli-startup.logger.descriptor.js +13 -0
- package/dist/logging/cli-startup.logger.descriptor.js.map +1 -0
- package/dist/logging.d.ts +4 -0
- package/dist/logging.d.ts.map +1 -0
- package/dist/logging.js +21 -0
- package/dist/logging.js.map +1 -0
- package/dist/patterns/config-namespace.d.ts +23 -0
- package/dist/patterns/config-namespace.d.ts.map +1 -0
- package/dist/patterns/config-namespace.js +218 -0
- package/dist/patterns/config-namespace.js.map +1 -0
- package/dist/patterns/crud.d.ts +23 -0
- package/dist/patterns/crud.d.ts.map +1 -0
- package/dist/patterns/crud.js +164 -0
- package/dist/patterns/crud.js.map +1 -0
- package/dist/patterns/index.d.ts +13 -0
- package/dist/patterns/index.d.ts.map +1 -0
- package/dist/patterns/index.js +13 -0
- package/dist/patterns/index.js.map +1 -0
- package/dist/patterns/log-viewer.d.ts +19 -0
- package/dist/patterns/log-viewer.d.ts.map +1 -0
- package/dist/patterns/log-viewer.js +74 -0
- package/dist/patterns/log-viewer.js.map +1 -0
- package/dist/patterns/pattern-types.d.ts +21 -0
- package/dist/patterns/pattern-types.d.ts.map +1 -0
- package/dist/patterns/pattern-types.js +7 -0
- package/dist/patterns/pattern-types.js.map +1 -0
- package/dist/patterns/process-manager.d.ts +21 -0
- package/dist/patterns/process-manager.d.ts.map +1 -0
- package/dist/patterns/process-manager.js +134 -0
- package/dist/patterns/process-manager.js.map +1 -0
- package/dist/patterns/resolver.contracts.d.ts +14 -0
- package/dist/patterns/resolver.contracts.d.ts.map +1 -0
- package/dist/patterns/resolver.contracts.js +9 -0
- package/dist/patterns/resolver.contracts.js.map +1 -0
- package/dist/patterns/resolver.d.ts +40 -0
- package/dist/patterns/resolver.d.ts.map +1 -0
- package/dist/patterns/resolver.js +63 -0
- package/dist/patterns/resolver.js.map +1 -0
- package/dist/patterns/schemas.d.ts +496 -0
- package/dist/patterns/schemas.d.ts.map +1 -0
- package/dist/patterns/schemas.js +105 -0
- package/dist/patterns/schemas.js.map +1 -0
- package/dist/patterns/tool-wrapper.d.ts +18 -0
- package/dist/patterns/tool-wrapper.d.ts.map +1 -0
- package/dist/patterns/tool-wrapper.js +130 -0
- package/dist/patterns/tool-wrapper.js.map +1 -0
- package/dist/providers.d.ts +105 -0
- package/dist/providers.d.ts.map +1 -0
- package/dist/providers.js +164 -0
- package/dist/providers.js.map +1 -0
- package/dist/schemas/descriptors.d.ts +130 -0
- package/dist/schemas/descriptors.d.ts.map +1 -0
- package/dist/schemas/descriptors.js +96 -0
- package/dist/schemas/descriptors.js.map +1 -0
- package/dist/schemas/surface.d.ts +40 -0
- package/dist/schemas/surface.d.ts.map +1 -0
- package/dist/schemas/surface.js +2 -0
- package/dist/schemas/surface.js.map +1 -0
- package/dist/schemas/types.d.ts +202 -0
- package/dist/schemas/types.d.ts.map +1 -0
- package/dist/schemas/types.js +2 -0
- package/dist/schemas/types.js.map +1 -0
- package/dist/support/ui-toolkit.d.ts +62 -0
- package/dist/support/ui-toolkit.d.ts.map +1 -0
- package/dist/support/ui-toolkit.js +172 -0
- package/dist/support/ui-toolkit.js.map +1 -0
- package/dist/surface/CLISurface.d.ts +16 -0
- package/dist/surface/CLISurface.d.ts.map +1 -0
- package/dist/surface/CLISurface.js +173 -0
- package/dist/surface/CLISurface.js.map +1 -0
- package/dist/surface/attach-tui-action.d.ts +12 -0
- package/dist/surface/attach-tui-action.d.ts.map +1 -0
- package/dist/surface/attach-tui-action.js +48 -0
- package/dist/surface/attach-tui-action.js.map +1 -0
- package/dist/surface/build-context.d.ts +4 -0
- package/dist/surface/build-context.d.ts.map +1 -0
- package/dist/surface/build-context.js +49 -0
- package/dist/surface/build-context.js.map +1 -0
- package/dist/surface/command-group-policy.d.ts +7 -0
- package/dist/surface/command-group-policy.d.ts.map +1 -0
- package/dist/surface/command-group-policy.js +42 -0
- package/dist/surface/command-group-policy.js.map +1 -0
- package/dist/surface/discovery-cache.d.ts +17 -0
- package/dist/surface/discovery-cache.d.ts.map +1 -0
- package/dist/surface/discovery-cache.js +106 -0
- package/dist/surface/discovery-cache.js.map +1 -0
- package/dist/surface/register-commands.d.ts +15 -0
- package/dist/surface/register-commands.d.ts.map +1 -0
- package/dist/surface/register-commands.js +197 -0
- package/dist/surface/register-commands.js.map +1 -0
- package/dist/surface/register-groups.d.ts +15 -0
- package/dist/surface/register-groups.d.ts.map +1 -0
- package/dist/surface/register-groups.js +52 -0
- package/dist/surface/register-groups.js.map +1 -0
- package/dist/surface.d.ts +9 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/surface.js +8 -0
- package/dist/surface.js.map +1 -0
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/ui/schemas/types.d.ts +2 -0
- package/dist/ui/schemas/types.d.ts.map +1 -0
- package/dist/ui/schemas/types.js +2 -0
- package/dist/ui/schemas/types.js.map +1 -0
- package/dist/ui/toolkit/VibesUIToolkit.d.ts +2 -0
- package/dist/ui/toolkit/VibesUIToolkit.d.ts.map +1 -0
- package/dist/ui/toolkit/VibesUIToolkit.js +2 -0
- package/dist/ui/toolkit/VibesUIToolkit.js.map +1 -0
- package/dist/ui.context.descriptor.d.ts +21 -0
- package/dist/ui.context.descriptor.d.ts.map +1 -0
- package/dist/ui.context.descriptor.js +12 -0
- package/dist/ui.context.descriptor.js.map +1 -0
- package/dist/utils/open.d.ts +2 -0
- package/dist/utils/open.d.ts.map +1 -0
- package/dist/utils/open.js +30 -0
- package/dist/utils/open.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/package.json +186 -0
- package/src/api/client/factory.ts +265 -0
- package/src/api/schemas/common.ts +50 -0
- package/src/api/schemas/types.ts +32 -0
- package/src/api/services/api.ts +129 -0
- package/src/api/types.ts +12 -0
- package/src/bin.ts +84 -0
- package/src/bootstrap.ts +19 -0
- package/src/cli.plugin.d.ts +19 -0
- package/src/cli.plugin.ts +202 -0
- package/src/commands/completion/bash.ts +68 -0
- package/src/commands/completion/completion.descriptor.ts +48 -0
- package/src/commands/completion/completion.impl.ts +188 -0
- package/src/commands/completion/fig.ts +78 -0
- package/src/commands/completion/fish.ts +52 -0
- package/src/commands/completion/tree.ts +115 -0
- package/src/commands/completion/zsh-widget.ts +39 -0
- package/src/commands/completion/zsh.ts +165 -0
- package/src/commands/profile/_utils.ts +72 -0
- package/src/commands/profile/profile-group.descriptor.ts +14 -0
- package/src/commands/profile/profile.create.descriptor.ts +24 -0
- package/src/commands/profile/profile.create.impl.ts +44 -0
- package/src/commands/profile/profile.delete.descriptor.ts +31 -0
- package/src/commands/profile/profile.delete.impl.ts +71 -0
- package/src/commands/profile/profile.info.descriptor.ts +25 -0
- package/src/commands/profile/profile.info.impl.ts +51 -0
- package/src/commands/profile/profile.list.descriptor.ts +18 -0
- package/src/commands/profile/profile.list.impl.ts +46 -0
- package/src/commands/profile/profile.use.descriptor.ts +25 -0
- package/src/commands/profile/profile.use.impl.ts +39 -0
- package/src/commands/runtime/_logging.ts +47 -0
- package/src/commands/runtime/codegen.command.descriptor.ts +18 -0
- package/src/commands/runtime/codegen.command.impl.ts +44 -0
- package/src/commands/runtime/codegen.ts +84 -0
- package/src/commands/runtime/index.ts +14 -0
- package/src/commands/runtime/plugin.ts +7 -0
- package/src/commands/runtime/runtime-group.descriptor.ts +12 -0
- package/src/config.ts +22 -0
- package/src/core/index.ts +9 -0
- package/src/core/namespace/hook.ts +25 -0
- package/src/core/namespace/index.ts +298 -0
- package/src/core/namespace/schemas/index.ts +25 -0
- package/src/core/plugins/types.ts +87 -0
- package/src/core/runtime/context.ts +50 -0
- package/src/core/runtime/hooks.ts +12 -0
- package/src/core/runtime/shared/context.ts +65 -0
- package/src/core/runtime/shared/options.ts +60 -0
- package/src/core/schemas/manifest.ts +26 -0
- package/src/core/schemas/types.ts +6 -0
- package/src/core/ui/interface.ts +12 -0
- package/src/docs/cli.commands.docs.descriptor.ts +210 -0
- package/src/docs/cli.groups.docs.descriptor.ts +333 -0
- package/src/docs/cli.output.docs.descriptor.ts +445 -0
- package/src/docs/types.ts +18 -0
- package/src/errors.ts +123 -0
- package/src/index.ts +76 -0
- package/src/logging/cli-startup.logger.descriptor.ts +16 -0
- package/src/logging.ts +35 -0
- package/src/patterns/config-namespace.ts +251 -0
- package/src/patterns/crud.ts +217 -0
- package/src/patterns/index.ts +24 -0
- package/src/patterns/log-viewer.ts +118 -0
- package/src/patterns/pattern-types.ts +22 -0
- package/src/patterns/process-manager.ts +180 -0
- package/src/patterns/resolver.contracts.ts +15 -0
- package/src/patterns/resolver.ts +86 -0
- package/src/patterns/schemas.ts +146 -0
- package/src/patterns/tool-wrapper.ts +165 -0
- package/src/providers.ts +282 -0
- package/src/schemas/descriptors.d.ts +119 -0
- package/src/schemas/descriptors.ts +136 -0
- package/src/schemas/surface.ts +52 -0
- package/src/schemas/types.d.ts +195 -0
- package/src/schemas/types.ts +225 -0
- package/src/support/ui-toolkit.ts +224 -0
- package/src/surface/CLISurface.ts +193 -0
- package/src/surface/attach-tui-action.ts +76 -0
- package/src/surface/build-context.ts +49 -0
- package/src/surface/command-group-policy.ts +52 -0
- package/src/surface/discovery-cache.ts +143 -0
- package/src/surface/register-commands.ts +266 -0
- package/src/surface/register-groups.ts +84 -0
- package/src/surface.ts +9 -0
- package/src/types.ts +3 -0
- package/src/ui/schemas/types.ts +1 -0
- package/src/ui/toolkit/VibesUIToolkit.ts +1 -0
- package/src/ui.context.descriptor.ts +13 -0
- package/src/utils/open.ts +36 -0
- package/src/version.ts +10 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API service - provides API testing and debugging commands
|
|
3
|
+
*/
|
|
4
|
+
import { apiTestSchema } from "../schemas/common.js";
|
|
5
|
+
import { createAPIClientConfig, testAPIConnection } from "../client/factory.js";
|
|
6
|
+
import { loadStoredCredentials, loadStoredEnvironment } from '@vibesdotdev/config/client';
|
|
7
|
+
/**
|
|
8
|
+
* Execute API test command
|
|
9
|
+
*/
|
|
10
|
+
export async function executeAPITest(input, context) {
|
|
11
|
+
try {
|
|
12
|
+
const validatedInput = apiTestSchema.parse(input);
|
|
13
|
+
const environment = await loadStoredEnvironment();
|
|
14
|
+
if (!environment) {
|
|
15
|
+
throw new Error('No environment configured');
|
|
16
|
+
}
|
|
17
|
+
const credentials = await loadStoredCredentials(environment.name);
|
|
18
|
+
let authType = 'none';
|
|
19
|
+
if (credentials?.apiKey)
|
|
20
|
+
authType = 'apiKey';
|
|
21
|
+
else if (credentials?.sessionToken)
|
|
22
|
+
authType = 'session';
|
|
23
|
+
// Test connection
|
|
24
|
+
const testResult = await testAPIConnection(validatedInput.endpoint, context);
|
|
25
|
+
const status = {
|
|
26
|
+
connected: testResult.success,
|
|
27
|
+
environment: environment.name,
|
|
28
|
+
baseUrl: environment.apiUrl,
|
|
29
|
+
authType,
|
|
30
|
+
lastChecked: new Date().toISOString(),
|
|
31
|
+
latency: testResult.latency,
|
|
32
|
+
error: testResult.error
|
|
33
|
+
};
|
|
34
|
+
const result = {
|
|
35
|
+
success: testResult.success,
|
|
36
|
+
status
|
|
37
|
+
};
|
|
38
|
+
if (testResult.success) {
|
|
39
|
+
result.response = {
|
|
40
|
+
status: testResult.status,
|
|
41
|
+
statusText: 'OK',
|
|
42
|
+
headers: {},
|
|
43
|
+
data: { message: 'Connection successful' }
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
result.error = testResult.error;
|
|
48
|
+
}
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
context.logger?.error('Failed to test API', error);
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Execute API debug command
|
|
58
|
+
*/
|
|
59
|
+
export async function executeAPIDebug(context) {
|
|
60
|
+
try {
|
|
61
|
+
// Get API client config
|
|
62
|
+
const config = await createAPIClientConfig(context);
|
|
63
|
+
// Get current environment
|
|
64
|
+
const environment = await loadStoredEnvironment();
|
|
65
|
+
const credentials = await loadStoredCredentials(environment?.name);
|
|
66
|
+
// Run diagnostics
|
|
67
|
+
const diagnostics = {
|
|
68
|
+
environmentResolved: !!environment,
|
|
69
|
+
authResolved: !!(credentials?.apiKey || credentials?.sessionToken),
|
|
70
|
+
baseUrlValid: !!environment?.apiUrl && environment.apiUrl.startsWith('http'),
|
|
71
|
+
credentialsValid: !!(credentials?.apiKey ||
|
|
72
|
+
(credentials?.sessionToken && !isTokenExpired(credentials.expiresAt)))
|
|
73
|
+
};
|
|
74
|
+
// Get connection status
|
|
75
|
+
const testResult = await testAPIConnection('/api/health', context);
|
|
76
|
+
const status = {
|
|
77
|
+
connected: testResult.success,
|
|
78
|
+
environment: environment?.name || 'none',
|
|
79
|
+
baseUrl: environment?.apiUrl || 'none',
|
|
80
|
+
authType: config.auth.type,
|
|
81
|
+
lastChecked: new Date().toISOString(),
|
|
82
|
+
latency: testResult.latency,
|
|
83
|
+
error: testResult.error
|
|
84
|
+
};
|
|
85
|
+
return {
|
|
86
|
+
config,
|
|
87
|
+
status,
|
|
88
|
+
diagnostics
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
context.logger?.error('Failed to debug API', error);
|
|
93
|
+
throw error;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Helper to check if token is expired
|
|
98
|
+
*/
|
|
99
|
+
function isTokenExpired(expiresAt) {
|
|
100
|
+
if (!expiresAt)
|
|
101
|
+
return false;
|
|
102
|
+
try {
|
|
103
|
+
const expiry = new Date(expiresAt);
|
|
104
|
+
return expiry.getTime() < Date.now();
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/api/services/api.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAE1F;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CACnC,KAAmB,EACnB,OAAuB;IAEvB,IAAI,CAAC;QACJ,MAAM,cAAc,G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AE,CAAC,WAAW,EAAE;YACrC,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,KAAK,EAAE,UAAU,CAAC,KAAK;SACvB,CAAC;QAEF,OAAO;YACN,MAAM;YACN,MAAM;YACN,WAAW;SACX,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC;QACpD,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,SAAkB;IACzC,IAAI,CAAC,SAAS;QAAE,OAAO,KAAK,CAAC;IAC7B,IAAI,CAAC;QACJ,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;QACnC,OAAO,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7D,YAAY,EACX,eAAe,EACf,YAAY,EACZ,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
package/dist/bin.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Binary Path Resolution
|
|
3
|
+
*
|
|
4
|
+
* Provides utilities for resolving the path to the vibes CLI binary.
|
|
5
|
+
* Used by PM and workers to spawn the CLI correctly.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Resolve the vibes CLI entry point path.
|
|
9
|
+
* Searches in order: apps/cli-bin, single-app layout, flat layout.
|
|
10
|
+
*
|
|
11
|
+
* @throws Error if no CLI entry point is found
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveCliEntry(): string;
|
|
14
|
+
/**
|
|
15
|
+
* Resolve the bun command to invoke the CLI.
|
|
16
|
+
* Returns the appropriate args to run the CLI.
|
|
17
|
+
*
|
|
18
|
+
* @param target - Worker target (consumer or cloud)
|
|
19
|
+
* @param options.hot - Enable hot reload (default: false)
|
|
20
|
+
* @returns Object with command and args array
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveCliInvocation(target: 'consumer' | 'cloud', options?: {
|
|
23
|
+
hot?: boolean;
|
|
24
|
+
}): {
|
|
25
|
+
command: string;
|
|
26
|
+
args: string[];
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=bin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAyBH;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAwBxC;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CACnC,MAAM,EAAE,UAAU,GAAG,OAAO,EAC5B,OAAO,GAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAO,GAC7B;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAUrC"}
|
package/dist/bin.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Binary Path Resolution
|
|
3
|
+
*
|
|
4
|
+
* Provides utilities for resolving the path to the vibes CLI binary.
|
|
5
|
+
* Used by PM and workers to spawn the CLI correctly.
|
|
6
|
+
*/
|
|
7
|
+
import { dirname, resolve } from 'node:path';
|
|
8
|
+
import { existsSync } from 'node:fs';
|
|
9
|
+
import { fileURLToPath } from 'node:url';
|
|
10
|
+
const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
const MONOREPO_ENTRY_SEGMENTS = ['apps', 'cli-bin', 'src', 'bin', 'vibes.ts'];
|
|
12
|
+
function findMonorepoCliEntry(startDir, searched) {
|
|
13
|
+
let current = resolve(startDir);
|
|
14
|
+
while (true) {
|
|
15
|
+
const candidate = resolve(current, ...MONOREPO_ENTRY_SEGMENTS);
|
|
16
|
+
searched.add(candidate);
|
|
17
|
+
if (existsSync(candidate))
|
|
18
|
+
return candidate;
|
|
19
|
+
const parent = dirname(current);
|
|
20
|
+
if (parent === current)
|
|
21
|
+
break;
|
|
22
|
+
current = parent;
|
|
23
|
+
}
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Resolve the vibes CLI entry point path.
|
|
28
|
+
* Searches in order: apps/cli-bin, single-app layout, flat layout.
|
|
29
|
+
*
|
|
30
|
+
* @throws Error if no CLI entry point is found
|
|
31
|
+
*/
|
|
32
|
+
export function resolveCliEntry() {
|
|
33
|
+
const searched = new Set();
|
|
34
|
+
const monorepoStarts = [process.cwd(), MODULE_DIR];
|
|
35
|
+
for (const start of monorepoStarts) {
|
|
36
|
+
const monorepoEntry = findMonorepoCliEntry(start, searched);
|
|
37
|
+
if (monorepoEntry)
|
|
38
|
+
return monorepoEntry;
|
|
39
|
+
}
|
|
40
|
+
const fallbackEntries = [
|
|
41
|
+
resolve(process.cwd(), 'src', 'bin', 'vibes.ts'),
|
|
42
|
+
resolve(process.cwd(), 'bin', 'vibes.ts'),
|
|
43
|
+
resolve(MODULE_DIR, 'src', 'bin', 'vibes.ts'),
|
|
44
|
+
resolve(MODULE_DIR, 'bin', 'vibes.ts'),
|
|
45
|
+
resolve(MODULE_DIR, '..', 'src', 'bin', 'vibes.ts'),
|
|
46
|
+
resolve(MODULE_DIR, '..', 'bin', 'vibes.ts')
|
|
47
|
+
];
|
|
48
|
+
for (const candidate of fallbackEntries) {
|
|
49
|
+
searched.add(candidate);
|
|
50
|
+
if (existsSync(candidate))
|
|
51
|
+
return candidate;
|
|
52
|
+
}
|
|
53
|
+
throw new Error(`Failed to resolve CLI entry point. Searched:\n${[...searched].join('\n')}`);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Resolve the bun command to invoke the CLI.
|
|
57
|
+
* Returns the appropriate args to run the CLI.
|
|
58
|
+
*
|
|
59
|
+
* @param target - Worker target (consumer or cloud)
|
|
60
|
+
* @param options.hot - Enable hot reload (default: false)
|
|
61
|
+
* @returns Object with command and args array
|
|
62
|
+
*/
|
|
63
|
+
export function resolveCliInvocation(target, options = {}) {
|
|
64
|
+
const cliEntry = resolveCliEntry();
|
|
65
|
+
const hot = options.hot ?? false;
|
|
66
|
+
return {
|
|
67
|
+
command: 'bun',
|
|
68
|
+
args: hot
|
|
69
|
+
? ['run', '--hot', '--bun', cliEntry, 'workers', 'serve', target]
|
|
70
|
+
: ['run', '--bun', cliEntry, 'workers', 'serve', target]
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3D,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAU,CAAC;AAEvF,SAAS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,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC;KAC5C,CAAC;IAEF,KAAK,MAAM,SAAS,IAAI,eAAe,EAAE,CAAC;QACzC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACxB,IAAI,UAAU,CAAC,SAAS,CAAC;YAAE,OAAO,SAAS,CAAC;IAC7C,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC9F,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CACnC,MAA4B,EAC5B,UAA6B,EAAE;IAE/B,MAAM,QAAQ,GAAG,eAAe,EAAE,CAAC;IACnC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,KAAK,CAAC;IAEjC,OAAO;QACN,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,GAAG;YACR,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC;YACjE,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC;KACzD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Bootstrap (compatibility re-export)
|
|
3
|
+
*
|
|
4
|
+
* @deprecated Prefer importing from '@vibesdotdev/runtime-surface-cli' for new code.
|
|
5
|
+
*
|
|
6
|
+
* This file is now a thin re-export shim for backward compatibility during the
|
|
7
|
+
* surface package migration. All real bootstrap logic (runtime initialization,
|
|
8
|
+
* umbrella plugin loading, etc.) lives in the dedicated surface package.
|
|
9
|
+
*
|
|
10
|
+
* Canonical usage:
|
|
11
|
+
* import { createVibesCliApp } from '@vibesdotdev/runtime-surface-cli';
|
|
12
|
+
*/
|
|
13
|
+
export { createVibesCliApp, type VibesCliAppOptions, type VibesCliApp, type CliPluginLoader, } from '@vibesdotdev/runtime-surface-cli';
|
|
14
|
+
//# sourceMappingURL=bootstrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Bootstrap (compatibility re-export)
|
|
3
|
+
*
|
|
4
|
+
* @deprecated Prefer importing from '@vibesdotdev/runtime-surface-cli' for new code.
|
|
5
|
+
*
|
|
6
|
+
* This file is now a thin re-export shim for backward compatibility during the
|
|
7
|
+
* surface package migration. All real bootstrap logic (runtime initialization,
|
|
8
|
+
* umbrella plugin loading, etc.) lives in the dedicated surface package.
|
|
9
|
+
*
|
|
10
|
+
* Canonical usage:
|
|
11
|
+
* import { createVibesCliApp } from '@vibesdotdev/runtime-surface-cli';
|
|
12
|
+
*/
|
|
13
|
+
export { createVibesCliApp, } from '@vibesdotdev/runtime-surface-cli';
|
|
14
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,iBAAiB,GAIlB,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Plugin
|
|
3
|
+
*
|
|
4
|
+
* Registers CLI kinds with the universal runtime:
|
|
5
|
+
* - cli/group: Command groups for organizing commands
|
|
6
|
+
* - cli/command: Executable CLI commands
|
|
7
|
+
*
|
|
8
|
+
* This plugin does NOT create a separate runtime - it extends the universal
|
|
9
|
+
* runtime with CLI-specific asset kinds that CLISurface uses to build
|
|
10
|
+
* the Commander.js command tree.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* CLI Plugin
|
|
14
|
+
*
|
|
15
|
+
* Registers cli/group and cli/command kinds with the universal runtime.
|
|
16
|
+
* CLISurface queries these kinds to build the Commander.js command tree.
|
|
17
|
+
*/
|
|
18
|
+
declare const _default: import("@vibesdotdev/runtime").RuntimePlugin;
|
|
19
|
+
export default _default;
|
|
20
|
+
//# sourceMappingURL=cli.plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.plugin.d.ts","sourceRoot":"","sources":["../src/cli.plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAyJH;;;;;GAKG;;AACH,wBAgCG"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Plugin
|
|
3
|
+
*
|
|
4
|
+
* Registers CLI kinds with the universal runtime:
|
|
5
|
+
* - cli/group: Command groups for organizing commands
|
|
6
|
+
* - cli/command: Executable CLI commands
|
|
7
|
+
*
|
|
8
|
+
* This plugin does NOT create a separate runtime - it extends the universal
|
|
9
|
+
* runtime with CLI-specific asset kinds that CLISurface uses to build
|
|
10
|
+
* the Commander.js command tree.
|
|
11
|
+
*/
|
|
12
|
+
import { createRuntimePlugin, loader } from '@vibesdotdev/runtime';
|
|
13
|
+
import { CLIGroupDescriptorSchema, CLICommandDescriptorSchema } from './schemas/descriptors.js';
|
|
14
|
+
// CLI command descriptors
|
|
15
|
+
import completionDescriptor from './commands/completion/completion.descriptor.js';
|
|
16
|
+
import { runtimeCodegenCommandDescriptor } from './commands/runtime/codegen.command.descriptor.js';
|
|
17
|
+
import { runtimeCodegenCommandImpl } from './commands/runtime/codegen.command.impl.js';
|
|
18
|
+
import uiContextDescriptor from './ui.context.descriptor.js';
|
|
19
|
+
import cliStartupLogger from './logging/cli-startup.logger.descriptor.js';
|
|
20
|
+
import runtimeGroup from './commands/runtime/runtime-group.descriptor.js';
|
|
21
|
+
// Profile descriptors
|
|
22
|
+
import profileGroupDescriptor from './commands/profile/profile-group.descriptor.js';
|
|
23
|
+
import profileListDescriptor from './commands/profile/profile.list.descriptor.js';
|
|
24
|
+
import profileCreateDescriptor from './commands/profile/profile.create.descriptor.js';
|
|
25
|
+
import profileUseDescriptor from './commands/profile/profile.use.descriptor.js';
|
|
26
|
+
import profileDeleteDescriptor from './commands/profile/profile.delete.descriptor.js';
|
|
27
|
+
import profileInfoDescriptor from './commands/profile/profile.info.descriptor.js';
|
|
28
|
+
// Docs
|
|
29
|
+
import cliCommandsDescriptor from "./docs/cli.commands.docs.descriptor.js";
|
|
30
|
+
import cliGroupsDescriptor from "./docs/cli.groups.docs.descriptor.js";
|
|
31
|
+
import cliOutputDescriptor from "./docs/cli.output.docs.descriptor.js";
|
|
32
|
+
/**
|
|
33
|
+
* CLI Group kind - metadata only, no implementation needed
|
|
34
|
+
*/
|
|
35
|
+
function isCLIGroupAssetDescriptor(descriptor) {
|
|
36
|
+
return descriptor.kind === 'cli/group' && typeof descriptor.id === 'string';
|
|
37
|
+
}
|
|
38
|
+
class DefaultCLIGroupImplementation {
|
|
39
|
+
descriptor;
|
|
40
|
+
constructor(descriptor) {
|
|
41
|
+
this.descriptor = descriptor;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const cliGroupKind = {
|
|
45
|
+
id: 'cli/group',
|
|
46
|
+
descriptorSchema: CLIGroupDescriptorSchema,
|
|
47
|
+
defaultImplementation: class {
|
|
48
|
+
descriptor;
|
|
49
|
+
constructor(descriptor) {
|
|
50
|
+
if (!isCLIGroupAssetDescriptor(descriptor)) {
|
|
51
|
+
throw new Error(`Invalid cli/group descriptor '${descriptor.id ?? 'unknown'}'`);
|
|
52
|
+
}
|
|
53
|
+
this.descriptor = descriptor;
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
// Resolution: prefer explicit scope matches
|
|
57
|
+
resolve: (candidates, scope) => {
|
|
58
|
+
const descriptors = candidates.filter(isCLIGroupAssetDescriptor);
|
|
59
|
+
if (descriptors.length === 0)
|
|
60
|
+
return undefined;
|
|
61
|
+
if (descriptors.length === 1)
|
|
62
|
+
return descriptors[0];
|
|
63
|
+
// Filter by surface
|
|
64
|
+
let matches = descriptors.filter((d) => {
|
|
65
|
+
if (!d.surfaces || d.surfaces.length === 0)
|
|
66
|
+
return true;
|
|
67
|
+
return d.surfaces.includes(scope.surface);
|
|
68
|
+
});
|
|
69
|
+
if (matches.length === 0)
|
|
70
|
+
return undefined;
|
|
71
|
+
// Filter by hardware
|
|
72
|
+
matches = matches.filter((d) => {
|
|
73
|
+
if (!d.hardware || d.hardware.length === 0)
|
|
74
|
+
return true;
|
|
75
|
+
return d.hardware.includes(scope.hardware);
|
|
76
|
+
});
|
|
77
|
+
// Sort by order, return first
|
|
78
|
+
matches.sort((a, b) => (a.order ?? 999) - (b.order ?? 999));
|
|
79
|
+
return matches[0];
|
|
80
|
+
},
|
|
81
|
+
contexts: []
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* CLI Command kind - requires implementation with execute()
|
|
85
|
+
*/
|
|
86
|
+
function isCLICommandAssetDescriptor(descriptor) {
|
|
87
|
+
return (descriptor.kind === 'cli/command' && typeof descriptor.id === 'string' && 'group' in descriptor);
|
|
88
|
+
}
|
|
89
|
+
class DefaultCLICommandImplementation {
|
|
90
|
+
descriptor;
|
|
91
|
+
constructor(descriptor) {
|
|
92
|
+
if (!isCLICommandAssetDescriptor(descriptor)) {
|
|
93
|
+
throw new Error(`Invalid cli/command descriptor '${descriptor.id ?? 'unknown'}'`);
|
|
94
|
+
}
|
|
95
|
+
this.descriptor = descriptor;
|
|
96
|
+
}
|
|
97
|
+
async execute(_args, _opts) {
|
|
98
|
+
throw new Error(`No implementation for command: ${this.descriptor.id}`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const cliCommandKind = {
|
|
102
|
+
id: 'cli/command',
|
|
103
|
+
descriptorSchema: CLICommandDescriptorSchema,
|
|
104
|
+
defaultImplementation: DefaultCLICommandImplementation,
|
|
105
|
+
// Resolution: prefer explicit scope matches
|
|
106
|
+
resolve: (candidates, scope) => {
|
|
107
|
+
const descriptors = candidates.filter(isCLICommandAssetDescriptor);
|
|
108
|
+
if (descriptors.length === 0)
|
|
109
|
+
return undefined;
|
|
110
|
+
if (descriptors.length === 1)
|
|
111
|
+
return descriptors[0];
|
|
112
|
+
// Filter by surface
|
|
113
|
+
let matches = descriptors.filter((d) => {
|
|
114
|
+
if (!d.surfaces || d.surfaces.length === 0)
|
|
115
|
+
return true;
|
|
116
|
+
return d.surfaces.includes(scope.surface);
|
|
117
|
+
});
|
|
118
|
+
if (matches.length === 0)
|
|
119
|
+
return undefined;
|
|
120
|
+
// Filter by hardware
|
|
121
|
+
matches = matches.filter((d) => {
|
|
122
|
+
if (!d.hardware || d.hardware.length === 0)
|
|
123
|
+
return true;
|
|
124
|
+
return d.hardware.includes(scope.hardware);
|
|
125
|
+
});
|
|
126
|
+
// Sort by order, return first
|
|
127
|
+
matches.sort((a, b) => (a.order ?? 999) - (b.order ?? 999));
|
|
128
|
+
return matches[0];
|
|
129
|
+
},
|
|
130
|
+
// Commands receive runtime context
|
|
131
|
+
contexts: ['runtime']
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* CLI Plugin
|
|
135
|
+
*
|
|
136
|
+
* Registers cli/group and cli/command kinds with the universal runtime.
|
|
137
|
+
* CLISurface queries these kinds to build the Commander.js command tree.
|
|
138
|
+
*/
|
|
139
|
+
export default createRuntimePlugin({
|
|
140
|
+
id: 'cli',
|
|
141
|
+
name: 'CLI Surface',
|
|
142
|
+
description: 'CLI command system using Commander.js',
|
|
143
|
+
dependencies: ['context'],
|
|
144
|
+
kinds: [cliGroupKind, cliCommandKind],
|
|
145
|
+
descriptors: [
|
|
146
|
+
completionDescriptor,
|
|
147
|
+
runtimeCodegenCommandDescriptor,
|
|
148
|
+
uiContextDescriptor,
|
|
149
|
+
cliStartupLogger,
|
|
150
|
+
runtimeGroup,
|
|
151
|
+
profileGroupDescriptor,
|
|
152
|
+
profileListDescriptor,
|
|
153
|
+
profileCreateDescriptor,
|
|
154
|
+
profileUseDescriptor,
|
|
155
|
+
profileDeleteDescriptor,
|
|
156
|
+
profileInfoDescriptor,
|
|
157
|
+
cliCommandsDescriptor,
|
|
158
|
+
cliGroupsDescriptor,
|
|
159
|
+
cliOutputDescriptor
|
|
160
|
+
],
|
|
161
|
+
loaders: [
|
|
162
|
+
loader('completion', () => import('./commands/completion/completion.impl.js')),
|
|
163
|
+
loader('profile.list', () => import('./commands/profile/profile.list.impl.js')),
|
|
164
|
+
loader('profile.create', () => import('./commands/profile/profile.create.impl.js')),
|
|
165
|
+
loader('profile.use', () => import('./commands/profile/profile.use.impl.js')),
|
|
166
|
+
loader('profile.delete', () => import('./commands/profile/profile.delete.impl.js')),
|
|
167
|
+
loader('profile.info', () => import('./commands/profile/profile.info.impl.js'))
|
|
168
|
+
]
|
|
169
|
+
});
|
|
170
|
+
//# sourceMappingURL=cli.plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.plugin.js","sourceRoot":"","sources":["../src/cli.plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACN,mBAAmB,EACnB,MAAM,EAGN,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACN,wBAAwB,EACxB,0BAA0B,EAG1B,MAAM,uBAAuB,CAAC;AAE/B,0BAA0B;AAC1B,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,+BAA+B,EAAE,MAAM,+CAA+C,CAAC;AAChG,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,mBAAmB,MAAM,yBAAyB,CAAC;AAC1D,OAAO,gBAAgB,MAAM,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AE,GAAG,EAAE,CAAC,MAAM,CAAC,2CAA2C,CAAC,CAAC;QACnF,MAAM,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,wCAAwC,CAAC,CAAC;QAC7E,MAAM,CAAC,gBAAgB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,2CAA2C,CAAC,CAAC;QACnF,MAAM,CAAC,cAAc,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,yCAAyC,CAAC,CAAC;KAC/E;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../../src/commands/completion/bash.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAwB1C,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAqChE"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bash Completion Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates a bash completion function from the command tree.
|
|
5
|
+
*/
|
|
6
|
+
function generateCaseBlock(path, node, indent) {
|
|
7
|
+
const lines = [];
|
|
8
|
+
if (node.children.length === 0)
|
|
9
|
+
return lines;
|
|
10
|
+
const childNames = node.children.flatMap((c) => [c.name, ...c.aliases]).join(' ');
|
|
11
|
+
lines.push(`${indent}${path})`);
|
|
12
|
+
lines.push(`${indent} COMPREPLY=( $(compgen -W "${childNames}" -- "\${cur}") )`);
|
|
13
|
+
lines.push(`${indent} return 0`);
|
|
14
|
+
lines.push(`${indent} ;;`);
|
|
15
|
+
for (const child of node.children) {
|
|
16
|
+
if (child.children.length > 0) {
|
|
17
|
+
lines.push(...generateCaseBlock(`${path} ${child.name}`, child, indent));
|
|
18
|
+
for (const alias of child.aliases) {
|
|
19
|
+
lines.push(...generateCaseBlock(`${path} ${alias}`, child, indent));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return lines;
|
|
24
|
+
}
|
|
25
|
+
export function generateBashCompletion(tree) {
|
|
26
|
+
const cases = generateCaseBlock('vibes', tree, ' ');
|
|
27
|
+
return `# vibes bash completion — generated by vibes completion bash
|
|
28
|
+
# Add to ~/.bashrc: eval "$(vibes completion bash)"
|
|
29
|
+
|
|
30
|
+
_vibes_completions() {
|
|
31
|
+
local cur prev words cword
|
|
32
|
+
_init_completion || return
|
|
33
|
+
|
|
34
|
+
local cmd="\${words[*]:0:cword}"
|
|
35
|
+
|
|
36
|
+
case "\${cmd}" in
|
|
37
|
+
${cases.join('\n')}
|
|
38
|
+
esac
|
|
39
|
+
|
|
40
|
+
# Option completion
|
|
41
|
+
if [[ "\${cur}" == -* ]]; then
|
|
42
|
+
local opts=""
|
|
43
|
+
case "\${cmd}" in
|
|
44
|
+
${tree.children
|
|
45
|
+
.flatMap((g) => g.children.map((c) => {
|
|
46
|
+
const opts = c.options.map((o) => (o.short ? `-${o.short} --${o.long}` : `--${o.long}`)).join(' ');
|
|
47
|
+
return opts ? ` vibes ${g.name} ${c.name}) opts="${opts}" ;;` : '';
|
|
48
|
+
}))
|
|
49
|
+
.filter(Boolean)
|
|
50
|
+
.join('\n')}
|
|
51
|
+
esac
|
|
52
|
+
COMPREPLY=( $(compgen -W "\${opts}" -- "\${cur}") )
|
|
53
|
+
return 0
|
|
54
|
+
fi
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
complete -F _vibes_completions vibes
|
|
58
|
+
`;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=bash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bash.js","sourceRoot":"","sources":["../../../src/commands/completion/bash.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,SAAS,iBAAiB,CAAC,IAAY,EAAE,IAAiB,EAAE,MAAc;IACzE,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,IAAI,CA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;;EAOhB,IAAI,CAAC,QAAQ;SACb,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CACd,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACpB,MAAM,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnG,OAAO,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,WAAW,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/E,CAAC,CAAC,CACF;SACA,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,IAAI,CAAC;;;;;;;;CAQX,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell Completion Generator Command Descriptor
|
|
3
|
+
*
|
|
4
|
+
* Generates shell completions and autosuggestions from runtime descriptors.
|
|
5
|
+
* Supports bash, zsh (with inline autosuggestion widget), fish, and fig specs.
|
|
6
|
+
*/
|
|
7
|
+
import type { CLICommandAssetDescriptor } from '../../schemas/descriptors';
|
|
8
|
+
declare const descriptor: CLICommandAssetDescriptor;
|
|
9
|
+
export default descriptor;
|
|
10
|
+
//# sourceMappingURL=completion.descriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.descriptor.d.ts","sourceRoot":"","sources":["../../../src/commands/completion/completion.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAE3E,QAAA,MAAM,UAAU,EAAE,yBAoCjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell Completion Generator Command Descriptor
|
|
3
|
+
*
|
|
4
|
+
* Generates shell completions and autosuggestions from runtime descriptors.
|
|
5
|
+
* Supports bash, zsh (with inline autosuggestion widget), fish, and fig specs.
|
|
6
|
+
*/
|
|
7
|
+
const descriptor = {
|
|
8
|
+
kind: 'cli/command',
|
|
9
|
+
id: 'completion',
|
|
10
|
+
name: 'completion',
|
|
11
|
+
description: 'Generate shell completions and autosuggestions',
|
|
12
|
+
group: 'shell-integration',
|
|
13
|
+
arguments: [
|
|
14
|
+
{
|
|
15
|
+
name: 'shell',
|
|
16
|
+
description: 'Target shell: bash, zsh, fish, or fig',
|
|
17
|
+
required: true
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
options: [
|
|
21
|
+
{
|
|
22
|
+
flags: '--json',
|
|
23
|
+
description: 'Output command tree as JSON (for tooling)'
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
flags: '--install',
|
|
27
|
+
description: 'Install to standard shell completion directory'
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
examples: [
|
|
31
|
+
{ command: 'vibes completion zsh', description: 'Output zsh completions with autosuggestions' },
|
|
32
|
+
{ command: 'eval "$(vibes completion zsh)"', description: 'Enable in current shell' },
|
|
33
|
+
{ command: 'vibes completion fig', description: 'Generate Fig/Amazon Q completion spec' },
|
|
34
|
+
{ command: 'vibes completion --json', description: 'Output raw command tree as JSON' }
|
|
35
|
+
],
|
|
36
|
+
surfaces: ['cli'],
|
|
37
|
+
hardware: ['consumer'],
|
|
38
|
+
enabled: true
|
|
39
|
+
};
|
|
40
|
+
export default descriptor;
|
|
41
|
+
//# sourceMappingURL=completion.descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.descriptor.js","sourceRoot":"","sources":["../../../src/commands/completion/completion.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,UAAU,GAA8B;IAC7C,IAAI,EAAE,aAAa;IACnB,EAAE,EAAE,YAAY;IAChB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,gDAAgD;IAC7D,KAAK,EAAE,mBAAmB;IAE1B,SAAS,EAAE;QACV;YACC,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,uCAAuC;YACpD,QAAQ,EAAE,IAAI;SACd;KACD;IAED,OAAO,EAAE;QACR;YACC,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,2CAA2C;SACxD;QACD;YACC,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,gDAAgD;SAC7D;KACD;IAED,QAAQ,EAAE;QACT,EAAE,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,6CAA6C,EAAE;QAC/F,EAAE,OAAO,EAAE,gCAAgC,EAAE,WAAW,EAAE,yBAAyB,EAAE;QACrF,EAAE,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,uCAAuC,EAAE;QACzF,EAAE,OAAO,EAAE,yBAAyB,EAAE,WAAW,EAAE,iCAAiC,EAAE;KACtF;IAED,QAAQ,EAAE,CAAC,KAAK,CAAC;IACjB,QAAQ,EAAE,CAAC,UAAU,CAAC;IACtB,OAAO,EAAE,IAAI;CACb,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell Completion Generator Implementation
|
|
3
|
+
*
|
|
4
|
+
* Builds the CLI command tree from runtime descriptors and generates
|
|
5
|
+
* shell-specific completion scripts. The zsh output includes an inline
|
|
6
|
+
* autosuggestion widget with history-based ranking.
|
|
7
|
+
*/
|
|
8
|
+
declare const _default: {
|
|
9
|
+
execute(args: Record<string, unknown>, opts: Record<string, unknown>): Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
12
|
+
//# sourceMappingURL=completion.impl.d.ts.map
|