mockpit 2.0.0 → 3.0.0

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 (73) hide show
  1. package/README.md +60 -212
  2. package/bin/demoData.js +2 -2
  3. package/bin/initDesign.js +6 -6
  4. package/bin/mockpit.js +407 -187
  5. package/bin/poster.js +377 -0
  6. package/dist/mcp/server.js +80 -24
  7. package/dist/server/answerAdditions.d.ts +7 -0
  8. package/dist/server/answerAdditions.js +76 -0
  9. package/dist/server/apiViews.d.ts +289 -52
  10. package/dist/server/apiViews.js +189 -81
  11. package/dist/server/app.d.ts +7 -2
  12. package/dist/server/app.js +2845 -832
  13. package/dist/server/appIcon.js +15 -5
  14. package/dist/server/appIconPng.js +3 -3
  15. package/dist/server/askNudges.js +1 -1
  16. package/dist/server/cdnInline.d.ts +8 -0
  17. package/dist/server/cdnInline.js +638 -0
  18. package/dist/server/codeWorker.js +1 -1
  19. package/dist/server/decisionList.d.ts +45 -0
  20. package/dist/server/decisionList.js +302 -0
  21. package/dist/server/decisions.d.ts +4 -4
  22. package/dist/server/decisions.js +9 -9
  23. package/dist/server/designGuide.d.ts +5 -5
  24. package/dist/server/designGuide.js +128 -67
  25. package/dist/server/embeds.d.ts +3 -1
  26. package/dist/server/embeds.js +31 -6
  27. package/dist/server/eventLog.d.ts +2 -2
  28. package/dist/server/eventLog.js +11 -11
  29. package/dist/server/events.d.ts +9 -6
  30. package/dist/server/feedbackBatch.d.ts +35 -13
  31. package/dist/server/feedbackBatch.js +111 -47
  32. package/dist/server/fills.d.ts +4 -0
  33. package/dist/server/fills.js +55 -1
  34. package/dist/server/handoff.d.ts +4 -1
  35. package/dist/server/handoff.js +8 -2
  36. package/dist/server/icons.js +1 -1
  37. package/dist/server/index.js +39 -10
  38. package/dist/server/jump.d.ts +21 -0
  39. package/dist/server/jump.js +175 -0
  40. package/dist/server/knobs.d.ts +3 -3
  41. package/dist/server/knobs.js +6 -6
  42. package/dist/server/mcpHttp.d.ts +5 -1
  43. package/dist/server/mcpHttp.js +16 -11
  44. package/dist/server/mcpSpec.js +118 -46
  45. package/dist/server/parts.js +9 -1
  46. package/dist/server/run.d.ts +1 -1
  47. package/dist/server/run.js +25 -16
  48. package/dist/server/runApi.d.ts +3 -3
  49. package/dist/server/runApi.js +25 -19
  50. package/dist/server/sqlStore.d.ts +112 -96
  51. package/dist/server/sqlStore.js +906 -172
  52. package/dist/server/standings.d.ts +25 -0
  53. package/dist/server/standings.js +113 -0
  54. package/dist/server/surfacePage.d.ts +6 -9
  55. package/dist/server/surfacePage.js +361 -86
  56. package/dist/server/types.d.ts +226 -72
  57. package/dist/server/types.js +73 -78
  58. package/extensions/mockpit.js +89 -72
  59. package/guide/AGENT_SETUP.md +13 -1
  60. package/guide/packs/design-craft.md +2 -3
  61. package/guide/topics/asks.md +106 -62
  62. package/guide/topics/feedback.md +126 -119
  63. package/guide/topics/html.md +17 -24
  64. package/guide/topics/http.md +41 -41
  65. package/guide/topics/knobs.md +7 -10
  66. package/guide/topics/scripts.md +22 -33
  67. package/guide/topics/surfaces.md +39 -48
  68. package/opencode/mockpit.js +120 -0
  69. package/opencode/package.json +8 -0
  70. package/package.json +4 -3
  71. package/skills/launch-video/SKILL.md +11 -11
  72. package/skills/mockpit/SKILL.md +26 -22
  73. package/viewer/dist/index.html +9 -9
@@ -1,4 +1,4 @@
1
- import type { Palette } from "./themes.ts";
1
+ import type { Mode, Palette } from "./themes.ts";
2
2
  export interface Session {
3
3
  id: string;
4
4
  agent: string;
@@ -69,6 +69,7 @@ export interface HtmlSurface {
69
69
  html: string;
70
70
  kits?: string[];
71
71
  poster?: string;
72
+ posterMode?: Mode;
72
73
  }
73
74
  export interface MarkdownSurface {
74
75
  kind: "markdown";
@@ -197,13 +198,22 @@ export interface PadValue {
197
198
  y: number;
198
199
  }
199
200
  export type KnobValue = number | boolean | string | PadValue | SpringKnob | EasingKnob;
200
- export type MockKind = "page" | "component" | "sketch";
201
- export declare const isMockKind: (k: unknown) => k is MockKind;
201
+ export type DesignKind = "screen" | "component" | "idea";
202
+ export declare const isDesignKind: (k: unknown) => k is DesignKind;
202
203
  export type PostStatus = "open" | "accepted" | "archived";
203
204
  export type VariantStatus = "open" | "inUse" | "archived";
204
205
  export declare const variantStatus: (status: PostStatus) => VariantStatus;
205
206
  export declare const isLive: (status: PostStatus | VariantStatus) => boolean;
206
207
  export declare const inUseVersion: (post: Pick<Post, "status" | "version" | "acceptedVersion">) => number;
208
+ type VersionLine = Pick<Post, "status" | "version" | "acceptedVersion" | "hiddenVersions" | "stayedVersion"> & {
209
+ history: {
210
+ version: number;
211
+ }[];
212
+ };
213
+ export declare const newestVisible: (post: VersionLine) => number;
214
+ export declare const currentVersion: (post: VersionLine) => number;
215
+ export declare const changedTo: (post: VersionLine) => number | undefined;
216
+ export declare const recommendedVariant: (asks: Pick<Ask, "state" | "options">[], state: string | null) => string | undefined;
207
217
  export declare function postAtVersion(post: Post, version: number): Post | null;
208
218
  export declare function versionAt(post: Pick<Post, "version" | "history">, n: number): number;
209
219
  export interface AskOption {
@@ -214,33 +224,66 @@ export interface AskOption {
214
224
  set?: Record<string, KnobValue>;
215
225
  recommended?: true;
216
226
  }
227
+ export interface AnswerAddition {
228
+ knob: string;
229
+ value: string;
230
+ style?: string;
231
+ fill?: string;
232
+ }
217
233
  export type AskAnswer = string | string[];
218
- export declare const optionState: (ask: Pick<Ask, "state">, mock: {
234
+ export interface HiddenAnswer {
235
+ id: string;
236
+ label: string;
237
+ why?: string;
238
+ }
239
+ export interface AnswerStanding {
240
+ kept: string[];
241
+ hidden: HiddenAnswer[];
242
+ carried?: string[];
243
+ since?: Record<string, string>;
244
+ unsent?: true;
245
+ }
246
+ export interface AnswerSet {
247
+ name: string;
248
+ answers: Record<string, AskAnswer>;
249
+ at: string;
250
+ }
251
+ export declare const optionState: (ask: Pick<Ask, "state">, design: {
219
252
  states: string[];
220
253
  }) => string | null;
221
254
  export interface Ask {
222
255
  id: string;
223
256
  text: string;
224
- scope: "mock" | "state" | "part";
257
+ scope: "design" | "state" | "part";
225
258
  state?: string;
259
+ states?: string[];
226
260
  part?: string;
227
261
  options: AskOption[];
228
262
  multi?: boolean;
229
263
  after?: string;
230
264
  answer?: AskAnswer;
231
265
  other?: string;
232
- note?: string;
266
+ comment?: string;
233
267
  otherImages?: string[];
234
- noteImages?: string[];
268
+ commentImages?: string[];
235
269
  dismissed?: true;
236
270
  at: string;
237
271
  }
238
272
  export declare const OTHER_ID = "other";
273
+ export interface ParagraphAnchor {
274
+ surface: number;
275
+ index: number;
276
+ kind: string;
277
+ text: string;
278
+ }
279
+ export declare const PARAGRAPH_TEXT_MAX = 600;
280
+ export declare const PARAGRAPHS_MAX = 500;
239
281
  export interface PartCommentAnchor {
240
282
  offset?: [number, number];
241
283
  quote?: string;
242
284
  selector?: string;
243
285
  box?: number[];
286
+ paragraph?: ParagraphAnchor;
244
287
  width?: number;
245
288
  }
246
289
  export declare const REACTIONS: readonly ["up", "down", "more"];
@@ -271,57 +314,83 @@ export interface Draft {
271
314
  tuned: Record<string, KnobValue>;
272
315
  comments: PartComment[];
273
316
  others?: Record<string, string>;
274
- notes?: Record<string, string>;
317
+ askComments?: Record<string, string>;
275
318
  otherImages?: Record<string, string[]>;
276
- noteImages?: Record<string, string[]>;
319
+ askCommentImages?: Record<string, string[]>;
277
320
  updatedAt: string;
278
321
  }
279
322
  export interface Reply {
280
- mockId: string;
323
+ designId: string;
281
324
  version: number;
282
325
  answers: Record<string, AskAnswer>;
283
326
  borrowed: Record<string, string>;
284
327
  tuned: Record<string, KnobValue>;
285
328
  comments: PartComment[];
286
329
  others?: Record<string, string>;
287
- notes?: Record<string, string>;
330
+ askComments?: Record<string, string>;
288
331
  otherImages?: Record<string, string[]>;
289
- noteImages?: Record<string, string[]>;
332
+ askCommentImages?: Record<string, string[]>;
290
333
  text?: string;
334
+ routed?: true;
335
+ more?: {
336
+ ask: string;
337
+ note?: string;
338
+ like?: string;
339
+ };
340
+ standings?: Record<string, AnswerStanding>;
341
+ update?: {
342
+ ask: string;
343
+ option: string;
344
+ };
345
+ set?: string;
291
346
  verdict?: ReplyVerdict;
292
- closed?: {
347
+ archived?: {
293
348
  dismissed: string[];
294
349
  };
295
- edited?: MockEdit;
350
+ edited?: DesignEdit;
296
351
  }
297
- export interface MockEdit {
298
- kind?: MockKind;
352
+ export interface DesignEdit {
353
+ kind?: DesignKind;
299
354
  area?: string | null;
355
+ notes?: string | null;
300
356
  }
301
357
  export declare const AREA_ORDER_SETTING = "areaOrder";
302
- export interface Mock {
358
+ export declare const DECISION_EDITS_SETTING = "decisions";
359
+ export interface DesignNotes {
360
+ text: string;
361
+ by: "agent" | "user";
362
+ at: string;
363
+ }
364
+ export declare const MAX_NOTES = 4000;
365
+ export type StateOutline = "dismissed" | "requested";
366
+ export declare const isPlanned: (design: {
367
+ kind: DesignKind;
368
+ }, variants: number) => boolean;
369
+ export interface Design {
303
370
  id: string;
304
371
  project: string;
305
372
  slug: string;
306
373
  title: string;
307
- kind: MockKind;
374
+ kind: DesignKind;
308
375
  area: string | null;
309
376
  source: string | null;
310
377
  states: string[];
311
- situations: Record<string, string[]>;
312
378
  asks: Ask[];
313
379
  knobs: Knobs;
314
380
  widths: number[];
315
381
  draft: Draft | null;
316
382
  sessionId: string | null;
317
- closedAt: string | null;
383
+ shortlist: boolean;
384
+ archivedAt: string | null;
385
+ archiveReason: string | null;
386
+ notes: DesignNotes | null;
387
+ stateOutlines: Record<string, StateOutline>;
388
+ answerAdditions: AnswerAddition[];
389
+ standings: Record<string, AnswerStanding>;
390
+ sets: AnswerSet[];
318
391
  createdAt: string;
319
392
  updatedAt: string;
320
393
  }
321
- export declare const NORMAL_SITUATION = "Normal";
322
- export declare const situationKey: (state: string, situation: string) => string;
323
- export declare function momentOf(situations: Record<string, string[]>, state: string | null): string | null;
324
- export declare const momentsOf: (states: string[], situations: Record<string, string[]>) => string[];
325
394
  export interface Embed {
326
395
  slug: string;
327
396
  variant: string;
@@ -336,15 +405,23 @@ export interface PostVersion {
336
405
  from?: number;
337
406
  prompt?: string;
338
407
  author?: string;
408
+ publishedBy?: string;
409
+ amendedAt?: string;
339
410
  }
340
411
  export interface ForkRef {
341
412
  variant: string;
342
413
  version: number;
343
414
  }
415
+ export interface CopyRef {
416
+ design: string;
417
+ state: string | null;
418
+ variant: string;
419
+ version: number;
420
+ }
344
421
  export interface Post {
345
422
  id: string;
346
423
  sessionId: string;
347
- mock: string;
424
+ design: string;
348
425
  state: string | null;
349
426
  variant: string;
350
427
  status: PostStatus;
@@ -355,18 +432,24 @@ export interface Post {
355
432
  version: number;
356
433
  history: PostVersion[];
357
434
  knobs?: Knobs;
358
- note?: string;
435
+ description?: string;
359
436
  embeds: Embed[];
360
437
  forkedFrom?: ForkRef;
361
- starred?: true;
438
+ copiedFrom?: CopyRef;
362
439
  acceptedVersion?: number;
363
440
  hiddenVersions?: number[];
441
+ archiveReason?: string;
442
+ archivedAt?: string;
443
+ stayedVersion?: number;
364
444
  from?: number;
365
445
  prompt?: string;
366
446
  author?: string;
447
+ publishedBy?: string;
448
+ amendedAt?: string;
449
+ rewrites?: number;
367
450
  }
368
451
  export interface FlowStep {
369
- mock: string;
452
+ design: string;
370
453
  state: string | null;
371
454
  }
372
455
  export interface Flow {
@@ -377,14 +460,36 @@ export interface Flow {
377
460
  updatedAt: string;
378
461
  }
379
462
  export declare const sameScreen: (a: FlowStep, b: FlowStep) => boolean;
463
+ export interface JumpRows {
464
+ designs: {
465
+ id: string;
466
+ project: string;
467
+ slug: string;
468
+ title: string;
469
+ kind: DesignKind;
470
+ area: string | null;
471
+ states: string[];
472
+ asks: Ask[];
473
+ widths: number[];
474
+ archivedAt: string | null;
475
+ updatedAt: string;
476
+ }[];
477
+ variants: {
478
+ designId: string;
479
+ state: string | null;
480
+ variant: string;
481
+ description: string | null;
482
+ status: PostStatus;
483
+ }[];
484
+ }
380
485
  export interface ProjectSummary {
381
486
  name: string;
382
- mocks: number;
487
+ designs: number;
383
488
  open: number;
384
489
  lastActiveAt: string;
385
490
  sessions: number;
386
491
  }
387
- export interface DesignSettings {
492
+ export interface DesignSystem {
388
493
  detected: {
389
494
  tailwind: boolean;
390
495
  shadcn: boolean;
@@ -486,7 +591,7 @@ export interface Comment {
486
591
  id: string;
487
592
  seq: number;
488
593
  sessionId: string;
489
- mockId: string | null;
594
+ designId: string | null;
490
595
  postId: string | null;
491
596
  author: string;
492
597
  text: string;
@@ -524,60 +629,70 @@ export interface CreateSessionInput {
524
629
  project?: string;
525
630
  key?: string;
526
631
  }
527
- export interface CreateMockInput {
632
+ export interface CreateDesignInput {
528
633
  project: string;
529
634
  slug: string;
530
635
  title?: string;
531
- kind?: MockKind;
636
+ kind?: DesignKind;
532
637
  area?: string | null;
533
638
  source?: string | null;
534
639
  states?: string[];
535
640
  knobs?: Knobs;
536
641
  widths?: number[];
537
642
  sessionId?: string | null;
643
+ shortlist?: boolean;
538
644
  }
539
- export interface UpdateMockInput {
645
+ export interface UpdateDesignInput {
540
646
  title?: string;
541
- kind?: MockKind;
647
+ kind?: DesignKind;
542
648
  area?: string | null;
543
649
  source?: string | null;
544
650
  states?: string[];
545
- situations?: Record<string, string[]>;
546
651
  asks?: Ask[];
547
652
  knobs?: Knobs;
548
653
  widths?: number[];
549
654
  sessionId?: string | null;
550
- closedAt?: string | null;
655
+ archivedAt?: string | null;
656
+ archiveReason?: string | null;
657
+ notes?: DesignNotes | null;
658
+ stateOutlines?: Record<string, StateOutline>;
659
+ answerAdditions?: AnswerAddition[];
660
+ standings?: Record<string, AnswerStanding>;
661
+ sets?: AnswerSet[];
551
662
  }
552
663
  export interface CreatePostInput {
553
664
  sessionId: string;
554
- mock: string;
665
+ design: string;
555
666
  state: string | null;
556
667
  variant?: string;
557
668
  title?: string;
558
669
  surfaces: Surface[];
559
670
  knobs?: Knobs;
560
- note?: string;
671
+ description?: string;
561
672
  embeds?: Embed[];
562
673
  forkedFrom?: ForkRef;
674
+ copiedFrom?: CopyRef;
563
675
  from?: number;
564
676
  prompt?: string;
565
677
  author?: string;
678
+ publishedBy?: string;
566
679
  }
567
680
  export interface UpdatePostInput {
568
681
  title?: string;
569
682
  surfaces?: Surface[];
570
683
  knobs?: Knobs | null;
571
- note?: string;
684
+ description?: string;
572
685
  embeds?: Embed[];
573
686
  from?: number;
574
687
  prompt?: string;
575
688
  author?: string;
576
689
  state?: string | null;
690
+ publishedBy?: string;
577
691
  }
692
+ export type AmendPostInput = Omit<UpdatePostInput, "state" | "publishedBy">;
578
693
  export interface CreateCommentInput {
579
694
  sessionId: string;
580
- mockId?: string | null;
695
+ designId?: string | null;
581
696
  postId?: string | null;
582
697
  author: string;
583
698
  text: string;
@@ -590,12 +705,24 @@ export interface CreateCommentInput {
590
705
  }
591
706
  export interface CommentQuery {
592
707
  sessionId?: string;
593
- mockId?: string;
708
+ designId?: string;
594
709
  postId?: string;
595
710
  afterSeq?: number;
596
711
  }
712
+ export interface DecisionVariant {
713
+ designId: string;
714
+ state: string | null;
715
+ variant: string;
716
+ status: PostStatus;
717
+ version: number;
718
+ acceptedVersion: number | null;
719
+ }
720
+ export interface DecisionSources {
721
+ variants: DecisionVariant[];
722
+ decidedAt: Record<string, string>;
723
+ }
597
724
  export interface CommitReplyInput {
598
- mockId: string;
725
+ designId: string;
599
726
  sessionId: string;
600
727
  text: string;
601
728
  payload: Reply;
@@ -605,11 +732,13 @@ export interface CommitReplyInput {
605
732
  version: number;
606
733
  }[];
607
734
  archive: string[];
608
- closedAt?: string;
735
+ release?: string[];
736
+ standings?: Record<string, AnswerStanding>;
609
737
  keepDraft?: true;
738
+ owner?: string;
610
739
  }
611
740
  export interface PostQuery {
612
- mockId?: string;
741
+ designId?: string;
613
742
  sessionId?: string;
614
743
  }
615
744
  export interface Store {
@@ -625,27 +754,42 @@ export interface Store {
625
754
  getSetting(key: string): Promise<string | null>;
626
755
  setSetting(key: string, value: string): Promise<void>;
627
756
  listProjects(): Promise<ProjectSummary[]>;
628
- listMocks(project?: string): Promise<Mock[]>;
629
- getMock(id: string): Promise<Mock | null>;
630
- findMock(project: string, slug: string): Promise<Mock | null>;
631
- createMock(input: CreateMockInput): Promise<Mock>;
632
- updateMock(id: string, patch: UpdateMockInput): Promise<Mock | null>;
633
- removeMock(id: string): Promise<boolean>;
634
- renameMock(id: string, slug: string): Promise<Mock | null>;
757
+ listJumpRows(): Promise<JumpRows>;
758
+ listDesigns(project?: string): Promise<Design[]>;
759
+ getDesign(id: string): Promise<Design | null>;
760
+ findDesign(project: string, slug: string): Promise<Design | null>;
761
+ createDesign(input: CreateDesignInput): Promise<Design>;
762
+ updateDesign(id: string, patch: UpdateDesignInput): Promise<Design | null>;
763
+ removeDesign(id: string): Promise<boolean>;
764
+ renameDesign(id: string, slug: string): Promise<Design | null>;
765
+ nameFirstState(id: string, state: string): Promise<Design | null>;
635
766
  renameProject(from: string, to: string): Promise<boolean>;
636
767
  listFlows(project: string): Promise<Flow[]>;
637
768
  placeFlowStep(project: string, name: string, screen: FlowStep, step: number): Promise<Flow | null>;
638
- putDraft(mockId: string, draft: Draft | null): Promise<Mock | null>;
769
+ putDraft(designId: string, draft: Draft | null): Promise<Design | null>;
639
770
  listPosts(query?: PostQuery): Promise<Post[]>;
771
+ listPostHeads(project?: string): Promise<PostHead[]>;
772
+ listCopies(project: string): Promise<LiveCopy[]>;
640
773
  countPostsBySession(): Promise<Map<string, number>>;
641
774
  getPost(id: string): Promise<Post | null>;
642
- findPost(mockId: string, state: string | null, variant: string): Promise<Post | null>;
775
+ setForkedFrom(id: string, from: ForkRef | null): Promise<Post | null>;
776
+ findPost(designId: string, state: string | null, variant: string): Promise<Post | null>;
643
777
  createPost(input: CreatePostInput): Promise<Post | null>;
644
778
  updatePost(id: string, patch: UpdatePostInput): Promise<Post | null>;
645
779
  removePost(id: string): Promise<boolean>;
780
+ amendPost(id: string, version: number, patch: AmendPostInput): Promise<Post | null>;
781
+ setPosterOnce(id: string, version: number, poster: string, mode?: Mode): Promise<boolean>;
782
+ withdrawVersion(id: string, version: number, embeds: Embed[]): Promise<{
783
+ post: Post | null;
784
+ } | null>;
646
785
  setPostStatus(id: string, status: PostStatus, acceptedVersion?: number): Promise<Post | null>;
647
- setPostStarred(id: string, starred: boolean): Promise<Post | null>;
786
+ bumpRewrites(designId: string): Promise<void>;
787
+ setPostArchived(id: string, archivedAt: string, reason: string | null): Promise<Post | null>;
648
788
  setVersionHidden(id: string, version: number, hidden: boolean): Promise<Post | null>;
789
+ deleteOldVersions(id: string, versions: number[]): Promise<Post | null>;
790
+ setPostReason(id: string, reason: string | null): Promise<Post | null>;
791
+ setPostStayed(id: string, version: number): Promise<Post | null>;
792
+ listDecisionSources(project: string): Promise<DecisionSources>;
649
793
  listComments(query: CommentQuery): Promise<Comment[]>;
650
794
  createComment(input: CreateCommentInput): Promise<Comment | null>;
651
795
  removeComment(id: string): Promise<Comment | null>;
@@ -666,6 +810,25 @@ export interface SqlStorage {
666
810
  exec(query: string, ...bindings: SqlStorageValue[]): SqlStorageCursor;
667
811
  transactionSync?<T>(fn: () => T): T;
668
812
  }
813
+ export interface SurfaceHead {
814
+ kind: Surface["kind"];
815
+ poster?: string;
816
+ posterMode?: Mode;
817
+ marked?: boolean;
818
+ }
819
+ export type PostHead = Omit<Post, "surfaces" | "history"> & {
820
+ surfaces: SurfaceHead[];
821
+ history: {
822
+ version: number;
823
+ surfaces: SurfaceHead[];
824
+ }[];
825
+ };
826
+ export interface LiveCopy {
827
+ design: string;
828
+ state: string | null;
829
+ variant: string;
830
+ copiedFrom: CopyRef;
831
+ }
669
832
  export declare const HISTORY_LIMIT = 20;
670
833
  export declare function reservedAgent(name: string): string;
671
834
  export declare function stripNul<T extends string | null | undefined>(s: T): T;
@@ -681,28 +844,18 @@ export declare const DEFAULT_VARIANT = "default";
681
844
  export declare function slugify(input: string): string;
682
845
  export declare function projectFromCwd(cwd: string | null | undefined): string | null;
683
846
  export declare const htmlSurface: (html: string, kits?: unknown) => HtmlSurface;
684
- export declare const askAnswered: (a: Pick<Ask, "answer" | "other" | "note">) => boolean;
685
- export declare const openAsks: (mock: Pick<Mock, "asks">) => Ask[];
686
- export declare function builtinAskIds(mock: Pick<Mock, "asks" | "states"> & {
687
- closedAt?: string | null;
688
- }, posts: Pick<Post, "mock" | "state" | "variant" | "status">[], mockId: string): string[];
689
- export declare const builtinAskCount: (mock: Pick<Mock, "asks" | "states"> & {
690
- closedAt?: string | null;
691
- }, posts: Pick<Post, "mock" | "state" | "variant" | "status">[], mockId: string) => number;
692
- export declare const openCount: (mock: Pick<Mock, "id" | "asks" | "states"> & {
693
- closedAt?: string | null;
694
- }, posts: Pick<Post, "mock" | "state" | "variant" | "status">[]) => number;
695
- export declare function draftedCount(mock: Pick<Mock, "id" | "asks" | "states" | "draft"> & {
696
- closedAt?: string | null;
697
- }, posts: Pick<Post, "mock" | "state" | "variant" | "status">[]): number | null;
847
+ export declare const askAnswered: (a: Pick<Ask, "answer" | "other" | "comment">) => boolean;
848
+ export declare const openAsks: (design: Pick<Design, "asks">) => Ask[];
849
+ export declare const openCount: (design: Pick<Design, "asks">) => number;
850
+ export declare function draftedCount(design: Pick<Design, "asks" | "draft">): number | null;
698
851
  export declare const BUILTIN_ASK_ID = "variant";
699
- export declare function builtinAsk(mock: Pick<Mock, "states">, posts: Pick<Post, "state" | "variant">[], id: string): Ask | undefined;
700
- export declare function summarizeProjects(mocks: Mock[], sessions: Session[], posts?: Post[]): ProjectSummary[];
852
+ export declare function builtinAsk(design: Pick<Design, "states">, posts: Pick<Post, "state" | "variant">[], id: string): Ask | undefined;
853
+ export declare function summarizeProjects(designs: Design[], sessions: Session[]): ProjectSummary[];
701
854
  export declare function surfacesByteLength(surfaces: Surface[]): number;
702
855
  export declare function collectAssetIds(surfaces: Surface[], out: Set<string>): void;
703
856
  export declare function collectAttachedIds(holder: {
704
857
  otherImages?: unknown;
705
- noteImages?: unknown;
858
+ askCommentImages?: unknown;
706
859
  } | null | undefined, out: Set<string>): void;
707
860
  export interface EvictionCandidate {
708
861
  id: string;
@@ -711,3 +864,4 @@ export interface EvictionCandidate {
711
864
  referenced: boolean;
712
865
  }
713
866
  export declare function selectEvictions(candidates: EvictionCandidate[], incomingBytes: number, budget: number): string[];
867
+ export {};