@h-rig/contracts 0.0.6-alpha.16 → 0.0.6-alpha.160
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3280 -0
- package/dist/index.mjs +3239 -0
- package/dist/src/agent-roles.d.ts +8 -0
- package/dist/src/artifact.d.ts +13 -0
- package/dist/src/artifact.js +3 -0
- package/dist/src/baseSchemas.d.ts +63 -0
- package/dist/src/baseSchemas.js +6 -0
- package/dist/src/browser.d.ts +80 -0
- package/dist/src/browser.js +13 -0
- package/dist/src/capability-id.d.ts +22 -0
- package/dist/src/capability-id.js +8 -0
- package/dist/src/cli-output.d.ts +348 -0
- package/dist/src/cli-output.js +190 -0
- package/dist/src/cli-runner.d.ts +43 -0
- package/dist/src/cli-runner.js +13 -0
- package/dist/src/collab-session-viewer.d.ts +36 -0
- package/dist/src/collab-session-viewer.js +13 -0
- package/dist/src/config.d.ts +551 -0
- package/dist/src/config.js +765 -162
- package/dist/src/control-plane-types.d.ts +323 -0
- package/dist/src/control-plane-types.js +13 -0
- package/dist/src/conversation.d.ts +50 -0
- package/dist/src/conversation.js +3 -0
- package/dist/src/dependency-preflight.d.ts +43 -0
- package/dist/src/dependency-preflight.js +13 -0
- package/dist/src/doctor.d.ts +90 -0
- package/dist/src/doctor.js +13 -0
- package/dist/src/drift.d.ts +28 -0
- package/dist/src/drift.js +69 -0
- package/dist/src/editor.d.ts +25 -0
- package/dist/src/editor.js +3 -0
- package/dist/src/errors.d.ts +13 -0
- package/dist/src/errors.js +17 -0
- package/dist/src/git.d.ts +144 -0
- package/dist/src/git.js +3 -0
- package/dist/src/github.d.ts +146 -0
- package/dist/src/github.js +17 -0
- package/dist/src/graph.d.ts +360 -0
- package/dist/src/graph.js +137 -1
- package/dist/src/guard.d.ts +111 -0
- package/dist/src/guard.js +6 -0
- package/dist/src/harness-events.d.ts +8 -0
- package/dist/src/harness-events.js +1 -0
- package/dist/src/help-catalog.d.ts +41 -0
- package/dist/src/help-catalog.js +13 -0
- package/dist/src/host.d.ts +41 -0
- package/dist/src/host.js +13 -0
- package/dist/src/identity.d.ts +44 -0
- package/dist/src/identity.js +1 -0
- package/dist/src/index.d.ts +77 -0
- package/dist/src/index.js +2661 -3970
- package/dist/src/isolation.d.ts +213 -0
- package/dist/src/isolation.js +13 -0
- package/dist/src/kernel.d.ts +200 -0
- package/dist/src/kernel.js +261 -0
- package/dist/src/keybindings.d.ts +71 -0
- package/dist/src/keybindings.js +3 -0
- package/dist/src/layout.d.ts +49 -0
- package/dist/src/layout.js +10 -0
- package/dist/src/lifecycle-capabilities.d.ts +128 -0
- package/dist/src/lifecycle-capabilities.js +25 -0
- package/dist/src/managed-repos.d.ts +136 -0
- package/dist/src/managed-repos.js +17 -0
- package/dist/src/memory.d.ts +199 -0
- package/dist/src/memory.js +15 -0
- package/dist/src/model.d.ts +77 -0
- package/dist/src/notify.d.ts +46 -0
- package/dist/src/notify.js +13 -0
- package/dist/src/orchestration.d.ts +43 -0
- package/dist/src/orchestration.js +28 -961
- package/dist/src/panel-protocol.d.ts +17 -0
- package/dist/src/panel-protocol.js +10 -0
- package/dist/src/pi-session.d.ts +113 -0
- package/dist/src/pi-session.js +1 -0
- package/dist/src/planning.d.ts +64 -0
- package/dist/src/planning.js +90 -0
- package/dist/src/plugin-hooks.d.ts +51 -0
- package/dist/src/plugin-hooks.js +386 -0
- package/dist/src/plugin.d.ts +476 -0
- package/dist/src/plugin.js +346 -64
- package/dist/src/policy.d.ts +16 -0
- package/dist/src/policy.js +3 -0
- package/dist/src/project.d.ts +71 -0
- package/dist/src/project.js +3 -0
- package/dist/src/prompt.d.ts +29 -0
- package/dist/src/prompt.js +13 -0
- package/dist/src/protocol-version.d.ts +21 -0
- package/dist/src/protocol-version.js +6 -0
- package/dist/src/provider-instructions.d.ts +41 -0
- package/dist/src/provider-instructions.js +13 -0
- package/dist/src/provider.d.ts +105 -0
- package/dist/src/provider.js +4 -824
- package/dist/src/remote.d.ts +318 -0
- package/dist/src/remote.js +238 -1078
- package/dist/src/review.d.ts +18 -0
- package/dist/src/review.js +3 -0
- package/dist/src/rollups.d.ts +41 -0
- package/dist/src/rollups.js +70 -0
- package/dist/src/run-discovery.d.ts +79 -0
- package/dist/src/run-discovery.js +13 -0
- package/dist/src/run-dispatch.d.ts +34 -0
- package/dist/src/run-dispatch.js +13 -0
- package/dist/src/run-identity.d.ts +47 -0
- package/dist/src/run-identity.js +13 -0
- package/dist/src/run-journal.d.ts +694 -0
- package/dist/src/run-journal.js +569 -0
- package/dist/src/run-read-model.d.ts +234 -0
- package/dist/src/run-read-model.js +13 -0
- package/dist/src/run-record.d.ts +45 -0
- package/dist/src/run-record.js +1 -0
- package/dist/src/run-registry-backbone.d.ts +56 -0
- package/dist/src/run-registry-backbone.js +13 -0
- package/dist/src/run-session-journal.d.ts +69 -0
- package/dist/src/run-session-journal.js +78 -0
- package/dist/src/run-status.d.ts +10 -0
- package/dist/src/run-status.js +27 -0
- package/dist/src/run-timeline.d.ts +7 -0
- package/dist/src/run-timeline.js +1 -0
- package/dist/src/runtime-task-context.d.ts +82 -0
- package/dist/src/runtime-task-context.js +1 -0
- package/dist/src/runtime.d.ts +103 -0
- package/dist/src/runtime.js +73 -906
- package/dist/src/session-asset-materializer.d.ts +35 -0
- package/dist/src/session-asset-materializer.js +13 -0
- package/dist/src/setup.d.ts +47 -0
- package/dist/src/setup.js +13 -0
- package/dist/src/stage.d.ts +245 -0
- package/dist/src/stage.js +169 -0
- package/dist/src/supervisor-journal.d.ts +204 -0
- package/dist/src/supervisor-journal.js +334 -0
- package/dist/src/task-data.d.ts +239 -0
- package/dist/src/task-data.js +13 -0
- package/dist/src/task-graph-primitives.d.ts +47 -0
- package/dist/src/task-graph-primitives.js +1 -0
- package/dist/src/task-source.d.ts +102 -0
- package/dist/src/task-source.js +12 -0
- package/dist/src/task-state-metadata.d.ts +21 -0
- package/dist/src/task-state-metadata.js +1 -0
- package/dist/src/terminal.d.ts +130 -0
- package/dist/src/terminal.js +3 -0
- package/dist/src/tool-materializer.d.ts +36 -0
- package/dist/src/tool-materializer.js +13 -0
- package/dist/src/tool-registry.d.ts +3 -0
- package/dist/src/tool-registry.js +58 -0
- package/dist/src/toolchain-sources.d.ts +54 -0
- package/dist/src/toolchain-sources.js +17 -0
- package/dist/src/validation.d.ts +14 -0
- package/dist/src/validation.js +3 -0
- package/dist/src/workflow-journal.d.ts +92 -0
- package/dist/src/workflow-journal.js +18 -0
- package/dist/src/workspace-config.d.ts +18 -0
- package/dist/src/workspace-config.js +13 -0
- package/dist/src/workspace.d.ts +204 -0
- package/dist/src/workspace.js +76 -911
- package/package.json +51 -4
- package/dist/src/engine.js +0 -2278
- package/dist/src/providerRuntime.js +0 -1630
- package/dist/src/rig.js +0 -2374
- package/dist/src/server.js +0 -1053
- package/dist/src/serviceFabric.js +0 -1066
- package/dist/src/ws.js +0 -2968
- /package/dist/src/{ipc.js → agent-roles.js} +0 -0
|
@@ -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/bundle-default-lifecycle'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,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");
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export declare const RIG_WORKFLOW_STARTED: "rig.workflow.started";
|
|
2
|
+
export declare const RIG_WORKFLOW_TARGET_SELECTED: "rig.workflow.target.selected";
|
|
3
|
+
export declare const RIG_WORKFLOW_TASK_SELECTED: "rig.workflow.task.selected";
|
|
4
|
+
export declare const RIG_WORKFLOW_STATUS_CHANGED: "rig.workflow.status.changed";
|
|
5
|
+
export declare const RIG_WORKFLOW_OPERATOR_NOTE: "rig.workflow.operator.note";
|
|
6
|
+
export declare const RIG_WORKFLOW_INBOX_REQUESTED: "rig.workflow.inbox.requested";
|
|
7
|
+
export declare const RIG_WORKFLOW_INBOX_RESOLVED: "rig.workflow.inbox.resolved";
|
|
8
|
+
export type RigWorkflowEntryType = typeof RIG_WORKFLOW_STARTED | typeof RIG_WORKFLOW_TARGET_SELECTED | typeof RIG_WORKFLOW_TASK_SELECTED | typeof RIG_WORKFLOW_STATUS_CHANGED | typeof RIG_WORKFLOW_OPERATOR_NOTE | typeof RIG_WORKFLOW_INBOX_REQUESTED | typeof RIG_WORKFLOW_INBOX_RESOLVED;
|
|
9
|
+
export type RigWorkflowTarget = "local" | "remote";
|
|
10
|
+
export type RigWorkflowOwner = {
|
|
11
|
+
githubUserId: string;
|
|
12
|
+
login: string;
|
|
13
|
+
namespaceKey: string;
|
|
14
|
+
};
|
|
15
|
+
export type RigWorkflowStarted = {
|
|
16
|
+
schemaVersion: 1;
|
|
17
|
+
workflowId: string;
|
|
18
|
+
target: RigWorkflowTarget;
|
|
19
|
+
selectedRepo: string;
|
|
20
|
+
owner: RigWorkflowOwner;
|
|
21
|
+
createdAt: string;
|
|
22
|
+
};
|
|
23
|
+
export type RigWorkflowTargetSelected = {
|
|
24
|
+
schemaVersion: 1;
|
|
25
|
+
target: RigWorkflowTarget;
|
|
26
|
+
reason?: string;
|
|
27
|
+
selectedAt: string;
|
|
28
|
+
};
|
|
29
|
+
export type RigWorkflowTaskSelected = {
|
|
30
|
+
schemaVersion: 1;
|
|
31
|
+
taskId: string;
|
|
32
|
+
title?: string;
|
|
33
|
+
selectedAt: string;
|
|
34
|
+
};
|
|
35
|
+
export type RigWorkflowStatus = "starting" | "running" | "waiting-approval" | "waiting-input" | "completed" | "failed" | "stopped";
|
|
36
|
+
export type RigWorkflowStatusChanged = {
|
|
37
|
+
schemaVersion: 1;
|
|
38
|
+
status: RigWorkflowStatus;
|
|
39
|
+
detail?: string;
|
|
40
|
+
changedAt: string;
|
|
41
|
+
};
|
|
42
|
+
export type RigWorkflowOperatorNote = {
|
|
43
|
+
schemaVersion: 1;
|
|
44
|
+
noteId?: string;
|
|
45
|
+
note: string;
|
|
46
|
+
notedAt: string;
|
|
47
|
+
};
|
|
48
|
+
export type RigWorkflowInboxRequested = {
|
|
49
|
+
schemaVersion: 1;
|
|
50
|
+
requestId: string;
|
|
51
|
+
kind: "approval" | "input";
|
|
52
|
+
title: string;
|
|
53
|
+
body?: string;
|
|
54
|
+
options?: readonly string[];
|
|
55
|
+
requestedAt: string;
|
|
56
|
+
};
|
|
57
|
+
export type RigWorkflowInboxResolved = {
|
|
58
|
+
schemaVersion: 1;
|
|
59
|
+
requestId: string;
|
|
60
|
+
decision: "approved" | "rejected" | "answered";
|
|
61
|
+
answer?: unknown;
|
|
62
|
+
resolvedAt: string;
|
|
63
|
+
};
|
|
64
|
+
export type RigWorkflowProjection = {
|
|
65
|
+
started: RigWorkflowStarted | null;
|
|
66
|
+
target: RigWorkflowTargetSelected | null;
|
|
67
|
+
task: RigWorkflowTaskSelected | null;
|
|
68
|
+
status: RigWorkflowStatusChanged | null;
|
|
69
|
+
notes: readonly RigWorkflowOperatorNote[];
|
|
70
|
+
inbox: readonly RigWorkflowInboxRequested[];
|
|
71
|
+
resolvedInbox: readonly RigWorkflowInboxResolved[];
|
|
72
|
+
updatedAt: string | null;
|
|
73
|
+
};
|
|
74
|
+
export type RigWorkflowCustomEntry = {
|
|
75
|
+
type: string;
|
|
76
|
+
customType?: string;
|
|
77
|
+
data?: unknown;
|
|
78
|
+
};
|
|
79
|
+
export type RigCollabWorkflowMarkerInput = {
|
|
80
|
+
sessionId: string;
|
|
81
|
+
sessionPath: string;
|
|
82
|
+
cwd: string;
|
|
83
|
+
title: string;
|
|
84
|
+
joinLink: string;
|
|
85
|
+
webLink: string;
|
|
86
|
+
relayUrl?: string;
|
|
87
|
+
selectedRepo?: string;
|
|
88
|
+
owner?: Partial<RigWorkflowOwner>;
|
|
89
|
+
startedAt: string;
|
|
90
|
+
updatedAt: string;
|
|
91
|
+
stale: boolean;
|
|
92
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/workflow-journal.ts
|
|
3
|
+
var RIG_WORKFLOW_STARTED = "rig.workflow.started";
|
|
4
|
+
var RIG_WORKFLOW_TARGET_SELECTED = "rig.workflow.target.selected";
|
|
5
|
+
var RIG_WORKFLOW_TASK_SELECTED = "rig.workflow.task.selected";
|
|
6
|
+
var RIG_WORKFLOW_STATUS_CHANGED = "rig.workflow.status.changed";
|
|
7
|
+
var RIG_WORKFLOW_OPERATOR_NOTE = "rig.workflow.operator.note";
|
|
8
|
+
var RIG_WORKFLOW_INBOX_REQUESTED = "rig.workflow.inbox.requested";
|
|
9
|
+
var RIG_WORKFLOW_INBOX_RESOLVED = "rig.workflow.inbox.resolved";
|
|
10
|
+
export {
|
|
11
|
+
RIG_WORKFLOW_TASK_SELECTED,
|
|
12
|
+
RIG_WORKFLOW_TARGET_SELECTED,
|
|
13
|
+
RIG_WORKFLOW_STATUS_CHANGED,
|
|
14
|
+
RIG_WORKFLOW_STARTED,
|
|
15
|
+
RIG_WORKFLOW_OPERATOR_NOTE,
|
|
16
|
+
RIG_WORKFLOW_INBOX_RESOLVED,
|
|
17
|
+
RIG_WORKFLOW_INBOX_REQUESTED
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CapabilityId } from "./capability-id";
|
|
2
|
+
export type EnsureDeclarativeConfigInput = {
|
|
3
|
+
readonly projectRoot: string;
|
|
4
|
+
readonly repoSlug?: string;
|
|
5
|
+
};
|
|
6
|
+
export type EnsureDeclarativeConfigResult = {
|
|
7
|
+
/** True when this call wrote a new `.rig/rigfig.toml`. */
|
|
8
|
+
readonly created: boolean;
|
|
9
|
+
/** The rigfig path when one now exists (created or pre-existing), else null. */
|
|
10
|
+
readonly path: string | null;
|
|
11
|
+
/** Why nothing was created (code config present, no plugin produced a config, …). */
|
|
12
|
+
readonly reason?: string;
|
|
13
|
+
};
|
|
14
|
+
export interface WorkspaceConfigEnsureService {
|
|
15
|
+
ensureDeclarativeConfig(input: EnsureDeclarativeConfigInput): EnsureDeclarativeConfigResult;
|
|
16
|
+
}
|
|
17
|
+
export declare const WORKSPACE_CONFIG_ENSURE_CAPABILITY_ID = "workspace.config.ensure";
|
|
18
|
+
export declare const WORKSPACE_CONFIG_ENSURE: CapabilityId<WorkspaceConfigEnsureService>;
|
|
@@ -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/workspace-config.ts
|
|
8
|
+
var WORKSPACE_CONFIG_ENSURE_CAPABILITY_ID = "workspace.config.ensure";
|
|
9
|
+
var WORKSPACE_CONFIG_ENSURE = makeCapabilityId(WORKSPACE_CONFIG_ENSURE_CAPABILITY_ID);
|
|
10
|
+
export {
|
|
11
|
+
WORKSPACE_CONFIG_ENSURE_CAPABILITY_ID,
|
|
12
|
+
WORKSPACE_CONFIG_ENSURE
|
|
13
|
+
};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const WorkspaceSourceKind: Schema.Literals<readonly ["native", "rig-import", "manual", "remote"]>;
|
|
3
|
+
export type WorkspaceSourceKind = typeof WorkspaceSourceKind.Type;
|
|
4
|
+
export declare const WorkspaceTopologyStatus: Schema.Literals<readonly ["empty", "ready", "degraded"]>;
|
|
5
|
+
export type WorkspaceTopologyStatus = typeof WorkspaceTopologyStatus.Type;
|
|
6
|
+
export declare const WorkspaceRemoteFleetStatus: Schema.Literals<readonly ["empty", "ready", "degraded"]>;
|
|
7
|
+
export type WorkspaceRemoteFleetStatus = typeof WorkspaceRemoteFleetStatus.Type;
|
|
8
|
+
export declare const WorkspaceServiceFabricStatus: Schema.Literals<readonly ["empty", "booting", "ready", "degraded", "stopped"]>;
|
|
9
|
+
export type WorkspaceServiceFabricStatus = typeof WorkspaceServiceFabricStatus.Type;
|
|
10
|
+
export declare const WorkspaceRemoteHostStatus: Schema.Literals<readonly ["registering", "ready", "busy", "degraded", "draining", "offline", "quarantined"]>;
|
|
11
|
+
export type WorkspaceRemoteHostStatus = typeof WorkspaceRemoteHostStatus.Type;
|
|
12
|
+
export declare const WorkspaceTopologyServiceSummary: Schema.Struct<{
|
|
13
|
+
readonly name: Schema.Trim;
|
|
14
|
+
readonly relativeRootPath: Schema.Trim;
|
|
15
|
+
readonly runtime: Schema.Trim;
|
|
16
|
+
readonly port: Schema.NullOr<Schema.Number>;
|
|
17
|
+
readonly healthcheck: Schema.NullOr<Schema.Trim>;
|
|
18
|
+
readonly sourceOfTruth: Schema.Struct<{
|
|
19
|
+
readonly code: Schema.NullOr<Schema.Trim>;
|
|
20
|
+
readonly tests: Schema.NullOr<Schema.Trim>;
|
|
21
|
+
readonly infra: Schema.NullOr<Schema.Trim>;
|
|
22
|
+
readonly deploy: Schema.NullOr<Schema.Trim>;
|
|
23
|
+
readonly dependencies: Schema.NullOr<Schema.Trim>;
|
|
24
|
+
}>;
|
|
25
|
+
readonly splitReadyChecklist: Schema.$Array<Schema.Trim>;
|
|
26
|
+
}>;
|
|
27
|
+
export type WorkspaceTopologyServiceSummary = typeof WorkspaceTopologyServiceSummary.Type;
|
|
28
|
+
export declare const WorkspaceTopologySummary: Schema.Struct<{
|
|
29
|
+
readonly compiledAt: Schema.String;
|
|
30
|
+
readonly status: Schema.Literals<readonly ["empty", "ready", "degraded"]>;
|
|
31
|
+
readonly manifestCount: Schema.Number;
|
|
32
|
+
readonly serviceCount: Schema.Number;
|
|
33
|
+
readonly services: Schema.$Array<Schema.Struct<{
|
|
34
|
+
readonly name: Schema.Trim;
|
|
35
|
+
readonly relativeRootPath: Schema.Trim;
|
|
36
|
+
readonly runtime: Schema.Trim;
|
|
37
|
+
readonly port: Schema.NullOr<Schema.Number>;
|
|
38
|
+
readonly healthcheck: Schema.NullOr<Schema.Trim>;
|
|
39
|
+
readonly sourceOfTruth: Schema.Struct<{
|
|
40
|
+
readonly code: Schema.NullOr<Schema.Trim>;
|
|
41
|
+
readonly tests: Schema.NullOr<Schema.Trim>;
|
|
42
|
+
readonly infra: Schema.NullOr<Schema.Trim>;
|
|
43
|
+
readonly deploy: Schema.NullOr<Schema.Trim>;
|
|
44
|
+
readonly dependencies: Schema.NullOr<Schema.Trim>;
|
|
45
|
+
}>;
|
|
46
|
+
readonly splitReadyChecklist: Schema.$Array<Schema.Trim>;
|
|
47
|
+
}>>;
|
|
48
|
+
readonly warnings: Schema.$Array<Schema.String>;
|
|
49
|
+
}>;
|
|
50
|
+
export type WorkspaceTopologySummary = typeof WorkspaceTopologySummary.Type;
|
|
51
|
+
export declare const WorkspaceRemoteHostSummary: Schema.Struct<{
|
|
52
|
+
readonly id: Schema.Trim;
|
|
53
|
+
readonly name: Schema.Trim;
|
|
54
|
+
readonly baseUrl: Schema.Trim;
|
|
55
|
+
readonly workspacePath: Schema.NullOr<Schema.Trim>;
|
|
56
|
+
readonly transport: Schema.Trim;
|
|
57
|
+
readonly hostname: Schema.NullOr<Schema.Trim>;
|
|
58
|
+
readonly region: Schema.NullOr<Schema.Trim>;
|
|
59
|
+
readonly labels: Schema.$Array<Schema.Trim>;
|
|
60
|
+
readonly capabilities: Schema.$Array<Schema.Trim>;
|
|
61
|
+
readonly runtimeAdapters: Schema.$Array<Schema.Literal<"pi">>;
|
|
62
|
+
readonly status: Schema.Literals<readonly ["registering", "ready", "busy", "degraded", "draining", "offline", "quarantined"]>;
|
|
63
|
+
readonly currentLeaseCount: Schema.Number;
|
|
64
|
+
readonly lastHeartbeatAt: Schema.NullOr<Schema.String>;
|
|
65
|
+
readonly registeredAt: Schema.String;
|
|
66
|
+
readonly manifestPath: Schema.Trim;
|
|
67
|
+
}>;
|
|
68
|
+
export type WorkspaceRemoteHostSummary = typeof WorkspaceRemoteHostSummary.Type;
|
|
69
|
+
export declare const WorkspaceRemoteFleetSummary: Schema.Struct<{
|
|
70
|
+
readonly updatedAt: Schema.String;
|
|
71
|
+
readonly status: Schema.Literals<readonly ["empty", "ready", "degraded"]>;
|
|
72
|
+
readonly manifestCount: Schema.Number;
|
|
73
|
+
readonly hostCount: Schema.Number;
|
|
74
|
+
readonly onlineHostCount: Schema.Number;
|
|
75
|
+
readonly hosts: Schema.$Array<Schema.Struct<{
|
|
76
|
+
readonly id: Schema.Trim;
|
|
77
|
+
readonly name: Schema.Trim;
|
|
78
|
+
readonly baseUrl: Schema.Trim;
|
|
79
|
+
readonly workspacePath: Schema.NullOr<Schema.Trim>;
|
|
80
|
+
readonly transport: Schema.Trim;
|
|
81
|
+
readonly hostname: Schema.NullOr<Schema.Trim>;
|
|
82
|
+
readonly region: Schema.NullOr<Schema.Trim>;
|
|
83
|
+
readonly labels: Schema.$Array<Schema.Trim>;
|
|
84
|
+
readonly capabilities: Schema.$Array<Schema.Trim>;
|
|
85
|
+
readonly runtimeAdapters: Schema.$Array<Schema.Literal<"pi">>;
|
|
86
|
+
readonly status: Schema.Literals<readonly ["registering", "ready", "busy", "degraded", "draining", "offline", "quarantined"]>;
|
|
87
|
+
readonly currentLeaseCount: Schema.Number;
|
|
88
|
+
readonly lastHeartbeatAt: Schema.NullOr<Schema.String>;
|
|
89
|
+
readonly registeredAt: Schema.String;
|
|
90
|
+
readonly manifestPath: Schema.Trim;
|
|
91
|
+
}>>;
|
|
92
|
+
readonly warnings: Schema.$Array<Schema.String>;
|
|
93
|
+
}>;
|
|
94
|
+
export type WorkspaceRemoteFleetSummary = typeof WorkspaceRemoteFleetSummary.Type;
|
|
95
|
+
export declare const WorkspaceServiceFabricServiceSummary: Schema.Struct<{
|
|
96
|
+
readonly name: Schema.Trim;
|
|
97
|
+
readonly relativeRootPath: Schema.Trim;
|
|
98
|
+
readonly mode: Schema.Literals<readonly ["stub", "process"]>;
|
|
99
|
+
readonly port: Schema.Number;
|
|
100
|
+
readonly healthcheck: Schema.Trim;
|
|
101
|
+
readonly routePrefix: Schema.NullOr<Schema.Trim>;
|
|
102
|
+
readonly status: Schema.Literals<readonly ["planned", "booting", "healthy", "degraded", "failed", "stopped"]>;
|
|
103
|
+
readonly pid: Schema.NullOr<Schema.Number>;
|
|
104
|
+
readonly logPath: Schema.NullOr<Schema.Trim>;
|
|
105
|
+
}>;
|
|
106
|
+
export type WorkspaceServiceFabricServiceSummary = typeof WorkspaceServiceFabricServiceSummary.Type;
|
|
107
|
+
export declare const WorkspaceServiceFabricSummary: Schema.Struct<{
|
|
108
|
+
readonly updatedAt: Schema.String;
|
|
109
|
+
readonly status: Schema.Literals<readonly ["empty", "booting", "ready", "degraded", "stopped"]>;
|
|
110
|
+
readonly serviceCount: Schema.Number;
|
|
111
|
+
readonly healthyServiceCount: Schema.Number;
|
|
112
|
+
readonly stateDir: Schema.Trim;
|
|
113
|
+
readonly services: Schema.$Array<Schema.Struct<{
|
|
114
|
+
readonly name: Schema.Trim;
|
|
115
|
+
readonly relativeRootPath: Schema.Trim;
|
|
116
|
+
readonly mode: Schema.Literals<readonly ["stub", "process"]>;
|
|
117
|
+
readonly port: Schema.Number;
|
|
118
|
+
readonly healthcheck: Schema.Trim;
|
|
119
|
+
readonly routePrefix: Schema.NullOr<Schema.Trim>;
|
|
120
|
+
readonly status: Schema.Literals<readonly ["planned", "booting", "healthy", "degraded", "failed", "stopped"]>;
|
|
121
|
+
readonly pid: Schema.NullOr<Schema.Number>;
|
|
122
|
+
readonly logPath: Schema.NullOr<Schema.Trim>;
|
|
123
|
+
}>>;
|
|
124
|
+
readonly warnings: Schema.$Array<Schema.String>;
|
|
125
|
+
}>;
|
|
126
|
+
export type WorkspaceServiceFabricSummary = typeof WorkspaceServiceFabricSummary.Type;
|
|
127
|
+
export declare const WorkspaceSummary: Schema.Struct<{
|
|
128
|
+
readonly id: Schema.brand<Schema.Trim, "WorkspaceId">;
|
|
129
|
+
readonly title: Schema.Trim;
|
|
130
|
+
readonly rootPath: Schema.Trim;
|
|
131
|
+
readonly sourceKind: Schema.Literals<readonly ["native", "rig-import", "manual", "remote"]>;
|
|
132
|
+
readonly defaultRuntimeAdapter: Schema.optional<Schema.Literal<"pi">>;
|
|
133
|
+
readonly defaultProvider: Schema.optional<Schema.Literals<readonly ["codex", "claude"]>>;
|
|
134
|
+
readonly defaultModel: Schema.NullOr<Schema.Trim>;
|
|
135
|
+
readonly topology: Schema.optional<Schema.Struct<{
|
|
136
|
+
readonly compiledAt: Schema.String;
|
|
137
|
+
readonly status: Schema.Literals<readonly ["empty", "ready", "degraded"]>;
|
|
138
|
+
readonly manifestCount: Schema.Number;
|
|
139
|
+
readonly serviceCount: Schema.Number;
|
|
140
|
+
readonly services: Schema.$Array<Schema.Struct<{
|
|
141
|
+
readonly name: Schema.Trim;
|
|
142
|
+
readonly relativeRootPath: Schema.Trim;
|
|
143
|
+
readonly runtime: Schema.Trim;
|
|
144
|
+
readonly port: Schema.NullOr<Schema.Number>;
|
|
145
|
+
readonly healthcheck: Schema.NullOr<Schema.Trim>;
|
|
146
|
+
readonly sourceOfTruth: Schema.Struct<{
|
|
147
|
+
readonly code: Schema.NullOr<Schema.Trim>;
|
|
148
|
+
readonly tests: Schema.NullOr<Schema.Trim>;
|
|
149
|
+
readonly infra: Schema.NullOr<Schema.Trim>;
|
|
150
|
+
readonly deploy: Schema.NullOr<Schema.Trim>;
|
|
151
|
+
readonly dependencies: Schema.NullOr<Schema.Trim>;
|
|
152
|
+
}>;
|
|
153
|
+
readonly splitReadyChecklist: Schema.$Array<Schema.Trim>;
|
|
154
|
+
}>>;
|
|
155
|
+
readonly warnings: Schema.$Array<Schema.String>;
|
|
156
|
+
}>>;
|
|
157
|
+
readonly remoteFleet: Schema.optional<Schema.Struct<{
|
|
158
|
+
readonly updatedAt: Schema.String;
|
|
159
|
+
readonly status: Schema.Literals<readonly ["empty", "ready", "degraded"]>;
|
|
160
|
+
readonly manifestCount: Schema.Number;
|
|
161
|
+
readonly hostCount: Schema.Number;
|
|
162
|
+
readonly onlineHostCount: Schema.Number;
|
|
163
|
+
readonly hosts: Schema.$Array<Schema.Struct<{
|
|
164
|
+
readonly id: Schema.Trim;
|
|
165
|
+
readonly name: Schema.Trim;
|
|
166
|
+
readonly baseUrl: Schema.Trim;
|
|
167
|
+
readonly workspacePath: Schema.NullOr<Schema.Trim>;
|
|
168
|
+
readonly transport: Schema.Trim;
|
|
169
|
+
readonly hostname: Schema.NullOr<Schema.Trim>;
|
|
170
|
+
readonly region: Schema.NullOr<Schema.Trim>;
|
|
171
|
+
readonly labels: Schema.$Array<Schema.Trim>;
|
|
172
|
+
readonly capabilities: Schema.$Array<Schema.Trim>;
|
|
173
|
+
readonly runtimeAdapters: Schema.$Array<Schema.Literal<"pi">>;
|
|
174
|
+
readonly status: Schema.Literals<readonly ["registering", "ready", "busy", "degraded", "draining", "offline", "quarantined"]>;
|
|
175
|
+
readonly currentLeaseCount: Schema.Number;
|
|
176
|
+
readonly lastHeartbeatAt: Schema.NullOr<Schema.String>;
|
|
177
|
+
readonly registeredAt: Schema.String;
|
|
178
|
+
readonly manifestPath: Schema.Trim;
|
|
179
|
+
}>>;
|
|
180
|
+
readonly warnings: Schema.$Array<Schema.String>;
|
|
181
|
+
}>>;
|
|
182
|
+
readonly serviceFabric: Schema.optional<Schema.Struct<{
|
|
183
|
+
readonly updatedAt: Schema.String;
|
|
184
|
+
readonly status: Schema.Literals<readonly ["empty", "booting", "ready", "degraded", "stopped"]>;
|
|
185
|
+
readonly serviceCount: Schema.Number;
|
|
186
|
+
readonly healthyServiceCount: Schema.Number;
|
|
187
|
+
readonly stateDir: Schema.Trim;
|
|
188
|
+
readonly services: Schema.$Array<Schema.Struct<{
|
|
189
|
+
readonly name: Schema.Trim;
|
|
190
|
+
readonly relativeRootPath: Schema.Trim;
|
|
191
|
+
readonly mode: Schema.Literals<readonly ["stub", "process"]>;
|
|
192
|
+
readonly port: Schema.Number;
|
|
193
|
+
readonly healthcheck: Schema.Trim;
|
|
194
|
+
readonly routePrefix: Schema.NullOr<Schema.Trim>;
|
|
195
|
+
readonly status: Schema.Literals<readonly ["planned", "booting", "healthy", "degraded", "failed", "stopped"]>;
|
|
196
|
+
readonly pid: Schema.NullOr<Schema.Number>;
|
|
197
|
+
readonly logPath: Schema.NullOr<Schema.Trim>;
|
|
198
|
+
}>>;
|
|
199
|
+
readonly warnings: Schema.$Array<Schema.String>;
|
|
200
|
+
}>>;
|
|
201
|
+
readonly createdAt: Schema.String;
|
|
202
|
+
readonly updatedAt: Schema.String;
|
|
203
|
+
}>;
|
|
204
|
+
export type WorkspaceSummary = typeof WorkspaceSummary.Type;
|