@h-rig/cli 0.0.6-alpha.78 → 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/bin/build-rig-binaries.d.ts +2 -0
- package/dist/bin/rig.d.ts +2 -0
- package/dist/bin/rig.js +37 -13
- package/dist/src/app/board.d.ts +23 -0
- package/dist/src/app/board.js +11 -8
- package/dist/src/app/drone-ui.d.ts +37 -0
- package/dist/src/app/theme.d.ts +47 -0
- package/dist/src/commands/_async-ui.d.ts +13 -0
- package/dist/src/commands/_authority-runs.d.ts +22 -0
- package/dist/src/commands/_cli-format.d.ts +49 -0
- package/dist/src/commands/_connection-state.d.ts +44 -0
- package/dist/src/commands/_doctor-checks.d.ts +52 -0
- package/dist/src/commands/_help-catalog.d.ts +51 -0
- package/dist/src/commands/_help-catalog.js +1 -0
- package/dist/src/commands/_json-output.d.ts +11 -0
- package/dist/src/commands/_operator-surface.d.ts +34 -0
- package/dist/src/commands/_operator-view.d.ts +30 -0
- package/dist/src/commands/_parsers.d.ts +15 -0
- package/dist/src/commands/_paths.d.ts +11 -0
- package/dist/src/commands/_pi-frontend.d.ts +27 -0
- package/dist/src/commands/_pi-install.d.ts +42 -0
- package/dist/src/commands/_pi-install.js +1 -1
- package/dist/src/commands/_policy.d.ts +8 -0
- package/dist/src/commands/_preflight.d.ts +22 -0
- package/dist/src/commands/_probes.d.ts +1 -0
- package/dist/src/commands/_run-driver-helpers.d.ts +99 -0
- package/dist/src/commands/_run-replay.d.ts +24 -0
- package/dist/src/commands/_server-client.d.ts +186 -0
- package/dist/src/commands/_snapshot-upload.d.ts +39 -0
- package/dist/src/commands/_spinner.d.ts +25 -0
- package/dist/src/commands/_task-picker.d.ts +9 -0
- package/dist/src/commands/agent.d.ts +3 -0
- package/dist/src/commands/browser.d.ts +65 -0
- package/dist/src/commands/connect.d.ts +7 -0
- package/dist/src/commands/dist.d.ts +28 -0
- package/dist/src/commands/doctor.d.ts +3 -0
- package/dist/src/commands/github.d.ts +3 -0
- package/dist/src/commands/inbox.d.ts +30 -0
- package/dist/src/commands/init.d.ts +74 -0
- package/dist/src/commands/init.js +1 -1
- package/dist/src/commands/inspect.d.ts +3 -0
- package/dist/src/commands/inspector.d.ts +3 -0
- package/dist/src/commands/pi.d.ts +3 -0
- package/dist/src/commands/plugin.d.ts +16 -0
- package/dist/src/commands/profile-and-review.d.ts +4 -0
- package/dist/src/commands/queue.d.ts +3 -0
- package/dist/src/commands/remote.d.ts +3 -0
- package/dist/src/commands/repo-git-harness.d.ts +5 -0
- package/dist/src/commands/run.d.ts +3 -0
- package/dist/src/commands/server.d.ts +7 -0
- package/dist/src/commands/setup.d.ts +16 -0
- package/dist/src/commands/stats.d.ts +12 -0
- package/dist/src/commands/stats.js +1 -0
- package/dist/src/commands/task-report-bug.d.ts +19 -0
- package/dist/src/commands/task-run-driver.d.ts +132 -0
- package/dist/src/commands/task-run-driver.js +23 -2
- package/dist/src/commands/task.d.ts +14 -0
- package/dist/src/commands/task.js +1 -0
- package/dist/src/commands/test.d.ts +3 -0
- package/dist/src/commands/workspace.d.ts +3 -0
- package/dist/src/commands.d.ts +29 -0
- package/dist/src/commands.js +37 -13
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.js +37 -13
- package/dist/src/launcher.d.ts +61 -0
- package/dist/src/report-bug.d.ts +44 -0
- package/dist/src/runner.d.ts +47 -0
- package/dist/src/withMutedConsole.d.ts +2 -0
- package/package.json +10 -8
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type RunnerContext } from "../runner";
|
|
2
|
+
import type { CommandOutcome } from "@rig/runtime/control-plane/runtime/types";
|
|
3
|
+
export type DistDoctorDetails = {
|
|
4
|
+
bun: {
|
|
5
|
+
available: boolean;
|
|
6
|
+
path: string | null;
|
|
7
|
+
version: string;
|
|
8
|
+
};
|
|
9
|
+
rig: {
|
|
10
|
+
onPath: boolean;
|
|
11
|
+
path: string | null;
|
|
12
|
+
runnable: boolean;
|
|
13
|
+
};
|
|
14
|
+
userBinDir: string;
|
|
15
|
+
userBinInPath: boolean;
|
|
16
|
+
latestDistBinary: string | null;
|
|
17
|
+
};
|
|
18
|
+
export type BuildTarget = {
|
|
19
|
+
source: string;
|
|
20
|
+
dest: string;
|
|
21
|
+
cwd: string;
|
|
22
|
+
};
|
|
23
|
+
export declare function collectRigValidatorBuildTargets(input: {
|
|
24
|
+
contextProjectRoot: string;
|
|
25
|
+
hostProjectRoot: string;
|
|
26
|
+
imageDir: string;
|
|
27
|
+
}): BuildTarget[];
|
|
28
|
+
export declare function executeDist(context: RunnerContext, args: string[]): Promise<CommandOutcome>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type RunnerContext } from "../runner";
|
|
2
|
+
import type { CommandOutcome } from "@rig/runtime/control-plane/runtime/types";
|
|
3
|
+
export type InboxKind = "approvals" | "inputs";
|
|
4
|
+
export type InboxRecord = {
|
|
5
|
+
runId?: string;
|
|
6
|
+
taskId?: string | null;
|
|
7
|
+
requestId?: string | null;
|
|
8
|
+
status?: string | null;
|
|
9
|
+
record?: Record<string, unknown>;
|
|
10
|
+
};
|
|
11
|
+
/** Exported for the board's inbox view — same records `rig inbox` renders. */
|
|
12
|
+
export declare function listInboxRecords(context: Pick<RunnerContext, "projectRoot">, kind: InboxKind, filters: {
|
|
13
|
+
run?: string;
|
|
14
|
+
task?: string;
|
|
15
|
+
pendingOnly?: boolean;
|
|
16
|
+
}): Promise<InboxRecord[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Pending-gate counts for proactive surfacing. Returns null when the server
|
|
19
|
+
* is unreachable — footer callers must never break the primary command.
|
|
20
|
+
*/
|
|
21
|
+
export declare function readPendingInboxCounts(context: Pick<RunnerContext, "projectRoot">): Promise<{
|
|
22
|
+
approvals: number;
|
|
23
|
+
inputs: number;
|
|
24
|
+
} | null>;
|
|
25
|
+
/**
|
|
26
|
+
* One-line warning under task/run command output when human gates are
|
|
27
|
+
* waiting. Silent when there is nothing pending or the server is down.
|
|
28
|
+
*/
|
|
29
|
+
export declare function printPendingInboxFooter(context: RunnerContext): Promise<void>;
|
|
30
|
+
export declare function executeInbox(context: RunnerContext, args: string[]): Promise<CommandOutcome>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { type RunnerContext } from "../runner";
|
|
2
|
+
import { buildRigInitConfigSource, type RigInitConfigInput } from "@rig/core";
|
|
3
|
+
import type { CommandOutcome } from "@rig/runtime/control-plane/runtime/types";
|
|
4
|
+
export { buildRigInitConfigSource };
|
|
5
|
+
export type { RigInitConfigInput };
|
|
6
|
+
type InitAuthMethod = "gh" | "token" | "device" | "skip";
|
|
7
|
+
type RemoteCheckoutStrategy = {
|
|
8
|
+
kind: "managed-clone";
|
|
9
|
+
} | {
|
|
10
|
+
kind: "current-ref";
|
|
11
|
+
ref?: string;
|
|
12
|
+
} | {
|
|
13
|
+
kind: "uploaded-snapshot";
|
|
14
|
+
} | {
|
|
15
|
+
kind: "existing-path";
|
|
16
|
+
path: string;
|
|
17
|
+
};
|
|
18
|
+
type InitControlPlaneOptions = {
|
|
19
|
+
demo?: boolean;
|
|
20
|
+
server?: "local" | "remote";
|
|
21
|
+
remoteUrl?: string;
|
|
22
|
+
connectionAlias?: string;
|
|
23
|
+
repoSlug?: string;
|
|
24
|
+
githubToken?: string;
|
|
25
|
+
githubAuthMethod?: InitAuthMethod;
|
|
26
|
+
githubProject?: "off" | string;
|
|
27
|
+
githubProjectStatusField?: string;
|
|
28
|
+
githubProjectStatuses?: Record<string, string>;
|
|
29
|
+
remoteCheckout?: RemoteCheckoutStrategy;
|
|
30
|
+
yes?: boolean;
|
|
31
|
+
repair?: boolean;
|
|
32
|
+
privateStateOnly?: boolean;
|
|
33
|
+
};
|
|
34
|
+
type InitPromptAdapter = {
|
|
35
|
+
intro?: (message: string) => void;
|
|
36
|
+
outro?: (message: string) => void;
|
|
37
|
+
cancel?: (message: string) => void;
|
|
38
|
+
isCancel: (value: unknown) => boolean;
|
|
39
|
+
text: (options: {
|
|
40
|
+
message: string;
|
|
41
|
+
placeholder?: string;
|
|
42
|
+
initialValue?: string;
|
|
43
|
+
defaultValue?: string;
|
|
44
|
+
}) => Promise<unknown>;
|
|
45
|
+
select: (options: {
|
|
46
|
+
message: string;
|
|
47
|
+
options: Array<{
|
|
48
|
+
value: string;
|
|
49
|
+
label: string;
|
|
50
|
+
hint?: string;
|
|
51
|
+
}>;
|
|
52
|
+
initialValue?: string;
|
|
53
|
+
}) => Promise<unknown>;
|
|
54
|
+
confirm?: (options: {
|
|
55
|
+
message: string;
|
|
56
|
+
initialValue?: boolean;
|
|
57
|
+
}) => Promise<unknown>;
|
|
58
|
+
};
|
|
59
|
+
export declare const DEMO_TASKS_RELATIVE_DIR = ".rig/demo-tasks";
|
|
60
|
+
/**
|
|
61
|
+
* The three sample tasks `rig init --demo` seeds. Shapes match what the
|
|
62
|
+
* standard plugin's files task source reads: one JSON object per file with
|
|
63
|
+
* id/title/body/status/labels (see packages/standard-plugin/src/files-source.ts).
|
|
64
|
+
*/
|
|
65
|
+
export declare const DEMO_TASKS: ReadonlyArray<Record<string, unknown>>;
|
|
66
|
+
/**
|
|
67
|
+
* `rig init --demo` — zero-GitHub, offline demo project: files task source
|
|
68
|
+
* pointing at .rig/demo-tasks/ with three seeded sample tasks, so an
|
|
69
|
+
* operator can see the full run lifecycle in minutes. Non-interactive and
|
|
70
|
+
* idempotent: an existing rig.config is left untouched unless --repair.
|
|
71
|
+
*/
|
|
72
|
+
export declare function runDemoInit(context: RunnerContext, options: InitControlPlaneOptions): CommandOutcome;
|
|
73
|
+
export declare function runInteractiveControlPlaneInit(context: RunnerContext, prompts: InitPromptAdapter): Promise<CommandOutcome>;
|
|
74
|
+
export declare function executeInit(context: RunnerContext, args: string[]): Promise<CommandOutcome>;
|
|
@@ -835,7 +835,7 @@ async function ensurePiBinaryAvailable(input) {
|
|
|
835
835
|
}
|
|
836
836
|
return { ok: true, detail: (current.stdout || current.stderr).trim() || undefined };
|
|
837
837
|
}
|
|
838
|
-
const installCommand = process.env.RIG_PI_INSTALL_COMMAND?.trim() || "bunx @earendil-works/pi@latest install";
|
|
838
|
+
const installCommand = process.env.RIG_PI_INSTALL_COMMAND?.trim() || "bunx @earendil-works/pi-coding-agent@latest install";
|
|
839
839
|
const parts = splitInstallCommand(installCommand);
|
|
840
840
|
if (parts.length === 0) {
|
|
841
841
|
return { ok: false, error: (current.stderr || current.stdout).trim() || "pi --version failed" };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type RunnerContext } from "../runner";
|
|
2
|
+
import type { CommandOutcome } from "@rig/runtime/control-plane/runtime/types";
|
|
3
|
+
export declare function executePlugin(context: RunnerContext, args: string[]): Promise<CommandOutcome>;
|
|
4
|
+
/**
|
|
5
|
+
* Resolve a plugin CLI command by exact id ("my-plugin:deploy") or by the
|
|
6
|
+
* unambiguous local part after the namespace colon ("deploy").
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolvePluginCliCommand(commands: readonly {
|
|
9
|
+
id: string;
|
|
10
|
+
command: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
}[], requested: string): {
|
|
13
|
+
id: string;
|
|
14
|
+
command: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
} | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type RunnerContext } from "../runner";
|
|
2
|
+
import type { CommandOutcome } from "@rig/runtime/control-plane/runtime/types";
|
|
3
|
+
export declare function executeProfile(context: RunnerContext, args: string[]): Promise<CommandOutcome>;
|
|
4
|
+
export declare function executeReview(context: RunnerContext, args: string[]): Promise<CommandOutcome>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type RunnerContext } from "../runner";
|
|
2
|
+
import type { CommandOutcome } from "@rig/runtime/control-plane/runtime/types";
|
|
3
|
+
export declare function executeRepo(context: RunnerContext, args: string[]): Promise<CommandOutcome>;
|
|
4
|
+
export declare function executeGit(context: RunnerContext, args: string[]): Promise<CommandOutcome>;
|
|
5
|
+
export declare function executeHarness(context: RunnerContext, args: string[]): Promise<CommandOutcome>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type RunnerContext } from "../runner";
|
|
2
|
+
import type { CommandOutcome } from "@rig/runtime/control-plane/runtime/types";
|
|
3
|
+
import { type SubmitTaskRunInput } from "./_server-client";
|
|
4
|
+
export type RigOwnedTaskRunFn = (context: RunnerContext, input: SubmitTaskRunInput) => Promise<unknown>;
|
|
5
|
+
export declare function executeServer(context: RunnerContext, args: string[], options: {
|
|
6
|
+
executeRigOwnedTaskRun: RigOwnedTaskRunFn;
|
|
7
|
+
}): Promise<CommandOutcome>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type RunnerContext } from "../runner";
|
|
2
|
+
import { type RigPluginWithRuntime } from "@rig/core";
|
|
3
|
+
import type { TaskSourceConfig } from "@rig/contracts";
|
|
4
|
+
import type { CommandOutcome } from "@rig/runtime/control-plane/runtime/types";
|
|
5
|
+
export declare function executeSetup(context: RunnerContext, args: string[]): Promise<CommandOutcome>;
|
|
6
|
+
type SetupCheck = {
|
|
7
|
+
ok: boolean;
|
|
8
|
+
label: string;
|
|
9
|
+
hint?: string;
|
|
10
|
+
};
|
|
11
|
+
type SetupRigConfig = {
|
|
12
|
+
plugins?: readonly RigPluginWithRuntime[];
|
|
13
|
+
taskSource?: TaskSourceConfig;
|
|
14
|
+
};
|
|
15
|
+
export declare function buildTaskSourceKindSetupCheck(config: SetupRigConfig): SetupCheck | null;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type RunnerContext } from "../runner";
|
|
2
|
+
import type { CommandOutcome } from "@rig/runtime/control-plane/runtime/types";
|
|
3
|
+
import { computeRigStats } from "@rig/runtime/control-plane/native/run-stats";
|
|
4
|
+
import type { RigStatsData } from "@rig/contracts";
|
|
5
|
+
/**
|
|
6
|
+
* Parse the --since window: `7d`/`30d` style relative day windows or an
|
|
7
|
+
* absolute ISO date/datetime. Returns null when no window is requested.
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseSinceOption(value: string | undefined, now?: Date): Date | null;
|
|
10
|
+
export { computeRigStats };
|
|
11
|
+
export declare function formatStatsReport(stats: RigStatsData): string;
|
|
12
|
+
export declare function executeStats(context: RunnerContext, args: string[]): Promise<CommandOutcome>;
|
|
@@ -680,6 +680,7 @@ var PRIMARY_GROUPS = [
|
|
|
680
680
|
{ command: "next [filters]", description: "Render the next matching task as a selected-task card.", primary: true },
|
|
681
681
|
{ command: "show <id>|--task <id> [--raw]", description: "Show a human task summary; --raw prints the full payload.", primary: true },
|
|
682
682
|
{ command: "run [#<issue>|<task-id>|--next|--task <id>]", description: "Submit a task run; interactive follows with bundled Pi.", primary: true },
|
|
683
|
+
{ command: "ready", description: "List task IDs that are runnable now." },
|
|
683
684
|
{ command: "validate|verify [--task <id>]", description: "Run configured task checks/review gates." },
|
|
684
685
|
{ command: "details --task <id>", description: "Show full task info from the configured source." },
|
|
685
686
|
{ command: "reopen [--task <id> | --all] [--reason <text>]", description: "Reopen closed task(s) in the configured source." },
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type RunnerContext } from "../runner";
|
|
2
|
+
import type { CommandOutcome } from "@rig/runtime/control-plane/runtime/types";
|
|
3
|
+
type BugPromptStyleOptions = {
|
|
4
|
+
color?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare function executeTaskReportBug(context: RunnerContext, args: string[]): Promise<CommandOutcome>;
|
|
7
|
+
export declare function promptBugText(message: string, defaultValue: string | undefined, options?: {
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
}): Promise<string>;
|
|
11
|
+
export declare function validateRequiredBugPromptValue(value: string | undefined, label: string): string | undefined;
|
|
12
|
+
type BugPromptExampleSection = "incident" | "reproduction" | "evidence" | "routing" | "browser";
|
|
13
|
+
export declare function bugPromptExampleText(section: BugPromptExampleSection, options?: BugPromptStyleOptions): string;
|
|
14
|
+
export declare function promptBugConfirm(message: string, initialValue: boolean): Promise<boolean>;
|
|
15
|
+
export declare function formatDroppedAssetDefault(value: string): string;
|
|
16
|
+
export declare function splitDroppedAssetList(value: string | undefined, options?: {
|
|
17
|
+
splitWhitespace?: boolean;
|
|
18
|
+
}): string[];
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { type RunnerContext } from "../runner";
|
|
2
|
+
import { updateConfiguredTaskSourceTask } from "@rig/runtime/control-plane/tasks/source-lifecycle";
|
|
3
|
+
import { runPrAutomation, type GitCommandRunner, type GitHubCommandRunner, type PrAutomationResult, type RigAutomationConfig } from "@rig/runtime/control-plane/native/pr-automation";
|
|
4
|
+
import { type SourceTaskContract } from "./_run-driver-helpers";
|
|
5
|
+
export type TaskRunReviewState = {
|
|
6
|
+
approved?: boolean;
|
|
7
|
+
provider?: string;
|
|
8
|
+
mode?: string;
|
|
9
|
+
verdict?: string;
|
|
10
|
+
local_reasons?: string[];
|
|
11
|
+
ai_reasons?: string[];
|
|
12
|
+
ai_warnings?: string[];
|
|
13
|
+
};
|
|
14
|
+
declare const PI_CANONICAL_RUN_STAGES: readonly ["Connect", "GitHub/task sync", "Prepare workspace", "Launch Pi", "Plan", "Implement", "Validate", "Commit", "Open PR", "Review/CI", "Merge", "Complete"];
|
|
15
|
+
export declare function canonicalPiRunStages(): string[];
|
|
16
|
+
export declare function buildPiRigBridgeEnv(input: {
|
|
17
|
+
readonly projectRoot: string;
|
|
18
|
+
readonly runId: string;
|
|
19
|
+
readonly taskId: string;
|
|
20
|
+
readonly serverUrl?: string | null;
|
|
21
|
+
readonly authToken?: string | null;
|
|
22
|
+
readonly githubToken?: string | null;
|
|
23
|
+
}): Record<string, string>;
|
|
24
|
+
export declare function applyDirtyBaselineSnapshot(input: {
|
|
25
|
+
readonly sourceRoot: string;
|
|
26
|
+
readonly targetRoot: string;
|
|
27
|
+
}): {
|
|
28
|
+
applied: boolean;
|
|
29
|
+
copiedUntracked: number;
|
|
30
|
+
detail: string;
|
|
31
|
+
};
|
|
32
|
+
export declare function buildTaskRunReviewEnv(config?: TaskRunAutomationConfig | null): Record<string, string>;
|
|
33
|
+
export declare function buildDirtyBaselineHandshakeEnv(input: {
|
|
34
|
+
readonly projectRoot: string;
|
|
35
|
+
readonly runId: string;
|
|
36
|
+
readonly baselineMode?: "head" | "dirty-snapshot";
|
|
37
|
+
}): Record<string, string>;
|
|
38
|
+
type TaskRunAutomationConfig = RigAutomationConfig & {
|
|
39
|
+
readonly github?: {
|
|
40
|
+
readonly issueUpdates?: "lifecycle" | "minimal" | "off";
|
|
41
|
+
};
|
|
42
|
+
readonly planning?: {
|
|
43
|
+
readonly mode?: "auto" | "always" | "off";
|
|
44
|
+
readonly requireForLabels?: readonly string[];
|
|
45
|
+
readonly skipForLabels?: readonly string[];
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export declare function resolveTaskRunAutomationLimits(config?: TaskRunAutomationConfig | null, env?: Record<string, string | undefined>): {
|
|
49
|
+
maxValidationAttempts: number;
|
|
50
|
+
maxPrFixIterations: number;
|
|
51
|
+
};
|
|
52
|
+
export type PlanningClassification = {
|
|
53
|
+
readonly planningRequired: boolean;
|
|
54
|
+
readonly size: "small" | "medium" | "large";
|
|
55
|
+
readonly risk: "low" | "medium" | "high";
|
|
56
|
+
readonly reason: string;
|
|
57
|
+
readonly policy: "always" | "off" | "auto";
|
|
58
|
+
};
|
|
59
|
+
export declare function classifyPlanningNeed(input: {
|
|
60
|
+
readonly config?: TaskRunAutomationConfig | null;
|
|
61
|
+
readonly sourceTask?: SourceTaskContract | null;
|
|
62
|
+
}): PlanningClassification;
|
|
63
|
+
export declare function buildPiValidationRetrySteeringPrompt(input: {
|
|
64
|
+
taskId: string;
|
|
65
|
+
attempt: number;
|
|
66
|
+
maxAttempts: number;
|
|
67
|
+
failureDetail: string;
|
|
68
|
+
validationOutput?: string | null;
|
|
69
|
+
}): string;
|
|
70
|
+
export declare function classifyValidationRetryOutcome(input: {
|
|
71
|
+
attempt: number;
|
|
72
|
+
maxAttempts: number;
|
|
73
|
+
failureDetail: string;
|
|
74
|
+
}): {
|
|
75
|
+
stage: "Validate failed";
|
|
76
|
+
status: "retry" | "needs_attention";
|
|
77
|
+
failureDetail: string;
|
|
78
|
+
};
|
|
79
|
+
export type TaskRunStageName = typeof PI_CANONICAL_RUN_STAGES[number] | "Needs attention" | "Failed";
|
|
80
|
+
export declare function taskRunStageLogId(runId: string, stage: TaskRunStageName): string;
|
|
81
|
+
export type TaskRunPostValidationLifecycleResult = {
|
|
82
|
+
readonly status: "completed" | "skipped" | "needs_attention";
|
|
83
|
+
readonly pr?: PrAutomationResult;
|
|
84
|
+
};
|
|
85
|
+
export declare function runTaskRunPostValidationLifecycle(input: {
|
|
86
|
+
readonly projectRoot: string;
|
|
87
|
+
readonly runId: string;
|
|
88
|
+
readonly taskId?: string;
|
|
89
|
+
readonly runtimeTaskId: string;
|
|
90
|
+
readonly runtimeWorkspace?: string | null;
|
|
91
|
+
readonly branch?: string | null;
|
|
92
|
+
readonly config?: TaskRunAutomationConfig | null;
|
|
93
|
+
readonly sourceTask: SourceTaskContract | null;
|
|
94
|
+
readonly uploadedSnapshot?: boolean;
|
|
95
|
+
readonly appendStage?: (stage: TaskRunStageName, detail?: string | null, status?: string, tone?: "info" | "tool" | "error") => void;
|
|
96
|
+
readonly ghCommand?: GitHubCommandRunner;
|
|
97
|
+
readonly gitCommand?: GitCommandRunner;
|
|
98
|
+
readonly prAutomation?: typeof runPrAutomation;
|
|
99
|
+
readonly steerPi?: (message: string) => Promise<void>;
|
|
100
|
+
readonly updateTaskSource?: typeof updateConfiguredTaskSourceTask;
|
|
101
|
+
}): Promise<TaskRunPostValidationLifecycleResult>;
|
|
102
|
+
export declare function classifyCompletionVerificationLine(line: string): {
|
|
103
|
+
isCompletionLine: boolean;
|
|
104
|
+
isVerifierReview: boolean;
|
|
105
|
+
};
|
|
106
|
+
export declare function createRunLogIdFactory(runId: string): () => string;
|
|
107
|
+
export declare function summarizeTaskRunProcessFailure(input: {
|
|
108
|
+
exitCode: number | null;
|
|
109
|
+
signal: string | null;
|
|
110
|
+
stderrLines?: readonly string[];
|
|
111
|
+
}): string;
|
|
112
|
+
export declare function readTaskRunAcceptedArtifactState(input: {
|
|
113
|
+
taskId: string | null;
|
|
114
|
+
workspaceDir: string | null;
|
|
115
|
+
artifactNotBeforeMs?: number;
|
|
116
|
+
}): {
|
|
117
|
+
accepted: boolean;
|
|
118
|
+
reason: string | null;
|
|
119
|
+
};
|
|
120
|
+
export declare function executeRigOwnedTaskRun(context: RunnerContext, input: {
|
|
121
|
+
runId: string;
|
|
122
|
+
taskId?: string;
|
|
123
|
+
title?: string;
|
|
124
|
+
runtimeAdapter: "claude-code" | "codex" | "pi";
|
|
125
|
+
model?: string;
|
|
126
|
+
runtimeMode: string;
|
|
127
|
+
interactionMode: string;
|
|
128
|
+
initialPrompt?: string;
|
|
129
|
+
baselineMode?: "head" | "dirty-snapshot";
|
|
130
|
+
prMode?: "auto" | "ask" | "off";
|
|
131
|
+
}): Promise<void>;
|
|
132
|
+
export {};
|
|
@@ -781,6 +781,19 @@ function looksLikeGitHubToken(value) {
|
|
|
781
781
|
return false;
|
|
782
782
|
return /^(gh[opusr]_|github_pat_)/.test(token);
|
|
783
783
|
}
|
|
784
|
+
function isSensitivePayloadKey(key) {
|
|
785
|
+
return /token|secret|password|authorization|credential/i.test(key);
|
|
786
|
+
}
|
|
787
|
+
function redactSensitivePayload(value) {
|
|
788
|
+
if (Array.isArray(value))
|
|
789
|
+
return value.map(redactSensitivePayload);
|
|
790
|
+
if (!value || typeof value !== "object")
|
|
791
|
+
return value;
|
|
792
|
+
return Object.fromEntries(Object.entries(value).map(([key, child]) => [
|
|
793
|
+
key,
|
|
794
|
+
isSensitivePayloadKey(key) && typeof child === "string" && child.trim() ? "[redacted]" : redactSensitivePayload(child)
|
|
795
|
+
]));
|
|
796
|
+
}
|
|
784
797
|
function githubBridgeEnv(token) {
|
|
785
798
|
const clean = token?.trim();
|
|
786
799
|
if (!clean)
|
|
@@ -1478,7 +1491,7 @@ function appendPiToolTimelineFromRecord(input) {
|
|
|
1478
1491
|
}
|
|
1479
1492
|
function isNonRenderablePiProtocolRecord(record) {
|
|
1480
1493
|
const type = typeof record.type === "string" ? record.type : "";
|
|
1481
|
-
return type === "agent_start" || type === "agent_end" || type === "message_start" || type === "message_end" || type === "turn_start" || type === "turn_end" || type === "tool_result" || type === "message_update" && (!record.assistantMessageEvent || typeof record.assistantMessageEvent !== "object" || Array.isArray(record.assistantMessageEvent) || record.assistantMessageEvent.type !== "text_delta");
|
|
1494
|
+
return type === "pi.event" || type === "status.update" || type === "activity.update" || type === "ready" || type === "agent_start" || type === "agent_end" || type === "message_start" || type === "message_end" || type === "turn_start" || type === "turn_end" || type === "tool_result" || type === "message_update" && (!record.assistantMessageEvent || typeof record.assistantMessageEvent !== "object" || Array.isArray(record.assistantMessageEvent) || record.assistantMessageEvent.type !== "text_delta");
|
|
1482
1495
|
}
|
|
1483
1496
|
function appendToolTimelineFromLog(input) {
|
|
1484
1497
|
const title = typeof input.log.title === "string" ? input.log.title : "";
|
|
@@ -2038,7 +2051,15 @@ ${planningClassification.planningRequired ? `Before implementing, write a concis
|
|
|
2038
2051
|
emitServerRunEvent({ type: "log", runId: input.runId, title });
|
|
2039
2052
|
return true;
|
|
2040
2053
|
}
|
|
2041
|
-
|
|
2054
|
+
appendRunTimeline(context.projectRoot, input.runId, {
|
|
2055
|
+
id: `timeline:${input.runId}:${Date.now()}:wrapper:${event.type}`,
|
|
2056
|
+
type: "wrapper-event",
|
|
2057
|
+
eventType: event.type,
|
|
2058
|
+
payload: redactSensitivePayload(payload),
|
|
2059
|
+
createdAt: new Date().toISOString()
|
|
2060
|
+
});
|
|
2061
|
+
emitServerRunEvent({ type: "timeline", runId: input.runId });
|
|
2062
|
+
return true;
|
|
2042
2063
|
};
|
|
2043
2064
|
const handleAgentStdoutLine = (line) => {
|
|
2044
2065
|
const trimmed = line.trim();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type RunnerContext } from "../runner";
|
|
2
|
+
import type { CommandOutcome } from "@rig/runtime/control-plane/runtime/types";
|
|
3
|
+
/** Project-config dispatch defaults — exported so the board's `n` (new run)
|
|
4
|
+
* flow dispatches with exactly the same defaults as `rig task run`. */
|
|
5
|
+
export declare function loadTaskRunProjectDefaults(projectRoot: string): Promise<{
|
|
6
|
+
runtimeAdapter?: "claude-code" | "codex" | "pi";
|
|
7
|
+
model?: string;
|
|
8
|
+
runtimeMode?: string;
|
|
9
|
+
prMode?: "auto" | "ask" | "off";
|
|
10
|
+
}>;
|
|
11
|
+
export type ReportBugFn = (context: RunnerContext, args: string[]) => Promise<CommandOutcome>;
|
|
12
|
+
export declare function executeTask(context: RunnerContext, args: string[], options: {
|
|
13
|
+
executeTaskReportBug: ReportBugFn;
|
|
14
|
+
}): Promise<CommandOutcome>;
|
|
@@ -1912,6 +1912,7 @@ var PRIMARY_GROUPS = [
|
|
|
1912
1912
|
{ command: "next [filters]", description: "Render the next matching task as a selected-task card.", primary: true },
|
|
1913
1913
|
{ command: "show <id>|--task <id> [--raw]", description: "Show a human task summary; --raw prints the full payload.", primary: true },
|
|
1914
1914
|
{ command: "run [#<issue>|<task-id>|--next|--task <id>]", description: "Submit a task run; interactive follows with bundled Pi.", primary: true },
|
|
1915
|
+
{ command: "ready", description: "List task IDs that are runnable now." },
|
|
1915
1916
|
{ command: "validate|verify [--task <id>]", description: "Run configured task checks/review gates." },
|
|
1916
1917
|
{ command: "details --task <id>", description: "Show full task info from the configured source." },
|
|
1917
1918
|
{ command: "reopen [--task <id> | --all] [--reason <text>]", description: "Reopen closed task(s) in the configured source." },
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type RunnerContext } from "./runner";
|
|
2
|
+
import type { CommandOutcome } from "@rig/runtime/control-plane/runtime/types";
|
|
3
|
+
import { buildBrowserDemoAgentCommands, buildBrowserDemoRuntime, browserDemoCommandCompletions, browserDemoCommandMatches, browserHelpText, findBrowserDemoPageTarget, formatBrowserDemoCdpResult, formatBrowserDemoCheckOutput, formatBrowserDemoCommandOutput, normalizeBrowserDemoCommand } from "./commands/browser";
|
|
4
|
+
import { buildRunPrompt } from "./commands/_run-driver-helpers";
|
|
5
|
+
import { bugPromptExampleText, formatDroppedAssetDefault, splitDroppedAssetList, validateRequiredBugPromptValue } from "./commands/task-report-bug";
|
|
6
|
+
export declare function printGroupHelp(group: string): void;
|
|
7
|
+
/** Returns true if args[0] requests group help (--help, -h, or "help"). */
|
|
8
|
+
export declare function isHelpArg(arg: string | undefined): boolean;
|
|
9
|
+
export declare function helpText(): string;
|
|
10
|
+
export declare function execute(context: RunnerContext, args: string[]): Promise<CommandOutcome>;
|
|
11
|
+
export { buildRigInitConfigSource } from "./commands/init";
|
|
12
|
+
export type { RigInitConfigInput } from "./commands/init";
|
|
13
|
+
export declare const __testOnly: {
|
|
14
|
+
buildRunPrompt: typeof buildRunPrompt;
|
|
15
|
+
buildBrowserDemoAgentCommands: typeof buildBrowserDemoAgentCommands;
|
|
16
|
+
buildBrowserDemoRuntime: typeof buildBrowserDemoRuntime;
|
|
17
|
+
browserDemoCommandCompletions: typeof browserDemoCommandCompletions;
|
|
18
|
+
browserDemoCommandMatches: typeof browserDemoCommandMatches;
|
|
19
|
+
browserHelpText: typeof browserHelpText;
|
|
20
|
+
bugPromptExampleText: typeof bugPromptExampleText;
|
|
21
|
+
findBrowserDemoPageTarget: typeof findBrowserDemoPageTarget;
|
|
22
|
+
formatBrowserDemoCdpResult: typeof formatBrowserDemoCdpResult;
|
|
23
|
+
formatBrowserDemoCheckOutput: typeof formatBrowserDemoCheckOutput;
|
|
24
|
+
formatBrowserDemoCommandOutput: typeof formatBrowserDemoCommandOutput;
|
|
25
|
+
formatDroppedAssetDefault: typeof formatDroppedAssetDefault;
|
|
26
|
+
normalizeBrowserDemoCommand: typeof normalizeBrowserDemoCommand;
|
|
27
|
+
splitDroppedAssetList: typeof splitDroppedAssetList;
|
|
28
|
+
validateRequiredBugPromptValue: typeof validateRequiredBugPromptValue;
|
|
29
|
+
};
|