@h-rig/core 0.0.6-alpha.77 → 0.0.6-alpha.79
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/src/define-config.d.ts +18 -0
- package/dist/src/define-plugin.d.ts +9 -0
- package/dist/src/engineReadModelReducer.d.ts +12 -0
- package/dist/src/index.d.ts +12 -0
- package/dist/src/load-config.d.ts +2 -0
- package/dist/src/plugin-host.d.ts +40 -0
- package/dist/src/plugin-runtime.d.ts +58 -0
- package/dist/src/rig-init-builder.d.ts +24 -0
- package/dist/src/rigSelectors.d.ts +194 -0
- package/dist/src/taskGraph.d.ts +28 -0
- package/dist/src/taskGraphCodes.d.ts +3 -0
- package/dist/src/taskGraphLayout.d.ts +60 -0
- package/package.json +8 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RigConfig } from "@rig/contracts";
|
|
2
|
+
/**
|
|
3
|
+
* Author-facing config input: `plugins` and `workspace` are optional and
|
|
4
|
+
* default to a plugin-less worktree setup, so the minimal documented config
|
|
5
|
+
* (project + taskSource) works out of the box.
|
|
6
|
+
*/
|
|
7
|
+
export type RigConfigInput = Omit<RigConfig, "plugins" | "workspace"> & {
|
|
8
|
+
plugins?: RigConfig["plugins"];
|
|
9
|
+
workspace?: RigConfig["workspace"];
|
|
10
|
+
};
|
|
11
|
+
/** Fill optional top-level sections before Schema decode (which requires them). */
|
|
12
|
+
export declare function applyConfigDefaults(raw: unknown): unknown;
|
|
13
|
+
/**
|
|
14
|
+
* Validate a Rig config and decode through Schema, preserving each plugin's
|
|
15
|
+
* `__runtime` channel. Schema decode strips unknown fields, so we capture
|
|
16
|
+
* the runtime objects before decoding and re-attach them after.
|
|
17
|
+
*/
|
|
18
|
+
export declare function defineConfig(cfg: RigConfigInput): RigConfig;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RigPlugin } from "@rig/contracts";
|
|
2
|
+
import type { RigPluginRuntime, RigPluginWithRuntime } from "./plugin-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Define a Rig plugin. The first argument is the schema-validated metadata
|
|
5
|
+
* (id strings, version, contributions). The optional second argument carries
|
|
6
|
+
* executable bits (validator `run` functions, etc.) that Schema cannot
|
|
7
|
+
* represent — they travel alongside the validated metadata as `__runtime`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function definePlugin(meta: RigPlugin, runtime?: RigPluginRuntime): RigPluginWithRuntime;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EngineEvent, EngineReadModel, QueueEntry, RunSummary, TaskSummary } from "@rig/contracts";
|
|
2
|
+
type EngineApplyStatus = "applied" | "ignored" | "requires-resync";
|
|
3
|
+
export type ApplyStatus = EngineApplyStatus;
|
|
4
|
+
export interface EngineEventApplyResult {
|
|
5
|
+
readonly status: EngineApplyStatus;
|
|
6
|
+
readonly snapshot: EngineReadModel;
|
|
7
|
+
}
|
|
8
|
+
export declare function mapTaskStatusFromRunStatus(status: RunSummary["status"], fallback: TaskSummary["status"]): TaskSummary["status"];
|
|
9
|
+
export declare function applyEngineEvent(snapshot: EngineReadModel, event: EngineEvent): EngineEventApplyResult;
|
|
10
|
+
export declare function applyEngineEvents(snapshot: EngineReadModel, events: ReadonlyArray<EngineEvent>): EngineEventApplyResult;
|
|
11
|
+
export declare function pruneQueueEntries(snapshot: EngineReadModel): QueueEntry[];
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const RIG_CORE_PACKAGE = "@rig/core";
|
|
2
|
+
export { definePlugin } from "./define-plugin";
|
|
3
|
+
export { defineConfig } from "./define-config";
|
|
4
|
+
export { createPluginHost } from "./plugin-host";
|
|
5
|
+
export type { PluginHost } from "./plugin-host";
|
|
6
|
+
export { buildRigInitConfigSource, type RigInitConfigInput, } from "./rig-init-builder";
|
|
7
|
+
export type { RegisteredValidator, RigPluginRuntime, RigPluginWithRuntime, TaskSourceFactoryContext, TaskSourceFactoryEntry, ValidatorContext, ValidatorResult, } from "./plugin-runtime";
|
|
8
|
+
export { applyEngineEvent, applyEngineEvents, applyEngineEvent as applyRigEvent, pruneQueueEntries, type ApplyStatus, type EngineEventApplyResult, type EngineEventApplyResult as RigEventApplyResult, } from "./engineReadModelReducer";
|
|
9
|
+
export { pickDefaultWorkspaceId, selectAdhocRuns, selectAdhocRunsForWorkspace, selectApprovalsForRun, selectApprovalsForWorkspace, selectGraphsForWorkspace, selectPendingApprovals, selectPrimaryWorkspace, selectQueueForWorkspace, selectRun, selectRunsByTask, selectRunsForTask, selectRunsForWorkspace, selectTask, selectTasksByStatus, selectTasksByWorkspace, selectTasksForWorkspace, selectTasksGroupedByStatus, selectUserInputsForRun, selectUserInputsForWorkspace, selectWorkspace, selectWorkspaces, } from "./rigSelectors";
|
|
10
|
+
export { buildTaskReferenceIndex, computeTaskBlockingDepths, readTaskMetadataStringList, readTaskSourceIssueId, resolveTaskReference, } from "./taskGraph";
|
|
11
|
+
export { extractTaskCode, extractTaskGroupKey, stripTaskCode, } from "./taskGraphCodes";
|
|
12
|
+
export { buildTaskGraphLayout, type TaskGraphEdge, type TaskGraphLane, type TaskGraphLayout, type TaskGraphNode, type TaskGraphStage, } from "./taskGraphLayout";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ValidatorRegistration, HookRegistration, SkillRegistration, RepoSourceRegistration, AgentRoleRegistration, TaskFieldExtension, TaskSourceRegistration, CliCommandRegistration } from "@rig/contracts";
|
|
2
|
+
import type { RegisteredValidator, RigPluginWithRuntime, TaskSourceFactoryEntry } from "./plugin-runtime";
|
|
3
|
+
export interface PluginHost {
|
|
4
|
+
getValidator(id: string): ValidatorRegistration | undefined;
|
|
5
|
+
getHook(id: string): HookRegistration | undefined;
|
|
6
|
+
getSkill(id: string): SkillRegistration | undefined;
|
|
7
|
+
getRepoSource(id: string): RepoSourceRegistration | undefined;
|
|
8
|
+
getAgentRole(id: string): AgentRoleRegistration | undefined;
|
|
9
|
+
getTaskFieldExtension(id: string): TaskFieldExtension | undefined;
|
|
10
|
+
getTaskSource(id: string): TaskSourceRegistration | undefined;
|
|
11
|
+
getCliCommand(id: string): CliCommandRegistration | undefined;
|
|
12
|
+
listValidators(): readonly ValidatorRegistration[];
|
|
13
|
+
listHooks(): readonly HookRegistration[];
|
|
14
|
+
listSkills(): readonly SkillRegistration[];
|
|
15
|
+
listRepoSources(): readonly RepoSourceRegistration[];
|
|
16
|
+
listAgentRoles(): readonly AgentRoleRegistration[];
|
|
17
|
+
listTaskFieldExtensions(): readonly TaskFieldExtension[];
|
|
18
|
+
listTaskSources(): readonly TaskSourceRegistration[];
|
|
19
|
+
listCliCommands(): readonly CliCommandRegistration[];
|
|
20
|
+
/**
|
|
21
|
+
* Executable validators contributed by plugins. Only validators whose
|
|
22
|
+
* metadata appears in `listValidators()` and whose plugin shipped a runtime
|
|
23
|
+
* implementation via `definePlugin(meta, { validators: [...] })` appear here.
|
|
24
|
+
* Validators registered metadata-only (no run() implementation) are absent.
|
|
25
|
+
*/
|
|
26
|
+
listExecutableValidators(): readonly RegisteredValidator[];
|
|
27
|
+
/**
|
|
28
|
+
* Executable task source factories contributed by plugins. Used by the
|
|
29
|
+
* runtime's `buildTaskSourceRegistry` to instantiate non-standard task
|
|
30
|
+
* source kinds (Linear, Jira, custom) declared by plugins.
|
|
31
|
+
*/
|
|
32
|
+
listExecutableTaskSources(): readonly TaskSourceFactoryEntry[];
|
|
33
|
+
/**
|
|
34
|
+
* Look up an executable task source factory by its `kind` (the value in
|
|
35
|
+
* `config.taskSource.kind`). Returns undefined when no plugin provides
|
|
36
|
+
* a factory for that kind.
|
|
37
|
+
*/
|
|
38
|
+
resolveTaskSourceFactoryByKind(kind: string): TaskSourceFactoryEntry | undefined;
|
|
39
|
+
}
|
|
40
|
+
export declare function createPluginHost(plugins: readonly RigPluginWithRuntime[]): PluginHost;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { HookImplementation, RegisteredTaskSource, RigPlugin, TaskSourceConfig, TaskSourceRegistration, ValidatorRegistration } from "@rig/contracts";
|
|
2
|
+
export interface ValidatorResult {
|
|
3
|
+
id: string;
|
|
4
|
+
passed: boolean;
|
|
5
|
+
summary: string;
|
|
6
|
+
details?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ValidatorContext {
|
|
9
|
+
taskId: string;
|
|
10
|
+
workspaceRoot: string;
|
|
11
|
+
scope: readonly string[];
|
|
12
|
+
monorepoRoot?: string;
|
|
13
|
+
artifactsDir?: string;
|
|
14
|
+
taskConfig?: unknown;
|
|
15
|
+
}
|
|
16
|
+
export interface RegisteredValidator extends ValidatorRegistration {
|
|
17
|
+
run(ctx: ValidatorContext): Promise<ValidatorResult>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Project context handed to task-source factories at instantiation. The
|
|
21
|
+
* server process's cwd is NOT necessarily the project root (workspace-spawned
|
|
22
|
+
* servers run from the engine checkout), so factories that touch the
|
|
23
|
+
* filesystem must resolve relative config paths against `projectRoot`,
|
|
24
|
+
* never cwd.
|
|
25
|
+
*/
|
|
26
|
+
export interface TaskSourceFactoryContext {
|
|
27
|
+
projectRoot: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Executable task-source factory contributed by a plugin. A plugin
|
|
31
|
+
* registers a TaskSourceRegistration metadata entry (with `id` and `kind`)
|
|
32
|
+
* AND a factory here that turns a TaskSourceConfig into a RegisteredTaskSource.
|
|
33
|
+
*
|
|
34
|
+
* `kind` is matched against `config.taskSource.kind` at boot. The first
|
|
35
|
+
* matching plugin factory wins; if multiple plugins claim the same kind,
|
|
36
|
+
* `createPluginHost` throws a duplicate-kind error.
|
|
37
|
+
*/
|
|
38
|
+
export interface TaskSourceFactoryEntry extends TaskSourceRegistration {
|
|
39
|
+
factory(config: TaskSourceConfig, context?: TaskSourceFactoryContext): RegisteredTaskSource;
|
|
40
|
+
}
|
|
41
|
+
export interface RigPluginRuntime {
|
|
42
|
+
validators?: readonly RegisteredValidator[];
|
|
43
|
+
taskSources?: readonly TaskSourceFactoryEntry[];
|
|
44
|
+
/**
|
|
45
|
+
* Typed hook implementations keyed by hook id. Each key must match a
|
|
46
|
+
* declared `contributes.hooks` entry on the same plugin. A typed hook and
|
|
47
|
+
* a metadata `command` string are mutually exclusive per hook — and when
|
|
48
|
+
* this channel is present, every declared hook must be implemented one way
|
|
49
|
+
* or the other (same all-or-none rule as validators). The runtime's
|
|
50
|
+
* hook-materializer generates the shim command that routes Claude Code's
|
|
51
|
+
* hook invocation to the typed function (see
|
|
52
|
+
* `@rig/runtime/control-plane/hook-runner`).
|
|
53
|
+
*/
|
|
54
|
+
hooks?: Record<string, HookImplementation>;
|
|
55
|
+
}
|
|
56
|
+
export type RigPluginWithRuntime = RigPlugin & {
|
|
57
|
+
__runtime?: RigPluginRuntime;
|
|
58
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure builder that turns a small input shape into the source text of a
|
|
3
|
+
* `rig.config.ts` file. Shared between the CLI `rig init` wizard and the
|
|
4
|
+
* desktop app's in-app setup wizard so both surfaces produce identical
|
|
5
|
+
* output.
|
|
6
|
+
*
|
|
7
|
+
* Pure — no fs, no node, no imports outside this file. Safe to bundle into
|
|
8
|
+
* a renderer (Vite, esbuild, webpack).
|
|
9
|
+
*/
|
|
10
|
+
export type RigInitConfigInput = {
|
|
11
|
+
projectName: string;
|
|
12
|
+
projectRepo?: string;
|
|
13
|
+
taskSource: {
|
|
14
|
+
kind: "github-issues";
|
|
15
|
+
owner: string;
|
|
16
|
+
repo: string;
|
|
17
|
+
assignee?: string;
|
|
18
|
+
} | {
|
|
19
|
+
kind: "files";
|
|
20
|
+
path: string;
|
|
21
|
+
};
|
|
22
|
+
useStandardPlugin: boolean;
|
|
23
|
+
};
|
|
24
|
+
export declare function buildRigInitConfigSource(input: RigInitConfigInput): string;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import type { ArtifactSummary, ApprovalSummary, EngineReadModel, GraphSummary, QueueEntry, RemoteConnectionSummary, RemoteEndpoint, RunId, RunSummary, TaskId, TaskStatus, TaskSummary, UserInputRequestSummary, WorkspaceId, WorkspaceSummary } from "@rig/contracts";
|
|
2
|
+
export declare function selectWorkspaces(snapshot: EngineReadModel | null): readonly WorkspaceSummary[];
|
|
3
|
+
export declare function selectPrimaryWorkspace(snapshot: EngineReadModel | null): WorkspaceSummary | null;
|
|
4
|
+
export declare function pickDefaultWorkspaceId(snapshot: EngineReadModel | null): WorkspaceId | null;
|
|
5
|
+
export declare function selectWorkspace(snapshot: EngineReadModel | null, workspaceId: WorkspaceId | null): WorkspaceSummary | null;
|
|
6
|
+
export declare function selectTask(snapshot: EngineReadModel | null, taskId: TaskId | null): TaskSummary | null;
|
|
7
|
+
export declare function selectTasksByWorkspace(snapshot: EngineReadModel | null, workspaceId: WorkspaceId | null): TaskSummary[];
|
|
8
|
+
export declare const selectTasksForWorkspace: typeof selectTasksByWorkspace;
|
|
9
|
+
export declare function selectTasksByStatus(snapshot: EngineReadModel | null, status: TaskStatus): TaskSummary[];
|
|
10
|
+
export declare function selectTasksGroupedByStatus(snapshot: EngineReadModel | null, workspaceId: WorkspaceId | null): Array<{
|
|
11
|
+
status: string;
|
|
12
|
+
tasks: readonly TaskSummary[];
|
|
13
|
+
}>;
|
|
14
|
+
export declare function selectRun(snapshot: EngineReadModel | null, runId: RunId | null): RunSummary | null;
|
|
15
|
+
export declare function selectRunsByTask(snapshot: EngineReadModel | null, taskId: TaskId | null): RunSummary[];
|
|
16
|
+
export declare const selectRunsForTask: typeof selectRunsByTask;
|
|
17
|
+
export declare function selectRunsForWorkspace(snapshot: EngineReadModel | null, workspaceId: WorkspaceId | null): RunSummary[];
|
|
18
|
+
export declare function selectAdhocRuns(snapshot: EngineReadModel | null): RunSummary[];
|
|
19
|
+
export declare function selectAdhocRunsForWorkspace(snapshot: EngineReadModel | null, workspaceId: WorkspaceId | null): RunSummary[];
|
|
20
|
+
export declare function selectGraphsForWorkspace(snapshot: EngineReadModel | null, workspaceId: WorkspaceId | null): GraphSummary[];
|
|
21
|
+
export declare function selectQueueForWorkspace(snapshot: EngineReadModel | null, workspaceId: WorkspaceId | null): QueueEntry[];
|
|
22
|
+
export declare function selectPendingApprovals(snapshot: EngineReadModel | null): ApprovalSummary[];
|
|
23
|
+
export declare function selectApprovalsForRun(snapshot: EngineReadModel | null, runId: RunId | null): ApprovalSummary[];
|
|
24
|
+
export declare function selectPendingApprovalsForRun(snapshot: EngineReadModel | null, runId: RunId | null): ApprovalSummary[];
|
|
25
|
+
export declare function selectApprovalsForWorkspace(snapshot: EngineReadModel | null, workspaceId: WorkspaceId | null): ApprovalSummary[];
|
|
26
|
+
export declare function selectUserInputsForRun(snapshot: EngineReadModel | null, runId: RunId | null): UserInputRequestSummary[];
|
|
27
|
+
export declare function selectPendingUserInputs(snapshot: EngineReadModel | null): UserInputRequestSummary[];
|
|
28
|
+
export declare function selectPendingUserInputsForRun(snapshot: EngineReadModel | null, runId: RunId | null): UserInputRequestSummary[];
|
|
29
|
+
export declare function selectUserInputsForWorkspace(snapshot: EngineReadModel | null, workspaceId: WorkspaceId | null): UserInputRequestSummary[];
|
|
30
|
+
export declare function selectRuntimeForRun(snapshot: EngineReadModel | null, runId: RunId | null): {
|
|
31
|
+
readonly id: string & import("effect/Brand").Brand<"EngineRuntimeId">;
|
|
32
|
+
readonly updatedAt: string;
|
|
33
|
+
readonly status: "starting" | "running" | "interrupted" | "failed" | "prepared" | "exited" | "destroyed";
|
|
34
|
+
readonly startedAt: string | null;
|
|
35
|
+
readonly pid: number | null;
|
|
36
|
+
readonly stateDir: string | null;
|
|
37
|
+
readonly workspaceId: string & import("effect/Brand").Brand<"WorkspaceId">;
|
|
38
|
+
readonly workspaceDir: string | null;
|
|
39
|
+
readonly homeDir: string | null;
|
|
40
|
+
readonly tmpDir: string | null;
|
|
41
|
+
readonly cacheDir: string | null;
|
|
42
|
+
readonly logsDir: string | null;
|
|
43
|
+
readonly sessionDir: string | null;
|
|
44
|
+
readonly sessionLogPath: string | null;
|
|
45
|
+
readonly exitedAt: string | null;
|
|
46
|
+
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
47
|
+
readonly adapterKind: string;
|
|
48
|
+
readonly sandboxMode: "read-only" | "workspace-write" | "danger-full-access";
|
|
49
|
+
readonly isolationMode: "none" | "env" | "worktree";
|
|
50
|
+
readonly executionTarget?: "remote" | "local" | undefined;
|
|
51
|
+
readonly remoteHostId?: string | null | undefined;
|
|
52
|
+
} | null;
|
|
53
|
+
export declare function selectLatestRuntimeForTask(snapshot: EngineReadModel | null, taskId: TaskId | null): {
|
|
54
|
+
readonly id: string & import("effect/Brand").Brand<"EngineRuntimeId">;
|
|
55
|
+
readonly updatedAt: string;
|
|
56
|
+
readonly status: "starting" | "running" | "interrupted" | "failed" | "prepared" | "exited" | "destroyed";
|
|
57
|
+
readonly startedAt: string | null;
|
|
58
|
+
readonly pid: number | null;
|
|
59
|
+
readonly stateDir: string | null;
|
|
60
|
+
readonly workspaceId: string & import("effect/Brand").Brand<"WorkspaceId">;
|
|
61
|
+
readonly workspaceDir: string | null;
|
|
62
|
+
readonly homeDir: string | null;
|
|
63
|
+
readonly tmpDir: string | null;
|
|
64
|
+
readonly cacheDir: string | null;
|
|
65
|
+
readonly logsDir: string | null;
|
|
66
|
+
readonly sessionDir: string | null;
|
|
67
|
+
readonly sessionLogPath: string | null;
|
|
68
|
+
readonly exitedAt: string | null;
|
|
69
|
+
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
70
|
+
readonly adapterKind: string;
|
|
71
|
+
readonly sandboxMode: "read-only" | "workspace-write" | "danger-full-access";
|
|
72
|
+
readonly isolationMode: "none" | "env" | "worktree";
|
|
73
|
+
readonly executionTarget?: "remote" | "local" | undefined;
|
|
74
|
+
readonly remoteHostId?: string | null | undefined;
|
|
75
|
+
} | null;
|
|
76
|
+
export declare function selectActionsForTask(snapshot: EngineReadModel | null, taskId: TaskId | null): {
|
|
77
|
+
readonly id: string & import("effect/Brand").Brand<"ActionId">;
|
|
78
|
+
readonly title: string;
|
|
79
|
+
readonly completedAt: string | null;
|
|
80
|
+
readonly payload: unknown;
|
|
81
|
+
readonly startedAt: string;
|
|
82
|
+
readonly state: string;
|
|
83
|
+
readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
|
|
84
|
+
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
85
|
+
readonly detail: string | null;
|
|
86
|
+
readonly actionType: string;
|
|
87
|
+
}[];
|
|
88
|
+
export declare function selectApprovalsForTask(snapshot: EngineReadModel | null, taskId: TaskId | null): {
|
|
89
|
+
readonly id: string;
|
|
90
|
+
readonly createdAt: string;
|
|
91
|
+
readonly status: "pending" | "resolved";
|
|
92
|
+
readonly payload: unknown;
|
|
93
|
+
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
94
|
+
readonly actionId: string | null;
|
|
95
|
+
readonly resolvedAt: string | null;
|
|
96
|
+
readonly requestKind: string;
|
|
97
|
+
}[];
|
|
98
|
+
export declare function selectUserInputsForTask(snapshot: EngineReadModel | null, taskId: TaskId | null): {
|
|
99
|
+
readonly id: string;
|
|
100
|
+
readonly createdAt: string;
|
|
101
|
+
readonly status: "pending" | "resolved";
|
|
102
|
+
readonly payload: unknown;
|
|
103
|
+
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
104
|
+
readonly resolvedAt: string | null;
|
|
105
|
+
}[];
|
|
106
|
+
export declare function selectValidationsForRun(snapshot: EngineReadModel | null, runId: RunId | null): {
|
|
107
|
+
readonly id: string & import("effect/Brand").Brand<"ValidationResultId">;
|
|
108
|
+
readonly status: "running" | "pending" | "failed" | "passed" | "skipped";
|
|
109
|
+
readonly completedAt: string | null;
|
|
110
|
+
readonly startedAt: string;
|
|
111
|
+
readonly taskId: (string & import("effect/Brand").Brand<"TaskId">) | null;
|
|
112
|
+
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
113
|
+
readonly validatorKey: string;
|
|
114
|
+
readonly output: unknown;
|
|
115
|
+
}[];
|
|
116
|
+
export declare function selectValidationsForTask(snapshot: EngineReadModel | null, taskId: TaskId | null): {
|
|
117
|
+
readonly id: string & import("effect/Brand").Brand<"ValidationResultId">;
|
|
118
|
+
readonly status: "running" | "pending" | "failed" | "passed" | "skipped";
|
|
119
|
+
readonly completedAt: string | null;
|
|
120
|
+
readonly startedAt: string;
|
|
121
|
+
readonly taskId: (string & import("effect/Brand").Brand<"TaskId">) | null;
|
|
122
|
+
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
123
|
+
readonly validatorKey: string;
|
|
124
|
+
readonly output: unknown;
|
|
125
|
+
}[];
|
|
126
|
+
export declare function selectFailedValidations(snapshot: EngineReadModel | null, runId: RunId | null): {
|
|
127
|
+
readonly id: string & import("effect/Brand").Brand<"ValidationResultId">;
|
|
128
|
+
readonly status: "running" | "pending" | "failed" | "passed" | "skipped";
|
|
129
|
+
readonly completedAt: string | null;
|
|
130
|
+
readonly startedAt: string;
|
|
131
|
+
readonly taskId: (string & import("effect/Brand").Brand<"TaskId">) | null;
|
|
132
|
+
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
133
|
+
readonly validatorKey: string;
|
|
134
|
+
readonly output: unknown;
|
|
135
|
+
}[];
|
|
136
|
+
export declare function selectReviewsForRun(snapshot: EngineReadModel | null, runId: RunId | null): {
|
|
137
|
+
readonly id: string & import("effect/Brand").Brand<"ReviewResultId">;
|
|
138
|
+
readonly createdAt: string;
|
|
139
|
+
readonly status: "running" | "error" | "rejected" | "pending" | "approved";
|
|
140
|
+
readonly completedAt: string | null;
|
|
141
|
+
readonly summary: string | null;
|
|
142
|
+
readonly provider: string;
|
|
143
|
+
readonly mode: "required" | "off" | "advisory";
|
|
144
|
+
readonly taskId: (string & import("effect/Brand").Brand<"TaskId">) | null;
|
|
145
|
+
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
146
|
+
readonly output: unknown;
|
|
147
|
+
}[];
|
|
148
|
+
export declare function selectReviewsForTask(snapshot: EngineReadModel | null, taskId: TaskId | null): {
|
|
149
|
+
readonly id: string & import("effect/Brand").Brand<"ReviewResultId">;
|
|
150
|
+
readonly createdAt: string;
|
|
151
|
+
readonly status: "running" | "error" | "rejected" | "pending" | "approved";
|
|
152
|
+
readonly completedAt: string | null;
|
|
153
|
+
readonly summary: string | null;
|
|
154
|
+
readonly provider: string;
|
|
155
|
+
readonly mode: "required" | "off" | "advisory";
|
|
156
|
+
readonly taskId: (string & import("effect/Brand").Brand<"TaskId">) | null;
|
|
157
|
+
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
158
|
+
readonly output: unknown;
|
|
159
|
+
}[];
|
|
160
|
+
export declare function selectArtifactsForRun(snapshot: EngineReadModel | null, runId: RunId | null): ArtifactSummary[];
|
|
161
|
+
export declare function selectArtifactsForTask(snapshot: EngineReadModel | null, taskId: TaskId | null): ArtifactSummary[];
|
|
162
|
+
export declare function selectPolicyDecisionsForTask(snapshot: EngineReadModel | null, taskId: TaskId | null): {
|
|
163
|
+
readonly id: string;
|
|
164
|
+
readonly createdAt: string;
|
|
165
|
+
readonly decision: "allow" | "block" | "warn";
|
|
166
|
+
readonly mode: "off" | "enforce" | "observe";
|
|
167
|
+
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
168
|
+
readonly actionId: (string & import("effect/Brand").Brand<"ActionId">) | null;
|
|
169
|
+
readonly reason: string;
|
|
170
|
+
readonly matchedRules: readonly string[];
|
|
171
|
+
}[];
|
|
172
|
+
export declare function selectRemoteEndpoints(snapshot: EngineReadModel | null): readonly RemoteEndpoint[];
|
|
173
|
+
export declare function selectRemoteConnections(snapshot: EngineReadModel | null): readonly RemoteConnectionSummary[];
|
|
174
|
+
export declare function selectRemoteEndpoint(snapshot: EngineReadModel | null, endpointId: string | null): {
|
|
175
|
+
readonly id: string & import("effect/Brand").Brand<"RemoteEndpointId">;
|
|
176
|
+
readonly port: number;
|
|
177
|
+
readonly lastConnectedAt: string | null;
|
|
178
|
+
readonly alias: string;
|
|
179
|
+
readonly host: string;
|
|
180
|
+
readonly token: string;
|
|
181
|
+
readonly addedAt: string;
|
|
182
|
+
readonly tokenConfigured?: boolean | undefined;
|
|
183
|
+
readonly autoConnect?: boolean | undefined;
|
|
184
|
+
} | null;
|
|
185
|
+
export declare function selectRemoteConnection(snapshot: EngineReadModel | null, endpointId: string | null): {
|
|
186
|
+
readonly error: string | null;
|
|
187
|
+
readonly status: "error" | "disconnected" | "connecting" | "authenticating" | "connected" | "reconnecting";
|
|
188
|
+
readonly endpointId: string & import("effect/Brand").Brand<"RemoteEndpointId">;
|
|
189
|
+
readonly connectedAt: string | null;
|
|
190
|
+
readonly tokenExpiresAt: string | null;
|
|
191
|
+
readonly latencyMs: number | null;
|
|
192
|
+
readonly subscribedEvents: readonly string[];
|
|
193
|
+
} | null;
|
|
194
|
+
export declare function selectConnectedRemoteCount(snapshot: EngineReadModel | null): number;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { TaskSummary } from "@rig/contracts";
|
|
2
|
+
export declare function readTaskMetadataStringList(task: TaskSummary, key: "dependencies" | "parentChildDeps" | "labels"): string[];
|
|
3
|
+
export declare function readTaskSourceIssueId(task: TaskSummary): string | null;
|
|
4
|
+
export declare function resolveTaskReference(ref: string, tasksById: ReadonlyMap<string, TaskSummary>, taskIdByExternalRef: ReadonlyMap<string, string>, taskIdBySourceIssueId: ReadonlyMap<string, string>): string | null;
|
|
5
|
+
export declare function buildTaskReferenceIndex(tasks: readonly TaskSummary[]): {
|
|
6
|
+
tasksById: Map<string, {
|
|
7
|
+
readonly id: string & import("effect/Brand").Brand<"TaskId">;
|
|
8
|
+
readonly title: string;
|
|
9
|
+
readonly createdAt: string;
|
|
10
|
+
readonly updatedAt: string;
|
|
11
|
+
readonly role: string | null;
|
|
12
|
+
readonly status: "running" | "ready" | "completed" | "failed" | "draft" | "open" | "queued" | "in_progress" | "under_review" | "blocked" | "unknown" | "cancelled" | "closed";
|
|
13
|
+
readonly metadata: unknown;
|
|
14
|
+
readonly description: string;
|
|
15
|
+
readonly workspaceId: string & import("effect/Brand").Brand<"WorkspaceId">;
|
|
16
|
+
readonly graphId: (string & import("effect/Brand").Brand<"GraphId">) | null;
|
|
17
|
+
readonly externalId: string | null;
|
|
18
|
+
readonly priority: number | null;
|
|
19
|
+
readonly scope: readonly string[];
|
|
20
|
+
readonly validationKeys: readonly string[];
|
|
21
|
+
readonly dependencies?: readonly string[] | undefined;
|
|
22
|
+
readonly sourceIssueId?: string | null | undefined;
|
|
23
|
+
readonly parentChildDeps?: readonly string[] | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
taskIdByExternalRef: Map<string, string & import("effect/Brand").Brand<"TaskId">>;
|
|
26
|
+
taskIdBySourceIssueId: Map<string, string & import("effect/Brand").Brand<"TaskId">>;
|
|
27
|
+
};
|
|
28
|
+
export declare function computeTaskBlockingDepths(tasks: readonly TaskSummary[]): Map<string, number>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { EngineReadModel, TaskSummary } from "@rig/contracts";
|
|
2
|
+
export type TaskGraphLane = Readonly<{
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
rowIndex: number;
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
color: string;
|
|
11
|
+
taskCount: number;
|
|
12
|
+
}>;
|
|
13
|
+
export type TaskGraphStage = Readonly<{
|
|
14
|
+
index: number;
|
|
15
|
+
label: string;
|
|
16
|
+
x: number;
|
|
17
|
+
width: number;
|
|
18
|
+
}>;
|
|
19
|
+
export type TaskGraphNode = Readonly<{
|
|
20
|
+
id: string;
|
|
21
|
+
task: TaskSummary;
|
|
22
|
+
rowKey: string;
|
|
23
|
+
rowLabel: string;
|
|
24
|
+
rowIndex: number;
|
|
25
|
+
stage: number;
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
color: string;
|
|
31
|
+
taskCode: string | null;
|
|
32
|
+
strippedTitle: string;
|
|
33
|
+
depsIn: number;
|
|
34
|
+
depsOut: number;
|
|
35
|
+
runCount: number;
|
|
36
|
+
hasApprovals: boolean;
|
|
37
|
+
hasPendingUserInput: boolean;
|
|
38
|
+
hasRejectedReview: boolean;
|
|
39
|
+
hasFailedValidations: boolean;
|
|
40
|
+
artifactCount: number;
|
|
41
|
+
}>;
|
|
42
|
+
export type TaskGraphEdge = Readonly<{
|
|
43
|
+
id: string;
|
|
44
|
+
sourceId: string;
|
|
45
|
+
targetId: string;
|
|
46
|
+
color: string;
|
|
47
|
+
kind: "blocking" | "parent-child";
|
|
48
|
+
}>;
|
|
49
|
+
export type TaskGraphLayout = Readonly<{
|
|
50
|
+
lanes: readonly TaskGraphLane[];
|
|
51
|
+
stages: readonly TaskGraphStage[];
|
|
52
|
+
nodes: readonly TaskGraphNode[];
|
|
53
|
+
edges: readonly TaskGraphEdge[];
|
|
54
|
+
totalWidth: number;
|
|
55
|
+
totalHeight: number;
|
|
56
|
+
taskCount: number;
|
|
57
|
+
}>;
|
|
58
|
+
export declare function buildTaskGraphLayout(snapshot: EngineReadModel | null, tasks: readonly TaskSummary[], options?: {
|
|
59
|
+
showParentChild?: boolean;
|
|
60
|
+
}): TaskGraphLayout;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h-rig/core",
|
|
3
|
-
"version": "0.0.6-alpha.
|
|
3
|
+
"version": "0.0.6-alpha.79",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Rig package",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -10,18 +10,23 @@
|
|
|
10
10
|
],
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"types": "./dist/src/index.d.ts",
|
|
13
14
|
"import": "./dist/src/index.js"
|
|
14
15
|
},
|
|
15
16
|
"./load-config": {
|
|
17
|
+
"types": "./dist/src/load-config.d.ts",
|
|
16
18
|
"import": "./dist/src/load-config.js"
|
|
17
19
|
},
|
|
18
20
|
"./engineReadModelReducer": {
|
|
21
|
+
"types": "./dist/src/engineReadModelReducer.d.ts",
|
|
19
22
|
"import": "./dist/src/engineReadModelReducer.js"
|
|
20
23
|
},
|
|
21
24
|
"./rigSelectors": {
|
|
25
|
+
"types": "./dist/src/rigSelectors.d.ts",
|
|
22
26
|
"import": "./dist/src/rigSelectors.js"
|
|
23
27
|
},
|
|
24
28
|
"./taskGraph": {
|
|
29
|
+
"types": "./dist/src/taskGraph.d.ts",
|
|
25
30
|
"import": "./dist/src/taskGraph.js"
|
|
26
31
|
}
|
|
27
32
|
},
|
|
@@ -30,8 +35,9 @@
|
|
|
30
35
|
},
|
|
31
36
|
"main": "./dist/src/index.js",
|
|
32
37
|
"module": "./dist/src/index.js",
|
|
38
|
+
"types": "./dist/src/index.d.ts",
|
|
33
39
|
"dependencies": {
|
|
34
|
-
"@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.
|
|
40
|
+
"@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.79",
|
|
35
41
|
"effect": "4.0.0-beta.78"
|
|
36
42
|
}
|
|
37
43
|
}
|