@vibesdotdev/vessel 0.0.0-stage → 1.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +90 -2
  3. package/dist/apps/filesystem.vessel.plugin.d.ts +307 -0
  4. package/dist/apps/filesystem.vessel.plugin.d.ts.map +1 -0
  5. package/dist/apps/filesystem.vessel.plugin.js +134 -0
  6. package/dist/apps/filesystem.vessel.plugin.js.map +1 -0
  7. package/dist/apps/storage.vessel.plugin.d.ts +318 -0
  8. package/dist/apps/storage.vessel.plugin.d.ts.map +1 -0
  9. package/dist/apps/storage.vessel.plugin.js +132 -0
  10. package/dist/apps/storage.vessel.plugin.js.map +1 -0
  11. package/dist/apps/terminal.vessel.plugin.d.ts +306 -0
  12. package/dist/apps/terminal.vessel.plugin.d.ts.map +1 -0
  13. package/dist/apps/terminal.vessel.plugin.js +112 -0
  14. package/dist/apps/terminal.vessel.plugin.js.map +1 -0
  15. package/dist/boundary.d.ts +10 -0
  16. package/dist/boundary.d.ts.map +1 -0
  17. package/dist/boundary.js +43 -0
  18. package/dist/boundary.js.map +1 -0
  19. package/dist/client/helper.d.ts +4 -0
  20. package/dist/client/helper.d.ts.map +1 -0
  21. package/dist/client/helper.js +5 -0
  22. package/dist/client/helper.js.map +1 -0
  23. package/dist/client/index.d.ts +3 -0
  24. package/dist/client/index.d.ts.map +1 -0
  25. package/dist/client/index.js +3 -0
  26. package/dist/client/index.js.map +1 -0
  27. package/dist/client/vessel-client.d.ts +39 -0
  28. package/dist/client/vessel-client.d.ts.map +1 -0
  29. package/dist/client/vessel-client.js +101 -0
  30. package/dist/client/vessel-client.js.map +1 -0
  31. package/dist/docs/vessel.docs.descriptor.d.ts +4 -0
  32. package/dist/docs/vessel.docs.descriptor.d.ts.map +1 -0
  33. package/dist/docs/vessel.docs.descriptor.js +96 -0
  34. package/dist/docs/vessel.docs.descriptor.js.map +1 -0
  35. package/dist/index.d.ts +13 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +13 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/kinds.d.ts +24 -0
  40. package/dist/kinds.d.ts.map +1 -0
  41. package/dist/kinds.js +78 -0
  42. package/dist/kinds.js.map +1 -0
  43. package/dist/launch/cli/descriptor.d.ts +3 -0
  44. package/dist/launch/cli/descriptor.d.ts.map +1 -0
  45. package/dist/launch/cli/descriptor.js +24 -0
  46. package/dist/launch/cli/descriptor.js.map +1 -0
  47. package/dist/launch/cli/implementation.d.ts +7 -0
  48. package/dist/launch/cli/implementation.d.ts.map +1 -0
  49. package/dist/launch/cli/implementation.js +14 -0
  50. package/dist/launch/cli/implementation.js.map +1 -0
  51. package/dist/launch/cli/options.d.ts +10 -0
  52. package/dist/launch/cli/options.d.ts.map +1 -0
  53. package/dist/launch/cli/options.js +12 -0
  54. package/dist/launch/cli/options.js.map +1 -0
  55. package/dist/launch/cli/plugin.d.ts +4 -0
  56. package/dist/launch/cli/plugin.d.ts.map +1 -0
  57. package/dist/launch/cli/plugin.js +12 -0
  58. package/dist/launch/cli/plugin.js.map +1 -0
  59. package/dist/launch/cli/request.d.ts +23 -0
  60. package/dist/launch/cli/request.d.ts.map +1 -0
  61. package/dist/launch/cli/request.js +27 -0
  62. package/dist/launch/cli/request.js.map +1 -0
  63. package/dist/launch/ensure-host.d.ts +48 -0
  64. package/dist/launch/ensure-host.d.ts.map +1 -0
  65. package/dist/launch/ensure-host.js +54 -0
  66. package/dist/launch/ensure-host.js.map +1 -0
  67. package/dist/launch/index.d.ts +9 -0
  68. package/dist/launch/index.d.ts.map +1 -0
  69. package/dist/launch/index.js +52 -0
  70. package/dist/launch/index.js.map +1 -0
  71. package/dist/launch/plugin.d.ts +6 -0
  72. package/dist/launch/plugin.d.ts.map +1 -0
  73. package/dist/launch/plugin.js +20 -0
  74. package/dist/launch/plugin.js.map +1 -0
  75. package/dist/launch/schema.d.ts +66 -0
  76. package/dist/launch/schema.d.ts.map +1 -0
  77. package/dist/launch/schema.js +71 -0
  78. package/dist/launch/schema.js.map +1 -0
  79. package/dist/launch/workspaces.d.ts +134 -0
  80. package/dist/launch/workspaces.d.ts.map +1 -0
  81. package/dist/launch/workspaces.js +60 -0
  82. package/dist/launch/workspaces.js.map +1 -0
  83. package/dist/module-not-found.d.ts +3 -0
  84. package/dist/module-not-found.d.ts.map +1 -0
  85. package/dist/module-not-found.js +18 -0
  86. package/dist/module-not-found.js.map +1 -0
  87. package/dist/schemas/platform.config.descriptor.d.ts +34 -0
  88. package/dist/schemas/platform.config.descriptor.d.ts.map +1 -0
  89. package/dist/schemas/platform.config.descriptor.js +13 -0
  90. package/dist/schemas/platform.config.descriptor.js.map +1 -0
  91. package/dist/schemas.d.ts +2213 -0
  92. package/dist/schemas.d.ts.map +1 -0
  93. package/dist/schemas.js +661 -0
  94. package/dist/schemas.js.map +1 -0
  95. package/dist/shell/app-surface.d.ts +55 -0
  96. package/dist/shell/app-surface.d.ts.map +1 -0
  97. package/dist/shell/app-surface.js +159 -0
  98. package/dist/shell/app-surface.js.map +1 -0
  99. package/dist/shell/dock.d.ts +30 -0
  100. package/dist/shell/dock.d.ts.map +1 -0
  101. package/dist/shell/dock.js +75 -0
  102. package/dist/shell/dock.js.map +1 -0
  103. package/dist/shell/index.d.ts +11 -0
  104. package/dist/shell/index.d.ts.map +1 -0
  105. package/dist/shell/index.js +10 -0
  106. package/dist/shell/index.js.map +1 -0
  107. package/dist/shell/launch-resolution.d.ts +49 -0
  108. package/dist/shell/launch-resolution.d.ts.map +1 -0
  109. package/dist/shell/launch-resolution.js +163 -0
  110. package/dist/shell/launch-resolution.js.map +1 -0
  111. package/dist/shell/layout-grid.d.ts +30 -0
  112. package/dist/shell/layout-grid.d.ts.map +1 -0
  113. package/dist/shell/layout-grid.js +56 -0
  114. package/dist/shell/layout-grid.js.map +1 -0
  115. package/dist/shell/owner-surface-lifecycle.d.ts +30 -0
  116. package/dist/shell/owner-surface-lifecycle.d.ts.map +1 -0
  117. package/dist/shell/owner-surface-lifecycle.js +54 -0
  118. package/dist/shell/owner-surface-lifecycle.js.map +1 -0
  119. package/dist/shell/ports.d.ts +107 -0
  120. package/dist/shell/ports.d.ts.map +1 -0
  121. package/dist/shell/ports.js +154 -0
  122. package/dist/shell/ports.js.map +1 -0
  123. package/dist/shell/types.d.ts +7 -0
  124. package/dist/shell/types.d.ts.map +1 -0
  125. package/dist/shell/types.js +2 -0
  126. package/dist/shell/types.js.map +1 -0
  127. package/dist/shell/window-manager.d.ts +82 -0
  128. package/dist/shell/window-manager.d.ts.map +1 -0
  129. package/dist/shell/window-manager.js +285 -0
  130. package/dist/shell/window-manager.js.map +1 -0
  131. package/dist/shell/workspace-memory.d.ts +42 -0
  132. package/dist/shell/workspace-memory.d.ts.map +1 -0
  133. package/dist/shell/workspace-memory.js +65 -0
  134. package/dist/shell/workspace-memory.js.map +1 -0
  135. package/dist/shell/workspace-state.d.ts +47 -0
  136. package/dist/shell/workspace-state.d.ts.map +1 -0
  137. package/dist/shell/workspace-state.js +137 -0
  138. package/dist/shell/workspace-state.js.map +1 -0
  139. package/dist/vessel.docs.plugin.d.ts +4 -0
  140. package/dist/vessel.docs.plugin.d.ts.map +1 -0
  141. package/dist/vessel.docs.plugin.js +11 -0
  142. package/dist/vessel.docs.plugin.js.map +1 -0
  143. package/dist/vessel.plugin.d.ts +3 -0
  144. package/dist/vessel.plugin.d.ts.map +1 -0
  145. package/dist/vessel.plugin.js +23 -0
  146. package/dist/vessel.plugin.js.map +1 -0
  147. package/dist/vessel.runtime-client.descriptor.d.ts +4 -0
  148. package/dist/vessel.runtime-client.descriptor.d.ts.map +1 -0
  149. package/dist/vessel.runtime-client.descriptor.js +13 -0
  150. package/dist/vessel.runtime-client.descriptor.js.map +1 -0
  151. package/dist/vessel.workspace-state.plugin.d.ts +4 -0
  152. package/dist/vessel.workspace-state.plugin.d.ts.map +1 -0
  153. package/dist/vessel.workspace-state.plugin.js +12 -0
  154. package/dist/vessel.workspace-state.plugin.js.map +1 -0
  155. package/dist/vessel.workspace.plugin.d.ts +3 -0
  156. package/dist/vessel.workspace.plugin.d.ts.map +1 -0
  157. package/dist/vessel.workspace.plugin.js +17 -0
  158. package/dist/vessel.workspace.plugin.js.map +1 -0
  159. package/dist/whiteboard/client.d.ts +35 -0
  160. package/dist/whiteboard/client.d.ts.map +1 -0
  161. package/dist/whiteboard/client.js +185 -0
  162. package/dist/whiteboard/client.js.map +1 -0
  163. package/dist/whiteboard/descriptor.d.ts +5 -0
  164. package/dist/whiteboard/descriptor.d.ts.map +1 -0
  165. package/dist/whiteboard/descriptor.js +14 -0
  166. package/dist/whiteboard/descriptor.js.map +1 -0
  167. package/dist/whiteboard/index.d.ts +7 -0
  168. package/dist/whiteboard/index.d.ts.map +1 -0
  169. package/dist/whiteboard/index.js +7 -0
  170. package/dist/whiteboard/index.js.map +1 -0
  171. package/dist/whiteboard/plugin.d.ts +3 -0
  172. package/dist/whiteboard/plugin.d.ts.map +1 -0
  173. package/dist/whiteboard/plugin.js +42 -0
  174. package/dist/whiteboard/plugin.js.map +1 -0
  175. package/dist/whiteboard/schemas.d.ts +479 -0
  176. package/dist/whiteboard/schemas.d.ts.map +1 -0
  177. package/dist/whiteboard/schemas.js +55 -0
  178. package/dist/whiteboard/schemas.js.map +1 -0
  179. package/dist/whiteboard/tools/apply.impl.d.ts +7 -0
  180. package/dist/whiteboard/tools/apply.impl.d.ts.map +1 -0
  181. package/dist/whiteboard/tools/apply.impl.js +12 -0
  182. package/dist/whiteboard/tools/apply.impl.js.map +1 -0
  183. package/dist/whiteboard/tools/descriptors.d.ts +489 -0
  184. package/dist/whiteboard/tools/descriptors.d.ts.map +1 -0
  185. package/dist/whiteboard/tools/descriptors.js +72 -0
  186. package/dist/whiteboard/tools/descriptors.js.map +1 -0
  187. package/dist/whiteboard/tools/get.impl.d.ts +7 -0
  188. package/dist/whiteboard/tools/get.impl.d.ts.map +1 -0
  189. package/dist/whiteboard/tools/get.impl.js +12 -0
  190. package/dist/whiteboard/tools/get.impl.js.map +1 -0
  191. package/dist/whiteboard/tools/open.impl.d.ts +7 -0
  192. package/dist/whiteboard/tools/open.impl.d.ts.map +1 -0
  193. package/dist/whiteboard/tools/open.impl.js +12 -0
  194. package/dist/whiteboard/tools/open.impl.js.map +1 -0
  195. package/dist/whiteboard/tools/signal.impl.d.ts +7 -0
  196. package/dist/whiteboard/tools/signal.impl.d.ts.map +1 -0
  197. package/dist/whiteboard/tools/signal.impl.js +11 -0
  198. package/dist/whiteboard/tools/signal.impl.js.map +1 -0
  199. package/dist/whiteboard/vessel-whiteboard.descriptors.d.ts +4 -0
  200. package/dist/whiteboard/vessel-whiteboard.descriptors.d.ts.map +1 -0
  201. package/dist/whiteboard/vessel-whiteboard.descriptors.js +61 -0
  202. package/dist/whiteboard/vessel-whiteboard.descriptors.js.map +1 -0
  203. package/dist/workspace/vessel-hub.descriptors.d.ts +543 -0
  204. package/dist/workspace/vessel-hub.descriptors.d.ts.map +1 -0
  205. package/dist/workspace/vessel-hub.descriptors.js +544 -0
  206. package/dist/workspace/vessel-hub.descriptors.js.map +1 -0
  207. package/dist/workspace/vessel-platform.descriptors.d.ts +809 -0
  208. package/dist/workspace/vessel-platform.descriptors.d.ts.map +1 -0
  209. package/dist/workspace/vessel-platform.descriptors.js +207 -0
  210. package/dist/workspace/vessel-platform.descriptors.js.map +1 -0
  211. package/dist/workspace/vessel-workspace.descriptors.d.ts +537 -0
  212. package/dist/workspace/vessel-workspace.descriptors.d.ts.map +1 -0
  213. package/dist/workspace/vessel-workspace.descriptors.js +115 -0
  214. package/dist/workspace/vessel-workspace.descriptors.js.map +1 -0
  215. package/dist/workspace-state/index.d.ts +3 -0
  216. package/dist/workspace-state/index.d.ts.map +1 -0
  217. package/dist/workspace-state/index.js +3 -0
  218. package/dist/workspace-state/index.js.map +1 -0
  219. package/dist/workspace-state/vessel.workspace-state.storage.descriptor.d.ts +51 -0
  220. package/dist/workspace-state/vessel.workspace-state.storage.descriptor.d.ts.map +1 -0
  221. package/dist/workspace-state/vessel.workspace-state.storage.descriptor.js +24 -0
  222. package/dist/workspace-state/vessel.workspace-state.storage.descriptor.js.map +1 -0
  223. package/package.json +207 -4
@@ -0,0 +1,48 @@
1
+ import { type CaughtFailure, type VibesRuntime } from '@vibesdotdev/kernel';
2
+ import type { VesselLauncher } from './schema.ts';
3
+ export declare const VESSEL_HOST_PACKAGE = "@vibesdotdev/vessel-desktop";
4
+ export declare const VESSEL_HOST_PLUGIN = "@vibesdotdev/vessel-desktop/plugin";
5
+ export declare const VESSEL_HOST_MISSING = "No Vessel host is installed in this runtime. Install or enable a Vessel host plugin.";
6
+ export declare const VESSEL_HOST_NOT_RUNNABLE = "No runnable Vessel host is available in this runtime.";
7
+ export declare const VESSEL_HOST_MULTIPLE = "Multiple Vessel hosts are available; select an explicit launcher.";
8
+ export declare const VESSEL_HOST_ASSETS_MISSING = "The installed Vessel host is missing its built web assets. Build or reinstall the Vessel host package.";
9
+ export interface PackageScopeAdd {
10
+ execute(args: {
11
+ package: string;
12
+ }, options?: {
13
+ global: boolean;
14
+ plugin: string;
15
+ }): Promise<void>;
16
+ }
17
+ /** The host's typed refusal, not its message text, says its built web assets are missing. */
18
+ export declare function isVesselHostAssetsMissing(input: CaughtFailure): boolean;
19
+ export declare function resolveVesselLaunchers(runtime: VibesRuntime, launcherId?: string): Promise<{
20
+ descriptor: {
21
+ id: string;
22
+ kind: "vessel/launcher";
23
+ name?: string | undefined;
24
+ description?: string | undefined;
25
+ tags?: string[] | undefined;
26
+ hardware?: string[] | undefined;
27
+ enabled?: boolean | undefined;
28
+ priority?: number | undefined;
29
+ capabilityId?: string | undefined;
30
+ requiredContext?: string[] | undefined;
31
+ optionalContext?: string[] | undefined;
32
+ config?: unknown;
33
+ retention?: string | {
34
+ reason: string;
35
+ maxAgeDays?: number | undefined;
36
+ maxEntries?: number | undefined;
37
+ maxBytes?: number | undefined;
38
+ cascadeFrom?: string | undefined;
39
+ ageField?: string | undefined;
40
+ enforcedBy?: string | undefined;
41
+ } | undefined;
42
+ };
43
+ impl: VesselLauncher;
44
+ }[]>;
45
+ /** Package installation is owned by the active CLI package scope. */
46
+ export declare function installVesselHostFromPackageScope(runtime: VibesRuntime): Promise<void>;
47
+ export declare function ensureVesselHost(runtime: VibesRuntime, launcherId?: string): Promise<void>;
48
+ //# sourceMappingURL=ensure-host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ensure-host.d.ts","sourceRoot":"","sources":["../../src/launch/ensure-host.ts"],"names":[],"mappings":"AACA,OAAO,EAAsC,KAAK,aAAa,EAA0B,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxI,OAAO,KAAK,EAAE,cAAc,EAA4B,MAAM,aAAa,CAAC;AAE5E,eAAO,MAAM,mBAAmB,gCAAgC,CAAC;AACjE,eAAO,MAAM,kBAAkB,uCAAuC,CAAC;AACvE,eAAO,MAAM,mBAAmB,yFAAyF,CAAC;AAC1H,eAAO,MAAM,wBAAwB,0DAA0D,CAAC;AAChG,eAAO,MAAM,oBAAoB,sEAAsE,CAAC;AACxG,eAAO,MAAM,0BAA0B,2GAA2G,CAAC;AAEnJ,MAAM,WAAW,eAAe;IAC/B,OAAO,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjG;AACD,6FAA6F;AAC7F,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAEvE;AACD,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;KAMtF;AACD,qEAAqE;AACrE,wBAAsB,iCAAiC,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAU5F;AACD,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAShG"}
@@ -0,0 +1,54 @@
1
+ import * as z from 'zod/v4';
2
+ import { CapabilityError, isCapabilityError } from '@vibesdotdev/kernel';
3
+ import { RuntimePluginSchema } from '@vibesdotdev/kernel/factory/plugin';
4
+ import { parseVesselValue, vesselFailure, vesselOperation } from "../boundary.js";
5
+ export const VESSEL_HOST_PACKAGE = '@vibesdotdev/vessel-desktop';
6
+ export const VESSEL_HOST_PLUGIN = '@vibesdotdev/vessel-desktop/plugin';
7
+ export const VESSEL_HOST_MISSING = 'No Vessel host is installed in this runtime. Install or enable a Vessel host plugin.';
8
+ export const VESSEL_HOST_NOT_RUNNABLE = 'No runnable Vessel host is available in this runtime.';
9
+ export const VESSEL_HOST_MULTIPLE = 'Multiple Vessel hosts are available; select an explicit launcher.';
10
+ export const VESSEL_HOST_ASSETS_MISSING = 'The installed Vessel host is missing its built web assets. Build or reinstall the Vessel host package.';
11
+ /** The host's typed refusal, not its message text, says its built web assets are missing. */
12
+ export function isVesselHostAssetsMissing(input) {
13
+ return isCapabilityError(input) && input.reason === 'vessel-host-assets-missing';
14
+ }
15
+ export async function resolveVesselLaunchers(runtime, launcherId) {
16
+ const id = parseVesselValue(z.string().min(1).optional(), launcherId);
17
+ if (!runtime.hasKind('vessel/launcher'))
18
+ return [];
19
+ let query = runtime.query('vessel/launcher').enabled().forHardware(runtime.scope.hardware);
20
+ if (id)
21
+ query = query.withId(id);
22
+ return vesselOperation(() => query.allWithDescriptors(), 'vessel-host-resolution-failed');
23
+ }
24
+ /** Package installation is owned by the active CLI package scope. */
25
+ export async function installVesselHostFromPackageScope(runtime) {
26
+ if (!runtime.hasKind('cli/command'))
27
+ throw new CapabilityError(VESSEL_HOST_MISSING + ' The active package scope cannot install plugins.', 'UNAVAILABLE', { reason: 'vessel-package-scope-unavailable' });
28
+ const adds = await vesselOperation(() => runtime.query('cli/command').withId('plugins.add').enabled().allWithDescriptors(), 'vessel-package-scope-unavailable');
29
+ if (adds.length !== 1)
30
+ throw new CapabilityError(VESSEL_HOST_MISSING + ' The active package scope cannot install plugins.', 'UNAVAILABLE', { reason: 'vessel-package-scope-unavailable' });
31
+ await vesselOperation(() => adds[0].impl.execute({ package: VESSEL_HOST_PACKAGE }, { global: true, plugin: VESSEL_HOST_PLUGIN }), 'vessel-host-install-failed');
32
+ if ((await resolveVesselLaunchers(runtime)).length > 0)
33
+ return;
34
+ const loaded = await vesselOperation(() => runtime.environment.loader.importModule(VESSEL_HOST_PLUGIN), 'vessel-host-import-failed');
35
+ const module = parseVesselValue(z.object({ default: z.unknown().optional() }), loaded);
36
+ const plugin = parseVesselValue(RuntimePluginSchema, module.default ?? loaded);
37
+ if (!runtime.hasPlugin(plugin.id))
38
+ await vesselOperation(() => runtime.registerPlugin(plugin), 'vessel-host-registration-failed');
39
+ }
40
+ export async function ensureVesselHost(runtime, launcherId) {
41
+ const existing = await resolveVesselLaunchers(runtime, launcherId);
42
+ if (existing.length === 1)
43
+ return;
44
+ if (existing.length > 1)
45
+ throw new CapabilityError(VESSEL_HOST_MULTIPLE, 'CONFLICT', { reason: 'vessel-host-conflict' });
46
+ await installVesselHostFromPackageScope(runtime);
47
+ const installed = await resolveVesselLaunchers(runtime, launcherId);
48
+ if (installed.length === 1)
49
+ return;
50
+ if (installed.length > 1)
51
+ throw new CapabilityError(VESSEL_HOST_MULTIPLE, 'CONFLICT', { reason: 'vessel-host-conflict' });
52
+ throw vesselFailure('vessel-host-unavailable', 'UNAVAILABLE');
53
+ }
54
+ //# sourceMappingURL=ensure-host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ensure-host.js","sourceRoot":"","sources":["../../src/launch/ensure-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAA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C;IACvF,MAAM,MAAM,GAAG,gBAAgB,CAAC,mBAAmB,EAAE,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,CAAC;IAC/E,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QAAE,MAAM,eAAe,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,iCAAiC,CAAC,CAAC;AACnI,CAAC;AACD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAAqB,EAAE,UAAmB;IAChF,MAAM,QAAQ,GAAG,MAAM,sBAAsB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACnE,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAClC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,eAAe,CAAC,oBAAoB,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,sBAAsB,EAAE,CAAC,CAAC;IACzH,MAAM,iCAAiC,CAAC,OAAO,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,MAAM,sBAAsB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACpE,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IACnC,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,eAAe,CAAC,oBAAoB,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,sBAAsB,EAAE,CAAC,CAAC;IAC1H,MAAM,aAAa,CAAC,yBAAyB,EAAE,aAAa,CAAC,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { VibesRuntime } from '@vibesdotdev/kernel';
2
+ import { type VesselLaunchInput, type VesselLaunchResult } from './schema.ts';
3
+ export * from './schema.ts';
4
+ export * from './workspaces.ts';
5
+ export { vesselLauncherKind, vesselLaunchPlugin } from './plugin.ts';
6
+ export { VESSEL_HOST_ASSETS_MISSING, VESSEL_HOST_MISSING, VESSEL_HOST_MULTIPLE, VESSEL_HOST_NOT_RUNNABLE, VESSEL_HOST_PACKAGE, VESSEL_HOST_PLUGIN, ensureVesselHost, installVesselHostFromPackageScope, isVesselHostAssetsMissing, resolveVesselLaunchers } from './ensure-host.ts';
7
+ /** Resolve host behavior from this runtime; do not bootstrap a private runtime. */
8
+ export declare function launchVessel(runtime: VibesRuntime, input: VesselLaunchInput, launcherId?: string): Promise<VesselLaunchResult>;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/launch/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAGN,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,MAAM,aAAa,CAAC;AAQrB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EACN,0BAA0B,EAC1B,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,iCAAiC,EACjC,yBAAyB,EACzB,sBAAsB,EACtB,MAAM,kBAAkB,CAAC;AAE1B,mFAAmF;AACnF,wBAAsB,YAAY,CACjC,OAAO,EAAE,YAAY,EACrB,KAAK,EAAE,iBAAiB,EACxB,UAAU,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,kBAAkB,CAAC,CAe7B"}
@@ -0,0 +1,52 @@
1
+ import * as z from 'zod/v4';
2
+ import { CapabilityError, CaughtFailureSchema, isCapabilityError, valueFreeFailure } from '@vibesdotdev/kernel';
3
+ import { parseVesselValue, vesselFailure } from "../boundary.js";
4
+ import { vesselLaunchRequestSchema, vesselLaunchResultSchema } from "./schema.js";
5
+ import { ensureVesselHost, installVesselHostFromPackageScope, isVesselHostAssetsMissing, resolveVesselLaunchers } from "./ensure-host.js";
6
+ export * from "./schema.js";
7
+ export * from "./workspaces.js";
8
+ export { vesselLauncherKind, vesselLaunchPlugin } from "./plugin.js";
9
+ export { VESSEL_HOST_ASSETS_MISSING, VESSEL_HOST_MISSING, VESSEL_HOST_MULTIPLE, VESSEL_HOST_NOT_RUNNABLE, VESSEL_HOST_PACKAGE, VESSEL_HOST_PLUGIN, ensureVesselHost, installVesselHostFromPackageScope, isVesselHostAssetsMissing, resolveVesselLaunchers } from "./ensure-host.js";
10
+ /** Resolve host behavior from this runtime; do not bootstrap a private runtime. */
11
+ export async function launchVessel(runtime, input, launcherId) {
12
+ const request = parseVesselValue(vesselLaunchRequestSchema, input);
13
+ const id = parseVesselValue(z.string().min(1).optional(), launcherId);
14
+ await ensureVesselHost(runtime, id);
15
+ const providers = await resolveVesselLaunchers(runtime, id);
16
+ if (providers.length !== 1)
17
+ throw vesselFailure('vessel-host-conflict', providers.length ? 'CONFLICT' : 'UNAVAILABLE');
18
+ const first = await attemptLaunch(providers[0].impl, request);
19
+ if ('result' in first)
20
+ return first.result;
21
+ if (first.reason !== 'vessel-host-assets-missing')
22
+ throw first.typed ?? vesselFailure(first.reason, first.code, first.failure, undefined, first.cause);
23
+ await repairHost(runtime, first.failure);
24
+ const retried = await resolveVesselLaunchers(runtime, id);
25
+ if (retried.length !== 1)
26
+ throw vesselFailure('vessel-host-assets-repair-failed', 'UNAVAILABLE');
27
+ const result = await attemptLaunch(retried[0].impl, request);
28
+ if ('failure' in result)
29
+ throw result.typed ?? vesselFailure(result.reason, result.code, result.failure, undefined, result.cause);
30
+ return result.result;
31
+ }
32
+ async function attemptLaunch(launcher, request) {
33
+ return Promise.resolve().then(() => launcher.launch(request)).then(value => ({ result: parseVesselValue(vesselLaunchResultSchema, value) }), (input) => {
34
+ const caught = CaughtFailureSchema.parse(input);
35
+ const typed = isCapabilityError(caught) ? caught : undefined;
36
+ const code = CapabilityError.from(caught).code;
37
+ const failure = { failure: valueFreeFailure(caught), code: code === 'INTERNAL' ? 'UNAVAILABLE' : code, reason: isVesselHostAssetsMissing(caught) ? 'vessel-host-assets-missing' : 'vessel-host-launch-failed', cause: caught };
38
+ if (typed !== undefined)
39
+ failure.typed = typed;
40
+ return failure;
41
+ });
42
+ }
43
+ async function repairHost(runtime, initialFailure) {
44
+ try {
45
+ await installVesselHostFromPackageScope(runtime);
46
+ }
47
+ catch (error) {
48
+ const caught = CaughtFailureSchema.parse(error);
49
+ throw new CapabilityError('The Vessel host assets could not be repaired.', 'UNAVAILABLE', { reason: 'vessel-host-assets-repair-failed', details: { initialFailure: { ...initialFailure }, failure: { ...valueFreeFailure(caught) } }, cause: caught });
50
+ }
51
+ }
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/launch/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,gBAAgB,EAAsB,MAAM,qBAAqB,CAAC;AACpI,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,EACN,yBAAyB,EACzB,wBAAwB,EAGxB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,gBAAgB,EAChB,iCAAiC,EACjC,yBAAyB,EACzB,sBAAsB,EACtB,MAAM,kBAAkB,CAAC;AAE1B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EACN,0BAA0B,EAC1B,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,iCAAiC,EACjC,yBAAyB,EACzB,sBAAsB,EACtB,MAAM,kBAAkB,CAAC;AA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K,GAAG,KAAK,CAAC;QAC/C,OAAO,OAAO,CAAC;IAChB,CAAC,CACD,CAAC;AACH,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,OAAqB,EAAE,cAA8D;IAC9G,IAAI,CAAC;QAAC,MAAM,iCAAiC,CAAC,OAAO,CAAC,CAAC;IAAC,CAAC;IACzD,OAAO,KAAK,EAAE,CAAC;QACd,MAAM,MAAM,GAAG,mBAAmB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAChD,MAAM,IAAI,eAAe,CAAC,+CAA+C,EAAE,aAAa,EAAE,EAAE,MAAM,EAAE,kCAAkC,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,EAAE,GAAG,cAAc,EAAE,EAAE,OAAO,EAAE,EAAE,GAAG,gBAAgB,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IACxP,CAAC;AACF,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { type VesselLauncher } from './schema.ts';
2
+ export declare const vesselLauncherKind: import("@vibesdotdev/kernel").RuntimeKindDescriptorRecord<VesselLauncher>;
3
+ /** The host supplies its loader. A descriptor alone never claims a runnable host. */
4
+ export declare const vesselLaunchPlugin: import("@vibesdotdev/kernel").RuntimePlugin;
5
+ export default vesselLaunchPlugin;
6
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/launch/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAGN,KAAK,cAAc,EACnB,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,kBAAkB,2EAS7B,CAAC;AAEH,qFAAqF;AACrF,eAAO,MAAM,kBAAkB,6CAI7B,CAAC;AACH,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { createRuntimeKind, createRuntimePlugin } from '@vibesdotdev/kernel';
2
+ import { vesselWorkspaceLauncherKind } from "./workspaces.js";
3
+ import { vesselLauncherDescriptorSchema } from "./schema.js";
4
+ export const vesselLauncherKind = createRuntimeKind({
5
+ id: 'vessel/launcher',
6
+ descriptorSchema: vesselLauncherDescriptorSchema,
7
+ descriptorOwnership: 'single-owner',
8
+ validateImplementation: (value) => value !== null &&
9
+ typeof value === 'object' &&
10
+ 'launch' in value &&
11
+ typeof value.launch === 'function'
12
+ });
13
+ /** The host supplies its loader. A descriptor alone never claims a runnable host. */
14
+ export const vesselLaunchPlugin = createRuntimePlugin({
15
+ id: 'vessel-launch',
16
+ name: 'Vessel launch contracts',
17
+ kinds: [vesselLauncherKind, vesselWorkspaceLauncherKind]
18
+ });
19
+ export default vesselLaunchPlugin;
20
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/launch/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EACN,8BAA8B,EAG9B,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAiB,CAA2C;IAC7F,EAAE,EAAE,iBAAiB;IACrB,gBAAgB,EAAE,8BAA8B;IAChD,mBAAmB,EAAE,cAAc;IACnC,sBAAsB,EAAE,CAAC,KAAc,EAA2B,EAAE,CACnE,KAAK,KAAK,IAAI;QACd,OAAO,KAAK,KAAK,QAAQ;QACzB,QAAQ,IAAI,KAAK;QACjB,OAAO,KAAK,CAAC,MAAM,KAAK,UAAU;CACnC,CAAC,CAAC;AAEH,qFAAqF;AACrF,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;IACrD,EAAE,EAAE,eAAe;IACnB,IAAI,EAAE,yBAAyB;IAC/B,KAAK,EAAE,CAAC,kBAAkB,EAAE,2BAA2B,CAAC;CACxD,CAAC,CAAC;AACH,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,66 @@
1
+ import * as z from 'zod/v4';
2
+ export declare const vesselLaunchEnvironmentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3
+ kind: z.ZodLiteral<"local">;
4
+ }, z.core.$strict>, z.ZodObject<{
5
+ kind: z.ZodLiteral<"fleet">;
6
+ id: z.ZodString;
7
+ }, z.core.$strict>, z.ZodObject<{
8
+ kind: z.ZodLiteral<"sandbox">;
9
+ id: z.ZodString;
10
+ }, z.core.$strict>], "kind">;
11
+ /** Host-bound input; never accept this object from an unauthenticated browser. */
12
+ export declare const vesselLaunchRequestSchema: z.ZodObject<{
13
+ version: z.ZodLiteral<1>;
14
+ initialAppId: z.ZodOptional<z.ZodString>;
15
+ workspaceRoot: z.ZodString;
16
+ profile: z.ZodOptional<z.ZodString>;
17
+ environment: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
18
+ kind: z.ZodLiteral<"local">;
19
+ }, z.core.$strict>, z.ZodObject<{
20
+ kind: z.ZodLiteral<"fleet">;
21
+ id: z.ZodString;
22
+ }, z.core.$strict>, z.ZodObject<{
23
+ kind: z.ZodLiteral<"sandbox">;
24
+ id: z.ZodString;
25
+ }, z.core.$strict>], "kind">>;
26
+ routeState: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
27
+ openBrowser: z.ZodDefault<z.ZodBoolean>;
28
+ background: z.ZodDefault<z.ZodBoolean>;
29
+ }, z.core.$strict>;
30
+ /** Browser credentials belong only to the host's short-lived handoff, not receipts. */
31
+ export declare const vesselLaunchResultSchema: z.ZodObject<{
32
+ version: z.ZodLiteral<1>;
33
+ url: z.ZodURL;
34
+ processId: z.ZodString;
35
+ }, z.core.$strict>;
36
+ export declare const vesselLauncherDescriptorSchema: z.ZodObject<{
37
+ id: z.ZodString;
38
+ name: z.ZodOptional<z.ZodString>;
39
+ description: z.ZodOptional<z.ZodString>;
40
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
+ hardware: z.ZodOptional<z.ZodArray<z.ZodString>>;
42
+ enabled: z.ZodOptional<z.ZodBoolean>;
43
+ priority: z.ZodOptional<z.ZodNumber>;
44
+ capabilityId: z.ZodOptional<z.ZodString>;
45
+ requiredContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
46
+ optionalContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
47
+ config: z.ZodOptional<z.ZodUnknown>;
48
+ retention: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
49
+ maxAgeDays: z.ZodOptional<z.ZodNumber>;
50
+ maxEntries: z.ZodOptional<z.ZodNumber>;
51
+ maxBytes: z.ZodOptional<z.ZodNumber>;
52
+ cascadeFrom: z.ZodOptional<z.ZodString>;
53
+ ageField: z.ZodOptional<z.ZodString>;
54
+ reason: z.ZodString;
55
+ enforcedBy: z.ZodOptional<z.ZodString>;
56
+ }, z.core.$strip>]>>;
57
+ kind: z.ZodLiteral<"vessel/launcher">;
58
+ }, z.core.$strip>;
59
+ export type VesselLaunchRequest = z.infer<typeof vesselLaunchRequestSchema>;
60
+ export type VesselLaunchInput = z.input<typeof vesselLaunchRequestSchema>;
61
+ export type VesselLaunchResult = z.infer<typeof vesselLaunchResultSchema>;
62
+ export type VesselLauncherDescriptor = z.infer<typeof vesselLauncherDescriptorSchema>;
63
+ export interface VesselLauncher {
64
+ launch(request: VesselLaunchRequest): Promise<VesselLaunchResult>;
65
+ }
66
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/launch/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAI5B,eAAO,MAAM,6BAA6B;;;;;;;;4BAIxC,CAAC;AAEH,kFAAkF;AAClF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;kBAe5B,CAAC;AAEX,uFAAuF;AACvF,eAAO,MAAM,wBAAwB;;;;kBA2B3B,CAAC;AAEX,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;iBAEzC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC1E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,MAAM,WAAW,cAAc;IAC9B,MAAM,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAClE"}
@@ -0,0 +1,71 @@
1
+ import { CaughtFailureSchema, valueFreeFailure } from '@vibesdotdev/kernel';
2
+ import * as z from 'zod/v4';
3
+ import { RuntimeDescriptorSchema } from '@vibesdotdev/kernel/schemas/descriptor';
4
+ import { vesselRouteStateSchema } from "../schemas.js";
5
+ export const vesselLaunchEnvironmentSchema = z.discriminatedUnion('kind', [
6
+ z.object({ kind: z.literal('local') }).strict(),
7
+ z.object({ kind: z.literal('fleet'), id: z.string().min(1) }).strict(),
8
+ z.object({ kind: z.literal('sandbox'), id: z.string().min(1) }).strict()
9
+ ]);
10
+ /** Host-bound input; never accept this object from an unauthenticated browser. */
11
+ export const vesselLaunchRequestSchema = z
12
+ .object({
13
+ version: z.literal(1),
14
+ initialAppId: z.string().min(1).optional(),
15
+ workspaceRoot: z.string().min(1),
16
+ profile: z.string().min(1).optional(),
17
+ environment: vesselLaunchEnvironmentSchema.default({ kind: 'local' }),
18
+ routeState: vesselRouteStateSchema.default({}),
19
+ openBrowser: z.boolean().default(true),
20
+ /**
21
+ * `false` keeps the launching CLI attached to the web host.
22
+ * Omitted launches stay on vibes pm so in-app workspace opens do not block.
23
+ */
24
+ background: z.boolean().default(true)
25
+ })
26
+ .strict();
27
+ /** Browser credentials belong only to the host's short-lived handoff, not receipts. */
28
+ export const vesselLaunchResultSchema = z
29
+ .object({
30
+ version: z.literal(1),
31
+ url: z.url().refine((value) => {
32
+ const url = new URL(value);
33
+ if (!['http:', 'https:'].includes(url.protocol) || url.username || url.password || url.hash)
34
+ return false;
35
+ const allowed = new Set(['app', 'state', 'environment', 'target']);
36
+ for (const key of url.searchParams.keys()) {
37
+ if (!allowed.has(key) || url.searchParams.getAll(key).length !== 1)
38
+ return false;
39
+ }
40
+ const app = url.searchParams.get('app');
41
+ if (app !== null && !/^[A-Za-z0-9._:-]{1,240}$/.test(app))
42
+ return false;
43
+ const state = url.searchParams.get('state');
44
+ if (state !== null) {
45
+ if (state.length > 16384)
46
+ return false;
47
+ if (!validateReceiptRouteState(state).valid)
48
+ return false;
49
+ }
50
+ const environment = url.searchParams.get('environment');
51
+ const target = url.searchParams.get('target');
52
+ const kind = environment ?? 'local';
53
+ // Each branch names only the fields its environment union member declares.
54
+ const candidate = target === null ? { kind } : { kind, id: target };
55
+ return vesselLaunchEnvironmentSchema.safeParse(candidate).success;
56
+ }, 'Launch receipts must contain a credential-free HTTP URL.'),
57
+ processId: z.string().min(1)
58
+ })
59
+ .strict();
60
+ export const vesselLauncherDescriptorSchema = RuntimeDescriptorSchema.extend({
61
+ kind: z.literal('vessel/launcher')
62
+ });
63
+ function validateReceiptRouteState(state) {
64
+ try {
65
+ return { valid: vesselRouteStateSchema.safeParse(JSON.parse(state)).success };
66
+ }
67
+ catch (error) {
68
+ return { valid: false, failure: valueFreeFailure(CaughtFailureSchema.parse(error)) };
69
+ }
70
+ }
71
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/launch/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE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KAAK,EAAE,CAAC;QAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,gBAAgB,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;IAAC,CAAC;AACxG,CAAC"}
@@ -0,0 +1,134 @@
1
+ import * as z from 'zod/v4';
2
+ import { vesselLaunchResultSchema } from './schema.ts';
3
+ /** A host resolves this opaque reference through its workspace custody owner. */
4
+ export declare const vesselOpenWorkspaceSchema: z.ZodObject<{
5
+ workspaceId: z.ZodOptional<z.ZodString>;
6
+ environment: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
7
+ kind: z.ZodLiteral<"local">;
8
+ }, z.core.$strict>, z.ZodObject<{
9
+ kind: z.ZodLiteral<"fleet">;
10
+ id: z.ZodString;
11
+ }, z.core.$strict>, z.ZodObject<{
12
+ kind: z.ZodLiteral<"sandbox">;
13
+ id: z.ZodString;
14
+ }, z.core.$strict>], "kind">>;
15
+ }, z.core.$strict>;
16
+ export declare const vesselCurrentWorkspaceSchema: z.ZodObject<{
17
+ workspaceId: z.ZodNullable<z.ZodString>;
18
+ environment: z.ZodDiscriminatedUnion<[z.ZodObject<{
19
+ kind: z.ZodLiteral<"local">;
20
+ }, z.core.$strict>, z.ZodObject<{
21
+ kind: z.ZodLiteral<"fleet">;
22
+ id: z.ZodString;
23
+ }, z.core.$strict>, z.ZodObject<{
24
+ kind: z.ZodLiteral<"sandbox">;
25
+ id: z.ZodString;
26
+ }, z.core.$strict>], "kind">;
27
+ }, z.core.$strict>;
28
+ export type VesselCurrentWorkspace = z.infer<typeof vesselCurrentWorkspaceSchema>;
29
+ export declare const vesselEditorIdSchema: z.ZodString;
30
+ export declare const vesselEditorInstanceSchema: z.ZodObject<{
31
+ id: z.ZodString;
32
+ label: z.ZodString;
33
+ current: z.ZodBoolean;
34
+ status: z.ZodString;
35
+ pid: z.ZodOptional<z.ZodNumber>;
36
+ environment: z.ZodDiscriminatedUnion<[z.ZodObject<{
37
+ kind: z.ZodLiteral<"local">;
38
+ }, z.core.$strict>, z.ZodObject<{
39
+ kind: z.ZodLiteral<"fleet">;
40
+ id: z.ZodString;
41
+ }, z.core.$strict>, z.ZodObject<{
42
+ kind: z.ZodLiteral<"sandbox">;
43
+ id: z.ZodString;
44
+ }, z.core.$strict>], "kind">;
45
+ idleTimeoutMs: z.ZodNullable<z.ZodNumber>;
46
+ backgroundProcesses: z.ZodArray<z.ZodObject<{
47
+ id: z.ZodString;
48
+ status: z.ZodString;
49
+ }, z.core.$strict>>;
50
+ }, z.core.$strict>;
51
+ export declare const vesselEditorInventorySchema: z.ZodArray<z.ZodObject<{
52
+ id: z.ZodString;
53
+ label: z.ZodString;
54
+ current: z.ZodBoolean;
55
+ status: z.ZodString;
56
+ pid: z.ZodOptional<z.ZodNumber>;
57
+ environment: z.ZodDiscriminatedUnion<[z.ZodObject<{
58
+ kind: z.ZodLiteral<"local">;
59
+ }, z.core.$strict>, z.ZodObject<{
60
+ kind: z.ZodLiteral<"fleet">;
61
+ id: z.ZodString;
62
+ }, z.core.$strict>, z.ZodObject<{
63
+ kind: z.ZodLiteral<"sandbox">;
64
+ id: z.ZodString;
65
+ }, z.core.$strict>], "kind">;
66
+ idleTimeoutMs: z.ZodNullable<z.ZodNumber>;
67
+ backgroundProcesses: z.ZodArray<z.ZodObject<{
68
+ id: z.ZodString;
69
+ status: z.ZodString;
70
+ }, z.core.$strict>>;
71
+ }, z.core.$strict>>;
72
+ export declare const vesselEditorShutdownReceiptSchema: z.ZodObject<{
73
+ status: z.ZodLiteral<"accepted">;
74
+ operationId: z.ZodString;
75
+ }, z.core.$strict>;
76
+ export type VesselEditorInstance = z.infer<typeof vesselEditorInstanceSchema>;
77
+ export interface VesselWorkspaceLauncher {
78
+ current(): Promise<VesselCurrentWorkspace>;
79
+ open(request: z.infer<typeof vesselOpenWorkspaceSchema>): Promise<z.infer<typeof vesselLaunchResultSchema>>;
80
+ editors(): Promise<VesselEditorInstance[]>;
81
+ shutdown(editorId: string): Promise<z.infer<typeof vesselEditorShutdownReceiptSchema>>;
82
+ }
83
+ export declare const vesselWorkspaceLauncherKind: import("@vibesdotdev/kernel").RuntimeKindDescriptorRecord<unknown>;
84
+ /** Authenticated renderer admission never exposes launch(nativeRoot) or credentials. */
85
+ export declare const vesselWorkspaceLauncherExposure: {
86
+ protocolVersion: 1;
87
+ discoverable: boolean;
88
+ audiences: ("service" | "operator" | "consumer-renderer" | "consumer-cli" | "consumer-agent")[];
89
+ methods: Record<string, {
90
+ request: {
91
+ id: string;
92
+ version: number;
93
+ schema: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
94
+ };
95
+ result: {
96
+ id: string;
97
+ version: number;
98
+ schema: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
99
+ };
100
+ dataClassification: "user" | "public" | "sensitive" | "secret";
101
+ rendererView: "raw" | "redacted" | "denied";
102
+ retry: {
103
+ mode: "read";
104
+ retry: "safe";
105
+ } | {
106
+ mode: "idempotent";
107
+ operationIdRequired: true;
108
+ reconciliationMethod: string;
109
+ } | {
110
+ mode: "non-idempotent";
111
+ retry: "never";
112
+ };
113
+ cancellation: {
114
+ mode: "none" | "cooperative" | "required";
115
+ defaultDeadlineMs: number;
116
+ maxDeadlineMs: number;
117
+ };
118
+ maxRequestBytes: number;
119
+ maxResultBytes: number;
120
+ projectRenderer?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
121
+ stream?: {
122
+ event: {
123
+ id: string;
124
+ version: number;
125
+ schema: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
126
+ };
127
+ maxEventBytes: number;
128
+ initialCredits: number;
129
+ maxCredits: number;
130
+ projectRenderer?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
131
+ } | undefined;
132
+ }>;
133
+ };
134
+ //# sourceMappingURL=workspaces.d.ts.map
@@ -0,0 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AC"}
@@ -0,0 +1,60 @@
1
+ import * as z from 'zod/v4';
2
+ import { createRuntimeKind, RuntimeDescriptorSchema } from '@vibesdotdev/kernel';
3
+ import { defineRemoteExposure } from '@vibesdotdev/kernel/federation';
4
+ import { vesselLaunchEnvironmentSchema, vesselLaunchResultSchema } from "./schema.js";
5
+ /** A host resolves this opaque reference through its workspace custody owner. */
6
+ export const vesselOpenWorkspaceSchema = z.object({
7
+ workspaceId: z.string().min(1).max(256).optional(),
8
+ environment: vesselLaunchEnvironmentSchema.optional()
9
+ }).strict().refine((request) => (request.environment?.kind === 'fleet' && !request.workspaceId) ||
10
+ (Boolean(request.workspaceId) && (!request.environment || request.environment.kind === 'local')), 'Choose an enrolled local workspace or a fleet host.');
11
+ export const vesselCurrentWorkspaceSchema = z.object({
12
+ workspaceId: z.string().min(1).max(256).nullable(),
13
+ environment: vesselLaunchEnvironmentSchema
14
+ }).strict();
15
+ export const vesselEditorIdSchema = z.string().regex(/^vessel-web-[a-f0-9]{20}$/);
16
+ export const vesselEditorInstanceSchema = z.object({
17
+ id: vesselEditorIdSchema,
18
+ label: z.string(),
19
+ current: z.boolean(),
20
+ status: z.string(),
21
+ pid: z.number().int().positive().optional(),
22
+ environment: vesselLaunchEnvironmentSchema,
23
+ idleTimeoutMs: z.number().int().positive().nullable(),
24
+ backgroundProcesses: z.array(z.object({ id: z.string(), status: z.string() }).strict())
25
+ }).strict();
26
+ export const vesselEditorInventorySchema = z.array(vesselEditorInstanceSchema).max(256);
27
+ export const vesselEditorShutdownReceiptSchema = z.object({
28
+ status: z.literal('accepted'),
29
+ operationId: z.string().min(1)
30
+ }).strict();
31
+ export const vesselWorkspaceLauncherKind = createRuntimeKind({
32
+ id: 'vessel/workspace-launcher',
33
+ descriptorSchema: RuntimeDescriptorSchema.extend({ kind: z.literal('vessel/workspace-launcher') }),
34
+ descriptorOwnership: 'single-owner'
35
+ });
36
+ const method = (name, request, result, readOnly) => ({
37
+ request: { id: `vessel.workspace-launcher.${name}.request`, version: 1, schema: request },
38
+ result: { id: `vessel.workspace-launcher.${name}.result`, version: 1, schema: result },
39
+ dataClassification: 'user',
40
+ rendererView: 'raw',
41
+ retry: readOnly
42
+ ? { mode: 'read', retry: 'safe' }
43
+ : { mode: 'non-idempotent', retry: 'never' },
44
+ cancellation: { mode: 'none', defaultDeadlineMs: 300_000, maxDeadlineMs: 300_000 },
45
+ maxRequestBytes: 4096,
46
+ maxResultBytes: 32768
47
+ });
48
+ /** Authenticated renderer admission never exposes launch(nativeRoot) or credentials. */
49
+ export const vesselWorkspaceLauncherExposure = defineRemoteExposure({
50
+ protocolVersion: 1,
51
+ discoverable: true,
52
+ audiences: ['consumer-renderer'],
53
+ methods: {
54
+ current: method('current', z.tuple([]), vesselCurrentWorkspaceSchema, true),
55
+ editors: method('editors', z.tuple([]), vesselEditorInventorySchema, true),
56
+ shutdown: method('shutdown', z.tuple([vesselEditorIdSchema]), vesselEditorShutdownReceiptSchema, false),
57
+ open: method('open', z.tuple([vesselOpenWorkspaceSchema]), vesselLaunchResultSchema, false)
58
+ }
59
+ });
60
+ //# sourceMappingURL=workspaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../../src/launch/workspaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,6BAA6B,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEtF,iFAAiF;AACjF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAClD,WAAW,EAA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E,gBAAyB,EAAE,KAAK,EAAE,OAAgB,EAAE;IAC/D,YAAY,EAAE,EAAE,IAAI,EAAE,MAAe,EAAE,iBAAiB,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE;IAC3F,eAAe,EAAE,IAAI;IACrB,cAAc,EAAE,KAAK;CACrB,CAAC,CAAC;AAEH,wFAAwF;AACxF,MAAM,CAAC,MAAM,+BAA+B,GAAG,oBAAoB,CAAC;IACnE,eAAe,EAAE,CAAC;IAClB,YAAY,EAAE,IAAI;IAClB,SAAS,EAAE,CAAC,mBAAmB,CAAC;IAChC,OAAO,EAAE;QACR,OAAO,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,4BAA4B,EAAE,IAAI,CAAC;QAC3E,OAAO,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,2BAA2B,EAAE,IAAI,CAAC;QAC1E,QAAQ,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,oBAAoB,CAAC,CAAC,EAAE,iCAAiC,EAAE,KAAK,CAAC;QACvG,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,yBAAyB,CAAC,CAAC,EAAE,wBAAwB,EAAE,KAAK,CAAC;KAC3F;CACD,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Optional-peer absence, restricted to the requested module when given. */
2
+ export declare function isModuleNotFound<Input>(input: Input, specifier?: string): boolean;
3
+ //# sourceMappingURL=module-not-found.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-not-found.d.ts","sourceRoot":"","sources":["../src/module-not-found.ts"],"names":[],"mappings":"AAKA,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAUjF"}
@@ -0,0 +1,18 @@
1
+ import { CapabilityError, CaughtFailureSchema, valueFreeFailure } from '@vibesdotdev/kernel';
2
+ import * as z from 'zod/v4';
3
+ const importFailureSchema = z.object({ code: z.enum(['ERR_MODULE_NOT_FOUND', 'MODULE_NOT_FOUND']).optional(), message: z.string().optional() });
4
+ /** Optional-peer absence, restricted to the requested module when given. */
5
+ export function isModuleNotFound(input, specifier) {
6
+ try {
7
+ const parsed = importFailureSchema.safeParse(input);
8
+ if (!parsed.success)
9
+ return false;
10
+ const { code, message } = parsed.data;
11
+ const missing = Boolean(code || message && /Cannot find (module|package)|Failed to resolve (import|module)|Unknown module/i.test(message));
12
+ return missing && (!specifier || Boolean(message?.includes(`'${specifier}'`) || message?.includes(`"${specifier}"`)));
13
+ }
14
+ catch (error) {
15
+ throw new CapabilityError('The import failure could not be inspected.', 'INVALID_INPUT', { reason: 'vessel-import-failure-invalid', details: { failure: { ...valueFreeFailure(CaughtFailureSchema.parse(error)) } } });
16
+ }
17
+ }
18
+ //# sourceMappingURL=module-not-found.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-not-found.js","sourceRoot":"","sources":["../src/module-not-found.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC7F,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAEhJ,4EAA4E;AAC5E,MAAM,UAAU,gBAAgB,CAAQ,KAAY,EAAE,SAAkB;IACvE,IAAI,CAAC;QACJ,MAAM,MAAM,GAAG,mBAAmB,CAAC,SAAS,CA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