@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
package/src/providers.ts
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Context Providers
|
|
3
|
+
*
|
|
4
|
+
* Registers CLI-specific context providers with the universal runtime.
|
|
5
|
+
* These contexts are available to CLI commands and patterns.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { VibesRuntime } from '@vibesdotdev/runtime/api/runtime';
|
|
9
|
+
import { VibesUIToolkit } from './support/ui-toolkit';
|
|
10
|
+
import { getLogger } from './logging';
|
|
11
|
+
|
|
12
|
+
const providerLogger = getLogger('providers');
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* UI Context - output formatting and display
|
|
16
|
+
*/
|
|
17
|
+
export interface UIContext {
|
|
18
|
+
info(message: string): void;
|
|
19
|
+
success(message: string): void;
|
|
20
|
+
warn(message: string): void;
|
|
21
|
+
error(message: string): void;
|
|
22
|
+
log(message: string): void;
|
|
23
|
+
table(data: unknown[], options?: { columns?: string[] } | string | string[]): void;
|
|
24
|
+
json(data: unknown): void;
|
|
25
|
+
yaml(data: unknown): void;
|
|
26
|
+
keyValue(data: Record<string, unknown>): void;
|
|
27
|
+
progress(message?: string): {
|
|
28
|
+
update: (nextMessage?: string) => void;
|
|
29
|
+
complete: (nextMessage?: string) => void;
|
|
30
|
+
fail: (nextMessage?: string) => void;
|
|
31
|
+
};
|
|
32
|
+
setFormat(format: 'json' | 'yaml' | 'table' | 'markdown'): void;
|
|
33
|
+
/**
|
|
34
|
+
* Render a value in a caller-selected format. Higher-level convenience over
|
|
35
|
+
* `json` / `yaml` / `table` used by command implementations that defer their
|
|
36
|
+
* output format to an `--output` flag.
|
|
37
|
+
*/
|
|
38
|
+
render(
|
|
39
|
+
data: unknown,
|
|
40
|
+
options?: { format?: 'json' | 'yaml' | 'table' | 'markdown' | 'text' }
|
|
41
|
+
): void | Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Logger Context - structured logging
|
|
46
|
+
*/
|
|
47
|
+
export interface LoggerContext {
|
|
48
|
+
info(message: string, meta?: unknown): void;
|
|
49
|
+
warn(message: string, meta?: unknown): void;
|
|
50
|
+
error(message: string, meta?: unknown): void;
|
|
51
|
+
debug(message: string, meta?: unknown): void;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* App Context - lifecycle control
|
|
56
|
+
*/
|
|
57
|
+
export interface AppContext {
|
|
58
|
+
keepAlive(): void;
|
|
59
|
+
shouldKeepAlive(): boolean;
|
|
60
|
+
exit(code?: number): void;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface ConfigContext {
|
|
64
|
+
get(key: string): Promise<unknown>;
|
|
65
|
+
set(key: string, value: unknown): Promise<void>;
|
|
66
|
+
getNamespace(namespace: string): Promise<Record<string, unknown>>;
|
|
67
|
+
delete(key: string): Promise<void>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Signal used to abort command execution without forcing process termination.
|
|
72
|
+
* CLISurface catches this and lets the process unwind naturally.
|
|
73
|
+
*/
|
|
74
|
+
export class CLIExitSignal extends Error {
|
|
75
|
+
constructor(public readonly code: number) {
|
|
76
|
+
super(`CLI requested exit with code ${code}`);
|
|
77
|
+
this.name = 'CLIExitSignal';
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function requestCLIExit(code = 0): never {
|
|
82
|
+
process.exitCode = code;
|
|
83
|
+
throw new CLIExitSignal(code);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* CLI Invocation Context - how the CLI was invoked
|
|
88
|
+
*/
|
|
89
|
+
export interface CLIContext {
|
|
90
|
+
command: string[];
|
|
91
|
+
bin: string;
|
|
92
|
+
script?: string;
|
|
93
|
+
cwd: string;
|
|
94
|
+
args: string[];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Options for CLI provider registration
|
|
99
|
+
*/
|
|
100
|
+
export interface CLIProviderOptions {
|
|
101
|
+
verbose?: boolean;
|
|
102
|
+
format?: 'json' | 'yaml' | 'table' | 'markdown';
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Shared state for keepAlive across the process
|
|
106
|
+
let keepAliveFlag = false;
|
|
107
|
+
|
|
108
|
+
function makeContextLoader(id: string, factory: () => unknown) {
|
|
109
|
+
return async () => ({
|
|
110
|
+
meta: { id, kind: 'context', priority: 0 },
|
|
111
|
+
impl: { provide: factory }
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Register CLI context providers with the runtime
|
|
117
|
+
*
|
|
118
|
+
* Call this before initializing CLISurface.
|
|
119
|
+
*/
|
|
120
|
+
export function registerCLIProviders(
|
|
121
|
+
runtime: VibesRuntime,
|
|
122
|
+
options: CLIProviderOptions = {}
|
|
123
|
+
): void {
|
|
124
|
+
const format = options.format ?? detectOutputFormat();
|
|
125
|
+
|
|
126
|
+
// Debug: Check if context kind exists
|
|
127
|
+
if (!runtime.hasKind('context')) {
|
|
128
|
+
throw new Error('Context kind not registered - cannot register CLI providers');
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const ctx = runtime.assets('context');
|
|
132
|
+
|
|
133
|
+
// UI Context
|
|
134
|
+
ctx.registerLoader(
|
|
135
|
+
'cli/ui',
|
|
136
|
+
makeContextLoader('cli/ui', () => {
|
|
137
|
+
const ui = new VibesUIToolkit({
|
|
138
|
+
mode: 'rich',
|
|
139
|
+
compact: false,
|
|
140
|
+
autoExit: false
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
ui.setFormat(format);
|
|
144
|
+
|
|
145
|
+
return ui as UIContext;
|
|
146
|
+
}),
|
|
147
|
+
{
|
|
148
|
+
constraint: { surfaces: ['cli'] },
|
|
149
|
+
priority: 0
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
// Logger Context
|
|
154
|
+
ctx.registerLoader(
|
|
155
|
+
'cli/logger',
|
|
156
|
+
makeContextLoader('cli/logger', () => ({
|
|
157
|
+
info: (msg: string, meta?: unknown) => {
|
|
158
|
+
if (options.verbose) providerLogger.info(msg, { meta });
|
|
159
|
+
},
|
|
160
|
+
warn: (msg: string, meta?: unknown) => providerLogger.warn(msg, { meta }),
|
|
161
|
+
error: (msg: string, meta?: unknown) => providerLogger.error(msg, { meta }),
|
|
162
|
+
debug: (msg: string, meta?: unknown) => {
|
|
163
|
+
if (options.verbose) providerLogger.debug(msg, { meta });
|
|
164
|
+
}
|
|
165
|
+
})),
|
|
166
|
+
{
|
|
167
|
+
constraint: { surfaces: ['cli'] },
|
|
168
|
+
priority: 0
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
// App Context
|
|
173
|
+
ctx.registerLoader(
|
|
174
|
+
'cli/app',
|
|
175
|
+
makeContextLoader('cli/app', () => ({
|
|
176
|
+
keepAlive: () => {
|
|
177
|
+
keepAliveFlag = true;
|
|
178
|
+
},
|
|
179
|
+
shouldKeepAlive: () => keepAliveFlag,
|
|
180
|
+
exit: (code = 0) => requestCLIExit(code)
|
|
181
|
+
})),
|
|
182
|
+
{
|
|
183
|
+
constraint: { surfaces: ['cli'] },
|
|
184
|
+
priority: 0
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
|
|
188
|
+
// CLI Invocation Context
|
|
189
|
+
ctx.registerLoader(
|
|
190
|
+
'cli/invocation',
|
|
191
|
+
makeContextLoader('cli/invocation', () => detectCLIInvocation()),
|
|
192
|
+
{
|
|
193
|
+
constraint: { surfaces: ['cli'] },
|
|
194
|
+
priority: 0
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
// Output Format Context
|
|
199
|
+
ctx.registerLoader(
|
|
200
|
+
'cli/output-format',
|
|
201
|
+
makeContextLoader('cli/output-format', () => format),
|
|
202
|
+
{
|
|
203
|
+
constraint: { surfaces: ['cli'] },
|
|
204
|
+
priority: 0
|
|
205
|
+
}
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Detect output format from CLI arguments
|
|
211
|
+
*/
|
|
212
|
+
export function detectOutputFormat(): 'json' | 'yaml' | 'table' | 'markdown' {
|
|
213
|
+
const inline = process.argv.find((arg) => arg.startsWith('--format='));
|
|
214
|
+
if (inline) {
|
|
215
|
+
const fmt = inline.slice('--format='.length).toLowerCase();
|
|
216
|
+
if (fmt === 'json' || fmt === 'yaml' || fmt === 'table' || fmt === 'markdown') {
|
|
217
|
+
return fmt;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const idx = process.argv.findIndex((arg) => arg === '--format');
|
|
222
|
+
if (idx >= 0 && idx + 1 < process.argv.length) {
|
|
223
|
+
const fmt = String(process.argv[idx + 1]).toLowerCase();
|
|
224
|
+
if (fmt === 'json' || fmt === 'yaml' || fmt === 'table' || fmt === 'markdown') {
|
|
225
|
+
return fmt as 'json' | 'yaml' | 'table' | 'markdown';
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
return 'table';
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Detect how the CLI was invoked
|
|
234
|
+
*/
|
|
235
|
+
function detectCLIInvocation(): CLIContext {
|
|
236
|
+
const argv = process.argv;
|
|
237
|
+
const cwd = process.cwd();
|
|
238
|
+
const interpreter = argv[0] ?? '';
|
|
239
|
+
const isInterpreted = interpreter.includes('bun') || interpreter.includes('node');
|
|
240
|
+
|
|
241
|
+
let command: string[] = [];
|
|
242
|
+
let bin = interpreter;
|
|
243
|
+
let script: string | undefined;
|
|
244
|
+
let args: string[] = [];
|
|
245
|
+
|
|
246
|
+
if (isInterpreted) {
|
|
247
|
+
let scriptIndex = 1;
|
|
248
|
+
while (scriptIndex < argv.length && argv[scriptIndex].startsWith('-')) {
|
|
249
|
+
scriptIndex++;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
if (scriptIndex < argv.length) {
|
|
253
|
+
script = argv[scriptIndex];
|
|
254
|
+
command = [interpreter, ...argv.slice(1, scriptIndex + 1)];
|
|
255
|
+
args = argv.slice(scriptIndex + 1);
|
|
256
|
+
} else {
|
|
257
|
+
command = [interpreter];
|
|
258
|
+
args = argv.slice(1);
|
|
259
|
+
}
|
|
260
|
+
bin = command.join(' ');
|
|
261
|
+
} else {
|
|
262
|
+
command = [interpreter];
|
|
263
|
+
args = argv.slice(1);
|
|
264
|
+
bin = interpreter;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
return { command, bin, script, cwd, args };
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Check if process should keep alive (for long-running commands)
|
|
272
|
+
*/
|
|
273
|
+
export function shouldKeepAlive(): boolean {
|
|
274
|
+
return keepAliveFlag;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Reset keep alive flag (for testing)
|
|
279
|
+
*/
|
|
280
|
+
export function resetKeepAlive(): void {
|
|
281
|
+
keepAliveFlag = false;
|
|
282
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Descriptor Schemas
|
|
3
|
+
*
|
|
4
|
+
* Kind-specific descriptor schemas for cli/group and cli/command.
|
|
5
|
+
* These are owned by the CLI module and registered with the runtime via cli.plugin.ts.
|
|
6
|
+
*/
|
|
7
|
+
import * as z from 'zod/v4';
|
|
8
|
+
/**
|
|
9
|
+
* Log buffer behavior — controls how CLI output is buffered during command execution.
|
|
10
|
+
*/
|
|
11
|
+
export declare const CLILogBufferBehaviorSchema: z.ZodObject<{
|
|
12
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
sinks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
|
+
fallbackToStdout: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
/**
|
|
17
|
+
* CLI Group descriptor config — groups organize commands into subcommand trees.
|
|
18
|
+
*/
|
|
19
|
+
export declare const CLIGroupDescriptorConfigSchema: z.ZodObject<{
|
|
20
|
+
name: z.ZodString;
|
|
21
|
+
description: z.ZodString;
|
|
22
|
+
parent: z.ZodOptional<z.ZodString>;
|
|
23
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
24
|
+
surfaces: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
25
|
+
cli: "cli";
|
|
26
|
+
worker: "worker";
|
|
27
|
+
bridge: "bridge";
|
|
28
|
+
web: "web";
|
|
29
|
+
}>>>;
|
|
30
|
+
internal: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
logBuffer: z.ZodOptional<z.ZodObject<{
|
|
33
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
sinks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
35
|
+
fallbackToStdout: z.ZodOptional<z.ZodBoolean>;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export declare const CLIGroupDescriptorSchema: z.ZodObject<{
|
|
39
|
+
[x: string]: any;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
/**
|
|
42
|
+
* CLI argument definition
|
|
43
|
+
*/
|
|
44
|
+
export declare const CLIArgumentSchema: z.ZodObject<{
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
description: z.ZodString;
|
|
47
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
variadic: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
default: z.ZodOptional<z.ZodUnknown>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
/**
|
|
52
|
+
* CLI option definition
|
|
53
|
+
*/
|
|
54
|
+
export declare const CLIOptionSchema: z.ZodObject<{
|
|
55
|
+
flags: z.ZodString;
|
|
56
|
+
description: z.ZodString;
|
|
57
|
+
default: z.ZodOptional<z.ZodUnknown>;
|
|
58
|
+
choices: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
/**
|
|
61
|
+
* CLI command example
|
|
62
|
+
*/
|
|
63
|
+
export declare const CLICommandExampleSchema: z.ZodObject<{
|
|
64
|
+
command: z.ZodString;
|
|
65
|
+
description: z.ZodString;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
/**
|
|
68
|
+
* CLI Command descriptor config — individual executable commands.
|
|
69
|
+
*/
|
|
70
|
+
export declare const CLICommandDescriptorConfigSchema: z.ZodObject<{
|
|
71
|
+
name: z.ZodString;
|
|
72
|
+
description: z.ZodString;
|
|
73
|
+
group: z.ZodString;
|
|
74
|
+
arguments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
75
|
+
name: z.ZodString;
|
|
76
|
+
description: z.ZodString;
|
|
77
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
78
|
+
variadic: z.ZodOptional<z.ZodBoolean>;
|
|
79
|
+
default: z.ZodOptional<z.ZodUnknown>;
|
|
80
|
+
}, z.core.$strip>>>;
|
|
81
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
82
|
+
flags: z.ZodString;
|
|
83
|
+
description: z.ZodString;
|
|
84
|
+
default: z.ZodOptional<z.ZodUnknown>;
|
|
85
|
+
choices: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
86
|
+
}, z.core.$strip>>>;
|
|
87
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
88
|
+
surfaces: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
89
|
+
cli: "cli";
|
|
90
|
+
worker: "worker";
|
|
91
|
+
bridge: "bridge";
|
|
92
|
+
web: "web";
|
|
93
|
+
}>>>;
|
|
94
|
+
internal: z.ZodOptional<z.ZodBoolean>;
|
|
95
|
+
examples: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
96
|
+
command: z.ZodString;
|
|
97
|
+
description: z.ZodString;
|
|
98
|
+
}, z.core.$strip>>>;
|
|
99
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
tuiAppId: z.ZodOptional<z.ZodString>;
|
|
101
|
+
logBuffer: z.ZodOptional<z.ZodObject<{
|
|
102
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
103
|
+
sinks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
104
|
+
fallbackToStdout: z.ZodOptional<z.ZodBoolean>;
|
|
105
|
+
}, z.core.$strip>>;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
export declare const CLICommandDescriptorSchema: z.ZodObject<{
|
|
108
|
+
[x: string]: any;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
export type { CLICommandArgument, CLICommandAssetDescriptor, CLICommandExample, CLICommandOption, CLIGroupAssetDescriptor, CLILogBufferBehavior } from './types';
|
|
111
|
+
/**
|
|
112
|
+
* Declaration merging for type-safe runtime asset resolution.
|
|
113
|
+
*/
|
|
114
|
+
declare module '@vibesdotdev/runtime/schemas/asset' {
|
|
115
|
+
interface RuntimeAssetSchemaRegistry {
|
|
116
|
+
'cli/group': CLIGroupAssetDescriptor;
|
|
117
|
+
'cli/command': CLICommandAssetDescriptor;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Descriptor Schemas
|
|
3
|
+
*
|
|
4
|
+
* Kind-specific descriptor schemas for cli/group and cli/command.
|
|
5
|
+
* These are owned by the CLI module and registered with the runtime via cli.plugin.ts.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import * as z from 'zod/v4';
|
|
9
|
+
import { createRuntimeAssetSchema } from '@vibesdotdev/runtime/schemas/asset';
|
|
10
|
+
import type {
|
|
11
|
+
CLICommandArgument,
|
|
12
|
+
CLICommandAssetDescriptor,
|
|
13
|
+
CLICommandExample,
|
|
14
|
+
CLICommandOption,
|
|
15
|
+
CLIGroupAssetDescriptor,
|
|
16
|
+
CLILogBufferBehavior
|
|
17
|
+
} from './types';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Log buffer behavior — controls how CLI output is buffered during command execution.
|
|
21
|
+
*/
|
|
22
|
+
export const CLILogBufferBehaviorSchema = z.object({
|
|
23
|
+
enabled: z.boolean().optional(),
|
|
24
|
+
sinks: z.array(z.string()).optional(),
|
|
25
|
+
fallbackToStdout: z.boolean().optional()
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* CLI Group descriptor config — groups organize commands into subcommand trees.
|
|
30
|
+
*/
|
|
31
|
+
export const CLIGroupDescriptorConfigSchema = z.object({
|
|
32
|
+
/** Human-readable name */
|
|
33
|
+
name: z.string().min(1),
|
|
34
|
+
/** Description of the group */
|
|
35
|
+
description: z.string().min(1),
|
|
36
|
+
/** Parent group ID (for nested groups) */
|
|
37
|
+
parent: z.string().optional(),
|
|
38
|
+
/** Command aliases */
|
|
39
|
+
aliases: z.array(z.string()).optional(),
|
|
40
|
+
/** Surfaces where this group is available */
|
|
41
|
+
surfaces: z.array(z.enum(['cli', 'web', 'worker', 'bridge'])).optional(),
|
|
42
|
+
/** Whether this group is internal-only unless the surface opts into internal commands */
|
|
43
|
+
internal: z.boolean().optional(),
|
|
44
|
+
/** Sort order within parent */
|
|
45
|
+
order: z.number().int().optional(),
|
|
46
|
+
/** Log buffer behavior for all commands in this group */
|
|
47
|
+
logBuffer: CLILogBufferBehaviorSchema.optional()
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export const CLIGroupDescriptorSchema = createRuntimeAssetSchema(
|
|
51
|
+
'cli/group',
|
|
52
|
+
CLIGroupDescriptorConfigSchema
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* CLI argument definition
|
|
57
|
+
*/
|
|
58
|
+
export const CLIArgumentSchema = z.object({
|
|
59
|
+
name: z.string().min(1),
|
|
60
|
+
description: z.string(),
|
|
61
|
+
required: z.boolean().optional(),
|
|
62
|
+
variadic: z.boolean().optional(),
|
|
63
|
+
default: z.unknown().optional()
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* CLI option definition
|
|
68
|
+
*/
|
|
69
|
+
export const CLIOptionSchema = z.object({
|
|
70
|
+
flags: z.string().min(1),
|
|
71
|
+
description: z.string().min(1),
|
|
72
|
+
default: z.unknown().optional(),
|
|
73
|
+
choices: z.array(z.string()).optional(),
|
|
74
|
+
type: z.enum(['string', 'number', 'boolean']).optional()
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* CLI command example
|
|
79
|
+
*/
|
|
80
|
+
export const CLICommandExampleSchema = z.object({
|
|
81
|
+
command: z.string().min(1),
|
|
82
|
+
description: z.string().min(1)
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* CLI Command descriptor config — individual executable commands.
|
|
87
|
+
*/
|
|
88
|
+
export const CLICommandDescriptorConfigSchema = z.object({
|
|
89
|
+
/** Human-readable name */
|
|
90
|
+
name: z.string().min(1),
|
|
91
|
+
/** Description of the command */
|
|
92
|
+
description: z.string().min(1),
|
|
93
|
+
/** Group this command belongs to */
|
|
94
|
+
group: z.string().min(1),
|
|
95
|
+
/** Positional arguments */
|
|
96
|
+
arguments: z.array(CLIArgumentSchema).optional(),
|
|
97
|
+
/** Named options/flags */
|
|
98
|
+
options: z.array(CLIOptionSchema).optional(),
|
|
99
|
+
/** Command aliases */
|
|
100
|
+
aliases: z.array(z.string()).optional(),
|
|
101
|
+
/** Surfaces where this command is available */
|
|
102
|
+
surfaces: z.array(z.enum(['cli', 'web', 'worker', 'bridge'])).optional(),
|
|
103
|
+
/** Whether this command is internal-only unless the surface opts into internal commands */
|
|
104
|
+
internal: z.boolean().optional(),
|
|
105
|
+
/** Examples of command usage */
|
|
106
|
+
examples: z.array(CLICommandExampleSchema).optional(),
|
|
107
|
+
/** Sort order within group */
|
|
108
|
+
order: z.number().int().optional(),
|
|
109
|
+
/** TUI app ID to launch instead of execute() */
|
|
110
|
+
tuiAppId: z.string().optional(),
|
|
111
|
+
/** Log buffer behavior for this command */
|
|
112
|
+
logBuffer: CLILogBufferBehaviorSchema.optional()
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
export const CLICommandDescriptorSchema = createRuntimeAssetSchema(
|
|
116
|
+
'cli/command',
|
|
117
|
+
CLICommandDescriptorConfigSchema
|
|
118
|
+
);
|
|
119
|
+
export type {
|
|
120
|
+
CLICommandArgument,
|
|
121
|
+
CLICommandAssetDescriptor,
|
|
122
|
+
CLICommandExample,
|
|
123
|
+
CLICommandOption,
|
|
124
|
+
CLIGroupAssetDescriptor,
|
|
125
|
+
CLILogBufferBehavior
|
|
126
|
+
} from './types';
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Declaration merging for type-safe runtime asset resolution.
|
|
130
|
+
*/
|
|
131
|
+
declare module '@vibesdotdev/runtime/schemas/asset' {
|
|
132
|
+
interface RuntimeAssetSchemaRegistry {
|
|
133
|
+
'cli/group': CLIGroupAssetDescriptor;
|
|
134
|
+
'cli/command': CLICommandAssetDescriptor;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { VibesRuntime } from '@vibesdotdev/runtime/api/runtime';
|
|
2
|
+
import type {
|
|
3
|
+
CLICommandAssetDescriptor,
|
|
4
|
+
CLIGroupAssetDescriptor,
|
|
5
|
+
CLILogBufferBehavior
|
|
6
|
+
} from './descriptors';
|
|
7
|
+
import type {
|
|
8
|
+
AppContext,
|
|
9
|
+
CLIProviderOptions,
|
|
10
|
+
ConfigContext,
|
|
11
|
+
LoggerContext,
|
|
12
|
+
UIContext
|
|
13
|
+
} from '../providers';
|
|
14
|
+
|
|
15
|
+
export interface CommandExecutionStartInfo {
|
|
16
|
+
command: CLICommandAssetDescriptor;
|
|
17
|
+
group?: CLIGroupAssetDescriptor;
|
|
18
|
+
args: Record<string, unknown>;
|
|
19
|
+
options: Record<string, unknown>;
|
|
20
|
+
logBuffer: CLILogBufferBehavior | null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* CLI Surface options
|
|
25
|
+
*/
|
|
26
|
+
export interface CLISurfaceOptions extends CLIProviderOptions {
|
|
27
|
+
/** Include descriptors marked internal (default: false) */
|
|
28
|
+
includeInternal?: boolean;
|
|
29
|
+
/** Enable pattern-based command generation */
|
|
30
|
+
enablePatterns?: boolean;
|
|
31
|
+
/** Callback invoked when command execution begins */
|
|
32
|
+
onCommandExecutionStart?: (info: CommandExecutionStartInfo) => void | Promise<void>;
|
|
33
|
+
/** Callback invoked before CLISurface triggers automatic process exit */
|
|
34
|
+
onBeforeAutoExit?: () => void | Promise<void>;
|
|
35
|
+
/** Fail initialization when command descriptors reference unknown groups */
|
|
36
|
+
strictCommandGroups?: boolean;
|
|
37
|
+
/** Additional group IDs explicitly allowed to register at CLI root */
|
|
38
|
+
rootFallbackGroups?: string[];
|
|
39
|
+
/** Fail initialization when cli/group parent references are missing */
|
|
40
|
+
strictGroupParents?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Context available to commands and patterns
|
|
45
|
+
*/
|
|
46
|
+
export interface CommandContext {
|
|
47
|
+
runtime: VibesRuntime;
|
|
48
|
+
ui?: UIContext;
|
|
49
|
+
logger?: LoggerContext;
|
|
50
|
+
app?: AppContext;
|
|
51
|
+
config?: ConfigContext;
|
|
52
|
+
}
|