@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,164 @@
1
+ import { z } from "zod";
2
+ import { AgentProviderSchema } from "../provider-manifest.js";
3
+ // COMPAT(agentLoops): retained after the v0.3.0 feature removal; remove after 2027-02-09 when mixed-version peers no longer send legacy messages.
4
+ export const LoopLogEntrySchema = z.object({
5
+ seq: z.number().int().positive(),
6
+ timestamp: z.string(),
7
+ iteration: z.number().int().positive().nullable(),
8
+ source: z.enum(["loop", "worker", "verifier", "verify-check"]),
9
+ level: z.enum(["info", "error"]),
10
+ text: z.string(),
11
+ });
12
+ export const LoopVerifyCheckResultSchema = z.object({
13
+ command: z.string(),
14
+ exitCode: z.number().int(),
15
+ passed: z.boolean(),
16
+ stdout: z.string(),
17
+ stderr: z.string(),
18
+ startedAt: z.string(),
19
+ completedAt: z.string(),
20
+ });
21
+ export const LoopVerifyPromptResultSchema = z.object({
22
+ passed: z.boolean(),
23
+ reason: z.string(),
24
+ verifierAgentId: z.string().nullable(),
25
+ startedAt: z.string(),
26
+ completedAt: z.string(),
27
+ });
28
+ export const LoopIterationRecordSchema = z.object({
29
+ index: z.number().int().positive(),
30
+ workerAgentId: z.string().nullable(),
31
+ workerStartedAt: z.string(),
32
+ workerCompletedAt: z.string().nullable(),
33
+ verifierAgentId: z.string().nullable(),
34
+ status: z.enum(["running", "succeeded", "failed", "stopped"]),
35
+ workerOutcome: z.enum(["completed", "failed", "canceled"]).nullable(),
36
+ failureReason: z.string().nullable(),
37
+ verifyChecks: z.array(LoopVerifyCheckResultSchema),
38
+ verifyPrompt: LoopVerifyPromptResultSchema.nullable(),
39
+ });
40
+ export const LoopRecordSchema = z.object({
41
+ id: z.string(),
42
+ name: z.string().nullable(),
43
+ prompt: z.string(),
44
+ cwd: z.string(),
45
+ provider: AgentProviderSchema,
46
+ model: z.string().nullable(),
47
+ modeId: z.string().nullable().default(null),
48
+ workerProvider: AgentProviderSchema.nullable(),
49
+ workerModel: z.string().nullable(),
50
+ verifierProvider: AgentProviderSchema.nullable(),
51
+ verifierModel: z.string().nullable(),
52
+ verifierModeId: z.string().nullable().default(null),
53
+ verifyPrompt: z.string().nullable(),
54
+ verifyChecks: z.array(z.string()),
55
+ archive: z.boolean(),
56
+ sleepMs: z.number().int().nonnegative(),
57
+ maxIterations: z.number().int().positive().nullable(),
58
+ maxTimeMs: z.number().int().positive().nullable(),
59
+ status: z.enum(["running", "succeeded", "failed", "stopped"]),
60
+ createdAt: z.string(),
61
+ updatedAt: z.string(),
62
+ startedAt: z.string(),
63
+ completedAt: z.string().nullable(),
64
+ stopRequestedAt: z.string().nullable(),
65
+ iterations: z.array(LoopIterationRecordSchema),
66
+ logs: z.array(LoopLogEntrySchema),
67
+ nextLogSeq: z.number().int().positive(),
68
+ activeIteration: z.number().int().positive().nullable(),
69
+ activeWorkerAgentId: z.string().nullable(),
70
+ activeVerifierAgentId: z.string().nullable(),
71
+ });
72
+ export const LoopListItemSchema = z.object({
73
+ id: z.string(),
74
+ name: z.string().nullable(),
75
+ status: z.enum(["running", "succeeded", "failed", "stopped"]),
76
+ cwd: z.string(),
77
+ createdAt: z.string(),
78
+ updatedAt: z.string(),
79
+ activeIteration: z.number().int().positive().nullable(),
80
+ });
81
+ export const LoopRunRequestSchema = z.object({
82
+ type: z.literal("loop/run"),
83
+ requestId: z.string(),
84
+ prompt: z.string().trim().min(1),
85
+ cwd: z.string(),
86
+ provider: AgentProviderSchema.optional(),
87
+ model: z.string().trim().min(1).optional(),
88
+ modeId: z.string().trim().min(1).optional(),
89
+ workerProvider: AgentProviderSchema.optional(),
90
+ workerModel: z.string().trim().min(1).optional(),
91
+ verifierProvider: AgentProviderSchema.optional(),
92
+ verifierModel: z.string().trim().min(1).optional(),
93
+ verifierModeId: z.string().trim().min(1).optional(),
94
+ verifyPrompt: z.string().trim().min(1).optional(),
95
+ verifyChecks: z.array(z.string().trim().min(1)).optional(),
96
+ archive: z.boolean().optional(),
97
+ name: z.string().trim().min(1).optional(),
98
+ sleepMs: z.number().int().nonnegative().optional(),
99
+ maxIterations: z.number().int().positive().optional(),
100
+ maxTimeMs: z.number().int().positive().optional(),
101
+ });
102
+ export const LoopListRequestSchema = z.object({
103
+ type: z.literal("loop/list"),
104
+ requestId: z.string(),
105
+ });
106
+ export const LoopInspectRequestSchema = z.object({
107
+ type: z.literal("loop/inspect"),
108
+ requestId: z.string(),
109
+ id: z.string().trim().min(1),
110
+ });
111
+ export const LoopLogsRequestSchema = z.object({
112
+ type: z.literal("loop/logs"),
113
+ requestId: z.string(),
114
+ id: z.string().trim().min(1),
115
+ afterSeq: z.number().int().nonnegative().optional(),
116
+ });
117
+ export const LoopStopRequestSchema = z.object({
118
+ type: z.literal("loop/stop"),
119
+ requestId: z.string(),
120
+ id: z.string().trim().min(1),
121
+ });
122
+ export const LoopRunResponseSchema = z.object({
123
+ type: z.literal("loop/run/response"),
124
+ payload: z.object({
125
+ requestId: z.string(),
126
+ loop: LoopRecordSchema.nullable(),
127
+ error: z.string().nullable(),
128
+ }),
129
+ });
130
+ export const LoopListResponseSchema = z.object({
131
+ type: z.literal("loop/list/response"),
132
+ payload: z.object({
133
+ requestId: z.string(),
134
+ loops: z.array(LoopListItemSchema),
135
+ error: z.string().nullable(),
136
+ }),
137
+ });
138
+ export const LoopInspectResponseSchema = z.object({
139
+ type: z.literal("loop/inspect/response"),
140
+ payload: z.object({
141
+ requestId: z.string(),
142
+ loop: LoopRecordSchema.nullable(),
143
+ error: z.string().nullable(),
144
+ }),
145
+ });
146
+ export const LoopLogsResponseSchema = z.object({
147
+ type: z.literal("loop/logs/response"),
148
+ payload: z.object({
149
+ requestId: z.string(),
150
+ loop: LoopRecordSchema.nullable(),
151
+ entries: z.array(LoopLogEntrySchema),
152
+ nextCursor: z.number().int().nonnegative(),
153
+ error: z.string().nullable(),
154
+ }),
155
+ });
156
+ export const LoopStopResponseSchema = z.object({
157
+ type: z.literal("loop/stop/response"),
158
+ payload: z.object({
159
+ requestId: z.string(),
160
+ loop: LoopRecordSchema.nullable(),
161
+ error: z.string().nullable(),
162
+ }),
163
+ });
164
+ //# sourceMappingURL=rpc-schemas.js.map
@@ -0,0 +1,138 @@
1
+ import { z } from "zod";
2
+ export declare const MateoServicePortAllocationSchema: z.ZodObject<{
3
+ range: z.ZodOptional<z.ZodString>;
4
+ portScript: z.ZodOptional<z.ZodString>;
5
+ }, z.core.$strict>;
6
+ export declare function normalizeLifecycleCommands(commands: unknown): string[];
7
+ export declare const MateoLifecycleCommandRawSchema: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
8
+ export declare const MateoScriptEntryRawSchema: z.ZodObject<{
9
+ type: z.ZodOptional<z.ZodUnknown>;
10
+ command: z.ZodOptional<z.ZodUnknown>;
11
+ port: z.ZodOptional<z.ZodUnknown>;
12
+ }, z.core.$loose>;
13
+ export declare const MateoWorktreeConfigRawSchema: z.ZodObject<{
14
+ setup: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
15
+ teardown: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
16
+ terminals: z.ZodOptional<z.ZodUnknown>;
17
+ servicePorts: z.ZodOptional<z.ZodObject<{
18
+ range: z.ZodOptional<z.ZodString>;
19
+ portScript: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strict>>;
21
+ }, z.core.$loose>;
22
+ export declare const MateoMetadataGenerationEntrySchema: z.ZodCatch<z.ZodObject<{
23
+ instructions: z.ZodOptional<z.ZodString>;
24
+ }, z.core.$loose>>;
25
+ export declare const MateoMetadataGenerationSchema: z.ZodCatch<z.ZodObject<{
26
+ title: z.ZodOptional<z.ZodCatch<z.ZodObject<{
27
+ instructions: z.ZodOptional<z.ZodString>;
28
+ }, z.core.$loose>>>;
29
+ branchName: z.ZodOptional<z.ZodCatch<z.ZodObject<{
30
+ instructions: z.ZodOptional<z.ZodString>;
31
+ }, z.core.$loose>>>;
32
+ commitMessage: z.ZodOptional<z.ZodCatch<z.ZodObject<{
33
+ instructions: z.ZodOptional<z.ZodString>;
34
+ }, z.core.$loose>>>;
35
+ pullRequest: z.ZodOptional<z.ZodCatch<z.ZodObject<{
36
+ instructions: z.ZodOptional<z.ZodString>;
37
+ }, z.core.$loose>>>;
38
+ }, z.core.$loose>>;
39
+ export declare const MateoConfigRawSchema: z.ZodObject<{
40
+ worktree: z.ZodOptional<z.ZodObject<{
41
+ setup: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
42
+ teardown: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
43
+ terminals: z.ZodOptional<z.ZodUnknown>;
44
+ servicePorts: z.ZodOptional<z.ZodObject<{
45
+ range: z.ZodOptional<z.ZodString>;
46
+ portScript: z.ZodOptional<z.ZodString>;
47
+ }, z.core.$strict>>;
48
+ }, z.core.$loose>>;
49
+ scripts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
50
+ type: z.ZodOptional<z.ZodUnknown>;
51
+ command: z.ZodOptional<z.ZodUnknown>;
52
+ port: z.ZodOptional<z.ZodUnknown>;
53
+ }, z.core.$loose>>>;
54
+ metadataGeneration: z.ZodOptional<z.ZodCatch<z.ZodObject<{
55
+ title: z.ZodOptional<z.ZodCatch<z.ZodObject<{
56
+ instructions: z.ZodOptional<z.ZodString>;
57
+ }, z.core.$loose>>>;
58
+ branchName: z.ZodOptional<z.ZodCatch<z.ZodObject<{
59
+ instructions: z.ZodOptional<z.ZodString>;
60
+ }, z.core.$loose>>>;
61
+ commitMessage: z.ZodOptional<z.ZodCatch<z.ZodObject<{
62
+ instructions: z.ZodOptional<z.ZodString>;
63
+ }, z.core.$loose>>>;
64
+ pullRequest: z.ZodOptional<z.ZodCatch<z.ZodObject<{
65
+ instructions: z.ZodOptional<z.ZodString>;
66
+ }, z.core.$loose>>>;
67
+ }, z.core.$loose>>>;
68
+ }, z.core.$loose>;
69
+ export declare const WorktreeConfigSchema: z.ZodCatch<z.ZodObject<{
70
+ terminals: z.ZodOptional<z.ZodUnknown>;
71
+ servicePorts: z.ZodOptional<z.ZodObject<{
72
+ range: z.ZodOptional<z.ZodString>;
73
+ portScript: z.ZodOptional<z.ZodString>;
74
+ }, z.core.$strict>>;
75
+ setup: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<string[], unknown>>;
76
+ teardown: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<string[], unknown>>;
77
+ }, z.core.$loose>>;
78
+ export declare const ScriptEntrySchema: z.ZodCatch<z.ZodObject<{
79
+ type: z.ZodOptional<z.ZodUnknown>;
80
+ command: z.ZodOptional<z.ZodUnknown>;
81
+ port: z.ZodOptional<z.ZodUnknown>;
82
+ }, z.core.$loose>>;
83
+ export declare const MateoConfigSchema: z.ZodCatch<z.ZodObject<{
84
+ worktree: z.ZodOptional<z.ZodCatch<z.ZodObject<{
85
+ terminals: z.ZodOptional<z.ZodUnknown>;
86
+ servicePorts: z.ZodOptional<z.ZodObject<{
87
+ range: z.ZodOptional<z.ZodString>;
88
+ portScript: z.ZodOptional<z.ZodString>;
89
+ }, z.core.$strict>>;
90
+ setup: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<string[], unknown>>;
91
+ teardown: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<string[], unknown>>;
92
+ }, z.core.$loose>>>;
93
+ scripts: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodCatch<z.ZodObject<{
94
+ type: z.ZodOptional<z.ZodUnknown>;
95
+ command: z.ZodOptional<z.ZodUnknown>;
96
+ port: z.ZodOptional<z.ZodUnknown>;
97
+ }, z.core.$loose>>>>>;
98
+ metadataGeneration: z.ZodOptional<z.ZodCatch<z.ZodObject<{
99
+ title: z.ZodOptional<z.ZodCatch<z.ZodObject<{
100
+ instructions: z.ZodOptional<z.ZodString>;
101
+ }, z.core.$loose>>>;
102
+ branchName: z.ZodOptional<z.ZodCatch<z.ZodObject<{
103
+ instructions: z.ZodOptional<z.ZodString>;
104
+ }, z.core.$loose>>>;
105
+ commitMessage: z.ZodOptional<z.ZodCatch<z.ZodObject<{
106
+ instructions: z.ZodOptional<z.ZodString>;
107
+ }, z.core.$loose>>>;
108
+ pullRequest: z.ZodOptional<z.ZodCatch<z.ZodObject<{
109
+ instructions: z.ZodOptional<z.ZodString>;
110
+ }, z.core.$loose>>>;
111
+ }, z.core.$loose>>>;
112
+ }, z.core.$loose>>;
113
+ export declare const MateoConfigRevisionSchema: z.ZodObject<{
114
+ mtimeMs: z.ZodNumber;
115
+ size: z.ZodNumber;
116
+ }, z.core.$strip>;
117
+ export declare const ProjectConfigRpcErrorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
118
+ code: z.ZodLiteral<"project_not_found">;
119
+ }, z.core.$strip>, z.ZodObject<{
120
+ code: z.ZodLiteral<"invalid_project_config">;
121
+ }, z.core.$strip>, z.ZodObject<{
122
+ code: z.ZodLiteral<"stale_project_config">;
123
+ currentRevision: z.ZodNullable<z.ZodObject<{
124
+ mtimeMs: z.ZodNumber;
125
+ size: z.ZodNumber;
126
+ }, z.core.$strip>>;
127
+ }, z.core.$strip>, z.ZodObject<{
128
+ code: z.ZodLiteral<"write_failed">;
129
+ }, z.core.$strip>], "code">;
130
+ export type MateoScriptEntryRaw = z.infer<typeof MateoScriptEntryRawSchema>;
131
+ export type MateoMetadataGenerationEntry = z.infer<typeof MateoMetadataGenerationEntrySchema>;
132
+ export type MateoMetadataGeneration = z.infer<typeof MateoMetadataGenerationSchema>;
133
+ export type MateoServicePortAllocation = z.infer<typeof MateoServicePortAllocationSchema>;
134
+ export type MateoConfigRaw = z.infer<typeof MateoConfigRawSchema>;
135
+ export type MateoConfig = z.infer<typeof MateoConfigSchema>;
136
+ export type MateoConfigRevision = z.infer<typeof MateoConfigRevisionSchema>;
137
+ export type ProjectConfigRpcError = z.infer<typeof ProjectConfigRpcErrorSchema>;
138
+ //# sourceMappingURL=mateo-config-schema.d.ts.map
@@ -0,0 +1,98 @@
1
+ import { z } from "zod";
2
+ const TCP_PORT_RANGE_PATTERN = /^(\d{1,5})-(\d{1,5})$/;
3
+ export const MateoServicePortAllocationSchema = z
4
+ .object({
5
+ range: z.string().trim().regex(TCP_PORT_RANGE_PATTERN).optional(),
6
+ portScript: z.string().trim().min(1).optional(),
7
+ })
8
+ .strict()
9
+ .refine((value) => value.range !== undefined || value.portScript !== undefined, "Expected range or portScript")
10
+ .refine((value) => {
11
+ if (!value.range)
12
+ return true;
13
+ const match = TCP_PORT_RANGE_PATTERN.exec(value.range);
14
+ if (!match)
15
+ return false;
16
+ const start = Number(match[1]);
17
+ const end = Number(match[2]);
18
+ return start >= 1 && end <= 65535 && start <= end;
19
+ }, "Expected an inclusive TCP port range from 1-65535");
20
+ export function normalizeLifecycleCommands(commands) {
21
+ if (typeof commands === "string") {
22
+ return commands.trim().length > 0 ? [commands] : [];
23
+ }
24
+ if (!Array.isArray(commands)) {
25
+ return [];
26
+ }
27
+ return commands.filter((command) => {
28
+ return typeof command === "string" && command.trim().length > 0;
29
+ });
30
+ }
31
+ export const MateoLifecycleCommandRawSchema = z.union([z.string(), z.array(z.string())]);
32
+ export const MateoScriptEntryRawSchema = z
33
+ .object({
34
+ type: z.unknown().optional(),
35
+ command: z.unknown().optional(),
36
+ port: z.unknown().optional(),
37
+ })
38
+ .passthrough();
39
+ export const MateoWorktreeConfigRawSchema = z
40
+ .object({
41
+ setup: MateoLifecycleCommandRawSchema.optional(),
42
+ teardown: MateoLifecycleCommandRawSchema.optional(),
43
+ terminals: z.unknown().optional(),
44
+ servicePorts: MateoServicePortAllocationSchema.optional(),
45
+ })
46
+ .passthrough();
47
+ export const MateoMetadataGenerationEntrySchema = z
48
+ .object({
49
+ instructions: z.string().optional(),
50
+ })
51
+ .passthrough()
52
+ .catch({});
53
+ export const MateoMetadataGenerationSchema = z
54
+ .object({
55
+ title: MateoMetadataGenerationEntrySchema.optional(),
56
+ branchName: MateoMetadataGenerationEntrySchema.optional(),
57
+ commitMessage: MateoMetadataGenerationEntrySchema.optional(),
58
+ pullRequest: MateoMetadataGenerationEntrySchema.optional(),
59
+ })
60
+ // COMPAT(projectMetadataAgentTitle): `agentTitle` project metadata prompts were removed
61
+ // in v0.1.96; keep legacy mateo.json parseable until 2026-12-16.
62
+ .passthrough()
63
+ .catch({});
64
+ export const MateoConfigRawSchema = z
65
+ .object({
66
+ worktree: MateoWorktreeConfigRawSchema.optional(),
67
+ scripts: z.record(z.string(), MateoScriptEntryRawSchema).optional(),
68
+ metadataGeneration: MateoMetadataGenerationSchema.optional(),
69
+ })
70
+ .passthrough();
71
+ export const WorktreeConfigSchema = MateoWorktreeConfigRawSchema.extend({
72
+ setup: z.unknown().optional().transform(normalizeLifecycleCommands),
73
+ teardown: z.unknown().optional().transform(normalizeLifecycleCommands),
74
+ })
75
+ .passthrough()
76
+ .catch({ setup: [], teardown: [] });
77
+ export const ScriptEntrySchema = MateoScriptEntryRawSchema.catch({});
78
+ export const MateoConfigSchema = MateoConfigRawSchema.extend({
79
+ worktree: WorktreeConfigSchema.optional(),
80
+ scripts: z.record(z.string(), ScriptEntrySchema).optional().catch({}),
81
+ metadataGeneration: MateoMetadataGenerationSchema.optional(),
82
+ })
83
+ .passthrough()
84
+ .catch({});
85
+ export const MateoConfigRevisionSchema = z.object({
86
+ mtimeMs: z.number(),
87
+ size: z.number(),
88
+ });
89
+ export const ProjectConfigRpcErrorSchema = z.discriminatedUnion("code", [
90
+ z.object({ code: z.literal("project_not_found") }),
91
+ z.object({ code: z.literal("invalid_project_config") }),
92
+ z.object({
93
+ code: z.literal("stale_project_config"),
94
+ currentRevision: MateoConfigRevisionSchema.nullable(),
95
+ }),
96
+ z.object({ code: z.literal("write_failed") }),
97
+ ]);
98
+ //# sourceMappingURL=mateo-config-schema.js.map
@@ -0,0 +1,2 @@
1
+ export { buildMateoToolDetailSections, type MateoToolDetailField, type MateoToolDetailSection, } from "./mateo-tool-presentation/index.js";
2
+ //# sourceMappingURL=mateo-tool-call-detail.d.ts.map
@@ -0,0 +1,3 @@
1
+ // COMPAT(mateoToolCallDetail): added in v0.12.0, remove after 2027-04-19 once plugins have migrated to mateo-tool-presentation/index.
2
+ export { buildMateoToolDetailSections, } from "./mateo-tool-presentation/index.js";
3
+ //# sourceMappingURL=mateo-tool-call-detail.js.map
@@ -0,0 +1,10 @@
1
+ import type { AgentMessage } from "../agent-message.js";
2
+ import type { ToolCallDetail } from "../agent-types.js";
3
+ export interface AgentMessageDisplay {
4
+ displayName: string;
5
+ summary?: string;
6
+ detail: ToolCallDetail;
7
+ }
8
+ /** Presentation shared by clients; never used to encode provider prompts. */
9
+ export declare function buildAgentMessageDisplay(message: AgentMessage): AgentMessageDisplay;
10
+ //# sourceMappingURL=agent-message.d.ts.map
@@ -0,0 +1,23 @@
1
+ import { toSummaryText } from "./summary-text.js";
2
+ /** Events read noun-first ("Agent finished"); the sender goes in the summary. */
3
+ const EVENT_LABELS = {
4
+ message: "Message received",
5
+ finished: "Agent finished",
6
+ errored: "Agent errored",
7
+ "permission-required": "Agent needs permission",
8
+ closed: "Agent closed",
9
+ canceled: "Agent canceled",
10
+ };
11
+ /** Presentation shared by clients; never used to encode provider prompts. */
12
+ export function buildAgentMessageDisplay(message) {
13
+ const summary = toSummaryText(message.sender.title ?? message.sender.id);
14
+ return {
15
+ displayName: EVENT_LABELS[message.event],
16
+ ...(summary ? { summary } : {}),
17
+ detail: {
18
+ type: "plain_text",
19
+ text: `From agent: ${message.sender.id}\n\n${message.text}`,
20
+ },
21
+ };
22
+ }
23
+ //# sourceMappingURL=agent-message.js.map