@h-rig/contracts 0.0.6-alpha.18 → 0.0.6-alpha.181
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 +3442 -0
- package/dist/index.mjs +3401 -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/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 +767 -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/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 +3 -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 +3 -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 +137 -1
- 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 +2605 -3752
- 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 +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 +3 -58
- 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 +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/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 +346 -64
- package/dist/src/policy.d.ts +16 -0
- package/dist/src/policy.js +3 -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 +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 +16 -835
- 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 +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-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 +73 -906
- 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 +24 -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 +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/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 +3 -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 +76 -911
- package/package.json +55 -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
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/capability-id.ts
|
|
3
|
+
function makeCapabilityId(id) {
|
|
4
|
+
return id;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// packages/contracts/src/task-tracker-state.ts
|
|
8
|
+
var TASK_TRACKER_LIFECYCLE_STATUSES = [
|
|
9
|
+
"draft",
|
|
10
|
+
"open",
|
|
11
|
+
"ready",
|
|
12
|
+
"queued",
|
|
13
|
+
"in_progress",
|
|
14
|
+
"under_review",
|
|
15
|
+
"blocked",
|
|
16
|
+
"completed",
|
|
17
|
+
"cancelled"
|
|
18
|
+
];
|
|
19
|
+
var TASK_TRACKER_STALE_CLAIM_MS = 24 * 60 * 60 * 1000;
|
|
20
|
+
var TASK_TRACKER_RECONCILIATION_POLICY_CAPABILITY_ID = "lifecycle.task-tracker-reconciliation-policy";
|
|
21
|
+
var TASK_TRACKER_RECONCILIATION_POLICY = makeCapabilityId(TASK_TRACKER_RECONCILIATION_POLICY_CAPABILITY_ID);
|
|
22
|
+
var TASK_TRACKER_READINESS_POLICY_CAPABILITY_ID = "scheduler.task-tracker-readiness-policy";
|
|
23
|
+
var TASK_TRACKER_READINESS_POLICY = makeCapabilityId(TASK_TRACKER_READINESS_POLICY_CAPABILITY_ID);
|
|
24
|
+
var TASK_TRACKER_REPO_LOCATOR_CAPABILITY_ID = "task-state.tracker-repo-locator";
|
|
25
|
+
var TASK_TRACKER_REPO_LOCATOR = makeCapabilityId(TASK_TRACKER_REPO_LOCATOR_CAPABILITY_ID);
|
|
26
|
+
var TASK_TRACKER_STATE_CAPABILITY_ID = "task-state.tracker-state";
|
|
27
|
+
var TASK_TRACKER_STATE = makeCapabilityId(TASK_TRACKER_STATE_CAPABILITY_ID);
|
|
28
|
+
export {
|
|
29
|
+
TASK_TRACKER_STATE_CAPABILITY_ID,
|
|
30
|
+
TASK_TRACKER_STATE,
|
|
31
|
+
TASK_TRACKER_STALE_CLAIM_MS,
|
|
32
|
+
TASK_TRACKER_REPO_LOCATOR_CAPABILITY_ID,
|
|
33
|
+
TASK_TRACKER_REPO_LOCATOR,
|
|
34
|
+
TASK_TRACKER_RECONCILIATION_POLICY_CAPABILITY_ID,
|
|
35
|
+
TASK_TRACKER_RECONCILIATION_POLICY,
|
|
36
|
+
TASK_TRACKER_READINESS_POLICY_CAPABILITY_ID,
|
|
37
|
+
TASK_TRACKER_READINESS_POLICY,
|
|
38
|
+
TASK_TRACKER_LIFECYCLE_STATUSES
|
|
39
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const DEFAULT_TERMINAL_ID = "default";
|
|
3
|
+
export declare const TerminalThreadInput: Schema.Struct<{
|
|
4
|
+
readonly threadId: Schema.Trim;
|
|
5
|
+
}>;
|
|
6
|
+
export type TerminalThreadInput = Schema.Codec.Encoded<typeof TerminalThreadInput>;
|
|
7
|
+
declare const TerminalSessionInput: Schema.Struct<{
|
|
8
|
+
readonly terminalId: Schema.withDecodingDefault<Schema.Trim>;
|
|
9
|
+
readonly threadId: Schema.Trim;
|
|
10
|
+
}>;
|
|
11
|
+
export type TerminalSessionInput = Schema.Codec.Encoded<typeof TerminalSessionInput>;
|
|
12
|
+
export declare const TerminalOpenInput: Schema.Struct<{
|
|
13
|
+
readonly cwd: Schema.Trim;
|
|
14
|
+
readonly cols: Schema.optional<Schema.Int>;
|
|
15
|
+
readonly rows: Schema.optional<Schema.Int>;
|
|
16
|
+
readonly env: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
17
|
+
readonly terminalId: Schema.withDecodingDefault<Schema.Trim>;
|
|
18
|
+
readonly threadId: Schema.Trim;
|
|
19
|
+
}>;
|
|
20
|
+
export type TerminalOpenInput = Schema.Codec.Encoded<typeof TerminalOpenInput>;
|
|
21
|
+
export declare const TerminalWriteInput: Schema.Struct<{
|
|
22
|
+
readonly data: Schema.String;
|
|
23
|
+
readonly terminalId: Schema.withDecodingDefault<Schema.Trim>;
|
|
24
|
+
readonly threadId: Schema.Trim;
|
|
25
|
+
}>;
|
|
26
|
+
export type TerminalWriteInput = Schema.Codec.Encoded<typeof TerminalWriteInput>;
|
|
27
|
+
export declare const TerminalResizeInput: Schema.Struct<{
|
|
28
|
+
readonly cols: Schema.Int;
|
|
29
|
+
readonly rows: Schema.Int;
|
|
30
|
+
readonly terminalId: Schema.withDecodingDefault<Schema.Trim>;
|
|
31
|
+
readonly threadId: Schema.Trim;
|
|
32
|
+
}>;
|
|
33
|
+
export type TerminalResizeInput = Schema.Codec.Encoded<typeof TerminalResizeInput>;
|
|
34
|
+
export declare const TerminalClearInput: Schema.Struct<{
|
|
35
|
+
readonly terminalId: Schema.withDecodingDefault<Schema.Trim>;
|
|
36
|
+
readonly threadId: Schema.Trim;
|
|
37
|
+
}>;
|
|
38
|
+
export type TerminalClearInput = Schema.Codec.Encoded<typeof TerminalClearInput>;
|
|
39
|
+
export declare const TerminalRestartInput: Schema.Struct<{
|
|
40
|
+
readonly cwd: Schema.Trim;
|
|
41
|
+
readonly cols: Schema.Int;
|
|
42
|
+
readonly rows: Schema.Int;
|
|
43
|
+
readonly env: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
44
|
+
readonly threadId: Schema.Trim;
|
|
45
|
+
}>;
|
|
46
|
+
export declare const TerminalCloseInput: Schema.Struct<{
|
|
47
|
+
readonly terminalId: Schema.optional<Schema.Trim>;
|
|
48
|
+
readonly deleteHistory: Schema.optional<Schema.Boolean>;
|
|
49
|
+
readonly threadId: Schema.Trim;
|
|
50
|
+
}>;
|
|
51
|
+
export type TerminalCloseInput = Schema.Codec.Encoded<typeof TerminalCloseInput>;
|
|
52
|
+
export declare const TerminalSessionStatus: Schema.Literals<readonly ["starting", "running", "exited", "error"]>;
|
|
53
|
+
export type TerminalSessionStatus = typeof TerminalSessionStatus.Type;
|
|
54
|
+
export declare const TerminalSessionSnapshot: Schema.Struct<{
|
|
55
|
+
readonly threadId: Schema.String;
|
|
56
|
+
readonly terminalId: Schema.String;
|
|
57
|
+
readonly cwd: Schema.String;
|
|
58
|
+
readonly status: Schema.Literals<readonly ["starting", "running", "exited", "error"]>;
|
|
59
|
+
readonly pid: Schema.NullOr<Schema.Int>;
|
|
60
|
+
readonly history: Schema.String;
|
|
61
|
+
readonly exitCode: Schema.NullOr<Schema.Int>;
|
|
62
|
+
readonly exitSignal: Schema.NullOr<Schema.String>;
|
|
63
|
+
readonly updatedAt: Schema.String;
|
|
64
|
+
}>;
|
|
65
|
+
export type TerminalSessionSnapshot = typeof TerminalSessionSnapshot.Type;
|
|
66
|
+
export declare const TerminalEvent: Schema.Union<readonly [Schema.Struct<{
|
|
67
|
+
readonly type: Schema.Literal<"started">;
|
|
68
|
+
readonly snapshot: Schema.Struct<{
|
|
69
|
+
readonly threadId: Schema.String;
|
|
70
|
+
readonly terminalId: Schema.String;
|
|
71
|
+
readonly cwd: Schema.String;
|
|
72
|
+
readonly status: Schema.Literals<readonly ["starting", "running", "exited", "error"]>;
|
|
73
|
+
readonly pid: Schema.NullOr<Schema.Int>;
|
|
74
|
+
readonly history: Schema.String;
|
|
75
|
+
readonly exitCode: Schema.NullOr<Schema.Int>;
|
|
76
|
+
readonly exitSignal: Schema.NullOr<Schema.String>;
|
|
77
|
+
readonly updatedAt: Schema.String;
|
|
78
|
+
}>;
|
|
79
|
+
readonly threadId: Schema.String;
|
|
80
|
+
readonly terminalId: Schema.String;
|
|
81
|
+
readonly createdAt: Schema.String;
|
|
82
|
+
}>, Schema.Struct<{
|
|
83
|
+
readonly type: Schema.Literal<"output">;
|
|
84
|
+
readonly data: Schema.String;
|
|
85
|
+
readonly threadId: Schema.String;
|
|
86
|
+
readonly terminalId: Schema.String;
|
|
87
|
+
readonly createdAt: Schema.String;
|
|
88
|
+
}>, Schema.Struct<{
|
|
89
|
+
readonly type: Schema.Literal<"exited">;
|
|
90
|
+
readonly exitCode: Schema.NullOr<Schema.Int>;
|
|
91
|
+
readonly exitSignal: Schema.NullOr<Schema.String>;
|
|
92
|
+
readonly threadId: Schema.String;
|
|
93
|
+
readonly terminalId: Schema.String;
|
|
94
|
+
readonly createdAt: Schema.String;
|
|
95
|
+
}>, Schema.Struct<{
|
|
96
|
+
readonly type: Schema.Literal<"error">;
|
|
97
|
+
readonly message: Schema.String;
|
|
98
|
+
readonly threadId: Schema.String;
|
|
99
|
+
readonly terminalId: Schema.String;
|
|
100
|
+
readonly createdAt: Schema.String;
|
|
101
|
+
}>, Schema.Struct<{
|
|
102
|
+
readonly type: Schema.Literal<"cleared">;
|
|
103
|
+
readonly threadId: Schema.String;
|
|
104
|
+
readonly terminalId: Schema.String;
|
|
105
|
+
readonly createdAt: Schema.String;
|
|
106
|
+
}>, Schema.Struct<{
|
|
107
|
+
readonly type: Schema.Literal<"restarted">;
|
|
108
|
+
readonly snapshot: Schema.Struct<{
|
|
109
|
+
readonly threadId: Schema.String;
|
|
110
|
+
readonly terminalId: Schema.String;
|
|
111
|
+
readonly cwd: Schema.String;
|
|
112
|
+
readonly status: Schema.Literals<readonly ["starting", "running", "exited", "error"]>;
|
|
113
|
+
readonly pid: Schema.NullOr<Schema.Int>;
|
|
114
|
+
readonly history: Schema.String;
|
|
115
|
+
readonly exitCode: Schema.NullOr<Schema.Int>;
|
|
116
|
+
readonly exitSignal: Schema.NullOr<Schema.String>;
|
|
117
|
+
readonly updatedAt: Schema.String;
|
|
118
|
+
}>;
|
|
119
|
+
readonly threadId: Schema.String;
|
|
120
|
+
readonly terminalId: Schema.String;
|
|
121
|
+
readonly createdAt: Schema.String;
|
|
122
|
+
}>, Schema.Struct<{
|
|
123
|
+
readonly type: Schema.Literal<"activity">;
|
|
124
|
+
readonly hasRunningSubprocess: Schema.Boolean;
|
|
125
|
+
readonly threadId: Schema.String;
|
|
126
|
+
readonly terminalId: Schema.String;
|
|
127
|
+
readonly createdAt: Schema.String;
|
|
128
|
+
}>]>;
|
|
129
|
+
export type TerminalEvent = typeof TerminalEvent.Type;
|
|
130
|
+
export {};
|
package/dist/src/terminal.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,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool-materializer capability seam.
|
|
3
|
+
*
|
|
4
|
+
* Defines the TOOL_MATERIALIZER service port that @rig/isolation-plugin
|
|
5
|
+
* consumes to build the runtime tool binaries (tool gateway, file tools,
|
|
6
|
+
* claude router, browser tools) without importing @rig/provider-plugin impl
|
|
7
|
+
* files directly. @rig/provider-plugin provides the capability; isolation-plugin
|
|
8
|
+
* resolves it via requireInstalledCapability — the SEAM-ONLY replacement for
|
|
9
|
+
* the four cross-plugin impl imports (§6.4).
|
|
10
|
+
*
|
|
11
|
+
* Pure: types + one branded id, no behaviour.
|
|
12
|
+
*/
|
|
13
|
+
import type { CapabilityId } from "./capability-id";
|
|
14
|
+
/**
|
|
15
|
+
* The tool-materializer service: builds provider-plugin-owned runtime tool
|
|
16
|
+
* binaries into the given bin directory.
|
|
17
|
+
*/
|
|
18
|
+
export interface ToolMaterializerService {
|
|
19
|
+
/** Materialize the runtime tool gateway binary. Returns the path. */
|
|
20
|
+
materializeRuntimeToolGateway(binDir: string): Promise<string>;
|
|
21
|
+
/** Materialize the runtime file-tools binary. Returns the path. */
|
|
22
|
+
materializeRuntimeFileTools(targetDir: string): Promise<string>;
|
|
23
|
+
/** Materialize the Claude tool-router binary. Returns the path. */
|
|
24
|
+
materializeClaudeToolRouterBinary(projectRoot: string, targetDir: string): Promise<string>;
|
|
25
|
+
/** Materialize the runtime browser-tools binary. Returns the path. */
|
|
26
|
+
materializeRuntimeBrowserTools(targetDir: string): Promise<string>;
|
|
27
|
+
/** Synchronously resolve the runtime browser-tool binary name. */
|
|
28
|
+
runtimeBrowserToolBinaryName(): string;
|
|
29
|
+
}
|
|
30
|
+
/** Stable id string for the tool-materializer service capability. */
|
|
31
|
+
export declare const TOOL_MATERIALIZER_CAPABILITY_ID = "provider.tool-materializer";
|
|
32
|
+
/**
|
|
33
|
+
* The branded tool-materializer capability id. `defineCapability(TOOL_MATERIALIZER)`
|
|
34
|
+
* (provider and consumers independently) resolves to a `ToolMaterializerService`.
|
|
35
|
+
*/
|
|
36
|
+
export declare const TOOL_MATERIALIZER: CapabilityId<ToolMaterializerService>;
|
|
@@ -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/tool-materializer.ts
|
|
8
|
+
var TOOL_MATERIALIZER_CAPABILITY_ID = "provider.tool-materializer";
|
|
9
|
+
var TOOL_MATERIALIZER = makeCapabilityId(TOOL_MATERIALIZER_CAPABILITY_ID);
|
|
10
|
+
export {
|
|
11
|
+
TOOL_MATERIALIZER_CAPABILITY_ID,
|
|
12
|
+
TOOL_MATERIALIZER
|
|
13
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/tool-registry.ts
|
|
3
|
+
var RUNTIME_SHELL_TOOL_NAMES = [
|
|
4
|
+
"bash",
|
|
5
|
+
"sh",
|
|
6
|
+
"zsh",
|
|
7
|
+
"git",
|
|
8
|
+
"bun",
|
|
9
|
+
"node",
|
|
10
|
+
"python3",
|
|
11
|
+
"rg",
|
|
12
|
+
"grep",
|
|
13
|
+
"sed",
|
|
14
|
+
"cat",
|
|
15
|
+
"ls",
|
|
16
|
+
"find",
|
|
17
|
+
"tsc",
|
|
18
|
+
"gh",
|
|
19
|
+
"mkdir",
|
|
20
|
+
"rm",
|
|
21
|
+
"mv",
|
|
22
|
+
"cp",
|
|
23
|
+
"touch",
|
|
24
|
+
"pwd",
|
|
25
|
+
"head",
|
|
26
|
+
"tail",
|
|
27
|
+
"wc",
|
|
28
|
+
"sort",
|
|
29
|
+
"uniq",
|
|
30
|
+
"awk",
|
|
31
|
+
"xargs",
|
|
32
|
+
"dirname",
|
|
33
|
+
"basename",
|
|
34
|
+
"realpath",
|
|
35
|
+
"env",
|
|
36
|
+
"jq",
|
|
37
|
+
"tee",
|
|
38
|
+
"which"
|
|
39
|
+
];
|
|
40
|
+
var RUNTIME_FILE_TOOL_NAMES = [
|
|
41
|
+
"rig-read",
|
|
42
|
+
"rig-write",
|
|
43
|
+
"rig-edit",
|
|
44
|
+
"rig-glob",
|
|
45
|
+
"rig-grep"
|
|
46
|
+
];
|
|
47
|
+
var RUNTIME_BROWSER_TOOL_NAMES = [
|
|
48
|
+
"rig-browser-launch",
|
|
49
|
+
"rig-browser-check",
|
|
50
|
+
"rig-browser-attach-info",
|
|
51
|
+
"rig-browser-e2e",
|
|
52
|
+
"rig-browser-reset-profile"
|
|
53
|
+
];
|
|
54
|
+
export {
|
|
55
|
+
RUNTIME_SHELL_TOOL_NAMES,
|
|
56
|
+
RUNTIME_FILE_TOOL_NAMES,
|
|
57
|
+
RUNTIME_BROWSER_TOOL_NAMES
|
|
58
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toolchain-source contribution seam.
|
|
3
|
+
*
|
|
4
|
+
* @rig/isolation-plugin's runtime toolchain materializes per-run hook binaries
|
|
5
|
+
* (guard hooks, lifecycle hooks) and standalone helper binaries (controlled-bash)
|
|
6
|
+
* by compiling SOURCE files owned by OTHER plugins. Hardcoding those sibling
|
|
7
|
+
* `packages/<plugin>/src/...` paths inside the toolchain couples it to every
|
|
8
|
+
* owning plugin's file layout (and trips the rule-8b arch invariant).
|
|
9
|
+
*
|
|
10
|
+
* Instead, each owning plugin CONTRIBUTES its build sources as DATA through a
|
|
11
|
+
* typed capability id, and the toolchain RESOLVES them off the project's plugin
|
|
12
|
+
* host. Each contributor owns a DISTINCT capability id (the plugin host enforces
|
|
13
|
+
* one-provider-per-id, so the two contributors cannot share a single id) — the
|
|
14
|
+
* toolchain merges the contributions it finds.
|
|
15
|
+
*
|
|
16
|
+
* Pure: types + branded ids, no behaviour.
|
|
17
|
+
*/
|
|
18
|
+
import type { CapabilityId } from "./capability-id";
|
|
19
|
+
/**
|
|
20
|
+
* One per-run hook binary build spec: the binary NAME (the basename the runtime
|
|
21
|
+
* dispatches by) and its `source` entrypoint, expressed RELATIVE to the rig
|
|
22
|
+
* source root (the same string the toolchain feeds to `buildBinary`).
|
|
23
|
+
*/
|
|
24
|
+
export interface ToolchainHookBinarySource {
|
|
25
|
+
readonly name: string;
|
|
26
|
+
readonly source: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A plugin's contribution of runtime-toolchain build sources.
|
|
30
|
+
*
|
|
31
|
+
* - `hookBinaries` are compiled uniformly into the runtime `hooks/` directory
|
|
32
|
+
* with the shared hook defines.
|
|
33
|
+
* - `namedSources` are standalone source paths the toolchain compiles with its
|
|
34
|
+
* own per-binary defines, keyed by a stable build id (e.g. `"controlled-bash"`).
|
|
35
|
+
*
|
|
36
|
+
* All paths are RELATIVE to the rig source root (unchanged from the literals the
|
|
37
|
+
* toolchain previously embedded), so resolution behaviour is identical.
|
|
38
|
+
*/
|
|
39
|
+
export interface ToolchainSourceContribution {
|
|
40
|
+
readonly hookBinaries?: ReadonlyArray<ToolchainHookBinarySource>;
|
|
41
|
+
readonly namedSources?: Readonly<Record<string, string>>;
|
|
42
|
+
}
|
|
43
|
+
/** Stable id for @rig/guard-plugin's toolchain-source contribution. */
|
|
44
|
+
export declare const GUARD_TOOLCHAIN_SOURCES_CAPABILITY_ID = "rig.toolchain.sources.guard";
|
|
45
|
+
/** Stable id for @rig/lifecycle-plugin's toolchain-source contribution. */
|
|
46
|
+
export declare const LIFECYCLE_TOOLCHAIN_SOURCES_CAPABILITY_ID = "rig.toolchain.sources.lifecycle";
|
|
47
|
+
/**
|
|
48
|
+
* The guard-plugin toolchain-source capability id. `defineCapability(...)` (the
|
|
49
|
+
* provider and the isolation-plugin consumer construct it independently from the
|
|
50
|
+
* shared id) resolves to a `ToolchainSourceContribution`.
|
|
51
|
+
*/
|
|
52
|
+
export declare const GUARD_TOOLCHAIN_SOURCES: CapabilityId<ToolchainSourceContribution>;
|
|
53
|
+
/** The bundle-default-lifecycle toolchain-source capability id. */
|
|
54
|
+
export declare const LIFECYCLE_TOOLCHAIN_SOURCES: CapabilityId<ToolchainSourceContribution>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/capability-id.ts
|
|
3
|
+
function makeCapabilityId(id) {
|
|
4
|
+
return id;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// packages/contracts/src/toolchain-sources.ts
|
|
8
|
+
var GUARD_TOOLCHAIN_SOURCES_CAPABILITY_ID = "rig.toolchain.sources.guard";
|
|
9
|
+
var LIFECYCLE_TOOLCHAIN_SOURCES_CAPABILITY_ID = "rig.toolchain.sources.lifecycle";
|
|
10
|
+
var GUARD_TOOLCHAIN_SOURCES = makeCapabilityId(GUARD_TOOLCHAIN_SOURCES_CAPABILITY_ID);
|
|
11
|
+
var LIFECYCLE_TOOLCHAIN_SOURCES = makeCapabilityId(LIFECYCLE_TOOLCHAIN_SOURCES_CAPABILITY_ID);
|
|
12
|
+
export {
|
|
13
|
+
LIFECYCLE_TOOLCHAIN_SOURCES_CAPABILITY_ID,
|
|
14
|
+
LIFECYCLE_TOOLCHAIN_SOURCES,
|
|
15
|
+
GUARD_TOOLCHAIN_SOURCES_CAPABILITY_ID,
|
|
16
|
+
GUARD_TOOLCHAIN_SOURCES
|
|
17
|
+
};
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import type { CapabilityId } from "./capability-id";
|
|
2
|
+
export type TransportConfigEnv = Readonly<Record<string, string | undefined>>;
|
|
3
|
+
export declare const DEFAULT_REMOTE_PORT = 7890;
|
|
4
|
+
export type RemoteConfigEntry = {
|
|
5
|
+
host?: string;
|
|
6
|
+
port?: number;
|
|
7
|
+
token?: string;
|
|
8
|
+
addedAt?: string;
|
|
9
|
+
lastConnected?: string;
|
|
10
|
+
};
|
|
11
|
+
export type RemotesToml = {
|
|
12
|
+
version?: number;
|
|
13
|
+
remotes?: Record<string, RemoteConfigEntry>;
|
|
14
|
+
};
|
|
15
|
+
export type AuthorityRemoteEndpointRecord = {
|
|
16
|
+
id: string;
|
|
17
|
+
alias: string;
|
|
18
|
+
host: string;
|
|
19
|
+
port: number;
|
|
20
|
+
transport: string;
|
|
21
|
+
auto_connect: boolean;
|
|
22
|
+
labels: string[];
|
|
23
|
+
capabilities: string[];
|
|
24
|
+
secret_ref: string;
|
|
25
|
+
created_at: string;
|
|
26
|
+
updated_at: string;
|
|
27
|
+
last_connected_at?: string | null;
|
|
28
|
+
};
|
|
29
|
+
export type AuthorityRemoteEndpointsToml = {
|
|
30
|
+
version?: number;
|
|
31
|
+
endpoints?: Record<string, AuthorityRemoteEndpointRecord>;
|
|
32
|
+
};
|
|
33
|
+
export type AuthorityRemoteSecretsToml = {
|
|
34
|
+
version?: number;
|
|
35
|
+
secrets?: Record<string, string>;
|
|
36
|
+
};
|
|
37
|
+
export type AuthorityMaterializedRemoteEndpoint = {
|
|
38
|
+
id: string;
|
|
39
|
+
alias: string;
|
|
40
|
+
host: string;
|
|
41
|
+
port: number;
|
|
42
|
+
token: string;
|
|
43
|
+
autoConnect: boolean;
|
|
44
|
+
addedAt: string;
|
|
45
|
+
updatedAt: string;
|
|
46
|
+
lastConnectedAt: string | null;
|
|
47
|
+
labels: string[];
|
|
48
|
+
capabilities: string[];
|
|
49
|
+
transport: string;
|
|
50
|
+
secretRef: string;
|
|
51
|
+
};
|
|
52
|
+
export type ManagedRemoteEndpoint = {
|
|
53
|
+
id: string;
|
|
54
|
+
alias: string;
|
|
55
|
+
host: string;
|
|
56
|
+
port: number;
|
|
57
|
+
token: string;
|
|
58
|
+
addedAt: string | null;
|
|
59
|
+
lastConnected: string | null;
|
|
60
|
+
};
|
|
61
|
+
export type RemoteEndpointMigrationResult = {
|
|
62
|
+
readonly imported: number;
|
|
63
|
+
readonly skipped: number;
|
|
64
|
+
readonly sourcePath: string;
|
|
65
|
+
};
|
|
66
|
+
export type RemoteEndpointDoctorResult = {
|
|
67
|
+
readonly manifestPath: string;
|
|
68
|
+
readonly secretsPath: string;
|
|
69
|
+
readonly endpointCount: number;
|
|
70
|
+
readonly missingSecrets: readonly string[];
|
|
71
|
+
readonly warnings: readonly string[];
|
|
72
|
+
};
|
|
73
|
+
export type SelectedRemote = {
|
|
74
|
+
alias: string;
|
|
75
|
+
host: string;
|
|
76
|
+
port: number;
|
|
77
|
+
sshTarget: string;
|
|
78
|
+
checkout: string | null;
|
|
79
|
+
registryBaseUrl: string | null;
|
|
80
|
+
secretRef: string | null;
|
|
81
|
+
};
|
|
82
|
+
export type DispatchTransportPlacement = {
|
|
83
|
+
readonly kind: "local";
|
|
84
|
+
readonly alias: "local";
|
|
85
|
+
readonly sshTarget: null;
|
|
86
|
+
readonly selected: null;
|
|
87
|
+
} | {
|
|
88
|
+
readonly kind: "remote";
|
|
89
|
+
readonly alias: string;
|
|
90
|
+
readonly sshTarget: string;
|
|
91
|
+
readonly selected: SelectedRemote | null;
|
|
92
|
+
};
|
|
93
|
+
export interface TransportConfigService {
|
|
94
|
+
readonly resolveRelayUrl: (input?: {
|
|
95
|
+
readonly env?: TransportConfigEnv;
|
|
96
|
+
}) => string;
|
|
97
|
+
readonly resolveSshTarget: (input?: {
|
|
98
|
+
readonly env?: TransportConfigEnv;
|
|
99
|
+
}) => string;
|
|
100
|
+
readonly listManagedRemoteEndpoints: (input?: {
|
|
101
|
+
readonly configPath?: string;
|
|
102
|
+
readonly projectRoot?: string;
|
|
103
|
+
}) => readonly ManagedRemoteEndpoint[];
|
|
104
|
+
readonly upsertManagedRemoteEndpoint: (input: {
|
|
105
|
+
readonly endpoint: {
|
|
106
|
+
readonly alias: string;
|
|
107
|
+
readonly host: string;
|
|
108
|
+
readonly port: number;
|
|
109
|
+
readonly token?: string;
|
|
110
|
+
};
|
|
111
|
+
readonly configPath?: string;
|
|
112
|
+
readonly projectRoot?: string;
|
|
113
|
+
}) => ManagedRemoteEndpoint;
|
|
114
|
+
readonly updateAuthorityRemoteEndpoint: (input: {
|
|
115
|
+
readonly projectRoot: string;
|
|
116
|
+
readonly endpoint: {
|
|
117
|
+
readonly endpointId?: string;
|
|
118
|
+
readonly alias?: string;
|
|
119
|
+
readonly host?: string;
|
|
120
|
+
readonly port?: number;
|
|
121
|
+
readonly token?: string;
|
|
122
|
+
readonly autoConnect?: boolean;
|
|
123
|
+
readonly transport?: string;
|
|
124
|
+
readonly labels?: readonly string[];
|
|
125
|
+
readonly capabilities?: readonly string[];
|
|
126
|
+
};
|
|
127
|
+
}) => AuthorityMaterializedRemoteEndpoint | null;
|
|
128
|
+
readonly removeManagedRemoteEndpoint: (input: {
|
|
129
|
+
readonly alias: string;
|
|
130
|
+
readonly configPath?: string;
|
|
131
|
+
readonly projectRoot?: string;
|
|
132
|
+
}) => boolean;
|
|
133
|
+
readonly migrateManagedRemoteEndpoints: (input: {
|
|
134
|
+
readonly projectRoot: string;
|
|
135
|
+
readonly legacyPath?: string;
|
|
136
|
+
}) => RemoteEndpointMigrationResult;
|
|
137
|
+
readonly doctorManagedRemoteEndpoints: (input: {
|
|
138
|
+
readonly projectRoot: string;
|
|
139
|
+
}) => RemoteEndpointDoctorResult;
|
|
140
|
+
readonly resolveSelectedRemote: (input: {
|
|
141
|
+
readonly projectRoot: string;
|
|
142
|
+
readonly env?: TransportConfigEnv;
|
|
143
|
+
}) => SelectedRemote | null;
|
|
144
|
+
readonly resolveDispatchTransportPlacement: (input: {
|
|
145
|
+
readonly projectRoot: string;
|
|
146
|
+
readonly env?: TransportConfigEnv;
|
|
147
|
+
}) => DispatchTransportPlacement;
|
|
148
|
+
readonly resolveRegistryBaseUrl: (input: {
|
|
149
|
+
readonly projectRoot: string;
|
|
150
|
+
readonly env?: TransportConfigEnv;
|
|
151
|
+
}) => string;
|
|
152
|
+
readonly resolveOwnerNamespaceKey: (input: {
|
|
153
|
+
readonly projectRoot: string;
|
|
154
|
+
readonly env?: TransportConfigEnv;
|
|
155
|
+
}) => string | null;
|
|
156
|
+
readonly resolveRigOmpConfigOverlayPath: (input: {
|
|
157
|
+
readonly projectRoot: string;
|
|
158
|
+
}) => string;
|
|
159
|
+
}
|
|
160
|
+
export declare const TRANSPORT_CONFIG_CAPABILITY_ID = "rig.transport.config";
|
|
161
|
+
export declare const TRANSPORT_CONFIG: CapabilityId<TransportConfigService>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/capability-id.ts
|
|
3
|
+
function makeCapabilityId(id) {
|
|
4
|
+
return id;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// packages/contracts/src/transport-config.ts
|
|
8
|
+
var DEFAULT_REMOTE_PORT = 7890;
|
|
9
|
+
var TRANSPORT_CONFIG_CAPABILITY_ID = "rig.transport.config";
|
|
10
|
+
var TRANSPORT_CONFIG = makeCapabilityId(TRANSPORT_CONFIG_CAPABILITY_ID);
|
|
11
|
+
export {
|
|
12
|
+
TRANSPORT_CONFIG_CAPABILITY_ID,
|
|
13
|
+
TRANSPORT_CONFIG,
|
|
14
|
+
DEFAULT_REMOTE_PORT
|
|
15
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const ValidationStatus: Schema.Literals<readonly ["pending", "running", "passed", "failed", "skipped"]>;
|
|
3
|
+
export type ValidationStatus = typeof ValidationStatus.Type;
|
|
4
|
+
export declare const ValidationSummary: Schema.Struct<{
|
|
5
|
+
readonly id: Schema.brand<Schema.Trim, "ValidationResultId">;
|
|
6
|
+
readonly runId: Schema.brand<Schema.Trim, "RunId">;
|
|
7
|
+
readonly taskId: Schema.NullOr<Schema.brand<Schema.Trim, "TaskId">>;
|
|
8
|
+
readonly validatorKey: Schema.Trim;
|
|
9
|
+
readonly status: Schema.Literals<readonly ["pending", "running", "passed", "failed", "skipped"]>;
|
|
10
|
+
readonly output: Schema.Unknown;
|
|
11
|
+
readonly startedAt: Schema.String;
|
|
12
|
+
readonly completedAt: Schema.NullOr<Schema.String>;
|
|
13
|
+
}>;
|
|
14
|
+
export type ValidationSummary = typeof ValidationSummary.Type;
|
package/dist/src/validation.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");
|