@h-rig/contracts 0.0.6-alpha.63 → 0.0.6-alpha.65

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.
@@ -0,0 +1,112 @@
1
+ // @bun
2
+ // packages/contracts/src/plugin-hooks.ts
3
+ import { Schema as Schema2 } from "effect";
4
+
5
+ // packages/contracts/src/plugin.ts
6
+ import { Schema } from "effect";
7
+ var ValidatorCategory = Schema.Literals([
8
+ "boundary",
9
+ "contract",
10
+ "integration",
11
+ "regression",
12
+ "external",
13
+ "custom"
14
+ ]);
15
+ var ValidatorRegistration = Schema.Struct({
16
+ id: Schema.String,
17
+ category: ValidatorCategory,
18
+ description: Schema.optional(Schema.String)
19
+ });
20
+ var HookEvent = Schema.Literals([
21
+ "PreToolUse",
22
+ "PostToolUse",
23
+ "UserPromptSubmit",
24
+ "Stop",
25
+ "SessionStart",
26
+ "SessionEnd"
27
+ ]);
28
+ var HookMatcher = Schema.Union([
29
+ Schema.Struct({ kind: Schema.Literal("all") }),
30
+ Schema.Struct({ kind: Schema.Literal("tool"), name: Schema.String }),
31
+ Schema.Struct({ kind: Schema.Literal("glob"), pattern: Schema.String })
32
+ ]);
33
+ var HookRegistration = Schema.Struct({
34
+ id: Schema.String,
35
+ event: HookEvent,
36
+ matcher: HookMatcher,
37
+ command: Schema.optional(Schema.String),
38
+ description: Schema.optional(Schema.String)
39
+ });
40
+ var SkillRegistration = Schema.Struct({
41
+ id: Schema.String,
42
+ path: Schema.String,
43
+ description: Schema.optional(Schema.String)
44
+ });
45
+ var RepoSourceRegistration = Schema.Struct({
46
+ id: Schema.String,
47
+ url: Schema.String,
48
+ defaultPath: Schema.optional(Schema.String),
49
+ description: Schema.optional(Schema.String),
50
+ defaultBranch: Schema.optional(Schema.String),
51
+ remoteEnvVar: Schema.optional(Schema.String),
52
+ checkoutEnvVar: Schema.optional(Schema.String)
53
+ });
54
+ var AgentRoleRegistration = Schema.Struct({
55
+ id: Schema.String,
56
+ defaultModel: Schema.optional(Schema.String),
57
+ description: Schema.optional(Schema.String)
58
+ });
59
+ var TaskFieldExtension = Schema.Struct({
60
+ id: Schema.String,
61
+ fieldName: Schema.String,
62
+ schemaJson: Schema.String
63
+ });
64
+ var TaskSourceKind = Schema.String;
65
+ var TaskSourceRegistration = Schema.Struct({
66
+ id: Schema.String,
67
+ kind: Schema.String,
68
+ description: Schema.optional(Schema.String)
69
+ });
70
+ var CliCommandRegistration = Schema.Struct({
71
+ id: Schema.String,
72
+ command: Schema.String,
73
+ description: Schema.optional(Schema.String)
74
+ });
75
+ var PluginContributes = Schema.Struct({
76
+ validators: Schema.optional(Schema.Array(ValidatorRegistration)),
77
+ hooks: Schema.optional(Schema.Array(HookRegistration)),
78
+ skills: Schema.optional(Schema.Array(SkillRegistration)),
79
+ repoSources: Schema.optional(Schema.Array(RepoSourceRegistration)),
80
+ agentRoles: Schema.optional(Schema.Array(AgentRoleRegistration)),
81
+ taskFieldSchemas: Schema.optional(Schema.Array(TaskFieldExtension)),
82
+ taskSources: Schema.optional(Schema.Array(TaskSourceRegistration)),
83
+ cliCommands: Schema.optional(Schema.Array(CliCommandRegistration))
84
+ });
85
+ var RigPlugin = Schema.Struct({
86
+ name: Schema.String,
87
+ version: Schema.String,
88
+ contributes: Schema.optional(PluginContributes)
89
+ });
90
+
91
+ // packages/contracts/src/plugin-hooks.ts
92
+ var HookToolInput = Schema2.Record(Schema2.String, Schema2.Unknown);
93
+ var HookContext = Schema2.Struct({
94
+ event: HookEvent,
95
+ toolName: Schema2.optional(Schema2.String),
96
+ toolInput: HookToolInput,
97
+ filePaths: Schema2.Array(Schema2.String),
98
+ projectRoot: Schema2.String,
99
+ taskId: Schema2.String
100
+ });
101
+ var HookDecision = Schema2.Literals(["allow", "block"]);
102
+ var HookResult = Schema2.Struct({
103
+ decision: HookDecision,
104
+ reason: Schema2.optional(Schema2.String),
105
+ systemMessage: Schema2.optional(Schema2.String)
106
+ });
107
+ export {
108
+ HookToolInput,
109
+ HookResult,
110
+ HookDecision,
111
+ HookContext
112
+ };
@@ -0,0 +1,6 @@
1
+ // @bun
2
+ // packages/contracts/src/protocol-version.ts
3
+ var RIG_PROTOCOL_VERSION = 1;
4
+ export {
5
+ RIG_PROTOCOL_VERSION
6
+ };
@@ -972,12 +972,14 @@ var RunStatus = Schema5.Literals([
972
972
  "running",
973
973
  "waiting-approval",
974
974
  "waiting-user-input",
975
+ "paused",
975
976
  "validating",
976
977
  "reviewing",
978
+ "closing-out",
979
+ "needs-attention",
977
980
  "completed",
978
981
  "failed",
979
- "cancelled",
980
- "paused"
982
+ "stopped"
981
983
  ]);
982
984
  var EngineSandboxMode = Schema5.Literals([
983
985
  "read-only",
package/dist/src/rig.js CHANGED
@@ -1074,12 +1074,14 @@ var RunStatus = Schema9.Literals([
1074
1074
  "running",
1075
1075
  "waiting-approval",
1076
1076
  "waiting-user-input",
1077
+ "paused",
1077
1078
  "validating",
1078
1079
  "reviewing",
1080
+ "closing-out",
1081
+ "needs-attention",
1079
1082
  "completed",
1080
1083
  "failed",
1081
- "cancelled",
1082
- "paused"
1084
+ "stopped"
1083
1085
  ]);
1084
1086
  var EngineSandboxMode = Schema9.Literals([
1085
1087
  "read-only",
@@ -2211,12 +2213,14 @@ var RIG_WS_METHODS = {
2211
2213
  stopRun: "rig.stopRun",
2212
2214
  resolveApproval: "rig.resolveApproval",
2213
2215
  resolveUserInput: "rig.resolveUserInput",
2214
- getTaskArtifacts: "rig.getTaskArtifacts"
2216
+ getTaskArtifacts: "rig.getTaskArtifacts",
2217
+ ackRunSteering: "rig.ackRunSteering"
2215
2218
  };
2216
2219
  var RIG_WS_CHANNELS = {
2217
2220
  snapshotInvalidated: "rig.snapshotInvalidated",
2218
2221
  event: "rig.event",
2219
- runLogAppended: "rig.runLogAppended"
2222
+ runLogAppended: "rig.runLogAppended",
2223
+ runSteering: "rig.runSteering"
2220
2224
  };
2221
2225
  var RigSnapshotInvalidatedPayload = Schema14.Struct({
2222
2226
  sequence: NonNegativeInt,
@@ -2258,6 +2262,26 @@ var RigRunLogAppendedPayload = Schema14.Struct({
2258
2262
  runId: RunId,
2259
2263
  entry: RigRawRunLogEntry
2260
2264
  });
2265
+ var RigQueuedRunSteeringMessage = Schema14.Struct({
2266
+ id: TrimmedNonEmptyString,
2267
+ runId: RunId,
2268
+ message: TrimmedNonEmptyString,
2269
+ actor: TrimmedNonEmptyString,
2270
+ createdAt: IsoDateTime,
2271
+ delivered: Schema14.Boolean
2272
+ });
2273
+ var RigRunSteeringQueuedPayload = Schema14.Struct({
2274
+ runId: RunId,
2275
+ message: RigQueuedRunSteeringMessage
2276
+ });
2277
+ var RigAckRunSteeringInput = Schema14.Struct({
2278
+ runId: RunId,
2279
+ ids: Schema14.Array(TrimmedNonEmptyString)
2280
+ });
2281
+ var RigAckRunSteeringResult = Schema14.Struct({
2282
+ runId: RunId,
2283
+ delivered: Schema14.Array(TrimmedNonEmptyString)
2284
+ });
2261
2285
  var RigCreateAdhocRunInput = Schema14.Struct({
2262
2286
  commandId: CommandId,
2263
2287
  runId: RunId,
@@ -2347,6 +2371,7 @@ export {
2347
2371
  RigStopRunInput,
2348
2372
  RigSnapshotInvalidatedPayload,
2349
2373
  RigSnapshot,
2374
+ RigRunSteeringQueuedPayload,
2350
2375
  RigRunLogAppendedPayload,
2351
2376
  RigResumeRunInput,
2352
2377
  RigResolveUserInputInput,
@@ -2354,6 +2379,7 @@ export {
2354
2379
  RigReplayEventsResult,
2355
2380
  RigReplayEventsInput,
2356
2381
  RigRawRunLogEntry,
2382
+ RigQueuedRunSteeringMessage,
2357
2383
  RigMutationResult,
2358
2384
  RigListWorkspacesResult,
2359
2385
  RigListWorkspacesInput,
@@ -2369,6 +2395,8 @@ export {
2369
2395
  RigDeleteRunInput,
2370
2396
  RigCreateTaskRunInput,
2371
2397
  RigCreateAdhocRunInput,
2398
+ RigAckRunSteeringResult,
2399
+ RigAckRunSteeringInput,
2372
2400
  RIG_WS_METHODS,
2373
2401
  RIG_WS_CHANNELS
2374
2402
  };