@getmateo/protocol 0.0.0-stage → 0.18.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.
Files changed (179) 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 +1224 -0
  42. package/dist/browser-automation/rpc-schemas.js +497 -0
  43. package/dist/browser-download-rules.d.ts +21 -0
  44. package/dist/browser-download-rules.js +54 -0
  45. package/dist/build-metadata.d.ts +17 -0
  46. package/dist/build-metadata.js +61 -0
  47. package/dist/chat/rpc-schemas.d.ts +158 -0
  48. package/dist/chat/rpc-schemas.js +104 -0
  49. package/dist/chat/types.d.ts +30 -0
  50. package/dist/chat/types.js +23 -0
  51. package/dist/check-traits.d.ts +11 -0
  52. package/dist/check-traits.js +10 -0
  53. package/dist/chunked-transport.d.ts +42 -0
  54. package/dist/chunked-transport.js +277 -0
  55. package/dist/client-capabilities.d.ts +24 -0
  56. package/dist/client-capabilities.js +52 -0
  57. package/dist/connection-offer.d.ts +36 -0
  58. package/dist/connection-offer.js +53 -0
  59. package/dist/daemon-auth.d.ts +548 -0
  60. package/dist/daemon-auth.js +152 -0
  61. package/dist/daemon-endpoints.d.ts +54 -0
  62. package/dist/daemon-endpoints.js +243 -0
  63. package/dist/error-utils.d.ts +11 -0
  64. package/dist/error-utils.js +27 -0
  65. package/dist/fleet.d.ts +381 -0
  66. package/dist/fleet.js +134 -0
  67. package/dist/forge-manifest.d.ts +66 -0
  68. package/dist/forge-manifest.js +92 -0
  69. package/dist/generated/validation/ws-outbound-schema-metadata.d.ts +14187 -0
  70. package/dist/generated/validation/ws-outbound-schema-metadata.js +262 -0
  71. package/dist/generated/validation/ws-outbound.aot.d.ts +520 -0
  72. package/dist/generated/validation/ws-outbound.aot.js +106677 -0
  73. package/dist/git-remote.d.ts +33 -0
  74. package/dist/git-remote.js +94 -0
  75. package/dist/gitea-status.d.ts +10 -0
  76. package/dist/gitea-status.js +23 -0
  77. package/dist/gitlab-pipeline.d.ts +10 -0
  78. package/dist/gitlab-pipeline.js +17 -0
  79. package/dist/global-terminal.d.ts +3 -0
  80. package/dist/global-terminal.js +8 -0
  81. package/dist/host-connection-schema.d.ts +11 -0
  82. package/dist/host-connection-schema.js +9 -0
  83. package/dist/host-target.d.ts +20 -0
  84. package/dist/host-target.js +137 -0
  85. package/dist/hosts.d.ts +133 -0
  86. package/dist/hosts.js +82 -0
  87. package/dist/literal-union.d.ts +2 -0
  88. package/dist/literal-union.js +2 -0
  89. package/dist/loop/rpc-schemas.d.ts +636 -0
  90. package/dist/loop/rpc-schemas.js +164 -0
  91. package/dist/mateo-config-schema.d.ts +138 -0
  92. package/dist/mateo-config-schema.js +98 -0
  93. package/dist/mateo-tool-call-detail.d.ts +2 -0
  94. package/dist/mateo-tool-call-detail.js +3 -0
  95. package/dist/mateo-tool-presentation/agent-message.d.ts +10 -0
  96. package/dist/mateo-tool-presentation/agent-message.js +23 -0
  97. package/dist/mateo-tool-presentation/catalog.d.ts +321 -0
  98. package/dist/mateo-tool-presentation/catalog.js +319 -0
  99. package/dist/mateo-tool-presentation/detail-sections.d.ts +15 -0
  100. package/dist/mateo-tool-presentation/detail-sections.js +161 -0
  101. package/dist/mateo-tool-presentation/index.d.ts +22 -0
  102. package/dist/mateo-tool-presentation/index.js +62 -0
  103. package/dist/mateo-tool-presentation/summary-text.d.ts +7 -0
  104. package/dist/mateo-tool-presentation/summary-text.js +22 -0
  105. package/dist/messages.d.ts +70260 -0
  106. package/dist/messages.js +6740 -0
  107. package/dist/path-utils.d.ts +2 -0
  108. package/dist/path-utils.js +16 -0
  109. package/dist/plugin-browser-consent-copy.d.ts +193 -0
  110. package/dist/plugin-browser-consent-copy.js +109 -0
  111. package/dist/plugin-browser-grants.d.ts +48 -0
  112. package/dist/plugin-browser-grants.js +56 -0
  113. package/dist/plugin-browser.d.ts +321 -0
  114. package/dist/plugin-browser.js +109 -0
  115. package/dist/plugin-config.d.ts +18 -0
  116. package/dist/plugin-config.js +13 -0
  117. package/dist/plugin-overview.d.ts +12 -0
  118. package/dist/plugin-overview.js +50 -0
  119. package/dist/plugin-registry.d.ts +153 -0
  120. package/dist/plugin-registry.js +83 -0
  121. package/dist/plugin-requirements.d.ts +11 -0
  122. package/dist/plugin-requirements.js +26 -0
  123. package/dist/plugin-source-reference.d.ts +11 -0
  124. package/dist/plugin-source-reference.js +68 -0
  125. package/dist/provider-config.d.ts +141 -0
  126. package/dist/provider-config.js +113 -0
  127. package/dist/provider-icon-names.d.ts +5 -0
  128. package/dist/provider-icon-names.js +54 -0
  129. package/dist/provider-manifest.d.ts +30 -0
  130. package/dist/provider-manifest.js +247 -0
  131. package/dist/provider-snapshot-codec.d.ts +18 -0
  132. package/dist/provider-snapshot-codec.js +71 -0
  133. package/dist/schedule/cadence.d.ts +6 -0
  134. package/dist/schedule/cadence.js +28 -0
  135. package/dist/schedule/cron-expression.d.ts +14 -0
  136. package/dist/schedule/cron-expression.js +107 -0
  137. package/dist/schedule/rpc-schemas.d.ts +570 -0
  138. package/dist/schedule/rpc-schemas.js +158 -0
  139. package/dist/schedule/types.d.ts +201 -0
  140. package/dist/schedule/types.js +68 -0
  141. package/dist/search/text-match.d.ts +78 -0
  142. package/dist/search/text-match.js +330 -0
  143. package/dist/service-defaults.d.ts +3 -0
  144. package/dist/service-defaults.js +5 -0
  145. package/dist/ssh-transport.d.ts +11 -0
  146. package/dist/ssh-transport.js +72 -0
  147. package/dist/terminal-activity.d.ts +21 -0
  148. package/dist/terminal-activity.js +25 -0
  149. package/dist/terminal-input-mode.d.ts +30 -0
  150. package/dist/terminal-input-mode.js +180 -0
  151. package/dist/terminal-key-input.d.ts +13 -0
  152. package/dist/terminal-key-input.js +210 -0
  153. package/dist/terminal-profile.d.ts +10 -0
  154. package/dist/terminal-profile.js +11 -0
  155. package/dist/terminal-profiles.d.ts +41 -0
  156. package/dist/terminal-profiles.js +276 -0
  157. package/dist/terminal-snapshot.d.ts +4 -0
  158. package/dist/terminal-snapshot.js +220 -0
  159. package/dist/terminal-stream-protocol.d.ts +2 -0
  160. package/dist/terminal-stream-protocol.js +2 -0
  161. package/dist/terminal-subscription-key.d.ts +2 -0
  162. package/dist/terminal-subscription-key.js +9 -0
  163. package/dist/timeline-identity.d.ts +3 -0
  164. package/dist/timeline-identity.js +8 -0
  165. package/dist/tool-call-display.d.ts +13 -0
  166. package/dist/tool-call-display.js +144 -0
  167. package/dist/tool-name-normalization.d.ts +9 -0
  168. package/dist/tool-name-normalization.js +82 -0
  169. package/dist/user-agent.d.ts +26 -0
  170. package/dist/user-agent.js +101 -0
  171. package/dist/validation/ws-outbound-envelope.d.ts +13413 -0
  172. package/dist/validation/ws-outbound-envelope.js +17 -0
  173. package/dist/validation/ws-outbound.d.ts +12 -0
  174. package/dist/validation/ws-outbound.js +38 -0
  175. package/dist/websocket-message-limit.d.ts +5 -0
  176. package/dist/websocket-message-limit.js +5 -0
  177. package/dist/workspace-labels.d.ts +9 -0
  178. package/dist/workspace-labels.js +19 -0
  179. package/package.json +48 -4
@@ -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
@@ -0,0 +1,113 @@
1
+ import { z } from "zod";
2
+ import { AgentProviderSchema } from "./provider-manifest.js";
3
+ const ProviderCommandDefaultSchema = z.object({
4
+ mode: z.literal("default"),
5
+ });
6
+ const ProviderCommandAppendSchema = z.object({
7
+ mode: z.literal("append"),
8
+ args: z.array(z.string()).optional(),
9
+ });
10
+ const ProviderCommandReplaceSchema = z.object({
11
+ mode: z.literal("replace"),
12
+ argv: z.array(z.string().min(1)).min(1),
13
+ });
14
+ export const ProviderCommandSchema = z.discriminatedUnion("mode", [
15
+ ProviderCommandDefaultSchema,
16
+ ProviderCommandAppendSchema,
17
+ ProviderCommandReplaceSchema,
18
+ ]);
19
+ export const ProviderRuntimeSettingsSchema = z.object({
20
+ command: ProviderCommandSchema.optional(),
21
+ env: z.record(z.string(), z.string()).optional(),
22
+ disallowedTools: z.array(z.string()).optional(),
23
+ });
24
+ export const ProviderMateoToolsPolicySchema = z.object({
25
+ enabled: z.boolean().optional(),
26
+ disabledTools: z.array(z.string()).optional(),
27
+ });
28
+ const ProviderProfileThinkingOptionSchema = z.object({
29
+ id: z.string(),
30
+ label: z.string(),
31
+ description: z.string().optional(),
32
+ isDefault: z.boolean().optional(),
33
+ });
34
+ export const ProviderProfileModelSchema = z.object({
35
+ id: z.string().min(1),
36
+ label: z.string().min(1),
37
+ description: z.string().optional(),
38
+ isDefault: z.boolean().optional(),
39
+ thinkingOptions: z.array(ProviderProfileThinkingOptionSchema).optional(),
40
+ });
41
+ export const ProviderOverrideSchema = z.object({
42
+ extends: z.string().optional(),
43
+ label: z.string().optional(),
44
+ description: z.string().optional(),
45
+ command: z.array(z.string().min(1)).min(1).optional(),
46
+ env: z.record(z.string(), z.string()).optional(),
47
+ options: z.record(z.string(), z.unknown()).optional(),
48
+ // COMPAT(providerParams): added in v0.10.0, remove after 2027-03-30 once configs use options.
49
+ params: z.record(z.string(), z.unknown()).optional(),
50
+ models: z.array(ProviderProfileModelSchema).optional(),
51
+ additionalModels: z.array(ProviderProfileModelSchema).optional(),
52
+ disallowedTools: z.array(z.string()).optional(),
53
+ mateoTools: ProviderMateoToolsPolicySchema.optional(),
54
+ enabled: z.boolean().optional(),
55
+ order: z.number().optional(),
56
+ });
57
+ const BUILTIN_PROVIDER_IDS = ["claude", "codex", "copilot", "opencode", "pi", "omp"];
58
+ const PROVIDER_ID_PATTERN = /^[a-z][a-z0-9-]*$/;
59
+ export const ProviderOverridesSchema = z
60
+ .record(z.string(), ProviderOverrideSchema)
61
+ .superRefine((providers, ctx) => {
62
+ const builtinProviderIdSet = new Set(BUILTIN_PROVIDER_IDS);
63
+ const validExtendsValues = new Set([...BUILTIN_PROVIDER_IDS, "acp"]);
64
+ for (const [providerId, provider] of Object.entries(providers)) {
65
+ if (!PROVIDER_ID_PATTERN.test(providerId)) {
66
+ ctx.addIssue({
67
+ code: z.ZodIssueCode.custom,
68
+ path: [providerId],
69
+ message: `Provider ID "${providerId}" must match ${PROVIDER_ID_PATTERN}.`,
70
+ });
71
+ }
72
+ const isBuiltinProvider = builtinProviderIdSet.has(providerId);
73
+ // Config loads before plugin registration. An entry without extends is an override;
74
+ // registry construction decides whether its provider exists. Configurable plugin IDs
75
+ // use this existing config alphabet; dots/underscores remain registration-only.
76
+ if (!isBuiltinProvider && provider.extends && !provider.label) {
77
+ ctx.addIssue({
78
+ code: z.ZodIssueCode.custom,
79
+ path: [providerId, "label"],
80
+ message: `Custom provider "${providerId}" must declare label.`,
81
+ });
82
+ }
83
+ if (provider.extends && !validExtendsValues.has(provider.extends)) {
84
+ ctx.addIssue({
85
+ code: z.ZodIssueCode.custom,
86
+ path: [providerId, "extends"],
87
+ message: `Provider "${providerId}" extends unknown provider "${provider.extends}".`,
88
+ });
89
+ }
90
+ if (provider.extends === "acp" && !provider.command) {
91
+ ctx.addIssue({
92
+ code: z.ZodIssueCode.custom,
93
+ path: [providerId, "command"],
94
+ message: `Provider "${providerId}" extending "acp" must declare command.`,
95
+ });
96
+ }
97
+ }
98
+ });
99
+ export const AgentProviderRuntimeSettingsMapSchema = z
100
+ .record(z.string(), ProviderRuntimeSettingsSchema)
101
+ .superRefine((providers, ctx) => {
102
+ for (const providerId of Object.keys(providers)) {
103
+ const parsedProviderId = AgentProviderSchema.safeParse(providerId);
104
+ if (!parsedProviderId.success) {
105
+ ctx.addIssue({
106
+ code: z.ZodIssueCode.custom,
107
+ path: [providerId],
108
+ message: `Invalid agent provider "${providerId}".`,
109
+ });
110
+ }
111
+ }
112
+ });
113
+ //# sourceMappingURL=provider-config.js.map
@@ -0,0 +1,5 @@
1
+ export declare const BUILTIN_PROVIDER_ICON_NAMES: string[];
2
+ export declare const ACP_PROVIDER_ICON_NAMES: string[];
3
+ export declare const TERMINAL_PROFILE_ICON_NAMES: string[];
4
+ export declare const KNOWN_PROVIDER_ICON_NAMES: string[];
5
+ //# sourceMappingURL=provider-icon-names.d.ts.map
@@ -0,0 +1,54 @@
1
+ export const BUILTIN_PROVIDER_ICON_NAMES = [
2
+ "claude",
3
+ "codex",
4
+ "copilot",
5
+ "kiro",
6
+ "minimax",
7
+ "omp",
8
+ "opencode",
9
+ "pi",
10
+ ];
11
+ export const ACP_PROVIDER_ICON_NAMES = [
12
+ "agoragentic-acp",
13
+ "amp-acp",
14
+ "auggie",
15
+ "autohand",
16
+ "cline",
17
+ "codebuddy-code",
18
+ "codewhale",
19
+ "cortex-code",
20
+ "corust-agent",
21
+ "crow-cli",
22
+ "cursor",
23
+ "deepagents",
24
+ "dimcode",
25
+ "dirac",
26
+ "factory-droid",
27
+ "fast-agent",
28
+ "gemini",
29
+ "gjc",
30
+ "glm-acp-agent",
31
+ "goose",
32
+ "grok",
33
+ "junie",
34
+ "kilo",
35
+ "kimi",
36
+ "minimax-code",
37
+ "minion-code",
38
+ "mistral-vibe",
39
+ "nova",
40
+ "poolside",
41
+ "qoder",
42
+ "qwen-code",
43
+ "sigit",
44
+ "stakpak",
45
+ "traecli",
46
+ "vtcode",
47
+ ];
48
+ export const TERMINAL_PROFILE_ICON_NAMES = ["agy"];
49
+ export const KNOWN_PROVIDER_ICON_NAMES = [
50
+ ...BUILTIN_PROVIDER_ICON_NAMES,
51
+ ...ACP_PROVIDER_ICON_NAMES,
52
+ ...TERMINAL_PROFILE_ICON_NAMES,
53
+ ];
54
+ //# sourceMappingURL=provider-icon-names.js.map
@@ -0,0 +1,30 @@
1
+ import { z } from "zod";
2
+ import type { AgentMode } from "./agent-types.js";
3
+ export type AgentModeColorTier = "safe" | "moderate" | "dangerous" | "planning" | `#${string}`;
4
+ export type AgentModeIcon = string;
5
+ export interface AgentModeVisuals {
6
+ icon: AgentModeIcon;
7
+ colorTier: AgentModeColorTier;
8
+ }
9
+ export type AgentProviderModeDefinition = Omit<AgentMode, "icon" | "colorTier"> & AgentModeVisuals & {
10
+ isUnattended?: boolean;
11
+ };
12
+ export interface AgentProviderDefinition {
13
+ id: string;
14
+ label: string;
15
+ description: string;
16
+ enabledByDefault?: boolean;
17
+ defaultModeId: string | null;
18
+ modes: AgentProviderModeDefinition[];
19
+ }
20
+ export declare const OMP_MODES: AgentProviderModeDefinition[];
21
+ export declare const AGENT_PROVIDER_DEFINITIONS: AgentProviderDefinition[];
22
+ export declare const DEV_AGENT_PROVIDER_DEFINITIONS: AgentProviderDefinition[];
23
+ export declare function getAgentProviderDefinition(provider: string, definitions?: AgentProviderDefinition[]): AgentProviderDefinition;
24
+ export declare const BUILTIN_PROVIDER_IDS: string[];
25
+ export declare const AGENT_PROVIDER_IDS: string[];
26
+ export declare const AgentProviderSchema: z.ZodString;
27
+ export declare function isValidAgentProvider(value: string, validIds?: Iterable<string>): boolean;
28
+ export declare function getUnattendedModeId(provider: string, definitions?: AgentProviderDefinition[]): string | undefined;
29
+ export declare function getModeVisuals(provider: string, modeId: string, definitions: AgentProviderDefinition[]): AgentModeVisuals | undefined;
30
+ //# sourceMappingURL=provider-manifest.d.ts.map