@vibes.diy/api-svc 14.3.85 → 14.3.86
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.
- package/create-handler.js +2 -0
- package/create-handler.js.map +1 -1
- package/index.d.ts +3 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/intern/agent-account-tools.d.ts +1 -0
- package/intern/agent-account-tools.js +1 -0
- package/intern/agent-account-tools.js.map +1 -1
- package/intern/agent-belt.d.ts +1 -3
- package/intern/agent-belt.js +25 -21
- package/intern/agent-belt.js.map +1 -1
- package/intern/agent-build-tools.d.ts +7 -0
- package/intern/agent-build-tools.js +6 -2
- package/intern/agent-build-tools.js.map +1 -1
- package/intern/agent-closing-options.d.ts +26 -0
- package/intern/agent-closing-options.js +130 -0
- package/intern/agent-closing-options.js.map +1 -0
- package/intern/agent-dispatcher.d.ts +1 -0
- package/intern/agent-dispatcher.js +17 -3
- package/intern/agent-dispatcher.js.map +1 -1
- package/intern/agent-session-instruction.d.ts +3 -2
- package/intern/agent-session-instruction.js +9 -7
- package/intern/agent-session-instruction.js.map +1 -1
- package/intern/agent-turn.d.ts +1 -0
- package/intern/agent-turn.js +1 -0
- package/intern/agent-turn.js.map +1 -1
- package/intern/alt-first-build.d.ts +36 -0
- package/intern/alt-first-build.js +137 -0
- package/intern/alt-first-build.js.map +1 -0
- package/intern/alt-landing.d.ts +7 -0
- package/intern/alt-landing.js +31 -0
- package/intern/alt-landing.js.map +1 -0
- package/intern/first-brief.d.ts +1 -1
- package/intern/first-brief.js +1 -1
- package/intern/first-brief.js.map +1 -1
- package/intern/first-build-classifier.d.ts +4 -4
- package/intern/first-build-classifier.js +15 -17
- package/intern/first-build-classifier.js.map +1 -1
- package/intern/first-build-race.d.ts +71 -0
- package/intern/first-build-race.js +257 -0
- package/intern/first-build-race.js.map +1 -0
- package/intern/instruction-variant.d.ts +23 -2
- package/intern/instruction-variant.js +159 -2
- package/intern/instruction-variant.js.map +1 -1
- package/intern/keeps-to-themselves.d.ts +1 -0
- package/intern/keeps-to-themselves.js +10 -0
- package/intern/keeps-to-themselves.js.map +1 -0
- package/intern/llm-tool-loop.d.ts +5 -1
- package/intern/llm-tool-loop.js +48 -15
- package/intern/llm-tool-loop.js.map +1 -1
- package/intern/mercury-capability-triggers.d.ts +1 -0
- package/intern/mercury-capability-triggers.js +95 -0
- package/intern/mercury-capability-triggers.js.map +1 -0
- package/intern/mercury-first-build-seam.d.ts +40 -5
- package/intern/mercury-first-build-seam.js +201 -14
- package/intern/mercury-first-build-seam.js.map +1 -1
- package/intern/mercury-first-build.d.ts +591 -21
- package/intern/mercury-first-build.js +2998 -287
- package/intern/mercury-first-build.js.map +1 -1
- package/intern/mercury-resilience.d.ts +70 -0
- package/intern/mercury-resilience.js +122 -0
- package/intern/mercury-resilience.js.map +1 -0
- package/intern/mint-decision.d.ts +1 -0
- package/intern/mint-decision.js +3 -0
- package/intern/mint-decision.js.map +1 -1
- package/intern/option-line-hold.d.ts +5 -0
- package/intern/option-line-hold.js +39 -0
- package/intern/option-line-hold.js.map +1 -0
- package/intern/pouf-room-catalog.d.ts +2 -0
- package/intern/pouf-room-catalog.js +11 -0
- package/intern/pouf-room-catalog.js.map +1 -0
- package/intern/retire-offer-options.d.ts +3 -0
- package/intern/retire-offer-options.js +91 -0
- package/intern/retire-offer-options.js.map +1 -0
- package/intern/seed-chat-section.d.ts +13 -0
- package/intern/seed-chat-section.js +62 -0
- package/intern/seed-chat-section.js.map +1 -1
- package/intern/server-first-build.js +1 -0
- package/intern/server-first-build.js.map +1 -1
- package/intern/vibe-font-catalog.d.ts +2 -0
- package/intern/vibe-font-catalog.js +8 -0
- package/intern/vibe-font-catalog.js.map +1 -0
- package/package.json +14 -14
- package/public/agent-turn-action.d.ts +1 -0
- package/public/agent-turn-action.js +271 -62
- package/public/agent-turn-action.js.map +1 -1
- package/public/agent-turn-assembly.js +5 -2
- package/public/agent-turn-assembly.js.map +1 -1
- package/public/prompt-chat-section.js +7 -5
- package/public/prompt-chat-section.js.map +1 -1
- package/public/prompt-turn-terminal.js +3 -1
- package/public/prompt-turn-terminal.js.map +1 -1
- package/public/report-activity.js +18 -2
- package/public/report-activity.js.map +1 -1
- package/public/vibe-traffic-source.js +1 -1
- package/public/vibe-traffic-source.js.map +1 -1
- package/types.d.ts +1 -0
- package/types.js.map +1 -1
- package/usage-report/new-user-alert-util.d.ts +6 -0
- package/usage-report/new-user-alert-util.js +30 -1
- package/usage-report/new-user-alert-util.js.map +1 -1
- package/intern/agent-options-tool.d.ts +0 -27
- package/intern/agent-options-tool.js +0 -213
- package/intern/agent-options-tool.js.map +0 -1
|
@@ -2,14 +2,25 @@ import { Result } from "@adviser/cement";
|
|
|
2
2
|
import type { CreateVibeToolInput, AppNature } from "@vibes.diy/api-types";
|
|
3
3
|
import type { LLMMessage } from "@vibes.diy/call-ai-v2";
|
|
4
4
|
import type { VibesApiSQLCtx } from "../types.js";
|
|
5
|
+
import { MercuryCircuitBreaker, type MercuryFallbackCause } from "./mercury-resilience.js";
|
|
5
6
|
export declare const MERCURY_FIRST_BUILD_MODEL = "inception/mercury-2.5";
|
|
6
7
|
export declare const MERCURY_FIRST_BUILD_REASONING: {
|
|
7
8
|
readonly effort: "none";
|
|
8
9
|
};
|
|
10
|
+
export type MercuryPlanner = "mercury" | "opus" | "haiku";
|
|
11
|
+
export declare const MERCURY_OPUS_PLANNER_MODEL = "~anthropic/claude-opus-latest";
|
|
12
|
+
export declare const MERCURY_OPUS_PLANNER_DEADLINE_MS = 240000;
|
|
13
|
+
export declare const MERCURY_OPUS_PLANNER_BUDGET_MS = 300000;
|
|
14
|
+
export declare const MERCURY_OPUS_PLANNER_FANOUT = 1;
|
|
15
|
+
export declare const MERCURY_OPUS_PLANNER_MAX_TOKENS = 8000;
|
|
16
|
+
export declare const MERCURY_OPUS_PLANNER_BREAKER: MercuryCircuitBreaker;
|
|
17
|
+
export declare const MERCURY_HAIKU_PLANNER_MODEL = "anthropic/claude-haiku-5.5";
|
|
18
|
+
export declare const MERCURY_HAIKU_PLANNER_DEADLINE_MS = 40000;
|
|
19
|
+
export declare const MERCURY_HAIKU_PLANNER_BUDGET_MS = 50000;
|
|
20
|
+
export declare const MERCURY_HAIKU_PLANNER_BREAKER: MercuryCircuitBreaker;
|
|
9
21
|
export declare const MERCURY_CALL_DEADLINE_MS = 8000;
|
|
10
22
|
export declare const MERCURY_CALL_ATTEMPTS = 2;
|
|
11
23
|
export declare const MERCURY_TRANSIENT_RETRIES = 3;
|
|
12
|
-
export declare const MERCURY_TRANSIENT_BACKOFF_MS = 400;
|
|
13
24
|
export declare const MERCURY_ARCHETYPES: readonly ["personal", "group", "publish", "intake", "open", "toy"];
|
|
14
25
|
export type MercuryArchetype = (typeof MERCURY_ARCHETYPES)[number];
|
|
15
26
|
export declare const MERCURY_FLAGS: readonly ["ai", "composer", "imageGen", "backend", "calendar", "audio", "threeD", "charts", "boardGame", "sensitive"];
|
|
@@ -21,6 +32,7 @@ export interface MercuryShape {
|
|
|
21
32
|
readonly who: string;
|
|
22
33
|
readonly recordNames: readonly string[];
|
|
23
34
|
readonly flags: Readonly<Record<MercuryFlag, boolean>>;
|
|
35
|
+
readonly keepsToThemselves?: boolean;
|
|
24
36
|
}
|
|
25
37
|
export interface MercuryBriefFields {
|
|
26
38
|
readonly opening: string;
|
|
@@ -37,29 +49,161 @@ export type MercuryBriefField = keyof MercuryBriefFields;
|
|
|
37
49
|
export declare const MERCURY_BRIEF_FIELDS: readonly MercuryBriefField[];
|
|
38
50
|
export declare const MERCURY_SHAPE_SYSTEM = "You classify a person's one-message request for a small web app before a build brief is written. Return only JSON.\n\narchetype, exactly one:\n- personal: one person's own tool (\"for me\", \"my\", \"private\", a tracker, a log, a list, a journal) with no other people named.\n- group: the person names other people who use it with them (we, our, friends, family, team, club, kids, housemates, partner, members, a foursome).\n- publish: the person writes and other people only read (a blog, menu, gallery, portfolio, schedule, zine, \"everyone can read\").\n- intake: strangers or customers submit something without signing up and the person sees the submissions (orders, bookings, requests, sign-ups, replies, reports from the public).\n- open: anyone with the link joins in and adds their own bit (a shared wall, canvas, feed, leaderboard game, community board, swap board, \"anyone can post\").\n- toy: a game, simulator, visual, sound or generator that keeps little or nothing (scores at most).\nTie-breaks: group means other people open the app on their own devices; a calculator, splitter or tool used on one phone \"with friends\" at the table is personal. toy is for games, simulators and visual or sound toys; a tool that analyzes, estimates, designs, counts, tracks or logs stores records and is personal. A \"feed of information\" pulled from the internet is personal with backend true. A test or nonsense phrase is still a request: make the most playful literal app of it (a \"squash bloom soothsayer\" is a fortune teller about squash) and classify that.\n\ncoreAction: the one thing the person does most in this app, as a short verb phrase in their own words (\"tap once per glass\", \"paste the group chat\", \"lasso cows\"). It becomes the biggest control on the first screen.\nkind: 2-6 word noun phrase for the app in the person's own nouns. who: who it is for, 2-8 words.\nrecordNames: 1-5 short singular record type names the app stores (toys may have just \"score\" or none).\nflags, each true only when the request itself needs it:\n- ai: the app must read, write or judge free text or photos with a language model (extract facts from pasted words, answer questions, generate text, chat, analyze a picture, suggest recipes).\n- composer: ai is true AND the person types or pastes their own words or photos as the way records get in.\n- imageGen: the app generates pictures.\n- backend: server work the page cannot do: scheduled reminders or digests, a live feed pulled from outside, secret dealing, email.\n- calendar: dates on a calendar, bookings by slot, recurring events, paystub periods.\n- audio: sound or music playback or synthesis.\n- threeD: 3D graphics, a simulator, a world you move through.\n- charts: heatmaps, graphs, statistics views.\n- boardGame: a turn-based card or board game.\n- sensitive: health, money of real people, kids, or the word private.";
|
|
39
51
|
export declare function mercuryShapeSchema(): Record<string, unknown>;
|
|
40
|
-
export declare function mercuryNonce(): string;
|
|
41
52
|
export declare function mercuryShapeMessages(o: {
|
|
42
53
|
readonly personWords: string;
|
|
43
|
-
readonly nonce: string;
|
|
44
54
|
}): LLMMessage[];
|
|
45
55
|
export declare function parseMercuryShape(raw: unknown): Result<MercuryShape>;
|
|
46
|
-
export declare function fixMercuryShape(shape: MercuryShape, personWords: string
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
export declare function
|
|
50
|
-
export declare function
|
|
56
|
+
export declare function fixMercuryShape(shape: MercuryShape, personWords: string, opts?: {
|
|
57
|
+
readonly keepBackend?: boolean;
|
|
58
|
+
}): MercuryShape;
|
|
59
|
+
export declare function mercuryBackendWordsNamed(personWords: string): boolean;
|
|
60
|
+
export declare function parseMercuryDraftShape(raw: unknown, personWords: string): Result<MercuryShape>;
|
|
61
|
+
export interface MercuryOneCallReceipt {
|
|
62
|
+
readonly draftArchetypes: readonly (MercuryArchetype | null)[];
|
|
63
|
+
readonly archetypeSplit: boolean;
|
|
64
|
+
readonly flagsWinner: readonly MercuryFlag[];
|
|
65
|
+
readonly flagsUnion: readonly MercuryFlag[];
|
|
66
|
+
readonly backendFilterCleared?: readonly number[];
|
|
67
|
+
readonly backendFilterKept?: number;
|
|
68
|
+
}
|
|
69
|
+
export interface MercuryPair {
|
|
70
|
+
readonly title: string;
|
|
71
|
+
readonly slug: string;
|
|
72
|
+
}
|
|
73
|
+
export interface MercuryAddressEncoding {
|
|
74
|
+
readonly properties: Readonly<Record<string, Record<string, unknown>>>;
|
|
75
|
+
readonly rule: string;
|
|
76
|
+
readonly ask: string;
|
|
77
|
+
readonly hints: Readonly<Record<string, string>>;
|
|
78
|
+
readonly example: (title: string, slugs: readonly string[]) => readonly string[];
|
|
79
|
+
readonly decode: (reply: Readonly<Record<string, unknown>>) => Result<MercuryDecodedAddress>;
|
|
80
|
+
readonly salvage: (json: unknown) => Record<string, unknown> | undefined;
|
|
81
|
+
}
|
|
82
|
+
export type MercuryAddressRepair = "salvage" | "split" | "label" | "slug-fallback" | "title-from-slug";
|
|
83
|
+
export interface MercuryDecodedAddress {
|
|
84
|
+
readonly title?: string;
|
|
85
|
+
readonly slugs: string[];
|
|
86
|
+
readonly repairs: readonly MercuryAddressRepair[];
|
|
87
|
+
}
|
|
88
|
+
export declare function mercuryAddressEncoding(): MercuryAddressEncoding;
|
|
89
|
+
export declare const MERCURY_ADDRESS: MercuryAddressEncoding;
|
|
90
|
+
export declare function mercurySlugWordsSentence(words: readonly string[]): string;
|
|
91
|
+
export declare const MERCURY_OWN_WORLD_SEED_HINT = "demo: a lively cast and where each one stands, in words, in states this app's own records hold";
|
|
92
|
+
export interface MercuryRoomsAsk {
|
|
93
|
+
readonly rooms?: boolean;
|
|
94
|
+
readonly font?: boolean;
|
|
95
|
+
readonly screens?: boolean;
|
|
96
|
+
readonly juice?: MercuryJuice;
|
|
97
|
+
readonly story?: boolean;
|
|
98
|
+
readonly preamble?: boolean;
|
|
99
|
+
readonly classify?: boolean;
|
|
100
|
+
readonly recordsRules?: boolean;
|
|
101
|
+
}
|
|
102
|
+
export declare const MERCURY_ROOMS_HINT = "an array of 2 or 3 room slugs from the room list";
|
|
103
|
+
export declare const MERCURY_ROOMS_ASK = "Also rooms: an array of 2 or 3 room slugs from the room list.";
|
|
104
|
+
export declare const MERCURY_FONT_HINT = "one font slug from the font list";
|
|
105
|
+
export declare const MERCURY_FONT_ASK = "Also font: one font slug from the font list.";
|
|
106
|
+
export declare const MERCURY_CLASSIFY_HINTS: Readonly<Record<string, string>>;
|
|
107
|
+
export declare function mercuryAnswerSkeleton(fields: readonly MercuryBriefField[], opts?: MercuryRoomsAsk): string;
|
|
108
|
+
export declare function mercuryFieldArchetypes(archetype: MercuryArchetype): MercuryArchetype[];
|
|
109
|
+
export declare function mercuryExemplarField(archetype: MercuryArchetype, address?: MercuryAddressEncoding, recordsRules?: boolean): string;
|
|
110
|
+
export declare const MERCURY_ONECALL_TRIPLES: readonly (readonly [MercuryArchetype, MercuryArchetype, MercuryArchetype])[];
|
|
111
|
+
export declare function mercuryOneCallField(draft: number, address?: MercuryAddressEncoding, recordsRules?: boolean): string;
|
|
112
|
+
export declare const MERCURY_BRIEF_FLOORS = "Floors for every brief: each screen names at least two visible controls and one state that changes (a colour, a ribbon, a sort order, a chip, a badge); the demo names a lively cast and where each one stands (who is winning, what is overdue, what just landed, who has nothing yet); the opening names the one moment that makes the app fun to open. All of it in the person's own nouns and in words rather than numbers, and nothing their words did not imply.";
|
|
113
|
+
export declare const MERCURY_DEMO_RULE = "The demo part starts with \"demo:\" and names a lively cast and where each one stands, in words: who is ahead, what is overdue, what just happened, what is still waiting; dates and counts are the builder's to pick, so the demo uses words like recently, just now, last week, nearly, still. Every demo record is one the app's own Add could write.";
|
|
114
|
+
export type MercuryJuice = "examples" | "own-world";
|
|
115
|
+
export type MercuryDepth = "none" | "sub-feature";
|
|
116
|
+
export declare const MERCURY_OWN_WORLD_DEMO_RULE = "The demo part starts with \"demo:\" and names a lively cast and where each one stands, in words, named in the app's own world: the states and progress this app's own records hold; dates and counts are the builder's to pick, so the demo uses words like recently, just now, last week, nearly, still. Every demo record is one the app's own Add could write.";
|
|
117
|
+
export declare const MERCURY_OWN_WORLD_BRIEF_FLOORS = "Floors for every brief: each screen names at least two visible controls and one state that changes (a colour, a ribbon, a sort order, a chip, a badge); the demo names a lively cast and where each one stands, in the app's own world and in states its own records hold; the opening names the one moment that makes the app fun to open. All of it in the person's own nouns and in words rather than numbers, and nothing their words did not imply.";
|
|
118
|
+
export declare const MERCURY_DEPTH_RULE = "Each screen also names one deeper interaction behind its main control, whichever this app's core action calls for: an undo, a long-press, a drag to reorder, an inline edit, or a filter chip.";
|
|
119
|
+
export declare const MERCURY_DEPTH_SCREENS_HINT = "1. the core action as the biggest control, two visible controls, one state that changes, one deeper interaction behind the main control (an undo, a long-press, a drag to reorder, an inline edit or a filter chip), why it exists; 2. ...; 3. ...";
|
|
120
|
+
export declare const MERCURY_RECORDS_RULE = "The records part names each record type the app stores, with its fields, as \"volunteer (name, shift, note)\". The rules part names the one to three computations or invariants the ask hinges on, in the person's terms \u2014 for example \"close each tab as the fewest who-pays-whom transfers and save each payment\", \"a second sign-up under the same name updates that volunteer\", \"the band has a fixed lineup of five players and every player appears on each setlist\", \"every Friday email the summary to the coach's address\". The screens build on the records and the rules.";
|
|
121
|
+
export declare const MERCURY_RECORDS_SCREENS_RULE = "The screens part names two or three screens; each one says what it shows from the records and what the person does there for this ask, and the screen that carries out a rule says so. At most one screen adds a deeper interaction, and only where the ask implies one.";
|
|
122
|
+
export declare const MERCURY_RECORDS_DEMO_RULE = "The demo part starts with \"demo:\" and is lively, in the app's own world: a small cast with names and the records the screens would show, in the states this app's own records hold. When the person typed data \u2014 items, amounts, names, a list \u2014 the demo carries every piece of it verbatim, quantities included (\"half a bag\" stays \"half a bag\"); dates and counts they did not give are the builder's to pick. Every demo record is one the app's own Add could write.";
|
|
123
|
+
export declare const MERCURY_ASK_WORDS_RULE = "Keep the ask's genre and capability words exactly as the person wrote them \u2014 3D, first-person, email, a named recipient, a schedule, a fixed number of people \u2014 in the opening, the rules or the screens.";
|
|
124
|
+
export declare const MERCURY_RECORDS_BRIEF_FLOORS = "Floors for every brief: every record names its fields; the rules carry the computation or invariant the ask hinges on; each screen shows and does something this ask needs; the demo is lively and carries the person's own typed data word for word; the opening names the one moment that makes the app fun to open. All of it in the person's own nouns, and nothing their words did not imply.";
|
|
125
|
+
export declare const MERCURY_RECORDS_HINT = "each record type the app stores, with its fields: \"name (field, field, field); name (field, field)\"";
|
|
126
|
+
export declare const MERCURY_RULES_HINT = "the one to three computations or invariants the ask hinges on, in the person's terms";
|
|
127
|
+
export declare const MERCURY_RECORDS_SCREENS_HINT = "1. the core action's screen: what it shows from the records and what the person does there for this ask, and the rule it carries out; 2. ...; 3. ...";
|
|
128
|
+
export declare const MERCURY_RECORDS_SEED_HINT = "demo: a lively cast and the records the screens show, in the app's own world, with every item, amount and name the person typed, verbatim";
|
|
129
|
+
export declare const MERCURY_CHOPPED_RECORDS_SEED_LINE = "- seed: a small, lively world in the app's own words \u2014 a cast with quoted names and the records the screens would show, in the states this app's own records hold; any data the person typed (items, amounts, names, quantities) appears in it verbatim. Every seeded record is one the app's own Add could write.";
|
|
130
|
+
export declare const MERCURY_BLOCK_WORLD_TRIGGER = " - a Minecraft-style block world to build and break blocks in";
|
|
131
|
+
export declare function mercuryBlockWorldNamed(personWords: string): boolean;
|
|
132
|
+
export type MercuryReplyShape = "split" | "whole";
|
|
133
|
+
export declare const MERCURY_STORY_EXAMPLE_SOUP = "Mia opens the app to post today's soups by taking a picture of the kitchen recipe via the platform camera widget, right after the morning prep; she also sets the inventory level via an onscreen slider\u2026 customers at the queue browse the menu and make selections by clicking the quantity buttons on their phones.";
|
|
134
|
+
export declare const MERCURY_STORY_EXAMPLE_BIKE = "Dev opens the app to post today's repair queue by taking a picture of each bike's tag via the platform camera widget, right after the shop opens; he also sets each repair's progress via an onscreen slider\u2026 riders waiting at the counter browse the queue and pick their pickup time by turning the time picker on their phones.";
|
|
135
|
+
export declare function mercuryStoryExample(personWords: string): string;
|
|
136
|
+
export declare function mercuryStoryRule(example: string): string;
|
|
137
|
+
export declare const MERCURY_STORY_HINT = "three to five sentences: one person from the demo cast using the app through its core loop, every step naming its on-screen action: which control they use, the platform widget if one applies (camera, slider, quantity stepper, picker), and what changes on screen; then who else sees it and which control they use";
|
|
138
|
+
export declare const MERCURY_WHOLE_PREAMBLE_RULE = "The preamble part is spoken to the person who asked, just before the app is built: plain sentences in their own words, starting with \"I'm making\" or \"I'm building\" \u2014 what you are making for them, its core action and the big control on its first screen that does it, then what else it does, its features named in their nouns. Make it vivid, like you can already see the app; it promises what the screens and the story carry.";
|
|
139
|
+
export declare const MERCURY_WHOLE_PREAMBLE_HINT = "plain sentences to the person, starting with \"I'm making\" or \"I'm building\": what it is for them, the core action and its first-screen control, then what else it does";
|
|
140
|
+
export declare const MERCURY_BRIEF_RULES: string;
|
|
141
|
+
export declare const MERCURY_ONECALL_DECIDED = "The classification keys in your reply (archetype, core action, record names, capabilities) decide the brief; follow them.";
|
|
142
|
+
export declare const MERCURY_ONECALL_CLASSIFY: string;
|
|
143
|
+
export declare function mercuryBriefRules(o?: {
|
|
144
|
+
readonly juice?: MercuryJuice;
|
|
145
|
+
readonly depth?: MercuryDepth;
|
|
146
|
+
readonly reply?: MercuryReplyShape;
|
|
147
|
+
readonly personWords?: string;
|
|
148
|
+
readonly recordsRules?: boolean;
|
|
149
|
+
}): string;
|
|
150
|
+
export type MercuryStyle = "base" | "chopped";
|
|
151
|
+
export declare const MERCURY_CHOPPED_BRIEF_RULES = "These parts are turned up, in the person's own nouns, at the field's own lengths:\n- opening: reads like you can already see the app \u2014 what it is, who it is for, and the one moment that makes it fun to open.\n- seed: a small world in words \u2014 a lively cast with quoted names and where each one stands (one leading, one close behind, one just joined), what happened just now and last week, and a couple of records in the interesting states the screens would show (one overdue, one sold out, one on a streak). Every seeded record is one the app's own Add could write.\n- look: a scene \u2014 a surface, a palette, a card shape and one gesture of mood \u2014 in under twenty words.\nThe access part, the title and the slugs stay as plain and exact as the field shows them. A vivid phrase belongs to this app or it stays out; every part describes the app the person asked for, and each part grows by a few words, never by a feature their words did not imply.";
|
|
152
|
+
export declare const MERCURY_CHOPPED_SEED_LINE = "- seed: a small world in words \u2014 a lively cast with quoted names and where each one stands (one leading, one close behind, one just joined), what happened just now and last week, and a couple of records in the interesting states the screens would show (one overdue, one sold out, one on a streak). Every seeded record is one the app's own Add could write.";
|
|
153
|
+
export declare const MERCURY_CHOPPED_OWN_WORLD_SEED_LINE = "- seed: a small world in words \u2014 a lively cast with quoted names and where each one stands in the app's own world, what happened just now and last week, and a couple of records in the interesting states this app's own records hold. Every seeded record is one the app's own Add could write.";
|
|
154
|
+
export declare const MERCURY_CHOPPED_OWN_WORLD_BRIEF_RULES: string;
|
|
155
|
+
export declare const MERCURY_CHOPPED_RECORDS_BRIEF_RULES: string;
|
|
156
|
+
export declare const MERCURY_ONECALL_CLASSIFY_RECORDS: string;
|
|
157
|
+
export declare const MERCURY_CHOPPED_PREAMBLE = "Make it vivid, like you can already see the app: name the first screen's hero control and the one moment that makes it fun to open, in their nouns. The promise stays the brief's: the core action and that control.";
|
|
158
|
+
export declare function mercuryBriefKeys(fields: readonly MercuryBriefField[]): string[];
|
|
159
|
+
export declare function mercuryBriefSchema(fields: readonly MercuryBriefField[], opts?: MercuryRoomsAsk): Record<string, unknown>;
|
|
160
|
+
interface MercuryBriefMessageOpts {
|
|
51
161
|
readonly personWords: string;
|
|
52
|
-
readonly shape: MercuryShape;
|
|
53
162
|
readonly fields: readonly MercuryBriefField[];
|
|
54
163
|
readonly words: readonly string[];
|
|
55
|
-
readonly
|
|
56
|
-
readonly
|
|
164
|
+
readonly style?: MercuryStyle;
|
|
165
|
+
readonly rooms?: boolean;
|
|
166
|
+
readonly font?: boolean;
|
|
167
|
+
readonly juice?: MercuryJuice;
|
|
168
|
+
readonly depth?: MercuryDepth;
|
|
169
|
+
readonly screens?: boolean;
|
|
170
|
+
readonly reply?: MercuryReplyShape;
|
|
171
|
+
readonly story?: boolean;
|
|
172
|
+
readonly preamble?: boolean;
|
|
173
|
+
readonly recordsRules?: boolean;
|
|
174
|
+
readonly recordsOwed?: boolean;
|
|
175
|
+
}
|
|
176
|
+
export declare function mercuryBriefMessages(o: MercuryBriefMessageOpts & {
|
|
177
|
+
readonly shape: MercuryShape;
|
|
178
|
+
}): LLMMessage[];
|
|
179
|
+
export declare function mercuryOneCallBriefMessages(o: MercuryBriefMessageOpts & {
|
|
180
|
+
readonly draft: number;
|
|
57
181
|
}): LLMMessage[];
|
|
58
182
|
export declare function cleanMercuryText(text: string): string;
|
|
59
|
-
export
|
|
183
|
+
export type MercuryRepair = "demo-prefix" | "archetype-tag";
|
|
184
|
+
export declare function stripMercuryArchetypeTag(text: string): {
|
|
185
|
+
readonly text: string;
|
|
186
|
+
readonly repaired: boolean;
|
|
187
|
+
};
|
|
188
|
+
export declare function repairMercuryField(field: Exclude<MercuryBriefField, "pairs">, value: string): {
|
|
189
|
+
readonly value: string;
|
|
190
|
+
readonly repaired: readonly MercuryRepair[];
|
|
191
|
+
};
|
|
192
|
+
export declare function prepareMercuryField(field: Exclude<MercuryBriefField, "pairs">, value: string): {
|
|
193
|
+
readonly gate: string;
|
|
194
|
+
readonly value: string;
|
|
195
|
+
readonly misses: readonly MercuryRepair[];
|
|
196
|
+
};
|
|
197
|
+
export interface MercuryGatedAddress {
|
|
198
|
+
readonly pairs: MercuryPair[];
|
|
199
|
+
readonly fallback: boolean;
|
|
200
|
+
readonly tagged: boolean;
|
|
201
|
+
}
|
|
202
|
+
export declare function gateMercuryAddress(o: {
|
|
60
203
|
readonly title: string;
|
|
61
|
-
readonly
|
|
62
|
-
}
|
|
204
|
+
readonly slugs: readonly string[];
|
|
205
|
+
}): Result<MercuryGatedAddress>;
|
|
206
|
+
export declare function mercurySlugsWithWord(pairs: readonly MercuryPair[], words: readonly string[]): number;
|
|
63
207
|
export declare function gateMercuryField(o: {
|
|
64
208
|
readonly field: Exclude<MercuryBriefField, "pairs">;
|
|
65
209
|
readonly value: string;
|
|
@@ -67,20 +211,83 @@ export declare function gateMercuryField(o: {
|
|
|
67
211
|
}): string[];
|
|
68
212
|
export declare const MERCURY_ACCESS_TAIL: Readonly<Record<MercuryArchetype, string>>;
|
|
69
213
|
export declare function mercuryAccessLine(shape: MercuryShape, access: string): string;
|
|
70
|
-
export declare function mercurySkills(shape: MercuryShape
|
|
71
|
-
|
|
214
|
+
export declare function mercurySkills(shape: MercuryShape, opts?: {
|
|
215
|
+
readonly personWords?: string;
|
|
216
|
+
readonly recordsRules?: boolean;
|
|
217
|
+
}): string[];
|
|
218
|
+
export type MercuryReadPosture = "private" | "members" | "public";
|
|
219
|
+
export type MercuryWritePosture = "owner" | "members";
|
|
220
|
+
export interface MercuryAccessPosture {
|
|
221
|
+
readonly read?: MercuryReadPosture;
|
|
222
|
+
readonly write?: MercuryWritePosture;
|
|
223
|
+
}
|
|
224
|
+
export declare function mercuryAccessPosture(access: string): MercuryAccessPosture;
|
|
225
|
+
export declare function mercuryDuoConflict(a: {
|
|
226
|
+
readonly shape: MercuryShape;
|
|
227
|
+
readonly access: string;
|
|
228
|
+
}, b: {
|
|
229
|
+
readonly shape: MercuryShape;
|
|
230
|
+
readonly access: string;
|
|
231
|
+
}, personWords: string): string | undefined;
|
|
232
|
+
export declare function mercuryNature(shape: MercuryShape, personWords: string): AppNature;
|
|
72
233
|
export declare function mercuryWorkflowLine(shape: MercuryShape): string;
|
|
73
|
-
|
|
234
|
+
interface MercuryAssembly {
|
|
74
235
|
readonly personWords: string;
|
|
75
236
|
readonly shape: MercuryShape;
|
|
76
237
|
readonly fields: MercuryBriefFields;
|
|
77
|
-
|
|
238
|
+
readonly rooms?: readonly string[];
|
|
239
|
+
readonly font?: string;
|
|
240
|
+
readonly screens?: string;
|
|
241
|
+
readonly story?: string;
|
|
242
|
+
readonly preamble?: string;
|
|
243
|
+
readonly reply?: MercuryReplyShape;
|
|
244
|
+
readonly partner?: MercuryTake;
|
|
245
|
+
readonly capabilityFlags?: Readonly<Record<MercuryFlag, boolean>>;
|
|
246
|
+
readonly recordsRules?: boolean;
|
|
247
|
+
readonly records?: string;
|
|
248
|
+
readonly rules?: string;
|
|
249
|
+
}
|
|
250
|
+
export interface MercuryTake {
|
|
251
|
+
readonly opening: string;
|
|
252
|
+
readonly access: string;
|
|
253
|
+
readonly seed: string;
|
|
254
|
+
readonly look: string;
|
|
255
|
+
readonly records?: string;
|
|
256
|
+
readonly rules?: string;
|
|
257
|
+
readonly screens?: string;
|
|
258
|
+
readonly story?: string;
|
|
259
|
+
readonly preamble?: string;
|
|
260
|
+
}
|
|
261
|
+
export interface MercuryGatedRooms {
|
|
262
|
+
readonly rooms?: readonly string[];
|
|
263
|
+
readonly dropped: number;
|
|
264
|
+
}
|
|
265
|
+
export declare function gateMercuryRooms(raw: unknown): MercuryGatedRooms;
|
|
266
|
+
export interface MercuryGatedFont {
|
|
267
|
+
readonly font?: string;
|
|
268
|
+
readonly dropped: number;
|
|
269
|
+
}
|
|
270
|
+
export declare function gateMercuryFont(raw: unknown): MercuryGatedFont;
|
|
271
|
+
export interface MercuryGatedScreens {
|
|
272
|
+
readonly screens?: string;
|
|
273
|
+
readonly dropped: number;
|
|
274
|
+
}
|
|
275
|
+
export declare function gateMercuryScreens(raw: unknown): MercuryGatedScreens;
|
|
276
|
+
export interface MercuryGatedStory {
|
|
277
|
+
readonly story?: string;
|
|
278
|
+
readonly dropped: number;
|
|
279
|
+
readonly misses?: readonly string[];
|
|
280
|
+
}
|
|
281
|
+
export declare function gateMercuryStory(raw: unknown): MercuryGatedStory;
|
|
282
|
+
export declare function gateMercuryWholePreamble(text: string): string[];
|
|
283
|
+
export declare function mercuryPreambleBrief(o: MercuryAssembly): string;
|
|
284
|
+
export declare function assembleMercuryCreateVibe(o: MercuryAssembly): CreateVibeToolInput;
|
|
78
285
|
export declare const MERCURY_PREAMBLE_SYSTEM = "You speak to the person who asked for an app, just before it is built. Write two or three plain sentences in their own words: what you are making for them, its core action, and the big control on its first screen that does it. That is the whole promise \u2014 the builder works out everything else after you speak. Start with \"I'm making\" or \"I'm building\", and write it as plain sentences to the person.";
|
|
79
286
|
export declare function mercuryPreambleMessages(o: {
|
|
80
287
|
readonly personWords: string;
|
|
81
288
|
readonly shape: MercuryShape;
|
|
82
289
|
readonly enrichedPrompt: string;
|
|
83
|
-
readonly
|
|
290
|
+
readonly style?: MercuryStyle;
|
|
84
291
|
}): LLMMessage[];
|
|
85
292
|
export declare function mercuryPreambleSchema(): Record<string, unknown>;
|
|
86
293
|
export declare function gateMercuryPreamble(o: {
|
|
@@ -102,20 +309,383 @@ export interface MercuryCallRecord {
|
|
|
102
309
|
readonly servedModel?: string;
|
|
103
310
|
readonly usage: readonly MercuryUsage[];
|
|
104
311
|
readonly error?: string;
|
|
312
|
+
readonly cause?: MercuryFallbackCause;
|
|
313
|
+
readonly sends: number;
|
|
314
|
+
readonly retries: number;
|
|
315
|
+
readonly history?: readonly string[];
|
|
316
|
+
readonly reasoningTokens?: number;
|
|
317
|
+
readonly passedThrough?: readonly MercuryRepair[];
|
|
318
|
+
readonly addressRepair?: readonly MercuryAddressRepair[];
|
|
319
|
+
readonly slugsWithWord?: number;
|
|
320
|
+
readonly roomsDropped?: number;
|
|
321
|
+
readonly fontDropped?: number;
|
|
322
|
+
readonly fanout?: MercuryFanout;
|
|
323
|
+
readonly juice?: MercuryJuice;
|
|
324
|
+
readonly depth?: MercuryDepth;
|
|
325
|
+
readonly screensDropped?: number;
|
|
326
|
+
readonly reply?: MercuryReplyShape;
|
|
327
|
+
readonly preambleFrom?: "brief" | "classification";
|
|
328
|
+
readonly storyChars?: number;
|
|
329
|
+
readonly storyDropped?: number;
|
|
330
|
+
readonly preambleChars?: number;
|
|
331
|
+
readonly softMisses?: Readonly<Record<string, readonly string[]>>;
|
|
332
|
+
readonly coerced?: readonly string[];
|
|
333
|
+
readonly fieldsDropped?: readonly string[];
|
|
334
|
+
readonly preambleFallback?: 1;
|
|
335
|
+
readonly duo?: true;
|
|
336
|
+
readonly duoDrafts?: readonly number[];
|
|
337
|
+
readonly duoBreadth?: readonly number[];
|
|
338
|
+
readonly duoPool?: number;
|
|
339
|
+
readonly duoArchetypes?: readonly MercuryArchetype[];
|
|
340
|
+
readonly duoConflict?: true;
|
|
341
|
+
readonly duoConflictReason?: string;
|
|
342
|
+
readonly recordsRules?: true;
|
|
343
|
+
readonly recordsDropped?: number;
|
|
344
|
+
readonly rulesDropped?: number;
|
|
345
|
+
readonly oneCall?: true;
|
|
346
|
+
readonly shapeCall?: false;
|
|
347
|
+
readonly draftArchetypes?: readonly (MercuryArchetype | null)[];
|
|
348
|
+
readonly archetypeSplit?: boolean;
|
|
349
|
+
readonly flagsWinner?: readonly MercuryFlag[];
|
|
350
|
+
readonly flagsUnion?: readonly MercuryFlag[];
|
|
351
|
+
readonly backendFilterCleared?: readonly number[];
|
|
352
|
+
readonly backendFilterKept?: number;
|
|
353
|
+
readonly planner?: Exclude<MercuryPlanner, "mercury">;
|
|
354
|
+
readonly format?: MercuryFormat;
|
|
355
|
+
readonly thinkAloud?: {
|
|
356
|
+
readonly narrationChars: number;
|
|
357
|
+
readonly specChars: number;
|
|
358
|
+
readonly guessLines: number;
|
|
359
|
+
};
|
|
360
|
+
readonly cards?: {
|
|
361
|
+
readonly preambleChars: number;
|
|
362
|
+
readonly cards: number;
|
|
363
|
+
readonly acceptLines: number;
|
|
364
|
+
readonly ruleLines: number;
|
|
365
|
+
readonly guessLines: number;
|
|
366
|
+
readonly dataRecords: number;
|
|
367
|
+
};
|
|
368
|
+
readonly fim?: MercuryFimReceipt;
|
|
369
|
+
readonly text?: string;
|
|
370
|
+
readonly partialText?: string;
|
|
371
|
+
readonly duoTexts?: readonly string[];
|
|
372
|
+
readonly filledText?: string;
|
|
373
|
+
}
|
|
374
|
+
export type MercuryFormat = "prose" | "thinkaloud" | "cards" | "cards-fim";
|
|
375
|
+
export interface MercuryBilled {
|
|
376
|
+
readonly prompt_tokens: number;
|
|
377
|
+
readonly completion_tokens: number;
|
|
378
|
+
readonly total_tokens: number;
|
|
379
|
+
readonly cost?: number;
|
|
380
|
+
readonly estimated: number;
|
|
381
|
+
}
|
|
382
|
+
export interface MercuryPickCandidate {
|
|
383
|
+
readonly draft: number;
|
|
384
|
+
readonly breadth: number;
|
|
385
|
+
readonly softMisses: number;
|
|
386
|
+
readonly ms: number;
|
|
387
|
+
readonly archetype?: MercuryArchetype;
|
|
388
|
+
}
|
|
389
|
+
export interface MercuryDuoReceipt {
|
|
390
|
+
readonly drafts: readonly number[];
|
|
391
|
+
readonly breadth: readonly number[];
|
|
392
|
+
readonly pool?: number;
|
|
393
|
+
readonly candidates?: readonly MercuryPickCandidate[];
|
|
394
|
+
readonly archetypes?: readonly MercuryArchetype[];
|
|
395
|
+
readonly archetypeSplit?: boolean;
|
|
396
|
+
readonly conflict?: string;
|
|
397
|
+
}
|
|
398
|
+
export interface MercuryFanout {
|
|
399
|
+
readonly drafts: number;
|
|
400
|
+
readonly valid: number;
|
|
401
|
+
readonly winner?: number;
|
|
402
|
+
readonly winnerMs?: number;
|
|
403
|
+
readonly picked?: number;
|
|
404
|
+
readonly candidates?: readonly MercuryPickCandidate[];
|
|
405
|
+
readonly pickWaitMs?: number;
|
|
406
|
+
readonly aborted: number;
|
|
407
|
+
readonly throttled?: number;
|
|
408
|
+
readonly billed: MercuryBilled;
|
|
105
409
|
}
|
|
410
|
+
export interface MercuryRowTarget {
|
|
411
|
+
readonly chatId: string;
|
|
412
|
+
readonly userId: string;
|
|
413
|
+
readonly onUsage?: (rounds: readonly MercuryUsageRound[]) => void;
|
|
414
|
+
readonly keepText?: boolean;
|
|
415
|
+
readonly onWritten?: (promptId: string) => void;
|
|
416
|
+
}
|
|
417
|
+
export type MercuryUsageRound = MercuryUsage & {
|
|
418
|
+
readonly model: string;
|
|
419
|
+
readonly role: "mercury";
|
|
420
|
+
};
|
|
421
|
+
export declare function recordMercuryDispatched(vctx: VibesApiSQLCtx, o: {
|
|
422
|
+
readonly chatId: string;
|
|
423
|
+
readonly promptId: string;
|
|
424
|
+
readonly enrichedPrompt: string;
|
|
425
|
+
}): Promise<void>;
|
|
426
|
+
export declare function recordMercuryRace(vctx: VibesApiSQLCtx, o: {
|
|
427
|
+
readonly chatId: string;
|
|
428
|
+
readonly promptId: string;
|
|
429
|
+
readonly race: object;
|
|
430
|
+
}): Promise<void>;
|
|
431
|
+
export declare function recordMercuryFim(vctx: VibesApiSQLCtx, o: {
|
|
432
|
+
readonly chatId: string;
|
|
433
|
+
readonly promptId: string;
|
|
434
|
+
readonly fim: MercuryFimReceipt;
|
|
435
|
+
readonly filledText?: string;
|
|
436
|
+
}): Promise<void>;
|
|
437
|
+
export interface MercuryProseExample {
|
|
438
|
+
readonly ask: string;
|
|
439
|
+
readonly brief: string;
|
|
440
|
+
}
|
|
441
|
+
export declare const MERCURY_PROSE_FORMAT_EXAMPLES: readonly MercuryProseExample[];
|
|
442
|
+
export declare const MERCURY_PROSE_SYSTEM: string;
|
|
443
|
+
export declare function mercuryProseBriefSchema(opts?: {
|
|
444
|
+
readonly rooms?: boolean;
|
|
445
|
+
readonly font?: boolean;
|
|
446
|
+
}): Record<string, unknown>;
|
|
447
|
+
export declare function mercuryProseBriefMessages(o: {
|
|
448
|
+
readonly personWords: string;
|
|
449
|
+
readonly words: readonly string[];
|
|
450
|
+
readonly rooms?: boolean;
|
|
451
|
+
readonly font?: boolean;
|
|
452
|
+
}): LLMMessage[];
|
|
453
|
+
interface MercuryProseDraft {
|
|
454
|
+
readonly shape: MercuryShape;
|
|
455
|
+
readonly brief: string;
|
|
456
|
+
readonly address: MercuryGatedAddress;
|
|
457
|
+
readonly addressRepair: readonly MercuryAddressRepair[];
|
|
458
|
+
readonly rooms?: MercuryGatedRooms;
|
|
459
|
+
readonly font?: MercuryGatedFont;
|
|
460
|
+
}
|
|
461
|
+
export declare function gateMercuryProseDraft(json: unknown, o: {
|
|
462
|
+
readonly personWords: string;
|
|
463
|
+
readonly askRooms: boolean;
|
|
464
|
+
}): Result<MercuryProseDraft>;
|
|
465
|
+
export declare function assembleMercuryProseCreateVibe(o: {
|
|
466
|
+
readonly personWords: string;
|
|
467
|
+
readonly draft: MercuryProseDraft;
|
|
468
|
+
}): CreateVibeToolInput;
|
|
469
|
+
export declare function mercuryProsePreamble(draft: MercuryProseDraft): string;
|
|
470
|
+
export declare const MERCURY_THINKALOUD_MARKER = "--- SPEC ---";
|
|
471
|
+
export declare const MERCURY_THINKALOUD_SPEC_HINTS: Readonly<Record<string, string>>;
|
|
472
|
+
export declare function mercuryThinkAloudSystem(o?: {
|
|
473
|
+
readonly rooms?: boolean;
|
|
474
|
+
readonly font?: boolean;
|
|
475
|
+
}): string;
|
|
476
|
+
export declare function mercuryThinkAloudMessages(o: {
|
|
477
|
+
readonly personWords: string;
|
|
478
|
+
readonly words: readonly string[];
|
|
479
|
+
readonly rooms?: boolean;
|
|
480
|
+
readonly font?: boolean;
|
|
481
|
+
}): LLMMessage[];
|
|
482
|
+
export interface MercuryThinkAloudReply {
|
|
483
|
+
readonly narration: string;
|
|
484
|
+
readonly spec: string;
|
|
485
|
+
readonly keys: Readonly<Record<string, string>>;
|
|
486
|
+
readonly guessLines: number;
|
|
487
|
+
}
|
|
488
|
+
export declare function parseMercuryThinkAloud(text: string): MercuryThinkAloudReply | undefined;
|
|
489
|
+
export interface MercuryThinkAloudDraft {
|
|
490
|
+
readonly shape: MercuryShape;
|
|
491
|
+
readonly reply: string;
|
|
492
|
+
readonly narration: string;
|
|
493
|
+
readonly spec: string;
|
|
494
|
+
readonly address: MercuryGatedAddress;
|
|
495
|
+
readonly addressRepair: readonly MercuryAddressRepair[];
|
|
496
|
+
readonly rooms?: MercuryGatedRooms;
|
|
497
|
+
readonly font?: MercuryGatedFont;
|
|
498
|
+
readonly softMisses: Readonly<Record<string, readonly string[]>>;
|
|
499
|
+
readonly guessLines: number;
|
|
500
|
+
}
|
|
501
|
+
export declare const MERCURY_THINKALOUD_DEFAULT_ARCHETYPE: MercuryArchetype;
|
|
502
|
+
export declare function gateMercuryThinkAloud(raw: unknown, o: {
|
|
503
|
+
readonly personWords: string;
|
|
504
|
+
readonly askRooms: boolean;
|
|
505
|
+
}): Result<MercuryThinkAloudDraft>;
|
|
506
|
+
export declare const MERCURY_TESTER_REPLY_INTRO = "A fast tester's first read:";
|
|
507
|
+
export declare const MERCURY_TESTER_REPLY_RULE = "Guesses only; the creator's words win.";
|
|
508
|
+
export declare function mercuryTesterReplyEnrichedPrompt(reply: string, personWords: string): string;
|
|
509
|
+
export declare function assembleMercuryThinkAloudCreateVibe(o: {
|
|
510
|
+
readonly personWords: string;
|
|
511
|
+
readonly draft: MercuryThinkAloudDraft;
|
|
512
|
+
}): CreateVibeToolInput;
|
|
513
|
+
export declare function mercuryThinkAloudPreamble(draft: MercuryThinkAloudDraft): string;
|
|
514
|
+
export declare const MERCURY_CARDS_MARKER = "--- CARDS ---";
|
|
515
|
+
export declare const MERCURY_CARDS_APP_MARKER = "--- APP ---";
|
|
516
|
+
export declare const MERCURY_CARDS_TAIL_HINTS: Readonly<Record<string, string>>;
|
|
517
|
+
export declare const MERCURY_CARDS_PREAMBLE_RULE = "Start with a short paragraph to the app creator, in plain warm words: what you're making for them and its most important workflow, walked through the way they'll do it. Say \"probably\" where you're guessing.";
|
|
518
|
+
export declare const MERCURY_CARDS_SHAPE = "As a <role>, I <action on a named record>, so that <outcome>.\n Accept: <one testable line, in terms of records and fields>\n Accept: <another>\n Data: <Record>{<field>, <field>, ...}\n Rule: <a value this card depends on and how it comes about, said loosely in one plain English sentence a friend would understand>";
|
|
519
|
+
export declare const MERCURY_CARDS_RULES = "Rules:\n- Use the person's own nouns for records, roles and actions.\n- Give what the person asked for plus what those parts need in order to work.\n- A line that rests on your assumption and not on the person's words ends with (guess). A line the person's words settle carries no label.";
|
|
520
|
+
export declare function mercuryCardsSystem(o?: {
|
|
521
|
+
readonly rooms?: boolean;
|
|
522
|
+
readonly font?: boolean;
|
|
523
|
+
}): string;
|
|
524
|
+
export declare function mercuryCardsMessages(o: {
|
|
525
|
+
readonly personWords: string;
|
|
526
|
+
readonly words: readonly string[];
|
|
527
|
+
readonly rooms?: boolean;
|
|
528
|
+
readonly font?: boolean;
|
|
529
|
+
}): LLMMessage[];
|
|
530
|
+
export interface MercuryCardsReply {
|
|
531
|
+
readonly lines: readonly string[];
|
|
532
|
+
readonly preamble: string;
|
|
533
|
+
readonly cardsMarkerAt?: number;
|
|
534
|
+
readonly appMarkerAt?: number;
|
|
535
|
+
readonly cardLines: readonly number[];
|
|
536
|
+
readonly keys: Readonly<Record<string, string>>;
|
|
537
|
+
readonly dataRecords: readonly string[];
|
|
538
|
+
readonly acceptLines: number;
|
|
539
|
+
readonly ruleLines: number;
|
|
540
|
+
readonly guessLines: number;
|
|
541
|
+
}
|
|
542
|
+
export declare function parseMercuryCards(text: string): MercuryCardsReply;
|
|
543
|
+
export interface MercuryCardsDraft {
|
|
544
|
+
readonly shape: MercuryShape;
|
|
545
|
+
readonly reply: string;
|
|
546
|
+
readonly parsed: MercuryCardsReply;
|
|
547
|
+
readonly address: MercuryGatedAddress;
|
|
548
|
+
readonly addressRepair: readonly MercuryAddressRepair[];
|
|
549
|
+
readonly rooms?: MercuryGatedRooms;
|
|
550
|
+
readonly font?: MercuryGatedFont;
|
|
551
|
+
readonly softMisses: Readonly<Record<string, readonly string[]>>;
|
|
552
|
+
}
|
|
553
|
+
export declare function gateMercuryCards(raw: unknown, o: {
|
|
554
|
+
readonly personWords: string;
|
|
555
|
+
readonly askRooms: boolean;
|
|
556
|
+
}): Result<MercuryCardsDraft>;
|
|
557
|
+
export declare const MERCURY_FIM_MODEL = "mercury-coder";
|
|
558
|
+
export declare const MERCURY_FIM_URL = "https://api.inceptionlabs.ai/v1/fim/completions";
|
|
559
|
+
export declare const MERCURY_FIM_MAX_TOKENS = 2000;
|
|
560
|
+
export declare const MERCURY_FIM_STOP: readonly string[];
|
|
561
|
+
export declare const MERCURY_FIM_CALL_DEADLINE_MS = 20000;
|
|
562
|
+
export declare const MERCURY_FIM_BUDGET_MS = 40000;
|
|
563
|
+
export declare const MERCURY_FIM_CONCURRENCY = 8;
|
|
564
|
+
export declare const MERCURY_FIM_PRICE: {
|
|
565
|
+
readonly inputUsdPerMTok: 0.25;
|
|
566
|
+
readonly outputUsdPerMTok: 1;
|
|
567
|
+
};
|
|
568
|
+
export declare function mercuryFimUsageRound(fim: MercuryFimReceipt): MercuryUsageRound | undefined;
|
|
569
|
+
export declare const MERCURY_FIM_WAVES: readonly ["see", "expect"];
|
|
570
|
+
export type MercuryFimSlot = (typeof MERCURY_FIM_WAVES)[number];
|
|
571
|
+
export declare const MERCURY_FIM_SEEDS: Readonly<Record<MercuryFimSlot, string>>;
|
|
572
|
+
export declare function mercuryFimHeader(personWords: string): string;
|
|
573
|
+
export interface MercuryFimReceipt {
|
|
574
|
+
readonly status: "ok" | "no-key" | "no-cards" | "failed";
|
|
575
|
+
readonly model: string;
|
|
576
|
+
readonly cards: number;
|
|
577
|
+
readonly slots: number;
|
|
578
|
+
readonly filled: number;
|
|
579
|
+
readonly empty: number;
|
|
580
|
+
readonly failed: number;
|
|
581
|
+
readonly ms: number;
|
|
582
|
+
readonly promptTokens: number;
|
|
583
|
+
readonly completionTokens: number;
|
|
584
|
+
readonly errors?: readonly string[];
|
|
585
|
+
}
|
|
586
|
+
export declare function renderMercuryCardsFills(o: {
|
|
587
|
+
readonly lines: readonly string[];
|
|
588
|
+
readonly bodyEnd: number;
|
|
589
|
+
readonly cardLines: readonly number[];
|
|
590
|
+
readonly fills: ReadonlyMap<string, string>;
|
|
591
|
+
readonly gap?: string;
|
|
592
|
+
}): string;
|
|
593
|
+
export declare function mercuryFimRequest(o: {
|
|
594
|
+
readonly personWords: string;
|
|
595
|
+
readonly lines: readonly string[];
|
|
596
|
+
readonly bodyEnd: number;
|
|
597
|
+
readonly cardLines: readonly number[];
|
|
598
|
+
readonly fills: ReadonlyMap<string, string>;
|
|
599
|
+
readonly gap: string;
|
|
600
|
+
}): {
|
|
601
|
+
readonly model: string;
|
|
602
|
+
readonly prompt: string;
|
|
603
|
+
readonly suffix: string;
|
|
604
|
+
readonly max_tokens: number;
|
|
605
|
+
readonly stop: string[];
|
|
606
|
+
};
|
|
607
|
+
export declare function mercuryCardsFim(vctx: Pick<VibesApiSQLCtx, "inferenceFetch">, o: {
|
|
608
|
+
readonly draft: MercuryCardsDraft;
|
|
609
|
+
readonly personWords: string;
|
|
610
|
+
readonly apiKey?: string;
|
|
611
|
+
readonly deadlineMs?: number;
|
|
612
|
+
readonly budgetMs?: number;
|
|
613
|
+
readonly url?: string;
|
|
614
|
+
readonly cancel?: AbortSignal;
|
|
615
|
+
}): Promise<{
|
|
616
|
+
readonly reply: string;
|
|
617
|
+
readonly receipt: MercuryFimReceipt;
|
|
618
|
+
}>;
|
|
619
|
+
export declare function assembleMercuryCardsCreateVibe(o: {
|
|
620
|
+
readonly personWords: string;
|
|
621
|
+
readonly draft: MercuryCardsDraft;
|
|
622
|
+
readonly reply: string;
|
|
623
|
+
}): CreateVibeToolInput;
|
|
624
|
+
export declare function mercuryCardsPreamble(draft: MercuryCardsDraft, personWords: string): string;
|
|
106
625
|
export interface MercuryFirstBuild {
|
|
107
626
|
readonly input: CreateVibeToolInput;
|
|
108
627
|
readonly preamble: string;
|
|
628
|
+
readonly preambleFrom?: "call" | "brief" | "classification";
|
|
629
|
+
readonly storyChars?: number;
|
|
630
|
+
readonly duo?: MercuryDuoReceipt;
|
|
631
|
+
readonly oneCall?: MercuryOneCallReceipt;
|
|
632
|
+
readonly planner?: Exclude<MercuryPlanner, "mercury">;
|
|
633
|
+
readonly format?: MercuryFormat;
|
|
634
|
+
readonly fim?: MercuryFimReceipt;
|
|
109
635
|
readonly shape: MercuryShape;
|
|
110
636
|
readonly elapsedMs: number;
|
|
637
|
+
readonly sends?: number;
|
|
638
|
+
readonly retries?: number;
|
|
639
|
+
readonly rowPromptId?: string;
|
|
111
640
|
}
|
|
112
641
|
export interface RunMercuryFirstBuildArgs {
|
|
113
642
|
readonly chatId: string;
|
|
114
643
|
readonly userId: string;
|
|
115
644
|
readonly personWords: string;
|
|
116
645
|
readonly words: readonly string[];
|
|
646
|
+
readonly style?: MercuryStyle;
|
|
117
647
|
readonly deadlineMs?: number;
|
|
118
|
-
readonly
|
|
119
|
-
readonly
|
|
648
|
+
readonly budgetMs?: number;
|
|
649
|
+
readonly rateLimitedBudgetMs?: number;
|
|
650
|
+
readonly breaker?: MercuryCircuitBreaker;
|
|
651
|
+
readonly onUsage?: (rounds: readonly MercuryUsageRound[]) => void;
|
|
652
|
+
readonly wordBag?: (count: number) => string[];
|
|
653
|
+
readonly rooms?: boolean;
|
|
654
|
+
readonly juice?: MercuryJuice;
|
|
655
|
+
readonly depth?: MercuryDepth;
|
|
656
|
+
readonly reply?: MercuryReplyShape;
|
|
657
|
+
readonly duo?: boolean;
|
|
658
|
+
readonly duoPool?: number;
|
|
659
|
+
readonly oneCall?: boolean;
|
|
660
|
+
readonly recordsRules?: boolean;
|
|
661
|
+
readonly planner?: MercuryPlanner;
|
|
662
|
+
readonly format?: "skeleton" | MercuryFormat;
|
|
663
|
+
readonly fimApiKey?: string;
|
|
664
|
+
readonly fimUrl?: string;
|
|
665
|
+
readonly keepText?: boolean;
|
|
666
|
+
readonly signal?: AbortSignal;
|
|
667
|
+
readonly onRowWritten?: (promptId: string) => void;
|
|
120
668
|
}
|
|
669
|
+
export declare function coerceMercuryText(v: unknown): {
|
|
670
|
+
readonly text?: string;
|
|
671
|
+
readonly coerced: boolean;
|
|
672
|
+
};
|
|
673
|
+
export declare const MERCURY_DROP_OVER_BOUND = 3;
|
|
674
|
+
export declare const MERCURY_BRIEF_FANOUT = 4;
|
|
675
|
+
export declare const MERCURY_SHAPE_MAX_TOKENS = 800;
|
|
676
|
+
export declare const MERCURY_PICK_WAIT_MS = 1500;
|
|
677
|
+
export declare const MERCURY_PICK_COUNT = 2;
|
|
678
|
+
export declare const MERCURY_DUO_PICK_COUNT = 3;
|
|
679
|
+
export declare const MERCURY_ONECALL_EXTRA_TOKENS = 400;
|
|
680
|
+
export declare function mercuryBreadth(o: {
|
|
681
|
+
readonly screens?: string;
|
|
682
|
+
readonly opening: string;
|
|
683
|
+
readonly seed?: string;
|
|
684
|
+
readonly access?: string;
|
|
685
|
+
}): number;
|
|
686
|
+
export declare const MERCURY_PROSE_MAX_TOKENS = 3200;
|
|
687
|
+
export declare const MERCURY_THINKALOUD_MAX_TOKENS = 16000;
|
|
688
|
+
export declare const MERCURY_THINKALOUD_DEADLINE_MS = 20000;
|
|
689
|
+
export declare const MERCURY_THINKALOUD_BUDGET_MS = 25000;
|
|
121
690
|
export declare function runMercuryFirstBuild(vctx: VibesApiSQLCtx, args: RunMercuryFirstBuildArgs): Promise<Result<MercuryFirstBuild>>;
|
|
691
|
+
export {};
|