@conciv/protocol 0.0.1

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 (49) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +5 -0
  3. package/dist/bundler-types.d.ts +37 -0
  4. package/dist/bundler-types.d.ts.map +1 -0
  5. package/dist/bundler-types.js +9 -0
  6. package/dist/bundler-types.js.map +1 -0
  7. package/dist/chat-types.d.ts +250 -0
  8. package/dist/chat-types.d.ts.map +1 -0
  9. package/dist/chat-types.js +127 -0
  10. package/dist/chat-types.js.map +1 -0
  11. package/dist/config-types.d.ts +44 -0
  12. package/dist/config-types.d.ts.map +1 -0
  13. package/dist/config-types.js +8 -0
  14. package/dist/config-types.js.map +1 -0
  15. package/dist/done-types.d.ts +14 -0
  16. package/dist/done-types.d.ts.map +1 -0
  17. package/dist/done-types.js +13 -0
  18. package/dist/done-types.js.map +1 -0
  19. package/dist/editor-types.d.ts +11 -0
  20. package/dist/editor-types.d.ts.map +1 -0
  21. package/dist/editor-types.js +10 -0
  22. package/dist/editor-types.js.map +1 -0
  23. package/dist/harness-types.d.ts +138 -0
  24. package/dist/harness-types.d.ts.map +1 -0
  25. package/dist/harness-types.js +8 -0
  26. package/dist/harness-types.js.map +1 -0
  27. package/dist/page-introspect-types.d.ts +55 -0
  28. package/dist/page-introspect-types.d.ts.map +1 -0
  29. package/dist/page-introspect-types.js +1 -0
  30. package/dist/page-types.d.ts +222 -0
  31. package/dist/page-types.d.ts.map +1 -0
  32. package/dist/page-types.js +163 -0
  33. package/dist/page-types.js.map +1 -0
  34. package/dist/tool-timing.d.ts +14 -0
  35. package/dist/tool-timing.d.ts.map +1 -0
  36. package/dist/tool-timing.js +22 -0
  37. package/dist/tool-timing.js.map +1 -0
  38. package/dist/tool-view-types.d.ts +13794 -0
  39. package/dist/tool-view-types.d.ts.map +1 -0
  40. package/dist/tool-view-types.js +1 -0
  41. package/dist/ui-types.d.ts +118 -0
  42. package/dist/ui-types.d.ts.map +1 -0
  43. package/dist/ui-types.js +136 -0
  44. package/dist/ui-types.js.map +1 -0
  45. package/dist/usage-types.d.ts +24 -0
  46. package/dist/usage-types.d.ts.map +1 -0
  47. package/dist/usage-types.js +68 -0
  48. package/dist/usage-types.js.map +1 -0
  49. package/package.json +96 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 aidx contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # @conciv/protocol
2
+
3
+ Wire types shared by the conciv vite-plugin and widget.
4
+
5
+ Part of [conciv](https://github.com/conciv-dev/conciv).
@@ -0,0 +1,37 @@
1
+ //#region src/bundler-types.d.ts
2
+ type BundlerConfig = {
3
+ root: string;
4
+ base: string;
5
+ mode: string;
6
+ aliases: {
7
+ find: string;
8
+ replacement: string;
9
+ }[];
10
+ plugins: string[];
11
+ };
12
+ type ModuleNode = {
13
+ url: string;
14
+ importers: string[];
15
+ importedModules: string[];
16
+ };
17
+ type BundlerBridge = {
18
+ id: string;
19
+ config(): BundlerConfig;
20
+ resolve(spec: string, importer?: string): Promise<{
21
+ id: string | null;
22
+ }>;
23
+ moduleGraph(file: string): ModuleNode[];
24
+ transform(url: string): Promise<{
25
+ code: string | null;
26
+ }>;
27
+ urls(): {
28
+ local: string[];
29
+ network: string[];
30
+ };
31
+ reload(file: string): Promise<void>;
32
+ restart(force?: boolean): Promise<void>;
33
+ };
34
+ declare function defineBundlerBridge<T extends BundlerBridge>(bridge: T): T;
35
+ //#endregion
36
+ export { BundlerBridge, BundlerConfig, ModuleNode, defineBundlerBridge };
37
+ //# sourceMappingURL=bundler-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundler-types.d.ts","names":[],"sources":["../src/bundler-types.ts"],"mappings":";KAIY,aAAA;EACV,IAAA;EACA,IAAA;EACA,IAAA;EACA,OAAA;IAAU,IAAA;IAAc,WAAA;EAAA;EACxB,OAAA;AAAA;AAAA,KAGU,UAAA;EAAc,GAAA;EAAa,SAAA;EAAqB,eAAA;AAAA;AAAA,KAEhD,aAAA;EACV,EAAA;EACA,MAAA,IAAU,aAAA;EACV,OAAA,CAAQ,IAAA,UAAc,QAAA,YAAoB,OAAA;IAAS,EAAA;EAAA;EACnD,WAAA,CAAY,IAAA,WAAe,UAAA;EAC3B,SAAA,CAAU,GAAA,WAAc,OAAA;IAAS,IAAA;EAAA;EACjC,IAAA;IAAS,KAAA;IAAiB,OAAA;EAAA;EAC1B,MAAA,CAAO,IAAA,WAAe,OAAA;EACtB,OAAA,CAAQ,KAAA,aAAkB,OAAA;AAAA;AAAA,iBAGZ,mBAAA,WAA8B,aAAA,EAAe,MAAA,EAAQ,CAAA,GAAI,CAAA"}
@@ -0,0 +1,9 @@
1
+ //#region src/bundler-types.ts
2
+ function defineBundlerBridge(bridge) {
3
+ if (!bridge.id) throw new Error("bundler bridge: id is required");
4
+ return bridge;
5
+ }
6
+ //#endregion
7
+ export { defineBundlerBridge };
8
+
9
+ //# sourceMappingURL=bundler-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundler-types.js","names":[],"sources":["../src/bundler-types.ts"],"sourcesContent":["// How the agent inspects + drives the live dev server (`conciv tools server …`). These ops\n// are bundler-specific, so core consumes this interface and each bundler implements it in its\n// own plugin package (e.g. viteBridge in @conciv/plugin) — core never imports a bundler.\n\nexport type BundlerConfig = {\n root: string\n base: string\n mode: string\n aliases: {find: string; replacement: string}[]\n plugins: string[]\n}\n\nexport type ModuleNode = {url: string; importers: string[]; importedModules: string[]}\n\nexport type BundlerBridge = {\n id: string // 'vite' | 'webpack' | …\n config(): BundlerConfig\n resolve(spec: string, importer?: string): Promise<{id: string | null}>\n moduleGraph(file: string): ModuleNode[]\n transform(url: string): Promise<{code: string | null}>\n urls(): {local: string[]; network: string[]}\n reload(file: string): Promise<void>\n restart(force?: boolean): Promise<void>\n}\n\nexport function defineBundlerBridge<T extends BundlerBridge>(bridge: T): T {\n if (!bridge.id) throw new Error('bundler bridge: id is required')\n return bridge\n}\n"],"mappings":";AAyBA,SAAgB,oBAA6C,QAAc;CACzE,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,MAAM,gCAAgC;CAChE,OAAO;AACT"}
@@ -0,0 +1,250 @@
1
+ import { z } from "zod";
2
+ import { MessagePart, StreamChunk, UIMessage, UIMessage as UIMessage$1 } from "@tanstack/ai";
3
+
4
+ //#region src/chat-types.d.ts
5
+ declare const CONCIV_SESSION_HEADER = "conciv-session-id";
6
+ declare const ChatContentPartSchema: z.ZodObject<{
7
+ type: z.ZodString;
8
+ content: z.ZodOptional<z.ZodString>;
9
+ source: z.ZodOptional<z.ZodObject<{
10
+ type: z.ZodString;
11
+ mimeType: z.ZodOptional<z.ZodString>;
12
+ value: z.ZodString;
13
+ }, z.core.$loose>>;
14
+ }, z.core.$loose>;
15
+ declare const ChatMessageSchema: z.ZodObject<{
16
+ role: z.ZodString;
17
+ content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
18
+ type: z.ZodString;
19
+ content: z.ZodOptional<z.ZodString>;
20
+ source: z.ZodOptional<z.ZodObject<{
21
+ type: z.ZodString;
22
+ mimeType: z.ZodOptional<z.ZodString>;
23
+ value: z.ZodString;
24
+ }, z.core.$loose>>;
25
+ }, z.core.$loose>>]>>;
26
+ parts: z.ZodOptional<z.ZodArray<z.ZodObject<{
27
+ type: z.ZodString;
28
+ content: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$loose>>>;
30
+ }, z.core.$loose>;
31
+ declare const ChatRequestSchema: z.ZodObject<{
32
+ messages: z.ZodArray<z.ZodObject<{
33
+ role: z.ZodString;
34
+ content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
35
+ type: z.ZodString;
36
+ content: z.ZodOptional<z.ZodString>;
37
+ source: z.ZodOptional<z.ZodObject<{
38
+ type: z.ZodString;
39
+ mimeType: z.ZodOptional<z.ZodString>;
40
+ value: z.ZodString;
41
+ }, z.core.$loose>>;
42
+ }, z.core.$loose>>]>>;
43
+ parts: z.ZodOptional<z.ZodArray<z.ZodObject<{
44
+ type: z.ZodString;
45
+ content: z.ZodOptional<z.ZodString>;
46
+ }, z.core.$loose>>>;
47
+ }, z.core.$loose>>;
48
+ model: z.ZodOptional<z.ZodString>;
49
+ intent: z.ZodOptional<z.ZodEnum<{
50
+ chat: "chat";
51
+ compact: "compact";
52
+ }>>;
53
+ forwardedProps: z.ZodOptional<z.ZodObject<{
54
+ model: z.ZodOptional<z.ZodString>;
55
+ intent: z.ZodOptional<z.ZodEnum<{
56
+ chat: "chat";
57
+ compact: "compact";
58
+ }>>;
59
+ }, z.core.$loose>>;
60
+ data: z.ZodOptional<z.ZodObject<{
61
+ model: z.ZodOptional<z.ZodString>;
62
+ intent: z.ZodOptional<z.ZodEnum<{
63
+ chat: "chat";
64
+ compact: "compact";
65
+ }>>;
66
+ }, z.core.$loose>>;
67
+ }, z.core.$strip>;
68
+ type ChatMessage = z.infer<typeof ChatMessageSchema>;
69
+ type ChatRequest = z.infer<typeof ChatRequestSchema>;
70
+ declare const SessionId: z.core.$ZodBranded<z.ZodString, "ConcivSessionId", "out">;
71
+ type SessionId = z.infer<typeof SessionId>;
72
+ declare function isSessionId(id: unknown): id is SessionId;
73
+ declare const HarnessSessionId: z.ZodString;
74
+ declare const SessionRecordSchema: z.ZodObject<{
75
+ id: z.core.$ZodBranded<z.ZodString, "ConcivSessionId", "out">;
76
+ harnessSessionId: z.ZodNullable<z.ZodString>;
77
+ harnessKind: z.ZodString;
78
+ origin: z.ZodEnum<{
79
+ chat: "chat";
80
+ agent: "agent";
81
+ external: "external";
82
+ }>;
83
+ title: z.ZodNullable<z.ZodString>;
84
+ model: z.ZodNullable<z.ZodString>;
85
+ usage: z.ZodNullable<z.ZodObject<{
86
+ modelId: z.ZodOptional<z.ZodString>;
87
+ contextWindow: z.ZodOptional<z.ZodNumber>;
88
+ inputTokens: z.ZodOptional<z.ZodNumber>;
89
+ outputTokens: z.ZodOptional<z.ZodNumber>;
90
+ cacheReadTokens: z.ZodOptional<z.ZodNumber>;
91
+ cacheWriteTokens: z.ZodOptional<z.ZodNumber>;
92
+ reasoningTokens: z.ZodOptional<z.ZodNumber>;
93
+ totalCostUsd: z.ZodOptional<z.ZodNumber>;
94
+ numTurns: z.ZodOptional<z.ZodNumber>;
95
+ }, z.core.$strip>>;
96
+ cwd: z.ZodString;
97
+ createdAt: z.ZodNumber;
98
+ updatedAt: z.ZodNumber;
99
+ }, z.core.$strip>;
100
+ type SessionRecord = z.infer<typeof SessionRecordSchema>;
101
+ type SessionRecordInput = z.input<typeof SessionRecordSchema>;
102
+ declare const ResolveRequestSchema: z.ZodObject<{
103
+ id: z.ZodOptional<z.ZodString>;
104
+ }, z.core.$strip>;
105
+ type ResolveRequest = z.infer<typeof ResolveRequestSchema>;
106
+ declare const ResolveResponseSchema: z.ZodObject<{
107
+ sessionId: z.core.$ZodBranded<z.ZodString, "ConcivSessionId", "out">;
108
+ }, z.core.$strip>;
109
+ type ResolveResponse = z.infer<typeof ResolveResponseSchema>;
110
+ declare const RenameResponseSchema: z.ZodObject<{
111
+ ok: z.ZodBoolean;
112
+ title: z.ZodString;
113
+ }, z.core.$strip>;
114
+ type RenameResponse = z.infer<typeof RenameResponseSchema>;
115
+ declare const OkSchema: z.ZodObject<{
116
+ ok: z.ZodBoolean;
117
+ }, z.core.$strip>;
118
+ type Ok = z.infer<typeof OkSchema>;
119
+ declare const PermissionDecisionSchema: z.ZodObject<{
120
+ approvalId: z.ZodString;
121
+ approved: z.ZodBoolean;
122
+ }, z.core.$strip>;
123
+ type PermissionDecision = z.infer<typeof PermissionDecisionSchema>;
124
+ declare const ChatSessionSchema: z.ZodObject<{
125
+ sessionId: z.core.$ZodBranded<z.ZodString, "ConcivSessionId", "out">;
126
+ harnessSessionId: z.ZodNullable<z.ZodString>;
127
+ name: z.ZodNullable<z.ZodString>;
128
+ origin: z.ZodEnum<{
129
+ chat: "chat";
130
+ agent: "agent";
131
+ external: "external";
132
+ }>;
133
+ cwd: z.ZodString;
134
+ lock: z.ZodObject<{
135
+ held: z.ZodBoolean;
136
+ role: z.ZodNullable<z.ZodEnum<{
137
+ chat: "chat";
138
+ iterate: "iterate";
139
+ }>>;
140
+ }, z.core.$strip>;
141
+ usage: z.ZodOptional<z.ZodNullable<z.ZodObject<{
142
+ modelId: z.ZodOptional<z.ZodString>;
143
+ contextWindow: z.ZodOptional<z.ZodNumber>;
144
+ inputTokens: z.ZodOptional<z.ZodNumber>;
145
+ outputTokens: z.ZodOptional<z.ZodNumber>;
146
+ cacheReadTokens: z.ZodOptional<z.ZodNumber>;
147
+ cacheWriteTokens: z.ZodOptional<z.ZodNumber>;
148
+ reasoningTokens: z.ZodOptional<z.ZodNumber>;
149
+ totalCostUsd: z.ZodOptional<z.ZodNumber>;
150
+ numTurns: z.ZodOptional<z.ZodNumber>;
151
+ }, z.core.$strip>>>;
152
+ harness: z.ZodObject<{
153
+ id: z.ZodString;
154
+ name: z.ZodString;
155
+ canLaunch: z.ZodBoolean;
156
+ }, z.core.$strip>;
157
+ }, z.core.$strip>;
158
+ type ChatSession = z.infer<typeof ChatSessionSchema>;
159
+ declare const HarnessModelSchema: z.ZodObject<{
160
+ id: z.ZodString;
161
+ name: z.ZodString;
162
+ description: z.ZodOptional<z.ZodString>;
163
+ group: z.ZodOptional<z.ZodString>;
164
+ disabled: z.ZodOptional<z.ZodBoolean>;
165
+ }, z.core.$strip>;
166
+ declare const ChatModelsSchema: z.ZodObject<{
167
+ models: z.ZodArray<z.ZodObject<{
168
+ id: z.ZodString;
169
+ name: z.ZodString;
170
+ description: z.ZodOptional<z.ZodString>;
171
+ group: z.ZodOptional<z.ZodString>;
172
+ disabled: z.ZodOptional<z.ZodBoolean>;
173
+ }, z.core.$strip>>;
174
+ defaultModel: z.ZodNullable<z.ZodString>;
175
+ harness: z.ZodObject<{
176
+ id: z.ZodString;
177
+ name: z.ZodString;
178
+ canLaunch: z.ZodBoolean;
179
+ }, z.core.$strip>;
180
+ }, z.core.$strip>;
181
+ type HarnessModelInfo = z.infer<typeof HarnessModelSchema>;
182
+ type ChatModels = z.infer<typeof ChatModelsSchema>;
183
+ declare const ChatHistorySchema: z.ZodArray<z.ZodCustom<UIMessage$1<unknown>, UIMessage$1<unknown>>>;
184
+ type ChatHistory = z.infer<typeof ChatHistorySchema>;
185
+ declare const ChatSessionMetaSchema: z.ZodObject<{
186
+ id: z.ZodString;
187
+ title: z.ZodString;
188
+ updatedAt: z.ZodNumber;
189
+ messageCount: z.ZodNumber;
190
+ running: z.ZodBoolean;
191
+ origin: z.ZodEnum<{
192
+ external: "external";
193
+ conciv: "conciv";
194
+ }>;
195
+ usage: z.ZodNullable<z.ZodObject<{
196
+ modelId: z.ZodOptional<z.ZodString>;
197
+ contextWindow: z.ZodOptional<z.ZodNumber>;
198
+ inputTokens: z.ZodOptional<z.ZodNumber>;
199
+ outputTokens: z.ZodOptional<z.ZodNumber>;
200
+ cacheReadTokens: z.ZodOptional<z.ZodNumber>;
201
+ cacheWriteTokens: z.ZodOptional<z.ZodNumber>;
202
+ reasoningTokens: z.ZodOptional<z.ZodNumber>;
203
+ totalCostUsd: z.ZodOptional<z.ZodNumber>;
204
+ numTurns: z.ZodOptional<z.ZodNumber>;
205
+ }, z.core.$strip>>;
206
+ }, z.core.$strip>;
207
+ declare const ChatSessionsSchema: z.ZodObject<{
208
+ sessions: z.ZodArray<z.ZodObject<{
209
+ id: z.ZodString;
210
+ title: z.ZodString;
211
+ updatedAt: z.ZodNumber;
212
+ messageCount: z.ZodNumber;
213
+ running: z.ZodBoolean;
214
+ origin: z.ZodEnum<{
215
+ external: "external";
216
+ conciv: "conciv";
217
+ }>;
218
+ usage: z.ZodNullable<z.ZodObject<{
219
+ modelId: z.ZodOptional<z.ZodString>;
220
+ contextWindow: z.ZodOptional<z.ZodNumber>;
221
+ inputTokens: z.ZodOptional<z.ZodNumber>;
222
+ outputTokens: z.ZodOptional<z.ZodNumber>;
223
+ cacheReadTokens: z.ZodOptional<z.ZodNumber>;
224
+ cacheWriteTokens: z.ZodOptional<z.ZodNumber>;
225
+ reasoningTokens: z.ZodOptional<z.ZodNumber>;
226
+ totalCostUsd: z.ZodOptional<z.ZodNumber>;
227
+ numTurns: z.ZodOptional<z.ZodNumber>;
228
+ }, z.core.$strip>>;
229
+ }, z.core.$strip>>;
230
+ }, z.core.$strip>;
231
+ type ChatSessionMeta = z.infer<typeof ChatSessionMetaSchema>;
232
+ type ChatSessions = z.infer<typeof ChatSessionsSchema>;
233
+ declare const RenameSessionSchema: z.ZodObject<{
234
+ sessionId: z.core.$ZodBranded<z.ZodString, "ConcivSessionId", "out">;
235
+ title: z.ZodString;
236
+ }, z.core.$strip>;
237
+ type RenameSession = z.infer<typeof RenameSessionSchema>;
238
+ declare const ChatLaunchRequestSchema: z.ZodObject<{
239
+ model: z.ZodOptional<z.ZodString>;
240
+ }, z.core.$strip>;
241
+ type ChatLaunchRequest = z.infer<typeof ChatLaunchRequestSchema>;
242
+ declare const ChatLaunchSchema: z.ZodObject<{
243
+ supported: z.ZodBoolean;
244
+ opened: z.ZodBoolean;
245
+ command: z.ZodNullable<z.ZodString>;
246
+ }, z.core.$strip>;
247
+ type ChatLaunch = z.infer<typeof ChatLaunchSchema>;
248
+ //#endregion
249
+ export { CONCIV_SESSION_HEADER, ChatContentPartSchema, ChatHistory, ChatHistorySchema, ChatLaunch, ChatLaunchRequest, ChatLaunchRequestSchema, ChatLaunchSchema, ChatMessage, ChatMessageSchema, ChatModels, ChatModelsSchema, ChatRequest, ChatRequestSchema, ChatSession, ChatSessionMeta, ChatSessionMetaSchema, ChatSessionSchema, ChatSessions, ChatSessionsSchema, HarnessModelInfo, HarnessModelSchema, HarnessSessionId, type MessagePart, Ok, OkSchema, PermissionDecision, PermissionDecisionSchema, RenameResponse, RenameResponseSchema, RenameSession, RenameSessionSchema, ResolveRequest, ResolveRequestSchema, ResolveResponse, ResolveResponseSchema, SessionId, SessionRecord, SessionRecordInput, SessionRecordSchema, type StreamChunk, type UIMessage, isSessionId };
250
+ //# sourceMappingURL=chat-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-types.d.ts","names":[],"sources":["../src/chat-types.ts"],"mappings":";;;;cAQa,qBAAA;AAAA,cAIA,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;;;;cAUrB,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;cAejB,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAUlB,WAAA,GAAc,CAAA,CAAE,KAAK,QAAQ,iBAAA;AAAA,KAC7B,WAAA,GAAc,CAAA,CAAE,KAAK,QAAQ,iBAAA;AAAA,cAI5B,SAAA,EAAS,CAAA,CAAA,IAAA,CAAA,WAAA,CAAA,CAAA,CAAA,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AiB,CAAA,CAAA,QAAA,CAAA,CAAA,CAAA,SAAA,CAAA,WAAA,WAAA,WAAA;AAAA,KAClB,WAAA,GAAc,CAAA,CAAE,KAAK,QAAQ,iBAAA;AAAA,cAI5B,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;cASrB,kBAAA,EAAkB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;KACnB,eAAA,GAAkB,CAAA,CAAE,KAAK,QAAQ,qBAAA;AAAA,KACjC,YAAA,GAAe,CAAA,CAAE,KAAK,QAAQ,kBAAA;AAAA,cAG7B,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;KACpB,aAAA,GAAgB,CAAA,CAAE,KAAK,QAAQ,mBAAA;AAAA,cAG9B,uBAAA,EAAuB,CAAA,CAAA,SAAA;;;KACxB,iBAAA,GAAoB,CAAA,CAAE,KAAK,QAAQ,uBAAA;AAAA,cAKlC,gBAAA,EAAgB,CAAA,CAAA,SAAA;;;;;KAKjB,UAAA,GAAa,CAAA,CAAE,KAAK,QAAQ,gBAAA"}
@@ -0,0 +1,127 @@
1
+ import { UsageSnapshotSchema } from "./usage-types.js";
2
+ import { z } from "zod";
3
+ //#region src/chat-types.ts
4
+ const CONCIV_SESSION_HEADER = "conciv-session-id";
5
+ const ChatContentPartSchema = z.object({
6
+ type: z.string(),
7
+ content: z.string().optional(),
8
+ source: z.object({
9
+ type: z.string(),
10
+ mimeType: z.string().optional(),
11
+ value: z.string()
12
+ }).loose().optional()
13
+ }).loose();
14
+ const ChatMessageSchema = z.object({
15
+ role: z.string(),
16
+ content: z.union([z.string(), z.array(ChatContentPartSchema)]).optional(),
17
+ parts: z.array(z.object({
18
+ type: z.string(),
19
+ content: z.string().optional()
20
+ }).loose()).optional()
21
+ }).loose();
22
+ const TurnIntent = z.enum(["chat", "compact"]);
23
+ const MetaCarrier = z.object({
24
+ model: z.string().optional(),
25
+ intent: TurnIntent.optional()
26
+ }).loose().optional();
27
+ const ChatRequestSchema = z.object({
28
+ messages: z.array(ChatMessageSchema),
29
+ model: z.string().optional(),
30
+ intent: TurnIntent.optional(),
31
+ forwardedProps: MetaCarrier,
32
+ data: MetaCarrier
33
+ });
34
+ const SessionId = z.string().regex(/^conciv_[A-Za-z0-9_-]{1,128}$/).brand();
35
+ function isSessionId(id) {
36
+ return SessionId.safeParse(id).success;
37
+ }
38
+ const HarnessSessionId = z.string().regex(/^[A-Za-z0-9_-]{1,128}$/);
39
+ const SessionRecordSchema = z.object({
40
+ id: SessionId,
41
+ harnessSessionId: z.string().nullable(),
42
+ harnessKind: z.string(),
43
+ origin: z.enum([
44
+ "chat",
45
+ "agent",
46
+ "external"
47
+ ]),
48
+ title: z.string().nullable(),
49
+ model: z.string().nullable(),
50
+ usage: UsageSnapshotSchema.nullable(),
51
+ cwd: z.string(),
52
+ createdAt: z.number(),
53
+ updatedAt: z.number()
54
+ });
55
+ const ResolveRequestSchema = z.object({ id: z.string().optional() });
56
+ const ResolveResponseSchema = z.object({ sessionId: SessionId });
57
+ const RenameResponseSchema = z.object({
58
+ ok: z.boolean(),
59
+ title: z.string()
60
+ });
61
+ const OkSchema = z.object({ ok: z.boolean() });
62
+ const PermissionDecisionSchema = z.object({
63
+ approvalId: z.string(),
64
+ approved: z.boolean()
65
+ });
66
+ const ChatSessionSchema = z.object({
67
+ sessionId: SessionId,
68
+ harnessSessionId: z.string().nullable(),
69
+ name: z.string().nullable(),
70
+ origin: z.enum([
71
+ "chat",
72
+ "agent",
73
+ "external"
74
+ ]),
75
+ cwd: z.string(),
76
+ lock: z.object({
77
+ held: z.boolean(),
78
+ role: z.enum(["iterate", "chat"]).nullable()
79
+ }),
80
+ usage: UsageSnapshotSchema.nullish(),
81
+ harness: z.object({
82
+ id: z.string(),
83
+ name: z.string(),
84
+ canLaunch: z.boolean()
85
+ })
86
+ });
87
+ const HarnessModelSchema = z.object({
88
+ id: z.string(),
89
+ name: z.string(),
90
+ description: z.string().optional(),
91
+ group: z.string().optional(),
92
+ disabled: z.boolean().optional()
93
+ });
94
+ const ChatModelsSchema = z.object({
95
+ models: z.array(HarnessModelSchema),
96
+ defaultModel: z.string().nullable(),
97
+ harness: z.object({
98
+ id: z.string(),
99
+ name: z.string(),
100
+ canLaunch: z.boolean()
101
+ })
102
+ });
103
+ const ChatHistorySchema = z.array(z.custom((v) => v !== null && typeof v === "object"));
104
+ const ChatSessionMetaSchema = z.object({
105
+ id: z.string(),
106
+ title: z.string(),
107
+ updatedAt: z.number(),
108
+ messageCount: z.number(),
109
+ running: z.boolean(),
110
+ origin: z.enum(["conciv", "external"]),
111
+ usage: UsageSnapshotSchema.nullable()
112
+ });
113
+ const ChatSessionsSchema = z.object({ sessions: z.array(ChatSessionMetaSchema) });
114
+ const RenameSessionSchema = z.object({
115
+ sessionId: SessionId,
116
+ title: z.string().max(120)
117
+ });
118
+ const ChatLaunchRequestSchema = z.object({ model: z.string().optional() });
119
+ const ChatLaunchSchema = z.object({
120
+ supported: z.boolean(),
121
+ opened: z.boolean(),
122
+ command: z.string().nullable()
123
+ });
124
+ //#endregion
125
+ export { CONCIV_SESSION_HEADER, ChatContentPartSchema, ChatHistorySchema, ChatLaunchRequestSchema, ChatLaunchSchema, ChatMessageSchema, ChatModelsSchema, ChatRequestSchema, ChatSessionMetaSchema, ChatSessionSchema, ChatSessionsSchema, HarnessModelSchema, HarnessSessionId, OkSchema, PermissionDecisionSchema, RenameResponseSchema, RenameSessionSchema, ResolveRequestSchema, ResolveResponseSchema, SessionId, SessionRecordSchema, isSessionId };
126
+
127
+ //# sourceMappingURL=chat-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-types.js","names":[],"sources":["../src/chat-types.ts"],"sourcesContent":["// Chat contracts. The streaming protocol is TanStack AI's own (AG-UI StreamChunk) — only the\n// request/session envelopes below are ours.\nimport {z} from 'zod'\nimport type {UIMessage} from '@tanstack/ai'\nimport {UsageSnapshotSchema} from './usage-types.js'\nexport type {StreamChunk, UIMessage, MessagePart} from '@tanstack/ai'\n\n// The HTTP header carrying our session id on every chat request.\nexport const CONCIV_SESSION_HEADER = 'conciv-session-id'\n\n// An inline content part on a posted message. Text carries `content`; image carries a base64\n// data `source` (mimeType matches @tanstack/ai's ContentPartDataSource field name).\nexport const ChatContentPartSchema = z\n .object({\n type: z.string(),\n content: z.string().optional(),\n source: z.object({type: z.string(), mimeType: z.string().optional(), value: z.string()}).loose().optional(),\n })\n .loose()\n\n// A posted message: parts-based UIMessage OR plain {role, content}. `content` is a string or an\n// array of content parts (text + image). .loose tolerates drift.\nexport const ChatMessageSchema = z\n .object({\n role: z.string(),\n content: z.union([z.string(), z.array(ChatContentPartSchema)]).optional(),\n parts: z.array(z.object({type: z.string(), content: z.string().optional()}).loose()).optional(),\n })\n .loose()\n\n// POST /api/chat body. The widget contributes the selected model via the connection body; TanStack\n// AI serializes that onto the AG-UI RunAgentInput under `forwardedProps`/`data` (not top-level), so\n// accept it in all three spots and let the route pick whichever is present.\n// The widget contributes per-turn extras (model, intent) via the connection body; TanStack AI nests\n// them under forwardedProps/data (not top-level), so accept them in all three spots.\nconst TurnIntent = z.enum(['chat', 'compact'])\nconst MetaCarrier = z.object({model: z.string().optional(), intent: TurnIntent.optional()}).loose().optional()\nexport const ChatRequestSchema = z.object({\n messages: z.array(ChatMessageSchema),\n model: z.string().optional(),\n // 'compact' → the turn compacts the resumed context (native where the harness supports it, else a\n // summarize-prompt fallback).\n intent: TurnIntent.optional(),\n forwardedProps: MetaCarrier,\n data: MetaCarrier,\n})\n\nexport type ChatMessage = z.infer<typeof ChatMessageSchema>\nexport type ChatRequest = z.infer<typeof ChatRequestSchema>\n\n// Our session id — minted by the server, conciv_ prefixed, branded so a raw harness id can't be\n// passed where ours is required.\nexport const SessionId = z\n .string()\n .regex(/^conciv_[A-Za-z0-9_-]{1,128}$/)\n .brand<'ConcivSessionId'>()\nexport type SessionId = z.infer<typeof SessionId>\n\n// Runtime guard — narrows an unknown/raw string to our branded SessionId. The one place to decide\n// \"is this ours\" so callers never hand-roll a `.startsWith('conciv_')` check.\nexport function isSessionId(id: unknown): id is SessionId {\n return SessionId.safeParse(id).success\n}\n\n// The harness's own session id (resume token). Charset-bounded for filesystem safety.\nexport const HarnessSessionId = z.string().regex(/^[A-Za-z0-9_-]{1,128}$/)\n\n// One consolidated, durable record per session — the single source of truth.\nexport const SessionRecordSchema = z.object({\n id: SessionId,\n harnessSessionId: z.string().nullable(), // resume token; null = never run\n harnessKind: z.string(), // 'claude' | 'codex' ... routes resume\n origin: z.enum(['chat', 'agent', 'external']),\n title: z.string().nullable(),\n model: z.string().nullable(),\n usage: UsageSnapshotSchema.nullable(),\n cwd: z.string(),\n createdAt: z.number(),\n updatedAt: z.number(),\n})\nexport type SessionRecord = z.infer<typeof SessionRecordSchema>\n// Raw shape accepted into the store (id is an unbranded string here; the schema brands it on parse).\nexport type SessionRecordInput = z.input<typeof SessionRecordSchema>\n\nexport const ResolveRequestSchema = z.object({id: z.string().optional()})\nexport type ResolveRequest = z.infer<typeof ResolveRequestSchema>\nexport const ResolveResponseSchema = z.object({sessionId: SessionId})\nexport type ResolveResponse = z.infer<typeof ResolveResponseSchema>\nexport const RenameResponseSchema = z.object({ok: z.boolean(), title: z.string()})\nexport type RenameResponse = z.infer<typeof RenameResponseSchema>\nexport const OkSchema = z.object({ok: z.boolean()})\nexport type Ok = z.infer<typeof OkSchema>\n\n// The decision posted from the permission approval gate.\nexport const PermissionDecisionSchema = z.object({approvalId: z.string(), approved: z.boolean()})\nexport type PermissionDecision = z.infer<typeof PermissionDecisionSchema>\n\n// GET /api/chat/session response.\nexport const ChatSessionSchema = z.object({\n sessionId: SessionId,\n // The harness resume token (display + resume), null until a turn mints one (= a \"new\" session).\n harnessSessionId: z.string().nullable(),\n // Human-readable session name from the transcript, or null when none is derivable yet.\n name: z.string().nullable(),\n // How this session came to exist; never the harness id.\n origin: z.enum(['chat', 'agent', 'external']),\n cwd: z.string(),\n lock: z.object({held: z.boolean(), role: z.enum(['iterate', 'chat']).nullable()}),\n // Last persisted usage for this session, so the tracker fills on open before any turn.\n usage: UsageSnapshotSchema.nullish(),\n // The active harness's identity + whether it supports \"open in <harness>\", so the widget can\n // label and gate the button before any click.\n harness: z.object({id: z.string(), name: z.string(), canLaunch: z.boolean()}),\n})\nexport type ChatSession = z.infer<typeof ChatSessionSchema>\n\n// GET /api/chat/models response — the active harness's models + the id to pre-select.\nexport const HarnessModelSchema = z.object({\n id: z.string(),\n name: z.string(),\n description: z.string().optional(),\n group: z.string().optional(),\n disabled: z.boolean().optional(),\n})\nexport const ChatModelsSchema = z.object({\n models: z.array(HarnessModelSchema),\n defaultModel: z.string().nullable(),\n // The active harness's identity + whether it supports \"open in <harness>\". Lives on this\n // non-session route so the widget can gate/label the launch button before resolving a session.\n harness: z.object({id: z.string(), name: z.string(), canLaunch: z.boolean()}),\n})\nexport type HarnessModelInfo = z.infer<typeof HarnessModelSchema>\nexport type ChatModels = z.infer<typeof ChatModelsSchema>\n\n// GET /api/chat/history response — TanStack's UIMessage[] (too rich to re-validate field by\n// field); validate array + object shape via z.custom, the sanctioned typed escape.\nexport const ChatHistorySchema = z.array(z.custom<UIMessage>((v) => v !== null && typeof v === 'object'))\nexport type ChatHistory = z.infer<typeof ChatHistorySchema>\n\n// One row in the session selector: our id (or a raw harness id for an unwrapped external row) +\n// its joined live/persisted state.\nexport const ChatSessionMetaSchema = z.object({\n id: z.string(),\n title: z.string(),\n updatedAt: z.number(),\n messageCount: z.number(),\n running: z.boolean(),\n origin: z.enum(['conciv', 'external']),\n usage: UsageSnapshotSchema.nullable(),\n})\nexport const ChatSessionsSchema = z.object({sessions: z.array(ChatSessionMetaSchema)})\nexport type ChatSessionMeta = z.infer<typeof ChatSessionMetaSchema>\nexport type ChatSessions = z.infer<typeof ChatSessionsSchema>\n\n// POST /api/chat/sessions/title body.\nexport const RenameSessionSchema = z.object({sessionId: SessionId, title: z.string().max(120)})\nexport type RenameSession = z.infer<typeof RenameSessionSchema>\n\n// POST /api/chat/launch body — the widget's current model, mirrored into the resumed terminal session.\nexport const ChatLaunchRequestSchema = z.object({model: z.string().optional()})\nexport type ChatLaunchRequest = z.infer<typeof ChatLaunchRequestSchema>\n\n// POST /api/chat/launch response. `supported` false → the active harness defines no interactive\n// launch. `opened` true → core launched the terminal; false → the widget copies `command` (the\n// paste-able resume command, null only when unsupported).\nexport const ChatLaunchSchema = z.object({\n supported: z.boolean(),\n opened: z.boolean(),\n command: z.string().nullable(),\n})\nexport type ChatLaunch = z.infer<typeof ChatLaunchSchema>\n"],"mappings":";;;AAQA,MAAa,wBAAwB;AAIrC,MAAa,wBAAwB,EAClC,OAAO;CACN,MAAM,EAAE,OAAO;CACf,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS;CAC7B,QAAQ,EAAE,OAAO;EAAC,MAAM,EAAE,OAAO;EAAG,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;EAAG,OAAO,EAAE,OAAO;CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS;AAC5G,CAAC,CAAC,CACD,MAAM;AAIT,MAAa,oBAAoB,EAC9B,OAAO;CACN,MAAM,EAAE,OAAO;CACf,SAAS,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,qBAAqB,CAAC,CAAC,CAAC,CAAC,SAAS;CACxE,OAAO,EAAE,MAAM,EAAE,OAAO;EAAC,MAAM,EAAE,OAAO;EAAG,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS;CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;AAChG,CAAC,CAAC,CACD,MAAM;AAOT,MAAM,aAAa,EAAE,KAAK,CAAC,QAAQ,SAAS,CAAC;AAC7C,MAAM,cAAc,EAAE,OAAO;CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAAG,QAAQ,WAAW,SAAS;AAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS;AAC7G,MAAa,oBAAoB,EAAE,OAAO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AAC,CAAC;AAKrF,MAAa,sBAAsB,EAAE,OAAO;CAAC,WAAW;CAAW,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,GAAG;AAAC,CAAC;AAI9F,MAAa,0BAA0B,EAAE,OAAO,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,EAAC,CAAC;AAM9E,MAAa,mBAAmB,EAAE,OAAO;CACvC,WAAW,EAAE,QAAQ;CACrB,QAAQ,EAAE,QAAQ;CAClB,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS;AAC/B,CAAC"}
@@ -0,0 +1,44 @@
1
+ //#region src/config-types.d.ts
2
+ type TriggerPosition = 'top-left' | 'top-right' | 'middle-left' | 'middle-right' | 'bottom-left' | 'bottom-right';
3
+ interface ModalConfig {
4
+ /** Initial trigger position. The user can drag it; it snaps to a preset and persists. Default 'bottom-right'. */
5
+ position?: TriggerPosition;
6
+ }
7
+ interface QuickTerminalConfig {
8
+ /** Hotkey(s) toggling the quick terminal. One binding or many (e.g. ['Mod+`', 'Control+k']). Default 'Mod+`'. */
9
+ hotkey?: string | string[];
10
+ }
11
+ interface WidgetConfig {
12
+ /** Bottom-right corner modal. On by default; `false` disables it, an object configures it. */
13
+ modal?: boolean | ModalConfig;
14
+ /** Top drop-down quick terminal. On by default; `false` disables it, an object sets the hotkey(s). */
15
+ quickTerminal?: boolean | QuickTerminalConfig;
16
+ }
17
+ interface ExtensionConfigRegistry {}
18
+ interface ConcivConfig {
19
+ enabled?: boolean;
20
+ /** Per-extension config, keyed + typed by each extension's declaration-merged ExtensionConfigRegistry entry. */
21
+ extensions?: { [Name in keyof ExtensionConfigRegistry]?: ExtensionConfigRegistry[Name] };
22
+ widgetUrl?: string;
23
+ /** Widget layouts + their options. Both layouts are enabled by default. */
24
+ widget?: WidgetConfig;
25
+ stateRoot?: string;
26
+ harness?: string;
27
+ harnessBin?: string;
28
+ sessionId?: string;
29
+ /** Fixed engine port. Used by the Next.js integration so server boot + client widget agree. */
30
+ port?: number;
31
+ /**
32
+ * Our minimal chat grounding prompt. `true`/omitted injects it (default); `false` opts out
33
+ * entirely (you take full control of the agent); a string replaces it with your own.
34
+ */
35
+ systemPrompt?: string | boolean;
36
+ /** @deprecated use harnessBin */
37
+ claudePath?: string;
38
+ /** @deprecated use sessionId */
39
+ claudeSessionId?: string;
40
+ }
41
+ declare function defineConfig<T extends ConcivConfig>(config: T): T;
42
+ //#endregion
43
+ export { ConcivConfig, ExtensionConfigRegistry, ModalConfig, QuickTerminalConfig, TriggerPosition, WidgetConfig, defineConfig };
44
+ //# sourceMappingURL=config-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-types.d.ts","names":[],"sources":["../src/config-types.ts"],"mappings":";KAIY,eAAA;AAAA,UAEK,WAAA;EAFU;EAIzB,QAAA,GAAW,eAAe;AAAA;AAAA,UAGX,mBAAA;EALA;EAOf,MAAM;AAAA;AAAA,UAGS,YAAA;EARW;EAU1B,KAAA,aAAkB,WAAA;EAPgB;EASlC,aAAA,aAA0B,mBAAmB;AAAA;AAAA,UAG9B,uBAAA;AAAA,UAEA,YAAA;EACf,OAAA;EAN6C;EAQ7C,UAAA,oBAA6B,uBAAA,IAA2B,uBAAA,CAAwB,IAAA;EAChF,SAAA;EAT6C;EAW7C,MAAA,GAAS,YAAA;EACT,SAAA;EACA,OAAA;EACA,UAAA;EACA,SAAA;EAZsC;EActC,IAAA;EAZ2B;;;;EAiB3B,YAAA;EAXS;EAYyB,UAAA;EAZb;EAaY,eAAA;AAAA;AAAA,iBAGnB,YAAA,WAAuB,YAAA,EAAc,MAAA,EAAQ,CAAA,GAAI,CAAA"}
@@ -0,0 +1,8 @@
1
+ //#region src/config-types.ts
2
+ function defineConfig(config) {
3
+ return config;
4
+ }
5
+ //#endregion
6
+ export { defineConfig };
7
+
8
+ //# sourceMappingURL=config-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-types.js","names":[],"sources":["../src/config-types.ts"],"sourcesContent":["// The public conciv config contract, shared by the engine + every plugin entry. Zero-runtime:\n// the type + an identity typed factory (mirrors defineHarness/defineRunner). Resolution + env\n// fallbacks live in @conciv/core/config.\n// Where the corner-modal trigger button sits. Draggable at runtime; this is the initial spot.\nexport type TriggerPosition = 'top-left' | 'top-right' | 'middle-left' | 'middle-right' | 'bottom-left' | 'bottom-right'\n\nexport interface ModalConfig {\n /** Initial trigger position. The user can drag it; it snaps to a preset and persists. Default 'bottom-right'. */\n position?: TriggerPosition\n}\n\nexport interface QuickTerminalConfig {\n /** Hotkey(s) toggling the quick terminal. One binding or many (e.g. ['Mod+`', 'Control+k']). Default 'Mod+`'. */\n hotkey?: string | string[]\n}\n\nexport interface WidgetConfig {\n /** Bottom-right corner modal. On by default; `false` disables it, an object configures it. */\n modal?: boolean | ModalConfig\n /** Top drop-down quick terminal. On by default; `false` disables it, an object sets the hotkey(s). */\n quickTerminal?: boolean | QuickTerminalConfig\n}\n\nexport interface ExtensionConfigRegistry {}\n\nexport interface ConcivConfig {\n enabled?: boolean\n /** Per-extension config, keyed + typed by each extension's declaration-merged ExtensionConfigRegistry entry. */\n extensions?: {[Name in keyof ExtensionConfigRegistry]?: ExtensionConfigRegistry[Name]}\n widgetUrl?: string\n /** Widget layouts + their options. Both layouts are enabled by default. */\n widget?: WidgetConfig\n stateRoot?: string\n harness?: string\n harnessBin?: string\n sessionId?: string\n /** Fixed engine port. Used by the Next.js integration so server boot + client widget agree. */\n port?: number\n /**\n * Our minimal chat grounding prompt. `true`/omitted injects it (default); `false` opts out\n * entirely (you take full control of the agent); a string replaces it with your own.\n */\n systemPrompt?: string | boolean\n /** @deprecated use harnessBin */ claudePath?: string\n /** @deprecated use sessionId */ claudeSessionId?: string\n}\n\nexport function defineConfig<T extends ConcivConfig>(config: T): T {\n return config\n}\n"],"mappings":";AA+CA,SAAgB,aAAqC,QAAc;CACjE,OAAO;AACT"}
@@ -0,0 +1,14 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/done-types.d.ts
4
+ declare const DoneCardSchema: z.ZodObject<{
5
+ message: z.ZodString;
6
+ summary: z.ZodString;
7
+ filesChanged: z.ZodArray<z.ZodString>;
8
+ pageActions: z.ZodArray<z.ZodString>;
9
+ testsPassed: z.ZodBoolean;
10
+ }, z.core.$strict>;
11
+ type DoneCard = z.infer<typeof DoneCardSchema>;
12
+ //#endregion
13
+ export { DoneCard, DoneCardSchema };
14
+ //# sourceMappingURL=done-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"done-types.d.ts","names":[],"sources":["../src/done-types.ts"],"mappings":";;;cAMa,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;;KAWf,QAAA,GAAW,CAAA,CAAE,KAAK,QAAQ,cAAA"}
@@ -0,0 +1,13 @@
1
+ import { z } from "zod";
2
+ //#region src/done-types.ts
3
+ const DoneCardSchema = z.object({
4
+ message: z.string(),
5
+ summary: z.string(),
6
+ filesChanged: z.array(z.string()),
7
+ pageActions: z.array(z.string()),
8
+ testsPassed: z.boolean()
9
+ }).strict();
10
+ //#endregion
11
+ export { DoneCardSchema };
12
+
13
+ //# sourceMappingURL=done-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"done-types.js","names":[],"sources":["../src/done-types.ts"],"sourcesContent":["import {z} from 'zod'\n\n// The agent-authored \"done\" summary. This is the structured-output contract: claude/codex emit it\n// at the end of a turn (Plan D), the widget renders it as the done card. Every field is REQUIRED and\n// additionalProperties is false, because codex's OpenAI-strict response_format rejects optional keys\n// (verified live); \"optional\" fields are required-but-emptyable (filesChanged: [], summary: '').\nexport const DoneCardSchema = z\n .object({\n // The conversational reply, rendered as the turn's normal text. The rest is the structured roll-up.\n message: z.string(),\n summary: z.string(),\n filesChanged: z.array(z.string()),\n pageActions: z.array(z.string()),\n testsPassed: z.boolean(),\n })\n .strict()\n\nexport type DoneCard = z.infer<typeof DoneCardSchema>\n"],"mappings":";;AAMA,MAAa,iBAAiB,EAC3B,OAAO;CAEN,SAAS,EAAE,OAAO;CAClB,SAAS,EAAE,OAAO;CAClB,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC;CAChC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC;CAC/B,aAAa,EAAE,QAAQ;AACzB,CAAC,CAAC,CACD,OAAO"}
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/editor-types.d.ts
4
+ declare const EditorOpenSchema: z.ZodObject<{
5
+ file: z.ZodString;
6
+ line: z.ZodOptional<z.ZodNumber>;
7
+ }, z.core.$strip>;
8
+ type EditorOpen = z.infer<typeof EditorOpenSchema>;
9
+ //#endregion
10
+ export { EditorOpen, EditorOpenSchema };
11
+ //# sourceMappingURL=editor-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-types.d.ts","names":[],"sources":["../src/editor-types.ts"],"mappings":";;;cAIa,gBAAA,EAAgB,CAAA,CAAA,SAAA;;;;KACjB,UAAA,GAAa,CAAA,CAAE,KAAK,QAAQ,gBAAA"}
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+ //#region src/editor-types.ts
3
+ const EditorOpenSchema = z.object({
4
+ file: z.string().min(1),
5
+ line: z.number().optional()
6
+ });
7
+ //#endregion
8
+ export { EditorOpenSchema };
9
+
10
+ //# sourceMappingURL=editor-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-types.js","names":[],"sources":["../src/editor-types.ts"],"sourcesContent":["import {z} from 'zod'\n\n// POST /api/editor/open body — \"open this file at this line\". Shared by core (validation) and the\n// widget transport (typing).\nexport const EditorOpenSchema = z.object({file: z.string().min(1), line: z.number().optional()})\nexport type EditorOpen = z.infer<typeof EditorOpenSchema>\n"],"mappings":";;AAIA,MAAa,mBAAmB,EAAE,OAAO;CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAAG,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;AAAC,CAAC"}