vibes-diy 14.3.459 → 14.3.461

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.
@@ -24707,6 +24707,12 @@ var init_lazy_type = __esm({
24707
24707
  });
24708
24708
 
24709
24709
  // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/types/types.ts
24710
+ function isMetaScreenShot(obj) {
24711
+ return MetaScreenShotRef.allows(obj);
24712
+ }
24713
+ function isMetaMobileScreenShot(obj) {
24714
+ return MetaMobileScreenShotRef.allows(obj);
24715
+ }
24710
24716
  function isMetaSharedScreenShot(obj) {
24711
24717
  return MetaSharedScreenShotRef.allows(obj);
24712
24718
  }
@@ -24784,6 +24790,7 @@ var init_types2 = __esm({
24784
24790
  ...screenshotProvenanceFields
24785
24791
  })
24786
24792
  );
24793
+ __name(isMetaScreenShot, "isMetaScreenShot");
24787
24794
  MetaMobileScreenShotRef = lazyType(
24788
24795
  () => type({
24789
24796
  type: "'mobile-screen-shot-ref'",
@@ -24795,6 +24802,7 @@ var init_types2 = __esm({
24795
24802
  ...screenshotProvenanceFields
24796
24803
  })
24797
24804
  );
24805
+ __name(isMetaMobileScreenShot, "isMetaMobileScreenShot");
24798
24806
  MetaSharedScreenShotRef = lazyType(
24799
24807
  () => type({
24800
24808
  type: "'shared-screen-shot-ref'",
@@ -26433,6 +26441,11 @@ var init_block_stream = __esm({
26433
26441
  repaired: "string[]",
26434
26442
  // #10273: the entry files given `export default App;` with no model (a subset of `repaired`).
26435
26443
  "exportAdded?": "string[]",
26444
+ // #10273: the entry files a stray unlabelled fence had replaced, put back to the last whole
26445
+ // version the turn wrote (or its base) with no model (a subset of `repaired`).
26446
+ "fragmentsDropped?": "string[]",
26447
+ // #10273: of those, the entries no write of the turn survived for (saved unchanged).
26448
+ "editsNotApplied?": "string[]",
26436
26449
  findings: "string[]",
26437
26450
  "usage?": type({ prompt_tokens: "number", completion_tokens: "number", total_tokens: "number", "cost?": "number" }).array()
26438
26451
  }),
@@ -26581,7 +26594,13 @@ var init_block_stream = __esm({
26581
26594
  // the platform re-emitted before the save and how many rounds it took. On the
26582
26595
  // terminal so a landing rebuilt from the stored row after a restart carries
26583
26596
  // the same fact the live wake does. Optional: absent when no repair ran.
26584
- "saveRepair?": { repaired: "string[]", attempts: "number", "exportAdded?": "string[]" },
26597
+ "saveRepair?": {
26598
+ repaired: "string[]",
26599
+ attempts: "number",
26600
+ "exportAdded?": "string[]",
26601
+ "fragmentsDropped?": "string[]",
26602
+ "editsNotApplied?": "string[]"
26603
+ },
26585
26604
  // The save-path seed repair (VibesDIY/vibes.diy#6904): the saved seed.json is
26586
26605
  // not the streamed one. Same reason as `saveRepair` for riding the terminal.
26587
26606
  "seedRepair?": { repaired: "string[]", attempts: "number" },
@@ -28413,6 +28432,8 @@ var init_agent_tools = __esm({
28413
28432
  // Every session edit enters the queue, including an empty lane, so `queued` alone
28414
28433
  // does not mean waiting. Absent on receipts recorded before it existed.
28415
28434
  "busy?": "boolean",
28435
+ // #11452 — beside `busy`: everything ahead is an earlier part of the same ask.
28436
+ "ownAhead?": "boolean",
28416
28437
  // #5450 X2 — what the build was given, stated by the server at dispatch.
28417
28438
  //
28418
28439
  // Tool calls do not ride the section stream (#5428), so a reader of a
@@ -28498,7 +28519,7 @@ var init_offered_options = __esm({
28498
28519
  function workStatusBlockSeq(round2) {
28499
28520
  return WORK_STATUS_SEQ_BASE - round2;
28500
28521
  }
28501
- var PromptBase, PromptReq, PromptFS, PromptBlockBegin, PromptError, PromptBlockEnd, PromptModelResolved, PromptFsPersisted, PromptSystemPrompt, PromptImgGenWaiting, PromptRaw, PromptDryRunPayload, AgentEvidence, PromptAgentEvidence, PromptRestyle, PromptFirstLook, PromptFirstBrief, WORK_STATUS_SEQ_BASE, WORK_STATUS_MAX_ROUND, WORK_STATUS_MAX_TOOLS, WORK_STATUS_MAX_TOOL_NAME_CHARS, WORK_STATUS_MAX_PATH_CHARS, PromptStatusTool, PromptStatus, NOTICE_MAX_PATH_CHARS, PromptNotice, TURN_SUMMARY_MAX_CHARS, PromptSummary, PROGRESS_LABEL_MAX_CHARS, PromptProgressLabel, PromptNatureRewrite, DISCUSSION_TITLE_MAX_CHARS, PromptDiscussionTitle, PromptMsgs;
28522
+ var PromptBase, PromptReq, PromptFS, PromptBlockBegin, SaveRepairTrace, PromptError, PromptBlockEnd, PromptModelResolved, PromptFsPersisted, PromptSystemPrompt, PromptImgGenWaiting, PromptRaw, PromptDryRunPayload, AgentEvidence, PromptAgentEvidence, PromptRestyle, PromptFirstLook, PromptFirstBrief, WORK_STATUS_SEQ_BASE, WORK_STATUS_MAX_ROUND, WORK_STATUS_MAX_TOOLS, WORK_STATUS_MAX_TOOL_NAME_CHARS, WORK_STATUS_MAX_PATH_CHARS, PromptStatusTool, PromptStatus, NOTICE_MAX_PATH_CHARS, PromptNotice, TURN_SUMMARY_MAX_CHARS, PromptSummary, PROGRESS_LABEL_MAX_CHARS, PromptProgressLabel, PromptNatureRewrite, DISCUSSION_TITLE_MAX_CHARS, PromptDiscussionTitle, PromptMsgs;
28502
28523
  var init_prompt = __esm({
28503
28524
  "../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/types/prompt.ts"() {
28504
28525
  "use strict";
@@ -28642,10 +28663,21 @@ var init_prompt = __esm({
28642
28663
  type: "'prompt.block-begin'"
28643
28664
  }).and(PromptBase)
28644
28665
  );
28666
+ SaveRepairTrace = lazyType(
28667
+ () => type({
28668
+ outcome: "'no-parse-findings' | 'model-error' | 'timeout' | 'unparseable-reply' | 'still-failing' | 'still-refused' | 'edits-not-applied' | 'off'",
28669
+ attempts: "number",
28670
+ "model?": "string",
28671
+ "fragmentsDropped?": "string[]",
28672
+ "detail?": "string"
28673
+ })
28674
+ );
28645
28675
  PromptError = lazyType(
28646
28676
  () => type({
28647
28677
  type: "'prompt.error'",
28648
28678
  error: "string",
28679
+ // #10273: the save-path repair's trace on a turn the save check refused. Absent otherwise.
28680
+ "saveRepair?": SaveRepairTrace,
28649
28681
  // A machine-readable cause, so a client can say something specific about a
28650
28682
  // failure class instead of rendering the raw message (#5363). Absent on every
28651
28683
  // ordinary error — an unrecognized code renders exactly as one.
@@ -28724,6 +28756,9 @@ var init_prompt = __esm({
28724
28756
  // #7008 — on a queued/committing receipt: was a build (or an earlier change) ahead of
28725
28757
  // it when it queued? Absent on rows written before this field, which read as not busy.
28726
28758
  "busy?": "boolean",
28759
+ // #11452 — on a busy receipt: everything ahead was an earlier part of the same ask (the
28760
+ // agent split one change into builds), so it is the person's own change building.
28761
+ "ownAhead?": "boolean",
28727
28762
  "saved?": "boolean",
28728
28763
  "ok?": "boolean",
28729
28764
  // A queued edit can be refused before a build starts. Preserve its typed
@@ -28931,7 +28966,7 @@ function guestAccountClaims(input3) {
28931
28966
  }
28932
28967
  };
28933
28968
  }
28934
- var GUEST_PRINCIPAL_PREFIX, guestPrincipalClaims, guestClaimHandoffClaims, issueGuestPrincipalRequest, guestPrincipalSession, reqClaimGuestPrincipal, guestAppPair, guestAppMove, resClaimGuestPrincipal, reqMintGuestClaimHandoff, resMintGuestClaimHandoff;
28969
+ var GUEST_PRINCIPAL_PREFIX, guestPrincipalClaims, guestClaimHandoffClaims, issueGuestPrincipalRequest, guestPrincipalSession, reqClaimGuestPrincipal, guestAppPair, guestAppMove, resClaimGuestPrincipal, reqPreviewGuestClaim, resPreviewGuestClaim, reqMintGuestClaimHandoff, resMintGuestClaimHandoff;
28935
28970
  var init_guest_principal = __esm({
28936
28971
  "../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/types/guest-principal.ts"() {
28937
28972
  "use strict";
@@ -28978,7 +29013,16 @@ var init_guest_principal = __esm({
28978
29013
  () => type({
28979
29014
  type: "'vibes.diy.req-claim-guest-principal'",
28980
29015
  auth: dashAuthType,
28981
- guestToken: "string > 0"
29016
+ guestToken: "string > 0",
29017
+ /**
29018
+ * The page vouches that the person means this claim (#11736): the
29019
+ * principal is the one this browser holds, this browser began the sign-in
29020
+ * as that guest, or they said yes on the card that names the apps. A claim
29021
+ * without it lands only for an account newer than the guest's work (the
29022
+ * sign-up that followed it). Optional so a page from before the card and a
29023
+ * new server interchange.
29024
+ */
29025
+ "confirmed?": "boolean"
28982
29026
  })
28983
29027
  );
28984
29028
  guestAppPair = lazyType(() => type({ ownerHandle: "string", appSlug: "string" }));
@@ -29004,6 +29048,20 @@ var init_guest_principal = __esm({
29004
29048
  settled: "boolean"
29005
29049
  })
29006
29050
  );
29051
+ reqPreviewGuestClaim = lazyType(
29052
+ () => type({
29053
+ type: "'vibes.diy.req-preview-guest-claim'",
29054
+ auth: dashAuthType,
29055
+ guestToken: "string > 0"
29056
+ })
29057
+ );
29058
+ resPreviewGuestClaim = lazyType(
29059
+ () => type({
29060
+ type: "'vibes.diy.res-preview-guest-claim'",
29061
+ /** The guest's apps, oldest first, at the address they hold today. */
29062
+ apps: guestAppPair.array()
29063
+ })
29064
+ );
29007
29065
  reqMintGuestClaimHandoff = lazyType(
29008
29066
  () => type({
29009
29067
  type: "'vibes.diy.req-mint-guest-claim-handoff'",
@@ -30147,11 +30205,12 @@ var init_notifications = __esm({
30147
30205
  ownerHandle: "string",
30148
30206
  appSlug: "string | null",
30149
30207
  "counterpartHandle?": "string",
30150
- // Author-supplied text, carried ONLY for `app-message` and `team-message`
30151
- // (#9814, the team's own words) (a live-bell/push
30152
- // renderer has no template to derive copy from for that type, unlike every
30153
- // templated type here — see notificationTypeEnum's `app-message` doc).
30154
- // Omitted for every other type to keep their wire payload unchanged.
30208
+ // The persisted row's own `body`, carried for every durable emit since
30209
+ // #7470 (one source of copy: the live surfaces can say what the inbox
30210
+ // says). For `app-message` and `team-message` (#9814) it is the message
30211
+ // itself, with no template to fall back on; for the templated kinds the
30212
+ // web toast says it and the push ignores it.
30213
+ // Optional: an ephemeral event, or one from an older worker, has none.
30155
30214
  "body?": "string",
30156
30215
  // The `app-message` deep link — a vibe backend's `ctx.notify({ path })`. It
30157
30216
  // rides the live event so the LIVE channels (the browser bell and the APNs
@@ -32240,6 +32299,7 @@ var init_agent_reply_fold = __esm({
32240
32299
  init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process();
32241
32300
  init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console();
32242
32301
  init_performance2();
32302
+ init_esm();
32243
32303
  init_agent_reactions();
32244
32304
  init_agent_picture();
32245
32305
  init_agent_imessage();
@@ -32316,10 +32376,10 @@ var init_text_turn = __esm({
32316
32376
  "animation?": type.enumerated(...IMESSAGE_TEXT_ANIMATIONS)
32317
32377
  }).array(),
32318
32378
  "replyToNewest?": "boolean"
32319
- }).or({ kind: "'picture'", url: "string", mimeType: "string", "name?": "string", "sticker?": "true" }).or({ kind: "'picture-missed'" }).or({ kind: "'poll'", question: "string", options: "string[]" }).or({ kind: "'background'", "clear?": "true" })
32379
+ }).or({ kind: "'picture'", url: "string", mimeType: "string", "name?": "string", "sticker?": "true" }).or({ kind: "'picture-missed'", "reason?": "string", "tool?": "string" }).or({ kind: "'poll'", question: "string", options: "string[]" }).or({ kind: "'background'", "clear?": "true" })
32320
32380
  );
32321
32381
  textTurnLine = lazyType(
32322
- () => type({ "+": "reject", reply: foldedReplyWire }).or({ "+": "reject", done: "true", chatId: "string", "credits?": "number", "ownerHandle?": "string" }).or({ "+": "reject", error: "string", "detail?": "string" }).or({ "+": "reject", reaction: "string" }).or({ "+": "reject", confirm: { action: "'unpublish'", ownerHandle: "string", appSlug: "string" } }).or({ "+": "reject", copy: { ownerHandle: "string", appSlug: "string", remixOf: "string" } }).or({ "+": "reject", idle: "true", chatId: "string" })
32382
+ () => type({ "+": "reject", reply: foldedReplyWire }).or({ "+": "reject", done: "true", chatId: "string", "credits?": "number", "ownerHandle?": "string" }).or({ "+": "reject", error: "string", "detail?": "string" }).or({ "+": "reject", reaction: "string" }).or({ "+": "reject", confirm: { action: "'unpublish'", ownerHandle: "string", appSlug: "string" } }).or({ "+": "reject", copy: { ownerHandle: "string", appSlug: "string", remixOf: "string" } }).or({ "+": "reject", idle: "true", chatId: "string" }).or({ "+": "reject", ranAs: "string > 0" })
32323
32383
  );
32324
32384
  }
32325
32385
  });
@@ -35996,7 +36056,15 @@ var init_checkout_unfinished_msg = __esm({
35996
36056
  /** Same-origin path the buyer left from; where the notification links back to. */
35997
36057
  returnPath: "string",
35998
36058
  /** ISO instant the checkout started, stamped by the producer. */
35999
- at: "string"
36059
+ at: "string",
36060
+ /** True when the checkout started from a walled turn that re-fires on
36061
+ * return (#11711): only then does the row say a change is ready. Absent on
36062
+ * messages from before the field, and on every other start: "unknown",
36063
+ * which gets the line that is true for everyone. */
36064
+ "changeWaiting?": "boolean",
36065
+ /** Where the checkout was started, as `checkout_started` names it (e.g.
36066
+ * `account-card`), for log lines. */
36067
+ "source?": "string"
36000
36068
  })
36001
36069
  );
36002
36070
  CHECKOUT_UNFINISHED_DELAY_SECONDS = 30 * 60;
@@ -37627,7 +37695,13 @@ var init_billing_msg = __esm({
37627
37695
  "units?": "number",
37628
37696
  // Where Stripe returns the user post-checkout. Server-validated against an
37629
37697
  // own-origin allowlist (open-redirect guard) — foreign URLs are rejected.
37630
- successUrl: "string"
37698
+ successUrl: "string",
37699
+ // #11711: the checkout started from a walled turn that re-fires on return,
37700
+ // so a change really is waiting, and where the tap came from (the
37701
+ // `checkout_started` source). Both only shape the unfinished-checkout
37702
+ // reminder's sentence; absent from an older client.
37703
+ "changeWaiting?": "boolean",
37704
+ "source?": "string"
37631
37705
  })
37632
37706
  );
37633
37707
  reqBillingPortal = lazyType(
@@ -65363,6 +65437,17 @@ var init_hashing = __esm({
65363
65437
  }
65364
65438
  });
65365
65439
 
65440
+ // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/identity/cli-login-confirm-code.ts
65441
+ var init_cli_login_confirm_code = __esm({
65442
+ "../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/identity/cli-login-confirm-code.ts"() {
65443
+ "use strict";
65444
+ init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process();
65445
+ init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console();
65446
+ init_performance2();
65447
+ init_esm();
65448
+ }
65449
+ });
65450
+
65366
65451
  // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/identity/runtime/settled-once.ts
65367
65452
  function settledOnce(load) {
65368
65453
  let settled;
@@ -65513,6 +65598,7 @@ var init_identity2 = __esm({
65513
65598
  init_superthis();
65514
65599
  init_sts();
65515
65600
  init_hashing();
65601
+ init_cli_login_confirm_code();
65516
65602
  init_settled_once();
65517
65603
  init_wire();
65518
65604
  init_clerk_token();
@@ -98212,8 +98298,8 @@ async function emitNotification(qctx, input3) {
98212
98298
  ownerHandle: input3.ownerHandle,
98213
98299
  appSlug: input3.appSlug,
98214
98300
  ...input3.appSlug === null ? { counterpartHandle: input3.ownerHandle } : {},
98215
- // A team note's words are its copy too (#9814), so they ride the event.
98216
- ...input3.notificationType === "app-message" || input3.notificationType === "team-message" ? { body } : {},
98301
+ // The row's own words, for every kind (#7470; a team note's since #9814).
98302
+ body,
98217
98303
  ...isValidNotifyPath(livePath) ? { path: livePath } : {},
98218
98304
  ...isCheckoutReturnPath(checkoutPath) ? { path: checkoutPath } : {},
98219
98305
  ...buildFields,
@@ -129883,6 +129969,25 @@ var init_vibe_sibling_resolve = __esm({
129883
129969
  });
129884
129970
 
129885
129971
  // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/public/select-app.ts
129972
+ async function selectTopProductionRelease(vctx, req) {
129973
+ const rows = await vctx.sql.db.select({
129974
+ appSlug: vctx.sql.tables.apps.appSlug,
129975
+ userId: vctx.sql.tables.apps.userId,
129976
+ ownerHandle: vctx.sql.tables.apps.ownerHandle,
129977
+ releaseSeq: vctx.sql.tables.apps.releaseSeq,
129978
+ fsId: vctx.sql.tables.apps.fsId,
129979
+ mode: vctx.sql.tables.apps.mode,
129980
+ publishedChips: vctx.sql.tables.apps.publishedChips,
129981
+ created: vctx.sql.tables.apps.created
129982
+ }).from(vctx.sql.tables.apps).where(
129983
+ and(
129984
+ eq(vctx.sql.tables.apps.ownerHandle, req.ownerHandle),
129985
+ eq(vctx.sql.tables.apps.appSlug, req.appSlug),
129986
+ eq(vctx.sql.tables.apps.mode, "production")
129987
+ )
129988
+ ).orderBy(desc(vctx.sql.tables.apps.releaseSeq)).limit(1);
129989
+ return rows[0];
129990
+ }
129886
129991
  async function selectLatestAppPerSlug(vctx, req) {
129887
129992
  const maxCreatedSub = vctx.sql.db.select({ mode: vctx.sql.tables.apps.mode, maxCreated: max(vctx.sql.tables.apps.created).as("max_created") }).from(vctx.sql.tables.apps).where(and(eq(vctx.sql.tables.apps.ownerHandle, req.ownerHandle), eq(vctx.sql.tables.apps.appSlug, req.appSlug))).groupBy(vctx.sql.tables.apps.mode).as("mc");
129888
129993
  const rows = await vctx.sql.db.select({
@@ -129921,6 +130026,7 @@ var init_select_app = __esm({
129921
130026
  init_performance2();
129922
130027
  init_expressions();
129923
130028
  init_sql2();
130029
+ __name(selectTopProductionRelease, "selectTopProductionRelease");
129924
130030
  __name(selectLatestAppPerSlug, "selectLatestAppPerSlug");
129925
130031
  }
129926
130032
  });
@@ -130866,7 +130972,27 @@ var init_keepsake = __esm({
130866
130972
  description: "A thing people print, share or hand out \u2014 a ticket, invitation, menu, poster, certificate or place card: one framed artifact drawn by the skin in a fixed shape, with the look's components as its editing controls beside it, and a print style that prints only the artifact",
130867
130973
  cues: ["printable", "to print", "print out", "invitation card", "a poster", "certificate", "place card"],
130868
130974
  needs: ["reskin"],
130869
- rail: "reskin"
130975
+ rail: "reskin",
130976
+ medium: "print"
130977
+ };
130978
+ }
130979
+ });
130980
+
130981
+ // ../../home/runner/work/vibes.diy/vibes.diy/prompts/pkg/llms/business-paper.ts
130982
+ var businessPaperConfig;
130983
+ var init_business_paper = __esm({
130984
+ "../../home/runner/work/vibes.diy/vibes.diy/prompts/pkg/llms/business-paper.ts"() {
130985
+ "use strict";
130986
+ init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process();
130987
+ init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console();
130988
+ init_performance2();
130989
+ businessPaperConfig = {
130990
+ name: "business-paper",
130991
+ label: "Business paper",
130992
+ description: "Invoices, quotes, estimates, receipts, statements and monthly reports printed from the app's own records (jobs, clients, orders): one page per record with a letterhead, a for block, line items, subtotal, tax and total computed in plain code, a document number and date, and a Print or save as PDF button whose print style shows only the pages",
130993
+ cues: ["invoice", "invoices", "print a quote", "printable quote", "monthly statement", "monthly report", "save as a pdf", "save as pdf"],
130994
+ rail: "reskin",
130995
+ medium: "print"
130870
130996
  };
130871
130997
  }
130872
130998
  });
@@ -131677,7 +131803,7 @@ var init_access = __esm({
131677
131803
  });
131678
131804
 
131679
131805
  // ../../home/runner/work/vibes.diy/vibes.diy/prompts/pkg/llms/connections.ts
131680
- var connectionsConfig;
131806
+ var connectionsConfig, ACCOUNT_DATA_WORDS, ACCOUNT_DATA, ACCOUNT_SERVICE, OWN_ACCOUNT;
131681
131807
  var init_connections = __esm({
131682
131808
  "../../home/runner/work/vibes.diy/vibes.diy/prompts/pkg/llms/connections.ts"() {
131683
131809
  "use strict";
@@ -131711,6 +131837,18 @@ var init_connections = __esm({
131711
131837
  importModule: "use-vibes",
131712
131838
  importName: "useConnection"
131713
131839
  };
131840
+ ACCOUNT_DATA_WORDS = "(?:posts?|videos?|reels?|followers?|subscribers?|likes?|comments?|views?|stats|statistics|analytics|insights|metrics|engag\\w*|numbers|account|profile)";
131841
+ ACCOUNT_DATA = new RegExp(`\\b${ACCOUNT_DATA_WORDS}\\b`, "i");
131842
+ ACCOUNT_SERVICE = "(?:instagram|threads|linkedin)";
131843
+ OWN_ACCOUNT = new RegExp(
131844
+ [
131845
+ `\\bsocial[- ]media (?:log-?ins?|accounts?|sign-?ins?)\\b`,
131846
+ `\\b(?:my|our) (?:own )?${ACCOUNT_SERVICE}(?:'s)? (?:\\w+ )?${ACCOUNT_DATA_WORDS}\\b`,
131847
+ `\\b${ACCOUNT_DATA_WORDS} (?:\\w+ ){0,2}(?:on|from|in) (?:my|our) ${ACCOUNT_SERVICE}\\b`,
131848
+ `\\b(?:connect|sign in with|log ?in with) (?:my |our )?${ACCOUNT_SERVICE}\\b`
131849
+ ].join("|"),
131850
+ "i"
131851
+ );
131714
131852
  }
131715
131853
  });
131716
131854
 
@@ -133067,6 +133205,40 @@ var init_ui_testimonials = __esm({
133067
133205
  }
133068
133206
  });
133069
133207
 
133208
+ // ../../home/runner/work/vibes.diy/vibes.diy/prompts/pkg/llms/ui-quote.ts
133209
+ var uiQuoteConfig;
133210
+ var init_ui_quote = __esm({
133211
+ "../../home/runner/work/vibes.diy/vibes.diy/prompts/pkg/llms/ui-quote.ts"() {
133212
+ "use strict";
133213
+ init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process();
133214
+ init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console();
133215
+ init_performance2();
133216
+ uiQuoteConfig = {
133217
+ name: "ui-quote",
133218
+ aliases: ["pouf-quote"],
133219
+ label: "Quote block",
133220
+ description: "Quote or estimate page for a job priced by hand (detailer, cleaner, groomer, handyman): the owner's pasted price list as records, the customer picks options and sees a price range, sends a request with name and phone and no account, and gets a private link where the owner's answer shows: confirm a price and time, ask for a photo, or not this time"
133221
+ };
133222
+ }
133223
+ });
133224
+
133225
+ // ../../home/runner/work/vibes.diy/vibes.diy/prompts/pkg/llms/spreadsheet-import.ts
133226
+ var spreadsheetImportConfig;
133227
+ var init_spreadsheet_import = __esm({
133228
+ "../../home/runner/work/vibes.diy/vibes.diy/prompts/pkg/llms/spreadsheet-import.ts"() {
133229
+ "use strict";
133230
+ init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process();
133231
+ init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console();
133232
+ init_performance2();
133233
+ spreadsheetImportConfig = {
133234
+ name: "spreadsheet-import",
133235
+ label: "Spreadsheet import",
133236
+ description: "Bring a CSV or TSV file (exported from Excel, Numbers or Google Sheets) into the app as one record per row: the person picks the file, a mapping step shows the first five rows with a guessed field per column they can change and the key column that matches rows, rows are written in batches with a progress count, importing the same file again updates rows and adds none twice, the result says how many were added, updated and skipped and why, and each imported row belongs to its importer or to the person a chosen column names. Use for importing an existing list of clients, contacts, jobs, stock or members from a spreadsheet; a short list typed or pasted into a form does not need it",
133237
+ cues: ["csv", "tsv", "spreadsheet", "import my", "excel", "google sheet", "google sheets"]
133238
+ };
133239
+ }
133240
+ });
133241
+
133070
133242
  // ../../home/runner/work/vibes.diy/vibes.diy/prompts/pkg/llms/cues.ts
133071
133243
  var init_cues = __esm({
133072
133244
  "../../home/runner/work/vibes.diy/vibes.diy/prompts/pkg/llms/cues.ts"() {
@@ -133088,7 +133260,7 @@ var init_needs = __esm({
133088
133260
  });
133089
133261
 
133090
133262
  // ../../home/runner/work/vibes.diy/vibes.diy/prompts/pkg/llms/index.ts
133091
- var allConfigs, SKILL_ALIASES, SKILL_CATALOG_EPOCH;
133263
+ var allConfigs, PLATFORM_KEYED_SKILLS, SKILL_ALIASES, SKILL_CATALOG_EPOCH;
133092
133264
  var init_llms = __esm({
133093
133265
  "../../home/runner/work/vibes.diy/vibes.diy/prompts/pkg/llms/index.ts"() {
133094
133266
  "use strict";
@@ -133108,6 +133280,7 @@ var init_llms = __esm({
133108
133280
  init_third_party_embed();
133109
133281
  init_weather();
133110
133282
  init_keepsake();
133283
+ init_business_paper();
133111
133284
  init_occasion();
133112
133285
  init_callai();
133113
133286
  init_fireproof();
@@ -133185,6 +133358,8 @@ var init_llms = __esm({
133185
133358
  init_ui_landing();
133186
133359
  init_ui_calendar();
133187
133360
  init_ui_testimonials();
133361
+ init_ui_quote();
133362
+ init_spreadsheet_import();
133188
133363
  init_backend();
133189
133364
  init_calendar();
133190
133365
  init_board_games();
@@ -133197,6 +133372,7 @@ var init_llms = __esm({
133197
133372
  init_third_party_embed();
133198
133373
  init_weather();
133199
133374
  init_keepsake();
133375
+ init_business_paper();
133200
133376
  init_occasion();
133201
133377
  init_callai();
133202
133378
  init_fireproof();
@@ -133274,6 +133450,8 @@ var init_llms = __esm({
133274
133450
  init_ui_landing();
133275
133451
  init_ui_calendar();
133276
133452
  init_ui_testimonials();
133453
+ init_ui_quote();
133454
+ init_spreadsheet_import();
133277
133455
  init_cues();
133278
133456
  init_needs();
133279
133457
  init_maps();
@@ -133370,6 +133548,14 @@ var init_llms = __esm({
133370
133548
  worldsConfig,
133371
133549
  motionConfig,
133372
133550
  richtextConfig,
133551
+ // The second print surface (#11600): paper from the app's records, borrowing the keepsake's
133552
+ // print-only approach. Plain elements the kit frames, so it is on every look's menu, and it sits
133553
+ // ahead of the look-owned run (reskin through the ui-* blocks): a row between them would split the
133554
+ // house menu inside the mint menu, which must carry it whole (builder-brief-parity.test.ts).
133555
+ businessPaperConfig,
133556
+ // A CSV or TSV file in as one record per row, parsed in the page, keyed for a repeat import (#11602).
133557
+ // On every look's menu, so it too sits ahead of the look-owned run (see business-paper above).
133558
+ spreadsheetImportConfig,
133373
133559
  // The two look-appearance skills (#7906), side by side so the menu reads them as a fork:
133374
133560
  // `reskin` keeps the look's components and changes their appearance; `match-style` digests a
133375
133561
  // style the person brings and replaces them.
@@ -133408,8 +133594,13 @@ var init_llms = __esm({
133408
133594
  uiQuizConfig,
133409
133595
  uiLandingConfig,
133410
133596
  uiCalendarConfig,
133411
- uiTestimonialsConfig
133597
+ uiTestimonialsConfig,
133598
+ // Written for this catalog, not ported: a quote page priced by hand, with a signed-out request route.
133599
+ uiQuoteConfig
133412
133600
  ];
133601
+ PLATFORM_KEYED_SKILLS = new Set(
133602
+ allConfigs.filter((c2) => c2.credential === "platform" || c2.credential === "visitor-connection").map((c2) => c2.name)
133603
+ );
133413
133604
  SKILL_ALIASES = new Map(
133414
133605
  allConfigs.flatMap((c2) => (c2.aliases ?? []).map((alias) => [alias, c2.name]))
133415
133606
  );
@@ -139574,6 +139765,65 @@ var init_app_settings_suggestion_bless = __esm({
139574
139765
  }
139575
139766
  });
139576
139767
 
139768
+ // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/moderation-gate.ts
139769
+ function memoFor(vctx) {
139770
+ const key = vctx.sql.db;
139771
+ let m2 = memos.get(key);
139772
+ if (m2 === void 0) {
139773
+ m2 = /* @__PURE__ */ new Map();
139774
+ memos.set(key, m2);
139775
+ }
139776
+ return m2;
139777
+ }
139778
+ async function memoized(vctx, { key, now: now2, read: read2 }) {
139779
+ const memo2 = memoFor(vctx);
139780
+ const hit = memo2.get(key);
139781
+ if (hit !== void 0 && now2 - hit.at < MEMO_TTL_MS) return hit.value;
139782
+ const r2 = await exception2Result(read2);
139783
+ if (r2.isErr()) {
139784
+ ensureLogger(vctx.sthis, "moderationGate").Warn().Err(r2.Err()).Str("key", key).Msg("moderation gate read failed; answering open");
139785
+ return false;
139786
+ }
139787
+ memo2.set(key, { value: r2.Ok(), at: now2 });
139788
+ return r2.Ok();
139789
+ }
139790
+ function isAccountSuspended(vctx, userId, now2 = Date.now()) {
139791
+ if (userId === "") return Promise.resolve(false);
139792
+ const t3 = vctx.sql.tables.accountSuspensions;
139793
+ return memoized(vctx, {
139794
+ key: `suspended:${userId}`,
139795
+ now: now2,
139796
+ read: /* @__PURE__ */ __name(async () => {
139797
+ const row = await vctx.sql.db.select({ suspended: t3.suspended }).from(t3).where(eq(t3.userId, userId)).limit(1).then((r2) => r2[0]);
139798
+ return row !== void 0 && row.suspended === 1;
139799
+ }, "read")
139800
+ });
139801
+ }
139802
+ async function servesNeutralPage(vctx, args2) {
139803
+ if (args2.viewerUserId !== void 0 && args2.viewerUserId === args2.ownerUserId) return false;
139804
+ if (args2.viewerUserId !== void 0 && adminUserIdSet(vctx).has(args2.viewerUserId)) return false;
139805
+ return isAccountSuspended(vctx, args2.ownerUserId, args2.now ?? Date.now());
139806
+ }
139807
+ var MEMO_TTL_MS, memos;
139808
+ var init_moderation_gate = __esm({
139809
+ "../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/moderation-gate.ts"() {
139810
+ "use strict";
139811
+ init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process();
139812
+ init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console();
139813
+ init_performance2();
139814
+ init_esm();
139815
+ init_expressions();
139816
+ init_identity2();
139817
+ init_admin_allowlist();
139818
+ MEMO_TTL_MS = 3e4;
139819
+ memos = /* @__PURE__ */ new WeakMap();
139820
+ __name(memoFor, "memoFor");
139821
+ __name(memoized, "memoized");
139822
+ __name(isAccountSuspended, "isAccountSuspended");
139823
+ __name(servesNeutralPage, "servesNeutralPage");
139824
+ }
139825
+ });
139826
+
139577
139827
  // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/public/developer-grants.ts
139578
139828
  async function currentUserIdForHandle(vctx, handle) {
139579
139829
  const row = await vctx.sql.db.select({ userId: vctx.sql.tables.handleBinding.userId }).from(vctx.sql.tables.handleBinding).where(eq(vctx.sql.tables.handleBinding.handle, handle)).limit(1).then((rows) => rows[0]);
@@ -139598,7 +139848,9 @@ async function resolveDeveloperAccess(vctx, { ownerHandle, appSlug, callerUserId
139598
139848
  eq(vctx.sql.tables.developerGrants.userId, currentOwnerUserId)
139599
139849
  )
139600
139850
  ).limit(1).then((rows) => rows[0]);
139601
- return row === void 0 ? null : { devHandle: row.devHandle };
139851
+ if (row === void 0) return null;
139852
+ if (await servesNeutralPage(vctx, { ownerUserId: currentOwnerUserId, viewerUserId: callerUserId })) return null;
139853
+ return { devHandle: row.devHandle };
139602
139854
  }
139603
139855
  async function resolveDeveloperHandles(vctx, { ownerHandle, appSlug }) {
139604
139856
  if (isDirectChannel(ownerHandle)) return [];
@@ -139628,6 +139880,7 @@ var init_developer_grants = __esm({
139628
139880
  init_performance2();
139629
139881
  init_types4();
139630
139882
  init_expressions();
139883
+ init_moderation_gate();
139631
139884
  __name(currentUserIdForHandle, "currentUserIdForHandle");
139632
139885
  __name(resolveDeveloperAccess, "resolveDeveloperAccess");
139633
139886
  __name(resolveDeveloperHandles, "resolveDeveloperHandles");
@@ -139667,7 +139920,7 @@ async function ensureLegacyAnonWriteStamped(args2) {
139667
139920
  const key = JSON.stringify([ownerHandle, appSlug]);
139668
139921
  const last = perDb.get(key);
139669
139922
  const now2 = Date.now();
139670
- if (last !== void 0 && now2 - last < MEMO_TTL_MS) return void 0;
139923
+ if (last !== void 0 && now2 - last < MEMO_TTL_MS2) return void 0;
139671
139924
  const r2 = await exception2Result(() => stamp(vctx, ownerHandle, appSlug));
139672
139925
  if (r2.isErr()) {
139673
139926
  console.warn(`anonWrite legacy stamp failed for ${ownerHandle}/${appSlug}:`, r2.Err());
@@ -139687,7 +139940,7 @@ async function stamp(vctx, ownerHandle, appSlug) {
139687
139940
  if (after === void 0) throw new Error("anonWrite legacy stamp reported success but stored nothing");
139688
139941
  return after;
139689
139942
  }
139690
- var ANON_WRITE_LEGACY_CUTOFF_ISO, MEMO_TTL_MS, checked;
139943
+ var ANON_WRITE_LEGACY_CUTOFF_ISO, MEMO_TTL_MS2, checked;
139691
139944
  var init_anon_write_legacy_sweep = __esm({
139692
139945
  "../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/public/anon-write-legacy-sweep.ts"() {
139693
139946
  "use strict";
@@ -139700,7 +139953,7 @@ var init_anon_write_legacy_sweep = __esm({
139700
139953
  init_app_setting_items();
139701
139954
  init_app_settings_sql_upsert();
139702
139955
  ANON_WRITE_LEGACY_CUTOFF_ISO = "2026-09-30T00:00:00.000Z";
139703
- MEMO_TTL_MS = 5 * 60 * 1e3;
139956
+ MEMO_TTL_MS2 = 5 * 60 * 1e3;
139704
139957
  checked = /* @__PURE__ */ new WeakMap();
139705
139958
  __name(legacyAnonWriteSnapshotVerdict, "legacyAnonWriteSnapshotVerdict");
139706
139959
  __name(appBindsAnyAccessFn, "appBindsAnyAccessFn");
@@ -140170,8 +140423,8 @@ var init_agent_session_instruction = __esm({
140170
140423
  init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console();
140171
140424
  init_performance2();
140172
140425
  init_types4();
140173
- AGENT_SESSION_INSTRUCTION_VERSION = "2026-11-30.2";
140174
- BROWSER_APP_ASK_LINE = 'When the ask names a desktop program, a phone app or software to install (an iPhone, iPad or Android app, or a mobile app, is a phone app), the app is made as one that opens from its own link, and those words say so in a clause: "Making your <app> as an app that opens in your browser", or for a phone app "Making your <app> as an app that opens on your phone from its own link".';
140426
+ AGENT_SESSION_INSTRUCTION_VERSION = "2026-12-01.6";
140427
+ BROWSER_APP_ASK_LINE = `When the ask names a desktop program, a phone app or software to install (an iPhone, iPad or Android app, or a mobile app, is a phone app), or a server stack to run on their own machine (Python, FastAPI, Flask, Django, Rails or Node, started with uvicorn or at localhost, storing in SQLite or Postgres), the app is made as one that opens from its own link, and those words say so in a clause: "Making your <app> as an app that opens in your browser", or for a phone app "Making your <app> as an app that opens on your phone from its own link". The stack's words give way to what the app does, with its records kept by the app itself.`;
140175
140428
  FIRST_BUILD_SAYS_WHAT_IS_MADE = `On a first build, the words before create_vibe say what will be made in the person's terms, and a control they mention is one the brief asks for. ${BROWSER_APP_ASK_LINE}`;
140176
140429
  REPLY_FOLD = `A reply that runs past about three short sentences, as one often does after tool calls or a build, opens with a summary of one or two plain sentences that stands on its own: what happened, and the one link or question that matters most. Then comes a line holding only ${AGENT_FOLD_MARKER}, then the full reply, shaped by every rule here. The summary is what a phone receives as a text message, and the web page shows the full reply under a More button, so the summary carries that link or question itself. A reply of three short sentences or fewer is its own summary and goes out whole, just as it is. Words written before a tool call go out as their own text the moment the call starts, so keep them to one short sentence of what you are about to do; the result comes in the reply after.`;
140177
140430
  }
@@ -142870,7 +143123,7 @@ var init_agent_stop_note = __esm({
142870
143123
  });
142871
143124
 
142872
143125
  // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/agent-settled-history.ts
142873
- var SETTLE_BATCH_TURNS, LIVE_TURNS_MAX, SETTLED_HISTORY_PREFIX, SETTLED_HISTORY_HEADER, JOURNAL_CACHE_TTL_MS;
143126
+ var SETTLE_BATCH_TURNS, LIVE_TURNS_MAX, SETTLED_HISTORY_PREFIX, SETTLED_HISTORY_HEADER, AGENT_RESUME_WAKE_NOTE, AGENT_BUILDS_ENDED_WAKE_NOTE, JOURNAL_CACHE_TTL_MS;
142874
143127
  var init_agent_settled_history = __esm({
142875
143128
  "../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/agent-settled-history.ts"() {
142876
143129
  "use strict";
@@ -142885,6 +143138,8 @@ var init_agent_settled_history = __esm({
142885
143138
  LIVE_TURNS_MAX = 2 * SETTLE_BATCH_TURNS;
142886
143139
  SETTLED_HISTORY_PREFIX = "[settled history]";
142887
143140
  SETTLED_HISTORY_HEADER = `${SETTLED_HISTORY_PREFIX} The earlier turns of this conversation follow in settled form: each keeps the person's words exactly and your final reply, then lists the tools you called and the versions you saved, one line each. The full turns after them are as they happened. For anything you need from earlier work \u2014 a file, a picture, a setting \u2014 read the app as it is now.`;
143141
+ AGENT_RESUME_WAKE_NOTE = "Resume the persisted agent session.";
143142
+ AGENT_BUILDS_ENDED_WAKE_NOTE = `${AGENT_RESUME_WAKE_NOTE} Every build you dispatched reached its own ending, and its result follows. For the person this conversation ran straight through: reply as the ordinary close of that build, telling them in their words what its result reports.`;
142888
143143
  JOURNAL_CACHE_TTL_MS = 5 * 6e4;
142889
143144
  }
142890
143145
  });
@@ -144390,7 +144645,7 @@ async function ensureLegacyCommentsMigrated(vctx, ownerHandle, appSlug) {
144390
144645
  const key = memoKey(ownerHandle, appSlug);
144391
144646
  const last = perDb.get(key);
144392
144647
  const now2 = Date.now();
144393
- if (last !== void 0 && now2 - last < MEMO_TTL_MS2) return;
144648
+ if (last !== void 0 && now2 - last < MEMO_TTL_MS3) return;
144394
144649
  const r2 = await exception2Result(() => migrate(vctx, ownerHandle, appSlug));
144395
144650
  if (r2.isErr()) {
144396
144651
  console.warn(`comments migration failed for ${ownerHandle}/${appSlug}:`, r2.Err());
@@ -144553,7 +144808,7 @@ async function moveStoredPin({
144553
144808
  }
144554
144809
  await ensureSettings(vctx, { ...read2, dbAclRemove: { dbName: LEGACY_COMMENTS_DB_NAME } }, ownerRow.userId);
144555
144810
  }
144556
- var MEMO_TTL_MS2, checked2;
144811
+ var MEMO_TTL_MS3, checked2;
144557
144812
  var init_platform_comments_migration = __esm({
144558
144813
  "../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/public/platform-comments-migration.ts"() {
144559
144814
  "use strict";
@@ -144568,7 +144823,7 @@ var init_platform_comments_migration = __esm({
144568
144823
  init_ensure_app_settings();
144569
144824
  init_viewer_channel_resolver();
144570
144825
  init_platform_db_registry();
144571
- MEMO_TTL_MS2 = 5 * 60 * 1e3;
144826
+ MEMO_TTL_MS3 = 5 * 60 * 1e3;
144572
144827
  checked2 = /* @__PURE__ */ new WeakMap();
144573
144828
  __name(memoKey, "memoKey");
144574
144829
  __name(ensureLegacyCommentsMigrated, "ensureLegacyCommentsMigrated");
@@ -152769,6 +153024,19 @@ var init_is_unique_violation = __esm({
152769
153024
  }
152770
153025
  });
152771
153026
 
153027
+ // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/history-section-msgs.ts
153028
+ var init_history_section_msgs = __esm({
153029
+ "../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/history-section-msgs.ts"() {
153030
+ "use strict";
153031
+ init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process();
153032
+ init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console();
153033
+ init_performance2();
153034
+ init_out4();
153035
+ init_types4();
153036
+ init_v2();
153037
+ }
153038
+ });
153039
+
152772
153040
  // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/open-turn-sweep.ts
152773
153041
  var init_open_turn_sweep = __esm({
152774
153042
  "../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/open-turn-sweep.ts"() {
@@ -152787,6 +153055,7 @@ var init_open_turn_sweep = __esm({
152787
153055
  init_build_ledger_store();
152788
153056
  init_guest_app_move();
152789
153057
  init_is_unique_violation();
153058
+ init_history_section_msgs();
152790
153059
  }
152791
153060
  });
152792
153061
 
@@ -153090,65 +153359,6 @@ var init_guest_principal_store = __esm({
153090
153359
  }
153091
153360
  });
153092
153361
 
153093
- // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/moderation-gate.ts
153094
- function memoFor(vctx) {
153095
- const key = vctx.sql.db;
153096
- let m2 = memos.get(key);
153097
- if (m2 === void 0) {
153098
- m2 = /* @__PURE__ */ new Map();
153099
- memos.set(key, m2);
153100
- }
153101
- return m2;
153102
- }
153103
- async function memoized(vctx, { key, now: now2, read: read2 }) {
153104
- const memo2 = memoFor(vctx);
153105
- const hit = memo2.get(key);
153106
- if (hit !== void 0 && now2 - hit.at < MEMO_TTL_MS3) return hit.value;
153107
- const r2 = await exception2Result(read2);
153108
- if (r2.isErr()) {
153109
- ensureLogger(vctx.sthis, "moderationGate").Warn().Err(r2.Err()).Str("key", key).Msg("moderation gate read failed; answering open");
153110
- return false;
153111
- }
153112
- memo2.set(key, { value: r2.Ok(), at: now2 });
153113
- return r2.Ok();
153114
- }
153115
- function isAccountSuspended(vctx, userId, now2 = Date.now()) {
153116
- if (userId === "") return Promise.resolve(false);
153117
- const t3 = vctx.sql.tables.accountSuspensions;
153118
- return memoized(vctx, {
153119
- key: `suspended:${userId}`,
153120
- now: now2,
153121
- read: /* @__PURE__ */ __name(async () => {
153122
- const row = await vctx.sql.db.select({ suspended: t3.suspended }).from(t3).where(eq(t3.userId, userId)).limit(1).then((r2) => r2[0]);
153123
- return row !== void 0 && row.suspended === 1;
153124
- }, "read")
153125
- });
153126
- }
153127
- async function servesNeutralPage(vctx, args2) {
153128
- if (args2.viewerUserId !== void 0 && args2.viewerUserId === args2.ownerUserId) return false;
153129
- if (args2.viewerUserId !== void 0 && adminUserIdSet(vctx).has(args2.viewerUserId)) return false;
153130
- return isAccountSuspended(vctx, args2.ownerUserId, args2.now ?? Date.now());
153131
- }
153132
- var MEMO_TTL_MS3, memos;
153133
- var init_moderation_gate = __esm({
153134
- "../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/moderation-gate.ts"() {
153135
- "use strict";
153136
- init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process();
153137
- init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console();
153138
- init_performance2();
153139
- init_esm();
153140
- init_expressions();
153141
- init_identity2();
153142
- init_admin_allowlist();
153143
- MEMO_TTL_MS3 = 3e4;
153144
- memos = /* @__PURE__ */ new WeakMap();
153145
- __name(memoFor, "memoFor");
153146
- __name(memoized, "memoized");
153147
- __name(isAccountSuspended, "isAccountSuspended");
153148
- __name(servesNeutralPage, "servesNeutralPage");
153149
- }
153150
- });
153151
-
153152
153362
  // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/inception-direct.ts
153153
153363
  function isInceptionModel(model) {
153154
153364
  return typeof model === "string" && model.startsWith(PREFIX);
@@ -158262,6 +158472,24 @@ function latestDocs(revisions, opts = {}) {
158262
158472
  }
158263
158473
  return out;
158264
158474
  }
158475
+ function isTestCrew(data2) {
158476
+ const name = typeof data2.name === "string" ? data2.name : "";
158477
+ const venue = typeof data2.venue === "string" ? data2.venue : "";
158478
+ return /^qa crew/i.test(name) || venue.startsWith("qa-") || data2.seed === true;
158479
+ }
158480
+ function isTestDinner(data2) {
158481
+ const name = typeof data2.name === "string" ? data2.name : "";
158482
+ return /^qa dinner/i.test(name) || data2.armPinned === true;
158483
+ }
158484
+ function isTestTrip(data2) {
158485
+ const name = typeof data2.name === "string" ? data2.name : "";
158486
+ return data2.qa === true || /^qa\b/i.test(name);
158487
+ }
158488
+ function isTestLeague(data2) {
158489
+ const name = typeof data2.name === "string" ? data2.name : "";
158490
+ const root = typeof data2.root === "string" ? data2.root : "";
158491
+ return /^qa league/i.test(name) || /^(ff-)?qa-/.test(root) || data2.seed === true;
158492
+ }
158265
158493
  function timeOf(v3) {
158266
158494
  if (typeof v3 === "number" && Number.isFinite(v3) && v3 > 0) return new Date(v3).toISOString();
158267
158495
  if (typeof v3 === "string" && Number.isFinite(Date.parse(v3))) return new Date(Date.parse(v3)).toISOString();
@@ -158270,8 +158498,14 @@ function timeOf(v3) {
158270
158498
  function recordsEdges({
158271
158499
  config: config3,
158272
158500
  revisions,
158273
- excluded = NOBODY
158501
+ excluded = NOBODY,
158502
+ includeTestGroups = false
158274
158503
  }) {
158504
+ const isTestGroup = config3.isTestGroup;
158505
+ function counted(d2) {
158506
+ return includeTestGroups || isTestGroup === void 0 || isTestGroup(d2.data) === false;
158507
+ }
158508
+ __name(counted, "counted");
158275
158509
  const contribDb = config3.contribDbName ?? config3.dbName;
158276
158510
  const prefix = config3.groupDbPrefix;
158277
158511
  const inContribDb = /* @__PURE__ */ __name((dbName) => prefix === void 0 ? dbName === contribDb : dbName.startsWith(prefix), "inContribDb");
@@ -158316,7 +158550,7 @@ function recordsEdges({
158316
158550
  return (config3.activatedAtField === void 0 ? void 0 : timeOf(d2.data[config3.activatedAtField])) ?? d2.created;
158317
158551
  }
158318
158552
  __name(flagActivatedAt, "flagActivatedAt");
158319
- const groups = docs.filter((d2) => inGroupDb(d2.dbName) && d2.data.type === config3.groupType).map((d2) => {
158553
+ const groups = docs.filter((d2) => inGroupDb(d2.dbName) && d2.data.type === config3.groupType && counted(d2)).map((d2) => {
158320
158554
  const groupKey = prefix === void 0 ? str(d2.data._id) ?? d2.docId : d2.dbName.slice(prefix.length);
158321
158555
  const parent = str(d2.data[config3.parentField]);
158322
158556
  return {
@@ -158366,6 +158600,10 @@ var init_web_r_util = __esm({
158366
158600
  __name(docKey, "docKey");
158367
158601
  __name(latestDocs, "latestDocs");
158368
158602
  NOBODY = /* @__PURE__ */ new Set();
158603
+ __name(isTestCrew, "isTestCrew");
158604
+ __name(isTestDinner, "isTestDinner");
158605
+ __name(isTestTrip, "isTestTrip");
158606
+ __name(isTestLeague, "isTestLeague");
158369
158607
  __name(timeOf, "timeOf");
158370
158608
  __name(recordsEdges, "recordsEdges");
158371
158609
  EXPERIMENTS = {
@@ -158404,7 +158642,32 @@ var init_web_r_util = __esm({
158404
158642
  contribType: "seat",
158405
158643
  groupField: "crewId",
158406
158644
  personField: "pk",
158407
- countParentsFromDepth: 0
158645
+ countParentsFromDepth: 0,
158646
+ isTestGroup: isTestCrew
158647
+ },
158648
+ // Kickoff Picks (#11558; traction playbooks/group-spread-research-2026-11-30.md, buy 3): league
158649
+ // mates make no-stakes picks for one game. Leagues and their private pick seats sit in db
158650
+ // `leagues`, all written by the app's backend for signed-out players (a pick's `pk` is a hashed
158651
+ // per-browser key). A league completes at 3 pickers, the disagreement reveal. "Captain your
158652
+ // other league" starts a child (`via: "captain"`, `parentLeagueId`). The root field is the
158653
+ // placement (`root`, an `ff-<placement>` campaign) that a child keeps from its parent, so the
158654
+ // report's root rows are per placement; a league with none falls back to its root league.
158655
+ "kickoff-picks": {
158656
+ kind: "records",
158657
+ experiment: "kickoff-picks",
158658
+ ownerHandle: "jchris",
158659
+ appSlug: "kickoff-picks",
158660
+ dbName: "leagues",
158661
+ groupType: "league",
158662
+ parentField: "parentLeagueId",
158663
+ rootField: "root",
158664
+ activatedField: "complete",
158665
+ activatedAtField: "completedAt",
158666
+ contribType: "pick",
158667
+ groupField: "leagueId",
158668
+ personField: "pk",
158669
+ countParentsFromDepth: 0,
158670
+ isTestGroup: isTestLeague
158408
158671
  },
158409
158672
  // Table Cast (traction cells/c-2659-us-table-cast-01.md): tables and seats in one db. Only a
158410
158673
  // table's owner writes the table doc, so activation is derived: host and two guests seated
@@ -158423,6 +158686,49 @@ var init_web_r_util = __esm({
158423
158686
  groupField: "tableId",
158424
158687
  personField: "authorHandle",
158425
158688
  countParentsFromDepth: 0
158689
+ },
158690
+ // Holiday Potluck (vibes.diy#11607): nobody signs in, and only the backend writes, so a person is
158691
+ // the hash of a per-browser key (`bk`) on each `act` (the host's "start" included), and activation
158692
+ // is derived: host and two browsers acting within 48h. "Use this list for my next party" boards
158693
+ // carry `parentBoardId` and their lineage's `rootBoardId`.
158694
+ "holiday-potluck": {
158695
+ kind: "records",
158696
+ experiment: "holiday-potluck",
158697
+ ownerHandle: "og",
158698
+ appSlug: "holiday-potluck",
158699
+ dbName: "crew",
158700
+ groupType: "board",
158701
+ parentField: "parentBoardId",
158702
+ rootField: "rootBoardId",
158703
+ derivedActivation: { minPeople: 3, windowHours: 48 },
158704
+ contribType: "act",
158705
+ groupField: "boardId",
158706
+ personField: "bk",
158707
+ countParentsFromDepth: 0,
158708
+ isTestGroup: isTestDinner
158709
+ },
158710
+ // Family Get-Together (seasonal lab experiment `family-trip-season`): a family's trip or holiday
158711
+ // visit on one link, planned by talking to it and changed by text. Nobody signs in on the page and
158712
+ // only the backend writes, so a person is the hash of a per-browser key (`bk`), or of a texter's
158713
+ // handle, on each `act` (the host's "start" included). Activation is derived: host and two people
158714
+ // acting within 48h. "Start your own get-together" from a trip carries `parentTripId` and the
158715
+ // lineage's `rootTripId`. Friend acted (the first non-host act inside 48h) is its `friend:<trip>`
158716
+ // record, one per trip. QA trips and their whole lineage carry `qa: true` (isTestTrip).
158717
+ "family-get-together": {
158718
+ kind: "records",
158719
+ experiment: "family-get-together",
158720
+ ownerHandle: "og",
158721
+ appSlug: "family-get-together",
158722
+ dbName: "trip",
158723
+ groupType: "trip",
158724
+ parentField: "parentTripId",
158725
+ rootField: "rootTripId",
158726
+ derivedActivation: { minPeople: 3, windowHours: 48 },
158727
+ contribType: "act",
158728
+ groupField: "tripId",
158729
+ personField: "bk",
158730
+ countParentsFromDepth: 0,
158731
+ isTestGroup: isTestTrip
158426
158732
  }
158427
158733
  };
158428
158734
  }
@@ -158520,9 +158826,12 @@ function groupState({
158520
158826
  excluded
158521
158827
  }) {
158522
158828
  const c2 = match4.live.config;
158523
- const edge = recordsEdges({ config: c2, revisions, ...excluded === void 0 ? {} : { excluded } }).find(
158524
- (e2) => e2.groupKey === match4.groupKey
158525
- );
158829
+ const edge = recordsEdges({
158830
+ config: c2,
158831
+ revisions,
158832
+ includeTestGroups: true,
158833
+ ...excluded === void 0 ? {} : { excluded }
158834
+ }).find((e2) => e2.groupKey === match4.groupKey);
158526
158835
  const docs = latestDocs(revisions, { keepDeleted: true });
158527
158836
  const groupDoc = docs.find(
158528
158837
  (d2) => d2.data.type === c2.groupType && (c2.groupDbPrefix !== void 0 ? true : d2.dbName === c2.dbName && (str2(d2.data._id) ?? d2.docId) === match4.groupKey)
@@ -158537,10 +158846,11 @@ function isSeedGroup(match4, groupDoc) {
158537
158846
  if (key === "sample" || key.startsWith("t-example-")) return true;
158538
158847
  const data2 = groupDoc.data;
158539
158848
  if (data2.example === true) return true;
158849
+ if (match4.live.config.isTestGroup?.(data2) === true) return true;
158540
158850
  const kit = str2(data2.kit);
158541
158851
  if (kit !== void 0 && kit !== "") return true;
158542
158852
  const name = str2(data2[match4.live.shape.nameField]) ?? "";
158543
- return /^\s*qa crew/i.test(name);
158853
+ return /^\s*qa (crew|league)/i.test(name);
158544
158854
  }
158545
158855
  function isRealWriter(id) {
158546
158856
  return id !== void 0 && id !== "" && id !== "unknown";
@@ -158623,7 +158933,9 @@ var init_web_group_live = __esm({
158623
158933
  LIVE_GROUP_SHAPES = {
158624
158934
  "gift-circles": { groupDocId: "circle", nameField: "title" },
158625
158935
  "crew-challenge": { contribDocIdPrefix: "seat:", captain: { field: "captain", handleField: "handle" }, nameField: "name" },
158626
- "table-cast": { contribDocIdPrefix: "seat:", nameField: "name" }
158936
+ "table-cast": { contribDocIdPrefix: "seat:", nameField: "name" },
158937
+ // Kickoff Picks (#11558): Crew Challenge's shape, with `pick:<league>:<pk>` seats written by its backend.
158938
+ "kickoff-picks": { contribDocIdPrefix: "pick:", captain: { field: "captain", handleField: "handle" }, nameField: "name" }
158627
158939
  };
158628
158940
  __name(liveExperiments, "liveExperiments");
158629
158941
  LIVE_EXPERIMENTS = liveExperiments();
@@ -158646,6 +158958,214 @@ var init_web_group_live = __esm({
158646
158958
  }
158647
158959
  });
158648
158960
 
158961
+ // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/picture-recapture.ts
158962
+ function isMediaDb(dbName) {
158963
+ return dbName.startsWith(MEDIA_DB_PREFIX);
158964
+ }
158965
+ function pictureRecaptureDepsOfSvc(vctx) {
158966
+ return {
158967
+ sql: vctx.sql,
158968
+ postQueue: /* @__PURE__ */ __name((msg, opts) => vctx.postQueue(msg, opts), "postQueue"),
158969
+ entryPoint: vctx.params.vibes.svc,
158970
+ wrapperBaseUrl: vctx.params.vibes.env.VIBES_DIY_PUBLIC_BASE_URL
158971
+ };
158972
+ }
158973
+ function coalesceKey(app) {
158974
+ return `${app.ownerHandle}/${app.appSlug}`;
158975
+ }
158976
+ function isCoalesced(key, now2) {
158977
+ const last = lastEnqueued.get(key);
158978
+ return last !== void 0 && now2 - last < PICTURE_RECAPTURE_DELAY_SECONDS * 1e3;
158979
+ }
158980
+ function tryClaim(key, now2) {
158981
+ if (isCoalesced(key, now2)) return false;
158982
+ if (lastEnqueued.size >= COALESCE_MAX_ENTRIES) lastEnqueued.clear();
158983
+ lastEnqueued.set(key, now2);
158984
+ return true;
158985
+ }
158986
+ function releaseClaim(key, now2) {
158987
+ if (lastEnqueued.get(key) === now2) lastEnqueued.delete(key);
158988
+ }
158989
+ function hasStoredShot(meta3) {
158990
+ const { filtered } = parseArrayWarning(meta3, MetaItem);
158991
+ return filtered.some((item) => isMetaMobileScreenShot(item) || isMetaScreenShot(item));
158992
+ }
158993
+ async function requestPictureRecapture(deps, app, reason) {
158994
+ const key = coalesceKey(app);
158995
+ const now2 = (deps.now ?? Date.now)();
158996
+ if (!tryClaim(key, now2)) return "coalesced";
158997
+ const rShot = await exception2Result(async () => {
158998
+ const release4 = await selectTopProductionRelease(deps, app);
158999
+ if (release4 === void 0) return "no-release";
159000
+ const t3 = deps.sql.tables.apps;
159001
+ const row = await deps.sql.db.select({ meta: t3.meta }).from(t3).where(and(eq(t3.ownerHandle, app.ownerHandle), eq(t3.appSlug, app.appSlug), eq(t3.fsId, release4.fsId))).limit(1).then((r2) => r2[0]);
159002
+ if (row === void 0 || !hasStoredShot(row.meta)) return "no-shot";
159003
+ return release4;
159004
+ });
159005
+ if (rShot.isErr()) {
159006
+ releaseClaim(key, now2);
159007
+ throw rShot.Err();
159008
+ }
159009
+ const release3 = rShot.Ok();
159010
+ if (release3 === "no-release" || release3 === "no-shot") {
159011
+ releaseClaim(key, now2);
159012
+ return release3;
159013
+ }
159014
+ const vibeUrl = calcEntryPointUrl({
159015
+ ...deps.entryPoint,
159016
+ bindings: { ownerHandle: app.ownerHandle, appSlug: app.appSlug, fsId: release3.fsId }
159017
+ });
159018
+ const rPost = await exception2Result(
159019
+ () => deps.postQueue(
159020
+ {
159021
+ payload: {
159022
+ type: "vibes.diy.evt-recapture-screenshot",
159023
+ ownerHandle: app.ownerHandle,
159024
+ appSlug: app.appSlug,
159025
+ fsId: release3.fsId,
159026
+ vibeUrl,
159027
+ requestedBy: `platform:picture-${reason}`,
159028
+ ...deps.wrapperBaseUrl === void 0 ? {} : { wrapperBaseUrl: deps.wrapperBaseUrl }
159029
+ },
159030
+ tid: "queue-event",
159031
+ src: "picture-recapture",
159032
+ dst: "vibes-service",
159033
+ ttl: 1
159034
+ },
159035
+ { delaySeconds: PICTURE_RECAPTURE_DELAY_SECONDS }
159036
+ )
159037
+ );
159038
+ if (rPost.isErr()) {
159039
+ releaseClaim(key, now2);
159040
+ throw rPost.Err();
159041
+ }
159042
+ return "enqueued";
159043
+ }
159044
+ async function lastLiveWasPictureVersion(vctx, key) {
159045
+ const t3 = vctx.sql.tables.appDocuments;
159046
+ const row = await vctx.sql.db.select({ data: t3.data }).from(t3).where(
159047
+ and(
159048
+ eq(t3.ownerHandle, key.ownerHandle),
159049
+ eq(t3.appSlug, key.appSlug),
159050
+ eq(t3.dbName, key.dbName),
159051
+ eq(t3.docId, key.docId),
159052
+ eq(t3.deleted, 0)
159053
+ )
159054
+ ).orderBy(desc(t3.seq)).limit(1).then((r2) => r2[0]);
159055
+ const data2 = row?.data;
159056
+ return data2?.type === "version" && typeof data2._files === "object" && data2._files !== null;
159057
+ }
159058
+ async function hostHoldsPicture(vctx, key) {
159059
+ const t3 = vctx.sql.tables.appDocuments;
159060
+ const prefix = `${escapeLike(key.docId)}:version:%`;
159061
+ const row = await vctx.sql.db.select({ docId: t3.docId }).from(t3).where(
159062
+ and(
159063
+ eq(t3.ownerHandle, key.ownerHandle),
159064
+ eq(t3.appSlug, key.appSlug),
159065
+ eq(t3.dbName, mediaDbName(key.dbName)),
159066
+ eq(t3.deleted, 0),
159067
+ sql`${t3.docId} like ${prefix} escape '\\'`
159068
+ )
159069
+ ).limit(1).then((r2) => r2[0]);
159070
+ return row !== void 0;
159071
+ }
159072
+ async function appHoldsAnyPicture(vctx, app) {
159073
+ const t3 = vctx.sql.tables.appDocuments;
159074
+ const row = await vctx.sql.db.select({ docId: t3.docId }).from(t3).where(
159075
+ and(
159076
+ eq(t3.ownerHandle, app.ownerHandle),
159077
+ eq(t3.appSlug, app.appSlug),
159078
+ eq(t3.deleted, 0),
159079
+ sql`${t3.dbName} like ${`${escapeLike(MEDIA_DB_PREFIX)}%`} escape '\\'`,
159080
+ sql`${t3.docId} like ${"%:version:%"}`
159081
+ )
159082
+ ).limit(1).then((r2) => r2[0]);
159083
+ return row !== void 0;
159084
+ }
159085
+ async function requestIfPublic(vctx, app, reason, opts) {
159086
+ const publicReadable = opts.isPublicReadable ?? isPublicReadable;
159087
+ if (!await publicReadable(vctx, app.appSlug, app.ownerHandle)) return "private-app";
159088
+ return requestPictureRecapture(pictureRecaptureDepsOfSvc(vctx), app, reason);
159089
+ }
159090
+ async function pictureRecaptureAfterDelete(vctx, key, opts = {}) {
159091
+ if (isCoalesced(coalesceKey(key), Date.now())) return "coalesced";
159092
+ if (isMediaDb(key.dbName)) {
159093
+ if (!await lastLiveWasPictureVersion(vctx, key)) return "not-a-picture";
159094
+ return requestIfPublic(vctx, key, "deleted", opts);
159095
+ }
159096
+ const holds = await hostHoldsPicture(vctx, key) || key.grantDelta === true && await appHoldsAnyPicture(vctx, key);
159097
+ if (!holds) return "not-a-picture";
159098
+ return requestIfPublic(vctx, key, "rescoped", opts);
159099
+ }
159100
+ function sameChannelSet2(a4, b4) {
159101
+ const sa = new Set(a4);
159102
+ const sb = new Set(b4);
159103
+ if (sa.size !== sb.size) return false;
159104
+ for (const c2 of sa) if (!sb.has(c2)) return false;
159105
+ return true;
159106
+ }
159107
+ async function pictureRecaptureAfterChannelMove(vctx, key, opts = {}) {
159108
+ if (isMediaDb(key.dbName)) return "not-a-picture";
159109
+ const moved = key.oldChannels.length > 0 && !sameChannelSet2(key.oldChannels, key.newChannels);
159110
+ const granted = key.grantDelta === true;
159111
+ if (!moved && !granted) return "unchanged";
159112
+ if (isCoalesced(coalesceKey(key), Date.now())) return "coalesced";
159113
+ const holds = moved && await hostHoldsPicture(vctx, key) || granted && await appHoldsAnyPicture(vctx, key);
159114
+ if (!holds) return "not-a-picture";
159115
+ return requestIfPublic(vctx, key, "rescoped", opts);
159116
+ }
159117
+ async function schedulePictureRecapture(vctx, label, task) {
159118
+ const run = /* @__PURE__ */ __name(async () => {
159119
+ const r2 = await exception2Result(task);
159120
+ if (r2.isErr()) console.warn(`[picture-recapture] ${label} failed:`, r2.Err().message);
159121
+ }, "run");
159122
+ const waitUntil = vctx.waitUntil;
159123
+ if (waitUntil === void 0) {
159124
+ await run();
159125
+ return;
159126
+ }
159127
+ const running = run();
159128
+ const registered = exception2Result(() => waitUntil(running));
159129
+ if (registered.isErr()) await running;
159130
+ }
159131
+ var MEDIA_DB_PREFIX, PICTURE_RECAPTURE_DELAY_SECONDS, COALESCE_MAX_ENTRIES, lastEnqueued;
159132
+ var init_picture_recapture = __esm({
159133
+ "../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/picture-recapture.ts"() {
159134
+ "use strict";
159135
+ init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process();
159136
+ init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console();
159137
+ init_performance2();
159138
+ init_esm();
159139
+ init_drizzle_orm();
159140
+ init_types4();
159141
+ init_types6();
159142
+ init_entry_point_utils2();
159143
+ init_select_app();
159144
+ init_access_helpers();
159145
+ init_web_group_live();
159146
+ MEDIA_DB_PREFIX = mediaDbName("");
159147
+ __name(isMediaDb, "isMediaDb");
159148
+ PICTURE_RECAPTURE_DELAY_SECONDS = 60;
159149
+ __name(pictureRecaptureDepsOfSvc, "pictureRecaptureDepsOfSvc");
159150
+ COALESCE_MAX_ENTRIES = 1e3;
159151
+ lastEnqueued = /* @__PURE__ */ new Map();
159152
+ __name(coalesceKey, "coalesceKey");
159153
+ __name(isCoalesced, "isCoalesced");
159154
+ __name(tryClaim, "tryClaim");
159155
+ __name(releaseClaim, "releaseClaim");
159156
+ __name(hasStoredShot, "hasStoredShot");
159157
+ __name(requestPictureRecapture, "requestPictureRecapture");
159158
+ __name(lastLiveWasPictureVersion, "lastLiveWasPictureVersion");
159159
+ __name(hostHoldsPicture, "hostHoldsPicture");
159160
+ __name(appHoldsAnyPicture, "appHoldsAnyPicture");
159161
+ __name(requestIfPublic, "requestIfPublic");
159162
+ __name(pictureRecaptureAfterDelete, "pictureRecaptureAfterDelete");
159163
+ __name(sameChannelSet2, "sameChannelSet");
159164
+ __name(pictureRecaptureAfterChannelMove, "pictureRecaptureAfterChannelMove");
159165
+ __name(schedulePictureRecapture, "schedulePictureRecapture");
159166
+ }
159167
+ });
159168
+
158649
159169
  // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/capi-web-group-event.ts
158650
159170
  function sqlWebGroupReads(sql2) {
158651
159171
  return {
@@ -160396,6 +160916,19 @@ async function handleBackendPut(vctx, base2, op, memo2, seams) {
160396
160916
  );
160397
160917
  if (membersChanged) memo2.forgetCallerAccess();
160398
160918
  timer.mark("memberGrants");
160919
+ await schedulePictureRecapture(
160920
+ vctx,
160921
+ "backend put",
160922
+ () => pictureRecaptureAfterChannelMove(vctx, {
160923
+ ownerHandle,
160924
+ appSlug,
160925
+ dbName,
160926
+ docId,
160927
+ oldChannels: feedOld.channels,
160928
+ newChannels: channelSetOfDescriptor(accessResult),
160929
+ grantDelta
160930
+ })
160931
+ );
160399
160932
  const seq2 = alloc.seq;
160400
160933
  await afterResponse(vctx, "backend put onChange", async () => {
160401
160934
  const rOnChange = await exception2Result(async () => {
@@ -160566,6 +161099,11 @@ async function handleBackendDelete(vctx, base2, op, memo2) {
160566
161099
  inviterRoleFor(vctx, appSlug, ownerHandle)
160567
161100
  );
160568
161101
  if (membersChanged) memo2.forgetCallerAccess();
161102
+ await schedulePictureRecapture(
161103
+ vctx,
161104
+ "backend delete",
161105
+ () => pictureRecaptureAfterDelete(vctx, { ownerHandle, appSlug, dbName, docId: op.docId, grantDelta })
161106
+ );
160569
161107
  const rOnChange = await exception2Result(async () => {
160570
161108
  if (base2.skipOnChange === true) return;
160571
161109
  await emitBackendOnChange(vctx, {
@@ -160620,6 +161158,7 @@ var init_backend_db_callback = __esm({
160620
161158
  init_access_fn_channel_index();
160621
161159
  init_app_documents_broadcast();
160622
161160
  init_emit_backend_onchange();
161161
+ init_picture_recapture();
160623
161162
  init_capi_web_group_event();
160624
161163
  init_put_access_gate();
160625
161164
  init_delete_access_gate();
@@ -161571,6 +162110,19 @@ async function putDocForCallerAttempt(vctx, callerArgs, attempt, seams) {
161571
162110
  grantDelta = notifyGrantDeltaIfChanged();
161572
162111
  }
161573
162112
  }
162113
+ await schedulePictureRecapture(
162114
+ vctx,
162115
+ "frontend put",
162116
+ () => pictureRecaptureAfterChannelMove(vctx, {
162117
+ ownerHandle: args2.ownerHandle,
162118
+ appSlug: args2.appSlug,
162119
+ dbName,
162120
+ docId,
162121
+ oldChannels: oldFeedChannels,
162122
+ newChannels: channelSetOfDescriptor(accessResult),
162123
+ grantDelta
162124
+ })
162125
+ );
161574
162126
  await (args2.fanOutDocChanged ?? notifyDocChangedFanOut)(vctx, {
161575
162127
  ownerHandle: args2.ownerHandle,
161576
162128
  appSlug: args2.appSlug,
@@ -161748,6 +162300,19 @@ async function deleteDocForCaller(vctx, args2) {
161748
162300
  });
161749
162301
  }
161750
162302
  purgeRootHtmlCacheSameColo(vctx, args2.ownerHandle, args2.appSlug);
162303
+ if (delAlloc.inserted) {
162304
+ await schedulePictureRecapture(
162305
+ vctx,
162306
+ "frontend delete",
162307
+ () => pictureRecaptureAfterDelete(vctx, {
162308
+ ownerHandle: args2.ownerHandle,
162309
+ appSlug: args2.appSlug,
162310
+ dbName,
162311
+ docId: args2.docId,
162312
+ grantDelta: deletedDocChangedGrants
162313
+ })
162314
+ );
162315
+ }
161751
162316
  return { kind: "ok", docId: args2.docId };
161752
162317
  }
161753
162318
  function setEphemeralChannelVerdict(key, entry) {
@@ -161843,6 +162408,7 @@ var init_app_documents_write_eventos = __esm({
161843
162408
  init_write_front_door();
161844
162409
  init_resolve_active_handle();
161845
162410
  init_swr_purge();
162411
+ init_picture_recapture();
161846
162412
  init_app_documents_broadcast();
161847
162413
  init_app_documents_grant_delta();
161848
162414
  init_app_member_grants();
@@ -162954,6 +163520,18 @@ async function tryPersist({
162954
163520
  alwaysPut: true,
162955
163521
  created: now2
162956
163522
  });
163523
+ await schedulePictureRecapture(
163524
+ vctx,
163525
+ "sync push put",
163526
+ () => pictureRecaptureAfterChannelMove(vctx, {
163527
+ ownerHandle: req.ownerHandle,
163528
+ appSlug: req.appSlug,
163529
+ dbName: req.dbName,
163530
+ docId: w2.docId,
163531
+ oldChannels,
163532
+ newChannels: channelSetOfDescriptor(descriptor)
163533
+ })
163534
+ );
162957
163535
  if (syncSeq === void 0) return void 0;
162958
163536
  return { docId: w2.docId, seq: seq2, syncSeq, absorbed: false };
162959
163537
  }
@@ -163020,7 +163598,7 @@ async function runPushPutEffects(vctx, p3) {
163020
163598
  });
163021
163599
  if (p3.descriptor && p3.grantsReduceBefore) {
163022
163600
  const outputHasGrants = hasGrantBearingDescriptor(p3.descriptor) ? 1 : 0;
163023
- notifyViewerGrantDeltaIfChanged(vctx, {
163601
+ const grantDelta = notifyViewerGrantDeltaIfChanged(vctx, {
163024
163602
  ownerHandle: p3.ownerHandle,
163025
163603
  appSlug: p3.appSlug,
163026
163604
  dbName: p3.dbName,
@@ -163030,6 +163608,21 @@ async function runPushPutEffects(vctx, p3) {
163030
163608
  grantsReduceBefore: p3.grantsReduceBefore,
163031
163609
  senderConnId: p3.senderConnId
163032
163610
  });
163611
+ if (grantDelta) {
163612
+ await schedulePictureRecapture(
163613
+ vctx,
163614
+ "sync push grant",
163615
+ () => pictureRecaptureAfterChannelMove(vctx, {
163616
+ ownerHandle: p3.ownerHandle,
163617
+ appSlug: p3.appSlug,
163618
+ dbName: p3.dbName,
163619
+ docId: p3.docId,
163620
+ oldChannels: [],
163621
+ newChannels: [],
163622
+ grantDelta: true
163623
+ })
163624
+ );
163625
+ }
163033
163626
  }
163034
163627
  }
163035
163628
  async function runPushDeleteEffects(vctx, p3) {
@@ -163069,6 +163662,17 @@ async function runPushDeleteEffects(vctx, p3) {
163069
163662
  });
163070
163663
  }
163071
163664
  purgeRootHtmlCacheSameColo(vctx, p3.ownerHandle, p3.appSlug);
163665
+ await schedulePictureRecapture(
163666
+ vctx,
163667
+ "sync push delete",
163668
+ () => pictureRecaptureAfterDelete(vctx, {
163669
+ ownerHandle: p3.ownerHandle,
163670
+ appSlug: p3.appSlug,
163671
+ dbName: p3.dbName,
163672
+ docId: p3.docId,
163673
+ grantDelta: p3.deletedDocChangedGrants
163674
+ })
163675
+ );
163072
163676
  }
163073
163677
  async function tryTombstone({
163074
163678
  vctx,
@@ -163186,6 +163790,7 @@ var init_sync_eventos = __esm({
163186
163790
  init_emit_backend_onchange();
163187
163791
  init_capi_web_group_event();
163188
163792
  init_swr_purge();
163793
+ init_picture_recapture();
163189
163794
  init_app_documents_broadcast();
163190
163795
  init_app_documents_grant_delta();
163191
163796
  init_app_member_grants();