vibes-diy 14.3.405 → 14.3.406

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.
@@ -540,6 +540,7 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
540
540
  claimId?: string | undefined;
541
541
  asker?: boolean | undefined;
542
542
  guestAskerUserId?: string | undefined;
543
+ guest?: true | undefined;
543
544
  } | {
544
545
  type: "groupSponsor";
545
546
  sponsorUserId: string;
@@ -210557,7 +210557,13 @@ var userSettingGroupPayer = lazyType(
210557
210557
  * phone-guest principal, named by the bridge. Read only for a text-later yes
210558
210558
  * (`resolveTextConsentSpeaker`) and the one tool that yes runs; never an asker elsewhere.
210559
210559
  */
210560
- "guestAskerUserId?": "string"
210560
+ "guestAskerUserId?": "string",
210561
+ /**
210562
+ * The bridge put this chat on its own guest allowance (`set-group-payer` with `guest`): a phone
210563
+ * guest's one-to-one chat. A sponsored group with no bridge account to fall back on can also
210564
+ * name itself its payer, so a self payer alone never says "one to one" (2026-11-20).
210565
+ */
210566
+ "guest?": "true"
210561
210567
  })
210562
210568
  );
210563
210569
  var userSettingGroupSponsor = lazyType(
@@ -294674,6 +294680,13 @@ async function readGroupPayer(sql2, groupUserId) {
294674
294680
  });
294675
294681
  }
294676
294682
  __name(readGroupPayer, "readGroupPayer");
294683
+ async function readGroupIsGuestChat(sql2, groupUserId) {
294684
+ return exception2Result(async () => {
294685
+ const payer = (await readSettings2(sql2, groupUserId))?.find(isUserSettingGroupPayer);
294686
+ return payer?.guest === true && payer.payerUserId === groupUserId;
294687
+ });
294688
+ }
294689
+ __name(readGroupIsGuestChat, "readGroupIsGuestChat");
294677
294690
  async function writeGroupPayer(sql2, args3) {
294678
294691
  return exception2Result(async () => {
294679
294692
  const t3 = sql2.tables.userSettings;
@@ -294690,7 +294703,8 @@ async function writeGroupPayer(sql2, args3) {
294690
294703
  updatedAt: now3,
294691
294704
  claimId,
294692
294705
  ...args3.asker === true ? { asker: true } : {},
294693
- ...args3.guestAskerUserId === void 0 ? {} : { guestAskerUserId: args3.guestAskerUserId }
294706
+ ...args3.guestAskerUserId === void 0 ? {} : { guestAskerUserId: args3.guestAskerUserId },
294707
+ ...args3.guest === true ? { guest: true } : {}
294694
294708
  }
294695
294709
  ];
294696
294710
  if (row === void 0) {
@@ -316715,6 +316729,8 @@ var sqlTextTaps = sqliteTable(
316715
316729
  utmContent: text2(),
316716
316730
  opener: text2(),
316717
316731
  variant: text2(),
316732
+ userAgent: text2(),
316733
+ // the tapping browser's User-Agent, capped at 512 chars; null when it sent none
316718
316734
  created: text2().notNull()
316719
316735
  },
316720
316736
  (table4) => [primaryKey2({ name: "TextTaps_plane_textHash_id_pk", columns: [table4.plane, table4.textHash, table4.id] })]
@@ -322367,6 +322383,8 @@ var sqlTextTaps2 = pgTable(
322367
322383
  utmContent: text(),
322368
322384
  opener: text(),
322369
322385
  variant: text(),
322386
+ userAgent: text(),
322387
+ // the tapping browser's User-Agent, capped at 512 chars; null when it sent none
322370
322388
  created: text().notNull()
322371
322389
  // ISO 8601, server receive time
322372
322390
  },
@@ -334416,6 +334434,7 @@ async function putTextTap(vctx, plane, tap, o4) {
334416
334434
  utmContent: tap.utmContent ?? null,
334417
334435
  opener: tap.opener ?? null,
334418
334436
  variant: tap.variant ?? null,
334437
+ userAgent: o4.userAgent ?? null,
334419
334438
  created: o4.now.toISOString()
334420
334439
  });
334421
334440
  return "stored";
@@ -334424,6 +334443,12 @@ __name(putTextTap, "putTextTap");
334424
334443
 
334425
334444
  // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/public/text-tap.ts
334426
334445
  var TEXT_TAP_MAX_BODY = 4096;
334446
+ var TEXT_TAP_MAX_USER_AGENT = 512;
334447
+ function tapUserAgent(req2) {
334448
+ const ua2 = (req2.headers.get("User-Agent") ?? "").trim().slice(0, TEXT_TAP_MAX_USER_AGENT);
334449
+ return ua2 === "" ? void 0 : ua2;
334450
+ }
334451
+ __name(tapUserAgent, "tapUserAgent");
334427
334452
  function edgeCountry(req2) {
334428
334453
  const c3 = req2.cf?.country ?? req2.headers.get("CF-IPCountry");
334429
334454
  return typeof c3 === "string" && c3 !== "" ? c3 : void 0;
@@ -334447,7 +334472,11 @@ async function receiveTextTap(vctx, body, o4) {
334447
334472
  const plane = textPlaneOf(vctx);
334448
334473
  if (plane === void 0) return { status: 503, json: { type: "error", message: "not set up" } };
334449
334474
  const rPut = await exception2Result(
334450
- () => putTextTap(vctx, plane, tap, { now: o4.now ?? /* @__PURE__ */ new Date(), id: o4.id ?? crypto.randomUUID() })
334475
+ () => putTextTap(vctx, plane, tap, {
334476
+ now: o4.now ?? /* @__PURE__ */ new Date(),
334477
+ id: o4.id ?? crypto.randomUUID(),
334478
+ ...o4.userAgent === void 0 ? {} : { userAgent: o4.userAgent }
334479
+ })
334451
334480
  );
334452
334481
  if (rPut.isErr()) {
334453
334482
  console.warn(`[text-tap] store failed: ${rPut.Err().message.slice(0, 200)}`);
@@ -334464,11 +334493,16 @@ var textTapHttp = {
334464
334493
  return Result.Ok(Option.None());
334465
334494
  }
334466
334495
  const rBody = await exception2Result(() => req2.text());
334467
- return Result.Ok(Option.Some({ body: rBody.isOk() ? rBody.Ok() : "", country: edgeCountry(req2) }));
334496
+ return Result.Ok(
334497
+ Option.Some({ body: rBody.isOk() ? rBody.Ok() : "", country: edgeCountry(req2), userAgent: tapUserAgent(req2) })
334498
+ );
334468
334499
  }, "validate"),
334469
334500
  handle: /* @__PURE__ */ __name(async (ctx) => {
334470
334501
  const vctx = ctx.ctx.getOrThrow("vibesApiCtx");
334471
- const res = await receiveTextTap(vctx, ctx.validated.body, { country: ctx.validated.country });
334502
+ const res = await receiveTextTap(vctx, ctx.validated.body, {
334503
+ country: ctx.validated.country,
334504
+ ...ctx.validated.userAgent === void 0 ? {} : { userAgent: ctx.validated.userAgent }
334505
+ });
334472
334506
  await ctx.send.send(ctx, answer2(res.status, res.json));
334473
334507
  return Result.Ok(EventoResult.Stop);
334474
334508
  }, "handle")
@@ -356236,7 +356270,13 @@ async function setGroupPayer(vctx, args3, seams = {}) {
356236
356270
  vctx,
356237
356271
  groupUserId: args3.groupUserId,
356238
356272
  msg: "group-payer: write failed",
356239
- write: /* @__PURE__ */ __name(() => writeGroupPayer(vctx.sql, { groupUserId: args3.groupUserId, payerUserId, ...asker ? { asker } : {} }), "write")
356273
+ write: /* @__PURE__ */ __name(() => writeGroupPayer(vctx.sql, {
356274
+ groupUserId: args3.groupUserId,
356275
+ payerUserId,
356276
+ ...asker ? { asker } : {},
356277
+ // Marks the chat a guest's one to one, which framing reads (`readGroupIsGuestChat`).
356278
+ ...args3.guest === true ? { guest: true } : {}
356279
+ }), "write")
356240
356280
  });
356241
356281
  if (written.result.isErr())
356242
356282
  return refuse7(GROUP_PAYER_ERROR.unavailable, "Couldn't record that. Try again in a moment.", written.causeClass);
@@ -386423,7 +386463,7 @@ function namedTools(tools) {
386423
386463
  return tools.slice(0, ADDED_VIBE_TOOLS_NAMED).map((t3) => `${t3.name} ${quoteUntrusted(t3.description)}`).join(", ");
386424
386464
  }
386425
386465
  __name(namedTools, "namedTools");
386426
- function groupHeldAppLines(ownerHandle, held3, addedVibes = []) {
386466
+ function groupHeldAppLines(ownerHandle, held3, addedVibes = [], whose = "the group's") {
386427
386467
  const added = new Set(addedVibes.map((v3) => `${v3.ownerHandle}/${v3.appSlug}`));
386428
386468
  const lines = [];
386429
386469
  for (const b4 of held3.boundApps ?? []) {
@@ -386438,7 +386478,7 @@ function groupHeldAppLines(ownerHandle, held3, addedVibes = []) {
386438
386478
  const own2 = (held3.ownToolVibes ?? []).filter((v3) => !bound.has(`${ownerHandle}/${v3.appSlug}`) && v3.tools.length > 0);
386439
386479
  if (own2.length > 0) {
386440
386480
  lines.push(
386441
- `the group's own vibes with tools (with_vibe @${ownerHandle}/<appSlug>, then call_vibe_tool; the text in \xAB\xBB is its maker's): ${own2.map((v3) => `${v3.appSlug}: ${namedTools(v3.tools)}`).join("; ")}`
386481
+ `${whose} own vibes with tools (with_vibe @${ownerHandle}/<appSlug>, then call_vibe_tool; the text in \xAB\xBB is its maker's): ${own2.map((v3) => `${v3.appSlug}: ${namedTools(v3.tools)}`).join("; ")}`
386442
386482
  );
386443
386483
  }
386444
386484
  return lines;
@@ -386450,6 +386490,9 @@ function serverFirstBuildAppContext(messages, address2) {
386450
386490
  }
386451
386491
  __name(serverFirstBuildAppContext, "serverFirstBuildAppContext");
386452
386492
  function topLevelContextLines(ownerHandle, brief2, group3) {
386493
+ if (group3 && brief2.oneToOneGuest === true) {
386494
+ return guestOneToOneContextLines(ownerHandle, { boundApps: brief2.boundApps, ownToolVibes: brief2.ownToolVibes });
386495
+ }
386453
386496
  if (group3) {
386454
386497
  const changed = vibeLinkChangesLine(brief2.linkChanges ?? []);
386455
386498
  return [
@@ -386467,6 +386510,15 @@ function topLevelContextLines(ownerHandle, brief2, group3) {
386467
386510
  ];
386468
386511
  }
386469
386512
  __name(topLevelContextLines, "topLevelContextLines");
386513
+ function guestOneToOneContextLines(ownerHandle, held3 = {}) {
386514
+ return [
386515
+ ...groupHeldAppLines(ownerHandle, held3, void 0, "this chat's"),
386516
+ `conversation: one to one \u2014 one person texting you, who hasn't linked a Vibes account to this number yet; everything they write is theirs and said to you`,
386517
+ `this conversation acts as: @${ownerHandle} \u2014 new vibes are created under it, and its vibes are this person's: the ones they made here, which come with them when they link an account`,
386518
+ `their own Vibes account, if they have one, isn't linked to this chat, so its apps aren't reachable here; when they ask about an account's apps, list this handle's and say once that linking their number brings in the rest (the Text Vibes card at https://vibes.diy/agent)`
386519
+ ];
386520
+ }
386521
+ __name(guestOneToOneContextLines, "guestOneToOneContextLines");
386470
386522
  function groupContextLines(ownerHandle, addedVibes, held3 = {}) {
386471
386523
  return [
386472
386524
  // The bound app, the picture app and the group's own vibes with tools, each with its tools (2026-11-18).
@@ -395359,7 +395411,8 @@ async function loadTopLevelAgentBrief(vctx, args3) {
395359
395411
  return t3 === void 0 || t3.length === 0 ? r2 : { ...r2, tools: t3 };
395360
395412
  });
395361
395413
  });
395362
- const [rHandles, rActive, rSelf, allLinks, rChanges, tools, rOwnTools, boundApps] = await Promise.all([
395414
+ const pGuestChat = !group3 ? void 0 : settled("guestChat", readGroupIsGuestChat(vctx.sql, args3.userId));
395415
+ const [rHandles, rActive, rSelf, allLinks, rChanges, tools, rOwnTools, boundApps, rGuestChat] = await Promise.all([
395363
395416
  pHandles,
395364
395417
  pActive,
395365
395418
  pSelf,
@@ -395368,6 +395421,7 @@ async function loadTopLevelAgentBrief(vctx, args3) {
395368
395421
  pTools,
395369
395422
  pOwnTools,
395370
395423
  pBound,
395424
+ pGuestChat,
395371
395425
  // The member note feeds nothing in the brief, and its read-then-write measured 2 to 4 s, the
395372
395426
  // brief's slowest step (#10019 round 14), so where the host can keep it alive past the reply it
395373
395427
  // finishes off the turn's path. Without `waitUntil` (tests, a host with none) it is awaited here.
@@ -395391,7 +395445,11 @@ async function loadTopLevelAgentBrief(vctx, args3) {
395391
395445
  if (rOwnTools?.isErr() === true)
395392
395446
  vctx.logger.Warn().Err(rOwnTools).Str("userId", args3.userId).Msg("top-level-agent-own-tools-failed");
395393
395447
  const ownToolVibes = rOwnTools?.isOk() === true && rOwnTools.Ok().length > 0 ? rOwnTools.Ok() : void 0;
395448
+ if (rGuestChat?.isErr() === true)
395449
+ vctx.logger.Warn().Err(rGuestChat).Str("userId", args3.userId).Msg("top-level-agent-guest-chat-read-failed");
395450
+ const oneToOneGuest = rGuestChat?.isOk() === true && rGuestChat.Ok();
395394
395451
  return Result.Ok({
395452
+ ...oneToOneGuest ? { oneToOneGuest: true } : {},
395395
395453
  ...displayName === void 0 ? {} : { displayName },
395396
395454
  ...activeHandle === void 0 ? {} : { activeHandle },
395397
395455
  handles: rHandles.Ok().map((r2) => r2.handle),
@@ -395682,7 +395740,9 @@ function createAccountAgentBelt(vctx, args3) {
395682
395740
  // Advertised only while the feedback gate allows this conversation (agent-feedback-tool.ts).
395683
395741
  ...agentFeedbackAllowed({ chatId: args3.chatId, userId: args3.actor.userId }) ? [feedback.definition] : []
395684
395742
  ];
395685
- const definitions = groupSession ? allDefinitions.filter((d2) => groupSessionKeepsTool(d2.function.name)) : allDefinitions.filter((d2) => !GROUP_ONLY_TOOL_NAMES.has(d2.function.name));
395743
+ const definitions = groupSession ? allDefinitions.filter(
395744
+ (d2) => groupSessionKeepsTool(d2.function.name) && !(args3.oneToOne === true && GROUP_ONLY_TOOL_NAMES.has(d2.function.name))
395745
+ ) : allDefinitions.filter((d2) => !GROUP_ONLY_TOOL_NAMES.has(d2.function.name));
395686
395746
  const offeredToolNames = /* @__PURE__ */ __name(() => definitions.map((d2) => d2.function.name), "offeredToolNames");
395687
395747
  function refused2(toolName, refusal5) {
395688
395748
  vctx.logger.Info().Any("event", { tool: toolName, chatId: args3.chatId, topLevel: true, reason: refusal5.reason }).Msg("agent-tool-refused");
@@ -396884,7 +396944,11 @@ async function assembleAgentTurn(args3) {
396884
396944
  }) ? { currentScreenshot: true } : {}
396885
396945
  });
396886
396946
  if (rAgent.isErr()) return Result.Err(rAgent);
396887
- let agentAssembled = { model: rAgent.Ok().model, messages: rAgent.Ok().messages };
396947
+ let agentAssembled = {
396948
+ model: rAgent.Ok().model,
396949
+ messages: rAgent.Ok().messages,
396950
+ ...topLevel?.oneToOneGuest === true ? { oneToOne: true } : {}
396951
+ };
396888
396952
  const rawIncoming = orig.prompt.messages.filter(isUserChatMessage);
396889
396953
  const newMessageCount = orig.prompt.messages.filter(isChatMessage).length;
396890
396954
  const incoming = newMessageCount === 0 ? [] : rAgent.Ok().messages.slice(-newMessageCount).filter(isUserChatMessage);
@@ -400071,6 +400135,8 @@ function createAgentTurnAction(args3) {
400071
400135
  const doorBelt = topLevel ? createAccountAgentBelt(vctx, {
400072
400136
  actor: rActor.Ok(),
400073
400137
  chatId: req2.chatId,
400138
+ // A phone guest's own one-to-one chat: one person, so no group-only tools (agent-account-tools.ts).
400139
+ ...agentPayload.oneToOne === true ? { oneToOne: true } : {},
400074
400140
  personWords,
400075
400141
  // A 👍 on Vibes' question, handed over by the Mac bridge, is a tapback yes (text-consents.ts).
400076
400142
  ...origFlags.byText === true && tapbackAnswerOf(personWords) !== void 0 ? { answerTapback: tapbackAnswerOf(personWords) } : {},
@@ -12696,7 +12696,13 @@ var init_settings = __esm({
12696
12696
  * phone-guest principal, named by the bridge. Read only for a text-later yes
12697
12697
  * (`resolveTextConsentSpeaker`) and the one tool that yes runs; never an asker elsewhere.
12698
12698
  */
12699
- "guestAskerUserId?": "string"
12699
+ "guestAskerUserId?": "string",
12700
+ /**
12701
+ * The bridge put this chat on its own guest allowance (`set-group-payer` with `guest`): a phone
12702
+ * guest's one-to-one chat. A sponsored group with no bridge account to fall back on can also
12703
+ * name itself its payer, so a self payer alone never says "one to one" (2026-11-20).
12704
+ */
12705
+ "guest?": "true"
12700
12706
  })
12701
12707
  );
12702
12708
  userSettingGroupSponsor = lazyType(
@@ -27777,6 +27783,7 @@ var init_version_timeline = __esm({
27777
27783
  var POUF_ENTRY_EXPORTS, POUF_TAUGHT_NAMES;
27778
27784
  var init_exports = __esm({
27779
27785
  "../vibes.diy/pouf/exports.ts"() {
27786
+ "use strict";
27780
27787
  POUF_ENTRY_EXPORTS = {
27781
27788
  index: [
27782
27789
  "AlertBell",
@@ -59682,6 +59689,12 @@ async function readGroupPayer(sql44, groupUserId) {
59682
59689
  return settings?.find(isUserSettingGroupPayer)?.payerUserId;
59683
59690
  });
59684
59691
  }
59692
+ async function readGroupIsGuestChat(sql44, groupUserId) {
59693
+ return exception2Result101(async () => {
59694
+ const payer = (await readSettings2(sql44, groupUserId))?.find(isUserSettingGroupPayer);
59695
+ return payer?.guest === true && payer.payerUserId === groupUserId;
59696
+ });
59697
+ }
59685
59698
  async function writeGroupPayer(sql44, args) {
59686
59699
  return exception2Result101(async () => {
59687
59700
  const t = sql44.tables.userSettings;
@@ -59698,7 +59711,8 @@ async function writeGroupPayer(sql44, args) {
59698
59711
  updatedAt: now3,
59699
59712
  claimId,
59700
59713
  ...args.asker === true ? { asker: true } : {},
59701
- ...args.guestAskerUserId === void 0 ? {} : { guestAskerUserId: args.guestAskerUserId }
59714
+ ...args.guestAskerUserId === void 0 ? {} : { guestAskerUserId: args.guestAskerUserId },
59715
+ ...args.guest === true ? { guest: true } : {}
59702
59716
  }
59703
59717
  ];
59704
59718
  if (row === void 0) {
@@ -59977,6 +59991,7 @@ var init_group_payer = __esm({
59977
59991
  NO_PAYER = { allowed: false, remainingCredits: 0 };
59978
59992
  GROUP_CANNOT_BUY = "group-cannot-buy: a group's credits are its members' own";
59979
59993
  __name(readGroupPayer, "readGroupPayer");
59994
+ __name(readGroupIsGuestChat, "readGroupIsGuestChat");
59980
59995
  __name(writeGroupPayer, "writeGroupPayer");
59981
59996
  __name(readGroupAsker, "readGroupAsker");
59982
59997
  __name(readGroupGuestAsker, "readGroupGuestAsker");
@@ -85758,6 +85773,8 @@ SELECT DISTINCT a."ownerHandle" AS "userSlug", a."appSlug" AS "appSlug",
85758
85773
  utmContent: text(),
85759
85774
  opener: text(),
85760
85775
  variant: text(),
85776
+ userAgent: text(),
85777
+ // the tapping browser's User-Agent, capped at 512 chars; null when it sent none
85761
85778
  created: text().notNull()
85762
85779
  },
85763
85780
  (table) => [primaryKey({ name: "TextTaps_plane_textHash_id_pk", columns: [table.plane, table.textHash, table.id] })]
@@ -87656,6 +87673,8 @@ SELECT DISTINCT a."ownerHandle" AS "userSlug", a."appSlug" AS "appSlug",
87656
87673
  utmContent: text2(),
87657
87674
  opener: text2(),
87658
87675
  variant: text2(),
87676
+ userAgent: text2(),
87677
+ // the tapping browser's User-Agent, capped at 512 chars; null when it sent none
87659
87678
  created: text2().notNull()
87660
87679
  // ISO 8601, server receive time
87661
87680
  },
@@ -93990,6 +94009,7 @@ async function putTextTap(vctx, plane, tap, o) {
93990
94009
  utmContent: tap.utmContent ?? null,
93991
94010
  opener: tap.opener ?? null,
93992
94011
  variant: tap.variant ?? null,
94012
+ userAgent: o.userAgent ?? null,
93993
94013
  created: o.now.toISOString()
93994
94014
  });
93995
94015
  return "stored";
@@ -94012,6 +94032,10 @@ import {
94012
94032
  Result as Result112,
94013
94033
  URI as URI34
94014
94034
  } from "@adviser/cement";
94035
+ function tapUserAgent(req2) {
94036
+ const ua = (req2.headers.get("User-Agent") ?? "").trim().slice(0, TEXT_TAP_MAX_USER_AGENT);
94037
+ return ua === "" ? void 0 : ua;
94038
+ }
94015
94039
  function edgeCountry(req2) {
94016
94040
  const c = req2.cf?.country ?? req2.headers.get("CF-IPCountry");
94017
94041
  return typeof c === "string" && c !== "" ? c : void 0;
@@ -94033,7 +94057,11 @@ async function receiveTextTap(vctx, body, o) {
94033
94057
  const plane = textPlaneOf(vctx);
94034
94058
  if (plane === void 0) return { status: 503, json: { type: "error", message: "not set up" } };
94035
94059
  const rPut = await exception2Result166(
94036
- () => putTextTap(vctx, plane, tap, { now: o.now ?? /* @__PURE__ */ new Date(), id: o.id ?? crypto.randomUUID() })
94060
+ () => putTextTap(vctx, plane, tap, {
94061
+ now: o.now ?? /* @__PURE__ */ new Date(),
94062
+ id: o.id ?? crypto.randomUUID(),
94063
+ ...o.userAgent === void 0 ? {} : { userAgent: o.userAgent }
94064
+ })
94037
94065
  );
94038
94066
  if (rPut.isErr()) {
94039
94067
  console.warn(`[text-tap] store failed: ${rPut.Err().message.slice(0, 200)}`);
@@ -94041,7 +94069,7 @@ async function receiveTextTap(vctx, body, o) {
94041
94069
  }
94042
94070
  return { status: 200, json: { type: "ok", stored: rPut.Ok() === "stored" } };
94043
94071
  }
94044
- var TEXT_TAP_MAX_BODY, textTapHttp;
94072
+ var TEXT_TAP_MAX_BODY, TEXT_TAP_MAX_USER_AGENT, textTapHttp;
94045
94073
  var init_text_tap2 = __esm({
94046
94074
  "../vibes.diy/api/svc/public/text-tap.ts"() {
94047
94075
  "use strict";
@@ -94050,6 +94078,8 @@ var init_text_tap2 = __esm({
94050
94078
  init_text_store();
94051
94079
  init_text_tap_store();
94052
94080
  TEXT_TAP_MAX_BODY = 4096;
94081
+ TEXT_TAP_MAX_USER_AGENT = 512;
94082
+ __name(tapUserAgent, "tapUserAgent");
94053
94083
  __name(edgeCountry, "edgeCountry");
94054
94084
  __name(answer2, "answer");
94055
94085
  __name(receiveTextTap, "receiveTextTap");
@@ -94061,11 +94091,16 @@ var init_text_tap2 = __esm({
94061
94091
  return Result112.Ok(Option27.None());
94062
94092
  }
94063
94093
  const rBody = await exception2Result166(() => req2.text());
94064
- return Result112.Ok(Option27.Some({ body: rBody.isOk() ? rBody.Ok() : "", country: edgeCountry(req2) }));
94094
+ return Result112.Ok(
94095
+ Option27.Some({ body: rBody.isOk() ? rBody.Ok() : "", country: edgeCountry(req2), userAgent: tapUserAgent(req2) })
94096
+ );
94065
94097
  }, "validate"),
94066
94098
  handle: /* @__PURE__ */ __name(async (ctx) => {
94067
94099
  const vctx = ctx.ctx.getOrThrow("vibesApiCtx");
94068
- const res = await receiveTextTap(vctx, ctx.validated.body, { country: ctx.validated.country });
94100
+ const res = await receiveTextTap(vctx, ctx.validated.body, {
94101
+ country: ctx.validated.country,
94102
+ ...ctx.validated.userAgent === void 0 ? {} : { userAgent: ctx.validated.userAgent }
94103
+ });
94069
94104
  await ctx.send.send(ctx, answer2(res.status, res.json));
94070
94105
  return Result112.Ok(EventoResult22.Stop);
94071
94106
  }, "handle")
@@ -105491,7 +105526,13 @@ async function setGroupPayer(vctx, args, seams = {}) {
105491
105526
  vctx,
105492
105527
  groupUserId: args.groupUserId,
105493
105528
  msg: "group-payer: write failed",
105494
- write: /* @__PURE__ */ __name(() => writeGroupPayer(vctx.sql, { groupUserId: args.groupUserId, payerUserId, ...asker ? { asker } : {} }), "write")
105529
+ write: /* @__PURE__ */ __name(() => writeGroupPayer(vctx.sql, {
105530
+ groupUserId: args.groupUserId,
105531
+ payerUserId,
105532
+ ...asker ? { asker } : {},
105533
+ // Marks the chat a guest's one to one, which framing reads (`readGroupIsGuestChat`).
105534
+ ...args.guest === true ? { guest: true } : {}
105535
+ }), "write")
105495
105536
  });
105496
105537
  if (written.result.isErr())
105497
105538
  return refuse7(GROUP_PAYER_ERROR.unavailable, "Couldn't record that. Try again in a moment.", written.causeClass);
@@ -136706,7 +136747,7 @@ function addedVibeContextLine(link) {
136706
136747
  function namedTools(tools) {
136707
136748
  return tools.slice(0, ADDED_VIBE_TOOLS_NAMED).map((t) => `${t.name} ${quoteUntrusted(t.description)}`).join(", ");
136708
136749
  }
136709
- function groupHeldAppLines(ownerHandle, held3, addedVibes = []) {
136750
+ function groupHeldAppLines(ownerHandle, held3, addedVibes = [], whose = "the group's") {
136710
136751
  const added = new Set(addedVibes.map((v) => `${v.ownerHandle}/${v.appSlug}`));
136711
136752
  const lines = [];
136712
136753
  for (const b of held3.boundApps ?? []) {
@@ -136721,7 +136762,7 @@ function groupHeldAppLines(ownerHandle, held3, addedVibes = []) {
136721
136762
  const own = (held3.ownToolVibes ?? []).filter((v) => !bound.has(`${ownerHandle}/${v.appSlug}`) && v.tools.length > 0);
136722
136763
  if (own.length > 0) {
136723
136764
  lines.push(
136724
- `the group's own vibes with tools (with_vibe @${ownerHandle}/<appSlug>, then call_vibe_tool; the text in \xAB\xBB is its maker's): ${own.map((v) => `${v.appSlug}: ${namedTools(v.tools)}`).join("; ")}`
136765
+ `${whose} own vibes with tools (with_vibe @${ownerHandle}/<appSlug>, then call_vibe_tool; the text in \xAB\xBB is its maker's): ${own.map((v) => `${v.appSlug}: ${namedTools(v.tools)}`).join("; ")}`
136725
136766
  );
136726
136767
  }
136727
136768
  return lines;
@@ -136730,6 +136771,9 @@ function serverFirstBuildAppContext(messages, address2) {
136730
136771
  return claimAgentAppContext(messages, address2, { firstBuildLine: SERVER_FIRST_BUILD_CONTEXT_LINE });
136731
136772
  }
136732
136773
  function topLevelContextLines(ownerHandle, brief2, group) {
136774
+ if (group && brief2.oneToOneGuest === true) {
136775
+ return guestOneToOneContextLines(ownerHandle, { boundApps: brief2.boundApps, ownToolVibes: brief2.ownToolVibes });
136776
+ }
136733
136777
  if (group) {
136734
136778
  const changed = vibeLinkChangesLine(brief2.linkChanges ?? []);
136735
136779
  return [
@@ -136746,6 +136790,14 @@ function topLevelContextLines(ownerHandle, brief2, group) {
136746
136790
  ...brief2.paneApp === void 0 ? [] : [paneAppContextLine(brief2.paneApp)]
136747
136791
  ];
136748
136792
  }
136793
+ function guestOneToOneContextLines(ownerHandle, held3 = {}) {
136794
+ return [
136795
+ ...groupHeldAppLines(ownerHandle, held3, void 0, "this chat's"),
136796
+ `conversation: one to one \u2014 one person texting you, who hasn't linked a Vibes account to this number yet; everything they write is theirs and said to you`,
136797
+ `this conversation acts as: @${ownerHandle} \u2014 new vibes are created under it, and its vibes are this person's: the ones they made here, which come with them when they link an account`,
136798
+ `their own Vibes account, if they have one, isn't linked to this chat, so its apps aren't reachable here; when they ask about an account's apps, list this handle's and say once that linking their number brings in the rest (the Text Vibes card at https://vibes.diy/agent)`
136799
+ ];
136800
+ }
136749
136801
  function groupContextLines(ownerHandle, addedVibes, held3 = {}) {
136750
136802
  return [
136751
136803
  // The bound app, the picture app and the group's own vibes with tools, each with its tools (2026-11-18).
@@ -136987,6 +137039,7 @@ var init_agent_assembly = __esm({
136987
137039
  SERVER_FIRST_BUILD_CONTEXT_LINE = "its first build is running now, started by the platform from the person's own words as this turn began. Tell the person in a sentence or two what is on its way, and answer from the [build result] when it arrives; its files, versions and settings are readable once it lands.";
136988
137040
  __name(serverFirstBuildAppContext, "serverFirstBuildAppContext");
136989
137041
  __name(topLevelContextLines, "topLevelContextLines");
137042
+ __name(guestOneToOneContextLines, "guestOneToOneContextLines");
136990
137043
  __name(groupContextLines, "groupContextLines");
136991
137044
  __name(headMovedLine, "headMovedLine");
136992
137045
  REFUSED_LINK_CONTEXT_LINE = `this message includes a link whose contents stayed outside this turn: the builder reads a source once the platform has opened that source to it, and this one is closed to it today \u2014 that is a fact about this app's powers rather than about the link. Tell the person that reading this source takes more power than this app has right now, and that the vibes.diy team can grant it; then carry on from what the message itself says.`;
@@ -145991,7 +146044,8 @@ async function loadTopLevelAgentBrief(vctx, args) {
145991
146044
  return t === void 0 || t.length === 0 ? r : { ...r, tools: t };
145992
146045
  });
145993
146046
  });
145994
- const [rHandles, rActive, rSelf, allLinks, rChanges, tools, rOwnTools, boundApps] = await Promise.all([
146047
+ const pGuestChat = !group ? void 0 : settled("guestChat", readGroupIsGuestChat(vctx.sql, args.userId));
146048
+ const [rHandles, rActive, rSelf, allLinks, rChanges, tools, rOwnTools, boundApps, rGuestChat] = await Promise.all([
145995
146049
  pHandles,
145996
146050
  pActive,
145997
146051
  pSelf,
@@ -146000,6 +146054,7 @@ async function loadTopLevelAgentBrief(vctx, args) {
146000
146054
  pTools,
146001
146055
  pOwnTools,
146002
146056
  pBound,
146057
+ pGuestChat,
146003
146058
  // The member note feeds nothing in the brief, and its read-then-write measured 2 to 4 s, the
146004
146059
  // brief's slowest step (#10019 round 14), so where the host can keep it alive past the reply it
146005
146060
  // finishes off the turn's path. Without `waitUntil` (tests, a host with none) it is awaited here.
@@ -146023,7 +146078,11 @@ async function loadTopLevelAgentBrief(vctx, args) {
146023
146078
  if (rOwnTools?.isErr() === true)
146024
146079
  vctx.logger.Warn().Err(rOwnTools).Str("userId", args.userId).Msg("top-level-agent-own-tools-failed");
146025
146080
  const ownToolVibes = rOwnTools?.isOk() === true && rOwnTools.Ok().length > 0 ? rOwnTools.Ok() : void 0;
146081
+ if (rGuestChat?.isErr() === true)
146082
+ vctx.logger.Warn().Err(rGuestChat).Str("userId", args.userId).Msg("top-level-agent-guest-chat-read-failed");
146083
+ const oneToOneGuest = rGuestChat?.isOk() === true && rGuestChat.Ok();
146026
146084
  return Result253.Ok({
146085
+ ...oneToOneGuest ? { oneToOneGuest: true } : {},
146027
146086
  ...displayName === void 0 ? {} : { displayName },
146028
146087
  ...activeHandle === void 0 ? {} : { activeHandle },
146029
146088
  handles: rHandles.Ok().map((r) => r.handle),
@@ -146309,7 +146368,9 @@ function createAccountAgentBelt(vctx, args) {
146309
146368
  // Advertised only while the feedback gate allows this conversation (agent-feedback-tool.ts).
146310
146369
  ...agentFeedbackAllowed({ chatId: args.chatId, userId: args.actor.userId }) ? [feedback.definition] : []
146311
146370
  ];
146312
- const definitions = groupSession ? allDefinitions.filter((d) => groupSessionKeepsTool(d.function.name)) : allDefinitions.filter((d) => !GROUP_ONLY_TOOL_NAMES.has(d.function.name));
146371
+ const definitions = groupSession ? allDefinitions.filter(
146372
+ (d) => groupSessionKeepsTool(d.function.name) && !(args.oneToOne === true && GROUP_ONLY_TOOL_NAMES.has(d.function.name))
146373
+ ) : allDefinitions.filter((d) => !GROUP_ONLY_TOOL_NAMES.has(d.function.name));
146313
146374
  const offeredToolNames = /* @__PURE__ */ __name(() => definitions.map((d) => d.function.name), "offeredToolNames");
146314
146375
  function refused2(toolName, refusal5) {
146315
146376
  vctx.logger.Info().Any("event", { tool: toolName, chatId: args.chatId, topLevel: true, reason: refusal5.reason }).Msg("agent-tool-refused");
@@ -147632,7 +147693,11 @@ async function assembleAgentTurn(args) {
147632
147693
  }) ? { currentScreenshot: true } : {}
147633
147694
  });
147634
147695
  if (rAgent.isErr()) return Result255.Err(rAgent);
147635
- let agentAssembled = { model: rAgent.Ok().model, messages: rAgent.Ok().messages };
147696
+ let agentAssembled = {
147697
+ model: rAgent.Ok().model,
147698
+ messages: rAgent.Ok().messages,
147699
+ ...topLevel?.oneToOneGuest === true ? { oneToOne: true } : {}
147700
+ };
147636
147701
  const rawIncoming = orig.prompt.messages.filter(isUserChatMessage);
147637
147702
  const newMessageCount = orig.prompt.messages.filter(isChatMessage).length;
147638
147703
  const incoming = newMessageCount === 0 ? [] : rAgent.Ok().messages.slice(-newMessageCount).filter(isUserChatMessage);
@@ -150952,6 +151017,8 @@ function createAgentTurnAction(args) {
150952
151017
  const doorBelt = topLevel ? createAccountAgentBelt(vctx, {
150953
151018
  actor: rActor.Ok(),
150954
151019
  chatId: req2.chatId,
151020
+ // A phone guest's own one-to-one chat: one person, so no group-only tools (agent-account-tools.ts).
151021
+ ...agentPayload.oneToOne === true ? { oneToOne: true } : {},
150955
151022
  personWords,
150956
151023
  // A 👍 on Vibes' question, handed over by the Mac bridge, is a tapback yes (text-consents.ts).
150957
151024
  ...origFlags.byText === true && tapbackAnswerOf(personWords) !== void 0 ? { answerTapback: tapbackAnswerOf(personWords) } : {},
@@ -175308,7 +175375,7 @@ var RUN_SCHEMA_HASH, RUN_SCHEMA_DDL;
175308
175375
  var init_run_schema_generated = __esm({
175309
175376
  "cli/cmds/run/run-schema.generated.ts"() {
175310
175377
  "use strict";
175311
- RUN_SCHEMA_HASH = "f7fec0bde6b85f5b";
175378
+ RUN_SCHEMA_HASH = "dca9e48bca7ddf81";
175312
175379
  RUN_SCHEMA_DDL = [
175313
175380
  "CREATE TABLE `AccessFnChannelIndex` (\n `userSlug` text NOT NULL,\n `appSlug` text NOT NULL,\n `dbName` text NOT NULL,\n `channel` text NOT NULL,\n `docId` text NOT NULL,\n PRIMARY KEY(`userSlug`, `appSlug`, `dbName`, `channel`, `docId`)\n);\n",
175314
175381
  "CREATE INDEX `AccessFnChannelIndex_lookup_idx` ON `AccessFnChannelIndex` (`userSlug`,`appSlug`,`dbName`,`channel`);",
@@ -175440,7 +175507,7 @@ var init_run_schema_generated = __esm({
175440
175507
  "CREATE TABLE `TextLinks` (\n `plane` text NOT NULL,\n `phoneHash` text NOT NULL,\n `phoneMasked` text NOT NULL,\n `userId` text NOT NULL,\n `ownerHandle` text NOT NULL,\n `linkedAt` text NOT NULL,\n `lastHeardAt` text,\n PRIMARY KEY(`plane`, `phoneHash`)\n);\n",
175441
175508
  "CREATE TABLE `TextOnboarding` (\n `plane` text NOT NULL,\n `userId` text NOT NULL,\n `phoneNumber` text NOT NULL,\n `nonce` text NOT NULL,\n `created` text NOT NULL,\n PRIMARY KEY(`plane`, `userId`)\n);\n",
175442
175509
  "CREATE UNIQUE INDEX `TextOnboarding_plane_nonce_unique` ON `TextOnboarding` (`plane`,`nonce`);",
175443
- "CREATE TABLE `TextTaps` (\n `plane` text NOT NULL,\n `textHash` text NOT NULL,\n `id` text NOT NULL,\n `fbc` text,\n `fbp` text,\n `utmCampaign` text,\n `utmContent` text,\n `opener` text,\n `variant` text,\n `created` text NOT NULL,\n PRIMARY KEY(`plane`, `textHash`, `id`)\n);\n",
175510
+ "CREATE TABLE `TextTaps` (\n `plane` text NOT NULL,\n `textHash` text NOT NULL,\n `id` text NOT NULL,\n `fbc` text,\n `fbp` text,\n `utmCampaign` text,\n `utmContent` text,\n `opener` text,\n `variant` text,\n `userAgent` text,\n `created` text NOT NULL,\n PRIMARY KEY(`plane`, `textHash`, `id`)\n);\n",
175444
175511
  "CREATE TABLE `ThirdPartyConsents` (\n `userId` text NOT NULL,\n `provider` text NOT NULL,\n `userSlug` text NOT NULL,\n `appSlug` text NOT NULL,\n `scopes` text DEFAULT '' NOT NULL,\n `created` text NOT NULL,\n `updated` text NOT NULL,\n `revokedAt` text DEFAULT '' NOT NULL,\n PRIMARY KEY(`userId`, `provider`, `userSlug`, `appSlug`)\n);\n",
175445
175512
  "CREATE INDEX `ThirdPartyConsents_vibe` ON `ThirdPartyConsents` (`userSlug`,`appSlug`);",
175446
175513
  "CREATE TABLE `ThirdPartyGrants` (\n `userId` text NOT NULL,\n `provider` text NOT NULL,\n `accountLabel` text DEFAULT '' NOT NULL,\n `accountId` text DEFAULT '' NOT NULL,\n `accessToken` text NOT NULL,\n `refreshToken` text DEFAULT '' NOT NULL,\n `expiresAt` text DEFAULT '' NOT NULL,\n `scopes` text DEFAULT '' NOT NULL,\n `status` text DEFAULT 'live' NOT NULL,\n `created` text NOT NULL,\n `updated` text NOT NULL,\n `revokedAt` text DEFAULT '' NOT NULL,\n `rev` integer DEFAULT 0 NOT NULL,\n PRIMARY KEY(`userId`, `provider`)\n);\n",
@@ -1,2 +1,2 @@
1
- export declare const RUN_SCHEMA_HASH = "f7fec0bde6b85f5b";
1
+ export declare const RUN_SCHEMA_HASH = "dca9e48bca7ddf81";
2
2
  export declare const RUN_SCHEMA_DDL: readonly string[];
@@ -1,4 +1,4 @@
1
- export const RUN_SCHEMA_HASH = "f7fec0bde6b85f5b";
1
+ export const RUN_SCHEMA_HASH = "dca9e48bca7ddf81";
2
2
  export const RUN_SCHEMA_DDL = [
3
3
  "CREATE TABLE `AccessFnChannelIndex` (\n\t`userSlug` text NOT NULL,\n\t`appSlug` text NOT NULL,\n\t`dbName` text NOT NULL,\n\t`channel` text NOT NULL,\n\t`docId` text NOT NULL,\n\tPRIMARY KEY(`userSlug`, `appSlug`, `dbName`, `channel`, `docId`)\n);\n",
4
4
  "CREATE INDEX `AccessFnChannelIndex_lookup_idx` ON `AccessFnChannelIndex` (`userSlug`,`appSlug`,`dbName`,`channel`);",
@@ -130,7 +130,7 @@ export const RUN_SCHEMA_DDL = [
130
130
  "CREATE TABLE `TextLinks` (\n\t`plane` text NOT NULL,\n\t`phoneHash` text NOT NULL,\n\t`phoneMasked` text NOT NULL,\n\t`userId` text NOT NULL,\n\t`ownerHandle` text NOT NULL,\n\t`linkedAt` text NOT NULL,\n\t`lastHeardAt` text,\n\tPRIMARY KEY(`plane`, `phoneHash`)\n);\n",
131
131
  "CREATE TABLE `TextOnboarding` (\n\t`plane` text NOT NULL,\n\t`userId` text NOT NULL,\n\t`phoneNumber` text NOT NULL,\n\t`nonce` text NOT NULL,\n\t`created` text NOT NULL,\n\tPRIMARY KEY(`plane`, `userId`)\n);\n",
132
132
  "CREATE UNIQUE INDEX `TextOnboarding_plane_nonce_unique` ON `TextOnboarding` (`plane`,`nonce`);",
133
- "CREATE TABLE `TextTaps` (\n\t`plane` text NOT NULL,\n\t`textHash` text NOT NULL,\n\t`id` text NOT NULL,\n\t`fbc` text,\n\t`fbp` text,\n\t`utmCampaign` text,\n\t`utmContent` text,\n\t`opener` text,\n\t`variant` text,\n\t`created` text NOT NULL,\n\tPRIMARY KEY(`plane`, `textHash`, `id`)\n);\n",
133
+ "CREATE TABLE `TextTaps` (\n\t`plane` text NOT NULL,\n\t`textHash` text NOT NULL,\n\t`id` text NOT NULL,\n\t`fbc` text,\n\t`fbp` text,\n\t`utmCampaign` text,\n\t`utmContent` text,\n\t`opener` text,\n\t`variant` text,\n\t`userAgent` text,\n\t`created` text NOT NULL,\n\tPRIMARY KEY(`plane`, `textHash`, `id`)\n);\n",
134
134
  "CREATE TABLE `ThirdPartyConsents` (\n\t`userId` text NOT NULL,\n\t`provider` text NOT NULL,\n\t`userSlug` text NOT NULL,\n\t`appSlug` text NOT NULL,\n\t`scopes` text DEFAULT '' NOT NULL,\n\t`created` text NOT NULL,\n\t`updated` text NOT NULL,\n\t`revokedAt` text DEFAULT '' NOT NULL,\n\tPRIMARY KEY(`userId`, `provider`, `userSlug`, `appSlug`)\n);\n",
135
135
  "CREATE INDEX `ThirdPartyConsents_vibe` ON `ThirdPartyConsents` (`userSlug`,`appSlug`);",
136
136
  "CREATE TABLE `ThirdPartyGrants` (\n\t`userId` text NOT NULL,\n\t`provider` text NOT NULL,\n\t`accountLabel` text DEFAULT '' NOT NULL,\n\t`accountId` text DEFAULT '' NOT NULL,\n\t`accessToken` text NOT NULL,\n\t`refreshToken` text DEFAULT '' NOT NULL,\n\t`expiresAt` text DEFAULT '' NOT NULL,\n\t`scopes` text DEFAULT '' NOT NULL,\n\t`status` text DEFAULT 'live' NOT NULL,\n\t`created` text NOT NULL,\n\t`updated` text NOT NULL,\n\t`revokedAt` text DEFAULT '' NOT NULL,\n\t`rev` integer DEFAULT 0 NOT NULL,\n\tPRIMARY KEY(`userId`, `provider`)\n);\n",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibes-diy",
3
- "version": "14.3.405",
3
+ "version": "14.3.406",
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.405",
45
- "@vibes.diy/api-types": "14.3.405",
46
- "@vibes.diy/call-ai-v2": "14.3.405",
47
- "@vibes.diy/cmd-harness": "14.3.405",
48
- "@vibes.diy/cmd-tools": "14.3.405",
49
- "@vibes.diy/identity": "14.3.405",
50
- "@vibes.diy/prompts": "14.3.405",
44
+ "@vibes.diy/api-impl": "14.3.406",
45
+ "@vibes.diy/api-types": "14.3.406",
46
+ "@vibes.diy/call-ai-v2": "14.3.406",
47
+ "@vibes.diy/cmd-harness": "14.3.406",
48
+ "@vibes.diy/cmd-tools": "14.3.406",
49
+ "@vibes.diy/identity": "14.3.406",
50
+ "@vibes.diy/prompts": "14.3.406",
51
51
  "acorn": "~8.19.0",
52
52
  "acorn-jsx": "~5.3.2",
53
53
  "arktype": "~2.2.9",