@klaudworks/rmr 0.4.2 → 0.4.4
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/README.md +4 -7
- package/dist/index.js +228 -207
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,14 +7,11 @@ Define multi-step coding workflows that match how you actually work. `rmr` orche
|
|
|
7
7
|
## Quick Start
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
|
|
11
|
-
npx @klaudworks/rmr@latest run .rmr/workflows/feature-dev/workflow.yaml --task "Implement feature X" # run it
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
Using `npx` with `@latest` always runs the newest version. To avoid the prefix, install globally:
|
|
10
|
+
npm install -g @klaudworks/rmr
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
# run from the root of your project
|
|
13
|
+
rmr install feature-dev
|
|
14
|
+
rmr run .rmr/workflows/feature-dev/workflow.yaml --task "Implement feature X"
|
|
18
15
|
```
|
|
19
16
|
|
|
20
17
|
## Sample Workflows
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
// @bun
|
|
1
|
+
#!/usr/bin/env node
|
|
3
2
|
import { createRequire } from "node:module";
|
|
4
3
|
var __create = Object.create;
|
|
5
4
|
var __getProtoOf = Object.getPrototypeOf;
|
|
@@ -7944,46 +7943,6 @@ var require_public_api = __commonJS((exports) => {
|
|
|
7944
7943
|
exports.parseDocument = parseDocument;
|
|
7945
7944
|
exports.stringify = stringify;
|
|
7946
7945
|
});
|
|
7947
|
-
// node_modules/clipanion/lib/platform/node.mjs
|
|
7948
|
-
import tty from "tty";
|
|
7949
|
-
function getDefaultColorDepth() {
|
|
7950
|
-
if (tty && `getColorDepth` in tty.WriteStream.prototype)
|
|
7951
|
-
return tty.WriteStream.prototype.getColorDepth();
|
|
7952
|
-
if (process.env.FORCE_COLOR === `0`)
|
|
7953
|
-
return 1;
|
|
7954
|
-
if (process.env.FORCE_COLOR === `1`)
|
|
7955
|
-
return 8;
|
|
7956
|
-
if (typeof process.stdout !== `undefined` && process.stdout.isTTY)
|
|
7957
|
-
return 8;
|
|
7958
|
-
return 1;
|
|
7959
|
-
}
|
|
7960
|
-
var gContextStorage;
|
|
7961
|
-
function getCaptureActivator(context) {
|
|
7962
|
-
let contextStorage = gContextStorage;
|
|
7963
|
-
if (typeof contextStorage === `undefined`) {
|
|
7964
|
-
if (context.stdout === process.stdout && context.stderr === process.stderr)
|
|
7965
|
-
return null;
|
|
7966
|
-
const { AsyncLocalStorage: LazyAsyncLocalStorage } = __require("async_hooks");
|
|
7967
|
-
contextStorage = gContextStorage = new LazyAsyncLocalStorage;
|
|
7968
|
-
const origStdoutWrite = process.stdout._write;
|
|
7969
|
-
process.stdout._write = function(chunk, encoding, cb) {
|
|
7970
|
-
const context2 = contextStorage.getStore();
|
|
7971
|
-
if (typeof context2 === `undefined`)
|
|
7972
|
-
return origStdoutWrite.call(this, chunk, encoding, cb);
|
|
7973
|
-
return context2.stdout.write(chunk, encoding, cb);
|
|
7974
|
-
};
|
|
7975
|
-
const origStderrWrite = process.stderr._write;
|
|
7976
|
-
process.stderr._write = function(chunk, encoding, cb) {
|
|
7977
|
-
const context2 = contextStorage.getStore();
|
|
7978
|
-
if (typeof context2 === `undefined`)
|
|
7979
|
-
return origStderrWrite.call(this, chunk, encoding, cb);
|
|
7980
|
-
return context2.stderr.write(chunk, encoding, cb);
|
|
7981
|
-
};
|
|
7982
|
-
}
|
|
7983
|
-
return (fn) => {
|
|
7984
|
-
return contextStorage.run(context, fn);
|
|
7985
|
-
};
|
|
7986
|
-
}
|
|
7987
7946
|
|
|
7988
7947
|
// node_modules/clipanion/lib/constants.mjs
|
|
7989
7948
|
var SpecialToken;
|
|
@@ -8077,6 +8036,136 @@ var whileRunning = (input) => `While running ${input.filter((token) => {
|
|
|
8077
8036
|
}
|
|
8078
8037
|
}).join(` `)}`;
|
|
8079
8038
|
|
|
8039
|
+
// node_modules/clipanion/lib/advanced/options/utils.mjs
|
|
8040
|
+
var isOptionSymbol = Symbol(`clipanion/isOption`);
|
|
8041
|
+
function makeCommandOption(spec) {
|
|
8042
|
+
return { ...spec, [isOptionSymbol]: true };
|
|
8043
|
+
}
|
|
8044
|
+
function rerouteArguments(a, b) {
|
|
8045
|
+
if (typeof a === `undefined`)
|
|
8046
|
+
return [a, b];
|
|
8047
|
+
if (typeof a === `object` && a !== null && !Array.isArray(a)) {
|
|
8048
|
+
return [undefined, a];
|
|
8049
|
+
} else {
|
|
8050
|
+
return [a, b];
|
|
8051
|
+
}
|
|
8052
|
+
}
|
|
8053
|
+
function cleanValidationError(message, { mergeName = false } = {}) {
|
|
8054
|
+
const match = message.match(/^([^:]+): (.*)$/m);
|
|
8055
|
+
if (!match)
|
|
8056
|
+
return `validation failed`;
|
|
8057
|
+
let [, path, line] = match;
|
|
8058
|
+
if (mergeName)
|
|
8059
|
+
line = line[0].toLowerCase() + line.slice(1);
|
|
8060
|
+
line = path !== `.` || !mergeName ? `${path.replace(/^\.(\[|$)/, `$1`)}: ${line}` : `: ${line}`;
|
|
8061
|
+
return line;
|
|
8062
|
+
}
|
|
8063
|
+
function formatError(message, errors) {
|
|
8064
|
+
if (errors.length === 1) {
|
|
8065
|
+
return new UsageError(`${message}${cleanValidationError(errors[0], { mergeName: true })}`);
|
|
8066
|
+
} else {
|
|
8067
|
+
return new UsageError(`${message}:
|
|
8068
|
+
${errors.map((error) => `
|
|
8069
|
+
- ${cleanValidationError(error)}`).join(``)}`);
|
|
8070
|
+
}
|
|
8071
|
+
}
|
|
8072
|
+
function applyValidator(name, value, validator) {
|
|
8073
|
+
if (typeof validator === `undefined`)
|
|
8074
|
+
return value;
|
|
8075
|
+
const errors = [];
|
|
8076
|
+
const coercions = [];
|
|
8077
|
+
const coercion = (v) => {
|
|
8078
|
+
const orig = value;
|
|
8079
|
+
value = v;
|
|
8080
|
+
return coercion.bind(null, orig);
|
|
8081
|
+
};
|
|
8082
|
+
const check = validator(value, { errors, coercions, coercion });
|
|
8083
|
+
if (!check)
|
|
8084
|
+
throw formatError(`Invalid value for ${name}`, errors);
|
|
8085
|
+
for (const [, op] of coercions)
|
|
8086
|
+
op();
|
|
8087
|
+
return value;
|
|
8088
|
+
}
|
|
8089
|
+
|
|
8090
|
+
// node_modules/clipanion/lib/advanced/Command.mjs
|
|
8091
|
+
class Command {
|
|
8092
|
+
constructor() {
|
|
8093
|
+
this.help = false;
|
|
8094
|
+
}
|
|
8095
|
+
static Usage(usage) {
|
|
8096
|
+
return usage;
|
|
8097
|
+
}
|
|
8098
|
+
async catch(error) {
|
|
8099
|
+
throw error;
|
|
8100
|
+
}
|
|
8101
|
+
async validateAndExecute() {
|
|
8102
|
+
const commandClass = this.constructor;
|
|
8103
|
+
const cascade = commandClass.schema;
|
|
8104
|
+
if (Array.isArray(cascade)) {
|
|
8105
|
+
const { isDict, isUnknown, applyCascade } = await Promise.resolve().then(() => __toESM(require_lib(), 1));
|
|
8106
|
+
const schema = applyCascade(isDict(isUnknown()), cascade);
|
|
8107
|
+
const errors = [];
|
|
8108
|
+
const coercions = [];
|
|
8109
|
+
const check = schema(this, { errors, coercions });
|
|
8110
|
+
if (!check)
|
|
8111
|
+
throw formatError(`Invalid option schema`, errors);
|
|
8112
|
+
for (const [, op] of coercions) {
|
|
8113
|
+
op();
|
|
8114
|
+
}
|
|
8115
|
+
} else if (cascade != null) {
|
|
8116
|
+
throw new Error(`Invalid command schema`);
|
|
8117
|
+
}
|
|
8118
|
+
const exitCode = await this.execute();
|
|
8119
|
+
if (typeof exitCode !== `undefined`) {
|
|
8120
|
+
return exitCode;
|
|
8121
|
+
} else {
|
|
8122
|
+
return 0;
|
|
8123
|
+
}
|
|
8124
|
+
}
|
|
8125
|
+
}
|
|
8126
|
+
Command.isOption = isOptionSymbol;
|
|
8127
|
+
Command.Default = [];
|
|
8128
|
+
// node_modules/clipanion/lib/platform/node.mjs
|
|
8129
|
+
import tty from "tty";
|
|
8130
|
+
function getDefaultColorDepth() {
|
|
8131
|
+
if (tty && `getColorDepth` in tty.WriteStream.prototype)
|
|
8132
|
+
return tty.WriteStream.prototype.getColorDepth();
|
|
8133
|
+
if (process.env.FORCE_COLOR === `0`)
|
|
8134
|
+
return 1;
|
|
8135
|
+
if (process.env.FORCE_COLOR === `1`)
|
|
8136
|
+
return 8;
|
|
8137
|
+
if (typeof process.stdout !== `undefined` && process.stdout.isTTY)
|
|
8138
|
+
return 8;
|
|
8139
|
+
return 1;
|
|
8140
|
+
}
|
|
8141
|
+
var gContextStorage;
|
|
8142
|
+
function getCaptureActivator(context) {
|
|
8143
|
+
let contextStorage = gContextStorage;
|
|
8144
|
+
if (typeof contextStorage === `undefined`) {
|
|
8145
|
+
if (context.stdout === process.stdout && context.stderr === process.stderr)
|
|
8146
|
+
return null;
|
|
8147
|
+
const { AsyncLocalStorage: LazyAsyncLocalStorage } = __require("async_hooks");
|
|
8148
|
+
contextStorage = gContextStorage = new LazyAsyncLocalStorage;
|
|
8149
|
+
const origStdoutWrite = process.stdout._write;
|
|
8150
|
+
process.stdout._write = function(chunk, encoding, cb) {
|
|
8151
|
+
const context2 = contextStorage.getStore();
|
|
8152
|
+
if (typeof context2 === `undefined`)
|
|
8153
|
+
return origStdoutWrite.call(this, chunk, encoding, cb);
|
|
8154
|
+
return context2.stdout.write(chunk, encoding, cb);
|
|
8155
|
+
};
|
|
8156
|
+
const origStderrWrite = process.stderr._write;
|
|
8157
|
+
process.stderr._write = function(chunk, encoding, cb) {
|
|
8158
|
+
const context2 = contextStorage.getStore();
|
|
8159
|
+
if (typeof context2 === `undefined`)
|
|
8160
|
+
return origStderrWrite.call(this, chunk, encoding, cb);
|
|
8161
|
+
return context2.stderr.write(chunk, encoding, cb);
|
|
8162
|
+
};
|
|
8163
|
+
}
|
|
8164
|
+
return (fn) => {
|
|
8165
|
+
return contextStorage.run(context, fn);
|
|
8166
|
+
};
|
|
8167
|
+
}
|
|
8168
|
+
|
|
8080
8169
|
// node_modules/clipanion/lib/core.mjs
|
|
8081
8170
|
function debug(str) {
|
|
8082
8171
|
if (IS_DEBUG) {
|
|
@@ -8860,96 +8949,6 @@ function formatMarkdownish(text, { format, paragraphs }) {
|
|
|
8860
8949
|
` : ``;
|
|
8861
8950
|
}
|
|
8862
8951
|
|
|
8863
|
-
// node_modules/clipanion/lib/advanced/options/utils.mjs
|
|
8864
|
-
var isOptionSymbol = Symbol(`clipanion/isOption`);
|
|
8865
|
-
function makeCommandOption(spec) {
|
|
8866
|
-
return { ...spec, [isOptionSymbol]: true };
|
|
8867
|
-
}
|
|
8868
|
-
function rerouteArguments(a, b) {
|
|
8869
|
-
if (typeof a === `undefined`)
|
|
8870
|
-
return [a, b];
|
|
8871
|
-
if (typeof a === `object` && a !== null && !Array.isArray(a)) {
|
|
8872
|
-
return [undefined, a];
|
|
8873
|
-
} else {
|
|
8874
|
-
return [a, b];
|
|
8875
|
-
}
|
|
8876
|
-
}
|
|
8877
|
-
function cleanValidationError(message, { mergeName = false } = {}) {
|
|
8878
|
-
const match = message.match(/^([^:]+): (.*)$/m);
|
|
8879
|
-
if (!match)
|
|
8880
|
-
return `validation failed`;
|
|
8881
|
-
let [, path, line] = match;
|
|
8882
|
-
if (mergeName)
|
|
8883
|
-
line = line[0].toLowerCase() + line.slice(1);
|
|
8884
|
-
line = path !== `.` || !mergeName ? `${path.replace(/^\.(\[|$)/, `$1`)}: ${line}` : `: ${line}`;
|
|
8885
|
-
return line;
|
|
8886
|
-
}
|
|
8887
|
-
function formatError(message, errors) {
|
|
8888
|
-
if (errors.length === 1) {
|
|
8889
|
-
return new UsageError(`${message}${cleanValidationError(errors[0], { mergeName: true })}`);
|
|
8890
|
-
} else {
|
|
8891
|
-
return new UsageError(`${message}:
|
|
8892
|
-
${errors.map((error) => `
|
|
8893
|
-
- ${cleanValidationError(error)}`).join(``)}`);
|
|
8894
|
-
}
|
|
8895
|
-
}
|
|
8896
|
-
function applyValidator(name, value, validator) {
|
|
8897
|
-
if (typeof validator === `undefined`)
|
|
8898
|
-
return value;
|
|
8899
|
-
const errors = [];
|
|
8900
|
-
const coercions = [];
|
|
8901
|
-
const coercion = (v) => {
|
|
8902
|
-
const orig = value;
|
|
8903
|
-
value = v;
|
|
8904
|
-
return coercion.bind(null, orig);
|
|
8905
|
-
};
|
|
8906
|
-
const check = validator(value, { errors, coercions, coercion });
|
|
8907
|
-
if (!check)
|
|
8908
|
-
throw formatError(`Invalid value for ${name}`, errors);
|
|
8909
|
-
for (const [, op] of coercions)
|
|
8910
|
-
op();
|
|
8911
|
-
return value;
|
|
8912
|
-
}
|
|
8913
|
-
|
|
8914
|
-
// node_modules/clipanion/lib/advanced/Command.mjs
|
|
8915
|
-
class Command {
|
|
8916
|
-
constructor() {
|
|
8917
|
-
this.help = false;
|
|
8918
|
-
}
|
|
8919
|
-
static Usage(usage) {
|
|
8920
|
-
return usage;
|
|
8921
|
-
}
|
|
8922
|
-
async catch(error) {
|
|
8923
|
-
throw error;
|
|
8924
|
-
}
|
|
8925
|
-
async validateAndExecute() {
|
|
8926
|
-
const commandClass = this.constructor;
|
|
8927
|
-
const cascade = commandClass.schema;
|
|
8928
|
-
if (Array.isArray(cascade)) {
|
|
8929
|
-
const { isDict, isUnknown, applyCascade } = await Promise.resolve().then(() => __toESM(require_lib(), 1));
|
|
8930
|
-
const schema = applyCascade(isDict(isUnknown()), cascade);
|
|
8931
|
-
const errors = [];
|
|
8932
|
-
const coercions = [];
|
|
8933
|
-
const check = schema(this, { errors, coercions });
|
|
8934
|
-
if (!check)
|
|
8935
|
-
throw formatError(`Invalid option schema`, errors);
|
|
8936
|
-
for (const [, op] of coercions) {
|
|
8937
|
-
op();
|
|
8938
|
-
}
|
|
8939
|
-
} else if (cascade != null) {
|
|
8940
|
-
throw new Error(`Invalid command schema`);
|
|
8941
|
-
}
|
|
8942
|
-
const exitCode = await this.execute();
|
|
8943
|
-
if (typeof exitCode !== `undefined`) {
|
|
8944
|
-
return exitCode;
|
|
8945
|
-
} else {
|
|
8946
|
-
return 0;
|
|
8947
|
-
}
|
|
8948
|
-
}
|
|
8949
|
-
}
|
|
8950
|
-
Command.isOption = isOptionSymbol;
|
|
8951
|
-
Command.Default = [];
|
|
8952
|
-
|
|
8953
8952
|
// node_modules/clipanion/lib/advanced/HelpCommand.mjs
|
|
8954
8953
|
class HelpCommand extends Command {
|
|
8955
8954
|
static from(state, contexts) {
|
|
@@ -11162,9 +11161,91 @@ function parseHarnessOverride(value) {
|
|
|
11162
11161
|
return value;
|
|
11163
11162
|
}
|
|
11164
11163
|
|
|
11164
|
+
// src/lib/version.ts
|
|
11165
|
+
import { readFileSync } from "node:fs";
|
|
11166
|
+
import { dirname as dirname2, resolve as resolve5 } from "node:path";
|
|
11167
|
+
import { fileURLToPath } from "node:url";
|
|
11168
|
+
var cached;
|
|
11169
|
+
function getVersion() {
|
|
11170
|
+
if (cached)
|
|
11171
|
+
return cached;
|
|
11172
|
+
const thisDir = dirname2(fileURLToPath(import.meta.url));
|
|
11173
|
+
const candidates = [
|
|
11174
|
+
resolve5(thisDir, "..", "package.json"),
|
|
11175
|
+
resolve5(thisDir, "..", "..", "package.json")
|
|
11176
|
+
];
|
|
11177
|
+
for (const candidate of candidates) {
|
|
11178
|
+
try {
|
|
11179
|
+
const pkg = JSON.parse(readFileSync(candidate, "utf8"));
|
|
11180
|
+
if (pkg.version) {
|
|
11181
|
+
cached = pkg.version;
|
|
11182
|
+
return cached;
|
|
11183
|
+
}
|
|
11184
|
+
} catch {}
|
|
11185
|
+
}
|
|
11186
|
+
cached = "0.0.0";
|
|
11187
|
+
return cached;
|
|
11188
|
+
}
|
|
11189
|
+
|
|
11190
|
+
// src/lib/update-check.ts
|
|
11191
|
+
var PACKAGE_NAME = "@klaudworks/rmr";
|
|
11192
|
+
var REGISTRY_URL = `https://registry.npmjs.org/${PACKAGE_NAME}/latest`;
|
|
11193
|
+
var FETCH_TIMEOUT_MS = 3000;
|
|
11194
|
+
function isNewer(latest, current) {
|
|
11195
|
+
const l = latest.split(".").map(Number);
|
|
11196
|
+
const c = current.split(".").map(Number);
|
|
11197
|
+
for (let i = 0;i < 3; i++) {
|
|
11198
|
+
const lv = l[i] ?? 0;
|
|
11199
|
+
const cv = c[i] ?? 0;
|
|
11200
|
+
if (lv > cv)
|
|
11201
|
+
return true;
|
|
11202
|
+
if (lv < cv)
|
|
11203
|
+
return false;
|
|
11204
|
+
}
|
|
11205
|
+
return false;
|
|
11206
|
+
}
|
|
11207
|
+
async function fetchLatestVersion() {
|
|
11208
|
+
try {
|
|
11209
|
+
const controller = new AbortController;
|
|
11210
|
+
const timeout = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
|
|
11211
|
+
const response = await fetch(REGISTRY_URL, {
|
|
11212
|
+
signal: controller.signal,
|
|
11213
|
+
headers: { accept: "application/json" }
|
|
11214
|
+
});
|
|
11215
|
+
clearTimeout(timeout);
|
|
11216
|
+
if (!response.ok)
|
|
11217
|
+
return null;
|
|
11218
|
+
const data = await response.json();
|
|
11219
|
+
return data.version ?? null;
|
|
11220
|
+
} catch {
|
|
11221
|
+
return null;
|
|
11222
|
+
}
|
|
11223
|
+
}
|
|
11224
|
+
function startUpdateCheck() {
|
|
11225
|
+
const currentVersion = getVersion();
|
|
11226
|
+
let result = null;
|
|
11227
|
+
const check = fetchLatestVersion().then((latestVersion) => {
|
|
11228
|
+
if (latestVersion && isNewer(latestVersion, currentVersion)) {
|
|
11229
|
+
result = { latestVersion };
|
|
11230
|
+
}
|
|
11231
|
+
}).catch(() => {});
|
|
11232
|
+
return () => {
|
|
11233
|
+
check.then(() => {
|
|
11234
|
+
if (result) {
|
|
11235
|
+
process.stderr.write(`
|
|
11236
|
+
`);
|
|
11237
|
+
ui.dim(`Update available: ${currentVersion} → ${result.latestVersion}
|
|
11238
|
+
`);
|
|
11239
|
+
ui.dim(`Run: npm install -g ${PACKAGE_NAME}@${result.latestVersion}
|
|
11240
|
+
`);
|
|
11241
|
+
}
|
|
11242
|
+
}).catch(() => {});
|
|
11243
|
+
};
|
|
11244
|
+
}
|
|
11245
|
+
|
|
11165
11246
|
// src/lib/workflow-loader.ts
|
|
11166
11247
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
11167
|
-
import { resolve as
|
|
11248
|
+
import { resolve as resolve6 } from "node:path";
|
|
11168
11249
|
|
|
11169
11250
|
// node_modules/yaml/dist/index.js
|
|
11170
11251
|
var composer = require_composer();
|
|
@@ -11246,7 +11327,7 @@ function validateUniqueness(items, kind) {
|
|
|
11246
11327
|
}
|
|
11247
11328
|
}
|
|
11248
11329
|
async function loadWorkflowDefinition(workflowPath) {
|
|
11249
|
-
const absolutePath =
|
|
11330
|
+
const absolutePath = resolve6(workflowPath);
|
|
11250
11331
|
const raw = await readFile3(absolutePath, "utf8");
|
|
11251
11332
|
const parsed = $parse(raw);
|
|
11252
11333
|
if (!parsed || typeof parsed !== "object") {
|
|
@@ -11368,6 +11449,7 @@ class ContinueCommand extends Command {
|
|
|
11368
11449
|
description: "Inject a one-time hint into the resumed harness prompt."
|
|
11369
11450
|
});
|
|
11370
11451
|
async execute() {
|
|
11452
|
+
const showUpdateNotice = startUpdateCheck();
|
|
11371
11453
|
const config = await loadConfig();
|
|
11372
11454
|
const runState = await loadRunState(config, this.runId);
|
|
11373
11455
|
const workflow = await loadWorkflowDefinition(runState.workflow_path);
|
|
@@ -11405,6 +11487,7 @@ class ContinueCommand extends Command {
|
|
|
11405
11487
|
allowAll: true,
|
|
11406
11488
|
overrides
|
|
11407
11489
|
});
|
|
11490
|
+
showUpdateNotice();
|
|
11408
11491
|
return 0;
|
|
11409
11492
|
}
|
|
11410
11493
|
}
|
|
@@ -11412,12 +11495,12 @@ class ContinueCommand extends Command {
|
|
|
11412
11495
|
// src/commands/install.ts
|
|
11413
11496
|
import { cp, readdir as readdir2 } from "node:fs/promises";
|
|
11414
11497
|
import { existsSync } from "node:fs";
|
|
11415
|
-
import { dirname as
|
|
11416
|
-
import { fileURLToPath } from "node:url";
|
|
11498
|
+
import { dirname as dirname3, resolve as resolve7 } from "node:path";
|
|
11499
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
11417
11500
|
function getExamplesWorkflowsDir() {
|
|
11418
|
-
const thisDir =
|
|
11419
|
-
const fromDist =
|
|
11420
|
-
const fromSrc =
|
|
11501
|
+
const thisDir = dirname3(fileURLToPath2(import.meta.url));
|
|
11502
|
+
const fromDist = resolve7(thisDir, "..", "examples", "workflows");
|
|
11503
|
+
const fromSrc = resolve7(thisDir, "..", "..", "examples", "workflows");
|
|
11421
11504
|
if (existsSync(fromDist))
|
|
11422
11505
|
return fromDist;
|
|
11423
11506
|
if (existsSync(fromSrc))
|
|
@@ -11442,8 +11525,8 @@ class InstallCommand extends Command {
|
|
|
11442
11525
|
if (!existsSync(examplesDir)) {
|
|
11443
11526
|
throw new UserInputError(`Bundled workflows directory not found: ${examplesDir}`);
|
|
11444
11527
|
}
|
|
11445
|
-
const sourceDir =
|
|
11446
|
-
const destinationDir =
|
|
11528
|
+
const sourceDir = resolve7(examplesDir, this.workflowName);
|
|
11529
|
+
const destinationDir = resolve7(config.workflowsDir, this.workflowName);
|
|
11447
11530
|
if (!existsSync(sourceDir)) {
|
|
11448
11531
|
const available = (await readdir2(examplesDir, { withFileTypes: true })).filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort();
|
|
11449
11532
|
const hint = available.length > 0 ? ` Available: ${available.join(", ")}.` : " No bundled workflows found.";
|
|
@@ -11463,34 +11546,6 @@ class InstallCommand extends Command {
|
|
|
11463
11546
|
|
|
11464
11547
|
// src/commands/root.ts
|
|
11465
11548
|
import { basename } from "node:path";
|
|
11466
|
-
|
|
11467
|
-
// src/lib/version.ts
|
|
11468
|
-
import { readFileSync } from "node:fs";
|
|
11469
|
-
import { dirname as dirname3, resolve as resolve7 } from "node:path";
|
|
11470
|
-
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
11471
|
-
var cached;
|
|
11472
|
-
function getVersion() {
|
|
11473
|
-
if (cached)
|
|
11474
|
-
return cached;
|
|
11475
|
-
const thisDir = dirname3(fileURLToPath2(import.meta.url));
|
|
11476
|
-
const candidates = [
|
|
11477
|
-
resolve7(thisDir, "..", "package.json"),
|
|
11478
|
-
resolve7(thisDir, "..", "..", "package.json")
|
|
11479
|
-
];
|
|
11480
|
-
for (const candidate of candidates) {
|
|
11481
|
-
try {
|
|
11482
|
-
const pkg = JSON.parse(readFileSync(candidate, "utf8"));
|
|
11483
|
-
if (pkg.version) {
|
|
11484
|
-
cached = pkg.version;
|
|
11485
|
-
return cached;
|
|
11486
|
-
}
|
|
11487
|
-
} catch {}
|
|
11488
|
-
}
|
|
11489
|
-
cached = "0.0.0";
|
|
11490
|
-
return cached;
|
|
11491
|
-
}
|
|
11492
|
-
|
|
11493
|
-
// src/commands/root.ts
|
|
11494
11549
|
function detectShell() {
|
|
11495
11550
|
const raw = process.env.SHELL;
|
|
11496
11551
|
if (!raw) {
|
|
@@ -11554,16 +11609,6 @@ class RootCommand extends Command {
|
|
|
11554
11609
|
}
|
|
11555
11610
|
}
|
|
11556
11611
|
|
|
11557
|
-
// src/lib/errors.ts
|
|
11558
|
-
class RmrError2 extends Error {
|
|
11559
|
-
code;
|
|
11560
|
-
constructor(code, message) {
|
|
11561
|
-
super(message);
|
|
11562
|
-
this.name = "RmrError";
|
|
11563
|
-
this.code = code;
|
|
11564
|
-
}
|
|
11565
|
-
}
|
|
11566
|
-
|
|
11567
11612
|
// src/lib/logger.ts
|
|
11568
11613
|
var colors = {
|
|
11569
11614
|
reset: "\x1B[0m",
|
|
@@ -11691,6 +11736,7 @@ class RunCommand extends Command {
|
|
|
11691
11736
|
throw new UserInputError("No task provided. Use --task/-t or --task-file/-f.");
|
|
11692
11737
|
}
|
|
11693
11738
|
async execute() {
|
|
11739
|
+
const showUpdateNotice = startUpdateCheck();
|
|
11694
11740
|
const config = await loadConfig();
|
|
11695
11741
|
const { task, displayTask } = await this.resolveTask();
|
|
11696
11742
|
const harnessOverride = parseHarnessOverride(this.harness);
|
|
@@ -11732,41 +11778,16 @@ class RunCommand extends Command {
|
|
|
11732
11778
|
allowAll: effectiveAllowAll,
|
|
11733
11779
|
...Object.keys(overrides).length > 0 && { overrides }
|
|
11734
11780
|
});
|
|
11781
|
+
showUpdateNotice();
|
|
11735
11782
|
return 0;
|
|
11736
11783
|
}
|
|
11737
11784
|
}
|
|
11738
11785
|
|
|
11739
|
-
// src/lib/version.ts
|
|
11740
|
-
import { readFileSync as readFileSync2 } from "node:fs";
|
|
11741
|
-
import { dirname as dirname4, resolve as resolve9 } from "node:path";
|
|
11742
|
-
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
11743
|
-
var cached2;
|
|
11744
|
-
function getVersion2() {
|
|
11745
|
-
if (cached2)
|
|
11746
|
-
return cached2;
|
|
11747
|
-
const thisDir = dirname4(fileURLToPath3(import.meta.url));
|
|
11748
|
-
const candidates = [
|
|
11749
|
-
resolve9(thisDir, "..", "package.json"),
|
|
11750
|
-
resolve9(thisDir, "..", "..", "package.json")
|
|
11751
|
-
];
|
|
11752
|
-
for (const candidate of candidates) {
|
|
11753
|
-
try {
|
|
11754
|
-
const pkg = JSON.parse(readFileSync2(candidate, "utf8"));
|
|
11755
|
-
if (pkg.version) {
|
|
11756
|
-
cached2 = pkg.version;
|
|
11757
|
-
return cached2;
|
|
11758
|
-
}
|
|
11759
|
-
} catch {}
|
|
11760
|
-
}
|
|
11761
|
-
cached2 = "0.0.0";
|
|
11762
|
-
return cached2;
|
|
11763
|
-
}
|
|
11764
|
-
|
|
11765
11786
|
// src/index.ts
|
|
11766
11787
|
var [, , ...args] = process.argv;
|
|
11767
11788
|
var cli = new Cli({
|
|
11768
11789
|
binaryName: "rmr",
|
|
11769
|
-
binaryVersion:
|
|
11790
|
+
binaryVersion: getVersion(),
|
|
11770
11791
|
enableColors: false
|
|
11771
11792
|
});
|
|
11772
11793
|
cli.register(exports_builtins.HelpCommand);
|
|
@@ -11781,7 +11802,7 @@ try {
|
|
|
11781
11802
|
const exitCode = await cli.run(args);
|
|
11782
11803
|
process.exitCode = exitCode;
|
|
11783
11804
|
} catch (error) {
|
|
11784
|
-
if (error instanceof
|
|
11805
|
+
if (error instanceof RmrError) {
|
|
11785
11806
|
logger.error(`${error.code}: ${error.message}`);
|
|
11786
11807
|
process.exitCode = 1;
|
|
11787
11808
|
} else if (error instanceof Error) {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@klaudworks/rex",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@klaudworks/rex",
|
|
9
|
-
"version": "0.4.
|
|
9
|
+
"version": "0.4.4",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"clipanion": "^4.0.0-rc.4",
|
|
12
12
|
"yaml": "^2.8.2"
|