dsh-draw 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/CHANGELOG.md +29 -0
- package/LICENSE +201 -0
- package/README.es.md +194 -0
- package/README.hi.md +194 -0
- package/README.md +194 -0
- package/README.pt.md +194 -0
- package/README.zh.md +194 -0
- package/SECURITY.md +39 -0
- package/THIRD_PARTY_NOTICES.md +21 -0
- package/cordis.patch.yml +48 -0
- package/lib/client.js +4787 -0
- package/lib/client.js.map +1 -0
- package/lib/index.js +1429 -0
- package/lib/typert.host.js +26 -0
- package/lib/types/client/DrawResultCard.d.ts +58 -0
- package/lib/types/client/DrawResultCard.d.ts.map +1 -0
- package/lib/types/client/DrawResultCard.js +48 -0
- package/lib/types/client/DrawSettingsTab.d.ts +31 -0
- package/lib/types/client/DrawSettingsTab.d.ts.map +1 -0
- package/lib/types/client/DrawSettingsTab.js +129 -0
- package/lib/types/client/index.d.ts +35 -0
- package/lib/types/client/index.d.ts.map +1 -0
- package/lib/types/client/index.js +98 -0
- package/lib/types/client/locales.d.ts +14 -0
- package/lib/types/client/locales.d.ts.map +1 -0
- package/lib/types/client/locales.js +57 -0
- package/lib/types/client/present.d.ts +80 -0
- package/lib/types/client/present.d.ts.map +1 -0
- package/lib/types/client/present.js +86 -0
- package/lib/types/client/remote.d.ts +268 -0
- package/lib/types/client/remote.d.ts.map +1 -0
- package/lib/types/client/remote.js +15 -0
- package/lib/types/client/styles.d.ts +11 -0
- package/lib/types/client/styles.d.ts.map +1 -0
- package/lib/types/client/styles.js +43 -0
- package/lib/types/config.d.ts +160 -0
- package/lib/types/config.d.ts.map +1 -0
- package/lib/types/config.js +230 -0
- package/lib/types/drawer.d.ts +114 -0
- package/lib/types/drawer.d.ts.map +1 -0
- package/lib/types/drawer.js +138 -0
- package/lib/types/engine.d.ts +58 -0
- package/lib/types/engine.d.ts.map +1 -0
- package/lib/types/engine.js +135 -0
- package/lib/types/http.d.ts +89 -0
- package/lib/types/http.d.ts.map +1 -0
- package/lib/types/http.js +127 -0
- package/lib/types/index.d.ts +43 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +78 -0
- package/lib/types/quota.d.ts +69 -0
- package/lib/types/quota.d.ts.map +1 -0
- package/lib/types/quota.js +56 -0
- package/lib/types/router.d.ts +141 -0
- package/lib/types/router.d.ts.map +1 -0
- package/lib/types/router.js +207 -0
- package/lib/types/sanitize.d.ts +40 -0
- package/lib/types/sanitize.d.ts.map +1 -0
- package/lib/types/sanitize.js +103 -0
- package/lib/types/service.d.ts +59 -0
- package/lib/types/service.d.ts.map +1 -0
- package/lib/types/service.js +131 -0
- package/lib/types/session-events.d.ts +66 -0
- package/lib/types/session-events.d.ts.map +1 -0
- package/lib/types/session-events.js +32 -0
- package/lib/types/tool.d.ts +30 -0
- package/lib/types/tool.d.ts.map +1 -0
- package/lib/types/tool.js +131 -0
- package/lib/types/translate.d.ts +64 -0
- package/lib/types/translate.d.ts.map +1 -0
- package/lib/types/translate.js +56 -0
- package/lib/types/typert.host.d.ts +250 -0
- package/lib/types/typert.host.d.ts.map +1 -0
- package/lib/types/typert.host.js +23 -0
- package/lib/types/version.d.ts +10 -0
- package/lib/types/version.d.ts.map +1 -0
- package/lib/types/version.js +9 -0
- package/lib/types/wire.d.ts +699 -0
- package/lib/types/wire.d.ts.map +1 -0
- package/lib/types/wire.js +273 -0
- package/lib/wire-Cc4JZ3jR.js +4370 -0
- package/package.json +179 -0
- package/src/client/DrawResultCard.tsx +100 -0
- package/src/client/DrawSettingsTab.tsx +159 -0
- package/src/client/index.ts +123 -0
- package/src/client/locales.ts +84 -0
- package/src/client/present.ts +137 -0
- package/src/client/remote.ts +44 -0
- package/src/client/styles.ts +44 -0
- package/src/config.ts +358 -0
- package/src/drawer.ts +234 -0
- package/src/engine.ts +182 -0
- package/src/http.ts +161 -0
- package/src/index.ts +93 -0
- package/src/quota.ts +98 -0
- package/src/router.ts +309 -0
- package/src/sanitize.ts +113 -0
- package/src/service.ts +169 -0
- package/src/session-events.ts +70 -0
- package/src/tool.ts +145 -0
- package/src/translate.ts +101 -0
- package/src/typert.host.ts +25 -0
- package/src/version.ts +10 -0
- package/src/wire.ts +417 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../src/wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C,qFAAqF;AACrF,MAAM,WAAW,oBAAoB;IACnC,2DAA2D;IAC3D,UAAU,EAAE,OAAO,CAAA;IACnB,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,8DAA8D;IAC9D,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,+BAA+B;AAC/B,MAAM,WAAW,UAAU;IACzB,iBAAiB;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,uEAAuE;IACvE,SAAS,EAAE,MAAM,CAAA;IACjB,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAA;IAChB,8CAA8C;IAC9C,SAAS,EAAE,OAAO,CAAA;IAClB,mCAAmC;IACnC,UAAU,EAAE,oBAAoB,CAAA;IAChC,sBAAsB;IACtB,MAAM,EAAE;QACN,mDAAmD;QACnD,mBAAmB,EAAE,MAAM,CAAA;QAC3B,iFAAiF;QACjF,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;QAC5B,uDAAuD;QACvD,SAAS,EAAE,MAAM,GAAG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R,MAAM;qBACT,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuBrB,0BAA0B;sBACrB,UAAU;wBACR,MAAM;qBACT,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BpB,CAAA"}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The panel's wire vocabulary: the snapshot and action types served over the
|
|
3
|
+
* `draw` Remote namespace, their zod v4 validation schemas (the strict codecs
|
|
4
|
+
* both Typert faces carry), and the invocation descriptors shared verbatim by
|
|
5
|
+
* the host `./typert` manifest and the client Remote contribution. One
|
|
6
|
+
* canonical source for both faces keeps the host and client codecs from ever
|
|
7
|
+
* drifting apart.
|
|
8
|
+
*
|
|
9
|
+
* @module dsh-draw/wire
|
|
10
|
+
*/
|
|
11
|
+
import { z } from 'zod';
|
|
12
|
+
/** Strict wire schema for {@link DrawStatusSnapshot} (zod v4, both Typert faces). */
|
|
13
|
+
export const DRAW_STATUS_SCHEMA = z.object({
|
|
14
|
+
pluginVersion: z.string(),
|
|
15
|
+
engines: z.array(z.object({
|
|
16
|
+
id: z.string(),
|
|
17
|
+
model: z.string(),
|
|
18
|
+
baseUrl: z.string(),
|
|
19
|
+
apiKeyRef: z.string(),
|
|
20
|
+
enabled: z.boolean(),
|
|
21
|
+
preferred: z.boolean(),
|
|
22
|
+
credential: z.object({
|
|
23
|
+
configured: z.boolean(),
|
|
24
|
+
source: z.string().optional(),
|
|
25
|
+
writable: z.boolean(),
|
|
26
|
+
}),
|
|
27
|
+
health: z.object({
|
|
28
|
+
consecutiveFailures: z.number().int(),
|
|
29
|
+
cooldownUntil: z.number().int().nullable(),
|
|
30
|
+
lastError: z.string().nullable(),
|
|
31
|
+
lastStatus: z.number().int().nullable(),
|
|
32
|
+
}),
|
|
33
|
+
})),
|
|
34
|
+
quota: z.object({
|
|
35
|
+
maxGenerationsPerSession: z.number().int(),
|
|
36
|
+
maxBytesPerSession: z.number().int(),
|
|
37
|
+
}),
|
|
38
|
+
requestTimeoutMs: z.number().int(),
|
|
39
|
+
maxImagesPerCall: z.number().int(),
|
|
40
|
+
});
|
|
41
|
+
/** Strict wire schema for {@link DrawProbeResult}. */
|
|
42
|
+
export const DRAW_PROBE_SCHEMA = z.object({
|
|
43
|
+
engineId: z.string(),
|
|
44
|
+
reachable: z.boolean(),
|
|
45
|
+
httpStatus: z.number().int().nullable(),
|
|
46
|
+
target: z.string(),
|
|
47
|
+
note: z.string(),
|
|
48
|
+
credentialConfigured: z.boolean(),
|
|
49
|
+
});
|
|
50
|
+
/** Strict wire schema for {@link CredentialActionResult}. */
|
|
51
|
+
export const CREDENTIAL_ACTION_SCHEMA = z.object({
|
|
52
|
+
engineId: z.string(),
|
|
53
|
+
reference: z.string(),
|
|
54
|
+
note: z.string(),
|
|
55
|
+
});
|
|
56
|
+
/** Strict wire schema for {@link DrawRegenerateResult}. */
|
|
57
|
+
export const DRAW_REGENERATE_SCHEMA = z.object({
|
|
58
|
+
engine: z.string(),
|
|
59
|
+
model: z.string(),
|
|
60
|
+
size: z.string(),
|
|
61
|
+
images: z.array(z.object({
|
|
62
|
+
attachmentId: z.string(),
|
|
63
|
+
mediaType: z.string(),
|
|
64
|
+
bytes: z.number().int(),
|
|
65
|
+
width: z.number().int(),
|
|
66
|
+
height: z.number().int(),
|
|
67
|
+
name: z.string().optional(),
|
|
68
|
+
})),
|
|
69
|
+
quota: z.object({ generations: z.number().int(), bytes: z.number().int() }),
|
|
70
|
+
quotaLimits: z.object({ maxGenerations: z.number().int(), maxBytes: z.number().int() }),
|
|
71
|
+
fallbackUsed: z.boolean(),
|
|
72
|
+
elapsedMs: z.number().int(),
|
|
73
|
+
attempts: z.array(z.object({
|
|
74
|
+
engine: z.string(),
|
|
75
|
+
phase: z.union([z.literal('credential'), z.literal('request'), z.literal('parse')]).optional(),
|
|
76
|
+
code: z.string(),
|
|
77
|
+
message: z.string().optional(),
|
|
78
|
+
status: z.number().int().optional(),
|
|
79
|
+
})),
|
|
80
|
+
});
|
|
81
|
+
/** Project a draw outcome image onto the wire shape. */
|
|
82
|
+
export function imageToWire(image) {
|
|
83
|
+
return {
|
|
84
|
+
attachmentId: image.attachmentId,
|
|
85
|
+
mediaType: image.mediaType,
|
|
86
|
+
bytes: image.bytes,
|
|
87
|
+
width: image.width,
|
|
88
|
+
height: image.height,
|
|
89
|
+
...(image.name !== undefined ? { name: image.name } : {}),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/** Project a router engine status onto the panel view shape. */
|
|
93
|
+
export function statusToView(status, engine, credential) {
|
|
94
|
+
return {
|
|
95
|
+
id: engine.id,
|
|
96
|
+
model: engine.model,
|
|
97
|
+
baseUrl: engine.baseUrl,
|
|
98
|
+
apiKeyRef: engine.apiKeyRef,
|
|
99
|
+
enabled: engine.enabled,
|
|
100
|
+
preferred: engine.preferred,
|
|
101
|
+
credential,
|
|
102
|
+
health: {
|
|
103
|
+
consecutiveFailures: status.consecutiveFailures,
|
|
104
|
+
cooldownUntil: status.cooldownUntil,
|
|
105
|
+
lastError: status.lastError,
|
|
106
|
+
lastStatus: status.lastStatus,
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/** Project a probe outcome onto the wire shape. */
|
|
111
|
+
export function probeToWire(probe) {
|
|
112
|
+
return {
|
|
113
|
+
engineId: probe.engineId,
|
|
114
|
+
reachable: probe.reachable,
|
|
115
|
+
httpStatus: probe.httpStatus,
|
|
116
|
+
target: probe.target,
|
|
117
|
+
note: probe.note,
|
|
118
|
+
credentialConfigured: probe.credentialConfigured,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/** JSON codec for one engine id. */
|
|
122
|
+
const ENGINE_ID_CODEC = z.string();
|
|
123
|
+
/** JSON codec for one credential value (non-empty). */
|
|
124
|
+
const CREDENTIAL_VALUE_CODEC = z.string().min(1);
|
|
125
|
+
/** JSON codec for regenerate arguments: the original tool args, verbatim. */
|
|
126
|
+
const REGENERATE_ARGS_CODEC = z.object({
|
|
127
|
+
prompt: z.string().min(1),
|
|
128
|
+
size: z.string().optional(),
|
|
129
|
+
count: z.number().int().optional(),
|
|
130
|
+
quality: z.string().optional(),
|
|
131
|
+
style: z.string().optional(),
|
|
132
|
+
engine: z.string().optional(),
|
|
133
|
+
}).passthrough();
|
|
134
|
+
/** JSON codec for one session id (the wire carries the branded id as a string). */
|
|
135
|
+
const SESSION_ID_CODEC = z.string().min(1);
|
|
136
|
+
/**
|
|
137
|
+
* The `draw/status` invocation descriptor: the settings-panel snapshot.
|
|
138
|
+
*/
|
|
139
|
+
export const DRAW_STATUS_DESCRIPTOR = Object.freeze({
|
|
140
|
+
id: 'dsh-draw#draw/status',
|
|
141
|
+
service: 'dsh-draw',
|
|
142
|
+
namespace: 'draw',
|
|
143
|
+
method: 'status',
|
|
144
|
+
invocation: Object.freeze({ kind: 'direct' }),
|
|
145
|
+
parameters: Object.freeze([]),
|
|
146
|
+
result: Object.freeze({
|
|
147
|
+
mode: 'strict',
|
|
148
|
+
typeSymbol: 'dsh-draw/types#DrawStatusSnapshot',
|
|
149
|
+
schema: DRAW_STATUS_SCHEMA,
|
|
150
|
+
}),
|
|
151
|
+
sourceLocation: Object.freeze({ file: 'src/wire.ts', line: 1, column: 1 }),
|
|
152
|
+
});
|
|
153
|
+
/**
|
|
154
|
+
* The `draw/probe` invocation descriptor: one engine's connectivity check.
|
|
155
|
+
*/
|
|
156
|
+
export const DRAW_PROBE_DESCRIPTOR = Object.freeze({
|
|
157
|
+
id: 'dsh-draw#draw/probe',
|
|
158
|
+
service: 'dsh-draw',
|
|
159
|
+
namespace: 'draw',
|
|
160
|
+
method: 'probe',
|
|
161
|
+
invocation: Object.freeze({ kind: 'direct' }),
|
|
162
|
+
parameters: Object.freeze([Object.freeze({
|
|
163
|
+
name: 'engineId',
|
|
164
|
+
wire: 'engineId',
|
|
165
|
+
source: 'json',
|
|
166
|
+
codec: Object.freeze({
|
|
167
|
+
mode: 'strict',
|
|
168
|
+
typeSymbol: 'dsh-draw/types#EngineId',
|
|
169
|
+
schema: ENGINE_ID_CODEC,
|
|
170
|
+
}),
|
|
171
|
+
})]),
|
|
172
|
+
result: Object.freeze({
|
|
173
|
+
mode: 'strict',
|
|
174
|
+
typeSymbol: 'dsh-draw/types#DrawProbeResult',
|
|
175
|
+
schema: DRAW_PROBE_SCHEMA,
|
|
176
|
+
}),
|
|
177
|
+
sourceLocation: Object.freeze({ file: 'src/wire.ts', line: 1, column: 1 }),
|
|
178
|
+
});
|
|
179
|
+
/**
|
|
180
|
+
* The `draw/setCredential` invocation descriptor: store an API key under the
|
|
181
|
+
* engine's credential reference. The value crosses the wire once and is never
|
|
182
|
+
* logged, snapshotted, or returned.
|
|
183
|
+
*/
|
|
184
|
+
export const DRAW_SET_CREDENTIAL_DESCRIPTOR = Object.freeze({
|
|
185
|
+
id: 'dsh-draw#draw/setCredential',
|
|
186
|
+
service: 'dsh-draw',
|
|
187
|
+
namespace: 'draw',
|
|
188
|
+
method: 'setCredential',
|
|
189
|
+
invocation: Object.freeze({ kind: 'direct' }),
|
|
190
|
+
parameters: Object.freeze([
|
|
191
|
+
Object.freeze({
|
|
192
|
+
name: 'engineId',
|
|
193
|
+
wire: 'engineId',
|
|
194
|
+
source: 'json',
|
|
195
|
+
codec: Object.freeze({ mode: 'strict', typeSymbol: 'dsh-draw/types#EngineId', schema: ENGINE_ID_CODEC }),
|
|
196
|
+
}),
|
|
197
|
+
Object.freeze({
|
|
198
|
+
name: 'value',
|
|
199
|
+
wire: 'value',
|
|
200
|
+
source: 'json',
|
|
201
|
+
codec: Object.freeze({ mode: 'strict', typeSymbol: 'dsh-draw/types#CredentialValue', schema: CREDENTIAL_VALUE_CODEC }),
|
|
202
|
+
}),
|
|
203
|
+
]),
|
|
204
|
+
result: Object.freeze({
|
|
205
|
+
mode: 'strict',
|
|
206
|
+
typeSymbol: 'dsh-draw/types#CredentialActionResult',
|
|
207
|
+
schema: CREDENTIAL_ACTION_SCHEMA,
|
|
208
|
+
}),
|
|
209
|
+
sourceLocation: Object.freeze({ file: 'src/wire.ts', line: 1, column: 1 }),
|
|
210
|
+
});
|
|
211
|
+
/**
|
|
212
|
+
* The `draw/unsetCredential` invocation descriptor: remove a stored API key.
|
|
213
|
+
*/
|
|
214
|
+
export const DRAW_UNSET_CREDENTIAL_DESCRIPTOR = Object.freeze({
|
|
215
|
+
id: 'dsh-draw#draw/unsetCredential',
|
|
216
|
+
service: 'dsh-draw',
|
|
217
|
+
namespace: 'draw',
|
|
218
|
+
method: 'unsetCredential',
|
|
219
|
+
invocation: Object.freeze({ kind: 'direct' }),
|
|
220
|
+
parameters: Object.freeze([Object.freeze({
|
|
221
|
+
name: 'engineId',
|
|
222
|
+
wire: 'engineId',
|
|
223
|
+
source: 'json',
|
|
224
|
+
codec: Object.freeze({ mode: 'strict', typeSymbol: 'dsh-draw/types#EngineId', schema: ENGINE_ID_CODEC }),
|
|
225
|
+
})]),
|
|
226
|
+
result: Object.freeze({
|
|
227
|
+
mode: 'strict',
|
|
228
|
+
typeSymbol: 'dsh-draw/types#CredentialActionResult',
|
|
229
|
+
schema: CREDENTIAL_ACTION_SCHEMA,
|
|
230
|
+
}),
|
|
231
|
+
sourceLocation: Object.freeze({ file: 'src/wire.ts', line: 1, column: 1 }),
|
|
232
|
+
});
|
|
233
|
+
/**
|
|
234
|
+
* The `draw/regenerate` invocation descriptor: re-run a generation from the
|
|
235
|
+
* result card with the original tool args. The host re-runs the full drawer
|
|
236
|
+
* path (quota, routing, attachment storage, audit event) so a regenerate is
|
|
237
|
+
* as durable and accounted as a tool call.
|
|
238
|
+
*/
|
|
239
|
+
export const DRAW_REGENERATE_DESCRIPTOR = Object.freeze({
|
|
240
|
+
id: 'dsh-draw#draw/regenerate',
|
|
241
|
+
service: 'dsh-draw',
|
|
242
|
+
namespace: 'draw',
|
|
243
|
+
method: 'regenerate',
|
|
244
|
+
invocation: Object.freeze({ kind: 'direct' }),
|
|
245
|
+
parameters: Object.freeze([
|
|
246
|
+
Object.freeze({
|
|
247
|
+
name: 'sessionId',
|
|
248
|
+
wire: 'sessionId',
|
|
249
|
+
source: 'json',
|
|
250
|
+
codec: Object.freeze({ mode: 'strict', typeSymbol: 'dsh-draw/types#SessionId', schema: SESSION_ID_CODEC }),
|
|
251
|
+
}),
|
|
252
|
+
Object.freeze({
|
|
253
|
+
name: 'args',
|
|
254
|
+
wire: 'args',
|
|
255
|
+
source: 'json',
|
|
256
|
+
codec: Object.freeze({ mode: 'strict', typeSymbol: 'dsh-draw/types#RegenerateArgs', schema: REGENERATE_ARGS_CODEC }),
|
|
257
|
+
}),
|
|
258
|
+
]),
|
|
259
|
+
result: Object.freeze({
|
|
260
|
+
mode: 'strict',
|
|
261
|
+
typeSymbol: 'dsh-draw/types#DrawRegenerateResult',
|
|
262
|
+
schema: DRAW_REGENERATE_SCHEMA,
|
|
263
|
+
}),
|
|
264
|
+
sourceLocation: Object.freeze({ file: 'src/wire.ts', line: 1, column: 1 }),
|
|
265
|
+
});
|
|
266
|
+
/** The canonical invocation list both Typert faces register. */
|
|
267
|
+
export const DRAW_INVOCATIONS = Object.freeze([
|
|
268
|
+
DRAW_STATUS_DESCRIPTOR,
|
|
269
|
+
DRAW_PROBE_DESCRIPTOR,
|
|
270
|
+
DRAW_SET_CREDENTIAL_DESCRIPTOR,
|
|
271
|
+
DRAW_UNSET_CREDENTIAL_DESCRIPTOR,
|
|
272
|
+
DRAW_REGENERATE_DESCRIPTOR,
|
|
273
|
+
]);
|