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