@h-rig/omp-extension-plugin 0.0.6-alpha.186

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.
@@ -0,0 +1,3 @@
1
+ import type { CliCommand, FeatureCapability } from "@rig/core/config";
2
+ export declare const productCliCommands: readonly CliCommand[];
3
+ export declare const productEntrypointCapability: FeatureCapability;
@@ -0,0 +1,215 @@
1
+ // @bun
2
+ var __defProp = Object.defineProperty;
3
+ var __returnValue = (v) => v;
4
+ function __exportSetter(name, newValue) {
5
+ this[name] = __returnValue.bind(null, newValue);
6
+ }
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true,
12
+ configurable: true,
13
+ set: __exportSetter.bind(all, name)
14
+ });
15
+ };
16
+ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
17
+
18
+ // packages/omp-extension-plugin/src/product-entrypoint/product-entrypoint.ts
19
+ var exports_product_entrypoint = {};
20
+ __export(exports_product_entrypoint, {
21
+ runRigOmpProductCommand: () => runRigOmpProductCommand,
22
+ joinRigOmpProductSession: () => joinRigOmpProductSession
23
+ });
24
+ import { resolve } from "path";
25
+ import { runCli } from "@oh-my-pi/pi-coding-agent/cli";
26
+ import { parseArgs } from "@oh-my-pi/pi-coding-agent/cli/args";
27
+ import { resolveCliArgv } from "@oh-my-pi/pi-coding-agent/cli-commands";
28
+ import { prepareAcpTerminalAuthArgs } from "@oh-my-pi/pi-coding-agent/modes/acp/terminal-auth";
29
+ import { runRootCommand } from "@oh-my-pi/pi-coding-agent/main";
30
+ import { createAgentSession } from "@oh-my-pi/pi-coding-agent/sdk";
31
+ import { defineCapability } from "@rig/core/capability";
32
+ import { loadCapabilityForRoot } from "@rig/core/capability-loaders";
33
+ import { resolvePluginHost } from "@rig/core/project-plugins";
34
+ import { RUN_IDENTITY_ENV, RUN_READ_MODEL, TRANSPORT_CONFIG } from "@rig/contracts";
35
+ async function withRigDefaultConfig(projectRoot, argv) {
36
+ const transportConfig = await loadCapabilityForRoot(projectRoot, TransportConfigCap);
37
+ if (!transportConfig)
38
+ throw new Error("TRANSPORT_CONFIG capability unavailable: load @rig/transport-plugin before launching OMP.");
39
+ return ["--config", transportConfig.resolveRigOmpConfigOverlayPath({ projectRoot }), ...argv];
40
+ }
41
+ async function createRigAgentSession(projectRoot, options = {}) {
42
+ const { host } = await resolvePluginHost(projectRoot);
43
+ const sessionExtensions = host.listSessionExtensions();
44
+ return createAgentSession({
45
+ ...options,
46
+ extensions: [...sessionExtensions.map((entry) => (api) => entry.install(api, { panels: host.listPanels() })), ...options.extensions ?? []]
47
+ });
48
+ }
49
+ function productArgv(input) {
50
+ if (input.command === "launch" && input.args.length === 0)
51
+ return [];
52
+ if (input.command === "launch" && input.args[0]?.startsWith("-"))
53
+ return [...input.args];
54
+ return [input.command, ...input.args];
55
+ }
56
+ async function joinRigOmpProductSession(input) {
57
+ const projectRoot = resolve(input.projectRoot);
58
+ const link = input.link.trim();
59
+ const previousProjectRoot = process.env.RIG_PROJECT_ROOT;
60
+ const previousCwd = process.cwd();
61
+ const identityEnv = await loadCapabilityForRoot(projectRoot, RunIdentityEnvCap);
62
+ const restorePublicIdentityEnv = identityEnv?.applyIdentityEnv(projectRoot) ?? (() => {});
63
+ process.env.RIG_PROJECT_ROOT = projectRoot;
64
+ process.chdir(projectRoot);
65
+ try {
66
+ const args = await withRigDefaultConfig(projectRoot, []);
67
+ const parsed = parseArgs(args);
68
+ parsed.join = link;
69
+ await runRootCommand(parsed, args, { createAgentSession: (options) => createRigAgentSession(projectRoot, options) });
70
+ return { ok: true, group: "product", command: "join" };
71
+ } finally {
72
+ restorePublicIdentityEnv();
73
+ process.chdir(previousCwd);
74
+ if (previousProjectRoot === undefined) {
75
+ delete process.env.RIG_PROJECT_ROOT;
76
+ } else {
77
+ process.env.RIG_PROJECT_ROOT = previousProjectRoot;
78
+ }
79
+ }
80
+ }
81
+ async function runRigOmpProductCommand(input) {
82
+ const projectRoot = resolve(input.projectRoot);
83
+ const previousProjectRoot = process.env.RIG_PROJECT_ROOT;
84
+ const previousCwd = process.cwd();
85
+ const identityEnv = await loadCapabilityForRoot(projectRoot, RunIdentityEnvCap);
86
+ const restorePublicIdentityEnv = identityEnv?.applyIdentityEnv(projectRoot) ?? (() => {});
87
+ process.env.RIG_PROJECT_ROOT = projectRoot;
88
+ process.chdir(projectRoot);
89
+ try {
90
+ const argv = productArgv(input);
91
+ if (argv[0]?.startsWith("__omp_worker_") || argv[0] === "--smoke-test") {
92
+ await runCli(argv);
93
+ return { ok: true, group: "product", command: input.command };
94
+ }
95
+ if (process.stdin.isTTY) {
96
+ const readModel = await loadCapabilityForRoot(projectRoot, RunReadModelCap);
97
+ if (readModel) {
98
+ await readModel.reconcileActiveRuns({
99
+ workspaceRoot: projectRoot,
100
+ identityFilter: identityEnv?.identityFilterFromEnv() ?? {}
101
+ }).catch(() => ({ flipped: [], resumable: [] }));
102
+ }
103
+ }
104
+ const resolved = resolveCliArgv(argv);
105
+ if ("error" in resolved) {
106
+ process.stderr.write(`error: ${resolved.error}
107
+ `);
108
+ process.exitCode = 1;
109
+ return { ok: true, group: "product", command: input.command };
110
+ }
111
+ const [ompCommand, ...ompCommandArgs] = resolved.argv;
112
+ if (ompCommand === "launch") {
113
+ const args = await withRigDefaultConfig(projectRoot, ompCommandArgs);
114
+ await runRootCommand(parseArgs(args), args, { createAgentSession: (options) => createRigAgentSession(projectRoot, options) });
115
+ } else if (ompCommand === "acp") {
116
+ const { args: preparedArgs, terminalAuth } = prepareAcpTerminalAuthArgs(ompCommandArgs);
117
+ const args = await withRigDefaultConfig(projectRoot, preparedArgs);
118
+ const parsed = parseArgs(args);
119
+ if (!terminalAuth)
120
+ parsed.mode = "acp";
121
+ await runRootCommand(parsed, args, { createAgentSession: (options) => createRigAgentSession(projectRoot, options) });
122
+ } else if (ompCommand === "join") {
123
+ const link = ompCommandArgs[0]?.trim();
124
+ if (!link) {
125
+ process.stderr.write(`Usage: rig join <link>
126
+ `);
127
+ process.exitCode = 1;
128
+ return { ok: true, group: "product", command: input.command };
129
+ }
130
+ if (!process.stdin.isTTY || !process.stdout.isTTY) {
131
+ process.stderr.write(`rig join requires an interactive terminal
132
+ `);
133
+ process.exitCode = 1;
134
+ return { ok: true, group: "product", command: input.command };
135
+ }
136
+ await joinRigOmpProductSession({ projectRoot, link });
137
+ } else {
138
+ await runCli(resolved.argv);
139
+ }
140
+ return { ok: true, group: "product", command: input.command };
141
+ } finally {
142
+ restorePublicIdentityEnv();
143
+ process.chdir(previousCwd);
144
+ if (previousProjectRoot === undefined) {
145
+ delete process.env.RIG_PROJECT_ROOT;
146
+ } else {
147
+ process.env.RIG_PROJECT_ROOT = previousProjectRoot;
148
+ }
149
+ }
150
+ }
151
+ var RunIdentityEnvCap, TransportConfigCap, RunReadModelCap;
152
+ var init_product_entrypoint = __esm(() => {
153
+ RunIdentityEnvCap = defineCapability(RUN_IDENTITY_ENV);
154
+ TransportConfigCap = defineCapability(TRANSPORT_CONFIG);
155
+ RunReadModelCap = defineCapability(RUN_READ_MODEL);
156
+ });
157
+
158
+ // packages/omp-extension-plugin/src/product-entrypoint/contributions.ts
159
+ import { defineCapability as defineCapability2 } from "@rig/core/capability";
160
+ import { PRODUCT_ENTRYPOINT } from "@rig/contracts";
161
+
162
+ // packages/omp-extension-plugin/src/product-entrypoint/metadata.ts
163
+ var STANDARD_PRODUCT_COMMANDS = [
164
+ { command: "launch", description: "Open the Rig Cockpit through the OMP collaboration substrate.", usage: "rig [launch] [args...]" },
165
+ { command: "join", description: "Join an encrypted Rig/OMP collaborative session.", usage: "rig join <link>" },
166
+ { command: "acp", description: "Start the Rig product in OMP ACP mode.", usage: "rig acp [args...]" },
167
+ { command: "models", description: "Delegate model management to the Rig product substrate.", usage: "rig models [args...]" },
168
+ { command: "mcp", description: "Delegate MCP management to the Rig product substrate.", usage: "rig mcp [args...]" },
169
+ { command: "update", description: "Delegate product update handling to the Rig product substrate.", usage: "rig update [args...]" }
170
+ ];
171
+ function standardProductCliCommandId(command) {
172
+ return `@rig/omp-extension-plugin:${command}`;
173
+ }
174
+ function standardProductCliCommandMetadata(descriptor) {
175
+ return {
176
+ id: standardProductCliCommandId(descriptor.command),
177
+ family: descriptor.command,
178
+ description: descriptor.description,
179
+ usage: descriptor.usage,
180
+ projectRequired: false,
181
+ ...descriptor.command === "launch" ? { rootDefault: true } : {},
182
+ productRoot: true
183
+ };
184
+ }
185
+
186
+ // packages/omp-extension-plugin/src/product-entrypoint/contributions.ts
187
+ var ProductEntrypointCap = defineCapability2(PRODUCT_ENTRYPOINT);
188
+ async function importProductEntrypoint() {
189
+ return await Promise.resolve().then(() => (init_product_entrypoint(), exports_product_entrypoint));
190
+ }
191
+ function createStandardProductCliCommand(descriptor) {
192
+ return {
193
+ ...standardProductCliCommandMetadata(descriptor),
194
+ run: async (context, args) => {
195
+ const { runRigOmpProductCommand: runRigOmpProductCommand2 } = await importProductEntrypoint();
196
+ return runRigOmpProductCommand2({
197
+ projectRoot: context.projectRoot,
198
+ command: descriptor.command,
199
+ args
200
+ });
201
+ }
202
+ };
203
+ }
204
+ var productCliCommands = STANDARD_PRODUCT_COMMANDS.map(createStandardProductCliCommand);
205
+ var productEntrypointCapability = ProductEntrypointCap.provide(async () => {
206
+ const { joinRigOmpProductSession: joinRigOmpProductSession2 } = await importProductEntrypoint();
207
+ return { joinSession: joinRigOmpProductSession2 };
208
+ }, {
209
+ title: "Product entrypoint service",
210
+ description: "Join live product sessions via the cockpit-owned runtime entrypoint."
211
+ });
212
+ export {
213
+ productEntrypointCapability,
214
+ productCliCommands
215
+ };
@@ -0,0 +1,17 @@
1
+ export type RigProductCommandName = "launch" | "join" | "acp" | "models" | "mcp" | "update";
2
+ export type StandardProductCommandDescriptor = {
3
+ readonly command: RigProductCommandName;
4
+ readonly description: string;
5
+ readonly usage: string;
6
+ };
7
+ export declare const STANDARD_PRODUCT_COMMANDS: readonly StandardProductCommandDescriptor[];
8
+ export declare function standardProductCliCommandId(command: RigProductCommandName): string;
9
+ export declare function standardProductCliCommandMetadata(descriptor: StandardProductCommandDescriptor): {
10
+ productRoot: boolean;
11
+ rootDefault?: boolean | undefined;
12
+ id: string;
13
+ family: RigProductCommandName;
14
+ description: string;
15
+ usage: string;
16
+ projectRequired: boolean;
17
+ };
@@ -0,0 +1,29 @@
1
+ // @bun
2
+ // packages/omp-extension-plugin/src/product-entrypoint/metadata.ts
3
+ var STANDARD_PRODUCT_COMMANDS = [
4
+ { command: "launch", description: "Open the Rig Cockpit through the OMP collaboration substrate.", usage: "rig [launch] [args...]" },
5
+ { command: "join", description: "Join an encrypted Rig/OMP collaborative session.", usage: "rig join <link>" },
6
+ { command: "acp", description: "Start the Rig product in OMP ACP mode.", usage: "rig acp [args...]" },
7
+ { command: "models", description: "Delegate model management to the Rig product substrate.", usage: "rig models [args...]" },
8
+ { command: "mcp", description: "Delegate MCP management to the Rig product substrate.", usage: "rig mcp [args...]" },
9
+ { command: "update", description: "Delegate product update handling to the Rig product substrate.", usage: "rig update [args...]" }
10
+ ];
11
+ function standardProductCliCommandId(command) {
12
+ return `@rig/omp-extension-plugin:${command}`;
13
+ }
14
+ function standardProductCliCommandMetadata(descriptor) {
15
+ return {
16
+ id: standardProductCliCommandId(descriptor.command),
17
+ family: descriptor.command,
18
+ description: descriptor.description,
19
+ usage: descriptor.usage,
20
+ projectRequired: false,
21
+ ...descriptor.command === "launch" ? { rootDefault: true } : {},
22
+ productRoot: true
23
+ };
24
+ }
25
+ export {
26
+ standardProductCliCommandMetadata,
27
+ standardProductCliCommandId,
28
+ STANDARD_PRODUCT_COMMANDS
29
+ };
@@ -0,0 +1,4 @@
1
+ export declare const PRODUCT_ENTRYPOINT_PLUGIN_NAME = "@rig/omp-extension-plugin";
2
+ export declare const productEntrypointPlugin: import("@rig/core").RigPlugin;
3
+ export declare function createProductEntrypointPlugin(): import("@rig/core").RigPlugin;
4
+ export default productEntrypointPlugin;
@@ -0,0 +1,300 @@
1
+ // @bun
2
+ var __defProp = Object.defineProperty;
3
+ var __returnValue = (v) => v;
4
+ function __exportSetter(name, newValue) {
5
+ this[name] = __returnValue.bind(null, newValue);
6
+ }
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true,
12
+ configurable: true,
13
+ set: __exportSetter.bind(all, name)
14
+ });
15
+ };
16
+ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
17
+
18
+ // packages/omp-extension-plugin/src/product-entrypoint/product-entrypoint.ts
19
+ var exports_product_entrypoint = {};
20
+ __export(exports_product_entrypoint, {
21
+ runRigOmpProductCommand: () => runRigOmpProductCommand,
22
+ joinRigOmpProductSession: () => joinRigOmpProductSession
23
+ });
24
+ import { resolve } from "path";
25
+ import { runCli } from "@oh-my-pi/pi-coding-agent/cli";
26
+ import { parseArgs } from "@oh-my-pi/pi-coding-agent/cli/args";
27
+ import { resolveCliArgv } from "@oh-my-pi/pi-coding-agent/cli-commands";
28
+ import { prepareAcpTerminalAuthArgs } from "@oh-my-pi/pi-coding-agent/modes/acp/terminal-auth";
29
+ import { runRootCommand } from "@oh-my-pi/pi-coding-agent/main";
30
+ import { createAgentSession } from "@oh-my-pi/pi-coding-agent/sdk";
31
+ import { defineCapability } from "@rig/core/capability";
32
+ import { loadCapabilityForRoot } from "@rig/core/capability-loaders";
33
+ import { resolvePluginHost } from "@rig/core/project-plugins";
34
+ import { RUN_IDENTITY_ENV, RUN_READ_MODEL, TRANSPORT_CONFIG } from "@rig/contracts";
35
+ async function withRigDefaultConfig(projectRoot, argv) {
36
+ const transportConfig = await loadCapabilityForRoot(projectRoot, TransportConfigCap);
37
+ if (!transportConfig)
38
+ throw new Error("TRANSPORT_CONFIG capability unavailable: load @rig/transport-plugin before launching OMP.");
39
+ return ["--config", transportConfig.resolveRigOmpConfigOverlayPath({ projectRoot }), ...argv];
40
+ }
41
+ async function createRigAgentSession(projectRoot, options = {}) {
42
+ const { host } = await resolvePluginHost(projectRoot);
43
+ const sessionExtensions = host.listSessionExtensions();
44
+ return createAgentSession({
45
+ ...options,
46
+ extensions: [...sessionExtensions.map((entry) => (api) => entry.install(api, { panels: host.listPanels() })), ...options.extensions ?? []]
47
+ });
48
+ }
49
+ function productArgv(input) {
50
+ if (input.command === "launch" && input.args.length === 0)
51
+ return [];
52
+ if (input.command === "launch" && input.args[0]?.startsWith("-"))
53
+ return [...input.args];
54
+ return [input.command, ...input.args];
55
+ }
56
+ async function joinRigOmpProductSession(input) {
57
+ const projectRoot = resolve(input.projectRoot);
58
+ const link = input.link.trim();
59
+ const previousProjectRoot = process.env.RIG_PROJECT_ROOT;
60
+ const previousCwd = process.cwd();
61
+ const identityEnv = await loadCapabilityForRoot(projectRoot, RunIdentityEnvCap);
62
+ const restorePublicIdentityEnv = identityEnv?.applyIdentityEnv(projectRoot) ?? (() => {});
63
+ process.env.RIG_PROJECT_ROOT = projectRoot;
64
+ process.chdir(projectRoot);
65
+ try {
66
+ const args = await withRigDefaultConfig(projectRoot, []);
67
+ const parsed = parseArgs(args);
68
+ parsed.join = link;
69
+ await runRootCommand(parsed, args, { createAgentSession: (options) => createRigAgentSession(projectRoot, options) });
70
+ return { ok: true, group: "product", command: "join" };
71
+ } finally {
72
+ restorePublicIdentityEnv();
73
+ process.chdir(previousCwd);
74
+ if (previousProjectRoot === undefined) {
75
+ delete process.env.RIG_PROJECT_ROOT;
76
+ } else {
77
+ process.env.RIG_PROJECT_ROOT = previousProjectRoot;
78
+ }
79
+ }
80
+ }
81
+ async function runRigOmpProductCommand(input) {
82
+ const projectRoot = resolve(input.projectRoot);
83
+ const previousProjectRoot = process.env.RIG_PROJECT_ROOT;
84
+ const previousCwd = process.cwd();
85
+ const identityEnv = await loadCapabilityForRoot(projectRoot, RunIdentityEnvCap);
86
+ const restorePublicIdentityEnv = identityEnv?.applyIdentityEnv(projectRoot) ?? (() => {});
87
+ process.env.RIG_PROJECT_ROOT = projectRoot;
88
+ process.chdir(projectRoot);
89
+ try {
90
+ const argv = productArgv(input);
91
+ if (argv[0]?.startsWith("__omp_worker_") || argv[0] === "--smoke-test") {
92
+ await runCli(argv);
93
+ return { ok: true, group: "product", command: input.command };
94
+ }
95
+ if (process.stdin.isTTY) {
96
+ const readModel = await loadCapabilityForRoot(projectRoot, RunReadModelCap);
97
+ if (readModel) {
98
+ await readModel.reconcileActiveRuns({
99
+ workspaceRoot: projectRoot,
100
+ identityFilter: identityEnv?.identityFilterFromEnv() ?? {}
101
+ }).catch(() => ({ flipped: [], resumable: [] }));
102
+ }
103
+ }
104
+ const resolved = resolveCliArgv(argv);
105
+ if ("error" in resolved) {
106
+ process.stderr.write(`error: ${resolved.error}
107
+ `);
108
+ process.exitCode = 1;
109
+ return { ok: true, group: "product", command: input.command };
110
+ }
111
+ const [ompCommand, ...ompCommandArgs] = resolved.argv;
112
+ if (ompCommand === "launch") {
113
+ const args = await withRigDefaultConfig(projectRoot, ompCommandArgs);
114
+ await runRootCommand(parseArgs(args), args, { createAgentSession: (options) => createRigAgentSession(projectRoot, options) });
115
+ } else if (ompCommand === "acp") {
116
+ const { args: preparedArgs, terminalAuth } = prepareAcpTerminalAuthArgs(ompCommandArgs);
117
+ const args = await withRigDefaultConfig(projectRoot, preparedArgs);
118
+ const parsed = parseArgs(args);
119
+ if (!terminalAuth)
120
+ parsed.mode = "acp";
121
+ await runRootCommand(parsed, args, { createAgentSession: (options) => createRigAgentSession(projectRoot, options) });
122
+ } else if (ompCommand === "join") {
123
+ const link = ompCommandArgs[0]?.trim();
124
+ if (!link) {
125
+ process.stderr.write(`Usage: rig join <link>
126
+ `);
127
+ process.exitCode = 1;
128
+ return { ok: true, group: "product", command: input.command };
129
+ }
130
+ if (!process.stdin.isTTY || !process.stdout.isTTY) {
131
+ process.stderr.write(`rig join requires an interactive terminal
132
+ `);
133
+ process.exitCode = 1;
134
+ return { ok: true, group: "product", command: input.command };
135
+ }
136
+ await joinRigOmpProductSession({ projectRoot, link });
137
+ } else {
138
+ await runCli(resolved.argv);
139
+ }
140
+ return { ok: true, group: "product", command: input.command };
141
+ } finally {
142
+ restorePublicIdentityEnv();
143
+ process.chdir(previousCwd);
144
+ if (previousProjectRoot === undefined) {
145
+ delete process.env.RIG_PROJECT_ROOT;
146
+ } else {
147
+ process.env.RIG_PROJECT_ROOT = previousProjectRoot;
148
+ }
149
+ }
150
+ }
151
+ var RunIdentityEnvCap, TransportConfigCap, RunReadModelCap;
152
+ var init_product_entrypoint = __esm(() => {
153
+ RunIdentityEnvCap = defineCapability(RUN_IDENTITY_ENV);
154
+ TransportConfigCap = defineCapability(TRANSPORT_CONFIG);
155
+ RunReadModelCap = defineCapability(RUN_READ_MODEL);
156
+ });
157
+
158
+ // packages/omp-extension-plugin/src/product-entrypoint/plugin.ts
159
+ import { definePlugin } from "@rig/core/config";
160
+ import { defineCapability as defineCapability3 } from "@rig/core/capability";
161
+ import { HELP_CATALOG } from "@rig/contracts";
162
+
163
+ // packages/omp-extension-plugin/src/product-entrypoint/contributions.ts
164
+ import { defineCapability as defineCapability2 } from "@rig/core/capability";
165
+ import { PRODUCT_ENTRYPOINT } from "@rig/contracts";
166
+
167
+ // packages/omp-extension-plugin/src/product-entrypoint/metadata.ts
168
+ var STANDARD_PRODUCT_COMMANDS = [
169
+ { command: "launch", description: "Open the Rig Cockpit through the OMP collaboration substrate.", usage: "rig [launch] [args...]" },
170
+ { command: "join", description: "Join an encrypted Rig/OMP collaborative session.", usage: "rig join <link>" },
171
+ { command: "acp", description: "Start the Rig product in OMP ACP mode.", usage: "rig acp [args...]" },
172
+ { command: "models", description: "Delegate model management to the Rig product substrate.", usage: "rig models [args...]" },
173
+ { command: "mcp", description: "Delegate MCP management to the Rig product substrate.", usage: "rig mcp [args...]" },
174
+ { command: "update", description: "Delegate product update handling to the Rig product substrate.", usage: "rig update [args...]" }
175
+ ];
176
+ function standardProductCliCommandId(command) {
177
+ return `@rig/omp-extension-plugin:${command}`;
178
+ }
179
+ function standardProductCliCommandMetadata(descriptor) {
180
+ return {
181
+ id: standardProductCliCommandId(descriptor.command),
182
+ family: descriptor.command,
183
+ description: descriptor.description,
184
+ usage: descriptor.usage,
185
+ projectRequired: false,
186
+ ...descriptor.command === "launch" ? { rootDefault: true } : {},
187
+ productRoot: true
188
+ };
189
+ }
190
+
191
+ // packages/omp-extension-plugin/src/product-entrypoint/contributions.ts
192
+ var ProductEntrypointCap = defineCapability2(PRODUCT_ENTRYPOINT);
193
+ async function importProductEntrypoint() {
194
+ return await Promise.resolve().then(() => (init_product_entrypoint(), exports_product_entrypoint));
195
+ }
196
+ function createStandardProductCliCommand(descriptor) {
197
+ return {
198
+ ...standardProductCliCommandMetadata(descriptor),
199
+ run: async (context, args) => {
200
+ const { runRigOmpProductCommand: runRigOmpProductCommand2 } = await importProductEntrypoint();
201
+ return runRigOmpProductCommand2({
202
+ projectRoot: context.projectRoot,
203
+ command: descriptor.command,
204
+ args
205
+ });
206
+ }
207
+ };
208
+ }
209
+ var productCliCommands = STANDARD_PRODUCT_COMMANDS.map(createStandardProductCliCommand);
210
+ var productEntrypointCapability = ProductEntrypointCap.provide(async () => {
211
+ const { joinRigOmpProductSession: joinRigOmpProductSession2 } = await importProductEntrypoint();
212
+ return { joinSession: joinRigOmpProductSession2 };
213
+ }, {
214
+ title: "Product entrypoint service",
215
+ description: "Join live product sessions via the cockpit-owned runtime entrypoint."
216
+ });
217
+
218
+ // packages/omp-extension-plugin/src/product-entrypoint/product-help.ts
219
+ var TOP_LEVEL_SECTIONS = [
220
+ {
221
+ title: "Open Rig",
222
+ subtitle: "the cockpit \u2014 bare rig opens the Rig Cockpit inside an OMP collab session",
223
+ commands: [
224
+ {
225
+ command: "rig",
226
+ description: "Open the Rig Cockpit (OMP collaboration substrate) for the current workspace.",
227
+ usecase: "Day-to-day entry point: drive everything (tasks, runs, inbox) from the board.",
228
+ examples: ["cd my-project && rig", "rig # in a repo with rig.config.ts"]
229
+ },
230
+ {
231
+ command: "rig --workspace <path>",
232
+ description: "Open the cockpit for another workspace instead of the current dir.",
233
+ usecase: "Operate a project without cd-ing into it.",
234
+ examples: ["rig --workspace ~/work/humanwork", "rig --workspace ../other-repo"]
235
+ },
236
+ {
237
+ command: "rig join <link>",
238
+ description: "Join an encrypted OMP collaborative session from another operator.",
239
+ usecase: "Pair on a teammate's live run from the join link they shared.",
240
+ examples: ["rig join where.rig-does.work/r/AbC123\u2026"]
241
+ },
242
+ { command: "/rig", description: "From inside an OMP session, (re)open the Rig Cockpit screen.", usecase: "Jump back to the board after dropping into the raw agent session." },
243
+ { command: "rig --version", description: "Print the installed Rig CLI version.", examples: ["rig --version"] }
244
+ ]
245
+ }
246
+ ];
247
+ var ADVANCED_COMMANDS = [
248
+ { command: "rig server task-run ...", description: "Internal legacy server-owned task execution entry point." },
249
+ { command: "rig server notify-test [--event <type>]", description: "Internal diagnostic event notification smoke command." },
250
+ { command: "rig run start|start-serial|start-parallel", description: "Legacy/internal queue starters; not the Rig Cockpit task-detail dispatch path." },
251
+ { command: "rig remote orchestrate-*", description: "Legacy automation-only remote orchestration commands." }
252
+ ];
253
+ function assembleHelpCatalog(commands) {
254
+ const seen = new Set;
255
+ const groups = [];
256
+ for (const command of commands) {
257
+ const helpDoc = command.helpDoc;
258
+ if (!helpDoc || seen.has(helpDoc.name))
259
+ continue;
260
+ seen.add(helpDoc.name);
261
+ groups.push(helpDoc);
262
+ }
263
+ const advancedGroupNames = groups.filter((group) => group.advancedOnly).map((group) => group.name);
264
+ return {
265
+ sections: TOP_LEVEL_SECTIONS,
266
+ groups,
267
+ advancedCommands: ADVANCED_COMMANDS,
268
+ advancedGroupNames
269
+ };
270
+ }
271
+
272
+ // packages/omp-extension-plugin/src/product-entrypoint/plugin.ts
273
+ var PRODUCT_ENTRYPOINT_PLUGIN_NAME = "@rig/omp-extension-plugin";
274
+ var HelpCatalogCap = defineCapability3(HELP_CATALOG);
275
+ var helpCatalogService = { helpCatalog: assembleHelpCatalog };
276
+ var productEntrypointPlugin = definePlugin({
277
+ name: PRODUCT_ENTRYPOINT_PLUGIN_NAME,
278
+ version: "0.0.0-alpha.1",
279
+ effects: { spawnsProcesses: true, readsFiles: true, contributesCliCommands: true },
280
+ contributes: {
281
+ cliCommands: [...productCliCommands],
282
+ capabilities: [
283
+ productEntrypointCapability,
284
+ HelpCatalogCap.provide(() => helpCatalogService, {
285
+ title: "Rig help catalog",
286
+ description: "Product-help intro framing + per-command help groups assembled from contributed commands' helpDoc."
287
+ })
288
+ ]
289
+ }
290
+ });
291
+ function createProductEntrypointPlugin() {
292
+ return productEntrypointPlugin;
293
+ }
294
+ var plugin_default = productEntrypointPlugin;
295
+ export {
296
+ productEntrypointPlugin,
297
+ plugin_default as default,
298
+ createProductEntrypointPlugin,
299
+ PRODUCT_ENTRYPOINT_PLUGIN_NAME
300
+ };
@@ -0,0 +1,14 @@
1
+ import { type ProductEntrypointJoinSessionInput, type ProductEntrypointJoinSessionResult } from "@rig/contracts";
2
+ import type { RigProductCommandName } from "./metadata";
3
+ export type RunRigOmpProductCommandInput = {
4
+ readonly projectRoot: string;
5
+ readonly command: RigProductCommandName;
6
+ readonly args: readonly string[];
7
+ };
8
+ export type JoinRigOmpProductSessionInput = ProductEntrypointJoinSessionInput;
9
+ export declare function joinRigOmpProductSession(input: JoinRigOmpProductSessionInput): Promise<ProductEntrypointJoinSessionResult>;
10
+ export declare function runRigOmpProductCommand(input: RunRigOmpProductCommandInput): Promise<{
11
+ ok: true;
12
+ group: string;
13
+ command: string;
14
+ }>;