@h-rig/contracts 0.0.6-alpha.157 → 0.0.6-alpha.158
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 +2340 -6832
- package/dist/index.mjs +2116 -6608
- package/dist/src/agent-roles.d.ts +8 -0
- package/dist/src/browser.d.ts +34 -4
- package/dist/src/browser.js +8 -1
- package/dist/src/capability-id.d.ts +22 -0
- package/dist/src/capability-id.js +8 -0
- package/dist/src/cli-output.d.ts +24 -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 +11 -0
- package/dist/src/config.js +279 -1098
- package/dist/src/control-plane-types.d.ts +41 -1
- package/dist/src/control-plane-types.js +9 -25
- package/dist/src/dependency-preflight.d.ts +43 -0
- package/dist/src/dependency-preflight.js +13 -0
- package/dist/src/doctor.d.ts +67 -4
- package/dist/src/doctor.js +8 -9
- package/dist/src/errors.d.ts +13 -0
- package/dist/src/errors.js +17 -0
- package/dist/src/github.d.ts +43 -0
- package/dist/src/github.js +12 -1
- package/dist/src/graph.d.ts +37 -0
- package/dist/src/graph.js +13 -0
- 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 +17 -10
- package/dist/src/help-catalog.js +9 -651
- 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 +27 -7
- package/dist/src/index.js +2116 -6608
- package/dist/src/isolation.d.ts +207 -15
- package/dist/src/isolation.js +8 -1
- package/dist/src/kernel.d.ts +11 -0
- package/dist/src/kernel.js +7 -0
- package/dist/src/layout.d.ts +49 -0
- package/dist/src/layout.js +10 -0
- package/dist/src/lifecycle-capabilities.d.ts +99 -0
- package/dist/src/lifecycle-capabilities.js +18 -1
- package/dist/src/managed-repos.d.ts +79 -16
- package/dist/src/managed-repos.js +12 -1
- package/dist/src/memory.d.ts +52 -4
- package/dist/src/memory.js +8 -1
- package/dist/src/notify.d.ts +46 -0
- package/dist/src/notify.js +13 -0
- package/dist/src/orchestration.d.ts +0 -3652
- package/dist/src/orchestration.js +28 -964
- package/dist/src/plugin-hooks.js +22 -3
- package/dist/src/plugin.d.ts +47 -0
- package/dist/src/plugin.js +24 -3
- package/dist/src/prompt.d.ts +29 -0
- package/dist/src/prompt.js +13 -0
- package/dist/src/provider-instructions.d.ts +26 -4
- package/dist/src/provider-instructions.js +8 -1
- package/dist/src/provider.js +1 -824
- package/dist/src/remote.d.ts +0 -8
- package/dist/src/remote.js +229 -1075
- 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 +0 -236
- package/dist/src/run-journal.js +249 -1321
- 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 +0 -11
- package/dist/src/run-record.js +0 -16
- 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 +1 -25
- package/dist/src/run-session-journal.js +0 -1731
- package/dist/src/run-status.d.ts +0 -2
- package/dist/src/run-status.js +0 -11
- package/dist/src/run-timeline.d.ts +0 -3
- package/dist/src/run-timeline.js +0 -1498
- package/dist/src/runtime-task-context.d.ts +82 -0
- package/dist/src/runtime-task-context.js +1 -0
- package/dist/src/runtime.js +66 -904
- 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/supervisor-journal.js +117 -955
- 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 +0 -21
- package/dist/src/task-graph-primitives.js +0 -318
- package/dist/src/task-source.d.ts +65 -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/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/workflow-journal.d.ts +0 -32
- package/dist/src/workflow-journal.js +0 -371
- package/dist/src/workspace-config.d.ts +18 -0
- package/dist/src/workspace-config.js +13 -0
- package/dist/src/workspace.js +73 -911
- package/package.json +1 -1
- package/dist/src/engine.d.ts +0 -2789
- package/dist/src/engine.js +0 -2392
- package/dist/src/ipc.d.ts +0 -248
- package/dist/src/providerRuntime.d.ts +0 -3949
- package/dist/src/providerRuntime.js +0 -1633
- package/dist/src/rig.d.ts +0 -783
- package/dist/src/rig.js +0 -2537
- package/dist/src/server.d.ts +0 -106
- package/dist/src/server.js +0 -1056
- package/dist/src/serviceFabric.d.ts +0 -62
- package/dist/src/serviceFabric.js +0 -1069
- package/dist/src/ws.d.ts +0 -747
- package/dist/src/ws.js +0 -3126
- /package/dist/src/{ipc.js → agent-roles.js} +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run-discovery capability seam.
|
|
3
|
+
*
|
|
4
|
+
* Contracts-native types for the RUN_DISCOVERY service: inline structural
|
|
5
|
+
* equivalents of the @oh-my-pi and @rig/relay-registry types. We define
|
|
6
|
+
* them here rather than importing from those packages to keep @rig/contracts
|
|
7
|
+
* floor-neutral (@rig/relay-registry depends on @rig/contracts — importing
|
|
8
|
+
* relay-registry here would be circular; @oh-my-pi is a vendor package that
|
|
9
|
+
* doesn't belong on the floor).
|
|
10
|
+
*
|
|
11
|
+
* TypeScript's structural type system makes these compatible with the
|
|
12
|
+
* corresponding @oh-my-pi / relay-registry types at the impl site.
|
|
13
|
+
*
|
|
14
|
+
* Pure: types + one branded id, no behaviour.
|
|
15
|
+
*/
|
|
16
|
+
import type { CapabilityId } from "./capability-id";
|
|
17
|
+
import type { Stream } from "effect";
|
|
18
|
+
/** Structural equivalent of @oh-my-pi CollabRegistryFilter. */
|
|
19
|
+
export interface RunDiscoveryFilter {
|
|
20
|
+
githubUserId?: string;
|
|
21
|
+
namespaceKey?: string;
|
|
22
|
+
selectedRepo?: string;
|
|
23
|
+
cwd?: string;
|
|
24
|
+
}
|
|
25
|
+
/** Structural equivalent of @oh-my-pi LiveCollabOwner. */
|
|
26
|
+
export interface RunDiscoveryOwner {
|
|
27
|
+
githubUserId?: string;
|
|
28
|
+
login?: string;
|
|
29
|
+
namespaceKey?: string;
|
|
30
|
+
}
|
|
31
|
+
/** Structural equivalent of @oh-my-pi LiveCollabProjection. */
|
|
32
|
+
export interface LiveRunCollabProjection {
|
|
33
|
+
sessionId: string;
|
|
34
|
+
sessionPath: string;
|
|
35
|
+
cwd: string;
|
|
36
|
+
title: string;
|
|
37
|
+
joinLink: string;
|
|
38
|
+
webLink: string;
|
|
39
|
+
relayUrl?: string;
|
|
40
|
+
owner?: RunDiscoveryOwner;
|
|
41
|
+
selectedRepo?: string;
|
|
42
|
+
startedAt: string;
|
|
43
|
+
updatedAt: string;
|
|
44
|
+
pid?: number;
|
|
45
|
+
stale: boolean;
|
|
46
|
+
}
|
|
47
|
+
/** Input for attaching to a run via the relay (structural equiv of AttachViaRelayInput). */
|
|
48
|
+
export interface RigRunAttachInput {
|
|
49
|
+
readonly runId: string;
|
|
50
|
+
readonly taskId?: string | null;
|
|
51
|
+
readonly identityFilter: RunDiscoveryFilter;
|
|
52
|
+
readonly timeoutMs?: number;
|
|
53
|
+
readonly projectRoot?: string;
|
|
54
|
+
}
|
|
55
|
+
/** Result of a relay attach (structural equiv of RigExtensionAttachResult). */
|
|
56
|
+
export interface RigRunAttachResult {
|
|
57
|
+
readonly sessionPath: string | null;
|
|
58
|
+
readonly joinLink: string | null;
|
|
59
|
+
readonly collabSessionId: string | null;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The run-discovery service surface: the unified active-run list (local FS +
|
|
63
|
+
* remote registry) and relay attach. registrySnapshotStream is intentionally
|
|
64
|
+
* omitted — its entry type (`RegistrySnapshotFrame` from @rig/relay-registry)
|
|
65
|
+
* cannot be referenced here without creating a circular dep; consumers that
|
|
66
|
+
* need snapshot frames must cast through the transport-plugin's richer type.
|
|
67
|
+
*/
|
|
68
|
+
export interface RunDiscoveryService {
|
|
69
|
+
readonly listActiveRunCollab: (projectRoot: string, filter: RunDiscoveryFilter) => Promise<readonly LiveRunCollabProjection[]>;
|
|
70
|
+
readonly runDiscoveryStream: (projectRoot: string) => Stream.Stream<void>;
|
|
71
|
+
readonly attachViaRelay: (input: RigRunAttachInput) => Promise<RigRunAttachResult | null>;
|
|
72
|
+
}
|
|
73
|
+
/** Stable id string for the run-discovery service capability. */
|
|
74
|
+
export declare const RUN_DISCOVERY_CAPABILITY_ID = "rig.runs.discovery";
|
|
75
|
+
/**
|
|
76
|
+
* The branded run-discovery capability id. `defineCapability(RUN_DISCOVERY)`
|
|
77
|
+
* (provider and consumers independently) resolves to a `RunDiscoveryService`.
|
|
78
|
+
*/
|
|
79
|
+
export declare const RUN_DISCOVERY: CapabilityId<RunDiscoveryService>;
|
|
@@ -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/run-discovery.ts
|
|
8
|
+
var RUN_DISCOVERY_CAPABILITY_ID = "rig.runs.discovery";
|
|
9
|
+
var RUN_DISCOVERY = makeCapabilityId(RUN_DISCOVERY_CAPABILITY_ID);
|
|
10
|
+
export {
|
|
11
|
+
RUN_DISCOVERY_CAPABILITY_ID,
|
|
12
|
+
RUN_DISCOVERY
|
|
13
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* run-dispatch.ts — pure capability vocabulary for placement-aware run dispatch.
|
|
3
|
+
*
|
|
4
|
+
* The dispatch IMPL (local + remote placement, run-process spawn, session-id
|
|
5
|
+
* wait) lives in @rig/transport-plugin (`./dispatch`, the `transport` backbone).
|
|
6
|
+
* Programmatic consumers (rig-extension, supervisor) resolve it off a project's
|
|
7
|
+
* plugin host under {@link RUN_DISPATCH_CAPABILITY_ID} — WITHOUT importing the
|
|
8
|
+
* transport plugin's impl. This file holds ONLY the pure id + interface shared
|
|
9
|
+
* by the provider and its consumers (no IO, no plugin imports).
|
|
10
|
+
*/
|
|
11
|
+
import type { CapabilityId } from "./capability-id";
|
|
12
|
+
/** The placement-aware run dispatch input (plain, OMP-type-free). */
|
|
13
|
+
export interface RunDispatchInput {
|
|
14
|
+
readonly projectRoot: string;
|
|
15
|
+
readonly taskId: string;
|
|
16
|
+
readonly title?: string | null;
|
|
17
|
+
readonly model?: string | null;
|
|
18
|
+
readonly prompt?: string | null;
|
|
19
|
+
readonly force?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The host-resolved run-dispatch surface: dispatch a run (resolving local vs
|
|
23
|
+
* remote/fleet placement at dispatch time) and resolve once an OMP session id
|
|
24
|
+
* has appeared. Mirrors `dispatchRun` in @rig/transport-plugin.
|
|
25
|
+
*/
|
|
26
|
+
export interface RunDispatchService {
|
|
27
|
+
readonly dispatchRun: (input: RunDispatchInput) => Promise<{
|
|
28
|
+
readonly runId: string;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
/** The capability id the transport plugin registers its run dispatcher under. */
|
|
32
|
+
export declare const RUN_DISPATCH_CAPABILITY_ID = "rig.runs.dispatch";
|
|
33
|
+
/** Phantom-typed id; string value is {@link RUN_DISPATCH_CAPABILITY_ID}. */
|
|
34
|
+
export declare const RUN_DISPATCH: CapabilityId<RunDispatchService>;
|
|
@@ -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/run-dispatch.ts
|
|
8
|
+
var RUN_DISPATCH_CAPABILITY_ID = "rig.runs.dispatch";
|
|
9
|
+
var RUN_DISPATCH = makeCapabilityId(RUN_DISPATCH_CAPABILITY_ID);
|
|
10
|
+
export {
|
|
11
|
+
RUN_DISPATCH_CAPABILITY_ID,
|
|
12
|
+
RUN_DISPATCH
|
|
13
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cap:run-identity-env — GitHub/Rig run identity capability seam.
|
|
3
|
+
*
|
|
4
|
+
* The CLI seed and sibling plugins must not implement GitHub identity policy or
|
|
5
|
+
* import a provider implementation directly. The identity owner
|
|
6
|
+
* (`@rig/github-provider-plugin`) registers this capability with public
|
|
7
|
+
* identity-env hydration, run-child credential stripping, and runtime identity
|
|
8
|
+
* resolution. This file holds ONLY pure seam vocabulary — no IO.
|
|
9
|
+
*/
|
|
10
|
+
import type { CapabilityId } from "./capability-id";
|
|
11
|
+
import type { RigIdentityContext, RigResolvedIdentity } from "./identity";
|
|
12
|
+
/** Structural mirror of `@rig/relay-registry`'s `CollabRegistryFilter` (no transport dep). */
|
|
13
|
+
export type IdentityRegistryFilter = {
|
|
14
|
+
readonly cwd?: string;
|
|
15
|
+
readonly selectedRepo?: string;
|
|
16
|
+
readonly githubUserId?: string;
|
|
17
|
+
readonly namespaceKey?: string;
|
|
18
|
+
};
|
|
19
|
+
/** Capability id the identity owner registers its run identity policy under. */
|
|
20
|
+
export declare const RUN_IDENTITY_ENV_CAPABILITY_ID = "cap:run-identity-env";
|
|
21
|
+
/** GitHub/Rig identity operations consumers resolve through the provider capability. */
|
|
22
|
+
export interface RunIdentityEnvService {
|
|
23
|
+
/**
|
|
24
|
+
* Resolve public identity env vars for `workspaceRoot` without mutating
|
|
25
|
+
* process.env.
|
|
26
|
+
*/
|
|
27
|
+
resolveIdentityEnv(workspaceRoot: string): Partial<Record<"RIG_SELECTED_REPO" | "RIG_GITHUB_USER_ID" | "RIG_GITHUB_LOGIN" | "RIG_GITHUB_NAMESPACE_KEY", string>>;
|
|
28
|
+
/**
|
|
29
|
+
* Hydrate the public-identity env vars for `workspaceRoot` into process.env
|
|
30
|
+
* (RIG_SELECTED_REPO / RIG_GITHUB_USER_ID / RIG_GITHUB_LOGIN / namespace key /
|
|
31
|
+
* auth-state-file pointer). Returns a restore closure that reverts the change.
|
|
32
|
+
*/
|
|
33
|
+
applyIdentityEnv(workspaceRoot: string): () => void;
|
|
34
|
+
/** Build a registry discovery filter from the current public identity env. */
|
|
35
|
+
identityFilterFromEnv(): IdentityRegistryFilter;
|
|
36
|
+
/**
|
|
37
|
+
* Return a copy of `env` (default process.env) with the run-scoped credential
|
|
38
|
+
* tokens removed, for use as a spawned run-host child's environment.
|
|
39
|
+
*/
|
|
40
|
+
stripRunChildCredentialEnv(env?: Record<string, string | undefined>): Record<string, string | undefined>;
|
|
41
|
+
/** Resolve the current Rig run identity from the OMP session/auth context. */
|
|
42
|
+
resolveRigIdentity(ctx: RigIdentityContext): RigResolvedIdentity | null;
|
|
43
|
+
/** Resolve the registry filter corresponding to the current Rig run identity. */
|
|
44
|
+
resolveRigIdentityFilter(ctx: RigIdentityContext): IdentityRegistryFilter | null;
|
|
45
|
+
}
|
|
46
|
+
/** Typed capability id; string value is {@link RUN_IDENTITY_ENV_CAPABILITY_ID}. */
|
|
47
|
+
export declare const RUN_IDENTITY_ENV: CapabilityId<RunIdentityEnvService>;
|
|
@@ -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/run-identity.ts
|
|
8
|
+
var RUN_IDENTITY_ENV_CAPABILITY_ID = "cap:run-identity-env";
|
|
9
|
+
var RUN_IDENTITY_ENV = makeCapabilityId(RUN_IDENTITY_ENV_CAPABILITY_ID);
|
|
10
|
+
export {
|
|
11
|
+
RUN_IDENTITY_ENV_CAPABILITY_ID,
|
|
12
|
+
RUN_IDENTITY_ENV
|
|
13
|
+
};
|
|
@@ -635,241 +635,6 @@ export declare const RunJournalEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
635
635
|
readonly runId: Schema.brand<Schema.Trim, "RunId">;
|
|
636
636
|
}>]>;
|
|
637
637
|
export type RunJournalEvent = typeof RunJournalEvent.Type;
|
|
638
|
-
export declare const decodeRunJournalEvent: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => {
|
|
639
|
-
readonly at: string;
|
|
640
|
-
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
641
|
-
readonly v: 1;
|
|
642
|
-
readonly type: "status-changed";
|
|
643
|
-
readonly from: "running" | "stopped" | "completed" | "created" | "queued" | "preparing" | "waiting-approval" | "waiting-user-input" | "paused" | "validating" | "reviewing" | "closing-out" | "needs-attention" | "failed" | null;
|
|
644
|
-
readonly to: "running" | "stopped" | "completed" | "created" | "queued" | "preparing" | "waiting-approval" | "waiting-user-input" | "paused" | "validating" | "reviewing" | "closing-out" | "needs-attention" | "failed";
|
|
645
|
-
readonly seq: number;
|
|
646
|
-
readonly reason?: string | null | undefined;
|
|
647
|
-
readonly actor?: {
|
|
648
|
-
readonly kind: "server" | "system" | "agent" | "operator";
|
|
649
|
-
readonly id?: string | null | undefined;
|
|
650
|
-
} | undefined;
|
|
651
|
-
} | {
|
|
652
|
-
readonly at: string;
|
|
653
|
-
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
654
|
-
readonly v: 1;
|
|
655
|
-
readonly type: "record-patch";
|
|
656
|
-
readonly seq: number;
|
|
657
|
-
readonly patch: {
|
|
658
|
-
readonly taskId?: string | null | undefined;
|
|
659
|
-
readonly runId?: string | undefined;
|
|
660
|
-
readonly createdAt?: string | undefined;
|
|
661
|
-
readonly title?: string | undefined;
|
|
662
|
-
readonly mode?: "local" | "remote" | undefined;
|
|
663
|
-
readonly startedAt?: string | null | undefined;
|
|
664
|
-
readonly updatedAt?: string | undefined;
|
|
665
|
-
readonly runtimeMode?: string | null | undefined;
|
|
666
|
-
readonly threadId?: string | null | undefined;
|
|
667
|
-
readonly completedAt?: string | null | undefined;
|
|
668
|
-
readonly interactionMode?: string | null | undefined;
|
|
669
|
-
readonly branch?: string | null | undefined;
|
|
670
|
-
readonly worktreePath?: string | null | undefined;
|
|
671
|
-
readonly model?: string | null | undefined;
|
|
672
|
-
readonly runtimeAdapter?: "pi" | undefined;
|
|
673
|
-
readonly initialPrompt?: string | null | undefined;
|
|
674
|
-
readonly latestMessageId?: string | null | undefined;
|
|
675
|
-
readonly errorText?: string | null | undefined;
|
|
676
|
-
readonly workspaceId?: string | undefined;
|
|
677
|
-
readonly sessionLogPath?: string | null | undefined;
|
|
678
|
-
readonly pid?: number | null | undefined;
|
|
679
|
-
readonly prUrl?: string | null | undefined;
|
|
680
|
-
readonly planning?: unknown;
|
|
681
|
-
readonly endpointId?: string | null | undefined;
|
|
682
|
-
readonly hostId?: string | null | undefined;
|
|
683
|
-
readonly leaseId?: string | null | undefined;
|
|
684
|
-
readonly runMode?: string | null | undefined;
|
|
685
|
-
readonly artifactRoot?: string | null | undefined;
|
|
686
|
-
readonly logRoot?: string | null | undefined;
|
|
687
|
-
readonly sessionPath?: string | null | undefined;
|
|
688
|
-
readonly piSession?: unknown;
|
|
689
|
-
readonly piSessionPrivate?: unknown;
|
|
690
|
-
readonly projectRoot?: string | null | undefined;
|
|
691
|
-
readonly serverCloseout?: {
|
|
692
|
-
readonly status: "running" | "completed" | "pending" | "needs-attention" | "failed";
|
|
693
|
-
readonly updatedAt: string;
|
|
694
|
-
readonly phase: "push" | "completed" | "queued" | "merge" | "commit" | "pr-review-merge" | "pr-opened" | "close-source";
|
|
695
|
-
readonly taskId?: string | null | undefined;
|
|
696
|
-
readonly reason?: string | null | undefined;
|
|
697
|
-
readonly error?: string | null | undefined;
|
|
698
|
-
readonly completedAt?: string | null | undefined;
|
|
699
|
-
readonly branch?: string | null | undefined;
|
|
700
|
-
readonly prUrl?: string | null | undefined;
|
|
701
|
-
readonly merged?: boolean | undefined;
|
|
702
|
-
readonly runtimeWorkspace?: string | null | undefined;
|
|
703
|
-
readonly artifactRoot?: string | null | undefined;
|
|
704
|
-
readonly iterations?: number | null | undefined;
|
|
705
|
-
readonly feedback?: readonly string[] | undefined;
|
|
706
|
-
readonly resumedAt?: string | null | undefined;
|
|
707
|
-
} | null | undefined;
|
|
708
|
-
readonly baselineMode?: string | null | undefined;
|
|
709
|
-
readonly prMode?: "auto" | "off" | "ask" | null | undefined;
|
|
710
|
-
readonly initiatedBy?: string | null | undefined;
|
|
711
|
-
readonly sourceTask?: unknown;
|
|
712
|
-
readonly serverPid?: number | null | undefined;
|
|
713
|
-
readonly latestSteeringAt?: string | null | undefined;
|
|
714
|
-
readonly latestSteeringDeliveredAt?: string | null | undefined;
|
|
715
|
-
readonly statusDetail?: string | null | undefined;
|
|
716
|
-
};
|
|
717
|
-
} | {
|
|
718
|
-
readonly at: string;
|
|
719
|
-
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
720
|
-
readonly v: 1;
|
|
721
|
-
readonly type: "timeline-entry";
|
|
722
|
-
readonly payload: unknown;
|
|
723
|
-
readonly seq: number;
|
|
724
|
-
} | {
|
|
725
|
-
readonly at: string;
|
|
726
|
-
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
727
|
-
readonly v: 1;
|
|
728
|
-
readonly type: "log-entry";
|
|
729
|
-
readonly payload: unknown;
|
|
730
|
-
readonly seq: number;
|
|
731
|
-
} | {
|
|
732
|
-
readonly at: string;
|
|
733
|
-
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
734
|
-
readonly v: 1;
|
|
735
|
-
readonly type: "approval-requested";
|
|
736
|
-
readonly payload: unknown;
|
|
737
|
-
readonly requestId: string;
|
|
738
|
-
readonly requestKind: string;
|
|
739
|
-
readonly seq: number;
|
|
740
|
-
readonly actionId?: string | null | undefined;
|
|
741
|
-
} | {
|
|
742
|
-
readonly at: string;
|
|
743
|
-
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
744
|
-
readonly v: 1;
|
|
745
|
-
readonly type: "approval-resolved";
|
|
746
|
-
readonly requestId: string;
|
|
747
|
-
readonly decision: "reject" | "approve";
|
|
748
|
-
readonly actor: {
|
|
749
|
-
readonly kind: "server" | "system" | "agent" | "operator";
|
|
750
|
-
readonly id?: string | null | undefined;
|
|
751
|
-
};
|
|
752
|
-
readonly seq: number;
|
|
753
|
-
readonly note?: string | null | undefined;
|
|
754
|
-
} | {
|
|
755
|
-
readonly at: string;
|
|
756
|
-
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
757
|
-
readonly v: 1;
|
|
758
|
-
readonly type: "input-requested";
|
|
759
|
-
readonly payload: unknown;
|
|
760
|
-
readonly requestId: string;
|
|
761
|
-
readonly seq: number;
|
|
762
|
-
} | {
|
|
763
|
-
readonly at: string;
|
|
764
|
-
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
765
|
-
readonly v: 1;
|
|
766
|
-
readonly type: "input-resolved";
|
|
767
|
-
readonly requestId: string;
|
|
768
|
-
readonly answers: {
|
|
769
|
-
readonly [x: string]: string;
|
|
770
|
-
};
|
|
771
|
-
readonly actor: {
|
|
772
|
-
readonly kind: "server" | "system" | "agent" | "operator";
|
|
773
|
-
readonly id?: string | null | undefined;
|
|
774
|
-
};
|
|
775
|
-
readonly seq: number;
|
|
776
|
-
} | {
|
|
777
|
-
readonly at: string;
|
|
778
|
-
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
779
|
-
readonly v: 1;
|
|
780
|
-
readonly type: "steering";
|
|
781
|
-
readonly text: string;
|
|
782
|
-
readonly actor: {
|
|
783
|
-
readonly kind: "server" | "system" | "agent" | "operator";
|
|
784
|
-
readonly id?: string | null | undefined;
|
|
785
|
-
};
|
|
786
|
-
readonly seq: number;
|
|
787
|
-
} | {
|
|
788
|
-
readonly at: string;
|
|
789
|
-
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
790
|
-
readonly v: 1;
|
|
791
|
-
readonly type: "adopted";
|
|
792
|
-
readonly pid: number | null;
|
|
793
|
-
readonly serverPid: number;
|
|
794
|
-
readonly seq: number;
|
|
795
|
-
} | {
|
|
796
|
-
readonly at: string;
|
|
797
|
-
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
798
|
-
readonly v: 1;
|
|
799
|
-
readonly detail: string;
|
|
800
|
-
readonly type: "stall-detected";
|
|
801
|
-
readonly seq: number;
|
|
802
|
-
} | {
|
|
803
|
-
readonly at: string;
|
|
804
|
-
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
805
|
-
readonly v: 1;
|
|
806
|
-
readonly type: "closeout-phase";
|
|
807
|
-
readonly phase: "push" | "completed" | "queued" | "merge" | "commit" | "pr-review-merge" | "pr-opened" | "close-source";
|
|
808
|
-
readonly seq: number;
|
|
809
|
-
readonly outcome: "completed" | "failed" | "started";
|
|
810
|
-
readonly detail?: string | null | undefined;
|
|
811
|
-
} | {
|
|
812
|
-
readonly at: string;
|
|
813
|
-
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
814
|
-
readonly v: 1;
|
|
815
|
-
readonly pipeline: {
|
|
816
|
-
readonly order: readonly (string & import("effect/Brand").Brand<"StageId">)[];
|
|
817
|
-
readonly record: readonly {
|
|
818
|
-
readonly contributedBy: string;
|
|
819
|
-
readonly stageId: string & import("effect/Brand").Brand<"StageId">;
|
|
820
|
-
readonly isProtected: boolean;
|
|
821
|
-
readonly removedBy?: string | undefined;
|
|
822
|
-
readonly replacedBy?: string | undefined;
|
|
823
|
-
readonly wrappedBy?: readonly string[] | undefined;
|
|
824
|
-
readonly droppedAnchors?: readonly (string & import("effect/Brand").Brand<"StageId">)[] | undefined;
|
|
825
|
-
}[];
|
|
826
|
-
readonly cycles: readonly (readonly (string & import("effect/Brand").Brand<"StageId">)[])[];
|
|
827
|
-
readonly runId?: (string & import("effect/Brand").Brand<"RunId">) | undefined;
|
|
828
|
-
readonly grantUses?: readonly {
|
|
829
|
-
readonly kind: "kernel-replacement";
|
|
830
|
-
readonly target: string;
|
|
831
|
-
readonly pluginId: string;
|
|
832
|
-
}[] | undefined;
|
|
833
|
-
readonly resolvedAt?: string | undefined;
|
|
834
|
-
};
|
|
835
|
-
readonly type: "pipeline-resolved";
|
|
836
|
-
readonly seq: number;
|
|
837
|
-
} | {
|
|
838
|
-
readonly at: string;
|
|
839
|
-
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
840
|
-
readonly v: 1;
|
|
841
|
-
readonly type: "stage-outcome";
|
|
842
|
-
readonly seq: number;
|
|
843
|
-
readonly outcome: {
|
|
844
|
-
readonly stageId: string & import("effect/Brand").Brand<"StageId">;
|
|
845
|
-
readonly result: {
|
|
846
|
-
readonly kind: "continue";
|
|
847
|
-
readonly ctx: {
|
|
848
|
-
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
849
|
-
readonly state: unknown;
|
|
850
|
-
readonly taskId?: (string & import("effect/Brand").Brand<"TaskId">) | null | undefined;
|
|
851
|
-
readonly metadata?: {
|
|
852
|
-
readonly [x: string]: unknown;
|
|
853
|
-
} | undefined;
|
|
854
|
-
};
|
|
855
|
-
} | {
|
|
856
|
-
readonly kind: "allow";
|
|
857
|
-
} | {
|
|
858
|
-
readonly kind: "block";
|
|
859
|
-
readonly reason: string;
|
|
860
|
-
};
|
|
861
|
-
readonly startedAt: string;
|
|
862
|
-
readonly finishedAt: string;
|
|
863
|
-
};
|
|
864
|
-
};
|
|
865
|
-
export declare const RUN_STATUS_TRANSITIONS: Readonly<Record<RunStatus, readonly RunStatus[]>>;
|
|
866
|
-
export declare const TERMINAL_RUN_STATUSES: readonly RunStatus[];
|
|
867
|
-
export declare const ACTIVE_RUN_STATUSES: readonly RunStatus[];
|
|
868
|
-
export declare function isTerminalRunStatus(status: RunStatus): boolean;
|
|
869
|
-
export declare function isActiveRunStatus(status: RunStatus): boolean;
|
|
870
|
-
export declare function canTransitionRunStatus(from: RunStatus | null, to: RunStatus): boolean;
|
|
871
|
-
/** Writer-side guard: throws on an illegal transition so bugs fail loudly at the source. */
|
|
872
|
-
export declare function assertRunStatusTransition(from: RunStatus | null, to: RunStatus): void;
|
|
873
638
|
export type RunJournalAnomaly = {
|
|
874
639
|
seq: number;
|
|
875
640
|
kind: "illegal-transition" | "duplicate-resolution" | "unknown-request";
|
|
@@ -927,4 +692,3 @@ export type RunJournalProjection = {
|
|
|
927
692
|
lastEventAt: string | null;
|
|
928
693
|
anomalies: ReadonlyArray<RunJournalAnomaly>;
|
|
929
694
|
};
|
|
930
|
-
export declare function reduceRunJournal(events: ReadonlyArray<RunJournalEvent>, runId?: string | null): RunJournalProjection;
|