@getmateo/protocol 0.0.0-stage → 0.17.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.
Files changed (171) hide show
  1. package/LICENSE +211 -0
  2. package/README.md +11 -2
  3. package/dist/addresses.d.ts +6 -0
  4. package/dist/addresses.js +2 -0
  5. package/dist/agent-attention-notification.d.ts +57 -0
  6. package/dist/agent-attention-notification.js +177 -0
  7. package/dist/agent-deep-link.d.ts +8 -0
  8. package/dist/agent-deep-link.js +49 -0
  9. package/dist/agent-labels.d.ts +14 -0
  10. package/dist/agent-labels.js +38 -0
  11. package/dist/agent-lifecycle.d.ts +3 -0
  12. package/dist/agent-lifecycle.js +8 -0
  13. package/dist/agent-message.d.ts +20 -0
  14. package/dist/agent-message.js +12 -0
  15. package/dist/agent-profile.d.ts +31 -0
  16. package/dist/agent-profile.js +32 -0
  17. package/dist/agent-runtime-config.d.ts +4 -0
  18. package/dist/agent-runtime-config.js +5 -0
  19. package/dist/agent-shells.d.ts +25 -0
  20. package/dist/agent-shells.js +17 -0
  21. package/dist/agent-state-bucket.d.ts +15 -0
  22. package/dist/agent-state-bucket.js +41 -0
  23. package/dist/agent-title-limits.d.ts +2 -0
  24. package/dist/agent-title-limits.js +2 -0
  25. package/dist/agent-types.d.ts +484 -0
  26. package/dist/agent-types.js +33 -0
  27. package/dist/binary-frames/demux.d.ts +15 -0
  28. package/dist/binary-frames/demux.js +28 -0
  29. package/dist/binary-frames/file-transfer.d.ts +51 -0
  30. package/dist/binary-frames/file-transfer.js +108 -0
  31. package/dist/binary-frames/host-route.d.ts +13 -0
  32. package/dist/binary-frames/host-route.js +39 -0
  33. package/dist/binary-frames/index.d.ts +5 -0
  34. package/dist/binary-frames/index.js +5 -0
  35. package/dist/binary-frames/terminal.d.ts +35 -0
  36. package/dist/binary-frames/terminal.js +100 -0
  37. package/dist/branch-slug.d.ts +14 -0
  38. package/dist/branch-slug.js +49 -0
  39. package/dist/browser-automation/capabilities.d.ts +7 -0
  40. package/dist/browser-automation/capabilities.js +31 -0
  41. package/dist/browser-automation/rpc-schemas.d.ts +1113 -0
  42. package/dist/browser-automation/rpc-schemas.js +463 -0
  43. package/dist/build-metadata.d.ts +17 -0
  44. package/dist/build-metadata.js +61 -0
  45. package/dist/chat/rpc-schemas.d.ts +158 -0
  46. package/dist/chat/rpc-schemas.js +104 -0
  47. package/dist/chat/types.d.ts +30 -0
  48. package/dist/chat/types.js +23 -0
  49. package/dist/check-traits.d.ts +11 -0
  50. package/dist/check-traits.js +10 -0
  51. package/dist/chunked-transport.d.ts +42 -0
  52. package/dist/chunked-transport.js +277 -0
  53. package/dist/client-capabilities.d.ts +24 -0
  54. package/dist/client-capabilities.js +52 -0
  55. package/dist/connection-offer.d.ts +36 -0
  56. package/dist/connection-offer.js +53 -0
  57. package/dist/daemon-auth.d.ts +548 -0
  58. package/dist/daemon-auth.js +152 -0
  59. package/dist/daemon-endpoints.d.ts +54 -0
  60. package/dist/daemon-endpoints.js +243 -0
  61. package/dist/error-utils.d.ts +11 -0
  62. package/dist/error-utils.js +27 -0
  63. package/dist/fleet.d.ts +381 -0
  64. package/dist/fleet.js +134 -0
  65. package/dist/forge-manifest.d.ts +66 -0
  66. package/dist/forge-manifest.js +92 -0
  67. package/dist/generated/validation/ws-outbound-schema-metadata.d.ts +14023 -0
  68. package/dist/generated/validation/ws-outbound-schema-metadata.js +258 -0
  69. package/dist/generated/validation/ws-outbound.aot.d.ts +512 -0
  70. package/dist/generated/validation/ws-outbound.aot.js +105425 -0
  71. package/dist/git-remote.d.ts +33 -0
  72. package/dist/git-remote.js +94 -0
  73. package/dist/gitea-status.d.ts +10 -0
  74. package/dist/gitea-status.js +23 -0
  75. package/dist/gitlab-pipeline.d.ts +10 -0
  76. package/dist/gitlab-pipeline.js +17 -0
  77. package/dist/global-terminal.d.ts +3 -0
  78. package/dist/global-terminal.js +8 -0
  79. package/dist/host-connection-schema.d.ts +11 -0
  80. package/dist/host-connection-schema.js +9 -0
  81. package/dist/host-target.d.ts +20 -0
  82. package/dist/host-target.js +137 -0
  83. package/dist/hosts.d.ts +133 -0
  84. package/dist/hosts.js +82 -0
  85. package/dist/literal-union.d.ts +2 -0
  86. package/dist/literal-union.js +2 -0
  87. package/dist/loop/rpc-schemas.d.ts +636 -0
  88. package/dist/loop/rpc-schemas.js +164 -0
  89. package/dist/mateo-config-schema.d.ts +138 -0
  90. package/dist/mateo-config-schema.js +98 -0
  91. package/dist/mateo-tool-call-detail.d.ts +2 -0
  92. package/dist/mateo-tool-call-detail.js +3 -0
  93. package/dist/mateo-tool-presentation/agent-message.d.ts +10 -0
  94. package/dist/mateo-tool-presentation/agent-message.js +23 -0
  95. package/dist/mateo-tool-presentation/catalog.d.ts +320 -0
  96. package/dist/mateo-tool-presentation/catalog.js +318 -0
  97. package/dist/mateo-tool-presentation/detail-sections.d.ts +15 -0
  98. package/dist/mateo-tool-presentation/detail-sections.js +161 -0
  99. package/dist/mateo-tool-presentation/index.d.ts +22 -0
  100. package/dist/mateo-tool-presentation/index.js +62 -0
  101. package/dist/mateo-tool-presentation/summary-text.d.ts +7 -0
  102. package/dist/mateo-tool-presentation/summary-text.js +22 -0
  103. package/dist/messages.d.ts +69382 -0
  104. package/dist/messages.js +6717 -0
  105. package/dist/path-utils.d.ts +2 -0
  106. package/dist/path-utils.js +16 -0
  107. package/dist/plugin-config.d.ts +18 -0
  108. package/dist/plugin-config.js +13 -0
  109. package/dist/plugin-overview.d.ts +12 -0
  110. package/dist/plugin-overview.js +50 -0
  111. package/dist/plugin-registry.d.ts +153 -0
  112. package/dist/plugin-registry.js +83 -0
  113. package/dist/plugin-requirements.d.ts +11 -0
  114. package/dist/plugin-requirements.js +26 -0
  115. package/dist/plugin-source-reference.d.ts +11 -0
  116. package/dist/plugin-source-reference.js +68 -0
  117. package/dist/provider-config.d.ts +141 -0
  118. package/dist/provider-config.js +113 -0
  119. package/dist/provider-icon-names.d.ts +5 -0
  120. package/dist/provider-icon-names.js +54 -0
  121. package/dist/provider-manifest.d.ts +30 -0
  122. package/dist/provider-manifest.js +247 -0
  123. package/dist/provider-snapshot-codec.d.ts +18 -0
  124. package/dist/provider-snapshot-codec.js +71 -0
  125. package/dist/schedule/cadence.d.ts +6 -0
  126. package/dist/schedule/cadence.js +28 -0
  127. package/dist/schedule/cron-expression.d.ts +14 -0
  128. package/dist/schedule/cron-expression.js +107 -0
  129. package/dist/schedule/rpc-schemas.d.ts +570 -0
  130. package/dist/schedule/rpc-schemas.js +158 -0
  131. package/dist/schedule/types.d.ts +201 -0
  132. package/dist/schedule/types.js +68 -0
  133. package/dist/search/text-match.d.ts +78 -0
  134. package/dist/search/text-match.js +330 -0
  135. package/dist/service-defaults.d.ts +3 -0
  136. package/dist/service-defaults.js +5 -0
  137. package/dist/ssh-transport.d.ts +11 -0
  138. package/dist/ssh-transport.js +72 -0
  139. package/dist/terminal-activity.d.ts +21 -0
  140. package/dist/terminal-activity.js +25 -0
  141. package/dist/terminal-input-mode.d.ts +30 -0
  142. package/dist/terminal-input-mode.js +180 -0
  143. package/dist/terminal-key-input.d.ts +13 -0
  144. package/dist/terminal-key-input.js +210 -0
  145. package/dist/terminal-profile.d.ts +10 -0
  146. package/dist/terminal-profile.js +11 -0
  147. package/dist/terminal-profiles.d.ts +41 -0
  148. package/dist/terminal-profiles.js +276 -0
  149. package/dist/terminal-snapshot.d.ts +4 -0
  150. package/dist/terminal-snapshot.js +220 -0
  151. package/dist/terminal-stream-protocol.d.ts +2 -0
  152. package/dist/terminal-stream-protocol.js +2 -0
  153. package/dist/terminal-subscription-key.d.ts +2 -0
  154. package/dist/terminal-subscription-key.js +9 -0
  155. package/dist/timeline-identity.d.ts +3 -0
  156. package/dist/timeline-identity.js +8 -0
  157. package/dist/tool-call-display.d.ts +13 -0
  158. package/dist/tool-call-display.js +144 -0
  159. package/dist/tool-name-normalization.d.ts +9 -0
  160. package/dist/tool-name-normalization.js +82 -0
  161. package/dist/user-agent.d.ts +26 -0
  162. package/dist/user-agent.js +101 -0
  163. package/dist/validation/ws-outbound-envelope.d.ts +13261 -0
  164. package/dist/validation/ws-outbound-envelope.js +17 -0
  165. package/dist/validation/ws-outbound.d.ts +12 -0
  166. package/dist/validation/ws-outbound.js +38 -0
  167. package/dist/websocket-message-limit.d.ts +5 -0
  168. package/dist/websocket-message-limit.js +5 -0
  169. package/dist/workspace-labels.d.ts +9 -0
  170. package/dist/workspace-labels.js +19 -0
  171. package/package.json +43 -4
@@ -0,0 +1,2 @@
1
+ export declare function stripCwdPrefix(filePath: string, cwd?: string): string;
2
+ //# sourceMappingURL=path-utils.d.ts.map
@@ -0,0 +1,16 @@
1
+ export function stripCwdPrefix(filePath, cwd) {
2
+ if (!cwd || !filePath) {
3
+ return filePath;
4
+ }
5
+ const normalizedCwd = cwd.replace(/\\/g, "/").replace(/\/+$/, "");
6
+ const normalizedPath = filePath.replace(/\\/g, "/");
7
+ const prefix = `${normalizedCwd}/`;
8
+ if (normalizedPath.startsWith(prefix)) {
9
+ return normalizedPath.slice(prefix.length);
10
+ }
11
+ if (normalizedPath === normalizedCwd) {
12
+ return ".";
13
+ }
14
+ return filePath;
15
+ }
16
+ //# sourceMappingURL=path-utils.js.map
@@ -0,0 +1,18 @@
1
+ import { z } from "zod";
2
+ export declare const PluginIdSchema: z.ZodString;
3
+ export declare const PluginRequirementsSchema: z.ZodObject<{
4
+ mateo: z.ZodOptional<z.ZodString>;
5
+ }, z.core.$strip>;
6
+ export type PluginRequirements = z.infer<typeof PluginRequirementsSchema>;
7
+ export declare const DirectoryPluginSourceSchema: z.ZodObject<{
8
+ source: z.ZodLiteral<"directory">;
9
+ path: z.ZodString;
10
+ enabled: z.ZodOptional<z.ZodBoolean>;
11
+ }, z.core.$strict>;
12
+ export declare const PluginSourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
13
+ source: z.ZodLiteral<"directory">;
14
+ path: z.ZodString;
15
+ enabled: z.ZodOptional<z.ZodBoolean>;
16
+ }, z.core.$strict>], "source">;
17
+ export type PluginSource = z.infer<typeof PluginSourceSchema>;
18
+ //# sourceMappingURL=plugin-config.d.ts.map
@@ -0,0 +1,13 @@
1
+ import { z } from "zod";
2
+ export const PluginIdSchema = z.string().regex(/^[a-z][a-z0-9-]*$/);
3
+ // Semver validation belongs at the manifest/runtime boundary, not on the wire.
4
+ export const PluginRequirementsSchema = z.object({ mateo: z.string().optional() });
5
+ export const DirectoryPluginSourceSchema = z
6
+ .object({
7
+ source: z.literal("directory"),
8
+ path: z.string().min(1),
9
+ enabled: z.boolean().optional(),
10
+ })
11
+ .strict();
12
+ export const PluginSourceSchema = z.discriminatedUnion("source", [DirectoryPluginSourceSchema]);
13
+ //# sourceMappingURL=plugin-config.js.map
@@ -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,153 @@
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
+ /** A bare `owner/slug`, which only names a plugin when a default registry is configured. */
147
+ export declare function isBarePluginRegistryId(source: string): boolean;
148
+ /**
149
+ * Mateo ships with no default registry: `host/owner/slug` always resolves, and a
150
+ * bare `owner/slug` resolves only against the host's configured default.
151
+ */
152
+ export declare function parsePluginRegistryReference(source: string, defaultUrl?: string): PluginRegistryIdentity | null;
153
+ //# sourceMappingURL=plugin-registry.d.ts.map
@@ -0,0 +1,83 @@
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
+ /** A bare `owner/slug`, which only names a plugin when a default registry is configured. */
63
+ export function isBarePluginRegistryId(source) {
64
+ return source.split("/").length === 2 && PluginRegistryIdSchema.safeParse(source).success;
65
+ }
66
+ /**
67
+ * Mateo ships with no default registry: `host/owner/slug` always resolves, and a
68
+ * bare `owner/slug` resolves only against the host's configured default.
69
+ */
70
+ export function parsePluginRegistryReference(source, defaultUrl) {
71
+ const segments = source.split("/");
72
+ if (isBarePluginRegistryId(source))
73
+ return defaultUrl ? { url: defaultUrl.replace(/\/+$/, ""), id: source } : null;
74
+ const [host, ...rest] = segments;
75
+ if (segments.length !== 3 || !host || !/[.:]/.test(host) || /[@?#\\]/.test(host))
76
+ return null;
77
+ const id = rest.join("/");
78
+ if (!PluginRegistryIdSchema.safeParse(id).success)
79
+ return null;
80
+ const url = new URL(`https://${host}`);
81
+ return { url: url.origin, id };
82
+ }
83
+ //# sourceMappingURL=plugin-registry.js.map
@@ -0,0 +1,11 @@
1
+ import type { PluginRequirements } from "./messages.js";
2
+ export declare function validatePluginRequirements(requirements: PluginRequirements | undefined): void;
3
+ interface PluginCompatibilityInput {
4
+ id: string;
5
+ requirements?: PluginRequirements;
6
+ version: string | null;
7
+ runtime: "daemon" | "app";
8
+ }
9
+ export declare function assertPluginCompatibility(input: PluginCompatibilityInput): void;
10
+ export {};
11
+ //# sourceMappingURL=plugin-requirements.d.ts.map
@@ -0,0 +1,26 @@
1
+ import parse from "semver/functions/parse.js";
2
+ import validRange from "semver/ranges/valid.js";
3
+ import satisfies from "semver/functions/satisfies.js";
4
+ export function validatePluginRequirements(requirements) {
5
+ const range = requirements?.mateo;
6
+ if (range !== undefined && (!range.trim() || validRange(range) === null)) {
7
+ throw new Error(`Invalid requirements.mateo: ${JSON.stringify(range)}. Use an npm semver range such as ">=0.8.0".`);
8
+ }
9
+ }
10
+ export function assertPluginCompatibility(input) {
11
+ validatePluginRequirements(input.requirements);
12
+ // COMPAT(plugin-requirements): added in v0.8.0-beta.1; remove after 2027-03-07 once pre-0.8 plugins and catalogs are unsupported. The legacy range excludes 0.8 prereleases and their stable core.
13
+ const range = input.requirements?.mateo ?? "<0.8.0";
14
+ const version = input.version ? parse(input.version) : null;
15
+ if (!version) {
16
+ throw new Error(`Cannot check plugin "${input.id}" requirements: Mateo ${input.runtime} version is unknown. Update the ${input.runtime}.`);
17
+ }
18
+ const stableCore = `${version.major}.${version.minor}.${version.patch}`;
19
+ if (satisfies(version, range) || satisfies(stableCore, range))
20
+ return;
21
+ const action = input.requirements?.mateo === undefined
22
+ ? "This plugin has no requirements.mateo and targets Mateo before 0.8. Ask its author to migrate it: https://paseo.sh/docs/plugins/migration"
23
+ : `Use a compatible plugin version or update the ${input.runtime}.`;
24
+ throw new Error(`Plugin "${input.id}" requires Mateo ${range}. Your ${input.runtime} is ${input.version}. ${action}`);
25
+ }
26
+ //# sourceMappingURL=plugin-requirements.js.map
@@ -0,0 +1,11 @@
1
+ import type { PluginInstallation } from "./messages.js";
2
+ export interface PluginSourceReference {
3
+ kind: "directory" | "managed";
4
+ source: string;
5
+ pluginPath: string | undefined;
6
+ }
7
+ export declare function parsePluginSourceReference(reference: string): PluginSourceReference;
8
+ export declare function formatPluginSourceReference(source: string, pluginPath: string | undefined): string;
9
+ export declare function formatPluginIdentity(identity: PluginInstallation["identity"]): string;
10
+ export declare function formatPluginInstallation(installation: PluginInstallation): string;
11
+ //# sourceMappingURL=plugin-source-reference.d.ts.map
@@ -0,0 +1,68 @@
1
+ import { parsePluginRegistryReference } from "./plugin-registry.js";
2
+ export function parsePluginSourceReference(reference) {
3
+ const prefix = /^(npm:|github:|git:(?!\/\/))/.exec(reference)?.[0];
4
+ const source = prefix ? reference.slice(prefix.length) : reference;
5
+ const parsed = splitPluginPath(source, { scp: prefix !== "npm:" });
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}` };
12
+ }
13
+ function splitPluginPath(reference, options) {
14
+ const separator = reference.lastIndexOf(":");
15
+ if (separator === -1)
16
+ return { source: reference, pluginPath: undefined };
17
+ const pluginPath = reference.slice(separator + 1);
18
+ if (!isPortableRelativePluginPath(pluginPath)) {
19
+ return { source: reference, pluginPath: undefined };
20
+ }
21
+ const scheme = reference.indexOf("://");
22
+ if (scheme !== -1) {
23
+ const pathStart = reference.indexOf("/", scheme + 3);
24
+ if (pathStart === -1 || separator < pathStart) {
25
+ return { source: reference, pluginPath: undefined };
26
+ }
27
+ }
28
+ else if (options.scp) {
29
+ const scpSeparator = reference.match(/^[^/@\s]+@[^:\s]+:/)?.[0].length;
30
+ if (scpSeparator !== undefined && separator === scpSeparator - 1) {
31
+ return { source: reference, pluginPath: undefined };
32
+ }
33
+ }
34
+ return { source: reference.slice(0, separator), pluginPath };
35
+ }
36
+ export function formatPluginSourceReference(source, pluginPath) {
37
+ if (pluginPath === undefined)
38
+ return source;
39
+ if (!isPortableRelativePluginPath(pluginPath)) {
40
+ throw new Error("Plugin path must be a portable path relative to the repository");
41
+ }
42
+ return `${source}:${pluginPath}`;
43
+ }
44
+ function isPortableRelativePluginPath(pluginPath) {
45
+ if (pluginPath === ".")
46
+ return true;
47
+ if (!pluginPath || pluginPath.startsWith("/") || pluginPath.startsWith("\\"))
48
+ return false;
49
+ if (/^[A-Za-z]:/.test(pluginPath) || pluginPath.includes(":"))
50
+ return false;
51
+ return pluginPath.split(/[\\/]/).every((part) => part !== "" && part !== "." && part !== "..");
52
+ }
53
+ export function formatPluginIdentity(identity) {
54
+ if (identity.kind === "directory")
55
+ return identity.path;
56
+ if (identity.registry)
57
+ return `${new URL(identity.registry.url).host}/${identity.registry.id}`;
58
+ const source = identity.kind === "npm" ? `npm:${identity.packageName}` : `git:${identity.remote}`;
59
+ return identity.pluginPath === "." ? source : `${source}:${identity.pluginPath}`;
60
+ }
61
+ export function formatPluginInstallation(installation) {
62
+ const identity = formatPluginIdentity(installation.identity);
63
+ const revision = installation.identity.kind === "git"
64
+ ? installation.currentRevision?.slice(0, 12)
65
+ : installation.currentRevision;
66
+ return revision ? `${identity} · ${revision}` : identity;
67
+ }
68
+ //# sourceMappingURL=plugin-source-reference.js.map
@@ -0,0 +1,141 @@
1
+ import { z } from "zod";
2
+ import type { AgentProvider } from "./agent-types.js";
3
+ export declare const ProviderCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4
+ mode: z.ZodLiteral<"default">;
5
+ }, z.core.$strip>, z.ZodObject<{
6
+ mode: z.ZodLiteral<"append">;
7
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
8
+ }, z.core.$strip>, z.ZodObject<{
9
+ mode: z.ZodLiteral<"replace">;
10
+ argv: z.ZodArray<z.ZodString>;
11
+ }, z.core.$strip>], "mode">;
12
+ export declare const ProviderRuntimeSettingsSchema: z.ZodObject<{
13
+ command: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
14
+ mode: z.ZodLiteral<"default">;
15
+ }, z.core.$strip>, z.ZodObject<{
16
+ mode: z.ZodLiteral<"append">;
17
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
18
+ }, z.core.$strip>, z.ZodObject<{
19
+ mode: z.ZodLiteral<"replace">;
20
+ argv: z.ZodArray<z.ZodString>;
21
+ }, z.core.$strip>], "mode">>;
22
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
23
+ disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
24
+ }, z.core.$strip>;
25
+ export declare const ProviderMateoToolsPolicySchema: z.ZodObject<{
26
+ enabled: z.ZodOptional<z.ZodBoolean>;
27
+ disabledTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
28
+ }, z.core.$strip>;
29
+ export declare const ProviderProfileModelSchema: z.ZodObject<{
30
+ id: z.ZodString;
31
+ label: z.ZodString;
32
+ description: z.ZodOptional<z.ZodString>;
33
+ isDefault: z.ZodOptional<z.ZodBoolean>;
34
+ thinkingOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
35
+ id: z.ZodString;
36
+ label: z.ZodString;
37
+ description: z.ZodOptional<z.ZodString>;
38
+ isDefault: z.ZodOptional<z.ZodBoolean>;
39
+ }, z.core.$strip>>>;
40
+ }, z.core.$strip>;
41
+ export declare const ProviderOverrideSchema: z.ZodObject<{
42
+ extends: z.ZodOptional<z.ZodString>;
43
+ label: z.ZodOptional<z.ZodString>;
44
+ description: z.ZodOptional<z.ZodString>;
45
+ command: z.ZodOptional<z.ZodArray<z.ZodString>>;
46
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
47
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
48
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
49
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
50
+ id: z.ZodString;
51
+ label: z.ZodString;
52
+ description: z.ZodOptional<z.ZodString>;
53
+ isDefault: z.ZodOptional<z.ZodBoolean>;
54
+ thinkingOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
55
+ id: z.ZodString;
56
+ label: z.ZodString;
57
+ description: z.ZodOptional<z.ZodString>;
58
+ isDefault: z.ZodOptional<z.ZodBoolean>;
59
+ }, z.core.$strip>>>;
60
+ }, z.core.$strip>>>;
61
+ additionalModels: z.ZodOptional<z.ZodArray<z.ZodObject<{
62
+ id: z.ZodString;
63
+ label: z.ZodString;
64
+ description: z.ZodOptional<z.ZodString>;
65
+ isDefault: z.ZodOptional<z.ZodBoolean>;
66
+ thinkingOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
67
+ id: z.ZodString;
68
+ label: z.ZodString;
69
+ description: z.ZodOptional<z.ZodString>;
70
+ isDefault: z.ZodOptional<z.ZodBoolean>;
71
+ }, z.core.$strip>>>;
72
+ }, z.core.$strip>>>;
73
+ disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
74
+ mateoTools: z.ZodOptional<z.ZodObject<{
75
+ enabled: z.ZodOptional<z.ZodBoolean>;
76
+ disabledTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
77
+ }, z.core.$strip>>;
78
+ enabled: z.ZodOptional<z.ZodBoolean>;
79
+ order: z.ZodOptional<z.ZodNumber>;
80
+ }, z.core.$strip>;
81
+ export declare const ProviderOverridesSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
82
+ extends: z.ZodOptional<z.ZodString>;
83
+ label: z.ZodOptional<z.ZodString>;
84
+ description: z.ZodOptional<z.ZodString>;
85
+ command: z.ZodOptional<z.ZodArray<z.ZodString>>;
86
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
87
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
88
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
89
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
90
+ id: z.ZodString;
91
+ label: z.ZodString;
92
+ description: z.ZodOptional<z.ZodString>;
93
+ isDefault: z.ZodOptional<z.ZodBoolean>;
94
+ thinkingOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
95
+ id: z.ZodString;
96
+ label: z.ZodString;
97
+ description: z.ZodOptional<z.ZodString>;
98
+ isDefault: z.ZodOptional<z.ZodBoolean>;
99
+ }, z.core.$strip>>>;
100
+ }, z.core.$strip>>>;
101
+ additionalModels: z.ZodOptional<z.ZodArray<z.ZodObject<{
102
+ id: z.ZodString;
103
+ label: z.ZodString;
104
+ description: z.ZodOptional<z.ZodString>;
105
+ isDefault: z.ZodOptional<z.ZodBoolean>;
106
+ thinkingOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
107
+ id: z.ZodString;
108
+ label: z.ZodString;
109
+ description: z.ZodOptional<z.ZodString>;
110
+ isDefault: z.ZodOptional<z.ZodBoolean>;
111
+ }, z.core.$strip>>>;
112
+ }, z.core.$strip>>>;
113
+ disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
114
+ mateoTools: z.ZodOptional<z.ZodObject<{
115
+ enabled: z.ZodOptional<z.ZodBoolean>;
116
+ disabledTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
117
+ }, z.core.$strip>>;
118
+ enabled: z.ZodOptional<z.ZodBoolean>;
119
+ order: z.ZodOptional<z.ZodNumber>;
120
+ }, z.core.$strip>>;
121
+ export declare const AgentProviderRuntimeSettingsMapSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
122
+ command: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
123
+ mode: z.ZodLiteral<"default">;
124
+ }, z.core.$strip>, z.ZodObject<{
125
+ mode: z.ZodLiteral<"append">;
126
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
127
+ }, z.core.$strip>, z.ZodObject<{
128
+ mode: z.ZodLiteral<"replace">;
129
+ argv: z.ZodArray<z.ZodString>;
130
+ }, z.core.$strip>], "mode">>;
131
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
132
+ disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
133
+ }, z.core.$strip>>;
134
+ export type ProviderCommand = z.infer<typeof ProviderCommandSchema>;
135
+ export type ProviderRuntimeSettings = z.infer<typeof ProviderRuntimeSettingsSchema>;
136
+ export type ProviderMateoToolsPolicy = z.infer<typeof ProviderMateoToolsPolicySchema>;
137
+ export type ProviderProfileModel = z.infer<typeof ProviderProfileModelSchema>;
138
+ export type ProviderOverride = z.infer<typeof ProviderOverrideSchema>;
139
+ export type ProviderOverrides = z.infer<typeof ProviderOverridesSchema>;
140
+ export type AgentProviderRuntimeSettingsMap = Partial<Record<AgentProvider, ProviderRuntimeSettings>>;
141
+ //# sourceMappingURL=provider-config.d.ts.map