@vibesdotdev/cli 0.0.2 → 1.0.0-rc.2
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
|
@@ -3,14 +3,17 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates commands for viewing logs.
|
|
5
5
|
*/
|
|
6
|
+
import { Option } from 'commander';
|
|
7
|
+
import { LogViewerSearchInputSchema, LogViewerTailInputSchema, parsePatternInput } from "../../schemas/pattern-input.js";
|
|
6
8
|
export class LogViewerPatternImpl {
|
|
7
9
|
runtime;
|
|
8
10
|
constructor(runtime) {
|
|
9
11
|
this.runtime = runtime;
|
|
10
12
|
}
|
|
11
13
|
async register(descriptor, parent, context) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
// `parent` IS the group command register-groups already created from
|
|
15
|
+
// this same descriptor — attach subcommands directly (see crud.ts).
|
|
16
|
+
const groupCmd = parent;
|
|
14
17
|
this.registerTail(groupCmd, descriptor, context);
|
|
15
18
|
this.registerSearch(groupCmd, descriptor, context);
|
|
16
19
|
this.registerLevels(groupCmd, descriptor, context);
|
|
@@ -31,17 +34,29 @@ export class LogViewerPatternImpl {
|
|
|
31
34
|
cmd.option(f.flag, f.description);
|
|
32
35
|
}
|
|
33
36
|
}
|
|
34
|
-
cmd.action(async (
|
|
37
|
+
cmd.action(async (options) => {
|
|
38
|
+
const filters = Object.fromEntries((cfg.filters ?? []).flatMap((filter) => {
|
|
39
|
+
const value = options[new Option(filter.flag).attributeName()];
|
|
40
|
+
return value === undefined ? [] : [[filter.name, value]];
|
|
41
|
+
}));
|
|
42
|
+
const input = parsePatternInput(LogViewerTailInputSchema, {
|
|
43
|
+
lines: options.lines,
|
|
44
|
+
levels: options.level,
|
|
45
|
+
follow: options.follow,
|
|
46
|
+
filters
|
|
47
|
+
});
|
|
35
48
|
const pm = ctx.pm;
|
|
36
49
|
if (!pm?.tailLogs) {
|
|
37
50
|
ctx.ui?.warn('Log streaming not available');
|
|
38
51
|
return;
|
|
39
52
|
}
|
|
40
|
-
|
|
41
|
-
lines:
|
|
42
|
-
levels:
|
|
43
|
-
follow:
|
|
44
|
-
|
|
53
|
+
const request = {
|
|
54
|
+
lines: input.lines,
|
|
55
|
+
levels: input.levels,
|
|
56
|
+
follow: input.follow,
|
|
57
|
+
filters: input.filters
|
|
58
|
+
};
|
|
59
|
+
await pm.tailLogs(descriptor.target.id, request);
|
|
45
60
|
});
|
|
46
61
|
}
|
|
47
62
|
registerSearch(parent, descriptor, ctx) {
|
|
@@ -52,7 +67,14 @@ export class LogViewerPatternImpl {
|
|
|
52
67
|
.option('-l, --level <levels...>', 'Filter by level')
|
|
53
68
|
.option('--since <time>', 'Since time')
|
|
54
69
|
.option('--until <time>', 'Until time')
|
|
55
|
-
.action(async (pattern,
|
|
70
|
+
.action(async (pattern, options) => {
|
|
71
|
+
parsePatternInput(LogViewerSearchInputSchema, {
|
|
72
|
+
pattern,
|
|
73
|
+
lines: options.lines,
|
|
74
|
+
levels: options.level,
|
|
75
|
+
since: options.since,
|
|
76
|
+
until: options.until
|
|
77
|
+
});
|
|
56
78
|
ctx.ui?.warn('Log search not yet implemented');
|
|
57
79
|
});
|
|
58
80
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-viewer.js","sourceRoot":"","sources":["../../../src/patterns/builtins/log-viewer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAgB,MAAM,WAAW,CAAC;AAKjD,OAAO,EACN,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,MAAM,gCAAgC,CAAC;AAExC,MAAM,OAAO,oBAAoB;IACZ;IAApB,YAAoB,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;IAAG,CAAC;IAE7C,KAAK,CAAC,QAAQ,CACb,UAAuC,EACvC,MAAe,EACf,OAAuB;QAEvB,qEAAqE;QACrE,oEAAoE;QACpE,MAAM,QAAQ,GAAG,MAAM,CAAC;QAExB,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,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,0BAA0B,EAAE;gBAC7C,OAAO;gBACP,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,MAAM,EAAE,OAAO,CAAC,KAAK;gBACrB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,KAAK,EAAE,OAAO,CAAC,KAAK;aACpB,CAAC,CAAC;YACH,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,gCAAgC,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,cAAc,CACrB,MAAe,EACf,UAAuC,EACvC,GAAmB;QAEnB,MAAM;aACJ,OAAO,CAAC,QAAQ,CAAC;aACjB,WAAW,CAAC,2BAA2B,CAAC;aACxC,MAAM,CAAC,GAAG,EAAE;YACZ,MAAM,MAAM,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YACpE,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAC,aAAa,IAAI,EAAE,CAAC;YAE1D,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,uBAAuB,CAAC,CAAC;YACtC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;gBAC5B,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC5D,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,KAAK,GAAG,MAAM,EAAE,CAAC,CAAC;YACvC,CAAC;QACF,CAAC,CAAC,CAAC;IACL,CAAC;CACD"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type OutputFormatterRenderOptions } from '../../schemas/output-format.ts';
|
|
2
|
+
import type { JsonValue } from '@vibesdotdev/kernel/schemas/json';
|
|
3
|
+
import type { CommandContext } from '../../schemas/surface.ts';
|
|
4
|
+
export declare function renderPatternOutput(data: JsonValue | undefined, format: string, context: CommandContext, options?: OutputFormatterRenderOptions): Promise<void>;
|
|
5
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../src/patterns/builtins/output.ts"],"names":[],"mappings":"AAYA,OAAO,EAAsC,KAAK,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AACvH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG/D,wBAAsB,mBAAmB,CACxC,IAAI,EAAE,SAAS,GAAG,SAAS,EAC3B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE,4BAA4B,GACpC,OAAO,CAAC,IAAI,CAAC,CAUf"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pattern output is rendered by the runtime formatter owner, then delivered by
|
|
3
|
+
* the command's output surface.
|
|
4
|
+
*
|
|
5
|
+
* `cli/output-formats` selects the formatter for the requested identifier,
|
|
6
|
+
* registered replacement included, and admits it before any byte is produced: an
|
|
7
|
+
* unavailable identifier refuses `NOT_FOUND / cli-output-format-unavailable`
|
|
8
|
+
* rather than silently rendering another format. The render is awaited, so
|
|
9
|
+
* nothing is left writing (or rejecting) after the action reports success.
|
|
10
|
+
*/
|
|
11
|
+
import { getVibesClient } from '@vibesdotdev/kernel/client';
|
|
12
|
+
import { OutputFormatterRenderOptionsSchema } from "../../schemas/output-format.js";
|
|
13
|
+
import { writeStdoutLine } from "../../commands/output.js";
|
|
14
|
+
export async function renderPatternOutput(data, format, context, options) {
|
|
15
|
+
const renderOptions = OutputFormatterRenderOptionsSchema.parse(options ?? {});
|
|
16
|
+
const formats = await getVibesClient('cli-output-formats', context.runtime);
|
|
17
|
+
if (context.ui) {
|
|
18
|
+
await formats.selected(format);
|
|
19
|
+
await context.ui.render(data, { format, ...renderOptions });
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const rendered = await formats.render(data, format, renderOptions);
|
|
23
|
+
await writeStdoutLine(context.runtime, rendered);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../../src/patterns/builtins/output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,kCAAkC,EAAqC,MAAM,gCAAgC,CAAC;AAGvH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACxC,IAA2B,EAC3B,MAAc,EACd,OAAuB,EACvB,OAAsC;IAEtC,MAAM,aAAa,GAAG,kCAAkC,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;IAC9E,MAAM,OAAO,GAAG,MAAM,cAAc,CAAkB,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7F,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;QAChB,MAAM,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC/B,MAAM,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,GAAG,aAAa,EAAE,CAAC,CAAC;QAC5D,OAAO;IACR,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;IACnE,MAAM,eAAe,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* Generates start/stop/restart/status commands for a daemon.
|
|
5
5
|
*/
|
|
6
6
|
import type { Command } from 'commander';
|
|
7
|
-
import type { VibesRuntime } from '@vibesdotdev/
|
|
8
|
-
import type { CLIProcessManagerGroupDescriptor } from '
|
|
9
|
-
import type { PatternImplementation } from '
|
|
10
|
-
import type { CommandContext } from '
|
|
7
|
+
import type { VibesRuntime } from '@vibesdotdev/kernel/api/runtime';
|
|
8
|
+
import type { CLIProcessManagerGroupDescriptor } from '../schemas.ts';
|
|
9
|
+
import type { PatternImplementation } from '../../schemas/pattern-implementation.ts';
|
|
10
|
+
import type { CommandContext } from '../../schemas/surface.ts';
|
|
11
11
|
export declare class ProcessManagerPatternImpl implements PatternImplementation<CLIProcessManagerGroupDescriptor> {
|
|
12
12
|
private runtime;
|
|
13
13
|
constructor(runtime: VibesRuntime);
|
|
@@ -16,6 +16,11 @@ export declare class ProcessManagerPatternImpl implements PatternImplementation<
|
|
|
16
16
|
private registerStop;
|
|
17
17
|
private registerRestart;
|
|
18
18
|
private registerStatus;
|
|
19
|
+
/**
|
|
20
|
+
* Record the health probe's answer on `status`: `ok: false` until the probe
|
|
21
|
+
* answers; a probe that cannot be made is reported through the runtime logger.
|
|
22
|
+
*/
|
|
23
|
+
private probeHealth;
|
|
19
24
|
private registerLogs;
|
|
20
25
|
}
|
|
21
26
|
//# sourceMappingURL=process-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-manager.d.ts","sourceRoot":"","sources":["../../../src/patterns/builtins/process-manager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAErF,OAAO,KAAK,EAAoB,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAUjF,qBAAa,yBAA0B,YAAW,qBAAqB,CAAC,gCAAgC,CAAC;IAC5F,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,YAAY;IAEnC,QAAQ,CACb,UAAU,EAAE,gCAAgC,EAC5C,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,cAAc,GACrB,OAAO,CAAC,IAAI,CAAC;IAehB,OAAO,CAAC,aAAa;IA6BrB,OAAO,CAAC,YAAY;IA0BpB,OAAO,CAAC,eAAe;IAsBvB,OAAO,CAAC,cAAc;IAiCtB;;;OAGG;YACW,WAAW;IAWzB,OAAO,CAAC,YAAY;CAwBpB"}
|
|
@@ -3,15 +3,19 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates start/stop/restart/status commands for a daemon.
|
|
5
5
|
*/
|
|
6
|
+
import { getLogger } from '@vibesdotdev/logging';
|
|
7
|
+
import { ProcessManagerLogsInputSchema, ProcessManagerRestartInputSchema, ProcessManagerStartInputSchema, ProcessManagerStatusInputSchema, ProcessManagerStopInputSchema, parsePatternInput } from "../../schemas/pattern-input.js";
|
|
6
8
|
export class ProcessManagerPatternImpl {
|
|
7
9
|
runtime;
|
|
8
10
|
constructor(runtime) {
|
|
9
11
|
this.runtime = runtime;
|
|
10
12
|
}
|
|
11
13
|
async register(descriptor, parent, context) {
|
|
12
|
-
const {
|
|
14
|
+
const { processManager } = descriptor;
|
|
13
15
|
const cmds = processManager.commands ?? {};
|
|
14
|
-
|
|
16
|
+
// `parent` IS the group command register-groups already created from
|
|
17
|
+
// this same descriptor — attach subcommands directly (see crud.ts).
|
|
18
|
+
const groupCmd = parent;
|
|
15
19
|
if (cmds.start !== false)
|
|
16
20
|
this.registerStart(groupCmd, descriptor, context);
|
|
17
21
|
if (cmds.stop !== false)
|
|
@@ -29,20 +33,20 @@ export class ProcessManagerPatternImpl {
|
|
|
29
33
|
.description(`Start ${d.name}`)
|
|
30
34
|
.option('--detach', 'Run in background', true)
|
|
31
35
|
.option('--env <vars...>', 'Environment variables')
|
|
32
|
-
.action(async (
|
|
36
|
+
.action(async (options) => {
|
|
37
|
+
const input = parsePatternInput(ProcessManagerStartInputSchema, {
|
|
38
|
+
detach: options.detach,
|
|
39
|
+
env: options.env
|
|
40
|
+
});
|
|
33
41
|
const pm = ctx.pm;
|
|
34
42
|
if (!pm?.start) {
|
|
35
43
|
ctx.ui?.error('Process manager not available');
|
|
36
44
|
return;
|
|
37
45
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
env[k] = v.join('=');
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
await pm.start(d.processManager.processId, { detach: opts.detach, env });
|
|
46
|
+
await pm.start(d.processManager.processId, {
|
|
47
|
+
detach: input.detach,
|
|
48
|
+
env: input.env ?? {}
|
|
49
|
+
});
|
|
46
50
|
ctx.ui?.success(`Started ${d.name}`);
|
|
47
51
|
});
|
|
48
52
|
}
|
|
@@ -52,15 +56,16 @@ export class ProcessManagerPatternImpl {
|
|
|
52
56
|
.description(`Stop ${d.name}`)
|
|
53
57
|
.option('--force', 'Force stop')
|
|
54
58
|
.option('--timeout <s>', 'Timeout', '10')
|
|
55
|
-
.action(async (
|
|
59
|
+
.action(async (options) => {
|
|
60
|
+
const input = parsePatternInput(ProcessManagerStopInputSchema, options);
|
|
56
61
|
const pm = ctx.pm;
|
|
57
62
|
if (!pm?.stop) {
|
|
58
63
|
ctx.ui?.error('Process manager not available');
|
|
59
64
|
return;
|
|
60
65
|
}
|
|
61
66
|
await pm.stop(d.processManager.processId, {
|
|
62
|
-
force:
|
|
63
|
-
timeout:
|
|
67
|
+
force: input.force,
|
|
68
|
+
timeout: input.timeoutMilliseconds
|
|
64
69
|
});
|
|
65
70
|
ctx.ui?.success(`Stopped ${d.name}`);
|
|
66
71
|
});
|
|
@@ -70,13 +75,14 @@ export class ProcessManagerPatternImpl {
|
|
|
70
75
|
.command('restart')
|
|
71
76
|
.description(`Restart ${d.name}`)
|
|
72
77
|
.option('--force', 'Force restart')
|
|
73
|
-
.action(async (
|
|
78
|
+
.action(async (options) => {
|
|
79
|
+
const input = parsePatternInput(ProcessManagerRestartInputSchema, options);
|
|
74
80
|
const pm = ctx.pm;
|
|
75
81
|
if (!pm?.restart) {
|
|
76
82
|
ctx.ui?.error('Process manager not available');
|
|
77
83
|
return;
|
|
78
84
|
}
|
|
79
|
-
await pm.restart(d.processManager.processId, { force:
|
|
85
|
+
await pm.restart(d.processManager.processId, { force: input.force });
|
|
80
86
|
ctx.ui?.success(`Restarted ${d.name}`);
|
|
81
87
|
});
|
|
82
88
|
}
|
|
@@ -86,23 +92,18 @@ export class ProcessManagerPatternImpl {
|
|
|
86
92
|
.description(`Show status of ${d.name}`)
|
|
87
93
|
.option('-f, --format <format>', 'Output format', 'table')
|
|
88
94
|
.option('--health', 'Include health check')
|
|
89
|
-
.action(async (
|
|
95
|
+
.action(async (options) => {
|
|
96
|
+
const input = parsePatternInput(ProcessManagerStatusInputSchema, options);
|
|
90
97
|
const pm = ctx.pm;
|
|
91
98
|
if (!pm?.status) {
|
|
92
99
|
ctx.ui?.error('Process manager not available');
|
|
93
100
|
return;
|
|
94
101
|
}
|
|
95
102
|
const status = await pm.status(d.processManager.processId);
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
const res = await fetch(d.processManager.healthCheck.url);
|
|
99
|
-
status.health = { ok: res.ok, code: res.status };
|
|
100
|
-
}
|
|
101
|
-
catch (e) {
|
|
102
|
-
status.health = { ok: false, error: String(e) };
|
|
103
|
-
}
|
|
103
|
+
if (input.health && d.processManager.healthCheck?.url) {
|
|
104
|
+
await this.probeHealth(d.processManager.healthCheck.url, status);
|
|
104
105
|
}
|
|
105
|
-
if (
|
|
106
|
+
if (input.format === 'json') {
|
|
106
107
|
ctx.ui?.json(status);
|
|
107
108
|
}
|
|
108
109
|
else {
|
|
@@ -112,21 +113,37 @@ export class ProcessManagerPatternImpl {
|
|
|
112
113
|
}
|
|
113
114
|
});
|
|
114
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Record the health probe's answer on `status`: `ok: false` until the probe
|
|
118
|
+
* answers; a probe that cannot be made is reported through the runtime logger.
|
|
119
|
+
*/
|
|
120
|
+
async probeHealth(url, status) {
|
|
121
|
+
const log = getLogger('cli.patterns', this.runtime);
|
|
122
|
+
status.health = { ok: false };
|
|
123
|
+
try {
|
|
124
|
+
const res = await fetch(url);
|
|
125
|
+
status.health = { ok: res.ok, code: res.status };
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
log.warn('Health check request failed', { error });
|
|
129
|
+
}
|
|
130
|
+
}
|
|
115
131
|
registerLogs(parent, d, ctx) {
|
|
116
132
|
parent
|
|
117
133
|
.command('logs')
|
|
118
134
|
.description(`View logs for ${d.name}`)
|
|
119
135
|
.option('-n, --lines <n>', 'Lines', '50')
|
|
120
136
|
.option('-f, --follow', 'Follow')
|
|
121
|
-
.action(async (
|
|
137
|
+
.action(async (options) => {
|
|
138
|
+
const input = parsePatternInput(ProcessManagerLogsInputSchema, options);
|
|
122
139
|
const pm = ctx.pm;
|
|
123
140
|
if (!pm?.logs) {
|
|
124
141
|
ctx.ui?.error('Process manager not available');
|
|
125
142
|
return;
|
|
126
143
|
}
|
|
127
144
|
await pm.logs(d.processManager.processId, {
|
|
128
|
-
lines:
|
|
129
|
-
follow:
|
|
145
|
+
lines: input.lines,
|
|
146
|
+
follow: input.follow
|
|
130
147
|
});
|
|
131
148
|
});
|
|
132
149
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-manager.js","sourceRoot":"","sources":["../../../src/patterns/builtins/process-manager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EACN,6BAA6B,EAC7B,gCAAgC,EAChC,8BAA8B,EAC9B,+BAA+B,EAC/B,6BAA6B,EAC7B,iBAAiB,EACjB,MAAM,gCAAgC,CAAC;AAExC,MAAM,OAAO,yBAAyB;IACjB;IAApB,YAAoB,OAAqB;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GAAG,CAAC,CAAC;YAC7B,MAAM,CAAC,MAAM,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC;QAClD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,GAAG,CAAC,IAAI,CAAC,6BAA6B,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QACpD,CAAC;IACF,CAAC;IAEO,YAAY,CACnB,MAAe,EACf,CAAmC,EACnC,GAAmB;QAEnB,MAAM;aACJ,OAAO,CAAC,MAAM,CAAC;aACf,WAAW,CAAC,iBAAiB,CAAC,CAAC,IAAI,EAAE,CAAC;aACtC,MAAM,CAAC,iBAAiB,EAAE,OAAO,EAAE,IAAI,CAAC;aACxC,MAAM,CAAC,cAAc,EAAE,QAAQ,CAAC;aAChC,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;YACzB,MAAM,KAAK,GAAG,iBAAiB,CAAC,6BAA6B,EAAE,OAAO,CAAC,CAAC;YACxE,MAAM,EAAE,GAAG,GAAG,CAAC,EAAE,CAAC;YAClB,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC;gBACf,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,+BAA+B,CAAC,CAAC;gBAC/C,OAAO;YACR,CAAC;YAED,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,SAAS,EAAE;gBACzC,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,MAAM,EAAE,KAAK,CAAC,MAAM;aACpB,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Wrapper Pattern Implementation
|
|
3
|
+
*
|
|
4
|
+
* Wraps a tools/tool as a CLI command.
|
|
5
|
+
*/
|
|
6
|
+
import { type Command } from 'commander';
|
|
7
|
+
import type { VibesRuntime } from '@vibesdotdev/kernel/api/runtime';
|
|
8
|
+
import type { CLIToolWrapperCommandDescriptor } from '../schemas.ts';
|
|
9
|
+
import type { PatternImplementation } from '../../schemas/pattern-implementation.ts';
|
|
10
|
+
import type { CommandContext } from '../../schemas/surface.ts';
|
|
11
|
+
export declare class ToolWrapperPatternImpl implements PatternImplementation<CLIToolWrapperCommandDescriptor> {
|
|
12
|
+
private runtime;
|
|
13
|
+
constructor(runtime: VibesRuntime);
|
|
14
|
+
register(descriptor: CLIToolWrapperCommandDescriptor, parent: Command, context: CommandContext): Promise<Command>;
|
|
15
|
+
private extractOptionName;
|
|
16
|
+
private output;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=tool-wrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-wrapper.d.ts","sourceRoot":"","sources":["../../../src/patterns/builtins/tool-wrapper.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAU,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAIjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAGpE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAyB/D,qBAAa,sBAAuB,YAAW,qBAAqB,CAAC,+BAA+B,CAAC;IACxF,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,YAAY;IAEnC,QAAQ,CACb,UAAU,EAAE,+BAA+B,EAC3C,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,cAAc,GACrB,OAAO,CAAC,OAAO,CAAC;IAsGnB,OAAO,CAAC,iBAAiB;YAQX,MAAM;CASpB"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Wrapper Pattern Implementation
|
|
3
|
+
*
|
|
4
|
+
* Wraps a tools/tool as a CLI command.
|
|
5
|
+
*/
|
|
6
|
+
import { Option } from 'commander';
|
|
7
|
+
import * as z from 'zod/v4';
|
|
8
|
+
import { CapabilityError } from '@vibesdotdev/kernel';
|
|
9
|
+
import { getVibesClient } from '@vibesdotdev/kernel/client';
|
|
10
|
+
import { JsonObjectSchema } from '@vibesdotdev/kernel/schemas/json';
|
|
11
|
+
import { parsePatternInput, ToolOutputSchema, ToolWrapperToolInputSchema, ToolWrapperCommandInputSchema } from "../../schemas/pattern-input.js";
|
|
12
|
+
import { renderPatternOutput } from "./output.js";
|
|
13
|
+
/** The tools runtime client that runs a tool through the canonical invocation path. */
|
|
14
|
+
function isSystemToolInvoker(client) {
|
|
15
|
+
return 'invokeSystemTool' in client && typeof client.invokeSystemTool === 'function';
|
|
16
|
+
}
|
|
17
|
+
export class ToolWrapperPatternImpl {
|
|
18
|
+
runtime;
|
|
19
|
+
constructor(runtime) {
|
|
20
|
+
this.runtime = runtime;
|
|
21
|
+
}
|
|
22
|
+
async register(descriptor, parent, context) {
|
|
23
|
+
const { target, toolWrapper, name } = descriptor;
|
|
24
|
+
// Get tool descriptor for metadata
|
|
25
|
+
const toolDesc = this.runtime.query(target.kind).withId(target.id).firstDescriptor();
|
|
26
|
+
const description = descriptor.description ?? toolDesc?.description ?? `Run ${name}`;
|
|
27
|
+
const cmd = parent.command(name).description(description);
|
|
28
|
+
// Add arguments
|
|
29
|
+
if (toolWrapper?.arguments) {
|
|
30
|
+
for (const arg of toolWrapper.arguments) {
|
|
31
|
+
const variadic = arg.variadic ? '...' : '';
|
|
32
|
+
const spec = arg.required ? `<${arg.name}${variadic}>` : `[${arg.name}${variadic}]`;
|
|
33
|
+
cmd.argument(spec, arg.description ?? arg.name);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// Add options
|
|
37
|
+
if (toolWrapper?.options) {
|
|
38
|
+
for (const opt of toolWrapper.options) {
|
|
39
|
+
// Note: In Commander.js, choices must be added as part of addOption(), not chained
|
|
40
|
+
const option = new Option(opt.flags, opt.description ?? opt.toolParam);
|
|
41
|
+
if (opt.default !== undefined)
|
|
42
|
+
option.default(opt.default);
|
|
43
|
+
if (opt.choices && opt.choices.length > 0)
|
|
44
|
+
option.choices(opt.choices);
|
|
45
|
+
cmd.addOption(option);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// Add output format option (avoid clashing with global --format)
|
|
49
|
+
const outputCfg = toolWrapper?.output ?? { format: 'raw' };
|
|
50
|
+
cmd.option('--output-format <format>', 'Output format', outputCfg.format);
|
|
51
|
+
cmd.action(async () => {
|
|
52
|
+
// Commander hands the positionals and options to the boundary as unknown input.
|
|
53
|
+
const commandOptions = cmd.opts();
|
|
54
|
+
const actionInput = parsePatternInput(ToolWrapperCommandInputSchema, {
|
|
55
|
+
positionals: cmd.processedArgs,
|
|
56
|
+
options: commandOptions,
|
|
57
|
+
format: commandOptions.outputFormat ?? outputCfg.format
|
|
58
|
+
});
|
|
59
|
+
const input = {};
|
|
60
|
+
// Commander hands one value per declared argument, in declaration order: a
|
|
61
|
+
// variadic argument arrives as its own text list, an omitted optional one as
|
|
62
|
+
// absent. Each value is read at its descriptor position, never flattened.
|
|
63
|
+
(toolWrapper?.arguments ?? []).forEach((arg, position) => {
|
|
64
|
+
const value = actionInput.positionals[position];
|
|
65
|
+
if (value === undefined)
|
|
66
|
+
return;
|
|
67
|
+
const values = z.array(z.string()).safeParse(value);
|
|
68
|
+
input[arg.toolParam] = arg.variadic
|
|
69
|
+
? (values.success ? values.data : [z.string().parse(value)])
|
|
70
|
+
: value;
|
|
71
|
+
});
|
|
72
|
+
for (const opt of toolWrapper?.options ?? []) {
|
|
73
|
+
const optionName = this.extractOptionName(opt.flags);
|
|
74
|
+
const value = actionInput.options[optionName];
|
|
75
|
+
if (value !== undefined)
|
|
76
|
+
input[opt.toolParam] = value;
|
|
77
|
+
}
|
|
78
|
+
const choices = Object.fromEntries((toolWrapper?.options ?? []).flatMap((option) => option.choices?.length ? [[option.toolParam, option.choices]] : []));
|
|
79
|
+
const toolInput = parsePatternInput(ToolWrapperToolInputSchema, { input, choices });
|
|
80
|
+
// Resolve only after every generated operand has passed its schema.
|
|
81
|
+
const logger = await this.runtime.resolve('logging/logger', 'cli');
|
|
82
|
+
const toolCallCtx = {
|
|
83
|
+
callId: `cli:${target.id}:${Date.now()}`,
|
|
84
|
+
logger: logger.child(target.id)
|
|
85
|
+
};
|
|
86
|
+
const hasToolsClient = target.kind === 'tools/tool'
|
|
87
|
+
&& this.runtime.hasKind('runtime/client')
|
|
88
|
+
&& Boolean(this.runtime.query('runtime/client').withId('tools').firstDescriptor());
|
|
89
|
+
const toolsClient = hasToolsClient ? await getVibesClient('tools', this.runtime) : undefined;
|
|
90
|
+
const rawResult = toolsClient !== undefined && isSystemToolInvoker(toolsClient)
|
|
91
|
+
? await toolsClient.invokeSystemTool(target.id, toolInput, toolCallCtx)
|
|
92
|
+
: await (await this.runtime.resolve(target.kind, target.id)).execute(toolInput, this.runtime, toolCallCtx);
|
|
93
|
+
const result = ToolOutputSchema.safeParse(rawResult);
|
|
94
|
+
if (!result.success) {
|
|
95
|
+
throw new CapabilityError(`Tool '${target.id}' returned a result that is not JSON data.`, 'INTERNAL', {
|
|
96
|
+
reason: 'tool-result-invalid',
|
|
97
|
+
retryable: false,
|
|
98
|
+
details: { tool: target.id },
|
|
99
|
+
cause: result.error
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
await this.output(result.data, actionInput.format, context, outputCfg.extractField);
|
|
103
|
+
});
|
|
104
|
+
return cmd;
|
|
105
|
+
}
|
|
106
|
+
extractOptionName(flags) {
|
|
107
|
+
const long = flags.match(/--(\w[\w-]*)/);
|
|
108
|
+
if (long)
|
|
109
|
+
return long[1].replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
110
|
+
const short = flags.match(/-(\w)/);
|
|
111
|
+
if (short)
|
|
112
|
+
return short[1];
|
|
113
|
+
throw new Error(`Cannot extract option name from: ${flags}`);
|
|
114
|
+
}
|
|
115
|
+
async output(data, format, context, extractField) {
|
|
116
|
+
let output = data;
|
|
117
|
+
const record = extractField ? JsonObjectSchema.safeParse(data) : undefined;
|
|
118
|
+
if (extractField && record?.success) {
|
|
119
|
+
output = record.data[extractField] ?? data;
|
|
120
|
+
}
|
|
121
|
+
await renderPatternOutput(output, format, context, { table: { data: output } });
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=tool-wrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-wrapper.js","sourceRoot":"","sources":["../../../src/patterns/builtins/tool-wrapper.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAgB,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAsB,MAAM,4BAA4B,CAAC;AAGhF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAMpE,OAAO,EACN,iBAAiB,EACjB,gBAAgB,EAChB,0BAA0B,EAC1B,6BAA6B,EAG7B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAOlD,uFAAuF;AACvF,SAAS,mBAAmB,CAAC,MAAqB;IAGjD,OAAO,kBAAkB,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,gBAAgB,KAAK,UAAU,CAAC;AACtF,CAAC;AAED,MAAM,OAAO,sBAAsB;IACd;IAApB,YAAoB,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;IAAG,CAAC;IAE7C,KAAK,CAAC,QAAQ,CACb,UAA2C,EAC3C,MAAe,EACf,OAAuB;QAEvB,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC;QAEj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AAE,MAAM,GAAG,SAAS,CAiBrD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A pattern command's free-text value (`--set key=value`, `config set key value`)
|
|
3
|
+
* typed from its text, shared by the CRUD and config-namespace patterns.
|
|
4
|
+
*
|
|
5
|
+
* `true`, `false`, `null` and a JSON number are those values; text that opens a
|
|
6
|
+
* JSON object, array or string is parsed as JSON; anything else is the text
|
|
7
|
+
* itself. Text that opens JSON but does not parse is refused `INVALID_INPUT`
|
|
8
|
+
* `cli-value-invalid` with the parse failure as its cause (it used to be kept
|
|
9
|
+
* as the raw string without a word); a string that must start with `{`, `[` or
|
|
10
|
+
* `"` is passed as a quoted JSON string.
|
|
11
|
+
*/
|
|
12
|
+
import { CapabilityError } from '@vibesdotdev/kernel';
|
|
13
|
+
import { JsonValueSchema } from '@vibesdotdev/kernel/schemas/json';
|
|
14
|
+
/** A JSON number literal, exactly as JSON writes one. */
|
|
15
|
+
const JSON_NUMBER = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
|
|
16
|
+
/** Text that opens a JSON object, array or string (after optional whitespace). */
|
|
17
|
+
const JSON_STRUCTURE_START = /^\s*[{["]/;
|
|
18
|
+
export function parseCliValue(text) {
|
|
19
|
+
const trimmed = text.trim();
|
|
20
|
+
if (trimmed === 'true')
|
|
21
|
+
return true;
|
|
22
|
+
if (trimmed === 'false')
|
|
23
|
+
return false;
|
|
24
|
+
if (trimmed === 'null')
|
|
25
|
+
return null;
|
|
26
|
+
if (JSON_NUMBER.test(trimmed))
|
|
27
|
+
return Number(trimmed);
|
|
28
|
+
if (!JSON_STRUCTURE_START.test(text))
|
|
29
|
+
return text;
|
|
30
|
+
try {
|
|
31
|
+
return JsonValueSchema.parse(JSON.parse(text));
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
throw new CapabilityError('The value opens JSON but is not valid JSON.', 'INVALID_INPUT', {
|
|
35
|
+
reason: 'cli-value-invalid',
|
|
36
|
+
retryable: false,
|
|
37
|
+
recoveryHint: 'Fix the JSON, or pass a string that starts with {, [ or " as a quoted JSON string.',
|
|
38
|
+
cause: error
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=cli-value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-value.js","sourceRoot":"","sources":["../../src/patterns/cli-value.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAkB,MAAM,kCAAkC,CAAC;AAEnF,yDAAyD;AACzD,MAAM,WAAW,GAAG,+CAA+C,CAAC;AACpE,kFAAkF;AAClF,MAAM,oBAAoB,GAAG,WAAW,CAAC;AAEzC,MAAM,UAAU,aAAa,CAAC,IAAY;IACzC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,OAAO,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IACpC,IAAI,OAAO,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IACtC,IAAI,OAAO,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IACpC,IAAI,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC;IACtD,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAClD,IAAI,CAAC;QACJ,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,IAAI,eAAe,CAAC,6CAA6C,EAAE,eAAe,EAAE;YACzF,MAAM,EAAE,mBAAmB;YAC3B,SAAS,EAAE,KAAK;YAChB,YAAY,EAAE,oFAAoF;YAClG,KAAK,EAAE,KAAK;SACZ,CAAC,CAAC;IACJ,CAAC;AACF,CAAC"}
|
package/dist/patterns/index.d.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* CLI
|
|
2
|
+
* CLI Pattern contracts and runtime-backed resolution.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Builtin implementations are registered lazily by the CLI composition plugin.
|
|
5
5
|
*/
|
|
6
|
-
export { PatternResolver, createPatternResolver, type PatternImplementation } from './resolver';
|
|
7
|
-
export { isPatternDescriptor, getPatternType, type CLIPatternDescriptor, type CLICRUDGroupDescriptor, type CLIToolWrapperCommandDescriptor, type CLILogViewerGroupDescriptor, type CLIProcessManagerGroupDescriptor, type CLIConfigNamespaceGroupDescriptor } from './schemas';
|
|
8
|
-
export {
|
|
9
|
-
export { ToolWrapperPatternImpl } from './tool-wrapper';
|
|
10
|
-
export { LogViewerPatternImpl } from './log-viewer';
|
|
11
|
-
export { ProcessManagerPatternImpl } from './process-manager';
|
|
12
|
-
export { ConfigNamespacePatternImpl } from './config-namespace';
|
|
6
|
+
export { PatternResolver, createPatternResolver, type PatternImplementation } from './resolver.ts';
|
|
7
|
+
export { isPatternDescriptor, getPatternType, type CLIPatternDescriptor, type CLICRUDGroupDescriptor, type CLIToolWrapperCommandDescriptor, type CLILogViewerGroupDescriptor, type CLIProcessManagerGroupDescriptor, type CLIConfigNamespaceGroupDescriptor } from './schemas.ts';
|
|
8
|
+
export { CLICRUDGroupDescriptorSchema, CLIConfigNamespaceGroupDescriptorSchema, CLILogViewerGroupDescriptorSchema, CLIProcessManagerGroupDescriptorSchema, CLIToolWrapperCommandDescriptorSchema, CLIPatternDescriptorSchema } from './schemas.ts';
|
|
13
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/patterns/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,KAAK,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/patterns/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEnG,OAAO,EACN,mBAAmB,EACnB,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,EACpC,KAAK,2BAA2B,EAChC,KAAK,gCAAgC,EACrC,KAAK,iCAAiC,EACtC,MAAM,cAAc,CAAC;AAEtB,OAAO,EACN,4BAA4B,EAC5B,uCAAuC,EACvC,iCAAiC,EACjC,sCAAsC,EACtC,qCAAqC,EACrC,0BAA0B,EAC1B,MAAM,cAAc,CAAC"}
|
package/dist/patterns/index.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* CLI
|
|
2
|
+
* CLI Pattern contracts and runtime-backed resolution.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Builtin implementations are registered lazily by the CLI composition plugin.
|
|
5
5
|
*/
|
|
6
|
-
export { PatternResolver, createPatternResolver } from
|
|
7
|
-
export { isPatternDescriptor, getPatternType } from
|
|
8
|
-
export {
|
|
9
|
-
export { ToolWrapperPatternImpl } from './tool-wrapper.js';
|
|
10
|
-
export { LogViewerPatternImpl } from './log-viewer.js';
|
|
11
|
-
export { ProcessManagerPatternImpl } from './process-manager.js';
|
|
12
|
-
export { ConfigNamespacePatternImpl } from './config-namespace.js';
|
|
6
|
+
export { PatternResolver, createPatternResolver } from "./resolver.js";
|
|
7
|
+
export { isPatternDescriptor, getPatternType } from "./schemas.js";
|
|
8
|
+
export { CLICRUDGroupDescriptorSchema, CLIConfigNamespaceGroupDescriptorSchema, CLILogViewerGroupDescriptorSchema, CLIProcessManagerGroupDescriptorSchema, CLIToolWrapperCommandDescriptorSchema, CLIPatternDescriptorSchema } from "./schemas.js";
|
|
13
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/patterns/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAA8B,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/patterns/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAA8B,MAAM,eAAe,CAAC;AAEnG,OAAO,EACN,mBAAmB,EACnB,cAAc,EAOd,MAAM,cAAc,CAAC;AAEtB,OAAO,EACN,4BAA4B,EAC5B,uCAAuC,EACvC,iCAAiC,EACjC,sCAAsC,EACtC,qCAAqC,EACrC,0BAA0B,EAC1B,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type PatternImplementation } from '../schemas/pattern-implementation.ts';
|
|
2
|
+
export declare const cliPatternKind: {
|
|
3
|
+
id: string;
|
|
4
|
+
descriptorSchema: import("zod").ZodObject<{
|
|
5
|
+
id: import("zod").ZodString;
|
|
6
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
7
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
8
|
+
tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
9
|
+
hardware: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
10
|
+
enabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
11
|
+
priority: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
12
|
+
capabilityId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
13
|
+
requiredContext: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
14
|
+
optionalContext: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
15
|
+
config: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
16
|
+
retention: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
17
|
+
maxAgeDays: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
18
|
+
maxEntries: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
19
|
+
maxBytes: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
20
|
+
cascadeFrom: import("zod").ZodOptional<import("zod").ZodString>;
|
|
21
|
+
ageField: import("zod").ZodOptional<import("zod").ZodString>;
|
|
22
|
+
reason: import("zod").ZodString;
|
|
23
|
+
enforcedBy: import("zod").ZodOptional<import("zod").ZodString>;
|
|
24
|
+
}, import("zod/v4/core").$strip>]>>;
|
|
25
|
+
kind: import("zod").ZodLiteral<"cli/pattern">;
|
|
26
|
+
}, import("zod/v4/core").$strip>;
|
|
27
|
+
validateImplementation: (value: PatternImplementation) => boolean;
|
|
28
|
+
contexts: never[];
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=pattern.kinds.d.ts.map
|