@h-rig/standard-plugin 0.0.6-alpha.143 → 0.0.6-alpha.144
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/blocker-classifier.d.ts +1 -0
- package/dist/src/blocker-classifier.js +18 -0
- package/dist/src/bundle.js +35 -179
- package/dist/src/cli-surface.d.ts +2 -1
- package/dist/src/cli-surface.js +43 -9
- package/dist/src/default-lifecycle.d.ts +2 -0
- package/dist/src/default-lifecycle.js +12 -0
- package/dist/src/dependency-graph.d.ts +1 -0
- package/dist/src/dependency-graph.js +22 -0
- package/dist/src/github-issues-source.js +23 -12
- package/dist/src/index.d.ts +7 -1
- package/dist/src/index.js +165 -169
- package/dist/src/planning.d.ts +1 -0
- package/dist/src/planning.js +14 -0
- package/dist/src/plugin.d.ts +2 -1
- package/dist/src/plugin.js +38 -169
- package/dist/src/product-entrypoint.d.ts +3 -11
- package/dist/src/product-entrypoint.js +1 -96
- package/dist/src/product-plugin.d.ts +3 -0
- package/dist/src/product-plugin.js +18 -0
- package/dist/src/supervisor.d.ts +1 -0
- package/dist/src/supervisor.js +12 -0
- package/dist/src/task-cli.d.ts +1 -0
- package/dist/src/task-cli.js +14 -0
- package/package.json +42 -12
package/dist/src/index.js
CHANGED
|
@@ -37,109 +37,6 @@ var init_metadata = __esm(() => {
|
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
// packages/standard-plugin/src/product-entrypoint.ts
|
|
41
|
-
var exports_product_entrypoint = {};
|
|
42
|
-
__export(exports_product_entrypoint, {
|
|
43
|
-
runRigOmpProductCommand: () => runRigOmpProductCommand
|
|
44
|
-
});
|
|
45
|
-
import { resolve as resolve3 } from "path";
|
|
46
|
-
import { runCli } from "@oh-my-pi/pi-coding-agent/cli";
|
|
47
|
-
import { parseArgs } from "@oh-my-pi/pi-coding-agent/cli/args";
|
|
48
|
-
import { resolveCliArgv } from "@oh-my-pi/pi-coding-agent/cli-commands";
|
|
49
|
-
import { prepareAcpTerminalAuthArgs } from "@oh-my-pi/pi-coding-agent/modes/acp/terminal-auth";
|
|
50
|
-
import { runRootCommand } from "@oh-my-pi/pi-coding-agent/main";
|
|
51
|
-
import { createAgentSession } from "@oh-my-pi/pi-coding-agent/sdk";
|
|
52
|
-
import { applyIdentityEnv, identityFilterFromEnv, reconcileRuns } from "@rig/client";
|
|
53
|
-
import rigExtension from "@rig/rig-extension";
|
|
54
|
-
import { resolveRigOmpConfigOverlayPath } from "@rig/runtime/control-plane/remote-config";
|
|
55
|
-
function withRigDefaultConfig(projectRoot, argv) {
|
|
56
|
-
return ["--config", resolveRigOmpConfigOverlayPath(projectRoot), ...argv];
|
|
57
|
-
}
|
|
58
|
-
function createRigAgentSession(options = {}) {
|
|
59
|
-
return createAgentSession({
|
|
60
|
-
...options,
|
|
61
|
-
extensions: [(api) => rigExtension(api), ...options.extensions ?? []]
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
function productArgv(input) {
|
|
65
|
-
if (input.command === "launch" && input.args.length === 0)
|
|
66
|
-
return [];
|
|
67
|
-
if (input.command === "launch" && input.args[0]?.startsWith("-"))
|
|
68
|
-
return [...input.args];
|
|
69
|
-
return [input.command, ...input.args];
|
|
70
|
-
}
|
|
71
|
-
async function runRigOmpProductCommand(input) {
|
|
72
|
-
const projectRoot = resolve3(input.projectRoot);
|
|
73
|
-
const previousProjectRoot = process.env.RIG_PROJECT_ROOT;
|
|
74
|
-
const previousCwd = process.cwd();
|
|
75
|
-
const restorePublicIdentityEnv = applyIdentityEnv(projectRoot);
|
|
76
|
-
process.env.RIG_PROJECT_ROOT = projectRoot;
|
|
77
|
-
process.chdir(projectRoot);
|
|
78
|
-
try {
|
|
79
|
-
const argv = productArgv(input);
|
|
80
|
-
if (argv[0]?.startsWith("__omp_worker_") || argv[0] === "--smoke-test") {
|
|
81
|
-
await runCli(argv);
|
|
82
|
-
return { ok: true, group: "product", command: input.command };
|
|
83
|
-
}
|
|
84
|
-
if (process.stdin.isTTY) {
|
|
85
|
-
const reconcile = await reconcileRuns({
|
|
86
|
-
workspaceRoot: projectRoot,
|
|
87
|
-
identityFilter: identityFilterFromEnv()
|
|
88
|
-
}).catch(() => ({ flipped: [], resumable: [] }));
|
|
89
|
-
globalThis.__RIG_RESUMABLE__ = reconcile.resumable;
|
|
90
|
-
}
|
|
91
|
-
const resolved = resolveCliArgv(argv);
|
|
92
|
-
if ("error" in resolved) {
|
|
93
|
-
process.stderr.write(`error: ${resolved.error}
|
|
94
|
-
`);
|
|
95
|
-
process.exitCode = 1;
|
|
96
|
-
return { ok: true, group: "product", command: input.command };
|
|
97
|
-
}
|
|
98
|
-
const [ompCommand, ...ompCommandArgs] = resolved.argv;
|
|
99
|
-
if (ompCommand === "launch") {
|
|
100
|
-
const args = withRigDefaultConfig(projectRoot, ompCommandArgs);
|
|
101
|
-
await runRootCommand(parseArgs(args), args, { createAgentSession: createRigAgentSession });
|
|
102
|
-
} else if (ompCommand === "acp") {
|
|
103
|
-
const { args: preparedArgs, terminalAuth } = prepareAcpTerminalAuthArgs(ompCommandArgs);
|
|
104
|
-
const args = withRigDefaultConfig(projectRoot, preparedArgs);
|
|
105
|
-
const parsed = parseArgs(args);
|
|
106
|
-
if (!terminalAuth)
|
|
107
|
-
parsed.mode = "acp";
|
|
108
|
-
await runRootCommand(parsed, args, { createAgentSession: createRigAgentSession });
|
|
109
|
-
} else if (ompCommand === "join") {
|
|
110
|
-
const link = ompCommandArgs[0]?.trim();
|
|
111
|
-
if (!link) {
|
|
112
|
-
process.stderr.write(`Usage: rig join <link>
|
|
113
|
-
`);
|
|
114
|
-
process.exitCode = 1;
|
|
115
|
-
return { ok: true, group: "product", command: input.command };
|
|
116
|
-
}
|
|
117
|
-
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
118
|
-
process.stderr.write(`rig join requires an interactive terminal
|
|
119
|
-
`);
|
|
120
|
-
process.exitCode = 1;
|
|
121
|
-
return { ok: true, group: "product", command: input.command };
|
|
122
|
-
}
|
|
123
|
-
const args = withRigDefaultConfig(projectRoot, []);
|
|
124
|
-
const parsed = parseArgs(args);
|
|
125
|
-
parsed.join = link;
|
|
126
|
-
await runRootCommand(parsed, args, { createAgentSession: createRigAgentSession });
|
|
127
|
-
} else {
|
|
128
|
-
await runCli(resolved.argv);
|
|
129
|
-
}
|
|
130
|
-
return { ok: true, group: "product", command: input.command };
|
|
131
|
-
} finally {
|
|
132
|
-
restorePublicIdentityEnv();
|
|
133
|
-
process.chdir(previousCwd);
|
|
134
|
-
if (previousProjectRoot === undefined) {
|
|
135
|
-
delete process.env.RIG_PROJECT_ROOT;
|
|
136
|
-
} else {
|
|
137
|
-
process.env.RIG_PROJECT_ROOT = previousProjectRoot;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
var init_product_entrypoint = () => {};
|
|
142
|
-
|
|
143
40
|
// packages/standard-plugin/src/drift/extract-refs.ts
|
|
144
41
|
function stripFenceLines(markdown) {
|
|
145
42
|
const lines = markdown.split(/\r?\n/);
|
|
@@ -272,7 +169,7 @@ __export(exports_detect, {
|
|
|
272
169
|
});
|
|
273
170
|
import { existsSync as existsSync3 } from "fs";
|
|
274
171
|
import { readdir, readFile, stat } from "fs/promises";
|
|
275
|
-
import { basename as basename2, extname, relative, resolve as
|
|
172
|
+
import { basename as basename2, extname, relative, resolve as resolve3 } from "path";
|
|
276
173
|
function globLikeMatch(path, pattern) {
|
|
277
174
|
if (pattern === path)
|
|
278
175
|
return true;
|
|
@@ -299,7 +196,7 @@ async function collectFiles(root, options) {
|
|
|
299
196
|
for (const entry of await readdir(dir, { withFileTypes: true })) {
|
|
300
197
|
if (entry.isDirectory() && DEFAULT_IGNORED_DIRS[entry.name])
|
|
301
198
|
continue;
|
|
302
|
-
const absolute =
|
|
199
|
+
const absolute = resolve3(dir, entry.name);
|
|
303
200
|
const rel = relative(root, absolute).replace(/\\/g, "/");
|
|
304
201
|
if (isIgnored(rel, options.ignore))
|
|
305
202
|
continue;
|
|
@@ -324,13 +221,13 @@ async function collectFiles(root, options) {
|
|
|
324
221
|
}
|
|
325
222
|
async function sourceReferenceCount(projectRoot, reference, docPath) {
|
|
326
223
|
if (reference.kind === "path")
|
|
327
|
-
return existsSync3(
|
|
224
|
+
return existsSync3(resolve3(projectRoot, reference.value)) ? 1 : 0;
|
|
328
225
|
let count = 0;
|
|
329
226
|
const sourceFiles = await collectFiles(projectRoot, { docs: false });
|
|
330
227
|
for (const sourceFile of sourceFiles) {
|
|
331
228
|
if (sourceFile === docPath)
|
|
332
229
|
continue;
|
|
333
|
-
const text = await readFile(
|
|
230
|
+
const text = await readFile(resolve3(projectRoot, sourceFile), "utf8").catch(() => "");
|
|
334
231
|
if (text.includes(reference.value))
|
|
335
232
|
count += 1;
|
|
336
233
|
}
|
|
@@ -357,7 +254,7 @@ function staleAnchorFinding(docPath, reference) {
|
|
|
357
254
|
};
|
|
358
255
|
}
|
|
359
256
|
async function detectDeletedReferences(projectRoot, docPath, git = makeDriftGit(projectRoot)) {
|
|
360
|
-
const markdown = await readFile(
|
|
257
|
+
const markdown = await readFile(resolve3(projectRoot, docPath), "utf8");
|
|
361
258
|
const docCommit = await git.lastCommitTouching(docPath);
|
|
362
259
|
const findings = [];
|
|
363
260
|
for (const reference of extractDriftReferences(markdown)) {
|
|
@@ -370,13 +267,13 @@ async function detectDeletedReferences(projectRoot, docPath, git = makeDriftGit(
|
|
|
370
267
|
return findings;
|
|
371
268
|
}
|
|
372
269
|
async function detectStaleAnchors(projectRoot, docPath, git = makeDriftGit(projectRoot)) {
|
|
373
|
-
const markdown = await readFile(
|
|
270
|
+
const markdown = await readFile(resolve3(projectRoot, docPath), "utf8");
|
|
374
271
|
const docCommit = await git.lastCommitTouching(docPath);
|
|
375
272
|
const findings = [];
|
|
376
273
|
for (const reference of extractDriftReferences(markdown).filter((ref) => ref.kind === "path")) {
|
|
377
|
-
if (!existsSync3(
|
|
274
|
+
if (!existsSync3(resolve3(projectRoot, reference.value)))
|
|
378
275
|
continue;
|
|
379
|
-
const sourceStat = await stat(
|
|
276
|
+
const sourceStat = await stat(resolve3(projectRoot, reference.value)).catch(() => null);
|
|
380
277
|
if (!sourceStat?.isFile())
|
|
381
278
|
continue;
|
|
382
279
|
const sourceCommit = await git.lastCommitTouching(reference.value);
|
|
@@ -646,8 +543,60 @@ var init_plugin = __esm(() => {
|
|
|
646
543
|
DOCS_DRIFT_RUNTIME_CLI_COMMAND = createDocsDriftRuntimeCliCommand();
|
|
647
544
|
});
|
|
648
545
|
|
|
546
|
+
// packages/standard-plugin/src/bundle.ts
|
|
547
|
+
import { createBlockerClassifierPlugin } from "@rig/blocker-classifier-plugin/plugin";
|
|
548
|
+
import { createDefaultLifecyclePlugin } from "@rig/bundle-default-lifecycle/plugin";
|
|
549
|
+
import { createDependencyGraphPlugin } from "@rig/dependency-graph-plugin/plugin";
|
|
550
|
+
import { createPlanningPlugin } from "@rig/planning-plugin/plugin";
|
|
551
|
+
import { createSupervisorPlugin } from "@rig/supervisor-plugin/plugin";
|
|
552
|
+
|
|
553
|
+
// packages/standard-plugin/src/run-worker-panels.ts
|
|
554
|
+
var RIG_RUN_STOP_PANEL_ACTION = "rig-run:stop";
|
|
555
|
+
var RIG_CAPABILITY_PANEL_SLOT = "capability";
|
|
556
|
+
var RIG_SUPERVISOR_PANEL_ID = "supervisor";
|
|
557
|
+
var RUN_SUPERVISOR_PANEL_REGISTRATION = {
|
|
558
|
+
id: RIG_SUPERVISOR_PANEL_ID,
|
|
559
|
+
slot: RIG_CAPABILITY_PANEL_SLOT,
|
|
560
|
+
title: "Supervisor",
|
|
561
|
+
capabilityId: "run.supervisor",
|
|
562
|
+
description: "Live run status, closeout progress, and operator stop control."
|
|
563
|
+
};
|
|
564
|
+
function buildSupervisorPanelPayload(context) {
|
|
565
|
+
const status = context.folded.status ?? "unknown";
|
|
566
|
+
const taskId = context.folded.record.taskId ?? context.taskIdAtStart;
|
|
567
|
+
const operatorActive = status === "running" || status === "validating" || status === "closing-out" || status === "needs-attention";
|
|
568
|
+
return {
|
|
569
|
+
status,
|
|
570
|
+
currentTask: taskId ? { id: taskId, title: context.runDisplayTitle } : null,
|
|
571
|
+
processed: context.folded.closeoutPhases.length,
|
|
572
|
+
succeeded: context.folded.closeoutPhases.filter((phase) => phase.outcome === "completed").length,
|
|
573
|
+
failed: context.folded.closeoutPhases.filter((phase) => phase.outcome === "failed").length,
|
|
574
|
+
skipped: 0,
|
|
575
|
+
plannedOrder: taskId ? [{ id: taskId, title: context.runDisplayTitle, status }] : [],
|
|
576
|
+
idleReason: operatorActive ? null : status,
|
|
577
|
+
stopActionId: operatorActive ? RIG_RUN_STOP_PANEL_ACTION : null,
|
|
578
|
+
closures: []
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
var RUN_SUPERVISOR_PANEL_PRODUCER = {
|
|
582
|
+
...RUN_SUPERVISOR_PANEL_REGISTRATION,
|
|
583
|
+
produce(context) {
|
|
584
|
+
return buildSupervisorPanelPayload(context);
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
var RUN_WORKER_PANEL_PLUGIN = {
|
|
588
|
+
name: "@rig/standard-plugin:run-worker-panels",
|
|
589
|
+
version: "0.0.0-alpha.1",
|
|
590
|
+
contributes: {
|
|
591
|
+
panels: [RUN_SUPERVISOR_PANEL_REGISTRATION]
|
|
592
|
+
},
|
|
593
|
+
__runtime: {
|
|
594
|
+
panels: [RUN_SUPERVISOR_PANEL_PRODUCER]
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
|
|
649
598
|
// packages/standard-plugin/src/plugin.ts
|
|
650
|
-
import { resolve as
|
|
599
|
+
import { resolve as resolve4 } from "path";
|
|
651
600
|
import { definePlugin } from "@rig/core/config";
|
|
652
601
|
|
|
653
602
|
// packages/standard-plugin/src/github-issues-source.ts
|
|
@@ -662,7 +611,7 @@ function createEnvGitHubCredentialProvider() {
|
|
|
662
611
|
return {
|
|
663
612
|
async resolveGitHubToken(input) {
|
|
664
613
|
if (input.purpose === "selected-repo") {
|
|
665
|
-
return { token: cleanToken(process.env.RIG_GITHUB_SELECTED_TOKEN ??
|
|
614
|
+
return { token: cleanToken(process.env.RIG_GITHUB_SELECTED_TOKEN ?? null) ?? "", source: "signed-in-user" };
|
|
666
615
|
}
|
|
667
616
|
const token = cleanToken(process.env.RIG_GITHUB_TOKEN ?? process.env.GH_TOKEN ?? process.env.GITHUB_TOKEN ?? null);
|
|
668
617
|
if (!token) {
|
|
@@ -697,11 +646,11 @@ function createStateGitHubCredentialProvider(options = {}) {
|
|
|
697
646
|
const candidates = [];
|
|
698
647
|
addCandidate(candidates, options.stateFile ?? process.env.RIG_GITHUB_AUTH_STATE_FILE);
|
|
699
648
|
addStateDir(candidates, options.stateDir);
|
|
649
|
+
addStateDir(candidates, process.env.RIG_STATE_DIR);
|
|
700
650
|
addProjectStateDir(candidates, process.env.PROJECT_RIG_ROOT);
|
|
701
651
|
addProjectStateDir(candidates, process.env.RIG_PROJECT_ROOT);
|
|
702
652
|
addProjectStateDir(candidates, process.env.RIG_HOST_PROJECT_ROOT);
|
|
703
653
|
addProjectStateDir(candidates, process.cwd());
|
|
704
|
-
addStateDir(candidates, process.env.RIG_STATE_DIR);
|
|
705
654
|
return candidates;
|
|
706
655
|
};
|
|
707
656
|
const readToken = () => {
|
|
@@ -721,7 +670,7 @@ function createStateGitHubCredentialProvider(options = {}) {
|
|
|
721
670
|
async resolveGitHubToken(input) {
|
|
722
671
|
const token = readToken();
|
|
723
672
|
if (input.purpose === "selected-repo") {
|
|
724
|
-
return { token: token ?? cleanToken(process.env.RIG_GITHUB_SELECTED_TOKEN ??
|
|
673
|
+
return { token: token ?? cleanToken(process.env.RIG_GITHUB_SELECTED_TOKEN ?? null) ?? "", source: "signed-in-user" };
|
|
725
674
|
}
|
|
726
675
|
if (token) {
|
|
727
676
|
return { token, source: "signed-in-user" };
|
|
@@ -793,9 +742,12 @@ function parseMetadataList(body, keys) {
|
|
|
793
742
|
}
|
|
794
743
|
return [...new Set(values)];
|
|
795
744
|
}
|
|
745
|
+
function bodyWithoutRigMetadataBlock(body) {
|
|
746
|
+
return body.replace(/<!-- rig:metadata:start -->\s*[\s\S]*?\s*<!-- rig:metadata:end -->/g, "");
|
|
747
|
+
}
|
|
796
748
|
function parseBodyKeyRefs(body, keys) {
|
|
797
749
|
const keyPattern = metadataKeyPattern(keys);
|
|
798
|
-
const values = body.split(/\r?\n/).flatMap((line) => {
|
|
750
|
+
const values = bodyWithoutRigMetadataBlock(body).split(/\r?\n/).flatMap((line) => {
|
|
799
751
|
const match = line.match(keyPattern);
|
|
800
752
|
return match?.[1] ? parseIssueRefs(match[1]) : [];
|
|
801
753
|
});
|
|
@@ -900,21 +852,29 @@ function isRigStickyStatusComment(body) {
|
|
|
900
852
|
return body.includes(RIG_STATUS_COMMENT_MARKER);
|
|
901
853
|
}
|
|
902
854
|
function ghSpawnOptions(extraEnv, timeoutMs) {
|
|
855
|
+
const env = {
|
|
856
|
+
...process.env,
|
|
857
|
+
...process.env.GH_TOKEN !== undefined ? { GH_TOKEN: process.env.GH_TOKEN } : {},
|
|
858
|
+
...process.env.GITHUB_TOKEN !== undefined ? { GITHUB_TOKEN: process.env.GITHUB_TOKEN } : {},
|
|
859
|
+
...process.env.RIG_GITHUB_TOKEN !== undefined ? { RIG_GITHUB_TOKEN: process.env.RIG_GITHUB_TOKEN } : {}
|
|
860
|
+
};
|
|
861
|
+
for (const [key, value] of Object.entries(extraEnv ?? {})) {
|
|
862
|
+
if (value === undefined)
|
|
863
|
+
delete env[key];
|
|
864
|
+
else
|
|
865
|
+
env[key] = value;
|
|
866
|
+
}
|
|
903
867
|
return {
|
|
904
868
|
encoding: "utf-8",
|
|
905
869
|
timeout: timeoutMs,
|
|
906
|
-
env
|
|
907
|
-
...process.env,
|
|
908
|
-
...process.env.GH_TOKEN !== undefined ? { GH_TOKEN: process.env.GH_TOKEN } : {},
|
|
909
|
-
...process.env.GITHUB_TOKEN !== undefined ? { GITHUB_TOKEN: process.env.GITHUB_TOKEN } : {},
|
|
910
|
-
...process.env.RIG_GITHUB_TOKEN !== undefined ? { RIG_GITHUB_TOKEN: process.env.RIG_GITHUB_TOKEN } : {},
|
|
911
|
-
...extraEnv ?? {}
|
|
912
|
-
}
|
|
870
|
+
env
|
|
913
871
|
};
|
|
914
872
|
}
|
|
915
873
|
function credentialEnv(token) {
|
|
916
874
|
const clean = token?.trim() ?? "";
|
|
917
|
-
|
|
875
|
+
if (clean)
|
|
876
|
+
return { GH_TOKEN: clean, GITHUB_TOKEN: clean, RIG_GITHUB_TOKEN: clean };
|
|
877
|
+
return { GH_TOKEN: undefined, GITHUB_TOKEN: undefined, RIG_GITHUB_TOKEN: undefined };
|
|
918
878
|
}
|
|
919
879
|
async function resolveCredentialEnv(opts, purpose) {
|
|
920
880
|
if (!opts.credentialProvider)
|
|
@@ -1663,40 +1623,9 @@ function createFilesTaskSource(opts) {
|
|
|
1663
1623
|
// packages/standard-plugin/src/plugin.ts
|
|
1664
1624
|
init_metadata();
|
|
1665
1625
|
init_metadata();
|
|
1626
|
+
import { createStandardProductEntrypointPlugin, standardProductEntrypointPlugin } from "@rig/product-entrypoint-plugin/plugin";
|
|
1627
|
+
import { createStandardTaskCliPlugin, standardTaskCliPlugin } from "@rig/task-cli-plugin/plugin";
|
|
1666
1628
|
var DOCS_HEALTH_PANEL_ID = "docs-health";
|
|
1667
|
-
var STANDARD_PRODUCT_COMMANDS = [
|
|
1668
|
-
{ command: "launch", description: "Open the Rig Cockpit through the OMP collaboration substrate.", usage: "rig [launch] [args...]" },
|
|
1669
|
-
{ command: "join", description: "Join an encrypted Rig/OMP collaborative session.", usage: "rig join <link>" },
|
|
1670
|
-
{ command: "acp", description: "Start the Rig product in OMP ACP mode.", usage: "rig acp [args...]" },
|
|
1671
|
-
{ command: "models", description: "Delegate model management to the Rig product substrate.", usage: "rig models [args...]" },
|
|
1672
|
-
{ command: "mcp", description: "Delegate MCP management to the Rig product substrate.", usage: "rig mcp [args...]" },
|
|
1673
|
-
{ command: "update", description: "Delegate product update handling to the Rig product substrate.", usage: "rig update [args...]" }
|
|
1674
|
-
];
|
|
1675
|
-
function standardProductCliCommandId(command) {
|
|
1676
|
-
return `@rig/standard-plugin:product-entrypoint:${command}`;
|
|
1677
|
-
}
|
|
1678
|
-
function standardProductCliCommandMetadata(descriptor) {
|
|
1679
|
-
return {
|
|
1680
|
-
id: standardProductCliCommandId(descriptor.command),
|
|
1681
|
-
family: descriptor.command,
|
|
1682
|
-
description: descriptor.description,
|
|
1683
|
-
usage: descriptor.usage,
|
|
1684
|
-
projectRequired: false
|
|
1685
|
-
};
|
|
1686
|
-
}
|
|
1687
|
-
function createStandardProductCliCommand(descriptor) {
|
|
1688
|
-
return {
|
|
1689
|
-
...standardProductCliCommandMetadata(descriptor),
|
|
1690
|
-
run: async (context, args) => {
|
|
1691
|
-
const { runRigOmpProductCommand: runRigOmpProductCommand2 } = await Promise.resolve().then(() => (init_product_entrypoint(), exports_product_entrypoint));
|
|
1692
|
-
return runRigOmpProductCommand2({
|
|
1693
|
-
projectRoot: context.projectRoot,
|
|
1694
|
-
command: descriptor.command,
|
|
1695
|
-
args
|
|
1696
|
-
});
|
|
1697
|
-
}
|
|
1698
|
-
};
|
|
1699
|
-
}
|
|
1700
1629
|
function requireStringField(config, field, kind) {
|
|
1701
1630
|
const value = config[field];
|
|
1702
1631
|
if (!value) {
|
|
@@ -1840,17 +1769,6 @@ function createStandardDocsDriftPlugin(opts = {}) {
|
|
|
1840
1769
|
cliCommands: [createLazyDocsDriftRuntimeCliCommand(opts)]
|
|
1841
1770
|
});
|
|
1842
1771
|
}
|
|
1843
|
-
function createStandardProductEntrypointPlugin() {
|
|
1844
|
-
return definePlugin({
|
|
1845
|
-
name: "@rig/standard-plugin:product-entrypoint",
|
|
1846
|
-
version: "0.1.0",
|
|
1847
|
-
contributes: {
|
|
1848
|
-
cliCommands: STANDARD_PRODUCT_COMMANDS.map(standardProductCliCommandMetadata)
|
|
1849
|
-
}
|
|
1850
|
-
}, {
|
|
1851
|
-
cliCommands: STANDARD_PRODUCT_COMMANDS.map(createStandardProductCliCommand)
|
|
1852
|
-
});
|
|
1853
|
-
}
|
|
1854
1772
|
function createStandardTaskSourcesPlugin(opts = {}) {
|
|
1855
1773
|
return definePlugin({
|
|
1856
1774
|
name: "@rig/standard-plugin:task-sources",
|
|
@@ -1880,7 +1798,7 @@ function createStandardTaskSourcesPlugin(opts = {}) {
|
|
|
1880
1798
|
owner: requireStringField(config, "owner", "github-issues"),
|
|
1881
1799
|
repo: requireStringField(config, "repo", "github-issues")
|
|
1882
1800
|
};
|
|
1883
|
-
const credentialProviderOptions = context?.projectRoot ? { stateDir:
|
|
1801
|
+
const credentialProviderOptions = context?.projectRoot ? { stateDir: resolve4(context.projectRoot, ".rig", "state") } : {};
|
|
1884
1802
|
options.credentialProvider = opts.githubCredentialProvider ?? createStateGitHubCredentialProvider(credentialProviderOptions);
|
|
1885
1803
|
if (opts.githubWorkspaceId)
|
|
1886
1804
|
options.workspaceId = opts.githubWorkspaceId;
|
|
@@ -1926,14 +1844,92 @@ function createStandardTaskSourcesPlugin(opts = {}) {
|
|
|
1926
1844
|
]
|
|
1927
1845
|
});
|
|
1928
1846
|
}
|
|
1847
|
+
|
|
1848
|
+
// packages/standard-plugin/src/bundle.ts
|
|
1849
|
+
function standardPlugins(options = {}) {
|
|
1850
|
+
return [
|
|
1851
|
+
createDefaultLifecyclePlugin(),
|
|
1852
|
+
createDependencyGraphPlugin(),
|
|
1853
|
+
createBlockerClassifierPlugin(),
|
|
1854
|
+
createPlanningPlugin(),
|
|
1855
|
+
createSupervisorPlugin(),
|
|
1856
|
+
RUN_WORKER_PANEL_PLUGIN,
|
|
1857
|
+
createStandardTaskSourcesPlugin(options.taskSources),
|
|
1858
|
+
createStandardTaskCliPlugin(),
|
|
1859
|
+
createStandardDocsDriftPlugin(options.drift),
|
|
1860
|
+
createStandardProductEntrypointPlugin()
|
|
1861
|
+
];
|
|
1862
|
+
}
|
|
1863
|
+
// packages/standard-plugin/src/cli-surface.ts
|
|
1864
|
+
var STANDARD_CLI_SURFACE_PLUGIN_NAME = "@rig/standard-plugin:cli-surface";
|
|
1865
|
+
function standardCliCommand(family, options) {
|
|
1866
|
+
return {
|
|
1867
|
+
id: `${STANDARD_CLI_SURFACE_PLUGIN_NAME}:${family}`,
|
|
1868
|
+
family,
|
|
1869
|
+
description: options.description,
|
|
1870
|
+
...options.usage ? { usage: options.usage } : {},
|
|
1871
|
+
...options.aliases ? { aliases: [...options.aliases] } : {},
|
|
1872
|
+
projectRequired: options.projectRequired ?? false
|
|
1873
|
+
};
|
|
1874
|
+
}
|
|
1875
|
+
var STANDARD_CLI_SURFACE_COMMAND_METADATA = [
|
|
1876
|
+
standardCliCommand("init", { description: "Initialize Rig project configuration." }),
|
|
1877
|
+
standardCliCommand("setup", { description: "Install and inspect local Rig setup." }),
|
|
1878
|
+
standardCliCommand("check", { description: "Run Rig setup checks.", usage: "rig check" }),
|
|
1879
|
+
standardCliCommand("install", { description: "Install Rig distribution artifacts.", usage: "rig install [options]" }),
|
|
1880
|
+
standardCliCommand("github", { description: "Manage GitHub auth and integration state." }),
|
|
1881
|
+
standardCliCommand("doctor", { description: "Inspect Rig environment health." }),
|
|
1882
|
+
standardCliCommand("repo", { description: "Manage repository state.", projectRequired: true }),
|
|
1883
|
+
standardCliCommand("profile", { description: "Manage runtime profile settings." }),
|
|
1884
|
+
standardCliCommand("review", { description: "Run review helpers.", projectRequired: true }),
|
|
1885
|
+
standardCliCommand("git", { description: "Run Rig git automation.", projectRequired: true }),
|
|
1886
|
+
standardCliCommand("harness", { description: "Inspect native harness integration." }),
|
|
1887
|
+
standardCliCommand("pi", { description: "Inspect Pi/OMP runtime integration." }),
|
|
1888
|
+
standardCliCommand("plugin", { description: "Inspect and run plugin compatibility commands." }),
|
|
1889
|
+
standardCliCommand("queue", { description: "Inspect dispatch queue state.", projectRequired: true }),
|
|
1890
|
+
standardCliCommand("agent", { description: "Run agent lifecycle helpers.", projectRequired: true }),
|
|
1891
|
+
standardCliCommand("dist", { description: "Build and inspect Rig distributions." }),
|
|
1892
|
+
standardCliCommand("workspace", { description: "Inspect workspace topology." }),
|
|
1893
|
+
standardCliCommand("remote", { description: "Manage remote endpoints." }),
|
|
1894
|
+
standardCliCommand("test", { description: "Run Rig test helpers." }),
|
|
1895
|
+
standardCliCommand("inspect", { description: "Inspect live/project Rig state." }),
|
|
1896
|
+
standardCliCommand("run", { description: "Dispatch and inspect runs.", projectRequired: true }),
|
|
1897
|
+
standardCliCommand("task", { description: "List and inspect task-source tasks.", projectRequired: true }),
|
|
1898
|
+
standardCliCommand("inbox", { description: "Inspect and resolve run inbox items.", projectRequired: true }),
|
|
1899
|
+
standardCliCommand("stats", { description: "Inspect run statistics.", projectRequired: true }),
|
|
1900
|
+
standardCliCommand("server", { description: "Manage selected local/remote execution server.", projectRequired: true }),
|
|
1901
|
+
standardCliCommand("config", { description: "Inspect Rig configuration." }),
|
|
1902
|
+
standardCliCommand("triage", { description: "Run issue triage helpers.", projectRequired: true })
|
|
1903
|
+
];
|
|
1904
|
+
var standardCliSurfacePlugin = {
|
|
1905
|
+
name: STANDARD_CLI_SURFACE_PLUGIN_NAME,
|
|
1906
|
+
version: "0.0.0-alpha.1",
|
|
1907
|
+
contributes: {
|
|
1908
|
+
capabilities: [{ id: "surface.cli", title: "Rig CLI surface", description: "Registry-dispatched command-line surface." }],
|
|
1909
|
+
cliCommands: STANDARD_CLI_SURFACE_COMMAND_METADATA
|
|
1910
|
+
}
|
|
1911
|
+
};
|
|
1929
1912
|
export {
|
|
1913
|
+
standardTaskCliPlugin,
|
|
1914
|
+
standardProductEntrypointPlugin,
|
|
1915
|
+
standardPlugins,
|
|
1916
|
+
standardCliSurfacePlugin,
|
|
1930
1917
|
createStateGitHubCredentialProvider,
|
|
1931
1918
|
createStandardTaskSourcesPlugin,
|
|
1919
|
+
createStandardTaskCliPlugin,
|
|
1932
1920
|
createStandardProductEntrypointPlugin,
|
|
1933
1921
|
createStandardDocsDriftPlugin,
|
|
1934
1922
|
createGitHubIssuesTaskSource,
|
|
1935
1923
|
createFilesTaskSource,
|
|
1936
1924
|
createEnvGitHubCredentialProvider,
|
|
1925
|
+
STANDARD_CLI_SURFACE_PLUGIN_NAME,
|
|
1926
|
+
STANDARD_CLI_SURFACE_COMMAND_METADATA,
|
|
1927
|
+
RUN_WORKER_PANEL_PLUGIN,
|
|
1928
|
+
RUN_SUPERVISOR_PANEL_REGISTRATION,
|
|
1929
|
+
RUN_SUPERVISOR_PANEL_PRODUCER,
|
|
1930
|
+
RIG_SUPERVISOR_PANEL_ID,
|
|
1931
|
+
RIG_RUN_STOP_PANEL_ACTION,
|
|
1932
|
+
RIG_CAPABILITY_PANEL_SLOT,
|
|
1937
1933
|
DOCS_HEALTH_PANEL_ID,
|
|
1938
1934
|
DOCS_DRIFT_VALIDATOR_ID,
|
|
1939
1935
|
DOCS_DRIFT_VALIDATOR,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PLANNING_PLAN_PANEL_ID, PLANNING_PLUGIN_NAME, createPlanningPlugin, planningPlugin, } from "@rig/planning-plugin/plugin";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/standard-plugin/src/planning.ts
|
|
3
|
+
import {
|
|
4
|
+
PLANNING_PLAN_PANEL_ID,
|
|
5
|
+
PLANNING_PLUGIN_NAME,
|
|
6
|
+
createPlanningPlugin,
|
|
7
|
+
planningPlugin
|
|
8
|
+
} from "@rig/planning-plugin/plugin";
|
|
9
|
+
export {
|
|
10
|
+
planningPlugin,
|
|
11
|
+
createPlanningPlugin,
|
|
12
|
+
PLANNING_PLUGIN_NAME,
|
|
13
|
+
PLANNING_PLAN_PANEL_ID
|
|
14
|
+
};
|
package/dist/src/plugin.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export type { DriftJudgeInput, DriftJudgeMismatch, DriftJudgeProvider } from "./
|
|
|
10
10
|
export type { GitHubIssuesOptions } from "./github-issues-source";
|
|
11
11
|
export type { FilesTaskSourceOptions } from "./files-source";
|
|
12
12
|
export type { DocsDriftPluginOptions } from "./drift/metadata";
|
|
13
|
+
export { createStandardProductEntrypointPlugin, standardProductEntrypointPlugin } from "@rig/product-entrypoint-plugin/plugin";
|
|
14
|
+
export { createStandardTaskCliPlugin, standardTaskCliPlugin } from "@rig/task-cli-plugin/plugin";
|
|
13
15
|
export declare const DOCS_HEALTH_PANEL_ID = "docs-health";
|
|
14
16
|
export interface StandardTaskSourcesPluginOptions {
|
|
15
17
|
githubCredentialProvider?: GitHubCredentialProvider;
|
|
@@ -19,5 +21,4 @@ export interface StandardTaskSourcesPluginOptions {
|
|
|
19
21
|
onGitHubTaskChanged?: GitHubIssuesOptions["onTaskChanged"];
|
|
20
22
|
}
|
|
21
23
|
export declare function createStandardDocsDriftPlugin(opts?: DocsDriftPluginOptions): RigPluginWithRuntime;
|
|
22
|
-
export declare function createStandardProductEntrypointPlugin(): RigPluginWithRuntime;
|
|
23
24
|
export declare function createStandardTaskSourcesPlugin(opts?: StandardTaskSourcesPluginOptions): RigPluginWithRuntime;
|