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.
- package/README.md +59 -223
- package/bin/demoData.js +2 -2
- package/bin/initDesign.js +17 -22
- package/bin/mockpit.js +626 -216
- package/bin/poster.js +434 -0
- package/dist/mcp/server.js +127 -29
- package/dist/server/answerAdditions.d.ts +7 -0
- package/dist/server/answerAdditions.js +76 -0
- package/dist/server/apiViews.d.ts +627 -385
- package/dist/server/apiViews.js +198 -81
- package/dist/server/app.d.ts +7 -2
- package/dist/server/app.js +3514 -984
- 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 +640 -0
- package/dist/server/codeWorker.js +2 -2
- package/dist/server/contrast.d.ts +4 -0
- package/dist/server/contrast.js +157 -0
- package/dist/server/decisionList.d.ts +48 -0
- package/dist/server/decisionList.js +340 -0
- package/dist/server/decisions.d.ts +4 -4
- package/dist/server/decisions.js +9 -9
- package/dist/server/designGuide.d.ts +14 -7
- package/dist/server/designGuide.js +314 -88
- 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 +15 -6
- package/dist/server/feedbackBatch.d.ts +39 -13
- package/dist/server/feedbackBatch.js +129 -47
- package/dist/server/fills.d.ts +4 -0
- package/dist/server/fills.js +55 -1
- package/dist/server/guidance.d.ts +1 -1
- package/dist/server/guidance.js +2 -2
- 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/kits.d.ts +2 -2
- package/dist/server/kits.js +54 -1
- package/dist/server/knobs.d.ts +3 -3
- package/dist/server/knobs.js +6 -6
- package/dist/server/mcpHttp.d.ts +7 -1
- package/dist/server/mcpHttp.js +29 -12
- package/dist/server/mcpSpec.d.ts +27 -27
- package/dist/server/mcpSpec.js +196 -56
- package/dist/server/parts.js +9 -1
- package/dist/server/run.d.ts +1 -1
- package/dist/server/run.js +47 -17
- package/dist/server/runApi.d.ts +3 -3
- package/dist/server/runApi.js +34 -21
- package/dist/server/sqlStore.d.ts +148 -103
- package/dist/server/sqlStore.js +1052 -181
- package/dist/server/standings.d.ts +25 -0
- package/dist/server/standings.js +113 -0
- package/dist/server/surfacePage.d.ts +8 -9
- package/dist/server/surfacePage.js +423 -100
- package/dist/server/system.d.ts +234 -0
- package/dist/server/system.js +1508 -0
- package/dist/server/systemChecks.d.ts +15 -0
- package/dist/server/systemChecks.js +224 -0
- package/dist/server/systemSpecimen.d.ts +2 -0
- package/dist/server/systemSpecimen.js +49 -0
- package/dist/server/themes.d.ts +9 -7
- package/dist/server/themes.js +43 -90
- package/dist/server/types.d.ts +266 -93
- package/dist/server/types.js +76 -79
- package/extensions/mockpit.js +89 -72
- package/guide/AGENT_SETUP.md +15 -1
- package/guide/packs/design-craft.md +2 -3
- package/guide/packs/foundations.md +35 -0
- package/guide/topics/asks.md +108 -63
- package/guide/topics/feedback.md +129 -120
- package/guide/topics/html.md +18 -25
- package/guide/topics/http.md +43 -41
- package/guide/topics/knobs.md +7 -10
- package/guide/topics/scripts.md +22 -33
- package/guide/topics/surfaces.md +39 -48
- package/guide/topics/system.md +157 -0
- package/opencode/mockpit.js +120 -0
- package/opencode/package.json +8 -0
- package/package.json +15 -14
- package/skills/launch-video/SKILL.md +11 -11
- package/skills/mockpit/SKILL.md +33 -26
- package/viewer/dist/index.html +10 -9
package/dist/server/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
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: ("
|
|
62
|
-
export declare const NATIVE_SURFACE_KINDS: ("
|
|
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
|
|
201
|
-
export declare const
|
|
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
|
|
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: "
|
|
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
|
-
|
|
270
|
+
comment?: string;
|
|
233
271
|
otherImages?: string[];
|
|
234
|
-
|
|
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
|
-
|
|
321
|
+
askComments?: Record<string, string>;
|
|
275
322
|
otherImages?: Record<string, string[]>;
|
|
276
|
-
|
|
323
|
+
askCommentImages?: Record<string, string[]>;
|
|
277
324
|
updatedAt: string;
|
|
278
325
|
}
|
|
279
326
|
export interface Reply {
|
|
280
|
-
|
|
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
|
-
|
|
334
|
+
askComments?: Record<string, string>;
|
|
288
335
|
otherImages?: Record<string, string[]>;
|
|
289
|
-
|
|
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
|
-
|
|
351
|
+
archived?: {
|
|
293
352
|
dismissed: string[];
|
|
294
353
|
};
|
|
295
|
-
edited?:
|
|
354
|
+
edited?: DesignEdit;
|
|
355
|
+
system?: {
|
|
356
|
+
project: string;
|
|
357
|
+
rev: number;
|
|
358
|
+
changes: string[];
|
|
359
|
+
};
|
|
296
360
|
}
|
|
297
|
-
export interface
|
|
298
|
-
kind?:
|
|
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
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
446
|
+
description?: string;
|
|
359
447
|
embeds: Embed[];
|
|
360
448
|
forkedFrom?: ForkRef;
|
|
361
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
626
|
+
export interface CreateDesignInput {
|
|
528
627
|
project: string;
|
|
529
628
|
slug: string;
|
|
530
629
|
title?: string;
|
|
531
|
-
kind?:
|
|
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
|
|
639
|
+
export interface UpdateDesignInput {
|
|
540
640
|
title?: string;
|
|
541
|
-
kind?:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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" | "
|
|
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;
|
|
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(
|
|
700
|
-
export declare function summarizeProjects(
|
|
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
|
-
|
|
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 {};
|