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.
- package/README.md +60 -212
- package/bin/demoData.js +2 -2
- package/bin/initDesign.js +6 -6
- package/bin/mockpit.js +407 -187
- package/bin/poster.js +377 -0
- package/dist/mcp/server.js +80 -24
- package/dist/server/answerAdditions.d.ts +7 -0
- package/dist/server/answerAdditions.js +76 -0
- package/dist/server/apiViews.d.ts +289 -52
- package/dist/server/apiViews.js +189 -81
- package/dist/server/app.d.ts +7 -2
- package/dist/server/app.js +2845 -832
- package/dist/server/appIcon.js +15 -5
- package/dist/server/appIconPng.js +3 -3
- package/dist/server/askNudges.js +1 -1
- package/dist/server/cdnInline.d.ts +8 -0
- package/dist/server/cdnInline.js +638 -0
- package/dist/server/codeWorker.js +1 -1
- package/dist/server/decisionList.d.ts +45 -0
- package/dist/server/decisionList.js +302 -0
- package/dist/server/decisions.d.ts +4 -4
- package/dist/server/decisions.js +9 -9
- package/dist/server/designGuide.d.ts +5 -5
- package/dist/server/designGuide.js +128 -67
- package/dist/server/embeds.d.ts +3 -1
- package/dist/server/embeds.js +31 -6
- package/dist/server/eventLog.d.ts +2 -2
- package/dist/server/eventLog.js +11 -11
- package/dist/server/events.d.ts +9 -6
- package/dist/server/feedbackBatch.d.ts +35 -13
- package/dist/server/feedbackBatch.js +111 -47
- package/dist/server/fills.d.ts +4 -0
- package/dist/server/fills.js +55 -1
- package/dist/server/handoff.d.ts +4 -1
- package/dist/server/handoff.js +8 -2
- package/dist/server/icons.js +1 -1
- package/dist/server/index.js +39 -10
- package/dist/server/jump.d.ts +21 -0
- package/dist/server/jump.js +175 -0
- package/dist/server/knobs.d.ts +3 -3
- package/dist/server/knobs.js +6 -6
- package/dist/server/mcpHttp.d.ts +5 -1
- package/dist/server/mcpHttp.js +16 -11
- package/dist/server/mcpSpec.js +118 -46
- package/dist/server/parts.js +9 -1
- package/dist/server/run.d.ts +1 -1
- package/dist/server/run.js +25 -16
- package/dist/server/runApi.d.ts +3 -3
- package/dist/server/runApi.js +25 -19
- package/dist/server/sqlStore.d.ts +112 -96
- package/dist/server/sqlStore.js +906 -172
- package/dist/server/standings.d.ts +25 -0
- package/dist/server/standings.js +113 -0
- package/dist/server/surfacePage.d.ts +6 -9
- package/dist/server/surfacePage.js +361 -86
- package/dist/server/types.d.ts +226 -72
- package/dist/server/types.js +73 -78
- package/extensions/mockpit.js +89 -72
- package/guide/AGENT_SETUP.md +13 -1
- package/guide/packs/design-craft.md +2 -3
- package/guide/topics/asks.md +106 -62
- package/guide/topics/feedback.md +126 -119
- package/guide/topics/html.md +17 -24
- package/guide/topics/http.md +41 -41
- package/guide/topics/knobs.md +7 -10
- package/guide/topics/scripts.md +22 -33
- package/guide/topics/surfaces.md +39 -48
- package/opencode/mockpit.js +120 -0
- package/opencode/package.json +8 -0
- package/package.json +4 -3
- package/skills/launch-video/SKILL.md +11 -11
- package/skills/mockpit/SKILL.md +26 -22
- package/viewer/dist/index.html +9 -9
package/dist/server/types.d.ts
CHANGED
|
@@ -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
|
|
201
|
-
export declare const
|
|
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
|
|
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: "
|
|
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
|
-
|
|
266
|
+
comment?: string;
|
|
233
267
|
otherImages?: string[];
|
|
234
|
-
|
|
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
|
-
|
|
317
|
+
askComments?: Record<string, string>;
|
|
275
318
|
otherImages?: Record<string, string[]>;
|
|
276
|
-
|
|
319
|
+
askCommentImages?: Record<string, string[]>;
|
|
277
320
|
updatedAt: string;
|
|
278
321
|
}
|
|
279
322
|
export interface Reply {
|
|
280
|
-
|
|
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
|
-
|
|
330
|
+
askComments?: Record<string, string>;
|
|
288
331
|
otherImages?: Record<string, string[]>;
|
|
289
|
-
|
|
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
|
-
|
|
347
|
+
archived?: {
|
|
293
348
|
dismissed: string[];
|
|
294
349
|
};
|
|
295
|
-
edited?:
|
|
350
|
+
edited?: DesignEdit;
|
|
296
351
|
}
|
|
297
|
-
export interface
|
|
298
|
-
kind?:
|
|
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
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
435
|
+
description?: string;
|
|
359
436
|
embeds: Embed[];
|
|
360
437
|
forkedFrom?: ForkRef;
|
|
361
|
-
|
|
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
|
-
|
|
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
|
-
|
|
487
|
+
designs: number;
|
|
383
488
|
open: number;
|
|
384
489
|
lastActiveAt: string;
|
|
385
490
|
sessions: number;
|
|
386
491
|
}
|
|
387
|
-
export interface
|
|
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
|
-
|
|
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
|
|
632
|
+
export interface CreateDesignInput {
|
|
528
633
|
project: string;
|
|
529
634
|
slug: string;
|
|
530
635
|
title?: string;
|
|
531
|
-
kind?:
|
|
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
|
|
645
|
+
export interface UpdateDesignInput {
|
|
540
646
|
title?: string;
|
|
541
|
-
kind?:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
735
|
+
release?: string[];
|
|
736
|
+
standings?: Record<string, AnswerStanding>;
|
|
609
737
|
keepDraft?: true;
|
|
738
|
+
owner?: string;
|
|
610
739
|
}
|
|
611
740
|
export interface PostQuery {
|
|
612
|
-
|
|
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
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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" | "
|
|
685
|
-
export declare const openAsks: (
|
|
686
|
-
export declare
|
|
687
|
-
|
|
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(
|
|
700
|
-
export declare function summarizeProjects(
|
|
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
|
-
|
|
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 {};
|