@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,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fig / Amazon Q Completion Spec Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates a TypeScript completion spec compatible with:
|
|
5
|
+
* - Amazon Q Developer CLI (successor to Fig)
|
|
6
|
+
* - Inshellisense (Microsoft)
|
|
7
|
+
* - Warp terminal
|
|
8
|
+
* - @withfig/autocomplete ecosystem
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { CommandNode, OptionNode } from './tree';
|
|
12
|
+
|
|
13
|
+
function optionToFig(opt: OptionNode): string {
|
|
14
|
+
const names: string[] = [];
|
|
15
|
+
if (opt.short) names.push(`"-${opt.short}"`);
|
|
16
|
+
names.push(`"--${opt.long}"`);
|
|
17
|
+
const nameStr = names.length === 1 ? names[0] : `[${names.join(', ')}]`;
|
|
18
|
+
|
|
19
|
+
const parts = [` name: ${nameStr}`];
|
|
20
|
+
parts.push(` description: ${JSON.stringify(opt.description)}`);
|
|
21
|
+
if (opt.takesValue) parts.push(' args: { name: "value" }');
|
|
22
|
+
if (opt.choices) {
|
|
23
|
+
const suggestions = opt.choices.map((c) => `"${c}"`).join(', ');
|
|
24
|
+
parts.push(` args: { name: "value", suggestions: [${suggestions}] }`);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return ` {\n${parts.join(',\n')}\n }`;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function nodeToFig(node: CommandNode, indent: number): string {
|
|
31
|
+
const pad = ' '.repeat(indent);
|
|
32
|
+
const parts: string[] = [];
|
|
33
|
+
parts.push(`${pad}{`);
|
|
34
|
+
parts.push(`${pad} name: ${JSON.stringify(node.name)},`);
|
|
35
|
+
parts.push(`${pad} description: ${JSON.stringify(node.description)},`);
|
|
36
|
+
|
|
37
|
+
if (node.children.length > 0) {
|
|
38
|
+
const childSpecs = node.children.map((c) => nodeToFig(c, indent + 4));
|
|
39
|
+
parts.push(`${pad} subcommands: [`);
|
|
40
|
+
parts.push(childSpecs.join(',\n'));
|
|
41
|
+
parts.push(`${pad} ],`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (node.options.length > 0) {
|
|
45
|
+
parts.push(`${pad} options: [`);
|
|
46
|
+
parts.push(node.options.map(optionToFig).join(',\n'));
|
|
47
|
+
parts.push(`${pad} ],`);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (node.arguments.length > 0) {
|
|
51
|
+
const arg = node.arguments[0];
|
|
52
|
+
parts.push(`${pad} args: {`);
|
|
53
|
+
parts.push(`${pad} name: ${JSON.stringify(arg.name)},`);
|
|
54
|
+
parts.push(`${pad} description: ${JSON.stringify(arg.description)},`);
|
|
55
|
+
if (!arg.required) parts.push(`${pad} isOptional: true,`);
|
|
56
|
+
if (arg.variadic) parts.push(`${pad} variadic: true,`);
|
|
57
|
+
parts.push(`${pad} },`);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
parts.push(`${pad}}`);
|
|
61
|
+
return parts.join('\n');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function generateFigSpec(tree: CommandNode): string {
|
|
65
|
+
const lines: string[] = [
|
|
66
|
+
'// vibes Fig/Amazon Q completion spec — generated by vibes completion fig',
|
|
67
|
+
'//',
|
|
68
|
+
'// For Amazon Q CLI: save to ~/.fig/autocomplete/vibes.ts',
|
|
69
|
+
'// For Inshellisense: save to node_modules/@withfig/autocomplete/src/vibes.ts',
|
|
70
|
+
'',
|
|
71
|
+
`const completionSpec: Fig.Spec = ${nodeToFig(tree, 0)};`,
|
|
72
|
+
'',
|
|
73
|
+
'export default completionSpec;',
|
|
74
|
+
''
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
return lines.join('\n');
|
|
78
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fish Completion Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates fish shell completions from the command tree.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { CommandNode } from './tree';
|
|
8
|
+
|
|
9
|
+
function emitNode(node: CommandNode, parentCondition: string): string[] {
|
|
10
|
+
const lines: string[] = [];
|
|
11
|
+
|
|
12
|
+
for (const child of node.children) {
|
|
13
|
+
const isGroup = child.children.length > 0;
|
|
14
|
+
lines.push(
|
|
15
|
+
`complete -c vibes -n "${parentCondition}" -a ${child.name} -d "${child.description}"`
|
|
16
|
+
);
|
|
17
|
+
for (const alias of child.aliases) {
|
|
18
|
+
lines.push(
|
|
19
|
+
`complete -c vibes -n "${parentCondition}" -a ${alias} -d "${child.description}"`
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
for (const opt of child.options) {
|
|
24
|
+
const condition = `__fish_seen_subcommand_from ${child.name}`;
|
|
25
|
+
const shortFlag = opt.short ? `-s ${opt.short} ` : '';
|
|
26
|
+
const reqArg = opt.takesValue ? '-r ' : '';
|
|
27
|
+
lines.push(
|
|
28
|
+
`complete -c vibes -n "${condition}" ${shortFlag}${reqArg}-l ${opt.long} -d "${opt.description}"`
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (isGroup) {
|
|
33
|
+
lines.push(...emitNode(child, `__fish_seen_subcommand_from ${child.name}`));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return lines;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function generateFishCompletion(tree: CommandNode): string {
|
|
41
|
+
const lines = [
|
|
42
|
+
'# vibes fish completion — generated by vibes completion fish',
|
|
43
|
+
'# Save to ~/.config/fish/completions/vibes.fish',
|
|
44
|
+
'',
|
|
45
|
+
'# Disable file completions by default',
|
|
46
|
+
'complete -c vibes -f',
|
|
47
|
+
''
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
lines.push(...emitNode(tree, '__fish_use_subcommand'));
|
|
51
|
+
return lines.join('\n') + '\n';
|
|
52
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command Tree Builder
|
|
3
|
+
*
|
|
4
|
+
* Extracts the full CLI command tree from runtime descriptors.
|
|
5
|
+
* Used by shell completion generators to produce shell-specific output.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { VibesRuntime } from '@vibesdotdev/runtime/api/runtime';
|
|
9
|
+
import type {
|
|
10
|
+
CLICommandAssetDescriptor,
|
|
11
|
+
CLIGroupAssetDescriptor
|
|
12
|
+
} from '../../schemas/descriptors';
|
|
13
|
+
import { getCLIDiscovery, type CLIDiscoveryOptions } from '../../surface/discovery-cache';
|
|
14
|
+
|
|
15
|
+
export interface CommandNode {
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
aliases: string[];
|
|
19
|
+
arguments: ArgumentNode[];
|
|
20
|
+
options: OptionNode[];
|
|
21
|
+
children: CommandNode[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ArgumentNode {
|
|
25
|
+
name: string;
|
|
26
|
+
description: string;
|
|
27
|
+
required: boolean;
|
|
28
|
+
variadic: boolean;
|
|
29
|
+
choices?: string[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface OptionNode {
|
|
33
|
+
long: string;
|
|
34
|
+
short?: string;
|
|
35
|
+
description: string;
|
|
36
|
+
takesValue: boolean;
|
|
37
|
+
choices?: string[];
|
|
38
|
+
default?: unknown;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function parseFlags(flags: string): { long: string; short?: string; takesValue: boolean } {
|
|
42
|
+
const takesValue = flags.includes('<') || flags.includes('[');
|
|
43
|
+
const parts = flags.split(',').map((s) => s.trim().split(/\s/)[0]);
|
|
44
|
+
const long = parts.find((p) => p.startsWith('--'))?.replace(/^--/, '') ?? parts[0].replace(/^-/, '');
|
|
45
|
+
const short = parts.find((p) => p.startsWith('-') && !p.startsWith('--'))?.replace(/^-/, '');
|
|
46
|
+
return { long, short, takesValue };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function buildCommandTree(
|
|
50
|
+
runtime: VibesRuntime,
|
|
51
|
+
options: CLIDiscoveryOptions = {}
|
|
52
|
+
): CommandNode {
|
|
53
|
+
const discovery = getCLIDiscovery(runtime, options);
|
|
54
|
+
const groups = discovery.sortedGroups;
|
|
55
|
+
const commands = discovery.sortedCommands.filter((command) => command.id !== 'completion');
|
|
56
|
+
|
|
57
|
+
const groupNodes = new Map<string, CommandNode>();
|
|
58
|
+
for (const g of groups) {
|
|
59
|
+
groupNodes.set(g.id, {
|
|
60
|
+
name: g.name,
|
|
61
|
+
description: g.description ?? '',
|
|
62
|
+
aliases: g.aliases ?? [],
|
|
63
|
+
arguments: [],
|
|
64
|
+
options: [],
|
|
65
|
+
children: []
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const root: CommandNode = {
|
|
70
|
+
name: 'vibes',
|
|
71
|
+
description: 'Vibes Developer CLI',
|
|
72
|
+
aliases: [],
|
|
73
|
+
arguments: [],
|
|
74
|
+
options: [
|
|
75
|
+
{ long: 'verbose', short: 'v', description: 'Enable verbose logging', takesValue: false },
|
|
76
|
+
{ long: 'help', short: 'h', description: 'Display help', takesValue: false }
|
|
77
|
+
],
|
|
78
|
+
children: []
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
for (const g of groups) {
|
|
82
|
+
const node = groupNodes.get(g.id);
|
|
83
|
+
if (!node) continue;
|
|
84
|
+
const parentNode = g.parent ? groupNodes.get(g.parent) : null;
|
|
85
|
+
(parentNode ?? root).children.push(node);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
for (const cmd of commands) {
|
|
89
|
+
const node: CommandNode = {
|
|
90
|
+
name: cmd.name,
|
|
91
|
+
description: cmd.description ?? '',
|
|
92
|
+
aliases: cmd.aliases ?? [],
|
|
93
|
+
arguments: (cmd.arguments ?? []).map((a) => ({
|
|
94
|
+
name: a.name,
|
|
95
|
+
description: a.description ?? '',
|
|
96
|
+
required: a.required ?? false,
|
|
97
|
+
variadic: a.variadic ?? false
|
|
98
|
+
})),
|
|
99
|
+
options: (cmd.options ?? []).map((o) => {
|
|
100
|
+
const parsed = parseFlags(o.flags);
|
|
101
|
+
return {
|
|
102
|
+
...parsed,
|
|
103
|
+
description: o.description ?? '',
|
|
104
|
+
choices: o.choices,
|
|
105
|
+
default: o.default
|
|
106
|
+
};
|
|
107
|
+
}),
|
|
108
|
+
children: []
|
|
109
|
+
};
|
|
110
|
+
const parent = groupNodes.get(cmd.group);
|
|
111
|
+
(parent ?? root).children.push(node);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return root;
|
|
115
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zsh Autosuggestion Integration
|
|
3
|
+
*
|
|
4
|
+
* Registers a custom zsh-autosuggestions strategy that suggests
|
|
5
|
+
* vibes commands from known command paths. Falls back gracefully
|
|
6
|
+
* if zsh-autosuggestions is not installed.
|
|
7
|
+
*
|
|
8
|
+
* Uses the static _VIBES_SUGGEST_PATHS array (populated at generation
|
|
9
|
+
* time from runtime descriptors) — no subprocess calls, no external
|
|
10
|
+
* commands, no PATH dependencies.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export function getWidgetCode(): string {
|
|
14
|
+
return `
|
|
15
|
+
# ── zsh-autosuggestions integration ──
|
|
16
|
+
# Registers a custom strategy for vibes commands.
|
|
17
|
+
# If zsh-autosuggestions is not loaded, this is a no-op.
|
|
18
|
+
|
|
19
|
+
_zsh_autosuggest_strategy_vibes() {
|
|
20
|
+
# Only handle vibes-prefixed input
|
|
21
|
+
[[ "\$1" != vibes* ]] && return
|
|
22
|
+
|
|
23
|
+
# Match against known command paths (no subprocess)
|
|
24
|
+
local _vp
|
|
25
|
+
for _vp in "\${_VIBES_SUGGEST_PATHS[@]}"; do
|
|
26
|
+
if [[ "vibes \$_vp" == "\$1"* && "vibes \$_vp" != "\$1" ]]; then
|
|
27
|
+
typeset -g suggestion="vibes \$_vp"
|
|
28
|
+
return
|
|
29
|
+
fi
|
|
30
|
+
done
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
# Prepend vibes strategy so it runs first for vibes commands,
|
|
34
|
+
# then falls through to the default history strategy for everything else.
|
|
35
|
+
if (( \$+functions[_zsh_autosuggest_strategy_history] )); then
|
|
36
|
+
ZSH_AUTOSUGGEST_STRATEGY=(vibes \${ZSH_AUTOSUGGEST_STRATEGY[@]})
|
|
37
|
+
fi
|
|
38
|
+
`.trim();
|
|
39
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zsh Completion Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates zsh tab completion with full flag/argument support
|
|
5
|
+
* and integrates with zsh-autosuggestions for inline ghost-text.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { CommandNode, OptionNode, ArgumentNode } from './tree';
|
|
9
|
+
import { getWidgetCode } from './zsh-widget';
|
|
10
|
+
|
|
11
|
+
function esc(s: string): string {
|
|
12
|
+
return s.replace(/'/g, "'\\''").replace(/\[/g, '\\[').replace(/\]/g, '\\]');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function optionSpec(opt: OptionNode): string {
|
|
16
|
+
const desc = esc(opt.description);
|
|
17
|
+
const short = opt.short ? `-${opt.short}` : '';
|
|
18
|
+
const long = `--${opt.long}`;
|
|
19
|
+
const names = short ? `'(${short} ${long})'{${short},${long}}` : `${long}`;
|
|
20
|
+
const action = opt.choices
|
|
21
|
+
? `:(${opt.choices.join(' ')})`
|
|
22
|
+
: opt.takesValue
|
|
23
|
+
? `: :_default`
|
|
24
|
+
: '';
|
|
25
|
+
return ` ${names}'[${desc}]${action}'`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function emitLeafFunction(node: CommandNode, fnName: string): string[] {
|
|
29
|
+
const lines: string[] = [];
|
|
30
|
+
lines.push(`${fnName}() {`);
|
|
31
|
+
|
|
32
|
+
if (node.options.length === 0 && node.arguments.length === 0) {
|
|
33
|
+
lines.push(' _message "no more arguments"');
|
|
34
|
+
lines.push('}');
|
|
35
|
+
return lines;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
lines.push(' _arguments -s \\');
|
|
39
|
+
for (const opt of node.options) {
|
|
40
|
+
lines.push(optionSpec(opt) + ' \\');
|
|
41
|
+
}
|
|
42
|
+
for (const arg of node.arguments) {
|
|
43
|
+
const desc = esc(arg.description);
|
|
44
|
+
const action = arg.choices ? `(${arg.choices.join(' ')})` : '_default';
|
|
45
|
+
const spec = arg.variadic
|
|
46
|
+
? `'*:${desc}:${action}'`
|
|
47
|
+
: arg.required
|
|
48
|
+
? `':${desc}:${action}'`
|
|
49
|
+
: `'::${desc}:${action}'`;
|
|
50
|
+
lines.push(` ${spec} \\`);
|
|
51
|
+
}
|
|
52
|
+
// Remove trailing backslash from last line
|
|
53
|
+
if (lines.length > 1) {
|
|
54
|
+
lines[lines.length - 1] = lines[lines.length - 1].replace(/ \\$/, '');
|
|
55
|
+
}
|
|
56
|
+
lines.push('}');
|
|
57
|
+
return lines;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function emitGroupFunction(node: CommandNode, fnName: string): string[] {
|
|
61
|
+
const lines: string[] = [];
|
|
62
|
+
lines.push(`${fnName}() {`);
|
|
63
|
+
lines.push(' local line state');
|
|
64
|
+
lines.push(' _arguments -C \\');
|
|
65
|
+
|
|
66
|
+
for (const opt of node.options) {
|
|
67
|
+
lines.push(optionSpec(opt) + ' \\');
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
lines.push(` "1: :${fnName}_cmds" \\`);
|
|
71
|
+
lines.push(' "*::arg:->args"');
|
|
72
|
+
lines.push(' case "$state" in');
|
|
73
|
+
lines.push(' args)');
|
|
74
|
+
lines.push(' case "$line[1]" in');
|
|
75
|
+
for (const child of node.children) {
|
|
76
|
+
const childFn = `${fnName}_${child.name.replace(/-/g, '_')}`;
|
|
77
|
+
lines.push(` ${child.name}) ${childFn} ;;`);
|
|
78
|
+
for (const alias of child.aliases) {
|
|
79
|
+
lines.push(` ${alias}) ${childFn} ;;`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
lines.push(' esac');
|
|
83
|
+
lines.push(' ;;');
|
|
84
|
+
lines.push(' esac');
|
|
85
|
+
lines.push('}');
|
|
86
|
+
lines.push('');
|
|
87
|
+
|
|
88
|
+
// Subcommand list function
|
|
89
|
+
lines.push(`${fnName}_cmds() {`);
|
|
90
|
+
lines.push(' local -a subcmds');
|
|
91
|
+
lines.push(' subcmds=(');
|
|
92
|
+
for (const child of node.children) {
|
|
93
|
+
const desc = esc(child.description);
|
|
94
|
+
lines.push(` '${child.name}:${desc}'`);
|
|
95
|
+
for (const alias of child.aliases) {
|
|
96
|
+
lines.push(` '${alias}:${desc}'`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
lines.push(' )');
|
|
100
|
+
lines.push(" _describe -t commands 'commands' subcmds");
|
|
101
|
+
lines.push('}');
|
|
102
|
+
|
|
103
|
+
return lines;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function emitAll(node: CommandNode, fnName: string): string[] {
|
|
107
|
+
const lines: string[] = [];
|
|
108
|
+
|
|
109
|
+
if (node.children.length > 0) {
|
|
110
|
+
lines.push(...emitGroupFunction(node, fnName));
|
|
111
|
+
lines.push('');
|
|
112
|
+
for (const child of node.children) {
|
|
113
|
+
const childFn = `${fnName}_${child.name.replace(/-/g, '_')}`;
|
|
114
|
+
lines.push(...emitAll(child, childFn));
|
|
115
|
+
lines.push('');
|
|
116
|
+
}
|
|
117
|
+
} else {
|
|
118
|
+
lines.push(...emitLeafFunction(node, fnName));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return lines;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function collectPaths(node: CommandNode, prefix: string): string[] {
|
|
125
|
+
const results: string[] = [];
|
|
126
|
+
for (const child of node.children) {
|
|
127
|
+
const cp = prefix ? `${prefix} ${child.name}` : child.name;
|
|
128
|
+
results.push(cp);
|
|
129
|
+
for (const alias of child.aliases) {
|
|
130
|
+
results.push(prefix ? `${prefix} ${alias}` : alias);
|
|
131
|
+
}
|
|
132
|
+
if (child.children.length > 0) {
|
|
133
|
+
results.push(...collectPaths(child, cp));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return results;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function generateZshCompletion(tree: CommandNode): string {
|
|
140
|
+
const completionPaths = collectPaths(tree, '').sort();
|
|
141
|
+
const completionPathsStr = completionPaths.map((p) => ` "${p}"`).join('\n');
|
|
142
|
+
|
|
143
|
+
const parts: string[] = [
|
|
144
|
+
'#compdef vibes',
|
|
145
|
+
'# vibes zsh completion — generated by vibes completion zsh',
|
|
146
|
+
'# Install: vibes completion zsh --install',
|
|
147
|
+
'',
|
|
148
|
+
'# ── Tab Completion (commands, flags, arguments) ──',
|
|
149
|
+
''
|
|
150
|
+
];
|
|
151
|
+
|
|
152
|
+
parts.push(...emitAll(tree, '_vibes'));
|
|
153
|
+
parts.push('');
|
|
154
|
+
parts.push('compdef _vibes vibes');
|
|
155
|
+
parts.push('');
|
|
156
|
+
|
|
157
|
+
parts.push('# ── Autosuggestion paths (used by zsh-autosuggestions strategy) ──');
|
|
158
|
+
parts.push('typeset -ga _VIBES_SUGGEST_PATHS=(');
|
|
159
|
+
parts.push(completionPathsStr);
|
|
160
|
+
parts.push(')');
|
|
161
|
+
parts.push('');
|
|
162
|
+
parts.push(getWidgetCode());
|
|
163
|
+
|
|
164
|
+
return parts.join('\n') + '\n';
|
|
165
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Profile command utilities
|
|
3
|
+
*
|
|
4
|
+
* Shared helpers for scanning profile directories and formatting output.
|
|
5
|
+
* Uses node built-ins only to avoid circular dependencies.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { existsSync, readdirSync, statSync, mkdirSync, rmSync } from 'node:fs';
|
|
9
|
+
import { homedir } from 'node:os';
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { getRuntimeEnv } from '@vibesdotdev/runtime';
|
|
12
|
+
|
|
13
|
+
export const GREEN = '\x1b[32m';
|
|
14
|
+
export const GRAY = '\x1b[90m';
|
|
15
|
+
export const YELLOW = '\x1b[33m';
|
|
16
|
+
export const RED = '\x1b[31m';
|
|
17
|
+
export const BOLD = '\x1b[1m';
|
|
18
|
+
export const RESET = '\x1b[0m';
|
|
19
|
+
|
|
20
|
+
const VALID_PROFILE_NAME = /^[a-zA-Z0-9._-]+$/;
|
|
21
|
+
|
|
22
|
+
export function validateProfileName(name: string): string {
|
|
23
|
+
if (!name || typeof name !== 'string') {
|
|
24
|
+
throw new Error('Profile name is required');
|
|
25
|
+
}
|
|
26
|
+
if (name.length > 64) {
|
|
27
|
+
throw new Error('Profile name must be 64 characters or fewer');
|
|
28
|
+
}
|
|
29
|
+
if (!VALID_PROFILE_NAME.test(name)) {
|
|
30
|
+
throw new Error(
|
|
31
|
+
'Profile name may only contain letters, numbers, dots, hyphens, and underscores'
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
return name;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function getProfilesDir(): string {
|
|
38
|
+
return join(homedir(), '.vibes', 'profile');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function getActiveProfile(): string | undefined {
|
|
42
|
+
return getRuntimeEnv('VIBES_PROFILE') || getRuntimeEnv('VIBES_PROFILE_NAME') || undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function listProfiles(): string[] {
|
|
46
|
+
const dir = getProfilesDir();
|
|
47
|
+
if (!existsSync(dir)) return [];
|
|
48
|
+
return readdirSync(dir).filter((name) => {
|
|
49
|
+
const full = join(dir, name);
|
|
50
|
+
return statSync(full).isDirectory();
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function profileExists(name: string): boolean {
|
|
55
|
+
const path = join(getProfilesDir(), name);
|
|
56
|
+
return existsSync(path) && statSync(path).isDirectory();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function createProfileDir(name: string): void {
|
|
60
|
+
const base = join(getProfilesDir(), name);
|
|
61
|
+
for (const sub of ['config', 'data', 'cache', 'logs']) {
|
|
62
|
+
mkdirSync(join(base, sub), { recursive: true });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function deleteProfileDir(name: string): void {
|
|
67
|
+
rmSync(join(getProfilesDir(), name), { recursive: true, force: true });
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function log(msg: string): void {
|
|
71
|
+
process.stderr.write(msg + '\n');
|
|
72
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CLIGroupAssetDescriptor } from '../../schemas/descriptors';
|
|
2
|
+
|
|
3
|
+
const descriptor: CLIGroupAssetDescriptor = {
|
|
4
|
+
kind: 'cli/group',
|
|
5
|
+
id: 'profile',
|
|
6
|
+
name: 'profile',
|
|
7
|
+
description: 'Manage vibes profiles (isolated config/data environments)',
|
|
8
|
+
order: 100,
|
|
9
|
+
surfaces: ['cli'],
|
|
10
|
+
hardware: ['consumer'],
|
|
11
|
+
enabled: true
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default descriptor;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CLICommandAssetDescriptor } from '../../schemas/descriptors';
|
|
2
|
+
|
|
3
|
+
const descriptor: CLICommandAssetDescriptor = {
|
|
4
|
+
kind: 'cli/command',
|
|
5
|
+
id: 'profile.create',
|
|
6
|
+
name: 'create',
|
|
7
|
+
description: 'Create a new profile',
|
|
8
|
+
group: 'profile',
|
|
9
|
+
arguments: [
|
|
10
|
+
{
|
|
11
|
+
name: 'name',
|
|
12
|
+
description: 'Name of the profile to create',
|
|
13
|
+
required: true
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
examples: [
|
|
17
|
+
{ command: 'vibes profile create work', description: 'Create a new profile named "work"' }
|
|
18
|
+
],
|
|
19
|
+
surfaces: ['cli'],
|
|
20
|
+
hardware: ['consumer'],
|
|
21
|
+
enabled: true
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default descriptor;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Profile Create Implementation
|
|
3
|
+
*
|
|
4
|
+
* Creates ~/.vibes/profile/{name}/ along with config/, data/, cache/, logs/.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { existsSync } from 'node:fs';
|
|
8
|
+
import {
|
|
9
|
+
getProfilesDir,
|
|
10
|
+
profileExists,
|
|
11
|
+
createProfileDir,
|
|
12
|
+
validateProfileName,
|
|
13
|
+
GREEN,
|
|
14
|
+
RED,
|
|
15
|
+
BOLD,
|
|
16
|
+
RESET,
|
|
17
|
+
log
|
|
18
|
+
} from './_utils';
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
async execute(args: Record<string, unknown>): Promise<void> {
|
|
22
|
+
const name = args.name as string;
|
|
23
|
+
if (!name) {
|
|
24
|
+
log(`${RED}✗${RESET} Profile name is required`);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
validateProfileName(name);
|
|
29
|
+
|
|
30
|
+
log('');
|
|
31
|
+
log(`${BOLD}vibes profile create${RESET} ${name}`);
|
|
32
|
+
log(`${'─'.repeat(40)}`);
|
|
33
|
+
|
|
34
|
+
if (profileExists(name)) {
|
|
35
|
+
log(` ${RED}✗${RESET} Profile already exists: ${BOLD}${name}${RESET}`);
|
|
36
|
+
log('');
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
createProfileDir(name);
|
|
41
|
+
log(` ${GREEN}✓${RESET} Created profile ${BOLD}${name}${RESET}`);
|
|
42
|
+
log('');
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CLICommandAssetDescriptor } from '../../schemas/descriptors';
|
|
2
|
+
|
|
3
|
+
const descriptor: CLICommandAssetDescriptor = {
|
|
4
|
+
kind: 'cli/command',
|
|
5
|
+
id: 'profile.delete',
|
|
6
|
+
name: 'delete',
|
|
7
|
+
description: 'Delete a profile',
|
|
8
|
+
group: 'profile',
|
|
9
|
+
arguments: [
|
|
10
|
+
{
|
|
11
|
+
name: 'name',
|
|
12
|
+
description: 'Name of the profile to delete',
|
|
13
|
+
required: true
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
options: [
|
|
17
|
+
{
|
|
18
|
+
flags: '--force',
|
|
19
|
+
description: 'Skip confirmation prompt'
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
examples: [
|
|
23
|
+
{ command: 'vibes profile delete work', description: 'Delete the "work" profile with confirmation' },
|
|
24
|
+
{ command: 'vibes profile delete work --force', description: 'Delete without confirmation' }
|
|
25
|
+
],
|
|
26
|
+
surfaces: ['cli'],
|
|
27
|
+
hardware: ['consumer'],
|
|
28
|
+
enabled: true
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default descriptor;
|