@motrix/mdxp 0.4.0 → 0.5.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.
|
@@ -4,6 +4,8 @@ import { z } from 'zod';
|
|
|
4
4
|
* `download/submit`. Discriminated on `kind`; strict variants so an agent's
|
|
5
5
|
* typo is loudly rejected rather than silently dropped. The host maps this onto
|
|
6
6
|
* its native taskCreateRequest in Spec 4.
|
|
7
|
+
* `idempotencyKey` (8-128 chars) marks one logical add for host-side dedup so
|
|
8
|
+
* a client may safely retry a lost response — same contract as download/submit.
|
|
7
9
|
*/
|
|
8
10
|
export declare const DownloadAddParamsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
9
11
|
kind: z.ZodLiteral<"url">;
|
|
@@ -16,17 +18,20 @@ export declare const DownloadAddParamsSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
16
18
|
}, z.core.$strip>>>;
|
|
17
19
|
connections: z.ZodOptional<z.ZodNumber>;
|
|
18
20
|
proxy: z.ZodOptional<z.ZodString>;
|
|
21
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
19
22
|
}, z.core.$strict>, z.ZodObject<{
|
|
20
23
|
kind: z.ZodLiteral<"magnet">;
|
|
21
24
|
saveDir: z.ZodString;
|
|
22
25
|
uri: z.ZodString;
|
|
23
26
|
selectedFiles: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
27
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
24
28
|
}, z.core.$strict>, z.ZodObject<{
|
|
25
29
|
kind: z.ZodLiteral<"torrent">;
|
|
26
30
|
saveDir: z.ZodString;
|
|
27
31
|
base64: z.ZodString;
|
|
28
32
|
selectedFiles: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
29
33
|
displayName: z.ZodOptional<z.ZodString>;
|
|
34
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
30
35
|
}, z.core.$strict>], "kind">;
|
|
31
36
|
/** Result is the created task snapshot so callers render without polling. */
|
|
32
37
|
export declare const DownloadAddResultSchema: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download-add.d.ts","sourceRoot":"","sources":["../../src/schemas/download-add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAmBvB
|
|
1
|
+
{"version":3,"file":"download-add.d.ts","sourceRoot":"","sources":["../../src/schemas/download-add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAmBvB;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;4BA0BlC,CAAA;AAEF,6EAA6E;AAC7E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAiB,CAAA;AAErD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AACvE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
|
|
@@ -19,6 +19,8 @@ const safeDownloadUrl = z
|
|
|
19
19
|
* `download/submit`. Discriminated on `kind`; strict variants so an agent's
|
|
20
20
|
* typo is loudly rejected rather than silently dropped. The host maps this onto
|
|
21
21
|
* its native taskCreateRequest in Spec 4.
|
|
22
|
+
* `idempotencyKey` (8-128 chars) marks one logical add for host-side dedup so
|
|
23
|
+
* a client may safely retry a lost response — same contract as download/submit.
|
|
22
24
|
*/
|
|
23
25
|
export const DownloadAddParamsSchema = z.discriminatedUnion('kind', [
|
|
24
26
|
z.strictObject({
|
|
@@ -29,12 +31,14 @@ export const DownloadAddParamsSchema = z.discriminatedUnion('kind', [
|
|
|
29
31
|
headers: z.array(HttpHeaderSchema).optional(),
|
|
30
32
|
connections: z.number().int().min(1).max(128).optional(),
|
|
31
33
|
proxy: z.string().optional(),
|
|
34
|
+
idempotencyKey: z.string().min(8).max(128).optional(),
|
|
32
35
|
}),
|
|
33
36
|
z.strictObject({
|
|
34
37
|
kind: z.literal('magnet'),
|
|
35
38
|
saveDir: z.string().min(1),
|
|
36
39
|
uri: z.string().startsWith('magnet:?'),
|
|
37
40
|
selectedFiles: z.array(z.number().int().nonnegative()).optional(),
|
|
41
|
+
idempotencyKey: z.string().min(8).max(128).optional(),
|
|
38
42
|
}),
|
|
39
43
|
z.strictObject({
|
|
40
44
|
kind: z.literal('torrent'),
|
|
@@ -42,6 +46,7 @@ export const DownloadAddParamsSchema = z.discriminatedUnion('kind', [
|
|
|
42
46
|
base64: z.string().min(1),
|
|
43
47
|
selectedFiles: z.array(z.number().int().nonnegative()).optional(),
|
|
44
48
|
displayName: z.string().optional(),
|
|
49
|
+
idempotencyKey: z.string().min(8).max(128).optional(),
|
|
45
50
|
}),
|
|
46
51
|
]);
|
|
47
52
|
/** Result is the created task snapshot so callers render without polling. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download-add.js","sourceRoot":"","sources":["../../src/schemas/download-add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE1C,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;AAE1E;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG,4BAA4B,CAAA;AACtD,MAAM,eAAe,GAAG,CAAC;KACtB,MAAM,EAAE;KACR,GAAG,EAAE;KACL,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;IACxC,OAAO,EAAE,gEAAgE;CAC1E,CAAC,CAAA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AAA;AAEF,6EAA6E;AAC7E,MAAM,CAAC,MAAM,uBAAuB,GAAG,cAAc,CAAA"}
|
package/package.json
CHANGED
|
@@ -22,6 +22,8 @@ const safeDownloadUrl = z
|
|
|
22
22
|
* `download/submit`. Discriminated on `kind`; strict variants so an agent's
|
|
23
23
|
* typo is loudly rejected rather than silently dropped. The host maps this onto
|
|
24
24
|
* its native taskCreateRequest in Spec 4.
|
|
25
|
+
* `idempotencyKey` (8-128 chars) marks one logical add for host-side dedup so
|
|
26
|
+
* a client may safely retry a lost response — same contract as download/submit.
|
|
25
27
|
*/
|
|
26
28
|
export const DownloadAddParamsSchema = z.discriminatedUnion('kind', [
|
|
27
29
|
z.strictObject({
|
|
@@ -32,12 +34,14 @@ export const DownloadAddParamsSchema = z.discriminatedUnion('kind', [
|
|
|
32
34
|
headers: z.array(HttpHeaderSchema).optional(),
|
|
33
35
|
connections: z.number().int().min(1).max(128).optional(),
|
|
34
36
|
proxy: z.string().optional(),
|
|
37
|
+
idempotencyKey: z.string().min(8).max(128).optional(),
|
|
35
38
|
}),
|
|
36
39
|
z.strictObject({
|
|
37
40
|
kind: z.literal('magnet'),
|
|
38
41
|
saveDir: z.string().min(1),
|
|
39
42
|
uri: z.string().startsWith('magnet:?'),
|
|
40
43
|
selectedFiles: z.array(z.number().int().nonnegative()).optional(),
|
|
44
|
+
idempotencyKey: z.string().min(8).max(128).optional(),
|
|
41
45
|
}),
|
|
42
46
|
z.strictObject({
|
|
43
47
|
kind: z.literal('torrent'),
|
|
@@ -45,6 +49,7 @@ export const DownloadAddParamsSchema = z.discriminatedUnion('kind', [
|
|
|
45
49
|
base64: z.string().min(1),
|
|
46
50
|
selectedFiles: z.array(z.number().int().nonnegative()).optional(),
|
|
47
51
|
displayName: z.string().optional(),
|
|
52
|
+
idempotencyKey: z.string().min(8).max(128).optional(),
|
|
48
53
|
}),
|
|
49
54
|
])
|
|
50
55
|
|