aicodeman 1.24.4 → 1.24.6

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 (174) hide show
  1. package/dist/cli.d.ts.map +1 -1
  2. package/dist/cli.js +3 -4
  3. package/dist/cli.js.map +1 -1
  4. package/dist/config/cli-registry/argv.d.ts +44 -0
  5. package/dist/config/cli-registry/argv.d.ts.map +1 -0
  6. package/dist/config/cli-registry/argv.js +157 -0
  7. package/dist/config/cli-registry/argv.js.map +1 -0
  8. package/dist/config/cli-registry/index.d.ts +17 -0
  9. package/dist/config/cli-registry/index.d.ts.map +1 -0
  10. package/dist/config/cli-registry/index.js +11 -0
  11. package/dist/config/cli-registry/index.js.map +1 -0
  12. package/dist/config/cli-registry/patterns.d.ts +42 -0
  13. package/dist/config/cli-registry/patterns.d.ts.map +1 -0
  14. package/dist/config/cli-registry/patterns.js +104 -0
  15. package/dist/config/cli-registry/patterns.js.map +1 -0
  16. package/dist/config/cli-registry/profiles.d.ts +74 -0
  17. package/dist/config/cli-registry/profiles.d.ts.map +1 -0
  18. package/dist/config/cli-registry/profiles.js +90 -0
  19. package/dist/config/cli-registry/profiles.js.map +1 -0
  20. package/dist/config/cli-registry/registry.d.ts +63 -0
  21. package/dist/config/cli-registry/registry.d.ts.map +1 -0
  22. package/dist/config/cli-registry/registry.js +216 -0
  23. package/dist/config/cli-registry/registry.js.map +1 -0
  24. package/dist/config/cli-registry/schema.d.ts +259 -0
  25. package/dist/config/cli-registry/schema.d.ts.map +1 -0
  26. package/dist/config/cli-registry/schema.js +398 -0
  27. package/dist/config/cli-registry/schema.js.map +1 -0
  28. package/dist/config/cli-registry/stock.d.ts +15 -0
  29. package/dist/config/cli-registry/stock.d.ts.map +1 -0
  30. package/dist/config/cli-registry/stock.js +996 -0
  31. package/dist/config/cli-registry/stock.js.map +1 -0
  32. package/dist/config/cli-registry/types.d.ts +565 -0
  33. package/dist/config/cli-registry/types.d.ts.map +1 -0
  34. package/dist/config/cli-registry/types.js +13 -0
  35. package/dist/config/cli-registry/types.js.map +1 -0
  36. package/dist/config/dependency-registry.d.ts +12 -1
  37. package/dist/config/dependency-registry.d.ts.map +1 -1
  38. package/dist/config/dependency-registry.js +155 -203
  39. package/dist/config/dependency-registry.js.map +1 -1
  40. package/dist/cron/cron-service.d.ts.map +1 -1
  41. package/dist/cron/cron-service.js +51 -17
  42. package/dist/cron/cron-service.js.map +1 -1
  43. package/dist/docker-hosts.d.ts +9 -1
  44. package/dist/docker-hosts.d.ts.map +1 -1
  45. package/dist/docker-hosts.js +25 -17
  46. package/dist/docker-hosts.js.map +1 -1
  47. package/dist/remote-hosts.d.ts +73 -0
  48. package/dist/remote-hosts.d.ts.map +1 -1
  49. package/dist/remote-hosts.js +139 -45
  50. package/dist/remote-hosts.js.map +1 -1
  51. package/dist/remote-reconnect.d.ts +10 -1
  52. package/dist/remote-reconnect.d.ts.map +1 -1
  53. package/dist/remote-reconnect.js +9 -0
  54. package/dist/remote-reconnect.js.map +1 -1
  55. package/dist/session-cli-registry-bridge.d.ts +66 -0
  56. package/dist/session-cli-registry-bridge.d.ts.map +1 -0
  57. package/dist/session-cli-registry-bridge.js +165 -0
  58. package/dist/session-cli-registry-bridge.js.map +1 -0
  59. package/dist/session.d.ts +13 -1
  60. package/dist/session.d.ts.map +1 -1
  61. package/dist/session.js +69 -76
  62. package/dist/session.js.map +1 -1
  63. package/dist/tmux-manager.d.ts +50 -35
  64. package/dist/tmux-manager.d.ts.map +1 -1
  65. package/dist/tmux-manager.js +258 -623
  66. package/dist/tmux-manager.js.map +1 -1
  67. package/dist/utils/antigravity-cli-resolver.d.ts.map +1 -1
  68. package/dist/utils/antigravity-cli-resolver.js +8 -10
  69. package/dist/utils/antigravity-cli-resolver.js.map +1 -1
  70. package/dist/utils/cli-executable-resolver.d.ts +9 -1
  71. package/dist/utils/cli-executable-resolver.d.ts.map +1 -1
  72. package/dist/utils/cli-executable-resolver.js +3 -2
  73. package/dist/utils/cli-executable-resolver.js.map +1 -1
  74. package/dist/utils/cli-launcher.d.ts +46 -0
  75. package/dist/utils/cli-launcher.d.ts.map +1 -0
  76. package/dist/utils/cli-launcher.js +101 -0
  77. package/dist/utils/cli-launcher.js.map +1 -0
  78. package/dist/utils/cli-resolver.d.ts +101 -0
  79. package/dist/utils/cli-resolver.d.ts.map +1 -0
  80. package/dist/utils/cli-resolver.js +220 -0
  81. package/dist/utils/cli-resolver.js.map +1 -0
  82. package/dist/utils/codex-cli-resolver.d.ts.map +1 -1
  83. package/dist/utils/codex-cli-resolver.js +8 -11
  84. package/dist/utils/codex-cli-resolver.js.map +1 -1
  85. package/dist/utils/deepseek-cli-resolver.d.ts.map +1 -1
  86. package/dist/utils/deepseek-cli-resolver.js +8 -6
  87. package/dist/utils/deepseek-cli-resolver.js.map +1 -1
  88. package/dist/utils/gemini-cli-resolver.d.ts.map +1 -1
  89. package/dist/utils/gemini-cli-resolver.js +8 -10
  90. package/dist/utils/gemini-cli-resolver.js.map +1 -1
  91. package/dist/utils/grok-cli-resolver.js +8 -8
  92. package/dist/utils/grok-cli-resolver.js.map +1 -1
  93. package/dist/utils/omp-cli-resolver.d.ts.map +1 -1
  94. package/dist/utils/omp-cli-resolver.js +10 -15
  95. package/dist/utils/omp-cli-resolver.js.map +1 -1
  96. package/dist/utils/opencode-cli-resolver.d.ts.map +1 -1
  97. package/dist/utils/opencode-cli-resolver.js +8 -11
  98. package/dist/utils/opencode-cli-resolver.js.map +1 -1
  99. package/dist/utils/pi-cli-resolver.d.ts.map +1 -1
  100. package/dist/utils/pi-cli-resolver.js +8 -9
  101. package/dist/utils/pi-cli-resolver.js.map +1 -1
  102. package/dist/web/public/admin-ui.js.gz +0 -0
  103. package/dist/web/public/api-client.c9b1cddc.js.gz +0 -0
  104. package/dist/web/public/app.a5d2fc08.js.gz +0 -0
  105. package/dist/web/public/approvals-ui.js.gz +0 -0
  106. package/dist/web/public/constants.7bd482dc.js.gz +0 -0
  107. package/dist/web/public/cron-ui.js.gz +0 -0
  108. package/dist/web/public/entrance-animations.js.gz +0 -0
  109. package/dist/web/public/home-sessions.js.gz +0 -0
  110. package/dist/web/public/i18n.9ae15b51.js.gz +0 -0
  111. package/dist/web/public/image-input.ee16ad88.js.gz +0 -0
  112. package/dist/web/public/index.html +9 -2
  113. package/dist/web/public/index.html.br +0 -0
  114. package/dist/web/public/index.html.gz +0 -0
  115. package/dist/web/public/input-cjk.87f14251.js.gz +0 -0
  116. package/dist/web/public/keyboard-accessory.0454a3e9.js.gz +0 -0
  117. package/dist/web/public/mobile-handlers.0f83a608.js.gz +0 -0
  118. package/dist/web/public/mobile-overview.js.gz +0 -0
  119. package/dist/web/public/mobile.87674154.css.gz +0 -0
  120. package/dist/web/public/notification-manager.5d229063.js.gz +0 -0
  121. package/dist/web/public/orchestrator-panel.js.gz +0 -0
  122. package/dist/web/public/panels-ui.e6e06034.js.gz +0 -0
  123. package/dist/web/public/ralph-panel.6de2d0f8.js.gz +0 -0
  124. package/dist/web/public/ralph-wizard.13a1831e.js.gz +0 -0
  125. package/dist/web/public/readmymind-ui.js.gz +0 -0
  126. package/dist/web/public/respawn-ui.ff0dae4c.js.gz +0 -0
  127. package/dist/web/public/sanitize-html.bc7078d6.js.gz +0 -0
  128. package/dist/web/public/session-lineage.js.gz +0 -0
  129. package/dist/web/public/session-ui.c558f981.js.gz +0 -0
  130. package/dist/web/public/{settings-ui.2a814a17.js → settings-ui.95b333c6.js} +1 -1
  131. package/dist/web/public/settings-ui.95b333c6.js.br +0 -0
  132. package/dist/web/public/settings-ui.95b333c6.js.gz +0 -0
  133. package/dist/web/public/styles.421b36d4.css.gz +0 -0
  134. package/dist/web/public/subagent-windows.e6ca799f.js.gz +0 -0
  135. package/dist/web/public/sw.js.gz +0 -0
  136. package/dist/web/public/tab-rail-resize.42c24949.js.gz +0 -0
  137. package/dist/web/public/terminal-ui.70445f81.js.gz +0 -0
  138. package/dist/web/public/ultracode-panel.js.gz +0 -0
  139. package/dist/web/public/ultracode-windows.js.gz +0 -0
  140. package/dist/web/public/upload.html.gz +0 -0
  141. package/dist/web/public/vendor/dompurify.min.js.gz +0 -0
  142. package/dist/web/public/vendor/marked.min.js.gz +0 -0
  143. package/dist/web/public/vendor/xterm-addon-fit.min.js.gz +0 -0
  144. package/dist/web/public/vendor/xterm-addon-serialize.min.js.gz +0 -0
  145. package/dist/web/public/vendor/xterm-addon-unicode11.min.js.gz +0 -0
  146. package/dist/web/public/vendor/xterm-addon-webgl.min.js.gz +0 -0
  147. package/dist/web/public/vendor/xterm-predictive-echo.bd6882b8.js.gz +0 -0
  148. package/dist/web/public/vendor/xterm-zerolag-input.6fee72f2.js.gz +0 -0
  149. package/dist/web/public/vendor/xterm.css.gz +0 -0
  150. package/dist/web/public/vendor/xterm.min.js.gz +0 -0
  151. package/dist/web/public/voice-input.4ec670b0.js.gz +0 -0
  152. package/dist/web/public/voice-pcm-worklet.js.gz +0 -0
  153. package/dist/web/public/webview-tabs.js.gz +0 -0
  154. package/dist/web/routes/cron-routes.d.ts.map +1 -1
  155. package/dist/web/routes/cron-routes.js +3 -2
  156. package/dist/web/routes/cron-routes.js.map +1 -1
  157. package/dist/web/routes/session-routes.d.ts +8 -34
  158. package/dist/web/routes/session-routes.d.ts.map +1 -1
  159. package/dist/web/routes/session-routes.js +164 -251
  160. package/dist/web/routes/session-routes.js.map +1 -1
  161. package/dist/web/routes/system-routes.d.ts.map +1 -1
  162. package/dist/web/routes/system-routes.js +2 -1
  163. package/dist/web/routes/system-routes.js.map +1 -1
  164. package/dist/web/schemas.d.ts +12 -48
  165. package/dist/web/schemas.d.ts.map +1 -1
  166. package/dist/web/schemas.js +82 -37
  167. package/dist/web/schemas.js.map +1 -1
  168. package/dist/web/session-wait-registry.d.ts +1 -1
  169. package/dist/web/session-wait-registry.d.ts.map +1 -1
  170. package/dist/web/session-wait-registry.js +20 -12
  171. package/dist/web/session-wait-registry.js.map +1 -1
  172. package/package.json +1 -1
  173. package/dist/web/public/settings-ui.2a814a17.js.br +0 -0
  174. package/dist/web/public/settings-ui.2a814a17.js.gz +0 -0
@@ -0,0 +1,259 @@
1
+ /**
2
+ * @fileoverview Zod validation for CLI registry entries.
3
+ *
4
+ * Every object here is `.strict()`: an unknown key is a hard validation error, not a
5
+ * silently-ignored one. That matters for a security-relevant schema — a typo in a field name
6
+ * must never degrade to "field absent, so the permissive default applies".
7
+ *
8
+ * The load-bearing rule enforced here is `SHELL_TOKEN`: it is what makes it impossible for a
9
+ * `clis.json` entry to smuggle shell metacharacters into the eventual `bash -c "..."` string
10
+ * (see argv.ts's file header for the full model).
11
+ *
12
+ * @module config/cli-registry/schema
13
+ */
14
+ import { z } from 'zod';
15
+ export declare const CliEntrySchema: z.ZodObject<{
16
+ id: z.ZodString;
17
+ label: z.ZodString;
18
+ shortBadge: z.ZodString;
19
+ accent: z.ZodString;
20
+ enabled: z.ZodBoolean;
21
+ stock: z.ZodBoolean;
22
+ order: z.ZodNumber;
23
+ kind: z.ZodEnum<{
24
+ shell: "shell";
25
+ agent: "agent";
26
+ }>;
27
+ discovery: z.ZodObject<{
28
+ binaries: z.ZodArray<z.ZodString>;
29
+ searchDirs: z.ZodArray<z.ZodString>;
30
+ version: z.ZodOptional<z.ZodObject<{
31
+ arg: z.ZodString;
32
+ regex: z.ZodOptional<z.ZodString>;
33
+ requireVersionMatch: z.ZodOptional<z.ZodBoolean>;
34
+ retryOnTransientFailure: z.ZodOptional<z.ZodBoolean>;
35
+ }, z.core.$strict>>;
36
+ identity: z.ZodOptional<z.ZodObject<{
37
+ arg: z.ZodString;
38
+ regex: z.ZodString;
39
+ }, z.core.$strict>>;
40
+ launcherProfile: z.ZodOptional<z.ZodString>;
41
+ launcherTargetParam: z.ZodOptional<z.ZodString>;
42
+ install: z.ZodObject<{
43
+ command: z.ZodObject<{
44
+ linux: z.ZodOptional<z.ZodString>;
45
+ darwin: z.ZodOptional<z.ZodString>;
46
+ wsl: z.ZodOptional<z.ZodString>;
47
+ win32: z.ZodOptional<z.ZodString>;
48
+ }, z.core.$strict>;
49
+ npmPackage: z.ZodOptional<z.ZodString>;
50
+ docsUrl: z.ZodOptional<z.ZodURL>;
51
+ }, z.core.$strict>;
52
+ }, z.core.$strict>;
53
+ launch: z.ZodObject<{
54
+ params: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
55
+ type: z.ZodLiteral<"enum">;
56
+ values: z.ZodArray<z.ZodString>;
57
+ default: z.ZodOptional<z.ZodString>;
58
+ }, z.core.$strict>, z.ZodObject<{
59
+ type: z.ZodLiteral<"bool">;
60
+ }, z.core.$strict>, z.ZodObject<{
61
+ type: z.ZodLiteral<"token">;
62
+ pattern: z.ZodEnum<{
63
+ [x: string]: string;
64
+ }>;
65
+ }, z.core.$strict>, z.ZodObject<{
66
+ type: z.ZodLiteral<"engine">;
67
+ source: z.ZodEnum<{
68
+ sessionId: "sessionId";
69
+ sessionName: "sessionName";
70
+ muxName: "muxName";
71
+ effortLevel: "effortLevel";
72
+ effortSettingsJson: "effortSettingsJson";
73
+ codemanPrefixedSessionId: "codemanPrefixedSessionId";
74
+ launcherDefaultTarget: "launcherDefaultTarget";
75
+ }>;
76
+ }, z.core.$strict>]>>;
77
+ chain: z.ZodOptional<z.ZodEnum<{
78
+ first: "first";
79
+ fallback: "fallback";
80
+ }>>;
81
+ variants: z.ZodArray<z.ZodObject<{
82
+ id: z.ZodString;
83
+ when: z.ZodOptional<z.ZodType<import("./types.js").Cond, unknown, z.core.$ZodTypeInternals<import("./types.js").Cond, unknown>>>;
84
+ args: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
85
+ lit: z.ZodString;
86
+ when: z.ZodOptional<z.ZodType<import("./types.js").Cond, unknown, z.core.$ZodTypeInternals<import("./types.js").Cond, unknown>>>;
87
+ }, z.core.$strict>, z.ZodObject<{
88
+ flag: z.ZodString;
89
+ when: z.ZodOptional<z.ZodType<import("./types.js").Cond, unknown, z.core.$ZodTypeInternals<import("./types.js").Cond, unknown>>>;
90
+ }, z.core.$strict>, z.ZodObject<{
91
+ flag: z.ZodString;
92
+ value: z.ZodString;
93
+ quote: z.ZodOptional<z.ZodEnum<{
94
+ auto: "auto";
95
+ single: "single";
96
+ bare: "bare";
97
+ double: "double";
98
+ }>>;
99
+ when: z.ZodOptional<z.ZodType<import("./types.js").Cond, unknown, z.core.$ZodTypeInternals<import("./types.js").Cond, unknown>>>;
100
+ }, z.core.$strict>, z.ZodObject<{
101
+ flag: z.ZodString;
102
+ valueFrom: z.ZodString;
103
+ quote: z.ZodOptional<z.ZodEnum<{
104
+ auto: "auto";
105
+ single: "single";
106
+ bare: "bare";
107
+ double: "double";
108
+ }>>;
109
+ when: z.ZodOptional<z.ZodType<import("./types.js").Cond, unknown, z.core.$ZodTypeInternals<import("./types.js").Cond, unknown>>>;
110
+ }, z.core.$strict>, z.ZodObject<{
111
+ valueFrom: z.ZodString;
112
+ quote: z.ZodOptional<z.ZodEnum<{
113
+ auto: "auto";
114
+ single: "single";
115
+ bare: "bare";
116
+ double: "double";
117
+ }>>;
118
+ when: z.ZodOptional<z.ZodType<import("./types.js").Cond, unknown, z.core.$ZodTypeInternals<import("./types.js").Cond, unknown>>>;
119
+ }, z.core.$strict>]>>;
120
+ }, z.core.$strict>>;
121
+ legacyConfigAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
122
+ legacyConfigField: z.ZodOptional<z.ZodString>;
123
+ resumeAppend: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
124
+ style: z.ZodLiteral<"flag">;
125
+ flag: z.ZodString;
126
+ }, z.core.$strict>, z.ZodObject<{
127
+ style: z.ZodLiteral<"positional">;
128
+ token: z.ZodString;
129
+ }, z.core.$strict>]>>;
130
+ }, z.core.$strict>;
131
+ env: z.ZodObject<{
132
+ exports: z.ZodArray<z.ZodObject<{
133
+ name: z.ZodString;
134
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
135
+ engine: z.ZodEnum<{
136
+ sessionId: "sessionId";
137
+ sessionName: "sessionName";
138
+ muxName: "muxName";
139
+ effortLevel: "effortLevel";
140
+ effortSettingsJson: "effortSettingsJson";
141
+ codemanPrefixedSessionId: "codemanPrefixedSessionId";
142
+ launcherDefaultTarget: "launcherDefaultTarget";
143
+ }>;
144
+ }, z.core.$strict>]>;
145
+ when: z.ZodOptional<z.ZodType<import("./types.js").Cond, unknown, z.core.$ZodTypeInternals<import("./types.js").Cond, unknown>>>;
146
+ }, z.core.$strict>>;
147
+ unset: z.ZodArray<z.ZodString>;
148
+ tmuxSetenvKeys: z.ZodArray<z.ZodString>;
149
+ dockerExecEnvNames: z.ZodArray<z.ZodString>;
150
+ configSetenv: z.ZodOptional<z.ZodArray<z.ZodObject<{
151
+ name: z.ZodString;
152
+ fromParam: z.ZodString;
153
+ }, z.core.$strict>>>;
154
+ allowedPrefixes: z.ZodArray<z.ZodString>;
155
+ allowedKeys: z.ZodArray<z.ZodString>;
156
+ configContentVar: z.ZodOptional<z.ZodString>;
157
+ setenvProfile: z.ZodOptional<z.ZodString>;
158
+ }, z.core.$strict>;
159
+ capabilities: z.ZodObject<{
160
+ external: z.ZodBoolean;
161
+ requiresMux: z.ZodBoolean;
162
+ hooks: z.ZodEnum<{
163
+ none: "none";
164
+ always: "always";
165
+ supervised: "supervised";
166
+ }>;
167
+ transcript: z.ZodEnum<{
168
+ none: "none";
169
+ "claude-jsonl": "claude-jsonl";
170
+ "codex-rollout": "codex-rollout";
171
+ "deepseek-zstd": "deepseek-zstd";
172
+ "omp-jsonl": "omp-jsonl";
173
+ }>;
174
+ altScreen: z.ZodEnum<{
175
+ "strip-full": "strip-full";
176
+ "strip-mux-only": "strip-mux-only";
177
+ preserve: "preserve";
178
+ }>;
179
+ echo: z.ZodObject<{
180
+ policy: z.ZodEnum<{
181
+ off: "off";
182
+ buffer: "buffer";
183
+ predict: "predict";
184
+ }>;
185
+ anchor: z.ZodUnion<readonly [z.ZodObject<{
186
+ kind: z.ZodLiteral<"glyph">;
187
+ glyph: z.ZodString;
188
+ offset: z.ZodNumber;
189
+ }, z.core.$strict>, z.ZodObject<{
190
+ kind: z.ZodLiteral<"cursor">;
191
+ }, z.core.$strict>, z.ZodObject<{
192
+ kind: z.ZodLiteral<"none">;
193
+ }, z.core.$strict>]>;
194
+ predictProfile: z.ZodOptional<z.ZodString>;
195
+ }, z.core.$strict>;
196
+ wheelForward: z.ZodObject<{
197
+ mode: z.ZodEnum<{
198
+ never: "never";
199
+ "version-gated": "version-gated";
200
+ }>;
201
+ minVersion: z.ZodOptional<z.ZodString>;
202
+ }, z.core.$strict>;
203
+ keyboardAccessory: z.ZodEnum<{
204
+ shell: "shell";
205
+ agent: "agent";
206
+ }>;
207
+ privilegedCommandGate: z.ZodBoolean;
208
+ startMode: z.ZodEnum<{
209
+ shell: "shell";
210
+ interactive: "interactive";
211
+ }>;
212
+ stripInkBloat: z.ZodBoolean;
213
+ ralph: z.ZodBoolean;
214
+ respawn: z.ZodBoolean;
215
+ effort: z.ZodBoolean;
216
+ agentSkillInjection: z.ZodBoolean;
217
+ statusLineTelemetry: z.ZodBoolean;
218
+ model: z.ZodObject<{
219
+ source: z.ZodEnum<{
220
+ none: "none";
221
+ flag: "flag";
222
+ "claude-settings-file": "claude-settings-file";
223
+ }>;
224
+ param: z.ZodOptional<z.ZodString>;
225
+ }, z.core.$strict>;
226
+ privilegedParams: z.ZodArray<z.ZodObject<{
227
+ param: z.ZodString;
228
+ clampTo: z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>;
229
+ materializeWhenAbsent: z.ZodOptional<z.ZodBoolean>;
230
+ }, z.core.$strict>>;
231
+ privilegedEnvKeys: z.ZodArray<z.ZodString>;
232
+ gates: z.ZodRecord<z.ZodString, z.ZodObject<{
233
+ minVersion: z.ZodString;
234
+ failClosed: z.ZodBoolean;
235
+ }, z.core.$strict>>;
236
+ maxFrameBytes: z.ZodOptional<z.ZodNumber>;
237
+ }, z.core.$strict>;
238
+ overlays: z.ZodObject<{
239
+ remote: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
240
+ command: z.ZodOptional<z.ZodString>;
241
+ }, z.core.$strict>, z.ZodObject<{
242
+ disabled: z.ZodLiteral<true>;
243
+ }, z.core.$strict>]>>;
244
+ docker: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
245
+ command: z.ZodOptional<z.ZodString>;
246
+ }, z.core.$strict>, z.ZodObject<{
247
+ disabled: z.ZodLiteral<true>;
248
+ }, z.core.$strict>]>>;
249
+ credStore: z.ZodOptional<z.ZodObject<{
250
+ rel: z.ZodString;
251
+ shareDirs: z.ZodOptional<z.ZodArray<z.ZodString>>;
252
+ shareFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
253
+ seedFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
254
+ seedWhole: z.ZodOptional<z.ZodBoolean>;
255
+ }, z.core.$strict>>;
256
+ }, z.core.$strict>;
257
+ }, z.core.$strict>;
258
+ export type ValidatedCliEntry = z.infer<typeof CliEntrySchema>;
259
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/config/cli-registry/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkUxB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAyFvB,CAAC;AAEL,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -0,0 +1,398 @@
1
+ /**
2
+ * @fileoverview Zod validation for CLI registry entries.
3
+ *
4
+ * Every object here is `.strict()`: an unknown key is a hard validation error, not a
5
+ * silently-ignored one. That matters for a security-relevant schema — a typo in a field name
6
+ * must never degrade to "field absent, so the permissive default applies".
7
+ *
8
+ * The load-bearing rule enforced here is `SHELL_TOKEN`: it is what makes it impossible for a
9
+ * `clis.json` entry to smuggle shell metacharacters into the eventual `bash -c "..."` string
10
+ * (see argv.ts's file header for the full model).
11
+ *
12
+ * @module config/cli-registry/schema
13
+ */
14
+ import { z } from 'zod';
15
+ import { TOKEN_PATTERNS } from './patterns.js';
16
+ import { isKnownLauncherProfile, isKnownSetenvProfile } from './profiles.js';
17
+ /** A bare CLI id: lowercase, starts with a letter, at most 24 chars. Also used as a CSS/URL token. */
18
+ const cliId = z
19
+ .string()
20
+ .regex(/^[a-z][a-z0-9-]{0,23}$/, 'id must be lowercase, start with a letter, and be at most 24 chars');
21
+ /** An env var name. */
22
+ const envName = z
23
+ .string()
24
+ .regex(/^[A-Z_][A-Z0-9_]*$/, 'env var name must be UPPER_SNAKE_CASE')
25
+ .max(64);
26
+ /**
27
+ * A shell-safe bare word: no space, quote, backtick, `$`, `;`, `&`, `|`, `<`, `>`, parens,
28
+ * braces, newline or backslash. Every LITERAL in the launch spec (base command, flag names,
29
+ * fixed values) must satisfy this — see argv.ts's file header.
30
+ */
31
+ const shellToken = z
32
+ .string()
33
+ .min(1)
34
+ .max(256)
35
+ .regex(/^[A-Za-z0-9._:@=+/,-]+$/, 'must be a plain word with no shell metacharacters');
36
+ const flagToken = z.string().regex(/^--?[A-Za-z0-9][A-Za-z0-9-]*$/, 'must look like -x or --long-flag');
37
+ const quoteStyle = z.enum(['auto', 'bare', 'double', 'single']);
38
+ const condSchema = z.lazy(() => z.union([
39
+ z.object({ param: z.string(), is: z.union([z.string(), z.boolean()]) }).strict(),
40
+ z.object({ param: z.string(), state: z.enum(['set', 'unset']) }).strict(),
41
+ z.object({ allOf: z.array(condSchema).min(1).max(8) }).strict(),
42
+ z.object({ anyOf: z.array(condSchema).min(1).max(8) }).strict(),
43
+ z.object({ not: condSchema }).strict(),
44
+ z.object({ capabilityGate: z.string() }).strict(),
45
+ ]));
46
+ const paramSpecSchema = z.union([
47
+ z
48
+ .object({ type: z.literal('enum'), values: z.array(z.string()).min(1).max(16), default: z.string().optional() })
49
+ .strict(),
50
+ z.object({ type: z.literal('bool') }).strict(),
51
+ z.object({ type: z.literal('token'), pattern: z.enum(TOKEN_PATTERNS) }).strict(),
52
+ z
53
+ .object({
54
+ type: z.literal('engine'),
55
+ source: z.enum([
56
+ 'sessionId',
57
+ 'sessionName',
58
+ 'muxName',
59
+ 'effortLevel',
60
+ 'effortSettingsJson',
61
+ 'codemanPrefixedSessionId',
62
+ 'launcherDefaultTarget',
63
+ ]),
64
+ })
65
+ .strict(),
66
+ ]);
67
+ const argSpecSchema = z.union([
68
+ z.object({ lit: shellToken, when: condSchema.optional() }).strict(),
69
+ z.object({ flag: flagToken, when: condSchema.optional() }).strict(),
70
+ z.object({ flag: flagToken, value: shellToken, quote: quoteStyle.optional(), when: condSchema.optional() }).strict(),
71
+ z
72
+ .object({ flag: flagToken, valueFrom: z.string(), quote: quoteStyle.optional(), when: condSchema.optional() })
73
+ .strict(),
74
+ z.object({ valueFrom: z.string(), quote: quoteStyle.optional(), when: condSchema.optional() }).strict(),
75
+ ]);
76
+ const variantSchema = z
77
+ .object({
78
+ id: z.string().min(1).max(40),
79
+ when: condSchema.optional(),
80
+ // min(0): the `shell` entry declares a variant with no args — tmux-manager resolves the
81
+ // real login shell in code, since it varies per remote user's /etc/passwd entry.
82
+ args: z.array(argSpecSchema).max(32),
83
+ })
84
+ .strict();
85
+ const launchSchema = z
86
+ .object({
87
+ params: z.record(z.string(), paramSpecSchema),
88
+ chain: z.enum(['first', 'fallback']).optional(),
89
+ variants: z.array(variantSchema).min(1).max(4),
90
+ legacyConfigAliases: z.record(z.string(), z.string()).optional(),
91
+ legacyConfigField: z.string().min(1).max(40).optional(),
92
+ resumeAppend: z
93
+ .union([
94
+ z.object({ style: z.literal('flag'), flag: flagToken }).strict(),
95
+ z.object({ style: z.literal('positional'), token: shellToken }).strict(),
96
+ ])
97
+ .optional(),
98
+ })
99
+ .strict()
100
+ .superRefine((launch, ctx) => {
101
+ const paramNames = new Set(Object.keys(launch.params));
102
+ const checkValueFrom = (name, path) => {
103
+ if (!paramNames.has(name)) {
104
+ ctx.addIssue({ code: 'custom', message: `valueFrom "${name}" is not a declared param`, path });
105
+ }
106
+ };
107
+ launch.variants.forEach((variant, vi) => {
108
+ variant.args.forEach((arg, ai) => {
109
+ if ('valueFrom' in arg)
110
+ checkValueFrom(arg.valueFrom, ['variants', vi, 'args', ai, 'valueFrom']);
111
+ });
112
+ });
113
+ if (launch.chain === 'fallback') {
114
+ const last = launch.variants.at(-1);
115
+ if (last?.when) {
116
+ ctx.addIssue({
117
+ code: 'custom',
118
+ message: 'the last variant of a fallback chain must have no `when` (it must be the guaranteed terminal case)',
119
+ path: ['variants', launch.variants.length - 1, 'when'],
120
+ });
121
+ }
122
+ }
123
+ if (launch.legacyConfigAliases) {
124
+ for (const paramName of Object.keys(launch.legacyConfigAliases)) {
125
+ if (!paramNames.has(paramName)) {
126
+ ctx.addIssue({
127
+ code: 'custom',
128
+ message: `legacyConfigAliases key "${paramName}" is not a declared param`,
129
+ path: ['legacyConfigAliases', paramName],
130
+ });
131
+ }
132
+ }
133
+ }
134
+ });
135
+ const versionProbeSchema = z
136
+ .object({
137
+ arg: shellToken,
138
+ regex: z.string().max(200).optional(),
139
+ requireVersionMatch: z.boolean().optional(),
140
+ retryOnTransientFailure: z.boolean().optional(),
141
+ })
142
+ .strict();
143
+ const identityProbeSchema = z
144
+ .object({
145
+ arg: shellToken,
146
+ // Same 200-char cap as version.regex, and compiled through the same compileVersionRegex()
147
+ // guard at use time. This is the second and last config-supplied regex in the registry.
148
+ regex: z.string().min(1).max(200),
149
+ })
150
+ .strict();
151
+ const discoverySchema = z
152
+ .object({
153
+ // min(0): the `shell` entry has no binary of its own (it resolves the login shell in code).
154
+ binaries: z.array(shellToken).max(4),
155
+ searchDirs: z.array(z.string().max(300)).max(16),
156
+ version: versionProbeSchema.optional(),
157
+ identity: identityProbeSchema.optional(),
158
+ launcherProfile: z.string().max(40).optional(),
159
+ launcherTargetParam: z.string().max(40).optional(),
160
+ install: z
161
+ .object({
162
+ // z.record with an enum key type requires every enum member in Zod v4; the install
163
+ // command legitimately varies by platform and most entries only need one or two, so
164
+ // this is a plain object of optional platform keys instead.
165
+ command: z
166
+ .object({
167
+ linux: z.string().max(500).optional(),
168
+ darwin: z.string().max(500).optional(),
169
+ wsl: z.string().max(500).optional(),
170
+ win32: z.string().max(500).optional(),
171
+ })
172
+ .strict(),
173
+ npmPackage: z.string().max(200).optional(),
174
+ docsUrl: z.url().optional(),
175
+ })
176
+ .strict(),
177
+ })
178
+ .strict();
179
+ const envExportSchema = z
180
+ .object({
181
+ name: envName,
182
+ value: z.union([
183
+ shellToken,
184
+ z
185
+ .object({
186
+ engine: z.enum([
187
+ 'sessionId',
188
+ 'sessionName',
189
+ 'muxName',
190
+ 'effortLevel',
191
+ 'effortSettingsJson',
192
+ 'codemanPrefixedSessionId',
193
+ 'launcherDefaultTarget',
194
+ ]),
195
+ })
196
+ .strict(),
197
+ ]),
198
+ when: condSchema.optional(),
199
+ })
200
+ .strict();
201
+ const envSchema = z
202
+ .object({
203
+ exports: z.array(envExportSchema).max(16),
204
+ unset: z.array(envName).max(16),
205
+ tmuxSetenvKeys: z.array(envName).max(32),
206
+ dockerExecEnvNames: z.array(envName).max(32),
207
+ configSetenv: z
208
+ .array(z.object({ name: envName, fromParam: z.string().min(1).max(40) }).strict())
209
+ .max(8)
210
+ .optional(),
211
+ allowedPrefixes: z
212
+ .array(z
213
+ .string()
214
+ .min(3)
215
+ .max(32)
216
+ .regex(/^[A-Z][A-Z0-9_]*_$/))
217
+ .max(8),
218
+ allowedKeys: z.array(envName).max(8),
219
+ configContentVar: envName.optional(),
220
+ setenvProfile: z.string().max(40).optional(),
221
+ })
222
+ .strict();
223
+ const echoSchema = z
224
+ .object({
225
+ policy: z.enum(['buffer', 'predict', 'off']),
226
+ anchor: z.union([
227
+ z
228
+ .object({ kind: z.literal('glyph'), glyph: z.string().min(1).max(4), offset: z.number().int().min(0).max(16) })
229
+ .strict(),
230
+ z.object({ kind: z.literal('cursor') }).strict(),
231
+ z.object({ kind: z.literal('none') }).strict(),
232
+ ]),
233
+ predictProfile: z.string().max(40).optional(),
234
+ })
235
+ .strict();
236
+ const capabilitiesSchema = z
237
+ .object({
238
+ external: z.boolean(),
239
+ requiresMux: z.boolean(),
240
+ hooks: z.enum(['none', 'always', 'supervised']),
241
+ transcript: z.enum(['claude-jsonl', 'codex-rollout', 'deepseek-zstd', 'omp-jsonl', 'none']),
242
+ altScreen: z.enum(['strip-full', 'strip-mux-only', 'preserve']),
243
+ echo: echoSchema,
244
+ wheelForward: z
245
+ .object({ mode: z.enum(['never', 'version-gated']), minVersion: z.string().max(20).optional() })
246
+ .strict(),
247
+ keyboardAccessory: z.enum(['agent', 'shell']),
248
+ privilegedCommandGate: z.boolean(),
249
+ startMode: z.enum(['interactive', 'shell']),
250
+ stripInkBloat: z.boolean(),
251
+ ralph: z.boolean(),
252
+ respawn: z.boolean(),
253
+ effort: z.boolean(),
254
+ agentSkillInjection: z.boolean(),
255
+ statusLineTelemetry: z.boolean(),
256
+ model: z
257
+ .object({ source: z.enum(['flag', 'claude-settings-file', 'none']), param: z.string().optional() })
258
+ .strict(),
259
+ privilegedParams: z
260
+ .array(z
261
+ .object({
262
+ param: z.string(),
263
+ clampTo: z.union([z.boolean(), z.string()]),
264
+ materializeWhenAbsent: z.boolean().optional(),
265
+ })
266
+ .strict())
267
+ .max(8),
268
+ // Exact env var NAMES, not prefixes: this list is a targeted deny, and a prefix here
269
+ // would let one entry silently strip a whole namespace off every owner's overrides.
270
+ privilegedEnvKeys: z.array(envName).max(8),
271
+ gates: z.record(z.string(), z.object({ minVersion: z.string().max(20), failClosed: z.boolean() }).strict()),
272
+ maxFrameBytes: z.number().int().positive().optional(),
273
+ })
274
+ .strict();
275
+ const credStoreSchema = z
276
+ .object({
277
+ rel: z.string().min(1).max(100),
278
+ shareDirs: z.array(z.string().max(100)).optional(),
279
+ shareFiles: z.array(z.string().max(100)).optional(),
280
+ seedFiles: z.array(z.string().max(100)).optional(),
281
+ seedWhole: z.boolean().optional(),
282
+ })
283
+ .strict();
284
+ /**
285
+ * A remote/docker default pane command: space-separated bare words from the SAME safe
286
+ * charset as `shellToken` (no shell metacharacters), so `claude --dangerously-skip-permissions`
287
+ * is expressible while still excluding `;`, `|`, `$`, backticks and quotes — this is not an
288
+ * escape hatch into arbitrary shell text, it is one bare command plus bare flags.
289
+ */
290
+ const commandLine = z
291
+ .string()
292
+ .min(1)
293
+ .max(200)
294
+ .regex(/^[A-Za-z0-9._:@=+/,-]+( [A-Za-z0-9._:@=+/,-]+)*$/, 'must be space-separated bare words with no shell metacharacters');
295
+ const overlayTargetSchema = z.union([
296
+ z.object({ command: commandLine.optional() }).strict(),
297
+ z.object({ disabled: z.literal(true) }).strict(),
298
+ ]);
299
+ const overlaysSchema = z
300
+ .object({
301
+ remote: overlayTargetSchema.optional(),
302
+ docker: overlayTargetSchema.optional(),
303
+ credStore: credStoreSchema.optional(),
304
+ })
305
+ .strict();
306
+ export const CliEntrySchema = z
307
+ .object({
308
+ id: cliId,
309
+ label: z.string().min(1).max(60),
310
+ shortBadge: z.string().min(1).max(6),
311
+ accent: z.string().regex(/^#[0-9a-fA-F]{6}$/, 'accent must be a 6-digit hex colour'),
312
+ enabled: z.boolean(),
313
+ stock: z.boolean(),
314
+ order: z.number().int(),
315
+ kind: z.enum(['agent', 'shell']),
316
+ discovery: discoverySchema,
317
+ launch: launchSchema,
318
+ env: envSchema,
319
+ capabilities: capabilitiesSchema,
320
+ overlays: overlaysSchema,
321
+ })
322
+ .strict()
323
+ .superRefine((entry, ctx) => {
324
+ const gateNames = new Set(Object.keys(entry.capabilities.gates));
325
+ const walkConds = (cond) => {
326
+ if (!cond)
327
+ return;
328
+ if ('capabilityGate' in cond && !gateNames.has(cond.capabilityGate)) {
329
+ ctx.addIssue({
330
+ code: 'custom',
331
+ message: `capabilityGate "${cond.capabilityGate}" is not declared in capabilities.gates`,
332
+ });
333
+ }
334
+ if ('allOf' in cond)
335
+ cond.allOf.forEach(walkConds);
336
+ if ('anyOf' in cond)
337
+ cond.anyOf.forEach(walkConds);
338
+ if ('not' in cond)
339
+ walkConds(cond.not);
340
+ };
341
+ for (const variant of entry.launch.variants) {
342
+ walkConds(variant.when);
343
+ for (const arg of variant.args)
344
+ walkConds(arg.when);
345
+ }
346
+ // Reject a profile name this build does not implement, rather than letting it fail
347
+ // closed at use time. An unimplemented `launcherProfile` would make the CLI look
348
+ // permanently uninstalled, and an unimplemented `setenvProfile` would silently skip
349
+ // setup the CLI needs; both are far easier to diagnose as a load-time error naming the
350
+ // field. (`echo.predictProfile` is deliberately NOT checked here — see profiles.ts.)
351
+ const { launcherProfile } = entry.discovery;
352
+ if (launcherProfile !== undefined && !isKnownLauncherProfile(launcherProfile)) {
353
+ ctx.addIssue({
354
+ code: 'custom',
355
+ message: `discovery.launcherProfile "${launcherProfile}" is not a profile this build implements`,
356
+ path: ['discovery', 'launcherProfile'],
357
+ });
358
+ }
359
+ // An env var exported from a param that does not exist would silently export nothing,
360
+ // and for DSH_PERMISSION_MODE that means silently losing a permission clamp.
361
+ const declaredParams = new Set(Object.keys(entry.launch.params));
362
+ entry.env.configSetenv?.forEach((mapping, i) => {
363
+ if (!declaredParams.has(mapping.fromParam)) {
364
+ ctx.addIssue({
365
+ code: 'custom',
366
+ message: `configSetenv fromParam "${mapping.fromParam}" is not a declared launch param`,
367
+ path: ['env', 'configSetenv', i, 'fromParam'],
368
+ });
369
+ }
370
+ });
371
+ // Same class of silent failure on the OTHER privileged surface, and this one is a
372
+ // security control: `privilegedParams[].param` is the multi-user bypass clamp's only
373
+ // handle on a CLI's privilege switch, and a name that is not a declared param clamps
374
+ // NOTHING — no load error, no failing test, the clamp simply stops running. The clamp
375
+ // resolves the name through `legacyConfigAliases`, so this check is what keeps the two
376
+ // in ONE namespace rather than two that merely coincide today: they do not for codex
377
+ // (`bypassApprovals` vs `dangerouslyBypassApprovals`), and giving deepseek's
378
+ // `permissionMode` an alias later would otherwise have removed its clamp with nothing
379
+ // saying so.
380
+ entry.capabilities.privilegedParams.forEach((clamp, i) => {
381
+ if (!declaredParams.has(clamp.param)) {
382
+ ctx.addIssue({
383
+ code: 'custom',
384
+ message: `privilegedParams param "${clamp.param}" is not a declared launch param`,
385
+ path: ['capabilities', 'privilegedParams', i, 'param'],
386
+ });
387
+ }
388
+ });
389
+ const { setenvProfile } = entry.env;
390
+ if (setenvProfile !== undefined && !isKnownSetenvProfile(setenvProfile)) {
391
+ ctx.addIssue({
392
+ code: 'custom',
393
+ message: `env.setenvProfile "${setenvProfile}" is not a profile this build implements`,
394
+ path: ['env', 'setenvProfile'],
395
+ });
396
+ }
397
+ });
398
+ //# sourceMappingURL=schema.js.map