@rulemetric/cli 0.6.5 → 0.6.6
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/chunk-42GFSAJP.js +32 -0
- package/dist/chunk-42GFSAJP.js.map +7 -0
- package/dist/commands/proxy/setup.js +1 -1
- package/dist/commands/proxy/start.js +1 -1
- package/dist/lib/which.js +1 -1
- package/oclif.manifest.json +83 -83
- package/package.json +6 -6
- package/dist/chunk-ERPMDAO3.js +0 -20
- package/dist/chunk-ERPMDAO3.js.map +0 -7
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// src/lib/which.ts
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
import { join, delimiter } from "node:path";
|
|
5
|
+
function wellKnownBinDirs(platform, home) {
|
|
6
|
+
if (platform === "darwin") {
|
|
7
|
+
return ["/opt/homebrew/bin", "/opt/homebrew/sbin", "/usr/local/bin", join(home, ".local/bin")];
|
|
8
|
+
}
|
|
9
|
+
if (platform === "linux") {
|
|
10
|
+
return ["/usr/local/bin", "/usr/bin", join(home, ".local/bin")];
|
|
11
|
+
}
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
function findBinary(name, opts = {}) {
|
|
15
|
+
const platform = opts.platform ?? process.platform;
|
|
16
|
+
const home = opts.home ?? homedir();
|
|
17
|
+
const pathDirs = (opts.pathEnv ?? process.env.PATH ?? "").split(delimiter).filter(Boolean);
|
|
18
|
+
const dirs = [.../* @__PURE__ */ new Set([...pathDirs, ...wellKnownBinDirs(platform, home)])];
|
|
19
|
+
const exts = platform === "win32" ? ["", ...(process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM").split(";").filter(Boolean)] : [""];
|
|
20
|
+
for (const dir of dirs) {
|
|
21
|
+
for (const ext of exts) {
|
|
22
|
+
const candidate = join(dir, name + ext);
|
|
23
|
+
if (existsSync(candidate)) return candidate;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
findBinary
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=chunk-42GFSAJP.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/lib/which.ts"],
|
|
4
|
+
"sourcesContent": ["import { existsSync } from 'node:fs';\nimport { homedir } from 'node:os';\nimport { join, delimiter } from 'node:path';\n\ninterface FindBinaryOptions {\n /** Override the platform (defaults to process.platform). Used in tests. */\n platform?: NodeJS.Platform;\n /** Override $PATH (defaults to process.env.PATH). Used in tests. */\n pathEnv?: string;\n /** Override the home dir (for the well-known-dir fallback). Used in tests. */\n home?: string;\n}\n\n/**\n * Standard install locations to probe IN ADDITION to $PATH \u2014 GUI/agent-launched\n * processes (and Claude Code's minimal-PATH hook shells) often omit these, so a\n * brew/pipx/mitmdump that's plainly installed reads as \"not found\". This is the\n * same minimal-PATH class as the hook-command PATH prefixing (PR #111); here it\n * makes mitmproxy auto-install actually fire on a Mac with Homebrew. Real $PATH\n * entries are searched first, so this only ever ADDS reach, never overrides.\n */\nfunction wellKnownBinDirs(platform: NodeJS.Platform, home: string): string[] {\n if (platform === 'darwin') {\n return ['/opt/homebrew/bin', '/opt/homebrew/sbin', '/usr/local/bin', join(home, '.local/bin')];\n }\n if (platform === 'linux') {\n return ['/usr/local/bin', '/usr/bin', join(home, '.local/bin')];\n }\n return [];\n}\n\n/**\n * Cross-platform executable lookup \u2014 the portable replacement for `which`/`where`.\n *\n * Scans the directories on `$PATH` for an executable named `name`, returning the\n * first full path that exists or `null`. On Windows it also probes the\n * `PATHEXT` extensions (`.EXE`, `.CMD`, ...) so `findBinary('mitmdump')` resolves\n * `mitmdump.exe`. Pure filesystem reads \u2014 no subprocess \u2014 so it works identically\n * on macOS, Linux, and Windows (the old `execSync('which \u2026')` path threw on\n * Windows, which has no `which`, silently breaking mitmproxy detection there).\n */\nexport function findBinary(name: string, opts: FindBinaryOptions = {}): string | null {\n const platform = opts.platform ?? process.platform;\n const home = opts.home ?? homedir();\n const pathDirs = (opts.pathEnv ?? process.env.PATH ?? '').split(delimiter).filter(Boolean);\n // $PATH first (a real entry wins), then the well-known install dirs \u2014 deduped.\n const dirs = [...new Set([...pathDirs, ...wellKnownBinDirs(platform, home)])];\n\n // On Windows, try the bare name first (in case it already carries an extension),\n // then each PATHEXT suffix. Elsewhere, only the bare name is meaningful.\n const exts =\n platform === 'win32'\n ? ['', ...(process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM').split(';').filter(Boolean)]\n : [''];\n\n for (const dir of dirs) {\n for (const ext of exts) {\n const candidate = join(dir, name + ext);\n if (existsSync(candidate)) return candidate;\n }\n }\n return null;\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,MAAM,iBAAiB;AAmBhC,SAAS,iBAAiB,UAA2B,MAAwB;AAC3E,MAAI,aAAa,UAAU;AACzB,WAAO,CAAC,qBAAqB,sBAAsB,kBAAkB,KAAK,MAAM,YAAY,CAAC;AAAA,EAC/F;AACA,MAAI,aAAa,SAAS;AACxB,WAAO,CAAC,kBAAkB,YAAY,KAAK,MAAM,YAAY,CAAC;AAAA,EAChE;AACA,SAAO,CAAC;AACV;AAYO,SAAS,WAAW,MAAc,OAA0B,CAAC,GAAkB;AACpF,QAAM,WAAW,KAAK,YAAY,QAAQ;AAC1C,QAAM,OAAO,KAAK,QAAQ,QAAQ;AAClC,QAAM,YAAY,KAAK,WAAW,QAAQ,IAAI,QAAQ,IAAI,MAAM,SAAS,EAAE,OAAO,OAAO;AAEzF,QAAM,OAAO,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,UAAU,GAAG,iBAAiB,UAAU,IAAI,CAAC,CAAC,CAAC;AAI5E,QAAM,OACJ,aAAa,UACT,CAAC,IAAI,IAAI,QAAQ,IAAI,WAAW,uBAAuB,MAAM,GAAG,EAAE,OAAO,OAAO,CAAC,IACjF,CAAC,EAAE;AAET,aAAW,OAAO,MAAM;AACtB,eAAW,OAAO,MAAM;AACtB,YAAM,YAAY,KAAK,KAAK,OAAO,GAAG;AACtC,UAAI,WAAW,SAAS,EAAG,QAAO;AAAA,IACpC;AAAA,EACF;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/lib/which.js
CHANGED
package/oclif.manifest.json
CHANGED
|
@@ -812,6 +812,88 @@
|
|
|
812
812
|
"recommend.js"
|
|
813
813
|
]
|
|
814
814
|
},
|
|
815
|
+
"crons:list": {
|
|
816
|
+
"aliases": [],
|
|
817
|
+
"args": {},
|
|
818
|
+
"description": "List manually-runnable maintenance tasks",
|
|
819
|
+
"examples": [
|
|
820
|
+
"<%= config.bin %> crons list"
|
|
821
|
+
],
|
|
822
|
+
"flags": {
|
|
823
|
+
"api-url": {
|
|
824
|
+
"description": "Override API base URL",
|
|
825
|
+
"env": "RULEMETRIC_API_URL",
|
|
826
|
+
"hidden": true,
|
|
827
|
+
"name": "api-url",
|
|
828
|
+
"hasDynamicHelp": false,
|
|
829
|
+
"multiple": false,
|
|
830
|
+
"type": "option"
|
|
831
|
+
}
|
|
832
|
+
},
|
|
833
|
+
"hasDynamicHelp": false,
|
|
834
|
+
"hiddenAliases": [],
|
|
835
|
+
"id": "crons:list",
|
|
836
|
+
"pluginAlias": "@rulemetric/cli",
|
|
837
|
+
"pluginName": "@rulemetric/cli",
|
|
838
|
+
"pluginType": "core",
|
|
839
|
+
"strict": true,
|
|
840
|
+
"enableJsonFlag": false,
|
|
841
|
+
"isESM": true,
|
|
842
|
+
"relativePath": [
|
|
843
|
+
"dist",
|
|
844
|
+
"commands",
|
|
845
|
+
"crons",
|
|
846
|
+
"list.js"
|
|
847
|
+
]
|
|
848
|
+
},
|
|
849
|
+
"crons:run": {
|
|
850
|
+
"aliases": [],
|
|
851
|
+
"args": {
|
|
852
|
+
"name": {
|
|
853
|
+
"description": "Task name (run `rulemetric crons list` to see all)",
|
|
854
|
+
"name": "name",
|
|
855
|
+
"required": true
|
|
856
|
+
}
|
|
857
|
+
},
|
|
858
|
+
"description": "Run a maintenance task synchronously, right now",
|
|
859
|
+
"examples": [
|
|
860
|
+
"<%= config.bin %> crons run cron_check_changelog",
|
|
861
|
+
"<%= config.bin %> crons run cron_suggest_instructions --quiet"
|
|
862
|
+
],
|
|
863
|
+
"flags": {
|
|
864
|
+
"api-url": {
|
|
865
|
+
"description": "Override API base URL",
|
|
866
|
+
"env": "RULEMETRIC_API_URL",
|
|
867
|
+
"hidden": true,
|
|
868
|
+
"name": "api-url",
|
|
869
|
+
"hasDynamicHelp": false,
|
|
870
|
+
"multiple": false,
|
|
871
|
+
"type": "option"
|
|
872
|
+
},
|
|
873
|
+
"quiet": {
|
|
874
|
+
"char": "q",
|
|
875
|
+
"description": "Suppress per-line log output; print summary only",
|
|
876
|
+
"name": "quiet",
|
|
877
|
+
"allowNo": false,
|
|
878
|
+
"type": "boolean"
|
|
879
|
+
}
|
|
880
|
+
},
|
|
881
|
+
"hasDynamicHelp": false,
|
|
882
|
+
"hiddenAliases": [],
|
|
883
|
+
"id": "crons:run",
|
|
884
|
+
"pluginAlias": "@rulemetric/cli",
|
|
885
|
+
"pluginName": "@rulemetric/cli",
|
|
886
|
+
"pluginType": "core",
|
|
887
|
+
"strict": true,
|
|
888
|
+
"enableJsonFlag": false,
|
|
889
|
+
"isESM": true,
|
|
890
|
+
"relativePath": [
|
|
891
|
+
"dist",
|
|
892
|
+
"commands",
|
|
893
|
+
"crons",
|
|
894
|
+
"run.js"
|
|
895
|
+
]
|
|
896
|
+
},
|
|
815
897
|
"eval-targets:create": {
|
|
816
898
|
"aliases": [],
|
|
817
899
|
"args": {},
|
|
@@ -2134,88 +2216,6 @@
|
|
|
2134
2216
|
"versions.js"
|
|
2135
2217
|
]
|
|
2136
2218
|
},
|
|
2137
|
-
"crons:list": {
|
|
2138
|
-
"aliases": [],
|
|
2139
|
-
"args": {},
|
|
2140
|
-
"description": "List manually-runnable maintenance tasks",
|
|
2141
|
-
"examples": [
|
|
2142
|
-
"<%= config.bin %> crons list"
|
|
2143
|
-
],
|
|
2144
|
-
"flags": {
|
|
2145
|
-
"api-url": {
|
|
2146
|
-
"description": "Override API base URL",
|
|
2147
|
-
"env": "RULEMETRIC_API_URL",
|
|
2148
|
-
"hidden": true,
|
|
2149
|
-
"name": "api-url",
|
|
2150
|
-
"hasDynamicHelp": false,
|
|
2151
|
-
"multiple": false,
|
|
2152
|
-
"type": "option"
|
|
2153
|
-
}
|
|
2154
|
-
},
|
|
2155
|
-
"hasDynamicHelp": false,
|
|
2156
|
-
"hiddenAliases": [],
|
|
2157
|
-
"id": "crons:list",
|
|
2158
|
-
"pluginAlias": "@rulemetric/cli",
|
|
2159
|
-
"pluginName": "@rulemetric/cli",
|
|
2160
|
-
"pluginType": "core",
|
|
2161
|
-
"strict": true,
|
|
2162
|
-
"enableJsonFlag": false,
|
|
2163
|
-
"isESM": true,
|
|
2164
|
-
"relativePath": [
|
|
2165
|
-
"dist",
|
|
2166
|
-
"commands",
|
|
2167
|
-
"crons",
|
|
2168
|
-
"list.js"
|
|
2169
|
-
]
|
|
2170
|
-
},
|
|
2171
|
-
"crons:run": {
|
|
2172
|
-
"aliases": [],
|
|
2173
|
-
"args": {
|
|
2174
|
-
"name": {
|
|
2175
|
-
"description": "Task name (run `rulemetric crons list` to see all)",
|
|
2176
|
-
"name": "name",
|
|
2177
|
-
"required": true
|
|
2178
|
-
}
|
|
2179
|
-
},
|
|
2180
|
-
"description": "Run a maintenance task synchronously, right now",
|
|
2181
|
-
"examples": [
|
|
2182
|
-
"<%= config.bin %> crons run cron_check_changelog",
|
|
2183
|
-
"<%= config.bin %> crons run cron_suggest_instructions --quiet"
|
|
2184
|
-
],
|
|
2185
|
-
"flags": {
|
|
2186
|
-
"api-url": {
|
|
2187
|
-
"description": "Override API base URL",
|
|
2188
|
-
"env": "RULEMETRIC_API_URL",
|
|
2189
|
-
"hidden": true,
|
|
2190
|
-
"name": "api-url",
|
|
2191
|
-
"hasDynamicHelp": false,
|
|
2192
|
-
"multiple": false,
|
|
2193
|
-
"type": "option"
|
|
2194
|
-
},
|
|
2195
|
-
"quiet": {
|
|
2196
|
-
"char": "q",
|
|
2197
|
-
"description": "Suppress per-line log output; print summary only",
|
|
2198
|
-
"name": "quiet",
|
|
2199
|
-
"allowNo": false,
|
|
2200
|
-
"type": "boolean"
|
|
2201
|
-
}
|
|
2202
|
-
},
|
|
2203
|
-
"hasDynamicHelp": false,
|
|
2204
|
-
"hiddenAliases": [],
|
|
2205
|
-
"id": "crons:run",
|
|
2206
|
-
"pluginAlias": "@rulemetric/cli",
|
|
2207
|
-
"pluginName": "@rulemetric/cli",
|
|
2208
|
-
"pluginType": "core",
|
|
2209
|
-
"strict": true,
|
|
2210
|
-
"enableJsonFlag": false,
|
|
2211
|
-
"isESM": true,
|
|
2212
|
-
"relativePath": [
|
|
2213
|
-
"dist",
|
|
2214
|
-
"commands",
|
|
2215
|
-
"crons",
|
|
2216
|
-
"run.js"
|
|
2217
|
-
]
|
|
2218
|
-
},
|
|
2219
2219
|
"org:current": {
|
|
2220
2220
|
"aliases": [],
|
|
2221
2221
|
"args": {},
|
|
@@ -4066,5 +4066,5 @@
|
|
|
4066
4066
|
]
|
|
4067
4067
|
}
|
|
4068
4068
|
},
|
|
4069
|
-
"version": "0.6.
|
|
4069
|
+
"version": "0.6.6"
|
|
4070
4070
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rulemetric/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
"postgres": "^3.4.0",
|
|
74
74
|
"react": "^19.0.0",
|
|
75
75
|
"zod": "^3.24.0",
|
|
76
|
-
"@rulemetric/hooks": "0.6.
|
|
77
|
-
"@rulemetric/
|
|
78
|
-
"@rulemetric/
|
|
76
|
+
"@rulemetric/hooks": "0.6.6",
|
|
77
|
+
"@rulemetric/skills-registry": "0.6.6",
|
|
78
|
+
"@rulemetric/proxy": "0.6.6"
|
|
79
79
|
},
|
|
80
80
|
"//deps": "Worker (`evals agent`) runtime deps: the @opentelemetry/* set, @sentry/node, and postgres are STATIC top-level imports loaded at worker startup (via bundled @rulemetric/{telemetry,db}) — they MUST be runtime deps or a clean `npm i -g` crashes with ModuleLoadError. `better-sqlite3` is optionalDependencies (below): it's a native module, lazy `require()`'d inside a try/catch (packages/session providers cursor/opencode) so a missing binary degrades gracefully — making it a hard dep would break `npm i -g` on platforms without prebuilt binaries. `resend` stays a devDep: lazy `await import('resend')` guarded by RESEND_API_KEY, which end-user workers never set (provider falls back to noop). Classification verified via import-graph scan of dist/commands/evals/agent.js + per-importer static/lazy check.",
|
|
81
81
|
"optionalDependencies": {
|
|
@@ -93,13 +93,13 @@
|
|
|
93
93
|
"tsx": "^4.19.0",
|
|
94
94
|
"typescript": "^5.9.0",
|
|
95
95
|
"vitest": "^3.2.0",
|
|
96
|
+
"@rulemetric/api": "0.0.1",
|
|
96
97
|
"@rulemetric/core": "0.0.1",
|
|
97
98
|
"@rulemetric/db": "0.0.1",
|
|
98
99
|
"@rulemetric/email": "0.0.1",
|
|
99
100
|
"@rulemetric/session": "0.2.1",
|
|
100
101
|
"@rulemetric/telemetry": "0.0.1",
|
|
101
|
-
"@rulemetric/typescript-config": "0.0.0"
|
|
102
|
-
"@rulemetric/api": "0.0.1"
|
|
102
|
+
"@rulemetric/typescript-config": "0.0.0"
|
|
103
103
|
},
|
|
104
104
|
"scripts": {
|
|
105
105
|
"build": "node scripts/build.mjs",
|
package/dist/chunk-ERPMDAO3.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// src/lib/which.ts
|
|
2
|
-
import { existsSync } from "node:fs";
|
|
3
|
-
import { join, delimiter } from "node:path";
|
|
4
|
-
function findBinary(name, opts = {}) {
|
|
5
|
-
const platform = opts.platform ?? process.platform;
|
|
6
|
-
const dirs = (process.env.PATH || "").split(delimiter).filter(Boolean);
|
|
7
|
-
const exts = platform === "win32" ? ["", ...(process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM").split(";").filter(Boolean)] : [""];
|
|
8
|
-
for (const dir of dirs) {
|
|
9
|
-
for (const ext of exts) {
|
|
10
|
-
const candidate = join(dir, name + ext);
|
|
11
|
-
if (existsSync(candidate)) return candidate;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
findBinary
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=chunk-ERPMDAO3.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/lib/which.ts"],
|
|
4
|
-
"sourcesContent": ["import { existsSync } from 'node:fs';\nimport { join, delimiter } from 'node:path';\n\ninterface FindBinaryOptions {\n /** Override the platform (defaults to process.platform). Used in tests. */\n platform?: NodeJS.Platform;\n}\n\n/**\n * Cross-platform executable lookup \u2014 the portable replacement for `which`/`where`.\n *\n * Scans the directories on `$PATH` for an executable named `name`, returning the\n * first full path that exists or `null`. On Windows it also probes the\n * `PATHEXT` extensions (`.EXE`, `.CMD`, ...) so `findBinary('mitmdump')` resolves\n * `mitmdump.exe`. Pure filesystem reads \u2014 no subprocess \u2014 so it works identically\n * on macOS, Linux, and Windows (the old `execSync('which \u2026')` path threw on\n * Windows, which has no `which`, silently breaking mitmproxy detection there).\n */\nexport function findBinary(name: string, opts: FindBinaryOptions = {}): string | null {\n const platform = opts.platform ?? process.platform;\n const dirs = (process.env.PATH || '').split(delimiter).filter(Boolean);\n\n // On Windows, try the bare name first (in case it already carries an extension),\n // then each PATHEXT suffix. Elsewhere, only the bare name is meaningful.\n const exts =\n platform === 'win32'\n ? ['', ...(process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM').split(';').filter(Boolean)]\n : [''];\n\n for (const dir of dirs) {\n for (const ext of exts) {\n const candidate = join(dir, name + ext);\n if (existsSync(candidate)) return candidate;\n }\n }\n return null;\n}\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,kBAAkB;AAC3B,SAAS,MAAM,iBAAiB;AAiBzB,SAAS,WAAW,MAAc,OAA0B,CAAC,GAAkB;AACpF,QAAM,WAAW,KAAK,YAAY,QAAQ;AAC1C,QAAM,QAAQ,QAAQ,IAAI,QAAQ,IAAI,MAAM,SAAS,EAAE,OAAO,OAAO;AAIrE,QAAM,OACJ,aAAa,UACT,CAAC,IAAI,IAAI,QAAQ,IAAI,WAAW,uBAAuB,MAAM,GAAG,EAAE,OAAO,OAAO,CAAC,IACjF,CAAC,EAAE;AAET,aAAW,OAAO,MAAM;AACtB,eAAW,OAAO,MAAM;AACtB,YAAM,YAAY,KAAK,KAAK,OAAO,GAAG;AACtC,UAAI,WAAW,SAAS,EAAG,QAAO;AAAA,IACpC;AAAA,EACF;AACA,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|