@vibesdotdev/plugins 0.0.0-stage → 1.0.0-rc.0
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 +54 -2
- package/VIBES.md +165 -0
- package/dist/ai/index.d.ts +4 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +3 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/ai/plugin.impl.cloud.d.ts +4 -0
- package/dist/ai/plugin.impl.cloud.d.ts.map +1 -0
- package/dist/ai/plugin.impl.cloud.js +32 -0
- package/dist/ai/plugin.impl.cloud.js.map +1 -0
- package/dist/ai/plugin.impl.consumer.d.ts +7 -0
- package/dist/ai/plugin.impl.consumer.d.ts.map +1 -0
- package/dist/ai/plugin.impl.consumer.js +222 -0
- package/dist/ai/plugin.impl.consumer.js.map +1 -0
- package/dist/auth/consumer.plugin.d.ts +3 -0
- package/dist/auth/consumer.plugin.d.ts.map +1 -0
- package/dist/auth/consumer.plugin.js +105 -0
- package/dist/auth/consumer.plugin.js.map +1 -0
- package/dist/auth/index.d.ts +2 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +2 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/plugin.d.ts +4 -0
- package/dist/auth/plugin.d.ts.map +1 -0
- package/dist/auth/plugin.js +33 -0
- package/dist/auth/plugin.js.map +1 -0
- package/dist/automation/consumer.plugin.d.ts +3 -0
- package/dist/automation/consumer.plugin.d.ts.map +1 -0
- package/dist/automation/consumer.plugin.js +92 -0
- package/dist/automation/consumer.plugin.js.map +1 -0
- package/dist/automation/index.d.ts +2 -0
- package/dist/automation/index.d.ts.map +1 -0
- package/dist/automation/index.js +2 -0
- package/dist/automation/index.js.map +1 -0
- package/dist/automation/plugin.d.ts +4 -0
- package/dist/automation/plugin.d.ts.map +1 -0
- package/dist/automation/plugin.js +30 -0
- package/dist/automation/plugin.js.map +1 -0
- package/dist/bun/host.d.ts +44 -0
- package/dist/bun/host.d.ts.map +1 -0
- package/dist/bun/host.js +71 -0
- package/dist/bun/host.js.map +1 -0
- package/dist/cli/child-failure.d.ts +37 -0
- package/dist/cli/child-failure.d.ts.map +1 -0
- package/dist/cli/child-failure.js +86 -0
- package/dist/cli/child-failure.js.map +1 -0
- package/dist/cli/context.d.ts +12 -0
- package/dist/cli/context.d.ts.map +1 -0
- package/dist/cli/context.js +11 -0
- package/dist/cli/context.js.map +1 -0
- package/dist/cli/execution.d.ts +10 -0
- package/dist/cli/execution.d.ts.map +1 -0
- package/dist/cli/execution.js +20 -0
- package/dist/cli/execution.js.map +1 -0
- package/dist/cli/failure-facts.d.ts +16 -0
- package/dist/cli/failure-facts.d.ts.map +1 -0
- package/dist/cli/failure-facts.js +39 -0
- package/dist/cli/failure-facts.js.map +1 -0
- package/dist/cli/package-manager.consumer.d.ts +106 -0
- package/dist/cli/package-manager.consumer.d.ts.map +1 -0
- package/dist/cli/package-manager.consumer.js +258 -0
- package/dist/cli/package-manager.consumer.js.map +1 -0
- package/dist/cli/plugin.d.ts +9 -0
- package/dist/cli/plugin.d.ts.map +1 -0
- package/dist/cli/plugin.js +34 -0
- package/dist/cli/plugin.js.map +1 -0
- package/dist/cli/plugins.add.cli-command.descriptor.d.ts +36 -0
- package/dist/cli/plugins.add.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/plugins.add.cli-command.descriptor.js +31 -0
- package/dist/cli/plugins.add.cli-command.descriptor.js.map +1 -0
- package/dist/cli/plugins.add.cli-command.impl.consumer.d.ts +63 -0
- package/dist/cli/plugins.add.cli-command.impl.consumer.d.ts.map +1 -0
- package/dist/cli/plugins.add.cli-command.impl.consumer.js +206 -0
- package/dist/cli/plugins.add.cli-command.impl.consumer.js.map +1 -0
- package/dist/cli/plugins.cli-group.descriptor.d.ts +4 -0
- package/dist/cli/plugins.cli-group.descriptor.d.ts.map +1 -0
- package/dist/cli/plugins.cli-group.descriptor.js +10 -0
- package/dist/cli/plugins.cli-group.descriptor.js.map +1 -0
- package/dist/cli/plugins.host.cli-command.descriptor.d.ts +31 -0
- package/dist/cli/plugins.host.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/plugins.host.cli-command.descriptor.js +37 -0
- package/dist/cli/plugins.host.cli-command.descriptor.js.map +1 -0
- package/dist/cli/plugins.host.cli-command.impl.consumer.d.ts +29 -0
- package/dist/cli/plugins.host.cli-command.impl.consumer.d.ts.map +1 -0
- package/dist/cli/plugins.host.cli-command.impl.consumer.js +109 -0
- package/dist/cli/plugins.host.cli-command.impl.consumer.js.map +1 -0
- package/dist/cli/plugins.link.cli-command.descriptor.d.ts +35 -0
- package/dist/cli/plugins.link.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/plugins.link.cli-command.descriptor.js +32 -0
- package/dist/cli/plugins.link.cli-command.descriptor.js.map +1 -0
- package/dist/cli/plugins.link.cli-command.impl.consumer.d.ts +31 -0
- package/dist/cli/plugins.link.cli-command.impl.consumer.d.ts.map +1 -0
- package/dist/cli/plugins.link.cli-command.impl.consumer.js +104 -0
- package/dist/cli/plugins.link.cli-command.impl.consumer.js.map +1 -0
- package/dist/cli/plugins.list.cli-command.descriptor.d.ts +26 -0
- package/dist/cli/plugins.list.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/plugins.list.cli-command.descriptor.js +22 -0
- package/dist/cli/plugins.list.cli-command.descriptor.js.map +1 -0
- package/dist/cli/plugins.list.cli-command.impl.consumer.d.ts +116 -0
- package/dist/cli/plugins.list.cli-command.impl.consumer.d.ts.map +1 -0
- package/dist/cli/plugins.list.cli-command.impl.consumer.js +343 -0
- package/dist/cli/plugins.list.cli-command.impl.consumer.js.map +1 -0
- package/dist/cli/plugins.remove.cli-command.descriptor.d.ts +31 -0
- package/dist/cli/plugins.remove.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/plugins.remove.cli-command.descriptor.js +26 -0
- package/dist/cli/plugins.remove.cli-command.descriptor.js.map +1 -0
- package/dist/cli/plugins.remove.cli-command.impl.consumer.d.ts +30 -0
- package/dist/cli/plugins.remove.cli-command.impl.consumer.d.ts.map +1 -0
- package/dist/cli/plugins.remove.cli-command.impl.consumer.js +80 -0
- package/dist/cli/plugins.remove.cli-command.impl.consumer.js.map +1 -0
- package/dist/cli/plugins.unlink.cli-command.descriptor.d.ts +31 -0
- package/dist/cli/plugins.unlink.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/plugins.unlink.cli-command.descriptor.js +21 -0
- package/dist/cli/plugins.unlink.cli-command.descriptor.js.map +1 -0
- package/dist/cli/plugins.unlink.cli-command.impl.consumer.d.ts +76 -0
- package/dist/cli/plugins.unlink.cli-command.impl.consumer.d.ts.map +1 -0
- package/dist/cli/plugins.unlink.cli-command.impl.consumer.js +190 -0
- package/dist/cli/plugins.unlink.cli-command.impl.consumer.js.map +1 -0
- package/dist/cli/registry-sign-in.consumer.d.ts +80 -0
- package/dist/cli/registry-sign-in.consumer.d.ts.map +1 -0
- package/dist/cli/registry-sign-in.consumer.js +199 -0
- package/dist/cli/registry-sign-in.consumer.js.map +1 -0
- package/dist/cli/roll.d.ts +230 -0
- package/dist/cli/roll.d.ts.map +1 -0
- package/dist/cli/roll.js +569 -0
- package/dist/cli/roll.js.map +1 -0
- package/dist/cli/schemas/context.d.ts +10 -0
- package/dist/cli/schemas/context.d.ts.map +1 -0
- package/dist/cli/schemas/context.js +3 -0
- package/dist/cli/schemas/context.js.map +1 -0
- package/dist/cli/schemas/scopes.d.ts +37 -0
- package/dist/cli/schemas/scopes.d.ts.map +1 -0
- package/dist/cli/schemas/scopes.js +11 -0
- package/dist/cli/schemas/scopes.js.map +1 -0
- package/dist/cli/schemas/unlink.d.ts +18 -0
- package/dist/cli/schemas/unlink.d.ts.map +1 -0
- package/dist/cli/schemas/unlink.js +3 -0
- package/dist/cli/schemas/unlink.js.map +1 -0
- package/dist/cli/schemas/update.d.ts +77 -0
- package/dist/cli/schemas/update.d.ts.map +1 -0
- package/dist/cli/schemas/update.js +3 -0
- package/dist/cli/schemas/update.js.map +1 -0
- package/dist/cli/scopes.d.ts +50 -0
- package/dist/cli/scopes.d.ts.map +1 -0
- package/dist/cli/scopes.js +90 -0
- package/dist/cli/scopes.js.map +1 -0
- package/dist/cli/seed.d.ts +232 -0
- package/dist/cli/seed.d.ts.map +1 -0
- package/dist/cli/seed.js +590 -0
- package/dist/cli/seed.js.map +1 -0
- package/dist/cli/self-update.d.ts +120 -0
- package/dist/cli/self-update.d.ts.map +1 -0
- package/dist/cli/self-update.js +274 -0
- package/dist/cli/self-update.js.map +1 -0
- package/dist/cli/update.cli-command.descriptor.d.ts +62 -0
- package/dist/cli/update.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/update.cli-command.descriptor.js +49 -0
- package/dist/cli/update.cli-command.descriptor.js.map +1 -0
- package/dist/cli/update.cli-command.impl.consumer.d.ts +178 -0
- package/dist/cli/update.cli-command.impl.consumer.d.ts.map +1 -0
- package/dist/cli/update.cli-command.impl.consumer.js +750 -0
- package/dist/cli/update.cli-command.impl.consumer.js.map +1 -0
- package/dist/comms/consumer.plugin.d.ts +3 -0
- package/dist/comms/consumer.plugin.d.ts.map +1 -0
- package/dist/comms/consumer.plugin.js +108 -0
- package/dist/comms/consumer.plugin.js.map +1 -0
- package/dist/comms/index.d.ts +2 -0
- package/dist/comms/index.d.ts.map +1 -0
- package/dist/comms/index.js +2 -0
- package/dist/comms/index.js.map +1 -0
- package/dist/comms/plugin.d.ts +4 -0
- package/dist/comms/plugin.d.ts.map +1 -0
- package/dist/comms/plugin.js +30 -0
- package/dist/comms/plugin.js.map +1 -0
- package/dist/consumer.d.ts +3 -0
- package/dist/consumer.d.ts.map +1 -0
- package/dist/consumer.js +3 -0
- package/dist/consumer.js.map +1 -0
- package/dist/consumer.plugin.d.ts +63 -0
- package/dist/consumer.plugin.d.ts.map +1 -0
- package/dist/consumer.plugin.js +89 -0
- package/dist/consumer.plugin.js.map +1 -0
- package/dist/core/consumer.plugin.d.ts +4 -0
- package/dist/core/consumer.plugin.d.ts.map +1 -0
- package/dist/core/consumer.plugin.js +358 -0
- package/dist/core/consumer.plugin.js.map +1 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +2 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/optional-member.d.ts +11 -0
- package/dist/core/optional-member.d.ts.map +1 -0
- package/dist/core/optional-member.js +68 -0
- package/dist/core/optional-member.js.map +1 -0
- package/dist/core/optional-plugin.d.ts +40 -0
- package/dist/core/optional-plugin.d.ts.map +1 -0
- package/dist/core/optional-plugin.js +107 -0
- package/dist/core/optional-plugin.js.map +1 -0
- package/dist/core/plugin.d.ts +10 -0
- package/dist/core/plugin.d.ts.map +1 -0
- package/dist/core/plugin.js +64 -0
- package/dist/core/plugin.js.map +1 -0
- package/dist/core/setup-requirements.descriptors.d.ts +7 -0
- package/dist/core/setup-requirements.descriptors.d.ts.map +1 -0
- package/dist/core/setup-requirements.descriptors.js +117 -0
- package/dist/core/setup-requirements.descriptors.js.map +1 -0
- package/dist/data/consumer.plugin.d.ts +3 -0
- package/dist/data/consumer.plugin.d.ts.map +1 -0
- package/dist/data/consumer.plugin.js +99 -0
- package/dist/data/consumer.plugin.js.map +1 -0
- package/dist/data/index.d.ts +2 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/index.js +2 -0
- package/dist/data/index.js.map +1 -0
- package/dist/data/plugin.d.ts +4 -0
- package/dist/data/plugin.d.ts.map +1 -0
- package/dist/data/plugin.js +37 -0
- package/dist/data/plugin.js.map +1 -0
- package/dist/devtools/consumer.plugin.d.ts +3 -0
- package/dist/devtools/consumer.plugin.d.ts.map +1 -0
- package/dist/devtools/consumer.plugin.js +323 -0
- package/dist/devtools/consumer.plugin.js.map +1 -0
- package/dist/devtools/index.d.ts +2 -0
- package/dist/devtools/index.d.ts.map +1 -0
- package/dist/devtools/index.js +2 -0
- package/dist/devtools/index.js.map +1 -0
- package/dist/devtools/plugin.d.ts +4 -0
- package/dist/devtools/plugin.d.ts.map +1 -0
- package/dist/devtools/plugin.js +34 -0
- package/dist/devtools/plugin.js.map +1 -0
- package/dist/filesystem/index.d.ts +2 -0
- package/dist/filesystem/index.d.ts.map +1 -0
- package/dist/filesystem/index.js +2 -0
- package/dist/filesystem/index.js.map +1 -0
- package/dist/filesystem/plugin.d.ts +4 -0
- package/dist/filesystem/plugin.d.ts.map +1 -0
- package/dist/filesystem/plugin.js +21 -0
- package/dist/filesystem/plugin.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +7 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +16 -0
- package/dist/plugin.js.map +1 -0
- package/dist/schemas/ai.d.ts +119 -0
- package/dist/schemas/ai.d.ts.map +1 -0
- package/dist/schemas/ai.js +84 -0
- package/dist/schemas/ai.js.map +1 -0
- package/dist/schemas/auth.d.ts +15 -0
- package/dist/schemas/auth.d.ts.map +1 -0
- package/dist/schemas/auth.js +19 -0
- package/dist/schemas/auth.js.map +1 -0
- package/dist/schemas/automation.d.ts +66 -0
- package/dist/schemas/automation.d.ts.map +1 -0
- package/dist/schemas/automation.js +36 -0
- package/dist/schemas/automation.js.map +1 -0
- package/dist/schemas/comms.d.ts +13 -0
- package/dist/schemas/comms.d.ts.map +1 -0
- package/dist/schemas/comms.js +27 -0
- package/dist/schemas/comms.js.map +1 -0
- package/dist/schemas/core.d.ts +102 -0
- package/dist/schemas/core.d.ts.map +1 -0
- package/dist/schemas/core.js +124 -0
- package/dist/schemas/core.js.map +1 -0
- package/dist/schemas/data.d.ts +13 -0
- package/dist/schemas/data.d.ts.map +1 -0
- package/dist/schemas/data.js +25 -0
- package/dist/schemas/data.js.map +1 -0
- package/dist/schemas/devtools.d.ts +33 -0
- package/dist/schemas/devtools.d.ts.map +1 -0
- package/dist/schemas/devtools.js +56 -0
- package/dist/schemas/devtools.js.map +1 -0
- package/dist/schemas/family.d.ts +11 -0
- package/dist/schemas/family.d.ts.map +1 -0
- package/dist/schemas/family.js +21 -0
- package/dist/schemas/family.js.map +1 -0
- package/dist/schemas/filesystem.d.ts +25 -0
- package/dist/schemas/filesystem.d.ts.map +1 -0
- package/dist/schemas/filesystem.js +24 -0
- package/dist/schemas/filesystem.js.map +1 -0
- package/dist/schemas/host.d.ts +10 -0
- package/dist/schemas/host.d.ts.map +1 -0
- package/dist/schemas/host.js +2 -0
- package/dist/schemas/host.js.map +1 -0
- package/dist/schemas/optional-member.d.ts +67 -0
- package/dist/schemas/optional-member.d.ts.map +1 -0
- package/dist/schemas/optional-member.js +31 -0
- package/dist/schemas/optional-member.js.map +1 -0
- package/dist/schemas/roll.d.ts +47 -0
- package/dist/schemas/roll.d.ts.map +1 -0
- package/dist/schemas/roll.js +18 -0
- package/dist/schemas/roll.js.map +1 -0
- package/dist/schemas/tui.d.ts +33 -0
- package/dist/schemas/tui.d.ts.map +1 -0
- package/dist/schemas/tui.js +95 -0
- package/dist/schemas/tui.js.map +1 -0
- package/dist/schemas/ui.d.ts +15 -0
- package/dist/schemas/ui.d.ts.map +1 -0
- package/dist/schemas/ui.js +45 -0
- package/dist/schemas/ui.js.map +1 -0
- package/dist/tui/code-sessions-tui-plugin-shim.d.ts +7 -0
- package/dist/tui/code-sessions-tui-plugin-shim.d.ts.map +1 -0
- package/dist/tui/code-sessions-tui-plugin-shim.js +2 -0
- package/dist/tui/code-sessions-tui-plugin-shim.js.map +1 -0
- package/dist/tui/index.d.ts +8 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +8 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/plugin.d.ts +53 -0
- package/dist/tui/plugin.d.ts.map +1 -0
- package/dist/tui/plugin.js +350 -0
- package/dist/tui/plugin.js.map +1 -0
- package/dist/ui/consumer.plugin.d.ts +3 -0
- package/dist/ui/consumer.plugin.d.ts.map +1 -0
- package/dist/ui/consumer.plugin.js +75 -0
- package/dist/ui/consumer.plugin.js.map +1 -0
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +2 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/plugin.d.ts +4 -0
- package/dist/ui/plugin.d.ts.map +1 -0
- package/dist/ui/plugin.js +35 -0
- package/dist/ui/plugin.js.map +1 -0
- package/host-start.mjs +39 -0
- package/host.mjs +24 -0
- package/package.json +437 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.add.cli-command.descriptor.js","sourceRoot":"","sources":["../../src/cli/plugins.add.cli-command.descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;GAIG;AACH,eAAe,kBAAkB,CAAC;IACjC,EAAE,EAAE,aAAa;IACjB,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,KAAK;IACX,WAAW,EAAE,oDAAoD;IACjE,KAAK,EAAE,SAAS;IAChB,QAAQ,EAAE,CAAC,KAAK,CAAC;IACjB,QAAQ,EAAE,CAAC,UAAU,CAAC;IACtB,eAAe,EAAE,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IAChD,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;IAClC,SAAS,EAAE;QACV;YACC,IAAI,EAAE,SAAS;YACf,WAAW,EACV,+GAA+G;YAChH,QAAQ,EAAE,IAAI;YACd,QAAQ,EAAE,KAAK;SACf;KACD;IACD,OAAO,EAAE;QACR,EAAE,KAAK,EAAE,sBAAsB,EAAE,WAAW,EAAE,yCAAyC,EAAE;QACzF,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,qDAAqD,EAAE;QACzF,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,oCAAoC,EAAE;KAC3E;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { CommandExecutionStartInfo } from '@vibesdotdev/cli/schemas/surface';
|
|
2
|
+
import type { CLICommandAssetDescriptor } from '@vibesdotdev/cli/schemas/types';
|
|
3
|
+
import { type RuntimePackagePlugins } from '@vibesdotdev/kernel';
|
|
4
|
+
import { PluginsCLICommand, type PluginsCLIContext } from './context.ts';
|
|
5
|
+
import { type SelectedScope } from './scopes.ts';
|
|
6
|
+
/**
|
|
7
|
+
* `vibes plugins add <coordinate> [--global|--workspace]`.
|
|
8
|
+
*
|
|
9
|
+
* Three things changed here and each has a reason:
|
|
10
|
+
*
|
|
11
|
+
* 1. **Scoped.** The command used to write `$VIBES_HOME` unconditionally.
|
|
12
|
+
* `--workspace` records the selection in the workspace's own list instead.
|
|
13
|
+
* An unflagged invocation still means `--global`, so no existing command
|
|
14
|
+
* line changes meaning.
|
|
15
|
+
* 2. **No `--exact`.** `bun add --exact` pinned the scope to whatever patch it
|
|
16
|
+
* saw, which made `vibes update` structurally unable to move it. Bun's own
|
|
17
|
+
* default (a caret range) is what gets written now; a coordinate that names
|
|
18
|
+
* a range explicitly still wins.
|
|
19
|
+
* 3. **`name@workspace:*` is a first-class coordinate**, and a package already
|
|
20
|
+
* supplied by one of the scope's `workspaces` link globs gets that protocol
|
|
21
|
+
* automatically — it is a linked provider, not a registry download.
|
|
22
|
+
*
|
|
23
|
+
* 4. **A delegated global home owns no packages.** `$VIBES_HOME` with
|
|
24
|
+
* `vibes.hostWorkspace` hands the whole graph to that workspace, and
|
|
25
|
+
* `vibes update --global` already refuses it for the same reason. Installing
|
|
26
|
+
* into it anyway (this command used to, "as a consumer product") built a
|
|
27
|
+
* second, registry-pinned closure that the running graph never composes but
|
|
28
|
+
* that path-based lookups (`$VIBES_HOME/node_modules/...`) then found first.
|
|
29
|
+
* `refuseDelegatedGlobalAdd` refuses before anything is written or run and
|
|
30
|
+
* names the scope that does own packages.
|
|
31
|
+
*
|
|
32
|
+
* The options are read from the SECOND execute parameter. They always were
|
|
33
|
+
* commander's option bag; reading them off the positional-args object (as this
|
|
34
|
+
* file did) silently made `--plugin` and the old `--manager` inert.
|
|
35
|
+
*/
|
|
36
|
+
export default class PluginsAddCLICommand extends PluginsCLICommand {
|
|
37
|
+
constructor(descriptor: CLICommandAssetDescriptor, context: PluginsCLIContext);
|
|
38
|
+
execute(args: CommandExecutionStartInfo['args'], options: CommandExecutionStartInfo['options']): Promise<void>;
|
|
39
|
+
private enable;
|
|
40
|
+
/**
|
|
41
|
+
* Undo a package this invocation installed, so a failed add leaves no
|
|
42
|
+
* residue. Both steps always run; each failure is returned, never dropped,
|
|
43
|
+
* so the caller reports it alongside the add's own failure.
|
|
44
|
+
*/
|
|
45
|
+
private rollback;
|
|
46
|
+
private emit;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Refuse `plugins add --global` when `$VIBES_HOME` delegates to a host
|
|
50
|
+
* workspace (`vibes.hostWorkspace`).
|
|
51
|
+
*
|
|
52
|
+
* The rule is the same one `vibes update --global` applies: a delegated home
|
|
53
|
+
* owns no packages, because every process that reads it takes its module graph
|
|
54
|
+
* from the host workspace. Anything installed under the home would be a
|
|
55
|
+
* second closure — pinned to whatever the registry held that day — that the
|
|
56
|
+
* running graph never composes, yet which any path-based lookup of
|
|
57
|
+
* `$VIBES_HOME/node_modules/<pkg>` would find. An end-user home (no
|
|
58
|
+
* `hostWorkspace`) owns its packages and is unaffected.
|
|
59
|
+
*
|
|
60
|
+
* Throws before anything is seeded, written or installed.
|
|
61
|
+
*/
|
|
62
|
+
export declare function refuseDelegatedGlobalAdd(scope: Pick<SelectedScope, 'kind' | 'root'>, packageName: string, plugins: Pick<RuntimePackagePlugins, 'readGlobalPluginScope'>): void;
|
|
63
|
+
//# sourceMappingURL=plugins.add.cli-command.impl.consumer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.add.cli-command.impl.consumer.d.ts","sourceRoot":"","sources":["../../src/cli/plugins.add.cli-command.impl.consumer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EAMN,KAAK,qBAAqB,EAE1B,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAOzE,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAGrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,iBAAiB;gBACtD,UAAU,EAAE,yBAAyB,EAAE,OAAO,EAAE,iBAAiB;IAIvE,OAAO,CAAC,IAAI,EAAE,yBAAyB,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,yBAAyB,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;YAwDtG,MAAM;IAQpB;;;;OAIG;YACW,QAAQ;IAStB,OAAO,CAAC,IAAI;CAsBZ;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CACvC,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC,EAC3C,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,IAAI,CAAC,qBAAqB,EAAE,uBAAuB,CAAC,GAC3D,IAAI,CAYN"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { CapabilityError, CaughtFailureSchema, getRuntimePackagePlugins, valueFreeFailure } from '@vibesdotdev/kernel';
|
|
2
|
+
import { LoggedErrorSchema } from '@vibesdotdev/logging';
|
|
3
|
+
import { z } from 'zod/v4';
|
|
4
|
+
import { PluginsCLICommand } from "./context.js";
|
|
5
|
+
import { hasScopeDependency, packageNameFromInstallSpec, requestedRangeFromInstallSpec, runBunOrThrow } from "./package-manager.consumer.js";
|
|
6
|
+
import { resolveSingleScope } from "./scopes.js";
|
|
7
|
+
import { seedGlobalScope } from "./seed.js";
|
|
8
|
+
/**
|
|
9
|
+
* `vibes plugins add <coordinate> [--global|--workspace]`.
|
|
10
|
+
*
|
|
11
|
+
* Three things changed here and each has a reason:
|
|
12
|
+
*
|
|
13
|
+
* 1. **Scoped.** The command used to write `$VIBES_HOME` unconditionally.
|
|
14
|
+
* `--workspace` records the selection in the workspace's own list instead.
|
|
15
|
+
* An unflagged invocation still means `--global`, so no existing command
|
|
16
|
+
* line changes meaning.
|
|
17
|
+
* 2. **No `--exact`.** `bun add --exact` pinned the scope to whatever patch it
|
|
18
|
+
* saw, which made `vibes update` structurally unable to move it. Bun's own
|
|
19
|
+
* default (a caret range) is what gets written now; a coordinate that names
|
|
20
|
+
* a range explicitly still wins.
|
|
21
|
+
* 3. **`name@workspace:*` is a first-class coordinate**, and a package already
|
|
22
|
+
* supplied by one of the scope's `workspaces` link globs gets that protocol
|
|
23
|
+
* automatically — it is a linked provider, not a registry download.
|
|
24
|
+
*
|
|
25
|
+
* 4. **A delegated global home owns no packages.** `$VIBES_HOME` with
|
|
26
|
+
* `vibes.hostWorkspace` hands the whole graph to that workspace, and
|
|
27
|
+
* `vibes update --global` already refuses it for the same reason. Installing
|
|
28
|
+
* into it anyway (this command used to, "as a consumer product") built a
|
|
29
|
+
* second, registry-pinned closure that the running graph never composes but
|
|
30
|
+
* that path-based lookups (`$VIBES_HOME/node_modules/...`) then found first.
|
|
31
|
+
* `refuseDelegatedGlobalAdd` refuses before anything is written or run and
|
|
32
|
+
* names the scope that does own packages.
|
|
33
|
+
*
|
|
34
|
+
* The options are read from the SECOND execute parameter. They always were
|
|
35
|
+
* commander's option bag; reading them off the positional-args object (as this
|
|
36
|
+
* file did) silently made `--plugin` and the old `--manager` inert.
|
|
37
|
+
*/
|
|
38
|
+
export default class PluginsAddCLICommand extends PluginsCLICommand {
|
|
39
|
+
constructor(descriptor, context) {
|
|
40
|
+
super(descriptor, context);
|
|
41
|
+
}
|
|
42
|
+
async execute(args, options) {
|
|
43
|
+
const flags = { ...args, ...options };
|
|
44
|
+
const input = AddInputSchema.parse({ ...flags, package: args.package });
|
|
45
|
+
const coordinate = input.package;
|
|
46
|
+
if (!coordinate)
|
|
47
|
+
throw addRefusal('plugins add requires a package coordinate', 'plugin-add-coordinate-missing');
|
|
48
|
+
const packageName = packageNameFromInstallSpec(coordinate);
|
|
49
|
+
if (!packageName) {
|
|
50
|
+
throw addRefusal('plugins add currently requires a named Bun package coordinate', 'plugin-add-coordinate-unnamed');
|
|
51
|
+
}
|
|
52
|
+
const plugins = await getRuntimePackagePlugins(this.runtime);
|
|
53
|
+
const scope = await resolveSingleScope(this.runtime, flags, { fallback: 'global' });
|
|
54
|
+
refuseDelegatedGlobalAdd(scope, packageName, plugins);
|
|
55
|
+
if (scope.kind === 'global')
|
|
56
|
+
await seedGlobalScope(this.runtime, { home: scope.root });
|
|
57
|
+
const linkedMember = plugins.expandWorkspaceMembers(scope.root).has(packageName);
|
|
58
|
+
const requestedRange = requestedRangeFromInstallSpec(coordinate);
|
|
59
|
+
const range = linkedMember
|
|
60
|
+
? plugins.WORKSPACE_DEPENDENCY_PROTOCOL
|
|
61
|
+
: (requestedRange ?? null);
|
|
62
|
+
const existed = await hasScopeDependency(this.runtime, scope.root, packageName);
|
|
63
|
+
if (linkedMember || range === plugins.WORKSPACE_DEPENDENCY_PROTOCOL) {
|
|
64
|
+
// A linked provider is declared, not downloaded: `bun install` resolves
|
|
65
|
+
// it from the member farm the scope already links.
|
|
66
|
+
await plugins.declareGlobalDependency(scope.root, packageName, plugins.WORKSPACE_DEPENDENCY_PROTOCOL);
|
|
67
|
+
await runBunOrThrow({ runtime: this.runtime, action: 'install', cwd: scope.root });
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
// No --exact: bun writes its own caret range, which is what `vibes
|
|
71
|
+
// update` later moves.
|
|
72
|
+
await runBunOrThrow({
|
|
73
|
+
runtime: this.runtime,
|
|
74
|
+
action: 'add',
|
|
75
|
+
cwd: scope.root,
|
|
76
|
+
args: [range ? `${packageName}@${range}` : packageName]
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
const enabled = await settleOutcome(async () => {
|
|
80
|
+
const specifier = input.plugin || plugins.inferGlobalPluginSpecifier(scope.root, packageName);
|
|
81
|
+
if (plugins.getPluginPackageName(specifier) !== packageName) {
|
|
82
|
+
throw addRefusal(`plugin export '${specifier}' does not belong to '${packageName}'`, 'plugin-add-export-foreign');
|
|
83
|
+
}
|
|
84
|
+
const resolved = await plugins.resolvePluginModule({ id: specifier, projectDir: scope.root });
|
|
85
|
+
// The value-free text, with the failure itself as cause for -v.
|
|
86
|
+
if (!('plugins' in resolved))
|
|
87
|
+
throw pluginLoadRefusal(resolved);
|
|
88
|
+
await this.enable(plugins, scope, specifier);
|
|
89
|
+
return specifier;
|
|
90
|
+
});
|
|
91
|
+
if ('failure' in enabled) {
|
|
92
|
+
// The add failed: undo a package this invocation installed, and carry any undo step that failed too.
|
|
93
|
+
const leftovers = existed ? [] : await this.rollback(plugins, scope, packageName);
|
|
94
|
+
throw rollbackCarried(enabled.failure, leftovers);
|
|
95
|
+
}
|
|
96
|
+
this.emit({ scope, specifier: enabled.value, packageName, linked: linkedMember });
|
|
97
|
+
}
|
|
98
|
+
async enable(plugins, scope, specifier) {
|
|
99
|
+
if (scope.kind === 'global') {
|
|
100
|
+
await plugins.enableGlobalPlugin(scope.root, specifier);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
await plugins.enableWorkspacePlugin(scope.root, specifier);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Undo a package this invocation installed, so a failed add leaves no
|
|
107
|
+
* residue. Both steps always run; each failure is returned, never dropped,
|
|
108
|
+
* so the caller reports it alongside the add's own failure.
|
|
109
|
+
*/
|
|
110
|
+
async rollback(plugins, scope, packageName) {
|
|
111
|
+
const failures = [];
|
|
112
|
+
const undeclared = await settleOutcome(() => plugins.undeclareGlobalDependency(scope.root, packageName));
|
|
113
|
+
if ('failure' in undeclared)
|
|
114
|
+
failures.push(undeclared.failure);
|
|
115
|
+
const reinstalled = await settleOutcome(() => runBunOrThrow({ runtime: this.runtime, action: 'install', cwd: scope.root }));
|
|
116
|
+
if ('failure' in reinstalled)
|
|
117
|
+
failures.push(reinstalled.failure);
|
|
118
|
+
return failures;
|
|
119
|
+
}
|
|
120
|
+
emit(payload) {
|
|
121
|
+
if (this.format === 'json') {
|
|
122
|
+
this.ui.json({
|
|
123
|
+
scope: payload.scope.kind,
|
|
124
|
+
root: payload.scope.root,
|
|
125
|
+
plugin: payload.specifier,
|
|
126
|
+
package: payload.packageName,
|
|
127
|
+
source: payload.linked ? 'linked' : 'installed',
|
|
128
|
+
enabled: true
|
|
129
|
+
});
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
this.ui.success(`Enabled ${payload.specifier} in the ${payload.scope.kind} scope ` +
|
|
133
|
+
`(${payload.scope.root}) — ${payload.linked ? 'linked' : 'installed'}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Refuse `plugins add --global` when `$VIBES_HOME` delegates to a host
|
|
138
|
+
* workspace (`vibes.hostWorkspace`).
|
|
139
|
+
*
|
|
140
|
+
* The rule is the same one `vibes update --global` applies: a delegated home
|
|
141
|
+
* owns no packages, because every process that reads it takes its module graph
|
|
142
|
+
* from the host workspace. Anything installed under the home would be a
|
|
143
|
+
* second closure — pinned to whatever the registry held that day — that the
|
|
144
|
+
* running graph never composes, yet which any path-based lookup of
|
|
145
|
+
* `$VIBES_HOME/node_modules/<pkg>` would find. An end-user home (no
|
|
146
|
+
* `hostWorkspace`) owns its packages and is unaffected.
|
|
147
|
+
*
|
|
148
|
+
* Throws before anything is seeded, written or installed.
|
|
149
|
+
*/
|
|
150
|
+
export function refuseDelegatedGlobalAdd(scope, packageName, plugins) {
|
|
151
|
+
if (scope.kind !== 'global')
|
|
152
|
+
return;
|
|
153
|
+
const hostWorkspace = plugins.readGlobalPluginScope(scope.root).hostWorkspace;
|
|
154
|
+
if (!hostWorkspace)
|
|
155
|
+
return;
|
|
156
|
+
throw addRefusal(`The global home ${scope.root} delegates to the host workspace ${hostWorkspace} and ` +
|
|
157
|
+
`owns no packages, so ${packageName} was not installed there. Select it in ` +
|
|
158
|
+
`${hostWorkspace} instead (its vibes.config plugins list, or ` +
|
|
159
|
+
`\`vibes plugins add ${packageName} --workspace\` from inside it). To make the ` +
|
|
160
|
+
'global home own packages again, run `vibes plugins host --global --clear` first.', 'plugin-add-home-delegated');
|
|
161
|
+
}
|
|
162
|
+
/** The command's inputs, each read on its own: a missing or non-text field is empty. */
|
|
163
|
+
const AddInputSchema = z.object({
|
|
164
|
+
package: z.string().trim().catch(''),
|
|
165
|
+
plugin: z.string().trim().catch('')
|
|
166
|
+
});
|
|
167
|
+
/** A refusal of the request itself. */
|
|
168
|
+
function addRefusal(message, reason) {
|
|
169
|
+
return new CapabilityError(message, 'INVALID_INPUT', { reason, retryable: false });
|
|
170
|
+
}
|
|
171
|
+
/** The plugin resolver's value-free text, typed, with the failure itself as cause when it gave one. */
|
|
172
|
+
function pluginLoadRefusal(failure) {
|
|
173
|
+
if (failure.cause === undefined) {
|
|
174
|
+
return new CapabilityError(failure.error, 'UNAVAILABLE', { reason: 'plugin-add-load-failed', retryable: false });
|
|
175
|
+
}
|
|
176
|
+
return new CapabilityError(failure.error, 'UNAVAILABLE', {
|
|
177
|
+
reason: 'plugin-add-load-failed',
|
|
178
|
+
retryable: false,
|
|
179
|
+
cause: failure.cause
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
/** A step's value, or the failure it raised, captured once. */
|
|
183
|
+
async function settleOutcome(step) {
|
|
184
|
+
try {
|
|
185
|
+
return { value: await step() };
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
return { failure: CaughtFailureSchema.parse(error) };
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* The add's failure, as thrown, when the undo was complete; otherwise a typed
|
|
193
|
+
* `plugin-add-rollback-incomplete` naming each undo step that failed
|
|
194
|
+
* (value-free), with every failure in `cause`.
|
|
195
|
+
*/
|
|
196
|
+
function rollbackCarried(failure, leftovers) {
|
|
197
|
+
if (leftovers.length === 0)
|
|
198
|
+
return failure;
|
|
199
|
+
return new CapabilityError(`${LoggedErrorSchema.parse(failure).message} (and the rollback did not complete)`, 'INTERNAL', {
|
|
200
|
+
reason: 'plugin-add-rollback-incomplete',
|
|
201
|
+
retryable: false,
|
|
202
|
+
details: { rollbackFailures: leftovers.map((leftover) => valueFreeFailure(leftover).name) },
|
|
203
|
+
cause: new AggregateError([failure, ...leftovers], 'The add failure, then each rollback failure')
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
//# sourceMappingURL=plugins.add.cli-command.impl.consumer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.add.cli-command.impl.consumer.js","sourceRoot":"","sources":["../../src/cli/plugins.add.cli-command.impl.consumer.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAIhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAA0B,MAAM,cAAc,CAAC;AACzE,OAAO,EACN,kBAAkB,EAClB,0BAA0B,EAC1B,6BAA6B,EAC7B,aAAa,EACb,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAsB,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,iBAAiB;IAClE,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@@ -0,0 +1,10 @@
|
|
|
1
|
+
const descriptor = {
|
|
2
|
+
kind: 'cli/group',
|
|
3
|
+
id: 'plugins',
|
|
4
|
+
name: 'plugins',
|
|
5
|
+
description: 'Install and manage scoped Bun package plugins (global and workspace)',
|
|
6
|
+
surfaces: ['cli'],
|
|
7
|
+
internal: false
|
|
8
|
+
};
|
|
9
|
+
export default descriptor;
|
|
10
|
+
//# sourceMappingURL=plugins.cli-group.descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.cli-group.descriptor.js","sourceRoot":"","sources":["../../src/cli/plugins.cli-group.descriptor.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAA4B;IAC3C,IAAI,EAAE,WAAW;IACjB,EAAE,EAAE,SAAS;IACb,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,sEAAsE;IACnF,QAAQ,EAAE,CAAC,KAAK,CAAC;IACjB,QAAQ,EAAE,KAAK;CACf,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
readonly id: "plugins.host";
|
|
3
|
+
readonly kind: "cli/command";
|
|
4
|
+
readonly name: "host";
|
|
5
|
+
readonly description: "Delegate the global scope to a self-hosting workspace (or show the delegation)";
|
|
6
|
+
readonly group: "plugins";
|
|
7
|
+
readonly surfaces: ["cli"];
|
|
8
|
+
readonly hardware: ["consumer"];
|
|
9
|
+
readonly requiredContext: ["cli/ui", "cli/output-format"];
|
|
10
|
+
readonly effects: {
|
|
11
|
+
readonly homeWrite: "required";
|
|
12
|
+
};
|
|
13
|
+
readonly arguments: [{
|
|
14
|
+
readonly name: "workspace";
|
|
15
|
+
readonly description: "Workspace root that supplies the framework graph";
|
|
16
|
+
readonly required: false;
|
|
17
|
+
readonly variadic: false;
|
|
18
|
+
}];
|
|
19
|
+
readonly options: [{
|
|
20
|
+
readonly flags: "--global";
|
|
21
|
+
readonly description: "Act on the global scope ($VIBES_HOME) — the only scope a delegation lives in; accepted for symmetry with the other plugins commands";
|
|
22
|
+
}, {
|
|
23
|
+
readonly flags: "--clear";
|
|
24
|
+
readonly description: "Remove the delegation";
|
|
25
|
+
}, {
|
|
26
|
+
readonly flags: "--dry-run";
|
|
27
|
+
readonly description: "Validate without writing";
|
|
28
|
+
}];
|
|
29
|
+
};
|
|
30
|
+
export default _default;
|
|
31
|
+
//# sourceMappingURL=plugins.host.cli-command.descriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.host.cli-command.descriptor.d.ts","sourceRoot":"","sources":["../../src/cli/plugins.host.cli-command.descriptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBAmCG"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createRuntimeAsset } from '@vibesdotdev/kernel';
|
|
2
|
+
export default createRuntimeAsset({
|
|
3
|
+
id: 'plugins.host',
|
|
4
|
+
kind: 'cli/command',
|
|
5
|
+
name: 'host',
|
|
6
|
+
description: 'Delegate the global scope to a self-hosting workspace (or show the delegation)',
|
|
7
|
+
group: 'plugins',
|
|
8
|
+
surfaces: ['cli'],
|
|
9
|
+
hardware: ['consumer'],
|
|
10
|
+
requiredContext: ['cli/ui', 'cli/output-format'],
|
|
11
|
+
// MEASURED, not conservatism: the PRIMARY path (`vibes plugins host --global
|
|
12
|
+
// <workspace>`, no `--clear`) calls `seedGlobalScope()` + `setGlobalHostWorkspace()`
|
|
13
|
+
// and creates `$VIBES_HOME/package.json` + `bunfig.toml` in a home that had
|
|
14
|
+
// neither. The previous `{ whenOption: 'clear' }` declaration therefore told
|
|
15
|
+
// `resolveCLIInvocationEffects` (cli/src/surface/invocation-effects.ts) that the
|
|
16
|
+
// one path that always writes the home writes nothing, and the bootstrap gates
|
|
17
|
+
// that read that boolean (cli/src/bootstrap.ts, runtime-surface-cli
|
|
18
|
+
// cli-bootstrap/session-lifecycle) were prepared for the wrong command.
|
|
19
|
+
effects: { homeWrite: 'required' },
|
|
20
|
+
arguments: [
|
|
21
|
+
{
|
|
22
|
+
name: 'workspace',
|
|
23
|
+
description: 'Workspace root that supplies the framework graph',
|
|
24
|
+
required: false,
|
|
25
|
+
variadic: false
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
options: [
|
|
29
|
+
{
|
|
30
|
+
flags: '--global',
|
|
31
|
+
description: 'Act on the global scope ($VIBES_HOME) — the only scope a delegation lives in; accepted for symmetry with the other plugins commands'
|
|
32
|
+
},
|
|
33
|
+
{ flags: '--clear', description: 'Remove the delegation' },
|
|
34
|
+
{ flags: '--dry-run', description: 'Validate without writing' }
|
|
35
|
+
]
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=plugins.host.cli-command.descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.host.cli-command.descriptor.js","sourceRoot":"","sources":["../../src/cli/plugins.host.cli-command.descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,eAAe,kBAAkB,CAAC;IACjC,EAAE,EAAE,cAAc;IAClB,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,gFAAgF;IAC7F,KAAK,EAAE,SAAS;IAChB,QAAQ,EAAE,CAAC,KAAK,CAAC;IACjB,QAAQ,EAAE,CAAC,UAAU,CAAC;IACtB,eAAe,EAAE,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IAChD,6EAA6E;IAC7E,qFAAqF;IACrF,4EAA4E;IAC5E,6EAA6E;IAC7E,iFAAiF;IACjF,+EAA+E;IAC/E,oEAAoE;IACpE,wEAAwE;IACxE,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;IAClC,SAAS,EAAE;QACV;YACC,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,kDAAkD;YAC/D,QAAQ,EAAE,KAAK;YACf,QAAQ,EAAE,KAAK;SACf;KACD;IACD,OAAO,EAAE;QACR;YACC,KAAK,EAAE,UAAU;YACjB,WAAW,EACV,qIAAqI;SACtI;QACD,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,uBAAuB,EAAE;QAC1D,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,0BAA0B,EAAE;KAC/D;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { CommandExecutionStartInfo } from '@vibesdotdev/cli/schemas/surface';
|
|
2
|
+
import type { CLICommandAssetDescriptor } from '@vibesdotdev/cli/schemas/types';
|
|
3
|
+
import { PluginsCLICommand, type PluginsCLIContext } from './context.ts';
|
|
4
|
+
/**
|
|
5
|
+
* `vibes plugins host --global <workspace>` — delegate the global scope.
|
|
6
|
+
*
|
|
7
|
+
* On a developer machine `$VIBES_HOME` should own NOTHING: no dependencies, no
|
|
8
|
+
* globs, no `node_modules`, no lock. It records one fact — which self-hosting
|
|
9
|
+
* workspace supplies the framework graph — and every invocation from any cwd
|
|
10
|
+
* then resolves R to that workspace and gets the same realpaths as `bun run
|
|
11
|
+
* vibes`. One `@vibesdotdev/kernel` machine-wide (plan §8 item 3).
|
|
12
|
+
*
|
|
13
|
+
* The delegation is VALIDATED before it is written: the target must actually
|
|
14
|
+
* materialize `@vibesdotdev/plugins`, either installed under its
|
|
15
|
+
* `node_modules` or expanded from its own `package.json#workspaces`. Writing
|
|
16
|
+
* an unvalidated `hostWorkspace` turns every future invocation into an exit 78
|
|
17
|
+
* from a file the user has no reason to suspect.
|
|
18
|
+
*
|
|
19
|
+
* Delegation and local ownership are exclusive by schema
|
|
20
|
+
* (`GlobalVibesManifestSchema`: `hostWorkspace` ⇒ `plugins: []`), so a home
|
|
21
|
+
* that already carries enabled plugins is refused with the exact repair rather
|
|
22
|
+
* than silently emptied.
|
|
23
|
+
*/
|
|
24
|
+
export default class PluginsHostCLICommand extends PluginsCLICommand {
|
|
25
|
+
constructor(descriptor: CLICommandAssetDescriptor, context: PluginsCLIContext);
|
|
26
|
+
execute(args: CommandExecutionStartInfo['args'], options: CommandExecutionStartInfo['options']): Promise<void>;
|
|
27
|
+
private emit;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=plugins.host.cli-command.impl.consumer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.host.cli-command.impl.consumer.d.ts","sourceRoot":"","sources":["../../src/cli/plugins.host.cli-command.impl.consumer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAKhF,OAAO,EAAE,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAWzE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,iBAAiB;gBACvD,UAAU,EAAE,yBAAyB,EAAE,OAAO,EAAE,iBAAiB;IAIvE,OAAO,CAAC,IAAI,EAAE,yBAAyB,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,yBAAyB,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IA6DpH,OAAO,CAAC,IAAI;CA8BZ"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { resolveFileSystemAdapter } from '@vibesdotdev/filesystem/client/resolve-adapter';
|
|
2
|
+
import { getRuntimePath } from '@vibesdotdev/paths';
|
|
3
|
+
import { getRuntimePackagePlugins } from '@vibesdotdev/kernel';
|
|
4
|
+
import { z } from 'zod/v4';
|
|
5
|
+
import { PluginsCLICommand } from "./context.js";
|
|
6
|
+
import { globalScopeRoot } from "./scopes.js";
|
|
7
|
+
import { seedGlobalScope, HOST_PACKAGE_NAME } from "./seed.js";
|
|
8
|
+
/** The command's inputs, each read on its own: a missing or non-text workspace is empty, a missing flag is off. */
|
|
9
|
+
const HostInputSchema = z.object({
|
|
10
|
+
workspace: z.string().trim().catch(''),
|
|
11
|
+
clear: z.boolean().catch(false),
|
|
12
|
+
dryRun: z.boolean().catch(false)
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* `vibes plugins host --global <workspace>` — delegate the global scope.
|
|
16
|
+
*
|
|
17
|
+
* On a developer machine `$VIBES_HOME` should own NOTHING: no dependencies, no
|
|
18
|
+
* globs, no `node_modules`, no lock. It records one fact — which self-hosting
|
|
19
|
+
* workspace supplies the framework graph — and every invocation from any cwd
|
|
20
|
+
* then resolves R to that workspace and gets the same realpaths as `bun run
|
|
21
|
+
* vibes`. One `@vibesdotdev/kernel` machine-wide (plan §8 item 3).
|
|
22
|
+
*
|
|
23
|
+
* The delegation is VALIDATED before it is written: the target must actually
|
|
24
|
+
* materialize `@vibesdotdev/plugins`, either installed under its
|
|
25
|
+
* `node_modules` or expanded from its own `package.json#workspaces`. Writing
|
|
26
|
+
* an unvalidated `hostWorkspace` turns every future invocation into an exit 78
|
|
27
|
+
* from a file the user has no reason to suspect.
|
|
28
|
+
*
|
|
29
|
+
* Delegation and local ownership are exclusive by schema
|
|
30
|
+
* (`GlobalVibesManifestSchema`: `hostWorkspace` ⇒ `plugins: []`), so a home
|
|
31
|
+
* that already carries enabled plugins is refused with the exact repair rather
|
|
32
|
+
* than silently emptied.
|
|
33
|
+
*/
|
|
34
|
+
export default class PluginsHostCLICommand extends PluginsCLICommand {
|
|
35
|
+
constructor(descriptor, context) {
|
|
36
|
+
super(descriptor, context);
|
|
37
|
+
}
|
|
38
|
+
async execute(args, options) {
|
|
39
|
+
const input = HostInputSchema.parse({ ...args, ...options, workspace: args.workspace });
|
|
40
|
+
const plugins = await getRuntimePackagePlugins(this.runtime);
|
|
41
|
+
const vibesHome = await globalScopeRoot(this.runtime);
|
|
42
|
+
const scope = plugins.readGlobalPluginScope(vibesHome);
|
|
43
|
+
if (input.clear) {
|
|
44
|
+
if (!input.dryRun)
|
|
45
|
+
await plugins.setGlobalHostWorkspace(vibesHome, null);
|
|
46
|
+
this.emit({
|
|
47
|
+
vibesHome,
|
|
48
|
+
hostWorkspace: null,
|
|
49
|
+
previous: scope.hostWorkspace ?? null,
|
|
50
|
+
dryRun: input.dryRun
|
|
51
|
+
});
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const requested = input.workspace;
|
|
55
|
+
if (!requested) {
|
|
56
|
+
this.emit({ vibesHome, hostWorkspace: scope.hostWorkspace ?? null, previous: null, read: true });
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const paths = await getRuntimePath(this.runtime);
|
|
60
|
+
const filesystem = await resolveFileSystemAdapter(this.runtime, { binding: false });
|
|
61
|
+
const workspace = paths.resolve(requested);
|
|
62
|
+
if (!(await filesystem.exists(paths.join(workspace, 'package.json')))) {
|
|
63
|
+
throw new Error(`${workspace} has no package.json — it is not a bun root`);
|
|
64
|
+
}
|
|
65
|
+
const installed = await filesystem.exists(paths.join(workspace, 'node_modules', ...HOST_PACKAGE_NAME.split('/'), 'package.json'));
|
|
66
|
+
const member = plugins.expandWorkspaceMembers(workspace).has(HOST_PACKAGE_NAME);
|
|
67
|
+
if (!installed && !member) {
|
|
68
|
+
throw new Error(`${workspace} does not materialize ${HOST_PACKAGE_NAME}: it is neither installed under ` +
|
|
69
|
+
`its node_modules nor a member of its package.json#workspaces. Delegating to it would ` +
|
|
70
|
+
`make every vibes invocation fail to find a host. Run 'bun install' there first.`);
|
|
71
|
+
}
|
|
72
|
+
if (scope.plugins.length > 0) {
|
|
73
|
+
throw new Error(`${scope.manifestPath} still enables ${scope.plugins.length} plugin(s) ` +
|
|
74
|
+
`(${scope.plugins.join(', ')}). A delegated home owns no list. Remove them first ` +
|
|
75
|
+
`(vibes plugins remove --global <name>) or run: vibes update --repair --global`);
|
|
76
|
+
}
|
|
77
|
+
if (!input.dryRun) {
|
|
78
|
+
await seedGlobalScope(this.runtime, { home: vibesHome });
|
|
79
|
+
await plugins.setGlobalHostWorkspace(vibesHome, workspace);
|
|
80
|
+
}
|
|
81
|
+
this.emit({
|
|
82
|
+
vibesHome,
|
|
83
|
+
hostWorkspace: workspace,
|
|
84
|
+
previous: scope.hostWorkspace ?? null,
|
|
85
|
+
dryRun: input.dryRun,
|
|
86
|
+
via: member ? 'workspaces member' : 'installed'
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
emit(payload) {
|
|
90
|
+
if (this.format === 'json') {
|
|
91
|
+
this.ui.json(payload);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (payload.read) {
|
|
95
|
+
this.ui.info(payload.hostWorkspace
|
|
96
|
+
? `${payload.vibesHome} delegates to ${payload.hostWorkspace}`
|
|
97
|
+
: `${payload.vibesHome} owns its own plugin scope (no hostWorkspace)`);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const prefix = payload.dryRun ? 'Would set' : 'Set';
|
|
101
|
+
if (!payload.hostWorkspace) {
|
|
102
|
+
this.ui.success(`${prefix} ${payload.vibesHome} back to owning its own plugin scope`);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
this.ui.success(`${prefix} hostWorkspace = ${payload.hostWorkspace} (${payload.via ?? 'validated'}) — ` +
|
|
106
|
+
`every vibes invocation now resolves its graph there`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=plugins.host.cli-command.impl.consumer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.host.cli-command.impl.consumer.js","sourceRoot":"","sources":["../../src/cli/plugins.host.cli-command.impl.consumer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,CAAC,E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AC,CAAC,GAAG,OAAO,CAAC,SAAS,+CAA+C,CACtE,CAAC;YACF,OAAO;QACR,CAAC;QACD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC;QACpD,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;YAC5B,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,MAAM,IAAI,OAAO,CAAC,SAAS,sCAAsC,CAAC,CAAC;YACtF,OAAO;QACR,CAAC;QACD,IAAI,CAAC,EAAE,CAAC,OAAO,CACd,GAAG,MAAM,oBAAoB,OAAO,CAAC,aAAa,KAAK,OAAO,CAAC,GAAG,IAAI,WAAW,MAAM;YACtF,qDAAqD,CACtD,CAAC;IACH,CAAC;CACD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
readonly id: "plugins.link";
|
|
3
|
+
readonly kind: "cli/command";
|
|
4
|
+
readonly name: "link";
|
|
5
|
+
readonly description: "Link a provider path glob into a scope with bun-native workspaces";
|
|
6
|
+
readonly group: "plugins";
|
|
7
|
+
readonly surfaces: ["cli"];
|
|
8
|
+
readonly hardware: ["consumer"];
|
|
9
|
+
readonly requiredContext: ["cli/ui", "cli/output-format"];
|
|
10
|
+
readonly effects: {
|
|
11
|
+
readonly homeWrite: "required";
|
|
12
|
+
};
|
|
13
|
+
readonly arguments: [{
|
|
14
|
+
readonly name: "glob";
|
|
15
|
+
readonly description: "Path glob whose members become linked packages, for example /abs/providers/*";
|
|
16
|
+
readonly required: true;
|
|
17
|
+
readonly variadic: false;
|
|
18
|
+
}];
|
|
19
|
+
readonly options: [{
|
|
20
|
+
readonly flags: "--global";
|
|
21
|
+
readonly description: "Act on the global scope ($VIBES_HOME)";
|
|
22
|
+
}, {
|
|
23
|
+
readonly flags: "--workspace";
|
|
24
|
+
readonly description: "Act on the current workspace scope";
|
|
25
|
+
}, {
|
|
26
|
+
readonly flags: "--dry-run";
|
|
27
|
+
readonly description: "Report what would be linked without writing";
|
|
28
|
+
}];
|
|
29
|
+
readonly examples: [{
|
|
30
|
+
readonly command: "vibes plugins link '/Users/me/providers/*' --global";
|
|
31
|
+
readonly description: "Link every package under a provider directory into the global scope";
|
|
32
|
+
}];
|
|
33
|
+
};
|
|
34
|
+
export default _default;
|
|
35
|
+
//# sourceMappingURL=plugins.link.cli-command.descriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.link.cli-command.descriptor.d.ts","sourceRoot":"","sources":["../../src/cli/plugins.link.cli-command.descriptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBA8BG"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createRuntimeAsset } from '@vibesdotdev/kernel';
|
|
2
|
+
export default createRuntimeAsset({
|
|
3
|
+
id: 'plugins.link',
|
|
4
|
+
kind: 'cli/command',
|
|
5
|
+
name: 'link',
|
|
6
|
+
description: 'Link a provider path glob into a scope with bun-native workspaces',
|
|
7
|
+
group: 'plugins',
|
|
8
|
+
surfaces: ['cli'],
|
|
9
|
+
hardware: ['consumer'],
|
|
10
|
+
requiredContext: ['cli/ui', 'cli/output-format'],
|
|
11
|
+
effects: { homeWrite: 'required' },
|
|
12
|
+
arguments: [
|
|
13
|
+
{
|
|
14
|
+
name: 'glob',
|
|
15
|
+
description: 'Path glob whose members become linked packages, for example /abs/providers/*',
|
|
16
|
+
required: true,
|
|
17
|
+
variadic: false
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
options: [
|
|
21
|
+
{ flags: '--global', description: 'Act on the global scope ($VIBES_HOME)' },
|
|
22
|
+
{ flags: '--workspace', description: 'Act on the current workspace scope' },
|
|
23
|
+
{ flags: '--dry-run', description: 'Report what would be linked without writing' }
|
|
24
|
+
],
|
|
25
|
+
examples: [
|
|
26
|
+
{
|
|
27
|
+
command: "vibes plugins link '/Users/me/providers/*' --global",
|
|
28
|
+
description: 'Link every package under a provider directory into the global scope'
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=plugins.link.cli-command.descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.link.cli-command.descriptor.js","sourceRoot":"","sources":["../../src/cli/plugins.link.cli-command.descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,eAAe,kBAAkB,CAAC;IACjC,EAAE,EAAE,cAAc;IAClB,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,mEAAmE;IAChF,KAAK,EAAE,SAAS;IAChB,QAAQ,EAAE,CAAC,KAAK,CAAC;IACjB,QAAQ,EAAE,CAAC,UAAU,CAAC;IACtB,eAAe,EAAE,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IAChD,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;IAClC,SAAS,EAAE;QACV;YACC,IAAI,EAAE,MAAM;YACZ,WAAW,EACV,8EAA8E;YAC/E,QAAQ,EAAE,IAAI;YACd,QAAQ,EAAE,KAAK;SACf;KACD;IACD,OAAO,EAAE;QACR,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,uCAAuC,EAAE;QAC3E,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,oCAAoC,EAAE;QAC3E,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,6CAA6C,EAAE;KAClF;IACD,QAAQ,EAAE;QACT;YACC,OAAO,EAAE,qDAAqD;YAC9D,WAAW,EAAE,qEAAqE;SAClF;KACD;CACD,CAAC,CAAC"}
|