@vibesdotdev/plugins 0.0.0-stage → 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +364 -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":"context.d.ts","sourceRoot":"","sources":["../../src/cli/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,8BAAsB,iBAAiB;IACtC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IACzC,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC;IACjC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEtB,WAAW,EAAE,yBAAyB,EAAE,OAAO,EAAE,iBAAiB;CAK9E"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class PluginsCLICommand {
|
|
2
|
+
runtime;
|
|
3
|
+
ui;
|
|
4
|
+
format;
|
|
5
|
+
constructor(_descriptor, context) {
|
|
6
|
+
this.runtime = context.runtime;
|
|
7
|
+
this.ui = context['cli/ui'];
|
|
8
|
+
this.format = context['cli/output-format'] ?? 'table';
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/cli/context.ts"],"names":[],"mappings":"AAOA,MAAM,OAAgB,iBAAiB;IACnB,OAAO,CAAe;IACtB,EAAE,CAAY;IACd,MAAM,CAAS;IAElC,YAAY,WAAsC,EAAE,OAA0B;QAC7E,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,IAAI,OAAO,CAAC;IACvD,CAAC;CACD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one way this package reaches `runtime/execution`: the declared fact
|
|
3
|
+
* first, so a host that composes no execution implementation refuses typed
|
|
4
|
+
* (`UNAVAILABLE` `plugin-execution-unavailable`) before anything resolves.
|
|
5
|
+
*/
|
|
6
|
+
import { type VibesRuntime } from '@vibesdotdev/kernel';
|
|
7
|
+
import type { RuntimeExecution } from '@vibesdotdev/kernel/execution';
|
|
8
|
+
/** The host's execution implementation for `purpose` (named in the refusal), or the typed refusal. */
|
|
9
|
+
export declare function resolveRuntimeExecution(runtime: VibesRuntime, purpose: string): Promise<RuntimeExecution>;
|
|
10
|
+
//# sourceMappingURL=execution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/cli/execution.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,KAAK,EAAuB,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAE3F,sGAAsG;AACtG,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAY/G"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one way this package reaches `runtime/execution`: the declared fact
|
|
3
|
+
* first, so a host that composes no execution implementation refuses typed
|
|
4
|
+
* (`UNAVAILABLE` `plugin-execution-unavailable`) before anything resolves.
|
|
5
|
+
*/
|
|
6
|
+
import { CapabilityError } from '@vibesdotdev/kernel';
|
|
7
|
+
/** The host's execution implementation for `purpose` (named in the refusal), or the typed refusal. */
|
|
8
|
+
export async function resolveRuntimeExecution(runtime, purpose) {
|
|
9
|
+
const declared = runtime.hasKind('runtime/execution') &&
|
|
10
|
+
runtime.query('runtime/execution').descriptors().length > 0;
|
|
11
|
+
if (!declared) {
|
|
12
|
+
throw new CapabilityError(`No consumer runtime/execution implementation can run the ${purpose}.`, 'UNAVAILABLE', {
|
|
13
|
+
reason: 'plugin-execution-unavailable',
|
|
14
|
+
retryable: false,
|
|
15
|
+
details: { kind: 'runtime/execution', purpose }
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return await runtime.query('runtime/execution').resolve();
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=execution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../../src/cli/execution.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAqB,MAAM,qBAAqB,CAAC;AAGzE,sGAAsG;AACtG,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,OAAqB,EAAE,OAAe;IACnF,MAAM,QAAQ,GACb,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC;QACpC,OAAO,CAAC,KAAK,CAAwC,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;IACpG,IAAI,CAAC,QAAQ,EAAE,CAAC;QACf,MAAM,IAAI,eAAe,CAAC,4DAA4D,OAAO,GAAG,EAAE,aAAa,EAAE;YAChH,MAAM,EAAE,8BAA8B;YACtC,SAAS,EAAE,KAAK;YAChB,OAAO,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE;SAC/C,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,OAAO,CAAC,KAAK,CAAwC,mBAAmB,CAAC,CAAC,OAAO,EAAE,CAAC;AAClG,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The facts this package reads off a caught failure: its errno (`ENOENT`,
|
|
3
|
+
* `EACCES`, …) and whether it is the loader's miss of a module that is not
|
|
4
|
+
* installed. Each is read once inside a guard: a failure whose field read
|
|
5
|
+
* throws (a hostile getter or Proxy) is not classifiable, and that is a typed
|
|
6
|
+
* refusal carrying both failures, never a silent "no code".
|
|
7
|
+
*/
|
|
8
|
+
import { type CaughtFailure } from '@vibesdotdev/kernel';
|
|
9
|
+
/** The errno of a caught failure, or `undefined` when it carries none. A read that throws refuses typed. */
|
|
10
|
+
export declare function errnoOf(failure: CaughtFailure): string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Only the requested package's own loader miss is absence. Unattributable,
|
|
13
|
+
* transitive and unreadable failures return false so callers propagate them.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isModuleAbsent(failure: CaughtFailure, specifier: string): boolean;
|
|
16
|
+
//# sourceMappingURL=failure-facts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failure-facts.d.ts","sourceRoot":"","sources":["../../src/cli/failure-facts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAwC,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAgB/F,4GAA4G;AAC5G,wBAAgB,OAAO,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,CAQlE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAEjF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The facts this package reads off a caught failure: its errno (`ENOENT`,
|
|
3
|
+
* `EACCES`, …) and whether it is the loader's miss of a module that is not
|
|
4
|
+
* installed. Each is read once inside a guard: a failure whose field read
|
|
5
|
+
* throws (a hostile getter or Proxy) is not classifiable, and that is a typed
|
|
6
|
+
* refusal carrying both failures, never a silent "no code".
|
|
7
|
+
*/
|
|
8
|
+
import { CapabilityError, CaughtFailureSchema } from '@vibesdotdev/kernel';
|
|
9
|
+
import { z } from 'zod/v4';
|
|
10
|
+
import { classifyOptionalLoad } from "../core/optional-plugin.js";
|
|
11
|
+
/** A native failure's errno code, read from its own field. */
|
|
12
|
+
const NativeFailureSchema = z.object({ code: z.string() });
|
|
13
|
+
/** The refusal for a failure whose own fields could not be read. */
|
|
14
|
+
function unreadableFailure(failure, unreadable) {
|
|
15
|
+
return new CapabilityError('A failure could not be classified: reading its code threw.', 'INTERNAL', {
|
|
16
|
+
reason: 'plugin-failure-unreadable',
|
|
17
|
+
retryable: false,
|
|
18
|
+
cause: new AggregateError([failure, unreadable], 'The failure, then the failure reading its code')
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/** The errno of a caught failure, or `undefined` when it carries none. A read that throws refuses typed. */
|
|
22
|
+
export function errnoOf(failure) {
|
|
23
|
+
let native;
|
|
24
|
+
try {
|
|
25
|
+
native = NativeFailureSchema.safeParse(failure);
|
|
26
|
+
}
|
|
27
|
+
catch (unreadable) {
|
|
28
|
+
throw unreadableFailure(failure, CaughtFailureSchema.parse(unreadable));
|
|
29
|
+
}
|
|
30
|
+
return native.success ? native.data.code : undefined;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Only the requested package's own loader miss is absence. Unattributable,
|
|
34
|
+
* transitive and unreadable failures return false so callers propagate them.
|
|
35
|
+
*/
|
|
36
|
+
export function isModuleAbsent(failure, specifier) {
|
|
37
|
+
return classifyOptionalLoad(specifier, failure).absent;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=failure-facts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failure-facts.js","sourceRoot":"","sources":["../../src/cli/failure-facts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAsB,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,8DAA8D;AAC9D,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAE3D,oEAAoE;AACpE,SAAS,iBAAiB,CAAC,OAAsB,EAAE,UAAyB;IAC3E,OAAO,IAAI,eAAe,CAAC,4DAA4D,EAAE,UAAU,EAAE;QACpG,MAAM,EAAE,2BAA2B;QACnC,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,IAAI,cAAc,CAAC,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,gDAAgD,CAAC;KAClG,CAAC,CAAC;AACJ,CAAC;AAED,4GAA4G;AAC5G,MAAM,UAAU,OAAO,CAAC,OAAsB;IAC7C,IAAI,MAAiE,CAAC;IACtE,IAAI,CAAC;QACJ,MAAM,GAAG,mBAAmB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;IAAC,OAAO,UAAU,EAAE,CAAC;QACrB,MAAM,iBAAiB,CAAC,OAAO,EAAE,mBAAmB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AACtD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,OAAsB,EAAE,SAAiB;IACvE,OAAO,oBAAoB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ONE way a plugin command runs Bun.
|
|
3
|
+
*
|
|
4
|
+
* ### The npm branch is gone (Rule 7 consumer list)
|
|
5
|
+
*
|
|
6
|
+
* `choosePackageManager` used to probe for `bun` then `npm`, refuse a home
|
|
7
|
+
* carrying both lock authorities, and translate every action into
|
|
8
|
+
* `npm install --prefix … --save-exact`. It had exactly four consumers, all in
|
|
9
|
+
* this directory: `plugins.add.cli-command.impl.consumer.ts`,
|
|
10
|
+
* `plugins.remove.cli-command.impl.consumer.ts`, the `--manager <bun|npm>`
|
|
11
|
+
* option on both descriptors, and `package-manager.consumer.test.ts`. All four
|
|
12
|
+
* are updated in the same change. Nothing outside `plugins/src/cli` ever
|
|
13
|
+
* imported the module (grepped across `repos/`), and no SPEC contract survives
|
|
14
|
+
* it — the plugins SPEC line that promised an "npm-compatible fallback" is
|
|
15
|
+
* corrected in the same commit.
|
|
16
|
+
*
|
|
17
|
+
* It went for a measured reason, not tidiness. A compiled `vibes` has no `bun`
|
|
18
|
+
* on `PATH` it can trust and no npm at all; the host command's
|
|
19
|
+
* `scriptRuntimeArgv()` (`runtime/host-command`, owner: the selected
|
|
20
|
+
* environment) answers with the RUNNING executable plus
|
|
21
|
+
* `BUN_BE_BUN=1`, so the Bun that installs your plugins is byte-identical to
|
|
22
|
+
* the Bun the host was built with. An npm-installed tree cannot satisfy
|
|
23
|
+
* `workspace:*`, cannot expand `package.json#workspaces` link globs, and
|
|
24
|
+
* writes a `package-lock.json` the graph nerve (`bun.lock` digest, plan §7)
|
|
25
|
+
* cannot read — i.e. the npm path could not implement any of requirements 2,
|
|
26
|
+
* 3, or 4. Keeping it would have meant shipping a silently different scope.
|
|
27
|
+
*
|
|
28
|
+
* ### Ranges: caret, never `--exact`
|
|
29
|
+
*
|
|
30
|
+
* `bun add --exact` pinned the global home to the patch it happened to see, so
|
|
31
|
+
* `vibes update` could never move it. Registry packages get `^<version>`;
|
|
32
|
+
* packages supplied by a `workspaces` link glob get `workspace:*`. Both are
|
|
33
|
+
* written by the environment's manifest writers — this module only runs bun.
|
|
34
|
+
*
|
|
35
|
+
* ### `--cwd`, measured
|
|
36
|
+
*
|
|
37
|
+
* `runBun` passes BOTH `--cwd D` and spawns with `cwd: D`. Measured on Bun
|
|
38
|
+
* 1.4.0: `bun install --cwd D` from a foreign cwd DOES read `D/bunfig.toml`
|
|
39
|
+
* (a scope URL of `http://127.0.0.1:9/` there produced `ConnectionRefused`,
|
|
40
|
+
* while removing that file produced a request to the ambient registry). The
|
|
41
|
+
* process cwd is set anyway so the behaviour does not depend on that detail
|
|
42
|
+
* surviving a Bun upgrade.
|
|
43
|
+
*/
|
|
44
|
+
import { type VibesRuntime } from '@vibesdotdev/kernel';
|
|
45
|
+
/** Default ceiling for one bun invocation. A cold registry install is slow. */
|
|
46
|
+
export declare const BUN_ACTION_TIMEOUT_MS: number;
|
|
47
|
+
export declare function packageNameFromInstallSpec(specifier: string): string | null;
|
|
48
|
+
/**
|
|
49
|
+
* The version selector a coordinate asked for, or `null` for a bare name.
|
|
50
|
+
* `@example/widget@^1.2.0` → `^1.2.0`; `@fx/local@workspace:*` → `workspace:*`.
|
|
51
|
+
*/
|
|
52
|
+
export declare function requestedRangeFromInstallSpec(specifier: string): string | null;
|
|
53
|
+
/** A scope manifest's install inputs. */
|
|
54
|
+
export interface ScopeDeclarations {
|
|
55
|
+
readonly dependencies: readonly string[];
|
|
56
|
+
readonly workspaces: readonly string[];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Does the scope manifest at `root` already declare `packageName`? A scope
|
|
60
|
+
* with no manifest yet declares nothing. A manifest that is there but cannot
|
|
61
|
+
* be read or parsed fails typed (`plugin-scope-manifest-unreadable`, the
|
|
62
|
+
* original as `cause`): read as "not declared", a failed add would roll back
|
|
63
|
+
* a dependency the scope already had.
|
|
64
|
+
*/
|
|
65
|
+
export declare function hasScopeDependency(runtime: VibesRuntime, root: string, packageName: string): Promise<boolean>;
|
|
66
|
+
/**
|
|
67
|
+
* The install inputs the scope manifest at `root` declares, or `null` when the
|
|
68
|
+
* scope has no manifest yet. A manifest that is there but cannot be read or
|
|
69
|
+
* parsed refuses typed (`plugin-scope-manifest-unreadable`, original as
|
|
70
|
+
* cause): an unreadable scope is a refused scope, never "assume it declares
|
|
71
|
+
* packages".
|
|
72
|
+
*/
|
|
73
|
+
export declare function readScopeDeclarations(runtime: VibesRuntime, root: string): Promise<ScopeDeclarations | null>;
|
|
74
|
+
/** @deprecated Name kept for the global-only callers; prefer `hasScopeDependency`. */
|
|
75
|
+
export declare const hasGlobalDependency: typeof hasScopeDependency;
|
|
76
|
+
export interface RunBunInput {
|
|
77
|
+
runtime: VibesRuntime;
|
|
78
|
+
/** `install`, `add`, `remove`, `update`, `pm`, … */
|
|
79
|
+
action: string;
|
|
80
|
+
/** The scope root bun operates on. Passed as `--cwd` AND as the process cwd. */
|
|
81
|
+
cwd: string;
|
|
82
|
+
args?: ReadonlyArray<string>;
|
|
83
|
+
timeoutMs?: number;
|
|
84
|
+
/** Extra environment for this child only. Callers never pass a token. */
|
|
85
|
+
env?: Record<string, string>;
|
|
86
|
+
}
|
|
87
|
+
export interface RunBunResult {
|
|
88
|
+
/** Exactly what was spawned, for a `--dry-run` receipt and for diagnostics. */
|
|
89
|
+
argv: string[];
|
|
90
|
+
exitCode: number | null;
|
|
91
|
+
stdout: string;
|
|
92
|
+
stderr: string;
|
|
93
|
+
timedOut: boolean;
|
|
94
|
+
durationMs: number;
|
|
95
|
+
}
|
|
96
|
+
/** Render the command line `runBun` WOULD spawn, without spawning it. */
|
|
97
|
+
export declare function planBun(input: RunBunInput): Promise<string[]>;
|
|
98
|
+
/**
|
|
99
|
+
* Run one Bun action against a scope root and return its exit code, output
|
|
100
|
+
* and timing. A non-zero exit is a result here, not an error; `runBunOrThrow`
|
|
101
|
+
* is the one that throws.
|
|
102
|
+
*/
|
|
103
|
+
export declare function runBun(input: RunBunInput): Promise<RunBunResult>;
|
|
104
|
+
/** `runBun` + "a non-zero exit is an error", which is what every caller wants. */
|
|
105
|
+
export declare function runBunOrThrow(input: RunBunInput): Promise<RunBunResult>;
|
|
106
|
+
//# sourceMappingURL=package-manager.consumer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-manager.consumer.d.ts","sourceRoot":"","sources":["../../src/cli/package-manager.consumer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAGH,OAAO,EAAwF,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAc9I,+EAA+E;AAC/E,eAAO,MAAM,qBAAqB,QAAc,CAAC;AAEjD,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAS3E;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAM9E;AAcD,yCAAyC;AACzC,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAoBD;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAcnH;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAiBlH;AAED,sFAAsF;AACtF,eAAO,MAAM,mBAAmB,2BAAqB,CAAC;AAuBtD,MAAM,WAAW,WAAW;IAC3B,OAAO,EAAE,YAAY,CAAC;IACtB,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IAC5B,+EAA+E;IAC/E,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACnB;AAyBD,yEAAyE;AACzE,wBAAsB,OAAO,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAGnE;AAED;;;;GAIG;AACH,wBAAsB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAEtE;AAkCD,kFAAkF;AAClF,wBAAsB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAiB7E"}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ONE way a plugin command runs Bun.
|
|
3
|
+
*
|
|
4
|
+
* ### The npm branch is gone (Rule 7 consumer list)
|
|
5
|
+
*
|
|
6
|
+
* `choosePackageManager` used to probe for `bun` then `npm`, refuse a home
|
|
7
|
+
* carrying both lock authorities, and translate every action into
|
|
8
|
+
* `npm install --prefix … --save-exact`. It had exactly four consumers, all in
|
|
9
|
+
* this directory: `plugins.add.cli-command.impl.consumer.ts`,
|
|
10
|
+
* `plugins.remove.cli-command.impl.consumer.ts`, the `--manager <bun|npm>`
|
|
11
|
+
* option on both descriptors, and `package-manager.consumer.test.ts`. All four
|
|
12
|
+
* are updated in the same change. Nothing outside `plugins/src/cli` ever
|
|
13
|
+
* imported the module (grepped across `repos/`), and no SPEC contract survives
|
|
14
|
+
* it — the plugins SPEC line that promised an "npm-compatible fallback" is
|
|
15
|
+
* corrected in the same commit.
|
|
16
|
+
*
|
|
17
|
+
* It went for a measured reason, not tidiness. A compiled `vibes` has no `bun`
|
|
18
|
+
* on `PATH` it can trust and no npm at all; the host command's
|
|
19
|
+
* `scriptRuntimeArgv()` (`runtime/host-command`, owner: the selected
|
|
20
|
+
* environment) answers with the RUNNING executable plus
|
|
21
|
+
* `BUN_BE_BUN=1`, so the Bun that installs your plugins is byte-identical to
|
|
22
|
+
* the Bun the host was built with. An npm-installed tree cannot satisfy
|
|
23
|
+
* `workspace:*`, cannot expand `package.json#workspaces` link globs, and
|
|
24
|
+
* writes a `package-lock.json` the graph nerve (`bun.lock` digest, plan §7)
|
|
25
|
+
* cannot read — i.e. the npm path could not implement any of requirements 2,
|
|
26
|
+
* 3, or 4. Keeping it would have meant shipping a silently different scope.
|
|
27
|
+
*
|
|
28
|
+
* ### Ranges: caret, never `--exact`
|
|
29
|
+
*
|
|
30
|
+
* `bun add --exact` pinned the global home to the patch it happened to see, so
|
|
31
|
+
* `vibes update` could never move it. Registry packages get `^<version>`;
|
|
32
|
+
* packages supplied by a `workspaces` link glob get `workspace:*`. Both are
|
|
33
|
+
* written by the environment's manifest writers — this module only runs bun.
|
|
34
|
+
*
|
|
35
|
+
* ### `--cwd`, measured
|
|
36
|
+
*
|
|
37
|
+
* `runBun` passes BOTH `--cwd D` and spawns with `cwd: D`. Measured on Bun
|
|
38
|
+
* 1.4.0: `bun install --cwd D` from a foreign cwd DOES read `D/bunfig.toml`
|
|
39
|
+
* (a scope URL of `http://127.0.0.1:9/` there produced `ConnectionRefused`,
|
|
40
|
+
* while removing that file produced a request to the ambient registry). The
|
|
41
|
+
* process cwd is set anyway so the behaviour does not depend on that detail
|
|
42
|
+
* surviving a Bun upgrade.
|
|
43
|
+
*/
|
|
44
|
+
import { resolveFileSystemAdapter } from '@vibesdotdev/filesystem/client/resolve-adapter';
|
|
45
|
+
import { CapabilityError, settle, composeChildEnv, getRuntimeHostCommands } from '@vibesdotdev/kernel';
|
|
46
|
+
import { redactedExcerpt, redactCredentials } from '@vibesdotdev/shared/utils';
|
|
47
|
+
import * as z from 'zod/v4';
|
|
48
|
+
import { hostArgv } from '@vibesdotdev/cli/host-argv';
|
|
49
|
+
import { resolveCliFlags } from '@vibesdotdev/cli/providers';
|
|
50
|
+
import { summarizeChildFailure } from "./child-failure.js";
|
|
51
|
+
import { resolveRuntimeExecution } from "./execution.js";
|
|
52
|
+
import { errnoOf } from "./failure-facts.js";
|
|
53
|
+
import { ensureRegistrySignIn, explainRegistryFailure, registryInstallEnv } from "./registry-sign-in.consumer.js";
|
|
54
|
+
/** Default ceiling for one bun invocation. A cold registry install is slow. */
|
|
55
|
+
export const BUN_ACTION_TIMEOUT_MS = 10 * 60_000;
|
|
56
|
+
export function packageNameFromInstallSpec(specifier) {
|
|
57
|
+
const value = specifier.trim();
|
|
58
|
+
if (!value || /^(?:\.|\/|file:|https?:|git(?:\+|:)|github:)/.test(value))
|
|
59
|
+
return null;
|
|
60
|
+
if (value.startsWith('@')) {
|
|
61
|
+
const match = /^(@[a-z0-9][a-z0-9._~-]*\/[a-z0-9][a-z0-9._~-]*)(?:@[^/]+)?$/i.exec(value);
|
|
62
|
+
return match?.[1] ?? null;
|
|
63
|
+
}
|
|
64
|
+
const match = /^([a-z0-9][a-z0-9._~-]*)(?:@[^/]+)?$/i.exec(value);
|
|
65
|
+
return match?.[1] ?? null;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The version selector a coordinate asked for, or `null` for a bare name.
|
|
69
|
+
* `@example/widget@^1.2.0` → `^1.2.0`; `@fx/local@workspace:*` → `workspace:*`.
|
|
70
|
+
*/
|
|
71
|
+
export function requestedRangeFromInstallSpec(specifier) {
|
|
72
|
+
const value = specifier.trim();
|
|
73
|
+
const at = value.lastIndexOf('@');
|
|
74
|
+
if (at <= 0)
|
|
75
|
+
return null;
|
|
76
|
+
const range = value.slice(at + 1);
|
|
77
|
+
return range.length > 0 && !range.includes('/') ? range : null;
|
|
78
|
+
}
|
|
79
|
+
/** The part of a scope manifest this module reads; every other field passes through untouched. */
|
|
80
|
+
const ScopeManifestDependenciesSchema = z.object({
|
|
81
|
+
dependencies: z.object({}).catchall(z.string()).optional()
|
|
82
|
+
});
|
|
83
|
+
/** What a scope manifest declares for bun to install: its dependency names and `workspaces` globs. */
|
|
84
|
+
const ScopeDeclarationsSchema = z.object({
|
|
85
|
+
dependencies: z.object({}).catchall(z.string()).optional(),
|
|
86
|
+
// bun takes either the list or `{ packages: [...] }`.
|
|
87
|
+
workspaces: z.union([z.array(z.string()), z.object({ packages: z.array(z.string()).optional() })]).optional()
|
|
88
|
+
});
|
|
89
|
+
/** `null` when the scope has no manifest yet (`ENOENT`); any other read failure is forwarded typed. */
|
|
90
|
+
function absentScopeManifest(cause, manifestPath) {
|
|
91
|
+
if (errnoOf(cause) === 'ENOENT')
|
|
92
|
+
return null;
|
|
93
|
+
throw new CapabilityError(`The scope manifest ${manifestPath} could not be read.`, 'UNAVAILABLE', {
|
|
94
|
+
reason: 'plugin-scope-manifest-unreadable',
|
|
95
|
+
details: { path: manifestPath },
|
|
96
|
+
cause
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/** The manifest's text, or `null` when the scope has none yet; read through the runtime's filesystem. */
|
|
100
|
+
async function readScopeManifest(runtime, manifestPath) {
|
|
101
|
+
const filesystem = await resolveFileSystemAdapter(runtime, { binding: false });
|
|
102
|
+
const read = await settle(() => filesystem.readFile(manifestPath, 'utf8'));
|
|
103
|
+
if (!read.ok)
|
|
104
|
+
return absentScopeManifest(read.cause, manifestPath);
|
|
105
|
+
return read.value instanceof Uint8Array ? new TextDecoder().decode(read.value) : read.value;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Does the scope manifest at `root` already declare `packageName`? A scope
|
|
109
|
+
* with no manifest yet declares nothing. A manifest that is there but cannot
|
|
110
|
+
* be read or parsed fails typed (`plugin-scope-manifest-unreadable`, the
|
|
111
|
+
* original as `cause`): read as "not declared", a failed add would roll back
|
|
112
|
+
* a dependency the scope already had.
|
|
113
|
+
*/
|
|
114
|
+
export async function hasScopeDependency(runtime, root, packageName) {
|
|
115
|
+
const filesystem = await resolveFileSystemAdapter(runtime, { binding: false });
|
|
116
|
+
const manifestPath = filesystem.join(root, 'package.json');
|
|
117
|
+
const text = await readScopeManifest(runtime, manifestPath);
|
|
118
|
+
if (text === null)
|
|
119
|
+
return false;
|
|
120
|
+
try {
|
|
121
|
+
return packageName in (ScopeManifestDependenciesSchema.parse(JSON.parse(text)).dependencies ?? {});
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
throw new CapabilityError(`The scope manifest ${manifestPath} is not a valid package.json.`, 'INVALID_INPUT', {
|
|
125
|
+
reason: 'plugin-scope-manifest-unreadable',
|
|
126
|
+
details: { path: manifestPath },
|
|
127
|
+
cause: error
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The install inputs the scope manifest at `root` declares, or `null` when the
|
|
133
|
+
* scope has no manifest yet. A manifest that is there but cannot be read or
|
|
134
|
+
* parsed refuses typed (`plugin-scope-manifest-unreadable`, original as
|
|
135
|
+
* cause): an unreadable scope is a refused scope, never "assume it declares
|
|
136
|
+
* packages".
|
|
137
|
+
*/
|
|
138
|
+
export async function readScopeDeclarations(runtime, root) {
|
|
139
|
+
const filesystem = await resolveFileSystemAdapter(runtime, { binding: false });
|
|
140
|
+
const manifestPath = filesystem.join(root, 'package.json');
|
|
141
|
+
const text = await readScopeManifest(runtime, manifestPath);
|
|
142
|
+
if (text === null)
|
|
143
|
+
return null;
|
|
144
|
+
let declared;
|
|
145
|
+
try {
|
|
146
|
+
declared = ScopeDeclarationsSchema.parse(JSON.parse(text));
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
throw new CapabilityError(`The scope manifest ${manifestPath} is not a valid package.json.`, 'INVALID_INPUT', {
|
|
150
|
+
reason: 'plugin-scope-manifest-unreadable',
|
|
151
|
+
details: { path: manifestPath },
|
|
152
|
+
cause: error
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
const globs = Array.isArray(declared.workspaces) ? declared.workspaces : (declared.workspaces?.packages ?? []);
|
|
156
|
+
return { dependencies: Object.keys(declared.dependencies ?? {}), workspaces: globs };
|
|
157
|
+
}
|
|
158
|
+
/** @deprecated Name kept for the global-only callers; prefer `hasScopeDependency`. */
|
|
159
|
+
export const hasGlobalDependency = hasScopeDependency;
|
|
160
|
+
async function resolveExecution(runtime) {
|
|
161
|
+
return await resolveRuntimeExecution(runtime, 'bun actions');
|
|
162
|
+
}
|
|
163
|
+
/** The typed failure of one bun action; `secrets` are the values its text must never carry. */
|
|
164
|
+
function bunActionFailure(input, result, secrets) {
|
|
165
|
+
const detail = summarizeChildFailure({ stdout: result.stdout, stderr: result.stderr, max: 8 });
|
|
166
|
+
// Bun echoes a request URL whole (`error: GET <url> - 401`), userinfo and query included.
|
|
167
|
+
const excerpt = detail ? redactedExcerpt(detail, { secrets, maxChars: 2_000 }) : '';
|
|
168
|
+
const outcome = result.timedOut ? ' (timed out)' : ` (exit ${result.exitCode})`;
|
|
169
|
+
return new CapabilityError(redactCredentials(`bun ${input.action} failed in ${input.cwd}${outcome}`, [...secrets]) + (excerpt ? `:\n${excerpt}` : ''), 'UNAVAILABLE', {
|
|
170
|
+
reason: 'plugin-bun-action-failed',
|
|
171
|
+
retryable: false,
|
|
172
|
+
details: { action: input.action, exitCode: result.exitCode, timedOut: result.timedOut }
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
/** The host's own script runtime (Bun), from the environment's host commands. */
|
|
176
|
+
async function scriptRuntime(runtime) {
|
|
177
|
+
return (await getRuntimeHostCommands(runtime)).scriptRuntimeArgv();
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* bun actions that resolve packages from the registry. Only these receive the
|
|
181
|
+
* registry credential, and only these run with `--ignore-scripts`: no package
|
|
182
|
+
* installed for the host runs a lifecycle script (rc01 §3 "Child credentials").
|
|
183
|
+
*/
|
|
184
|
+
const REGISTRY_ACTIONS = new Set(['install', 'add', 'update']);
|
|
185
|
+
function bunArgv(bunArgv, input) {
|
|
186
|
+
return [
|
|
187
|
+
...bunArgv,
|
|
188
|
+
input.action,
|
|
189
|
+
'--cwd',
|
|
190
|
+
input.cwd,
|
|
191
|
+
...(REGISTRY_ACTIONS.has(input.action) ? ['--ignore-scripts'] : []),
|
|
192
|
+
...(input.args ?? [])
|
|
193
|
+
];
|
|
194
|
+
}
|
|
195
|
+
/** Render the command line `runBun` WOULD spawn, without spawning it. */
|
|
196
|
+
export async function planBun(input) {
|
|
197
|
+
const bun = await scriptRuntime(input.runtime);
|
|
198
|
+
return bunArgv(bun.argv, input);
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Run one Bun action against a scope root and return its exit code, output
|
|
202
|
+
* and timing. A non-zero exit is a result here, not an error; `runBunOrThrow`
|
|
203
|
+
* is the one that throws.
|
|
204
|
+
*/
|
|
205
|
+
export async function runBun(input) {
|
|
206
|
+
return (await runBunWithSecrets(input)).result;
|
|
207
|
+
}
|
|
208
|
+
/** `runBun`, plus the credential values the child was handed (what its output must never repeat). */
|
|
209
|
+
async function runBunWithSecrets(input) {
|
|
210
|
+
const execution = await resolveExecution(input.runtime);
|
|
211
|
+
const bun = await scriptRuntime(input.runtime);
|
|
212
|
+
const argv = bunArgv(bun.argv, input);
|
|
213
|
+
// The registry credential reaches only an action that resolves packages.
|
|
214
|
+
const credential = REGISTRY_ACTIONS.has(input.action) ? await registryInstallEnv(input.runtime) : {};
|
|
215
|
+
const secrets = Object.values(credential);
|
|
216
|
+
const options = {
|
|
217
|
+
command: argv[0],
|
|
218
|
+
args: argv.slice(1),
|
|
219
|
+
cwd: input.cwd,
|
|
220
|
+
// The kernel's host set plus Bun's re-entry switch, the registry
|
|
221
|
+
// credential an install needs, and the caller's declared variables.
|
|
222
|
+
env: composeChildEnv(input.runtime, { env: { ...bun.env, ...credential, ...input.env } }),
|
|
223
|
+
envMode: 'replace',
|
|
224
|
+
timeout: input.timeoutMs ?? BUN_ACTION_TIMEOUT_MS
|
|
225
|
+
};
|
|
226
|
+
const result = await execution.execute(options);
|
|
227
|
+
return {
|
|
228
|
+
result: {
|
|
229
|
+
argv,
|
|
230
|
+
exitCode: result.exitCode,
|
|
231
|
+
stdout: result.stdout,
|
|
232
|
+
stderr: result.stderr,
|
|
233
|
+
timedOut: result.timedOut,
|
|
234
|
+
durationMs: result.durationMs
|
|
235
|
+
},
|
|
236
|
+
secrets
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
/** `runBun` + "a non-zero exit is an error", which is what every caller wants. */
|
|
240
|
+
export async function runBunOrThrow(input) {
|
|
241
|
+
const resolvesPackages = REGISTRY_ACTIONS.has(input.action);
|
|
242
|
+
if (resolvesPackages) {
|
|
243
|
+
// The CLI surface decides whether a person can answer: a pipe,
|
|
244
|
+
// `--non-interactive`, `--json` and the host's `VIBES_FORCE_INTERACTIVE`
|
|
245
|
+
// terminal fact are all its flags, and a raw TTY check here would ignore
|
|
246
|
+
// every one of them.
|
|
247
|
+
await ensureRegistrySignIn(input.runtime, {
|
|
248
|
+
interactive: !resolveCliFlags(hostArgv(input.runtime), input.runtime.localEnvironment.terminal?.() ?? null).nonInteractive
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
const { result, secrets } = await runBunWithSecrets(input);
|
|
252
|
+
if (result.exitCode !== 0 || result.timedOut) {
|
|
253
|
+
const failure = bunActionFailure(input, result, secrets);
|
|
254
|
+
throw resolvesPackages ? await explainRegistryFailure(input.runtime, failure, result.stderr) : failure;
|
|
255
|
+
}
|
|
256
|
+
return result;
|
|
257
|
+
}
|
|
258
|
+
//# sourceMappingURL=package-manager.consumer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-manager.consumer.js","sourceRoot":"","sources":["../../src/cli/package-manager.consumer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,eAAe,EAAE,sBAAsB,EAAyC,MAAM,qBAAqB,CAAC;AAC9I,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAK/E,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAElH,+EAA+E;AAC/E,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,GAAG,MAAM,CAAC;AAEjD,MAAM,UAAU,0BAA0B,CAAC,SAAiB;IAC3D,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;IAC/B,IAAI,CAAC,KAAK,IAAI,8CAA8C,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtF,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,KAAK,G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-0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The repair kernel. Every command here has to keep working when the rest of
|
|
3
|
+
* the composition does not, which is why they are the plugins the host floor
|
|
4
|
+
* mounts and why `vibes update` lives in this plugin rather than in an
|
|
5
|
+
* umbrella that could itself fail to load.
|
|
6
|
+
*/
|
|
7
|
+
declare const plugin: import("@vibesdotdev/kernel").RuntimePlugin;
|
|
8
|
+
export default plugin;
|
|
9
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/cli/plugin.ts"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,QAAA,MAAM,MAAM,6CAuBV,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createRuntimePlugin, loader } from '@vibesdotdev/kernel';
|
|
2
|
+
import group from "./plugins.cli-group.descriptor.js";
|
|
3
|
+
import add from "./plugins.add.cli-command.descriptor.js";
|
|
4
|
+
import host from "./plugins.host.cli-command.descriptor.js";
|
|
5
|
+
import link from "./plugins.link.cli-command.descriptor.js";
|
|
6
|
+
import list from "./plugins.list.cli-command.descriptor.js";
|
|
7
|
+
import remove from "./plugins.remove.cli-command.descriptor.js";
|
|
8
|
+
import unlink from "./plugins.unlink.cli-command.descriptor.js";
|
|
9
|
+
import update from "./update.cli-command.descriptor.js";
|
|
10
|
+
const CLI_COMMAND = { kind: 'cli/command' };
|
|
11
|
+
/**
|
|
12
|
+
* The repair kernel. Every command here has to keep working when the rest of
|
|
13
|
+
* the composition does not, which is why they are the plugins the host floor
|
|
14
|
+
* mounts and why `vibes update` lives in this plugin rather than in an
|
|
15
|
+
* umbrella that could itself fail to load.
|
|
16
|
+
*/
|
|
17
|
+
const plugin = createRuntimePlugin({
|
|
18
|
+
id: '@vibesdotdev/plugins-cli',
|
|
19
|
+
name: 'Plugins CLI',
|
|
20
|
+
description: 'Scoped Bun package plugin management and vibes update',
|
|
21
|
+
dependencies: ['cli'],
|
|
22
|
+
descriptors: [group, add, list, remove, link, unlink, host, update],
|
|
23
|
+
loaders: [
|
|
24
|
+
loader('plugins.add', CLI_COMMAND, () => import("./plugins.add.cli-command.impl.consumer.js")),
|
|
25
|
+
loader('plugins.list', CLI_COMMAND, () => import("./plugins.list.cli-command.impl.consumer.js")),
|
|
26
|
+
loader('plugins.remove', CLI_COMMAND, () => import("./plugins.remove.cli-command.impl.consumer.js")),
|
|
27
|
+
loader('plugins.link', CLI_COMMAND, () => import("./plugins.link.cli-command.impl.consumer.js")),
|
|
28
|
+
loader('plugins.unlink', CLI_COMMAND, () => import("./plugins.unlink.cli-command.impl.consumer.js")),
|
|
29
|
+
loader('plugins.host', CLI_COMMAND, () => import("./plugins.host.cli-command.impl.consumer.js")),
|
|
30
|
+
loader('update', CLI_COMMAND, () => import("./update.cli-command.impl.consumer.js"))
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
export default plugin;
|
|
34
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/cli/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,MAAM,mCAAmC,CAAC;AACtD,OAAO,GAAG,MAAM,yCAAyC,CAAC;AAC1D,OAAO,IAAI,MAAM,0CAA0C,CAAC;AAC5D,OAAO,IAAI,MAAM,0CAA0C,CAAC;AAC5D,OAAO,IAAI,MAAM,0CAA0C,CAAC;AAC5D,OAAO,MAAM,MAAM,4CAA4C,CAAC;AAChE,OAAO,MAAM,MAAM,4CAA4C,CAAC;AAChE,OAAO,MAAM,MAAM,oCAAoC,CAAC;AAExD,MAAM,WAAW,GAAG,EAAE,IAAI,EAAE,aAAa,EAAW,CAAC;AAErD;;;;;GAKG;AACH,MAAM,MAAM,GAAG,mBAAmB,CAAC;IAClC,EAAE,EAAE,0BAA0B;IAC9B,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,uDAAuD;IACpE,YAAY,EAAE,CAAC,KAAK,CAAC;IACrB,WAAW,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC;IACnE,OAAO,EAAE;QACR,MAAM,CAAC,aAAa,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,4CAA4C,CAAC,CAAC;QAC9F,MAAM,CAAC,cAAc,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,6CAA6C,CAAC,CAAC;QAChG,MAAM,CAAC,gBAAgB,EAAE,WAAW,EAAE,GAAG,EAAE,CAC1C,MAAM,CAAC,+CAA+C,CAAC,CACvD;QACD,MAAM,CAAC,cAAc,EAAE,WAAW,EAAE,GAAG,EAAE,CACxC,MAAM,CAAC,6CAA6C,CAAC,CACrD;QACD,MAAM,CAAC,gBAAgB,EAAE,WAAW,EAAE,GAAG,EAAE,CAC1C,MAAM,CAAC,+CAA+C,CAAC,CACvD;QACD,MAAM,CAAC,cAAc,EAAE,WAAW,EAAE,GAAG,EAAE,CACxC,MAAM,CAAC,6CAA6C,CAAC,CACrD;QACD,MAAM,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,uCAAuC,CAAC,CAAC;KACpF;CACD,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `--manager <bun|npm>` is gone with the npm branch it selected (Rule 7
|
|
3
|
+
* consumer list in `package-manager.consumer.ts`). A compiled `vibes` runs its
|
|
4
|
+
* own embedded Bun through `resolveBunArgv()`; there is nothing to choose.
|
|
5
|
+
*/
|
|
6
|
+
declare const _default: {
|
|
7
|
+
readonly id: "plugins.add";
|
|
8
|
+
readonly kind: "cli/command";
|
|
9
|
+
readonly name: "add";
|
|
10
|
+
readonly description: "Install and enable a Bun package plugin in a scope";
|
|
11
|
+
readonly group: "plugins";
|
|
12
|
+
readonly surfaces: ["cli"];
|
|
13
|
+
readonly hardware: ["consumer"];
|
|
14
|
+
readonly requiredContext: ["cli/ui", "cli/output-format"];
|
|
15
|
+
readonly effects: {
|
|
16
|
+
readonly homeWrite: "required";
|
|
17
|
+
};
|
|
18
|
+
readonly arguments: [{
|
|
19
|
+
readonly name: "package";
|
|
20
|
+
readonly description: "Package coordinate, for example @example/vibes-plugin, @example/vibes-plugin@^1.2.0, or @fx/local@workspace:*";
|
|
21
|
+
readonly required: true;
|
|
22
|
+
readonly variadic: false;
|
|
23
|
+
}];
|
|
24
|
+
readonly options: [{
|
|
25
|
+
readonly flags: "--plugin <specifier>";
|
|
26
|
+
readonly description: "Explicit public plugin export to enable";
|
|
27
|
+
}, {
|
|
28
|
+
readonly flags: "--global";
|
|
29
|
+
readonly description: "Act on the global scope ($VIBES_HOME) — the default";
|
|
30
|
+
}, {
|
|
31
|
+
readonly flags: "--workspace";
|
|
32
|
+
readonly description: "Act on the current workspace scope";
|
|
33
|
+
}];
|
|
34
|
+
};
|
|
35
|
+
export default _default;
|
|
36
|
+
//# sourceMappingURL=plugins.add.cli-command.descriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.add.cli-command.descriptor.d.ts","sourceRoot":"","sources":["../../src/cli/plugins.add.cli-command.descriptor.ts"],"names":[],"mappings":"AAEA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAwBG"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createRuntimeAsset } from '@vibesdotdev/kernel';
|
|
2
|
+
/**
|
|
3
|
+
* `--manager <bun|npm>` is gone with the npm branch it selected (Rule 7
|
|
4
|
+
* consumer list in `package-manager.consumer.ts`). A compiled `vibes` runs its
|
|
5
|
+
* own embedded Bun through `resolveBunArgv()`; there is nothing to choose.
|
|
6
|
+
*/
|
|
7
|
+
export default createRuntimeAsset({
|
|
8
|
+
id: 'plugins.add',
|
|
9
|
+
kind: 'cli/command',
|
|
10
|
+
name: 'add',
|
|
11
|
+
description: 'Install and enable a Bun package plugin in a scope',
|
|
12
|
+
group: 'plugins',
|
|
13
|
+
surfaces: ['cli'],
|
|
14
|
+
hardware: ['consumer'],
|
|
15
|
+
requiredContext: ['cli/ui', 'cli/output-format'],
|
|
16
|
+
effects: { homeWrite: 'required' },
|
|
17
|
+
arguments: [
|
|
18
|
+
{
|
|
19
|
+
name: 'package',
|
|
20
|
+
description: 'Package coordinate, for example @example/vibes-plugin, @example/vibes-plugin@^1.2.0, or @fx/local@workspace:*',
|
|
21
|
+
required: true,
|
|
22
|
+
variadic: false
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
options: [
|
|
26
|
+
{ flags: '--plugin <specifier>', description: 'Explicit public plugin export to enable' },
|
|
27
|
+
{ flags: '--global', description: 'Act on the global scope ($VIBES_HOME) — the default' },
|
|
28
|
+
{ flags: '--workspace', description: 'Act on the current workspace scope' }
|
|
29
|
+
]
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=plugins.add.cli-command.descriptor.js.map
|