@vibes.diy/api-svc 14.3.79 → 14.3.80

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 (152) hide show
  1. package/create-handler.d.ts +0 -1
  2. package/create-handler.js +0 -2
  3. package/create-handler.js.map +1 -1
  4. package/evento-handler-manifest.js +6 -2
  5. package/evento-handler-manifest.js.map +1 -1
  6. package/index.d.ts +0 -1
  7. package/index.js +0 -1
  8. package/index.js.map +1 -1
  9. package/intern/account-vibe-activity.d.ts +36 -0
  10. package/intern/account-vibe-activity.js +284 -0
  11. package/intern/account-vibe-activity.js.map +1 -0
  12. package/intern/agent-account-tools.d.ts +21 -1
  13. package/intern/agent-account-tools.js +221 -35
  14. package/intern/agent-account-tools.js.map +1 -1
  15. package/intern/agent-assembly.d.ts +1 -0
  16. package/intern/agent-assembly.js +24 -2
  17. package/intern/agent-assembly.js.map +1 -1
  18. package/intern/agent-belt.js +3 -1
  19. package/intern/agent-belt.js.map +1 -1
  20. package/intern/agent-discussions.d.ts +22 -0
  21. package/intern/agent-discussions.js +131 -0
  22. package/intern/agent-discussions.js.map +1 -0
  23. package/intern/agent-file-tools.d.ts +12 -2
  24. package/intern/agent-file-tools.js.map +1 -1
  25. package/intern/agent-options-tool.d.ts +5 -1
  26. package/intern/agent-options-tool.js +49 -14
  27. package/intern/agent-options-tool.js.map +1 -1
  28. package/intern/agent-read-tools.d.ts +1 -0
  29. package/intern/agent-read-tools.js +1 -1
  30. package/intern/agent-read-tools.js.map +1 -1
  31. package/intern/agent-request-frame.d.ts +23 -2
  32. package/intern/agent-request-frame.js +74 -16
  33. package/intern/agent-request-frame.js.map +1 -1
  34. package/intern/agent-session-instruction.d.ts +2 -2
  35. package/intern/agent-session-instruction.js +7 -14
  36. package/intern/agent-session-instruction.js.map +1 -1
  37. package/intern/agent-session.d.ts +5 -0
  38. package/intern/agent-session.js +10 -2
  39. package/intern/agent-session.js.map +1 -1
  40. package/intern/agent-settled-history.d.ts +22 -0
  41. package/intern/agent-settled-history.js +293 -0
  42. package/intern/agent-settled-history.js.map +1 -0
  43. package/intern/agent-top-level-instruction.d.ts +2 -2
  44. package/intern/agent-top-level-instruction.js +7 -4
  45. package/intern/agent-top-level-instruction.js.map +1 -1
  46. package/intern/agent-wake.d.ts +2 -0
  47. package/intern/agent-wake.js +2 -1
  48. package/intern/agent-wake.js.map +1 -1
  49. package/intern/agent-with-vibe.d.ts +24 -1
  50. package/intern/agent-with-vibe.js +97 -30
  51. package/intern/agent-with-vibe.js.map +1 -1
  52. package/intern/builder-settled-history.d.ts +12 -0
  53. package/intern/builder-settled-history.js +71 -0
  54. package/intern/builder-settled-history.js.map +1 -0
  55. package/intern/byok-model-scope.d.ts +7 -0
  56. package/intern/byok-model-scope.js +11 -0
  57. package/intern/byok-model-scope.js.map +1 -0
  58. package/intern/caller-model.d.ts +19 -0
  59. package/intern/caller-model.js +30 -0
  60. package/intern/caller-model.js.map +1 -0
  61. package/intern/design-repair.d.ts +3 -0
  62. package/intern/design-repair.js +41 -1
  63. package/intern/design-repair.js.map +1 -1
  64. package/intern/ensure-chat-id.js +40 -2
  65. package/intern/ensure-chat-id.js.map +1 -1
  66. package/intern/first-build-no-app.d.ts +15 -0
  67. package/intern/first-build-no-app.js +124 -0
  68. package/intern/first-build-no-app.js.map +1 -0
  69. package/intern/get-vibe-route-hints.d.ts +2 -2
  70. package/intern/get-vibe-route-hints.js +9 -5
  71. package/intern/get-vibe-route-hints.js.map +1 -1
  72. package/intern/import-synth.js +1 -0
  73. package/intern/import-synth.js.map +1 -1
  74. package/intern/llm-tool-loop.d.ts +5 -1
  75. package/intern/llm-tool-loop.js +11 -6
  76. package/intern/llm-tool-loop.js.map +1 -1
  77. package/intern/look-lint-engine.js +25 -1
  78. package/intern/look-lint-engine.js.map +1 -1
  79. package/intern/mint-fire-core.js +7 -0
  80. package/intern/mint-fire-core.js.map +1 -1
  81. package/intern/opens-check.js +3 -0
  82. package/intern/opens-check.js.map +1 -1
  83. package/intern/prompt-assembly.d.ts +6 -0
  84. package/intern/prompt-assembly.js +65 -13
  85. package/intern/prompt-assembly.js.map +1 -1
  86. package/package.json +14 -13
  87. package/public/agent-turn-action.js +115 -66
  88. package/public/agent-turn-action.js.map +1 -1
  89. package/public/agent-turn-assembly.d.ts +5 -0
  90. package/public/agent-turn-assembly.js +21 -6
  91. package/public/agent-turn-assembly.js.map +1 -1
  92. package/public/app-documents-write-eventos.js +12 -2
  93. package/public/app-documents-write-eventos.js.map +1 -1
  94. package/public/codegen-turn-route.d.ts +1 -0
  95. package/public/codegen-turn-route.js +2 -1
  96. package/public/codegen-turn-route.js.map +1 -1
  97. package/public/fork-app.js +4 -1
  98. package/public/fork-app.js.map +1 -1
  99. package/public/fs-prompt.d.ts +2 -1
  100. package/public/fs-prompt.js +4 -2
  101. package/public/fs-prompt.js.map +1 -1
  102. package/public/handler-llm-request.d.ts +3 -1
  103. package/public/handler-llm-request.js +14 -2
  104. package/public/handler-llm-request.js.map +1 -1
  105. package/public/home-feed-common.js +1 -1
  106. package/public/home-feed-common.js.map +1 -1
  107. package/public/list-agent-discussions.d.ts +3 -0
  108. package/public/list-agent-discussions.js +45 -0
  109. package/public/list-agent-discussions.js.map +1 -0
  110. package/public/list-app-models.d.ts +20 -0
  111. package/public/list-app-models.js +159 -0
  112. package/public/list-app-models.js.map +1 -0
  113. package/public/list-vibe-activity.d.ts +3 -0
  114. package/public/list-vibe-activity.js +58 -0
  115. package/public/list-vibe-activity.js.map +1 -0
  116. package/public/llm-dispatch-fallback.d.ts +1 -0
  117. package/public/llm-dispatch-fallback.js +4 -0
  118. package/public/llm-dispatch-fallback.js.map +1 -1
  119. package/public/open-chat.js +2 -1
  120. package/public/open-chat.js.map +1 -1
  121. package/public/prompt-chat-section.js +21 -1
  122. package/public/prompt-chat-section.js.map +1 -1
  123. package/public/prompt-section-actions.d.ts +2 -0
  124. package/public/prompt-section-actions.js +5 -2
  125. package/public/prompt-section-actions.js.map +1 -1
  126. package/public/prompt-turn-settled.js +1 -0
  127. package/public/prompt-turn-settled.js.map +1 -1
  128. package/public/prompt-turn-types.d.ts +1 -0
  129. package/public/related-vibes.js +3 -3
  130. package/public/related-vibes.js.map +1 -1
  131. package/public/request-flow.js +7 -1
  132. package/public/request-flow.js.map +1 -1
  133. package/public/resolve-active-handle.d.ts +1 -0
  134. package/public/resolve-active-handle.js +36 -1
  135. package/public/resolve-active-handle.js.map +1 -1
  136. package/public/stream-assembly.js +2 -0
  137. package/public/stream-assembly.js.map +1 -1
  138. package/shard-gate.js +15 -2
  139. package/shard-gate.js.map +1 -1
  140. package/types.d.ts +0 -1
  141. package/types.js.map +1 -1
  142. package/usage-report/first-build-no-app-alarm-util.d.ts +24 -0
  143. package/usage-report/first-build-no-app-alarm-util.js +70 -0
  144. package/usage-report/first-build-no-app-alarm-util.js.map +1 -0
  145. package/usage-report/first-build-no-app-alarm.d.ts +2 -0
  146. package/usage-report/first-build-no-app-alarm.js +180 -0
  147. package/usage-report/first-build-no-app-alarm.js.map +1 -0
  148. package/usage-report/warm-vibe-cache.js +1 -1
  149. package/usage-report/warm-vibe-cache.js.map +1 -1
  150. package/public/similar-vibes.d.ts +0 -11
  151. package/public/similar-vibes.js +0 -86
  152. package/public/similar-vibes.js.map +0 -1
@@ -0,0 +1,293 @@
1
+ import { isRequestFrameMessage, markJournalCacheTail } from "./agent-request-frame.js";
2
+ export const SETTLE_BATCH_TURNS = 3;
3
+ export const LIVE_TURNS_MAX = 2 * SETTLE_BATCH_TURNS;
4
+ export const NO_SETTLED_HISTORY = { through: 0, messages: 0 };
5
+ export const SETTLED_HISTORY_PREFIX = "[settled history]";
6
+ const SETTLED_HISTORY_HEADER = `${SETTLED_HISTORY_PREFIX} The earlier turns of this conversation follow in settled form: each keeps the person's words exactly and your final reply, then lists the tools you called and the versions you saved, one line each. The full turns after them are as they happened. For anything you need from earlier work — a file, a picture, a setting — read the app as it is now.`;
7
+ export const AGENT_RESUME_WAKE_NOTE = "Resume the persisted agent session.";
8
+ const PLATFORM_PREFIXES = [
9
+ "[build result]",
10
+ "[commit result]",
11
+ "[queued edit]",
12
+ "[tool result]",
13
+ "[tool image]",
14
+ SETTLED_HISTORY_PREFIX,
15
+ ];
16
+ function firstText(message) {
17
+ if (Array.isArray(message.content) === false)
18
+ return typeof message.content === "string" ? message.content : undefined;
19
+ const first = message.content[0];
20
+ return first?.type === "text" ? first.text : undefined;
21
+ }
22
+ export function isPersonMessage(message) {
23
+ if (message.role !== "user" || Array.isArray(message.content) === false)
24
+ return false;
25
+ if (isRequestFrameMessage(message))
26
+ return false;
27
+ const text = firstText(message);
28
+ if (text === undefined)
29
+ return true;
30
+ if (text === AGENT_RESUME_WAKE_NOTE)
31
+ return false;
32
+ return PLATFORM_PREFIXES.some((prefix) => text.startsWith(prefix)) === false;
33
+ }
34
+ function isBandHeader(message) {
35
+ return message !== undefined && message.role === "user" && firstText(message)?.startsWith(SETTLED_HISTORY_PREFIX) === true;
36
+ }
37
+ export function settledBandLength(journal, state) {
38
+ const count = state?.messages ?? 0;
39
+ if (count < 3 || count > journal.length)
40
+ return 0;
41
+ if (isBandHeader(journal[0]) === false)
42
+ return 0;
43
+ const last = journal[count - 1];
44
+ return last?.role === "assistant" && Array.isArray(last.content) ? count : 0;
45
+ }
46
+ function liveTurnStarts(journal, from) {
47
+ const starts = [];
48
+ for (let i = from; i < journal.length; i++) {
49
+ const message = journal[i];
50
+ if (message === undefined || isPersonMessage(message) === false)
51
+ continue;
52
+ const previous = journal[i - 1];
53
+ if (i === from || previous === undefined || isPersonMessage(previous) === false)
54
+ starts.push(i);
55
+ }
56
+ return starts;
57
+ }
58
+ const MAX_LINE = 200;
59
+ function oneLine(text, firstSentence = true) {
60
+ const line = (text.split("\n").find((l) => l.trim() !== "") ?? "").trim().replace(/\s+/g, " ");
61
+ const sentence = firstSentence ? (/^(.+?[.!?])(\s|$)/.exec(line)?.[1] ?? line) : line;
62
+ return sentence.length > MAX_LINE ? `${sentence.slice(0, MAX_LINE - 1)}…` : sentence;
63
+ }
64
+ function parseArgs(raw) {
65
+ try {
66
+ const value = JSON.parse(raw);
67
+ return typeof value === "object" && value !== null && Array.isArray(value) === false ? value : {};
68
+ }
69
+ catch {
70
+ return {};
71
+ }
72
+ }
73
+ function stringArg(args, keys) {
74
+ for (const key of keys) {
75
+ const value = args[key];
76
+ if (typeof value === "string" && value.trim() !== "")
77
+ return value;
78
+ if (Array.isArray(value) && value.length > 0 && value.every((v) => typeof v === "string"))
79
+ return value.join(", ");
80
+ }
81
+ return undefined;
82
+ }
83
+ const INSTRUCTION_KEYS = ["instruction", "prompt"];
84
+ const TARGET_KEYS = ["path", "paths", "url", "query", "docId", "name", "database"];
85
+ const STAGING_TOOLS = new Set(["edit_file", "write_file"]);
86
+ const WITH_VIBE = "with_vibe";
87
+ function addressOf(args) {
88
+ const { ownerHandle, appSlug } = args;
89
+ return typeof ownerHandle === "string" && ownerHandle !== "" && typeof appSlug === "string" && appSlug !== ""
90
+ ? `${ownerHandle}/${appSlug}`
91
+ : undefined;
92
+ }
93
+ function innerCalls(args) {
94
+ const calls = Array.isArray(args.calls) ? args.calls : [];
95
+ const staged = [];
96
+ let commits = false;
97
+ const words = calls.map((call) => {
98
+ const record = typeof call === "object" && call !== null ? call : {};
99
+ const tool = typeof record.tool === "string" ? record.tool : "?";
100
+ const input = typeof record.input === "object" && record.input !== null ? record.input : {};
101
+ const target = stringArg(input, TARGET_KEYS);
102
+ if (STAGING_TOOLS.has(tool) && target !== undefined)
103
+ staged.push(target);
104
+ if (tool === "commit_version")
105
+ commits = true;
106
+ return target === undefined ? tool : `${tool} ${oneLine(target, false)}`;
107
+ });
108
+ return { line: words.join(", "), staged: [...new Set(staged)], commits };
109
+ }
110
+ function findFsId(value) {
111
+ if (typeof value !== "object" || value === null)
112
+ return undefined;
113
+ const record = value;
114
+ if (typeof record.fsId === "string")
115
+ return record.fsId;
116
+ for (const child of Object.values(record)) {
117
+ const found = findFsId(child);
118
+ if (found !== undefined)
119
+ return found;
120
+ }
121
+ return undefined;
122
+ }
123
+ export function settlePersonPart(part) {
124
+ if (part.type === "text")
125
+ return { type: "text", text: part.text };
126
+ if (part.type === "vibes_file")
127
+ return { type: "text", text: `[attached ${part.kind}: ${part.name}]` };
128
+ return { type: "text", text: "[attached image]" };
129
+ }
130
+ function assistantText(message) {
131
+ if (message.role !== "assistant")
132
+ return "";
133
+ if (typeof message.content === "string")
134
+ return message.content;
135
+ if (Array.isArray(message.content) === false)
136
+ return "";
137
+ return message.content.map((part) => (part.type === "text" ? part.text : "")).join("");
138
+ }
139
+ const FOREIGN_LANDING = /^\[build result\] For vibe (\S+) \(\/vibe\/[^)]*\): /;
140
+ function settleTurn(turn, cursor) {
141
+ const people = [];
142
+ const work = [];
143
+ const push = (line) => {
144
+ if (work.at(-1) !== line)
145
+ work.push(line);
146
+ };
147
+ let reply = "";
148
+ let intent;
149
+ let staged = [];
150
+ const withVibeCommits = new Map();
151
+ const creates = new Map();
152
+ const versionAt = (address) => address === undefined ? cursor.version : cursor.versions.get(address);
153
+ const saved = (address, version) => {
154
+ if (address === undefined)
155
+ cursor.version = version;
156
+ else
157
+ cursor.versions.set(address, version);
158
+ };
159
+ for (const message of turn) {
160
+ if (isPersonMessage(message)) {
161
+ people.push({ role: "user", content: message.content.map(settlePersonPart) });
162
+ continue;
163
+ }
164
+ if (message.role === "assistant") {
165
+ const text = assistantText(message).trim();
166
+ if (text !== "")
167
+ reply = text;
168
+ if ("tool_calls" in message) {
169
+ for (const call of message.tool_calls) {
170
+ const name = call.function.name;
171
+ const args = parseArgs(call.function.arguments);
172
+ const address = addressOf(args);
173
+ const lead = address === undefined ? name : `${name} ${address}`;
174
+ const version = versionAt(address);
175
+ const at = version === undefined ? "" : ` @${version}`;
176
+ const instruction = stringArg(args, INSTRUCTION_KEYS);
177
+ const target = stringArg(args, TARGET_KEYS);
178
+ if (instruction !== undefined) {
179
+ const said = oneLine(instruction);
180
+ if (address === undefined)
181
+ intent = said;
182
+ else
183
+ cursor.intents.set(address, said);
184
+ if (address === undefined && name !== "edit_vibe")
185
+ creates.set(call.id, said);
186
+ push(`[${lead}: ${said}]`);
187
+ }
188
+ else if (name === WITH_VIBE && address !== undefined) {
189
+ const inner = innerCalls(args);
190
+ push(`[${lead}: ${inner.line}]`);
191
+ if (inner.commits)
192
+ withVibeCommits.set(call.id, { address, staged: inner.staged });
193
+ }
194
+ else if (name === "read_screenshot") {
195
+ push(`[screenshot${at}]`);
196
+ }
197
+ else {
198
+ push(`[${lead}${target === undefined ? "" : ` ${oneLine(target, false)}`}${at}]`);
199
+ }
200
+ if (STAGING_TOOLS.has(name) && target !== undefined)
201
+ staged = [...staged.filter((p) => p !== target), target];
202
+ }
203
+ }
204
+ continue;
205
+ }
206
+ if (message.role === "tool") {
207
+ const commit = withVibeCommits.get(message.tool_call_id);
208
+ if (commit !== undefined) {
209
+ const version = findFsId(parseArgs(message.content));
210
+ if (version !== undefined) {
211
+ saved(commit.address, version);
212
+ push(`${commit.address} ${version} · ${commit.staged.length === 0 ? "files not named" : commit.staged.join(", ")} · direct edit`);
213
+ }
214
+ }
215
+ const created = creates.get(message.tool_call_id);
216
+ if (created !== undefined) {
217
+ const receipt = parseArgs(message.content);
218
+ const key = addressOf(receipt) ?? (typeof receipt.appSlug === "string" ? `*/${receipt.appSlug}` : undefined);
219
+ if (key !== undefined)
220
+ cursor.intents.set(key, created);
221
+ }
222
+ continue;
223
+ }
224
+ if (message.role !== "user")
225
+ continue;
226
+ const text = firstText(message) ?? "";
227
+ if (text.startsWith("[build result]")) {
228
+ const address = FOREIGN_LANDING.exec(text)?.[1];
229
+ const prefix = address === undefined ? "" : `${address} `;
230
+ const why = (address === undefined
231
+ ? intent
232
+ : (cursor.intents.get(address) ?? cursor.intents.get(`*/${address.slice(address.indexOf("/") + 1)}`))) ?? "build";
233
+ const version = /Saved as version (\S+?)\.(\s|$)/.exec(text)?.[1];
234
+ const files = /changes are saved \(([^)]*)\)/.exec(text)?.[1];
235
+ if (version !== undefined) {
236
+ saved(address, version);
237
+ push(`${prefix}${version} · ${files ?? "files not named"} · ${why}`);
238
+ }
239
+ else if (text.includes("made no changes"))
240
+ push(`${prefix}no changes saved · ${why}`);
241
+ else if (text.includes("did not finish") || text.includes("could not start"))
242
+ push(`${prefix}build failed, nothing saved · ${why}`);
243
+ }
244
+ else if (text.startsWith("[commit result]")) {
245
+ const version = findFsId(parseArgs(text.slice("[commit result]".length).trim()));
246
+ if (version !== undefined) {
247
+ saved(undefined, version);
248
+ push(`${version} · ${staged.length === 0 ? "files not named" : staged.join(", ")} · ${intent ?? "direct edit"}`);
249
+ }
250
+ else
251
+ push("commit refused, nothing saved");
252
+ staged = [];
253
+ }
254
+ }
255
+ const record = [reply === "" ? "(no reply text)" : reply, ...(work.length === 0 ? [] : ["", ...work])].join("\n");
256
+ return [...people, { role: "assistant", content: [{ type: "text", text: record }] }];
257
+ }
258
+ export function rolloverAgentJournal(journal, state, incoming) {
259
+ if (incoming.some(isPersonMessage) === false)
260
+ return undefined;
261
+ const band = settledBandLength(journal, state);
262
+ const starts = liveTurnStarts(journal, band);
263
+ if (starts.length < LIVE_TURNS_MAX)
264
+ return undefined;
265
+ const bounds = [band, ...starts.slice(1, SETTLE_BATCH_TURNS + 1)];
266
+ const cursor = { versions: new Map(), intents: new Map() };
267
+ const records = [];
268
+ for (let k = 0; k < SETTLE_BATCH_TURNS; k++)
269
+ records.push(...settleTurn(journal.slice(bounds[k], bounds[k + 1]), cursor));
270
+ const head = band === 0
271
+ ? [{ role: "user", content: [{ type: "text", text: SETTLED_HISTORY_HEADER }] }]
272
+ : journal.slice(0, band);
273
+ const settledMessages = head.length + records.length;
274
+ return {
275
+ journal: [...head, ...records, ...journal.slice(bounds[SETTLE_BATCH_TURNS])],
276
+ settled: { through: (band === 0 ? 0 : (state?.through ?? 0)) + SETTLE_BATCH_TURNS, messages: settledMessages },
277
+ };
278
+ }
279
+ export function rolloverAgentTranscript(transcript, state, incoming) {
280
+ const journal = transcript.filter((message) => message.role !== "system" && isRequestFrameMessage(message) === false);
281
+ const rolled = rolloverAgentJournal(journal, state, incoming);
282
+ if (rolled === undefined)
283
+ return undefined;
284
+ return {
285
+ messages: [
286
+ ...transcript.filter((message) => message.role === "system"),
287
+ ...markJournalCacheTail(rolled.journal, { settledMessages: rolled.settled.messages }),
288
+ ...transcript.filter(isRequestFrameMessage),
289
+ ],
290
+ settled: rolled.settled,
291
+ };
292
+ }
293
+ //# sourceMappingURL=agent-settled-history.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-settled-history.js","sourceRoot":"","sources":["../../jsr/intern/agent-settled-history.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AA6CvF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAEpC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAG,kBAAkB,CAAC;AASrD,MAAM,CAAC,MAAM,kBAAkB,GAAsB,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;AAGjF,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAC1D,MAAM,sBAAsB,GAAG,GAAG,sBAAsB,4VAA4V,CAAC;AAGrZ,MAAM,CAAC,MAAM,sBAAsB,GAAG,qCAAqC,CAAC;AAS5E,MAAM,iBAAiB,GAAG;IACxB,gBAAgB;IAChB,iBAAiB;IACjB,eAAe;IACf,eAAe;IACf,cAAc;IACd,sBAAsB;CACvB,CAAC;AAEF,SAAS,SAAS,CAAC,OAAmB;IACpC,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,KAAK;QAAE,OAAO,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IACvH,MAAM,KAAK,GAAI,OAAO,CAAC,OAA4B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AAC;YAC5D,GAAG,oBAAoB,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YACrF,GAAG,UAAU,CAAC,MAAM,CAAC,qBAAqB,CAAC;SAC5C;QACD,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC;AACJ,CAAC"}
@@ -1,5 +1,5 @@
1
- export declare const TOP_LEVEL_AGENT_INSTRUCTION_VERSION = "2026-10-05.2";
2
- export declare const TOP_LEVEL_AGENT_INSTRUCTION = "TOP-LEVEL CONVERSATION. You are the top-level Vibes agent: the person's own assistant for their whole Vibes DIY account, not the builder of one app. This conversation is not bound to any single vibe.\nThe <app-context> block names who you are talking with \u2014 their name when they have shared one, their active handle, every handle the account holds \u2014 and the handle this conversation acts as. Address the person by name when you have it, and speak about their vibes as theirs.\n\nRead the general instruction that follows with that in mind: wherever it says \"the app\" or \"this app\", it means whichever vibe you are working on at that moment, named by its handle and address.\n\nYour tools in this conversation:\n- list_vibes \u2014 the person's vibes across every handle they hold: handle, address (appSlug), title, last update, and whether it is published. Call it whenever the person refers to their apps, before naming one, and before any change that spans several vibes.\n- create_vibe \u2014 start a brand-new vibe under the handle this conversation acts as. Every call makes a new app with its own address.\n- edit_vibe_at \u2014 change one existing vibe, named by its ownerHandle and appSlug exactly as list_vibes reported them, with the change as a plain-language instruction. To make the same kind of change across several vibes, call edit_vibe_at once per vibe, each with an instruction written for that vibe; at most five builds start per turn. Each answers `building`, and its [build result] arrives here by itself, naming the vibe it belongs to.\n- with_vibe \u2014 look inside one existing vibe, named by its ownerHandle and appSlug from list_vibes: in one call, run up to eight of that vibe's read tools (list_files, read_file, read_files, read_app_settings, list_versions, read_screenshot, read_app_logs, read_release_state, list_databases, query_docs, get_doc) and get one result per call. It only reads, and nothing carries over between calls, so call it again to read further \u2014 list the files, then read the ones you need. Read a vibe this way before describing it or before writing an edit_vibe_at instruction about its code.\n- lookup_handle, and fetch_url when the person's message carries a link, work as they do anywhere.\n\nThe per-app tools the general instruction mentions are not tools of their own here. Their reads run inside with_vibe; a change to a vibe goes through edit_vibe_at, which builds it. When the person wants to work on one vibe closely, link it so they can open it: that vibe's own conversation has every per-app tool.\n\nLink every vibe you name as a markdown link to /vibe/<handle>/<appSlug>, using the address list_vibes or a receipt gave you.\nYou act only on the handles this account holds. When the person asks about somebody else's vibe, offer to make them their own version with create_vibe.\n\nThe general instruction for every Vibes agent follows.";
1
+ export declare const TOP_LEVEL_AGENT_INSTRUCTION_VERSION = "2026-10-06.1";
2
+ export declare const TOP_LEVEL_AGENT_INSTRUCTION = "TOP-LEVEL CONVERSATION. You are the top-level Vibes agent: the person's own assistant for their whole Vibes DIY account, not the builder of one app. This conversation is not bound to any single vibe.\nThe <app-context> block names who you are talking with \u2014 their name when they have shared one, their active handle, every handle the account holds \u2014 and the handle this conversation acts as. Address the person by name when you have it, and speak about their vibes as theirs.\n\nRead the general instruction that follows with that in mind: wherever it says \"the app\" or \"this app\", it means whichever vibe you are working on at that moment, named by its handle and address.\n\nYour tools in this conversation:\n- list_vibes \u2014 the person's vibes across every handle they hold: handle, address (appSlug), title, last update, and whether it is published. Call it whenever the person refers to their apps, before naming one, and before any change that spans several vibes.\n- vibe_activity \u2014 who uses the person's vibes besides them, in one answer across every vibe under every handle: for each vibe, how many other signed-in people saved records in it (otherWriters), the busiest of them by handle with their record count and last write, approved members, and access requests waiting for an answer, busiest vibe first. Any question about who uses, shares, joins or visits their vibes starts here, and the answer covers the whole account, so name the vibes it ranks rather than opening them one by one. Someone who only opens or reads a vibe leaves no record, so say \"people who saved something\" and mention that readers do not show.\n- create_vibe \u2014 start a brand-new vibe under the handle this conversation acts as. Every call makes a new app with its own address.\n- edit_vibe_at \u2014 change one existing vibe, named by its ownerHandle and appSlug exactly as list_vibes reported them, with the change as a plain-language instruction. To make the same kind of change across several vibes, call edit_vibe_at once per vibe, each with an instruction written for that vibe; at most five builds start per turn. Each answers `building`, and its [build result] arrives here by itself, naming the vibe it belongs to.\n- with_vibe \u2014 work inside one existing vibe, named by its ownerHandle and appSlug from list_vibes or vibe_activity: in one call, run up to eight of that vibe's tools and get one result per call. The reads are list_files, read_file, read_files, read_app_settings, list_versions, read_screenshot, read_app_logs, read_release_state, list_databases, query_docs and get_doc; nothing carries over between calls, so call it again to read further \u2014 list the files, then read the ones you need. Read a vibe this way before describing it or before writing an edit_vibe_at instruction about its code. A small, precise change to a vibe's code can be made here directly with edit_file or write_file, then validate, then commit_version last \u2014 read, edit, validate and commit in ONE call, because staged edits end with the call. Those calls stop at the first one that fails and save nothing unless commit_version saves; when validate answers with errors, call with_vibe again with the fix. It runs only while no build is running on that vibe (otherwise it answers busy), and each call that saves counts toward the five per turn.\n- lookup_handle, and fetch_url when the person's message carries a link, work as they do anywhere.\n\nThe per-app tools the general instruction mentions are not tools of their own here. Their reads and the four file tools run inside with_vibe; any larger or open-ended change to a vibe \u2014 new features, a redesign, anything you would need to explore before writing \u2014 goes through edit_vibe_at, which builds it. When the person wants to work on one vibe closely, link it so they can open it: that vibe's own conversation has every per-app tool.\n\nPeople who use a vibe come from vibe_activity's writers and members. What a vibe's records contain is that app's content: sample and example records carry made-up names, so a name inside a record is content, and with_vibe is for looking inside one vibe after vibe_activity points at it.\n\nLink every vibe you name as a markdown link to /vibe/<handle>/<appSlug>, using the address list_vibes or a receipt gave you. Each vibe you link that way appears under your reply as a card with its screenshot that the person can open, so write vibe links in exactly that form and link the vibes your answer is about.\nYou act only on the handles this account holds. When the person asks about somebody else's vibe, offer to make them their own version with create_vibe.\n\nThe general instruction for every Vibes agent follows.";
3
3
  export declare function topLevelAgentSystemContent(): {
4
4
  type: "text";
5
5
  text: string;
@@ -1,5 +1,5 @@
1
1
  import { AGENT_SESSION_INSTRUCTION } from "./agent-session-instruction.js";
2
- export const TOP_LEVEL_AGENT_INSTRUCTION_VERSION = "2026-10-05.2";
2
+ export const TOP_LEVEL_AGENT_INSTRUCTION_VERSION = "2026-10-06.1";
3
3
  export const TOP_LEVEL_AGENT_INSTRUCTION = `TOP-LEVEL CONVERSATION. You are the top-level Vibes agent: the person's own assistant for their whole Vibes DIY account, not the builder of one app. This conversation is not bound to any single vibe.
4
4
  The <app-context> block names who you are talking with — their name when they have shared one, their active handle, every handle the account holds — and the handle this conversation acts as. Address the person by name when you have it, and speak about their vibes as theirs.
5
5
 
@@ -7,14 +7,17 @@ Read the general instruction that follows with that in mind: wherever it says "t
7
7
 
8
8
  Your tools in this conversation:
9
9
  - list_vibes — the person's vibes across every handle they hold: handle, address (appSlug), title, last update, and whether it is published. Call it whenever the person refers to their apps, before naming one, and before any change that spans several vibes.
10
+ - vibe_activity — who uses the person's vibes besides them, in one answer across every vibe under every handle: for each vibe, how many other signed-in people saved records in it (otherWriters), the busiest of them by handle with their record count and last write, approved members, and access requests waiting for an answer, busiest vibe first. Any question about who uses, shares, joins or visits their vibes starts here, and the answer covers the whole account, so name the vibes it ranks rather than opening them one by one. Someone who only opens or reads a vibe leaves no record, so say "people who saved something" and mention that readers do not show.
10
11
  - create_vibe — start a brand-new vibe under the handle this conversation acts as. Every call makes a new app with its own address.
11
12
  - edit_vibe_at — change one existing vibe, named by its ownerHandle and appSlug exactly as list_vibes reported them, with the change as a plain-language instruction. To make the same kind of change across several vibes, call edit_vibe_at once per vibe, each with an instruction written for that vibe; at most five builds start per turn. Each answers \`building\`, and its [build result] arrives here by itself, naming the vibe it belongs to.
12
- - with_vibe — look inside one existing vibe, named by its ownerHandle and appSlug from list_vibes: in one call, run up to eight of that vibe's read tools (list_files, read_file, read_files, read_app_settings, list_versions, read_screenshot, read_app_logs, read_release_state, list_databases, query_docs, get_doc) and get one result per call. It only reads, and nothing carries over between calls, so call it again to read further — list the files, then read the ones you need. Read a vibe this way before describing it or before writing an edit_vibe_at instruction about its code.
13
+ - with_vibe — work inside one existing vibe, named by its ownerHandle and appSlug from list_vibes or vibe_activity: in one call, run up to eight of that vibe's tools and get one result per call. The reads are list_files, read_file, read_files, read_app_settings, list_versions, read_screenshot, read_app_logs, read_release_state, list_databases, query_docs and get_doc; nothing carries over between calls, so call it again to read further — list the files, then read the ones you need. Read a vibe this way before describing it or before writing an edit_vibe_at instruction about its code. A small, precise change to a vibe's code can be made here directly with edit_file or write_file, then validate, then commit_version last — read, edit, validate and commit in ONE call, because staged edits end with the call. Those calls stop at the first one that fails and save nothing unless commit_version saves; when validate answers with errors, call with_vibe again with the fix. It runs only while no build is running on that vibe (otherwise it answers busy), and each call that saves counts toward the five per turn.
13
14
  - lookup_handle, and fetch_url when the person's message carries a link, work as they do anywhere.
14
15
 
15
- The per-app tools the general instruction mentions are not tools of their own here. Their reads run inside with_vibe; a change to a vibe goes through edit_vibe_at, which builds it. When the person wants to work on one vibe closely, link it so they can open it: that vibe's own conversation has every per-app tool.
16
+ The per-app tools the general instruction mentions are not tools of their own here. Their reads and the four file tools run inside with_vibe; any larger or open-ended change to a vibe — new features, a redesign, anything you would need to explore before writing — goes through edit_vibe_at, which builds it. When the person wants to work on one vibe closely, link it so they can open it: that vibe's own conversation has every per-app tool.
16
17
 
17
- Link every vibe you name as a markdown link to /vibe/<handle>/<appSlug>, using the address list_vibes or a receipt gave you.
18
+ People who use a vibe come from vibe_activity's writers and members. What a vibe's records contain is that app's content: sample and example records carry made-up names, so a name inside a record is content, and with_vibe is for looking inside one vibe after vibe_activity points at it.
19
+
20
+ Link every vibe you name as a markdown link to /vibe/<handle>/<appSlug>, using the address list_vibes or a receipt gave you. Each vibe you link that way appears under your reply as a card with its screenshot that the person can open, so write vibe links in exactly that form and link the vibes your answer is about.
18
21
  You act only on the handles this account holds. When the person asks about somebody else's vibe, offer to make them their own version with create_vibe.
19
22
 
20
23
  The general instruction for every Vibes agent follows.`;
@@ -1 +1 @@
1
- {"version":3,"file":"agent-top-level-instruction.js","sourceRoot":"","sources":["../../jsr/intern/agent-top-level-instruction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAqB3E,MAAM,CAAC,MAAM,mCAAmC,GAAG,cAAc,CAAC;AAElE,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;;;;;;;;;;;;uDAiBY,CAAC;AAGxD,MAAM,UAAU,0BAA0B;IAKxC,OAAO;QACL,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,2BAA2B,EAAE;QAC5D,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,yBAAyB,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,WAAoB,EAAE,EAAE;KAC1G,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"agent-top-level-instruction.js","sourceRoot":"","sources":["../../jsr/intern/agent-top-level-instruction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAsB3E,MAAM,CAAC,MAAM,mCAAmC,GAAG,cAAc,CAAC;AAElE,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;uDAoBY,CAAC;AAGxD,MAAM,UAAU,0BAA0B;IAKxC,OAAO;QACL,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,2BAA2B,EAAE;QAC5D,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,yBAAyB,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,WAAoB,EAAE,EAAE;KAC1G,CAAC;AACJ,CAAC"}
@@ -35,6 +35,7 @@ export interface AgentWakeOutcome {
35
35
  readonly rules: Readonly<Record<string, number>>;
36
36
  readonly repairing: boolean;
37
37
  };
38
+ readonly firstBuild?: boolean;
38
39
  readonly errorReason?: string;
39
40
  }
40
41
  export declare function renderBuildSettledSentence(outcome: AgentWakeOutcome): string;
@@ -48,6 +49,7 @@ export declare function designFindingsLine(findings: {
48
49
  readonly repairing: boolean;
49
50
  }): string;
50
51
  export declare const SEE_IT_LINE = "To see what it looks like now, call read_screenshot (no version, so it waits for this version's picture) before describing the result.";
52
+ export declare const FIRST_BUILD_SEEN_LINE = "The person is already looking at the app. Describe what this report and the saved files establish, as the screen they open on, and do not wait for a picture: its screenshot is taken shortly and is in front of you on their next message.";
51
53
  export declare function renderAgentWakeNote(outcome: AgentWakeOutcome): string;
52
54
  export interface FireAgentWakeArgs<Host extends AgentDispatchHostCtx> {
53
55
  readonly vctx: VibesApiSQLCtx;
@@ -40,7 +40,7 @@ export function renderBuildSettledSentence(outcome) {
40
40
  }
41
41
  if (outcome.fsId !== undefined)
42
42
  facts.push(`Saved as version ${outcome.fsId}.`);
43
- facts.push(SEE_IT_LINE);
43
+ facts.push(outcome.firstBuild === true ? FIRST_BUILD_SEEN_LINE : SEE_IT_LINE);
44
44
  if (outcome.accessLine !== undefined)
45
45
  facts.push(outcome.accessLine);
46
46
  facts.push(...aliasContextLines(outcome.aliasNotes ?? []));
@@ -66,6 +66,7 @@ export function designFindingsLine(findings) {
66
66
  return findings.repairing ? `${head}; a background pass may tidy them in place.` : `${head}.`;
67
67
  }
68
68
  export const SEE_IT_LINE = "To see what it looks like now, call read_screenshot (no version, so it waits for this version's picture) before describing the result.";
69
+ export const FIRST_BUILD_SEEN_LINE = "The person is already looking at the app. Describe what this report and the saved files establish, as the screen they open on, and do not wait for a picture: its screenshot is taken shortly and is in front of you on their next message.";
69
70
  export function renderAgentWakeNote(outcome) {
70
71
  return `[build result] ${renderBuildSettledSentence(outcome)} Continue from this result in the same conversation.`;
71
72
  }
@@ -1 +1 @@
1
- {"version":3,"file":"agent-wake.js","sourceRoot":"","sources":["../../jsr/intern/agent-wake.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAKnD,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAoB,MAAM,iBAAiB,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAsD1D,MAAM,CAAC,MAAM,qBAAqB,GAAG,C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,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC;QAClF,GAAG,CAAC,IAAI,CAAC,kBAAkB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAQjG,MAAM,EAAE,EAAE,GAAG,CAAC,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;KAC/F,CAAC;IACF,MAAM,GAAG,GAAkC;QACzC,GAAG,IAAI,CAAC,SAAS;QACjB,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG;QAC9B,OAAO;KACR,CAAC;IAEF,MAAM,GAAG,GAAG,gBAAgB,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;QACjG,IAAI,CAAC,CAAC,KAAK,EAAE;YAAE,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;QACtF,OAAO,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;IASH,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;QAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AACxD,CAAC"}
@@ -1,9 +1,14 @@
1
+ import { Result } from "@adviser/cement";
2
+ import type { AgentFileCommit } from "@vibes.diy/api-types";
1
3
  import type { ToolDefinition } from "@vibes.diy/call-ai-v2";
2
4
  import { type LlmToolExecutor, type LlmToolImage } from "./llm-tool-loop.js";
5
+ import type { AgentFileSession } from "./agent-file-tools.js";
3
6
  export declare const WITH_VIBE_TOOL_NAME = "with_vibe";
4
7
  export declare const WITH_VIBE_MAX_CALLS = 8;
5
8
  export declare const WITH_VIBE_RESULT_MAX_CHARS = 8192;
6
- export declare const WITH_VIBE_INNER_TOOLS: readonly ["list_files", "read_file", "read_files", "read_app_settings", "list_versions", "read_screenshot", "read_app_logs", "read_release_state", "list_databases", "query_docs", "get_doc"];
9
+ export declare const WITH_VIBE_EDIT_TOOL_NAMES: readonly ["edit_file", "write_file", "validate", "commit_version"];
10
+ export declare const WITH_VIBE_COMMIT_TOOL_NAME = "commit_version";
11
+ export declare const WITH_VIBE_INNER_TOOLS: readonly ["list_files", "read_file", "read_files", "read_app_settings", "list_versions", "read_screenshot", "read_app_logs", "read_release_state", "list_databases", "query_docs", "get_doc", "edit_file", "write_file", "validate", "commit_version"];
7
12
  export type WithVibeInnerTool = (typeof WITH_VIBE_INNER_TOOLS)[number];
8
13
  export declare const WITH_VIBE_FILE_TOOLS: ReadonlySet<string>;
9
14
  export declare const WITH_VIBE_INNER_INPUTS: {
@@ -39,7 +44,19 @@ export declare const WITH_VIBE_INNER_INPUTS: {
39
44
  dbName: string;
40
45
  docId: string;
41
46
  }, {}>;
47
+ edit_file: import("arktype/internal/variants/object.ts").ObjectType<{
48
+ path: string;
49
+ old_string: string;
50
+ new_string: string;
51
+ }, {}>;
52
+ write_file: import("arktype/internal/variants/object.ts").ObjectType<{
53
+ path: string;
54
+ contents: string;
55
+ }, {}>;
56
+ validate: import("arktype/internal/variants/object.ts").ObjectType<object, {}>;
57
+ commit_version: import("arktype/internal/variants/object.ts").ObjectType<object, {}>;
42
58
  };
59
+ export declare function isWithVibeEditTool(name: string): boolean;
43
60
  export declare function withVibeToolDefinition(): ToolDefinition;
44
61
  export type WithVibeEntry = {
45
62
  readonly tool: string;
@@ -59,8 +76,12 @@ export interface RunWithVibeCallsArgs {
59
76
  readonly signal: AbortSignal;
60
77
  readonly attachImage?: (image: LlmToolImage) => void;
61
78
  readonly callId: string;
79
+ readonly stopOnFailure?: boolean;
80
+ readonly onThrown?: (tool: string, callId: string, error: Error) => void;
62
81
  }
63
82
  export declare function runWithVibeCalls(args: RunWithVibeCallsArgs): Promise<WithVibeEntry[]>;
83
+ export declare function withVibeEntrySaved(entry: WithVibeEntry): boolean;
84
+ export declare function createWithVibeFileSession(commit: (commit: AgentFileCommit) => Promise<Result<Readonly<Record<string, unknown>>>>): AgentFileSession;
64
85
  export interface WithVibeTruncatedEntry {
65
86
  readonly tool: string;
66
87
  readonly truncated: true;
@@ -69,4 +90,6 @@ export interface WithVibeTruncatedEntry {
69
90
  readonly partial: string;
70
91
  }
71
92
  export declare function fitWithVibeAnswer(envelope: Readonly<Record<string, unknown>>, entries: readonly WithVibeEntry[], maxChars?: number): string;
93
+ export declare const WITH_VIBE_COMMIT_NOTE_PREFIX = "Edited from /agent:";
94
+ export declare const WITH_VIBE_UNSAVED_NOTE = "Nothing was saved: staged edits last only for this with_vibe call and become a version only when commit_version saves.";
72
95
  export declare const WITH_VIBE_BUILD_NOTE = "A build is running on this vibe; its files may change when it lands.";