@_davideast/stitch-mcp 0.5.5 → 0.7.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/dist/chunk-0xbbvsve.js +370 -0
- package/dist/chunk-0xbbvsve.js.map +16 -0
- package/dist/chunk-11ab03kg.js +137 -0
- package/dist/chunk-11ab03kg.js.map +10 -0
- package/dist/chunk-17cs61t4.js +270 -0
- package/dist/chunk-17cs61t4.js.map +10 -0
- package/dist/chunk-1mz7188j.js +20 -0
- package/dist/chunk-1mz7188j.js.map +9 -0
- package/dist/chunk-1txb8kjb.js +17 -0
- package/dist/chunk-1txb8kjb.js.map +9 -0
- package/dist/chunk-1v5q6d3n.js +17 -0
- package/dist/chunk-1v5q6d3n.js.map +9 -0
- package/dist/chunk-1wcg0pjg.js +94 -0
- package/dist/chunk-1wcg0pjg.js.map +10 -0
- package/dist/chunk-2zp03jky.js +19 -0
- package/dist/chunk-2zp03jky.js.map +9 -0
- package/dist/chunk-441ntz7a.js +137 -0
- package/dist/chunk-441ntz7a.js.map +10 -0
- package/dist/chunk-543135qd.js +43679 -0
- package/dist/chunk-543135qd.js.map +234 -0
- package/dist/chunk-564wpgj7.js +246 -0
- package/dist/chunk-564wpgj7.js.map +14 -0
- package/dist/chunk-5jbenaez.js +19185 -0
- package/dist/chunk-5jbenaez.js.map +115 -0
- package/dist/chunk-7ryqstaa.js +7065 -0
- package/dist/chunk-7ryqstaa.js.map +115 -0
- package/dist/chunk-86gwwcyr.js +46325 -0
- package/dist/chunk-86gwwcyr.js.map +261 -0
- package/dist/chunk-8gegrmmt.js +256 -0
- package/dist/chunk-8gegrmmt.js.map +11 -0
- package/dist/chunk-8hgrrc49.js +17 -0
- package/dist/chunk-8hgrrc49.js.map +9 -0
- package/dist/chunk-8w97w2wa.js +50 -0
- package/dist/chunk-8w97w2wa.js.map +9 -0
- package/dist/chunk-8yfetpqq.js +19132 -0
- package/dist/chunk-8yfetpqq.js.map +115 -0
- package/dist/chunk-94knm2sw.js +1495 -0
- package/dist/chunk-94knm2sw.js.map +23 -0
- package/dist/chunk-appd0sxm.js +5217 -0
- package/dist/chunk-appd0sxm.js.map +67 -0
- package/dist/chunk-c08qy4ty.js +67 -0
- package/dist/chunk-c08qy4ty.js.map +10 -0
- package/dist/chunk-d1ea3tmp.js +17 -0
- package/dist/chunk-d1ea3tmp.js.map +9 -0
- package/dist/chunk-ecn1ca83.js +34253 -0
- package/dist/chunk-ecn1ca83.js.map +261 -0
- package/dist/chunk-ef1c6gq5.js +947 -0
- package/dist/chunk-ef1c6gq5.js.map +28 -0
- package/dist/chunk-f0dt9hv8.js +680 -0
- package/dist/chunk-f0dt9hv8.js.map +17 -0
- package/dist/chunk-f2aj8ff8.js +11 -0
- package/dist/chunk-f2aj8ff8.js.map +9 -0
- package/dist/chunk-f3wp07zw.js +24 -0
- package/dist/chunk-f3wp07zw.js.map +9 -0
- package/dist/chunk-f5wqd3z3.js +10 -0
- package/dist/chunk-f5wqd3z3.js.map +9 -0
- package/dist/chunk-g8hwy0wx.js +504 -0
- package/dist/chunk-g8hwy0wx.js.map +21 -0
- package/dist/chunk-gcx3c3yc.js +680 -0
- package/dist/chunk-gcx3c3yc.js.map +17 -0
- package/dist/chunk-gq6vxp70.js +202 -0
- package/dist/chunk-gq6vxp70.js.map +13 -0
- package/dist/chunk-gw64p5pg.js +164 -0
- package/dist/chunk-gw64p5pg.js.map +10 -0
- package/dist/chunk-hst78da7.js +87 -0
- package/dist/chunk-hst78da7.js.map +13 -0
- package/dist/chunk-hsxpgjyd.js +256 -0
- package/dist/chunk-hsxpgjyd.js.map +11 -0
- package/dist/chunk-j1v44zzm.js +109 -0
- package/dist/chunk-j1v44zzm.js.map +10 -0
- package/dist/chunk-jfd5md63.js +736 -0
- package/dist/chunk-jfd5md63.js.map +16 -0
- package/dist/chunk-jvhzgyhy.js +62 -0
- package/dist/chunk-jvhzgyhy.js.map +10 -0
- package/dist/chunk-k86st2r8.js +7 -0
- package/dist/chunk-k86st2r8.js.map +9 -0
- package/dist/chunk-kztccppz.js +606 -0
- package/dist/chunk-kztccppz.js.map +15 -0
- package/dist/chunk-m2vk15q9.js +503 -0
- package/dist/chunk-m2vk15q9.js.map +21 -0
- package/dist/chunk-mk40f3ka.js +31529 -0
- package/dist/chunk-mk40f3ka.js.map +245 -0
- package/dist/chunk-mp1sf8x6.js +264 -0
- package/dist/chunk-mp1sf8x6.js.map +12 -0
- package/dist/chunk-n9fs543g.js +94 -0
- package/dist/chunk-n9fs543g.js.map +10 -0
- package/dist/chunk-nbbwjw90.js +165 -0
- package/dist/chunk-nbbwjw90.js.map +10 -0
- package/dist/chunk-qnd877d5.js +947 -0
- package/dist/chunk-qnd877d5.js.map +28 -0
- package/dist/chunk-rng2ypf7.js +538 -0
- package/dist/chunk-rng2ypf7.js.map +15 -0
- package/dist/chunk-sjq10wbw.js +39 -0
- package/dist/chunk-sjq10wbw.js.map +9 -0
- package/dist/chunk-snv6a65k.js +759 -0
- package/dist/chunk-snv6a65k.js.map +19 -0
- package/dist/chunk-sqhdg0mf.js +2138 -0
- package/dist/chunk-sqhdg0mf.js.map +44 -0
- package/dist/chunk-tebher8z.js +514 -0
- package/dist/chunk-tebher8z.js.map +12 -0
- package/dist/chunk-v0wtyr4k.js +66 -0
- package/dist/chunk-v0wtyr4k.js.map +10 -0
- package/dist/chunk-v20274k8.js +246 -0
- package/dist/chunk-v20274k8.js.map +14 -0
- package/dist/chunk-vcp9fp2w.js +839 -0
- package/dist/chunk-vcp9fp2w.js.map +11 -0
- package/dist/chunk-vz737k5f.js +269 -0
- package/dist/chunk-vz737k5f.js.map +10 -0
- package/dist/chunk-x6bsgeqa.js +736 -0
- package/dist/chunk-x6bsgeqa.js.map +16 -0
- package/dist/chunk-xg9kcbp1.js +371 -0
- package/dist/chunk-xg9kcbp1.js.map +16 -0
- package/dist/chunk-xhad5b8x.js +110 -0
- package/dist/chunk-xhad5b8x.js.map +10 -0
- package/dist/chunk-xkwa1mn5.js +203 -0
- package/dist/chunk-xkwa1mn5.js.map +13 -0
- package/dist/chunk-xtcg74kf.js +50 -0
- package/dist/chunk-xtcg74kf.js.map +9 -0
- package/dist/chunk-xzjkaqe9.js +759 -0
- package/dist/chunk-xzjkaqe9.js.map +19 -0
- package/dist/chunk-y65xgj69.js +1495 -0
- package/dist/chunk-y65xgj69.js.map +23 -0
- package/dist/commands/doctor/command.js +1 -1
- package/dist/commands/init/command.js +1 -1
- package/dist/commands/logout/command.js +1 -1
- package/dist/commands/proxy/LoggingCallToolHandler.d.ts +11 -0
- package/dist/commands/proxy/command.js +1 -1
- package/dist/commands/screens/command.js +4 -4
- package/dist/commands/serve/command.js +5 -5
- package/dist/commands/site/command.js +1 -1
- package/dist/commands/snapshot/command.js +1 -1
- package/dist/commands/tool/command.js +1 -1
- package/dist/commands/tool/steps/LogExecuteToolStep.d.ts +19 -0
- package/dist/commands/upload/command.d.ts +2 -0
- package/dist/commands/upload/command.js +77 -0
- package/dist/commands/upload/command.js.map +11 -0
- package/dist/commands/upload/handler.d.ts +20 -0
- package/dist/commands/upload/spec.d.ts +38 -0
- package/dist/commands/view/command.js +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/lib/log/append.d.ts +12 -0
- package/dist/lib/log/blob-store/handler.d.ts +10 -0
- package/dist/lib/log/blob-store/spec.d.ts +251 -0
- package/dist/lib/log/capture/handler.d.ts +10 -0
- package/dist/lib/log/capture/spec.d.ts +1504 -0
- package/dist/lib/log/factory.d.ts +4 -0
- package/package.json +2 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type AppendResult = {
|
|
2
|
+
success: true;
|
|
3
|
+
} | {
|
|
4
|
+
success: false;
|
|
5
|
+
error: {
|
|
6
|
+
code: 'EVENT_VALIDATION_FAILED' | 'EVENT_WRITE_FAILED';
|
|
7
|
+
message: string;
|
|
8
|
+
recoverable: boolean;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
/** Validate envelope shape and append exactly one JSON line, ending in `\n`. */
|
|
12
|
+
export declare function appendEvent(eventsPath: string, event: unknown): Promise<AppendResult>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BlobStoreSpec, PutResult, HasResult, GetResult } from './spec.js';
|
|
2
|
+
export declare class BlobStoreHandler implements BlobStoreSpec {
|
|
3
|
+
private readonly root;
|
|
4
|
+
constructor(root: string);
|
|
5
|
+
put(buffer: Buffer, mime: string): Promise<PutResult>;
|
|
6
|
+
private findBySha;
|
|
7
|
+
fetch(url: string, mimeHint?: string): Promise<PutResult>;
|
|
8
|
+
has(sha256: string): Promise<HasResult>;
|
|
9
|
+
get(sha256: string): Promise<GetResult>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const Sha256Schema: z.ZodString;
|
|
3
|
+
export declare const MimeSchema: z.ZodString;
|
|
4
|
+
export declare const BlobRefSchema: z.ZodObject<{
|
|
5
|
+
sha256: z.ZodString;
|
|
6
|
+
size: z.ZodNumber;
|
|
7
|
+
mime: z.ZodString;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
sha256: string;
|
|
10
|
+
size: number;
|
|
11
|
+
mime: string;
|
|
12
|
+
}, {
|
|
13
|
+
sha256: string;
|
|
14
|
+
size: number;
|
|
15
|
+
mime: string;
|
|
16
|
+
}>;
|
|
17
|
+
export type BlobRef = z.infer<typeof BlobRefSchema>;
|
|
18
|
+
export declare const BlobStoreErrorCodeSchema: z.ZodEnum<["BLOB_FETCH_NETWORK", "BLOB_FETCH_HTTP_ERROR", "BLOB_WRITE_FAILED", "BLOB_READ_FAILED", "BLOB_INVALID_INPUT"]>;
|
|
19
|
+
export type BlobStoreErrorCode = z.infer<typeof BlobStoreErrorCodeSchema>;
|
|
20
|
+
export declare const BlobStoreErrorSchema: z.ZodObject<{
|
|
21
|
+
code: z.ZodEnum<["BLOB_FETCH_NETWORK", "BLOB_FETCH_HTTP_ERROR", "BLOB_WRITE_FAILED", "BLOB_READ_FAILED", "BLOB_INVALID_INPUT"]>;
|
|
22
|
+
message: z.ZodString;
|
|
23
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
24
|
+
recoverable: z.ZodBoolean;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
code: "BLOB_FETCH_NETWORK" | "BLOB_FETCH_HTTP_ERROR" | "BLOB_WRITE_FAILED" | "BLOB_READ_FAILED" | "BLOB_INVALID_INPUT";
|
|
27
|
+
message: string;
|
|
28
|
+
recoverable: boolean;
|
|
29
|
+
suggestion?: string | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
code: "BLOB_FETCH_NETWORK" | "BLOB_FETCH_HTTP_ERROR" | "BLOB_WRITE_FAILED" | "BLOB_READ_FAILED" | "BLOB_INVALID_INPUT";
|
|
32
|
+
message: string;
|
|
33
|
+
recoverable: boolean;
|
|
34
|
+
suggestion?: string | undefined;
|
|
35
|
+
}>;
|
|
36
|
+
export type BlobStoreError = z.infer<typeof BlobStoreErrorSchema>;
|
|
37
|
+
export declare const PutSuccessSchema: z.ZodObject<{
|
|
38
|
+
success: z.ZodLiteral<true>;
|
|
39
|
+
data: z.ZodObject<{
|
|
40
|
+
sha256: z.ZodString;
|
|
41
|
+
size: z.ZodNumber;
|
|
42
|
+
mime: z.ZodString;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
sha256: string;
|
|
45
|
+
size: number;
|
|
46
|
+
mime: string;
|
|
47
|
+
}, {
|
|
48
|
+
sha256: string;
|
|
49
|
+
size: number;
|
|
50
|
+
mime: string;
|
|
51
|
+
}>;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
success: true;
|
|
54
|
+
data: {
|
|
55
|
+
sha256: string;
|
|
56
|
+
size: number;
|
|
57
|
+
mime: string;
|
|
58
|
+
};
|
|
59
|
+
}, {
|
|
60
|
+
success: true;
|
|
61
|
+
data: {
|
|
62
|
+
sha256: string;
|
|
63
|
+
size: number;
|
|
64
|
+
mime: string;
|
|
65
|
+
};
|
|
66
|
+
}>;
|
|
67
|
+
export declare const PutResultSchema: z.ZodUnion<[z.ZodObject<{
|
|
68
|
+
success: z.ZodLiteral<true>;
|
|
69
|
+
data: z.ZodObject<{
|
|
70
|
+
sha256: z.ZodString;
|
|
71
|
+
size: z.ZodNumber;
|
|
72
|
+
mime: z.ZodString;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
sha256: string;
|
|
75
|
+
size: number;
|
|
76
|
+
mime: string;
|
|
77
|
+
}, {
|
|
78
|
+
sha256: string;
|
|
79
|
+
size: number;
|
|
80
|
+
mime: string;
|
|
81
|
+
}>;
|
|
82
|
+
}, "strip", z.ZodTypeAny, {
|
|
83
|
+
success: true;
|
|
84
|
+
data: {
|
|
85
|
+
sha256: string;
|
|
86
|
+
size: number;
|
|
87
|
+
mime: string;
|
|
88
|
+
};
|
|
89
|
+
}, {
|
|
90
|
+
success: true;
|
|
91
|
+
data: {
|
|
92
|
+
sha256: string;
|
|
93
|
+
size: number;
|
|
94
|
+
mime: string;
|
|
95
|
+
};
|
|
96
|
+
}>, z.ZodObject<{
|
|
97
|
+
success: z.ZodLiteral<false>;
|
|
98
|
+
error: z.ZodObject<{
|
|
99
|
+
code: z.ZodEnum<["BLOB_FETCH_NETWORK", "BLOB_FETCH_HTTP_ERROR", "BLOB_WRITE_FAILED", "BLOB_READ_FAILED", "BLOB_INVALID_INPUT"]>;
|
|
100
|
+
message: z.ZodString;
|
|
101
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
102
|
+
recoverable: z.ZodBoolean;
|
|
103
|
+
}, "strip", z.ZodTypeAny, {
|
|
104
|
+
code: "BLOB_FETCH_NETWORK" | "BLOB_FETCH_HTTP_ERROR" | "BLOB_WRITE_FAILED" | "BLOB_READ_FAILED" | "BLOB_INVALID_INPUT";
|
|
105
|
+
message: string;
|
|
106
|
+
recoverable: boolean;
|
|
107
|
+
suggestion?: string | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
code: "BLOB_FETCH_NETWORK" | "BLOB_FETCH_HTTP_ERROR" | "BLOB_WRITE_FAILED" | "BLOB_READ_FAILED" | "BLOB_INVALID_INPUT";
|
|
110
|
+
message: string;
|
|
111
|
+
recoverable: boolean;
|
|
112
|
+
suggestion?: string | undefined;
|
|
113
|
+
}>;
|
|
114
|
+
}, "strip", z.ZodTypeAny, {
|
|
115
|
+
success: false;
|
|
116
|
+
error: {
|
|
117
|
+
code: "BLOB_FETCH_NETWORK" | "BLOB_FETCH_HTTP_ERROR" | "BLOB_WRITE_FAILED" | "BLOB_READ_FAILED" | "BLOB_INVALID_INPUT";
|
|
118
|
+
message: string;
|
|
119
|
+
recoverable: boolean;
|
|
120
|
+
suggestion?: string | undefined;
|
|
121
|
+
};
|
|
122
|
+
}, {
|
|
123
|
+
success: false;
|
|
124
|
+
error: {
|
|
125
|
+
code: "BLOB_FETCH_NETWORK" | "BLOB_FETCH_HTTP_ERROR" | "BLOB_WRITE_FAILED" | "BLOB_READ_FAILED" | "BLOB_INVALID_INPUT";
|
|
126
|
+
message: string;
|
|
127
|
+
recoverable: boolean;
|
|
128
|
+
suggestion?: string | undefined;
|
|
129
|
+
};
|
|
130
|
+
}>]>;
|
|
131
|
+
export type PutResult = z.infer<typeof PutResultSchema>;
|
|
132
|
+
export declare const HasSuccessSchema: z.ZodObject<{
|
|
133
|
+
success: z.ZodLiteral<true>;
|
|
134
|
+
data: z.ZodBoolean;
|
|
135
|
+
}, "strip", z.ZodTypeAny, {
|
|
136
|
+
success: true;
|
|
137
|
+
data: boolean;
|
|
138
|
+
}, {
|
|
139
|
+
success: true;
|
|
140
|
+
data: boolean;
|
|
141
|
+
}>;
|
|
142
|
+
export declare const HasResultSchema: z.ZodUnion<[z.ZodObject<{
|
|
143
|
+
success: z.ZodLiteral<true>;
|
|
144
|
+
data: z.ZodBoolean;
|
|
145
|
+
}, "strip", z.ZodTypeAny, {
|
|
146
|
+
success: true;
|
|
147
|
+
data: boolean;
|
|
148
|
+
}, {
|
|
149
|
+
success: true;
|
|
150
|
+
data: boolean;
|
|
151
|
+
}>, z.ZodObject<{
|
|
152
|
+
success: z.ZodLiteral<false>;
|
|
153
|
+
error: z.ZodObject<{
|
|
154
|
+
code: z.ZodEnum<["BLOB_FETCH_NETWORK", "BLOB_FETCH_HTTP_ERROR", "BLOB_WRITE_FAILED", "BLOB_READ_FAILED", "BLOB_INVALID_INPUT"]>;
|
|
155
|
+
message: z.ZodString;
|
|
156
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
157
|
+
recoverable: z.ZodBoolean;
|
|
158
|
+
}, "strip", z.ZodTypeAny, {
|
|
159
|
+
code: "BLOB_FETCH_NETWORK" | "BLOB_FETCH_HTTP_ERROR" | "BLOB_WRITE_FAILED" | "BLOB_READ_FAILED" | "BLOB_INVALID_INPUT";
|
|
160
|
+
message: string;
|
|
161
|
+
recoverable: boolean;
|
|
162
|
+
suggestion?: string | undefined;
|
|
163
|
+
}, {
|
|
164
|
+
code: "BLOB_FETCH_NETWORK" | "BLOB_FETCH_HTTP_ERROR" | "BLOB_WRITE_FAILED" | "BLOB_READ_FAILED" | "BLOB_INVALID_INPUT";
|
|
165
|
+
message: string;
|
|
166
|
+
recoverable: boolean;
|
|
167
|
+
suggestion?: string | undefined;
|
|
168
|
+
}>;
|
|
169
|
+
}, "strip", z.ZodTypeAny, {
|
|
170
|
+
success: false;
|
|
171
|
+
error: {
|
|
172
|
+
code: "BLOB_FETCH_NETWORK" | "BLOB_FETCH_HTTP_ERROR" | "BLOB_WRITE_FAILED" | "BLOB_READ_FAILED" | "BLOB_INVALID_INPUT";
|
|
173
|
+
message: string;
|
|
174
|
+
recoverable: boolean;
|
|
175
|
+
suggestion?: string | undefined;
|
|
176
|
+
};
|
|
177
|
+
}, {
|
|
178
|
+
success: false;
|
|
179
|
+
error: {
|
|
180
|
+
code: "BLOB_FETCH_NETWORK" | "BLOB_FETCH_HTTP_ERROR" | "BLOB_WRITE_FAILED" | "BLOB_READ_FAILED" | "BLOB_INVALID_INPUT";
|
|
181
|
+
message: string;
|
|
182
|
+
recoverable: boolean;
|
|
183
|
+
suggestion?: string | undefined;
|
|
184
|
+
};
|
|
185
|
+
}>]>;
|
|
186
|
+
export type HasResult = z.infer<typeof HasResultSchema>;
|
|
187
|
+
export declare const GetSuccessSchema: z.ZodObject<{
|
|
188
|
+
success: z.ZodLiteral<true>;
|
|
189
|
+
data: z.ZodNullable<z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
|
|
190
|
+
}, "strip", z.ZodTypeAny, {
|
|
191
|
+
success: true;
|
|
192
|
+
data: Buffer<ArrayBufferLike> | null;
|
|
193
|
+
}, {
|
|
194
|
+
success: true;
|
|
195
|
+
data: Buffer<ArrayBufferLike> | null;
|
|
196
|
+
}>;
|
|
197
|
+
export declare const GetResultSchema: z.ZodUnion<[z.ZodObject<{
|
|
198
|
+
success: z.ZodLiteral<true>;
|
|
199
|
+
data: z.ZodNullable<z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
|
|
200
|
+
}, "strip", z.ZodTypeAny, {
|
|
201
|
+
success: true;
|
|
202
|
+
data: Buffer<ArrayBufferLike> | null;
|
|
203
|
+
}, {
|
|
204
|
+
success: true;
|
|
205
|
+
data: Buffer<ArrayBufferLike> | null;
|
|
206
|
+
}>, z.ZodObject<{
|
|
207
|
+
success: z.ZodLiteral<false>;
|
|
208
|
+
error: z.ZodObject<{
|
|
209
|
+
code: z.ZodEnum<["BLOB_FETCH_NETWORK", "BLOB_FETCH_HTTP_ERROR", "BLOB_WRITE_FAILED", "BLOB_READ_FAILED", "BLOB_INVALID_INPUT"]>;
|
|
210
|
+
message: z.ZodString;
|
|
211
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
212
|
+
recoverable: z.ZodBoolean;
|
|
213
|
+
}, "strip", z.ZodTypeAny, {
|
|
214
|
+
code: "BLOB_FETCH_NETWORK" | "BLOB_FETCH_HTTP_ERROR" | "BLOB_WRITE_FAILED" | "BLOB_READ_FAILED" | "BLOB_INVALID_INPUT";
|
|
215
|
+
message: string;
|
|
216
|
+
recoverable: boolean;
|
|
217
|
+
suggestion?: string | undefined;
|
|
218
|
+
}, {
|
|
219
|
+
code: "BLOB_FETCH_NETWORK" | "BLOB_FETCH_HTTP_ERROR" | "BLOB_WRITE_FAILED" | "BLOB_READ_FAILED" | "BLOB_INVALID_INPUT";
|
|
220
|
+
message: string;
|
|
221
|
+
recoverable: boolean;
|
|
222
|
+
suggestion?: string | undefined;
|
|
223
|
+
}>;
|
|
224
|
+
}, "strip", z.ZodTypeAny, {
|
|
225
|
+
success: false;
|
|
226
|
+
error: {
|
|
227
|
+
code: "BLOB_FETCH_NETWORK" | "BLOB_FETCH_HTTP_ERROR" | "BLOB_WRITE_FAILED" | "BLOB_READ_FAILED" | "BLOB_INVALID_INPUT";
|
|
228
|
+
message: string;
|
|
229
|
+
recoverable: boolean;
|
|
230
|
+
suggestion?: string | undefined;
|
|
231
|
+
};
|
|
232
|
+
}, {
|
|
233
|
+
success: false;
|
|
234
|
+
error: {
|
|
235
|
+
code: "BLOB_FETCH_NETWORK" | "BLOB_FETCH_HTTP_ERROR" | "BLOB_WRITE_FAILED" | "BLOB_READ_FAILED" | "BLOB_INVALID_INPUT";
|
|
236
|
+
message: string;
|
|
237
|
+
recoverable: boolean;
|
|
238
|
+
suggestion?: string | undefined;
|
|
239
|
+
};
|
|
240
|
+
}>]>;
|
|
241
|
+
export type GetResult = z.infer<typeof GetResultSchema>;
|
|
242
|
+
export interface BlobStoreSpec {
|
|
243
|
+
/** Hash, dedupe, and persist a buffer. Returns a content-addressed BlobRef. */
|
|
244
|
+
put(buffer: Buffer, mime: string): Promise<PutResult>;
|
|
245
|
+
/** Fetch a URL (following redirects) and persist the bytes. */
|
|
246
|
+
fetch(url: string, mimeHint?: string): Promise<PutResult>;
|
|
247
|
+
/** Cheap existence check by sha256. */
|
|
248
|
+
has(sha256: string): Promise<HasResult>;
|
|
249
|
+
/** Read bytes by sha256. data === null when absent. */
|
|
250
|
+
get(sha256: string): Promise<GetResult>;
|
|
251
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type CaptureDeps, type CaptureInput, type CaptureResult, type CaptureSpec } from './spec.js';
|
|
2
|
+
export declare class CaptureHandler implements CaptureSpec {
|
|
3
|
+
private readonly blobs;
|
|
4
|
+
private readonly append;
|
|
5
|
+
private readonly now;
|
|
6
|
+
private readonly newId;
|
|
7
|
+
constructor(deps: CaptureDeps);
|
|
8
|
+
capture(input: CaptureInput): Promise<CaptureResult>;
|
|
9
|
+
private fail;
|
|
10
|
+
}
|