@h-rig/contracts 0.0.6-alpha.16 → 0.0.6-alpha.161
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.
- package/dist/index.cjs +3280 -0
- package/dist/index.mjs +3239 -0
- package/dist/src/agent-roles.d.ts +8 -0
- package/dist/src/artifact.d.ts +13 -0
- package/dist/src/artifact.js +3 -0
- package/dist/src/baseSchemas.d.ts +63 -0
- package/dist/src/baseSchemas.js +6 -0
- package/dist/src/browser.d.ts +80 -0
- package/dist/src/browser.js +13 -0
- package/dist/src/capability-id.d.ts +22 -0
- package/dist/src/capability-id.js +8 -0
- package/dist/src/cli-output.d.ts +348 -0
- package/dist/src/cli-output.js +190 -0
- package/dist/src/cli-runner.d.ts +43 -0
- package/dist/src/cli-runner.js +13 -0
- package/dist/src/collab-session-viewer.d.ts +36 -0
- package/dist/src/collab-session-viewer.js +13 -0
- package/dist/src/config.d.ts +551 -0
- package/dist/src/config.js +765 -162
- package/dist/src/control-plane-types.d.ts +323 -0
- package/dist/src/control-plane-types.js +13 -0
- package/dist/src/conversation.d.ts +50 -0
- package/dist/src/conversation.js +3 -0
- package/dist/src/dependency-preflight.d.ts +43 -0
- package/dist/src/dependency-preflight.js +13 -0
- package/dist/src/doctor.d.ts +90 -0
- package/dist/src/doctor.js +13 -0
- package/dist/src/drift.d.ts +28 -0
- package/dist/src/drift.js +69 -0
- package/dist/src/editor.d.ts +25 -0
- package/dist/src/editor.js +3 -0
- package/dist/src/errors.d.ts +13 -0
- package/dist/src/errors.js +17 -0
- package/dist/src/git.d.ts +144 -0
- package/dist/src/git.js +3 -0
- package/dist/src/github.d.ts +146 -0
- package/dist/src/github.js +17 -0
- package/dist/src/graph.d.ts +360 -0
- package/dist/src/graph.js +137 -1
- package/dist/src/guard.d.ts +111 -0
- package/dist/src/guard.js +6 -0
- package/dist/src/harness-events.d.ts +8 -0
- package/dist/src/harness-events.js +1 -0
- package/dist/src/help-catalog.d.ts +41 -0
- package/dist/src/help-catalog.js +13 -0
- package/dist/src/host.d.ts +41 -0
- package/dist/src/host.js +13 -0
- package/dist/src/identity.d.ts +44 -0
- package/dist/src/identity.js +1 -0
- package/dist/src/index.d.ts +77 -0
- package/dist/src/index.js +2661 -3970
- package/dist/src/isolation.d.ts +213 -0
- package/dist/src/isolation.js +13 -0
- package/dist/src/kernel.d.ts +200 -0
- package/dist/src/kernel.js +261 -0
- package/dist/src/keybindings.d.ts +71 -0
- package/dist/src/keybindings.js +3 -0
- package/dist/src/layout.d.ts +49 -0
- package/dist/src/layout.js +10 -0
- package/dist/src/lifecycle-capabilities.d.ts +128 -0
- package/dist/src/lifecycle-capabilities.js +25 -0
- package/dist/src/managed-repos.d.ts +136 -0
- package/dist/src/managed-repos.js +17 -0
- package/dist/src/memory.d.ts +199 -0
- package/dist/src/memory.js +15 -0
- package/dist/src/model.d.ts +77 -0
- package/dist/src/notify.d.ts +46 -0
- package/dist/src/notify.js +13 -0
- package/dist/src/orchestration.d.ts +43 -0
- package/dist/src/orchestration.js +28 -961
- package/dist/src/panel-protocol.d.ts +17 -0
- package/dist/src/panel-protocol.js +10 -0
- package/dist/src/pi-session.d.ts +113 -0
- package/dist/src/pi-session.js +1 -0
- package/dist/src/planning.d.ts +64 -0
- package/dist/src/planning.js +90 -0
- package/dist/src/plugin-hooks.d.ts +51 -0
- package/dist/src/plugin-hooks.js +386 -0
- package/dist/src/plugin.d.ts +476 -0
- package/dist/src/plugin.js +346 -64
- package/dist/src/policy.d.ts +16 -0
- package/dist/src/policy.js +3 -0
- package/dist/src/project.d.ts +71 -0
- package/dist/src/project.js +3 -0
- package/dist/src/prompt.d.ts +29 -0
- package/dist/src/prompt.js +13 -0
- package/dist/src/protocol-version.d.ts +21 -0
- package/dist/src/protocol-version.js +6 -0
- package/dist/src/provider-instructions.d.ts +41 -0
- package/dist/src/provider-instructions.js +13 -0
- package/dist/src/provider.d.ts +105 -0
- package/dist/src/provider.js +4 -824
- package/dist/src/remote.d.ts +318 -0
- package/dist/src/remote.js +238 -1078
- package/dist/src/review.d.ts +18 -0
- package/dist/src/review.js +3 -0
- package/dist/src/rollups.d.ts +41 -0
- package/dist/src/rollups.js +70 -0
- package/dist/src/run-discovery.d.ts +79 -0
- package/dist/src/run-discovery.js +13 -0
- package/dist/src/run-dispatch.d.ts +34 -0
- package/dist/src/run-dispatch.js +13 -0
- package/dist/src/run-identity.d.ts +47 -0
- package/dist/src/run-identity.js +13 -0
- package/dist/src/run-journal.d.ts +694 -0
- package/dist/src/run-journal.js +569 -0
- package/dist/src/run-read-model.d.ts +234 -0
- package/dist/src/run-read-model.js +13 -0
- package/dist/src/run-record.d.ts +45 -0
- package/dist/src/run-record.js +1 -0
- package/dist/src/run-registry-backbone.d.ts +56 -0
- package/dist/src/run-registry-backbone.js +13 -0
- package/dist/src/run-session-journal.d.ts +69 -0
- package/dist/src/run-session-journal.js +78 -0
- package/dist/src/run-status.d.ts +10 -0
- package/dist/src/run-status.js +27 -0
- package/dist/src/run-timeline.d.ts +7 -0
- package/dist/src/run-timeline.js +1 -0
- package/dist/src/runtime-task-context.d.ts +82 -0
- package/dist/src/runtime-task-context.js +1 -0
- package/dist/src/runtime.d.ts +103 -0
- package/dist/src/runtime.js +73 -906
- package/dist/src/session-asset-materializer.d.ts +35 -0
- package/dist/src/session-asset-materializer.js +13 -0
- package/dist/src/setup.d.ts +47 -0
- package/dist/src/setup.js +13 -0
- package/dist/src/stage.d.ts +245 -0
- package/dist/src/stage.js +169 -0
- package/dist/src/supervisor-journal.d.ts +204 -0
- package/dist/src/supervisor-journal.js +334 -0
- package/dist/src/task-data.d.ts +239 -0
- package/dist/src/task-data.js +13 -0
- package/dist/src/task-graph-primitives.d.ts +47 -0
- package/dist/src/task-graph-primitives.js +1 -0
- package/dist/src/task-source.d.ts +102 -0
- package/dist/src/task-source.js +12 -0
- package/dist/src/task-state-metadata.d.ts +21 -0
- package/dist/src/task-state-metadata.js +1 -0
- package/dist/src/terminal.d.ts +130 -0
- package/dist/src/terminal.js +3 -0
- package/dist/src/tool-materializer.d.ts +36 -0
- package/dist/src/tool-materializer.js +13 -0
- package/dist/src/tool-registry.d.ts +3 -0
- package/dist/src/tool-registry.js +58 -0
- package/dist/src/toolchain-sources.d.ts +54 -0
- package/dist/src/toolchain-sources.js +17 -0
- package/dist/src/validation.d.ts +14 -0
- package/dist/src/validation.js +3 -0
- package/dist/src/workflow-journal.d.ts +92 -0
- package/dist/src/workflow-journal.js +18 -0
- package/dist/src/workspace-config.d.ts +18 -0
- package/dist/src/workspace-config.js +13 -0
- package/dist/src/workspace.d.ts +204 -0
- package/dist/src/workspace.js +76 -911
- package/package.json +51 -4
- package/dist/src/engine.js +0 -2278
- package/dist/src/providerRuntime.js +0 -1630
- package/dist/src/rig.js +0 -2374
- package/dist/src/server.js +0 -1053
- package/dist/src/serviceFabric.js +0 -1066
- package/dist/src/ws.js +0 -2968
- /package/dist/src/{ipc.js → agent-roles.js} +0 -0
package/dist/src/plugin.js
CHANGED
|
@@ -1,7 +1,230 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// packages/contracts/src/plugin.ts
|
|
3
|
+
import { Schema as Schema4 } from "effect";
|
|
4
|
+
|
|
5
|
+
// packages/contracts/src/kernel.ts
|
|
6
|
+
import { Schema as Schema3 } from "effect";
|
|
7
|
+
|
|
8
|
+
// packages/contracts/src/baseSchemas.ts
|
|
3
9
|
import { Schema } from "effect";
|
|
4
|
-
var
|
|
10
|
+
var TrimmedString = Schema.Trim;
|
|
11
|
+
var TrimmedNonEmptyString = TrimmedString.check(Schema.isNonEmpty());
|
|
12
|
+
var NonNegativeInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
|
|
13
|
+
var PositiveInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1));
|
|
14
|
+
var IsoDateTime = Schema.String;
|
|
15
|
+
var makeEntityId = (brand) => TrimmedNonEmptyString.pipe(Schema.brand(brand));
|
|
16
|
+
var ThreadId = makeEntityId("ThreadId");
|
|
17
|
+
var ProjectId = makeEntityId("ProjectId");
|
|
18
|
+
var WorkspaceId = makeEntityId("WorkspaceId");
|
|
19
|
+
var GraphId = makeEntityId("GraphId");
|
|
20
|
+
var TaskId = makeEntityId("TaskId");
|
|
21
|
+
var RunId = makeEntityId("RunId");
|
|
22
|
+
var SafePathSegment = TrimmedNonEmptyString.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)).pipe(Schema.brand("SafePathSegment"));
|
|
23
|
+
var SafeRunId = TrimmedNonEmptyString.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/)).pipe(Schema.brand("SafeRunId"));
|
|
24
|
+
var SafeGitRefComponent = TrimmedNonEmptyString.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)).pipe(Schema.brand("SafeGitRefComponent"));
|
|
25
|
+
var EngineRuntimeId = makeEntityId("EngineRuntimeId");
|
|
26
|
+
var ConversationId = makeEntityId("ConversationId");
|
|
27
|
+
var ActionId = makeEntityId("ActionId");
|
|
28
|
+
var ArtifactId = makeEntityId("ArtifactId");
|
|
29
|
+
var WorktreeId = makeEntityId("WorktreeId");
|
|
30
|
+
var ValidationResultId = makeEntityId("ValidationResultId");
|
|
31
|
+
var ReviewResultId = makeEntityId("ReviewResultId");
|
|
32
|
+
var CommandId = makeEntityId("CommandId");
|
|
33
|
+
var EventId = makeEntityId("EventId");
|
|
34
|
+
var MessageId = makeEntityId("MessageId");
|
|
35
|
+
var TurnId = makeEntityId("TurnId");
|
|
36
|
+
var ProviderItemId = makeEntityId("ProviderItemId");
|
|
37
|
+
var RuntimeSessionId = makeEntityId("RuntimeSessionId");
|
|
38
|
+
var RuntimeItemId = makeEntityId("RuntimeItemId");
|
|
39
|
+
var RuntimeRequestId = makeEntityId("RuntimeRequestId");
|
|
40
|
+
var RuntimeTaskId = makeEntityId("RuntimeTaskId");
|
|
41
|
+
var ApprovalRequestId = makeEntityId("ApprovalRequestId");
|
|
42
|
+
var CheckpointRef = makeEntityId("CheckpointRef");
|
|
43
|
+
var RemoteEndpointId = makeEntityId("RemoteEndpointId");
|
|
44
|
+
|
|
45
|
+
// packages/contracts/src/capability-id.ts
|
|
46
|
+
function makeCapabilityId(id) {
|
|
47
|
+
return id;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// packages/contracts/src/stage.ts
|
|
51
|
+
import { Schema as Schema2 } from "effect";
|
|
52
|
+
var StageKind = Schema2.Literals(["transform", "gate", "observe"]);
|
|
53
|
+
var StageId = TrimmedNonEmptyString.pipe(Schema2.brand("StageId"));
|
|
54
|
+
var StageContext = Schema2.Struct({
|
|
55
|
+
runId: RunId,
|
|
56
|
+
taskId: Schema2.optional(Schema2.NullOr(TaskId)),
|
|
57
|
+
state: Schema2.Unknown,
|
|
58
|
+
metadata: Schema2.optional(Schema2.Record(Schema2.String, Schema2.Unknown))
|
|
59
|
+
});
|
|
60
|
+
var StageDescriptor = Schema2.Struct({
|
|
61
|
+
id: StageId,
|
|
62
|
+
kind: StageKind,
|
|
63
|
+
before: Schema2.optional(Schema2.Array(StageId)),
|
|
64
|
+
after: Schema2.optional(Schema2.Array(StageId)),
|
|
65
|
+
priority: Schema2.Number.pipe(Schema2.withDecodingDefault(() => 0)),
|
|
66
|
+
protected: Schema2.Boolean.pipe(Schema2.withDecodingDefault(() => false))
|
|
67
|
+
});
|
|
68
|
+
var Stage = StageDescriptor;
|
|
69
|
+
var StageContinueResult = Schema2.Struct({
|
|
70
|
+
kind: Schema2.Literal("continue"),
|
|
71
|
+
ctx: StageContext
|
|
72
|
+
});
|
|
73
|
+
var StageAllowResult = Schema2.Struct({
|
|
74
|
+
kind: Schema2.Literal("allow")
|
|
75
|
+
});
|
|
76
|
+
var StageBlockResult = Schema2.Struct({
|
|
77
|
+
kind: Schema2.Literal("block"),
|
|
78
|
+
reason: TrimmedNonEmptyString
|
|
79
|
+
});
|
|
80
|
+
var StageResult = Schema2.Union([
|
|
81
|
+
StageContinueResult,
|
|
82
|
+
StageAllowResult,
|
|
83
|
+
StageBlockResult
|
|
84
|
+
]);
|
|
85
|
+
var StageWrapperDescriptor = Schema2.Struct({
|
|
86
|
+
id: TrimmedNonEmptyString,
|
|
87
|
+
priority: Schema2.Number.pipe(Schema2.withDecodingDefault(() => 0))
|
|
88
|
+
});
|
|
89
|
+
var StageMutationOp = Schema2.Literals(["insert", "remove", "replace", "wrap", "reorder"]);
|
|
90
|
+
var InsertStageMutation = Schema2.Struct({
|
|
91
|
+
op: Schema2.Literal("insert"),
|
|
92
|
+
stage: StageDescriptor,
|
|
93
|
+
contributedBy: Schema2.optional(TrimmedNonEmptyString)
|
|
94
|
+
});
|
|
95
|
+
var RemoveStageMutation = Schema2.Struct({
|
|
96
|
+
op: Schema2.Literal("remove"),
|
|
97
|
+
id: StageId,
|
|
98
|
+
contributedBy: Schema2.optional(TrimmedNonEmptyString)
|
|
99
|
+
});
|
|
100
|
+
var ReplaceStageMutation = Schema2.Struct({
|
|
101
|
+
op: Schema2.Literal("replace"),
|
|
102
|
+
id: StageId,
|
|
103
|
+
stage: StageDescriptor,
|
|
104
|
+
contributedBy: Schema2.optional(TrimmedNonEmptyString)
|
|
105
|
+
});
|
|
106
|
+
var WrapStageMutation = Schema2.Struct({
|
|
107
|
+
op: Schema2.Literal("wrap"),
|
|
108
|
+
id: StageId,
|
|
109
|
+
around: StageWrapperDescriptor,
|
|
110
|
+
contributedBy: Schema2.optional(TrimmedNonEmptyString)
|
|
111
|
+
});
|
|
112
|
+
var ReorderStageMutation = Schema2.Struct({
|
|
113
|
+
op: Schema2.Literal("reorder"),
|
|
114
|
+
id: StageId,
|
|
115
|
+
before: Schema2.optional(Schema2.Array(StageId)),
|
|
116
|
+
after: Schema2.optional(Schema2.Array(StageId)),
|
|
117
|
+
contributedBy: Schema2.optional(TrimmedNonEmptyString)
|
|
118
|
+
});
|
|
119
|
+
var StageMutation = Schema2.Union([
|
|
120
|
+
InsertStageMutation,
|
|
121
|
+
RemoveStageMutation,
|
|
122
|
+
ReplaceStageMutation,
|
|
123
|
+
WrapStageMutation,
|
|
124
|
+
ReorderStageMutation
|
|
125
|
+
]);
|
|
126
|
+
var ResolutionGrantUse = Schema2.Struct({
|
|
127
|
+
kind: Schema2.Literal("kernel-replacement"),
|
|
128
|
+
target: TrimmedNonEmptyString,
|
|
129
|
+
pluginId: TrimmedNonEmptyString
|
|
130
|
+
});
|
|
131
|
+
var ResolutionRecordEntry = Schema2.Struct({
|
|
132
|
+
stageId: StageId,
|
|
133
|
+
contributedBy: TrimmedNonEmptyString,
|
|
134
|
+
removedBy: Schema2.optional(TrimmedNonEmptyString),
|
|
135
|
+
replacedBy: Schema2.optional(TrimmedNonEmptyString),
|
|
136
|
+
wrappedBy: Schema2.optional(Schema2.Array(TrimmedNonEmptyString)),
|
|
137
|
+
droppedAnchors: Schema2.optional(Schema2.Array(StageId)),
|
|
138
|
+
isProtected: Schema2.Boolean
|
|
139
|
+
});
|
|
140
|
+
var ResolvedPipeline = Schema2.Struct({
|
|
141
|
+
runId: Schema2.optional(RunId),
|
|
142
|
+
order: Schema2.Array(StageId),
|
|
143
|
+
record: Schema2.Array(ResolutionRecordEntry),
|
|
144
|
+
cycles: Schema2.Array(Schema2.Array(StageId)),
|
|
145
|
+
grantUses: Schema2.optional(Schema2.Array(ResolutionGrantUse)),
|
|
146
|
+
resolvedAt: Schema2.optional(IsoDateTime)
|
|
147
|
+
});
|
|
148
|
+
var StageRunOutcome = Schema2.Struct({
|
|
149
|
+
stageId: StageId,
|
|
150
|
+
result: StageResult,
|
|
151
|
+
startedAt: IsoDateTime,
|
|
152
|
+
finishedAt: IsoDateTime
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
// packages/contracts/src/kernel.ts
|
|
156
|
+
var CapabilityTag = Schema3.Literals([
|
|
157
|
+
"kernel",
|
|
158
|
+
"journal",
|
|
159
|
+
"stage-runner",
|
|
160
|
+
"transport",
|
|
161
|
+
"loader-policy"
|
|
162
|
+
]);
|
|
163
|
+
var CapabilityProviderRef = Schema3.Struct({
|
|
164
|
+
capability: CapabilityTag,
|
|
165
|
+
pluginId: TrimmedNonEmptyString
|
|
166
|
+
});
|
|
167
|
+
var CapabilityReplacement = Schema3.Struct({
|
|
168
|
+
capability: CapabilityTag,
|
|
169
|
+
providerPluginId: TrimmedNonEmptyString
|
|
170
|
+
});
|
|
171
|
+
var CapabilityReplacementSpec = Schema3.Union([
|
|
172
|
+
CapabilityReplacement,
|
|
173
|
+
TrimmedNonEmptyString
|
|
174
|
+
]);
|
|
175
|
+
var KernelReplacementGrant = Schema3.Struct({
|
|
176
|
+
pluginId: TrimmedNonEmptyString,
|
|
177
|
+
grantedBy: Schema3.optional(TrimmedNonEmptyString),
|
|
178
|
+
reason: Schema3.optional(Schema3.String)
|
|
179
|
+
});
|
|
180
|
+
var CapabilityGrants = Schema3.Struct({
|
|
181
|
+
capabilityPrecedence: Schema3.optional(Schema3.Record(Schema3.String, Schema3.Array(TrimmedNonEmptyString))),
|
|
182
|
+
kernelReplacementGrants: Schema3.optional(Schema3.Array(KernelReplacementGrant))
|
|
183
|
+
});
|
|
184
|
+
var KernelBootErrorCode = Schema3.Literals([
|
|
185
|
+
"BootIncoherent",
|
|
186
|
+
"AmbiguousCapability",
|
|
187
|
+
"MissingCapability",
|
|
188
|
+
"KernelReplacementDenied",
|
|
189
|
+
"PipelineUnresolvable"
|
|
190
|
+
]);
|
|
191
|
+
var KernelBootError = Schema3.Struct({
|
|
192
|
+
code: KernelBootErrorCode,
|
|
193
|
+
message: TrimmedNonEmptyString,
|
|
194
|
+
capability: Schema3.optional(CapabilityTag),
|
|
195
|
+
stageId: Schema3.optional(TrimmedNonEmptyString),
|
|
196
|
+
pluginIds: Schema3.optional(Schema3.Array(TrimmedNonEmptyString))
|
|
197
|
+
});
|
|
198
|
+
var CapabilityResolutionStatus = Schema3.Literals(["resolved", "ambiguous", "missing", "replaced"]);
|
|
199
|
+
var CapabilityResolutionRecord = Schema3.Struct({
|
|
200
|
+
capability: CapabilityTag,
|
|
201
|
+
status: CapabilityResolutionStatus,
|
|
202
|
+
selectedPluginId: Schema3.NullOr(TrimmedNonEmptyString),
|
|
203
|
+
candidatePluginIds: Schema3.Array(TrimmedNonEmptyString),
|
|
204
|
+
precedenceUsed: Schema3.Boolean,
|
|
205
|
+
replacementUsed: Schema3.optional(CapabilityReplacement),
|
|
206
|
+
error: Schema3.optional(Schema3.String)
|
|
207
|
+
});
|
|
208
|
+
var KernelResolutionRecord = Schema3.Struct({
|
|
209
|
+
resolvedAt: IsoDateTime,
|
|
210
|
+
capabilities: Schema3.Array(CapabilityResolutionRecord),
|
|
211
|
+
pipeline: Schema3.optional(ResolvedPipeline)
|
|
212
|
+
});
|
|
213
|
+
var BootResultDescriptor = Schema3.Struct({
|
|
214
|
+
kernelPluginId: TrimmedNonEmptyString,
|
|
215
|
+
pluginIds: Schema3.Array(TrimmedNonEmptyString),
|
|
216
|
+
resolution: KernelResolutionRecord
|
|
217
|
+
});
|
|
218
|
+
var JournalEvent = Schema3.Struct({
|
|
219
|
+
type: TrimmedNonEmptyString,
|
|
220
|
+
runId: Schema3.optional(RunId),
|
|
221
|
+
at: IsoDateTime,
|
|
222
|
+
payload: Schema3.Unknown
|
|
223
|
+
});
|
|
224
|
+
var PLACEMENT_RUN_TRANSPORT = makeCapabilityId("transport.placement-run");
|
|
225
|
+
|
|
226
|
+
// packages/contracts/src/plugin.ts
|
|
227
|
+
var ValidatorCategory = Schema4.Literals([
|
|
5
228
|
"boundary",
|
|
6
229
|
"contract",
|
|
7
230
|
"integration",
|
|
@@ -9,12 +232,12 @@ var ValidatorCategory = Schema.Literals([
|
|
|
9
232
|
"external",
|
|
10
233
|
"custom"
|
|
11
234
|
]);
|
|
12
|
-
var ValidatorRegistration =
|
|
13
|
-
id:
|
|
235
|
+
var ValidatorRegistration = Schema4.Struct({
|
|
236
|
+
id: Schema4.String,
|
|
14
237
|
category: ValidatorCategory,
|
|
15
|
-
description:
|
|
238
|
+
description: Schema4.optional(Schema4.String)
|
|
16
239
|
});
|
|
17
|
-
var
|
|
240
|
+
var AgentSessionHookEvent = Schema4.Literals([
|
|
18
241
|
"PreToolUse",
|
|
19
242
|
"PostToolUse",
|
|
20
243
|
"UserPromptSubmit",
|
|
@@ -22,67 +245,119 @@ var HookEvent = Schema.Literals([
|
|
|
22
245
|
"SessionStart",
|
|
23
246
|
"SessionEnd"
|
|
24
247
|
]);
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
248
|
+
var HookEvent = AgentSessionHookEvent;
|
|
249
|
+
var HookMatcher = Schema4.Union([
|
|
250
|
+
Schema4.Struct({ kind: Schema4.Literal("all") }),
|
|
251
|
+
Schema4.Struct({ kind: Schema4.Literal("tool"), name: Schema4.String }),
|
|
252
|
+
Schema4.Struct({ kind: Schema4.Literal("glob"), pattern: Schema4.String })
|
|
29
253
|
]);
|
|
30
|
-
var HookRegistration =
|
|
31
|
-
id:
|
|
32
|
-
event:
|
|
254
|
+
var HookRegistration = Schema4.Struct({
|
|
255
|
+
id: Schema4.String,
|
|
256
|
+
event: AgentSessionHookEvent,
|
|
33
257
|
matcher: HookMatcher,
|
|
34
|
-
command:
|
|
35
|
-
description:
|
|
36
|
-
});
|
|
37
|
-
var SkillRegistration =
|
|
38
|
-
id:
|
|
39
|
-
path:
|
|
40
|
-
description:
|
|
41
|
-
});
|
|
42
|
-
var RepoSourceRegistration =
|
|
43
|
-
id:
|
|
44
|
-
url:
|
|
45
|
-
defaultPath:
|
|
46
|
-
description:
|
|
47
|
-
defaultBranch:
|
|
48
|
-
remoteEnvVar:
|
|
49
|
-
checkoutEnvVar:
|
|
50
|
-
});
|
|
51
|
-
var AgentRoleRegistration =
|
|
52
|
-
id:
|
|
53
|
-
defaultModel:
|
|
54
|
-
description:
|
|
55
|
-
});
|
|
56
|
-
var TaskFieldExtension =
|
|
57
|
-
id:
|
|
58
|
-
fieldName:
|
|
59
|
-
schemaJson:
|
|
60
|
-
});
|
|
61
|
-
var TaskSourceKind =
|
|
62
|
-
var TaskSourceRegistration =
|
|
63
|
-
id:
|
|
64
|
-
kind:
|
|
65
|
-
description:
|
|
66
|
-
});
|
|
67
|
-
var CliCommandRegistration =
|
|
68
|
-
id:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
258
|
+
command: Schema4.optional(Schema4.String),
|
|
259
|
+
description: Schema4.optional(Schema4.String)
|
|
260
|
+
});
|
|
261
|
+
var SkillRegistration = Schema4.Struct({
|
|
262
|
+
id: Schema4.String,
|
|
263
|
+
path: Schema4.String,
|
|
264
|
+
description: Schema4.optional(Schema4.String)
|
|
265
|
+
});
|
|
266
|
+
var RepoSourceRegistration = Schema4.Struct({
|
|
267
|
+
id: Schema4.String,
|
|
268
|
+
url: Schema4.String,
|
|
269
|
+
defaultPath: Schema4.optional(Schema4.String),
|
|
270
|
+
description: Schema4.optional(Schema4.String),
|
|
271
|
+
defaultBranch: Schema4.optional(Schema4.String),
|
|
272
|
+
remoteEnvVar: Schema4.optional(Schema4.String),
|
|
273
|
+
checkoutEnvVar: Schema4.optional(Schema4.String)
|
|
274
|
+
});
|
|
275
|
+
var AgentRoleRegistration = Schema4.Struct({
|
|
276
|
+
id: Schema4.String,
|
|
277
|
+
defaultModel: Schema4.optional(Schema4.String),
|
|
278
|
+
description: Schema4.optional(Schema4.String)
|
|
279
|
+
});
|
|
280
|
+
var TaskFieldExtension = Schema4.Struct({
|
|
281
|
+
id: Schema4.String,
|
|
282
|
+
fieldName: Schema4.String,
|
|
283
|
+
schemaJson: Schema4.String
|
|
284
|
+
});
|
|
285
|
+
var TaskSourceKind = Schema4.String;
|
|
286
|
+
var TaskSourceRegistration = Schema4.Struct({
|
|
287
|
+
id: Schema4.String,
|
|
288
|
+
kind: Schema4.String,
|
|
289
|
+
description: Schema4.optional(Schema4.String)
|
|
290
|
+
});
|
|
291
|
+
var CliCommandRegistration = Schema4.Struct({
|
|
292
|
+
id: Schema4.String,
|
|
293
|
+
family: Schema4.optional(Schema4.String),
|
|
294
|
+
command: Schema4.optional(Schema4.String),
|
|
295
|
+
description: Schema4.optional(Schema4.String),
|
|
296
|
+
usage: Schema4.optional(Schema4.String),
|
|
297
|
+
aliases: Schema4.optional(Schema4.Array(Schema4.String)),
|
|
298
|
+
projectRequired: Schema4.optional(Schema4.Boolean),
|
|
299
|
+
rootDefault: Schema4.optional(Schema4.Boolean),
|
|
300
|
+
productRoot: Schema4.optional(Schema4.Boolean),
|
|
301
|
+
subcommands: Schema4.optional(Schema4.Array(Schema4.String))
|
|
302
|
+
});
|
|
303
|
+
var CapabilityRunSchema = Schema4.declare((u) => typeof u === "function", { identifier: "CapabilityRun" });
|
|
304
|
+
var ProductCapabilityRegistration = Schema4.Struct({
|
|
305
|
+
id: Schema4.String,
|
|
306
|
+
title: Schema4.String,
|
|
307
|
+
description: Schema4.optional(Schema4.String),
|
|
308
|
+
commandId: Schema4.optional(Schema4.String),
|
|
309
|
+
panelId: Schema4.optional(Schema4.String),
|
|
310
|
+
run: Schema4.optional(CapabilityRunSchema)
|
|
311
|
+
});
|
|
312
|
+
var PanelRegistration = Schema4.Struct({
|
|
313
|
+
id: Schema4.String,
|
|
314
|
+
slot: Schema4.String,
|
|
315
|
+
title: Schema4.String,
|
|
316
|
+
capabilityId: Schema4.optional(Schema4.String),
|
|
317
|
+
badge: Schema4.optional(Schema4.String),
|
|
318
|
+
disabled: Schema4.optional(Schema4.Boolean),
|
|
319
|
+
description: Schema4.optional(Schema4.String)
|
|
320
|
+
});
|
|
321
|
+
var BlockerClassifierRegistration = Schema4.Struct({
|
|
322
|
+
id: Schema4.String,
|
|
323
|
+
description: Schema4.optional(Schema4.String),
|
|
324
|
+
priority: Schema4.optional(Schema4.Number)
|
|
325
|
+
});
|
|
326
|
+
var SessionExtensionRegistration = Schema4.Struct({
|
|
327
|
+
id: Schema4.String,
|
|
328
|
+
description: Schema4.optional(Schema4.String)
|
|
329
|
+
});
|
|
330
|
+
var SeedEntrypointRegistration = Schema4.Struct({
|
|
331
|
+
id: Schema4.String,
|
|
332
|
+
description: Schema4.optional(Schema4.String),
|
|
333
|
+
basename: Schema4.optional(Schema4.String),
|
|
334
|
+
workerArg: Schema4.optional(Schema4.String),
|
|
335
|
+
insidePty: Schema4.optional(Schema4.Boolean)
|
|
336
|
+
});
|
|
337
|
+
var PluginContributes = Schema4.Struct({
|
|
338
|
+
validators: Schema4.optional(Schema4.Array(ValidatorRegistration)),
|
|
339
|
+
hooks: Schema4.optional(Schema4.Array(HookRegistration)),
|
|
340
|
+
skills: Schema4.optional(Schema4.Array(SkillRegistration)),
|
|
341
|
+
repoSources: Schema4.optional(Schema4.Array(RepoSourceRegistration)),
|
|
342
|
+
agentRoles: Schema4.optional(Schema4.Array(AgentRoleRegistration)),
|
|
343
|
+
taskFieldSchemas: Schema4.optional(Schema4.Array(TaskFieldExtension)),
|
|
344
|
+
taskSources: Schema4.optional(Schema4.Array(TaskSourceRegistration)),
|
|
345
|
+
cliCommands: Schema4.optional(Schema4.Array(CliCommandRegistration)),
|
|
346
|
+
stages: Schema4.optional(Schema4.Array(Stage)),
|
|
347
|
+
stageMutations: Schema4.optional(Schema4.Array(StageMutation)),
|
|
348
|
+
capabilities: Schema4.optional(Schema4.Array(ProductCapabilityRegistration)),
|
|
349
|
+
panels: Schema4.optional(Schema4.Array(PanelRegistration)),
|
|
350
|
+
blockerClassifiers: Schema4.optional(Schema4.Array(BlockerClassifierRegistration)),
|
|
351
|
+
sessionExtensions: Schema4.optional(Schema4.Array(SessionExtensionRegistration)),
|
|
352
|
+
seedEntrypoints: Schema4.optional(Schema4.Array(SeedEntrypointRegistration))
|
|
353
|
+
});
|
|
354
|
+
var RigPlugin = Schema4.Struct({
|
|
355
|
+
name: Schema4.String,
|
|
356
|
+
version: Schema4.String,
|
|
357
|
+
provides: Schema4.optional(Schema4.Array(CapabilityTag)),
|
|
358
|
+
requires: Schema4.optional(Schema4.Array(CapabilityTag)),
|
|
359
|
+
replaces: Schema4.optional(Schema4.Array(CapabilityReplacementSpec)),
|
|
360
|
+
contributes: Schema4.optional(PluginContributes)
|
|
86
361
|
});
|
|
87
362
|
export {
|
|
88
363
|
ValidatorRegistration,
|
|
@@ -91,12 +366,19 @@ export {
|
|
|
91
366
|
TaskSourceKind,
|
|
92
367
|
TaskFieldExtension,
|
|
93
368
|
SkillRegistration,
|
|
369
|
+
SessionExtensionRegistration,
|
|
370
|
+
SeedEntrypointRegistration,
|
|
94
371
|
RigPlugin,
|
|
95
372
|
RepoSourceRegistration,
|
|
373
|
+
ProductCapabilityRegistration,
|
|
96
374
|
PluginContributes,
|
|
375
|
+
PanelRegistration,
|
|
97
376
|
HookRegistration,
|
|
98
377
|
HookMatcher,
|
|
99
378
|
HookEvent,
|
|
100
379
|
CliCommandRegistration,
|
|
380
|
+
CapabilityRunSchema,
|
|
381
|
+
BlockerClassifierRegistration,
|
|
382
|
+
AgentSessionHookEvent,
|
|
101
383
|
AgentRoleRegistration
|
|
102
384
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const PolicyDecision: Schema.Literals<readonly ["allow", "warn", "block"]>;
|
|
3
|
+
export type PolicyDecision = typeof PolicyDecision.Type;
|
|
4
|
+
export declare const PolicyMode: Schema.Literals<readonly ["off", "observe", "enforce"]>;
|
|
5
|
+
export type PolicyMode = typeof PolicyMode.Type;
|
|
6
|
+
export declare const PolicyDecisionSummary: Schema.Struct<{
|
|
7
|
+
readonly id: Schema.Trim;
|
|
8
|
+
readonly runId: Schema.brand<Schema.Trim, "RunId">;
|
|
9
|
+
readonly actionId: Schema.NullOr<Schema.brand<Schema.Trim, "ActionId">>;
|
|
10
|
+
readonly decision: Schema.Literals<readonly ["allow", "warn", "block"]>;
|
|
11
|
+
readonly mode: Schema.Literals<readonly ["off", "observe", "enforce"]>;
|
|
12
|
+
readonly matchedRules: Schema.$Array<Schema.Trim>;
|
|
13
|
+
readonly reason: Schema.String;
|
|
14
|
+
readonly createdAt: Schema.String;
|
|
15
|
+
}>;
|
|
16
|
+
export type PolicyDecisionSummary = typeof PolicyDecisionSummary.Type;
|
package/dist/src/policy.js
CHANGED
|
@@ -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,71 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const ProjectSearchEntriesInput: Schema.Struct<{
|
|
3
|
+
readonly cwd: Schema.Trim;
|
|
4
|
+
readonly query: Schema.Trim;
|
|
5
|
+
readonly limit: Schema.Int;
|
|
6
|
+
}>;
|
|
7
|
+
export type ProjectSearchEntriesInput = typeof ProjectSearchEntriesInput.Type;
|
|
8
|
+
export declare const ProjectEntry: Schema.Struct<{
|
|
9
|
+
readonly path: Schema.Trim;
|
|
10
|
+
readonly kind: Schema.Literals<readonly ["file", "directory"]>;
|
|
11
|
+
readonly parentPath: Schema.optional<Schema.Trim>;
|
|
12
|
+
}>;
|
|
13
|
+
export type ProjectEntry = typeof ProjectEntry.Type;
|
|
14
|
+
export declare const ProjectSearchEntriesResult: Schema.Struct<{
|
|
15
|
+
readonly entries: Schema.$Array<Schema.Struct<{
|
|
16
|
+
readonly path: Schema.Trim;
|
|
17
|
+
readonly kind: Schema.Literals<readonly ["file", "directory"]>;
|
|
18
|
+
readonly parentPath: Schema.optional<Schema.Trim>;
|
|
19
|
+
}>>;
|
|
20
|
+
readonly truncated: Schema.Boolean;
|
|
21
|
+
}>;
|
|
22
|
+
export type ProjectSearchEntriesResult = typeof ProjectSearchEntriesResult.Type;
|
|
23
|
+
export declare const ProjectListDirectoryInput: Schema.Struct<{
|
|
24
|
+
readonly cwd: Schema.Trim;
|
|
25
|
+
readonly relativePath: Schema.Trim;
|
|
26
|
+
readonly limit: Schema.Int;
|
|
27
|
+
}>;
|
|
28
|
+
export type ProjectListDirectoryInput = typeof ProjectListDirectoryInput.Type;
|
|
29
|
+
export declare const ProjectDirectoryEntry: Schema.Struct<{
|
|
30
|
+
readonly name: Schema.Trim;
|
|
31
|
+
readonly relativePath: Schema.Trim;
|
|
32
|
+
readonly kind: Schema.Literals<readonly ["file", "directory"]>;
|
|
33
|
+
readonly sizeBytes: Schema.optional<Schema.Int>;
|
|
34
|
+
readonly modifiedAt: Schema.optional<Schema.String>;
|
|
35
|
+
}>;
|
|
36
|
+
export type ProjectDirectoryEntry = typeof ProjectDirectoryEntry.Type;
|
|
37
|
+
export declare const ProjectListDirectoryResult: Schema.Struct<{
|
|
38
|
+
readonly entries: Schema.$Array<Schema.Struct<{
|
|
39
|
+
readonly name: Schema.Trim;
|
|
40
|
+
readonly relativePath: Schema.Trim;
|
|
41
|
+
readonly kind: Schema.Literals<readonly ["file", "directory"]>;
|
|
42
|
+
readonly sizeBytes: Schema.optional<Schema.Int>;
|
|
43
|
+
readonly modifiedAt: Schema.optional<Schema.String>;
|
|
44
|
+
}>>;
|
|
45
|
+
readonly truncated: Schema.Boolean;
|
|
46
|
+
}>;
|
|
47
|
+
export type ProjectListDirectoryResult = typeof ProjectListDirectoryResult.Type;
|
|
48
|
+
export declare const ProjectWriteFileInput: Schema.Struct<{
|
|
49
|
+
readonly cwd: Schema.Trim;
|
|
50
|
+
readonly relativePath: Schema.Trim;
|
|
51
|
+
readonly contents: Schema.String;
|
|
52
|
+
}>;
|
|
53
|
+
export type ProjectWriteFileInput = typeof ProjectWriteFileInput.Type;
|
|
54
|
+
export declare const ProjectWriteFileResult: Schema.Struct<{
|
|
55
|
+
readonly relativePath: Schema.Trim;
|
|
56
|
+
}>;
|
|
57
|
+
export type ProjectWriteFileResult = typeof ProjectWriteFileResult.Type;
|
|
58
|
+
export declare const ProjectReadFileInput: Schema.Struct<{
|
|
59
|
+
readonly cwd: Schema.Trim;
|
|
60
|
+
readonly relativePath: Schema.Trim;
|
|
61
|
+
}>;
|
|
62
|
+
export type ProjectReadFileInput = typeof ProjectReadFileInput.Type;
|
|
63
|
+
export declare const ProjectReadFileResult: Schema.Struct<{
|
|
64
|
+
readonly relativePath: Schema.Trim;
|
|
65
|
+
readonly contents: Schema.String;
|
|
66
|
+
readonly truncated: Schema.Boolean;
|
|
67
|
+
readonly sizeBytes: Schema.Int;
|
|
68
|
+
readonly maxBytes: Schema.Int;
|
|
69
|
+
}>;
|
|
70
|
+
export type ProjectReadFileResult = typeof ProjectReadFileResult.Type;
|
|
71
|
+
export declare const PROJECT_READ_FILE_MAX_BYTES_VALUE: number;
|
package/dist/src/project.js
CHANGED
|
@@ -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,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* prompt.ts — pure capability vocabulary for agent prompt assembly.
|
|
3
|
+
*
|
|
4
|
+
* Moved here from `@rig/prompt-plugin` (where it was defined locally): the FLOOR
|
|
5
|
+
* cannot resolve a capability whose id/input type only exist inside a plugin
|
|
6
|
+
* without importing the plugin. The plugin OWNS the impl
|
|
7
|
+
* (`readPriorPrProgressPromptSection`, lazy-loaded inside `run()`) and registers
|
|
8
|
+
* it under this id; consumers resolve it off the host. Types only here.
|
|
9
|
+
*/
|
|
10
|
+
import type { CapabilityId } from "./capability-id";
|
|
11
|
+
/**
|
|
12
|
+
* Capability id: agent prompt assembly — the prior-progress section of what the
|
|
13
|
+
* agent is told for a re-dispatched task.
|
|
14
|
+
*/
|
|
15
|
+
export declare const PRIOR_PROGRESS_PROMPT_CAPABILITY_ID = "prompt.prior-progress";
|
|
16
|
+
/** Pure input: which workspace + task to assemble the prior-progress section for. */
|
|
17
|
+
export type PriorProgressPromptInput = {
|
|
18
|
+
readonly projectRoot: string;
|
|
19
|
+
readonly taskId: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The cohesive prompt-assembly operation: returns the prior-PR-progress prompt
|
|
23
|
+
* section, or null when there is no prior progress. Async (reads fs).
|
|
24
|
+
*/
|
|
25
|
+
export interface PriorProgressPromptService {
|
|
26
|
+
readPriorProgressSection(input: PriorProgressPromptInput): Promise<string | null>;
|
|
27
|
+
}
|
|
28
|
+
/** Typed capability id; string value is {@link PRIOR_PROGRESS_PROMPT_CAPABILITY_ID}. */
|
|
29
|
+
export declare const PRIOR_PROGRESS_PROMPT: CapabilityId<PriorProgressPromptService>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/capability-id.ts
|
|
3
|
+
function makeCapabilityId(id) {
|
|
4
|
+
return id;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// packages/contracts/src/prompt.ts
|
|
8
|
+
var PRIOR_PROGRESS_PROMPT_CAPABILITY_ID = "prompt.prior-progress";
|
|
9
|
+
var PRIOR_PROGRESS_PROMPT = makeCapabilityId(PRIOR_PROGRESS_PROMPT_CAPABILITY_ID);
|
|
10
|
+
export {
|
|
11
|
+
PRIOR_PROGRESS_PROMPT_CAPABILITY_ID,
|
|
12
|
+
PRIOR_PROGRESS_PROMPT
|
|
13
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rig client–server protocol version.
|
|
3
|
+
*
|
|
4
|
+
* A single integer shared by the server (reported in the
|
|
5
|
+
* `GET /api/server/status` bootstrap payload as `protocolVersion`) and by
|
|
6
|
+
* clients that speak the HTTP/WS surface (the pi-rig bridge validates it at
|
|
7
|
+
* extension init and disables itself on mismatch instead of failing on a
|
|
8
|
+
* random later request).
|
|
9
|
+
*
|
|
10
|
+
* Bump rules:
|
|
11
|
+
* - Increment whenever a change to the server API surface would break an
|
|
12
|
+
* older client (removed/renamed routes, changed payload shapes, changed
|
|
13
|
+
* steering/event semantics).
|
|
14
|
+
* - Purely additive changes (new routes, new optional fields) do NOT require
|
|
15
|
+
* a bump.
|
|
16
|
+
*
|
|
17
|
+
* History:
|
|
18
|
+
* - 1: first explicit version (2026-06). Servers older than this do not
|
|
19
|
+
* report `protocolVersion` at all; clients treat the missing field as v0.
|
|
20
|
+
*/
|
|
21
|
+
export declare const RIG_PROTOCOL_VERSION = 1;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure provider-instruction contract types.
|
|
3
|
+
*
|
|
4
|
+
* Neutral home for the agent-harness provider identity so the dumb runtime
|
|
5
|
+
* substrate (native/task-ops, hooks/inject-context) and the
|
|
6
|
+
* @rig/provider-plugin that owns the instruction text can both reference it
|
|
7
|
+
* without a substrate->plugin import cycle. Carries no behaviour and imports
|
|
8
|
+
* nothing — exactly like `memory.ts` / `lifecycle-capabilities.ts`.
|
|
9
|
+
*
|
|
10
|
+
* The plugin registers its executable `RuntimeInstructionService` impl under the
|
|
11
|
+
* typed id {@link RUNTIME_INSTRUCTION} (whose string value is
|
|
12
|
+
* {@link RUNTIME_INSTRUCTION_SERVICE_CAPABILITY_ID}) via `*.provide`; the runtime
|
|
13
|
+
* resolves it by id from `pluginHost.listExecutableCapabilities()` via the
|
|
14
|
+
* `defineCapability` seam (`@rig/core/capability`), re-exported from the thin
|
|
15
|
+
* `@rig/runtime/control-plane/provider-instruction-port`.
|
|
16
|
+
*/
|
|
17
|
+
import type { CapabilityId } from "./capability-id";
|
|
18
|
+
/** Capability id the provider plugin registers its instruction service under. */
|
|
19
|
+
export declare const RUNTIME_INSTRUCTION_SERVICE_CAPABILITY_ID = "provider.runtime-instructions";
|
|
20
|
+
/** The agent harness adapter the runtime is currently wired to. */
|
|
21
|
+
export type RuntimeInstructionProvider = "pi";
|
|
22
|
+
/**
|
|
23
|
+
* The cohesive set of agent-harness instruction builders the runtime consumers
|
|
24
|
+
* depend on. This is pure capability VOCAB: the `@rig/provider-plugin` provides a
|
|
25
|
+
* concrete impl (statically checked against this interface via the typed
|
|
26
|
+
* capability seam), and the substrate only ever sees this contract — resolved by
|
|
27
|
+
* id off a plugin host with no `as unknown as` at any call site.
|
|
28
|
+
*/
|
|
29
|
+
export interface RuntimeInstructionService {
|
|
30
|
+
normalizeProvider(value: string | undefined | null): RuntimeInstructionProvider;
|
|
31
|
+
buildTaskRunInstructionLines(provider: RuntimeInstructionProvider): string[];
|
|
32
|
+
buildRuntimeContextLines(provider: RuntimeInstructionProvider): string[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The typed capability id the provider plugin provides and consumers require.
|
|
36
|
+
* Phantom-typed with `RuntimeInstructionService` so `resolve(host)` returns a
|
|
37
|
+
* `RuntimeInstructionService` with no cast leaking to callers. Its string value
|
|
38
|
+
* is {@link RUNTIME_INSTRUCTION_SERVICE_CAPABILITY_ID}, so it indexes the same
|
|
39
|
+
* host entry.
|
|
40
|
+
*/
|
|
41
|
+
export declare const RUNTIME_INSTRUCTION: CapabilityId<RuntimeInstructionService>;
|