@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,8 @@
|
|
|
1
|
+
import type { AgentRoleRegistration } from "./plugin";
|
|
2
|
+
export interface ResolvedAgentRole extends AgentRoleRegistration {
|
|
3
|
+
model: string;
|
|
4
|
+
}
|
|
5
|
+
export interface AgentRoleRegistry {
|
|
6
|
+
resolve(id: string): ResolvedAgentRole;
|
|
7
|
+
list(): readonly ResolvedAgentRole[];
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// @bun
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const ArtifactSummary: Schema.Struct<{
|
|
3
|
+
readonly id: Schema.brand<Schema.Trim, "ArtifactId">;
|
|
4
|
+
readonly runId: Schema.brand<Schema.Trim, "RunId">;
|
|
5
|
+
readonly taskId: Schema.NullOr<Schema.brand<Schema.Trim, "TaskId">>;
|
|
6
|
+
readonly kind: Schema.Trim;
|
|
7
|
+
readonly label: Schema.Trim;
|
|
8
|
+
readonly path: Schema.NullOr<Schema.Trim>;
|
|
9
|
+
readonly url: Schema.NullOr<Schema.Trim>;
|
|
10
|
+
readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
11
|
+
readonly createdAt: Schema.String;
|
|
12
|
+
}>;
|
|
13
|
+
export type ArtifactSummary = typeof ArtifactSummary.Type;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/artifact.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/artifact.ts
|
|
43
|
+
var ArtifactSummary = Schema2.Struct({
|
|
44
|
+
id: ArtifactId,
|
|
45
|
+
runId: RunId,
|
|
46
|
+
taskId: Schema2.NullOr(TaskId),
|
|
47
|
+
kind: TrimmedNonEmptyString,
|
|
48
|
+
label: TrimmedNonEmptyString,
|
|
49
|
+
path: Schema2.NullOr(TrimmedNonEmptyString),
|
|
50
|
+
url: Schema2.NullOr(TrimmedNonEmptyString),
|
|
51
|
+
metadata: Schema2.Record(Schema2.String, Schema2.Unknown),
|
|
52
|
+
createdAt: IsoDateTime
|
|
53
|
+
});
|
|
54
|
+
export {
|
|
55
|
+
ArtifactSummary
|
|
56
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const TrimmedString: Schema.Trim;
|
|
3
|
+
export declare const TrimmedNonEmptyString: Schema.Trim;
|
|
4
|
+
export declare const NonNegativeInt: Schema.Int;
|
|
5
|
+
export declare const PositiveInt: Schema.Int;
|
|
6
|
+
export declare const IsoDateTime: Schema.String;
|
|
7
|
+
export type IsoDateTime = typeof IsoDateTime.Type;
|
|
8
|
+
export declare const ThreadId: Schema.brand<Schema.Trim, "ThreadId">;
|
|
9
|
+
export type ThreadId = typeof ThreadId.Type;
|
|
10
|
+
export declare const ProjectId: Schema.brand<Schema.Trim, "ProjectId">;
|
|
11
|
+
export type ProjectId = typeof ProjectId.Type;
|
|
12
|
+
export declare const WorkspaceId: Schema.brand<Schema.Trim, "WorkspaceId">;
|
|
13
|
+
export type WorkspaceId = typeof WorkspaceId.Type;
|
|
14
|
+
export declare const GraphId: Schema.brand<Schema.Trim, "GraphId">;
|
|
15
|
+
export type GraphId = typeof GraphId.Type;
|
|
16
|
+
export declare const TaskId: Schema.brand<Schema.Trim, "TaskId">;
|
|
17
|
+
export type TaskId = typeof TaskId.Type;
|
|
18
|
+
export declare const RunId: Schema.brand<Schema.Trim, "RunId">;
|
|
19
|
+
export type RunId = typeof RunId.Type;
|
|
20
|
+
export declare const SafePathSegment: Schema.brand<Schema.Trim, "SafePathSegment">;
|
|
21
|
+
export type SafePathSegment = typeof SafePathSegment.Type;
|
|
22
|
+
export declare const SafeRunId: Schema.brand<Schema.Trim, "SafeRunId">;
|
|
23
|
+
export type SafeRunId = typeof SafeRunId.Type;
|
|
24
|
+
export declare const SafeGitRefComponent: Schema.brand<Schema.Trim, "SafeGitRefComponent">;
|
|
25
|
+
export type SafeGitRefComponent = typeof SafeGitRefComponent.Type;
|
|
26
|
+
export declare const EngineRuntimeId: Schema.brand<Schema.Trim, "EngineRuntimeId">;
|
|
27
|
+
export type EngineRuntimeId = typeof EngineRuntimeId.Type;
|
|
28
|
+
export declare const ConversationId: Schema.brand<Schema.Trim, "ConversationId">;
|
|
29
|
+
export type ConversationId = typeof ConversationId.Type;
|
|
30
|
+
export declare const ActionId: Schema.brand<Schema.Trim, "ActionId">;
|
|
31
|
+
export type ActionId = typeof ActionId.Type;
|
|
32
|
+
export declare const ArtifactId: Schema.brand<Schema.Trim, "ArtifactId">;
|
|
33
|
+
export type ArtifactId = typeof ArtifactId.Type;
|
|
34
|
+
export declare const WorktreeId: Schema.brand<Schema.Trim, "WorktreeId">;
|
|
35
|
+
export type WorktreeId = typeof WorktreeId.Type;
|
|
36
|
+
export declare const ValidationResultId: Schema.brand<Schema.Trim, "ValidationResultId">;
|
|
37
|
+
export type ValidationResultId = typeof ValidationResultId.Type;
|
|
38
|
+
export declare const ReviewResultId: Schema.brand<Schema.Trim, "ReviewResultId">;
|
|
39
|
+
export type ReviewResultId = typeof ReviewResultId.Type;
|
|
40
|
+
export declare const CommandId: Schema.brand<Schema.Trim, "CommandId">;
|
|
41
|
+
export type CommandId = typeof CommandId.Type;
|
|
42
|
+
export declare const EventId: Schema.brand<Schema.Trim, "EventId">;
|
|
43
|
+
export type EventId = typeof EventId.Type;
|
|
44
|
+
export declare const MessageId: Schema.brand<Schema.Trim, "MessageId">;
|
|
45
|
+
export type MessageId = typeof MessageId.Type;
|
|
46
|
+
export declare const TurnId: Schema.brand<Schema.Trim, "TurnId">;
|
|
47
|
+
export type TurnId = typeof TurnId.Type;
|
|
48
|
+
export declare const ProviderItemId: Schema.brand<Schema.Trim, "ProviderItemId">;
|
|
49
|
+
export type ProviderItemId = typeof ProviderItemId.Type;
|
|
50
|
+
export declare const RuntimeSessionId: Schema.brand<Schema.Trim, "RuntimeSessionId">;
|
|
51
|
+
export type RuntimeSessionId = typeof RuntimeSessionId.Type;
|
|
52
|
+
export declare const RuntimeItemId: Schema.brand<Schema.Trim, "RuntimeItemId">;
|
|
53
|
+
export type RuntimeItemId = typeof RuntimeItemId.Type;
|
|
54
|
+
export declare const RuntimeRequestId: Schema.brand<Schema.Trim, "RuntimeRequestId">;
|
|
55
|
+
export type RuntimeRequestId = typeof RuntimeRequestId.Type;
|
|
56
|
+
export declare const RuntimeTaskId: Schema.brand<Schema.Trim, "RuntimeTaskId">;
|
|
57
|
+
export type RuntimeTaskId = typeof RuntimeTaskId.Type;
|
|
58
|
+
export declare const ApprovalRequestId: Schema.brand<Schema.Trim, "ApprovalRequestId">;
|
|
59
|
+
export type ApprovalRequestId = typeof ApprovalRequestId.Type;
|
|
60
|
+
export declare const CheckpointRef: Schema.brand<Schema.Trim, "CheckpointRef">;
|
|
61
|
+
export type CheckpointRef = typeof CheckpointRef.Type;
|
|
62
|
+
export declare const RemoteEndpointId: Schema.brand<Schema.Trim, "RemoteEndpointId">;
|
|
63
|
+
export type RemoteEndpointId = typeof RemoteEndpointId.Type;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/baseSchemas.ts
|
|
3
|
+
import { Schema } from "effect";
|
|
4
|
+
var TrimmedString = Schema.Trim;
|
|
5
|
+
var TrimmedNonEmptyString = TrimmedString.check(Schema.isNonEmpty());
|
|
6
|
+
var NonNegativeInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
|
|
7
|
+
var PositiveInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1));
|
|
8
|
+
var IsoDateTime = Schema.String;
|
|
9
|
+
var makeEntityId = (brand) => TrimmedNonEmptyString.pipe(Schema.brand(brand));
|
|
10
|
+
var ThreadId = makeEntityId("ThreadId");
|
|
11
|
+
var ProjectId = makeEntityId("ProjectId");
|
|
12
|
+
var WorkspaceId = makeEntityId("WorkspaceId");
|
|
13
|
+
var GraphId = makeEntityId("GraphId");
|
|
14
|
+
var TaskId = makeEntityId("TaskId");
|
|
15
|
+
var RunId = makeEntityId("RunId");
|
|
16
|
+
var SafePathSegment = TrimmedNonEmptyString.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)).pipe(Schema.brand("SafePathSegment"));
|
|
17
|
+
var SafeRunId = TrimmedNonEmptyString.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/)).pipe(Schema.brand("SafeRunId"));
|
|
18
|
+
var SafeGitRefComponent = TrimmedNonEmptyString.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)).pipe(Schema.brand("SafeGitRefComponent"));
|
|
19
|
+
var EngineRuntimeId = makeEntityId("EngineRuntimeId");
|
|
20
|
+
var ConversationId = makeEntityId("ConversationId");
|
|
21
|
+
var ActionId = makeEntityId("ActionId");
|
|
22
|
+
var ArtifactId = makeEntityId("ArtifactId");
|
|
23
|
+
var WorktreeId = makeEntityId("WorktreeId");
|
|
24
|
+
var ValidationResultId = makeEntityId("ValidationResultId");
|
|
25
|
+
var ReviewResultId = makeEntityId("ReviewResultId");
|
|
26
|
+
var CommandId = makeEntityId("CommandId");
|
|
27
|
+
var EventId = makeEntityId("EventId");
|
|
28
|
+
var MessageId = makeEntityId("MessageId");
|
|
29
|
+
var TurnId = makeEntityId("TurnId");
|
|
30
|
+
var ProviderItemId = makeEntityId("ProviderItemId");
|
|
31
|
+
var RuntimeSessionId = makeEntityId("RuntimeSessionId");
|
|
32
|
+
var RuntimeItemId = makeEntityId("RuntimeItemId");
|
|
33
|
+
var RuntimeRequestId = makeEntityId("RuntimeRequestId");
|
|
34
|
+
var RuntimeTaskId = makeEntityId("RuntimeTaskId");
|
|
35
|
+
var ApprovalRequestId = makeEntityId("ApprovalRequestId");
|
|
36
|
+
var CheckpointRef = makeEntityId("CheckpointRef");
|
|
37
|
+
var RemoteEndpointId = makeEntityId("RemoteEndpointId");
|
|
38
|
+
export {
|
|
39
|
+
WorktreeId,
|
|
40
|
+
WorkspaceId,
|
|
41
|
+
ValidationResultId,
|
|
42
|
+
TurnId,
|
|
43
|
+
TrimmedString,
|
|
44
|
+
TrimmedNonEmptyString,
|
|
45
|
+
ThreadId,
|
|
46
|
+
TaskId,
|
|
47
|
+
SafeRunId,
|
|
48
|
+
SafePathSegment,
|
|
49
|
+
SafeGitRefComponent,
|
|
50
|
+
RuntimeTaskId,
|
|
51
|
+
RuntimeSessionId,
|
|
52
|
+
RuntimeRequestId,
|
|
53
|
+
RuntimeItemId,
|
|
54
|
+
RunId,
|
|
55
|
+
ReviewResultId,
|
|
56
|
+
RemoteEndpointId,
|
|
57
|
+
ProviderItemId,
|
|
58
|
+
ProjectId,
|
|
59
|
+
PositiveInt,
|
|
60
|
+
NonNegativeInt,
|
|
61
|
+
MessageId,
|
|
62
|
+
IsoDateTime,
|
|
63
|
+
GraphId,
|
|
64
|
+
EventId,
|
|
65
|
+
EngineRuntimeId,
|
|
66
|
+
ConversationId,
|
|
67
|
+
CommandId,
|
|
68
|
+
CheckpointRef,
|
|
69
|
+
ArtifactId,
|
|
70
|
+
ApprovalRequestId,
|
|
71
|
+
ActionId
|
|
72
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CapabilityId } from "./capability-id";
|
|
2
|
+
import type { BlockerClassification } from "./graph";
|
|
3
|
+
import type { RunRecord } from "./run-record";
|
|
4
|
+
import type { TaskLike } from "./task-source";
|
|
5
|
+
export interface WorkspaceBlockersProjection {
|
|
6
|
+
readonly classifications: readonly BlockerClassification[];
|
|
7
|
+
readonly human: readonly BlockerClassification[];
|
|
8
|
+
readonly machine: readonly BlockerClassification[];
|
|
9
|
+
readonly generatedAt: string;
|
|
10
|
+
}
|
|
11
|
+
export interface BlockerClassifierService {
|
|
12
|
+
readonly classifyTasks: (input: {
|
|
13
|
+
readonly tasks: readonly TaskLike[];
|
|
14
|
+
readonly runs?: readonly Pick<RunRecord, "taskId" | "status" | "updatedAt" | "startedAt">[];
|
|
15
|
+
readonly humanOnly?: boolean;
|
|
16
|
+
readonly generatedAt?: string;
|
|
17
|
+
}) => WorkspaceBlockersProjection;
|
|
18
|
+
readonly isHumanBlockerClass: (blockerClass: BlockerClassification["blockerClass"]) => boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare const BLOCKER_CLASSIFIER_CAPABILITY_ID = "rig.blockers.classifier";
|
|
21
|
+
export declare const BLOCKER_CLASSIFIER: CapabilityId<BlockerClassifierService>;
|
|
@@ -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/blocker-classifier.ts
|
|
8
|
+
var BLOCKER_CLASSIFIER_CAPABILITY_ID = "rig.blockers.classifier";
|
|
9
|
+
var BLOCKER_CLASSIFIER = makeCapabilityId(BLOCKER_CLASSIFIER_CAPABILITY_ID);
|
|
10
|
+
export {
|
|
11
|
+
BLOCKER_CLASSIFIER_CAPABILITY_ID,
|
|
12
|
+
BLOCKER_CLASSIFIER
|
|
13
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure browser-contract types.
|
|
3
|
+
*
|
|
4
|
+
* These types are the neutral home for the browser-required task contract so
|
|
5
|
+
* that the dumb runtime substrate (isolation provisioning, task info, rig-agent,
|
|
6
|
+
* rig-browser-tool) and the @rig/browser-plugin that owns the resolution logic
|
|
7
|
+
* can both reference them without a substrate->plugin import cycle. They carry
|
|
8
|
+
* no behaviour and import nothing — exactly like `memory.ts` /
|
|
9
|
+
* `lifecycle-capabilities.ts`.
|
|
10
|
+
*
|
|
11
|
+
* The plugin registers its executable `BrowserContractService` impl under the
|
|
12
|
+
* typed capability id {@link BROWSER_CONTRACT_SERVICE_CAPABILITY} (whose string
|
|
13
|
+
* value is {@link BROWSER_CONTRACT_SERVICE_CAPABILITY_ID}) via the
|
|
14
|
+
* `defineCapability` seam (`@rig/core/capability`); the runtime resolves it by id
|
|
15
|
+
* from `pluginHost.listExecutableCapabilities()` via the thin typed port in
|
|
16
|
+
* `@rig/runtime/control-plane/browser-contract-port`.
|
|
17
|
+
*/
|
|
18
|
+
import type { CapabilityId } from "./capability-id";
|
|
19
|
+
/** Capability id the browser plugin registers its `BrowserContractService` factory under. */
|
|
20
|
+
export declare const BROWSER_CONTRACT_SERVICE_CAPABILITY_ID = "browser.contract";
|
|
21
|
+
/** Author-facing browser config attached to a task entry (rig.config / task source). */
|
|
22
|
+
export type TaskBrowserConfig = {
|
|
23
|
+
required?: boolean;
|
|
24
|
+
preset?: string;
|
|
25
|
+
profile?: string;
|
|
26
|
+
attach_url?: string;
|
|
27
|
+
state_dir?: string;
|
|
28
|
+
dev_command?: string;
|
|
29
|
+
launch_command?: string;
|
|
30
|
+
check_command?: string;
|
|
31
|
+
e2e_command?: string;
|
|
32
|
+
mode?: string;
|
|
33
|
+
};
|
|
34
|
+
/** Resolved, runtime-effective browser contract persisted into the runtime context. */
|
|
35
|
+
export type RuntimeBrowserContext = {
|
|
36
|
+
required: boolean;
|
|
37
|
+
preset: string;
|
|
38
|
+
mode: string;
|
|
39
|
+
stateDir: string;
|
|
40
|
+
defaultProfile: string;
|
|
41
|
+
effectiveProfile: string;
|
|
42
|
+
defaultAttachUrl: string;
|
|
43
|
+
effectiveAttachUrl: string;
|
|
44
|
+
devCommand?: string;
|
|
45
|
+
launchCommand?: string;
|
|
46
|
+
checkCommand?: string;
|
|
47
|
+
e2eCommand?: string;
|
|
48
|
+
launchHelper: string;
|
|
49
|
+
checkHelper: string;
|
|
50
|
+
attachInfoHelper: string;
|
|
51
|
+
e2eHelper: string;
|
|
52
|
+
resetProfileHelper: string;
|
|
53
|
+
};
|
|
54
|
+
/** Options for deriving the runtime-effective browser context. */
|
|
55
|
+
export type ResolveTaskBrowserContextOptions = {
|
|
56
|
+
hostProjectRoot?: string;
|
|
57
|
+
runtimeId?: string;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* The cohesive set of browser-contract operations the runtime consumers depend
|
|
61
|
+
* on. This is pure capability VOCAB: the `@rig/browser-plugin` provides a
|
|
62
|
+
* concrete impl (statically checked against this interface via
|
|
63
|
+
* `BrowserContractCap.provide`), and the substrate only ever sees this contract —
|
|
64
|
+
* resolved by id off a plugin host with no `as unknown as` at any call site.
|
|
65
|
+
*/
|
|
66
|
+
export interface BrowserContractService {
|
|
67
|
+
/** Resolve an author-facing `TaskBrowserConfig` into the runtime-effective context. */
|
|
68
|
+
resolveTaskBrowserContext(browser: TaskBrowserConfig | undefined, options?: ResolveTaskBrowserContextOptions): RuntimeBrowserContext | undefined;
|
|
69
|
+
/** Render the `task info` guidance lines for a resolved browser context. */
|
|
70
|
+
buildBrowserGuidanceLines(browser: RuntimeBrowserContext): string[];
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The typed capability id the browser plugin provides and consumers require.
|
|
74
|
+
* Phantom-typed with {@link BrowserContractService} so
|
|
75
|
+
* `BrowserContractCap.require(host)` returns a `BrowserContractService` with no
|
|
76
|
+
* cast leaking to callers. Its string value is
|
|
77
|
+
* {@link BROWSER_CONTRACT_SERVICE_CAPABILITY_ID}, so it indexes the same host
|
|
78
|
+
* entry.
|
|
79
|
+
*/
|
|
80
|
+
export declare const BROWSER_CONTRACT_SERVICE_CAPABILITY: CapabilityId<BrowserContractService>;
|
|
@@ -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/browser.ts
|
|
8
|
+
var BROWSER_CONTRACT_SERVICE_CAPABILITY_ID = "browser.contract";
|
|
9
|
+
var BROWSER_CONTRACT_SERVICE_CAPABILITY = makeCapabilityId(BROWSER_CONTRACT_SERVICE_CAPABILITY_ID);
|
|
10
|
+
export {
|
|
11
|
+
BROWSER_CONTRACT_SERVICE_CAPABILITY_ID,
|
|
12
|
+
BROWSER_CONTRACT_SERVICE_CAPABILITY
|
|
13
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capability-seam vocabulary.
|
|
3
|
+
*
|
|
4
|
+
* A `CapabilityId<T>` is a plain id string branded (phantom-typed) with the
|
|
5
|
+
* service type `T` it resolves to. `defineCapability<T>` (in `@rig/core`) reads
|
|
6
|
+
* this brand so `resolve`/`require` are typed as `T` with the `unknown → T` cast
|
|
7
|
+
* contained ONCE inside the helper — callers never cast.
|
|
8
|
+
*
|
|
9
|
+
* Pure: no imports, no behaviour. The brand lives only in an OPTIONAL phantom
|
|
10
|
+
* property so a plain `string` is still assignable to `CapabilityId<T>` via the
|
|
11
|
+
* `makeCapabilityId` cast, and a `CapabilityId<T>` is usable anywhere a `string`
|
|
12
|
+
* is (equality checks against `host` capability ids, `.toString()`, etc.).
|
|
13
|
+
*/
|
|
14
|
+
declare const CapabilityIdBrand: unique symbol;
|
|
15
|
+
/** A capability id string branded with the service type `T` it resolves to. */
|
|
16
|
+
export type CapabilityId<T> = string & {
|
|
17
|
+
/** Phantom — never present at runtime; carries `T` for `defineCapability<T>`. */
|
|
18
|
+
readonly [CapabilityIdBrand]?: T;
|
|
19
|
+
};
|
|
20
|
+
/** Brand a plain id string as a `CapabilityId<T>`. */
|
|
21
|
+
export declare function makeCapabilityId<T>(id: string): CapabilityId<T>;
|
|
22
|
+
export {};
|