@aiworkbench/vibe-ide 0.0.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.
Files changed (39) hide show
  1. package/dist/core/boot.d.ts +15 -0
  2. package/dist/core/boot.d.ts.map +1 -0
  3. package/dist/core/bridge-shim.d.ts +9 -0
  4. package/dist/core/bridge-shim.d.ts.map +1 -0
  5. package/dist/core/filesystem.d.ts +39 -0
  6. package/dist/core/filesystem.d.ts.map +1 -0
  7. package/dist/core/inject-shim.d.ts +6 -0
  8. package/dist/core/inject-shim.d.ts.map +1 -0
  9. package/dist/core/install.d.ts +14 -0
  10. package/dist/core/install.d.ts.map +1 -0
  11. package/dist/core/preview-channel.d.ts +79 -0
  12. package/dist/core/preview-channel.d.ts.map +1 -0
  13. package/dist/core/process.d.ts +20 -0
  14. package/dist/core/process.d.ts.map +1 -0
  15. package/dist/ide-theme.css +248 -0
  16. package/dist/index.d.ts +25 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.js +7699 -0
  19. package/dist/mcp/mcp-adapter.d.ts +45 -0
  20. package/dist/mcp/mcp-adapter.d.ts.map +1 -0
  21. package/dist/mcp/mcp-tools.d.ts +467 -0
  22. package/dist/mcp/mcp-tools.d.ts.map +1 -0
  23. package/dist/react/provider.d.ts +12 -0
  24. package/dist/react/provider.d.ts.map +1 -0
  25. package/dist/react/use-vibe-ide.d.ts +11 -0
  26. package/dist/react/use-vibe-ide.d.ts.map +1 -0
  27. package/dist/react/vibe-ide-bridge-relay.d.ts +14 -0
  28. package/dist/react/vibe-ide-bridge-relay.d.ts.map +1 -0
  29. package/dist/react/vibe-ide-layout.d.ts +10 -0
  30. package/dist/react/vibe-ide-layout.d.ts.map +1 -0
  31. package/dist/react/vibe-ide-preview-pane.d.ts +7 -0
  32. package/dist/react/vibe-ide-preview-pane.d.ts.map +1 -0
  33. package/dist/react/vibe-ide-toolbar.d.ts +15 -0
  34. package/dist/react/vibe-ide-toolbar.d.ts.map +1 -0
  35. package/dist/templates/generated.d.ts +22 -0
  36. package/dist/templates/generated.d.ts.map +1 -0
  37. package/dist/types.d.ts +187 -0
  38. package/dist/types.d.ts.map +1 -0
  39. package/package.json +41 -0
@@ -0,0 +1,15 @@
1
+ /**
2
+ * WebContainer boot lifecycle with single-tab detection.
3
+ *
4
+ * Refactored from usecase-editor to accept configurable options
5
+ * instead of relying on host-level globals.
6
+ */
7
+ import { WebContainer } from "@webcontainer/api";
8
+ import type { VibeIdeBootOptions } from "../types";
9
+ export declare class WebContainerTabBlockedError extends Error {
10
+ constructor();
11
+ }
12
+ export declare function bootWebContainer(options?: VibeIdeBootOptions): Promise<WebContainer>;
13
+ export declare function teardownWebContainer(): void;
14
+ export declare function getWebContainer(): WebContainer | null;
15
+ //# sourceMappingURL=boot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../src/core/boot.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAUnD,qBAAa,2BAA4B,SAAQ,KAAK;;CAOrD;AAED,wBAAsB,gBAAgB,CACpC,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,YAAY,CAAC,CAiEvB;AAED,wBAAgB,oBAAoB,SAcnC;AAED,wBAAgB,eAAe,wBAE9B"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Bridge dev shim — injected into the WebContainer at /.ide/vibe-bridge-dev.js
3
+ *
4
+ * This is a self-executing JS string that creates `window.__VIBE_BRIDGE_DEV__`,
5
+ * implementing the full Bridge API client-side inside the preview iframe. It
6
+ * communicates with the host via a MessagePort received through `vibe:init`.
7
+ */
8
+ export declare const BRIDGE_DEV_SHIM_SOURCE = "\n(async function() {\n function waitForBridgeInit() {\n return new Promise((resolve) => {\n window.addEventListener('message', (e) => {\n if (e.data?.type === 'vibe:init') {\n resolve({ port: e.ports[0], previewSessionId: e.data.previewSessionId, bootstrap: e.data.bootstrap });\n }\n });\n });\n }\n\n const { port, previewSessionId, bootstrap } = await waitForBridgeInit();\n const effectivePermissions = new Set(Array.isArray(bootstrap?.effectivePermissions) ? bootstrap.effectivePermissions : []);\n let currentBootstrap = bootstrap || {};\n\n window.addEventListener('message', (e) => {\n if (e.data?.type === 'vibe:permissions') {\n effectivePermissions.clear();\n const nextPermissions = Array.isArray(e.data.effectivePermissions) ? e.data.effectivePermissions : [];\n nextPermissions.forEach((capability) => effectivePermissions.add(capability));\n currentBootstrap = e.data.bootstrap || currentBootstrap;\n }\n });\n\n function ensureCapability(capability) {\n if (!effectivePermissions.has(capability)) {\n throw new Error(capability + ' is not permitted in this preview');\n }\n }\n\n function sendOneWay(capability, method, args) {\n ensureCapability(capability);\n port.postMessage({ id: crypto.randomUUID(), previewSessionId, capability, method, args });\n }\n\n function sendRequest(capability, method, args) {\n ensureCapability(capability);\n const id = crypto.randomUUID();\n return new Promise((resolve, reject) => {\n const handler = (e) => {\n if (e.data.id === id) {\n port.removeEventListener('message', handler);\n if (e.data.error) reject(new Error(e.data.error));\n else resolve(e.data.result);\n }\n };\n port.addEventListener('message', handler);\n port.start();\n port.postMessage({ id, previewSessionId, capability, method, args });\n });\n }\n\n function sendStream(capability, method, args, onChunk) {\n ensureCapability(capability);\n const id = crypto.randomUUID();\n let isDone = false;\n let stopEventRegistration = () => {};\n\n const promise = new Promise((resolve, reject) => {\n const handler = (e) => {\n if (e.data.id === id) {\n if (e.data.error) {\n port.removeEventListener('message', handler);\n reject(new Error(e.data.error));\n } else if (e.data.chunk !== undefined) {\n onChunk(e.data.chunk);\n } else if (e.data.subscribed) {\n resolve({ subscriptionId: id, unsubscribe: stopEventRegistration });\n } else if (e.data.done || e.data.result !== undefined) {\n port.removeEventListener('message', handler);\n isDone = true;\n resolve(e.data.result);\n }\n }\n };\n port.addEventListener('message', handler);\n port.start();\n port.postMessage({ id, previewSessionId, capability, method, args });\n \n stopEventRegistration = () => {\n if (!isDone) {\n port.removeEventListener('message', handler);\n port.postMessage({\n id: crypto.randomUUID(),\n previewSessionId,\n capability,\n method: 'unsubscribe',\n args: [id],\n });\n }\n };\n });\n \n return { promise, unsubscribe: stopEventRegistration };\n }\n\n window.__VIBE_BRIDGE_DEV__ = {\n auth: {\n getUser: () => {\n ensureCapability('auth');\n if (!currentBootstrap.user) {\n throw new Error('auth.getUser() is unavailable in this preview');\n }\n return currentBootstrap.user;\n },\n getToken: async () => { throw new Error(\"auth.getToken() is unavailable in dev preview\"); }\n },\n theme: {\n current: () => {\n ensureCapability('theme');\n return currentBootstrap.theme;\n }\n },\n toast: {\n show: (msg, opts) => sendOneWay('toast', 'show', [msg, opts])\n },\n api: {\n fetch: async (ep, opts) => {\n const res = await sendRequest('api', 'fetch', [ep, opts]);\n return new Response(res.body, { status: res.status, statusText: res.statusText, headers: res.headers });\n }\n },\n storage: {\n get: (key) => sendRequest('storage', 'get', [key]),\n set: (key, val) => sendRequest('storage', 'set', [key, val]),\n remove: (key) => sendRequest('storage', 'remove', [key]),\n keys: () => sendRequest('storage', 'keys', [])\n },\n navigation: {\n navigate: (path) => sendOneWay('navigation', 'navigate', [path])\n },\n events: {\n emit: (evt, data) => sendOneWay('events', 'emit', [evt, data]),\n on: (evt, cb) => {\n const stream = sendStream('events', 'on', [evt], (chunk) => {\n cb(chunk);\n });\n return stream.unsubscribe;\n },\n once: (evt, cb) => {\n let unsub = () => {};\n const wrappedCb = (chunk) => { unsub(); cb(chunk); };\n const stream = sendStream('events', 'once', [evt], wrappedCb);\n unsub = stream.unsubscribe;\n return unsub;\n }\n },\n chat: {\n send: function(serverUrl, parts, options) {\n const payload = {\n serverUrl,\n parts,\n options: options ? {\n contextId: options.contextId,\n messageId: options.messageId,\n metadata: options.metadata,\n } : undefined,\n };\n let buffer = [];\n let error = null;\n let done = false;\n let resolvers = [];\n const stream = sendStream('chat', 'send', [payload], (chunk) => {\n buffer.push(chunk);\n if (resolvers.length > 0) resolvers.shift()();\n });\n\n stream.promise.then((res) => {\n done = true;\n if (resolvers.length > 0) resolvers.shift()();\n }).catch(err => {\n error = err;\n done = true;\n if (resolvers.length > 0) resolvers.shift()();\n });\n const iterator = (async function*() {\n while (true) {\n if (buffer.length > 0) yield buffer.shift();\n else if (error) throw error;\n else if (done) break;\n else await new Promise(r => resolvers.push(r));\n }\n })();\n\n return {\n [Symbol.asyncIterator]: () => iterator,\n abort: () => stream.unsubscribe(),\n };\n }\n }\n };\n\n window.dispatchEvent(new Event(\"vibe-bridge-ready\"));\n})();\n";
9
+ //# sourceMappingURL=bridge-shim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge-shim.d.ts","sourceRoot":"","sources":["../../src/core/bridge-shim.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,sBAAsB,6hNAmMlC,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * WebContainer filesystem helpers: read, write, serialize, and batched writes.
3
+ *
4
+ * Refactored from usecase-editor to accept configurable exclusion lists.
5
+ */
6
+ import type { WebContainer, FileSystemTree } from "@webcontainer/api";
7
+ export declare function readFileTree(instance: WebContainer, basePath?: string, options?: {
8
+ exclude?: string[];
9
+ }): Promise<FileSystemTree>;
10
+ export declare function serializeProject(instance: WebContainer): Promise<{
11
+ path: string;
12
+ content: string;
13
+ }[]>;
14
+ export declare function writeFileTree(instance: WebContainer, _path: string, tree: FileSystemTree): Promise<void>;
15
+ /**
16
+ * Batches filesystem writes with a 150ms idle debounce. Prevents Vite HMR
17
+ * thrashing when the agent writes many files in rapid succession.
18
+ */
19
+ export declare class WriteCoalescer {
20
+ private instance;
21
+ private pending;
22
+ private timer;
23
+ dirty: boolean;
24
+ private maxBufferSize;
25
+ private currentBufferSize;
26
+ constructor(instance: WebContainer, options?: {
27
+ maxBufferSize?: number;
28
+ });
29
+ enqueue(path: string, content: string): void;
30
+ write(path: string, content: string): void;
31
+ private scheduleFlush;
32
+ flushImmediate(files: {
33
+ path: string;
34
+ content: string;
35
+ }[]): Promise<void>;
36
+ private writeDirect;
37
+ destroy(): void;
38
+ }
39
+ //# sourceMappingURL=filesystem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filesystem.d.ts","sourceRoot":"","sources":["../../src/core/filesystem.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAoBtE,wBAAsB,YAAY,CAChC,QAAQ,EAAE,YAAY,EACtB,QAAQ,GAAE,MAAY,EACtB,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CAAO,GACnC,OAAO,CAAC,cAAc,CAAC,CA6BzB;AAED,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,CAAC,CAkB9C;AAED,wBAAsB,aAAa,CACjC,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,cAAc,iBAGrB;AAED;;;GAGG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAe;IAC/B,OAAO,CAAC,OAAO,CAAkC;IACjD,OAAO,CAAC,KAAK,CAAuB;IAC7B,KAAK,UAAS;IACrB,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,iBAAiB,CAAK;gBAElB,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE;IAKxE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAyBrC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAInC,OAAO,CAAC,aAAa;IAWf,cAAc,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE;YAiBjD,WAAW;IAezB,OAAO;CAGR"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Inject the bridge dev shim into the WebContainer virtual filesystem.
3
+ */
4
+ import type { WebContainer } from "@webcontainer/api";
5
+ export declare function injectDevShim(instance: WebContainer): Promise<void>;
6
+ //# sourceMappingURL=inject-shim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inject-shim.d.ts","sourceRoot":"","sources":["../../src/core/inject-shim.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD,wBAAsB,aAAa,CAAC,QAAQ,EAAE,YAAY,iBAWzD"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Dependency installation with SHA-256 fingerprint-based caching.
3
+ */
4
+ import type { WebContainer } from "@webcontainer/api";
5
+ export declare function computeInstallFingerprint(lockfile: string, nodeVersion: string, npmVersion: string, installMode: string, templateId: string): Promise<string>;
6
+ export declare function installDependencies(instance: WebContainer, options?: {
7
+ templateId?: string;
8
+ onOutput?: (chunk: string) => void;
9
+ }): Promise<{
10
+ skipped: boolean;
11
+ exitCode: number;
12
+ fingerprint: string;
13
+ }>;
14
+ //# sourceMappingURL=install.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/core/install.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKtD,wBAAsB,yBAAyB,CAC7C,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,mBAQnB;AAED,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,YAAY,EACtB,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE;;;;GAoCtE"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Preview iframe ↔ host bridge relay protocol.
3
+ *
4
+ * Uses a `MessageChannel` for secure, session-bound communication between the
5
+ * host IDE and the preview iframe running inside WebContainer.
6
+ *
7
+ * Refactored from usecase-editor to remove the React `RefObject` dependency.
8
+ * Accepts a plain `{ current: HTMLIFrameElement | null }` ref-like object so
9
+ * it works with any framework (or direct DOM references).
10
+ */
11
+ import { z } from "zod";
12
+ export declare const BridgeCapabilitySchema: z.ZodEnum<["toast", "navigation", "storage", "events", "theme", "auth", "api", "chat"]>;
13
+ export type BridgeCapability = z.infer<typeof BridgeCapabilitySchema>;
14
+ export declare const BridgeRequestSchema: z.ZodObject<{
15
+ id: z.ZodString;
16
+ previewSessionId: z.ZodString;
17
+ capability: z.ZodEnum<["toast", "navigation", "storage", "events", "theme", "auth", "api", "chat"]>;
18
+ method: z.ZodString;
19
+ args: z.ZodArray<z.ZodUnknown, "many">;
20
+ }, "strip", z.ZodTypeAny, {
21
+ id: string;
22
+ previewSessionId: string;
23
+ capability: "auth" | "api" | "navigation" | "theme" | "toast" | "storage" | "events" | "chat";
24
+ method: string;
25
+ args: unknown[];
26
+ }, {
27
+ id: string;
28
+ previewSessionId: string;
29
+ capability: "auth" | "api" | "navigation" | "theme" | "toast" | "storage" | "events" | "chat";
30
+ method: string;
31
+ args: unknown[];
32
+ }>;
33
+ export type BridgeRequest = z.infer<typeof BridgeRequestSchema>;
34
+ export declare const BridgeResponseSchema: z.ZodObject<{
35
+ id: z.ZodString;
36
+ result: z.ZodOptional<z.ZodUnknown>;
37
+ error: z.ZodOptional<z.ZodString>;
38
+ chunk: z.ZodOptional<z.ZodUnknown>;
39
+ done: z.ZodOptional<z.ZodBoolean>;
40
+ subscribed: z.ZodOptional<z.ZodBoolean>;
41
+ }, "strip", z.ZodTypeAny, {
42
+ id: string;
43
+ error?: string | undefined;
44
+ result?: unknown;
45
+ chunk?: unknown;
46
+ done?: boolean | undefined;
47
+ subscribed?: boolean | undefined;
48
+ }, {
49
+ id: string;
50
+ error?: string | undefined;
51
+ result?: unknown;
52
+ chunk?: unknown;
53
+ done?: boolean | undefined;
54
+ subscribed?: boolean | undefined;
55
+ }>;
56
+ export type BridgeResponse = z.infer<typeof BridgeResponseSchema>;
57
+ /** A ref-like container for an iframe element. Compatible with React refs. */
58
+ export interface IframeRef {
59
+ current: HTMLIFrameElement | null;
60
+ }
61
+ export declare function createPreviewChannel(iframeRef: IframeRef, iframeOrigin: string): {
62
+ channel: MessageChannel;
63
+ previewSessionId: `${string}-${string}-${string}-${string}-${string}`;
64
+ sendInit: (effectivePermissions: BridgeCapability[], bootstrap: unknown) => void;
65
+ destroy: () => void;
66
+ };
67
+ export type StreamingContext = {
68
+ id: string;
69
+ postChunk: (chunk: unknown) => void;
70
+ done: (result?: unknown) => void;
71
+ };
72
+ export type CapabilityHandler = (method: string, args: unknown[], ctx: StreamingContext) => Promise<unknown> | unknown;
73
+ export declare function createRequestHandler(port: MessagePort, handlers: Partial<Record<BridgeCapability, CapabilityHandler>>, options?: {
74
+ timeout?: number;
75
+ maxConcurrency?: number;
76
+ allowedSessionId?: string;
77
+ allowedCapabilities?: BridgeCapability[] | (() => BridgeCapability[]);
78
+ }): () => void;
79
+ //# sourceMappingURL=preview-channel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-channel.d.ts","sourceRoot":"","sources":["../../src/core/preview-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,sBAAsB,yFASjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MA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+ * WebContainer process spawning with output buffering and timeout control.
3
+ */
4
+ import type { WebContainer } from "@webcontainer/api";
5
+ export interface ProcessResult {
6
+ exitCode: Promise<number>;
7
+ kill: () => void;
8
+ }
9
+ export declare function spawnWithOutput(instance: WebContainer, command: string, args: string[], options?: {
10
+ onChunk?: (chunk: string) => void;
11
+ timeout?: number;
12
+ }): Promise<ProcessResult>;
13
+ export declare function spawnDevServer(instance: WebContainer, options?: {
14
+ onOutput?: (chunk: string) => void;
15
+ }): Promise<{
16
+ url: Promise<string>;
17
+ kill: () => void;
18
+ output: ReadableStream<string>;
19
+ }>;
20
+ //# sourceMappingURL=process.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../src/core/process.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1B,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,wBAAsB,eAAe,CACnC,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAChE,OAAO,CAAC,aAAa,CAAC,CA2ExB;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,YAAY,EACtB,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE;;;;GAsBjD"}
@@ -0,0 +1,248 @@
1
+ /* ─────────────────────────────────────────────────────────
2
+ IDE Theme — Polished Dark with Gold/Amber Accent
3
+ Scoped tokens & utilities for the builder IDE view.
4
+ ───────────────────────────────────────────────────────── */
5
+
6
+ /* ── Design Tokens ─────────────────────────────────────── */
7
+ .ide-root {
8
+ color-scheme: dark;
9
+
10
+ /* Backgrounds */
11
+ --ide-bg: #09090b;
12
+ --ide-surface: #18181b;
13
+ --ide-surface-hover: #27272a;
14
+
15
+ /* Borders */
16
+ --ide-border: #27272a;
17
+ --ide-border-strong: #3f3f46;
18
+
19
+ /* Text */
20
+ --ide-text: #fafafa;
21
+ --ide-text-secondary: #a1a1aa;
22
+ --ide-text-tertiary: #71717a;
23
+
24
+ /* Accent — tertiary gold/amber from design tokens */
25
+ --ide-accent: oklch(0.8544 0.1746 90.88);
26
+ --ide-accent-soft: rgba(234, 179, 8, 0.10);
27
+ --ide-accent-hover: oklch(0.9 0.16 90.88);
28
+ --ide-accent-muted: oklch(0.7 0.14 90.88);
29
+
30
+ /* Semantic */
31
+ --ide-success: #22c55e;
32
+ --ide-error: #ef4444;
33
+ --ide-warning: #f59e0b;
34
+ }
35
+
36
+ /* ── Base Panel ────────────────────────────────────────── */
37
+ .ide-panel {
38
+ background: var(--ide-bg);
39
+ color: var(--ide-text);
40
+ }
41
+
42
+ /* ── Elevated Card ─────────────────────────────────────── */
43
+ .ide-card {
44
+ background: var(--ide-surface);
45
+ border: 1px solid var(--ide-border);
46
+ border-radius: 0.75rem;
47
+ box-shadow:
48
+ 0 1px 2px rgba(0, 0, 0, 0.3),
49
+ 0 4px 12px rgba(0, 0, 0, 0.15);
50
+ }
51
+
52
+ .ide-card:hover {
53
+ border-color: var(--ide-border-strong);
54
+ }
55
+
56
+ /* ── Segmented Tab Pills ───────────────────────────────── */
57
+ .ide-pill-group {
58
+ display: flex;
59
+ align-items: center;
60
+ gap: 2px;
61
+ background: var(--ide-surface);
62
+ border-radius: 0.5rem;
63
+ padding: 3px;
64
+ }
65
+
66
+ .ide-pill {
67
+ padding: 0.25rem 0.75rem;
68
+ font-size: 0.8125rem;
69
+ font-weight: 500;
70
+ border-radius: 0.375rem;
71
+ cursor: pointer;
72
+ transition-property: color, background-color, box-shadow;
73
+ transition-duration: 150ms;
74
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
75
+ user-select: none;
76
+ }
77
+
78
+ .ide-pill-active {
79
+ background: var(--ide-accent);
80
+ color: var(--ide-bg);
81
+ box-shadow: 0 1px 4px rgba(234, 179, 8, 0.25);
82
+ }
83
+
84
+ .ide-pill-inactive {
85
+ color: var(--ide-text-tertiary);
86
+ background: transparent;
87
+ }
88
+
89
+ .ide-pill-inactive:hover {
90
+ color: var(--ide-text);
91
+ background: var(--ide-surface-hover);
92
+ }
93
+
94
+ /* ── Input ──────────────────────────────────────────────── */
95
+ .ide-input {
96
+ background: var(--ide-surface);
97
+ border: 1px solid var(--ide-border);
98
+ color: var(--ide-text);
99
+ border-radius: 0.75rem;
100
+ transition-property: border-color, box-shadow;
101
+ transition-duration: 150ms;
102
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
103
+ }
104
+
105
+ .ide-input::placeholder {
106
+ color: var(--ide-text-tertiary);
107
+ }
108
+
109
+ .ide-input:focus {
110
+ outline: none;
111
+ border-color: var(--ide-accent);
112
+ box-shadow: 0 0 0 3px var(--ide-accent-soft);
113
+ }
114
+
115
+ /* ── React-Split Gutter ────────────────────────────────── */
116
+ .ide-gutter {
117
+ position: relative;
118
+ background: transparent !important;
119
+ cursor: col-resize;
120
+ z-index: 10;
121
+ }
122
+
123
+ .ide-gutter::before {
124
+ content: "";
125
+ position: absolute;
126
+ top: 0;
127
+ bottom: 0;
128
+ left: 50%;
129
+ width: 1px;
130
+ transform: translateX(-50%);
131
+ background: var(--ide-border);
132
+ transition-property: background-color, width;
133
+ transition-duration: 150ms;
134
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
135
+ }
136
+
137
+ .ide-gutter:hover::before {
138
+ width: 2px;
139
+ background: var(--ide-accent);
140
+ }
141
+
142
+ /* ── Scrollbar (dark) ──────────────────────────────────── */
143
+ .ide-scrollbar::-webkit-scrollbar {
144
+ width: 6px;
145
+ }
146
+
147
+ .ide-scrollbar::-webkit-scrollbar-track {
148
+ background: transparent;
149
+ }
150
+
151
+ .ide-scrollbar::-webkit-scrollbar-thumb {
152
+ background: var(--ide-border-strong);
153
+ border-radius: 3px;
154
+ }
155
+
156
+ .ide-scrollbar::-webkit-scrollbar-thumb:hover {
157
+ background: var(--ide-text-tertiary);
158
+ }
159
+
160
+ /* ── Radix ScrollArea thin scrollbar (inside .ide-root) ── */
161
+ .ide-root [data-slot="scroll-area-scrollbar"][data-orientation="vertical"] {
162
+ width: 4px;
163
+ border-left: none;
164
+ padding: 0;
165
+ }
166
+
167
+ .ide-root [data-slot="scroll-area-thumb"] {
168
+ background: var(--ide-border-strong);
169
+ border-radius: 9999px;
170
+ }
171
+
172
+ .ide-root [data-slot="scroll-area-thumb"]:hover {
173
+ background: var(--ide-text-tertiary);
174
+ }
175
+
176
+ /* ── Gold Spinner ──────────────────────────────────────── */
177
+ @keyframes ide-spin {
178
+ to {
179
+ transform: rotate(360deg);
180
+ }
181
+ }
182
+
183
+ .ide-spinner {
184
+ width: 2rem;
185
+ height: 2rem;
186
+ border: 2px solid var(--ide-border);
187
+ border-top-color: var(--ide-accent);
188
+ border-radius: 9999px;
189
+ animation: ide-spin 0.8s linear infinite;
190
+ }
191
+
192
+ /* ── Fade-in for loading text ──────────────────────────── */
193
+ @keyframes ide-fade-in {
194
+ from {
195
+ opacity: 0;
196
+ transform: translateY(4px);
197
+ }
198
+ to {
199
+ opacity: 1;
200
+ transform: translateY(0);
201
+ }
202
+ }
203
+
204
+ .ide-fade-in {
205
+ animation: ide-fade-in 0.4s ease-out both;
206
+ }
207
+
208
+ /* ── Collapse toggle button ────────────────────────────── */
209
+ .ide-collapse-btn {
210
+ display: flex;
211
+ align-items: center;
212
+ justify-content: center;
213
+ width: 1.5rem;
214
+ height: 2.5rem;
215
+ background: var(--ide-surface);
216
+ border: 1px solid var(--ide-border);
217
+ border-radius: 0 0.5rem 0.5rem 0;
218
+ cursor: pointer;
219
+ color: var(--ide-text-tertiary);
220
+ transition-property: color, background-color, border-color;
221
+ transition-duration: 150ms;
222
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
223
+ z-index: 20;
224
+ }
225
+
226
+ .ide-collapse-btn:hover {
227
+ color: var(--ide-accent);
228
+ background: var(--ide-surface-hover);
229
+ border-color: var(--ide-accent);
230
+ }
231
+
232
+ /* ── Reduce motion ─────────────────────────────────────── */
233
+ @media (prefers-reduced-motion: reduce) {
234
+ .ide-spinner {
235
+ animation-duration: 3s;
236
+ }
237
+
238
+ .ide-fade-in {
239
+ animation: none;
240
+ }
241
+
242
+ .ide-pill,
243
+ .ide-input,
244
+ .ide-gutter::before,
245
+ .ide-collapse-btn {
246
+ transition-duration: 0ms;
247
+ }
248
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @aiworkbench/vibe-ide — Public API barrel export.
3
+ *
4
+ * This is the single entry point for the package. It re-exports everything
5
+ * consumers need: types, core runtime, MCP layer, template generation,
6
+ * and React components/hooks.
7
+ */
8
+ export type { TemplateId, TemplateVars, RightPaneTab, UnifiedMessageStatus, UnifiedConnectionStatus, UnifiedArtifact, UnifiedStatusUpdate, UnifiedToolInvocation, UnifiedMessage, VibeIdeChatAdapter, VibeIdePreviewPolicy, VibeIdePersistenceAdapter, VibeIdeApprovalAdapter, WebContainerMcpAdapterOptions, VibeIdeBootOptions, VibeIdeProviderProps, VibeIdeSplitLayoutProps, VibeIdeContextValue, } from "./types";
9
+ export { bootWebContainer, teardownWebContainer, getWebContainer, WebContainerTabBlockedError, } from "./core/boot";
10
+ export { readFileTree, serializeProject, writeFileTree, WriteCoalescer, } from "./core/filesystem";
11
+ export { spawnWithOutput, spawnDevServer, type ProcessResult, } from "./core/process";
12
+ export { installDependencies, computeInstallFingerprint, } from "./core/install";
13
+ export { createPreviewChannel, createRequestHandler, BridgeCapabilitySchema, BridgeRequestSchema, BridgeResponseSchema, type IframeRef, type BridgeCapability, type BridgeRequest, type BridgeResponse, type StreamingContext, type CapabilityHandler, } from "./core/preview-channel";
14
+ export { BRIDGE_DEV_SHIM_SOURCE } from "./core/bridge-shim";
15
+ export { injectDevShim } from "./core/inject-shim";
16
+ export { webContainerToolArgumentSchemas, WebContainerToolSchema, webContainerToolsDefinition, type WebContainerToolCall, } from "./mcp/mcp-tools";
17
+ export { WebContainerMcpAdapter, createWebContainerMcpAdapter, } from "./mcp/mcp-adapter";
18
+ export { getVibeIdeTemplateTree } from "./templates/generated";
19
+ export { VibeIdeProvider } from "./react/provider";
20
+ export { useVibeIde } from "./react/use-vibe-ide";
21
+ export { VibeIdeSplitLayout } from "./react/vibe-ide-layout";
22
+ export { VibeIdePreviewPane } from "./react/vibe-ide-preview-pane";
23
+ export { VibeIdeToolbar } from "./react/vibe-ide-toolbar";
24
+ export { VibeIdeBridgeRelay } from "./react/vibe-ide-bridge-relay";
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,YAAY,EACV,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,SAAS,CAAC;AAMjB,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,cAAc,GACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,eAAe,EACf,cAAc,EACd,KAAK,aAAa,GACnB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,mBAAmB,EAC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