@h-rig/contracts 0.0.6-alpha.13 → 0.0.6-alpha.131

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 (79) hide show
  1. package/dist/index.cjs +6585 -0
  2. package/dist/index.mjs +6544 -0
  3. package/dist/src/artifact.d.ts +13 -0
  4. package/dist/src/artifact.js +3 -0
  5. package/dist/src/baseSchemas.d.ts +63 -0
  6. package/dist/src/baseSchemas.js +6 -0
  7. package/dist/src/cli-output.d.ts +324 -0
  8. package/dist/src/cli-output.js +190 -0
  9. package/dist/src/config.d.ts +368 -0
  10. package/dist/src/config.js +27 -5
  11. package/dist/src/conversation.d.ts +50 -0
  12. package/dist/src/conversation.js +3 -0
  13. package/dist/src/editor.d.ts +25 -0
  14. package/dist/src/editor.js +3 -0
  15. package/dist/src/engine.d.ts +2789 -0
  16. package/dist/src/engine.js +19 -13
  17. package/dist/src/git.d.ts +144 -0
  18. package/dist/src/git.js +3 -0
  19. package/dist/src/graph.d.ts +39 -0
  20. package/dist/src/graph.js +3 -0
  21. package/dist/src/help-catalog.d.ts +34 -0
  22. package/dist/src/help-catalog.js +577 -0
  23. package/dist/src/index.d.ts +40 -0
  24. package/dist/src/index.js +3223 -1226
  25. package/dist/src/ipc.d.ts +248 -0
  26. package/dist/src/keybindings.d.ts +71 -0
  27. package/dist/src/keybindings.js +3 -0
  28. package/dist/src/model.d.ts +77 -0
  29. package/dist/src/orchestration.d.ts +3695 -0
  30. package/dist/src/orchestration.js +3 -0
  31. package/dist/src/pi-session.d.ts +113 -0
  32. package/dist/src/pi-session.js +1 -0
  33. package/dist/src/plugin-hooks.d.ts +51 -0
  34. package/dist/src/plugin-hooks.js +112 -0
  35. package/dist/src/plugin.d.ts +230 -0
  36. package/dist/src/policy.d.ts +16 -0
  37. package/dist/src/policy.js +3 -0
  38. package/dist/src/project.d.ts +71 -0
  39. package/dist/src/project.js +3 -0
  40. package/dist/src/protocol-version.d.ts +21 -0
  41. package/dist/src/protocol-version.js +6 -0
  42. package/dist/src/provider.d.ts +105 -0
  43. package/dist/src/provider.js +3 -0
  44. package/dist/src/providerRuntime.d.ts +3949 -0
  45. package/dist/src/providerRuntime.js +3 -0
  46. package/dist/src/remote.d.ts +326 -0
  47. package/dist/src/remote.js +16 -10
  48. package/dist/src/review.d.ts +18 -0
  49. package/dist/src/review.js +3 -0
  50. package/dist/src/rig.d.ts +783 -0
  51. package/dist/src/rig.js +70 -15
  52. package/dist/src/run-journal.d.ts +763 -0
  53. package/dist/src/run-journal.js +1509 -0
  54. package/dist/src/run-record.d.ts +45 -0
  55. package/dist/src/run-record.js +1 -0
  56. package/dist/src/run-session-journal.d.ts +89 -0
  57. package/dist/src/run-session-journal.js +1671 -0
  58. package/dist/src/run-status.d.ts +12 -0
  59. package/dist/src/run-status.js +38 -0
  60. package/dist/src/run-timeline.d.ts +10 -0
  61. package/dist/src/run-timeline.js +1377 -0
  62. package/dist/src/runtime.d.ts +103 -0
  63. package/dist/src/runtime.js +9 -4
  64. package/dist/src/server.d.ts +106 -0
  65. package/dist/src/server.js +3 -0
  66. package/dist/src/serviceFabric.d.ts +62 -0
  67. package/dist/src/serviceFabric.js +5 -2
  68. package/dist/src/task-source.d.ts +28 -0
  69. package/dist/src/terminal.d.ts +130 -0
  70. package/dist/src/terminal.js +3 -0
  71. package/dist/src/validation.d.ts +14 -0
  72. package/dist/src/validation.js +3 -0
  73. package/dist/src/workflow-journal.d.ts +124 -0
  74. package/dist/src/workflow-journal.js +389 -0
  75. package/dist/src/workspace.d.ts +204 -0
  76. package/dist/src/workspace.js +5 -2
  77. package/dist/src/ws.d.ts +747 -0
  78. package/dist/src/ws.js +64 -14
  79. package/package.json +6 -3
@@ -0,0 +1,368 @@
1
+ import { Schema } from "effect";
2
+ export declare const WorkspaceIsolation: Schema.Literals<readonly ["worktree", "directory"]>;
3
+ export type WorkspaceIsolation = typeof WorkspaceIsolation.Type;
4
+ /**
5
+ * Git checkout strategy for agent workspaces. This is git HYGIENE (parallel
6
+ * runs don't trample each other), NOT a security boundary — the security
7
+ * boundary is `workspace.sandbox`.
8
+ */
9
+ export declare const WorkspaceCheckout: Schema.Literals<readonly ["worktree", "directory"]>;
10
+ export type WorkspaceCheckout = typeof WorkspaceCheckout.Type;
11
+ /**
12
+ * Security sandbox mode for agent processes (macOS seatbelt / Linux bwrap).
13
+ * "enforce" (the default) refuses to run unsandboxed when no backend is
14
+ * available; "auto" degrades to unsandboxed with a warning; "off" opts out
15
+ * explicitly.
16
+ */
17
+ export declare const WorkspaceSandbox: Schema.Literals<readonly ["enforce", "auto", "off"]>;
18
+ export type WorkspaceSandbox = typeof WorkspaceSandbox.Type;
19
+ export declare const ScopeSearchPrefix: Schema.Struct<{
20
+ readonly prefix: Schema.String;
21
+ readonly matchStartsWith: Schema.optional<Schema.$Array<Schema.String>>;
22
+ readonly matchExact: Schema.optional<Schema.$Array<Schema.String>>;
23
+ }>;
24
+ export type ScopeSearchPrefix = typeof ScopeSearchPrefix.Type;
25
+ export declare const ScopeNormalizationRules: Schema.Struct<{
26
+ readonly stripPrefixes: Schema.optional<Schema.$Array<Schema.String>>;
27
+ readonly searchPrefixes: Schema.optional<Schema.$Array<Schema.Struct<{
28
+ readonly prefix: Schema.String;
29
+ readonly matchStartsWith: Schema.optional<Schema.$Array<Schema.String>>;
30
+ readonly matchExact: Schema.optional<Schema.$Array<Schema.String>>;
31
+ }>>>;
32
+ }>;
33
+ export type ScopeNormalizationRules = typeof ScopeNormalizationRules.Type;
34
+ export declare const WorkspaceConfig: Schema.Struct<{
35
+ readonly mainRepo: Schema.String;
36
+ /** Canonical name for the checkout axis; `isolation` is the deprecated alias. */
37
+ readonly checkout: Schema.optional<Schema.Literals<readonly ["worktree", "directory"]>>;
38
+ /** @deprecated Renamed to `checkout` — worktrees are git hygiene, not isolation. */
39
+ readonly isolation: Schema.optional<Schema.Literals<readonly ["worktree", "directory"]>>;
40
+ readonly sandbox: Schema.optional<Schema.Literals<readonly ["enforce", "auto", "off"]>>;
41
+ readonly scopeNormalization: Schema.optional<Schema.Struct<{
42
+ readonly stripPrefixes: Schema.optional<Schema.$Array<Schema.String>>;
43
+ readonly searchPrefixes: Schema.optional<Schema.$Array<Schema.Struct<{
44
+ readonly prefix: Schema.String;
45
+ readonly matchStartsWith: Schema.optional<Schema.$Array<Schema.String>>;
46
+ readonly matchExact: Schema.optional<Schema.$Array<Schema.String>>;
47
+ }>>>;
48
+ }>>;
49
+ }>;
50
+ export type WorkspaceConfig = typeof WorkspaceConfig.Type;
51
+ export declare const TaskSourceConfig: Schema.Struct<{
52
+ readonly kind: Schema.String;
53
+ readonly path: Schema.optional<Schema.String>;
54
+ readonly owner: Schema.optional<Schema.String>;
55
+ readonly repo: Schema.optional<Schema.String>;
56
+ readonly labels: Schema.optional<Schema.$Array<Schema.String>>;
57
+ readonly state: Schema.optional<Schema.Literals<readonly ["open", "closed", "all"]>>;
58
+ readonly url: Schema.optional<Schema.String>;
59
+ readonly options: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
60
+ }>;
61
+ export type TaskSourceConfig = typeof TaskSourceConfig.Type;
62
+ export declare const RuntimeHarness: Schema.Literal<"pi">;
63
+ export type RuntimeHarness = typeof RuntimeHarness.Type;
64
+ export declare const RigRuntimeMode: Schema.Literals<readonly ["yolo", "approval-required"]>;
65
+ export type RigRuntimeMode = typeof RigRuntimeMode.Type;
66
+ /**
67
+ * Pi harness configuration. `packages` lists Pi extension packages (npm
68
+ * specifiers like "pi-subagents" or "pi-web-access@1.2.0", or git sources)
69
+ * that Rig materializes into the workspace's `.pi/settings.json`. Pi
70
+ * auto-installs missing packages at session start, so worker sessions on
71
+ * remote hosts pick them up with no extra provisioning.
72
+ */
73
+ export declare const PiRuntimeConfig: Schema.Struct<{
74
+ readonly packages: Schema.optional<Schema.$Array<Schema.String>>;
75
+ }>;
76
+ export type PiRuntimeConfig = typeof PiRuntimeConfig.Type;
77
+ /**
78
+ * Rig backbone + placement, surfaced so EVERY value Rig would otherwise compute
79
+ * or hardcode is settable from `rig.config.ts`. Resolution order everywhere is
80
+ * ambient env → `rig.config.ts` → computed default (the default is the value Rig
81
+ * computes today, e.g. host `where.rig-does.work`). All optional: omit and you get
82
+ * the computed default with zero config.
83
+ *
84
+ * - `host` : the shared collab/discovery backbone host. relayUrl + registryUrl
85
+ * derive from it (`wss://<host>`, `https://<host>/registry`) unless
86
+ * set explicitly below.
87
+ * - `relayUrl`/`registryUrl` : explicit overrides of the derived backbone
88
+ * endpoints.
89
+ * - `sshTarget`/`checkout` : remote run PLACEMENT (which machine executes a run,
90
+ * and the checkout dir there) — formerly only in endpoints.toml /
91
+ * connection.json, now surfaceable here too.
92
+ */
93
+ export declare const RigServerConfig: Schema.Struct<{
94
+ readonly host: Schema.optional<Schema.String>;
95
+ readonly relayUrl: Schema.optional<Schema.String>;
96
+ readonly registryUrl: Schema.optional<Schema.String>;
97
+ readonly sshTarget: Schema.optional<Schema.String>;
98
+ readonly checkout: Schema.optional<Schema.String>;
99
+ }>;
100
+ export type RigServerConfig = typeof RigServerConfig.Type;
101
+ export declare const RuntimeConfig: Schema.Struct<{
102
+ readonly agentRoles: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
103
+ readonly timeouts: Schema.optional<Schema.$Record<Schema.String, Schema.Number>>;
104
+ readonly harness: Schema.optional<Schema.Literal<"pi">>;
105
+ readonly model: Schema.optional<Schema.String>;
106
+ readonly mode: Schema.optional<Schema.Literals<readonly ["yolo", "approval-required"]>>;
107
+ readonly pi: Schema.optional<Schema.Struct<{
108
+ readonly packages: Schema.optional<Schema.$Array<Schema.String>>;
109
+ }>>;
110
+ /** Backbone (relay/registry) + remote placement; computed defaults under the hood. */
111
+ readonly server: Schema.optional<Schema.Struct<{
112
+ readonly host: Schema.optional<Schema.String>;
113
+ readonly relayUrl: Schema.optional<Schema.String>;
114
+ readonly registryUrl: Schema.optional<Schema.String>;
115
+ readonly sshTarget: Schema.optional<Schema.String>;
116
+ readonly checkout: Schema.optional<Schema.String>;
117
+ }>>;
118
+ }>;
119
+ export type RuntimeConfig = typeof RuntimeConfig.Type;
120
+ export declare const ProjectIdentity: Schema.Struct<{
121
+ readonly name: Schema.String;
122
+ readonly repo: Schema.optional<Schema.String>;
123
+ }>;
124
+ export type ProjectIdentity = typeof ProjectIdentity.Type;
125
+ export declare const PlanningConfig: Schema.Struct<{
126
+ readonly mode: Schema.optional<Schema.Literals<readonly ["auto", "always", "off"]>>;
127
+ readonly requireForLabels: Schema.optional<Schema.$Array<Schema.String>>;
128
+ readonly skipForLabels: Schema.optional<Schema.$Array<Schema.String>>;
129
+ }>;
130
+ export type PlanningConfig = typeof PlanningConfig.Type;
131
+ export declare const GitHubProjectStatusConfig: Schema.Struct<{
132
+ readonly enabled: Schema.optional<Schema.Boolean>;
133
+ readonly projectId: Schema.optional<Schema.String>;
134
+ readonly statusFieldId: Schema.optional<Schema.String>;
135
+ readonly statuses: Schema.optional<Schema.Struct<{
136
+ readonly running: Schema.optional<Schema.String>;
137
+ readonly prOpen: Schema.optional<Schema.String>;
138
+ readonly ciFixing: Schema.optional<Schema.String>;
139
+ readonly merging: Schema.optional<Schema.String>;
140
+ readonly done: Schema.optional<Schema.String>;
141
+ readonly needsAttention: Schema.optional<Schema.String>;
142
+ }>>;
143
+ }>;
144
+ export type GitHubProjectStatusConfig = typeof GitHubProjectStatusConfig.Type;
145
+ export declare const GitHubConfig: Schema.Struct<{
146
+ readonly issueUpdates: Schema.optional<Schema.Literals<readonly ["lifecycle", "minimal", "off"]>>;
147
+ readonly projects: Schema.optional<Schema.Struct<{
148
+ readonly enabled: Schema.optional<Schema.Boolean>;
149
+ readonly projectId: Schema.optional<Schema.String>;
150
+ readonly statusFieldId: Schema.optional<Schema.String>;
151
+ readonly statuses: Schema.optional<Schema.Struct<{
152
+ readonly running: Schema.optional<Schema.String>;
153
+ readonly prOpen: Schema.optional<Schema.String>;
154
+ readonly ciFixing: Schema.optional<Schema.String>;
155
+ readonly merging: Schema.optional<Schema.String>;
156
+ readonly done: Schema.optional<Schema.String>;
157
+ readonly needsAttention: Schema.optional<Schema.String>;
158
+ }>>;
159
+ }>>;
160
+ }>;
161
+ export type GitHubConfig = typeof GitHubConfig.Type;
162
+ export declare const AutomationConfig: Schema.Struct<{
163
+ readonly maxValidationAttempts: Schema.optional<Schema.Number>;
164
+ readonly maxPrFixIterations: Schema.optional<Schema.Number>;
165
+ }>;
166
+ export type AutomationConfig = typeof AutomationConfig.Type;
167
+ export declare const PullRequestConfig: Schema.Struct<{
168
+ readonly mode: Schema.optional<Schema.Literals<readonly ["auto", "ask", "off"]>>;
169
+ readonly watchChecks: Schema.optional<Schema.Boolean>;
170
+ readonly autoFixChecks: Schema.optional<Schema.Boolean>;
171
+ readonly autoFixReview: Schema.optional<Schema.Boolean>;
172
+ readonly pendingTimeoutMs: Schema.optional<Schema.Number>;
173
+ readonly pendingPollMs: Schema.optional<Schema.Number>;
174
+ }>;
175
+ export type PullRequestConfig = typeof PullRequestConfig.Type;
176
+ export declare const MergeConfig: Schema.Struct<{
177
+ readonly mode: Schema.optional<Schema.Literals<readonly ["auto", "off", "pr-ready"]>>;
178
+ readonly method: Schema.optional<Schema.Literals<readonly ["repo-default", "squash", "merge", "rebase"]>>;
179
+ readonly deleteBranch: Schema.optional<Schema.Union<readonly [Schema.Literal<"repo-default">, Schema.Boolean]>>;
180
+ readonly allowedFailures: Schema.optional<Schema.$Array<Schema.String>>;
181
+ readonly bypass: Schema.optional<Schema.Boolean>;
182
+ }>;
183
+ export type MergeConfig = typeof MergeConfig.Type;
184
+ export declare const IssueAnalysisConfig: Schema.Struct<{
185
+ readonly enabled: Schema.optional<Schema.Boolean>;
186
+ readonly harness: Schema.optional<Schema.Literal<"pi">>;
187
+ readonly model: Schema.optional<Schema.String>;
188
+ readonly mode: Schema.optional<Schema.Literals<readonly ["continuous", "off"]>>;
189
+ }>;
190
+ export type IssueAnalysisConfig = typeof IssueAnalysisConfig.Type;
191
+ export declare const ReviewConfig: Schema.Struct<{
192
+ readonly mode: Schema.optional<Schema.Literals<readonly ["off", "advisory", "required"]>>;
193
+ readonly provider: Schema.optional<Schema.Literals<readonly ["greptile", "github"]>>;
194
+ }>;
195
+ export type ReviewConfig = typeof ReviewConfig.Type;
196
+ export declare const RigConfig: Schema.Struct<{
197
+ readonly project: Schema.Struct<{
198
+ readonly name: Schema.String;
199
+ readonly repo: Schema.optional<Schema.String>;
200
+ }>;
201
+ readonly plugins: Schema.$Array<Schema.Struct<{
202
+ readonly name: Schema.String;
203
+ readonly version: Schema.String;
204
+ readonly contributes: Schema.optional<Schema.Struct<{
205
+ readonly validators: Schema.optional<Schema.$Array<Schema.Struct<{
206
+ readonly id: Schema.String;
207
+ readonly category: Schema.Literals<readonly ["boundary", "contract", "integration", "regression", "external", "custom"]>;
208
+ readonly description: Schema.optional<Schema.String>;
209
+ }>>>;
210
+ readonly hooks: Schema.optional<Schema.$Array<Schema.Struct<{
211
+ readonly id: Schema.String;
212
+ readonly event: Schema.Literals<readonly ["PreToolUse", "PostToolUse", "UserPromptSubmit", "Stop", "SessionStart", "SessionEnd"]>;
213
+ readonly matcher: Schema.Union<readonly [Schema.Struct<{
214
+ readonly kind: Schema.Literal<"all">;
215
+ }>, Schema.Struct<{
216
+ readonly kind: Schema.Literal<"tool">;
217
+ readonly name: Schema.String;
218
+ }>, Schema.Struct<{
219
+ readonly kind: Schema.Literal<"glob">;
220
+ readonly pattern: Schema.String;
221
+ }>]>;
222
+ readonly command: Schema.optional<Schema.String>;
223
+ readonly description: Schema.optional<Schema.String>;
224
+ }>>>;
225
+ readonly skills: Schema.optional<Schema.$Array<Schema.Struct<{
226
+ readonly id: Schema.String;
227
+ readonly path: Schema.String;
228
+ readonly description: Schema.optional<Schema.String>;
229
+ }>>>;
230
+ readonly repoSources: Schema.optional<Schema.$Array<Schema.Struct<{
231
+ readonly id: Schema.String;
232
+ readonly url: Schema.String;
233
+ readonly defaultPath: Schema.optional<Schema.String>;
234
+ readonly description: Schema.optional<Schema.String>;
235
+ readonly defaultBranch: Schema.optional<Schema.String>;
236
+ readonly remoteEnvVar: Schema.optional<Schema.String>;
237
+ readonly checkoutEnvVar: Schema.optional<Schema.String>;
238
+ }>>>;
239
+ readonly agentRoles: Schema.optional<Schema.$Array<Schema.Struct<{
240
+ readonly id: Schema.String;
241
+ readonly defaultModel: Schema.optional<Schema.String>;
242
+ readonly description: Schema.optional<Schema.String>;
243
+ }>>>;
244
+ readonly taskFieldSchemas: Schema.optional<Schema.$Array<Schema.Struct<{
245
+ readonly id: Schema.String;
246
+ readonly fieldName: Schema.String;
247
+ readonly schemaJson: Schema.String;
248
+ }>>>;
249
+ readonly taskSources: Schema.optional<Schema.$Array<Schema.Struct<{
250
+ readonly id: Schema.String;
251
+ readonly kind: Schema.String;
252
+ readonly description: Schema.optional<Schema.String>;
253
+ }>>>;
254
+ readonly cliCommands: Schema.optional<Schema.$Array<Schema.Struct<{
255
+ readonly id: Schema.String;
256
+ readonly command: Schema.String;
257
+ readonly description: Schema.optional<Schema.String>;
258
+ }>>>;
259
+ }>>;
260
+ }>>;
261
+ readonly taskSource: Schema.Struct<{
262
+ readonly kind: Schema.String;
263
+ readonly path: Schema.optional<Schema.String>;
264
+ readonly owner: Schema.optional<Schema.String>;
265
+ readonly repo: Schema.optional<Schema.String>;
266
+ readonly labels: Schema.optional<Schema.$Array<Schema.String>>;
267
+ readonly state: Schema.optional<Schema.Literals<readonly ["open", "closed", "all"]>>;
268
+ readonly url: Schema.optional<Schema.String>;
269
+ readonly options: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
270
+ }>;
271
+ readonly workspace: Schema.Struct<{
272
+ readonly mainRepo: Schema.String;
273
+ /** Canonical name for the checkout axis; `isolation` is the deprecated alias. */
274
+ readonly checkout: Schema.optional<Schema.Literals<readonly ["worktree", "directory"]>>;
275
+ /** @deprecated Renamed to `checkout` — worktrees are git hygiene, not isolation. */
276
+ readonly isolation: Schema.optional<Schema.Literals<readonly ["worktree", "directory"]>>;
277
+ readonly sandbox: Schema.optional<Schema.Literals<readonly ["enforce", "auto", "off"]>>;
278
+ readonly scopeNormalization: Schema.optional<Schema.Struct<{
279
+ readonly stripPrefixes: Schema.optional<Schema.$Array<Schema.String>>;
280
+ readonly searchPrefixes: Schema.optional<Schema.$Array<Schema.Struct<{
281
+ readonly prefix: Schema.String;
282
+ readonly matchStartsWith: Schema.optional<Schema.$Array<Schema.String>>;
283
+ readonly matchExact: Schema.optional<Schema.$Array<Schema.String>>;
284
+ }>>>;
285
+ }>>;
286
+ }>;
287
+ readonly runtime: Schema.optional<Schema.Struct<{
288
+ readonly agentRoles: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
289
+ readonly timeouts: Schema.optional<Schema.$Record<Schema.String, Schema.Number>>;
290
+ readonly harness: Schema.optional<Schema.Literal<"pi">>;
291
+ readonly model: Schema.optional<Schema.String>;
292
+ readonly mode: Schema.optional<Schema.Literals<readonly ["yolo", "approval-required"]>>;
293
+ readonly pi: Schema.optional<Schema.Struct<{
294
+ readonly packages: Schema.optional<Schema.$Array<Schema.String>>;
295
+ }>>;
296
+ /** Backbone (relay/registry) + remote placement; computed defaults under the hood. */
297
+ readonly server: Schema.optional<Schema.Struct<{
298
+ readonly host: Schema.optional<Schema.String>;
299
+ readonly relayUrl: Schema.optional<Schema.String>;
300
+ readonly registryUrl: Schema.optional<Schema.String>;
301
+ readonly sshTarget: Schema.optional<Schema.String>;
302
+ readonly checkout: Schema.optional<Schema.String>;
303
+ }>>;
304
+ }>>;
305
+ readonly planning: Schema.optional<Schema.Struct<{
306
+ readonly mode: Schema.optional<Schema.Literals<readonly ["auto", "always", "off"]>>;
307
+ readonly requireForLabels: Schema.optional<Schema.$Array<Schema.String>>;
308
+ readonly skipForLabels: Schema.optional<Schema.$Array<Schema.String>>;
309
+ }>>;
310
+ readonly github: Schema.optional<Schema.Struct<{
311
+ readonly issueUpdates: Schema.optional<Schema.Literals<readonly ["lifecycle", "minimal", "off"]>>;
312
+ readonly projects: Schema.optional<Schema.Struct<{
313
+ readonly enabled: Schema.optional<Schema.Boolean>;
314
+ readonly projectId: Schema.optional<Schema.String>;
315
+ readonly statusFieldId: Schema.optional<Schema.String>;
316
+ readonly statuses: Schema.optional<Schema.Struct<{
317
+ readonly running: Schema.optional<Schema.String>;
318
+ readonly prOpen: Schema.optional<Schema.String>;
319
+ readonly ciFixing: Schema.optional<Schema.String>;
320
+ readonly merging: Schema.optional<Schema.String>;
321
+ readonly done: Schema.optional<Schema.String>;
322
+ readonly needsAttention: Schema.optional<Schema.String>;
323
+ }>>;
324
+ }>>;
325
+ }>>;
326
+ readonly automation: Schema.optional<Schema.Struct<{
327
+ readonly maxValidationAttempts: Schema.optional<Schema.Number>;
328
+ readonly maxPrFixIterations: Schema.optional<Schema.Number>;
329
+ }>>;
330
+ readonly pr: Schema.optional<Schema.Struct<{
331
+ readonly mode: Schema.optional<Schema.Literals<readonly ["auto", "ask", "off"]>>;
332
+ readonly watchChecks: Schema.optional<Schema.Boolean>;
333
+ readonly autoFixChecks: Schema.optional<Schema.Boolean>;
334
+ readonly autoFixReview: Schema.optional<Schema.Boolean>;
335
+ readonly pendingTimeoutMs: Schema.optional<Schema.Number>;
336
+ readonly pendingPollMs: Schema.optional<Schema.Number>;
337
+ }>>;
338
+ readonly merge: Schema.optional<Schema.Struct<{
339
+ readonly mode: Schema.optional<Schema.Literals<readonly ["auto", "off", "pr-ready"]>>;
340
+ readonly method: Schema.optional<Schema.Literals<readonly ["repo-default", "squash", "merge", "rebase"]>>;
341
+ readonly deleteBranch: Schema.optional<Schema.Union<readonly [Schema.Literal<"repo-default">, Schema.Boolean]>>;
342
+ readonly allowedFailures: Schema.optional<Schema.$Array<Schema.String>>;
343
+ readonly bypass: Schema.optional<Schema.Boolean>;
344
+ }>>;
345
+ readonly review: Schema.optional<Schema.Struct<{
346
+ readonly mode: Schema.optional<Schema.Literals<readonly ["off", "advisory", "required"]>>;
347
+ readonly provider: Schema.optional<Schema.Literals<readonly ["greptile", "github"]>>;
348
+ }>>;
349
+ readonly issueAnalysis: Schema.optional<Schema.Struct<{
350
+ readonly enabled: Schema.optional<Schema.Boolean>;
351
+ readonly harness: Schema.optional<Schema.Literal<"pi">>;
352
+ readonly model: Schema.optional<Schema.String>;
353
+ readonly mode: Schema.optional<Schema.Literals<readonly ["continuous", "off"]>>;
354
+ }>>;
355
+ /**
356
+ * Generic env-override map: the single escape hatch that makes EVERY env-driven
357
+ * value (the dozens of `RIG_*` / `RIG_BAKED_*` / `RIG_BROWSER_*` knobs, plus any
358
+ * computed value that reads an env var) settable from `rig.config.ts` without a
359
+ * typed field per knob. The CLI applies these to `process.env` at startup
360
+ * FILL-IF-UNSET, so the precedence is:
361
+ * ambient process env at run time (top winner)
362
+ * → `rig.config.ts` (this `env` map + typed sections)
363
+ * → computed default / derived value (under the hood).
364
+ * i.e. `RIG_X=… rig …` always beats the config; the config beats the default.
365
+ */
366
+ readonly env: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
367
+ }>;
368
+ export type RigConfig = typeof RigConfig.Type;
@@ -93,6 +93,8 @@ var WorkspaceIsolation = Schema2.Literals([
93
93
  "worktree",
94
94
  "directory"
95
95
  ]);
96
+ var WorkspaceCheckout = WorkspaceIsolation;
97
+ var WorkspaceSandbox = Schema2.Literals(["enforce", "auto", "off"]);
96
98
  var ScopeSearchPrefix = Schema2.Struct({
97
99
  prefix: Schema2.String,
98
100
  matchStartsWith: Schema2.optional(Schema2.Array(Schema2.String)),
@@ -104,7 +106,9 @@ var ScopeNormalizationRules = Schema2.Struct({
104
106
  });
105
107
  var WorkspaceConfig = Schema2.Struct({
106
108
  mainRepo: Schema2.String,
107
- isolation: WorkspaceIsolation,
109
+ checkout: Schema2.optional(WorkspaceCheckout),
110
+ isolation: Schema2.optional(WorkspaceIsolation),
111
+ sandbox: Schema2.optional(WorkspaceSandbox),
108
112
  scopeNormalization: Schema2.optional(ScopeNormalizationRules)
109
113
  });
110
114
  var TaskSourceConfig = Schema2.Struct({
@@ -117,14 +121,26 @@ var TaskSourceConfig = Schema2.Struct({
117
121
  url: Schema2.optional(Schema2.String),
118
122
  options: Schema2.optional(Schema2.Record(Schema2.String, Schema2.Unknown))
119
123
  });
120
- var RuntimeHarness = Schema2.Literals(["pi", "claude-code", "codex"]);
124
+ var RuntimeHarness = Schema2.Literal("pi");
121
125
  var RigRuntimeMode = Schema2.Literals(["yolo", "approval-required"]);
126
+ var PiRuntimeConfig = Schema2.Struct({
127
+ packages: Schema2.optional(Schema2.Array(Schema2.String))
128
+ });
129
+ var RigServerConfig = Schema2.Struct({
130
+ host: Schema2.optional(Schema2.String),
131
+ relayUrl: Schema2.optional(Schema2.String),
132
+ registryUrl: Schema2.optional(Schema2.String),
133
+ sshTarget: Schema2.optional(Schema2.String),
134
+ checkout: Schema2.optional(Schema2.String)
135
+ });
122
136
  var RuntimeConfig = Schema2.Struct({
123
137
  agentRoles: Schema2.optional(Schema2.Record(Schema2.String, Schema2.Unknown)),
124
138
  timeouts: Schema2.optional(Schema2.Record(Schema2.String, Schema2.Number)),
125
139
  harness: Schema2.optional(RuntimeHarness),
126
140
  model: Schema2.optional(Schema2.String),
127
- mode: Schema2.optional(RigRuntimeMode)
141
+ mode: Schema2.optional(RigRuntimeMode),
142
+ pi: Schema2.optional(PiRuntimeConfig),
143
+ server: Schema2.optional(RigServerConfig)
128
144
  });
129
145
  var ProjectIdentity = Schema2.Struct({
130
146
  name: Schema2.String,
@@ -143,6 +159,7 @@ var GitHubProjectStatusConfig = Schema2.Struct({
143
159
  running: Schema2.optional(Schema2.String),
144
160
  prOpen: Schema2.optional(Schema2.String),
145
161
  ciFixing: Schema2.optional(Schema2.String),
162
+ merging: Schema2.optional(Schema2.String),
146
163
  done: Schema2.optional(Schema2.String),
147
164
  needsAttention: Schema2.optional(Schema2.String)
148
165
  }))
@@ -178,7 +195,7 @@ var IssueAnalysisConfig = Schema2.Struct({
178
195
  });
179
196
  var ReviewConfig = Schema2.Struct({
180
197
  mode: Schema2.optional(Schema2.Literals(["off", "advisory", "required"])),
181
- provider: Schema2.optional(Schema2.Literal("greptile"))
198
+ provider: Schema2.optional(Schema2.Literals(["greptile", "github"]))
182
199
  });
183
200
  var RigConfig = Schema2.Struct({
184
201
  project: ProjectIdentity,
@@ -192,22 +209,27 @@ var RigConfig = Schema2.Struct({
192
209
  pr: Schema2.optional(PullRequestConfig),
193
210
  merge: Schema2.optional(MergeConfig),
194
211
  review: Schema2.optional(ReviewConfig),
195
- issueAnalysis: Schema2.optional(IssueAnalysisConfig)
212
+ issueAnalysis: Schema2.optional(IssueAnalysisConfig),
213
+ env: Schema2.optional(Schema2.Record(Schema2.String, Schema2.String))
196
214
  });
197
215
  export {
216
+ WorkspaceSandbox,
198
217
  WorkspaceIsolation,
199
218
  WorkspaceConfig,
219
+ WorkspaceCheckout,
200
220
  TaskSourceConfig,
201
221
  ScopeSearchPrefix,
202
222
  ScopeNormalizationRules,
203
223
  RuntimeHarness,
204
224
  RuntimeConfig,
225
+ RigServerConfig,
205
226
  RigRuntimeMode,
206
227
  RigConfig,
207
228
  ReviewConfig,
208
229
  PullRequestConfig,
209
230
  ProjectIdentity,
210
231
  PlanningConfig,
232
+ PiRuntimeConfig,
211
233
  MergeConfig,
212
234
  IssueAnalysisConfig,
213
235
  GitHubProjectStatusConfig,
@@ -0,0 +1,50 @@
1
+ import { Schema } from "effect";
2
+ export declare const EngineMessageRole: Schema.Literals<readonly ["user", "assistant", "system"]>;
3
+ export type EngineMessageRole = typeof EngineMessageRole.Type;
4
+ export declare const EngineMessageState: Schema.Literals<readonly ["streaming", "completed", "interrupted", "errored"]>;
5
+ export type EngineMessageState = typeof EngineMessageState.Type;
6
+ export declare const ConversationSummary: Schema.Struct<{
7
+ readonly id: Schema.brand<Schema.Trim, "ConversationId">;
8
+ readonly runId: Schema.brand<Schema.Trim, "RunId">;
9
+ readonly title: Schema.Trim;
10
+ readonly createdAt: Schema.String;
11
+ readonly updatedAt: Schema.String;
12
+ }>;
13
+ export type ConversationSummary = typeof ConversationSummary.Type;
14
+ export declare const EngineMessage: Schema.Struct<{
15
+ readonly id: Schema.brand<Schema.Trim, "MessageId">;
16
+ readonly conversationId: Schema.brand<Schema.Trim, "ConversationId">;
17
+ readonly role: Schema.Literals<readonly ["user", "assistant", "system"]>;
18
+ readonly text: Schema.String;
19
+ readonly attachments: Schema.$Array<Schema.Unknown>;
20
+ readonly state: Schema.Literals<readonly ["streaming", "completed", "interrupted", "errored"]>;
21
+ readonly createdAt: Schema.String;
22
+ readonly completedAt: Schema.NullOr<Schema.String>;
23
+ }>;
24
+ export type EngineMessage = typeof EngineMessage.Type;
25
+ export declare const EngineAction: Schema.Struct<{
26
+ readonly id: Schema.brand<Schema.Trim, "ActionId">;
27
+ readonly runId: Schema.brand<Schema.Trim, "RunId">;
28
+ readonly messageId: Schema.NullOr<Schema.brand<Schema.Trim, "MessageId">>;
29
+ readonly actionType: Schema.Trim;
30
+ readonly title: Schema.Trim;
31
+ readonly detail: Schema.NullOr<Schema.String>;
32
+ readonly state: Schema.Trim;
33
+ readonly payload: Schema.Unknown;
34
+ readonly startedAt: Schema.String;
35
+ readonly completedAt: Schema.NullOr<Schema.String>;
36
+ }>;
37
+ export type EngineAction = typeof EngineAction.Type;
38
+ export declare const EngineLogTone: Schema.Literals<readonly ["thinking", "tool", "info", "error"]>;
39
+ export type EngineLogTone = typeof EngineLogTone.Type;
40
+ export declare const EngineRunLog: Schema.Struct<{
41
+ readonly id: Schema.Trim;
42
+ readonly runId: Schema.brand<Schema.Trim, "RunId">;
43
+ readonly title: Schema.Trim;
44
+ readonly detail: Schema.NullOr<Schema.String>;
45
+ readonly tone: Schema.Literals<readonly ["thinking", "tool", "info", "error"]>;
46
+ readonly status: Schema.NullOr<Schema.Trim>;
47
+ readonly payload: Schema.Unknown;
48
+ readonly createdAt: Schema.String;
49
+ }>;
50
+ export type EngineRunLog = typeof EngineRunLog.Type;
@@ -16,6 +16,9 @@ var WorkspaceId = makeEntityId("WorkspaceId");
16
16
  var GraphId = makeEntityId("GraphId");
17
17
  var TaskId = makeEntityId("TaskId");
18
18
  var RunId = makeEntityId("RunId");
19
+ var SafePathSegment = TrimmedNonEmptyString.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)).pipe(Schema.brand("SafePathSegment"));
20
+ var SafeRunId = TrimmedNonEmptyString.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/)).pipe(Schema.brand("SafeRunId"));
21
+ var SafeGitRefComponent = TrimmedNonEmptyString.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)).pipe(Schema.brand("SafeGitRefComponent"));
19
22
  var EngineRuntimeId = makeEntityId("EngineRuntimeId");
20
23
  var ConversationId = makeEntityId("ConversationId");
21
24
  var ActionId = makeEntityId("ActionId");
@@ -0,0 +1,25 @@
1
+ import { Schema } from "effect";
2
+ export declare const EDITORS: readonly [{
3
+ readonly id: "cursor";
4
+ readonly label: "Cursor";
5
+ readonly command: "cursor";
6
+ }, {
7
+ readonly id: "vscode";
8
+ readonly label: "VS Code";
9
+ readonly command: "code";
10
+ }, {
11
+ readonly id: "zed";
12
+ readonly label: "Zed";
13
+ readonly command: "zed";
14
+ }, {
15
+ readonly id: "file-manager";
16
+ readonly label: "File Manager";
17
+ readonly command: null;
18
+ }];
19
+ export declare const EditorId: Schema.Literals<("cursor" | "vscode" | "zed" | "file-manager")[]>;
20
+ export type EditorId = typeof EditorId.Type;
21
+ export declare const OpenInEditorInput: Schema.Struct<{
22
+ readonly cwd: Schema.Trim;
23
+ readonly editor: Schema.Literals<("cursor" | "vscode" | "zed" | "file-manager")[]>;
24
+ }>;
25
+ export type OpenInEditorInput = typeof OpenInEditorInput.Type;
@@ -16,6 +16,9 @@ var WorkspaceId = makeEntityId("WorkspaceId");
16
16
  var GraphId = makeEntityId("GraphId");
17
17
  var TaskId = makeEntityId("TaskId");
18
18
  var RunId = makeEntityId("RunId");
19
+ var SafePathSegment = TrimmedNonEmptyString.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)).pipe(Schema.brand("SafePathSegment"));
20
+ var SafeRunId = TrimmedNonEmptyString.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/)).pipe(Schema.brand("SafeRunId"));
21
+ var SafeGitRefComponent = TrimmedNonEmptyString.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)).pipe(Schema.brand("SafeGitRefComponent"));
19
22
  var EngineRuntimeId = makeEntityId("EngineRuntimeId");
20
23
  var ConversationId = makeEntityId("ConversationId");
21
24
  var ActionId = makeEntityId("ActionId");