vibes-diy 14.3.441 → 14.3.442

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.
@@ -33396,6 +33396,11 @@ var reqCreationPromptChatSection = lazyType(
33396
33396
  // about the screen, never access: the server names it to the agent only
33397
33397
  // when the caller's account holds the handle and the app is bound under it.
33398
33398
  "paneApp?": { ownerHandle: "string", appSlug: "string" },
33399
+ // /agent only (#10702): the message is the words the person typed on the
33400
+ // home page as their go, carried into a fresh discussion. Honoured only on
33401
+ // a discussion's first turn, where it tells the agent to build now; a
33402
+ // forged value buys one build the same person could ask for in words.
33403
+ "carriedFrom?": "'home'",
33399
33404
  // Whether the sending tab's PostHog SDK was loaded at the send (#7094 §6).
33400
33405
  // Analytics only: it lands on `codegen_turn_settled.posthog_active` and
33401
33406
  // nothing reads it for routing, billing or authorization. Optional, so an
@@ -29985,6 +29985,11 @@ var reqCreationPromptChatSection = lazyType(
29985
29985
  // about the screen, never access: the server names it to the agent only
29986
29986
  // when the caller's account holds the handle and the app is bound under it.
29987
29987
  "paneApp?": { ownerHandle: "string", appSlug: "string" },
29988
+ // /agent only (#10702): the message is the words the person typed on the
29989
+ // home page as their go, carried into a fresh discussion. Honoured only on
29990
+ // a discussion's first turn, where it tells the agent to build now; a
29991
+ // forged value buys one build the same person could ask for in words.
29992
+ "carriedFrom?": "'home'",
29988
29993
  // Whether the sending tab's PostHog SDK was loaded at the send (#7094 §6).
29989
29994
  // Analytics only: it lands on `codegen_turn_settled.posthog_active` and
29990
29995
  // nothing reads it for routing, billing or authorization. Optional, so an
@@ -63007,11 +63012,30 @@ async function moveAppsOffProvisionalHandle(db, t, input) {
63007
63012
  if (one.isErr()) return Result40.Err(one.Err());
63008
63013
  moved.push(one.Ok());
63009
63014
  }
63015
+ const cc = t.chatContexts;
63016
+ await db.update(cc).set({ ownerHandle: input.toHandle }).where(and48(eq55(cc.ownerHandle, input.fromHandle), eq55(cc.appSlug, AGENT_CHAT_APP_SLUG), eq55(cc.userId, input.userId)));
63017
+ await copyAgentDiscussionDeletions(db, t, input);
63010
63018
  const hb = t.handleBinding;
63011
63019
  await db.update(hb).set({ migratedAway: 1 }).where(and48(eq55(hb.handle, input.fromHandle), eq55(hb.userId, input.userId)));
63012
63020
  return Result40.Ok({ moved, deferred });
63013
63021
  }
63014
63022
  __name(moveAppsOffProvisionalHandle, "moveAppsOffProvisionalHandle");
63023
+ async function copyAgentDiscussionDeletions(db, t, input) {
63024
+ const ai = t.appSettingItems;
63025
+ const rows = await db.select({ itemKey: ai.itemKey, item: ai.item }).from(ai).where(and48(eq55(ai.userId, input.userId), eq55(ai.ownerHandle, input.fromHandle), eq55(ai.appSlug, AGENT_CHAT_APP_SLUG)));
63026
+ const deletions = rows.flatMap(
63027
+ (row) => isActiveAgentDiscussion(row.item) && row.item.hiddenAt !== void 0 ? [{ itemKey: row.itemKey, chatId: row.item.chatId, hiddenAt: row.item.hiddenAt }] : []
63028
+ );
63029
+ if (deletions.length === 0) return;
63030
+ const key = { userId: input.userId, ownerHandle: input.toHandle, appSlug: AGENT_CHAT_APP_SLUG };
63031
+ await ensureAppSettingsItemized({ sql: { db, tables: t } }, key);
63032
+ const now3 = (/* @__PURE__ */ new Date()).toISOString();
63033
+ for (const d of deletions) {
63034
+ const item = { type: "active.agent-discussion", chatId: d.chatId, hiddenAt: d.hiddenAt };
63035
+ await db.insert(ai).values({ ...key, itemKey: d.itemKey, item, revision: 0, updated: now3, created: now3 }).onConflictDoNothing({ target: [ai.userId, ai.ownerHandle, ai.appSlug, ai.itemKey] });
63036
+ }
63037
+ }
63038
+ __name(copyAgentDiscussionDeletions, "copyAgentDiscussionDeletions");
63015
63039
  async function finishDeferredAppMove(vctx, input) {
63016
63040
  const now3 = input.now ?? /* @__PURE__ */ new Date();
63017
63041
  const t = vctx.sql.tables;
@@ -81647,6 +81671,7 @@ async function storeAndAuditAsset(vctx, params) {
81647
81671
  }
81648
81672
  }
81649
81673
  await seedAssetSafety(vctx, {
81674
+ size: stored.size,
81650
81675
  cid: stored.cid,
81651
81676
  assetURI: stored.getURL,
81652
81677
  mimeType,
@@ -81664,13 +81689,30 @@ async function storeAndAuditAsset(vctx, params) {
81664
81689
  });
81665
81690
  }
81666
81691
  __name(storeAndAuditAsset, "storeAndAuditAsset");
81692
+ var GENERATED_MODEL = "exempt:generation";
81693
+ var GENERATED_REASON = "made-by-our-image-model";
81667
81694
  async function seedAssetSafety(vctx, a) {
81668
81695
  const isImage = a.mimeType !== null && a.mimeType.startsWith("image/");
81696
+ const generated = isImage && a.origin === "generation";
81669
81697
  const isVideo = a.mimeType !== null && a.mimeType.startsWith("video/");
81670
81698
  const now3 = (/* @__PURE__ */ new Date()).toISOString();
81671
81699
  const t = vctx.sql.tables.assetSafety;
81672
81700
  const rSeed = await exception2Result141(
81673
- () => vctx.sql.db.insert(t).values({ cid: a.cid, verdict: isImage || isVideo ? "pending" : "low", attempts: 0, created: now3, updated: now3 }).onConflictDoNothing({ target: t.cid })
81701
+ () => vctx.sql.db.insert(t).values(
81702
+ generated ? {
81703
+ cid: a.cid,
81704
+ verdict: "low",
81705
+ attempts: 0,
81706
+ checkedAt: now3,
81707
+ model: GENERATED_MODEL,
81708
+ reason: GENERATED_REASON,
81709
+ cdnCid: a.assetURI,
81710
+ cdnMime: a.mimeType,
81711
+ cdnSize: a.size,
81712
+ created: now3,
81713
+ updated: now3
81714
+ } : { cid: a.cid, verdict: isImage || isVideo ? "pending" : "low", attempts: 0, created: now3, updated: now3 }
81715
+ ).onConflictDoNothing({ target: t.cid }).returning({ cid: t.cid })
81674
81716
  );
81675
81717
  if (rSeed.isErr()) {
81676
81718
  vctx.logger.Warn().Err(rSeed).Str("cid", a.cid).Msg("asset-safety-seed-failed");
@@ -81685,9 +81727,9 @@ async function seedAssetSafety(vctx, a) {
81685
81727
  return;
81686
81728
  }
81687
81729
  const existing = rExisting.Ok();
81688
- if (existing !== void 0 && existing.verdict !== "pending") return;
81730
+ if (existing !== void 0 && existing.verdict !== "pending" && !generated) return;
81689
81731
  let model = "";
81690
- if (isImage) {
81732
+ if (isImage && !generated) {
81691
81733
  const rModels = await exception2Result141(() => loadModels(vctx));
81692
81734
  const rModel = rModels.isErr() ? Result74.Err(rModels) : resolveVisionModelId(rModels.Ok().models);
81693
81735
  if (rModel.isErr()) {
@@ -121926,7 +121968,8 @@ function readTurnEnvelope(orig, turnStartedAt) {
121926
121968
  timeZone: resolveTimeZone(orig.timeZone),
121927
121969
  rewriteNature: readRewriteNature(orig.rewriteNature),
121928
121970
  personWords: carriedPersonWords(orig),
121929
- paneApp: readPaneAppField(orig.paneApp)
121971
+ paneApp: readPaneAppField(orig.paneApp),
121972
+ ...orig.carriedFrom === "home" ? { carriedFromHome: true } : {}
121930
121973
  };
121931
121974
  }
121932
121975
  __name(readTurnEnvelope, "readTurnEnvelope");
@@ -125698,6 +125741,7 @@ function serverFirstBuildAppContext(messages, address2) {
125698
125741
  return claimAgentAppContext(messages, address2, { firstBuildLine: SERVER_FIRST_BUILD_CONTEXT_LINE });
125699
125742
  }
125700
125743
  __name(serverFirstBuildAppContext, "serverFirstBuildAppContext");
125744
+ var CARRIED_FROM_HOME_LINE = "carried from the home page: the person typed this first message on the home page as their go \u2014 build it now with create_vibe; any question you have rides along while it builds";
125701
125745
  function topLevelContextLines(ownerHandle, brief2, group) {
125702
125746
  if (group && brief2.oneToOneGuest === true) {
125703
125747
  return guestOneToOneContextLines(ownerHandle, { boundApps: brief2.boundApps, ownToolVibes: brief2.ownToolVibes });
@@ -125715,7 +125759,8 @@ function topLevelContextLines(ownerHandle, brief2, group) {
125715
125759
  ...brief2.activeHandle === void 0 ? [] : [`active handle: @${brief2.activeHandle}`],
125716
125760
  `handles on this account: ${brief2.handles.map((h) => `@${h}`).join(", ")}`,
125717
125761
  `this conversation acts as: @${ownerHandle} \u2014 new vibes are created under it`,
125718
- ...brief2.paneApp === void 0 ? [] : [paneAppContextLine(brief2.paneApp)]
125762
+ ...brief2.paneApp === void 0 ? [] : [paneAppContextLine(brief2.paneApp)],
125763
+ ...brief2.carriedFromHome === true ? [CARRIED_FROM_HOME_LINE] : []
125719
125764
  ];
125720
125765
  }
125721
125766
  __name(topLevelContextLines, "topLevelContextLines");
@@ -138663,6 +138708,12 @@ function turnCarriesCurrentScreenshot(turn) {
138663
138708
  return turn.agentFirstTurnMint === false && turn.agentWakeTurn === false && turn.hasUserMessage === true;
138664
138709
  }
138665
138710
  __name(turnCarriesCurrentScreenshot, "turnCarriesCurrentScreenshot");
138711
+ function journalHasPersonMessage(snapshot) {
138712
+ return (snapshot?.messages ?? []).some(
138713
+ (m) => typeof m === "object" && m !== null && "role" in m && m.role === "user"
138714
+ );
138715
+ }
138716
+ __name(journalHasPersonMessage, "journalHasPersonMessage");
138666
138717
  async function assembleAgentTurn(args) {
138667
138718
  const { ctx, vctx, req: req2, orig, resChat, defaults, agentFirstTurnMint, instructionVariant, turnLatency } = args;
138668
138719
  const { agentWakeNote, agentWakeTurn, nonInteractive } = args.envelope;
@@ -138709,6 +138760,8 @@ async function assembleAgentTurn(args) {
138709
138760
  topLevel = rBrief.isOk() ? rBrief.Ok() : { handles: [resChat.ownerHandle] };
138710
138761
  const paneApp = args.envelope.paneApp === void 0 || isGroupPrincipal(req2._auth.verifiedAuth.claims.userId) ? void 0 : await verifyPaneApp(vctx, { ref: args.envelope.paneApp, handles: topLevel.handles });
138711
138762
  if (paneApp !== void 0) topLevel = { ...topLevel, paneApp };
138763
+ if (args.envelope.carriedFromHome === true && agentWakeTurn === false && isGroupPrincipal(req2._auth.verifiedAuth.claims.userId) === false && rSeenHead.isOk() && journalHasPersonMessage(rSeenHead.Ok().snapshot) === false)
138764
+ topLevel = { ...topLevel, carriedFromHome: true };
138712
138765
  }
138713
138766
  const fastLevers = fastFirstTurnLevers(instructionVariant, agentFirstTurnMint);
138714
138767
  asmMark("reads");
@@ -151758,6 +151811,8 @@ var LLMChatImpl = class _LLMChatImpl {
151758
151811
  ...mode === "codegen" && opts?.rewriteNature !== void 0 ? { rewriteNature: opts.rewriteNature } : {},
151759
151812
  // #9925: codegen-only, forwarded only when set, so an ordinary turn is byte-identical.
151760
151813
  ...mode === "codegen" && opts?.paneApp !== void 0 ? { paneApp: { ownerHandle: opts.paneApp.ownerHandle, appSlug: opts.paneApp.appSlug } } : {},
151814
+ // #10702: codegen-only, forwarded only when set, so an ordinary turn is byte-identical.
151815
+ ...mode === "codegen" && opts?.carriedFrom === "home" ? { carriedFrom: "home" } : {},
151761
151816
  // Per-call BYOK key: a top-level envelope field on all LLM modes
151762
151817
  // (codegen/runtime/img). Only forwarded when non-empty so a cleared
151763
151818
  // value stays absent on the wire.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibes-diy",
3
- "version": "14.3.441",
3
+ "version": "14.3.442",
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.",
@@ -41,13 +41,13 @@
41
41
  "@neondatabase/serverless": "~1.2.1",
42
42
  "@noble/hashes": "~2.4.0",
43
43
  "@shadcn/lint": "~0.2.3",
44
- "@vibes.diy/api-impl": "14.3.441",
45
- "@vibes.diy/api-types": "14.3.441",
46
- "@vibes.diy/call-ai-v2": "14.3.441",
47
- "@vibes.diy/cmd-harness": "14.3.441",
48
- "@vibes.diy/cmd-tools": "14.3.441",
49
- "@vibes.diy/identity": "14.3.441",
50
- "@vibes.diy/prompts": "14.3.441",
44
+ "@vibes.diy/api-impl": "14.3.442",
45
+ "@vibes.diy/api-types": "14.3.442",
46
+ "@vibes.diy/call-ai-v2": "14.3.442",
47
+ "@vibes.diy/cmd-harness": "14.3.442",
48
+ "@vibes.diy/cmd-tools": "14.3.442",
49
+ "@vibes.diy/identity": "14.3.442",
50
+ "@vibes.diy/prompts": "14.3.442",
51
51
  "acorn": "~8.19.0",
52
52
  "acorn-jsx": "~5.3.2",
53
53
  "arktype": "~2.2.9",