mockpit 1.3.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 +66 -202
- package/bin/demoData.js +5 -5
- package/bin/initDesign.js +6 -6
- package/bin/mockpit.js +687 -192
- package/bin/poster.js +377 -0
- package/dist/mcp/server.js +110 -19
- package/dist/server/answerAdditions.d.ts +7 -0
- package/dist/server/answerAdditions.js +76 -0
- package/dist/server/apiViews.d.ts +563 -41
- package/dist/server/apiViews.js +223 -74
- package/dist/server/app.d.ts +10 -2
- package/dist/server/app.js +3284 -782
- 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 +2 -1
- package/dist/server/decisionList.d.ts +45 -0
- package/dist/server/decisionList.js +302 -0
- package/dist/server/decisions.d.ts +8 -8
- package/dist/server/decisions.js +18 -17
- package/dist/server/designGuide.d.ts +10 -6
- package/dist/server/designGuide.js +173 -78
- package/dist/server/embeds.d.ts +4 -1
- package/dist/server/embeds.js +57 -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 +38 -16
- package/dist/server/feedbackBatch.js +121 -50
- package/dist/server/fills.d.ts +4 -0
- package/dist/server/fills.js +55 -1
- package/dist/server/guidance.d.ts +23 -0
- package/dist/server/guidance.js +71 -0
- 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 +49 -11
- 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 +8 -1
- package/dist/server/mcpHttp.js +44 -7
- package/dist/server/mcpSpec.d.ts +2 -1
- package/dist/server/mcpSpec.js +172 -50
- package/dist/server/parts.js +9 -1
- package/dist/server/postSurfaces.js +3 -0
- package/dist/server/run.d.ts +1 -1
- package/dist/server/run.js +31 -17
- package/dist/server/runApi.d.ts +3 -3
- package/dist/server/runApi.js +34 -24
- package/dist/server/sqlStore.d.ts +117 -94
- package/dist/server/sqlStore.js +1089 -141
- 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 +252 -69
- package/dist/server/types.js +87 -69
- package/extensions/mockpit.js +245 -65
- package/guide/AGENT_SETUP.md +13 -1
- package/guide/packs/design-craft.md +34 -0
- package/guide/topics/asks.md +117 -69
- package/guide/topics/feedback.md +156 -119
- package/guide/topics/html.md +19 -32
- package/guide/topics/http.md +43 -40
- package/guide/topics/knobs.md +7 -10
- package/guide/topics/scripts.md +24 -35
- package/guide/topics/surfaces.md +50 -41
- package/opencode/mockpit.js +120 -0
- package/opencode/package.json +8 -0
- package/package.json +4 -6
- package/skills/launch-video/SKILL.md +12 -12
- package/skills/mockpit/SKILL.md +35 -23
- package/viewer/dist/index.html +9 -8
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;
|
|
@@ -68,6 +68,8 @@ export interface HtmlSurface {
|
|
|
68
68
|
kind: "html";
|
|
69
69
|
html: string;
|
|
70
70
|
kits?: string[];
|
|
71
|
+
poster?: string;
|
|
72
|
+
posterMode?: Mode;
|
|
71
73
|
}
|
|
72
74
|
export interface MarkdownSurface {
|
|
73
75
|
kind: "markdown";
|
|
@@ -196,10 +198,22 @@ export interface PadValue {
|
|
|
196
198
|
y: number;
|
|
197
199
|
}
|
|
198
200
|
export type KnobValue = number | boolean | string | PadValue | SpringKnob | EasingKnob;
|
|
199
|
-
export type
|
|
200
|
-
export
|
|
201
|
-
export
|
|
201
|
+
export type DesignKind = "screen" | "component" | "idea";
|
|
202
|
+
export declare const isDesignKind: (k: unknown) => k is DesignKind;
|
|
203
|
+
export type PostStatus = "open" | "accepted" | "archived";
|
|
204
|
+
export type VariantStatus = "open" | "inUse" | "archived";
|
|
205
|
+
export declare const variantStatus: (status: PostStatus) => VariantStatus;
|
|
206
|
+
export declare const isLive: (status: PostStatus | VariantStatus) => boolean;
|
|
202
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;
|
|
203
217
|
export declare function postAtVersion(post: Post, version: number): Post | null;
|
|
204
218
|
export declare function versionAt(post: Pick<Post, "version" | "history">, n: number): number;
|
|
205
219
|
export interface AskOption {
|
|
@@ -208,34 +222,68 @@ export interface AskOption {
|
|
|
208
222
|
variant?: string;
|
|
209
223
|
version?: number;
|
|
210
224
|
set?: Record<string, KnobValue>;
|
|
225
|
+
recommended?: true;
|
|
226
|
+
}
|
|
227
|
+
export interface AnswerAddition {
|
|
228
|
+
knob: string;
|
|
229
|
+
value: string;
|
|
230
|
+
style?: string;
|
|
231
|
+
fill?: string;
|
|
211
232
|
}
|
|
212
233
|
export type AskAnswer = string | string[];
|
|
213
|
-
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: {
|
|
214
252
|
states: string[];
|
|
215
253
|
}) => string | null;
|
|
216
254
|
export interface Ask {
|
|
217
255
|
id: string;
|
|
218
256
|
text: string;
|
|
219
|
-
scope: "
|
|
257
|
+
scope: "design" | "state" | "part";
|
|
220
258
|
state?: string;
|
|
259
|
+
states?: string[];
|
|
221
260
|
part?: string;
|
|
222
261
|
options: AskOption[];
|
|
223
262
|
multi?: boolean;
|
|
224
263
|
after?: string;
|
|
225
264
|
answer?: AskAnswer;
|
|
226
265
|
other?: string;
|
|
227
|
-
|
|
266
|
+
comment?: string;
|
|
228
267
|
otherImages?: string[];
|
|
229
|
-
|
|
268
|
+
commentImages?: string[];
|
|
230
269
|
dismissed?: true;
|
|
231
270
|
at: string;
|
|
232
271
|
}
|
|
233
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;
|
|
234
281
|
export interface PartCommentAnchor {
|
|
235
282
|
offset?: [number, number];
|
|
236
283
|
quote?: string;
|
|
237
284
|
selector?: string;
|
|
238
285
|
box?: number[];
|
|
286
|
+
paragraph?: ParagraphAnchor;
|
|
239
287
|
width?: number;
|
|
240
288
|
}
|
|
241
289
|
export declare const REACTIONS: readonly ["up", "down", "more"];
|
|
@@ -247,9 +295,14 @@ export interface PartComment {
|
|
|
247
295
|
anchor?: PartCommentAnchor;
|
|
248
296
|
reaction?: Reaction;
|
|
249
297
|
variant?: string;
|
|
298
|
+
version?: number;
|
|
299
|
+
borrow?: {
|
|
300
|
+
from: string;
|
|
301
|
+
part?: string;
|
|
302
|
+
};
|
|
250
303
|
}
|
|
251
|
-
export interface
|
|
252
|
-
kind: "
|
|
304
|
+
export interface ReplyVerdict {
|
|
305
|
+
kind: "use" | "revise";
|
|
253
306
|
state: string | null;
|
|
254
307
|
variant: string;
|
|
255
308
|
version?: number;
|
|
@@ -257,45 +310,84 @@ export interface ReplyDecision {
|
|
|
257
310
|
export interface Draft {
|
|
258
311
|
version: number;
|
|
259
312
|
answers: Record<string, AskAnswer>;
|
|
260
|
-
|
|
313
|
+
borrowed: Record<string, string>;
|
|
261
314
|
tuned: Record<string, KnobValue>;
|
|
262
315
|
comments: PartComment[];
|
|
263
316
|
others?: Record<string, string>;
|
|
264
|
-
|
|
317
|
+
askComments?: Record<string, string>;
|
|
265
318
|
otherImages?: Record<string, string[]>;
|
|
266
|
-
|
|
319
|
+
askCommentImages?: Record<string, string[]>;
|
|
267
320
|
updatedAt: string;
|
|
268
321
|
}
|
|
269
322
|
export interface Reply {
|
|
270
|
-
|
|
323
|
+
designId: string;
|
|
271
324
|
version: number;
|
|
272
325
|
answers: Record<string, AskAnswer>;
|
|
273
|
-
|
|
326
|
+
borrowed: Record<string, string>;
|
|
274
327
|
tuned: Record<string, KnobValue>;
|
|
275
328
|
comments: PartComment[];
|
|
276
329
|
others?: Record<string, string>;
|
|
277
|
-
|
|
330
|
+
askComments?: Record<string, string>;
|
|
278
331
|
otherImages?: Record<string, string[]>;
|
|
279
|
-
|
|
332
|
+
askCommentImages?: Record<string, string[]>;
|
|
280
333
|
text?: string;
|
|
281
|
-
|
|
282
|
-
|
|
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;
|
|
346
|
+
verdict?: ReplyVerdict;
|
|
347
|
+
archived?: {
|
|
283
348
|
dismissed: string[];
|
|
284
349
|
};
|
|
350
|
+
edited?: DesignEdit;
|
|
351
|
+
}
|
|
352
|
+
export interface DesignEdit {
|
|
353
|
+
kind?: DesignKind;
|
|
354
|
+
area?: string | null;
|
|
355
|
+
notes?: string | null;
|
|
285
356
|
}
|
|
286
|
-
export
|
|
357
|
+
export declare const AREA_ORDER_SETTING = "areaOrder";
|
|
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 {
|
|
287
370
|
id: string;
|
|
288
371
|
project: string;
|
|
289
372
|
slug: string;
|
|
290
373
|
title: string;
|
|
291
|
-
kind:
|
|
374
|
+
kind: DesignKind;
|
|
375
|
+
area: string | null;
|
|
376
|
+
source: string | null;
|
|
292
377
|
states: string[];
|
|
293
378
|
asks: Ask[];
|
|
294
379
|
knobs: Knobs;
|
|
295
380
|
widths: number[];
|
|
296
381
|
draft: Draft | null;
|
|
297
382
|
sessionId: string | null;
|
|
298
|
-
|
|
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[];
|
|
299
391
|
createdAt: string;
|
|
300
392
|
updatedAt: string;
|
|
301
393
|
}
|
|
@@ -313,15 +405,23 @@ export interface PostVersion {
|
|
|
313
405
|
from?: number;
|
|
314
406
|
prompt?: string;
|
|
315
407
|
author?: string;
|
|
408
|
+
publishedBy?: string;
|
|
409
|
+
amendedAt?: string;
|
|
316
410
|
}
|
|
317
411
|
export interface ForkRef {
|
|
318
412
|
variant: string;
|
|
319
413
|
version: number;
|
|
320
414
|
}
|
|
415
|
+
export interface CopyRef {
|
|
416
|
+
design: string;
|
|
417
|
+
state: string | null;
|
|
418
|
+
variant: string;
|
|
419
|
+
version: number;
|
|
420
|
+
}
|
|
321
421
|
export interface Post {
|
|
322
422
|
id: string;
|
|
323
423
|
sessionId: string;
|
|
324
|
-
|
|
424
|
+
design: string;
|
|
325
425
|
state: string | null;
|
|
326
426
|
variant: string;
|
|
327
427
|
status: PostStatus;
|
|
@@ -332,18 +432,24 @@ export interface Post {
|
|
|
332
432
|
version: number;
|
|
333
433
|
history: PostVersion[];
|
|
334
434
|
knobs?: Knobs;
|
|
335
|
-
|
|
435
|
+
description?: string;
|
|
336
436
|
embeds: Embed[];
|
|
337
437
|
forkedFrom?: ForkRef;
|
|
338
|
-
|
|
438
|
+
copiedFrom?: CopyRef;
|
|
339
439
|
acceptedVersion?: number;
|
|
340
440
|
hiddenVersions?: number[];
|
|
441
|
+
archiveReason?: string;
|
|
442
|
+
archivedAt?: string;
|
|
443
|
+
stayedVersion?: number;
|
|
341
444
|
from?: number;
|
|
342
445
|
prompt?: string;
|
|
343
446
|
author?: string;
|
|
447
|
+
publishedBy?: string;
|
|
448
|
+
amendedAt?: string;
|
|
449
|
+
rewrites?: number;
|
|
344
450
|
}
|
|
345
451
|
export interface FlowStep {
|
|
346
|
-
|
|
452
|
+
design: string;
|
|
347
453
|
state: string | null;
|
|
348
454
|
}
|
|
349
455
|
export interface Flow {
|
|
@@ -354,14 +460,36 @@ export interface Flow {
|
|
|
354
460
|
updatedAt: string;
|
|
355
461
|
}
|
|
356
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
|
+
}
|
|
357
485
|
export interface ProjectSummary {
|
|
358
486
|
name: string;
|
|
359
|
-
|
|
487
|
+
designs: number;
|
|
360
488
|
open: number;
|
|
361
489
|
lastActiveAt: string;
|
|
362
490
|
sessions: number;
|
|
363
491
|
}
|
|
364
|
-
export interface
|
|
492
|
+
export interface DesignSystem {
|
|
365
493
|
detected: {
|
|
366
494
|
tailwind: boolean;
|
|
367
495
|
shadcn: boolean;
|
|
@@ -463,7 +591,7 @@ export interface Comment {
|
|
|
463
591
|
id: string;
|
|
464
592
|
seq: number;
|
|
465
593
|
sessionId: string;
|
|
466
|
-
|
|
594
|
+
designId: string | null;
|
|
467
595
|
postId: string | null;
|
|
468
596
|
author: string;
|
|
469
597
|
text: string;
|
|
@@ -501,55 +629,70 @@ export interface CreateSessionInput {
|
|
|
501
629
|
project?: string;
|
|
502
630
|
key?: string;
|
|
503
631
|
}
|
|
504
|
-
export interface
|
|
632
|
+
export interface CreateDesignInput {
|
|
505
633
|
project: string;
|
|
506
634
|
slug: string;
|
|
507
635
|
title?: string;
|
|
508
|
-
kind?:
|
|
636
|
+
kind?: DesignKind;
|
|
637
|
+
area?: string | null;
|
|
638
|
+
source?: string | null;
|
|
509
639
|
states?: string[];
|
|
510
640
|
knobs?: Knobs;
|
|
511
641
|
widths?: number[];
|
|
512
642
|
sessionId?: string | null;
|
|
643
|
+
shortlist?: boolean;
|
|
513
644
|
}
|
|
514
|
-
export interface
|
|
645
|
+
export interface UpdateDesignInput {
|
|
515
646
|
title?: string;
|
|
516
|
-
kind?:
|
|
647
|
+
kind?: DesignKind;
|
|
648
|
+
area?: string | null;
|
|
649
|
+
source?: string | null;
|
|
517
650
|
states?: string[];
|
|
518
651
|
asks?: Ask[];
|
|
519
652
|
knobs?: Knobs;
|
|
520
653
|
widths?: number[];
|
|
521
654
|
sessionId?: string | null;
|
|
522
|
-
|
|
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[];
|
|
523
662
|
}
|
|
524
663
|
export interface CreatePostInput {
|
|
525
664
|
sessionId: string;
|
|
526
|
-
|
|
665
|
+
design: string;
|
|
527
666
|
state: string | null;
|
|
528
667
|
variant?: string;
|
|
529
668
|
title?: string;
|
|
530
669
|
surfaces: Surface[];
|
|
531
670
|
knobs?: Knobs;
|
|
532
|
-
|
|
671
|
+
description?: string;
|
|
533
672
|
embeds?: Embed[];
|
|
534
673
|
forkedFrom?: ForkRef;
|
|
674
|
+
copiedFrom?: CopyRef;
|
|
535
675
|
from?: number;
|
|
536
676
|
prompt?: string;
|
|
537
677
|
author?: string;
|
|
678
|
+
publishedBy?: string;
|
|
538
679
|
}
|
|
539
680
|
export interface UpdatePostInput {
|
|
540
681
|
title?: string;
|
|
541
682
|
surfaces?: Surface[];
|
|
542
683
|
knobs?: Knobs | null;
|
|
543
|
-
|
|
684
|
+
description?: string;
|
|
544
685
|
embeds?: Embed[];
|
|
545
686
|
from?: number;
|
|
546
687
|
prompt?: string;
|
|
547
688
|
author?: string;
|
|
548
689
|
state?: string | null;
|
|
690
|
+
publishedBy?: string;
|
|
549
691
|
}
|
|
692
|
+
export type AmendPostInput = Omit<UpdatePostInput, "state" | "publishedBy">;
|
|
550
693
|
export interface CreateCommentInput {
|
|
551
694
|
sessionId: string;
|
|
552
|
-
|
|
695
|
+
designId?: string | null;
|
|
553
696
|
postId?: string | null;
|
|
554
697
|
author: string;
|
|
555
698
|
text: string;
|
|
@@ -562,12 +705,24 @@ export interface CreateCommentInput {
|
|
|
562
705
|
}
|
|
563
706
|
export interface CommentQuery {
|
|
564
707
|
sessionId?: string;
|
|
565
|
-
|
|
708
|
+
designId?: string;
|
|
566
709
|
postId?: string;
|
|
567
710
|
afterSeq?: number;
|
|
568
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
|
+
}
|
|
569
724
|
export interface CommitReplyInput {
|
|
570
|
-
|
|
725
|
+
designId: string;
|
|
571
726
|
sessionId: string;
|
|
572
727
|
text: string;
|
|
573
728
|
payload: Reply;
|
|
@@ -577,12 +732,13 @@ export interface CommitReplyInput {
|
|
|
577
732
|
version: number;
|
|
578
733
|
}[];
|
|
579
734
|
archive: string[];
|
|
580
|
-
|
|
581
|
-
|
|
735
|
+
release?: string[];
|
|
736
|
+
standings?: Record<string, AnswerStanding>;
|
|
582
737
|
keepDraft?: true;
|
|
738
|
+
owner?: string;
|
|
583
739
|
}
|
|
584
740
|
export interface PostQuery {
|
|
585
|
-
|
|
741
|
+
designId?: string;
|
|
586
742
|
sessionId?: string;
|
|
587
743
|
}
|
|
588
744
|
export interface Store {
|
|
@@ -598,25 +754,42 @@ export interface Store {
|
|
|
598
754
|
getSetting(key: string): Promise<string | null>;
|
|
599
755
|
setSetting(key: string, value: string): Promise<void>;
|
|
600
756
|
listProjects(): Promise<ProjectSummary[]>;
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
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>;
|
|
766
|
+
renameProject(from: string, to: string): Promise<boolean>;
|
|
607
767
|
listFlows(project: string): Promise<Flow[]>;
|
|
608
768
|
placeFlowStep(project: string, name: string, screen: FlowStep, step: number): Promise<Flow | null>;
|
|
609
|
-
putDraft(
|
|
769
|
+
putDraft(designId: string, draft: Draft | null): Promise<Design | null>;
|
|
610
770
|
listPosts(query?: PostQuery): Promise<Post[]>;
|
|
771
|
+
listPostHeads(project?: string): Promise<PostHead[]>;
|
|
772
|
+
listCopies(project: string): Promise<LiveCopy[]>;
|
|
611
773
|
countPostsBySession(): Promise<Map<string, number>>;
|
|
612
774
|
getPost(id: string): Promise<Post | null>;
|
|
613
|
-
|
|
775
|
+
setForkedFrom(id: string, from: ForkRef | null): Promise<Post | null>;
|
|
776
|
+
findPost(designId: string, state: string | null, variant: string): Promise<Post | null>;
|
|
614
777
|
createPost(input: CreatePostInput): Promise<Post | null>;
|
|
615
778
|
updatePost(id: string, patch: UpdatePostInput): Promise<Post | null>;
|
|
616
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>;
|
|
617
785
|
setPostStatus(id: string, status: PostStatus, acceptedVersion?: number): Promise<Post | null>;
|
|
618
|
-
|
|
786
|
+
bumpRewrites(designId: string): Promise<void>;
|
|
787
|
+
setPostArchived(id: string, archivedAt: string, reason: string | null): Promise<Post | null>;
|
|
619
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>;
|
|
620
793
|
listComments(query: CommentQuery): Promise<Comment[]>;
|
|
621
794
|
createComment(input: CreateCommentInput): Promise<Comment | null>;
|
|
622
795
|
removeComment(id: string): Promise<Comment | null>;
|
|
@@ -637,6 +810,25 @@ export interface SqlStorage {
|
|
|
637
810
|
exec(query: string, ...bindings: SqlStorageValue[]): SqlStorageCursor;
|
|
638
811
|
transactionSync?<T>(fn: () => T): T;
|
|
639
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
|
+
}
|
|
640
832
|
export declare const HISTORY_LIMIT = 20;
|
|
641
833
|
export declare function reservedAgent(name: string): string;
|
|
642
834
|
export declare function stripNul<T extends string | null | undefined>(s: T): T;
|
|
@@ -652,28 +844,18 @@ export declare const DEFAULT_VARIANT = "default";
|
|
|
652
844
|
export declare function slugify(input: string): string;
|
|
653
845
|
export declare function projectFromCwd(cwd: string | null | undefined): string | null;
|
|
654
846
|
export declare const htmlSurface: (html: string, kits?: unknown) => HtmlSurface;
|
|
655
|
-
export declare const askAnswered: (a: Pick<Ask, "answer" | "other" | "
|
|
656
|
-
export declare const openAsks: (
|
|
657
|
-
export declare
|
|
658
|
-
|
|
659
|
-
}, posts: Pick<Post, "mock" | "state" | "variant" | "status">[], mockId: string): string[];
|
|
660
|
-
export declare const builtinAskCount: (mock: Pick<Mock, "asks" | "states"> & {
|
|
661
|
-
resolvedAt?: string | null;
|
|
662
|
-
}, posts: Pick<Post, "mock" | "state" | "variant" | "status">[], mockId: string) => number;
|
|
663
|
-
export declare const openCount: (mock: Pick<Mock, "id" | "asks" | "states"> & {
|
|
664
|
-
resolvedAt?: string | null;
|
|
665
|
-
}, posts: Pick<Post, "mock" | "state" | "variant" | "status">[]) => number;
|
|
666
|
-
export declare function draftedCount(mock: Pick<Mock, "id" | "asks" | "states" | "draft"> & {
|
|
667
|
-
resolvedAt?: string | null;
|
|
668
|
-
}, 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;
|
|
669
851
|
export declare const BUILTIN_ASK_ID = "variant";
|
|
670
|
-
export declare function builtinAsk(
|
|
671
|
-
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[];
|
|
672
854
|
export declare function surfacesByteLength(surfaces: Surface[]): number;
|
|
673
855
|
export declare function collectAssetIds(surfaces: Surface[], out: Set<string>): void;
|
|
674
856
|
export declare function collectAttachedIds(holder: {
|
|
675
857
|
otherImages?: unknown;
|
|
676
|
-
|
|
858
|
+
askCommentImages?: unknown;
|
|
677
859
|
} | null | undefined, out: Set<string>): void;
|
|
678
860
|
export interface EvictionCandidate {
|
|
679
861
|
id: string;
|
|
@@ -682,3 +864,4 @@ export interface EvictionCandidate {
|
|
|
682
864
|
referenced: boolean;
|
|
683
865
|
}
|
|
684
866
|
export declare function selectEvictions(candidates: EvictionCandidate[], incomingBytes: number, budget: number): string[];
|
|
867
|
+
export {};
|