vibes-diy 14.3.472 → 14.3.474

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.
@@ -177926,6 +177926,7 @@ async function createAppContext(params) {
177926
177926
  postQueue: params.postQueue,
177927
177927
  ...params.waitUntil === void 0 ? {} : { waitUntil: params.waitUntil }
177928
177928
  }),
177929
+ releaseAccessFnRuntime: params.releaseAccessFnRuntime,
177929
177930
  accessFnSourceCache: params.accessFnSourceCache,
177930
177931
  backendSourceCache: params.backendSourceCache,
177931
177932
  kycExemptUserIds: params.kycExemptUserIds,
@@ -178388,13 +178389,35 @@ function netHashFn({
178388
178389
  });
178389
178390
  }
178390
178391
  __name(netHashFn, "netHashFn");
178392
+ var QUICKJS_IDLE_RELEASE_MS = 2e3;
178393
+ async function newReleasableQuickJSModule() {
178394
+ const m = await Promise.resolve().then(() => (init_workerd(), workerd_exports));
178395
+ const variant2 = m.newVariant(m.RELEASE_SYNC, {
178396
+ wasmModule: m.releaseSyncWasmModule
178397
+ });
178398
+ return m.newQuickJSWASMModuleFromVariant(variant2);
178399
+ }
178400
+ __name(newReleasableQuickJSModule, "newReleasableQuickJSModule");
178401
+ function scheduleIdleRelease(ref3) {
178402
+ if (ref3.idleTimer !== void 0) clearTimeout(ref3.idleTimer);
178403
+ ref3.idleTimer = setTimeout(() => {
178404
+ ref3.idleTimer = void 0;
178405
+ ref3.module = null;
178406
+ }, ref3.idleReleaseMs ?? QUICKJS_IDLE_RELEASE_MS);
178407
+ }
178408
+ __name(scheduleIdleRelease, "scheduleIdleRelease");
178391
178409
  async function localInvokeAccessFn(cachedModuleRef, params) {
178392
178410
  if (!params.source) {
178393
178411
  return { forbidden: "access function source not provided" };
178394
178412
  }
178395
- const QuickJS = cachedModuleRef.module ?? await Promise.resolve().then(() => (init_workerd(), workerd_exports)).then((m) => m.getQuickJSWASMModule());
178413
+ const QuickJS = cachedModuleRef.module ?? (cachedModuleRef.releasable === true ? await newReleasableQuickJSModule() : await Promise.resolve().then(() => (init_workerd(), workerd_exports)).then((m) => m.getQuickJSWASMModule()));
178396
178414
  cachedModuleRef.module = QuickJS;
178397
- return invokeAccessFnInQuickJS(QuickJS, params);
178415
+ if (cachedModuleRef.releasable !== true) return invokeAccessFnInQuickJS(QuickJS, params);
178416
+ try {
178417
+ return invokeAccessFnInQuickJS(QuickJS, params);
178418
+ } finally {
178419
+ scheduleIdleRelease(cachedModuleRef);
178420
+ }
178398
178421
  }
178399
178422
  __name(localInvokeAccessFn, "localInvokeAccessFn");
178400
178423
  async function cfServeAppCtx(request, env3, ctx, callbackOverrides) {
@@ -45737,7 +45737,6 @@ function isValidNotifyPath(path) {
45737
45737
  var NOTIFY_PATH_MAX_CHARS, NOTIFY_PATH_ERROR, NOTIFY_PICTURE_SHAPE_ERROR, NOTIFY_CONSENT_ERROR;
45738
45738
  var init_notify_path = __esm({
45739
45739
  "../vibes.diy/vibe/runtime/notify-path.ts"() {
45740
- "use strict";
45741
45740
  NOTIFY_PATH_MAX_CHARS = 200;
45742
45741
  NOTIFY_PATH_ERROR = `ctx.notify path must start with "#", be at most ${NOTIFY_PATH_MAX_CHARS} characters, and contain no whitespace or control characters`;
45743
45742
  __name(isValidNotifyPath, "isValidNotifyPath");
@@ -113213,6 +113212,7 @@ async function createAppContext(params) {
113213
113212
  postQueue: params.postQueue,
113214
113213
  ...params.waitUntil === void 0 ? {} : { waitUntil: params.waitUntil }
113215
113214
  }),
113215
+ releaseAccessFnRuntime: params.releaseAccessFnRuntime,
113216
113216
  accessFnSourceCache: params.accessFnSourceCache,
113217
113217
  backendSourceCache: params.backendSourceCache,
113218
113218
  kycExemptUserIds: params.kycExemptUserIds,
@@ -113643,13 +113643,35 @@ var R2ToS3Api = class {
113643
113643
 
113644
113644
  // ../vibes.diy/api/svc/cf-serve-app-ctx.ts
113645
113645
  init_client_attribution();
113646
+ var QUICKJS_IDLE_RELEASE_MS = 2e3;
113647
+ async function newReleasableQuickJSModule() {
113648
+ const m = await import("@cf-wasm/quickjs");
113649
+ const variant = m.newVariant(m.RELEASE_SYNC, {
113650
+ wasmModule: m.releaseSyncWasmModule
113651
+ });
113652
+ return m.newQuickJSWASMModuleFromVariant(variant);
113653
+ }
113654
+ __name(newReleasableQuickJSModule, "newReleasableQuickJSModule");
113655
+ function scheduleIdleRelease(ref) {
113656
+ if (ref.idleTimer !== void 0) clearTimeout(ref.idleTimer);
113657
+ ref.idleTimer = setTimeout(() => {
113658
+ ref.idleTimer = void 0;
113659
+ ref.module = null;
113660
+ }, ref.idleReleaseMs ?? QUICKJS_IDLE_RELEASE_MS);
113661
+ }
113662
+ __name(scheduleIdleRelease, "scheduleIdleRelease");
113646
113663
  async function localInvokeAccessFn(cachedModuleRef, params) {
113647
113664
  if (!params.source) {
113648
113665
  return { forbidden: "access function source not provided" };
113649
113666
  }
113650
- const QuickJS = cachedModuleRef.module ?? await import("@cf-wasm/quickjs").then((m) => m.getQuickJSWASMModule());
113667
+ const QuickJS = cachedModuleRef.module ?? (cachedModuleRef.releasable === true ? await newReleasableQuickJSModule() : await import("@cf-wasm/quickjs").then((m) => m.getQuickJSWASMModule()));
113651
113668
  cachedModuleRef.module = QuickJS;
113652
- return invokeAccessFnInQuickJS(QuickJS, params);
113669
+ if (cachedModuleRef.releasable !== true) return invokeAccessFnInQuickJS(QuickJS, params);
113670
+ try {
113671
+ return invokeAccessFnInQuickJS(QuickJS, params);
113672
+ } finally {
113673
+ scheduleIdleRelease(cachedModuleRef);
113674
+ }
113653
113675
  }
113654
113676
  __name(localInvokeAccessFn, "localInvokeAccessFn");
113655
113677
 
@@ -116785,6 +116807,14 @@ var BACKFILL_DOC_CHUNK = 200;
116785
116807
  async function backfillAccessFnOutputs(vctx, opts) {
116786
116808
  const invokeAccessFn = vctx.invokeAccessFn;
116787
116809
  if (invokeAccessFn === void 0) return;
116810
+ try {
116811
+ await backfillAccessFnOutputsWith(vctx, invokeAccessFn, opts);
116812
+ } finally {
116813
+ vctx.releaseAccessFnRuntime?.();
116814
+ }
116815
+ }
116816
+ __name(backfillAccessFnOutputs, "backfillAccessFnOutputs");
116817
+ async function backfillAccessFnOutputsWith(vctx, invokeAccessFn, opts) {
116788
116818
  const { ownerHandle, appSlug, cid: appCid, exportNames, oldCids } = opts;
116789
116819
  const tDocs = vctx.sql.tables.appDocuments;
116790
116820
  const tOutputs = vctx.sql.tables.accessFnOutputs;
@@ -117156,7 +117186,7 @@ async function backfillAccessFnOutputs(vctx, opts) {
117156
117186
  }
117157
117187
  }
117158
117188
  }
117159
- __name(backfillAccessFnOutputs, "backfillAccessFnOutputs");
117189
+ __name(backfillAccessFnOutputsWith, "backfillAccessFnOutputsWith");
117160
117190
 
117161
117191
  // ../vibes.diy/api/svc/intern/access-verdict-docs.ts
117162
117192
  init_platform_db_registry();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibes-diy",
3
- "version": "14.3.472",
3
+ "version": "14.3.474",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "description": "Command-line tool for vibes.diy — vibes give agents superpowers: generate, edit, pull, push, and publish AI-built apps. Login is free and easy.",
@@ -52,13 +52,13 @@
52
52
  "@neondatabase/serverless": "~1.2.2",
53
53
  "@noble/hashes": "~2.4.0",
54
54
  "@shadcn/lint": "~0.2.5",
55
- "@vibes.diy/api-impl": "14.3.472",
56
- "@vibes.diy/api-types": "14.3.472",
57
- "@vibes.diy/call-ai-v2": "14.3.472",
58
- "@vibes.diy/cmd-harness": "14.3.472",
59
- "@vibes.diy/cmd-tools": "14.3.472",
60
- "@vibes.diy/identity": "14.3.472",
61
- "@vibes.diy/prompts": "14.3.472",
55
+ "@vibes.diy/api-impl": "14.3.474",
56
+ "@vibes.diy/api-types": "14.3.474",
57
+ "@vibes.diy/call-ai-v2": "14.3.474",
58
+ "@vibes.diy/cmd-harness": "14.3.474",
59
+ "@vibes.diy/cmd-tools": "14.3.474",
60
+ "@vibes.diy/identity": "14.3.474",
61
+ "@vibes.diy/prompts": "14.3.474",
62
62
  "acorn": "~8.19.0",
63
63
  "acorn-jsx": "~5.3.2",
64
64
  "arktype": "~2.2.10",