vibes-diy 14.3.58 → 14.3.64

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.
@@ -204,201 +204,78 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
204
204
  updated: string;
205
205
  created: string;
206
206
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
207
- type: "vibes-diy.cli.system";
208
- }, {
209
- type: "vibes-diy.cli.res-system";
210
- systemPrompt: string;
211
- }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
212
- type: "vibes-diy.cli.remix";
213
- srcUserSlug: string;
214
- srcAppSlug: string;
215
- dstOwnerHandle?: string | undefined;
216
- dstAppSlug?: string | undefined;
217
- published: boolean;
218
- settingsOnly: boolean;
219
- apiUrl: string;
220
- }, {
221
- type: "vibes-diy.cli.res-remix";
222
- ownerHandle: string;
223
- appSlug: string;
224
- url: string;
225
- carried?: string[] | undefined;
226
- skippedPresent?: string[] | undefined;
227
- chatId?: string | undefined;
228
- }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
229
- type: "vibes-diy.cli.put-asset";
230
- file: string;
231
- appSlug: string;
232
- ownerHandle: string;
233
- apiUrl: string;
234
- mimeType: string;
235
- verifyFetch: boolean;
207
+ type: "vibes-diy.cli.variety";
236
208
  }, {
237
- type: "vibes-diy.cli.res-put-asset";
238
- cid: string;
239
- getURL: string;
240
- size: number;
241
- uploadId: string;
242
- verified?: boolean | undefined;
209
+ type: "vibes-diy.cli.res-variety-list";
210
+ grammar: string;
211
+ flourishCount: number;
212
+ archetypes: {
213
+ id: string;
214
+ guidance: string;
215
+ }[];
216
+ flourishes: {
217
+ id: string;
218
+ guidance: string;
219
+ }[];
243
220
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
244
- type: "vibes-diy.cli.db.list";
221
+ type: "vibes-diy.cli.db.get";
245
222
  apiUrl: string;
246
223
  appSlug: string;
247
224
  ownerHandle: string;
225
+ dbName: string;
226
+ docId: string;
248
227
  admin: boolean;
228
+ actingHandle: string;
249
229
  }, {
250
- type: "vibes-diy.cli.db.list-res";
251
- dbNames: string[];
230
+ type: "vibes-diy.cli.db.get-res";
231
+ doc: {
232
+ [x: string]: unknown;
233
+ };
252
234
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
253
- type: "vibes-diy.cli.db.query";
235
+ type: "vibes-diy.cli.db.subscribe";
254
236
  apiUrl: string;
255
237
  appSlug: string;
256
238
  ownerHandle: string;
257
239
  dbName: string;
258
- field: string;
259
- key: string;
260
- prefix: string;
261
- range: string;
262
- limit: number;
263
- descending: boolean;
264
- admin: boolean;
265
- actingHandle: string;
266
- }, {
267
- type: "vibes-diy.cli.db.query-res";
268
- docs: {
269
- [x: string]: unknown;
270
- }[];
271
- }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
272
- type: "vibes-diy.cli.codegen-log";
240
+ }, never> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
241
+ type: "vibes-diy.cli.app-chats";
273
242
  appSlug: string;
274
243
  ownerHandle: string;
275
244
  chatId?: string | undefined;
276
245
  apiUrl: string;
277
- response?: boolean | undefined;
278
- raw?: boolean | undefined;
279
- files?: boolean | undefined;
280
- jsonl?: boolean | undefined;
281
- user?: boolean | undefined;
282
- promptId?: string | undefined;
283
246
  }, {
284
- type: "vibes-diy.cli.res-codegen-log-response";
285
- output: string;
286
- } | {
287
- type: "vibes-diy.cli.res-codegen-log-list";
247
+ type: "vibes-diy.cli.res-app-chats-list";
288
248
  items: {
289
249
  chatId: string;
290
250
  appSlug: string;
291
251
  ownerHandle: string;
292
252
  created: string;
253
+ userHandle?: string | undefined;
293
254
  }[];
294
255
  } | {
295
- type: "vibes-diy.cli.res-codegen-log-detail";
256
+ type: "vibes-diy.cli.res-app-chats-detail";
296
257
  chatId: string;
297
- ownerHandle: string;
298
- appSlug: string;
299
- prompts: {
300
- prompt: string;
301
- fsId: string;
302
- created: string;
303
- }[];
258
+ ownerHandle?: string | undefined;
259
+ appSlug?: string | undefined;
260
+ output: string;
304
261
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
305
- type: "vibes-diy.cli.edit";
306
- appSlug: string;
307
- prompt: string;
308
- ownerHandle: string;
309
- instantJoin?: boolean | undefined;
310
- verbose: boolean;
311
- dir: string;
262
+ type: "vibes-diy.cli.list";
312
263
  apiUrl: string;
313
- dryRun: boolean;
314
- transcript: boolean;
315
- directBuild?: boolean | undefined;
316
- focusPath?: string | undefined;
317
- model?: string | undefined;
318
- builderModel?: string | undefined;
319
- apiKey?: string | undefined;
320
264
  }, {
321
- type: "vibes-diy.cli.res-edit";
322
- appSlug: string;
323
- ownerHandle: string;
324
- url: string;
325
- directory: string;
326
- restyled?: boolean | undefined;
327
- } | {
328
- appSlug: string;
329
- ownerHandle: string;
330
- mode: "dev" | "production";
331
- fsId: string;
332
- type: "vibes.diy.res-ensure-app-slug";
333
- env: Record<string, string>;
334
- fileSystem: {
335
- fileName: string;
336
- mimeType: string;
337
- assetId: string;
338
- assetURI: string;
339
- transform?: {
340
- type: "jsx-to-js";
341
- transformedAssetId: string;
342
- } | {
343
- type: "imports";
344
- importMapAssetId: string;
345
- } | {
346
- type: "import-map";
347
- fromAssetIds: string[];
348
- } | {
349
- type: "transformed";
350
- action: "jsx-to-js";
351
- transformedAssetId: string;
352
- } | {
353
- type: "tailwind-css";
265
+ type: "vibes-diy.cli.res-list";
266
+ items: {
267
+ ownerHandle: string;
268
+ appSlug: string;
269
+ updated: string;
270
+ title?: string | undefined;
271
+ icon?: {
272
+ cid: string;
273
+ mime: string;
354
274
  } | undefined;
355
- entryPoint?: boolean | undefined;
356
- size: number;
357
- kind?: "asset" | undefined;
358
- uploadId?: string | undefined;
275
+ pinnedAt?: string | undefined;
276
+ neverPublished?: boolean | undefined;
277
+ unpublishedAt?: string | undefined;
359
278
  }[];
360
- } | {
361
- type: "vibes.diy.res-error";
362
- error: {
363
- message: string;
364
- code: "require-login";
365
- };
366
- } | {
367
- type: "vibes.diy.res-error";
368
- error: {
369
- message: string;
370
- code: "user-slug-invalid";
371
- };
372
- } | {
373
- type: "vibes.diy.res-error";
374
- error: {
375
- message: string;
376
- code: "app-slug-invalid";
377
- };
378
- } | {
379
- type: "vibes.diy.res-error";
380
- error: {
381
- message: string;
382
- code: "max-app-slugs-reached";
383
- };
384
- } | {
385
- type: "vibes.diy.res-error";
386
- error: {
387
- message: string;
388
- code: "handle-required";
389
- };
390
- } | {
391
- type: "vibes.diy.res-error";
392
- error: {
393
- message: string;
394
- code: "from-not-owned";
395
- };
396
- } | {
397
- type: "vibes.diy.res-error";
398
- error: {
399
- message: string;
400
- code: "from-carry-failed";
401
- };
402
279
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
403
280
  type: "vibes-diy.cli.app-status";
404
281
  appSlug: string;
@@ -594,19 +471,10 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
594
471
  slug: string;
595
472
  content: string;
596
473
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
597
- type: "vibes-diy.cli.variety";
474
+ type: "vibes-diy.cli.system";
598
475
  }, {
599
- type: "vibes-diy.cli.res-variety-list";
600
- grammar: string;
601
- flourishCount: number;
602
- archetypes: {
603
- id: string;
604
- guidance: string;
605
- }[];
606
- flourishes: {
607
- id: string;
608
- guidance: string;
609
- }[];
476
+ type: "vibes-diy.cli.res-system";
477
+ systemPrompt: string;
610
478
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
611
479
  type: "vibes-diy.cli.push";
612
480
  mode: string;
@@ -698,6 +566,23 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
698
566
  message: string;
699
567
  code: "from-carry-failed";
700
568
  };
569
+ }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
570
+ type: "vibes-diy.cli.remix";
571
+ srcUserSlug: string;
572
+ srcAppSlug: string;
573
+ dstOwnerHandle?: string | undefined;
574
+ dstAppSlug?: string | undefined;
575
+ published: boolean;
576
+ settingsOnly: boolean;
577
+ apiUrl: string;
578
+ }, {
579
+ type: "vibes-diy.cli.res-remix";
580
+ ownerHandle: string;
581
+ appSlug: string;
582
+ url: string;
583
+ carried?: string[] | undefined;
584
+ skippedPresent?: string[] | undefined;
585
+ chatId?: string | undefined;
701
586
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
702
587
  type: "vibes-diy.cli.claim-handle";
703
588
  apiUrl: string;
@@ -708,6 +593,21 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
708
593
  ownerHandle?: string | undefined;
709
594
  defaultHandleSet?: boolean | undefined;
710
595
  suggestions: string[];
596
+ }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
597
+ type: "vibes-diy.cli.put-asset";
598
+ file: string;
599
+ appSlug: string;
600
+ ownerHandle: string;
601
+ apiUrl: string;
602
+ mimeType: string;
603
+ verifyFetch: boolean;
604
+ }, {
605
+ type: "vibes-diy.cli.res-put-asset";
606
+ cid: string;
607
+ getURL: string;
608
+ size: number;
609
+ uploadId: string;
610
+ verified?: boolean | undefined;
711
611
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
712
612
  type: "vibes-diy.cli.generate";
713
613
  prompt: string;
@@ -726,6 +626,16 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
726
626
  record?: string | undefined;
727
627
  style?: string | undefined;
728
628
  }, {
629
+ type: "vibes-diy.cli.res-generate";
630
+ appSlug: string;
631
+ ownerHandle: string;
632
+ url: string;
633
+ directory: string;
634
+ release?: "not-visible" | "published" | "version-locked" | undefined;
635
+ turns?: number | undefined;
636
+ publish?: "kept-private-no-access-fn" | "private" | "published" | undefined;
637
+ posture?: "gated" | "open" | "private" | undefined;
638
+ } | {
729
639
  appSlug: string;
730
640
  ownerHandle: string;
731
641
  mode: "dev" | "production";
@@ -800,55 +710,137 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
800
710
  message: string;
801
711
  code: "from-carry-failed";
802
712
  };
803
- } | {
804
- type: "vibes-diy.cli.res-generate";
805
- appSlug: string;
806
- ownerHandle: string;
807
- url: string;
808
- directory: string;
809
- release?: "not-visible" | "published" | "version-locked" | undefined;
810
- turns?: number | undefined;
811
- publish?: "kept-private-no-access-fn" | "private" | "published" | undefined;
812
- posture?: "gated" | "open" | "private" | undefined;
813
713
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
814
- type: "vibes-diy.cli.app-chats";
714
+ type: "vibes-diy.cli.codegen-log";
815
715
  appSlug: string;
816
716
  ownerHandle: string;
817
717
  chatId?: string | undefined;
818
718
  apiUrl: string;
719
+ response?: boolean | undefined;
720
+ raw?: boolean | undefined;
721
+ files?: boolean | undefined;
722
+ jsonl?: boolean | undefined;
723
+ user?: boolean | undefined;
724
+ promptId?: string | undefined;
819
725
  }, {
820
- type: "vibes-diy.cli.res-app-chats-list";
726
+ type: "vibes-diy.cli.res-codegen-log-list";
821
727
  items: {
822
728
  chatId: string;
823
729
  appSlug: string;
824
730
  ownerHandle: string;
825
731
  created: string;
826
- userHandle?: string | undefined;
827
732
  }[];
828
733
  } | {
829
- type: "vibes-diy.cli.res-app-chats-detail";
734
+ type: "vibes-diy.cli.res-codegen-log-detail";
830
735
  chatId: string;
831
- ownerHandle?: string | undefined;
832
- appSlug?: string | undefined;
736
+ ownerHandle: string;
737
+ appSlug: string;
738
+ prompts: {
739
+ prompt: string;
740
+ fsId: string;
741
+ created: string;
742
+ }[];
743
+ } | {
744
+ type: "vibes-diy.cli.res-codegen-log-response";
833
745
  output: string;
834
746
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
835
- type: "vibes-diy.cli.list";
747
+ type: "vibes-diy.cli.edit";
748
+ appSlug: string;
749
+ prompt: string;
750
+ ownerHandle: string;
751
+ instantJoin?: boolean | undefined;
752
+ verbose: boolean;
753
+ dir: string;
836
754
  apiUrl: string;
755
+ dryRun: boolean;
756
+ transcript: boolean;
757
+ directBuild?: boolean | undefined;
758
+ focusPath?: string | undefined;
759
+ model?: string | undefined;
760
+ builderModel?: string | undefined;
761
+ apiKey?: string | undefined;
837
762
  }, {
838
- type: "vibes-diy.cli.res-list";
839
- items: {
840
- ownerHandle: string;
841
- appSlug: string;
842
- updated: string;
843
- title?: string | undefined;
844
- icon?: {
845
- cid: string;
846
- mime: string;
763
+ appSlug: string;
764
+ ownerHandle: string;
765
+ mode: "dev" | "production";
766
+ fsId: string;
767
+ type: "vibes.diy.res-ensure-app-slug";
768
+ env: Record<string, string>;
769
+ fileSystem: {
770
+ fileName: string;
771
+ mimeType: string;
772
+ assetId: string;
773
+ assetURI: string;
774
+ transform?: {
775
+ type: "jsx-to-js";
776
+ transformedAssetId: string;
777
+ } | {
778
+ type: "imports";
779
+ importMapAssetId: string;
780
+ } | {
781
+ type: "import-map";
782
+ fromAssetIds: string[];
783
+ } | {
784
+ type: "transformed";
785
+ action: "jsx-to-js";
786
+ transformedAssetId: string;
787
+ } | {
788
+ type: "tailwind-css";
847
789
  } | undefined;
848
- pinnedAt?: string | undefined;
849
- neverPublished?: boolean | undefined;
850
- unpublishedAt?: string | undefined;
790
+ entryPoint?: boolean | undefined;
791
+ size: number;
792
+ kind?: "asset" | undefined;
793
+ uploadId?: string | undefined;
851
794
  }[];
795
+ } | {
796
+ type: "vibes.diy.res-error";
797
+ error: {
798
+ message: string;
799
+ code: "require-login";
800
+ };
801
+ } | {
802
+ type: "vibes.diy.res-error";
803
+ error: {
804
+ message: string;
805
+ code: "user-slug-invalid";
806
+ };
807
+ } | {
808
+ type: "vibes.diy.res-error";
809
+ error: {
810
+ message: string;
811
+ code: "app-slug-invalid";
812
+ };
813
+ } | {
814
+ type: "vibes.diy.res-error";
815
+ error: {
816
+ message: string;
817
+ code: "max-app-slugs-reached";
818
+ };
819
+ } | {
820
+ type: "vibes.diy.res-error";
821
+ error: {
822
+ message: string;
823
+ code: "handle-required";
824
+ };
825
+ } | {
826
+ type: "vibes.diy.res-error";
827
+ error: {
828
+ message: string;
829
+ code: "from-not-owned";
830
+ };
831
+ } | {
832
+ type: "vibes.diy.res-error";
833
+ error: {
834
+ message: string;
835
+ code: "from-carry-failed";
836
+ };
837
+ } | {
838
+ type: "vibes-diy.cli.res-edit";
839
+ appSlug: string;
840
+ ownerHandle: string;
841
+ url: string;
842
+ directory: string;
843
+ restyled?: boolean | undefined;
852
844
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
853
845
  type: "vibes-diy.cli.pull";
854
846
  appSlug: string;
@@ -994,19 +986,14 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
994
986
  type: "core-cli.res-device-id-register";
995
987
  output: string;
996
988
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
997
- type: "vibes-diy.cli.db.get";
989
+ type: "vibes-diy.cli.db.list";
998
990
  apiUrl: string;
999
991
  appSlug: string;
1000
992
  ownerHandle: string;
1001
- dbName: string;
1002
- docId: string;
1003
993
  admin: boolean;
1004
- actingHandle: string;
1005
994
  }, {
1006
- type: "vibes-diy.cli.db.get-res";
1007
- doc: {
1008
- [x: string]: unknown;
1009
- };
995
+ type: "vibes-diy.cli.db.list-res";
996
+ dbNames: string[];
1010
997
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
1011
998
  type: "vibes-diy.cli.db.put";
1012
999
  apiUrl: string;
@@ -1035,10 +1022,23 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
1035
1022
  id: string;
1036
1023
  ok: true;
1037
1024
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
1038
- type: "vibes-diy.cli.db.subscribe";
1025
+ type: "vibes-diy.cli.db.query";
1039
1026
  apiUrl: string;
1040
1027
  appSlug: string;
1041
1028
  ownerHandle: string;
1042
1029
  dbName: string;
1043
- }, never>)[];
1030
+ field: string;
1031
+ key: string;
1032
+ prefix: string;
1033
+ range: string;
1034
+ limit: number;
1035
+ descending: boolean;
1036
+ admin: boolean;
1037
+ actingHandle: string;
1038
+ }, {
1039
+ type: "vibes-diy.cli.db.query-res";
1040
+ docs: {
1041
+ [x: string]: unknown;
1042
+ }[];
1043
+ }>)[];
1044
1044
  export declare function cmdTsEvento(): import("@adviser/cement").Evento;
@@ -1,6 +1,6 @@
1
1
  import { Result } from "@adviser/cement";
2
2
  import { type AgentEvidenceLine } from "@vibes.diy/api-types";
3
- import { type ChatWireBlockEvent, type ChatWireDraftReadyEvent, type ChatWireEvent, type ChatWireFireVerdictEvent } from "@vibes.diy/api-impl";
3
+ import { type ChatWireBlockEvent, type ChatWireEvent } from "@vibes.diy/api-impl";
4
4
  import { resolveSectionStream, type ResolveSectionStreamResult } from "./resolve-section-stream.js";
5
5
  export declare const AGENT_TURN_CEILING_MS = 900000;
6
6
  export interface ChatEventFeed {
@@ -27,8 +27,6 @@ export interface FollowChatBuildOpts {
27
27
  readonly onProgress?: (msg: string) => void;
28
28
  readonly onBuildResolved?: (landing: FollowChatBuildLanding) => void | Promise<void>;
29
29
  readonly seed?: () => ReadonlyMap<string, string> | undefined;
30
- readonly onDraftReady?: (ev: ChatWireDraftReadyEvent) => void;
31
- readonly onFireVerdict?: (ev: ChatWireFireVerdictEvent) => string | undefined;
32
30
  readonly onSnapshot?: Parameters<typeof resolveSectionStream>[0]["onSnapshot"];
33
31
  readonly onError?: Parameters<typeof resolveSectionStream>[0]["onError"];
34
32
  readonly deadlineMs?: number;
@@ -1,6 +1,6 @@
1
1
  import { Result } from "@adviser/cement";
2
2
  import { agentEvidenceLine } from "@vibes.diy/api-types";
3
- import { wireEventKey, } from "@vibes.diy/api-impl";
3
+ import { wireEventKey } from "@vibes.diy/api-impl";
4
4
  import { resolveSectionStream } from "./resolve-section-stream.js";
5
5
  export const AGENT_TURN_CEILING_MS = 900_000;
6
6
  function agentAnswer(prose, errors) {
@@ -53,20 +53,15 @@ export async function followChatBuild(opts) {
53
53
  let sawEvidence = false;
54
54
  const seen = new Set();
55
55
  let live = opts.startAfterPromptId === undefined;
56
- let draft = {};
57
- const draftPromptIds = new Set();
58
- const stripSlash = (p) => (p.startsWith("/") ? p.slice(1) : p);
59
- const draftSeed = () => draft.files === undefined ? undefined : new Map(Object.entries(draft.files));
60
56
  let idle = false;
61
57
  let current;
62
- const startResolving = (promptId, asDraft = false) => {
58
+ const startResolving = (promptId) => {
63
59
  const ts = new TransformStream();
64
60
  const writer = ts.writable.getWriter();
65
- const seed = asDraft ? undefined : (opts.seed?.() ?? draftSeed());
61
+ const seed = opts.seed?.();
66
62
  current = {
67
63
  promptId,
68
64
  writer,
69
- ...(asDraft ? { draft: true } : {}),
70
65
  ...(seed === undefined ? {} : { seed }),
71
66
  resolving: resolveSectionStream({
72
67
  sectionStream: ts.readable,
@@ -84,17 +79,6 @@ export async function followChatBuild(opts) {
84
79
  current = undefined;
85
80
  await build.writer.close().catch(() => undefined);
86
81
  const r = await build.resolving;
87
- if (build.draft === true) {
88
- if (r.isOk() && draft.files === undefined && Object.keys(r.Ok().files).length > 0) {
89
- draft = {
90
- ...draft,
91
- files: Object.fromEntries(Object.entries(r.Ok().files).map(([k, v]) => [stripSlash(k), v])),
92
- ...(build.fsId === undefined ? {} : { fsId: build.fsId }),
93
- promptId: build.promptId,
94
- };
95
- }
96
- return;
97
- }
98
82
  if (r.isErr()) {
99
83
  promptErrors.push(String(r.Err().message ?? r.Err()));
100
84
  return;
@@ -112,32 +96,6 @@ export async function followChatBuild(opts) {
112
96
  };
113
97
  const finish = async () => {
114
98
  await landCurrent();
115
- if (landings.length === 0 && idle && claimed && draft.files !== undefined) {
116
- const files = draft.files;
117
- const paths = Object.keys(files);
118
- const landing = {
119
- promptId: draft.promptId ?? `draft-${opts.chatId}`,
120
- ...(draft.fsId === undefined ? {} : { fsId: draft.fsId }),
121
- resolved: {
122
- files,
123
- errors: [],
124
- recoveredNoMatches: [],
125
- snapshotCount: paths.length,
126
- applyErrorCount: 0,
127
- turnEndSeen: true,
128
- announcedPaths: paths,
129
- blockEndSeen: true,
130
- promptErrors: [],
131
- restyleCount: 0,
132
- restyleDescriptions: [],
133
- },
134
- ownerHandle,
135
- appSlug,
136
- seed: new Map(Object.entries(files)),
137
- };
138
- landings.push(landing);
139
- await opts.onBuildResolved?.(landing);
140
- }
141
99
  for (const text of agentProse.values()) {
142
100
  if (text.trim().length === 0)
143
101
  continue;
@@ -169,33 +127,6 @@ export async function followChatBuild(opts) {
169
127
  opts.onUpstreamError?.(ev.message);
170
128
  continue;
171
129
  }
172
- if (ev.kind === "draft-ready") {
173
- if (ev.chatId !== opts.chatId)
174
- continue;
175
- if (ev.promptId !== undefined)
176
- draftPromptIds.add(ev.promptId);
177
- if (ev.fileTexts !== undefined) {
178
- draft = {
179
- files: Object.fromEntries(Object.entries(ev.fileTexts).map(([k, v]) => [stripSlash(k), v])),
180
- fsId: ev.fsId,
181
- ...(ev.promptId === undefined ? {} : { promptId: ev.promptId }),
182
- };
183
- }
184
- else if (draft.fsId === undefined) {
185
- draft = { ...draft, fsId: ev.fsId, ...(ev.promptId === undefined ? {} : { promptId: ev.promptId }) };
186
- }
187
- opts.onDraftReady?.(ev);
188
- continue;
189
- }
190
- if (ev.kind === "fire-verdict") {
191
- const reason = opts.onFireVerdict?.(ev);
192
- if (reason === undefined)
193
- continue;
194
- if (current !== undefined)
195
- await current.writer.close().catch(() => undefined);
196
- current = undefined;
197
- return Result.Err(reason);
198
- }
199
130
  if (ev.kind === "image-survey")
200
131
  continue;
201
132
  const key = wireEventKey(ev);
@@ -208,23 +139,6 @@ export async function followChatBuild(opts) {
208
139
  live = true;
209
140
  }
210
141
  opts.onBlock?.(ev);
211
- if (ev.type === "prompt.req" && ev.firstDraft === true)
212
- draftPromptIds.add(ev.promptId);
213
- if (draftPromptIds.has(ev.promptId)) {
214
- if (!buildPromptIds.has(ev.promptId)) {
215
- buildPromptIds.add(ev.promptId);
216
- if (current === undefined && draft.files === undefined)
217
- startResolving(ev.promptId, true);
218
- }
219
- if (current?.promptId === ev.promptId && ev.block !== undefined)
220
- await current.writer.write(asSectionBlocks(ev.block));
221
- if (ev.type === "block.end" && current?.promptId === ev.promptId) {
222
- if (ev.fsId !== undefined)
223
- current.fsId = ev.fsId;
224
- await landCurrent();
225
- }
226
- continue;
227
- }
228
142
  if (ev.type === "prompt.req" && ev.agentDispatched !== true)
229
143
  agentTurnsSeen.add(ev.promptId);
230
144
  const isBuildStart = (ev.type === "prompt.req" && ev.agentDispatched === true) ||