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.
Files changed (77) hide show
  1. package/README.md +66 -202
  2. package/bin/demoData.js +5 -5
  3. package/bin/initDesign.js +6 -6
  4. package/bin/mockpit.js +687 -192
  5. package/bin/poster.js +377 -0
  6. package/dist/mcp/server.js +110 -19
  7. package/dist/server/answerAdditions.d.ts +7 -0
  8. package/dist/server/answerAdditions.js +76 -0
  9. package/dist/server/apiViews.d.ts +563 -41
  10. package/dist/server/apiViews.js +223 -74
  11. package/dist/server/app.d.ts +10 -2
  12. package/dist/server/app.js +3284 -782
  13. package/dist/server/appIcon.js +15 -5
  14. package/dist/server/appIconPng.js +3 -3
  15. package/dist/server/askNudges.js +1 -1
  16. package/dist/server/cdnInline.d.ts +8 -0
  17. package/dist/server/cdnInline.js +638 -0
  18. package/dist/server/codeWorker.js +2 -1
  19. package/dist/server/decisionList.d.ts +45 -0
  20. package/dist/server/decisionList.js +302 -0
  21. package/dist/server/decisions.d.ts +8 -8
  22. package/dist/server/decisions.js +18 -17
  23. package/dist/server/designGuide.d.ts +10 -6
  24. package/dist/server/designGuide.js +173 -78
  25. package/dist/server/embeds.d.ts +4 -1
  26. package/dist/server/embeds.js +57 -6
  27. package/dist/server/eventLog.d.ts +2 -2
  28. package/dist/server/eventLog.js +11 -11
  29. package/dist/server/events.d.ts +9 -6
  30. package/dist/server/feedbackBatch.d.ts +38 -16
  31. package/dist/server/feedbackBatch.js +121 -50
  32. package/dist/server/fills.d.ts +4 -0
  33. package/dist/server/fills.js +55 -1
  34. package/dist/server/guidance.d.ts +23 -0
  35. package/dist/server/guidance.js +71 -0
  36. package/dist/server/handoff.d.ts +4 -1
  37. package/dist/server/handoff.js +8 -2
  38. package/dist/server/icons.js +1 -1
  39. package/dist/server/index.js +49 -11
  40. package/dist/server/jump.d.ts +21 -0
  41. package/dist/server/jump.js +175 -0
  42. package/dist/server/knobs.d.ts +3 -3
  43. package/dist/server/knobs.js +6 -6
  44. package/dist/server/mcpHttp.d.ts +8 -1
  45. package/dist/server/mcpHttp.js +44 -7
  46. package/dist/server/mcpSpec.d.ts +2 -1
  47. package/dist/server/mcpSpec.js +172 -50
  48. package/dist/server/parts.js +9 -1
  49. package/dist/server/postSurfaces.js +3 -0
  50. package/dist/server/run.d.ts +1 -1
  51. package/dist/server/run.js +31 -17
  52. package/dist/server/runApi.d.ts +3 -3
  53. package/dist/server/runApi.js +34 -24
  54. package/dist/server/sqlStore.d.ts +117 -94
  55. package/dist/server/sqlStore.js +1089 -141
  56. package/dist/server/standings.d.ts +25 -0
  57. package/dist/server/standings.js +113 -0
  58. package/dist/server/surfacePage.d.ts +6 -9
  59. package/dist/server/surfacePage.js +361 -86
  60. package/dist/server/types.d.ts +252 -69
  61. package/dist/server/types.js +87 -69
  62. package/extensions/mockpit.js +245 -65
  63. package/guide/AGENT_SETUP.md +13 -1
  64. package/guide/packs/design-craft.md +34 -0
  65. package/guide/topics/asks.md +117 -69
  66. package/guide/topics/feedback.md +156 -119
  67. package/guide/topics/html.md +19 -32
  68. package/guide/topics/http.md +43 -40
  69. package/guide/topics/knobs.md +7 -10
  70. package/guide/topics/scripts.md +24 -35
  71. package/guide/topics/surfaces.md +50 -41
  72. package/opencode/mockpit.js +120 -0
  73. package/opencode/package.json +8 -0
  74. package/package.json +4 -6
  75. package/skills/launch-video/SKILL.md +12 -12
  76. package/skills/mockpit/SKILL.md +35 -23
  77. package/viewer/dist/index.html +9 -8
@@ -2,13 +2,13 @@
2
2
  // tool description, the scripts guide topic and `mockpit run --help`, so the
3
3
  // tiers cannot describe different APIs. Hand-shaped rather than generated from
4
4
  // mcpSpec: a generator repeats Surface per tool and the run-level params on
5
- // every function, roughly tripling the size. test/run.test.ts checks that every
6
- // host function named here exists and vice versa.
5
+ // every function, roughly tripling the size. Every host function named here
6
+ // must exist, and vice versa.
7
7
  export const RUN_API = `// The body of an async function, in plain JavaScript (no TypeScript syntax).
8
8
  // \`await mockpit.*\`, \`return\` a JSON value, print() adds an output line.
9
9
  // No network, timers, imports or process. Session, project and agent are fixed
10
10
  // for the run; pass the returned session to the next run.
11
- type Ref = { mock: string; state?: string; variant?: string };
11
+ type Ref = { design: string; state?: string; variant?: string };
12
12
  type Knobs = Record<string, unknown>; // path → [default,min,max,step] | boolean | {type:"select",options} | "#hex"
13
13
  type Surface =
14
14
  | { kind: "html"; html: string; kits?: string[] }
@@ -20,35 +20,43 @@ type Surface =
20
20
  | { kind: "json"; data: unknown; title?: string }
21
21
  | { kind: "code"; code: string; language?: string; lineStart?: number };
22
22
  type Ask = {
23
- id?: string; text: string; scope?: "mock" | "state" | "part"; state?: string; part?: string; multi?: boolean;
24
- options: { id?: string; label: string; variant?: string; set?: Knobs }[];
23
+ id?: string; text: string; scope?: "design" | "state" | "part"; state?: string; part?: string; multi?: boolean;
24
+ options: { id?: string; label: string; variant?: string; set?: Knobs; recommended?: boolean }[];
25
25
  };
26
26
  type Written = {
27
- post: { state: string | null; variant: string; version: number }; url: string;
28
- parts: { state: string | null; parts: { name: string }[] }[];
27
+ post?: { state: string | null; variant: string; version: number }; planned?: true; url: string;
28
+ parts?: { state: string | null; parts: { name: string }[] }[];
29
29
  partChanges?: { vanished: string[]; renamed: { from: string; to: string }[] };
30
- nudges?: string[]; suggestedAsk?: Ask; // send it with ask when nudged
30
+ nudges?: string[]; suggestedAsk?: Ask; suggestedFillAsks?: Ask[]; // send with ask when nudged
31
31
  };
32
32
  type Feedback = {
33
- mock: string | null;
34
- reply: null | { asks: { ask: string; chosen: { id: string; label: string; other?: true }[]; note?: string }[]; mix: Knobs; tuned: Knobs; comments: { part: string | null; text: string }[] };
35
- comments: { text: string; state: string | null; variant: string | null }[];
36
- accepted: { state: string | null; variant: string }[]; archived: { state: string | null; variant: string }[];
33
+ design: string | null;
34
+ reply: null | { asks: { ask: string; chosen: { id: string; label: string; other?: true }[]; comment?: string }[]; borrowed: Record<string, string>; tuned: Knobs; comments: { part: string | null; text: string }[]; verdict?: { kind: "use" | "revise"; state: string | null; variant: string; version?: number } };
35
+ messages: { text: string; state: string | null; variant: string | null }[];
36
+ inUse: { state: string | null; variant: string; version: number }[]; archived: { state: string | null; variant: string }[];
37
37
  };
38
- type Pending = { mock: string; viewerOpen: boolean; draft: null | { answered: number; of: number; comments: number; touchedAt: string } };
38
+ type Pending = { design: string; archived?: true; viewerOpen: boolean; draft: null | { answered: number; of: number; comments: number; touchedAt: string } };
39
39
  declare const mockpit: {
40
40
  guide(topic?: "knobs" | "asks" | "surfaces" | "html" | "feedback" | "http" | "scripts"): Promise<string>;
41
- /** No mock: every mock, the flows, plus pending. With one: its states, variants, asks, parts, knobs. */
42
- read(mock?: string, opts?: { body?: boolean; history?: boolean }): Promise<unknown>;
43
- /** Creates or versions (mock, state, variant). One of: html; surfaces, the full ordered list
41
+ /** Read first: decisionList is what the user already settled; it stands unless they say otherwise.
42
+ * No design: every design, the flows, plus pending. With one: its states, variants, asks, parts, knobs.
43
+ * opts.decisions: only the whole list, when a read cut it. */
44
+ read(design?: string, opts?: { body?: boolean; history?: boolean; decisions?: boolean }): Promise<unknown>;
45
+ /** Creates or versions (design, state, variant). One of: html; surfaces, the full ordered list
44
46
  * ({id} alone keeps that surface, a missing id is removed); parts {"name"|"name#key": outer html};
45
- * fills {"part#fill": outer html}, replacing or adding one alternative of a slot. */
46
- publish(v: Ref & { title?: string; kind?: "component" | "page"; html?: string; surfaces?: (Surface | { id: string })[]; parts?: Record<string, string>; fills?: Record<string, string>; knobs?: Knobs; variantKnobs?: Knobs; from?: number; prompt?: string; note?: string; widths?: number[]; flow?: string; step?: number }): Promise<Written>;
47
- ask(mock: string, asks: Ask[]): Promise<{ asks: { id: string; text: string }[]; url: string; nudges?: string[] }>;
47
+ * fills {"part#fill": outer html}, replacing or adding one fill of a part.
48
+ * None of them, with kind screen or component: plans it, for a later publish to draw. */
49
+ publish(v: Ref & { title?: string; kind?: "screen" | "component" | "idea"; area?: string; source?: string; html?: string; poster?: string; surfaces?: (Surface | { id: string })[]; parts?: Record<string, string>; fills?: Record<string, string>; knobs?: Knobs; variantKnobs?: Knobs; from?: number; prompt?: string; description?: string; widths?: number[]; flow?: string; step?: number }): Promise<Written>;
50
+ ask(design: string, asks: Ask[]): Promise<{ asks: { id: string; text: string }[]; url: string; nudges?: string[] }>;
48
51
  /** Never waits: what the user sent since you last heard, and what they are doing now. */
49
52
  feedback(): Promise<{ feedback: Feedback[]; pending: Pending[] }>;
50
53
  say(v: Ref, message: string): Promise<void>;
51
- export(v: Ref): Promise<{ states: { state: string | null; variant: string; version: number; html: string }[]; reply: unknown }>;
54
+ /** to or toState moves variants there; archive hides them; restore brings them back. */
55
+ move(v: Ref & { variants: string[]; to?: string; toState?: string; archive?: boolean; restore?: boolean }): Promise<{ variants: { state: string | null; variant: string; status: string }[]; skipped: { variant: string; why: string }[]; url: string }>;
56
+ /** No new version; "" clears. { rename } or { areaOrder } without design edits the project.
57
+ * notes: a short plain-text spec; not applied over the user's own edit (notes.applied says). */
58
+ edit(v: { design?: string; slug?: string; title?: string; kind?: string; area?: string; source?: string; firstState?: string; notes?: string; rename?: string; areaOrder?: string[] }): Promise<{ url: string; notes?: { applied: boolean; text?: string } }>;
59
+ export(v: Ref): Promise<{ states: { state: string | null; variant: string; version: number; html: string; allFills?: string }[]; reply: unknown }>;
52
60
  /** data: base64 bytes. Use id as an image surface's assetId. */
53
61
  upload(data: string, opts: { contentType: string; filename?: string; kind?: "image" | "file" }): Promise<{ id: string; url: string }>;
54
62
  };
@@ -61,17 +69,19 @@ export const RUN_FUNCTIONS = [
61
69
  "ask",
62
70
  "feedback",
63
71
  "say",
72
+ "move",
73
+ "edit",
64
74
  "export",
65
75
  "upload",
66
76
  ];
67
77
  export const RUN_EXAMPLE = `const html = (tone) => \`<section data-part="hero" class="\${tone}"><h1>Writer</h1></section>\`;
68
- await mockpit.publish({ mock: "writer", variant: "calm", html: html("calm") });
69
- await mockpit.publish({ mock: "writer", variant: "bold", html: html("bold") });
70
- const { url } = await mockpit.ask("writer", [{ id: "look", text: "Which look?",
78
+ await mockpit.publish({ design: "writer", variant: "calm", html: html("calm") });
79
+ await mockpit.publish({ design: "writer", variant: "bold", html: html("bold") });
80
+ const { url } = await mockpit.ask("writer", [{ id: "tone", text: "Calm or bold?",
71
81
  options: [{ label: "Calm", variant: "calm" }, { label: "Bold", variant: "bold" }] }]);
72
82
  // Tell the user where to look and end the turn; a later run reads mockpit.feedback().
73
83
  return url;`;
74
- export const RUN_DESCRIPTION = "Run a script against mockpit, which shows design work to the user (project > mock > state > " +
84
+ export const RUN_DESCRIPTION = "Run a script against mockpit, which shows design work to the user (project > design > state > " +
75
85
  "variant > version). Publish variants and ask in one call; nothing waits for the user. Returns " +
76
86
  "value, prints, calls (every host call in order: which writes landed), error {kind, message, " +
77
87
  "line} and feedback (every batch received, even if the script failed). Read mockpit.guide() " +
@@ -1,13 +1,26 @@
1
- import { type Ask, type Asset, type Comment, type CommentQuery, type CommitReplyInput, type CreateAssetInput, type CreateCommentInput, type CreateMockInput, type CreatePostInput, type CreateSessionInput, type Draft, type Knobs, type Mock, type MockKind, type Post, type PostQuery, type PostStatus, type PostVersion, type Session, type Embed, type Flow, type FlowStep, type ForkRef, type SqlStorage, type Store, type Surface, type UpdateMockInput, type UpdatePostInput } from "./types.ts";
1
+ import { type Ask, type JumpRows, type DesignKind, type Asset, type Comment, type CommentQuery, type CommitReplyInput, type CreateAssetInput, type CreateCommentInput, type CreateDesignInput, type CreatePostInput, type CreateSessionInput, type Draft, type Knobs, type Design, type DesignNotes, type AnswerAddition, type AnswerSet, type AnswerStanding, type StateOutline, type Post, type CopyRef, type LiveCopy, type PostHead, type PostQuery, type PostStatus, type PostVersion, type Session, type Embed, type Flow, type FlowStep, type ForkRef, type SqlStorage, type Store, type Surface, type UpdateDesignInput, type UpdatePostInput, type AmendPostInput, type DecisionVariant } from "./types.ts";
2
+ import type { Mode } from "./themes.ts";
2
3
  export declare class SqlStore implements Store {
3
4
  private sql;
4
5
  private assetRefCache;
5
- constructor(sql: SqlStorage);
6
+ private postCache;
7
+ private postCacheBytes;
8
+ private postCacheLimit;
9
+ private raw;
10
+ private holdPostDrop;
11
+ constructor(sql: SqlStorage, opts?: {
12
+ postCacheBytes?: number;
13
+ });
6
14
  private atomic;
7
15
  private tables;
8
16
  private columns;
9
17
  private addMissing;
18
+ private migrateToDesignWords;
19
+ private migrateAskScopeWord;
20
+ private renameMocksToDesigns;
10
21
  private migrate;
22
+ private migrateSituations;
23
+ private migrateToContractTerms;
11
24
  private createIndexes;
12
25
  private migrateLegacy;
13
26
  private migrateToSurfaces;
@@ -15,14 +28,15 @@ export declare class SqlStore implements Store {
15
28
  private migrateSurfaceIds;
16
29
  private migrateToItems;
17
30
  private migrateToVersions;
18
- private migrateToMocks;
31
+ private migrateToDesigns;
32
+ private migrateToSketches;
19
33
  private settingSync;
20
34
  private insertVersion;
21
35
  private rowToVersion;
22
36
  private historiesFor;
23
37
  private rowsToPosts;
24
38
  private rowToSession;
25
- private rowToMock;
39
+ private rowToDesign;
26
40
  private rowToPost;
27
41
  private rowToAsset;
28
42
  private rowToComment;
@@ -39,39 +53,60 @@ export declare class SqlStore implements Store {
39
53
  getSetting(key: string): Promise<string | null>;
40
54
  setSetting(key: string, value: string): Promise<void>;
41
55
  listProjects(): Promise<import("./types.ts").ProjectSummary[]>;
42
- listMocks(project?: string): Promise<Mock[]>;
43
- getMock(id: string): Promise<Mock | null>;
44
- findMock(project: string, slug: string): Promise<Mock | null>;
45
- createMock(input: CreateMockInput): Promise<Mock>;
46
- updateMock(id: string, patch: UpdateMockInput): Promise<Mock | null>;
47
- removeMock(id: string): Promise<boolean>;
56
+ listJumpRows(): Promise<JumpRows>;
57
+ listDesigns(project?: string): Promise<Design[]>;
58
+ getDesign(id: string): Promise<Design | null>;
59
+ findDesign(project: string, slug: string): Promise<Design | null>;
60
+ createDesign(input: CreateDesignInput): Promise<Design>;
61
+ updateDesign(id: string, patch: UpdateDesignInput): Promise<Design | null>;
62
+ removeDesign(id: string): Promise<boolean>;
63
+ nameFirstState(id: string, state: string): Promise<Design | null>;
64
+ renameDesign(id: string, slug: string): Promise<Design | null>;
65
+ renameProject(from: string, to: string): Promise<boolean>;
48
66
  private flowsOf;
49
67
  private writeFlow;
50
68
  listFlows(project: string): Promise<Flow[]>;
51
69
  placeFlowStep(project: string, name: string, screen: FlowStep, step: number): Promise<Flow | null>;
52
- putDraft(mockId: string, draft: Draft | null): Promise<{
70
+ putDraft(designId: string, draft: Draft | null): Promise<{
53
71
  draft: Draft | null;
54
72
  id: string;
55
73
  project: string;
56
74
  slug: string;
57
75
  title: string;
58
- kind: MockKind;
76
+ kind: DesignKind;
77
+ area: string | null;
78
+ source: string | null;
59
79
  states: string[];
60
80
  asks: Ask[];
61
81
  knobs: Knobs;
62
82
  widths: number[];
63
83
  sessionId: string | null;
64
- resolvedAt: string | null;
84
+ shortlist: boolean;
85
+ archivedAt: string | null;
86
+ archiveReason: string | null;
87
+ notes: DesignNotes | null;
88
+ stateOutlines: Record<string, StateOutline>;
89
+ answerAdditions: AnswerAddition[];
90
+ standings: Record<string, AnswerStanding>;
91
+ sets: AnswerSet[];
65
92
  createdAt: string;
66
93
  updatedAt: string;
67
94
  } | null>;
68
- private touchMock;
95
+ private touchDesign;
69
96
  listPosts(query?: PostQuery): Promise<Post[]>;
97
+ listPostHeads(project?: string): Promise<PostHead[]>;
98
+ listCopies(project: string): Promise<LiveCopy[]>;
99
+ private postsOfDesign;
100
+ private trimPostCache;
101
+ private writingPosts;
102
+ private cachedPost;
103
+ private recache;
70
104
  countPostsBySession(): Promise<Map<string, number>>;
71
105
  getPost(id: string): Promise<Post | null>;
72
- findPost(mockId: string, state: string | null, variant: string): Promise<Post | null>;
106
+ findPost(designId: string, state: string | null, variant: string): Promise<Post | null>;
73
107
  createPost(input: CreatePostInput): Promise<Post | null>;
74
108
  updatePost(id: string, patch: UpdatePostInput): Promise<{
109
+ publishedBy?: string | undefined;
75
110
  author?: string | undefined;
76
111
  embeds: Embed[];
77
112
  state: string | null;
@@ -80,119 +115,107 @@ export declare class SqlStore implements Store {
80
115
  history: PostVersion[];
81
116
  from: number;
82
117
  prompt: string;
83
- note?: string | undefined;
118
+ description?: string | undefined;
84
119
  knobs?: Knobs | undefined;
85
120
  title: string;
86
121
  surfaces: Surface[];
87
122
  id: string;
88
123
  sessionId: string;
89
- mock: string;
124
+ design: string;
90
125
  variant: string;
91
126
  status: PostStatus;
92
127
  createdAt: string;
93
128
  forkedFrom?: ForkRef;
94
- starred?: true;
129
+ copiedFrom?: CopyRef;
95
130
  acceptedVersion?: number;
96
131
  hiddenVersions?: number[];
132
+ archiveReason?: string;
133
+ archivedAt?: string;
134
+ stayedVersion?: number;
135
+ rewrites?: number;
97
136
  } | null>;
98
- removePost(id: string): Promise<boolean>;
99
- setPostStatus(id: string, status: PostStatus, acceptedVersion?: number): Promise<{
100
- status: PostStatus;
101
- id: string;
102
- sessionId: string;
103
- mock: string;
104
- state: string | null;
105
- variant: string;
106
- title: string;
107
- surfaces: Surface[];
108
- createdAt: string;
109
- updatedAt: string;
110
- version: number;
111
- history: PostVersion[];
112
- knobs?: Knobs;
113
- note?: string;
137
+ amendPost(id: string, version: number, patch: AmendPostInput): Promise<{
138
+ amendedAt: string;
139
+ rewrites: number;
140
+ author?: string | undefined;
141
+ prompt?: string | undefined;
142
+ from?: number | undefined;
114
143
  embeds: Embed[];
115
- forkedFrom?: ForkRef;
116
- starred?: true;
117
- hiddenVersions?: number[];
118
- from?: number;
119
- prompt?: string;
120
- author?: string;
121
- } | {
122
- status: PostStatus;
123
- acceptedVersion: number;
124
- id: string;
125
- sessionId: string;
126
- mock: string;
127
- state: string | null;
128
- variant: string;
144
+ description?: string | undefined;
145
+ knobs?: Knobs | undefined;
129
146
  title: string;
130
147
  surfaces: Surface[];
131
- createdAt: string;
132
- updatedAt: string;
133
- version: number;
134
- history: PostVersion[];
135
- knobs?: Knobs;
136
- note?: string;
137
- embeds: Embed[];
138
- forkedFrom?: ForkRef;
139
- starred?: true;
140
- hiddenVersions?: number[];
141
- from?: number;
142
- prompt?: string;
143
- author?: string;
144
- } | null>;
145
- setPostStarred(id: string, starred: boolean): Promise<{
146
148
  id: string;
147
149
  sessionId: string;
148
- mock: string;
150
+ design: string;
149
151
  state: string | null;
150
152
  variant: string;
151
153
  status: PostStatus;
152
- title: string;
153
- surfaces: Surface[];
154
154
  createdAt: string;
155
155
  updatedAt: string;
156
156
  version: number;
157
157
  history: PostVersion[];
158
- knobs?: Knobs;
159
- note?: string;
160
- embeds: Embed[];
161
158
  forkedFrom?: ForkRef;
159
+ copiedFrom?: CopyRef;
162
160
  acceptedVersion?: number;
163
161
  hiddenVersions?: number[];
164
- from?: number;
165
- prompt?: string;
166
- author?: string;
162
+ archiveReason?: string;
163
+ archivedAt?: string;
164
+ stayedVersion?: number;
165
+ publishedBy?: string;
166
+ } | null>;
167
+ setPosterOnce(id: string, version: number, poster: string, mode?: Mode): Promise<boolean>;
168
+ withdrawVersion(id: string, version: number, embeds: Embed[]): Promise<{
169
+ post: null;
167
170
  } | {
168
- starred: true;
169
- id: string;
170
- sessionId: string;
171
- mock: string;
172
- state: string | null;
173
- variant: string;
174
- status: PostStatus;
175
- title: string;
176
- surfaces: Surface[];
177
- createdAt: string;
178
- updatedAt: string;
179
- version: number;
180
- history: PostVersion[];
181
- knobs?: Knobs;
182
- note?: string;
183
- embeds: Embed[];
184
- forkedFrom?: ForkRef;
185
- acceptedVersion?: number;
186
- hiddenVersions?: number[];
187
- from?: number;
188
- prompt?: string;
189
- author?: string;
171
+ post: {
172
+ rewrites: number;
173
+ hiddenVersions?: number[] | undefined;
174
+ amendedAt?: string | undefined;
175
+ publishedBy?: string | undefined;
176
+ author?: string | undefined;
177
+ prompt?: string | undefined;
178
+ from?: number | undefined;
179
+ title: string;
180
+ surfaces: Surface[];
181
+ embeds: Embed[];
182
+ updatedAt: string;
183
+ version: number;
184
+ history: PostVersion[];
185
+ id: string;
186
+ sessionId: string;
187
+ design: string;
188
+ state: string | null;
189
+ variant: string;
190
+ status: PostStatus;
191
+ createdAt: string;
192
+ knobs?: Knobs;
193
+ description?: string;
194
+ forkedFrom?: ForkRef;
195
+ copiedFrom?: CopyRef;
196
+ acceptedVersion?: number;
197
+ archiveReason?: string;
198
+ archivedAt?: string;
199
+ stayedVersion?: number;
200
+ };
190
201
  } | null>;
202
+ removePost(id: string): Promise<boolean>;
203
+ setPostStatus(id: string, status: PostStatus, acceptedVersion?: number): Promise<Post | null>;
204
+ setPostArchived(id: string, archivedAt: string, reason: string | null): Promise<Post | null>;
205
+ setForkedFrom(id: string, from: ForkRef | null): Promise<Post | null>;
206
+ bumpRewrites(designId: string): Promise<void>;
191
207
  setVersionHidden(id: string, version: number, hidden: boolean): Promise<Post | null>;
208
+ deleteOldVersions(id: string, versions: number[]): Promise<Post | null>;
209
+ setPostReason(id: string, reason: string | null): Promise<Post | null>;
210
+ setPostStayed(id: string, version: number): Promise<Post | null>;
192
211
  listComments(query: CommentQuery): Promise<Comment[]>;
193
212
  private insertComment;
194
213
  createComment(input: CreateCommentInput): Promise<Comment | null>;
195
214
  removeComment(id: string): Promise<Comment | null>;
215
+ listDecisionSources(project: string): Promise<{
216
+ variants: DecisionVariant[];
217
+ decidedAt: Record<string, string>;
218
+ }>;
196
219
  commitReply(input: CommitReplyInput): Promise<Comment | null>;
197
220
  private referencedAssetIds;
198
221
  private addAssetRefs;