@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,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
@@ -0,0 +1,247 @@
1
+ import { z } from "zod";
2
+ const CLAUDE_MODES = [
3
+ {
4
+ id: "plan",
5
+ label: "Plan Mode",
6
+ description: "Analyze the codebase without executing tools or edits",
7
+ icon: "ShieldEllipsis",
8
+ colorTier: "planning",
9
+ },
10
+ {
11
+ id: "default",
12
+ label: "Always Ask",
13
+ description: "Prompts for permission the first time a tool is used",
14
+ icon: "Shield",
15
+ colorTier: "safe",
16
+ },
17
+ {
18
+ id: "acceptEdits",
19
+ label: "Accept File Edits",
20
+ description: "Automatically approves edit-focused tools without prompting",
21
+ icon: "ShieldPlus",
22
+ colorTier: "moderate",
23
+ },
24
+ {
25
+ id: "auto",
26
+ label: "Auto mode",
27
+ description: "Uses a model classifier to review permission prompts automatically",
28
+ icon: "ShieldCheck",
29
+ colorTier: "moderate",
30
+ },
31
+ {
32
+ id: "bypassPermissions",
33
+ label: "Bypass",
34
+ description: "Skip all permission prompts (use with caution)",
35
+ icon: "ShieldOff",
36
+ colorTier: "dangerous",
37
+ isUnattended: true,
38
+ },
39
+ ];
40
+ const CODEX_MODES = [
41
+ {
42
+ id: "auto",
43
+ label: "Default Permissions",
44
+ description: "Edit files and run commands with Codex's default approval flow.",
45
+ icon: "Shield",
46
+ colorTier: "moderate",
47
+ },
48
+ {
49
+ id: "auto-review",
50
+ label: "Auto-review",
51
+ description: "Same workspace-write permissions as Default, but eligible `on-request` approvals are routed through the auto-reviewer subagent.",
52
+ icon: "ShieldCheck",
53
+ colorTier: "moderate",
54
+ },
55
+ {
56
+ id: "full-access",
57
+ label: "Full Access",
58
+ description: "Edit files, run commands, and access the network without additional prompts.",
59
+ icon: "ShieldOff",
60
+ colorTier: "dangerous",
61
+ isUnattended: true,
62
+ },
63
+ ];
64
+ const COPILOT_MODES = [
65
+ {
66
+ id: "https://agentclientprotocol.com/protocol/session-modes#agent",
67
+ label: "Agent",
68
+ description: "Default agent mode for conversational interactions",
69
+ icon: "Shield",
70
+ colorTier: "moderate",
71
+ },
72
+ {
73
+ id: "https://agentclientprotocol.com/protocol/session-modes#plan",
74
+ label: "Plan",
75
+ description: "Plan mode for creating and executing multi-step plans",
76
+ icon: "ShieldEllipsis",
77
+ colorTier: "planning",
78
+ },
79
+ {
80
+ id: "allow-all",
81
+ label: "Allow All",
82
+ description: "Automatically approves all Copilot tool, path, and URL requests.",
83
+ icon: "ShieldOff",
84
+ colorTier: "dangerous",
85
+ isUnattended: true,
86
+ },
87
+ ];
88
+ const OPENCODE_MODES = [
89
+ {
90
+ id: "build",
91
+ label: "Build",
92
+ description: "Allows edits and tool execution for implementation work",
93
+ icon: "Shield",
94
+ colorTier: "moderate",
95
+ },
96
+ {
97
+ id: "plan",
98
+ label: "Plan",
99
+ description: "Read-only planning mode that avoids file edits",
100
+ icon: "ShieldEllipsis",
101
+ colorTier: "planning",
102
+ },
103
+ ];
104
+ export const OMP_MODES = [
105
+ {
106
+ id: "full",
107
+ label: "Full Access",
108
+ description: "Launches OMP with yolo approval mode so tools run without prompts.",
109
+ icon: "ShieldOff",
110
+ colorTier: "dangerous",
111
+ isUnattended: true,
112
+ },
113
+ {
114
+ id: "write",
115
+ label: "Write Approval",
116
+ description: "Launches OMP with write approval mode — reads are free, writes require approval.",
117
+ icon: "ShieldAlert",
118
+ colorTier: "moderate",
119
+ },
120
+ {
121
+ id: "ask",
122
+ label: "Always Ask",
123
+ description: "Launches OMP with always-ask approval mode for write and exec tools.",
124
+ icon: "ShieldCheck",
125
+ colorTier: "safe",
126
+ },
127
+ ];
128
+ const MOCK_LOAD_TEST_MODES = [
129
+ {
130
+ id: "load-test",
131
+ label: "Load Test",
132
+ description: "Streams repeated markdown, reasoning, and tool calls for app stress testing",
133
+ icon: "ShieldOff",
134
+ colorTier: "dangerous",
135
+ },
136
+ {
137
+ id: "approval-test",
138
+ label: "Approval Test",
139
+ description: "Alternate development-only permission mode for preference tests",
140
+ icon: "ShieldCheck",
141
+ colorTier: "safe",
142
+ },
143
+ ];
144
+ const MOCK_SLOW_MODES = [
145
+ {
146
+ id: "default",
147
+ label: "Default",
148
+ description: "Dev-only mode for the mock slow provider",
149
+ icon: "ShieldOff",
150
+ colorTier: "dangerous",
151
+ },
152
+ ];
153
+ export const AGENT_PROVIDER_DEFINITIONS = [
154
+ {
155
+ id: "claude",
156
+ label: "Claude",
157
+ description: "Anthropic's multi-tool assistant with MCP support, streaming, and deep reasoning",
158
+ defaultModeId: "auto",
159
+ modes: CLAUDE_MODES,
160
+ },
161
+ {
162
+ id: "codex",
163
+ label: "Codex",
164
+ description: "OpenAI's Codex workspace agent with sandbox controls and optional network access",
165
+ defaultModeId: "auto-review",
166
+ modes: CODEX_MODES,
167
+ },
168
+ {
169
+ id: "copilot",
170
+ label: "Copilot",
171
+ description: "GitHub Copilot via Agent Client Protocol with dynamic modes and session support",
172
+ defaultModeId: "https://agentclientprotocol.com/protocol/session-modes#agent",
173
+ modes: COPILOT_MODES,
174
+ },
175
+ {
176
+ id: "opencode",
177
+ label: "OpenCode",
178
+ description: "Open-source coding assistant with multi-provider model support",
179
+ // No static default: OpenCode users can rename or delete any agent,
180
+ // including "build". Leaving this unset means the daemon and OpenCode
181
+ // itself decide (see normalizeOpenCodeModeId in opencode-agent.ts).
182
+ defaultModeId: null,
183
+ modes: OPENCODE_MODES,
184
+ },
185
+ {
186
+ id: "pi",
187
+ label: "Pi",
188
+ description: "Minimal terminal-based coding agent with multi-provider LLM support",
189
+ defaultModeId: null,
190
+ modes: [],
191
+ },
192
+ {
193
+ id: "omp",
194
+ label: "Oh My Pi",
195
+ description: "Multi-provider coding agent with native approvals, host tools, and subagents",
196
+ enabledByDefault: false,
197
+ defaultModeId: "full",
198
+ modes: OMP_MODES,
199
+ },
200
+ ];
201
+ export const DEV_AGENT_PROVIDER_DEFINITIONS = [
202
+ {
203
+ id: "mock",
204
+ label: "Mock Load Test",
205
+ description: "Development-only provider that emits synthetic agent traffic for performance tests",
206
+ defaultModeId: "load-test",
207
+ modes: MOCK_LOAD_TEST_MODES,
208
+ },
209
+ {
210
+ id: "mock-slow",
211
+ label: "Mock Slow Provider",
212
+ description: "Dev-only: hangs during model discovery to test loading and timeout UI",
213
+ defaultModeId: "default",
214
+ modes: MOCK_SLOW_MODES,
215
+ },
216
+ ];
217
+ export function getAgentProviderDefinition(provider, definitions = [
218
+ ...AGENT_PROVIDER_DEFINITIONS,
219
+ ...DEV_AGENT_PROVIDER_DEFINITIONS,
220
+ ]) {
221
+ const definition = definitions.find((entry) => entry.id === provider);
222
+ if (!definition) {
223
+ throw new Error(`Unknown agent provider: ${provider}`);
224
+ }
225
+ return definition;
226
+ }
227
+ export const BUILTIN_PROVIDER_IDS = AGENT_PROVIDER_DEFINITIONS.map((d) => d.id);
228
+ export const AGENT_PROVIDER_IDS = BUILTIN_PROVIDER_IDS;
229
+ export const AgentProviderSchema = z.string();
230
+ export function isValidAgentProvider(value, validIds = BUILTIN_PROVIDER_IDS) {
231
+ return Array.isArray(validIds) ? validIds.includes(value) : new Set(validIds).has(value);
232
+ }
233
+ export function getUnattendedModeId(provider, definitions = [
234
+ ...AGENT_PROVIDER_DEFINITIONS,
235
+ ...DEV_AGENT_PROVIDER_DEFINITIONS,
236
+ ]) {
237
+ const definition = definitions.find((entry) => entry.id === provider);
238
+ return definition?.modes.find((mode) => mode.isUnattended)?.id;
239
+ }
240
+ export function getModeVisuals(provider, modeId, definitions) {
241
+ const definition = definitions.find((entry) => entry.id === provider);
242
+ const mode = definition?.modes.find((m) => m.id === modeId);
243
+ if (!mode)
244
+ return undefined;
245
+ return { icon: mode.icon, colorTier: mode.colorTier };
246
+ }
247
+ //# sourceMappingURL=provider-manifest.js.map
@@ -0,0 +1,18 @@
1
+ import type { AgentModelDefinition, AgentSelectOption, ProviderSnapshotEntry } from "./agent-types.js";
2
+ export interface CompactProviderSnapshotModel extends Omit<AgentModelDefinition, "provider" | "thinkingOptions"> {
3
+ thinkingSet?: number;
4
+ }
5
+ export interface CompactProviderSnapshotEntry extends Omit<ProviderSnapshotEntry, "models"> {
6
+ models?: CompactProviderSnapshotModel[];
7
+ }
8
+ export interface ProviderSnapshotThinkingSet {
9
+ options: AgentSelectOption[];
10
+ defaultOptionId?: string;
11
+ }
12
+ export interface CompactProviderSnapshot {
13
+ entries: CompactProviderSnapshotEntry[];
14
+ thinkingSets: ProviderSnapshotThinkingSet[];
15
+ }
16
+ export declare function compactProviderSnapshot(entries: ProviderSnapshotEntry[]): CompactProviderSnapshot;
17
+ export declare function expandProviderSnapshot(snapshot: CompactProviderSnapshot): ProviderSnapshotEntry[];
18
+ //# sourceMappingURL=provider-snapshot-codec.d.ts.map
@@ -0,0 +1,71 @@
1
+ function thinkingSetKey(set) {
2
+ return JSON.stringify(set);
3
+ }
4
+ function compactModel({ provider: _provider, thinkingOptions, defaultThinkingOptionId, ...modelFields }, thinkingSets, thinkingSetIndexes) {
5
+ const compact = modelFields;
6
+ if (thinkingOptions === undefined) {
7
+ if (defaultThinkingOptionId !== undefined) {
8
+ compact.defaultThinkingOptionId = defaultThinkingOptionId;
9
+ }
10
+ return compact;
11
+ }
12
+ const thinkingSet = {
13
+ options: thinkingOptions,
14
+ ...(defaultThinkingOptionId !== undefined ? { defaultOptionId: defaultThinkingOptionId } : {}),
15
+ };
16
+ const key = thinkingSetKey(thinkingSet);
17
+ const existingIndex = thinkingSetIndexes.get(key);
18
+ if (existingIndex !== undefined) {
19
+ compact.thinkingSet = existingIndex;
20
+ return compact;
21
+ }
22
+ const index = thinkingSets.length;
23
+ thinkingSets.push(thinkingSet);
24
+ thinkingSetIndexes.set(key, index);
25
+ compact.thinkingSet = index;
26
+ return compact;
27
+ }
28
+ export function compactProviderSnapshot(entries) {
29
+ const thinkingSets = [];
30
+ const thinkingSetIndexes = new Map();
31
+ const compactEntries = entries.map((entry) => {
32
+ if (entry.models === undefined) {
33
+ return entry;
34
+ }
35
+ return {
36
+ ...entry,
37
+ models: entry.models.map((model) => compactModel(model, thinkingSets, thinkingSetIndexes)),
38
+ };
39
+ });
40
+ return { entries: compactEntries, thinkingSets };
41
+ }
42
+ function expandModel(provider, model, thinkingSets) {
43
+ const { thinkingSet: thinkingSetIndex, ...modelFields } = model;
44
+ if (thinkingSetIndex === undefined) {
45
+ return { provider, ...modelFields };
46
+ }
47
+ const thinkingSet = thinkingSets[thinkingSetIndex];
48
+ if (!thinkingSet) {
49
+ throw new RangeError(`Provider snapshot references missing thinking set ${thinkingSetIndex}`);
50
+ }
51
+ return {
52
+ provider,
53
+ ...modelFields,
54
+ thinkingOptions: thinkingSet.options,
55
+ ...(thinkingSet.defaultOptionId !== undefined
56
+ ? { defaultThinkingOptionId: thinkingSet.defaultOptionId }
57
+ : {}),
58
+ };
59
+ }
60
+ export function expandProviderSnapshot(snapshot) {
61
+ return snapshot.entries.map((entry) => {
62
+ const { models, ...entryFields } = entry;
63
+ if (models === undefined)
64
+ return entryFields;
65
+ return {
66
+ ...entryFields,
67
+ models: models.map((model) => expandModel(entryFields.provider, model, snapshot.thinkingSets)),
68
+ };
69
+ });
70
+ }
71
+ //# sourceMappingURL=provider-snapshot-codec.js.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Convert an exact rolling interval to an equivalent five-field cron cadence.
3
+ * Returns null when cron's calendar boundaries would change the interval.
4
+ */
5
+ export declare function everyMsToFiveFieldCron(everyMs: number): string | null;
6
+ //# sourceMappingURL=cadence.d.ts.map
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Convert an exact rolling interval to an equivalent five-field cron cadence.
3
+ * Returns null when cron's calendar boundaries would change the interval.
4
+ */
5
+ export function everyMsToFiveFieldCron(everyMs) {
6
+ const minutes = everyMs / 60000;
7
+ if (!Number.isInteger(minutes) || minutes <= 0) {
8
+ return null;
9
+ }
10
+ if (minutes < 60 && 60 % minutes === 0) {
11
+ return `*/${minutes} * * * *`;
12
+ }
13
+ if (minutes === 60) {
14
+ return "0 * * * *";
15
+ }
16
+ if (minutes % 60 !== 0) {
17
+ return null;
18
+ }
19
+ const hours = minutes / 60;
20
+ if (hours < 24 && 24 % hours === 0) {
21
+ return `0 */${hours} * * *`;
22
+ }
23
+ if (hours === 24) {
24
+ return "0 0 * * *";
25
+ }
26
+ return null;
27
+ }
28
+ //# sourceMappingURL=cadence.js.map
@@ -0,0 +1,14 @@
1
+ export interface CronFieldMatcher {
2
+ isWildcard: boolean;
3
+ matches(value: number): boolean;
4
+ }
5
+ export interface ParsedCronExpression {
6
+ minute: CronFieldMatcher;
7
+ hour: CronFieldMatcher;
8
+ dayOfMonth: CronFieldMatcher;
9
+ month: CronFieldMatcher;
10
+ dayOfWeek: CronFieldMatcher;
11
+ }
12
+ export declare function parseCronExpression(expression: string): ParsedCronExpression;
13
+ export declare function validateCronExpression(expression: string): string | null;
14
+ //# sourceMappingURL=cron-expression.d.ts.map