@vibes.diy/vibe-runtime 3.0.3 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,23 +1,23 @@
1
1
  [![Join our
2
2
  Discord](https://discord-badge.selem.workers.dev/i/vnpWycj4Ta.svg)](https://discord.gg/vnpWycj4Ta)
3
3
 
4
- # ✨ Vibes DIY — make apps with your friends
4
+ # ✨ Vibes DIY — make apps with your friends, run the front counter
5
5
 
6
6
  Software is getting weird again. Describe what you want and get a real, live app — fun, done, and alive. [Try it now](https://vibes.diy/) or [fork on GitHub](https://github.com/VibesDIY/vibes.diy).
7
7
 
8
- Make apps with your friends, so easy even AI can do it. Describe your app in plain words, it builds instantly, and you keep changing it just by talking to it. Share the link and your friends join right away no setup, no "wait, let me send you the invite."
8
+ Make apps with your friends or run the front counter. So easy even AI can do it. Describe your app in plain words, it builds instantly, and you keep changing it just by talking to it. Share the link and your friends — or your customers — join right away. No setup, no "wait, let me send you the invite."
9
9
 
10
10
  ## Why it's different
11
11
 
12
- - **Fun** — build for any reason, or no reason at all.
13
- - **Done** — it's a real app at its own live link, not a prototype. State is saved automatically.
12
+ - **Fun** — build for any reason, or no reason at all. Or because the spreadsheet is killing you.
13
+ - **Done** — it's a real app at its own live link, not a prototype. It can take an order — add a payment flow when you wire one up. State is saved automatically.
14
14
  - **Alive** — keep talking to it and it keeps changing. So can anyone you share it with.
15
15
 
16
16
  Seeing a vibe makes you want to change it. Start from someone else's, tweak it to fit you, share it, and the people you share with remix their own version. You're not a user anymore — you're a maker.
17
17
 
18
18
  ## What people make
19
19
 
20
- A character bot that answers in your voice. A neighborhood resource tracker you share at the next town meeting. A flashcard app remixed into collaborative trivia your students change live. A workout tracker a whole gym swaps routines on. Every one is the same move: start, tweak, share, remix.
20
+ From the group chat to the front counter. A character bot that answers in your voice. A neighborhood resource tracker you share at the next town meeting. A daily-specials board that takes the order. The shared spreadsheet your team fights over, turned into a real app with a form and a dashboard. A booking-and-intake app your clients fill out themselves. Every one is the same move: start, tweak, share, remix.
21
21
 
22
22
  ## Yours to control
23
23
 
@@ -0,0 +1,28 @@
1
+ import { type WorkerLoaderBinding } from "./worker-loader-executor.js";
2
+ export type BackendHandler = "fetch" | "scheduled" | "onChange";
3
+ export interface BackendTrigger {
4
+ readonly userHandle?: string | null;
5
+ readonly sourceTag?: string;
6
+ readonly depth?: number;
7
+ readonly dedupeKey?: string;
8
+ readonly payload?: unknown;
9
+ }
10
+ export interface BackendInvokeInput {
11
+ readonly source: string;
12
+ readonly handler: BackendHandler;
13
+ readonly trigger: BackendTrigger;
14
+ }
15
+ export interface BackendExecutor {
16
+ invoke(input: BackendInvokeInput): Promise<Response>;
17
+ }
18
+ export type BackendJsMode = "off" | "loader";
19
+ export declare function parseBackendJsMode(raw: string | undefined): BackendJsMode;
20
+ export interface SelectBackendExecutorOptions {
21
+ readonly loader?: WorkerLoaderBinding;
22
+ readonly policyVersion?: string;
23
+ readonly vibe?: {
24
+ readonly ownerHandle: string;
25
+ readonly appSlug: string;
26
+ };
27
+ }
28
+ export declare function selectBackendExecutor(mode: BackendJsMode, opts?: SelectBackendExecutorOptions): BackendExecutor | undefined;
@@ -0,0 +1,21 @@
1
+ import { WorkerLoaderBackendExecutor } from "./backend-worker-loader-executor.js";
2
+ export function parseBackendJsMode(raw) {
3
+ switch ((raw ?? "").trim().toLowerCase()) {
4
+ case "loader":
5
+ return "loader";
6
+ default:
7
+ return "off";
8
+ }
9
+ }
10
+ export function selectBackendExecutor(mode, opts = {}) {
11
+ switch (mode) {
12
+ case "off":
13
+ return undefined;
14
+ case "loader":
15
+ if (opts.loader === undefined) {
16
+ throw new Error("BACKEND_JS=loader requires a Worker Loader (env.LOADER) binding");
17
+ }
18
+ return new WorkerLoaderBackendExecutor(opts.loader, { policyVersion: opts.policyVersion, vibe: opts.vibe });
19
+ }
20
+ }
21
+ //# sourceMappingURL=backend-executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backend-executor.js","sourceRoot":"","sources":["../jsr/backend-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AA4ElF,MAAM,UAAU,kBAAkB,CAAC,GAAuB;IACxD,QAAQ,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC;QACzC,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC;AAgCD,MAAM,UAAU,qBAAqB,CAAC,IAAmB,EAAE,IAAI,GAAiC,EAAE;IAChG,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,KAAK;YACR,OAAO,SAAS,CAAC;QACnB,KAAK,QAAQ;YACX,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;gBAC9B,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;YACrF,CAAC;YACD,OAAO,IAAI,2BAA2B,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAChH,CAAC;AACH,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { type WorkerCode, type WorkerLoaderBinding } from "./worker-loader-executor.js";
2
+ import { type BackendExecutor, type BackendInvokeInput } from "./backend-executor.js";
3
+ export declare function buildBackendWorkerCode(input: {
4
+ module: string;
5
+ policyVersion?: string;
6
+ vibe?: {
7
+ ownerHandle: string;
8
+ appSlug: string;
9
+ };
10
+ }): WorkerCode;
11
+ export declare class WorkerLoaderBackendExecutor implements BackendExecutor {
12
+ private readonly loader;
13
+ private readonly opts;
14
+ constructor(loader: WorkerLoaderBinding, opts?: {
15
+ readonly policyVersion?: string;
16
+ readonly vibe?: {
17
+ ownerHandle: string;
18
+ appSlug: string;
19
+ };
20
+ });
21
+ invoke(input: BackendInvokeInput): Promise<Response>;
22
+ }
@@ -0,0 +1,81 @@
1
+ import { TxtEnDecoderSingleton } from "@adviser/cement";
2
+ import { transformBackendSource } from "./transform-backend-source.js";
3
+ const MAIN_MODULE = "main.js";
4
+ const BACKEND_MODULE = "backend.js";
5
+ const COMPATIBILITY_DATE = "2025-05-01";
6
+ const BACKEND_REQUEST_URL = "https://vibe-backend.internal/";
7
+ export function buildBackendWorkerCode(input) {
8
+ const policyVersion = input.policyVersion ?? "v1";
9
+ const vibeLiteral = input.vibe ? JSON.stringify({ ownerHandle: input.vibe.ownerHandle, appSlug: input.vibe.appSlug }) : "null";
10
+ const main = [
11
+ `// backend-isolate policy=${policyVersion}`,
12
+ `import * as handlers from "./${BACKEND_MODULE}";`,
13
+ `const VIBE = ${vibeLiteral};`,
14
+ `export default {`,
15
+ ` async fetch(request) {`,
16
+ ` const { handler, trigger } = await request.json();`,
17
+ ` const ALLOWED_HANDLERS = { fetch: true, scheduled: true, onChange: true };`,
18
+ ` if (!Object.prototype.hasOwnProperty.call(ALLOWED_HANDLERS, handler)) {`,
19
+ ` return new Response("invalid backend handler: " + handler, { status: 400 });`,
20
+ ` }`,
21
+ ` const ctx = {`,
22
+ ` appInfo: VIBE,`,
23
+ ` userInfo: trigger && trigger.userHandle ? { userHandle: trigger.userHandle } : null,`,
24
+ ` get db() { throw new Error("ctx.db is not available yet (wired in #2856 slice B6)"); },`,
25
+ ` get secrets() { throw new Error("ctx.secrets is not available yet (wired in #2856 slice B7)"); },`,
26
+ ` };`,
27
+ ` const fn = handlers[handler];`,
28
+ ` if (typeof fn !== "function") {`,
29
+ ` return new Response("no backend handler: " + handler, { status: 404 });`,
30
+ ` }`,
31
+ ` if (handler === "fetch") {`,
32
+ ` const p = (trigger && trigger.payload) || {};`,
33
+ ` const userReq = new Request(p.url || "https://vibe.internal/", {`,
34
+ ` method: p.method, headers: p.headers, body: p.body,`,
35
+ ` });`,
36
+ ` return await fn(userReq, ctx);`,
37
+ ` }`,
38
+ ` await fn((trigger && trigger.payload) || {}, ctx);`,
39
+ ` return new Response(null, { status: 204 });`,
40
+ ` },`,
41
+ `};`,
42
+ ``,
43
+ ].join("\n");
44
+ return {
45
+ compatibilityDate: COMPATIBILITY_DATE,
46
+ mainModule: MAIN_MODULE,
47
+ modules: {
48
+ [MAIN_MODULE]: main,
49
+ [BACKEND_MODULE]: input.module,
50
+ },
51
+ globalOutbound: null,
52
+ };
53
+ }
54
+ async function hashBackendWorkerCode(code) {
55
+ const payload = `${code.compatibilityDate}\n${code.mainModule}\n${JSON.stringify(code.modules)}`;
56
+ const digest = await crypto.subtle.digest("SHA-256", TxtEnDecoderSingleton().encode(payload));
57
+ return Array.from(new Uint8Array(digest))
58
+ .map((b) => b.toString(16).padStart(2, "0"))
59
+ .join("");
60
+ }
61
+ export class WorkerLoaderBackendExecutor {
62
+ loader;
63
+ opts;
64
+ constructor(loader, opts = {}) {
65
+ this.loader = loader;
66
+ this.opts = opts;
67
+ }
68
+ async invoke(input) {
69
+ const { module } = transformBackendSource(input.source);
70
+ const code = buildBackendWorkerCode({ module, policyVersion: this.opts.policyVersion, vibe: this.opts.vibe });
71
+ const id = await hashBackendWorkerCode(code);
72
+ const stub = this.loader.get(id, () => code);
73
+ const request = new Request(BACKEND_REQUEST_URL, {
74
+ method: "POST",
75
+ headers: { "content-type": "application/json" },
76
+ body: JSON.stringify({ handler: input.handler, trigger: input.trigger }),
77
+ });
78
+ return stub.getEntrypoint().fetch(request);
79
+ }
80
+ }
81
+ //# sourceMappingURL=backend-worker-loader-executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backend-worker-loader-executor.js","sourceRoot":"","sources":["../jsr/backend-worker-loader-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAIvE,MAAM,WAAW,GAAG,SAAS,CAAC;AAC9B,MAAM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,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;SACzE,CAAC,CAAC;QAIH,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;CACF"}
package/package.json CHANGED
@@ -1,15 +1,24 @@
1
1
  {
2
2
  "name": "@vibes.diy/vibe-runtime",
3
- "version": "3.0.3",
3
+ "version": "4.0.0",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
+ "exports": {
7
+ ".": "./index.js",
8
+ "./vibe-executor.js": "./vibe-executor.js",
9
+ "./worker-loader-executor.js": "./worker-loader-executor.js",
10
+ "./ssr-source-check.js": "./ssr-source-check.js",
11
+ "./render-vibes.js": "./render-vibes.js",
12
+ "./parse-backend-config.js": "./parse-backend-config.js",
13
+ "./backend-executor.js": "./backend-executor.js"
14
+ },
6
15
  "scripts": {
7
16
  "build": "core-cli tsc"
8
17
  },
9
18
  "dependencies": {
10
19
  "@adviser/cement": "~0.5.34",
11
- "@vibes.diy/base": "3.0.3",
12
- "@vibes.diy/vibe-types": "3.0.3",
20
+ "@vibes.diy/base": "4.0.0",
21
+ "@vibes.diy/vibe-types": "4.0.0",
13
22
  "arktype": "~2.2.1",
14
23
  "charwise": "~3.0.1",
15
24
  "es-module-lexer": "~2.1.0",
@@ -0,0 +1,14 @@
1
+ import type { BackendHandler } from "./backend-executor.js";
2
+ export declare const MIN_INTERVAL_MS = 5000;
3
+ export declare const MAX_INTERVAL_MS = 3600000;
4
+ export interface BackendSchedule {
5
+ readonly intervalMs: number;
6
+ readonly raw: string;
7
+ }
8
+ export interface BackendConfigParseResult {
9
+ readonly handlers: BackendHandler[];
10
+ readonly hasConfig: boolean;
11
+ readonly schedule?: BackendSchedule;
12
+ readonly errors: string[];
13
+ }
14
+ export declare function parseBackendConfig(source: string | undefined): BackendConfigParseResult;
@@ -0,0 +1,102 @@
1
+ export const MIN_INTERVAL_MS = 5_000;
2
+ export const MAX_INTERVAL_MS = 3_600_000;
3
+ const HANDLER_NAMES = ["fetch", "scheduled", "onChange"];
4
+ function exportsName(source, name) {
5
+ const decl = new RegExp(`export\\s+(?:async\\s+)?(?:function\\s+${name}\\b|(?:const|let|var)\\s+${name}\\b)`);
6
+ if (decl.test(source))
7
+ return true;
8
+ const listPattern = /export\s*\{([^}]*)\}/g;
9
+ let m;
10
+ while ((m = listPattern.exec(source)) !== null) {
11
+ const inner = m[1];
12
+ const bareOrAliased = new RegExp(`(?:\\bas\\s+${name}\\b|(?:^|,)\\s*${name}\\s*(?:,|$))`);
13
+ if (bareOrAliased.test(inner))
14
+ return true;
15
+ }
16
+ return false;
17
+ }
18
+ function parseDurationMs(raw) {
19
+ const m = /^(\d+)\s*(s|m|h)$/.exec(raw.trim());
20
+ if (m === null)
21
+ return undefined;
22
+ const n = Number.parseInt(m[1], 10);
23
+ if (!Number.isFinite(n))
24
+ return undefined;
25
+ const mult = m[2] === "s" ? 1_000 : m[2] === "m" ? 60_000 : 3_600_000;
26
+ return n * mult;
27
+ }
28
+ function sliceBalancedObject(source, openIdx) {
29
+ let depth = 0;
30
+ let quote = null;
31
+ for (let i = openIdx; i < source.length; i++) {
32
+ const ch = source[i];
33
+ if (quote !== null) {
34
+ if (ch === "\\") {
35
+ i++;
36
+ continue;
37
+ }
38
+ if (ch === quote)
39
+ quote = null;
40
+ continue;
41
+ }
42
+ if (ch === '"' || ch === "'" || ch === "`") {
43
+ quote = ch;
44
+ }
45
+ else if (ch === "{") {
46
+ depth++;
47
+ }
48
+ else if (ch === "}") {
49
+ depth--;
50
+ if (depth === 0)
51
+ return source.slice(openIdx, i + 1);
52
+ }
53
+ }
54
+ return undefined;
55
+ }
56
+ function extractConfigObject(source) {
57
+ const decl = /(?:export\s+)?(?:const|let|var)\s+config\s*=\s*\{/.exec(source);
58
+ if (decl === null)
59
+ return undefined;
60
+ const openIdx = decl.index + decl[0].length - 1;
61
+ return sliceBalancedObject(source, openIdx);
62
+ }
63
+ function extractIntervalLiteral(source) {
64
+ const configObj = extractConfigObject(source);
65
+ if (configObj === undefined)
66
+ return undefined;
67
+ const m = /scheduled\s*:\s*\{[^}]*?\binterval\s*:\s*["']([^"']+)["']/s.exec(configObj);
68
+ return m?.[1];
69
+ }
70
+ export function parseBackendConfig(source) {
71
+ const errors = [];
72
+ if (source === undefined || source.trim() === "") {
73
+ return { handlers: [], hasConfig: false, errors };
74
+ }
75
+ const handlers = HANDLER_NAMES.filter((name) => exportsName(source, name));
76
+ const hasConfig = exportsName(source, "config");
77
+ const hasScheduled = handlers.includes("scheduled");
78
+ let schedule;
79
+ const rawInterval = extractIntervalLiteral(source);
80
+ if (hasScheduled) {
81
+ if (rawInterval === undefined) {
82
+ errors.push('scheduled handler requires config.scheduled.interval as a static string-literal duration, e.g. { scheduled: { interval: "5m" } }; computed/indirect values are unsupported');
83
+ }
84
+ else {
85
+ const intervalMs = parseDurationMs(rawInterval);
86
+ if (intervalMs === undefined) {
87
+ errors.push(`config.scheduled.interval "${rawInterval}" is not a valid duration — use a string literal like "5s", "1m", or "1h"`);
88
+ }
89
+ else if (intervalMs < MIN_INTERVAL_MS) {
90
+ errors.push(`config.scheduled.interval "${rawInterval}" is faster than the 5s minimum`);
91
+ }
92
+ else if (intervalMs > MAX_INTERVAL_MS) {
93
+ errors.push(`config.scheduled.interval "${rawInterval}" is slower than the 1h maximum`);
94
+ }
95
+ else {
96
+ schedule = { intervalMs, raw: rawInterval };
97
+ }
98
+ }
99
+ }
100
+ return { handlers, hasConfig, schedule, errors };
101
+ }
102
+ //# sourceMappingURL=parse-backend-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-backend-config.js","sourceRoot":"","sources":["../jsr/parse-backend-config.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;AAC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D,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;gBAC7B,MAAM,CAAC,IAAI,CACT,8BAA8B,WAAW,2EAA2E,CACrH,CAAC;YACJ,CAAC;iBAAM,IAAI,UAAU,GAAG,eAAe,EAAE,CAAC;gBACxC,MAAM,CAAC,IAAI,CAAC,8BAA8B,WAAW,iCAAiC,CAAC,CAAC;YAC1F,CAAC;iBAAM,IAAI,UAAU,GAAG,eAAe,EAAE,CAAC;gBACxC,MAAM,CAAC,IAAI,CAAC,8BAA8B,WAAW,iCAAiC,CAAC,CAAC;YAC1F,CAAC;iBAAM,CAAC;gBACN,QAAQ,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC;YAC9C,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AACnD,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { type TransformResult } from "./transform-vibe-source.js";
2
+ export declare function transformBackendSource(src: string): TransformResult;
@@ -0,0 +1,5 @@
1
+ import { transformVibeSource } from "./transform-vibe-source.js";
2
+ export function transformBackendSource(src) {
3
+ return transformVibeSource(src);
4
+ }
5
+ //# sourceMappingURL=transform-backend-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform-backend-source.js","sourceRoot":"","sources":["../jsr/transform-backend-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAwB,MAAM,4BAA4B,CAAC;AAYvF,MAAM,UAAU,sBAAsB,CAAC,GAAW;IAChD,OAAO,mBAAmB,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC"}