vibes-diy 14.3.484 → 14.3.486

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.
@@ -95735,6 +95735,9 @@ var init_autumn_recent_usage = __esm({
95735
95735
  });
95736
95736
 
95737
95737
  // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/billing.ts
95738
+ function creditsForCents(cents, rate = DISPLAY_CREDITS_PER_CENT) {
95739
+ return Math.max(0, Math.round(cents * rate));
95740
+ }
95738
95741
  function isMember(plan) {
95739
95742
  return plan === "plus" || plan === "pro" || plan === "growth" || plan === "business" || plan === "enterprise";
95740
95743
  }
@@ -96198,7 +96201,7 @@ function defaultBilling(opts) {
96198
96201
  feature_id: AI_CREDITS_FEATURE_ID,
96199
96202
  // The single cents → display-credits conversion point (see
96200
96203
  // DISPLAY_CREDITS_PER_CENT above); everything upstream stays raw cents.
96201
- value: costCents * DISPLAY_CREDITS_PER_CENT,
96204
+ value: creditsForCents(costCents),
96202
96205
  // promptId is unique per turn — retries of the same turn can't double-charge.
96203
96206
  idempotency_key: promptId,
96204
96207
  properties: {
@@ -96526,7 +96529,8 @@ var init_billing = __esm({
96526
96529
  init_types4();
96527
96530
  init_autumn_recent_usage();
96528
96531
  AI_CREDITS_FEATURE_ID = "ai_credits";
96529
- DISPLAY_CREDITS_PER_CENT = 2;
96532
+ DISPLAY_CREDITS_PER_CENT = 2.8;
96533
+ __name(creditsForCents, "creditsForCents");
96530
96534
  PLUS_PLAN_ID = "plus";
96531
96535
  PRO_PLAN_ID = "pro";
96532
96536
  GROWTH_PLAN_ID = "growth";
@@ -96604,6 +96608,11 @@ var init_billing = __esm({
96604
96608
  });
96605
96609
 
96606
96610
  // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/capi-lead-ledger.ts
96611
+ async function landLedgerWrite(sql2, userId, asRead, settings, now2) {
96612
+ const t3 = sql2.tables.userSettings;
96613
+ const rows = await sql2.db.update(t3).set({ settings, updated: now2 }).where(and(eq(t3.userId, userId), eq(t3.settings, asRead))).returning({ userId: t3.userId });
96614
+ return rows.length > 0;
96615
+ }
96607
96616
  function ledgerRungOf(key) {
96608
96617
  if (key.startsWith("childGroup:")) return "childGroup";
96609
96618
  if (key.startsWith("childPaid:")) return "childPaid";
@@ -96646,10 +96655,7 @@ async function claimLeadKey(sql2, args2) {
96646
96655
  groupKeys: [...prior?.groupKeys ?? [], groupKey],
96647
96656
  claimId
96648
96657
  };
96649
- await sql2.db.update(t3).set({ settings: [...settings.filter((s2) => s2.type !== "capiLeadCredited"), next3], updated: now2 }).where(and(eq(t3.userId, userId), eq(t3.settings, row.settings)));
96650
- const after = await sql2.db.select({ settings: t3.settings }).from(t3).where(eq(t3.userId, userId)).limit(1).then((r2) => r2[0]);
96651
- const { filtered: afterSettings } = parseArrayWarning(after?.settings ?? [], userSettingItem);
96652
- return afterSettings.find(isUserSettingCapiLeadCredited)?.claimId === claimId;
96658
+ return landLedgerWrite(sql2, userId, row.settings, [...settings.filter((s2) => s2.type !== "capiLeadCredited"), next3], now2);
96653
96659
  }
96654
96660
  var WEB_GROUP_LEDGER_CAPS;
96655
96661
  var init_capi_lead_ledger = __esm({
@@ -96660,6 +96666,7 @@ var init_capi_lead_ledger = __esm({
96660
96666
  init_performance2();
96661
96667
  init_expressions();
96662
96668
  init_types4();
96669
+ __name(landLedgerWrite, "landLedgerWrite");
96663
96670
  WEB_GROUP_LEDGER_CAPS = {
96664
96671
  groupActive: WEB_GROUP_ACTIVE_CAP,
96665
96672
  childGroup: WEB_CHILD_GROUP_CAP,
@@ -140123,7 +140130,7 @@ var init_maps = __esm({
140123
140130
  mapsConfig = {
140124
140131
  name: "maps",
140125
140132
  label: "maps",
140126
- description: "maps of every kind. World overviews (countries, travel journals, places visited, best places to live, territory games, choropleths) use bundled country outlines and SVG markers that render immediately. Street maps of places near the person (restaurants, coffee, parks, \"near me\", a city or zip, directions) are written with Google's own Maps JavaScript loader (`@googlemaps/js-api-loader`: Map, AdvancedMarkerElement, InfoWindow, Place.searchNearby), which the platform draws and answers with real places, opening already full, with friends' ratings and directions links on top",
140133
+ description: "Maps: world and country overviews (travel journals, places visited, best places to live, territory games, choropleths) and street maps of nearby places (restaurants, coffee, parks, near me, a city or zip, directions)",
140127
140134
  cues: [
140128
140135
  "world map",
140129
140136
  "countries",
@@ -140152,7 +140159,7 @@ var init_calendar = __esm({
140152
140159
  calendarConfig = {
140153
140160
  name: "calendar",
140154
140161
  label: "calendar-ics",
140155
- description: "dates and calendars: any app that keeps a date \u2014 due dates, deadlines, streaks and check-ins, schedules and shifts, reminders, timelines, 'tomorrow', 'Friday', 'every Monday' \u2014 resolves relative words against today, saves at once and shows the resolved date, and dates its sample records around the day they are written so the demo opens alive; plus live calendar subscriptions (webcal/.ics): each user's dated items as a phone-calendar feed that updates as they add more, with the backend.js aggregation recipe and the iOS-proof ICS format rules",
140162
+ description: "Dates and calendars: any app that keeps a date (due dates, deadlines, streaks, check-ins, schedules, shifts, reminders, timelines, tomorrow, every Monday), plus webcal/.ics feeds for a phone calendar",
140156
140163
  // The first-mint audit reports these. Kept in step with the description so the
140157
140164
  // audit's cue report names a date-shaped app that skipped this skill.
140158
140165
  cues: [
@@ -140188,7 +140195,7 @@ var init_board_games = __esm({
140188
140195
  boardGamesConfig = {
140189
140196
  name: "board-games",
140190
140197
  label: "Board, tile and card games",
140191
- description: "Load it for every board, tile, card or word game \u2014 checkers, tic-tac-toe, connect four, go, mancala, sudoku, minesweeper, 2048, solitaire \u2014 turn-based play one move, tap, guess or card at a time, alone, against the app, passing one phone or against a friend on their own phone from a shared link; also bingo cards dealt per player from a shared pool, daily word guesses with an on-screen keyboard and a share grid, crosswords, word searches, grouping puzzles, letter hives, hex, poker and other card games with hidden hands, trivia rooms and dice scoresheets with house rules (chess has its own skill, which loads this one). Covers SVG boards in the app's theme tokens (square, hex, ring, graph and stacked shapes) dressed in a look from the request's world (a dauber on paper, skate wheels, poker chips, wooden tiles), seeded deals and daily seeds, win-line detection, turns, undo, AI opponents, and who sees what \u2014 public tables, private hands, members-only clubs.",
140198
+ description: "Board, tile, card and word games, turn-based: checkers, tic-tac-toe, go, sudoku, minesweeper, 2048, solitaire, poker, bingo, daily word guesses, crosswords, grouping puzzles, trivia rooms, dice scoresheets; not chess: use chess",
140192
140199
  // A game across phones is a live room: seats, the turn passing and the turn clock are live-rooms'.
140193
140200
  needs: ["live-rooms", "surface-board"],
140194
140201
  // The rule-function shape every game here is written in; chess maps chess.js onto it.
@@ -140227,7 +140234,7 @@ var init_chess = __esm({
140227
140234
  chessConfig = {
140228
140235
  name: "chess",
140229
140236
  label: "Chess",
140230
- description: "Load it for every standard chess app on the 8\xD78 board \u2014 play the computer at a chosen strength, play a friend from a shared link, puzzles, opening trainers, blunder coaches, game reviews, club ladders (other boards and rule sets are chess-variants'). Real rules from chess.js (castling, en passant, promotion, check, mate, every draw), a Stockfish engine opponent and analysis in a Web Worker, move lists, PGN and FEN, clocks, and the board drawn in SVG, with react-chessboard drag-and-drop, or in 3D.",
140237
+ description: "Standard chess on the 8\xD78 board: play the computer, play a friend from a shared link, puzzles, opening trainers, blunder coaches, game reviews, club ladders; other boards and rule sets are chess-variants",
140231
140238
  // The board, its look, turns, seats and who sees what are board-games'.
140232
140239
  needs: ["board-games"],
140233
140240
  cues: ["chess", "chessboard", "stockfish", "checkmate", "chess puzzle", "chess puzzles", "pgn"],
@@ -140247,7 +140254,7 @@ var init_chess_variants = __esm({
140247
140254
  chessVariantsConfig = {
140248
140255
  name: "chess-variants",
140249
140256
  label: "Chess variants",
140250
- description: "Load it for chess on anything but the standard 8\xD78 rules \u2014 minichess on 5\xD75 or 6\xD76 boards, pawns-only games, atomic, crazyhouse, antichess, horde, three-check, King of the Hill, Chess960, shogi, xiangqi, new pieces, and a chess club's own invented variant. Rules from Fairy-Stockfish's ffish library, a variant written in a few lines of config, and a Fairy-Stockfish engine opponent in a Web Worker at any strength, on a board of any size.",
140257
+ description: "Chess on anything but the standard 8\xD78 rules: minichess on 5\xD75 or 6\xD76 boards, pawns-only, atomic, crazyhouse, antichess, horde, three-check, King of the Hill, Chess960, shogi, xiangqi, new pieces, invented variants",
140251
140258
  // The board, its look, turns, seats and access are board-games'.
140252
140259
  needs: ["board-games"],
140253
140260
  cues: ["chess variant", "chess variants", "minichess", "fairy chess", "fairy-stockfish", "crazyhouse", "atomic chess", "antichess", "pawn wars"],
@@ -140303,7 +140310,7 @@ var init_group_plan = __esm({
140303
140310
  groupPlanConfig = {
140304
140311
  name: "group-plan",
140305
140312
  label: "Group plans",
140306
- description: "A job a group does together that ends in one result or one action: poll everyone then pick a date, collect each person's top picks then return a short bookable list, a meeting point that respects what each person privately needs, items people claim, an RSVP or order placed once for the group. Answers are one row per person, a person's private need is read only by its author and the scheduled tick that computes the plan, the plan record is written only by backend.js and quotes no private need, the scheduled tick notifies the owner only when a decision is needed (quorum, conflict, deadline) and stops at its check budget, an approval counts only from a member other than the proposer and only while the proposal's text, audience and amount are unchanged, and each outside action is claimed once as an intent (ifRev: null) and is done only when a receipt confirms it. A single person's own list or tracker, or a poll with no decision to act on, does not need it",
140313
+ description: "A job a group does together that ends in one result or action: poll everyone then pick a date, shortlist everyone's top picks, a meeting point, items people claim, a group RSVP or order, each answer one row per person; not a solo list or a poll with no decision",
140307
140314
  cues: ["poll everyone", "everyone's availability", "find a time that works", "plan for the group", "rsvp for"]
140308
140315
  };
140309
140316
  }
@@ -140320,7 +140327,7 @@ var init_vibe_tools2 = __esm({
140320
140327
  vibeToolsConfig = {
140321
140328
  name: "vibe-tools",
140322
140329
  label: "Vibe tools",
140323
- description: "The verbs a person could ask for by text instead of tapping (vote for a place, claim a slot, book a table, add a book to the list), declared in backend.js as a static `export const tools` (at most 8) so an assistant in a group chat can do them for that person. Each tool has a one-line description, typed input fields, who it is for (anyone, members, owner), and either a handler shared with the page's button through a fetch route or a declared one-record write (`key: \"caller\"` for one record per person). A plain record (a list item, a note) needs no tool, since an assistant saves it directly through access.js; a domain tool takes the steps the app works out (book the next free hour, a legal move) in its handler. A tool always acts as its caller through access.js (`user.backend` is `tool`, never admin mode) and its callAI spends the caller's credits. A tool may carry a short `title`, an `annotations` flag (`readOnly` for a lookup, `consequential` for one the assistant confirms first) and an `output` field list. A picture app may mark one tool `offer: true`, which the assistant offers once per chat with the app's first picture; `offer: { textsLater: true }` records each person's yes, and a scheduled `ctx.notify({ consent: \"text-later\" })` reaches only people who said yes. A picture app that writes its prompt in code exports it as a read-only hook, `export const hooks = { picturePrompt: { run } }`: it takes the person's words as `addition` and returns the prompt string, and the platform paints from it. An app that writes stories about its cast (episodes, chapters) declares a tool that writes one with ctx.callAI and returns its first scene and picture, and a next_\u2026 tool that tells the rest, so a group that plays by text hears it in the chat. An app whose actions only happen on the page does not need it",
140330
+ description: "Actions a person could ask for by text instead of tapping (vote for a place, claim a slot, book a table, add a book to the list) so an assistant in a group chat can do them, a picture app offered in a chat or texting people later, or episodes about a cast a group plays by text; not for apps whose actions only happen on the page",
140324
140331
  cues: ["text the app", "ask the assistant to", "from the group chat", "vote by text", "claim by text", "tools for the agent", "episodes in the group chat", "tell the story by text"]
140325
140332
  };
140326
140333
  }
@@ -140355,7 +140362,7 @@ var init_weather = __esm({
140355
140362
  weatherConfig = {
140356
140363
  name: "weather",
140357
140364
  label: "Weather forecasts",
140358
- description: "Live weather for any app that shows weather (a dashboard, a trip planner, a garden or event page), with no key and no setup, from Open-Meteo: a place name to coordinates, current conditions, an hourly strip and a daily forecast for one or several places in one call, \xB0C/\xB0F and wind units, weather codes in plain words, refresh and errors that keep the last forecast, and the data credit",
140365
+ description: "Live weather for any app that shows weather (a dashboard, a trip planner, a garden or event page): current conditions, hourly and daily forecast for one or several places, with no key and no setup",
140359
140366
  cues: ["weather", "forecast", "weather dashboard", "weather app"],
140360
140367
  credential: "none",
140361
140368
  egress: [
@@ -140377,7 +140384,7 @@ var init_keepsake = __esm({
140377
140384
  keepsakeConfig = {
140378
140385
  name: "keepsake",
140379
140386
  label: "Keepsake",
140380
- 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",
140387
+ description: "A thing people print, share or hand out: a ticket, invitation, menu, poster, certificate or place card, made as one framed artifact that prints on its own",
140381
140388
  cues: ["printable", "to print", "print out", "invitation card", "a poster", "certificate", "place card"],
140382
140389
  needs: ["reskin"],
140383
140390
  rail: "reskin",
@@ -140397,7 +140404,7 @@ var init_business_paper = __esm({
140397
140404
  businessPaperConfig = {
140398
140405
  name: "business-paper",
140399
140406
  label: "Business paper",
140400
- 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",
140407
+ description: "Invoices, quotes, estimates, receipts, statements and monthly reports printed or saved as PDF from the app's own records (jobs, clients, orders), with line items, tax and totals",
140401
140408
  cues: ["invoice", "invoices", "print a quote", "printable quote", "monthly statement", "monthly report", "save as a pdf", "save as pdf"],
140402
140409
  rail: "reskin",
140403
140410
  medium: "print"
@@ -140416,7 +140423,7 @@ var init_occasion = __esm({
140416
140423
  occasionConfig = {
140417
140424
  name: "occasion",
140418
140425
  label: "Occasion",
140419
- description: "The app is FOR an occasion or a theme \u2014 Halloween, Christmas, Hanukkah, Diwali, Lunar New Year, Thanksgiving, Valentine's, a birthday party, a wedding, a baby shower, game day, a pirate or dinosaur party \u2014 even when the person describes no appearance: the occasion is the style, so the app wears its palette, a display face, its objects as motifs, a hero that sets the scene and words in the day's voice, by the reskin technique",
140426
+ description: "The app is FOR an occasion or theme: Halloween, Christmas, Hanukkah, Diwali, Lunar New Year, Thanksgiving, Valentine's, birthday, wedding, baby shower, game day, pirate or dinosaur party, even with no look described",
140420
140427
  cues: [
140421
140428
  "halloween",
140422
140429
  "trick or treat",
@@ -140621,7 +140628,7 @@ var init_world_controls = __esm({
140621
140628
  // What it builds first (lab 2026-11-02, #8373): the fast first-build planner left it off a "3D garden I can
140622
140629
  // walk around in" 1 time in 4 when the row led with the mechanism. "Explore" alone pulled a spinning product
140623
140630
  // viewer in 2 of 4 (0 of 4 before), so the row says walked through as a player and names the viewer as three-js.
140624
- "Any 3D place the person walks through as a player, on foot or flying, first-person, on a phone and a desktop: a 3D garden, house, museum, cave, island, maze, city or ship to walk around in. Load it beside three-js for every walked-through world; a model turned or spun on its own (a product viewer) is three-js alone. The useWorldControls hook from use-vibes: left thumb walks on a floating stick, right thumb looks, flick up to jump, tap and hold act on what is under the finger, a \u{1F3A5} button cycles free cam, first person and shoulder views, and the desktop gets pointer lock, WASD and Space. walk-through, first-person, walk around, explore, wander, fly around, 3D world"
140631
+ "Walk-through 3D world the person explores as a player, first-person: walk around, wander or fly around a garden, house, museum, cave, island, maze, city, ship; load beside three-js; a model just spun (product viewer) is three-js alone"
140625
140632
  ),
140626
140633
  // The use-vibes hook this doc teaches (Walk + look), moved here from touch-games with the section.
140627
140634
  teaches: ["useWorldControls"],
@@ -140660,7 +140667,7 @@ var init_speech = __esm({
140660
140667
  name: "speech",
140661
140668
  needs: ["sound-core", "mic-capture"],
140662
140669
  label: "Speech",
140663
- description: "Apps that talk and listen: read text aloud in a natural voice (a narrator, a language tutor, a story reader, spoken quiz questions), turn a recording into words (dictation, voice notes to text, an interviewer that asks aloud and hears the answer), and ask the model about a recording. speak() returns a playable WAV with 30 voices and plain-words style; transcribe() takes a MediaRecorder Blob as it is.",
140670
+ description: "Apps that talk and listen: read text aloud in a natural voice (narrator, language tutor, story reader, spoken quiz), turn a recording into words (dictation, voice notes to text, interviewer), ask the model about a recording",
140664
140671
  cues: [
140665
140672
  "read aloud",
140666
140673
  "read it aloud",
@@ -140716,7 +140723,7 @@ var init_media_capture = __esm({
140716
140723
  // Subjects first (lab 2026-11-02): with a mechanism-first row the agent named it for a plant
140717
140724
  // photo (2/3) and never for a voice memo or an avatar profile (0/6). Voice first (#8373 eval): still
140718
140725
  // 0/2 for "voice memos" while the row led with photos.
140719
- "Voice memos, voice notes and any app that records audio, and any app where the person adds a photo or uses the camera: a plant or receipt identifier, profile and avatar photos, a selfie booth, a scanner. The photo picker that offers Take Photo and the photo library (preview, paste, drag-and-drop, downscale, location stripped), a live camera viewfinder (front/back switch, permission asked on the tap, a picker when the camera is blocked), and a voice recorder (timer, level meter, play back before saving)."
140726
+ "Voice memos, voice notes and any app that records audio, and any app where the person adds a photo or uses the camera: plant or receipt identifier, profile and avatar photos, selfie booth, scanner"
140720
140727
  ),
140721
140728
  // Phrase forms rather than bare "record", which also names a data app's records.
140722
140729
  cues: [
@@ -140756,7 +140763,7 @@ var init_web_audio = __esm({
140756
140763
  // The unlock, the effects, the mute toggle and the restraint rule live in the sound core.
140757
140764
  needs: ["sound-core"],
140758
140765
  label: "Web Audio API",
140759
- description: 'Web Audio fundamentals: the AudioContext from the gesture unlock, oscillators, decoded-file playback, gain and filters, and heavyweight engines (Tone.js and the like) imported at runtime from a pinned URL in a memoized loader, with one Stop that silences every voice. A music toy (a drum machine, a synth, a sequencer, a metronome) names "web-music", which brings this with it.',
140766
+ description: "Web Audio fundamentals: generated tones (oscillators), audio file playback, gain and filters, Tone.js-style engines; not for a music toy (drum machine, synth, sequencer, metronome): use web-music",
140760
140767
  // The browser API whose rules (unlock on the gesture, one context, restraint) this doc owns.
140761
140768
  teaches: ["AudioContext", "WebAudio", "Web Audio"],
140762
140769
  cues: ["audio", "sound", "sounds", "oscillator", "web audio", "samples", "sampled", "sampled sounds", "audio engine"]
@@ -140777,7 +140784,7 @@ var init_web_music = __esm({
140777
140784
  // Opening, explaining and stopping the mic stream for §3's monitoring lives in mic-capture.
140778
140785
  needs: ["web-audio", "mic-capture"],
140779
140786
  label: "Web music",
140780
- description: "Drum machines, beat makers, step sequencers, synths, theremins, drones and metronomes: a complete synthesized drum machine (kick, snare, hats, 16\u2011step sequencer, tempo, swing, saturation, volume) wearing a token-painted instrument face; a master bus with global Saturation and Volume; echo/delay with effects in the feedback path; mic monitoring with a metronome; audio\u2011clock scheduling for multi\u2011channel drum machines and MIDI synths with accurate voice overlap. drum machine, beat maker, step sequencer, groovebox, synth, synthesizer, keyboard, metronome, midi, melody, music toy",
140787
+ description: "Music toys and instruments: drum machine, beat maker, step sequencer, groovebox, synth, synthesizer, keyboard, theremin, drone, metronome, midi, melody, music toy, echo/delay effects, mic monitoring",
140781
140788
  cues: ["music", "synth", "synthesizer", "metronome", "drum machine", "drum", "drums", "midi", "melody"]
140782
140789
  };
140783
140790
  }
@@ -140795,7 +140802,7 @@ var init_d3 = __esm({
140795
140802
  name: "d3",
140796
140803
  needs: ["surface-stage"],
140797
140804
  label: "D3.js",
140798
- description: "D3.js data visualization library for creating interactive charts, graphs, maps, and data-driven documents using SVG, HTML, CSS. Includes scales, selections, transitions, animations, force simulations, geographic projections, data binding, DOM manipulation, data viz, dataviz",
140805
+ description: "D3.js data visualization library for interactive charts, graphs, maps and data-driven documents: force simulations, geographic projections, transitions, animations, data viz, dataviz",
140799
140806
  cues: [
140800
140807
  "chart",
140801
140808
  "charts",
@@ -140854,7 +140861,7 @@ var init_live_rooms = __esm({
140854
140861
  liveRoomsConfig = {
140855
140862
  name: "live-rooms",
140856
140863
  label: "Live rooms",
140857
- description: "A room people are in at the same time, for any app whose point is being there together and that no game, world or chat skill covers: a watch party, a standup, a shared timer or countdown, a hangout, a live poll, a room friends join from a link. Covers the room id in the URL (#room=), the invite link, presence as a never-saved draft with a heartbeat and expiry, who is here with avatar faces and an 'N here' count, other people's cursors, optimistic local-first writes, seats and turns with a shared turn clock. A block world, a board or card game, or a group chat names its own skill, which loads this one.",
140864
+ description: "A room people are in at the same time, when being there together is the point: watch party, standup, shared timer or countdown, hangout, live poll, room joined from a link, live cursors; not for voxel, board-games or a group chat",
140858
140865
  // The room techniques a consumer's prose leans on without calling this doc's helpers: voxel streams
140859
140866
  // its pose as the presence draft, and board-games hands its seats their turn clock.
140860
140867
  teaches: ["presence draft", "turn clock"],
@@ -140892,7 +140899,7 @@ var init_three_js = __esm({
140892
140899
  name: "three-js",
140893
140900
  needs: ["surface-stage"],
140894
140901
  label: "Three.js",
140895
- description: "Three.js 3D graphics library for WebGL rendering: mesh geometry, materials, lighting, animation, cameras, textures, GLSL shaders, GLTF/OBJ/FBX model loading, physics, particle systems, post-processing, visual effects, 3js, and 3D infographics told chapter by chapter with bars rising off a map or timeline. Anything played or steered also loads touch-games for phone controls; a place the person walks through as a player (a garden, house, museum or cave, first-person) also loads world-controls, and a model turned, spun or orbited on its own (a product viewer, a globe) stays three-js",
140902
+ description: "Three.js 3D graphics (WebGL, 3js): 3D models, shaders, visual effects, 3D infographics, a product viewer or globe spun on its own; anything played or steered also loads touch-games, a walked-through place also loads world-controls",
140896
140903
  cues: ["3d", "three.js", "3d infographic", "infographic", "threejs", "3js", "webgl", "shader", "shaders", "mesh", "gltf", "3d model", "3d scene"],
140897
140904
  importModule: "three",
140898
140905
  importName: "THREE",
@@ -140914,7 +140921,7 @@ var init_p5 = __esm({
140914
140921
  // Theme tokens reach the canvas through lib/look.js, the shared probe (canvas theme colours).
140915
140922
  needs: ["surface-stage", "canvas-theme-colors"],
140916
140923
  label: "p5.js",
140917
- description: "p5.js creative-coding library for 2D canvas and WEBGL sketches: generative art, flow fields, particle systems, Perlin noise, seeded deterministic sketches, kaleidoscopes, screensavers, visualisers, drawing and painting toys, plotter-style patterns, still gallery renders with noLoop, and fragment shaders. Covers instance mode in React (one useEffect, instance.remove() on cleanup), the version-pinned esm.sh import, sizing from the host element, pixelDensity, randomSeed/noiseSeed determinism, trails, and touch. p5, p5.js, processing, sketch, creative coding, generative art, canvas art, noise field. Anything played or steered also loads touch-games for phone controls",
140924
+ description: "p5.js creative coding sketch (p5, processing): generative art, canvas art, noise field, particle systems, kaleidoscopes, screensavers, visualisers, drawing and painting toys; anything played or steered also loads touch-games",
140918
140925
  cues: [
140919
140926
  "p5",
140920
140927
  "p5.js",
@@ -140954,7 +140961,7 @@ var init_voxel = __esm({
140954
140961
  // controls come through `needs`, so the selector's separate three-js / world-controls picks drop.
140955
140962
  covers: ["three-js", "world-controls"],
140956
140963
  label: "Voxel",
140957
- description: "Any voxel or block world \u2014 Minecraft-style, an island, a city, a sandbox \u2014 walked, flown or built in. Build a Minecraft-style first-person voxel sandbox with Three.js: chunked block world, procedural terrain (noise heightmaps, biomes, caves, ore veins, trees), place/break with a DDA voxel raycast, an AABB player controller with gravity, jump, sprint, auto step-up and un-stick, thumb walk/look and desktop pointer lock through useWorldControls with a click-to-play overlay, endless chunk streaming, a shared voxel palette with material-colored controls, a day/night cycle, ambient mobs, and live multiplayer block edits with temporary player presence over Fireproof. Covers the survival layer (table-driven crafting tiers, tools with durability, smelting, armor, mob combat, hunger, dimensions, per-player inventory, world reset) and the flat multi-file project split for bigger games. minecraft, voxel, block world, sandbox, blocks, mining, building, first-person, 3d game, procedural world, chunks, terrain, overworld, creative mode, survival, crafting, nether. Anything played or steered also loads touch-games for phone controls",
140964
+ description: "Any voxel or block world, Minecraft-style, an island, a city, a sandbox, walked, flown or built in: minecraft, mining, building, crafting, survival, creative mode, terrain, nether, a first-person 3D game or procedural world; anything played or steered also loads touch-games",
140958
140965
  cues: ["voxel", "voxels", "minecraft", "block world", "blocky", "sandbox game"],
140959
140966
  // A shared world is a live room: the room link, presence, who is here and the room's access
140960
140967
  // branches are the live-rooms doc's; voxel keeps the block-edit conflict models.
@@ -140976,7 +140983,7 @@ var init_character_games = __esm({
140976
140983
  characterGamesConfig = {
140977
140984
  name: "character-games",
140978
140985
  label: "Character games",
140979
- description: "Turn a character into a 3D toy action figure, and hang a whole cast in a 3D gallery. A superhero drawing, a cosplay photo, a game character or a few words become a cel-shaded three.js figure with the character's body proportions, costume colours and pattern, hair, mask and top accessories (cape, wings, shield, hammer, horns, glowing fists, an aura and more), read by one callAI vision call into a small figure spec people can keep and edit; and a full-screen gallery room where every character's portrait hangs on a wall and the chosen one's figure turns on a stage in front of it, missing figures sculpted from the portrait and shared for everyone. character maker, character creator, action figure, toy figure, figurine, superhero figure, hero maker, 3d character, character gallery, cast gallery, hall of heroes",
140986
+ description: "Turn a character into a 3D toy action figure, or hang a cast in a 3D gallery, from a superhero drawing, cosplay photo or a few words: character maker, character creator, figurine, hero maker, character gallery, hall of heroes",
140980
140987
  needs: ["photo-input"],
140981
140988
  covers: ["three-js"],
140982
140989
  cues: [
@@ -141014,7 +141021,7 @@ var init_touch_games = __esm({
141014
141021
  // world-controls, which a walked scene loads beside this.
141015
141022
  needs: ["sound-core", "surface-play-area"],
141016
141023
  label: "Touch games",
141017
- description: "Phone-first controls for every game played in real time, tapped or steered (a turn-based board, card or word game is board-games) \u2014 load it on its own for a tap game or a whack-a-mole grid, and beside three-js, voxel, physics, p5, worlds or ui-game for every other real-time game, 3D scene you move through, or canvas toy: the play area is the controller (select-none touch-none surface, Pointer Events with pointer capture), swipes that fire mid-move with chaining, tap vs swipe on one surface, a floating ghost stick under the thumb, hold-to-boost with drag steering, pull-back-and-release aiming, gesture trails and feedback, sound effects on the core actions with a mute toggle, the world painted in the app's look, and keyboard twins for desktop. game, mobile game, tap game, whack-a-mole, reflex game, touch controls, swipe, joystick, runner, racer, flyer, shooter, snake, slingshot, platformer, arcade, flappy, one thumb",
141024
+ description: "Phone-first controls for every real-time game, tapped or steered (tap game, whack-a-mole, runner, shooter, snake, platformer, arcade), alone or beside three-js, voxel, physics, p5, worlds or ui-game, and for any 3D scene you move through or canvas toy; turn-based games: use board-games",
141018
141025
  // Reporting cues for the first-mint audit: games played in real time — tapped, steered, jumped, dodged,
141019
141026
  // swiped — and never turn-based asks (bingo, quiz, trivia, chess) or a 3D product viewer. "jump"
141020
141027
  // alone is left out on purpose ("jump to a section"). These are broad on purpose: they
@@ -141066,7 +141073,7 @@ var init_webxr = __esm({
141066
141073
  webxrConfig = {
141067
141074
  name: "webxr",
141068
141075
  label: "Babylon.js WebXR",
141069
- description: "Babylon.js 3D engine with first-class WebXR: immersive VR and AR passthrough, hit-testing, surface anchors, particle systems, SolidParticleSystem, custom GLSL shaders, controller and hand-tracking events, PBR materials, Quest performance patterns. babylon, babylonjs, WebXR, VR, AR, spatial computing, immersive, mixed reality, xr, augmented reality, virtual reality, Quest, Vision Pro",
141076
+ description: "VR, AR and XR apps: virtual reality, augmented reality, mixed reality, WebXR, immersive or spatial computing scenes for Quest or Vision Pro, hand tracking, AR passthrough, or any ask for Babylon.js 3D, particle systems, custom GLSL shaders or PBR materials",
141070
141077
  cues: [
141071
141078
  "webxr",
141072
141079
  "vr",
@@ -141136,7 +141143,7 @@ var init_create_vibe = __esm({
141136
141143
  createVibeConfig = {
141137
141144
  name: "create-vibe",
141138
141145
  label: "createVibe",
141139
- description: "Hand off to the builder to generate a second, personalized vibe (interviewer / meta-vibes)",
141146
+ description: "Meta-vibes and interviewer apps: an app that interviews the visitor, then hands off to the builder to generate a second, personalized vibe for them",
141140
141147
  importModule: "use-vibes",
141141
141148
  importName: "createVibe"
141142
141149
  };
@@ -141221,7 +141228,7 @@ var init_connections = __esm({
141221
141228
  connectionsConfig = {
141222
141229
  name: "connections",
141223
141230
  label: "Connections",
141224
- description: "Connect a visitor's own GitHub profile, Threads, Instagram or LinkedIn account with one click, read it from backend.js, and post to their Threads, Instagram or LinkedIn \u2014 config.connections, useConnection, @vibes.diy/social",
141231
+ description: "Connecting a visitor's own GitHub profile, Threads, Instagram or LinkedIn account with one click, to read it or post to their Threads, Instagram or LinkedIn; working with GitHub repos is github",
141225
141232
  cues: [
141226
141233
  "connect my",
141227
141234
  "sign in with github",
@@ -141271,7 +141278,7 @@ var init_github = __esm({
141271
141278
  githubConfig = {
141272
141279
  name: "github",
141273
141280
  label: "GitHub repos",
141274
- description: "Work with somebody's GitHub repo \u2014 a pull request bot, a code reviewer, an issue sorter, a repo dashboard, anything reading files, commits or a README or answering GitHub webhooks \u2014 through the vibes.diy GitHub App: a Connect link to /github/install, config.github in backend.js, ctx.github.fetch for repo calls and the /github-webhook route for events (a visitor's GitHub profile alone is connections)",
141281
+ description: "GitHub repo work: pull request bots, code reviewers, issue sorters, repo dashboards, anything reading files, commits or a README or answering GitHub webhooks; a visitor's GitHub profile alone is connections",
141275
141282
  cues: [
141276
141283
  "my repo",
141277
141284
  "github repo",
@@ -141305,7 +141312,7 @@ var init_social_post = __esm({
141305
141312
  // camera photo into the JPEG Instagram takes.
141306
141313
  needs: ["photo-input"],
141307
141314
  label: "Post as you",
141308
- description: "Post as the visitor to their own Threads, LinkedIn and Instagram \u2014 a composer that cross-posts one update with an optional photo, a Connect and Renew button per network, one result and link per network \u2014 config.connections posting scopes, useConnection, apiFetch, threads/linkedin/instagram from @vibes.diy/social",
141315
+ description: "Posting as the visitor to their own Threads, LinkedIn and Instagram: a composer that cross-posts one update with an optional photo and shows one result and link per network",
141309
141316
  cues: [
141310
141317
  "post to my linkedin",
141311
141318
  "post to linkedin",
@@ -141339,7 +141346,7 @@ var init_youtube = __esm({
141339
141346
  youtubeConfig = {
141340
141347
  name: "youtube",
141341
141348
  label: "YouTube channel stats",
141342
- description: "YouTube on a page: playing videos, playlists and a channel's uploads in YouTube's own player, which needs no key and no setup; and channel stats on the platform's key with no key for the owner to create: ctx.youtube.fetch in backend.js and its daily unit budget, resolving a channel from a handle or URL, reading videos through the uploads playlist, evening and morning samples compared into a 9 a.m. overnight recap pushed with ctx.notify, 28-day sample retention, and labeling the numbers an API key cannot see",
141349
+ description: "YouTube on a page: playing videos, playlists and a channel's uploads in YouTube's own player, and channel stats on the platform's key with no key for the owner to create, such as an overnight recap",
141343
141350
  cues: [
141344
141351
  "youtube",
141345
141352
  "my channel",
@@ -141377,7 +141384,7 @@ var init_bluesky = __esm({
141377
141384
  blueskyConfig = {
141378
141385
  name: "bluesky",
141379
141386
  label: "Bluesky public data",
141380
- description: "Reading PUBLIC Bluesky data with no credential of any kind: the unauthenticated XRPC host, profiles, follows and followers, an account's own feed, actor search, why post search is not available without a session, checking a response's status before parsing it because a refusal comes back as HTML, and paging on the cursor rather than on emptiness",
141387
+ description: "Reading public Bluesky data with no key or login: profiles, follows and followers, an account's own feed and actor search; post search is not available without a session",
141381
141388
  cues: [
141382
141389
  "bluesky",
141383
141390
  "bsky",
@@ -141404,7 +141411,7 @@ var init_spotify = __esm({
141404
141411
  spotifyConfig = {
141405
141412
  name: "spotify",
141406
141413
  label: "Spotify catalog",
141407
- description: "Spotify on a page: playing tracks, albums, playlists and an artist's top tracks in Spotify's own player, which needs no credentials and no setup; and reading Spotify's public catalog (search, albums, tracks) with the owner's own Spotify app credentials: the setup steps the app shows when SPOTIFY_CLIENT_ID/SPOTIFY_CLIENT_SECRET are missing, the client-credentials token minted in backend.js and cached in memory rather than stored, searching artists/albums/tracks, the boundary that a listener's own top tracks and playlists need a connection instead, and keeping every refusal's reason",
141414
+ description: "Spotify on a page: playing tracks, albums, playlists or an artist's top tracks in Spotify's player, or searching its public catalog on the owner's own app credentials; a listener's own top tracks and playlists add connections beside it",
141408
141415
  cues: [
141409
141416
  "spotify",
141410
141417
  "spotify search",
@@ -141440,7 +141447,7 @@ var init_square = __esm({
141440
141447
  squareConfig = {
141441
141448
  name: "square",
141442
141449
  label: "Square payments",
141443
- description: "Taking real money through Square, for an owner who already sells on Square: load it only when the person names Square \u2014 Square, my Square account, pay with Square, Square checkout, sell on Square, a Square payment link \u2014 and every other ask to take money, with no Square in the words, is the stripe skill. One-time payments into the owner's own Square account on the owner's own Square access token, pasted once into the vibe's Secrets as SQUARE_ACCESS_TOKEN (SQUARE_ENV=sandbox for Square's developer sandbox): the setup steps the app shows until the token is in, linking the Square Developer Console's Credentials page; every Square call in backend.js with ctx.fetch, never from the page; the first active location that takes cards and its currency; the owner's product catalog as records only the owner writes, priced in the currency's smallest unit (cents for USD, yen for JPY), and backend.js pricing every line from those records; one pending order then one Square payment link opened in a new tab; an order marked paid only after backend.js reads Square's order back and matches our reference_id, total, a tender and nothing left to pay; a scheduled sweep that settles orders whose buyer closed the tab; a notice to the owner per sale; refunds in the Square Dashboard",
141450
+ description: "Taking real money through Square, one-time, into the owner's own Square account, only when the person names Square: pay with Square, Square checkout, sell on Square, a Square payment link; any other ask to take money is stripe",
141444
141451
  cues: [
141445
141452
  "with square",
141446
141453
  "through square",
@@ -141507,7 +141514,7 @@ var init_squarespace = __esm({
141507
141514
  squarespaceConfig = {
141508
141515
  name: "squarespace",
141509
141516
  label: "Squarespace orders",
141510
- description: "Reading a Squarespace seller's own store: load it when the person names Squarespace and their orders, customers or shop \u2014 my Squarespace orders, the orders to pack from my Squarespace store, which Squarespace customers order most. Read only, on the owner's own Commerce API key (Commerce Advanced plan, Orders and Profiles set to Read Only), pasted once into the vibe's Secrets as SQUARESPACE_API_KEY: the setup steps the app shows until the key is in; every Squarespace call in backend.js with ctx.fetch and a User-Agent, never from the page; a scheduled poll every 15 minutes of the orders modified since the last poll, the first page by modifiedAfter and modifiedBefore together and every later page by cursor alone, one record per order keyed by its Squarespace id; each customer's order count and lifetime spend from their profile's transactionsSummary, looked up by email; records only backend.js writes and only the owner reads; fulfilment and refunds stay in Squarespace",
141517
+ description: "Reading a Squarespace seller's own store on the owner's own API key, read only: when the person names Squarespace and their orders, customers or shop, like my Squarespace orders to pack or which customers order most",
141511
141518
  cues: ["squarespace"],
141512
141519
  needs: ["owner-secret"],
141513
141520
  credential: "owner-secret",
@@ -141536,7 +141543,7 @@ var init_shippo = __esm({
141536
141543
  shippoConfig = {
141537
141544
  name: "shippo",
141538
141545
  label: "Shippo orders and labels",
141539
- description: "Reading a Shippo merchant's own shipping: load it when the person names Shippo and their orders, labels, boxes or packing \u2014 my Shippo orders, a packing station for the orders in Shippo, which box each label went out in, my saved box sizes. Read only, on the owner's own Shippo API key (live or test, from API Configuration > Developer keys), pasted once into the vibe's Secrets as SHIPPO_API_KEY and sent as Authorization: ShippoToken: the setup steps the app shows until the key is in; every Shippo call in backend.js with ctx.fetch, never from the page; a scheduled poll every 15 minutes of GET /orders/ with start_date, results=100 and page, a few pages per poll, one record per order keyed by its object_id; the box each label used from GET /transactions/{id} then GET /parcels/{id}, read once each from a capped follow-up list; the saved boxes from GET /user-parcel-templates; list reads kept under Shippo's 50 a minute (10 on a test key); records only backend.js writes and only the owner reads; buying labels and refunds stay in Shippo",
141546
+ description: "Reading a Shippo merchant's own shipping on the owner's own API key, read only: when the person names Shippo and their orders, labels, boxes or packing, like a packing station, which box each label used, or saved box sizes",
141540
141547
  cues: ["shippo"],
141541
141548
  needs: ["owner-secret"],
141542
141549
  credential: "owner-secret",
@@ -141565,7 +141572,7 @@ var init_stripe = __esm({
141565
141572
  stripeConfig = {
141566
141573
  name: "stripe",
141567
141574
  label: "Stripe payments",
141568
- description: "Taking real money through Stripe Checkout: load it whenever the person asks for money to move \u2014 pay the bill, split the check, a restaurant check, pay at the table or at the counter, a tip or a tip jar, donate or a donation page, sell tickets, sell products buyers pay for, buy now or purchase online, a charge, a deposit, dues, a checkout, a client paying an invoice online (pay an invoice, bill a client), pay with Stripe, the word Stripe, or a named payment app buyers pay through (Apple Pay, Cash App, Zelle, Venmo, Chime: card, Apple Pay and Cash App Pay ride Checkout, and a P2P app the person keeps is a manual lane beside it whose handle the owner types); money through Square (pay with Square, my Square account, a Square checkout) is the square skill instead, never this one \u2014 one-time charges into the owner's own Stripe account through ctx.stripe, connected once with Connect Stripe (a monthly or yearly subscription is the stripe-subscriptions skill): what is for sale and its price is the owner's product catalog, product records in the app's database that only the owner writes (access.js) from the app's own Products screen, starting empty with the owner's first product, and backend.js charges the price it reads from the product the buyer names, never an amount from the browser or a constant in backend.js; anyone pays by default, signed in or not (a guest's order is written by backend.js for them, and sign-in only when the owner asks for it: members only, a roster, a my-orders page), a venue's guest checkout (a check, a tip, a donation, an invoice paid by link with a pay-by date and an overdue state \u2014 the payment keyed to the thing paid and its session), one payer paying the whole check by default with splitting as a second choice and the balance reserved with a revision-checked write before any session opens, the Connect Stripe setup item read from ctx.stripe.status(), test mode first with the order's mode passed on every call and live once the owner takes this app live, every Stripe call in backend.js with no Stripe.js in the page, one pending order then one Checkout Session opened in a new tab, an order marked paid only after the backend reads the session back from Stripe and matches it to the order, integer amounts in cents, and a scheduled sweep that settles orders whose buyer never came back. A storefront, plans page, booking page or invoice maker that only records orders or marks invoices paid by hand takes no payment and does not need this; offer it as the [pay] option instead",
141575
+ description: "Taking real money, one-time, through Stripe: pay a bill, check or invoice, tip, donate, sell tickets or products, deposit, dues, checkout, Apple Pay, Venmo, Cash App, Zelle, Chime; not Square (square), recurring (stripe-subscriptions) or orders only recorded",
141569
141576
  cues: [
141570
141577
  "stripe",
141571
141578
  "take payments",
@@ -141657,7 +141664,7 @@ var init_stripe_subscriptions = __esm({
141657
141664
  stripeSubscriptionsConfig = {
141658
141665
  name: "stripe-subscriptions",
141659
141666
  label: "Stripe subscriptions",
141660
- description: "A paid membership or subscription through Stripe Checkout in subscription mode, ONLY when the person asks for recurring money \u2014 monthly, yearly, subscribe, membership fee, paid tier, paywall \u2014 into the owner's own Stripe account through ctx.stripe, connected once with Connect Stripe: the plans are the owner's, plan records in the app's database with a price and a month or year interval that only the owner writes (access.js) from the app's own Plans screen, starting empty with the owner's first plan, and backend.js subscribes at the price it reads from the plan the member names, never an amount from the browser or a constant in backend.js; the Connect Stripe and Customer Portal setup items, test mode first with the membership's mode passed on every call and live once the owner takes this app live, every Stripe call in backend.js with no Stripe.js in the page, one pending membership then one Checkout Session opened in a new tab, entitlement computed from Stripe's status plus one GRACE_DAYS knob for a past_due card, members-only content as a channel the membership record grants and the backend withdraws, cancellation and card changes in Stripe's Customer Portal, and a scheduled sweep that re-reads every live subscription. A one-time charge (dues once, a ticket, a deposit) is the stripe skill; an app with members-only content that charges nothing does not need this \u2014 offer it as the [pay] option instead",
141667
+ description: "A paid membership or subscription through Stripe, only when asked for recurring money: monthly, yearly, subscribe, membership fee, paid tier, paywall; a one-time charge is stripe, and free members-only content needs neither",
141661
141668
  cues: [
141662
141669
  "subscription",
141663
141670
  "subscribe",
@@ -141688,7 +141695,7 @@ var init_member_area = __esm({
141688
141695
  memberAreaConfig = {
141689
141696
  name: "member-area",
141690
141697
  label: "Member area with tiers",
141691
- description: "A member area with TIERS on top of a payment recipe \u2014 gold and platinum, supporter levels, a top tier that gets the owner's own tools \u2014 for a creator's audience from YouTube, a newsletter or a community: load it beside stripe-subscriptions (renewing, the default), square (when the person names Square) or stripe (dues or a season pass), never on its own, and only when the person asks for tiers, a members' discussion or members-only tools. Each tier is an owner-written plan record with a rank, copied onto the membership by backend.js; a member of rank N holds channels tier-1 through tier-N while entitled; every post, room and message names its lowest tier in minRank; members post in rooms their tier reads, checked with ctx.requireAccess in access.js; members-only tools run in backend.js and answer 403 below the tool's rank before ctx.callAI; on Square or a one-time Stripe charge a tier is a pass whose paidThrough each paid order moves forward. One database for memberships, plans, posts, rooms and messages. A single members-only feed with one price and no tiers, discussion or tools is stripe-subscriptions alone",
141698
+ description: "A member area with tiers (gold and platinum, supporter levels), a members' discussion or members-only tools; load only beside stripe-subscriptions (default), square or stripe; one price with no tiers, discussion or tools is stripe-subscriptions alone",
141692
141699
  cues: [
141693
141700
  "member area",
141694
141701
  "members area",
@@ -141720,7 +141727,7 @@ var init_blockly = __esm({
141720
141727
  // The Blockly theme reads the tokens through lib/look.js; the doc called cssColor without defining it.
141721
141728
  needs: ["canvas-theme-colors"],
141722
141729
  label: "Blockly",
141723
- description: "Block editors built with Blockly, where people snap pieces together instead of typing code. Two audiences, one recipe. Teaching code: Scratch-like coding playgrounds for kids and beginners, drag-and-drop page builders with a live preview and Code Peek, turtle and robot sequences. Business logic edited by the people who own it: no-code rules engines (credit scoring, fraud flags, approval thresholds, compliance checks, discount and pricing rules, eligibility, routing and triage) whose blocks compile to a JSON rule tree the app evaluates in the browser and in backend.js; CRM, ERP and ticket workflow automations (when a record arrives, if it matches, tag it, assign it, send it to a queue, schedule a follow-up); low-code form and screen builders; device, robot and conveyor step sequences; QA, test-case and integration scripts (steps, expectations, mock responses). Covers the one pinned esm.sh ?bundle import, custom blocks with connection checks as the type system, JSON toolboxes with shadow defaults, custom CodeGenerator output (HTML, JSON, steps) and the standard javascriptGenerator run in a sandboxed iframe with step highlighting, workspace JSON saved to Fireproof with autosave, a Blockly theme from the app's tokens, locales via setLocale, and the zelos renderer on phones. blockly, scratch, blocks, block editor, visual programming, drag and drop code, no-code, low-code, rules engine, rule builder, decision rules, business rules, policy builder, workflow builder, automation builder, if-this-then-that, approval flow, test builder, puzzle pieces",
141730
+ description: "Block editors built with Blockly, snapping pieces together instead of typing code: Scratch-like coding for kids, visual programming, drag-and-drop page, form or screen builders, no-code rules engines, approval flows, workflow or automation builders, test builders",
141724
141731
  cues: [
141725
141732
  "blockly",
141726
141733
  "scratch",
@@ -141779,7 +141786,7 @@ var init_strudel = __esm({
141779
141786
  name: "strudel",
141780
141787
  needs: ["web-audio"],
141781
141788
  label: "Strudel live coding",
141782
- description: "Live-coding music with Strudel, where the music is a pattern written as text: a pattern pad with an editor, examples, play and stop and saved patterns; a groovebox whose pads write mini-notation and whose lights follow the engine's events; knob instruments that re-evaluate a pattern as sliders move; generative radios; a prompt box that asks callAI to rewrite the groove; a shared groovebook with an access rule. Covers the AGPL engine fetched at play time by a pinned esm.sh dynamic import in a memoized player (never bundled, credited visibly), the engine and every pattern running in a sandboxed frame the app drives by postMessage, so a shared pattern never reaches the app's data, the Dirt-Samples kit and the drum-machine banks from jsDelivr, mini-notation and the effect chain, the verbatim text-to-pattern system prompt for callAI, cpm as cycles per minute with the beats-per-cycle table, onEvalError for patterns that did not compile, hush on stop, and onTrigger for visuals. strudel, tidal, tidalcycles, live coding, livecoding, algorave, mini-notation, pattern music, algorithmic music, generative music, text patterns, code music",
141789
+ description: "Live-coding music with Strudel, where the music is a pattern written as text: pattern pads, grooveboxes, knob instruments, generative radios, an AI box that rewrites the groove, a shared groovebook; also tidal, tidalcycles, algorave, mini-notation, algorithmic or generative music",
141783
141790
  // The engine's own entry points, which the doc imports at play time rather than declares.
141784
141791
  teaches: ["initStrudel", "setAudioContext"],
141785
141792
  cues: [
@@ -141816,7 +141823,7 @@ var init_hydra = __esm({
141816
141823
  hydraConfig = {
141817
141824
  name: "hydra",
141818
141825
  label: "Hydra live-coded visuals",
141819
- description: "Live-coded video with Hydra, the browser video synth of the algorave scene, where a moving picture is a chain of functions written as text (osc, noise, voronoi, shape, kaleid, modulate, feedback through src(o0)): a sketch pad with an editor, examples, a callAI box that rewrites the sketch and a shared gallery; a video synth whose knobs write the sketch, with the camera as a source; VJ decks and full-screen visuals for a set; visuals that move with the room's sound or with a Strudel pattern's beat through a.fft. Covers the AGPL engine fetched after first paint by a pinned esm.sh dynamic import (never bundled, credited visibly), the engine and every sketch running in a sandboxed frame the app drives by postMessage, so a shared sketch never reaches the app's data, errors shown while the last good one plays, the verbatim text-to-sketch system prompt, the microphone and camera from a press. hydra, hydra-synth, live coding visuals, livecoding visuals, live visuals, video synth, vj, vjing, algorithmic video, generative video, audio-reactive visuals, algorave visuals, feedback visuals, kaleidoscope visuals",
141826
+ description: "Hydra live-coded visuals and video synths: a sketch pad with examples, a shared gallery and an AI box that rewrites the sketch, the camera as a source, VJ decks, full-screen visuals for a set, algorave, kaleidoscope, feedback or generative video, audio-reactive visuals that follow sound or a Strudel beat",
141820
141827
  needs: ["surface-stage"],
141821
141828
  teaches: ["hydra-synth"],
141822
141829
  cues: [
@@ -141860,7 +141867,7 @@ var init_physics = __esm({
141860
141867
  // The stage paints in the theme tokens through lib/look.js (canvas theme colours).
141861
141868
  needs: ["canvas-theme-colors"],
141862
141869
  label: "Physics (Matter.js)",
141863
- description: "2D physics toys and games built with Matter.js, where objects have mass and meet other objects: marble runs and Rube Goldberg builders whose pieces are documents with build and play modes, plinko and pachinko, slingshots and catapults that knock a tower down, dominoes, pinball, ragdolls and soft bodies, word piles and pages whose elements fall and can be flicked. Covers the pinned esm.sh default import, the engine in a ref with a fixed-step loop and disposal, painting bodies from their vertices on a DPR canvas in the app's theme tokens, the mouse constraint with pixelRatio for touch, pieces as Fireproof documents rebuilt into bodies, seeded replays, labelled collisions and sensors for scoring, and the Render.create ordering trap. physics, gravity, bounce, bouncy, collide, collision, tumble, fall, marble run, rube goldberg, plinko, pachinko, catapult, slingshot, dominoes, knock down the tower, pinball, ragdoll, soft body, matter.js. Anything played or steered also loads touch-games for phone controls",
141870
+ description: "2D physics toys and games where objects fall, bounce and collide: marble runs, Rube Goldberg, plinko, pachinko, slingshots, catapults, dominoes, pinball, ragdolls, Matter.js; if played or steered also load touch-games",
141864
141871
  cues: [
141865
141872
  "physics",
141866
141873
  "gravity",
@@ -141907,7 +141914,7 @@ var init_worlds = __esm({
141907
141914
  // The palette comes from the theme tokens through lib/look.js (canvas theme colours).
141908
141915
  needs: ["canvas-theme-colors"],
141909
141916
  label: "Generative worlds",
141910
- description: "Living simulations on a canvas: ecosystems and terrariums (grass, grazers, hunters), ant farms, Conway's Game of Life and other cellular automata, falling sand, forest fires, boids and flocks, petri dishes, weather drifting over a map \u2014 a grid of cells in a typed array, two rule functions that seed and step it, one seeded random generator so the same seed grows the same world on every device, a tick loop on its own clock with play, pause, step and speed, the grid painted as pixels through ImageData in the app's theme colours, dials for the rates, a census on a slow clock, and kept moments as recipes (seed, dials, tick, recorded taps) that replay into a living gallery. ecosystem, terrarium, ant farm, game of life, cellular automaton, falling sand, forest fire, boids, flocking, simulation, petri dish, predator prey, evolution, artificial life, screensaver world. Anything played or steered also loads touch-games for phone controls; a 3D world the person walks through as a player is three-js with world-controls",
141917
+ description: "Living simulations on a canvas: ecosystems, terrariums, ant farms, Game of Life, cellular automata, falling sand, forest fires, boids, predator prey, weather drifting over a map; if played or steered add touch-games; walkable 3D worlds are three-js with world-controls",
141911
141918
  cues: [
141912
141919
  "ecosystem",
141913
141920
  "terrarium",
@@ -141954,7 +141961,7 @@ var init_motion = __esm({
141954
141961
  motionConfig = {
141955
141962
  name: "motion",
141956
141963
  label: "Motion (scroll and gesture animation)",
141957
- description: "Pages that move when you scroll, tap and wait, built on Motion's vanilla animate, scroll, inView, stagger and press: launch and story pages whose sections reveal as they arrive, a bar that fills with how far you have read, numbers that count up, headline sequences with timed offsets and springs, cards that spring in, buttons that squash when pressed, parallax heroes, scroll-told explainers. Covers the pinned lazy import of the vanilla entry (no second React), a helper module whose every helper returns a stop for the effect's cleanup and reads reduced motion when it runs, above-the-fold content that stays visible, scroll progress with target and offset, sequences with at, springs, gestures, and keeping JSX class-only while Motion writes transforms through refs. animation, animate, scroll animation, scroll-driven, scrollytelling, parallax, reveal on scroll, fade in on scroll, count up, spring, bounce, micro-interaction, press effect, landing page motion, feel alive, motion one, framer motion, gsap",
141964
+ description: "Scroll and tap animation for pages: reveal on scroll, scrollytelling, parallax heroes, count-up numbers, springs, press effects, micro-interactions, landing page motion, framer motion, gsap, feel alive",
141958
141965
  cues: [
141959
141966
  "animation",
141960
141967
  "animate",
@@ -142001,7 +142008,7 @@ var init_richtext = __esm({
142001
142008
  richtextConfig = {
142002
142009
  name: "richtext",
142003
142010
  label: "Rich text (Tiptap)",
142004
- description: "Notebooks, journals, wikis, notes apps and document editors built on Tiptap: pages with headings, lists, checklists, links and images, a list of documents and one editor, a shared page a team edits with the last editor named, meeting notes with action items, a recipe book with real pages, a journal with one entry per day. Covers every Tiptap package pinned to one version by its esm.sh URL (one ProseMirror, no second React), an editor module with createEditor, load, flush, run and destroy, a saved note as its JSON plus plain text and a derived title, a title field beside the page saved with the body (after its own pause and on close, so drafts keep their titles), saving after typing pauses with flush on blur and switch, loading a document without a save echo (setContent with emitUpdate false), destroy in the effect's cleanup, the page styled from the host with arbitrary variants, toolbar commands and active states, and images as _files. notebook, notes, note taking, journal, diary, wiki, document editor, rich text editor, text editor, wysiwyg, writing app, markdown editor, meeting notes, knowledge base, tiptap, prosemirror",
142011
+ description: "Notebooks, journals, diaries, wikis, notes apps and document editors with rich text pages: meeting notes, knowledge base, writing app, wysiwyg or markdown editor, a shared team page, Tiptap",
142005
142012
  cues: [
142006
142013
  "notebook",
142007
142014
  "notes app",
@@ -142049,7 +142056,7 @@ var init_match_style = __esm({
142049
142056
  name: "match-style",
142050
142057
  aliases: ["custom-look"],
142051
142058
  label: "Match style",
142052
- description: "The person brings an existing style to match \u2014 a brand guide, pasted CSS or design tokens, their own brand colours and font, a design system with its own components (Material 3, Apple's HIG / iOS settings, plain shadcn), or a screenshot or site to copy faithfully \u2014 so the app drops the look's components and wears that style: its palette written onto the theme variables in its own :root block, Google Fonts, plain JSX + Tailwind components",
142059
+ description: "The person brings an existing style to match: a brand guide, pasted CSS or design tokens, brand colours and font, a design system (Material 3, Apple's HIG or iOS settings, shadcn), a screenshot or site to copy; a mood or era described in words is reskin",
142053
142060
  cues: [
142054
142061
  "design system",
142055
142062
  "brand guide",
@@ -142093,7 +142100,7 @@ var init_reskin = __esm({
142093
142100
  reskinConfig = {
142094
142101
  name: "reskin",
142095
142102
  label: "Reskin",
142096
- description: `The person says "look like\u2026", "make it feel\u2026" or names a style or mood \u2014 "a 90s Mac app", "a newspaper", "chopped and screwed", "Y2K", "neo-brutalist", "like Stripe's dashboard" \u2014 with nothing to copy supplied: keep the look's components, logic and Look tab, and give them that appearance \u2014 the look's tokens re-scoped on one wrapper, its hook classes styled from a <style> string, web fonts, borders, texture, motion and a recomposed layout; a dark mode or a light and dark switch is a dark arm of the same skin on the look's own token names`,
142103
+ description: `The person says "look like\u2026", "make it feel\u2026" or names a style or mood (a 90s Mac app, Y2K, neo-brutalist, like Stripe's dashboard) or wants a dark mode, with nothing to copy supplied; a style they bring is match-style`,
142097
142104
  // The look kit's hook class. A surface on `rail: "reskin"` writes against it without needing reskin.
142098
142105
  teaches: ["data-reskin"],
142099
142106
  cues: [
@@ -142162,7 +142169,7 @@ var init_ui_feed = __esm({
142162
142169
  name: "ui-feed",
142163
142170
  aliases: ["pouf-feed"],
142164
142171
  label: "Feed block",
142165
- description: "Social feed to post updates, like them and reply in comments"
142172
+ description: "Social feed where people post updates, like them and reply in comments"
142166
142173
  };
142167
142174
  }
142168
142175
  });
@@ -142179,7 +142186,7 @@ var init_ui_chat = __esm({
142179
142186
  name: "ui-chat",
142180
142187
  aliases: ["pouf-chat"],
142181
142188
  label: "Chat block",
142182
- description: "Group chat with rooms, live message threads, who is in each room, and a composer",
142189
+ description: "Group chat with rooms and live message threads, showing who is in each room",
142183
142190
  // Each room is a live room: its link, who has it open and the invite are live-rooms'.
142184
142191
  needs: ["live-rooms"]
142185
142192
  };
@@ -142215,7 +142222,7 @@ var init_ui_inbox = __esm({
142215
142222
  name: "ui-inbox",
142216
142223
  aliases: ["pouf-inbox"],
142217
142224
  label: "Inbox block",
142218
- description: "Shared inbox to send notes, search, read, reply and archive"
142225
+ description: "Shared inbox to send notes, search, read, reply and archive; not for support tickets: use ui-support"
142219
142226
  };
142220
142227
  }
142221
142228
  });
@@ -142232,7 +142239,7 @@ var init_ui_support = __esm({
142232
142239
  name: "ui-support",
142233
142240
  aliases: ["pouf-support"],
142234
142241
  label: "Support block",
142235
- description: "Support desk to log tickets, filter the queue, reply, resolve"
142242
+ description: "Support desk to log tickets, filter the queue, reply and resolve; not for a general shared inbox of notes: use ui-inbox"
142236
142243
  };
142237
142244
  }
142238
142245
  });
@@ -142249,7 +142256,7 @@ var init_ui_crm = __esm({
142249
142256
  name: "ui-crm",
142250
142257
  aliases: ["pouf-crm"],
142251
142258
  label: "Crm block",
142252
- description: "Customer list with stages, account details and notes per contact"
142259
+ description: "Customer list (CRM) with stages, account details and notes per contact"
142253
142260
  };
142254
142261
  }
142255
142262
  });
@@ -142266,7 +142273,7 @@ var init_ui_inventory = __esm({
142266
142273
  name: "ui-inventory",
142267
142274
  aliases: ["pouf-inventory"],
142268
142275
  label: "Inventory block",
142269
- description: "Stock list with low-stock alerts, receiving and per-item details"
142276
+ description: "Inventory stock list with low-stock alerts, receiving and per-item details"
142270
142277
  };
142271
142278
  }
142272
142279
  });
@@ -142283,7 +142290,7 @@ var init_ui_editorial = __esm({
142283
142290
  name: "ui-editorial",
142284
142291
  aliases: ["pouf-editorial"],
142285
142292
  label: "Editorial block",
142286
- description: "Story pipeline moving drafts through scheduled to published"
142293
+ description: "Editorial story pipeline moving drafts through scheduled to published"
142287
142294
  };
142288
142295
  }
142289
142296
  });
@@ -142300,7 +142307,7 @@ var init_ui_event = __esm({
142300
142307
  name: "ui-event",
142301
142308
  aliases: ["pouf-event"],
142302
142309
  label: "Event block",
142303
- description: "Guest check-in desk with arrivals count, search and attendance filter"
142310
+ description: "Event guest check-in desk with arrivals count, search and attendance filter"
142304
142311
  };
142305
142312
  }
142306
142313
  });
@@ -142351,7 +142358,7 @@ var init_ui_settings = __esm({
142351
142358
  name: "ui-settings",
142352
142359
  aliases: ["pouf-settings"],
142353
142360
  label: "Settings block",
142354
- description: "Per-person settings with tabs, switches and a save bar"
142361
+ description: "Per-person settings page for each user's own preferences"
142355
142362
  };
142356
142363
  }
142357
142364
  });
@@ -142368,7 +142375,7 @@ var init_ui_onboarding = __esm({
142368
142375
  name: "ui-onboarding",
142369
142376
  aliases: ["pouf-onboarding"],
142370
142377
  label: "Onboarding block",
142371
- description: "Step-by-step setup wizard with progress; answers saved on finish"
142378
+ description: "Step-by-step setup wizard or onboarding flow with progress, where answers are saved on finish"
142372
142379
  };
142373
142380
  }
142374
142381
  });
@@ -142402,7 +142409,7 @@ var init_ui_storefront = __esm({
142402
142409
  name: "ui-storefront",
142403
142410
  aliases: ["pouf-storefront"],
142404
142411
  label: "Storefront block",
142405
- description: "Product grid the owner stocks and prices in the app, with filters, a shopping bag saved from the first Add as an open order with one line record per product, and an order; card payment is the stripe skill"
142412
+ description: "Shop storefront: product grid the owner stocks and prices in the app, with filters, a shopping bag and an order; not for card payment: use stripe"
142406
142413
  };
142407
142414
  }
142408
142415
  });
@@ -142419,7 +142426,7 @@ var init_ui_booking = __esm({
142419
142426
  name: "ui-booking",
142420
142427
  aliases: ["pouf-booking"],
142421
142428
  label: "Booking block",
142422
- description: "Appointment booking: pick a service, day and free slot, confirm; and a helper the owner adds, whose Today shows each of today's jobs as a work order (time, work and address; she greets the customer as the owner's helper) with Mark done and Add a photo (brief both whenever a helper is asked for, even an ask that names only what she sees), while prices and each customer's name and number stay with the owner"
142429
+ description: "Appointment booking: pick a service, day and free slot, confirm; also pick whenever a helper is asked for who sees today's jobs as work orders with Mark done and Add a photo, even if the ask names only what the helper sees"
142423
142430
  };
142424
142431
  }
142425
142432
  });
@@ -142470,7 +142477,7 @@ var init_ui_pricing = __esm({
142470
142477
  name: "ui-pricing",
142471
142478
  aliases: ["pouf-pricing"],
142472
142479
  label: "Pricing block",
142473
- description: "Pricing plans with a billing-cycle toggle; records plan requests, no payment"
142480
+ description: "Pricing plans page with a billing-cycle toggle; records plan requests only, takes no payment"
142474
142481
  };
142475
142482
  }
142476
142483
  });
@@ -142540,7 +142547,7 @@ var init_ui_weather = __esm({
142540
142547
  label: "Weather block",
142541
142548
  // "on sample figures": the lab on #8372 saw this row picked alone for a weather dashboard, which then
142542
142549
  // shipped the sample; the row now says the live data is the weather skill's.
142543
- description: 'Weather card with city and unit pickers, hourly strip and forecast, drawn on sample figures; name "weather" beside it for live forecasts'
142550
+ description: "Weather card UI with city and unit pickers, hourly strip and forecast, on sample figures only; for live forecasts also name weather beside it"
142544
142551
  };
142545
142552
  }
142546
142553
  });
@@ -142625,7 +142632,7 @@ var init_ui_quote = __esm({
142625
142632
  name: "ui-quote",
142626
142633
  aliases: ["pouf-quote"],
142627
142634
  label: "Quote block",
142628
- 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; and a helper the owner adds, whose Today shows each of today's jobs as a work order (time, work and address; she greets the customer as the owner's helper) with Mark done and Add a photo (brief both whenever a helper is asked for, even an ask that names only what she sees), while prices and each customer's name and number stay with the owner"
142635
+ description: "Quote or estimate page for a job priced by hand (detailer, cleaner, groomer, handyman): customers pick options, see a price range and send a request; also any ask for the owner's helper seeing today's jobs as work orders"
142629
142636
  };
142630
142637
  }
142631
142638
  });
@@ -142641,7 +142648,7 @@ var init_spreadsheet_import = __esm({
142641
142648
  spreadsheetImportConfig = {
142642
142649
  name: "spreadsheet-import",
142643
142650
  label: "Spreadsheet import",
142644
- 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",
142651
+ description: "Import a spreadsheet file (CSV or TSV exported from Excel, Numbers or Google Sheets): an existing list of clients, contacts, jobs, stock or members; a short list typed or pasted into a form does not need it",
142645
142652
  cues: ["csv", "tsv", "spreadsheet", "import my", "excel", "google sheet", "google sheets"]
142646
142653
  };
142647
142654
  }
@@ -146958,7 +146965,7 @@ var init_looks2 = __esm({
146958
146965
  // The sketch is pouf-drawn; a build in the person's own style is told nothing of it.
146959
146966
  firstLook: false,
146960
146967
  servedPaletteSlug: "default",
146961
- mintWhen: 'only when the person brings an existing style to match \u2014 a brand guide, pasted CSS or tokens, their own brand colours or font, a design system such as Material 3, shadcn or iOS settings, a screenshot to copy \u2014 and name the "match-style" skill with it; a described appearance alone ("look like a 90s Mac app") stays on the default look with the "reskin" skill'
146968
+ mintWhen: 'only for a brought style to match (brand guide, pasted CSS, a screenshot), with the "match-style" skill; a described look stays default with "reskin"'
146962
146969
  }
146963
146970
  };
146964
146971
  LOOK_SLUGS = Object.keys(LOOKS);
@@ -148569,16 +148576,17 @@ async function readGuestCredits(vctx, userId) {
148569
148576
  );
148570
148577
  if (lost.isErr()) return Result.Err(lost.Err());
148571
148578
  const lostPromptIds = new Set(lost.Ok().map((r2) => r2.promptId));
148572
- let spentCents = 0;
148579
+ let spentCredits = 0;
148573
148580
  for (const row of rows.Ok()) {
148574
148581
  if (lostPromptIds.has(row.promptId)) continue;
148575
148582
  if (isFreeRepairRow(row.ref)) continue;
148576
148583
  if (isEmptyTurnRow(row.ref)) continue;
148577
148584
  if (isLostTurnRow(row.ref)) continue;
148578
148585
  const parsed2 = usageRef(row.ref);
148579
- spentCents += parsed2 instanceof type.errors ? costCentsFromUsage({ given: [], calculated: { total_tokens: row.totalTokens } }) : costCentsFromUsage(parsed2.usage);
148586
+ spentCredits += creditsForCents(
148587
+ parsed2 instanceof type.errors ? costCentsFromUsage({ given: [], calculated: { total_tokens: row.totalTokens } }) : costCentsFromUsage(parsed2.usage)
148588
+ );
148580
148589
  }
148581
- const spentCredits = spentCents * DISPLAY_CREDITS_PER_CENT;
148582
148590
  const included = await includedCreditsOf(vctx, userId);
148583
148591
  if (included.isErr()) return Result.Err(included.Err());
148584
148592
  return Result.Ok({
@@ -150045,6 +150053,119 @@ var init_access_output_read = __esm({
150045
150053
  }
150046
150054
  });
150047
150055
 
150056
+ // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/friend-acted-shape.ts
150057
+ async function inviteDigest(inviteId) {
150058
+ return (await capiSha256Hex(`friendinvite:${inviteId}`)).slice(0, 32);
150059
+ }
150060
+ async function friendInviteDigest(flow, inviteKey) {
150061
+ return inviteDigest(flow === "game" ? inviteKey : `${flow}:${inviteKey}`);
150062
+ }
150063
+ function hoursSinceInvite(invitedMs, actedMs) {
150064
+ return Math.round(Math.max(0, actedMs - invitedMs) / 36e3) / 100;
150065
+ }
150066
+ function friendActedCapture(fact) {
150067
+ return {
150068
+ event: fact.event ?? FRIEND_ACTED_EVENT,
150069
+ distinctId: `friend-invite:${fact.inviteDigest}`,
150070
+ properties: {
150071
+ $process_person_profile: false,
150072
+ flow: fact.flow,
150073
+ invite_key: fact.inviteDigest,
150074
+ hours_since_invite: fact.hoursSinceInvite,
150075
+ verdict: fact.verdict,
150076
+ paid: fact.paid,
150077
+ outcome: fact.outcome
150078
+ }
150079
+ };
150080
+ }
150081
+ var FRIEND_ACTED_EVENT, FRIEND_ACTED_PAID_EVENT, FRIEND_ACTED_COUNT_WINDOW_MS;
150082
+ var init_friend_acted_shape = __esm({
150083
+ "../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/friend-acted-shape.ts"() {
150084
+ "use strict";
150085
+ init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process();
150086
+ init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console();
150087
+ init_performance2();
150088
+ init_types4();
150089
+ FRIEND_ACTED_EVENT = "friend_acted";
150090
+ FRIEND_ACTED_PAID_EVENT = "friend_acted_paid";
150091
+ FRIEND_ACTED_COUNT_WINDOW_MS = 48 * 36e5;
150092
+ __name(inviteDigest, "inviteDigest");
150093
+ __name(friendInviteDigest, "friendInviteDigest");
150094
+ __name(hoursSinceInvite, "hoursSinceInvite");
150095
+ __name(friendActedCapture, "friendActedCapture");
150096
+ }
150097
+ });
150098
+
150099
+ // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/friend-invite-sent.ts
150100
+ function friendInviteSentCapture(flow, inviteDigest2, senderId) {
150101
+ const account = senderId !== void 0 && senderId !== "" && isGuestPrincipal(senderId) === false ? senderId : void 0;
150102
+ return {
150103
+ event: FRIEND_INVITE_SENT_EVENT,
150104
+ distinctId: account ?? `friend-invite:${inviteDigest2}`,
150105
+ properties: {
150106
+ ...account === void 0 ? { $process_person_profile: false } : {},
150107
+ flow,
150108
+ invite_key: inviteDigest2
150109
+ }
150110
+ };
150111
+ }
150112
+ async function captureFriendInviteSent(vctx, args2, timeoutMs = FRIEND_INVITE_SENT_TIMEOUT_MS) {
150113
+ const r2 = await exception2Result(async () => {
150114
+ if (args2.preview === true) return "skipped";
150115
+ const testTraffic = typeof args2.testTraffic === "function" ? await args2.testTraffic() : args2.testTraffic === true;
150116
+ if (testTraffic) return "skipped";
150117
+ const digest2 = await friendInviteDigest(args2.flow, args2.inviteKey);
150118
+ const capture = friendInviteSentCapture(args2.flow, digest2, args2.senderId);
150119
+ const sink = {
150120
+ ...vctx,
150121
+ ...args2.country === void 0 ? {} : { analyticsCountry: args2.country },
150122
+ analyticsFetch: /* @__PURE__ */ __name((input3, init) => vctx.analyticsFetch(input3, { ...init, signal: AbortSignal.timeout(timeoutMs) }), "analyticsFetch")
150123
+ };
150124
+ const sent = await capturePostHogServerEvent(sink, {
150125
+ ...capture,
150126
+ ...args2.sentAt === void 0 ? {} : { timestamp: args2.sentAt }
150127
+ });
150128
+ return sent === "skipped:not-us" ? "not-us" : sent === "skipped:no-key" ? "skipped" : sent;
150129
+ });
150130
+ if (r2.isErr()) {
150131
+ console.error("[friend-acted] friend_invite_sent capture failed", r2.Err());
150132
+ return "failed";
150133
+ }
150134
+ return r2.Ok();
150135
+ }
150136
+ function scheduleFriendInviteSent(vctx, args2) {
150137
+ const r2 = exception2Result(() => {
150138
+ const senderId = args2.senderId;
150139
+ const task = captureFriendInviteSent(vctx, {
150140
+ ...args2,
150141
+ preview: vctx.params.vibes.env.ENVIRONMENT === "preview",
150142
+ testTraffic: args2.testTraffic ?? (async () => senderId === void 0 || senderId === "" ? false : isTestTrafficSettings(await readSettings(vctx.sql, senderId)))
150143
+ });
150144
+ vctx.waitUntil?.(task);
150145
+ });
150146
+ if (r2.isErr()) console.error("[friend-acted] friend_invite_sent schedule failed", r2.Err());
150147
+ }
150148
+ var FRIEND_INVITE_SENT_EVENT, FRIEND_INVITE_SENT_TIMEOUT_MS;
150149
+ var init_friend_invite_sent = __esm({
150150
+ "../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/friend-invite-sent.ts"() {
150151
+ "use strict";
150152
+ init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process();
150153
+ init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console();
150154
+ init_performance2();
150155
+ init_esm();
150156
+ init_types4();
150157
+ init_analytics();
150158
+ init_capi_share_event();
150159
+ init_friend_acted_shape();
150160
+ init_test_traffic();
150161
+ FRIEND_INVITE_SENT_EVENT = "friend_invite_sent";
150162
+ __name(friendInviteSentCapture, "friendInviteSentCapture");
150163
+ FRIEND_INVITE_SENT_TIMEOUT_MS = 5e3;
150164
+ __name(captureFriendInviteSent, "captureFriendInviteSent");
150165
+ __name(scheduleFriendInviteSent, "scheduleFriendInviteSent");
150166
+ }
150167
+ });
150168
+
150048
150169
  // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/public/invite-flow.ts
150049
150170
  function canonicalEmail2(email4) {
150050
150171
  const [lhs, domain3] = email4.trim().toLowerCase().split("@");
@@ -150204,6 +150325,7 @@ var init_invite_flow2 = __esm({
150204
150325
  init_check_auth();
150205
150326
  init_owns_owner_handle();
150206
150327
  init_email_invite_friend_acted();
150328
+ init_friend_invite_sent();
150207
150329
  init_expressions();
150208
150330
  init_out4();
150209
150331
  GOOGLE_DOMAINS2 = /* @__PURE__ */ new Set(["gmail.com", "googlemail.com"]);
@@ -150287,6 +150409,11 @@ var init_invite_flow2 = __esm({
150287
150409
  grant: val,
150288
150410
  op: "upsert"
150289
150411
  });
150412
+ scheduleFriendInviteSent(vctx, {
150413
+ flow: "app_invite",
150414
+ inviteKey: inviteGrantKey({ userId, ownerHandle: req.ownerHandle, appSlug: req.appSlug, emailKey }),
150415
+ senderId: userId
150416
+ });
150290
150417
  await ctx.send.send(ctx, val);
150291
150418
  return Result.Ok(EventoResult.Continue);
150292
150419
  }
@@ -151400,7 +151527,7 @@ var init_agent_session_instruction = __esm({
151400
151527
  init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console();
151401
151528
  init_performance2();
151402
151529
  init_types4();
151403
- AGENT_SESSION_INSTRUCTION_VERSION = "2026-12-04.2";
151530
+ AGENT_SESSION_INSTRUCTION_VERSION = "2026-12-04.4";
151404
151531
  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.`;
151405
151532
  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}`;
151406
151533
  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.`;
@@ -158477,11 +158604,17 @@ async function loadGroupHead(sql2, match4) {
158477
158604
  const c2 = match4.live.config;
158478
158605
  const t3 = sql2.tables.appDocuments;
158479
158606
  const dbName = c2.groupDbPrefix === void 0 ? c2.dbName : `${c2.groupDbPrefix}${match4.groupKey}`;
158480
- const rows = await sql2.db.select({ seq: t3.seq, created: t3.created, deleted: t3.deleted, data: t3.data }).from(t3).where(and(eq(t3.ownerHandle, c2.ownerHandle), eq(t3.appSlug, c2.appSlug), eq(t3.dbName, dbName), eq(t3.docId, groupDocIdOf(match4)))).orderBy(asc(t3.seq)).limit(GROUP_READ_LIMIT).then((r2) => r2);
158607
+ const rows = await sql2.db.select({ seq: t3.seq, created: t3.created, deleted: t3.deleted, data: t3.data, userId: t3.userId }).from(t3).where(and(eq(t3.ownerHandle, c2.ownerHandle), eq(t3.appSlug, c2.appSlug), eq(t3.dbName, dbName), eq(t3.docId, groupDocIdOf(match4)))).orderBy(asc(t3.seq)).limit(GROUP_READ_LIMIT).then((r2) => r2);
158481
158608
  const live = rows.filter((r2) => Number(r2.deleted) !== 1);
158482
158609
  if (rows.length === 0 || live.length === 0) return void 0;
158483
158610
  const firstCreatedMs = Date.parse(rows[0].created);
158484
- return { firstCreatedMs, latest: recordOf(live[live.length - 1].data), first: recordOf(rows[0].data) };
158611
+ const firstUserId = rows[0].userId;
158612
+ return {
158613
+ firstCreatedMs,
158614
+ latest: recordOf(live[live.length - 1].data),
158615
+ first: recordOf(rows[0].data),
158616
+ ...typeof firstUserId === "string" && firstUserId !== "" ? { firstUserId } : {}
158617
+ };
158485
158618
  }
158486
158619
  function groupNeverPays(match4, head, nowMs, windowMs) {
158487
158620
  const c2 = match4.live.config;
@@ -162696,6 +162829,57 @@ var init_friend_acted_store = __esm({
162696
162829
  });
162697
162830
 
162698
162831
  // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/web-group-friend-acted.ts
162832
+ async function startedHost(ctx, match4, head) {
162833
+ if (judgedFromWrite(match4)) return { host: void 0 };
162834
+ if (match4.live.shape.captain !== void 0) {
162835
+ const captain = match4.live.shape.captain;
162836
+ const raw = groupState({ match: match4, revisions: await ctx.reads.groupRevisions(match4) });
162837
+ if (raw.contributions.some((d3) => d3.data[captain.field] === true) === false) return "no-starter-yet";
162838
+ return { host: await resolveGroupStarter(ctx.reads.userIdOfHandle, match4, raw) };
162839
+ }
162840
+ return isRealWriter(head.firstUserId) ? { host: head.firstUserId } : "no-starter";
162841
+ }
162842
+ async function recordWebGroupStarted(ctx, args2) {
162843
+ const { match: match4, nowMs } = args2;
162844
+ const c2 = match4.live.config;
162845
+ const memoKey3 = `${c2.ownerHandle}/${c2.appSlug}\0${c2.experiment}\0${match4.groupKey}`;
162846
+ const until = startedSent.get(memoKey3);
162847
+ if (until !== void 0 && until > nowMs) return "skipped";
162848
+ const done = /* @__PURE__ */ __name((outcome) => {
162849
+ if (startedSent.size >= SKIP_MAX) startedSent.clear();
162850
+ startedSent.set(memoKey3, nowMs + SKIP_MS);
162851
+ return outcome;
162852
+ }, "done");
162853
+ if (ctx.analytics !== void 0 && isUsCountry(ctx.analytics.analyticsCountry) === false) return "not-us";
162854
+ const r2 = await exception2Result(async () => {
162855
+ const head = await ctx.reads.groupHead(match4);
162856
+ if (head === void 0) return "no-group";
162857
+ if (nowMs - head.firstCreatedMs > FRIEND_ACTED_COUNT_WINDOW_MS + CLOCK_SLACK_MS) return done("window-closed");
162858
+ if (isSeedGroup(match4, { data: head.latest })) return done("seed");
162859
+ const starter = await startedHost(ctx, match4, head);
162860
+ if (starter === "no-starter-yet") return "no-starter";
162861
+ if (starter === "no-starter") return done("no-starter");
162862
+ if (starter.host !== void 0 && await ctx.hostTestTraffic(starter.host)) return done("test-traffic");
162863
+ if (ctx.analytics === void 0) return done("not-captured");
162864
+ const sent = await captureFriendInviteSent(
162865
+ ctx.analytics,
162866
+ {
162867
+ flow: "web_group",
162868
+ inviteKey: webGroupInviteKey(match4),
162869
+ preview: ctx.preview === true,
162870
+ sentAt: new Date(head.firstCreatedMs).toISOString()
162871
+ },
162872
+ ...ctx.captureTimeoutMs === void 0 ? [] : [ctx.captureTimeoutMs]
162873
+ );
162874
+ if (sent === "failed" || sent === "not-us") return sent;
162875
+ return done(sent === "sent" ? "sent" : "not-captured");
162876
+ });
162877
+ if (r2.isErr()) {
162878
+ console.error("[friend-acted] web group start failed", r2.Err());
162879
+ return "failed";
162880
+ }
162881
+ return r2.Ok();
162882
+ }
162699
162883
  function str3(v3) {
162700
162884
  return typeof v3 === "string" && v3 !== "" ? v3 : void 0;
162701
162885
  }
@@ -162831,7 +163015,7 @@ function firstContributions(match4, state2) {
162831
163015
  }
162832
163016
  return out;
162833
163017
  }
162834
- var POTLUCK_ACT_KINDS, CLOCK_SLACK_MS, SKIP_MS, SKIP_MAX, skipUntil;
163018
+ var POTLUCK_ACT_KINDS, CLOCK_SLACK_MS, SKIP_MS, SKIP_MAX, skipUntil, startedSent;
162835
163019
  var init_web_group_friend_acted = __esm({
162836
163020
  "../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/web-group-friend-acted.ts"() {
162837
163021
  "use strict";
@@ -162844,11 +163028,15 @@ var init_web_group_friend_acted = __esm({
162844
163028
  init_friend_acted_recorder();
162845
163029
  init_friend_acted_store();
162846
163030
  init_web_group_live();
163031
+ init_friend_invite_sent();
162847
163032
  POTLUCK_ACT_KINDS = /* @__PURE__ */ new Set(["start", "claim", "change", "release", "add", "undo"]);
162848
163033
  CLOCK_SLACK_MS = 6e4;
162849
163034
  SKIP_MS = 24 * 60 * 60 * 1e3;
162850
163035
  SKIP_MAX = 5e3;
162851
163036
  skipUntil = /* @__PURE__ */ new Map();
163037
+ startedSent = /* @__PURE__ */ new Map();
163038
+ __name(startedHost, "startedHost");
163039
+ __name(recordWebGroupStarted, "recordWebGroupStarted");
162852
163040
  __name(str3, "str");
162853
163041
  __name(recordOf2, "recordOf");
162854
163042
  __name(webGroupInviteKey, "webGroupInviteKey");
@@ -163306,6 +163494,19 @@ async function runWebGroupWrite(ctx, args2) {
163306
163494
  const credentialed = ctx.capiToken !== void 0 && ctx.capiToken !== "" && ctx.pixelId !== void 0 && ctx.pixelId !== "";
163307
163495
  if (args2.rungMatch !== void 0 && credentialed) await runWebGroupRungs(shared, { match: args2.rungMatch, nowMs: args2.nowMs });
163308
163496
  const friend = args2.friend;
163497
+ const started = friend === void 0 ? Promise.resolve() : recordWebGroupStarted(
163498
+ {
163499
+ reads: shared.reads,
163500
+ hostTestTraffic: /* @__PURE__ */ __name(async (hostRef) => (await readFriendHost(friend.ctx.recorder, { hostUserId: hostRef, testTraffic: false })).testTraffic, "hostTestTraffic"),
163501
+ ...friend.ctx.recorder.analytics === void 0 ? {} : { analytics: friend.ctx.recorder.analytics },
163502
+ ...friend.ctx.preview === true ? { preview: true } : {}
163503
+ },
163504
+ { match: friend.match, nowMs: args2.nowMs }
163505
+ );
163506
+ await exception2Result(() => runFriendAndReturned(shared, friend, args2.returned, args2));
163507
+ await started;
163508
+ }
163509
+ async function runFriendAndReturned(shared, friend, returned, args2) {
163309
163510
  if (friend !== void 0) {
163310
163511
  const r2 = await exception2Result(
163311
163512
  () => recordWebGroupFriendActed(
@@ -163315,7 +163516,6 @@ async function runWebGroupWrite(ctx, args2) {
163315
163516
  );
163316
163517
  if (r2.isErr()) console.error("[friend-acted] web group task failed", r2.Err());
163317
163518
  }
163318
- const returned = args2.returned;
163319
163519
  if (returned === void 0) return;
163320
163520
  const rReturned = await exception2Result(
163321
163521
  () => recordWebGroupReturned(
@@ -163399,6 +163599,7 @@ var init_capi_web_group_event = __esm({
163399
163599
  init_lead_fanout();
163400
163600
  init_test_traffic();
163401
163601
  init_web_group_friend_acted();
163602
+ init_friend_acted_event();
163402
163603
  init_web_group_returned();
163403
163604
  init_web_group_live();
163404
163605
  __name(sqlWebGroupReads, "sqlWebGroupReads");
@@ -163430,53 +163631,11 @@ var init_capi_web_group_event = __esm({
163430
163631
  __name(taskWebGroupReads, "taskWebGroupReads");
163431
163632
  __name(runWebGroupRungs, "runWebGroupRungs");
163432
163633
  __name(runWebGroupWrite, "runWebGroupWrite");
163634
+ __name(runFriendAndReturned, "runFriendAndReturned");
163433
163635
  __name(scheduleWebGroupActive, "scheduleWebGroupActive");
163434
163636
  }
163435
163637
  });
163436
163638
 
163437
- // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/friend-acted-shape.ts
163438
- async function inviteDigest(inviteId) {
163439
- return (await capiSha256Hex(`friendinvite:${inviteId}`)).slice(0, 32);
163440
- }
163441
- async function friendInviteDigest(flow, inviteKey) {
163442
- return inviteDigest(flow === "game" ? inviteKey : `${flow}:${inviteKey}`);
163443
- }
163444
- function hoursSinceInvite(invitedMs, actedMs) {
163445
- return Math.round(Math.max(0, actedMs - invitedMs) / 36e3) / 100;
163446
- }
163447
- function friendActedCapture(fact) {
163448
- return {
163449
- event: fact.event ?? FRIEND_ACTED_EVENT,
163450
- distinctId: `friend-invite:${fact.inviteDigest}`,
163451
- properties: {
163452
- $process_person_profile: false,
163453
- flow: fact.flow,
163454
- invite_key: fact.inviteDigest,
163455
- hours_since_invite: fact.hoursSinceInvite,
163456
- verdict: fact.verdict,
163457
- paid: fact.paid,
163458
- outcome: fact.outcome
163459
- }
163460
- };
163461
- }
163462
- var FRIEND_ACTED_EVENT, FRIEND_ACTED_PAID_EVENT, FRIEND_ACTED_COUNT_WINDOW_MS;
163463
- var init_friend_acted_shape = __esm({
163464
- "../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/friend-acted-shape.ts"() {
163465
- "use strict";
163466
- init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process();
163467
- init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console();
163468
- init_performance2();
163469
- init_types4();
163470
- FRIEND_ACTED_EVENT = "friend_acted";
163471
- FRIEND_ACTED_PAID_EVENT = "friend_acted_paid";
163472
- FRIEND_ACTED_COUNT_WINDOW_MS = 48 * 36e5;
163473
- __name(inviteDigest, "inviteDigest");
163474
- __name(friendInviteDigest, "friendInviteDigest");
163475
- __name(hoursSinceInvite, "hoursSinceInvite");
163476
- __name(friendActedCapture, "friendActedCapture");
163477
- }
163478
- });
163479
-
163480
163639
  // ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/friend-acted-rules.ts
163481
163640
  function within(args2) {
163482
163641
  return Math.abs(args2.nowMs - args2.atMs) <= args2.windowMs;
@@ -175687,7 +175846,7 @@ function makeBackendAiCallback(vctx, base2) {
175687
175846
  () => captureCreditUsageMilestones(vctx, {
175688
175847
  userId,
175689
175848
  check: m.creditCheck,
175690
- chargedCredits: costCents * DISPLAY_CREDITS_PER_CENT,
175849
+ chargedCredits: creditsForCents(costCents),
175691
175850
  lane: `backend-${base2.lane}`,
175692
175851
  ownerHandle: base2.ownerHandle,
175693
175852
  appSlug: base2.appSlug,