@h-rig/contracts 0.0.0-e2e-live.20260630085347
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/README.md +14 -0
- package/dist/index.cjs +3442 -0
- package/dist/index.mjs +3401 -0
- package/dist/src/agent-roles.d.ts +8 -0
- package/dist/src/agent-roles.js +1 -0
- package/dist/src/artifact.d.ts +13 -0
- package/dist/src/artifact.js +56 -0
- package/dist/src/baseSchemas.d.ts +63 -0
- package/dist/src/baseSchemas.js +72 -0
- package/dist/src/blocker-classifier.d.ts +21 -0
- package/dist/src/blocker-classifier.js +13 -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/cockpit.d.ts +58 -0
- package/dist/src/cockpit.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 +553 -0
- package/dist/src/config.js +822 -0
- 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 +98 -0
- package/dist/src/dependency-preflight.d.ts +43 -0
- package/dist/src/dependency-preflight.js +13 -0
- package/dist/src/docs-drift.d.ts +10 -0
- package/dist/src/docs-drift.js +12 -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 +58 -0
- package/dist/src/errors.d.ts +13 -0
- package/dist/src/errors.js +17 -0
- package/dist/src/git.d.ts +152 -0
- package/dist/src/git.js +196 -0
- package/dist/src/github.d.ts +295 -0
- package/dist/src/github.js +17 -0
- package/dist/src/graph.d.ts +360 -0
- package/dist/src/graph.js +229 -0
- package/dist/src/guard.d.ts +118 -0
- package/dist/src/guard.js +15 -0
- package/dist/src/harness-events.d.ts +8 -0
- package/dist/src/harness-events.js +1 -0
- package/dist/src/harness-profile-state.d.ts +10 -0
- package/dist/src/harness-profile-state.js +13 -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 +98 -0
- package/dist/src/index.js +3401 -0
- 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 +122 -0
- package/dist/src/layout.d.ts +44 -0
- package/dist/src/layout.js +8 -0
- package/dist/src/lifecycle-capabilities.d.ts +224 -0
- package/dist/src/lifecycle-capabilities.js +45 -0
- package/dist/src/managed-repos.d.ts +339 -0
- package/dist/src/managed-repos.js +37 -0
- package/dist/src/memory.d.ts +199 -0
- package/dist/src/memory.js +15 -0
- package/dist/src/model.d.ts +13 -0
- package/dist/src/model.js +9 -0
- package/dist/src/native-toolchain.d.ts +46 -0
- package/dist/src/native-toolchain.js +13 -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 +98 -0
- 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/placement.d.ts +47 -0
- package/dist/src/placement.js +13 -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 +384 -0
- package/dist/src/policy.d.ts +16 -0
- package/dist/src/policy.js +59 -0
- package/dist/src/product-entrypoint.d.ts +22 -0
- package/dist/src/product-entrypoint.js +13 -0
- package/dist/src/project.d.ts +71 -0
- package/dist/src/project.js +110 -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 +194 -0
- package/dist/src/remote-control.d.ts +93 -0
- package/dist/src/remote-control.js +26 -0
- package/dist/src/remote.d.ts +318 -0
- package/dist/src/remote.js +634 -0
- package/dist/src/review.d.ts +18 -0
- package/dist/src/review.js +61 -0
- package/dist/src/rollups.d.ts +41 -0
- package/dist/src/rollups.js +70 -0
- package/dist/src/run-control.d.ts +164 -0
- package/dist/src/run-control.js +13 -0
- package/dist/src/run-discovery.d.ts +83 -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-queue.d.ts +36 -0
- package/dist/src/run-queue.js +13 -0
- package/dist/src/run-read-model.d.ts +200 -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 +154 -0
- package/dist/src/run-session-journal.js +87 -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-secrets.d.ts +10 -0
- package/dist/src/runtime-secrets.js +13 -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 +210 -0
- package/dist/src/session-asset-materializer.d.ts +35 -0
- package/dist/src/session-asset-materializer.js +13 -0
- package/dist/src/session-hook-materializer.d.ts +41 -0
- package/dist/src/session-hook-materializer.js +13 -0
- package/dist/src/setup.d.ts +154 -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 +336 -0
- package/dist/src/supervisor-loop.d.ts +40 -0
- package/dist/src/supervisor-loop.js +13 -0
- package/dist/src/task-artifacts.d.ts +53 -0
- package/dist/src/task-artifacts.js +13 -0
- package/dist/src/task-config.d.ts +22 -0
- package/dist/src/task-config.js +1 -0
- package/dist/src/task-context-renderer.d.ts +29 -0
- package/dist/src/task-context-renderer.js +13 -0
- package/dist/src/task-data.d.ts +196 -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 +167 -0
- package/dist/src/task-source.js +25 -0
- package/dist/src/task-state-metadata.d.ts +21 -0
- package/dist/src/task-state-metadata.js +1 -0
- package/dist/src/task-state-paths.d.ts +14 -0
- package/dist/src/task-state-paths.js +13 -0
- package/dist/src/task-state-store.d.ts +36 -0
- package/dist/src/task-state-store.js +17 -0
- package/dist/src/task-tracker-state.d.ts +101 -0
- package/dist/src/task-tracker-state.js +39 -0
- package/dist/src/terminal.d.ts +130 -0
- package/dist/src/terminal.js +161 -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/transport-config.d.ts +161 -0
- package/dist/src/transport-config.js +15 -0
- package/dist/src/validation.d.ts +14 -0
- package/dist/src/validation.js +63 -0
- package/dist/src/workflow-journal.d.ts +125 -0
- package/dist/src/workflow-journal.js +27 -0
- package/dist/src/workspace-config.d.ts +18 -0
- package/dist/src/workspace-config.js +13 -0
- package/dist/src/workspace-service.d.ts +16 -0
- package/dist/src/workspace-service.js +13 -0
- package/dist/src/workspace.d.ts +204 -0
- package/dist/src/workspace.js +195 -0
- package/package.json +79 -0
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
// @bun
|
|
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
|
|
9
|
+
import { Schema } from "effect";
|
|
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([
|
|
228
|
+
"boundary",
|
|
229
|
+
"contract",
|
|
230
|
+
"integration",
|
|
231
|
+
"regression",
|
|
232
|
+
"external",
|
|
233
|
+
"custom"
|
|
234
|
+
]);
|
|
235
|
+
var ValidatorRegistration = Schema4.Struct({
|
|
236
|
+
id: Schema4.String,
|
|
237
|
+
category: ValidatorCategory,
|
|
238
|
+
description: Schema4.optional(Schema4.String)
|
|
239
|
+
});
|
|
240
|
+
var AgentSessionHookEvent = Schema4.Literals([
|
|
241
|
+
"PreToolUse",
|
|
242
|
+
"PostToolUse",
|
|
243
|
+
"UserPromptSubmit",
|
|
244
|
+
"Stop",
|
|
245
|
+
"SessionStart",
|
|
246
|
+
"SessionEnd"
|
|
247
|
+
]);
|
|
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 })
|
|
253
|
+
]);
|
|
254
|
+
var HookRegistration = Schema4.Struct({
|
|
255
|
+
id: Schema4.String,
|
|
256
|
+
event: AgentSessionHookEvent,
|
|
257
|
+
matcher: HookMatcher,
|
|
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)
|
|
361
|
+
});
|
|
362
|
+
export {
|
|
363
|
+
ValidatorRegistration,
|
|
364
|
+
ValidatorCategory,
|
|
365
|
+
TaskSourceRegistration,
|
|
366
|
+
TaskSourceKind,
|
|
367
|
+
TaskFieldExtension,
|
|
368
|
+
SkillRegistration,
|
|
369
|
+
SessionExtensionRegistration,
|
|
370
|
+
SeedEntrypointRegistration,
|
|
371
|
+
RigPlugin,
|
|
372
|
+
RepoSourceRegistration,
|
|
373
|
+
ProductCapabilityRegistration,
|
|
374
|
+
PluginContributes,
|
|
375
|
+
PanelRegistration,
|
|
376
|
+
HookRegistration,
|
|
377
|
+
HookMatcher,
|
|
378
|
+
HookEvent,
|
|
379
|
+
CliCommandRegistration,
|
|
380
|
+
CapabilityRunSchema,
|
|
381
|
+
BlockerClassifierRegistration,
|
|
382
|
+
AgentSessionHookEvent,
|
|
383
|
+
AgentRoleRegistration
|
|
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;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/policy.ts
|
|
3
|
+
import { Schema as Schema2 } from "effect";
|
|
4
|
+
|
|
5
|
+
// packages/contracts/src/baseSchemas.ts
|
|
6
|
+
import { Schema } from "effect";
|
|
7
|
+
var TrimmedString = Schema.Trim;
|
|
8
|
+
var TrimmedNonEmptyString = TrimmedString.check(Schema.isNonEmpty());
|
|
9
|
+
var NonNegativeInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
|
|
10
|
+
var PositiveInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1));
|
|
11
|
+
var IsoDateTime = Schema.String;
|
|
12
|
+
var makeEntityId = (brand) => TrimmedNonEmptyString.pipe(Schema.brand(brand));
|
|
13
|
+
var ThreadId = makeEntityId("ThreadId");
|
|
14
|
+
var ProjectId = makeEntityId("ProjectId");
|
|
15
|
+
var WorkspaceId = makeEntityId("WorkspaceId");
|
|
16
|
+
var GraphId = makeEntityId("GraphId");
|
|
17
|
+
var TaskId = makeEntityId("TaskId");
|
|
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"));
|
|
22
|
+
var EngineRuntimeId = makeEntityId("EngineRuntimeId");
|
|
23
|
+
var ConversationId = makeEntityId("ConversationId");
|
|
24
|
+
var ActionId = makeEntityId("ActionId");
|
|
25
|
+
var ArtifactId = makeEntityId("ArtifactId");
|
|
26
|
+
var WorktreeId = makeEntityId("WorktreeId");
|
|
27
|
+
var ValidationResultId = makeEntityId("ValidationResultId");
|
|
28
|
+
var ReviewResultId = makeEntityId("ReviewResultId");
|
|
29
|
+
var CommandId = makeEntityId("CommandId");
|
|
30
|
+
var EventId = makeEntityId("EventId");
|
|
31
|
+
var MessageId = makeEntityId("MessageId");
|
|
32
|
+
var TurnId = makeEntityId("TurnId");
|
|
33
|
+
var ProviderItemId = makeEntityId("ProviderItemId");
|
|
34
|
+
var RuntimeSessionId = makeEntityId("RuntimeSessionId");
|
|
35
|
+
var RuntimeItemId = makeEntityId("RuntimeItemId");
|
|
36
|
+
var RuntimeRequestId = makeEntityId("RuntimeRequestId");
|
|
37
|
+
var RuntimeTaskId = makeEntityId("RuntimeTaskId");
|
|
38
|
+
var ApprovalRequestId = makeEntityId("ApprovalRequestId");
|
|
39
|
+
var CheckpointRef = makeEntityId("CheckpointRef");
|
|
40
|
+
var RemoteEndpointId = makeEntityId("RemoteEndpointId");
|
|
41
|
+
|
|
42
|
+
// packages/contracts/src/policy.ts
|
|
43
|
+
var PolicyDecision = Schema2.Literals(["allow", "warn", "block"]);
|
|
44
|
+
var PolicyMode = Schema2.Literals(["off", "observe", "enforce"]);
|
|
45
|
+
var PolicyDecisionSummary = Schema2.Struct({
|
|
46
|
+
id: TrimmedNonEmptyString,
|
|
47
|
+
runId: RunId,
|
|
48
|
+
actionId: Schema2.NullOr(ActionId),
|
|
49
|
+
decision: PolicyDecision,
|
|
50
|
+
mode: PolicyMode,
|
|
51
|
+
matchedRules: Schema2.Array(TrimmedNonEmptyString),
|
|
52
|
+
reason: Schema2.String,
|
|
53
|
+
createdAt: IsoDateTime
|
|
54
|
+
});
|
|
55
|
+
export {
|
|
56
|
+
PolicyMode,
|
|
57
|
+
PolicyDecisionSummary,
|
|
58
|
+
PolicyDecision
|
|
59
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* product-entrypoint.ts — pure capability vocabulary for product-owned session entrypoints.
|
|
3
|
+
*
|
|
4
|
+
* The implementation lives in @rig/product-entrypoint-plugin. CLI consumers resolve
|
|
5
|
+
* this capability from the project plugin host instead of importing product runtime
|
|
6
|
+
* entrypoint code directly.
|
|
7
|
+
*/
|
|
8
|
+
import type { CapabilityId } from "./capability-id";
|
|
9
|
+
export interface ProductEntrypointJoinSessionInput {
|
|
10
|
+
readonly projectRoot: string;
|
|
11
|
+
readonly link: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ProductEntrypointJoinSessionResult {
|
|
14
|
+
readonly ok: true;
|
|
15
|
+
readonly group: "product";
|
|
16
|
+
readonly command: "join";
|
|
17
|
+
}
|
|
18
|
+
export interface ProductEntrypointService {
|
|
19
|
+
readonly joinSession: (input: ProductEntrypointJoinSessionInput) => Promise<ProductEntrypointJoinSessionResult>;
|
|
20
|
+
}
|
|
21
|
+
export declare const PRODUCT_ENTRYPOINT_CAPABILITY_ID = "rig.product.entrypoint";
|
|
22
|
+
export declare const PRODUCT_ENTRYPOINT: CapabilityId<ProductEntrypointService>;
|
|
@@ -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/product-entrypoint.ts
|
|
8
|
+
var PRODUCT_ENTRYPOINT_CAPABILITY_ID = "rig.product.entrypoint";
|
|
9
|
+
var PRODUCT_ENTRYPOINT = makeCapabilityId(PRODUCT_ENTRYPOINT_CAPABILITY_ID);
|
|
10
|
+
export {
|
|
11
|
+
PRODUCT_ENTRYPOINT_CAPABILITY_ID,
|
|
12
|
+
PRODUCT_ENTRYPOINT
|
|
13
|
+
};
|
|
@@ -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;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/project.ts
|
|
3
|
+
import { Schema as Schema2 } from "effect";
|
|
4
|
+
|
|
5
|
+
// packages/contracts/src/baseSchemas.ts
|
|
6
|
+
import { Schema } from "effect";
|
|
7
|
+
var TrimmedString = Schema.Trim;
|
|
8
|
+
var TrimmedNonEmptyString = TrimmedString.check(Schema.isNonEmpty());
|
|
9
|
+
var NonNegativeInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
|
|
10
|
+
var PositiveInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1));
|
|
11
|
+
var IsoDateTime = Schema.String;
|
|
12
|
+
var makeEntityId = (brand) => TrimmedNonEmptyString.pipe(Schema.brand(brand));
|
|
13
|
+
var ThreadId = makeEntityId("ThreadId");
|
|
14
|
+
var ProjectId = makeEntityId("ProjectId");
|
|
15
|
+
var WorkspaceId = makeEntityId("WorkspaceId");
|
|
16
|
+
var GraphId = makeEntityId("GraphId");
|
|
17
|
+
var TaskId = makeEntityId("TaskId");
|
|
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"));
|
|
22
|
+
var EngineRuntimeId = makeEntityId("EngineRuntimeId");
|
|
23
|
+
var ConversationId = makeEntityId("ConversationId");
|
|
24
|
+
var ActionId = makeEntityId("ActionId");
|
|
25
|
+
var ArtifactId = makeEntityId("ArtifactId");
|
|
26
|
+
var WorktreeId = makeEntityId("WorktreeId");
|
|
27
|
+
var ValidationResultId = makeEntityId("ValidationResultId");
|
|
28
|
+
var ReviewResultId = makeEntityId("ReviewResultId");
|
|
29
|
+
var CommandId = makeEntityId("CommandId");
|
|
30
|
+
var EventId = makeEntityId("EventId");
|
|
31
|
+
var MessageId = makeEntityId("MessageId");
|
|
32
|
+
var TurnId = makeEntityId("TurnId");
|
|
33
|
+
var ProviderItemId = makeEntityId("ProviderItemId");
|
|
34
|
+
var RuntimeSessionId = makeEntityId("RuntimeSessionId");
|
|
35
|
+
var RuntimeItemId = makeEntityId("RuntimeItemId");
|
|
36
|
+
var RuntimeRequestId = makeEntityId("RuntimeRequestId");
|
|
37
|
+
var RuntimeTaskId = makeEntityId("RuntimeTaskId");
|
|
38
|
+
var ApprovalRequestId = makeEntityId("ApprovalRequestId");
|
|
39
|
+
var CheckpointRef = makeEntityId("CheckpointRef");
|
|
40
|
+
var RemoteEndpointId = makeEntityId("RemoteEndpointId");
|
|
41
|
+
|
|
42
|
+
// packages/contracts/src/project.ts
|
|
43
|
+
var PROJECT_SEARCH_ENTRIES_MAX_LIMIT = 200;
|
|
44
|
+
var PROJECT_LIST_DIRECTORY_MAX_LIMIT = 500;
|
|
45
|
+
var PROJECT_WRITE_FILE_PATH_MAX_LENGTH = 512;
|
|
46
|
+
var PROJECT_READ_FILE_MAX_BYTES = 512 * 1024;
|
|
47
|
+
var ProjectSearchEntriesInput = Schema2.Struct({
|
|
48
|
+
cwd: TrimmedNonEmptyString,
|
|
49
|
+
query: TrimmedNonEmptyString.check(Schema2.isMaxLength(256)),
|
|
50
|
+
limit: PositiveInt.check(Schema2.isLessThanOrEqualTo(PROJECT_SEARCH_ENTRIES_MAX_LIMIT))
|
|
51
|
+
});
|
|
52
|
+
var ProjectEntryKind = Schema2.Literals(["file", "directory"]);
|
|
53
|
+
var ProjectEntry = Schema2.Struct({
|
|
54
|
+
path: TrimmedNonEmptyString,
|
|
55
|
+
kind: ProjectEntryKind,
|
|
56
|
+
parentPath: Schema2.optional(TrimmedNonEmptyString)
|
|
57
|
+
});
|
|
58
|
+
var ProjectSearchEntriesResult = Schema2.Struct({
|
|
59
|
+
entries: Schema2.Array(ProjectEntry),
|
|
60
|
+
truncated: Schema2.Boolean
|
|
61
|
+
});
|
|
62
|
+
var ProjectListDirectoryInput = Schema2.Struct({
|
|
63
|
+
cwd: TrimmedNonEmptyString,
|
|
64
|
+
relativePath: TrimmedNonEmptyString.check(Schema2.isMaxLength(PROJECT_WRITE_FILE_PATH_MAX_LENGTH)),
|
|
65
|
+
limit: PositiveInt.check(Schema2.isLessThanOrEqualTo(PROJECT_LIST_DIRECTORY_MAX_LIMIT))
|
|
66
|
+
});
|
|
67
|
+
var ProjectDirectoryEntry = Schema2.Struct({
|
|
68
|
+
name: TrimmedNonEmptyString,
|
|
69
|
+
relativePath: TrimmedNonEmptyString,
|
|
70
|
+
kind: ProjectEntryKind,
|
|
71
|
+
sizeBytes: Schema2.optional(NonNegativeInt),
|
|
72
|
+
modifiedAt: Schema2.optional(Schema2.String)
|
|
73
|
+
});
|
|
74
|
+
var ProjectListDirectoryResult = Schema2.Struct({
|
|
75
|
+
entries: Schema2.Array(ProjectDirectoryEntry),
|
|
76
|
+
truncated: Schema2.Boolean
|
|
77
|
+
});
|
|
78
|
+
var ProjectWriteFileInput = Schema2.Struct({
|
|
79
|
+
cwd: TrimmedNonEmptyString,
|
|
80
|
+
relativePath: TrimmedNonEmptyString.check(Schema2.isMaxLength(PROJECT_WRITE_FILE_PATH_MAX_LENGTH)),
|
|
81
|
+
contents: Schema2.String
|
|
82
|
+
});
|
|
83
|
+
var ProjectWriteFileResult = Schema2.Struct({
|
|
84
|
+
relativePath: TrimmedNonEmptyString
|
|
85
|
+
});
|
|
86
|
+
var ProjectReadFileInput = Schema2.Struct({
|
|
87
|
+
cwd: TrimmedNonEmptyString,
|
|
88
|
+
relativePath: TrimmedNonEmptyString.check(Schema2.isMaxLength(PROJECT_WRITE_FILE_PATH_MAX_LENGTH))
|
|
89
|
+
});
|
|
90
|
+
var ProjectReadFileResult = Schema2.Struct({
|
|
91
|
+
relativePath: TrimmedNonEmptyString,
|
|
92
|
+
contents: Schema2.String,
|
|
93
|
+
truncated: Schema2.Boolean,
|
|
94
|
+
sizeBytes: NonNegativeInt,
|
|
95
|
+
maxBytes: PositiveInt
|
|
96
|
+
});
|
|
97
|
+
var PROJECT_READ_FILE_MAX_BYTES_VALUE = PROJECT_READ_FILE_MAX_BYTES;
|
|
98
|
+
export {
|
|
99
|
+
ProjectWriteFileResult,
|
|
100
|
+
ProjectWriteFileInput,
|
|
101
|
+
ProjectSearchEntriesResult,
|
|
102
|
+
ProjectSearchEntriesInput,
|
|
103
|
+
ProjectReadFileResult,
|
|
104
|
+
ProjectReadFileInput,
|
|
105
|
+
ProjectListDirectoryResult,
|
|
106
|
+
ProjectListDirectoryInput,
|
|
107
|
+
ProjectEntry,
|
|
108
|
+
ProjectDirectoryEntry,
|
|
109
|
+
PROJECT_READ_FILE_MAX_BYTES_VALUE
|
|
110
|
+
};
|