@vibes.diy/api-svc 14.3.85 → 14.3.87

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.
Files changed (106) hide show
  1. package/create-handler.js +2 -0
  2. package/create-handler.js.map +1 -1
  3. package/index.d.ts +3 -1
  4. package/index.js +3 -1
  5. package/index.js.map +1 -1
  6. package/intern/agent-account-tools.d.ts +1 -0
  7. package/intern/agent-account-tools.js +1 -0
  8. package/intern/agent-account-tools.js.map +1 -1
  9. package/intern/agent-assembly.js +5 -1
  10. package/intern/agent-assembly.js.map +1 -1
  11. package/intern/agent-belt.d.ts +1 -3
  12. package/intern/agent-belt.js +25 -21
  13. package/intern/agent-belt.js.map +1 -1
  14. package/intern/agent-build-tools.d.ts +7 -0
  15. package/intern/agent-build-tools.js +6 -2
  16. package/intern/agent-build-tools.js.map +1 -1
  17. package/intern/agent-closing-options.d.ts +26 -0
  18. package/intern/agent-closing-options.js +130 -0
  19. package/intern/agent-closing-options.js.map +1 -0
  20. package/intern/agent-dispatcher.d.ts +1 -0
  21. package/intern/agent-dispatcher.js +17 -3
  22. package/intern/agent-dispatcher.js.map +1 -1
  23. package/intern/agent-session-instruction.d.ts +3 -2
  24. package/intern/agent-session-instruction.js +9 -7
  25. package/intern/agent-session-instruction.js.map +1 -1
  26. package/intern/agent-turn.d.ts +1 -0
  27. package/intern/agent-turn.js +1 -0
  28. package/intern/agent-turn.js.map +1 -1
  29. package/intern/alt-first-build.d.ts +48 -0
  30. package/intern/alt-first-build.js +179 -0
  31. package/intern/alt-first-build.js.map +1 -0
  32. package/intern/alt-landing.d.ts +13 -0
  33. package/intern/alt-landing.js +55 -0
  34. package/intern/alt-landing.js.map +1 -0
  35. package/intern/first-brief.d.ts +1 -1
  36. package/intern/first-brief.js +1 -1
  37. package/intern/first-brief.js.map +1 -1
  38. package/intern/first-build-classifier.d.ts +4 -4
  39. package/intern/first-build-classifier.js +15 -17
  40. package/intern/first-build-classifier.js.map +1 -1
  41. package/intern/first-build-race.d.ts +71 -0
  42. package/intern/first-build-race.js +257 -0
  43. package/intern/first-build-race.js.map +1 -0
  44. package/intern/instruction-variant.d.ts +23 -2
  45. package/intern/instruction-variant.js +159 -2
  46. package/intern/instruction-variant.js.map +1 -1
  47. package/intern/keeps-to-themselves.d.ts +1 -0
  48. package/intern/keeps-to-themselves.js +10 -0
  49. package/intern/keeps-to-themselves.js.map +1 -0
  50. package/intern/llm-tool-loop.d.ts +5 -1
  51. package/intern/llm-tool-loop.js +48 -15
  52. package/intern/llm-tool-loop.js.map +1 -1
  53. package/intern/mercury-capability-triggers.d.ts +1 -0
  54. package/intern/mercury-capability-triggers.js +95 -0
  55. package/intern/mercury-capability-triggers.js.map +1 -0
  56. package/intern/mercury-first-build-seam.d.ts +40 -5
  57. package/intern/mercury-first-build-seam.js +201 -14
  58. package/intern/mercury-first-build-seam.js.map +1 -1
  59. package/intern/mercury-first-build.d.ts +591 -21
  60. package/intern/mercury-first-build.js +2998 -287
  61. package/intern/mercury-first-build.js.map +1 -1
  62. package/intern/mercury-resilience.d.ts +70 -0
  63. package/intern/mercury-resilience.js +122 -0
  64. package/intern/mercury-resilience.js.map +1 -0
  65. package/intern/mint-decision.d.ts +1 -0
  66. package/intern/mint-decision.js +3 -0
  67. package/intern/mint-decision.js.map +1 -1
  68. package/intern/option-line-hold.d.ts +5 -0
  69. package/intern/option-line-hold.js +39 -0
  70. package/intern/option-line-hold.js.map +1 -0
  71. package/intern/pouf-room-catalog.d.ts +2 -0
  72. package/intern/pouf-room-catalog.js +11 -0
  73. package/intern/pouf-room-catalog.js.map +1 -0
  74. package/intern/retire-offer-options.d.ts +3 -0
  75. package/intern/retire-offer-options.js +91 -0
  76. package/intern/retire-offer-options.js.map +1 -0
  77. package/intern/seed-chat-section.d.ts +13 -0
  78. package/intern/seed-chat-section.js +62 -0
  79. package/intern/seed-chat-section.js.map +1 -1
  80. package/intern/server-first-build.js +1 -0
  81. package/intern/server-first-build.js.map +1 -1
  82. package/intern/vibe-font-catalog.d.ts +2 -0
  83. package/intern/vibe-font-catalog.js +8 -0
  84. package/intern/vibe-font-catalog.js.map +1 -0
  85. package/package.json +14 -14
  86. package/public/agent-turn-action.d.ts +1 -0
  87. package/public/agent-turn-action.js +256 -62
  88. package/public/agent-turn-action.js.map +1 -1
  89. package/public/agent-turn-assembly.js +5 -2
  90. package/public/agent-turn-assembly.js.map +1 -1
  91. package/public/prompt-chat-section.js +7 -5
  92. package/public/prompt-chat-section.js.map +1 -1
  93. package/public/prompt-turn-terminal.js +3 -1
  94. package/public/prompt-turn-terminal.js.map +1 -1
  95. package/public/report-activity.js +18 -2
  96. package/public/report-activity.js.map +1 -1
  97. package/public/vibe-traffic-source.js +1 -1
  98. package/public/vibe-traffic-source.js.map +1 -1
  99. package/types.d.ts +1 -0
  100. package/types.js.map +1 -1
  101. package/usage-report/new-user-alert-util.d.ts +6 -0
  102. package/usage-report/new-user-alert-util.js +30 -1
  103. package/usage-report/new-user-alert-util.js.map +1 -1
  104. package/intern/agent-options-tool.d.ts +0 -27
  105. package/intern/agent-options-tool.js +0 -213
  106. package/intern/agent-options-tool.js.map +0 -1
@@ -0,0 +1,95 @@
1
+ export const MERCURY_CAPABILITY_TRIGGERS = `A trigger is an example, not a password: set a capability when the request implies it in any words, and none when the app needs none of them. composer is set only together with ai.
2
+ - ai (a language model reads, writes or judges words or photos) when the request says or implies:
3
+ - a sentence typed in turns into the record's fields
4
+ - a pasted list gets sorted into groups
5
+ - answers a question about the saved records
6
+ - suggests what to make or do next from what is saved
7
+ - summarizes a long note into a few lines
8
+ - writes a caption, a blurb or a short poem
9
+ - a chat reply in a made-up persona's voice
10
+ - looks at a photo and says what is in it
11
+ - gives feedback on, rates or roasts what someone wrote
12
+ - translates or rewrites text in another tone
13
+ - comes up with names, prompts or ideas on request
14
+ - pulls the facts out of a pasted message or email
15
+ - makes up a story, a riddle or a fortune
16
+ - composer (records come in as the person's own words or photos, read by ai) when the request says or implies:
17
+ - add entries in my own words, however I like (also ai)
18
+ - paste a group chat and each item becomes a record (also ai)
19
+ - type a line like 'basil and two tomatoes, bed 3' to add plants (also ai)
20
+ - snap a photo of a receipt or label to add it (also ai)
21
+ - jot a quick note and it gets filed in the right place (also ai)
22
+ - imageGen (the app makes pictures) when the request says or implies:
23
+ - draws a picture of each item
24
+ - makes an avatar from a selfie
25
+ - restyles a photo as a cartoon or a painting
26
+ - a cover image for each story, album or book
27
+ - illustrates each creature or character card
28
+ - designs a logo or a badge
29
+ - shows what something would look like before it exists
30
+ - a colouring page or sticker made to order
31
+ - a product shot for each listing
32
+ - backend (server work the page cannot do on its own) when the request says or implies:
33
+ - reminds me tomorrow morning (also calendar)
34
+ - emails the manager every Monday (also calendar)
35
+ - a weekly digest or summary sent to the owner
36
+ - notifies someone when a new entry arrives
37
+ - pulls a live feed, prices or weather from a website
38
+ - reads a web page or API the person names
39
+ - sends each new record to Slack or a Google Sheet
40
+ - receives a webhook from a payment or code service
41
+ - checks something every hour and keeps the latest
42
+ - deals secret hands no other player can peek at (also boardGame)
43
+ - nags me when something goes overdue (also calendar)
44
+ - calendar (the app keeps dates) when the request says or implies:
45
+ - a due date or deadline on each item
46
+ - keeps a streak of days in a row
47
+ - a shift schedule for the week
48
+ - book an open time slot
49
+ - something that repeats every Tuesday
50
+ - a month view of what happened when
51
+ - subscribe to it from my phone's calendar (also backend)
52
+ - a timeline of dated moments
53
+ - totals for each pay period
54
+ - counts down the days to an event
55
+ - shows how long since I last did it
56
+ - audio (sound or music) when the request says or implies:
57
+ - plays a sound on each tap
58
+ - a drum machine or a beat pad
59
+ - a metronome that keeps time
60
+ - a little synth that plays notes
61
+ - background music or ambient sound
62
+ - records the mic and plays it back with an echo
63
+ - a chime when the timer ends
64
+ - threeD (a 3D world or scene) when the request says or implies:
65
+ - a 3D scene you can spin and zoom
66
+ - fly or drive through a world
67
+ - a physics simulator with things that fall and bounce
68
+ - a 3D model of a room, object or building
69
+ - particles, glow and shader effects
70
+ - a first-person walk around a place
71
+ - charts (graphs, maps and statistics views) when the request says or implies:
72
+ - a graph of progress over time
73
+ - a heatmap of activity
74
+ - a pie or bar chart of where the money went
75
+ - a stats page with averages and bests
76
+ - a map with pins
77
+ - a histogram or a scatter of the entries
78
+ - compares two things side by side in a chart
79
+ - boardGame (a turn-based board, tile or card game) when the request says or implies:
80
+ - bingo cards dealt per player
81
+ - a daily word guess with a share grid
82
+ - a crossword, word search or sudoku
83
+ - chess, checkers, go or mancala
84
+ - solitaire or another card game
85
+ - a trivia room people answer in turn
86
+ - a dice scoresheet with house rules
87
+ - players take turns on a shared board
88
+ - minesweeper, 2048 or tic-tac-toe
89
+ - sensitive (health, real people's money, kids, or private) when the request says or implies:
90
+ - tracks a medication, a symptom or a diagnosis
91
+ - about my kid or a child in my care
92
+ - a budget, debts, salary or what people owe
93
+ - the word private, or only me
94
+ - a mood or therapy journal`;
95
+ //# sourceMappingURL=mercury-capability-triggers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mercury-capability-triggers.js","sourceRoot":"","sources":["../../jsr/intern/mercury-capability-triggers.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BA6Fb,CAAC"}
@@ -5,14 +5,16 @@ import type { VibesApiSQLCtx } from "../types.js";
5
5
  import type { AgentActor } from "./agent-actor.js";
6
6
  import { type AgentBuildDispatcher, type FirstTurnMint } from "./agent-build-tools.js";
7
7
  import type { InstructionVariant } from "./instruction-variant.js";
8
- import type { MercuryFirstBuild } from "./mercury-first-build.js";
8
+ import { type MercuryDepth, type MercuryFirstBuild, type MercuryFormat, type MercuryPlanner, type MercuryJuice, type MercuryReplyShape, type MercuryStyle, type MercuryUsageRound } from "./mercury-first-build.js";
9
+ import type { FirstBuildRace } from "./first-build-race.js";
9
10
  export declare const MERCURY_SEAM_SOURCE = "mercury";
10
- export type MercurySeamSkip = "mercury-failed" | "create-refused";
11
+ export type MercurySeamSkip = "mercury-failed" | "create-refused" | "opus-won";
11
12
  export type MercurySeamOutcome = {
12
13
  readonly dispatched: true;
13
14
  readonly chatId: string;
14
15
  readonly appSlug: string;
15
16
  readonly preamble: string;
17
+ readonly history: readonly LLMMessage[];
16
18
  readonly addressRetried?: true;
17
19
  } | {
18
20
  readonly dispatched: false;
@@ -24,19 +26,52 @@ export declare function runMercurySeam(vctx: VibesApiSQLCtx, o: {
24
26
  readonly dispatcher: AgentBuildDispatcher;
25
27
  readonly firstTurn: FirstTurnMint;
26
28
  readonly presetColorway?: string;
29
+ readonly style?: MercuryStyle;
30
+ readonly juice?: MercuryJuice;
31
+ readonly depth?: MercuryDepth;
32
+ readonly reply?: MercuryReplyShape;
33
+ readonly duo?: boolean;
34
+ readonly oneCall?: boolean;
35
+ readonly recordsRules?: boolean;
36
+ readonly planner?: Exclude<MercuryPlanner, "mercury">;
37
+ readonly format?: MercuryFormat;
38
+ readonly productionSwitch?: true;
39
+ readonly keepText?: boolean;
40
+ readonly race?: FirstBuildRace;
27
41
  readonly evidence: (e: AgentEvidence) => Promise<Result<void>>;
28
42
  }): Promise<MercurySeamOutcome>;
29
- export declare function mercuryFirstBuildContextLine(preamble: string): string;
43
+ export declare const MERCURY_FIRST_BUILD_CALL_ID = "call_mercury_first_build";
44
+ export declare function mercuryFirstBuildHistory(o: {
45
+ readonly preamble: string;
46
+ readonly input: unknown;
47
+ readonly receipt: unknown;
48
+ }): LLMMessage[];
49
+ export declare const MERCURY_TESTER_ATTRIBUTION_LINE: string;
50
+ export declare function mercuryTesterPlanned(format: "skeleton" | MercuryFormat | undefined): boolean;
51
+ export declare const MERCURY_FIRST_BUILD_LINE: string;
52
+ export declare function mercuryFirstBuildContextLine(o?: {
53
+ readonly tester?: boolean;
54
+ }): string;
30
55
  export declare function mercuryFirstBuildAppContext(messages: readonly LLMMessage[], o: {
31
56
  readonly ownerHandle: string;
32
57
  readonly appSlug: string;
33
- readonly preamble: string;
58
+ readonly tester?: boolean;
34
59
  }): LLMMessage[];
35
60
  export declare function withPreambleFirst(stream: ReadableStream<SseStreamMsg>, preamble: string): ReadableStream<SseStreamMsg>;
61
+ export declare function withMercuryUsageRounds(stream: ReadableStream<SseStreamMsg>, o: {
62
+ readonly settled: Promise<unknown>;
63
+ readonly rounds: () => readonly MercuryUsageRound[];
64
+ }): ReadableStream<SseStreamMsg>;
36
65
  export declare const MERCURY_DERIVE_FROM_ASK_OVERLAY = "<derive-from-ask>\nThe <app-workflow> brief for this app is deliberately thin on records and screens. It fixes what is settled: the person's own words, the ownership archetype and the access shape, which capabilities are loaded, the core action in the person's words, the record names, the seed cast, the look and the title. It leaves the mechanics to you, because you can read the person's message and work out what the app must actually do.\n\nDerive the rest from the verbatim ask before you write code: the fields each named record needs so the screens can show what the person described; the first screen, built around the core action as its biggest control in as few taps as the words allow; every other screen the ask implies and nothing it does not; the calculations, states and transitions the words commit you to \u2014 a tally that increments on one tap, a split that shows who owes whom, a feed that refreshes from its source, a timer that fills the screen. Each asked feature is a direct control of its own.\n\nKeep the ownership and access shape exactly as the brief gives it: who owns the object, who is let in, what a visitor sees. Keep the record names and the seed cast; give the seed records exactly the fields your Add writes. A specified ask gets on screen only what it names plus what that needs; a vague ask gets one or two alive defaults. The hints in the brief are hints: where your reading of the ask disagrees with one, the ask wins.\n</derive-from-ask>";
66
+ export declare const MERCURY_CHOPPED_DERIVE_FROM_ASK_OVERLAY = "<derive-from-ask>\nThe <app-workflow> brief for this app is deliberately thin on records and screens. It fixes what is settled: the person's own words, the ownership archetype and the access shape, which capabilities are loaded, the core action in the person's words, the record names, the seed cast, the look and the title. It leaves the mechanics to you, because you can read the person's message and work out what the app must actually do.\n\nDerive the rest from the verbatim ask before you write code, and derive generously: build the fuller app the ask implies, the one a person would be delighted to open. The fields each named record needs so the screens can show what the person described, plus the ones that make a record feel alive (a status, a date, a count, a who). The first screen, built around the core action as its biggest control, one satisfying tap away. Every screen the ask implies and the ones a person using it would reach for in their first five minutes: the history, the summary with its big number, the detail view, the filter chip row. The calculations, states and transitions the words commit you to, carried all the way through \u2014 a tally that increments on one tap and celebrates a streak, a split that shows who owes whom and settles up, a feed that refreshes from its source, a timer that fills the screen. Each asked feature is a direct control of its own.\n\nTurn the screens up: each carries one distinctive detail specific to this app \u2014 the big number, the chip row, the satisfying tap, the state that changes colour \u2014 and the seed records sit in the interesting states those screens show. Empty states invite the first action in the app's own voice.\n\nKeep the ownership and access shape exactly as the brief gives it: who owns the object, who is let in, what a visitor sees. Keep the record names and the seed cast; give the seed records exactly the fields your Add writes. Everything you add serves the app the person asked for, in their own nouns and their world: the app stays the one they asked for, grown fuller, never a different one. The hints in the brief are hints: where your reading of the ask disagrees with one, the ask wins.\n</derive-from-ask>";
67
+ export declare function mercuryBuilderOverlayFor(o: {
68
+ readonly instructionVariant: InstructionVariant | undefined;
69
+ readonly agentDispatched: boolean;
70
+ readonly initialTurn: boolean;
71
+ }): string | undefined;
37
72
  export declare function mercuryBuilderOverlayApplies(o: {
38
73
  readonly instructionVariant: InstructionVariant | undefined;
39
74
  readonly agentDispatched: boolean;
40
75
  readonly initialTurn: boolean;
41
76
  }): boolean;
42
- export declare function withMercuryBuilderOverlay(messages: readonly ChatMessage[]): ChatMessage[];
77
+ export declare function withMercuryBuilderOverlay(messages: readonly ChatMessage[], overlay?: string): ChatMessage[];
@@ -1,25 +1,74 @@
1
- import { isSseLine } from "@vibes.diy/call-ai-v2";
1
+ import { isSseEnd, isSseLine } from "@vibes.diy/call-ai-v2";
2
2
  import { runCreateVibeTool } from "./agent-build-tools.js";
3
+ import { CREATE_VIBE_TOOL_NAME } from "./agent-belt.js";
3
4
  import { claimAgentAppContext } from "./agent-request-frame.js";
5
+ import { recordMercuryDispatched, } from "./mercury-first-build.js";
6
+ import { MercuryStageError } from "./mercury-resilience.js";
4
7
  import { SERVER_FIRST_BUILD_EVIDENCE_NAME } from "./server-first-build.js";
5
8
  export const MERCURY_SEAM_SOURCE = "mercury";
6
9
  export async function runMercurySeam(vctx, o) {
10
+ const style = o.style ?? "base";
11
+ const juice = o.juice ?? "examples";
12
+ const depth = o.depth ?? "none";
13
+ const reply = o.reply ?? "split";
7
14
  const record = async (body) => {
8
15
  const written = await o.evidence({
9
16
  kind: "receipt",
10
17
  name: SERVER_FIRST_BUILD_EVIDENCE_NAME,
11
- text: JSON.stringify({ ...body, source: MERCURY_SEAM_SOURCE }),
18
+ text: JSON.stringify({
19
+ ...body,
20
+ source: MERCURY_SEAM_SOURCE,
21
+ style,
22
+ juice,
23
+ depth,
24
+ reply,
25
+ ...(o.duo === true ? { duo: true } : {}),
26
+ ...(o.oneCall === true ? { oneCall: true } : {}),
27
+ ...(o.recordsRules === true ? { recordsRules: true } : {}),
28
+ ...(o.planner === undefined ? {} : { planner: o.planner }),
29
+ ...(o.format === undefined ? {} : { format: o.format }),
30
+ ...(o.productionSwitch === true ? { productionSwitch: true } : {}),
31
+ ...(o.race === undefined ? {} : { race: o.race.receipt() }),
32
+ }),
12
33
  });
13
34
  if (written.isErr())
14
35
  vctx.logger.Warn().Err(written).Str("chatId", o.firstTurn.chatId).Msg("mercury-seam-evidence-failed");
15
36
  };
16
37
  const rMercury = await o.pending;
38
+ o.race?.mercurySettled(rMercury.isOk());
39
+ if (o.race !== undefined && o.race.winner() === "opus") {
40
+ await record({
41
+ dispatched: false,
42
+ reason: "opus-won",
43
+ ...(rMercury.isErr() ? { error: rMercury.Err().message } : {}),
44
+ ...(rMercury.isErr() && rMercury.Err() instanceof MercuryStageError
45
+ ? { cause: rMercury.Err().fallbackCause }
46
+ : {}),
47
+ });
48
+ return { dispatched: false, reason: "opus-won" };
49
+ }
17
50
  if (rMercury.isErr()) {
51
+ const err = rMercury.Err();
52
+ const fallback = err instanceof MercuryStageError
53
+ ? {
54
+ cause: err.fallbackCause,
55
+ ...(err.detail.call === undefined ? {} : { call: err.detail.call }),
56
+ sends: err.detail.sends,
57
+ retries: err.detail.retries,
58
+ elapsedMs: err.detail.elapsedMs,
59
+ ...(err.detail.rateLimitCapMs === undefined ? {} : { rateLimitCapMs: err.detail.rateLimitCapMs }),
60
+ }
61
+ : { cause: "error" };
18
62
  vctx.logger
19
63
  .Warn()
20
- .Any("event", { chatId: o.firstTurn.chatId, error: rMercury.Err().message })
64
+ .Any("event", {
65
+ chatId: o.firstTurn.chatId,
66
+ error: err.message,
67
+ ...fallback,
68
+ ...(o.productionSwitch === true ? { productionSwitch: true } : {}),
69
+ })
21
70
  .Msg("mercury-first-build-fallback");
22
- await record({ dispatched: false, reason: "mercury-failed", error: rMercury.Err().message });
71
+ await record({ dispatched: false, reason: "mercury-failed", error: err.message, ...fallback });
23
72
  return { dispatched: false, reason: "mercury-failed" };
24
73
  }
25
74
  const mercury = rMercury.Ok();
@@ -28,7 +77,30 @@ export async function runMercurySeam(vctx, o) {
28
77
  archetype: mercury.shape.archetype,
29
78
  coreAction: mercury.shape.coreAction,
30
79
  skills: mercury.input.skills ?? [],
80
+ ...(typeof mercury.input.font === "string" ? { font: mercury.input.font } : {}),
81
+ ...(mercury.sends === undefined ? {} : { sends: mercury.sends }),
82
+ ...(mercury.retries === undefined ? {} : { retries: mercury.retries }),
83
+ ...(mercury.preambleFrom === "brief"
84
+ ? {
85
+ preambleFrom: mercury.preambleFrom,
86
+ preambleChars: mercury.preamble.length,
87
+ ...(mercury.storyChars === undefined ? {} : { storyChars: mercury.storyChars }),
88
+ }
89
+ : {}),
90
+ ...(mercury.duo === undefined ? {} : { duoDrafts: mercury.duo.drafts, duoBreadth: mercury.duo.breadth }),
91
+ ...(mercury.duo?.pool === undefined ? {} : { duoPool: mercury.duo.pool }),
92
+ ...(mercury.duo?.candidates === undefined ? {} : { duoCandidates: mercury.duo.candidates }),
93
+ ...(mercury.duo?.archetypes === undefined
94
+ ? {}
95
+ : { duoArchetypes: mercury.duo.archetypes, duoArchetypeSplit: mercury.duo.archetypeSplit === true }),
96
+ ...(mercury.duo?.conflict === undefined ? {} : { duoConflict: true, duoConflictReason: mercury.duo.conflict }),
97
+ ...(mercury.oneCall === undefined ? {} : { shapeCall: false, ...mercury.oneCall }),
98
+ ...(mercury.fim === undefined ? {} : { fim: mercury.fim }),
31
99
  };
100
+ if (o.race !== undefined && o.race.claimMercury() === false) {
101
+ await record({ dispatched: false, reason: "opus-won", mercury: summary });
102
+ return { dispatched: false, reason: "opus-won" };
103
+ }
32
104
  const createArgs = {
33
105
  actor: o.actor,
34
106
  input: mercury.input,
@@ -40,6 +112,7 @@ export async function runMercurySeam(vctx, o) {
40
112
  const addressRetried = first.isErr() && first.Err().refusal.reason === "address-taken";
41
113
  const r = addressRetried ? await runCreateVibeTool(vctx, createArgs) : first;
42
114
  if (r.isErr()) {
115
+ o.race?.settleMercury({ dispatched: false });
43
116
  vctx.logger
44
117
  .Warn()
45
118
  .Any("event", { chatId: o.firstTurn.chatId, refusal: r.Err().refusal })
@@ -53,6 +126,17 @@ export async function runMercurySeam(vctx, o) {
53
126
  });
54
127
  return { dispatched: false, reason: "create-refused" };
55
128
  }
129
+ o.race?.settleMercury({
130
+ dispatched: true,
131
+ receipt: r.Ok(),
132
+ preamble: mercury.preamble,
133
+ });
134
+ if (o.keepText === true && mercury.rowPromptId !== undefined && typeof mercury.input.enrichedPrompt === "string")
135
+ await recordMercuryDispatched(vctx, {
136
+ chatId: o.firstTurn.chatId,
137
+ promptId: mercury.rowPromptId,
138
+ enrichedPrompt: mercury.input.enrichedPrompt,
139
+ });
56
140
  await record({
57
141
  dispatched: true,
58
142
  appSlug: r.Ok().appSlug,
@@ -62,24 +146,54 @@ export async function runMercurySeam(vctx, o) {
62
146
  });
63
147
  vctx.logger
64
148
  .Info()
65
- .Any("event", { chatId: r.Ok().chatId, appSlug: r.Ok().appSlug, mercuryMs: mercury.elapsedMs, addressRetried })
149
+ .Any("event", {
150
+ chatId: r.Ok().chatId,
151
+ appSlug: r.Ok().appSlug,
152
+ mercuryMs: mercury.elapsedMs,
153
+ addressRetried,
154
+ ...(o.productionSwitch === true ? { productionSwitch: true } : {}),
155
+ })
66
156
  .Msg("mercury-first-build-dispatched");
67
157
  return {
68
158
  dispatched: true,
69
159
  chatId: r.Ok().chatId,
70
160
  appSlug: r.Ok().appSlug,
71
161
  preamble: mercury.preamble,
162
+ history: mercuryFirstBuildHistory({ preamble: mercury.preamble, input: mercury.input, receipt: r.Ok() }),
72
163
  ...(addressRetried ? { addressRetried: true } : {}),
73
164
  };
74
165
  }
75
- export function mercuryFirstBuildContextLine(preamble) {
76
- return ("its first build is running now, started by the platform from the person's own words as this turn began. " +
77
- `Your reply this turn already opens with these words, on the person's screen as you start: "${preamble}" ` +
78
- "Carry on from them in a sentence at most, and answer from the [build result] when it arrives; " +
79
- "its files, versions and settings are readable once it lands.");
166
+ export const MERCURY_FIRST_BUILD_CALL_ID = "call_mercury_first_build";
167
+ export function mercuryFirstBuildHistory(o) {
168
+ return [
169
+ {
170
+ role: "assistant",
171
+ content: o.preamble,
172
+ tool_calls: [
173
+ {
174
+ id: MERCURY_FIRST_BUILD_CALL_ID,
175
+ type: "function",
176
+ function: { name: CREATE_VIBE_TOOL_NAME, arguments: JSON.stringify(o.input) },
177
+ },
178
+ ],
179
+ },
180
+ { role: "tool", tool_call_id: MERCURY_FIRST_BUILD_CALL_ID, content: JSON.stringify(o.receipt) },
181
+ ];
182
+ }
183
+ export const MERCURY_TESTER_ATTRIBUTION_LINE = "This first build and your opening words were planned from a fast tester's first read of the person's words, not by you. " +
184
+ "Where something in it differs from what the person asked, mention it and ask whether they would like it changed; " +
185
+ "change it on your own only when it breaks the app.";
186
+ export function mercuryTesterPlanned(format) {
187
+ return format === "thinkaloud" || format === "cards" || format === "cards-fim";
188
+ }
189
+ export const MERCURY_FIRST_BUILD_LINE = "its first build is running now, from the create_vibe call above. " +
190
+ "Continue in at most a sentence; answer from the [build result] when it lands; " +
191
+ "its files, versions and settings are readable once it lands.";
192
+ export function mercuryFirstBuildContextLine(o = {}) {
193
+ return MERCURY_FIRST_BUILD_LINE + (o.tester === true ? ` ${MERCURY_TESTER_ATTRIBUTION_LINE}` : "");
80
194
  }
81
195
  export function mercuryFirstBuildAppContext(messages, o) {
82
- return claimAgentAppContext(messages, { ownerHandle: o.ownerHandle, appSlug: o.appSlug }, { firstBuildLine: mercuryFirstBuildContextLine(o.preamble) });
196
+ return claimAgentAppContext(messages, { ownerHandle: o.ownerHandle, appSlug: o.appSlug }, { firstBuildLine: mercuryFirstBuildContextLine({ tester: o.tester === true }) });
83
197
  }
84
198
  export function withPreambleFirst(stream, preamble) {
85
199
  let sent = false;
@@ -110,6 +224,61 @@ export function withPreambleFirst(stream, preamble) {
110
224
  },
111
225
  }));
112
226
  }
227
+ export function withMercuryUsageRounds(stream, o) {
228
+ let sent = false;
229
+ let streamId;
230
+ async function emit(controller, from) {
231
+ sent = true;
232
+ await o.settled;
233
+ for (const round of o.rounds()) {
234
+ controller.enqueue({
235
+ type: "sse.line",
236
+ streamId: from.streamId,
237
+ chunkNr: 0,
238
+ timestamp: new Date(),
239
+ chunk: {
240
+ id: from.id,
241
+ provider: from.provider,
242
+ model: round.model,
243
+ object: from.object,
244
+ created: from.created,
245
+ choices: [],
246
+ usage: { ...round },
247
+ },
248
+ });
249
+ }
250
+ }
251
+ function synthetic(forStream) {
252
+ return {
253
+ streamId: forStream,
254
+ id: `mercury-usage-${forStream}`,
255
+ provider: "mercury",
256
+ object: "chat.completion.chunk",
257
+ created: Math.floor(Date.now() / 1000),
258
+ };
259
+ }
260
+ return stream.pipeThrough(new TransformStream({
261
+ async transform(msg, controller) {
262
+ streamId = msg.streamId;
263
+ if (sent === false && isSseEnd(msg))
264
+ await emit(controller, synthetic(msg.streamId));
265
+ controller.enqueue(msg);
266
+ if (sent || isSseLine(msg) === false)
267
+ return;
268
+ await emit(controller, {
269
+ streamId: msg.streamId,
270
+ id: msg.chunk.id,
271
+ provider: msg.chunk.provider,
272
+ object: msg.chunk.object,
273
+ created: msg.chunk.created,
274
+ });
275
+ },
276
+ async flush(controller) {
277
+ if (sent === false && streamId !== undefined)
278
+ await emit(controller, synthetic(streamId));
279
+ },
280
+ }));
281
+ }
113
282
  export const MERCURY_DERIVE_FROM_ASK_OVERLAY = `<derive-from-ask>
114
283
  The <app-workflow> brief for this app is deliberately thin on records and screens. It fixes what is settled: the person's own words, the ownership archetype and the access shape, which capabilities are loaded, the core action in the person's words, the record names, the seed cast, the look and the title. It leaves the mechanics to you, because you can read the person's message and work out what the app must actually do.
115
284
 
@@ -117,13 +286,31 @@ Derive the rest from the verbatim ask before you write code: the fields each nam
117
286
 
118
287
  Keep the ownership and access shape exactly as the brief gives it: who owns the object, who is let in, what a visitor sees. Keep the record names and the seed cast; give the seed records exactly the fields your Add writes. A specified ask gets on screen only what it names plus what that needs; a vague ask gets one or two alive defaults. The hints in the brief are hints: where your reading of the ask disagrees with one, the ask wins.
119
288
  </derive-from-ask>`;
289
+ export const MERCURY_CHOPPED_DERIVE_FROM_ASK_OVERLAY = `<derive-from-ask>
290
+ The <app-workflow> brief for this app is deliberately thin on records and screens. It fixes what is settled: the person's own words, the ownership archetype and the access shape, which capabilities are loaded, the core action in the person's words, the record names, the seed cast, the look and the title. It leaves the mechanics to you, because you can read the person's message and work out what the app must actually do.
291
+
292
+ Derive the rest from the verbatim ask before you write code, and derive generously: build the fuller app the ask implies, the one a person would be delighted to open. The fields each named record needs so the screens can show what the person described, plus the ones that make a record feel alive (a status, a date, a count, a who). The first screen, built around the core action as its biggest control, one satisfying tap away. Every screen the ask implies and the ones a person using it would reach for in their first five minutes: the history, the summary with its big number, the detail view, the filter chip row. The calculations, states and transitions the words commit you to, carried all the way through — a tally that increments on one tap and celebrates a streak, a split that shows who owes whom and settles up, a feed that refreshes from its source, a timer that fills the screen. Each asked feature is a direct control of its own.
293
+
294
+ Turn the screens up: each carries one distinctive detail specific to this app — the big number, the chip row, the satisfying tap, the state that changes colour — and the seed records sit in the interesting states those screens show. Empty states invite the first action in the app's own voice.
295
+
296
+ Keep the ownership and access shape exactly as the brief gives it: who owns the object, who is let in, what a visitor sees. Keep the record names and the seed cast; give the seed records exactly the fields your Add writes. Everything you add serves the app the person asked for, in their own nouns and their world: the app stays the one they asked for, grown fuller, never a different one. The hints in the brief are hints: where your reading of the ask disagrees with one, the ask wins.
297
+ </derive-from-ask>`;
298
+ export function mercuryBuilderOverlayFor(o) {
299
+ if (o.agentDispatched === false || o.initialTurn === false)
300
+ return undefined;
301
+ if (o.instructionVariant === "mercury-recut-first-build")
302
+ return MERCURY_DERIVE_FROM_ASK_OVERLAY;
303
+ if (o.instructionVariant === "mercury-chopped-first-build" || o.instructionVariant === "mercury-onecall-first-build")
304
+ return MERCURY_CHOPPED_DERIVE_FROM_ASK_OVERLAY;
305
+ return undefined;
306
+ }
120
307
  export function mercuryBuilderOverlayApplies(o) {
121
- return o.instructionVariant === "mercury-recut-first-build" && o.agentDispatched && o.initialTurn;
308
+ return mercuryBuilderOverlayFor(o) !== undefined;
122
309
  }
123
- export function withMercuryBuilderOverlay(messages) {
310
+ export function withMercuryBuilderOverlay(messages, overlay = MERCURY_DERIVE_FROM_ASK_OVERLAY) {
124
311
  const at = messages.findIndex((m) => m.role === "system");
125
312
  if (at < 0)
126
313
  return [...messages];
127
- return messages.map((m, i) => i === at ? { ...m, content: [...m.content, { type: "text", text: MERCURY_DERIVE_FROM_ASK_OVERLAY }] } : m);
314
+ return messages.map((m, i) => (i === at ? { ...m, content: [...m.content, { type: "text", text: overlay }] } : m));
128
315
  }
129
316
  //# sourceMappingURL=mercury-first-build-seam.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mercury-first-build-seam.js","sourceRoot":"","sources":["../../jsr/intern/mercury-first-build-seam.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAwD,MAAM,uBAAuB,CAAC;AAGxG,OAAO,EAAE,iBAAiB,EAAiD,MAAM,wBAAwB,CAAC;AAC1G,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO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