@autono/pinbox-core 0.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 +17 -0
- package/dist/auth/verify.d.ts +15 -0
- package/dist/auth/verify.js +2 -0
- package/dist/connectors/github.d.ts +5 -0
- package/dist/connectors/github.js +49 -0
- package/dist/connectors/index.d.ts +37 -0
- package/dist/connectors/index.js +103 -0
- package/dist/context-BHcEpzVb.js +30 -0
- package/dist/delivery/openclaw.d.ts +10 -0
- package/dist/delivery/openclaw.js +50 -0
- package/dist/delivery/resume.d.ts +23 -0
- package/dist/delivery/resume.js +102 -0
- package/dist/delivery/router.d.ts +2 -0
- package/dist/delivery/router.js +262 -0
- package/dist/delivery/webhook.d.ts +9 -0
- package/dist/delivery/webhook.js +52 -0
- package/dist/do.d.ts +67 -0
- package/dist/do.js +713 -0
- package/dist/hub-QYz6OqYQ.js +328 -0
- package/dist/hub-server.d.ts +44 -0
- package/dist/hub-server.js +251 -0
- package/dist/hub.d.ts +125 -0
- package/dist/hub.js +2 -0
- package/dist/markdown.d.ts +14 -0
- package/dist/markdown.js +87 -0
- package/dist/payload-m1DbRWDD.d.ts +6 -0
- package/dist/poll-BrcAuaAz.js +252 -0
- package/dist/proc-BMp_pbPS.js +42 -0
- package/dist/router-D3dDjIaD.d.ts +62 -0
- package/dist/schema-BOTmn5SM.d.ts +297 -0
- package/dist/schema.d.ts +2 -0
- package/dist/schema.js +121 -0
- package/dist/schema.json +403 -0
- package/dist/sessions-CJdMBH3C.d.ts +47 -0
- package/dist/sessions-DrCVTMfI.js +129 -0
- package/dist/sessions.d.ts +2 -0
- package/dist/sessions.js +2 -0
- package/dist/store-DHbwWu93.d.ts +105 -0
- package/dist/store-DM8MjB8M.js +479 -0
- package/dist/store.d.ts +2 -0
- package/dist/store.js +3 -0
- package/dist/types-BLNQb7MH.d.ts +28 -0
- package/dist/verify-BDt9d9Np.js +55 -0
- package/dist/ws-protocol.d.ts +61 -0
- package/dist/ws-protocol.js +51 -0
- package/dist/ws.d.ts +7 -0
- package/dist/ws.js +1 -0
- package/package.json +104 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/schema.d.ts
|
|
3
|
+
declare const SCHEMA_VERSION = 1;
|
|
4
|
+
declare const RectSchema: z.ZodType<{
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
}>;
|
|
10
|
+
declare const SessionRefSchema: z.ZodObject<{
|
|
11
|
+
agent: z.ZodString;
|
|
12
|
+
key: z.ZodString;
|
|
13
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
declare const AttachmentSchema: z.ZodObject<{
|
|
16
|
+
id: z.ZodString;
|
|
17
|
+
kind: z.ZodEnum<{
|
|
18
|
+
file: "file";
|
|
19
|
+
screenshot: "screenshot";
|
|
20
|
+
}>;
|
|
21
|
+
path: z.ZodOptional<z.ZodString>;
|
|
22
|
+
url: z.ZodOptional<z.ZodString>;
|
|
23
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
24
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
declare const ThreadMessageSchema: z.ZodObject<{
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
pinId: z.ZodString;
|
|
30
|
+
role: z.ZodEnum<{
|
|
31
|
+
agent: "agent";
|
|
32
|
+
human: "human";
|
|
33
|
+
mirror: "mirror";
|
|
34
|
+
}>;
|
|
35
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
36
|
+
text: z.ZodString;
|
|
37
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
38
|
+
id: z.ZodString;
|
|
39
|
+
kind: z.ZodEnum<{
|
|
40
|
+
file: "file";
|
|
41
|
+
screenshot: "screenshot";
|
|
42
|
+
}>;
|
|
43
|
+
path: z.ZodOptional<z.ZodString>;
|
|
44
|
+
url: z.ZodOptional<z.ZodString>;
|
|
45
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
46
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
}, z.core.$strip>>>;
|
|
49
|
+
at: z.ZodString;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
declare const LinkSchema: z.ZodObject<{
|
|
52
|
+
connector: z.ZodString;
|
|
53
|
+
ref: z.ZodString;
|
|
54
|
+
url: z.ZodString;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
declare const PinInputSchema: z.ZodObject<{
|
|
57
|
+
text: z.ZodString;
|
|
58
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
59
|
+
move: "move";
|
|
60
|
+
note: "note";
|
|
61
|
+
}>>;
|
|
62
|
+
target: z.ZodOptional<z.ZodObject<{
|
|
63
|
+
url: z.ZodOptional<z.ZodString>;
|
|
64
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
65
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
66
|
+
rect: z.ZodOptional<z.ZodType<{
|
|
67
|
+
x: number;
|
|
68
|
+
y: number;
|
|
69
|
+
width: number;
|
|
70
|
+
height: number;
|
|
71
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
72
|
+
x: number;
|
|
73
|
+
y: number;
|
|
74
|
+
width: number;
|
|
75
|
+
height: number;
|
|
76
|
+
}, unknown>>>;
|
|
77
|
+
fixed: z.ZodOptional<z.ZodBoolean>;
|
|
78
|
+
anchor: z.ZodOptional<z.ZodString>;
|
|
79
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
80
|
+
file: z.ZodString;
|
|
81
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
via: z.ZodEnum<{
|
|
83
|
+
framework: "framework";
|
|
84
|
+
none: "none";
|
|
85
|
+
plugin: "plugin";
|
|
86
|
+
}>;
|
|
87
|
+
}, z.core.$strip>>;
|
|
88
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
89
|
+
classes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
90
|
+
styles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
91
|
+
aria: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
92
|
+
nearbyText: z.ZodOptional<z.ZodString>;
|
|
93
|
+
selectedText: z.ZodOptional<z.ZodString>;
|
|
94
|
+
}, z.core.$strip>>;
|
|
95
|
+
}, z.core.$strip>>;
|
|
96
|
+
move: z.ZodOptional<z.ZodObject<{
|
|
97
|
+
from: z.ZodType<{
|
|
98
|
+
x: number;
|
|
99
|
+
y: number;
|
|
100
|
+
width: number;
|
|
101
|
+
height: number;
|
|
102
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
103
|
+
x: number;
|
|
104
|
+
y: number;
|
|
105
|
+
width: number;
|
|
106
|
+
height: number;
|
|
107
|
+
}, unknown>>;
|
|
108
|
+
to: z.ZodType<{
|
|
109
|
+
x: number;
|
|
110
|
+
y: number;
|
|
111
|
+
width: number;
|
|
112
|
+
height: number;
|
|
113
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
114
|
+
x: number;
|
|
115
|
+
y: number;
|
|
116
|
+
width: number;
|
|
117
|
+
height: number;
|
|
118
|
+
}, unknown>>;
|
|
119
|
+
}, z.core.$strip>>;
|
|
120
|
+
env: z.ZodOptional<z.ZodObject<{
|
|
121
|
+
viewport: z.ZodOptional<z.ZodObject<{
|
|
122
|
+
w: z.ZodNumber;
|
|
123
|
+
h: z.ZodNumber;
|
|
124
|
+
dpr: z.ZodNumber;
|
|
125
|
+
}, z.core.$strip>>;
|
|
126
|
+
browser: z.ZodOptional<z.ZodString>;
|
|
127
|
+
os: z.ZodOptional<z.ZodString>;
|
|
128
|
+
colorScheme: z.ZodOptional<z.ZodEnum<{
|
|
129
|
+
dark: "dark";
|
|
130
|
+
light: "light";
|
|
131
|
+
}>>;
|
|
132
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
133
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
134
|
+
}, z.core.$strip>>;
|
|
135
|
+
author: z.ZodObject<{
|
|
136
|
+
userId: z.ZodString;
|
|
137
|
+
name: z.ZodOptional<z.ZodString>;
|
|
138
|
+
email: z.ZodOptional<z.ZodString>;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
agentSession: z.ZodOptional<z.ZodObject<{
|
|
141
|
+
agent: z.ZodString;
|
|
142
|
+
key: z.ZodString;
|
|
143
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
144
|
+
}, z.core.$strip>>;
|
|
145
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
146
|
+
id: z.ZodString;
|
|
147
|
+
kind: z.ZodEnum<{
|
|
148
|
+
file: "file";
|
|
149
|
+
screenshot: "screenshot";
|
|
150
|
+
}>;
|
|
151
|
+
path: z.ZodOptional<z.ZodString>;
|
|
152
|
+
url: z.ZodOptional<z.ZodString>;
|
|
153
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
154
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
155
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
156
|
+
}, z.core.$strip>>>;
|
|
157
|
+
}, z.core.$strip>;
|
|
158
|
+
declare const PinSchema: z.ZodObject<{
|
|
159
|
+
text: z.ZodString;
|
|
160
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
161
|
+
move: "move";
|
|
162
|
+
note: "note";
|
|
163
|
+
}>>;
|
|
164
|
+
target: z.ZodOptional<z.ZodObject<{
|
|
165
|
+
url: z.ZodOptional<z.ZodString>;
|
|
166
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
167
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
168
|
+
rect: z.ZodOptional<z.ZodType<{
|
|
169
|
+
x: number;
|
|
170
|
+
y: number;
|
|
171
|
+
width: number;
|
|
172
|
+
height: number;
|
|
173
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
174
|
+
x: number;
|
|
175
|
+
y: number;
|
|
176
|
+
width: number;
|
|
177
|
+
height: number;
|
|
178
|
+
}, unknown>>>;
|
|
179
|
+
fixed: z.ZodOptional<z.ZodBoolean>;
|
|
180
|
+
anchor: z.ZodOptional<z.ZodString>;
|
|
181
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
182
|
+
file: z.ZodString;
|
|
183
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
184
|
+
via: z.ZodEnum<{
|
|
185
|
+
framework: "framework";
|
|
186
|
+
none: "none";
|
|
187
|
+
plugin: "plugin";
|
|
188
|
+
}>;
|
|
189
|
+
}, z.core.$strip>>;
|
|
190
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
191
|
+
classes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
192
|
+
styles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
193
|
+
aria: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
194
|
+
nearbyText: z.ZodOptional<z.ZodString>;
|
|
195
|
+
selectedText: z.ZodOptional<z.ZodString>;
|
|
196
|
+
}, z.core.$strip>>;
|
|
197
|
+
}, z.core.$strip>>;
|
|
198
|
+
move: z.ZodOptional<z.ZodObject<{
|
|
199
|
+
from: z.ZodType<{
|
|
200
|
+
x: number;
|
|
201
|
+
y: number;
|
|
202
|
+
width: number;
|
|
203
|
+
height: number;
|
|
204
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
205
|
+
x: number;
|
|
206
|
+
y: number;
|
|
207
|
+
width: number;
|
|
208
|
+
height: number;
|
|
209
|
+
}, unknown>>;
|
|
210
|
+
to: z.ZodType<{
|
|
211
|
+
x: number;
|
|
212
|
+
y: number;
|
|
213
|
+
width: number;
|
|
214
|
+
height: number;
|
|
215
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
216
|
+
x: number;
|
|
217
|
+
y: number;
|
|
218
|
+
width: number;
|
|
219
|
+
height: number;
|
|
220
|
+
}, unknown>>;
|
|
221
|
+
}, z.core.$strip>>;
|
|
222
|
+
env: z.ZodOptional<z.ZodObject<{
|
|
223
|
+
viewport: z.ZodOptional<z.ZodObject<{
|
|
224
|
+
w: z.ZodNumber;
|
|
225
|
+
h: z.ZodNumber;
|
|
226
|
+
dpr: z.ZodNumber;
|
|
227
|
+
}, z.core.$strip>>;
|
|
228
|
+
browser: z.ZodOptional<z.ZodString>;
|
|
229
|
+
os: z.ZodOptional<z.ZodString>;
|
|
230
|
+
colorScheme: z.ZodOptional<z.ZodEnum<{
|
|
231
|
+
dark: "dark";
|
|
232
|
+
light: "light";
|
|
233
|
+
}>>;
|
|
234
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
235
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
236
|
+
}, z.core.$strip>>;
|
|
237
|
+
author: z.ZodObject<{
|
|
238
|
+
userId: z.ZodString;
|
|
239
|
+
name: z.ZodOptional<z.ZodString>;
|
|
240
|
+
email: z.ZodOptional<z.ZodString>;
|
|
241
|
+
}, z.core.$strip>;
|
|
242
|
+
agentSession: z.ZodOptional<z.ZodObject<{
|
|
243
|
+
agent: z.ZodString;
|
|
244
|
+
key: z.ZodString;
|
|
245
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
246
|
+
}, z.core.$strip>>;
|
|
247
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
248
|
+
id: z.ZodString;
|
|
249
|
+
kind: z.ZodEnum<{
|
|
250
|
+
file: "file";
|
|
251
|
+
screenshot: "screenshot";
|
|
252
|
+
}>;
|
|
253
|
+
path: z.ZodOptional<z.ZodString>;
|
|
254
|
+
url: z.ZodOptional<z.ZodString>;
|
|
255
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
256
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
257
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
258
|
+
}, z.core.$strip>>>;
|
|
259
|
+
id: z.ZodString;
|
|
260
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
261
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
262
|
+
open: "open";
|
|
263
|
+
resolved: "resolved";
|
|
264
|
+
}>>;
|
|
265
|
+
createdAt: z.ZodString;
|
|
266
|
+
resolution: z.ZodOptional<z.ZodObject<{
|
|
267
|
+
by: z.ZodEnum<{
|
|
268
|
+
agent: "agent";
|
|
269
|
+
human: "human";
|
|
270
|
+
}>;
|
|
271
|
+
note: z.ZodOptional<z.ZodString>;
|
|
272
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
273
|
+
at: z.ZodString;
|
|
274
|
+
}, z.core.$strip>>;
|
|
275
|
+
verification: z.ZodOptional<z.ZodObject<{
|
|
276
|
+
outcome: z.ZodEnum<{
|
|
277
|
+
accepted: "accepted";
|
|
278
|
+
reopened: "reopened";
|
|
279
|
+
}>;
|
|
280
|
+
at: z.ZodString;
|
|
281
|
+
}, z.core.$strip>>;
|
|
282
|
+
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
283
|
+
connector: z.ZodString;
|
|
284
|
+
ref: z.ZodString;
|
|
285
|
+
url: z.ZodString;
|
|
286
|
+
}, z.core.$strip>>>;
|
|
287
|
+
}, z.core.$strip>;
|
|
288
|
+
type Rect = z.infer<typeof RectSchema>;
|
|
289
|
+
type Pin = z.infer<typeof PinSchema>;
|
|
290
|
+
type PinInput = z.infer<typeof PinInputSchema>;
|
|
291
|
+
type ThreadMessage = z.infer<typeof ThreadMessageSchema>;
|
|
292
|
+
type SessionRef = z.infer<typeof SessionRefSchema>;
|
|
293
|
+
type Attachment = z.infer<typeof AttachmentSchema>;
|
|
294
|
+
type Link = z.infer<typeof LinkSchema>;
|
|
295
|
+
declare function pinJsonSchema(): Record<string, unknown>;
|
|
296
|
+
//#endregion
|
|
297
|
+
export { Pin as a, PinSchema as c, SCHEMA_VERSION as d, SessionRef as f, pinJsonSchema as g, ThreadMessageSchema as h, LinkSchema as i, Rect as l, ThreadMessage as m, AttachmentSchema as n, PinInput as o, SessionRefSchema as p, Link as r, PinInputSchema as s, Attachment as t, RectSchema as u };
|
package/dist/schema.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as Pin, c as PinSchema, d as SCHEMA_VERSION, f as SessionRef, g as pinJsonSchema, h as ThreadMessageSchema, i as LinkSchema, l as Rect, m as ThreadMessage, n as AttachmentSchema, o as PinInput, p as SessionRefSchema, r as Link, s as PinInputSchema, t as Attachment, u as RectSchema } from "./schema-BOTmn5SM.js";
|
|
2
|
+
export { Attachment, AttachmentSchema, Link, LinkSchema, Pin, PinInput, PinInputSchema, PinSchema, Rect, RectSchema, SCHEMA_VERSION, SessionRef, SessionRefSchema, ThreadMessage, ThreadMessageSchema, pinJsonSchema };
|
package/dist/schema.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/schema.ts
|
|
3
|
+
const SCHEMA_VERSION = 1;
|
|
4
|
+
const RectSchema = z.object({
|
|
5
|
+
x: z.number(),
|
|
6
|
+
y: z.number(),
|
|
7
|
+
width: z.number(),
|
|
8
|
+
height: z.number()
|
|
9
|
+
});
|
|
10
|
+
const SessionRefSchema = z.object({
|
|
11
|
+
agent: z.string(),
|
|
12
|
+
key: z.string(),
|
|
13
|
+
cwd: z.string().optional()
|
|
14
|
+
});
|
|
15
|
+
const AttachmentSchema = z.object({
|
|
16
|
+
id: z.string(),
|
|
17
|
+
kind: z.enum(["screenshot", "file"]),
|
|
18
|
+
path: z.string().optional(),
|
|
19
|
+
url: z.string().optional(),
|
|
20
|
+
contentType: z.string().optional(),
|
|
21
|
+
width: z.number().int().optional(),
|
|
22
|
+
height: z.number().int().optional()
|
|
23
|
+
});
|
|
24
|
+
const ThreadMessageSchema = z.object({
|
|
25
|
+
id: z.string(),
|
|
26
|
+
pinId: z.string(),
|
|
27
|
+
role: z.enum([
|
|
28
|
+
"human",
|
|
29
|
+
"agent",
|
|
30
|
+
"mirror"
|
|
31
|
+
]),
|
|
32
|
+
origin: z.string().optional(),
|
|
33
|
+
text: z.string(),
|
|
34
|
+
attachments: z.array(AttachmentSchema).optional(),
|
|
35
|
+
at: z.string()
|
|
36
|
+
});
|
|
37
|
+
const SourceSchema = z.object({
|
|
38
|
+
file: z.string(),
|
|
39
|
+
line: z.number().optional(),
|
|
40
|
+
via: z.enum([
|
|
41
|
+
"plugin",
|
|
42
|
+
"framework",
|
|
43
|
+
"none"
|
|
44
|
+
])
|
|
45
|
+
});
|
|
46
|
+
const ContextSchema = z.object({
|
|
47
|
+
classes: z.array(z.string()).optional(),
|
|
48
|
+
styles: z.record(z.string(), z.string()).optional(),
|
|
49
|
+
aria: z.record(z.string(), z.string()).optional(),
|
|
50
|
+
nearbyText: z.string().optional(),
|
|
51
|
+
selectedText: z.string().optional()
|
|
52
|
+
});
|
|
53
|
+
const TargetSchema = z.object({
|
|
54
|
+
url: z.string().optional(),
|
|
55
|
+
selector: z.string().optional(),
|
|
56
|
+
tag: z.string().optional(),
|
|
57
|
+
rect: RectSchema.optional(),
|
|
58
|
+
fixed: z.boolean().optional(),
|
|
59
|
+
anchor: z.string().optional(),
|
|
60
|
+
source: SourceSchema.optional(),
|
|
61
|
+
context: ContextSchema.optional()
|
|
62
|
+
});
|
|
63
|
+
const EnvSchema = z.object({
|
|
64
|
+
viewport: z.object({
|
|
65
|
+
w: z.number(),
|
|
66
|
+
h: z.number(),
|
|
67
|
+
dpr: z.number()
|
|
68
|
+
}).optional(),
|
|
69
|
+
browser: z.string().optional(),
|
|
70
|
+
os: z.string().optional(),
|
|
71
|
+
colorScheme: z.enum(["light", "dark"]).optional(),
|
|
72
|
+
branch: z.string().optional(),
|
|
73
|
+
commit: z.string().optional()
|
|
74
|
+
});
|
|
75
|
+
const AuthorSchema = z.object({
|
|
76
|
+
userId: z.string(),
|
|
77
|
+
name: z.string().optional(),
|
|
78
|
+
email: z.string().optional()
|
|
79
|
+
});
|
|
80
|
+
const ResolutionSchema = z.object({
|
|
81
|
+
by: z.enum(["human", "agent"]),
|
|
82
|
+
note: z.string().optional(),
|
|
83
|
+
commit: z.string().optional(),
|
|
84
|
+
at: z.string()
|
|
85
|
+
});
|
|
86
|
+
const VerificationSchema = z.object({
|
|
87
|
+
outcome: z.enum(["accepted", "reopened"]),
|
|
88
|
+
at: z.string()
|
|
89
|
+
});
|
|
90
|
+
const LinkSchema = z.object({
|
|
91
|
+
connector: z.string(),
|
|
92
|
+
ref: z.string(),
|
|
93
|
+
url: z.string()
|
|
94
|
+
});
|
|
95
|
+
const PinInputSchema = z.object({
|
|
96
|
+
text: z.string().min(1),
|
|
97
|
+
kind: z.enum(["note", "move"]).default("note"),
|
|
98
|
+
target: TargetSchema.optional(),
|
|
99
|
+
move: z.object({
|
|
100
|
+
from: RectSchema,
|
|
101
|
+
to: RectSchema
|
|
102
|
+
}).optional(),
|
|
103
|
+
env: EnvSchema.optional(),
|
|
104
|
+
author: AuthorSchema,
|
|
105
|
+
agentSession: SessionRefSchema.optional(),
|
|
106
|
+
attachments: z.array(AttachmentSchema).optional()
|
|
107
|
+
});
|
|
108
|
+
const PinSchema = PinInputSchema.extend({
|
|
109
|
+
id: z.string().regex(/^pin_[a-z0-9]{10}$/),
|
|
110
|
+
schemaVersion: z.literal(1),
|
|
111
|
+
status: z.enum(["open", "resolved"]).default("open"),
|
|
112
|
+
createdAt: z.string(),
|
|
113
|
+
resolution: ResolutionSchema.optional(),
|
|
114
|
+
verification: VerificationSchema.optional(),
|
|
115
|
+
links: z.array(LinkSchema).optional()
|
|
116
|
+
});
|
|
117
|
+
function pinJsonSchema() {
|
|
118
|
+
return z.toJSONSchema(PinSchema);
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
export { AttachmentSchema, LinkSchema, PinInputSchema, PinSchema, RectSchema, SCHEMA_VERSION, SessionRefSchema, ThreadMessageSchema, pinJsonSchema };
|