vibes-diy 14.3.456 → 14.3.457

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.
@@ -22988,6 +22988,7 @@ function isKnownThemeSlug(slug) {
22988
22988
  var THEME_SLUGS, THEME_SLUG_SET;
22989
22989
  var init_theme_slugs = __esm({
22990
22990
  "../prompts/pkg/themes/theme-slugs.ts"() {
22991
+ "use strict";
22991
22992
  THEME_SLUGS = [
22992
22993
  "aether",
22993
22994
  "archive",
@@ -114996,7 +114997,7 @@ import { exception2Result as exception2Result260 } from "@adviser/cement";
114996
114997
  init_exports();
114997
114998
  init_types3();
114998
114999
  init_grouped_vibe_import_map();
114999
- import { exception2Result as exception2Result259 } from "@adviser/cement";
115000
+ import { exception2Result as exception2Result259, KeyedResolvOnce as KeyedResolvOnce9 } from "@adviser/cement";
115000
115001
  import { Parser as Parser2 } from "acorn";
115001
115002
  import acornJsx from "acorn-jsx";
115002
115003
  import { transform as transform6 } from "sucrase";
@@ -117845,7 +117846,35 @@ function seedFindings(vfs) {
117845
117846
  );
117846
117847
  }
117847
117848
  __name(seedFindings, "seedFindings");
117849
+ var opensVerdictOnce = new KeyedResolvOnce9({ lru: { maxEntries: 4 } });
117850
+ function filesDigest(vfs) {
117851
+ let h = 2166136261;
117852
+ let chars = 0;
117853
+ const mix = /* @__PURE__ */ __name((text3) => {
117854
+ for (let i = 0; i < text3.length; i++) h = Math.imul(h ^ text3.charCodeAt(i), 16777619);
117855
+ h = Math.imul(h ^ 255, 16777619);
117856
+ chars += text3.length;
117857
+ }, "mix");
117858
+ for (const path of [...vfs.keys()].sort()) {
117859
+ mix(path);
117860
+ mix(vfs.get(path) ?? "");
117861
+ }
117862
+ return `${vfs.size}:${chars}:${(h >>> 0).toString(16)}`;
117863
+ }
117864
+ __name(filesDigest, "filesDigest");
117865
+ function sameFiles(a, b) {
117866
+ if (a.size !== b.size) return false;
117867
+ for (const [path, contents] of a) if (b.get(path) !== contents) return false;
117868
+ return true;
117869
+ }
117870
+ __name(sameFiles, "sameFiles");
117848
117871
  function checkOpens(vfs) {
117872
+ const cached3 = opensVerdictOnce.get(filesDigest(vfs)).once(() => ({ vfs: new Map(vfs), verdict: checkOpensUncached(vfs) }));
117873
+ const verdict = sameFiles(cached3.vfs, vfs) ? cached3.verdict : checkOpensUncached(vfs);
117874
+ return { opens: verdict.opens, findings: [...verdict.findings] };
117875
+ }
117876
+ __name(checkOpens, "checkOpens");
117877
+ function checkOpensUncached(vfs) {
117849
117878
  const entries = [...vfs.keys()].filter((path) => OPENS_ENTRY_PATH.test(path));
117850
117879
  const queue = entries.length > 0 ? entries : [...vfs.keys()].filter(isBrowserModule);
117851
117880
  const seen = /* @__PURE__ */ new Set();
@@ -117862,7 +117891,7 @@ function checkOpens(vfs) {
117862
117891
  findings.push(...seedFindings(vfs));
117863
117892
  return { opens: findings.every((finding) => OPENS_ADVISORY_CLASSES.has(finding.class)), findings };
117864
117893
  }
117865
- __name(checkOpens, "checkOpens");
117894
+ __name(checkOpensUncached, "checkOpensUncached");
117866
117895
  function collapseOpensFindings(findings) {
117867
117896
  const counts2 = /* @__PURE__ */ new Map();
117868
117897
  const atLoad = /* @__PURE__ */ new Set();
@@ -124286,7 +124315,15 @@ init_types3();
124286
124315
  init_v2();
124287
124316
  import { type as type151 } from "arktype";
124288
124317
  import { and as and140, eq as eq164, inArray as inArray43, ne as ne19 } from "drizzle-orm/sql/expressions";
124289
- function historySectionMsgs(blocks) {
124318
+ var KEPT_EVENT_VALIDATORS = /* @__PURE__ */ new Map([
124319
+ ["prompt.req", (item) => PromptReq(item)],
124320
+ ["prompt.agent-evidence", (item) => PromptAgentEvidence(item)],
124321
+ ["block.toplevel.line", (item) => ToplevelLineMsg(item)],
124322
+ ["block.code.begin", (item) => CodeBeginMsg(item)],
124323
+ ["block.code.line", (item) => CodeLineMsg(item)],
124324
+ ["block.code.end", (item) => CodeEndMsg(item)]
124325
+ ]);
124326
+ function historyKeptMsgs(blocks) {
124290
124327
  const msgs = [];
124291
124328
  const warning = [];
124292
124329
  if (!Array.isArray(blocks)) return { msgs, warning };
@@ -124295,16 +124332,26 @@ function historySectionMsgs(blocks) {
124295
124332
  msgs.push(item);
124296
124333
  return;
124297
124334
  }
124298
- const parsed = PromptAndBlockMsgs(item);
124335
+ const t = typeof item === "object" && item !== null ? item.type : void 0;
124336
+ if (typeof t !== "string") {
124337
+ warning.push({ idx, txt: "event has no type" });
124338
+ return;
124339
+ }
124340
+ const validate = KEPT_EVENT_VALIDATORS.get(t);
124341
+ if (validate === void 0) return;
124342
+ if (t === "prompt.agent-evidence" && item.evidence?.kind !== "active") return;
124343
+ const parsed = validate(item);
124299
124344
  if (parsed instanceof type151.errors) {
124300
- warning.push({ idx, txt: parsed.summary });
124345
+ const full = PromptAndBlockMsgs(item);
124346
+ if (full instanceof type151.errors) warning.push({ idx, txt: full.summary });
124347
+ else msgs.push(full);
124301
124348
  return;
124302
124349
  }
124303
124350
  msgs.push(parsed);
124304
124351
  });
124305
124352
  return { msgs, warning };
124306
124353
  }
124307
- __name(historySectionMsgs, "historySectionMsgs");
124354
+ __name(historyKeptMsgs, "historyKeptMsgs");
124308
124355
  function isCodeSummaryMsg(msg) {
124309
124356
  return typeof msg === "object" && msg !== null && msg.type === "history.code.summary";
124310
124357
  }
@@ -124332,7 +124379,7 @@ async function readChatHistory(vctx, chatId, opts) {
124332
124379
  if (want.has(key)) byKey.set(key, row.blocks);
124333
124380
  }
124334
124381
  for (const k of pageKeys) {
124335
- const { msgs, warning } = historySectionMsgs(byKey.get(sectionKey(k)));
124382
+ const { msgs, warning } = historyKeptMsgs(byKey.get(sectionKey(k)));
124336
124383
  if (warning.length > 0) opts.onWarning?.(warning);
124337
124384
  for (const msg of msgs) reducer.push(msg);
124338
124385
  }
@@ -165122,7 +165169,7 @@ import { Result as Result318, BuildURI as BuildURI22, exception2Result as except
165122
165169
 
165123
165170
  // ../vibes.diy/api/impl/websocket-connection.ts
165124
165171
  init_types3();
165125
- import { BuildURI as BuildURI21, exception2Result as exception2Result410, Future as Future4, KeyedResolvOnce as KeyedResolvOnce9, OnFunc as OnFunc2, Result as Result310, URI as URI49 } from "@adviser/cement";
165172
+ import { BuildURI as BuildURI21, exception2Result as exception2Result410, Future as Future4, KeyedResolvOnce as KeyedResolvOnce10, OnFunc as OnFunc2, Result as Result310, URI as URI49 } from "@adviser/cement";
165126
165173
 
165127
165174
  // ../vibes.diy/api/impl/ws-proxy.ts
165128
165175
  import { URI as URI48 } from "@adviser/cement";
@@ -165255,7 +165302,7 @@ function describeWsProxyDecision(decision) {
165255
165302
  __name(describeWsProxyDecision, "describeWsProxyDecision");
165256
165303
 
165257
165304
  // ../vibes.diy/api/impl/websocket-connection.ts
165258
- var vibesDiyApiPerConnection = new KeyedResolvOnce9();
165305
+ var vibesDiyApiPerConnection = new KeyedResolvOnce10();
165259
165306
  function runtimeWebSocketImpl() {
165260
165307
  return {
165261
165308
  globalWebSocket: typeof globalThis.WebSocket === "undefined" ? void 0 : globalThis.WebSocket,
@@ -168716,11 +168763,11 @@ var DeviceIdKeyBagItemSchema = z6.object({
168716
168763
  }).readonly();
168717
168764
 
168718
168765
  // ../vibes.diy/identity/keybag/keybag.ts
168719
- import { URI as URI51, runtimeFn as runtimeFn3, KeyedResolvOnce as KeyedResolvOnce11 } from "@adviser/cement";
168766
+ import { URI as URI51, runtimeFn as runtimeFn3, KeyedResolvOnce as KeyedResolvOnce12 } from "@adviser/cement";
168720
168767
 
168721
168768
  // ../vibes.diy/identity/keybag/key-bag.ts
168722
168769
  init_hashing();
168723
- import { KeyedResolvOnce as KeyedResolvOnce10, Lazy as Lazy16, Option as Option71 } from "@adviser/cement";
168770
+ import { KeyedResolvOnce as KeyedResolvOnce11, Lazy as Lazy16, Option as Option71 } from "@adviser/cement";
168724
168771
  import { z as z7 } from "zod";
168725
168772
  var KeyedDeviceIdKeyBagItemSchema = z7.object({
168726
168773
  id: z7.string(),
@@ -168878,7 +168925,7 @@ var keyBagProviderFactories = new Map(
168878
168925
  }
168879
168926
  ].map((i) => [i.protocol, i])
168880
168927
  );
168881
- var _keyBags = new KeyedResolvOnce11();
168928
+ var _keyBags = new KeyedResolvOnce12();
168882
168929
 
168883
168930
  // ../vibes.diy/identity/keybag/instance.ts
168884
168931
  import { URI as URI52, exception2Result as exception2Result420 } from "@adviser/cement";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibes-diy",
3
- "version": "14.3.456",
3
+ "version": "14.3.457",
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.1",
53
53
  "@noble/hashes": "~2.4.0",
54
54
  "@shadcn/lint": "~0.2.3",
55
- "@vibes.diy/api-impl": "14.3.456",
56
- "@vibes.diy/api-types": "14.3.456",
57
- "@vibes.diy/call-ai-v2": "14.3.456",
58
- "@vibes.diy/cmd-harness": "14.3.456",
59
- "@vibes.diy/cmd-tools": "14.3.456",
60
- "@vibes.diy/identity": "14.3.456",
61
- "@vibes.diy/prompts": "14.3.456",
55
+ "@vibes.diy/api-impl": "14.3.457",
56
+ "@vibes.diy/api-types": "14.3.457",
57
+ "@vibes.diy/call-ai-v2": "14.3.457",
58
+ "@vibes.diy/cmd-harness": "14.3.457",
59
+ "@vibes.diy/cmd-tools": "14.3.457",
60
+ "@vibes.diy/identity": "14.3.457",
61
+ "@vibes.diy/prompts": "14.3.457",
62
62
  "acorn": "~8.19.0",
63
63
  "acorn-jsx": "~5.3.2",
64
64
  "arktype": "~2.2.10",