@klaudworks/rmr 1.2.0 → 1.2.2
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/index.js
CHANGED
|
@@ -12028,8 +12028,18 @@ class ContinueCommand extends BaseCommand {
|
|
|
12028
12028
|
// src/commands/install.ts
|
|
12029
12029
|
import { cp, readdir as readdir2 } from "node:fs/promises";
|
|
12030
12030
|
import { existsSync } from "node:fs";
|
|
12031
|
-
import { dirname as dirname3, resolve as resolve7 } from "node:path";
|
|
12031
|
+
import { basename as basename2, dirname as dirname3, resolve as resolve7 } from "node:path";
|
|
12032
12032
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
12033
|
+
|
|
12034
|
+
// src/lib/workflow-utils.ts
|
|
12035
|
+
function workflowRequiresTask(workflow) {
|
|
12036
|
+
return workflow.steps.some((step) => step.requires.inputs.includes("task"));
|
|
12037
|
+
}
|
|
12038
|
+
function getWorkflowDefaultHarness(workflow) {
|
|
12039
|
+
return workflow.harness ?? "(none - step-level harnesses only)";
|
|
12040
|
+
}
|
|
12041
|
+
|
|
12042
|
+
// src/commands/install.ts
|
|
12033
12043
|
function getExamplesWorkflowsDir() {
|
|
12034
12044
|
const thisDir = dirname3(fileURLToPath2(import.meta.url));
|
|
12035
12045
|
const fromDist = resolve7(thisDir, "..", "examples", "workflows");
|
|
@@ -12040,6 +12050,17 @@ function getExamplesWorkflowsDir() {
|
|
|
12040
12050
|
return fromSrc;
|
|
12041
12051
|
return fromSrc;
|
|
12042
12052
|
}
|
|
12053
|
+
function resolveWorkflowFilePath(workflowDir) {
|
|
12054
|
+
const yamlPath = resolve7(workflowDir, "workflow.yaml");
|
|
12055
|
+
if (existsSync(yamlPath)) {
|
|
12056
|
+
return yamlPath;
|
|
12057
|
+
}
|
|
12058
|
+
const ymlPath = resolve7(workflowDir, "workflow.yml");
|
|
12059
|
+
if (existsSync(ymlPath)) {
|
|
12060
|
+
return ymlPath;
|
|
12061
|
+
}
|
|
12062
|
+
throw new UserInputError(`Workflow directory does not contain workflow.yaml or workflow.yml: ${workflowDir}`);
|
|
12063
|
+
}
|
|
12043
12064
|
|
|
12044
12065
|
class InstallCommand extends BaseCommand {
|
|
12045
12066
|
static paths = [["install"]];
|
|
@@ -12065,14 +12086,26 @@ class InstallCommand extends BaseCommand {
|
|
|
12065
12086
|
const hint = available.length > 0 ? ` Available: ${available.join(", ")}.` : " No bundled workflows found.";
|
|
12066
12087
|
throw new UserInputError(`Unknown workflow "${this.workflowName}".${hint}`);
|
|
12067
12088
|
}
|
|
12089
|
+
const sourceWorkflowPath = resolveWorkflowFilePath(sourceDir);
|
|
12090
|
+
const sourceWorkflow = await loadWorkflowDefinition(sourceWorkflowPath).catch((error) => {
|
|
12091
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
12092
|
+
throw new UserInputError(`Bundled workflow "${this.workflowName}" is invalid: ${message}`);
|
|
12093
|
+
});
|
|
12094
|
+
const workflowFileName = basename2(sourceWorkflowPath);
|
|
12095
|
+
const installedWorkflowPath = `.rmr/workflows/${this.workflowName}/${workflowFileName}`;
|
|
12096
|
+
const runHint = workflowRequiresTask(sourceWorkflow) ? `${binaryName} run ${installedWorkflowPath} --task "Describe your task"` : `${binaryName} run ${installedWorkflowPath}`;
|
|
12097
|
+
const defaultHarness = getWorkflowDefaultHarness(sourceWorkflow);
|
|
12098
|
+
const harnessHint = `Default harness: ${defaultHarness}. ` + `To use codex or opencode, edit ${installedWorkflowPath}.`;
|
|
12068
12099
|
if (existsSync(destinationDir)) {
|
|
12069
12100
|
ui.info(`Workflow already installed at .rmr/workflows/${this.workflowName}/`);
|
|
12070
|
-
ui.info(`Run it with: ${
|
|
12101
|
+
ui.info(`Run it with: ${runHint}`);
|
|
12102
|
+
ui.info(harnessHint);
|
|
12071
12103
|
return 0;
|
|
12072
12104
|
}
|
|
12073
12105
|
await cp(sourceDir, destinationDir, { recursive: true, force: false, errorOnExist: true });
|
|
12074
12106
|
ui.success(`installed .rmr/workflows/${this.workflowName}/`);
|
|
12075
|
-
ui.info(`Run it with: ${
|
|
12107
|
+
ui.info(`Run it with: ${runHint}`);
|
|
12108
|
+
ui.info(harnessHint);
|
|
12076
12109
|
return 0;
|
|
12077
12110
|
}
|
|
12078
12111
|
}
|
|
@@ -12193,13 +12226,13 @@ class ListCommand extends BaseCommand {
|
|
|
12193
12226
|
}
|
|
12194
12227
|
|
|
12195
12228
|
// src/commands/root.ts
|
|
12196
|
-
import { basename as
|
|
12229
|
+
import { basename as basename3 } from "node:path";
|
|
12197
12230
|
function detectShell() {
|
|
12198
12231
|
const raw = process.env.SHELL;
|
|
12199
12232
|
if (!raw) {
|
|
12200
12233
|
return null;
|
|
12201
12234
|
}
|
|
12202
|
-
const shell =
|
|
12235
|
+
const shell = basename3(raw);
|
|
12203
12236
|
if (shell === "bash" || shell === "zsh" || shell === "fish") {
|
|
12204
12237
|
return shell;
|
|
12205
12238
|
}
|
|
@@ -12319,9 +12352,6 @@ async function resolveWorkflowPath(inputPath) {
|
|
|
12319
12352
|
throw new UserInputError(`Failed to access workflow path "${absolutePath}": ${getErrorMessage(error)}`);
|
|
12320
12353
|
}
|
|
12321
12354
|
}
|
|
12322
|
-
function workflowRequiresTask(workflow) {
|
|
12323
|
-
return workflow.steps.some((step) => step.requires.inputs.includes("task"));
|
|
12324
|
-
}
|
|
12325
12355
|
|
|
12326
12356
|
class RunCommand extends BaseCommand {
|
|
12327
12357
|
static paths = [["run"]];
|
|
@@ -12,8 +12,7 @@ Use issue comments as the source of truth for research context and plan.
|
|
|
12
12
|
## Workflow
|
|
13
13
|
|
|
14
14
|
1. Determine issue id:
|
|
15
|
-
- Use `{{
|
|
16
|
-
- Otherwise use `{{plan.issue_id}}`.
|
|
15
|
+
- Use `{{plan.issue_id}}`.
|
|
17
16
|
2. If needed, claim issue:
|
|
18
17
|
`bd update <issue-id> --status in_progress --json | toon`
|
|
19
18
|
3. Read issue comments once:
|
|
@@ -76,4 +75,3 @@ If blocked after 3 attempts:
|
|
|
76
75
|
|
|
77
76
|
Reviewer feedback: {{verify.issues}}
|
|
78
77
|
Planned issue: {{plan.issue_id}}
|
|
79
|
-
Loop issue: {{verify.issue_id}}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@klaudworks/rex",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@klaudworks/rex",
|
|
9
|
-
"version": "1.2.
|
|
9
|
+
"version": "1.2.2",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"clipanion": "^4.0.0-rc.4",
|
|
12
12
|
"yaml": "^2.8.2"
|