@vibesdotdev/cli 0.0.2 → 1.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +18 -0
- package/README.md +261 -1
- package/dist/boot/action-lifetime.d.ts +16 -0
- package/dist/boot/action-lifetime.d.ts.map +1 -0
- package/dist/boot/action-lifetime.js +80 -0
- package/dist/boot/action-lifetime.js.map +1 -0
- package/dist/boot/bootstrap.d.ts +190 -0
- package/dist/boot/bootstrap.d.ts.map +1 -0
- package/dist/boot/bootstrap.js +737 -0
- package/dist/boot/bootstrap.js.map +1 -0
- package/dist/boot/cli-flags.d.ts +45 -0
- package/dist/boot/cli-flags.d.ts.map +1 -0
- package/dist/boot/cli-flags.js +113 -0
- package/dist/boot/cli-flags.js.map +1 -0
- package/dist/boot/config.d.ts +25 -0
- package/dist/boot/config.d.ts.map +1 -0
- package/dist/{config.js → boot/config.js} +1 -1
- package/dist/boot/config.js.map +1 -0
- package/dist/boot/external-url.d.ts +13 -0
- package/dist/boot/external-url.d.ts.map +1 -0
- package/dist/boot/external-url.js +66 -0
- package/dist/boot/external-url.js.map +1 -0
- package/dist/boot/host-argv.d.ts +7 -0
- package/dist/boot/host-argv.d.ts.map +1 -0
- package/dist/boot/host-argv.js +8 -0
- package/dist/boot/host-argv.js.map +1 -0
- package/dist/boot/host-bootstrap.d.ts +37 -0
- package/dist/boot/host-bootstrap.d.ts.map +1 -0
- package/dist/boot/host-bootstrap.js +60 -0
- package/dist/boot/host-bootstrap.js.map +1 -0
- package/dist/boot/providers.d.ts +35 -0
- package/dist/boot/providers.d.ts.map +1 -0
- package/dist/boot/providers.js +155 -0
- package/dist/boot/providers.js.map +1 -0
- package/dist/boot/schemas/external-url.d.ts +11 -0
- package/dist/boot/schemas/external-url.d.ts.map +1 -0
- package/dist/boot/schemas/external-url.js +3 -0
- package/dist/boot/schemas/external-url.js.map +1 -0
- package/dist/boot/schemas/host-bootstrap.d.ts +7 -0
- package/dist/boot/schemas/host-bootstrap.d.ts.map +1 -0
- package/dist/boot/schemas/host-bootstrap.js +3 -0
- package/dist/boot/schemas/host-bootstrap.js.map +1 -0
- package/dist/boot/schemas/providers.d.ts +23 -0
- package/dist/boot/schemas/providers.d.ts.map +1 -0
- package/dist/boot/schemas/providers.js +3 -0
- package/dist/boot/schemas/providers.js.map +1 -0
- package/dist/boot/schemas/types.d.ts +4 -0
- package/dist/boot/schemas/types.d.ts.map +1 -0
- package/dist/{api → boot}/schemas/types.js.map +1 -1
- package/dist/boot/tui-plugin-policy.d.ts +8 -0
- package/dist/boot/tui-plugin-policy.d.ts.map +1 -0
- package/dist/boot/tui-plugin-policy.js +26 -0
- package/dist/boot/tui-plugin-policy.js.map +1 -0
- package/dist/boot/version.d.ts +13 -0
- package/dist/boot/version.d.ts.map +1 -0
- package/dist/boot/version.js +14 -0
- package/dist/boot/version.js.map +1 -0
- package/dist/bun/index.d.ts +2 -0
- package/dist/bun/index.d.ts.map +1 -0
- package/dist/bun/index.js +2 -0
- package/dist/bun/index.js.map +1 -0
- package/dist/bun/interactive-host.d.ts +9 -0
- package/dist/bun/interactive-host.d.ts.map +1 -0
- package/dist/bun/interactive-host.js +18 -0
- package/dist/bun/interactive-host.js.map +1 -0
- package/dist/commands/cli.kinds.d.ts +1239 -0
- package/dist/commands/cli.kinds.d.ts.map +1 -0
- package/dist/commands/cli.kinds.js +138 -0
- package/dist/commands/cli.kinds.js.map +1 -0
- package/dist/commands/cli.plugin.d.ts +22 -0
- package/dist/commands/cli.plugin.d.ts.map +1 -0
- package/dist/commands/cli.plugin.js +138 -0
- package/dist/commands/cli.plugin.js.map +1 -0
- package/dist/commands/completion/bash.d.ts +1 -1
- package/dist/commands/completion/bash.d.ts.map +1 -1
- package/dist/commands/completion/bash.impl.consumer.d.ts +6 -0
- package/dist/commands/completion/bash.impl.consumer.d.ts.map +1 -0
- package/dist/commands/completion/bash.impl.consumer.js +6 -0
- package/dist/commands/completion/bash.impl.consumer.js.map +1 -0
- package/dist/commands/completion/bash.js +4 -2
- package/dist/commands/completion/bash.js.map +1 -1
- package/dist/commands/completion/completion.consumer.plugin.d.ts +3 -0
- package/dist/commands/completion/completion.consumer.plugin.d.ts.map +1 -0
- package/dist/commands/completion/completion.consumer.plugin.js +19 -0
- package/dist/commands/completion/completion.consumer.plugin.js.map +1 -0
- package/dist/commands/completion/completion.descriptor.d.ts +1 -2
- package/dist/commands/completion/completion.descriptor.d.ts.map +1 -1
- package/dist/commands/completion/completion.descriptor.js +11 -4
- package/dist/commands/completion/completion.descriptor.js.map +1 -1
- package/dist/commands/completion/completion.descriptors.d.ts +3 -0
- package/dist/commands/completion/completion.descriptors.d.ts.map +1 -0
- package/dist/commands/completion/completion.descriptors.js +56 -0
- package/dist/commands/completion/completion.descriptors.js.map +1 -0
- package/dist/commands/completion/completion.impl.d.ts +5 -4
- package/dist/commands/completion/completion.impl.d.ts.map +1 -1
- package/dist/commands/completion/completion.impl.js +104 -145
- package/dist/commands/completion/completion.impl.js.map +1 -1
- package/dist/commands/completion/completion.install.impl.consumer.d.ts +4 -0
- package/dist/commands/completion/completion.install.impl.consumer.d.ts.map +1 -0
- package/dist/commands/completion/completion.install.impl.consumer.js +102 -0
- package/dist/commands/completion/completion.install.impl.consumer.js.map +1 -0
- package/dist/commands/completion/completion.kinds.d.ts +43 -0
- package/dist/commands/completion/completion.kinds.d.ts.map +1 -0
- package/dist/commands/completion/completion.kinds.js +17 -0
- package/dist/commands/completion/completion.kinds.js.map +1 -0
- package/dist/commands/completion/fig.d.ts +1 -1
- package/dist/commands/completion/fig.d.ts.map +1 -1
- package/dist/commands/completion/fig.impl.consumer.d.ts +6 -0
- package/dist/commands/completion/fig.impl.consumer.d.ts.map +1 -0
- package/dist/commands/completion/fig.impl.consumer.js +6 -0
- package/dist/commands/completion/fig.impl.consumer.js.map +1 -0
- package/dist/commands/completion/fish.d.ts +1 -1
- package/dist/commands/completion/fish.d.ts.map +1 -1
- package/dist/commands/completion/fish.impl.consumer.d.ts +6 -0
- package/dist/commands/completion/fish.impl.consumer.d.ts.map +1 -0
- package/dist/commands/completion/fish.impl.consumer.js +6 -0
- package/dist/commands/completion/fish.impl.consumer.js.map +1 -0
- package/dist/commands/completion/tree.d.ts +5 -26
- package/dist/commands/completion/tree.d.ts.map +1 -1
- package/dist/commands/completion/tree.js +26 -25
- package/dist/commands/completion/tree.js.map +1 -1
- package/dist/commands/completion/zsh-widget.js +4 -4
- package/dist/commands/completion/zsh.d.ts +1 -1
- package/dist/commands/completion/zsh.d.ts.map +1 -1
- package/dist/commands/completion/zsh.impl.consumer.d.ts +6 -0
- package/dist/commands/completion/zsh.impl.consumer.d.ts.map +1 -0
- package/dist/commands/completion/zsh.impl.consumer.js +6 -0
- package/dist/commands/completion/zsh.impl.consumer.js.map +1 -0
- package/dist/commands/completion/zsh.js +1 -1
- package/dist/commands/completion/zsh.js.map +1 -1
- package/dist/commands/docs/cli.commands.docs.descriptor.d.ts +8 -0
- package/dist/commands/docs/cli.commands.docs.descriptor.d.ts.map +1 -0
- package/dist/commands/docs/cli.commands.docs.descriptor.js +55 -0
- package/dist/commands/docs/cli.commands.docs.descriptor.js.map +1 -0
- package/dist/commands/docs/cli.docs.descriptor.d.ts +4 -0
- package/dist/commands/docs/cli.docs.descriptor.d.ts.map +1 -0
- package/dist/commands/docs/cli.docs.descriptor.js +44 -0
- package/dist/commands/docs/cli.docs.descriptor.js.map +1 -0
- package/dist/commands/docs/cli.groups.docs.descriptor.d.ts +4 -0
- package/dist/commands/docs/cli.groups.docs.descriptor.d.ts.map +1 -0
- package/dist/commands/docs/cli.groups.docs.descriptor.js +40 -0
- package/dist/commands/docs/cli.groups.docs.descriptor.js.map +1 -0
- package/dist/commands/docs/cli.output.docs.descriptor.d.ts +4 -0
- package/dist/commands/docs/cli.output.docs.descriptor.d.ts.map +1 -0
- package/dist/commands/docs/cli.output.docs.descriptor.js +45 -0
- package/dist/commands/docs/cli.output.docs.descriptor.js.map +1 -0
- package/dist/commands/docs/content/cli-commands.json +1 -0
- package/dist/commands/docs/content/cli-groups.json +1 -0
- package/dist/commands/docs/content/cli-output.json +1 -0
- package/dist/commands/docs/doc-paths.d.ts +11 -0
- package/dist/commands/docs/doc-paths.d.ts.map +1 -0
- package/dist/commands/docs/doc-paths.js +32 -0
- package/dist/commands/docs/doc-paths.js.map +1 -0
- package/dist/commands/docs/generate.d.ts +48 -0
- package/dist/commands/docs/generate.d.ts.map +1 -0
- package/dist/commands/docs/generate.js +121 -0
- package/dist/commands/docs/generate.js.map +1 -0
- package/dist/commands/docs/render-command.d.ts +5 -0
- package/dist/commands/docs/render-command.d.ts.map +1 -0
- package/dist/commands/docs/render-command.js +117 -0
- package/dist/commands/docs/render-command.js.map +1 -0
- package/dist/commands/docs/render-group.d.ts +5 -0
- package/dist/commands/docs/render-group.d.ts.map +1 -0
- package/dist/commands/docs/render-group.js +62 -0
- package/dist/commands/docs/render-group.js.map +1 -0
- package/dist/commands/docs/schemas/generate.d.ts +14 -0
- package/dist/commands/docs/schemas/generate.d.ts.map +1 -0
- package/dist/commands/docs/schemas/generate.js +3 -0
- package/dist/commands/docs/schemas/generate.js.map +1 -0
- package/dist/commands/output.d.ts +27 -0
- package/dist/commands/output.d.ts.map +1 -0
- package/dist/commands/output.js +104 -0
- package/dist/commands/output.js.map +1 -0
- package/dist/commands/profile/_utils.d.ts +34 -9
- package/dist/commands/profile/_utils.d.ts.map +1 -1
- package/dist/commands/profile/_utils.js +65 -37
- package/dist/commands/profile/_utils.js.map +1 -1
- package/dist/commands/profile/profile-env.d.ts +42 -0
- package/dist/commands/profile/profile-env.d.ts.map +1 -0
- package/dist/commands/profile/profile-env.js +56 -0
- package/dist/commands/profile/profile-env.js.map +1 -0
- package/dist/commands/profile/profile-group.descriptor.d.ts +1 -1
- package/dist/commands/profile/profile-group.descriptor.d.ts.map +1 -1
- package/dist/commands/profile/profile.create.descriptor.d.ts +1 -1
- package/dist/commands/profile/profile.create.descriptor.d.ts.map +1 -1
- package/dist/commands/profile/profile.create.descriptor.js +12 -1
- package/dist/commands/profile/profile.create.descriptor.js.map +1 -1
- package/dist/commands/profile/profile.create.impl.d.ts +2 -6
- package/dist/commands/profile/profile.create.impl.d.ts.map +1 -1
- package/dist/commands/profile/profile.create.impl.js +32 -9
- package/dist/commands/profile/profile.create.impl.js.map +1 -1
- package/dist/commands/profile/profile.delete.descriptor.d.ts +1 -1
- package/dist/commands/profile/profile.delete.descriptor.d.ts.map +1 -1
- package/dist/commands/profile/profile.delete.impl.d.ts +2 -7
- package/dist/commands/profile/profile.delete.impl.d.ts.map +1 -1
- package/dist/commands/profile/profile.delete.impl.js +33 -16
- package/dist/commands/profile/profile.delete.impl.js.map +1 -1
- package/dist/commands/profile/profile.environment.descriptor.d.ts +4 -0
- package/dist/commands/profile/profile.environment.descriptor.d.ts.map +1 -0
- package/dist/commands/profile/profile.environment.descriptor.js +26 -0
- package/dist/commands/profile/profile.environment.descriptor.js.map +1 -0
- package/dist/commands/profile/profile.environment.impl.d.ts +14 -0
- package/dist/commands/profile/profile.environment.impl.d.ts.map +1 -0
- package/dist/commands/profile/profile.environment.impl.js +33 -0
- package/dist/commands/profile/profile.environment.impl.js.map +1 -0
- package/dist/commands/profile/profile.info.descriptor.d.ts +1 -1
- package/dist/commands/profile/profile.info.descriptor.d.ts.map +1 -1
- package/dist/commands/profile/profile.info.descriptor.js +5 -1
- package/dist/commands/profile/profile.info.descriptor.js.map +1 -1
- package/dist/commands/profile/profile.info.impl.d.ts +5 -2
- package/dist/commands/profile/profile.info.impl.d.ts.map +1 -1
- package/dist/commands/profile/profile.info.impl.js +31 -14
- package/dist/commands/profile/profile.info.impl.js.map +1 -1
- package/dist/commands/profile/profile.list.descriptor.d.ts +1 -1
- package/dist/commands/profile/profile.list.descriptor.d.ts.map +1 -1
- package/dist/commands/profile/profile.list.descriptor.js +5 -1
- package/dist/commands/profile/profile.list.descriptor.js.map +1 -1
- package/dist/commands/profile/profile.list.impl.d.ts +17 -2
- package/dist/commands/profile/profile.list.impl.d.ts.map +1 -1
- package/dist/commands/profile/profile.list.impl.js +52 -25
- package/dist/commands/profile/profile.list.impl.js.map +1 -1
- package/dist/commands/profile/profile.use.descriptor.d.ts +1 -1
- package/dist/commands/profile/profile.use.descriptor.d.ts.map +1 -1
- package/dist/commands/profile/profile.use.impl.d.ts +2 -6
- package/dist/commands/profile/profile.use.impl.d.ts.map +1 -1
- package/dist/commands/profile/profile.use.impl.js +40 -10
- package/dist/commands/profile/profile.use.impl.js.map +1 -1
- package/dist/commands/runtime/codegen.command.descriptor.d.ts +26 -12
- package/dist/commands/runtime/codegen.command.descriptor.d.ts.map +1 -1
- package/dist/commands/runtime/codegen.command.descriptor.js +24 -6
- package/dist/commands/runtime/codegen.command.descriptor.js.map +1 -1
- package/dist/commands/runtime/codegen.command.impl.d.ts +15 -2
- package/dist/commands/runtime/codegen.command.impl.d.ts.map +1 -1
- package/dist/commands/runtime/codegen.command.impl.js +17 -30
- package/dist/commands/runtime/codegen.command.impl.js.map +1 -1
- package/dist/commands/runtime/codegen.d.ts +10 -14
- package/dist/commands/runtime/codegen.d.ts.map +1 -1
- package/dist/commands/runtime/codegen.declarations.d.ts +6 -0
- package/dist/commands/runtime/codegen.declarations.d.ts.map +1 -0
- package/dist/commands/runtime/codegen.declarations.js +6 -0
- package/dist/commands/runtime/codegen.declarations.js.map +1 -0
- package/dist/commands/runtime/codegen.js +85 -58
- package/dist/commands/runtime/codegen.js.map +1 -1
- package/dist/commands/runtime/export/markdown-document.d.ts +25 -0
- package/dist/commands/runtime/export/markdown-document.d.ts.map +1 -0
- package/dist/commands/runtime/export/markdown-document.js +38 -0
- package/dist/commands/runtime/export/markdown-document.js.map +1 -0
- package/dist/commands/runtime/export/markdown.d.ts +17 -0
- package/dist/commands/runtime/export/markdown.d.ts.map +1 -0
- package/dist/commands/runtime/export/markdown.js +141 -0
- package/dist/commands/runtime/export/markdown.js.map +1 -0
- package/dist/commands/runtime/export/read.d.ts +27 -0
- package/dist/commands/runtime/export/read.d.ts.map +1 -0
- package/dist/commands/runtime/export/read.js +128 -0
- package/dist/commands/runtime/export/read.js.map +1 -0
- package/dist/commands/runtime/export/reading-notes.d.ts +11 -0
- package/dist/commands/runtime/export/reading-notes.d.ts.map +1 -0
- package/dist/commands/runtime/export/reading-notes.js +45 -0
- package/dist/commands/runtime/export/reading-notes.js.map +1 -0
- package/dist/commands/runtime/export/register.d.ts +34 -0
- package/dist/commands/runtime/export/register.d.ts.map +1 -0
- package/dist/commands/runtime/export/register.js +57 -0
- package/dist/commands/runtime/export/register.js.map +1 -0
- package/dist/commands/runtime/export/schemas.d.ts +104 -0
- package/dist/commands/runtime/export/schemas.d.ts.map +1 -0
- package/dist/commands/runtime/export/schemas.js +38 -0
- package/dist/commands/runtime/export/schemas.js.map +1 -0
- package/dist/commands/runtime/export/write.d.ts +16 -0
- package/dist/commands/runtime/export/write.d.ts.map +1 -0
- package/dist/commands/runtime/export/write.js +36 -0
- package/dist/commands/runtime/export/write.js.map +1 -0
- package/dist/commands/runtime/export.command.impl.d.ts +18 -0
- package/dist/commands/runtime/export.command.impl.d.ts.map +1 -0
- package/dist/commands/runtime/export.command.impl.js +39 -0
- package/dist/commands/runtime/export.command.impl.js.map +1 -0
- package/dist/commands/runtime/export.d.ts +28 -0
- package/dist/commands/runtime/export.d.ts.map +1 -0
- package/dist/commands/runtime/export.descriptor.d.ts +55 -0
- package/dist/commands/runtime/export.descriptor.d.ts.map +1 -0
- package/dist/commands/runtime/export.descriptor.js +58 -0
- package/dist/commands/runtime/export.descriptor.js.map +1 -0
- package/dist/commands/runtime/export.js +28 -0
- package/dist/commands/runtime/export.js.map +1 -0
- package/dist/commands/runtime/index.d.ts +2 -2
- package/dist/commands/runtime/index.d.ts.map +1 -1
- package/dist/commands/runtime/index.js +3 -3
- package/dist/commands/runtime/index.js.map +1 -1
- package/dist/commands/runtime/plugin.d.ts +1 -1
- package/dist/commands/runtime/plugin.d.ts.map +1 -1
- package/dist/commands/runtime/plugin.js +1 -1
- package/dist/commands/runtime/plugin.js.map +1 -1
- package/dist/commands/runtime/runtime-group.descriptor.d.ts +1 -1
- package/dist/commands/runtime/runtime-group.descriptor.d.ts.map +1 -1
- package/dist/commands/schemas/output.d.ts +26 -0
- package/dist/commands/schemas/output.d.ts.map +1 -0
- package/dist/commands/schemas/output.js +14 -0
- package/dist/commands/schemas/output.js.map +1 -0
- package/dist/commands/schemas/profile-environment.d.ts +6 -0
- package/dist/commands/schemas/profile-environment.d.ts.map +1 -0
- package/dist/commands/schemas/profile-environment.js +3 -0
- package/dist/commands/schemas/profile-environment.js.map +1 -0
- package/dist/commands/schemas/profile-list.d.ts +22 -0
- package/dist/commands/schemas/profile-list.d.ts.map +1 -0
- package/dist/commands/schemas/profile-list.js +3 -0
- package/dist/commands/schemas/profile-list.js.map +1 -0
- package/dist/commands/skills/_skills.d.ts +98 -0
- package/dist/commands/skills/_skills.d.ts.map +1 -0
- package/dist/commands/skills/_skills.js +183 -0
- package/dist/commands/skills/_skills.js.map +1 -0
- package/dist/commands/skills/skills-group.descriptor.d.ts +4 -0
- package/dist/commands/skills/skills-group.descriptor.d.ts.map +1 -0
- package/dist/commands/skills/skills-group.descriptor.js +12 -0
- package/dist/commands/skills/skills-group.descriptor.js.map +1 -0
- package/dist/commands/skills/skills.install.descriptor.d.ts +4 -0
- package/dist/commands/skills/skills.install.descriptor.d.ts.map +1 -0
- package/dist/commands/skills/skills.install.descriptor.js +37 -0
- package/dist/commands/skills/skills.install.descriptor.js.map +1 -0
- package/dist/commands/skills/skills.install.impl.d.ts +12 -0
- package/dist/commands/skills/skills.install.impl.d.ts.map +1 -0
- package/dist/commands/skills/skills.install.impl.js +65 -0
- package/dist/commands/skills/skills.install.impl.js.map +1 -0
- package/dist/commands/skills/skills.list.descriptor.d.ts +4 -0
- package/dist/commands/skills/skills.list.descriptor.d.ts.map +1 -0
- package/dist/commands/skills/skills.list.descriptor.js +23 -0
- package/dist/commands/skills/skills.list.descriptor.js.map +1 -0
- package/dist/commands/skills/skills.list.impl.d.ts +11 -0
- package/dist/commands/skills/skills.list.impl.d.ts.map +1 -0
- package/dist/commands/skills/skills.list.impl.js +69 -0
- package/dist/commands/skills/skills.list.impl.js.map +1 -0
- package/dist/core/runtime/shared/context.d.ts +16 -16
- package/dist/core/runtime/shared/context.d.ts.map +1 -1
- package/dist/core/runtime/shared/context.js +20 -35
- package/dist/core/runtime/shared/context.js.map +1 -1
- package/dist/core/runtime/shared/options.d.ts +5 -19
- package/dist/core/runtime/shared/options.d.ts.map +1 -1
- package/dist/core/runtime/shared/options.js +87 -42
- package/dist/core/runtime/shared/options.js.map +1 -1
- package/dist/design-inventory.d.ts +23 -0
- package/dist/design-inventory.d.ts.map +1 -0
- package/dist/design-inventory.js +66 -0
- package/dist/design-inventory.js.map +1 -0
- package/dist/index.d.ts +12 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -25
- package/dist/index.js.map +1 -1
- package/dist/invocation/client.d.ts +20 -0
- package/dist/invocation/client.d.ts.map +1 -0
- package/dist/invocation/client.js +25 -0
- package/dist/invocation/client.js.map +1 -0
- package/dist/invocation/state.d.ts +10 -0
- package/dist/invocation/state.d.ts.map +1 -0
- package/dist/invocation/state.js +32 -0
- package/dist/invocation/state.js.map +1 -0
- package/dist/patterns/builtins/config-namespace-commands.d.ts +10 -0
- package/dist/patterns/builtins/config-namespace-commands.d.ts.map +1 -0
- package/dist/patterns/builtins/config-namespace-commands.js +132 -0
- package/dist/patterns/builtins/config-namespace-commands.js.map +1 -0
- package/dist/patterns/builtins/config-namespace-output.d.ts +9 -0
- package/dist/patterns/builtins/config-namespace-output.d.ts.map +1 -0
- package/dist/patterns/builtins/config-namespace-output.js +31 -0
- package/dist/patterns/builtins/config-namespace-output.js.map +1 -0
- package/dist/patterns/builtins/config-namespace.d.ts +23 -0
- package/dist/patterns/builtins/config-namespace.d.ts.map +1 -0
- package/dist/patterns/builtins/config-namespace.js +70 -0
- package/dist/patterns/builtins/config-namespace.js.map +1 -0
- package/dist/patterns/builtins/crud-commands.d.ts +11 -0
- package/dist/patterns/builtins/crud-commands.d.ts.map +1 -0
- package/dist/patterns/builtins/crud-commands.js +105 -0
- package/dist/patterns/builtins/crud-commands.js.map +1 -0
- package/dist/patterns/builtins/crud-output.d.ts +7 -0
- package/dist/patterns/builtins/crud-output.d.ts.map +1 -0
- package/dist/patterns/builtins/crud-output.js +21 -0
- package/dist/patterns/builtins/crud-output.js.map +1 -0
- package/dist/patterns/builtins/crud.d.ts +16 -0
- package/dist/patterns/builtins/crud.d.ts.map +1 -0
- package/dist/patterns/builtins/crud.js +38 -0
- package/dist/patterns/builtins/crud.js.map +1 -0
- package/dist/patterns/{log-viewer.d.ts → builtins/log-viewer.d.ts} +5 -5
- package/dist/patterns/builtins/log-viewer.d.ts.map +1 -0
- package/dist/patterns/{log-viewer.js → builtins/log-viewer.js} +31 -9
- package/dist/patterns/builtins/log-viewer.js.map +1 -0
- package/dist/patterns/builtins/output.d.ts +5 -0
- package/dist/patterns/builtins/output.d.ts.map +1 -0
- package/dist/patterns/builtins/output.js +25 -0
- package/dist/patterns/builtins/output.js.map +1 -0
- package/dist/patterns/{process-manager.d.ts → builtins/process-manager.d.ts} +9 -4
- package/dist/patterns/builtins/process-manager.d.ts.map +1 -0
- package/dist/patterns/{process-manager.js → builtins/process-manager.js} +46 -29
- package/dist/patterns/builtins/process-manager.js.map +1 -0
- package/dist/patterns/builtins/tool-wrapper.d.ts +18 -0
- package/dist/patterns/builtins/tool-wrapper.d.ts.map +1 -0
- package/dist/patterns/builtins/tool-wrapper.js +124 -0
- package/dist/patterns/builtins/tool-wrapper.js.map +1 -0
- package/dist/patterns/cli-value.d.ts +3 -0
- package/dist/patterns/cli-value.d.ts.map +1 -0
- package/dist/patterns/cli-value.js +42 -0
- package/dist/patterns/cli-value.js.map +1 -0
- package/dist/patterns/index.d.ts +5 -9
- package/dist/patterns/index.d.ts.map +1 -1
- package/dist/patterns/index.js +5 -9
- package/dist/patterns/index.js.map +1 -1
- package/dist/patterns/pattern.kinds.d.ts +30 -0
- package/dist/patterns/pattern.kinds.d.ts.map +1 -0
- package/dist/patterns/pattern.kinds.js +8 -0
- package/dist/patterns/pattern.kinds.js.map +1 -0
- package/dist/patterns/resolver.d.ts +11 -32
- package/dist/patterns/resolver.d.ts.map +1 -1
- package/dist/patterns/resolver.js +14 -45
- package/dist/patterns/resolver.js.map +1 -1
- package/dist/patterns/schemas.d.ts +9 -492
- package/dist/patterns/schemas.d.ts.map +1 -1
- package/dist/patterns/schemas.js +5 -94
- package/dist/patterns/schemas.js.map +1 -1
- package/dist/schemas/bootstrap.d.ts +242 -0
- package/dist/schemas/bootstrap.d.ts.map +1 -0
- package/dist/schemas/bootstrap.js +7 -0
- package/dist/schemas/bootstrap.js.map +1 -0
- package/dist/schemas/command-implementation.d.ts +34 -0
- package/dist/schemas/command-implementation.d.ts.map +1 -0
- package/dist/schemas/command-implementation.js +31 -0
- package/dist/schemas/command-implementation.js.map +1 -0
- package/dist/schemas/command-recommendations.d.ts +9 -0
- package/dist/schemas/command-recommendations.d.ts.map +1 -0
- package/dist/schemas/command-recommendations.js +14 -0
- package/dist/schemas/command-recommendations.js.map +1 -0
- package/dist/schemas/completion.d.ts +118 -0
- package/dist/schemas/completion.d.ts.map +1 -0
- package/dist/schemas/completion.js +63 -0
- package/dist/schemas/completion.js.map +1 -0
- package/dist/schemas/descriptors.d.ts +1 -129
- package/dist/schemas/descriptors.d.ts.map +1 -1
- package/dist/schemas/descriptors.js +1 -95
- package/dist/schemas/descriptors.js.map +1 -1
- package/dist/schemas/design-inventory.d.ts +20 -0
- package/dist/schemas/design-inventory.d.ts.map +1 -0
- package/dist/schemas/design-inventory.js +10 -0
- package/dist/schemas/design-inventory.js.map +1 -0
- package/dist/schemas/discovery.d.ts +17 -0
- package/dist/schemas/discovery.d.ts.map +1 -0
- package/dist/schemas/discovery.js +15 -0
- package/dist/schemas/discovery.js.map +1 -0
- package/dist/schemas/exit.d.ts +33 -0
- package/dist/schemas/exit.d.ts.map +1 -0
- package/dist/schemas/exit.js +20 -0
- package/dist/schemas/exit.js.map +1 -0
- package/dist/schemas/interactive-host.d.ts +10 -0
- package/dist/schemas/interactive-host.d.ts.map +1 -0
- package/dist/schemas/interactive-host.js +11 -0
- package/dist/schemas/interactive-host.js.map +1 -0
- package/dist/schemas/output-format.d.ts +61 -0
- package/dist/schemas/output-format.d.ts.map +1 -0
- package/dist/schemas/output-format.js +26 -0
- package/dist/schemas/output-format.js.map +1 -0
- package/dist/schemas/pattern-implementation.d.ts +1572 -0
- package/dist/schemas/pattern-implementation.d.ts.map +1 -0
- package/dist/schemas/pattern-implementation.js +12 -0
- package/dist/schemas/pattern-implementation.js.map +1 -0
- package/dist/schemas/pattern-input.d.ts +152 -0
- package/dist/schemas/pattern-input.d.ts.map +1 -0
- package/dist/schemas/pattern-input.js +194 -0
- package/dist/schemas/pattern-input.js.map +1 -0
- package/dist/schemas/pm-context.d.ts +17 -0
- package/dist/schemas/pm-context.d.ts.map +1 -0
- package/dist/schemas/pm-context.js +13 -0
- package/dist/schemas/pm-context.js.map +1 -0
- package/dist/schemas/prompts.d.ts +61 -0
- package/dist/schemas/prompts.d.ts.map +1 -0
- package/dist/schemas/prompts.js +43 -0
- package/dist/schemas/prompts.js.map +1 -0
- package/dist/schemas/runtime-codegen.d.ts +191 -0
- package/dist/schemas/runtime-codegen.d.ts.map +1 -0
- package/dist/schemas/runtime-codegen.js +83 -0
- package/dist/schemas/runtime-codegen.js.map +1 -0
- package/dist/schemas/surface.d.ts +33 -20
- package/dist/schemas/surface.d.ts.map +1 -1
- package/dist/schemas/surface.js +2 -1
- package/dist/schemas/surface.js.map +1 -1
- package/dist/schemas/terminal-input.d.ts +15 -0
- package/dist/schemas/terminal-input.d.ts.map +1 -0
- package/dist/schemas/terminal-input.js +13 -0
- package/dist/schemas/terminal-input.js.map +1 -0
- package/dist/schemas/types.d.ts +1 -201
- package/dist/schemas/types.d.ts.map +1 -1
- package/dist/support/cli-inventory.generated.d.ts +4 -0
- package/dist/support/cli-inventory.generated.d.ts.map +1 -0
- package/dist/support/cli-inventory.generated.js +31 -0
- package/dist/support/cli-inventory.generated.js.map +1 -0
- package/dist/support/logging/cli-startup.logger.descriptor.d.ts.map +1 -0
- package/dist/support/logging/cli-startup.logger.descriptor.js.map +1 -0
- package/dist/support/logging/logging.d.ts +8 -0
- package/dist/support/logging/logging.d.ts.map +1 -0
- package/dist/support/logging/logging.js +13 -0
- package/dist/support/logging/logging.js.map +1 -0
- package/dist/support/terminal-input.d.ts +11 -0
- package/dist/support/terminal-input.d.ts.map +1 -0
- package/dist/support/terminal-input.js +39 -0
- package/dist/support/terminal-input.js.map +1 -0
- package/dist/support/ui/context.descriptor.d.ts +35 -0
- package/dist/support/ui/context.descriptor.d.ts.map +1 -0
- package/dist/{ui.context.descriptor.js → support/ui/context.descriptor.js} +2 -2
- package/dist/support/ui/context.descriptor.js.map +1 -0
- package/dist/support/ui/format.client.d.ts +42 -0
- package/dist/support/ui/format.client.d.ts.map +1 -0
- package/dist/support/ui/format.client.js +92 -0
- package/dist/support/ui/format.client.js.map +1 -0
- package/dist/support/ui/format.kinds.d.ts +30 -0
- package/dist/support/ui/format.kinds.d.ts.map +1 -0
- package/dist/support/ui/format.kinds.js +8 -0
- package/dist/support/ui/format.kinds.js.map +1 -0
- package/dist/support/ui/format.plugin.d.ts +7 -0
- package/dist/support/ui/format.plugin.d.ts.map +1 -0
- package/dist/support/ui/format.plugin.js +23 -0
- package/dist/support/ui/format.plugin.js.map +1 -0
- package/dist/support/ui/formats.d.ts +4 -0
- package/dist/support/ui/formats.d.ts.map +1 -0
- package/dist/support/ui/formats.js +34 -0
- package/dist/support/ui/formats.js.map +1 -0
- package/dist/support/ui/prompts.d.ts +9 -0
- package/dist/support/ui/prompts.d.ts.map +1 -0
- package/dist/support/ui/prompts.js +99 -0
- package/dist/support/ui/prompts.js.map +1 -0
- package/dist/support/ui/schemas/types.d.ts +2 -0
- package/dist/support/ui/schemas/types.d.ts.map +1 -0
- package/dist/support/ui/schemas/types.js.map +1 -0
- package/dist/support/ui/schemas/ui-toolkit.d.ts +45 -0
- package/dist/support/ui/schemas/ui-toolkit.d.ts.map +1 -0
- package/dist/support/ui/schemas/ui-toolkit.js +2 -0
- package/dist/support/ui/schemas/ui-toolkit.js.map +1 -0
- package/dist/support/ui/showcase.d.ts +18 -0
- package/dist/support/ui/showcase.d.ts.map +1 -0
- package/dist/support/ui/showcase.js +101 -0
- package/dist/support/ui/showcase.js.map +1 -0
- package/dist/support/ui/table.d.ts +28 -0
- package/dist/support/ui/table.d.ts.map +1 -0
- package/dist/support/ui/table.js +74 -0
- package/dist/support/ui/table.js.map +1 -0
- package/dist/support/ui/toolkit.d.ts +56 -0
- package/dist/support/ui/toolkit.d.ts.map +1 -0
- package/dist/support/ui/toolkit.js +130 -0
- package/dist/support/ui/toolkit.js.map +1 -0
- package/dist/support/vibesdev/index.d.ts +2 -0
- package/dist/support/vibesdev/index.d.ts.map +1 -0
- package/dist/support/vibesdev/index.js +3 -0
- package/dist/support/vibesdev/index.js.map +1 -0
- package/dist/surface/CLISurface.d.ts +77 -3
- package/dist/surface/CLISurface.d.ts.map +1 -1
- package/dist/surface/CLISurface.js +642 -98
- package/dist/surface/CLISurface.js.map +1 -1
- package/dist/surface/argument-name.d.ts +14 -0
- package/dist/surface/argument-name.d.ts.map +1 -0
- package/dist/surface/argument-name.js +23 -0
- package/dist/surface/argument-name.js.map +1 -0
- package/dist/surface/attach-tui-action.d.ts +35 -9
- package/dist/surface/attach-tui-action.d.ts.map +1 -1
- package/dist/surface/attach-tui-action.js +50 -43
- package/dist/surface/attach-tui-action.js.map +1 -1
- package/dist/surface/build-context.d.ts +2 -2
- package/dist/surface/build-context.d.ts.map +1 -1
- package/dist/surface/build-context.js +26 -44
- package/dist/surface/build-context.js.map +1 -1
- package/dist/surface/command-group-policy.d.ts +2 -3
- package/dist/surface/command-group-policy.d.ts.map +1 -1
- package/dist/surface/command-group-policy.js +1 -11
- package/dist/surface/command-group-policy.js.map +1 -1
- package/dist/surface/command-implementation.d.ts +9 -0
- package/dist/surface/command-implementation.d.ts.map +1 -0
- package/dist/surface/command-implementation.js +19 -0
- package/dist/surface/command-implementation.js.map +1 -0
- package/dist/surface/command-options.d.ts +29 -0
- package/dist/surface/command-options.d.ts.map +1 -0
- package/dist/surface/command-options.js +57 -0
- package/dist/surface/command-options.js.map +1 -0
- package/dist/surface/commander-action.d.ts +25 -0
- package/dist/surface/commander-action.d.ts.map +1 -0
- package/dist/surface/commander-action.js +38 -0
- package/dist/surface/commander-action.js.map +1 -0
- package/dist/surface/discovery-cache.d.ts +3 -15
- package/dist/surface/discovery-cache.d.ts.map +1 -1
- package/dist/surface/discovery-cache.js +6 -33
- package/dist/surface/discovery-cache.js.map +1 -1
- package/dist/surface/exit.d.ts +10 -0
- package/dist/surface/exit.d.ts.map +1 -0
- package/dist/surface/exit.js +33 -0
- package/dist/surface/exit.js.map +1 -0
- package/dist/surface/failure-of.d.ts +9 -0
- package/dist/surface/failure-of.d.ts.map +1 -0
- package/dist/surface/failure-of.js +17 -0
- package/dist/surface/failure-of.js.map +1 -0
- package/dist/surface/failure-output.d.ts +50 -0
- package/dist/surface/failure-output.d.ts.map +1 -0
- package/dist/surface/failure-output.js +84 -0
- package/dist/surface/failure-output.js.map +1 -0
- package/dist/surface/failure-report.d.ts +78 -0
- package/dist/surface/failure-report.d.ts.map +1 -0
- package/dist/surface/failure-report.js +229 -0
- package/dist/surface/failure-report.js.map +1 -0
- package/dist/surface/group-fallback.d.ts +32 -0
- package/dist/surface/group-fallback.d.ts.map +1 -0
- package/dist/surface/group-fallback.js +78 -0
- package/dist/surface/group-fallback.js.map +1 -0
- package/dist/surface/index.d.ts +10 -0
- package/dist/surface/index.d.ts.map +1 -0
- package/dist/surface/index.js +8 -0
- package/dist/surface/index.js.map +1 -0
- package/dist/surface/inherited-options.d.ts +28 -0
- package/dist/surface/inherited-options.d.ts.map +1 -0
- package/dist/surface/inherited-options.js +108 -0
- package/dist/surface/inherited-options.js.map +1 -0
- package/dist/surface/interactive-gate.d.ts +41 -0
- package/dist/surface/interactive-gate.d.ts.map +1 -0
- package/dist/surface/interactive-gate.js +112 -0
- package/dist/surface/interactive-gate.js.map +1 -0
- package/dist/surface/invocation-actions.d.ts +40 -0
- package/dist/surface/invocation-actions.d.ts.map +1 -0
- package/dist/surface/invocation-actions.js +78 -0
- package/dist/surface/invocation-actions.js.map +1 -0
- package/dist/surface/invocation-effects.d.ts +11 -0
- package/dist/surface/invocation-effects.d.ts.map +1 -0
- package/dist/surface/invocation-effects.js +52 -0
- package/dist/surface/invocation-effects.js.map +1 -0
- package/dist/surface/invocation-lifecycle.d.ts +49 -0
- package/dist/surface/invocation-lifecycle.d.ts.map +1 -0
- package/dist/surface/invocation-lifecycle.js +127 -0
- package/dist/surface/invocation-lifecycle.js.map +1 -0
- package/dist/surface/output-format-request.d.ts +23 -0
- package/dist/surface/output-format-request.d.ts.map +1 -0
- package/dist/surface/output-format-request.js +116 -0
- package/dist/surface/output-format-request.js.map +1 -0
- package/dist/surface/pm-context.d.ts +5 -0
- package/dist/surface/pm-context.d.ts.map +1 -0
- package/dist/surface/pm-context.js +69 -0
- package/dist/surface/pm-context.js.map +1 -0
- package/dist/surface/register-commands.d.ts +24 -4
- package/dist/surface/register-commands.d.ts.map +1 -1
- package/dist/surface/register-commands.js +156 -63
- package/dist/surface/register-commands.js.map +1 -1
- package/dist/surface/register-groups.d.ts +4 -4
- package/dist/surface/register-groups.d.ts.map +1 -1
- package/dist/surface/register-groups.js +71 -9
- package/dist/surface/register-groups.js.map +1 -1
- package/dist/surface/schemas/CLISurface.d.ts +31 -0
- package/dist/surface/schemas/CLISurface.d.ts.map +1 -0
- package/dist/surface/schemas/CLISurface.js +2 -0
- package/dist/surface/schemas/CLISurface.js.map +1 -0
- package/dist/surface/schemas/command-implementation.d.ts +20 -0
- package/dist/surface/schemas/command-implementation.d.ts.map +1 -0
- package/dist/surface/schemas/command-implementation.js +2 -0
- package/dist/surface/schemas/command-implementation.js.map +1 -0
- package/dist/surface/schemas/interactive-gate.d.ts +29 -0
- package/dist/surface/schemas/interactive-gate.d.ts.map +1 -0
- package/dist/surface/schemas/interactive-gate.js +2 -0
- package/dist/surface/schemas/interactive-gate.js.map +1 -0
- package/package.json +273 -136
- package/bin/vibes.ts +0 -26
- package/dist/api/client/factory.d.ts +0 -29
- package/dist/api/client/factory.d.ts.map +0 -1
- package/dist/api/client/factory.js +0 -189
- package/dist/api/client/factory.js.map +0 -1
- package/dist/api/schemas/common.d.ts +0 -58
- package/dist/api/schemas/common.d.ts.map +0 -1
- package/dist/api/schemas/common.js +0 -48
- package/dist/api/schemas/common.js.map +0 -1
- package/dist/api/schemas/types.d.ts +0 -30
- package/dist/api/schemas/types.d.ts.map +0 -1
- package/dist/api/services/api.d.ts +0 -14
- package/dist/api/services/api.d.ts.map +0 -1
- package/dist/api/services/api.js +0 -110
- package/dist/api/services/api.js.map +0 -1
- package/dist/api/types.d.ts +0 -6
- package/dist/api/types.d.ts.map +0 -1
- package/dist/api/types.js +0 -5
- package/dist/api/types.js.map +0 -1
- package/dist/bin.d.ts +0 -28
- package/dist/bin.d.ts.map +0 -1
- package/dist/bin.js +0 -73
- package/dist/bin.js.map +0 -1
- package/dist/bootstrap.d.ts +0 -14
- package/dist/bootstrap.d.ts.map +0 -1
- package/dist/bootstrap.js +0 -14
- package/dist/bootstrap.js.map +0 -1
- package/dist/cli.plugin.d.ts +0 -20
- package/dist/cli.plugin.d.ts.map +0 -1
- package/dist/cli.plugin.js +0 -170
- package/dist/cli.plugin.js.map +0 -1
- package/dist/commands/runtime/_logging.d.ts +0 -11
- package/dist/commands/runtime/_logging.d.ts.map +0 -1
- package/dist/commands/runtime/_logging.js +0 -40
- package/dist/commands/runtime/_logging.js.map +0 -1
- package/dist/config.d.ts +0 -17
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/core/index.d.ts +0 -9
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -5
- package/dist/core/index.js.map +0 -1
- package/dist/core/namespace/hook.d.ts +0 -12
- package/dist/core/namespace/hook.d.ts.map +0 -1
- package/dist/core/namespace/hook.js +0 -15
- package/dist/core/namespace/hook.js.map +0 -1
- package/dist/core/namespace/index.d.ts +0 -18
- package/dist/core/namespace/index.d.ts.map +0 -1
- package/dist/core/namespace/index.js +0 -214
- package/dist/core/namespace/index.js.map +0 -1
- package/dist/core/namespace/schemas/index.d.ts +0 -25
- package/dist/core/namespace/schemas/index.d.ts.map +0 -1
- package/dist/core/namespace/schemas/index.js +0 -2
- package/dist/core/namespace/schemas/index.js.map +0 -1
- package/dist/core/plugins/types.d.ts +0 -81
- package/dist/core/plugins/types.d.ts.map +0 -1
- package/dist/core/plugins/types.js +0 -6
- package/dist/core/plugins/types.js.map +0 -1
- package/dist/core/runtime/context.d.ts +0 -25
- package/dist/core/runtime/context.d.ts.map +0 -1
- package/dist/core/runtime/context.js +0 -30
- package/dist/core/runtime/context.js.map +0 -1
- package/dist/core/runtime/hooks.d.ts +0 -12
- package/dist/core/runtime/hooks.d.ts.map +0 -1
- package/dist/core/runtime/hooks.js +0 -2
- package/dist/core/runtime/hooks.js.map +0 -1
- package/dist/core/schemas/manifest.d.ts +0 -24
- package/dist/core/schemas/manifest.d.ts.map +0 -1
- package/dist/core/schemas/manifest.js +0 -6
- package/dist/core/schemas/manifest.js.map +0 -1
- package/dist/core/schemas/types.d.ts +0 -7
- package/dist/core/schemas/types.d.ts.map +0 -1
- package/dist/core/schemas/types.js.map +0 -1
- package/dist/core/ui/interface.d.ts +0 -12
- package/dist/core/ui/interface.d.ts.map +0 -1
- package/dist/core/ui/interface.js +0 -6
- package/dist/core/ui/interface.js.map +0 -1
- package/dist/docs/cli.commands.docs.descriptor.d.ts +0 -4
- package/dist/docs/cli.commands.docs.descriptor.d.ts.map +0 -1
- package/dist/docs/cli.commands.docs.descriptor.js +0 -207
- package/dist/docs/cli.commands.docs.descriptor.js.map +0 -1
- package/dist/docs/cli.groups.docs.descriptor.d.ts +0 -4
- package/dist/docs/cli.groups.docs.descriptor.d.ts.map +0 -1
- package/dist/docs/cli.groups.docs.descriptor.js +0 -330
- package/dist/docs/cli.groups.docs.descriptor.js.map +0 -1
- package/dist/docs/cli.output.docs.descriptor.d.ts +0 -4
- package/dist/docs/cli.output.docs.descriptor.d.ts.map +0 -1
- package/dist/docs/cli.output.docs.descriptor.js +0 -442
- package/dist/docs/cli.output.docs.descriptor.js.map +0 -1
- package/dist/docs/types.d.ts +0 -19
- package/dist/docs/types.d.ts.map +0 -1
- package/dist/docs/types.js +0 -2
- package/dist/docs/types.js.map +0 -1
- package/dist/errors.d.ts +0 -74
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -113
- package/dist/errors.js.map +0 -1
- package/dist/logging/cli-startup.logger.descriptor.d.ts.map +0 -1
- package/dist/logging/cli-startup.logger.descriptor.js.map +0 -1
- package/dist/logging.d.ts +0 -4
- package/dist/logging.d.ts.map +0 -1
- package/dist/logging.js +0 -21
- package/dist/logging.js.map +0 -1
- package/dist/patterns/config-namespace.d.ts +0 -23
- package/dist/patterns/config-namespace.d.ts.map +0 -1
- package/dist/patterns/config-namespace.js +0 -218
- package/dist/patterns/config-namespace.js.map +0 -1
- package/dist/patterns/crud.d.ts +0 -23
- package/dist/patterns/crud.d.ts.map +0 -1
- package/dist/patterns/crud.js +0 -164
- package/dist/patterns/crud.js.map +0 -1
- package/dist/patterns/log-viewer.d.ts.map +0 -1
- package/dist/patterns/log-viewer.js.map +0 -1
- package/dist/patterns/pattern-types.d.ts +0 -21
- package/dist/patterns/pattern-types.d.ts.map +0 -1
- package/dist/patterns/pattern-types.js +0 -7
- package/dist/patterns/pattern-types.js.map +0 -1
- package/dist/patterns/process-manager.d.ts.map +0 -1
- package/dist/patterns/process-manager.js.map +0 -1
- package/dist/patterns/resolver.contracts.d.ts +0 -14
- package/dist/patterns/resolver.contracts.d.ts.map +0 -1
- package/dist/patterns/resolver.contracts.js +0 -9
- package/dist/patterns/resolver.contracts.js.map +0 -1
- package/dist/patterns/tool-wrapper.d.ts +0 -18
- package/dist/patterns/tool-wrapper.d.ts.map +0 -1
- package/dist/patterns/tool-wrapper.js +0 -130
- package/dist/patterns/tool-wrapper.js.map +0 -1
- package/dist/providers.d.ts +0 -105
- package/dist/providers.d.ts.map +0 -1
- package/dist/providers.js +0 -164
- package/dist/providers.js.map +0 -1
- package/dist/support/ui-toolkit.d.ts +0 -62
- package/dist/support/ui-toolkit.d.ts.map +0 -1
- package/dist/support/ui-toolkit.js +0 -172
- package/dist/support/ui-toolkit.js.map +0 -1
- package/dist/surface.d.ts +0 -9
- package/dist/surface.d.ts.map +0 -1
- package/dist/surface.js +0 -8
- package/dist/surface.js.map +0 -1
- package/dist/types.d.ts +0 -4
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/ui/schemas/types.d.ts +0 -2
- package/dist/ui/schemas/types.d.ts.map +0 -1
- package/dist/ui/schemas/types.js +0 -2
- package/dist/ui/schemas/types.js.map +0 -1
- package/dist/ui/toolkit/VibesUIToolkit.d.ts +0 -2
- package/dist/ui/toolkit/VibesUIToolkit.d.ts.map +0 -1
- package/dist/ui/toolkit/VibesUIToolkit.js +0 -2
- package/dist/ui/toolkit/VibesUIToolkit.js.map +0 -1
- package/dist/ui.context.descriptor.d.ts +0 -21
- package/dist/ui.context.descriptor.d.ts.map +0 -1
- package/dist/ui.context.descriptor.js.map +0 -1
- package/dist/utils/open.d.ts +0 -2
- package/dist/utils/open.d.ts.map +0 -1
- package/dist/utils/open.js +0 -30
- package/dist/utils/open.js.map +0 -1
- package/dist/version.d.ts +0 -2
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js +0 -2
- package/dist/version.js.map +0 -1
- package/src/api/client/factory.ts +0 -265
- package/src/api/schemas/common.ts +0 -50
- package/src/api/schemas/types.ts +0 -32
- package/src/api/services/api.ts +0 -129
- package/src/api/types.ts +0 -12
- package/src/bin.ts +0 -84
- package/src/bootstrap.ts +0 -19
- package/src/cli.plugin.d.ts +0 -19
- package/src/cli.plugin.ts +0 -202
- package/src/commands/completion/bash.ts +0 -68
- package/src/commands/completion/completion.descriptor.ts +0 -48
- package/src/commands/completion/completion.impl.ts +0 -188
- package/src/commands/completion/fig.ts +0 -78
- package/src/commands/completion/fish.ts +0 -52
- package/src/commands/completion/tree.ts +0 -115
- package/src/commands/completion/zsh-widget.ts +0 -39
- package/src/commands/completion/zsh.ts +0 -165
- package/src/commands/profile/_utils.ts +0 -72
- package/src/commands/profile/profile-group.descriptor.ts +0 -14
- package/src/commands/profile/profile.create.descriptor.ts +0 -24
- package/src/commands/profile/profile.create.impl.ts +0 -44
- package/src/commands/profile/profile.delete.descriptor.ts +0 -31
- package/src/commands/profile/profile.delete.impl.ts +0 -71
- package/src/commands/profile/profile.info.descriptor.ts +0 -25
- package/src/commands/profile/profile.info.impl.ts +0 -51
- package/src/commands/profile/profile.list.descriptor.ts +0 -18
- package/src/commands/profile/profile.list.impl.ts +0 -46
- package/src/commands/profile/profile.use.descriptor.ts +0 -25
- package/src/commands/profile/profile.use.impl.ts +0 -39
- package/src/commands/runtime/_logging.ts +0 -47
- package/src/commands/runtime/codegen.command.descriptor.ts +0 -18
- package/src/commands/runtime/codegen.command.impl.ts +0 -44
- package/src/commands/runtime/codegen.ts +0 -84
- package/src/commands/runtime/index.ts +0 -14
- package/src/commands/runtime/plugin.ts +0 -7
- package/src/commands/runtime/runtime-group.descriptor.ts +0 -12
- package/src/config.ts +0 -22
- package/src/core/index.ts +0 -9
- package/src/core/namespace/hook.ts +0 -25
- package/src/core/namespace/index.ts +0 -298
- package/src/core/namespace/schemas/index.ts +0 -25
- package/src/core/plugins/types.ts +0 -87
- package/src/core/runtime/context.ts +0 -50
- package/src/core/runtime/hooks.ts +0 -12
- package/src/core/runtime/shared/context.ts +0 -65
- package/src/core/runtime/shared/options.ts +0 -60
- package/src/core/schemas/manifest.ts +0 -26
- package/src/core/schemas/types.ts +0 -6
- package/src/core/ui/interface.ts +0 -12
- package/src/docs/cli.commands.docs.descriptor.ts +0 -210
- package/src/docs/cli.groups.docs.descriptor.ts +0 -333
- package/src/docs/cli.output.docs.descriptor.ts +0 -445
- package/src/docs/types.ts +0 -18
- package/src/errors.ts +0 -123
- package/src/index.ts +0 -76
- package/src/logging/cli-startup.logger.descriptor.ts +0 -16
- package/src/logging.ts +0 -35
- package/src/patterns/config-namespace.ts +0 -251
- package/src/patterns/crud.ts +0 -217
- package/src/patterns/index.ts +0 -24
- package/src/patterns/log-viewer.ts +0 -118
- package/src/patterns/pattern-types.ts +0 -22
- package/src/patterns/process-manager.ts +0 -180
- package/src/patterns/resolver.contracts.ts +0 -15
- package/src/patterns/resolver.ts +0 -86
- package/src/patterns/schemas.ts +0 -146
- package/src/patterns/tool-wrapper.ts +0 -165
- package/src/providers.ts +0 -282
- package/src/schemas/descriptors.d.ts +0 -119
- package/src/schemas/descriptors.ts +0 -136
- package/src/schemas/surface.ts +0 -52
- package/src/schemas/types.d.ts +0 -195
- package/src/schemas/types.ts +0 -225
- package/src/support/ui-toolkit.ts +0 -224
- package/src/surface/CLISurface.ts +0 -193
- package/src/surface/attach-tui-action.ts +0 -76
- package/src/surface/build-context.ts +0 -49
- package/src/surface/command-group-policy.ts +0 -52
- package/src/surface/discovery-cache.ts +0 -143
- package/src/surface/register-commands.ts +0 -266
- package/src/surface/register-groups.ts +0 -84
- package/src/surface.ts +0 -9
- package/src/types.ts +0 -3
- package/src/ui/schemas/types.ts +0 -1
- package/src/ui/toolkit/VibesUIToolkit.ts +0 -1
- package/src/ui.context.descriptor.ts +0 -13
- package/src/utils/open.ts +0 -36
- package/src/version.ts +0 -10
- /package/dist/{api → boot}/schemas/types.js +0 -0
- /package/dist/{logging → support/logging}/cli-startup.logger.descriptor.d.ts +0 -0
- /package/dist/{logging → support/logging}/cli-startup.logger.descriptor.js +0 -0
- /package/dist/{core → support/ui}/schemas/types.js +0 -0
|
@@ -0,0 +1,737 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Bootstrap
|
|
3
|
+
*
|
|
4
|
+
* Composition function for initializing the Vibes CLI application.
|
|
5
|
+
* Handles runtime initialization, plugin loading, and CLISurface setup.
|
|
6
|
+
*
|
|
7
|
+
* Public hosts import this factory from `@vibesdotdev/cli/bootstrap` or
|
|
8
|
+
* `@vibesdotdev/surface-cli`, which re-exports it. The executable belongs to
|
|
9
|
+
* cli-bin; this package supplies composition and the command surface.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { createVibesCliApp } from '@vibesdotdev/surface-cli';
|
|
14
|
+
*
|
|
15
|
+
* import type { VibesCliAppOptions } from '@vibesdotdev/cli/bootstrap';
|
|
16
|
+
*
|
|
17
|
+
* // The executable supplies its environment, host declaration, output and argv.
|
|
18
|
+
* export async function runHost({ environment, host, hostOutput, argv }: VibesCliAppOptions) {
|
|
19
|
+
* const app = await createVibesCliApp({ environment, host, hostOutput, argv });
|
|
20
|
+
* await app.cli.run([...argv]);
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
import { CapabilityError, CaughtFailureSchema, RuntimeHardwareSchema, RuntimePurposeSchema, VibesRuntime, bootstrapVibesRuntime, composeChildEnv, createRuntimePlugin, createContextDescriptor, formatPluginFailureDiagnostic, parseBuildSurface, readPluginConfig, registerBuildSurface, requireRuntimeCwd, runtimeStdioContextDescriptor, } from "@vibesdotdev/kernel";
|
|
25
|
+
import { shouldLoadTuiPluginGraph } from "./tui-plugin-policy.js";
|
|
26
|
+
import { Command, CommanderError, Option } from "commander";
|
|
27
|
+
import { getVibesClient } from "@vibesdotdev/kernel/client";
|
|
28
|
+
import { CLISurface } from "../surface/CLISurface.js";
|
|
29
|
+
import { CLIPluginConfigSchema } from "../schemas/command-recommendations.js";
|
|
30
|
+
import { readVibesVersion } from "../boot/version.js";
|
|
31
|
+
import { registerCliExternalUrlContext } from "../boot/external-url.js";
|
|
32
|
+
import { detectOutputFormat, hostArgv } from "../boot/providers.js";
|
|
33
|
+
import { commandWriters } from "../commands/output.js";
|
|
34
|
+
import { renderCliFailure } from "../surface/failure-report.js";
|
|
35
|
+
import { resolveCommandImplementation } from "../surface/command-implementation.js";
|
|
36
|
+
import * as z from "zod/v4";
|
|
37
|
+
function isCliEnvironmentFactory(value) {
|
|
38
|
+
return z.function().safeParse(value).success;
|
|
39
|
+
}
|
|
40
|
+
function writeEssentialPluginDiagnostic(output, input) {
|
|
41
|
+
output.write("stderr", `${formatPluginFailureDiagnostic(input)}\n`);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The hidden global flag a canonical help lookup child carries, so it never
|
|
45
|
+
* delegates again. It travels in argv, never the environment.
|
|
46
|
+
*/
|
|
47
|
+
export const CANONICAL_COMMAND_HELP_LOOKUP_FLAG = "--canonical-help-lookup";
|
|
48
|
+
/**
|
|
49
|
+
* Re-enter the declared CLI host once, bound to R (`--workspace-root <R>`),
|
|
50
|
+
* when the materialized scoped tree cannot resolve a requested help path.
|
|
51
|
+
*
|
|
52
|
+
* The child is the authority: it either renders the exact command help or its
|
|
53
|
+
* own materialized tree rejects the path. The marker prevents recursive
|
|
54
|
+
* delegation; the child is bound to R by `--workspace-root`, and its env is
|
|
55
|
+
* the kernel's host set only, so it composes R's own config (RC04: no config
|
|
56
|
+
* handoff exists to outrank it). Action execution never delegates: the
|
|
57
|
+
* selected project plugin graph retains custody.
|
|
58
|
+
*/
|
|
59
|
+
function createCanonicalCommandHelpDelegate(runtime, hostRoot, selfSpawnArgv, isLookupChild) {
|
|
60
|
+
if (isLookupChild) {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
return async (argv) => {
|
|
64
|
+
if (!hostRoot || !selfSpawnArgv?.length)
|
|
65
|
+
throw new CapabilityError('Canonical command help requires the runtime host\'s declared root and re-entry command.', 'UNAVAILABLE', { reason: 'cli-host-reentry-unavailable', retryable: false });
|
|
66
|
+
const [command, ...prefixArgs] = selfSpawnArgv;
|
|
67
|
+
if (!command)
|
|
68
|
+
throw new CapabilityError('Canonical command help has no declared re-entry command.', 'UNAVAILABLE', {
|
|
69
|
+
reason: 'cli-host-reentry-unavailable', retryable: false,
|
|
70
|
+
});
|
|
71
|
+
// The child runs through the host's own execution capability, with the
|
|
72
|
+
// kernel's host set (never the live env) and the lookup marker in argv. It
|
|
73
|
+
// is a help render: its output is relayed verbatim and its exit code is the answer.
|
|
74
|
+
const execution = await runtime
|
|
75
|
+
.query("runtime/execution")
|
|
76
|
+
.resolve();
|
|
77
|
+
// The child re-enters from this host's own working directory; a host
|
|
78
|
+
// without one cannot re-enter (`cwd-unavailable`).
|
|
79
|
+
const result = await execution.execute({
|
|
80
|
+
command,
|
|
81
|
+
args: [...prefixArgs, CANONICAL_COMMAND_HELP_LOOKUP_FLAG, "--workspace-root", hostRoot, ...argv.slice(2)],
|
|
82
|
+
cwd: requireRuntimeCwd(runtime),
|
|
83
|
+
env: composeChildEnv(runtime, {}),
|
|
84
|
+
envMode: "replace",
|
|
85
|
+
});
|
|
86
|
+
const { out, err } = await commandWriters(runtime);
|
|
87
|
+
if (result.stdout)
|
|
88
|
+
out(result.stdout);
|
|
89
|
+
if (result.stderr)
|
|
90
|
+
err(result.stderr);
|
|
91
|
+
return result.exitCode ?? 1;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/** Shared declarations for the actual command tree and pre-activation routing. */
|
|
95
|
+
export function registerGlobalOptions(program, options = {}) {
|
|
96
|
+
return registerHmrOptions(program
|
|
97
|
+
.addOption(new Option(CANONICAL_COMMAND_HELP_LOOKUP_FLAG, "Internal: this invocation is a canonical help lookup").hideHelp())
|
|
98
|
+
.option("--finite", "Do not start autonomous background work (does not bypass authority or isolate filesystem access)")
|
|
99
|
+
.option("-v, --verbose", "Enable verbose logging")
|
|
100
|
+
.option("-q, --quiet", "Suppress non-essential output (errors still surface on stderr)")
|
|
101
|
+
.option("--format <format>", "Output format id resolved from this runtime's registered formatters (commands may own --format)", options.format ?? "table")
|
|
102
|
+
.option("--json", "Shorthand for --format json (machine-readable output to stdout)")
|
|
103
|
+
.option("--no-color", "Disable ANSI color codes (also honors NO_COLOR env)")
|
|
104
|
+
.option("--non-interactive", "Never prompt; fail or pick safe defaults instead (autodetected from non-TTY pipes; override with VIBES_FORCE_INTERACTIVE=1)")
|
|
105
|
+
.option("--no-interactive", "Alias for --non-interactive")
|
|
106
|
+
.option("-y, --yes", "Assume \"yes\" to confirmation prompts (per-command CRUD)")
|
|
107
|
+
.option("--profile <name>", "Active vibes profile (overrides $VIBES_PROFILE for this invocation)")
|
|
108
|
+
.option("--workspace-root <dir>", "Bind this invocation to <dir> instead of the nearest workspace above the current directory"));
|
|
109
|
+
}
|
|
110
|
+
function parseRootInvocation(argv) {
|
|
111
|
+
const program = registerGlobalOptions(new Command().exitOverride().configureOutput({ writeErr: () => { } }));
|
|
112
|
+
try {
|
|
113
|
+
const { operands } = program.parseOptions(argv.slice(2));
|
|
114
|
+
return {
|
|
115
|
+
finite: program.opts().finite === true,
|
|
116
|
+
canonicalHelpLookup: program.opts().canonicalHelpLookup === true,
|
|
117
|
+
operands,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
if (!(error instanceof CommanderError))
|
|
122
|
+
throw error;
|
|
123
|
+
throw new CapabilityError(`The command line cannot be parsed: ${error.message}`, "INVALID_INPUT", {
|
|
124
|
+
reason: "argv-invalid",
|
|
125
|
+
details: { commanderCode: error.code },
|
|
126
|
+
cause: error,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Pre-parse `vibes tools run <tool> --purpose <p>` and return the purpose this
|
|
132
|
+
* host declares (rc02-rc03 C7). Like `--profile` and `--workspace-root`, it is
|
|
133
|
+
* read before any runtime exists: the declaration states it once, at boot, and
|
|
134
|
+
* nothing patches the scope afterwards. Only `tools run` declares a purpose
|
|
135
|
+
* this way; every other command declares `direct`. The command path comes from
|
|
136
|
+
* the global option declarations; the flag is read only before a `--`.
|
|
137
|
+
*
|
|
138
|
+
* An unknown purpose is `INVALID_INPUT` `scope-invalid`, the same refusal the
|
|
139
|
+
* command gives it; a blank or missing value declares none.
|
|
140
|
+
*/
|
|
141
|
+
export function readToolsRunPurposeFromArgv(argv) {
|
|
142
|
+
const [group, command] = parseRootInvocation(argv).operands;
|
|
143
|
+
if (group !== "tools" || command !== "run")
|
|
144
|
+
return undefined;
|
|
145
|
+
let value;
|
|
146
|
+
for (let i = 2; i < argv.length; i++) {
|
|
147
|
+
const token = argv[i];
|
|
148
|
+
if (token === "--")
|
|
149
|
+
break;
|
|
150
|
+
if (token === "--purpose") {
|
|
151
|
+
const next = argv[i + 1];
|
|
152
|
+
value = next && !next.startsWith("-") ? next : undefined;
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
if (token.startsWith("--purpose=")) {
|
|
156
|
+
value = token.slice("--purpose=".length);
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
const purpose = value?.trim();
|
|
161
|
+
if (!purpose)
|
|
162
|
+
return undefined;
|
|
163
|
+
const parsed = RuntimePurposeSchema.safeParse(purpose);
|
|
164
|
+
if (!parsed.success) {
|
|
165
|
+
throw new CapabilityError(`Unknown purpose '${purpose}'. Purposes: ${RuntimePurposeSchema.options.join(", ")}.`, "INVALID_INPUT", { reason: "scope-invalid", details: { purpose } });
|
|
166
|
+
}
|
|
167
|
+
return parsed.data;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Whether the global `--finite` flag was passed, parsed against the global
|
|
171
|
+
* declarations only (an option after `--` is not the flag). Every command,
|
|
172
|
+
* serve included, declares `--finite ? finite : persistent` from this, once,
|
|
173
|
+
* before boot (rc02-rc03 §2.3); nothing patches it afterwards.
|
|
174
|
+
*/
|
|
175
|
+
export function isFiniteInvocation(argv) {
|
|
176
|
+
return parseRootInvocation(argv).finite;
|
|
177
|
+
}
|
|
178
|
+
/** Whether this invocation is a canonical help lookup child ({@link CANONICAL_COMMAND_HELP_LOOKUP_FLAG}). */
|
|
179
|
+
export function isCanonicalHelpLookup(argv) {
|
|
180
|
+
return parseRootInvocation(argv).canonicalHelpLookup;
|
|
181
|
+
}
|
|
182
|
+
/** Where the consumer CLI runs; also the venue a host-credentials manifest is judged against. */
|
|
183
|
+
export const CLI_HOSTING = Object.freeze({ mode: "local", owner: "consumer", venue: "user-device" });
|
|
184
|
+
/** Where a serve host runs: the same machine, serving other processes over IPC (rc01 §2.4; N1). */
|
|
185
|
+
export const SERVE_HOSTING = Object.freeze({ mode: "local", owner: "consumer", venue: "ipc-worker" });
|
|
186
|
+
export function declareCliHostScope(input) {
|
|
187
|
+
// The CLI serves file tools on the workspace it bound for itself.
|
|
188
|
+
const workspace = { access: "write" };
|
|
189
|
+
if (input.workspaceRoot)
|
|
190
|
+
workspace.root = input.workspaceRoot;
|
|
191
|
+
// No `environmentTier`: kernel bootstrap binds it from the composition
|
|
192
|
+
// (`config['runtime.host'].environmentTier`: workspace layers over floor),
|
|
193
|
+
// never from the build flavor.
|
|
194
|
+
const qualifiers = {};
|
|
195
|
+
if (input.profile)
|
|
196
|
+
qualifiers.profile = input.profile;
|
|
197
|
+
if (input.hotReload)
|
|
198
|
+
qualifiers.hotReload = input.hotReload;
|
|
199
|
+
if (input.serve)
|
|
200
|
+
qualifiers.serve = input.serve.descriptorId;
|
|
201
|
+
return {
|
|
202
|
+
surface: input.serve?.surface ?? "cli",
|
|
203
|
+
hardware: input.hardware ?? "consumer",
|
|
204
|
+
purpose: input.serve?.purpose ?? input.purpose ?? "direct",
|
|
205
|
+
lifecycle: isFiniteInvocation(input.argv) ? "finite" : "persistent",
|
|
206
|
+
hosting: input.serve ? SERVE_HOSTING : CLI_HOSTING,
|
|
207
|
+
capabilities: input.serve
|
|
208
|
+
? { requestPrincipals: true, sharedHost: true }
|
|
209
|
+
: input.hostCredentials
|
|
210
|
+
? { hostCredentials: true }
|
|
211
|
+
: { interactiveSession: true },
|
|
212
|
+
workspace,
|
|
213
|
+
qualifiers,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* The hardware a shim-launched host was baked for, parsed against the
|
|
218
|
+
* runtime's hardware schema; absent when nothing was baked. A baked value the
|
|
219
|
+
* runtime does not know is refused typed here, at the boundary that read it.
|
|
220
|
+
*/
|
|
221
|
+
function bakedHardware(value) {
|
|
222
|
+
const text = value?.trim();
|
|
223
|
+
if (!text)
|
|
224
|
+
return undefined;
|
|
225
|
+
const parsed = RuntimeHardwareSchema.safeParse(text);
|
|
226
|
+
if (!parsed.success) {
|
|
227
|
+
throw new CapabilityError(`The shim baked an unknown runtime hardware '${text}'.`, "INVALID_INPUT", {
|
|
228
|
+
reason: "hardware-invalid",
|
|
229
|
+
retryable: false,
|
|
230
|
+
details: { hardware: text },
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
return parsed.data;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* The CLI host's own plugins, first in the floor: Logging's Config-free boot
|
|
237
|
+
* preparation, the CLI plugin (its kinds and providers), the build surface,
|
|
238
|
+
* the external-URL context, and the host's own consumer filesystem. The CLI
|
|
239
|
+
* surface emits its own diagnostics through Logging, and an emit on an
|
|
240
|
+
* unprepared Root refuses `logger-not-initialized`. No plane need select the
|
|
241
|
+
* `logging` plugin (a specialized, repair or serve host may not), so the floor
|
|
242
|
+
* prepares Logging on the console the host declares, by the same declared
|
|
243
|
+
* fact Logging's own plugin reads (C082a). A host that declares no console
|
|
244
|
+
* offers no diagnostics, and an emit there keeps the strict refusal. The
|
|
245
|
+
* home-write probe (and any consumer CLI filesystem need) reads
|
|
246
|
+
* `filesystem/adapter`; a workspace that declares its own plugin list without
|
|
247
|
+
* a consumer adapter (a cloud-only app checkout) must not take the host's
|
|
248
|
+
* writable home away, so the floor guarantees the Bun/Node adapter every CLI
|
|
249
|
+
* host runs on. First registration wins, so a workspace that composes the same
|
|
250
|
+
* plugins is unchanged.
|
|
251
|
+
*/
|
|
252
|
+
const CANONICAL_CLI_HOST_PLUGINS = new WeakSet();
|
|
253
|
+
export function isCanonicalCliHostPlugin(plugin) {
|
|
254
|
+
return CANONICAL_CLI_HOST_PLUGINS.has(plugin);
|
|
255
|
+
}
|
|
256
|
+
export function createCliHostPlugin(buildSurface) {
|
|
257
|
+
const plugin = createRuntimePlugin({
|
|
258
|
+
id: "cli.host",
|
|
259
|
+
name: "CLI host",
|
|
260
|
+
description: "The Vibes CLI host's own Logging boot preparation, plugin, build surface, consumer filesystem and external URL context.",
|
|
261
|
+
dependencies: ["context"],
|
|
262
|
+
async onRegister(runtime) {
|
|
263
|
+
registerBuildSurface(runtime, buildSurface);
|
|
264
|
+
if (runtime.hasContext(runtimeStdioContextDescriptor.id)) {
|
|
265
|
+
await runtime.registerPlugin((await import("@vibesdotdev/logging/contexts")).loggingBootstrapPlugin);
|
|
266
|
+
}
|
|
267
|
+
await runtime.registerPlugin((await import("../commands/cli.plugin.js")).default);
|
|
268
|
+
await runtime.registerPlugin((await import("@vibesdotdev/filesystem/plugin")).filesystemPlugin);
|
|
269
|
+
await runtime.registerPlugin((await import("@vibesdotdev/host-node/filesystem")).bunFileSystemAdapterPlugin);
|
|
270
|
+
const inputOwner = await import("@vibesdotdev/host-node/terminal-input");
|
|
271
|
+
await runtime.registerPlugin(inputOwner.nodeTerminalInputPlugin());
|
|
272
|
+
runtime.registerLoader("context", "cli/terminal-input", async () => ({
|
|
273
|
+
meta: { id: "cli/terminal-input", kind: "context", priority: -1 },
|
|
274
|
+
impl: { provide: async () => (await getVibesClient(inputOwner.nodeTerminalInputDescriptor.id, runtime)).input },
|
|
275
|
+
}), { constraint: { surfaces: ["cli"] }, priority: -1 });
|
|
276
|
+
registerCliExternalUrlContext(runtime);
|
|
277
|
+
},
|
|
278
|
+
});
|
|
279
|
+
CANONICAL_CLI_HOST_PLUGINS.add(plugin);
|
|
280
|
+
return plugin;
|
|
281
|
+
}
|
|
282
|
+
/** The original executable floor, retained as data for an opt-in execution owner. */
|
|
283
|
+
export const CLI_EXECUTION_COMPOSITION_CONTEXT_ID = "cli/execution-composition";
|
|
284
|
+
/**
|
|
285
|
+
* Create the Vibes CLI application: one boot through the entry
|
|
286
|
+
* (`bootstrapVibesRuntime`, rc02-rc03 §2.1), a workspace composition bound as
|
|
287
|
+
* the host's default runtime, deferred until a command is selected. Workspace
|
|
288
|
+
* binding is host-owned; root/nested config layering and embedded app exclusion
|
|
289
|
+
* remain kernel-owned. The CLI forwards the real cwd and selected loader.
|
|
290
|
+
*/
|
|
291
|
+
export async function createVibesCliApp(options) {
|
|
292
|
+
const buildSurface = options.buildSurface ?? parseBuildSurface(undefined);
|
|
293
|
+
const shimChannel = options.host?.shimChannel === true;
|
|
294
|
+
const verbose = options.verbose ?? false;
|
|
295
|
+
const floorPlugins = [
|
|
296
|
+
async () => createCliHostPlugin(buildSurface),
|
|
297
|
+
...(options.surfaceFloorPlugins ?? []),
|
|
298
|
+
...(options.hostPlugins ?? []),
|
|
299
|
+
];
|
|
300
|
+
const floor = options.hostConfig
|
|
301
|
+
? { plugins: floorPlugins, config: options.hostConfig }
|
|
302
|
+
: { plugins: floorPlugins };
|
|
303
|
+
const quietReport = {
|
|
304
|
+
warn: (message) => options.hostOutput.write("stderr", `${message}\n`),
|
|
305
|
+
error: (message) => options.hostOutput.write("stderr", `${message}\n`),
|
|
306
|
+
skipped: ({ plugin, error }) => {
|
|
307
|
+
writeEssentialPluginDiagnostic(options.hostOutput, { scope: "cli", action: "Skipped plugin", plugin, error });
|
|
308
|
+
// Under -v the skip also carries its cause, through the one failure
|
|
309
|
+
// renderer (cause chain, key redaction); the default line stays value-free.
|
|
310
|
+
if (verbose)
|
|
311
|
+
options.hostOutput.write("stderr", `${renderCliFailure(CaughtFailureSchema.parse(error), { verbose: true })}\n`);
|
|
312
|
+
},
|
|
313
|
+
};
|
|
314
|
+
const report = verbose
|
|
315
|
+
? { ...quietReport, info: (message) => options.hostOutput.write("stderr", `${message}\n`) }
|
|
316
|
+
: quietReport;
|
|
317
|
+
const interactiveComposition = {
|
|
318
|
+
kind: "workspace",
|
|
319
|
+
attestHostGraph: options.attestHostGraph,
|
|
320
|
+
floor,
|
|
321
|
+
global: options.globalPackagePlugins === true,
|
|
322
|
+
failurePolicy: options.pluginFailurePolicy ?? "report",
|
|
323
|
+
report,
|
|
324
|
+
};
|
|
325
|
+
// Headless boots omit exports whose package metadata declares the TUI surface.
|
|
326
|
+
// A host selection policy remains an additional filter for its own command graph.
|
|
327
|
+
const headlessOmitComposition = {
|
|
328
|
+
...interactiveComposition,
|
|
329
|
+
omitSurfaces: ['tui'],
|
|
330
|
+
};
|
|
331
|
+
const headlessComposition = options.headlessPluginSelectionPolicy === undefined
|
|
332
|
+
? headlessOmitComposition
|
|
333
|
+
: {
|
|
334
|
+
...headlessOmitComposition,
|
|
335
|
+
selectionPolicy: options.headlessPluginSelectionPolicy,
|
|
336
|
+
};
|
|
337
|
+
const composition = shouldLoadTuiPluginGraph(options.argv, {
|
|
338
|
+
attachedTerminal: options.attachedTerminal === true,
|
|
339
|
+
})
|
|
340
|
+
? interactiveComposition
|
|
341
|
+
: headlessComposition;
|
|
342
|
+
/**
|
|
343
|
+
* THE DECLARATION. The host states its scope once, per boot. The bearer
|
|
344
|
+
* capability comes from the environment's own capture: a live
|
|
345
|
+
* host-credentials manifest makes this a `hostCredentials` host.
|
|
346
|
+
*/
|
|
347
|
+
const createDefaultEnvironment = async (serve) => {
|
|
348
|
+
// A caller environment needs no Bun import, construction or native producer.
|
|
349
|
+
// Only the default executable host declares scope and spawn data from its native argv.
|
|
350
|
+
const argv = [...options.argv];
|
|
351
|
+
const profile = readProfileFromArgv(argv);
|
|
352
|
+
const hmr = readHmrFromArgv(argv);
|
|
353
|
+
const workspaceRoot = options.workspaceRoot ?? readWorkspaceRootFromArgv(argv);
|
|
354
|
+
const purpose = readToolsRunPurposeFromArgv(argv);
|
|
355
|
+
const environmentModule = await import("@vibesdotdev/host-bun");
|
|
356
|
+
const hostFacts = { profile, hmr };
|
|
357
|
+
if (options.version)
|
|
358
|
+
hostFacts.version = options.version;
|
|
359
|
+
const environmentOptions = {
|
|
360
|
+
nativeLaunch: { manifestPath: environmentModule.bunNativeLaunchManifestPath },
|
|
361
|
+
scope: (captured, host) => {
|
|
362
|
+
const input = {
|
|
363
|
+
argv,
|
|
364
|
+
buildSurface,
|
|
365
|
+
workspaceRoot,
|
|
366
|
+
profile,
|
|
367
|
+
hostCredentials: environmentModule.hasLiveHostCredentials(captured, CLI_HOSTING.venue, host),
|
|
368
|
+
hotReload: declaredHotReload(captured).hotReload,
|
|
369
|
+
};
|
|
370
|
+
if (purpose)
|
|
371
|
+
input.purpose = purpose;
|
|
372
|
+
// The baked hardware is a shim channel key; a host the shim did not
|
|
373
|
+
// launch declares its own.
|
|
374
|
+
const hardware = shimChannel ? bakedHardware(captured[environmentModule.SHIM_CHANNEL_KEYS.hardware]) : undefined;
|
|
375
|
+
if (hardware)
|
|
376
|
+
input.hardware = hardware;
|
|
377
|
+
if (serve)
|
|
378
|
+
input.serve = serve;
|
|
379
|
+
return declareCliHostScope(input);
|
|
380
|
+
},
|
|
381
|
+
host: declareCliHost(options.host, hostFacts),
|
|
382
|
+
};
|
|
383
|
+
return environmentModule.createRuntimeEnvironmentBunPlugin(profile ? { ...environmentOptions, paths: { profileName: profile } } : environmentOptions);
|
|
384
|
+
};
|
|
385
|
+
const environment = options.environment;
|
|
386
|
+
const boot = async (serve, transport) => {
|
|
387
|
+
const declared = isCliEnvironmentFactory(environment)
|
|
388
|
+
? await environment(serve === undefined ? undefined : Object.freeze({ ...serve }))
|
|
389
|
+
: environment ?? await createDefaultEnvironment(serve);
|
|
390
|
+
const booted = await bootstrapVibesRuntime({
|
|
391
|
+
environment: declared,
|
|
392
|
+
// A transport host composes the CLI floor, what the selected command's
|
|
393
|
+
// implementation declares it needs there, and the entry; nothing else.
|
|
394
|
+
composition: transport
|
|
395
|
+
? {
|
|
396
|
+
kind: "literal",
|
|
397
|
+
plugins: [
|
|
398
|
+
async () => createCliHostPlugin(buildSurface),
|
|
399
|
+
...transport.plugins.map((plugin) => async () => plugin),
|
|
400
|
+
async () => transport.entry,
|
|
401
|
+
],
|
|
402
|
+
}
|
|
403
|
+
: composition,
|
|
404
|
+
binding: "default",
|
|
405
|
+
// Validate the serving declaration before autonomous work can activate.
|
|
406
|
+
activation: "deferred",
|
|
407
|
+
});
|
|
408
|
+
try {
|
|
409
|
+
parseRootInvocation(hostArgv(booted));
|
|
410
|
+
if (serve) {
|
|
411
|
+
const scope = booted.declaredScope;
|
|
412
|
+
if (scope.surface !== serve.surface || scope.purpose !== serve.purpose ||
|
|
413
|
+
scope.hosting?.mode !== SERVE_HOSTING.mode || scope.hosting?.owner !== SERVE_HOSTING.owner ||
|
|
414
|
+
scope.hosting?.venue !== SERVE_HOSTING.venue || scope.qualifiers?.serve !== serve.descriptorId ||
|
|
415
|
+
scope.capabilities?.requestPrincipals !== true || scope.capabilities?.sharedHost !== true ||
|
|
416
|
+
scope.capabilities?.interactiveSession === true || scope.capabilities?.hostCredentials === true) {
|
|
417
|
+
throw new CapabilityError("The caller environment does not declare the selected serving host.", "CONFLICT", {
|
|
418
|
+
reason: "cli-serve-scope-mismatch", details: { descriptorId: serve.descriptorId },
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
if (!serve.deferActivation)
|
|
422
|
+
await booted.activatePlugins();
|
|
423
|
+
}
|
|
424
|
+
return booted;
|
|
425
|
+
}
|
|
426
|
+
catch (error) {
|
|
427
|
+
try {
|
|
428
|
+
await booted.dispose();
|
|
429
|
+
}
|
|
430
|
+
catch (disposeError) {
|
|
431
|
+
throw new AggregateError([error, disposeError], "CLI host admission and cleanup both failed", { cause: error });
|
|
432
|
+
}
|
|
433
|
+
throw error;
|
|
434
|
+
}
|
|
435
|
+
};
|
|
436
|
+
const runtime = await boot();
|
|
437
|
+
const program = new Command()
|
|
438
|
+
.name("vibes")
|
|
439
|
+
.description("Vibes Developer CLI")
|
|
440
|
+
.version(options.version ?? readVibesVersion(runtime))
|
|
441
|
+
.exitOverride();
|
|
442
|
+
registerGlobalOptions(program, options);
|
|
443
|
+
program
|
|
444
|
+
.addHelpText("after", [
|
|
445
|
+
"",
|
|
446
|
+
"Get started:",
|
|
447
|
+
" vibes profile --help Manage isolated profiles",
|
|
448
|
+
" vibes runtime --help Inspect runtime commands",
|
|
449
|
+
" vibes completion zsh Generate shell completion",
|
|
450
|
+
].join("\n"));
|
|
451
|
+
const strict = options.strict === true;
|
|
452
|
+
// `--json` / `--format json` are GLOBAL flags that every command reading
|
|
453
|
+
// `cli/output-format` is documented to honour. Detect from argv when the
|
|
454
|
+
// embedding host did not pin a format.
|
|
455
|
+
const hostIdentity = runtime.localEnvironment.hostIdentity?.();
|
|
456
|
+
const surfaceOptions = {
|
|
457
|
+
verbose,
|
|
458
|
+
format: options.format ?? detectOutputFormat(hostArgv(runtime)),
|
|
459
|
+
includeInternal: options.includeInternal ?? false,
|
|
460
|
+
enablePatterns: true,
|
|
461
|
+
strictCommandGroups: strict,
|
|
462
|
+
strictGroupParents: strict,
|
|
463
|
+
canonicalCommandHelp: createCanonicalCommandHelpDelegate(runtime, hostIdentity?.hostRoot ?? null, runtime.localEnvironment.selfSpawnArgv?.() ?? null, isCanonicalHelpLookup(hostArgv(runtime))),
|
|
464
|
+
rootFallbackGroups: options.rootFallbackGroups,
|
|
465
|
+
hostOutput: options.hostOutput,
|
|
466
|
+
onBeforeAutoExit: options.onBeforeAutoExit,
|
|
467
|
+
// The serve transition (rc02-rc03 §2.3): dispose the un-activated CLI
|
|
468
|
+
// runtime, then boot the serve host through the same entry. Nothing was
|
|
469
|
+
// resolved against the CLI runtime during command selection, and any read
|
|
470
|
+
// of it after disposal throws `runtime-unbootstrapped`.
|
|
471
|
+
serveTransition: async ({ descriptorId, serve }) => {
|
|
472
|
+
let transport;
|
|
473
|
+
if (serve.composition === "transport") {
|
|
474
|
+
const descriptor = runtime.query("cli/command").withId(descriptorId).descriptors()[0];
|
|
475
|
+
const selected = await resolveCommandImplementation(runtime, descriptorId);
|
|
476
|
+
if (!descriptor || selected.kind !== "implemented") {
|
|
477
|
+
throw new CapabilityError("The transport entry has no admitted command registration.", "UNAVAILABLE", {
|
|
478
|
+
reason: "cli-transport-entry-unavailable", details: { descriptorId },
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
const executionCompositionPlugin = createRuntimePlugin({
|
|
482
|
+
id: "cli.transport-entry",
|
|
483
|
+
dependencies: ["cli"],
|
|
484
|
+
descriptors: selected.transportEntry ? [] : [descriptor],
|
|
485
|
+
onRegister(current) {
|
|
486
|
+
if (!selected.transportEntry) {
|
|
487
|
+
current.registerLoader("cli/command", descriptorId, async () => ({ impl: { execute: selected.execute } }));
|
|
488
|
+
}
|
|
489
|
+
const executionFloor = options.hostConfig
|
|
490
|
+
? { plugins: [...(options.hostPlugins ?? [])], config: options.hostConfig }
|
|
491
|
+
: { plugins: [...(options.hostPlugins ?? [])] };
|
|
492
|
+
const executionComposition = {
|
|
493
|
+
floor: executionFloor, global: composition.global, failurePolicy: composition.failurePolicy,
|
|
494
|
+
};
|
|
495
|
+
current.registerDescriptor("context", createContextDescriptor({
|
|
496
|
+
id: CLI_EXECUTION_COMPOSITION_CONTEXT_ID,
|
|
497
|
+
description: "Executable-owned composition declaration for its separate execution host.",
|
|
498
|
+
}));
|
|
499
|
+
current.registerLoader("context", CLI_EXECUTION_COMPOSITION_CONTEXT_ID, async () => ({ impl: executionComposition }));
|
|
500
|
+
},
|
|
501
|
+
});
|
|
502
|
+
transport = selected.transportEntry
|
|
503
|
+
? {
|
|
504
|
+
entry: selected.transportEntry,
|
|
505
|
+
plugins: [...selected.transportPlugins, executionCompositionPlugin],
|
|
506
|
+
}
|
|
507
|
+
: {
|
|
508
|
+
entry: executionCompositionPlugin,
|
|
509
|
+
plugins: selected.transportPlugins,
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
await runtime.dispose();
|
|
513
|
+
return boot({ descriptorId, surface: serve.surface, purpose: serve.purpose,
|
|
514
|
+
deferActivation: serve.deferActivation, composition: serve.composition }, transport);
|
|
515
|
+
},
|
|
516
|
+
};
|
|
517
|
+
let cliConfig;
|
|
518
|
+
try {
|
|
519
|
+
cliConfig = await readPluginConfig(runtime, 'cli', CLIPluginConfigSchema);
|
|
520
|
+
}
|
|
521
|
+
catch (error) {
|
|
522
|
+
try {
|
|
523
|
+
await runtime.dispose();
|
|
524
|
+
}
|
|
525
|
+
catch (disposeError) {
|
|
526
|
+
throw new AggregateError([error, disposeError], 'CLI config admission and cleanup both failed', { cause: error });
|
|
527
|
+
}
|
|
528
|
+
throw error;
|
|
529
|
+
}
|
|
530
|
+
const recommendations = cliConfig?.commandRecommendations ?? options.commandRecommendations;
|
|
531
|
+
if (recommendations !== undefined) {
|
|
532
|
+
surfaceOptions.commandRecommendations = recommendations;
|
|
533
|
+
}
|
|
534
|
+
// INVARIANT for plugin authors: activation is EFFECT-GATED, so a plugin must
|
|
535
|
+
// never register command descriptors (or command groups) from `onActivate`
|
|
536
|
+
// — do it in `onRegister`. Command visibility must not depend on what the
|
|
537
|
+
// selected action is allowed to write.
|
|
538
|
+
// The caller's bearer is not bound into the runtime environment or
|
|
539
|
+
// `process.env`. Readers call auth's `resolveCallerBearer` with their runtime.
|
|
540
|
+
const cli = new CLISurface(runtime, program, surfaceOptions);
|
|
541
|
+
cli.addInvocationPreparer({
|
|
542
|
+
prepare: async (info) => {
|
|
543
|
+
const current = cli.activeRuntime;
|
|
544
|
+
// `--hmr` owes a notice to every invocation that will not arm hot reload.
|
|
545
|
+
// A launcher is judged by the serve command it spawns.
|
|
546
|
+
if (readHmrFromArgv(hostArgv(current)) === "1") {
|
|
547
|
+
const serve = info.effects.serve ?? launchedServe(current, info.effects.launches);
|
|
548
|
+
const notice = describeHmrInvocation(serve, info.commandPath);
|
|
549
|
+
if (notice)
|
|
550
|
+
(await commandWriters(current)).err(notice);
|
|
551
|
+
}
|
|
552
|
+
if (!info.effects.homeWrite || current.activated || info.effects.serve?.deferActivation)
|
|
553
|
+
return;
|
|
554
|
+
// Logger outputs can resolve config/environment, which in turn reads the
|
|
555
|
+
// persisted environment selection. Keep that storage path behind the
|
|
556
|
+
// selected action's declared home-write effect.
|
|
557
|
+
const { initializeLoggers } = await import("@vibesdotdev/logging");
|
|
558
|
+
await initializeLoggers(current);
|
|
559
|
+
// Boot phases 5–7: activation registers deferred runtime clients used by
|
|
560
|
+
// executable commands. Metadata-only actions consume descriptors and do
|
|
561
|
+
// not need implementations or their storage-backed activation work.
|
|
562
|
+
await current.activatePlugins();
|
|
563
|
+
},
|
|
564
|
+
});
|
|
565
|
+
return { runtime, program, cli };
|
|
566
|
+
}
|
|
567
|
+
/** The serve effect of the command a launcher spawns, read from its descriptor. */
|
|
568
|
+
function launchedServe(runtime, launches) {
|
|
569
|
+
if (!launches || !runtime.hasKind("cli/command"))
|
|
570
|
+
return undefined;
|
|
571
|
+
const descriptor = runtime.query("cli/command").withId(launches).descriptors()[0];
|
|
572
|
+
return descriptor?.effects?.serve;
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* What will the selected command actually do with `--hmr`? A serve command
|
|
576
|
+
* that declares `hotReload` arms it; any other serve command is a long-running
|
|
577
|
+
* service that does not; everything else exits before a source can change.
|
|
578
|
+
* The command's descriptor (`effects.serve`) is the one source; no argv table.
|
|
579
|
+
*/
|
|
580
|
+
export function classifyHmrInvocation(serve) {
|
|
581
|
+
if (!serve)
|
|
582
|
+
return "one-shot";
|
|
583
|
+
return serve.hotReload ? "arms" : "service-without-hmr";
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* The one stderr line `--hmr` owes this invocation, or null when the selected
|
|
587
|
+
* command arms hot reload and will report for itself.
|
|
588
|
+
*/
|
|
589
|
+
export function describeHmrInvocation(serve, commandPath) {
|
|
590
|
+
const kind = classifyHmrInvocation(serve);
|
|
591
|
+
if (kind === "arms")
|
|
592
|
+
return null;
|
|
593
|
+
if (kind === "service-without-hmr") {
|
|
594
|
+
const command = commandPath.slice(1).join(" ");
|
|
595
|
+
return (`--hmr: \`vibes ${command}\` is a long-running service, but this surface does not arm plugin hot reload yet ` +
|
|
596
|
+
"— nothing in this process watches source, and nothing will reload. " +
|
|
597
|
+
"The surface that does is `vibes --hmr runtime daemon serve`.\n");
|
|
598
|
+
}
|
|
599
|
+
// A one-shot process exits before any source can change, so arming a watcher
|
|
600
|
+
// would be theatre; silently ignoring the flag would be worse, because the
|
|
601
|
+
// operator would believe a fleet was hot.
|
|
602
|
+
return ("--hmr: no long-running service in this invocation; nothing to hot-reload. " +
|
|
603
|
+
"Pass it to a service command (e.g. `vibes --hmr runtime daemon serve`) to arm plugin hot reload.\n");
|
|
604
|
+
}
|
|
605
|
+
const HMR_ON_FLAG = "--hmr";
|
|
606
|
+
const HMR_OFF_FLAG = "--no-hmr";
|
|
607
|
+
/**
|
|
608
|
+
* Pre-parse `--hmr` / `--no-hmr` and return what it asks for: `"1"` (on), `"0"`
|
|
609
|
+
* (an explicit veto) or `undefined` (absent).
|
|
610
|
+
*
|
|
611
|
+
* A boolean sibling of {@link readProfileFromArgv}, and for the same reason:
|
|
612
|
+
* the flag has to be readable BEFORE Commander parses anything, because
|
|
613
|
+
* `startHostHotReload` runs inside the service command that Commander is on its
|
|
614
|
+
* way to dispatching.
|
|
615
|
+
*
|
|
616
|
+
* `--no-hmr` explicitly turns it OFF (`"0"`), so a child of a `--hmr` parent
|
|
617
|
+
* can opt out without unsetting an inherited variable.
|
|
618
|
+
*
|
|
619
|
+
* ONLY the two spellings Commander declares (see {@link registerHmrOptions}).
|
|
620
|
+
* `--hmr=true` / `--hmr=false` were once honoured here, but Commander rejects
|
|
621
|
+
* `--flag=value` on a boolean option, so those two spellings used to set the
|
|
622
|
+
* flag and then die with `unknown option` before any command ran.
|
|
623
|
+
*
|
|
624
|
+
* LAST FLAG WINS, because that is what Commander does. An earlier revision
|
|
625
|
+
* returned on the FIRST recognized token, so `vibes --hmr --no-hmr runtime
|
|
626
|
+
* daemon serve` came out on while `program.parse` of the same argv yielded
|
|
627
|
+
* `{hmr: false}` — and since nothing reads Commander's `hmr` option, the
|
|
628
|
+
* pre-parser is the half that decides.
|
|
629
|
+
*/
|
|
630
|
+
export function readHmrFromArgv(argv) {
|
|
631
|
+
let last = null;
|
|
632
|
+
for (let i = 2; i < argv.length; i++) {
|
|
633
|
+
const token = argv[i];
|
|
634
|
+
if (token === "--")
|
|
635
|
+
break;
|
|
636
|
+
if (token === HMR_ON_FLAG || token === HMR_OFF_FLAG)
|
|
637
|
+
last = token;
|
|
638
|
+
}
|
|
639
|
+
if (last === HMR_ON_FLAG)
|
|
640
|
+
return "1";
|
|
641
|
+
if (last === HMR_OFF_FLAG)
|
|
642
|
+
return "0";
|
|
643
|
+
return undefined;
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* Every argv spelling {@link readHmrFromArgv} honours. Exported so the test
|
|
647
|
+
* can assert that the shipping Commander declaration accepts each of them —
|
|
648
|
+
* the pre-parser and the parser drifting apart is invisible to a unit test that
|
|
649
|
+
* only calls the pure function.
|
|
650
|
+
*/
|
|
651
|
+
export const HMR_ARGV_SPELLINGS = [HMR_ON_FLAG, HMR_OFF_FLAG];
|
|
652
|
+
/**
|
|
653
|
+
* Declare the `--hmr` / `--no-hmr` global pair on a program.
|
|
654
|
+
*
|
|
655
|
+
* ONE declaration site, called by `createVibesCliApp` and exercised directly by
|
|
656
|
+
* `hmr-global-flag.test.ts`, so "the pre-parser accepts it" and "the shipping
|
|
657
|
+
* command accepts it" cannot diverge without turning a test red.
|
|
658
|
+
*/
|
|
659
|
+
export function registerHmrOptions(program) {
|
|
660
|
+
return program
|
|
661
|
+
.option(HMR_ON_FLAG, "Hot-reload linked plugins when their source changes (long-running service commands; one-shot commands acknowledge and continue). Refused on cloud hardware.")
|
|
662
|
+
.option(HMR_OFF_FLAG, "Disable plugin hot reload for this invocation, overriding an inherited VIBES_HMR=1 (e.g. a service spawned by a `--hmr` parent).");
|
|
663
|
+
}
|
|
664
|
+
/** The channel key `--hmr` / `--no-hmr` publish to this host's readers and its children. */
|
|
665
|
+
export const HMR_CHANNEL_KEY = "VIBES_HMR";
|
|
666
|
+
/** Declare hot reload from the canonical channel captured by this host. */
|
|
667
|
+
export function declaredHotReload(captured) {
|
|
668
|
+
const hmr = captured[HMR_CHANNEL_KEY]?.trim();
|
|
669
|
+
if (hmr === "0")
|
|
670
|
+
return { hotReload: "off" };
|
|
671
|
+
if (hmr === "1")
|
|
672
|
+
return { hotReload: "on" };
|
|
673
|
+
return {};
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* Pre-parse `--profile <name>` / `--profile=<name>` and return the name.
|
|
677
|
+
*
|
|
678
|
+
* Commander parses the same flag later when `program.parseAsync` runs, but
|
|
679
|
+
* by then `loadConfig` and `registerCorePlugins` have already chosen
|
|
680
|
+
* profile-scoped paths, so the host needs it before the environment exists.
|
|
681
|
+
*
|
|
682
|
+
* Strict: ignores anything that looks like another flag (`--profile --foo`).
|
|
683
|
+
*/
|
|
684
|
+
export function readProfileFromArgv(argv) {
|
|
685
|
+
for (let i = 2; i < argv.length; i++) {
|
|
686
|
+
const token = argv[i];
|
|
687
|
+
if (token === "--")
|
|
688
|
+
break;
|
|
689
|
+
if (token === "--profile") {
|
|
690
|
+
const next = argv[i + 1];
|
|
691
|
+
return next && !next.startsWith("-") ? next : undefined;
|
|
692
|
+
}
|
|
693
|
+
if (token.startsWith("--profile=")) {
|
|
694
|
+
const value = token.slice("--profile=".length);
|
|
695
|
+
return value || undefined;
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
return undefined;
|
|
699
|
+
}
|
|
700
|
+
export function declareCliHost(host, facts) {
|
|
701
|
+
const spawnEnv = { ...host?.spawnEnv };
|
|
702
|
+
if (facts.profile)
|
|
703
|
+
spawnEnv.VIBES_PROFILE = facts.profile;
|
|
704
|
+
if (facts.hmr)
|
|
705
|
+
spawnEnv[HMR_CHANNEL_KEY] = facts.hmr;
|
|
706
|
+
return facts.version ? { ...host, spawnEnv, version: facts.version } : { ...host, spawnEnv };
|
|
707
|
+
}
|
|
708
|
+
/**
|
|
709
|
+
* Pre-parse `--workspace-root <dir>` / `--workspace-root=<dir>` and return the
|
|
710
|
+
* directory as written. Commander parses the same global flag later, but the
|
|
711
|
+
* environment captures its workspace binding when it is constructed, before
|
|
712
|
+
* any command exists. The kernel's workspace-root policy resolves a relative
|
|
713
|
+
* directory against the environment's captured cwd and validates it: an
|
|
714
|
+
* existing directory that is neither `/` nor home, else `INVALID_INPUT`
|
|
715
|
+
* `workspace-invalid`.
|
|
716
|
+
*/
|
|
717
|
+
export function readWorkspaceRootFromArgv(argv) {
|
|
718
|
+
for (let i = 2; i < argv.length; i++) {
|
|
719
|
+
const token = argv[i];
|
|
720
|
+
if (token === "--")
|
|
721
|
+
break;
|
|
722
|
+
let value;
|
|
723
|
+
if (token === "--workspace-root") {
|
|
724
|
+
const next = argv[i + 1];
|
|
725
|
+
value = next && !next.startsWith("-") ? next : undefined;
|
|
726
|
+
}
|
|
727
|
+
else if (token.startsWith("--workspace-root=")) {
|
|
728
|
+
value = token.slice("--workspace-root=".length);
|
|
729
|
+
}
|
|
730
|
+
else {
|
|
731
|
+
continue;
|
|
732
|
+
}
|
|
733
|
+
return value?.trim() || undefined;
|
|
734
|
+
}
|
|
735
|
+
return undefined;
|
|
736
|
+
}
|
|
737
|
+
//# sourceMappingURL=bootstrap.js.map
|