@h-rig/planning-plugin 0.0.6-alpha.156 → 0.0.6-alpha.158
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/cli.d.ts +1 -7
- package/dist/src/cli.js +8 -7
- package/dist/src/index.js +10 -8
- package/dist/src/plugin.js +10 -8
- package/package.json +3 -3
package/dist/src/cli.d.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
+
import { type CommandOutcome } from "@rig/contracts";
|
|
1
2
|
import type { RuntimeCliContext } from "@rig/core/config";
|
|
2
3
|
export declare const PLANNING_PLAN_CLI_ID = "planning.plan";
|
|
3
|
-
type CommandOutcome = {
|
|
4
|
-
readonly ok: boolean;
|
|
5
|
-
readonly group: string;
|
|
6
|
-
readonly command: string;
|
|
7
|
-
readonly details?: Record<string, unknown>;
|
|
8
|
-
};
|
|
9
4
|
export declare function executePlan(context: RuntimeCliContext, args: readonly string[]): Promise<CommandOutcome>;
|
|
10
5
|
export declare const planningCliCommands: readonly [{
|
|
11
6
|
readonly id: "planning.plan";
|
|
@@ -16,4 +11,3 @@ export declare const planningCliCommands: readonly [{
|
|
|
16
11
|
readonly projectRequired: true;
|
|
17
12
|
readonly run: typeof executePlan;
|
|
18
13
|
}];
|
|
19
|
-
export {};
|
package/dist/src/cli.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var __require = import.meta.require;
|
|
3
|
-
|
|
4
2
|
// packages/planning-plugin/src/cli.ts
|
|
5
3
|
import { readFileSync } from "fs";
|
|
4
|
+
import { TASK_IO_SERVICE_CAPABILITY } from "@rig/contracts";
|
|
5
|
+
import { defineCapability } from "@rig/core/capability";
|
|
6
|
+
import { requireCapabilityForRoot } from "@rig/core/capability-loaders";
|
|
6
7
|
|
|
7
8
|
// packages/planning-plugin/src/planning.ts
|
|
8
9
|
async function spec(input, ports) {
|
|
@@ -221,9 +222,9 @@ function defaultPlanningProvider(now) {
|
|
|
221
222
|
plan: (planSpec) => planSpec
|
|
222
223
|
};
|
|
223
224
|
}
|
|
224
|
-
async function loadPlanningClientIo() {
|
|
225
|
-
const
|
|
226
|
-
return { createTask, getTask };
|
|
225
|
+
async function loadPlanningClientIo(projectRoot) {
|
|
226
|
+
const taskIo = await requireCapabilityForRoot(projectRoot, defineCapability(TASK_IO_SERVICE_CAPABILITY), "No task-sources plugin provides task IO for this project root.");
|
|
227
|
+
return { createTask: taskIo.createTask, getTask: taskIo.getTask };
|
|
227
228
|
}
|
|
228
229
|
async function readPrdText(context, args) {
|
|
229
230
|
const title = takeOption(args, "--title");
|
|
@@ -234,7 +235,7 @@ async function readPrdText(context, args) {
|
|
|
234
235
|
if (sources.length !== 1)
|
|
235
236
|
throw new Error("rig plan requires exactly one of --text <prd>, --prd <file>, or --issue <id>.");
|
|
236
237
|
if (issue.value) {
|
|
237
|
-
const { getTask } = await loadPlanningClientIo();
|
|
238
|
+
const { getTask } = await loadPlanningClientIo(context.projectRoot);
|
|
238
239
|
const task = await getTask(context.projectRoot, issue.value);
|
|
239
240
|
if (!task)
|
|
240
241
|
throw new Error(`No task found for issue ${issue.value}.`);
|
|
@@ -260,7 +261,7 @@ async function executePlan(context, args) {
|
|
|
260
261
|
const willMaterialize = materialize.value && !dryRun.value;
|
|
261
262
|
const now = () => new Date().toISOString();
|
|
262
263
|
const provider = defaultPlanningProvider(now);
|
|
263
|
-
const { createTask } = await loadPlanningClientIo();
|
|
264
|
+
const { createTask } = await loadPlanningClientIo(context.projectRoot);
|
|
264
265
|
const result = await planWorkspace(context.projectRoot, prd.body, {
|
|
265
266
|
generatePlan: (input) => specClarifyPlan({ title: input.title ?? prd.title, body: input.prd }, {}, provider),
|
|
266
267
|
createTask
|
package/dist/src/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var __require = import.meta.require;
|
|
3
|
-
|
|
4
2
|
// packages/planning-plugin/src/planning.ts
|
|
5
3
|
async function spec(input, ports) {
|
|
6
4
|
return ports.spec(input);
|
|
@@ -119,6 +117,9 @@ async function materialize(planSpec, source, options = {}) {
|
|
|
119
117
|
}
|
|
120
118
|
// packages/planning-plugin/src/cli.ts
|
|
121
119
|
import { readFileSync } from "fs";
|
|
120
|
+
import { TASK_IO_SERVICE_CAPABILITY } from "@rig/contracts";
|
|
121
|
+
import { defineCapability } from "@rig/core/capability";
|
|
122
|
+
import { requireCapabilityForRoot } from "@rig/core/capability-loaders";
|
|
122
123
|
|
|
123
124
|
// packages/planning-plugin/src/workspace-planning.ts
|
|
124
125
|
function taskByLocalId2(spec2) {
|
|
@@ -323,9 +324,9 @@ function defaultPlanningProvider(now) {
|
|
|
323
324
|
plan: (planSpec) => planSpec
|
|
324
325
|
};
|
|
325
326
|
}
|
|
326
|
-
async function loadPlanningClientIo() {
|
|
327
|
-
const
|
|
328
|
-
return { createTask, getTask };
|
|
327
|
+
async function loadPlanningClientIo(projectRoot) {
|
|
328
|
+
const taskIo = await requireCapabilityForRoot(projectRoot, defineCapability(TASK_IO_SERVICE_CAPABILITY), "No task-sources plugin provides task IO for this project root.");
|
|
329
|
+
return { createTask: taskIo.createTask, getTask: taskIo.getTask };
|
|
329
330
|
}
|
|
330
331
|
async function readPrdText(context, args) {
|
|
331
332
|
const title = takeOption(args, "--title");
|
|
@@ -336,7 +337,7 @@ async function readPrdText(context, args) {
|
|
|
336
337
|
if (sources.length !== 1)
|
|
337
338
|
throw new Error("rig plan requires exactly one of --text <prd>, --prd <file>, or --issue <id>.");
|
|
338
339
|
if (issue.value) {
|
|
339
|
-
const { getTask } = await loadPlanningClientIo();
|
|
340
|
+
const { getTask } = await loadPlanningClientIo(context.projectRoot);
|
|
340
341
|
const task = await getTask(context.projectRoot, issue.value);
|
|
341
342
|
if (!task)
|
|
342
343
|
throw new Error(`No task found for issue ${issue.value}.`);
|
|
@@ -362,7 +363,7 @@ async function executePlan(context, args) {
|
|
|
362
363
|
const willMaterialize = materialize2.value && !dryRun.value;
|
|
363
364
|
const now = () => new Date().toISOString();
|
|
364
365
|
const provider = defaultPlanningProvider(now);
|
|
365
|
-
const { createTask } = await loadPlanningClientIo();
|
|
366
|
+
const { createTask } = await loadPlanningClientIo(context.projectRoot);
|
|
366
367
|
const result = await planWorkspace(context.projectRoot, prd.body, {
|
|
367
368
|
generatePlan: (input) => specClarifyPlan({ title: input.title ?? prd.title, body: input.prd }, {}, provider),
|
|
368
369
|
createTask
|
|
@@ -403,7 +404,8 @@ var planningPlugin = definePlugin({
|
|
|
403
404
|
panels: [
|
|
404
405
|
{ id: PLANNING_PLAN_PANEL_ID, slot: "capability", title: "Plan intake", capabilityId: "planning.plan" }
|
|
405
406
|
],
|
|
406
|
-
cliCommands: planningCliCommands
|
|
407
|
+
cliCommands: planningCliCommands,
|
|
408
|
+
config: { defaults: () => ({ planning: { mode: "auto" } }) }
|
|
407
409
|
}
|
|
408
410
|
});
|
|
409
411
|
function createPlanningPlugin() {
|
package/dist/src/plugin.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var __require = import.meta.require;
|
|
3
|
-
|
|
4
2
|
// packages/planning-plugin/src/plugin.ts
|
|
5
3
|
import { definePlugin } from "@rig/core/config";
|
|
6
4
|
|
|
7
5
|
// packages/planning-plugin/src/cli.ts
|
|
8
6
|
import { readFileSync } from "fs";
|
|
7
|
+
import { TASK_IO_SERVICE_CAPABILITY } from "@rig/contracts";
|
|
8
|
+
import { defineCapability } from "@rig/core/capability";
|
|
9
|
+
import { requireCapabilityForRoot } from "@rig/core/capability-loaders";
|
|
9
10
|
|
|
10
11
|
// packages/planning-plugin/src/planning.ts
|
|
11
12
|
async function spec(input, ports) {
|
|
@@ -224,9 +225,9 @@ function defaultPlanningProvider(now) {
|
|
|
224
225
|
plan: (planSpec) => planSpec
|
|
225
226
|
};
|
|
226
227
|
}
|
|
227
|
-
async function loadPlanningClientIo() {
|
|
228
|
-
const
|
|
229
|
-
return { createTask, getTask };
|
|
228
|
+
async function loadPlanningClientIo(projectRoot) {
|
|
229
|
+
const taskIo = await requireCapabilityForRoot(projectRoot, defineCapability(TASK_IO_SERVICE_CAPABILITY), "No task-sources plugin provides task IO for this project root.");
|
|
230
|
+
return { createTask: taskIo.createTask, getTask: taskIo.getTask };
|
|
230
231
|
}
|
|
231
232
|
async function readPrdText(context, args) {
|
|
232
233
|
const title = takeOption(args, "--title");
|
|
@@ -237,7 +238,7 @@ async function readPrdText(context, args) {
|
|
|
237
238
|
if (sources.length !== 1)
|
|
238
239
|
throw new Error("rig plan requires exactly one of --text <prd>, --prd <file>, or --issue <id>.");
|
|
239
240
|
if (issue.value) {
|
|
240
|
-
const { getTask } = await loadPlanningClientIo();
|
|
241
|
+
const { getTask } = await loadPlanningClientIo(context.projectRoot);
|
|
241
242
|
const task = await getTask(context.projectRoot, issue.value);
|
|
242
243
|
if (!task)
|
|
243
244
|
throw new Error(`No task found for issue ${issue.value}.`);
|
|
@@ -263,7 +264,7 @@ async function executePlan(context, args) {
|
|
|
263
264
|
const willMaterialize = materialize.value && !dryRun.value;
|
|
264
265
|
const now = () => new Date().toISOString();
|
|
265
266
|
const provider = defaultPlanningProvider(now);
|
|
266
|
-
const { createTask } = await loadPlanningClientIo();
|
|
267
|
+
const { createTask } = await loadPlanningClientIo(context.projectRoot);
|
|
267
268
|
const result = await planWorkspace(context.projectRoot, prd.body, {
|
|
268
269
|
generatePlan: (input) => specClarifyPlan({ title: input.title ?? prd.title, body: input.prd }, {}, provider),
|
|
269
270
|
createTask
|
|
@@ -304,7 +305,8 @@ var planningPlugin = definePlugin({
|
|
|
304
305
|
panels: [
|
|
305
306
|
{ id: PLANNING_PLAN_PANEL_ID, slot: "capability", title: "Plan intake", capabilityId: "planning.plan" }
|
|
306
307
|
],
|
|
307
|
-
cliCommands: planningCliCommands
|
|
308
|
+
cliCommands: planningCliCommands,
|
|
309
|
+
config: { defaults: () => ({ planning: { mode: "auto" } }) }
|
|
308
310
|
}
|
|
309
311
|
});
|
|
310
312
|
function createPlanningPlugin() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h-rig/planning-plugin",
|
|
3
|
-
"version": "0.0.6-alpha.
|
|
3
|
+
"version": "0.0.6-alpha.158",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "First-party PRD-to-plan plugin for Rig task sources.",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"module": "./dist/src/index.js",
|
|
30
30
|
"types": "./dist/src/index.d.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.
|
|
33
|
-
"@rig/core": "npm:@h-rig/core@0.0.6-alpha.
|
|
32
|
+
"@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.158",
|
|
33
|
+
"@rig/core": "npm:@h-rig/core@0.0.6-alpha.158"
|
|
34
34
|
}
|
|
35
35
|
}
|