@camerontaylor/paseo-protocol 0.11.0-beta.3.fork.1 → 0.11.1-fork.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.
- package/dist/browser-automation/rpc-schemas.d.ts +3 -3
- package/dist/generated/validation/ws-outbound.aot.js +51698 -50265
- package/dist/messages.d.ts +1284 -221
- package/dist/messages.js +40 -3
- package/dist/plugin-overview.d.ts +12 -0
- package/dist/plugin-overview.js +50 -0
- package/dist/plugin-registry.d.ts +147 -0
- package/dist/plugin-registry.js +75 -0
- package/dist/plugin-source-reference.d.ts +1 -0
- package/dist/plugin-source-reference.js +9 -1
- package/dist/schedule/rpc-schemas.d.ts +4 -4
- package/dist/schedule/types.d.ts +1 -1
- package/dist/validation/ws-outbound-schema-metadata.d.ts +283 -53
- package/package.json +1 -1
package/dist/messages.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PluginRegistryIdentitySchema } from "./plugin-registry.js";
|
|
1
2
|
import { AgentProfileSchema, AgentSkillSelectionSchema } from "./agent-profile.js";
|
|
2
3
|
export { AgentProfileSchema, AgentSkillSelectionSchema, } from "./agent-profile.js";
|
|
3
4
|
import { PluginIdSchema, PluginRequirementsSchema, PluginSourceSchema } from "./plugin-config.js";
|
|
@@ -103,6 +104,7 @@ export const MutableDaemonConfigSchema = z
|
|
|
103
104
|
metadataGeneration: MutableMetadataGenerationConfigSchema.default({ providers: [] }),
|
|
104
105
|
autoArchiveAfterMerge: z.boolean().default(false),
|
|
105
106
|
enableTerminalAgentHooks: z.boolean().default(false),
|
|
107
|
+
appendSystemPromptExcludedProviders: z.array(z.string().min(1)).optional(),
|
|
106
108
|
appendSystemPrompt: z.string().default(""),
|
|
107
109
|
terminalProfiles: z.array(TerminalProfileSchema).optional(),
|
|
108
110
|
agentProfiles: z.array(AgentProfileSchema).optional(),
|
|
@@ -131,6 +133,7 @@ export const MutableDaemonConfigPatchSchema = z
|
|
|
131
133
|
metadataGeneration: MutableMetadataGenerationConfigSchema.partial().optional(),
|
|
132
134
|
autoArchiveAfterMerge: z.boolean().optional(),
|
|
133
135
|
enableTerminalAgentHooks: z.boolean().optional(),
|
|
136
|
+
appendSystemPromptExcludedProviders: z.array(z.string().min(1)).optional(),
|
|
134
137
|
appendSystemPrompt: z.string().optional(),
|
|
135
138
|
terminalProfiles: z.array(TerminalProfileSchema).optional(),
|
|
136
139
|
agentProfiles: z.array(AgentProfileSchema).optional(),
|
|
@@ -1206,8 +1209,18 @@ export const PluginSourceInstallRequestSchema = z.object({
|
|
|
1206
1209
|
});
|
|
1207
1210
|
export const PluginSourceIdentitySchema = z.discriminatedUnion("kind", [
|
|
1208
1211
|
z.object({ kind: z.literal("directory"), path: z.string() }),
|
|
1209
|
-
z.object({
|
|
1210
|
-
|
|
1212
|
+
z.object({
|
|
1213
|
+
kind: z.literal("git"),
|
|
1214
|
+
remote: z.string(),
|
|
1215
|
+
pluginPath: z.string(),
|
|
1216
|
+
registry: PluginRegistryIdentitySchema.optional(),
|
|
1217
|
+
}),
|
|
1218
|
+
z.object({
|
|
1219
|
+
kind: z.literal("npm"),
|
|
1220
|
+
packageName: z.string(),
|
|
1221
|
+
pluginPath: z.string(),
|
|
1222
|
+
registry: PluginRegistryIdentitySchema.optional(),
|
|
1223
|
+
}),
|
|
1211
1224
|
]);
|
|
1212
1225
|
export const PluginInstallationSchema = z.object({
|
|
1213
1226
|
identity: PluginSourceIdentitySchema,
|
|
@@ -1479,6 +1492,8 @@ export const ProviderUsageListRequestMessageSchema = z.object({
|
|
|
1479
1492
|
});
|
|
1480
1493
|
export const UsageListReportsRequestMessageSchema = z.object({
|
|
1481
1494
|
type: z.literal("usage.list_reports.request"),
|
|
1495
|
+
streaming: z.boolean().optional(),
|
|
1496
|
+
agentId: z.string().optional(),
|
|
1482
1497
|
requestId: z.string(),
|
|
1483
1498
|
reportIds: z.array(z.string()).optional(),
|
|
1484
1499
|
forceRefresh: z.boolean().optional(),
|
|
@@ -3085,6 +3100,7 @@ export const ServerInfoStatusPayloadSchema = z
|
|
|
3085
3100
|
hubAgentRpc: z.boolean().optional(),
|
|
3086
3101
|
providersSnapshot: z.boolean().optional(),
|
|
3087
3102
|
usageSources: z.boolean().optional(),
|
|
3103
|
+
usageReportsStreaming: z.boolean().optional(),
|
|
3088
3104
|
// COMPAT(providersSnapshotCwd): added in v0.3.2, remove gate after 2027-02-10.
|
|
3089
3105
|
providersSnapshotCwd: z.boolean().optional(),
|
|
3090
3106
|
// COMPAT(directorySync): added in v0.3.x, remove gate after 2027-02-12.
|
|
@@ -5666,10 +5682,27 @@ export const UsageReportEntrySchema = z.object({
|
|
|
5666
5682
|
sourceLabel: z.string(),
|
|
5667
5683
|
icon: z.string().optional(),
|
|
5668
5684
|
report: UsageReportSchema,
|
|
5685
|
+
loginErrors: z
|
|
5686
|
+
.array(z.object({
|
|
5687
|
+
harness: z.string(),
|
|
5688
|
+
report: z.discriminatedUnion("status", [
|
|
5689
|
+
z.object({ status: z.literal("unavailable"), problem: UsageProblemSchema }),
|
|
5690
|
+
z.object({ status: z.literal("error"), error: z.string() }),
|
|
5691
|
+
]),
|
|
5692
|
+
}))
|
|
5693
|
+
.optional(),
|
|
5694
|
+
});
|
|
5695
|
+
export const UsageListReportsUpdateMessageSchema = z.object({
|
|
5696
|
+
type: z.literal("usage.list_reports.update"),
|
|
5697
|
+
payload: z.object({ requestId: z.string(), report: UsageReportEntrySchema }),
|
|
5669
5698
|
});
|
|
5670
5699
|
export const UsageListReportsResponseMessageSchema = z.object({
|
|
5671
5700
|
type: z.literal("usage.list_reports.response"),
|
|
5672
|
-
payload: z.object({
|
|
5701
|
+
payload: z.object({
|
|
5702
|
+
requestId: z.string(),
|
|
5703
|
+
reports: z.array(UsageReportEntrySchema).optional(),
|
|
5704
|
+
error: z.string().nullable().optional(),
|
|
5705
|
+
}),
|
|
5673
5706
|
});
|
|
5674
5707
|
const AgentSlashCommandSchema = z.object({
|
|
5675
5708
|
name: z.string(),
|
|
@@ -5939,6 +5972,9 @@ export const PluginNpmInstallationSchema = z.object({
|
|
|
5939
5972
|
});
|
|
5940
5973
|
export const PluginListItemSchema = z.object({
|
|
5941
5974
|
id: PluginIdSchema,
|
|
5975
|
+
name: z.string().optional(),
|
|
5976
|
+
icon: z.string().optional(),
|
|
5977
|
+
media: z.array(z.string()).optional(),
|
|
5942
5978
|
description: z.string().optional(),
|
|
5943
5979
|
path: z.string(),
|
|
5944
5980
|
enabled: z.boolean(),
|
|
@@ -6278,6 +6314,7 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
|
|
|
6278
6314
|
RefreshProvidersSnapshotResponseMessageSchema,
|
|
6279
6315
|
ProviderDiagnosticResponseMessageSchema,
|
|
6280
6316
|
ProviderUsageListResponseMessageSchema,
|
|
6317
|
+
UsageListReportsUpdateMessageSchema,
|
|
6281
6318
|
UsageListReportsResponseMessageSchema,
|
|
6282
6319
|
ListCommandsResponseSchema,
|
|
6283
6320
|
ListTerminalsResponseSchema,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Presentation contract for author-controlled registry content, independent of the UI runtime. */
|
|
2
|
+
export declare const pluginOverviewPolicy: {
|
|
3
|
+
readonly rawHtml: false;
|
|
4
|
+
readonly elements: readonly ["p", "br", "hr", "h1", "h2", "h3", "h4", "h5", "h6", "blockquote", "ul", "ol", "li", "strong", "em", "del", "pre", "code", "a", "img", "table", "thead", "tbody", "tr", "th", "td"];
|
|
5
|
+
readonly link: {
|
|
6
|
+
readonly rel: "noopener noreferrer nofollow";
|
|
7
|
+
readonly target: "_blank";
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
/** Validate decoded Markdown destinations; never resolve against the reader's page or repository. */
|
|
11
|
+
export declare function pluginOverviewUrl(value: string | undefined): string | undefined;
|
|
12
|
+
//# sourceMappingURL=plugin-overview.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** Presentation contract for author-controlled registry content, independent of the UI runtime. */
|
|
2
|
+
export const pluginOverviewPolicy = {
|
|
3
|
+
rawHtml: false,
|
|
4
|
+
elements: [
|
|
5
|
+
"p",
|
|
6
|
+
"br",
|
|
7
|
+
"hr",
|
|
8
|
+
"h1",
|
|
9
|
+
"h2",
|
|
10
|
+
"h3",
|
|
11
|
+
"h4",
|
|
12
|
+
"h5",
|
|
13
|
+
"h6",
|
|
14
|
+
"blockquote",
|
|
15
|
+
"ul",
|
|
16
|
+
"ol",
|
|
17
|
+
"li",
|
|
18
|
+
"strong",
|
|
19
|
+
"em",
|
|
20
|
+
"del",
|
|
21
|
+
"pre",
|
|
22
|
+
"code",
|
|
23
|
+
"a",
|
|
24
|
+
"img",
|
|
25
|
+
"table",
|
|
26
|
+
"thead",
|
|
27
|
+
"tbody",
|
|
28
|
+
"tr",
|
|
29
|
+
"th",
|
|
30
|
+
"td",
|
|
31
|
+
],
|
|
32
|
+
link: { rel: "noopener noreferrer nofollow", target: "_blank" },
|
|
33
|
+
};
|
|
34
|
+
/** Validate decoded Markdown destinations; never resolve against the reader's page or repository. */
|
|
35
|
+
export function pluginOverviewUrl(value) {
|
|
36
|
+
// URL parsers discard controls and normalize backslashes; reject those ambiguous spellings.
|
|
37
|
+
// eslint-disable-next-line no-control-regex
|
|
38
|
+
if (!value || !/^https:\/\/[^/?#]/i.test(value) || /[\u0000-\u0020\u007f\\]/.test(value))
|
|
39
|
+
return undefined;
|
|
40
|
+
try {
|
|
41
|
+
const url = new URL(value);
|
|
42
|
+
if (url.protocol !== "https:" || !url.hostname || url.username || url.password)
|
|
43
|
+
return undefined;
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=plugin-overview.js.map
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const PluginRegistryIdSchema: z.ZodString;
|
|
3
|
+
export declare const PluginRegistryIdentitySchema: z.ZodObject<{
|
|
4
|
+
url: z.ZodString;
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare const PluginRegistriesSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
8
|
+
authorization: z.ZodString;
|
|
9
|
+
}, z.core.$strip>>;
|
|
10
|
+
export declare const PluginRegistryArtifactSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
11
|
+
kind: z.ZodLiteral<"npm">;
|
|
12
|
+
package: z.ZodString;
|
|
13
|
+
version: z.ZodString;
|
|
14
|
+
resolved: z.ZodString;
|
|
15
|
+
integrity: z.ZodString;
|
|
16
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
17
|
+
kind: z.ZodLiteral<"git">;
|
|
18
|
+
remote: z.ZodString;
|
|
19
|
+
commit: z.ZodString;
|
|
20
|
+
pluginPath: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, z.core.$strip>], "kind">;
|
|
22
|
+
export declare const PublishedPluginSchema: z.ZodObject<{
|
|
23
|
+
id: z.ZodString;
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
description: z.ZodString;
|
|
26
|
+
license: z.ZodOptional<z.ZodString>;
|
|
27
|
+
categories: z.ZodArray<z.ZodString>;
|
|
28
|
+
author: z.ZodObject<{
|
|
29
|
+
github: z.ZodString;
|
|
30
|
+
name: z.ZodOptional<z.ZodString>;
|
|
31
|
+
npm: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
repository: z.ZodObject<{
|
|
34
|
+
url: z.ZodString;
|
|
35
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
artifact: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
38
|
+
kind: z.ZodLiteral<"npm">;
|
|
39
|
+
package: z.ZodString;
|
|
40
|
+
version: z.ZodString;
|
|
41
|
+
resolved: z.ZodString;
|
|
42
|
+
integrity: z.ZodString;
|
|
43
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
44
|
+
kind: z.ZodLiteral<"git">;
|
|
45
|
+
remote: z.ZodString;
|
|
46
|
+
commit: z.ZodString;
|
|
47
|
+
pluginPath: z.ZodOptional<z.ZodString>;
|
|
48
|
+
}, z.core.$strip>], "kind">;
|
|
49
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
50
|
+
media: z.ZodArray<z.ZodString>;
|
|
51
|
+
submittedAt: z.ZodString;
|
|
52
|
+
reviewedAt: z.ZodString;
|
|
53
|
+
updatedAt: z.ZodString;
|
|
54
|
+
publishedAt: z.ZodString;
|
|
55
|
+
installs: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
/** Whether a registry media entry is a video or an image, from its path extension. */
|
|
58
|
+
export declare function pluginMediaKind(url: string): "image" | "video";
|
|
59
|
+
export declare const PublishedPluginDetailSchema: z.ZodObject<{
|
|
60
|
+
id: z.ZodString;
|
|
61
|
+
name: z.ZodString;
|
|
62
|
+
description: z.ZodString;
|
|
63
|
+
license: z.ZodOptional<z.ZodString>;
|
|
64
|
+
categories: z.ZodArray<z.ZodString>;
|
|
65
|
+
author: z.ZodObject<{
|
|
66
|
+
github: z.ZodString;
|
|
67
|
+
name: z.ZodOptional<z.ZodString>;
|
|
68
|
+
npm: z.ZodOptional<z.ZodString>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
repository: z.ZodObject<{
|
|
71
|
+
url: z.ZodString;
|
|
72
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
artifact: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
75
|
+
kind: z.ZodLiteral<"npm">;
|
|
76
|
+
package: z.ZodString;
|
|
77
|
+
version: z.ZodString;
|
|
78
|
+
resolved: z.ZodString;
|
|
79
|
+
integrity: z.ZodString;
|
|
80
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
81
|
+
kind: z.ZodLiteral<"git">;
|
|
82
|
+
remote: z.ZodString;
|
|
83
|
+
commit: z.ZodString;
|
|
84
|
+
pluginPath: z.ZodOptional<z.ZodString>;
|
|
85
|
+
}, z.core.$strip>], "kind">;
|
|
86
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
87
|
+
media: z.ZodArray<z.ZodString>;
|
|
88
|
+
submittedAt: z.ZodString;
|
|
89
|
+
reviewedAt: z.ZodString;
|
|
90
|
+
updatedAt: z.ZodString;
|
|
91
|
+
publishedAt: z.ZodString;
|
|
92
|
+
installs: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
readme: z.ZodString;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
export declare const PluginRegistryIndexSchema: z.ZodObject<{
|
|
96
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
97
|
+
registry: z.ZodObject<{
|
|
98
|
+
name: z.ZodString;
|
|
99
|
+
url: z.ZodString;
|
|
100
|
+
}, z.core.$strip>;
|
|
101
|
+
categories: z.ZodArray<z.ZodObject<{
|
|
102
|
+
slug: z.ZodString;
|
|
103
|
+
label: z.ZodString;
|
|
104
|
+
description: z.ZodOptional<z.ZodString>;
|
|
105
|
+
}, z.core.$strip>>;
|
|
106
|
+
plugins: z.ZodArray<z.ZodObject<{
|
|
107
|
+
id: z.ZodString;
|
|
108
|
+
name: z.ZodString;
|
|
109
|
+
description: z.ZodString;
|
|
110
|
+
license: z.ZodOptional<z.ZodString>;
|
|
111
|
+
categories: z.ZodArray<z.ZodString>;
|
|
112
|
+
author: z.ZodObject<{
|
|
113
|
+
github: z.ZodString;
|
|
114
|
+
name: z.ZodOptional<z.ZodString>;
|
|
115
|
+
npm: z.ZodOptional<z.ZodString>;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
repository: z.ZodObject<{
|
|
118
|
+
url: z.ZodString;
|
|
119
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
120
|
+
}, z.core.$strip>;
|
|
121
|
+
artifact: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
122
|
+
kind: z.ZodLiteral<"npm">;
|
|
123
|
+
package: z.ZodString;
|
|
124
|
+
version: z.ZodString;
|
|
125
|
+
resolved: z.ZodString;
|
|
126
|
+
integrity: z.ZodString;
|
|
127
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
128
|
+
kind: z.ZodLiteral<"git">;
|
|
129
|
+
remote: z.ZodString;
|
|
130
|
+
commit: z.ZodString;
|
|
131
|
+
pluginPath: z.ZodOptional<z.ZodString>;
|
|
132
|
+
}, z.core.$strip>], "kind">;
|
|
133
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
134
|
+
media: z.ZodArray<z.ZodString>;
|
|
135
|
+
submittedAt: z.ZodString;
|
|
136
|
+
reviewedAt: z.ZodString;
|
|
137
|
+
updatedAt: z.ZodString;
|
|
138
|
+
publishedAt: z.ZodString;
|
|
139
|
+
installs: z.ZodOptional<z.ZodNumber>;
|
|
140
|
+
}, z.core.$strip>>;
|
|
141
|
+
featured: z.ZodArray<z.ZodString>;
|
|
142
|
+
generatedAt: z.ZodString;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
export type PluginRegistryIdentity = z.infer<typeof PluginRegistryIdentitySchema>;
|
|
145
|
+
export type PluginRegistries = z.infer<typeof PluginRegistriesSchema>;
|
|
146
|
+
export declare function parsePluginRegistryReference(source: string, defaultUrl?: string): PluginRegistryIdentity | null;
|
|
147
|
+
//# sourceMappingURL=plugin-registry.d.ts.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const PluginRegistryIdSchema = z
|
|
3
|
+
.string()
|
|
4
|
+
.regex(/^[a-z0-9]+(?:-[a-z0-9]+)*\/[a-z0-9]+(?:-[a-z0-9]+)*$/);
|
|
5
|
+
export const PluginRegistryIdentitySchema = z.object({
|
|
6
|
+
url: z.string().url(),
|
|
7
|
+
id: PluginRegistryIdSchema,
|
|
8
|
+
});
|
|
9
|
+
export const PluginRegistriesSchema = z.record(z.string(), z.object({ authorization: z.string().min(1) }));
|
|
10
|
+
export const PluginRegistryArtifactSchema = z.discriminatedUnion("kind", [
|
|
11
|
+
z.object({
|
|
12
|
+
kind: z.literal("npm"),
|
|
13
|
+
package: z.string().regex(/^(?:@[a-z0-9][\w.-]*\/)?[a-z0-9][\w.-]*$/),
|
|
14
|
+
version: z.string().regex(/^\d+\.\d+\.\d+(?:-[\w.-]+)?(?:\+[\w.-]+)?$/),
|
|
15
|
+
resolved: z.string().url(),
|
|
16
|
+
integrity: z.string().regex(/^sha512-[A-Za-z0-9+/]+=*$/),
|
|
17
|
+
}),
|
|
18
|
+
z.object({
|
|
19
|
+
kind: z.literal("git"),
|
|
20
|
+
remote: z.string().min(1),
|
|
21
|
+
commit: z.string().regex(/^[0-9a-f]{40,64}$/),
|
|
22
|
+
pluginPath: z
|
|
23
|
+
.string()
|
|
24
|
+
.regex(/^[^\\:]+$/)
|
|
25
|
+
.optional(),
|
|
26
|
+
}),
|
|
27
|
+
]);
|
|
28
|
+
export const PublishedPluginSchema = z.object({
|
|
29
|
+
id: PluginRegistryIdSchema,
|
|
30
|
+
name: z.string(),
|
|
31
|
+
description: z.string(),
|
|
32
|
+
license: z.string().optional(),
|
|
33
|
+
categories: z.array(z.string()),
|
|
34
|
+
author: z.object({ github: z.string(), name: z.string().optional(), npm: z.string().optional() }),
|
|
35
|
+
repository: z.object({ url: z.string().url(), commit: z.string().optional() }),
|
|
36
|
+
artifact: PluginRegistryArtifactSchema,
|
|
37
|
+
icon: z.string().url().optional(),
|
|
38
|
+
/** Images and videos in display order; see `pluginMediaKind`. */
|
|
39
|
+
media: z.array(z.string().url()),
|
|
40
|
+
submittedAt: z.string(),
|
|
41
|
+
reviewedAt: z.string(),
|
|
42
|
+
updatedAt: z.string(),
|
|
43
|
+
publishedAt: z.string(),
|
|
44
|
+
installs: z.number().int().nonnegative().optional(),
|
|
45
|
+
});
|
|
46
|
+
const VIDEO_EXTENSIONS = new Set(["mp4", "webm"]);
|
|
47
|
+
/** Whether a registry media entry is a video or an image, from its path extension. */
|
|
48
|
+
export function pluginMediaKind(url) {
|
|
49
|
+
const extension = new URL(url).pathname.split(".").pop()?.toLowerCase() ?? "";
|
|
50
|
+
return VIDEO_EXTENSIONS.has(extension) ? "video" : "image";
|
|
51
|
+
}
|
|
52
|
+
export const PublishedPluginDetailSchema = PublishedPluginSchema.extend({ readme: z.string() });
|
|
53
|
+
export const PluginRegistryIndexSchema = z.object({
|
|
54
|
+
schemaVersion: z.literal(1),
|
|
55
|
+
registry: z.object({ name: z.string(), url: z.string().url() }),
|
|
56
|
+
categories: z.array(z.object({ slug: z.string(), label: z.string(), description: z.string().optional() })),
|
|
57
|
+
plugins: z.array(PublishedPluginSchema),
|
|
58
|
+
/** Plugin IDs the maintainer features, in display order. An ID may name a plugin that is not listed. */
|
|
59
|
+
featured: z.array(z.string()),
|
|
60
|
+
generatedAt: z.string(),
|
|
61
|
+
});
|
|
62
|
+
export function parsePluginRegistryReference(source, defaultUrl = "https://plugins.paseo.sh") {
|
|
63
|
+
const segments = source.split("/");
|
|
64
|
+
if (segments.length === 2 && PluginRegistryIdSchema.safeParse(source).success)
|
|
65
|
+
return { url: defaultUrl.replace(/\/+$/, ""), id: source };
|
|
66
|
+
const [host, ...rest] = segments;
|
|
67
|
+
if (segments.length !== 3 || !host || !/[.:]/.test(host) || /[@?#\\]/.test(host))
|
|
68
|
+
return null;
|
|
69
|
+
const id = rest.join("/");
|
|
70
|
+
if (!PluginRegistryIdSchema.safeParse(id).success)
|
|
71
|
+
return null;
|
|
72
|
+
const url = new URL(`https://${host}`);
|
|
73
|
+
return { url: url.origin, id };
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=plugin-registry.js.map
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import { parsePluginRegistryReference } from "./plugin-registry.js";
|
|
1
2
|
export function parsePluginSourceReference(reference) {
|
|
2
3
|
const prefix = /^(npm:|github:|git:(?!\/\/))/.exec(reference)?.[0];
|
|
3
4
|
const source = prefix ? reference.slice(prefix.length) : reference;
|
|
4
5
|
const parsed = splitPluginPath(source, { scp: prefix !== "npm:" });
|
|
5
|
-
|
|
6
|
+
if (!prefix && /^(\.\.?(?:[/\\]|$)|\/|~|[A-Za-z]:[/\\]|\\\\)/.test(parsed.source)) {
|
|
7
|
+
return { kind: "directory", ...parsed };
|
|
8
|
+
}
|
|
9
|
+
if (parsePluginRegistryReference(reference))
|
|
10
|
+
return { kind: "managed", source: reference, pluginPath: undefined };
|
|
11
|
+
return { kind: "managed", ...parsed, source: `${prefix ?? ""}${parsed.source}` };
|
|
6
12
|
}
|
|
7
13
|
function splitPluginPath(reference, options) {
|
|
8
14
|
const separator = reference.lastIndexOf(":");
|
|
@@ -47,6 +53,8 @@ function isPortableRelativePluginPath(pluginPath) {
|
|
|
47
53
|
export function formatPluginIdentity(identity) {
|
|
48
54
|
if (identity.kind === "directory")
|
|
49
55
|
return identity.path;
|
|
56
|
+
if (identity.registry)
|
|
57
|
+
return `${new URL(identity.registry.url).host}/${identity.registry.id}`;
|
|
50
58
|
const source = identity.kind === "npm" ? `npm:${identity.packageName}` : `git:${identity.remote}`;
|
|
51
59
|
return identity.pluginPath === "." ? source : `${source}:${identity.pluginPath}`;
|
|
52
60
|
}
|
|
@@ -112,13 +112,13 @@ export declare const ScheduleCreateResponseSchema: z.ZodObject<{
|
|
|
112
112
|
schedule: z.ZodNullable<z.ZodObject<{
|
|
113
113
|
name: z.ZodNullable<z.ZodString>;
|
|
114
114
|
id: z.ZodString;
|
|
115
|
+
updatedAt: z.ZodString;
|
|
115
116
|
status: z.ZodEnum<{
|
|
116
117
|
completed: "completed";
|
|
117
118
|
active: "active";
|
|
118
119
|
paused: "paused";
|
|
119
120
|
}>;
|
|
120
121
|
createdAt: z.ZodString;
|
|
121
|
-
updatedAt: z.ZodString;
|
|
122
122
|
cadence: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
123
123
|
type: z.ZodLiteral<"every">;
|
|
124
124
|
everyMs: z.ZodNumber;
|
|
@@ -167,13 +167,13 @@ export declare const ScheduleListResponseSchema: z.ZodObject<{
|
|
|
167
167
|
schedules: z.ZodArray<z.ZodObject<{
|
|
168
168
|
name: z.ZodNullable<z.ZodString>;
|
|
169
169
|
id: z.ZodString;
|
|
170
|
+
updatedAt: z.ZodString;
|
|
170
171
|
status: z.ZodEnum<{
|
|
171
172
|
completed: "completed";
|
|
172
173
|
active: "active";
|
|
173
174
|
paused: "paused";
|
|
174
175
|
}>;
|
|
175
176
|
createdAt: z.ZodString;
|
|
176
|
-
updatedAt: z.ZodString;
|
|
177
177
|
cadence: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
178
178
|
type: z.ZodLiteral<"every">;
|
|
179
179
|
everyMs: z.ZodNumber;
|
|
@@ -314,13 +314,13 @@ export declare const SchedulePauseResponseSchema: z.ZodObject<{
|
|
|
314
314
|
schedule: z.ZodNullable<z.ZodObject<{
|
|
315
315
|
name: z.ZodNullable<z.ZodString>;
|
|
316
316
|
id: z.ZodString;
|
|
317
|
+
updatedAt: z.ZodString;
|
|
317
318
|
status: z.ZodEnum<{
|
|
318
319
|
completed: "completed";
|
|
319
320
|
active: "active";
|
|
320
321
|
paused: "paused";
|
|
321
322
|
}>;
|
|
322
323
|
createdAt: z.ZodString;
|
|
323
|
-
updatedAt: z.ZodString;
|
|
324
324
|
cadence: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
325
325
|
type: z.ZodLiteral<"every">;
|
|
326
326
|
everyMs: z.ZodNumber;
|
|
@@ -369,13 +369,13 @@ export declare const ScheduleResumeResponseSchema: z.ZodObject<{
|
|
|
369
369
|
schedule: z.ZodNullable<z.ZodObject<{
|
|
370
370
|
name: z.ZodNullable<z.ZodString>;
|
|
371
371
|
id: z.ZodString;
|
|
372
|
+
updatedAt: z.ZodString;
|
|
372
373
|
status: z.ZodEnum<{
|
|
373
374
|
completed: "completed";
|
|
374
375
|
active: "active";
|
|
375
376
|
paused: "paused";
|
|
376
377
|
}>;
|
|
377
378
|
createdAt: z.ZodString;
|
|
378
|
-
updatedAt: z.ZodString;
|
|
379
379
|
cadence: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
380
380
|
type: z.ZodLiteral<"every">;
|
|
381
381
|
everyMs: z.ZodNumber;
|
package/dist/schedule/types.d.ts
CHANGED
|
@@ -121,13 +121,13 @@ export type StoredSchedule = z.infer<typeof StoredScheduleSchema>;
|
|
|
121
121
|
export declare const ScheduleSummarySchema: z.ZodObject<{
|
|
122
122
|
name: z.ZodNullable<z.ZodString>;
|
|
123
123
|
id: z.ZodString;
|
|
124
|
+
updatedAt: z.ZodString;
|
|
124
125
|
status: z.ZodEnum<{
|
|
125
126
|
completed: "completed";
|
|
126
127
|
active: "active";
|
|
127
128
|
paused: "paused";
|
|
128
129
|
}>;
|
|
129
130
|
createdAt: z.ZodString;
|
|
130
|
-
updatedAt: z.ZodString;
|
|
131
131
|
cadence: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
132
132
|
type: z.ZodLiteral<"every">;
|
|
133
133
|
everyMs: z.ZodNumber;
|