@h-rig/cli-surface-plugin 0.0.6-alpha.154 → 0.0.6-alpha.156
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/commands/_cli-format.js +1 -1
- package/dist/src/commands/_doctor-checks.d.ts +10 -3
- package/dist/src/commands/_doctor-checks.js +18 -2
- package/dist/src/commands/_inprocess-services.d.ts +1 -1
- package/dist/src/commands/_inprocess-services.js +1 -1
- package/dist/src/commands/_parsers.d.ts +2 -2
- package/dist/src/commands/config.js +1 -1
- package/dist/src/commands/doctor.js +18 -2
- package/dist/src/commands/github.js +1 -1
- package/dist/src/commands/inbox.d.ts +2 -2
- package/dist/src/commands/inbox.js +2 -2
- package/dist/src/commands/init.d.ts +1 -1
- package/dist/src/commands/init.js +20 -4
- package/dist/src/commands/inspect.d.ts +1 -1
- package/dist/src/commands/inspect.js +8 -6
- package/dist/src/commands/repo-git-harness.js +2 -1
- package/dist/src/commands/run.d.ts +2 -1
- package/dist/src/commands/run.js +10 -10
- package/dist/src/commands/server.js +2 -2
- package/dist/src/commands/setup.d.ts +2 -2
- package/dist/src/commands/setup.js +19 -3
- package/dist/src/commands/stats.d.ts +1 -1
- package/dist/src/commands/stats.js +2 -2
- package/dist/src/commands/task.d.ts +2 -2
- package/dist/src/commands/task.js +8 -8
- package/dist/src/commands/triage.d.ts +1 -1
- package/dist/src/commands/triage.js +1 -1
- package/dist/src/plugin.d.ts +2 -2
- package/dist/src/plugin.js +1 -3
- package/dist/src/provider-model.d.ts +34 -0
- package/dist/src/provider-model.js +56 -0
- package/package.json +11 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// packages/cli-surface-plugin/src/commands/_cli-format.ts
|
|
3
3
|
import pc from "picocolors";
|
|
4
|
-
import { runStatusColorRole, runStatusText, statusColorRole } from "@rig/
|
|
4
|
+
import { runStatusColorRole, runStatusText, statusColorRole } from "@rig/run-worker/runs";
|
|
5
5
|
var dim = pc.dim;
|
|
6
6
|
var faintBar = pc.dim("\u2502");
|
|
7
7
|
var accent = pc.cyan;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import { countDoctorFailures
|
|
2
|
-
import type { DoctorCheck, DoctorStatus
|
|
1
|
+
import { countDoctorFailures } from "@rig/contracts";
|
|
2
|
+
import type { DoctorCheck, DoctorStatus } from "@rig/contracts";
|
|
3
|
+
import { type RunDoctorChecksOptions } from "@rig/runtime/control-plane/doctor-service-port";
|
|
3
4
|
export type RigDoctorCheck = DoctorCheck;
|
|
4
5
|
export type { DoctorStatus };
|
|
5
6
|
export type RunRigDoctorChecksOptions = RunDoctorChecksOptions;
|
|
6
|
-
export declare const runRigDoctorChecks: typeof runDoctorChecks;
|
|
7
7
|
export { countDoctorFailures };
|
|
8
|
+
/**
|
|
9
|
+
* Resolve the diagnostic doctor product from @rig/doctor-plugin through the
|
|
10
|
+
* runtime port (a plugin host built from the project's rig.config). When the
|
|
11
|
+
* plugin/config is unresolvable, degrade to a single actionable fail check
|
|
12
|
+
* rather than throwing — the doctor command still reports something useful.
|
|
13
|
+
*/
|
|
14
|
+
export declare function runRigDoctorChecks(options: RunRigDoctorChecksOptions): Promise<DoctorCheck[]>;
|
|
8
15
|
export declare function formatDoctorChecks(checks: readonly RigDoctorCheck[]): string;
|
|
9
16
|
export declare function throwIfDoctorFailed(checks: readonly RigDoctorCheck[]): void;
|
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// packages/cli-surface-plugin/src/commands/_doctor-checks.ts
|
|
3
|
-
import { countDoctorFailures
|
|
4
|
-
|
|
3
|
+
import { countDoctorFailures } from "@rig/contracts";
|
|
4
|
+
import { loadDoctorService } from "@rig/runtime/control-plane/doctor-service-port";
|
|
5
|
+
async function runRigDoctorChecks(options) {
|
|
6
|
+
const service = await loadDoctorService(options.projectRoot);
|
|
7
|
+
if (!service) {
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
id: "doctor-plugin",
|
|
11
|
+
label: "doctor diagnostics",
|
|
12
|
+
status: "fail",
|
|
13
|
+
level: "fail",
|
|
14
|
+
detail: "@rig/doctor-plugin is not resolvable from rig.config",
|
|
15
|
+
remediation: "Ensure rig.config registers @rig/doctor-plugin (included in standardPlugins) and that rig.config loads."
|
|
16
|
+
}
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
return service.runDoctorChecks(options);
|
|
20
|
+
}
|
|
5
21
|
function formatDoctorChecks(checks) {
|
|
6
22
|
return checks.map((entry) => {
|
|
7
23
|
const status = String(entry.status ?? entry.level ?? "warn");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { saveGitHubTokenForProject, type GitHubAuthStatus } from "@rig/
|
|
1
|
+
import { saveGitHubTokenForProject, type GitHubAuthStatus } from "@rig/github-provider-plugin";
|
|
2
2
|
export type GitHubAuthStatusResponse = {
|
|
3
3
|
readonly ok: true;
|
|
4
4
|
} & GitHubAuthStatus;
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
resolveGitHubAuthStatus,
|
|
11
11
|
resolveProjectStatusField,
|
|
12
12
|
saveGitHubTokenForProject
|
|
13
|
-
} from "@rig/
|
|
13
|
+
} from "@rig/github-provider-plugin";
|
|
14
14
|
var scopedGitHubBearerTokens = new Map;
|
|
15
15
|
function cleanToken(value) {
|
|
16
16
|
const trimmed = value?.trim();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TaskSourceConfig } from "@rig/contracts";
|
|
2
|
-
import type {
|
|
2
|
+
import type { RigPlugin } from "@rig/core";
|
|
3
3
|
export declare function parsePositiveInt(value: string | undefined, option: string, fallback: number): number;
|
|
4
4
|
export declare function parseOptionalPositiveInt(value: string | undefined, option: string): number | undefined;
|
|
5
5
|
export declare function parseRequiredPositiveInt(value: string | undefined, option: string): number;
|
|
@@ -9,7 +9,7 @@ export declare function parseIsolationMode(value: string | undefined, allowOff:
|
|
|
9
9
|
export declare function parseInstallScope(value: string | undefined): "user" | "system";
|
|
10
10
|
export declare function resolveInstallDir(scope: "user" | "system", explicitPath: string | undefined): string;
|
|
11
11
|
export type CliRigConfig = {
|
|
12
|
-
plugins?: readonly
|
|
12
|
+
plugins?: readonly RigPlugin[];
|
|
13
13
|
taskSource?: TaskSourceConfig;
|
|
14
14
|
};
|
|
15
15
|
export declare function loadRigConfigOrNull(projectRoot: string): Promise<CliRigConfig | null>;
|
|
@@ -35,7 +35,7 @@ Usage: ${usage}`);
|
|
|
35
35
|
|
|
36
36
|
// packages/cli-surface-plugin/src/commands/_cli-format.ts
|
|
37
37
|
import pc from "picocolors";
|
|
38
|
-
import { runStatusColorRole, runStatusText, statusColorRole } from "@rig/
|
|
38
|
+
import { runStatusColorRole, runStatusText, statusColorRole } from "@rig/run-worker/runs";
|
|
39
39
|
var dim = pc.dim;
|
|
40
40
|
var faintBar = pc.dim("\u2502");
|
|
41
41
|
var accent = pc.cyan;
|
|
@@ -22,8 +22,24 @@ Usage: ${usage}`);
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
// packages/cli-surface-plugin/src/commands/_doctor-checks.ts
|
|
25
|
-
import { countDoctorFailures
|
|
26
|
-
|
|
25
|
+
import { countDoctorFailures } from "@rig/contracts";
|
|
26
|
+
import { loadDoctorService } from "@rig/runtime/control-plane/doctor-service-port";
|
|
27
|
+
async function runRigDoctorChecks(options) {
|
|
28
|
+
const service = await loadDoctorService(options.projectRoot);
|
|
29
|
+
if (!service) {
|
|
30
|
+
return [
|
|
31
|
+
{
|
|
32
|
+
id: "doctor-plugin",
|
|
33
|
+
label: "doctor diagnostics",
|
|
34
|
+
status: "fail",
|
|
35
|
+
level: "fail",
|
|
36
|
+
detail: "@rig/doctor-plugin is not resolvable from rig.config",
|
|
37
|
+
remediation: "Ensure rig.config registers @rig/doctor-plugin (included in standardPlugins) and that rig.config loads."
|
|
38
|
+
}
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
return service.runDoctorChecks(options);
|
|
42
|
+
}
|
|
27
43
|
function formatDoctorChecks(checks) {
|
|
28
44
|
return checks.map((entry) => {
|
|
29
45
|
const status = String(entry.status ?? entry.level ?? "warn");
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
resolveGitHubAuthStatus,
|
|
52
52
|
resolveProjectStatusField,
|
|
53
53
|
saveGitHubTokenForProject
|
|
54
|
-
} from "@rig/
|
|
54
|
+
} from "@rig/github-provider-plugin";
|
|
55
55
|
var scopedGitHubBearerTokens = new Map;
|
|
56
56
|
function cleanToken(value) {
|
|
57
57
|
const trimmed = value?.trim();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CommandOutcome } from "@rig/runtime";
|
|
2
|
-
import type { InboxDeps as ClientInboxDeps, InboxKind, InboxRecord } from "@rig/
|
|
2
|
+
import type { InboxDeps as ClientInboxDeps, InboxKind, InboxRecord } from "@rig/run-worker/runs";
|
|
3
3
|
import { type RunnerContext } from "../runner";
|
|
4
|
-
export type { InboxKind, InboxRecord } from "@rig/
|
|
4
|
+
export type { InboxKind, InboxRecord } from "@rig/run-worker/runs";
|
|
5
5
|
export interface InboxFilters {
|
|
6
6
|
readonly run?: string;
|
|
7
7
|
readonly task?: string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// packages/cli-surface-plugin/src/commands/inbox.ts
|
|
3
3
|
import { Duration, Effect, Stream } from "effect";
|
|
4
4
|
import { localRunChanges } from "@rig/runtime/control-plane/run-discovery-stream";
|
|
5
|
-
import { listInboxRecords as clientListInboxRecords, readInboxCounts, resolveInboxRequest } from "@rig/
|
|
5
|
+
import { listInboxRecords as clientListInboxRecords, readInboxCounts, resolveInboxRequest } from "@rig/run-worker/runs";
|
|
6
6
|
|
|
7
7
|
// packages/cli-surface-plugin/src/runner.ts
|
|
8
8
|
import { EventBus } from "@rig/runtime/control-plane/runtime/events";
|
|
@@ -48,7 +48,7 @@ Usage: ${usage}`);
|
|
|
48
48
|
|
|
49
49
|
// packages/cli-surface-plugin/src/commands/_cli-format.ts
|
|
50
50
|
import pc from "picocolors";
|
|
51
|
-
import { runStatusColorRole, runStatusText, statusColorRole } from "@rig/
|
|
51
|
+
import { runStatusColorRole, runStatusText, statusColorRole } from "@rig/run-worker/runs";
|
|
52
52
|
var dim = pc.dim;
|
|
53
53
|
var faintBar = pc.dim("\u2502");
|
|
54
54
|
var accent = pc.cyan;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RunnerContext } from "../runner";
|
|
2
|
-
import { buildRigInitConfigSource, type RigInitConfigInput } from "@rig/
|
|
2
|
+
import { buildRigInitConfigSource, type RigInitConfigInput } from "@rig/init-plugin";
|
|
3
3
|
import type { CommandOutcome } from "@rig/runtime";
|
|
4
4
|
export { buildRigInitConfigSource };
|
|
5
5
|
export type { RigInitConfigInput };
|
|
@@ -353,7 +353,7 @@ function takeOption(args, option) {
|
|
|
353
353
|
}
|
|
354
354
|
|
|
355
355
|
// packages/cli-surface-plugin/src/commands/init.ts
|
|
356
|
-
import { buildRigInitConfigSource } from "@rig/
|
|
356
|
+
import { buildRigInitConfigSource } from "@rig/init-plugin";
|
|
357
357
|
|
|
358
358
|
// packages/cli-surface-plugin/src/commands/_connection-state.ts
|
|
359
359
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
@@ -411,7 +411,7 @@ import {
|
|
|
411
411
|
resolveGitHubAuthStatus,
|
|
412
412
|
resolveProjectStatusField,
|
|
413
413
|
saveGitHubTokenForProject
|
|
414
|
-
} from "@rig/
|
|
414
|
+
} from "@rig/github-provider-plugin";
|
|
415
415
|
var scopedGitHubBearerTokens = new Map;
|
|
416
416
|
function cleanToken(value) {
|
|
417
417
|
const trimmed = value?.trim();
|
|
@@ -623,8 +623,24 @@ async function ensurePiRigInstalled(input) {
|
|
|
623
623
|
}
|
|
624
624
|
|
|
625
625
|
// packages/cli-surface-plugin/src/commands/_doctor-checks.ts
|
|
626
|
-
import { countDoctorFailures
|
|
627
|
-
|
|
626
|
+
import { countDoctorFailures } from "@rig/contracts";
|
|
627
|
+
import { loadDoctorService } from "@rig/runtime/control-plane/doctor-service-port";
|
|
628
|
+
async function runRigDoctorChecks(options) {
|
|
629
|
+
const service = await loadDoctorService(options.projectRoot);
|
|
630
|
+
if (!service) {
|
|
631
|
+
return [
|
|
632
|
+
{
|
|
633
|
+
id: "doctor-plugin",
|
|
634
|
+
label: "doctor diagnostics",
|
|
635
|
+
status: "fail",
|
|
636
|
+
level: "fail",
|
|
637
|
+
detail: "@rig/doctor-plugin is not resolvable from rig.config",
|
|
638
|
+
remediation: "Ensure rig.config registers @rig/doctor-plugin (included in standardPlugins) and that rig.config loads."
|
|
639
|
+
}
|
|
640
|
+
];
|
|
641
|
+
}
|
|
642
|
+
return service.runDoctorChecks(options);
|
|
643
|
+
}
|
|
628
644
|
|
|
629
645
|
// packages/cli-surface-plugin/src/version.ts
|
|
630
646
|
import { existsSync as existsSync3, readFileSync as readFileSync2 } from "fs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RunSessionCustomEntry } from "@rig/contracts";
|
|
2
2
|
import type { CommandOutcome } from "@rig/runtime/control-plane/runtime/types";
|
|
3
3
|
import type { TaskArtifactReadResult } from "@rig/runtime/control-plane/native/task-ops";
|
|
4
|
-
import type { RunRecord } from "@rig/
|
|
4
|
+
import type { RunRecord } from "@rig/run-worker/runs";
|
|
5
5
|
import { type RunnerContext } from "../runner";
|
|
6
6
|
type MaybePromise<T> = T | Promise<T>;
|
|
7
7
|
type InspectCommandDeps = {
|
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
// packages/cli-surface-plugin/src/commands/inspect.ts
|
|
3
3
|
import {
|
|
4
4
|
changedFilesForTask,
|
|
5
|
+
taskArtifactRead,
|
|
6
|
+
taskArtifacts,
|
|
7
|
+
taskDeps
|
|
8
|
+
} from "@rig/runtime/control-plane/native/task-ops";
|
|
9
|
+
import {
|
|
5
10
|
extractRunLogs,
|
|
6
11
|
getRun,
|
|
7
12
|
listRuns,
|
|
8
13
|
runsForTask,
|
|
9
|
-
summarizeRunFailures
|
|
10
|
-
|
|
11
|
-
taskArtifacts,
|
|
12
|
-
taskDeps
|
|
13
|
-
} from "@rig/client";
|
|
14
|
+
summarizeRunFailures
|
|
15
|
+
} from "@rig/run-worker/runs";
|
|
14
16
|
|
|
15
17
|
// packages/cli-surface-plugin/src/runner.ts
|
|
16
18
|
import { EventBus } from "@rig/runtime/control-plane/runtime/events";
|
|
@@ -63,7 +65,7 @@ Usage: ${usage}`);
|
|
|
63
65
|
|
|
64
66
|
// packages/cli-surface-plugin/src/commands/_cli-format.ts
|
|
65
67
|
import pc from "picocolors";
|
|
66
|
-
import { runStatusColorRole, runStatusText, statusColorRole } from "@rig/
|
|
68
|
+
import { runStatusColorRole, runStatusText, statusColorRole } from "@rig/run-worker/runs";
|
|
67
69
|
var dim = pc.dim;
|
|
68
70
|
var faintBar = pc.dim("\u2502");
|
|
69
71
|
var accent = pc.cyan;
|
|
@@ -59,6 +59,7 @@ Usage: ${usage}`);
|
|
|
59
59
|
// packages/cli-surface-plugin/src/commands/repo-git-harness.ts
|
|
60
60
|
import { executeHarnessCommand } from "@rig/runtime/control-plane/native/harness-cli";
|
|
61
61
|
import { repoEnsure, resetBaseline } from "@rig/runtime/control-plane/native/repo-ops";
|
|
62
|
+
import { taskVerify } from "@rig/bundle-default-lifecycle/control-plane/task-verify";
|
|
62
63
|
|
|
63
64
|
// packages/cli-surface-plugin/src/withMutedConsole.ts
|
|
64
65
|
function isPromise(value) {
|
|
@@ -269,7 +270,7 @@ async function executeHarness(context, args) {
|
|
|
269
270
|
return { ok: true, group: "harness", command: args[0] ?? "harness" };
|
|
270
271
|
}
|
|
271
272
|
try {
|
|
272
|
-
await executeHarnessCommand(context.projectRoot, args);
|
|
273
|
+
await executeHarnessCommand(context.projectRoot, args, undefined, undefined, { taskVerify });
|
|
273
274
|
} catch (error) {
|
|
274
275
|
throw new CliError(error instanceof Error ? error.message : String(error), 2);
|
|
275
276
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CommandOutcome } from "@rig/runtime";
|
|
2
|
-
import type {
|
|
2
|
+
import type { TaskLike } from "@rig/core/task-io";
|
|
3
|
+
import type { RunControl, RunJoinTarget, RunRecord } from "@rig/run-worker/runs";
|
|
3
4
|
import { type RunnerContext } from "../runner";
|
|
4
5
|
export type RunTaskLike = TaskLike & Record<string, unknown>;
|
|
5
6
|
export interface RunExecutorDeps {
|
package/dist/src/commands/run.js
CHANGED
|
@@ -3,23 +3,23 @@ var __require = import.meta.require;
|
|
|
3
3
|
|
|
4
4
|
// packages/cli-surface-plugin/src/commands/run.ts
|
|
5
5
|
import { TERMINAL_RUN_STATUSES } from "@rig/contracts";
|
|
6
|
+
import {
|
|
7
|
+
listTasks,
|
|
8
|
+
normalizeTaskId,
|
|
9
|
+
readTaskTitle
|
|
10
|
+
} from "@rig/core/task-io";
|
|
11
|
+
import { removeRegistryRoom } from "@rig/runtime/control-plane/registry-room";
|
|
12
|
+
import { isReadyTask, resolveStartTask, selectNextReadyTask } from "@rig/dependency-graph-plugin";
|
|
6
13
|
import {
|
|
7
14
|
activeRunByTaskId,
|
|
8
15
|
assertNoActiveRunForTask,
|
|
9
16
|
deliverRemoteRunControl,
|
|
10
17
|
deliverRunControl,
|
|
11
18
|
getRun,
|
|
12
|
-
isReadyTask,
|
|
13
19
|
listRuns,
|
|
14
|
-
listTasks,
|
|
15
|
-
normalizeTaskId,
|
|
16
20
|
readSessionRunEntries,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
resolveJoinTarget,
|
|
20
|
-
resolveStartTask,
|
|
21
|
-
selectNextReadyTask
|
|
22
|
-
} from "@rig/client";
|
|
21
|
+
resolveJoinTarget
|
|
22
|
+
} from "@rig/run-worker/runs";
|
|
23
23
|
|
|
24
24
|
// packages/cli-surface-plugin/src/runner.ts
|
|
25
25
|
import { EventBus } from "@rig/runtime/control-plane/runtime/events";
|
|
@@ -88,7 +88,7 @@ async function dispatchThroughKernel(input, options) {
|
|
|
88
88
|
|
|
89
89
|
// packages/cli-surface-plugin/src/commands/_cli-format.ts
|
|
90
90
|
import pc from "picocolors";
|
|
91
|
-
import { runStatusColorRole, runStatusText, statusColorRole } from "@rig/
|
|
91
|
+
import { runStatusColorRole, runStatusText, statusColorRole } from "@rig/run-worker/runs";
|
|
92
92
|
var dim = pc.dim;
|
|
93
93
|
var faintBar = pc.dim("\u2502");
|
|
94
94
|
var accent = pc.cyan;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// packages/cli-surface-plugin/src/commands/server.ts
|
|
3
|
-
import { addPlacement, listPlacements, readPlacement, removePlacement, selectPlacement } from "@rig/
|
|
3
|
+
import { addPlacement, listPlacements, readPlacement, removePlacement, selectPlacement } from "@rig/runtime/control-plane/placement";
|
|
4
4
|
|
|
5
5
|
// packages/cli-surface-plugin/src/runner.ts
|
|
6
6
|
import { EventBus } from "@rig/runtime/control-plane/runtime/events";
|
|
@@ -46,7 +46,7 @@ Usage: ${usage}`);
|
|
|
46
46
|
|
|
47
47
|
// packages/cli-surface-plugin/src/commands/_cli-format.ts
|
|
48
48
|
import pc from "picocolors";
|
|
49
|
-
import { runStatusColorRole, runStatusText, statusColorRole } from "@rig/
|
|
49
|
+
import { runStatusColorRole, runStatusText, statusColorRole } from "@rig/run-worker/runs";
|
|
50
50
|
var dim = pc.dim;
|
|
51
51
|
var faintBar = pc.dim("\u2502");
|
|
52
52
|
var accent = pc.cyan;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TaskSourceConfig } from "@rig/contracts";
|
|
2
2
|
import type { CommandOutcome } from "@rig/runtime";
|
|
3
|
-
import { type
|
|
3
|
+
import { type RigPlugin } from "@rig/core";
|
|
4
4
|
import { type RunnerContext } from "../runner";
|
|
5
5
|
type SetupCheck = {
|
|
6
6
|
ok: boolean;
|
|
@@ -8,7 +8,7 @@ type SetupCheck = {
|
|
|
8
8
|
hint?: string;
|
|
9
9
|
};
|
|
10
10
|
type SetupRigConfig = {
|
|
11
|
-
plugins?: readonly
|
|
11
|
+
plugins?: readonly RigPlugin[];
|
|
12
12
|
taskSource?: TaskSourceConfig;
|
|
13
13
|
};
|
|
14
14
|
export declare function buildTaskSourceKindSetupCheck(config: SetupRigConfig): SetupCheck | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// packages/cli-surface-plugin/src/commands/setup.ts
|
|
3
3
|
import { createPluginHost } from "@rig/core";
|
|
4
|
-
import { detectStartupStatus, ensureGitHubAuth, parseRepoSlug, runSetup, validateGitHubAuth } from "@rig/
|
|
4
|
+
import { detectStartupStatus, ensureGitHubAuth, parseRepoSlug, runSetup, validateGitHubAuth } from "@rig/init-plugin";
|
|
5
5
|
|
|
6
6
|
// packages/cli-surface-plugin/src/runner.ts
|
|
7
7
|
import { EventBus } from "@rig/runtime/control-plane/runtime/events";
|
|
@@ -97,8 +97,24 @@ function withMutedConsole(mute, fn) {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
// packages/cli-surface-plugin/src/commands/_doctor-checks.ts
|
|
100
|
-
import { countDoctorFailures
|
|
101
|
-
|
|
100
|
+
import { countDoctorFailures } from "@rig/contracts";
|
|
101
|
+
import { loadDoctorService } from "@rig/runtime/control-plane/doctor-service-port";
|
|
102
|
+
async function runRigDoctorChecks(options) {
|
|
103
|
+
const service = await loadDoctorService(options.projectRoot);
|
|
104
|
+
if (!service) {
|
|
105
|
+
return [
|
|
106
|
+
{
|
|
107
|
+
id: "doctor-plugin",
|
|
108
|
+
label: "doctor diagnostics",
|
|
109
|
+
status: "fail",
|
|
110
|
+
level: "fail",
|
|
111
|
+
detail: "@rig/doctor-plugin is not resolvable from rig.config",
|
|
112
|
+
remediation: "Ensure rig.config registers @rig/doctor-plugin (included in standardPlugins) and that rig.config loads."
|
|
113
|
+
}
|
|
114
|
+
];
|
|
115
|
+
}
|
|
116
|
+
return service.runDoctorChecks(options);
|
|
117
|
+
}
|
|
102
118
|
function formatDoctorChecks(checks) {
|
|
103
119
|
return checks.map((entry) => {
|
|
104
120
|
const status = String(entry.status ?? entry.level ?? "warn");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RigStatsData } from "@rig/contracts";
|
|
2
2
|
import type { CommandOutcome } from "@rig/runtime";
|
|
3
|
-
import type { RunRecord } from "@rig/
|
|
3
|
+
import type { RunRecord } from "@rig/run-worker/runs";
|
|
4
4
|
import { type RunnerContext } from "../runner";
|
|
5
5
|
type StatsCommandDeps = {
|
|
6
6
|
listRuns?: (projectRoot: string) => Promise<RunRecord[]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// packages/cli-surface-plugin/src/commands/stats.ts
|
|
3
|
-
import { computeStats } from "@rig/
|
|
3
|
+
import { computeStats } from "@rig/run-worker/runs";
|
|
4
4
|
|
|
5
5
|
// packages/cli-surface-plugin/src/runner.ts
|
|
6
6
|
import { EventBus } from "@rig/runtime/control-plane/runtime/events";
|
|
@@ -46,7 +46,7 @@ Usage: ${usage}`);
|
|
|
46
46
|
|
|
47
47
|
// packages/cli-surface-plugin/src/commands/_cli-format.ts
|
|
48
48
|
import pc from "picocolors";
|
|
49
|
-
import { runStatusColorRole, runStatusText, statusColorRole } from "@rig/
|
|
49
|
+
import { runStatusColorRole, runStatusText, statusColorRole } from "@rig/run-worker/runs";
|
|
50
50
|
var dim = pc.dim;
|
|
51
51
|
var faintBar = pc.dim("\u2502");
|
|
52
52
|
var accent = pc.cyan;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { RegisteredTaskSource } from "@rig/contracts";
|
|
2
2
|
import type { CommandOutcome } from "@rig/runtime/control-plane/runtime/types";
|
|
3
|
-
import type { TaskLike } from "@rig/
|
|
3
|
+
import type { TaskLike } from "@rig/core/task-io";
|
|
4
4
|
import { type RunnerContext } from "../runner";
|
|
5
|
-
export type { TaskLike } from "@rig/
|
|
5
|
+
export type { TaskLike } from "@rig/core/task-io";
|
|
6
6
|
type TaskDispatch = (input: {
|
|
7
7
|
readonly projectRoot: string;
|
|
8
8
|
readonly taskId: string;
|
|
@@ -3,14 +3,13 @@ var __require = import.meta.require;
|
|
|
3
3
|
|
|
4
4
|
// packages/cli-surface-plugin/src/commands/task.ts
|
|
5
5
|
import {
|
|
6
|
-
applyFilters,
|
|
7
6
|
createTask,
|
|
8
7
|
getTask,
|
|
9
8
|
listTasks,
|
|
10
9
|
normalizeTaskId,
|
|
11
|
-
readTaskTitle
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
readTaskTitle
|
|
11
|
+
} from "@rig/core/task-io";
|
|
12
|
+
import {
|
|
14
13
|
taskArtifactDir,
|
|
15
14
|
taskArtifacts,
|
|
16
15
|
taskArtifactWrite,
|
|
@@ -22,9 +21,10 @@ import {
|
|
|
22
21
|
taskReopen,
|
|
23
22
|
taskScope,
|
|
24
23
|
taskStatus,
|
|
25
|
-
taskValidate
|
|
26
|
-
|
|
27
|
-
} from "@rig/
|
|
24
|
+
taskValidate
|
|
25
|
+
} from "@rig/runtime/control-plane/native/task-ops";
|
|
26
|
+
import { applyFilters, resolveStartTask, selectNextReadyTask } from "@rig/dependency-graph-plugin";
|
|
27
|
+
import { taskVerify } from "@rig/bundle-default-lifecycle/control-plane/task-verify";
|
|
28
28
|
|
|
29
29
|
// packages/cli-surface-plugin/src/runner.ts
|
|
30
30
|
import { EventBus } from "@rig/runtime/control-plane/runtime/events";
|
|
@@ -100,7 +100,7 @@ async function dispatchThroughKernel(input, options) {
|
|
|
100
100
|
|
|
101
101
|
// packages/cli-surface-plugin/src/commands/_cli-format.ts
|
|
102
102
|
import pc from "picocolors";
|
|
103
|
-
import { runStatusColorRole, runStatusText, statusColorRole } from "@rig/
|
|
103
|
+
import { runStatusColorRole, runStatusText, statusColorRole } from "@rig/run-worker/runs";
|
|
104
104
|
var dim = pc.dim;
|
|
105
105
|
var faintBar = pc.dim("\u2502");
|
|
106
106
|
var accent = pc.cyan;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type IssueAnalysisTriageRunResult, type RunIssueAnalysisTriageOptions } from "@rig/
|
|
1
|
+
import { type IssueAnalysisTriageRunResult, type RunIssueAnalysisTriageOptions } from "@rig/github-provider-plugin";
|
|
2
2
|
import type { CommandOutcome } from "@rig/runtime/control-plane/runtime/types";
|
|
3
3
|
import { type RunnerContext } from "../runner";
|
|
4
4
|
type TriageCommandDeps = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// packages/cli-surface-plugin/src/commands/triage.ts
|
|
3
|
-
import { runIssueAnalysisTriage } from "@rig/
|
|
3
|
+
import { runIssueAnalysisTriage } from "@rig/github-provider-plugin";
|
|
4
4
|
|
|
5
5
|
// packages/cli-surface-plugin/src/runner.ts
|
|
6
6
|
import { EventBus } from "@rig/runtime/control-plane/runtime/events";
|
package/dist/src/plugin.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const STANDARD_CLI_SURFACE_PLUGIN_NAME = "@rig/cli-surface-plugin";
|
|
2
|
-
export declare function createStandardCliSurfacePlugin(): import("@rig/core").
|
|
3
|
-
export declare const standardCliSurfacePlugin: import("@rig/core").
|
|
2
|
+
export declare function createStandardCliSurfacePlugin(): import("@rig/core").RigPlugin;
|
|
3
|
+
export declare const standardCliSurfacePlugin: import("@rig/core").RigPlugin;
|
package/dist/src/plugin.js
CHANGED
|
@@ -80,10 +80,8 @@ function createStandardCliSurfacePlugin() {
|
|
|
80
80
|
provides: [],
|
|
81
81
|
contributes: {
|
|
82
82
|
capabilities: [{ id: "surface.cli", title: "Rig CLI surface", description: "Registry-dispatched command-line surface." }],
|
|
83
|
-
cliCommands: stockCliCommands
|
|
83
|
+
cliCommands: stockCliCommands
|
|
84
84
|
}
|
|
85
|
-
}, {
|
|
86
|
-
cliCommands: stockCliCommands
|
|
87
85
|
});
|
|
88
86
|
}
|
|
89
87
|
var standardCliSurfacePlugin = createStandardCliSurfacePlugin();
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CODEX_REASONING_EFFORT_OPTIONS, type CodexReasoningEffort, type ModelSlug, type ProviderKind } from "@rig/contracts";
|
|
2
|
+
export declare function getModelOptions(provider?: ProviderKind): readonly [{
|
|
3
|
+
readonly slug: "gpt-5.4";
|
|
4
|
+
readonly name: "GPT-5.4";
|
|
5
|
+
}, {
|
|
6
|
+
readonly slug: "gpt-5.3-codex";
|
|
7
|
+
readonly name: "GPT-5.3 Codex";
|
|
8
|
+
}, {
|
|
9
|
+
readonly slug: "gpt-5.3-codex-spark";
|
|
10
|
+
readonly name: "GPT-5.3 Codex Spark";
|
|
11
|
+
}, {
|
|
12
|
+
readonly slug: "gpt-5.2-codex";
|
|
13
|
+
readonly name: "GPT-5.2 Codex";
|
|
14
|
+
}, {
|
|
15
|
+
readonly slug: "gpt-5.2";
|
|
16
|
+
readonly name: "GPT-5.2";
|
|
17
|
+
}] | readonly [{
|
|
18
|
+
readonly slug: "claude-sonnet-4-6";
|
|
19
|
+
readonly name: "Claude Sonnet 4.6";
|
|
20
|
+
}, {
|
|
21
|
+
readonly slug: "claude-opus-4-1";
|
|
22
|
+
readonly name: "Claude Opus 4.1";
|
|
23
|
+
}, {
|
|
24
|
+
readonly slug: "claude-3-7-sonnet-latest";
|
|
25
|
+
readonly name: "Claude 3.7 Sonnet";
|
|
26
|
+
}];
|
|
27
|
+
export declare function getDefaultModel(provider?: ProviderKind): ModelSlug;
|
|
28
|
+
export declare function normalizeModelSlug(model: string | null | undefined, provider?: ProviderKind): ModelSlug | null;
|
|
29
|
+
export declare function resolveModelSlug(model: string | null | undefined, provider?: ProviderKind): ModelSlug;
|
|
30
|
+
export declare function resolveModelSlugForProvider(provider: ProviderKind, model: string | null | undefined): ModelSlug;
|
|
31
|
+
export declare function getReasoningEffortOptions(provider?: ProviderKind): ReadonlyArray<CodexReasoningEffort>;
|
|
32
|
+
export declare function getDefaultReasoningEffort(provider: "codex"): CodexReasoningEffort;
|
|
33
|
+
export declare function getDefaultReasoningEffort(provider: ProviderKind): CodexReasoningEffort | null;
|
|
34
|
+
export { CODEX_REASONING_EFFORT_OPTIONS };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/cli-surface-plugin/src/provider-model.ts
|
|
3
|
+
import {
|
|
4
|
+
CODEX_REASONING_EFFORT_OPTIONS,
|
|
5
|
+
DEFAULT_MODEL_BY_PROVIDER,
|
|
6
|
+
MODEL_OPTIONS_BY_PROVIDER,
|
|
7
|
+
MODEL_SLUG_ALIASES_BY_PROVIDER
|
|
8
|
+
} from "@rig/contracts";
|
|
9
|
+
var MODEL_SLUG_SET_BY_PROVIDER = {
|
|
10
|
+
codex: new Set(MODEL_OPTIONS_BY_PROVIDER.codex.map((option) => option.slug)),
|
|
11
|
+
claude: new Set(MODEL_OPTIONS_BY_PROVIDER.claude.map((option) => option.slug))
|
|
12
|
+
};
|
|
13
|
+
function getModelOptions(provider = "codex") {
|
|
14
|
+
return MODEL_OPTIONS_BY_PROVIDER[provider];
|
|
15
|
+
}
|
|
16
|
+
function getDefaultModel(provider = "codex") {
|
|
17
|
+
return DEFAULT_MODEL_BY_PROVIDER[provider];
|
|
18
|
+
}
|
|
19
|
+
function normalizeModelSlug(model, provider = "codex") {
|
|
20
|
+
if (typeof model !== "string") {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const trimmed = model.trim();
|
|
24
|
+
if (!trimmed) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
const aliases = MODEL_SLUG_ALIASES_BY_PROVIDER[provider];
|
|
28
|
+
const aliased = aliases[trimmed];
|
|
29
|
+
return typeof aliased === "string" ? aliased : trimmed;
|
|
30
|
+
}
|
|
31
|
+
function resolveModelSlug(model, provider = "codex") {
|
|
32
|
+
const normalized = normalizeModelSlug(model, provider);
|
|
33
|
+
if (!normalized) {
|
|
34
|
+
return getDefaultModel(provider);
|
|
35
|
+
}
|
|
36
|
+
return MODEL_SLUG_SET_BY_PROVIDER[provider].has(normalized) ? normalized : getDefaultModel(provider);
|
|
37
|
+
}
|
|
38
|
+
function resolveModelSlugForProvider(provider, model) {
|
|
39
|
+
return resolveModelSlug(model, provider);
|
|
40
|
+
}
|
|
41
|
+
function getReasoningEffortOptions(provider = "codex") {
|
|
42
|
+
return provider === "codex" ? CODEX_REASONING_EFFORT_OPTIONS : [];
|
|
43
|
+
}
|
|
44
|
+
function getDefaultReasoningEffort(provider = "codex") {
|
|
45
|
+
return provider === "codex" ? "high" : null;
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
resolveModelSlugForProvider,
|
|
49
|
+
resolveModelSlug,
|
|
50
|
+
normalizeModelSlug,
|
|
51
|
+
getReasoningEffortOptions,
|
|
52
|
+
getModelOptions,
|
|
53
|
+
getDefaultReasoningEffort,
|
|
54
|
+
getDefaultModel,
|
|
55
|
+
CODEX_REASONING_EFFORT_OPTIONS
|
|
56
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h-rig/cli-surface-plugin",
|
|
3
|
-
"version": "0.0.6-alpha.
|
|
3
|
+
"version": "0.0.6-alpha.156",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Standard executable Rig CLI surface plugin facade.",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -22,12 +22,16 @@
|
|
|
22
22
|
"bun": ">=1.3.11"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@rig/
|
|
26
|
-
"@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.
|
|
27
|
-
"@rig/core": "npm:@h-rig/core@0.0.6-alpha.
|
|
28
|
-
"@rig/
|
|
29
|
-
"@rig/
|
|
30
|
-
"@rig/
|
|
25
|
+
"@rig/bundle-default-lifecycle": "npm:@h-rig/bundle-default-lifecycle@0.0.6-alpha.156",
|
|
26
|
+
"@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.156",
|
|
27
|
+
"@rig/core": "npm:@h-rig/core@0.0.6-alpha.156",
|
|
28
|
+
"@rig/dependency-graph-plugin": "npm:@h-rig/dependency-graph-plugin@0.0.6-alpha.156",
|
|
29
|
+
"@rig/github-provider-plugin": "npm:@h-rig/github-provider-plugin@0.0.6-alpha.156",
|
|
30
|
+
"@rig/init-plugin": "npm:@h-rig/init-plugin@0.0.6-alpha.156",
|
|
31
|
+
"@rig/kernel": "npm:@h-rig/kernel@0.0.6-alpha.156",
|
|
32
|
+
"@rig/run-worker": "npm:@h-rig/run-worker@0.0.6-alpha.156",
|
|
33
|
+
"@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.156",
|
|
34
|
+
"@rig/shared": "npm:@h-rig/shared@0.0.6-alpha.156",
|
|
31
35
|
"effect": "4.0.0-beta.90",
|
|
32
36
|
"picocolors": "^1.1.1"
|
|
33
37
|
}
|