@rulemetric/cli 0.5.2 → 0.5.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/bin/dev.js +7 -0
- package/dist/base-command.js +4 -4
- package/dist/{chunk-7DRLX3DN.js → chunk-3POYC5NA.js} +3 -3
- package/dist/{chunk-TJ2M5QVL.js → chunk-3QH73QOQ.js} +2 -2
- package/dist/{chunk-AOIY5RT6.js → chunk-4LHEN2FS.js} +17 -17
- package/dist/{chunk-LJ5OT5XN.js → chunk-7K4ILWS7.js} +6 -6
- package/dist/{chunk-5ZOLDIZQ.js → chunk-BCIUSUEV.js} +5 -5
- package/dist/{chunk-TDTHAOXO.js → chunk-DR5WLIOU.js} +2 -2
- package/dist/{chunk-K3BFZ7KG.js → chunk-E3BIT53W.js} +1 -1
- package/dist/chunk-E3BIT53W.js.map +7 -0
- package/dist/{chunk-4QGATD5Y.js → chunk-F5N6CLJJ.js} +1 -1
- package/dist/{chunk-4QGATD5Y.js.map → chunk-F5N6CLJJ.js.map} +2 -2
- package/dist/{chunk-7XDWLJJP.js → chunk-H3C6EGR2.js} +5 -5
- package/dist/{chunk-PHIAFGQ2.js → chunk-IATQXFJA.js} +7 -7
- package/dist/{chunk-IVOCDHWA.js → chunk-IPOO4IGF.js} +3 -3
- package/dist/{chunk-AUUHXCJU.js → chunk-JEJ3J5J6.js} +2 -2
- package/dist/{chunk-OAQG5WBV.js → chunk-LAKZUE35.js} +2 -2
- package/dist/{chunk-346TGPVR.js → chunk-LTT2YMYY.js} +2 -2
- package/dist/{chunk-CCSR73HF.js → chunk-N5A2IQAK.js} +2 -2
- package/dist/{chunk-IKEI4KNV.js → chunk-OTOWLUOJ.js} +4 -4
- package/dist/{chunk-YQFCUKNI.js → chunk-QNSVCSHG.js} +373 -414
- package/dist/chunk-QNSVCSHG.js.map +7 -0
- package/dist/{chunk-OKCFYPIQ.js → chunk-RCMXTLQF.js} +2 -2
- package/dist/{chunk-CGUV6TUA.js → chunk-RUCSRN7F.js} +2 -2
- package/dist/{chunk-4UJATBTG.js → chunk-SLL3OBKN.js} +4 -4
- package/dist/{chunk-CB43W53J.js → chunk-SZ7VDCD6.js} +3 -3
- package/dist/{chunk-N52AHNBH.js → chunk-W4MZXKZ2.js} +6 -2
- package/dist/chunk-W4MZXKZ2.js.map +7 -0
- package/dist/{chunk-DUR54APY.js → chunk-WLFX4PYR.js} +6 -6
- package/dist/{chunk-FUS5C4SB.js → chunk-Y4BJXXYV.js} +2 -2
- package/dist/{chunk-KHJUQFIK.js → chunk-YSEQWCN4.js} +2 -2
- package/dist/{chunk-CWFVBGX2.js → chunk-ZRLYHBPN.js} +4 -2
- package/dist/chunk-ZRLYHBPN.js.map +7 -0
- package/dist/{chunk-46LMTDRE.js → chunk-ZSGKRCKD.js} +7 -4
- package/dist/chunk-ZSGKRCKD.js.map +7 -0
- package/dist/commands/antigravity/backfill.js +5 -5
- package/dist/commands/auth/create-key.js +7 -5
- package/dist/commands/auth/create-key.js.map +2 -2
- package/dist/commands/auth/login.js +4 -4
- package/dist/commands/auth/logout.js +4 -4
- package/dist/commands/auth/revoke-key.js +4 -4
- package/dist/commands/auth/status.js +4 -4
- package/dist/commands/catalog/index.js +4 -4
- package/dist/commands/catalog/recommend.js +4 -4
- package/dist/commands/convert.js +6 -5
- package/dist/commands/convert.js.map +2 -2
- package/dist/commands/converters.js +4 -4
- package/dist/commands/crons/list.js +4 -4
- package/dist/commands/crons/run.js +4 -4
- package/dist/commands/dashboard.js +4 -4
- package/dist/commands/eval-targets/create.js +4 -4
- package/dist/commands/eval-targets/list.js +4 -4
- package/dist/commands/evals/agent.js +25 -28
- package/dist/commands/evals/agent.js.map +4 -4
- package/dist/commands/evals/benchmark.js +5 -5
- package/dist/commands/evals/compare.js +4 -4
- package/dist/commands/evals/create.js +4 -4
- package/dist/commands/evals/optimize-description.js +4 -4
- package/dist/commands/evals/optimize.js +4 -4
- package/dist/commands/evals/run.js +4 -4
- package/dist/commands/gateway/ensure.js +4 -4
- package/dist/commands/hooks/install.js +4 -4
- package/dist/commands/hooks/run.js +4 -4
- package/dist/commands/hooks/uninstall.js +4 -4
- package/dist/commands/import.js +4 -4
- package/dist/commands/instructions/create.js +4 -4
- package/dist/commands/instructions/delete.js +4 -4
- package/dist/commands/instructions/fork.js +4 -4
- package/dist/commands/instructions/get.js +4 -4
- package/dist/commands/instructions/list.js +4 -4
- package/dist/commands/instructions/promote.js +4 -4
- package/dist/commands/instructions/pull.js +4 -4
- package/dist/commands/instructions/upstream.js +4 -4
- package/dist/commands/instructions/versions.js +4 -4
- package/dist/commands/launcher.js +4 -4
- package/dist/commands/org/current.js +9 -9
- package/dist/commands/org/list.js +6 -6
- package/dist/commands/org/switch.js +7 -7
- package/dist/commands/packs/add-instruction.js +4 -4
- package/dist/commands/packs/apply.js +4 -4
- package/dist/commands/packs/create.js +4 -4
- package/dist/commands/packs/fork.js +4 -4
- package/dist/commands/packs/get.js +4 -4
- package/dist/commands/packs/list.js +4 -4
- package/dist/commands/packs/remove-instruction.js +4 -4
- package/dist/commands/proxy/env.js +4 -4
- package/dist/commands/proxy/logs.js +4 -4
- package/dist/commands/proxy/restart.js +4 -4
- package/dist/commands/proxy/setup.js +4 -4
- package/dist/commands/proxy/start.js +4 -4
- package/dist/commands/proxy/status.js +4 -4
- package/dist/commands/proxy/stop.js +4 -4
- package/dist/commands/research/backfill.js +7 -7
- package/dist/commands/research/tail-transcript.js +7 -7
- package/dist/commands/service/install.js +9 -4
- package/dist/commands/service/install.js.map +2 -2
- package/dist/commands/service/status.js +4 -4
- package/dist/commands/service/uninstall.js +4 -4
- package/dist/commands/sessions/analyze.js +4 -4
- package/dist/commands/sessions/end.js +4 -4
- package/dist/commands/sessions/import.js +4 -4
- package/dist/commands/sessions/list.js +4 -4
- package/dist/commands/sessions/start.js +6 -6
- package/dist/commands/setup.js +5 -5
- package/dist/commands/skills/export-approved.js +4 -4
- package/dist/commands/skills/install.js +4 -4
- package/dist/commands/skills/list.js +4 -4
- package/dist/commands/skills/publish.js +4 -4
- package/dist/commands/skills/search.js +4 -4
- package/dist/commands/skills/update.js +4 -4
- package/dist/commands/suggestions/accept.js +4 -4
- package/dist/commands/suggestions/dismiss.js +4 -4
- package/dist/commands/suggestions/list.js +4 -4
- package/dist/commands/suggestions/refresh.js +4 -4
- package/dist/dashboard/Dashboard.js +17 -15
- package/dist/dashboard/Dashboard.js.map +1 -1
- package/dist/dashboard/data.js +4 -2
- package/dist/dashboard/launcher/LauncherOverlay.js +6 -4
- package/dist/dashboard/launcher/api.js +3 -1
- package/dist/dashboard/launcher/useLaunchJobs.js +4 -2
- package/dist/{dist-NEECHU47.js → dist-UNYP5PJR.js} +2 -2
- package/dist/lib/active-org-refresh.js +3 -3
- package/dist/lib/agent-loop.js +19 -19
- package/dist/lib/antigravity-transcript.js +2 -2
- package/dist/lib/api-client.js +3 -1
- package/dist/lib/eval-benchmark.js +2 -2
- package/dist/lib/eval-conversation-handler.js +2 -2
- package/dist/lib/handlers/cron-suggest-instructions.js +4 -4
- package/dist/lib/handlers/process-announcement.js +3 -3
- package/dist/lib/handlers/process-changelog.js +3 -3
- package/dist/lib/handlers/process-conversation.js +3 -3
- package/dist/lib/handlers/process-eval.js +2 -2
- package/dist/lib/handlers/process-insights.js +2 -2
- package/dist/lib/handlers/process-launch.js +4 -4
- package/dist/lib/handlers/process-run-cleanup.js +4 -4
- package/dist/lib/handlers/process-session-goal.js +2 -2
- package/dist/lib/manual-tasks.js +7 -7
- package/dist/lib/research-client.js +2 -2
- package/dist/lib/setup-steps.js +2 -2
- package/dist/lib/terminal-target-heartbeat.js +2 -2
- package/dist/lib/worktree.js +2 -2
- package/oclif.manifest.json +1 -40
- package/package.json +7 -7
- package/dist/chunk-46LMTDRE.js.map +0 -7
- package/dist/chunk-CWFVBGX2.js.map +0 -7
- package/dist/chunk-K3BFZ7KG.js.map +0 -7
- package/dist/chunk-N52AHNBH.js.map +0 -7
- package/dist/chunk-YQFCUKNI.js.map +0 -7
- package/dist/commands/signals/report.js +0 -43
- package/dist/commands/signals/report.js.map +0 -7
- package/dist/lib/handlers/cron-close-stale-sessions.js +0 -19
- package/dist/lib/handlers/cron-close-stale-sessions.js.map +0 -7
- package/dist/lib/handlers/cron-data-integrity-audit.js +0 -22
- package/dist/lib/handlers/cron-data-integrity-audit.js.map +0 -7
- package/dist/lib/provider-aggregator.js +0 -59
- package/dist/lib/provider-aggregator.js.map +0 -7
- /package/dist/{chunk-7DRLX3DN.js.map → chunk-3POYC5NA.js.map} +0 -0
- /package/dist/{chunk-TJ2M5QVL.js.map → chunk-3QH73QOQ.js.map} +0 -0
- /package/dist/{chunk-AOIY5RT6.js.map → chunk-4LHEN2FS.js.map} +0 -0
- /package/dist/{chunk-LJ5OT5XN.js.map → chunk-7K4ILWS7.js.map} +0 -0
- /package/dist/{chunk-5ZOLDIZQ.js.map → chunk-BCIUSUEV.js.map} +0 -0
- /package/dist/{chunk-TDTHAOXO.js.map → chunk-DR5WLIOU.js.map} +0 -0
- /package/dist/{chunk-7XDWLJJP.js.map → chunk-H3C6EGR2.js.map} +0 -0
- /package/dist/{chunk-PHIAFGQ2.js.map → chunk-IATQXFJA.js.map} +0 -0
- /package/dist/{chunk-IVOCDHWA.js.map → chunk-IPOO4IGF.js.map} +0 -0
- /package/dist/{chunk-AUUHXCJU.js.map → chunk-JEJ3J5J6.js.map} +0 -0
- /package/dist/{chunk-OAQG5WBV.js.map → chunk-LAKZUE35.js.map} +0 -0
- /package/dist/{chunk-346TGPVR.js.map → chunk-LTT2YMYY.js.map} +0 -0
- /package/dist/{chunk-CCSR73HF.js.map → chunk-N5A2IQAK.js.map} +0 -0
- /package/dist/{chunk-IKEI4KNV.js.map → chunk-OTOWLUOJ.js.map} +0 -0
- /package/dist/{chunk-OKCFYPIQ.js.map → chunk-RCMXTLQF.js.map} +0 -0
- /package/dist/{chunk-CGUV6TUA.js.map → chunk-RUCSRN7F.js.map} +0 -0
- /package/dist/{chunk-4UJATBTG.js.map → chunk-SLL3OBKN.js.map} +0 -0
- /package/dist/{chunk-CB43W53J.js.map → chunk-SZ7VDCD6.js.map} +0 -0
- /package/dist/{chunk-DUR54APY.js.map → chunk-WLFX4PYR.js.map} +0 -0
- /package/dist/{chunk-FUS5C4SB.js.map → chunk-Y4BJXXYV.js.map} +0 -0
- /package/dist/{chunk-KHJUQFIK.js.map → chunk-YSEQWCN4.js.map} +0 -0
- /package/dist/{dist-NEECHU47.js.map → dist-UNYP5PJR.js.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/lib/api-client.ts"],
|
|
4
|
+
"sourcesContent": ["import { fileURLToPath } from 'node:url';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { loadToken, loadEnvFileAuth } from './auth.js';\n\n/**\n * Read the CLI's own version. Walks up from this module's location to find\n * `@rulemetric/cli`'s package.json \u2014 robust whether running unbundled from\n * `src/lib/` (dev) or from a bundled chunk at a different `dist/` depth (prod),\n * where a fixed relative `../../package.json` would resolve to the wrong file.\n */\nfunction readCliVersion(): string {\n let dir = dirname(fileURLToPath(import.meta.url));\n for (let i = 0; i < 8; i++) {\n const pj = join(dir, 'package.json');\n if (existsSync(pj)) {\n try {\n const parsed = JSON.parse(readFileSync(pj, 'utf8')) as { name?: string; version?: string };\n if (parsed.name === '@rulemetric/cli' && parsed.version) return parsed.version;\n } catch {\n /* unreadable/parse error \u2014 keep walking up */\n }\n }\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n return '0.0.0';\n}\n\nconst version = readCliVersion();\n\n/**\n * Default API base URL for the CLI. Points at PRODUCTION so a fresh `npm i -g\n * @rulemetric/cli` (no config, no env vars) can `auth login` out of the box.\n * Dev opts into localhost by setting `RULEMETRIC_API_URL` \u2014 `bin/dev.js` sets\n * it to `http://localhost:3000` automatically, and `scripts/start.sh` exports\n * it for the launchd services.\n */\nexport const DEFAULT_API_URL = 'https://rulemetric.com';\n\nexport class ApiError extends Error {\n constructor(\n public statusCode: number,\n message: string,\n ) {\n super(message);\n this.name = 'ApiError';\n }\n}\n\ninterface ApiOptions {\n method?: string;\n body?: unknown;\n headers?: Record<string, string>;\n}\n\nfunction getBaseUrl(): string {\n // Additive fallback to the env file's URL so a key/token read from that same\n // file (see the auth header below) is sent to the SERVER it belongs to,\n // not the localhost default.\n const url = process.env.RULEMETRIC_API_URL ?? loadEnvFileAuth().apiUrl ?? DEFAULT_API_URL;\n\n // Enforce HTTPS for non-localhost URLs\n const parsed = new URL(url);\n if (parsed.protocol === 'http:' && parsed.hostname !== 'localhost' && parsed.hostname !== '127.0.0.1') {\n throw new Error(`API URL must use HTTPS for non-localhost hosts: ${url}`);\n }\n\n return url;\n}\n\nexport async function api<T>(path: string, options: ApiOptions = {}): Promise<T> {\n const baseUrl = getBaseUrl();\n const url = `${baseUrl}${path}`;\n\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n 'User-Agent': `rulemetric-cli/${version}`,\n ...options.headers,\n };\n\n // Auth header resolution, first match wins:\n // 1. process.env.RULEMETRIC_API_KEY \u2014 exported long-lived key\n // 2. env-file RULEMETRIC_API_KEY \u2014 long-lived key on disk (create-key)\n // 3. auth.json OAuth accessToken \u2014 fresh right after `auth login`\n // 4. env-file RULEMETRIC_ACCESS_TOKEN \u2014 token persisted by login\n // The long-lived API key is preferred over the OAuth token because the latter\n // EXPIRES \u2014 auth.json can hold a stale token, so trying it first would 401\n // (\"Session expired\") even when a valid key sits right there in the env file.\n const envAuth = loadEnvFileAuth();\n const bearer =\n process.env.RULEMETRIC_API_KEY ||\n envAuth.apiKey ||\n loadToken()?.accessToken ||\n envAuth.accessToken;\n if (bearer) {\n headers['Authorization'] = `Bearer ${bearer}`;\n }\n\n // Bypass proxy for localhost API calls \u2014 HTTPS_PROXY is for Claude Code \u2192 Anthropic,\n // not for CLI \u2192 local API. Node.js fetch doesn't respect NO_PROXY reliably, so we\n // temporarily unset the proxy env vars for localhost calls.\n const parsed = new URL(url);\n const isLocalhost = parsed.hostname === 'localhost' || parsed.hostname === '127.0.0.1';\n const savedProxy = process.env.HTTPS_PROXY;\n const savedHttpProxy = process.env.HTTP_PROXY;\n if (isLocalhost) {\n delete process.env.HTTPS_PROXY;\n delete process.env.HTTP_PROXY;\n }\n\n let response: Response;\n try {\n response = await fetch(url, {\n method: options.method ?? 'GET',\n headers,\n body: options.body ? JSON.stringify(options.body) : undefined,\n });\n } finally {\n // Restore proxy vars so claude -p calls still route through the proxy\n if (isLocalhost) {\n if (savedProxy !== undefined) process.env.HTTPS_PROXY = savedProxy;\n if (savedHttpProxy !== undefined) process.env.HTTP_PROXY = savedHttpProxy;\n }\n }\n\n let responseBody: unknown;\n const contentType = response.headers.get('content-type');\n if (contentType?.includes('application/json')) {\n responseBody = await response.json();\n } else {\n responseBody = await response.text();\n }\n\n if (!response.ok) {\n // Extract only the error message, not the full response body\n const message =\n responseBody && typeof responseBody === 'object' && 'error' in responseBody\n ? String((responseBody as { error: string }).error)\n : `HTTP ${response.status}`;\n throw new ApiError(response.status, message);\n }\n\n return responseBody as T;\n}\n\nexport const apiGet = <T>(path: string): Promise<T> => api<T>(path);\nexport const apiPost = <T>(path: string, body: unknown): Promise<T> => api<T>(path, { method: 'POST', body });\nexport const apiPut = <T>(path: string, body: unknown): Promise<T> => api<T>(path, { method: 'PUT', body });\nexport const apiPatch = <T>(path: string, body: unknown): Promise<T> => api<T>(path, { method: 'PATCH', body });\nexport const apiDelete = <T>(path: string): Promise<T> => api<T>(path, { method: 'DELETE' });\n"],
|
|
5
|
+
"mappings": ";;;;;;AAAA,SAAS,qBAAqB;AAC9B,SAAS,YAAY,oBAAoB;AACzC,SAAS,SAAS,YAAY;AAS9B,SAAS,iBAAyB;AAChC,MAAI,MAAM,QAAQ,cAAc,YAAY,GAAG,CAAC;AAChD,WAAS,IAAI,GAAG,IAAI,GAAG,KAAK;AAC1B,UAAM,KAAK,KAAK,KAAK,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+1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ClaudeCodeAdapter,
|
|
3
3
|
discoverAllSessions
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-F5N6CLJJ.js";
|
|
5
|
+
import {
|
|
6
|
+
DEFAULT_API_URL
|
|
7
|
+
} from "./chunk-ZRLYHBPN.js";
|
|
5
8
|
|
|
6
9
|
// src/dashboard/data.ts
|
|
7
10
|
import * as fs from "node:fs";
|
|
@@ -77,7 +80,7 @@ async function loadLocalStats(providerFilter) {
|
|
|
77
80
|
return stats;
|
|
78
81
|
}
|
|
79
82
|
async function loadApiInsights(projectPath) {
|
|
80
|
-
const apiUrl = process.env.RULEMETRIC_API_URL ??
|
|
83
|
+
const apiUrl = process.env.RULEMETRIC_API_URL ?? DEFAULT_API_URL;
|
|
81
84
|
const apiKey = process.env.RULEMETRIC_API_KEY;
|
|
82
85
|
const accessToken = process.env.RULEMETRIC_ACCESS_TOKEN;
|
|
83
86
|
const token = apiKey ?? accessToken;
|
|
@@ -96,7 +99,7 @@ async function loadApiInsights(projectPath) {
|
|
|
96
99
|
}
|
|
97
100
|
}
|
|
98
101
|
async function loadLinkedInstructions(projectPath) {
|
|
99
|
-
const apiUrl = process.env.RULEMETRIC_API_URL ??
|
|
102
|
+
const apiUrl = process.env.RULEMETRIC_API_URL ?? DEFAULT_API_URL;
|
|
100
103
|
const token = process.env.RULEMETRIC_API_KEY ?? process.env.RULEMETRIC_ACCESS_TOKEN;
|
|
101
104
|
if (!token) return null;
|
|
102
105
|
const params = new URLSearchParams();
|
|
@@ -118,4 +121,4 @@ export {
|
|
|
118
121
|
loadApiInsights,
|
|
119
122
|
loadLinkedInstructions
|
|
120
123
|
};
|
|
121
|
-
//# sourceMappingURL=chunk-
|
|
124
|
+
//# sourceMappingURL=chunk-ZSGKRCKD.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/dashboard/data.ts"],
|
|
4
|
+
"sourcesContent": ["import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport * as os from 'node:os';\nimport { discoverAllSessions, ClaudeCodeAdapter } from '@rulemetric/session';\nimport { DEFAULT_API_URL } from '../lib/api-client.js';\nimport type { LocalStats, ApiInsights } from './types.js';\n\n/** Load auth config from env vars \u2192 ~/.config/rulemetric/env \u2192 .env.local */\nfunction ensureEnv(): void {\n if (process.env.RULEMETRIC_API_KEY || process.env.RULEMETRIC_ACCESS_TOKEN) return;\n\n // Try ~/.config/rulemetric/env\n const globalEnv = path.join(os.homedir(), '.config', 'rulemetric', 'env');\n if (loadEnvFile(globalEnv)) return;\n\n // Try .env.local in cwd\n loadEnvFile(path.join(process.cwd(), '.env.local'));\n}\n\nfunction loadEnvFile(filePath: string): boolean {\n try {\n const content = fs.readFileSync(filePath, 'utf-8');\n for (const line of content.split('\\n')) {\n const trimmed = line.trim();\n if (!trimmed || trimmed.startsWith('#')) continue;\n const eqIdx = trimmed.indexOf('=');\n if (eqIdx < 0) continue;\n const key = trimmed.slice(0, eqIdx).trim();\n const value = trimmed.slice(eqIdx + 1).trim();\n if (!process.env[key]) {\n process.env[key] = value;\n }\n }\n return !!(process.env.RULEMETRIC_API_KEY || process.env.RULEMETRIC_ACCESS_TOKEN);\n } catch {\n return false;\n }\n}\n\n// Load on import\nensureEnv();\n\n/** Read local JSONL files and compute basic stats. */\nexport async function loadLocalStats(providerFilter?: string): Promise<LocalStats> {\n const stats: LocalStats = {\n totalSessions: 0,\n totalCalls: 0,\n totalInputTokens: 0,\n totalOutputTokens: 0,\n totalCacheReadTokens: 0,\n totalCacheWriteTokens: 0,\n totalCostUSD: 0,\n providers: {},\n };\n\n const sources = await discoverAllSessions(providerFilter);\n stats.providers = {};\n for (const s of sources) {\n stats.providers[s.provider] = (stats.providers[s.provider] || 0) + 1;\n }\n\n // Parse Claude Code sessions from local JSONL files\n const adapter = new ClaudeCodeAdapter();\n const claudeSources = sources.filter(s => s.provider === 'claude');\n\n for (const source of claudeSources) {\n try {\n const files = fs.readdirSync(source.path).filter(f => f.endsWith('.jsonl'));\n stats.totalSessions += files.length;\n\n for (const file of files) {\n const content = fs.readFileSync(path.join(source.path, file), 'utf-8');\n const parsed = adapter.parse(content);\n\n for (const event of parsed.events) {\n if (event.tokenUsage) {\n stats.totalCalls++;\n stats.totalInputTokens += event.tokenUsage.input;\n stats.totalOutputTokens += event.tokenUsage.output;\n stats.totalCacheReadTokens += event.tokenUsage.cacheRead ?? 0;\n stats.totalCacheWriteTokens += event.tokenUsage.cacheWrite ?? 0;\n }\n }\n }\n } catch {\n // Skip unreadable directories\n }\n }\n\n // Estimate cost (Opus pricing as default)\n const inputCostPerM = 15;\n const outputCostPerM = 75;\n stats.totalCostUSD = Math.round((\n (stats.totalInputTokens / 1_000_000) * inputCostPerM +\n (stats.totalOutputTokens / 1_000_000) * outputCostPerM +\n (stats.totalCacheReadTokens / 1_000_000) * (inputCostPerM * 0.1) +\n (stats.totalCacheWriteTokens / 1_000_000) * (inputCostPerM * 1.25)\n ) * 100) / 100;\n\n return stats;\n}\n\n/** Fetch enriched insights from the API. Returns null if API is unreachable. */\nexport async function loadApiInsights(projectPath?: string): Promise<ApiInsights | null> {\n const apiUrl = process.env.RULEMETRIC_API_URL ?? DEFAULT_API_URL;\n const apiKey = process.env.RULEMETRIC_API_KEY;\n const accessToken = process.env.RULEMETRIC_ACCESS_TOKEN;\n const token = apiKey ?? accessToken;\n if (!token) return null;\n\n const params = new URLSearchParams();\n if (projectPath) params.set('projectPath', projectPath);\n\n try {\n const resp = await fetch(`${apiUrl}/api/insights/compute?${params}`, {\n headers: { Authorization: `Bearer ${token}` },\n signal: AbortSignal.timeout(5000),\n });\n if (!resp.ok) return null;\n return await resp.json() as ApiInsights;\n } catch {\n return null;\n }\n}\n\n/** Fetch linked instructions from the API. */\nexport async function loadLinkedInstructions(projectPath?: string): Promise<Array<{ name: string; linkedSessions: number }> | null> {\n const apiUrl = process.env.RULEMETRIC_API_URL ?? DEFAULT_API_URL;\n const token = process.env.RULEMETRIC_API_KEY ?? process.env.RULEMETRIC_ACCESS_TOKEN;\n if (!token) return null;\n\n const params = new URLSearchParams();\n if (projectPath) params.set('projectPath', projectPath);\n\n try {\n const resp = await fetch(`${apiUrl}/api/insights/linked-instructions?${params}`, {\n headers: { Authorization: `Bearer ${token}` },\n signal: AbortSignal.timeout(5000),\n });\n if (!resp.ok) return null;\n return await resp.json() as Array<{ name: string; linkedSessions: number }>;\n } catch {\n return null;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAAA,YAAY,QAAQ;AACpB,YAAY,UAAU;AACtB,YAAY,QAAQ;AAMpB,SAAS,YAAkB;AACzB,MAAI,QAAQ,IAAI,sBAAsB,QAAQ,IAAI,wBAAyB;AAG3E,QAAM,YAAiB,UAAQ,WAAQ,GAAG,WAAW,cAAc,KAAK;AACxE,MAAI,YAAY,SAAS,EAAG;AAG5B,cAAiB,UAAK,QAAQ,IAAI,GAAG,YAAY,CAAC;AACpD;AAEA,SAAS,YAAY,UAA2B;AAC9C,MAAI;AACF,UAAM,UAAa,gBAAa,UAAU,OAAO;AACjD,eAAW,QAAQ,QAAQ,MAAM,IAAI,GAAG;AACtC,YAAM,UAAU,KAAK,KAAK;AAC1B,UAAI,CAAC,WAAW,QAAQ,WAAW,GAAG,EAAG;AACzC,YAAM,QAAQ,QAAQ,QAAQ,GAAG;AACjC,UAAI,QAAQ,EAAG;AACf,YAAM,MAAM,QAAQ,MAAM,GAAG,KAAK,EAAE,KAAK;AACzC,YAAM,QAAQ,QAAQ,MAAM,QAAQ,CAAC,EAAE,KAAK;AAC5C,UAAI,CAAC,QAAQ,IAAI,GAAG,GAAG;AACrB,gBAAQ,IAAI,GAAG,IAAI;AAAA,MACrB;AAAA,IACF;AACA,WAAO,CAAC,EAAE,QAAQ,IAAI,sBAAsB,QAAQ,IAAI;AAAA,EAC1D,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAGA,UAAU;A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5
5
|
stateApi
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-RUCSRN7F.js";
|
|
7
7
|
import {
|
|
8
8
|
BaseCommand
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-SZ7VDCD6.js";
|
|
10
10
|
import "../../chunk-R56PH7YE.js";
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-CWFVBGX2.js";
|
|
13
|
-
import "../../chunk-W2YERO7E.js";
|
|
11
|
+
import "../../chunk-SLL3OBKN.js";
|
|
14
12
|
import "../../chunk-EKJ2CABV.js";
|
|
13
|
+
import "../../chunk-ZRLYHBPN.js";
|
|
14
|
+
import "../../chunk-W2YERO7E.js";
|
|
15
15
|
import "../../chunk-NSBPE2FW.js";
|
|
16
16
|
|
|
17
17
|
// src/commands/antigravity/backfill.ts
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-SZ7VDCD6.js";
|
|
4
4
|
import "../../chunk-R56PH7YE.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-SLL3OBKN.js";
|
|
6
|
+
import "../../chunk-EKJ2CABV.js";
|
|
6
7
|
import {
|
|
7
8
|
apiPost
|
|
8
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-ZRLYHBPN.js";
|
|
9
10
|
import {
|
|
11
|
+
getDefaultConfigDir,
|
|
10
12
|
saveApiKey
|
|
11
13
|
} from "../../chunk-W2YERO7E.js";
|
|
12
|
-
import "../../chunk-EKJ2CABV.js";
|
|
13
14
|
import "../../chunk-NSBPE2FW.js";
|
|
14
15
|
|
|
15
16
|
// src/commands/auth/create-key.ts
|
|
17
|
+
import * as path from "node:path";
|
|
16
18
|
import { Flags } from "@oclif/core";
|
|
17
19
|
var AuthCreateKey = class _AuthCreateKey extends BaseCommand {
|
|
18
20
|
static description = "Create a long-lived API key for CLI and proxy authentication";
|
|
@@ -38,7 +40,7 @@ var AuthCreateKey = class _AuthCreateKey extends BaseCommand {
|
|
|
38
40
|
if (flags.save) {
|
|
39
41
|
saveApiKey(data.key, process.env.RULEMETRIC_API_URL);
|
|
40
42
|
this.log("");
|
|
41
|
-
this.log(
|
|
43
|
+
this.log(`Key saved to ${path.join(getDefaultConfigDir(), "env")} (RULEMETRIC_API_KEY)`);
|
|
42
44
|
this.log("Hooks and proxy will use this key automatically.");
|
|
43
45
|
}
|
|
44
46
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/commands/auth/create-key.ts"],
|
|
4
|
-
"sourcesContent": ["import { Flags } from '@oclif/core';\nimport { BaseCommand } from '../../base-command.js';\nimport { apiPost } from '../../lib/api-client.js';\nimport { saveApiKey } from '../../lib/auth.js';\n\ninterface CreateKeyResponse {\n id: string;\n name: string;\n key: string;\n keyPrefix: string;\n createdAt: string;\n}\n\nexport default class AuthCreateKey extends BaseCommand {\n static override description = 'Create a long-lived API key for CLI and proxy authentication';\n\n static override examples = [\n '<%= config.bin %> auth create-key --name \"laptop\"',\n '<%= config.bin %> auth create-key --name \"work proxy\" --save',\n ];\n\n static override flags = {\n name: Flags.string({ char: 'n', description: 'Name for this key', required: true }),\n save: Flags.boolean({ char: 's', description: 'Save key to ~/.config/rulemetric/env for hooks/proxy', default: true }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(AuthCreateKey);\n\n const data = await apiPost<CreateKeyResponse>('/api/auth/api-keys', { name: flags.name });\n\n this.log('');\n this.log('API key created successfully:');\n this.log('');\n this.log(` Name: ${data.name}`);\n this.log(` Key: ${data.key}`);\n this.log(` Prefix: ${data.keyPrefix}`);\n this.log('');\n this.warn('Save this key now \u2014 it will not be shown again.');\n\n if (flags.save) {\n saveApiKey(data.key, process.env.RULEMETRIC_API_URL);\n this.log('');\n this.log(
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import * as path from 'node:path';\nimport { Flags } from '@oclif/core';\nimport { BaseCommand } from '../../base-command.js';\nimport { apiPost } from '../../lib/api-client.js';\nimport { saveApiKey, getDefaultConfigDir } from '../../lib/auth.js';\n\ninterface CreateKeyResponse {\n id: string;\n name: string;\n key: string;\n keyPrefix: string;\n createdAt: string;\n}\n\nexport default class AuthCreateKey extends BaseCommand {\n static override description = 'Create a long-lived API key for CLI and proxy authentication';\n\n static override examples = [\n '<%= config.bin %> auth create-key --name \"laptop\"',\n '<%= config.bin %> auth create-key --name \"work proxy\" --save',\n ];\n\n static override flags = {\n name: Flags.string({ char: 'n', description: 'Name for this key', required: true }),\n save: Flags.boolean({ char: 's', description: 'Save key to ~/.config/rulemetric/env for hooks/proxy', default: true }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(AuthCreateKey);\n\n const data = await apiPost<CreateKeyResponse>('/api/auth/api-keys', { name: flags.name });\n\n this.log('');\n this.log('API key created successfully:');\n this.log('');\n this.log(` Name: ${data.name}`);\n this.log(` Key: ${data.key}`);\n this.log(` Prefix: ${data.keyPrefix}`);\n this.log('');\n this.warn('Save this key now \u2014 it will not be shown again.');\n\n if (flags.save) {\n saveApiKey(data.key, process.env.RULEMETRIC_API_URL);\n this.log('');\n this.log(`Key saved to ${path.join(getDefaultConfigDir(), 'env')} (RULEMETRIC_API_KEY)`);\n this.log('Hooks and proxy will use this key automatically.');\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA,YAAY,UAAU;AACtB,SAAS,aAAa;AAatB,IAAqB,gBAArB,MAAqB,uBAAsB,YAAY;AAAA,EACrD,OAAgB,cAAc;AAAA,EAE9B,OAAgB,WAAW;AAAA,IACzB;AAAA,IACA;AAAA,EACF;AAAA,EAEA,OAAgB,QAAQ;AAAA,IACtB,MAAM,MAAM,OAAO,EAAE,MAAM,KAAK,aAAa,qBAAqB,UAAU,KAAK,CAAC;AAAA,IAClF,MAAM,MAAM,QAAQ,EAAE,MAAM,KAAK,aAAa,wDAAwD,SAAS,KAAK,CAAC;AAAA,EACvH;AAAA,EAEA,MAAM,MAAqB;AACzB,UAAM,EAAE,MAAM,IAAI,MAAM,KAAK,MAAM,cAAa;AAEhD,UAAM,OAAO,MAAM,QAA2B,sBAAsB,EAAE,MAAM,MAAM,KAAK,CAAC;AAExF,SAAK,IAAI,EAAE;AACX,SAAK,IAAI,+BAA+B;AACxC,SAAK,IAAI,EAAE;AACX,SAAK,IAAI,aAAa,KAAK,IAAI,EAAE;AACjC,SAAK,IAAI,aAAa,KAAK,GAAG,EAAE;AAChC,SAAK,IAAI,aAAa,KAAK,SAAS,EAAE;AACtC,SAAK,IAAI,EAAE;AACX,SAAK,KAAK,sDAAiD;AAE3D,QAAI,MAAM,MAAM;AACd,iBAAW,KAAK,KAAK,QAAQ,IAAI,kBAAkB;AACnD,WAAK,IAAI,EAAE;AACX,WAAK,IAAI,gBAAqB,UAAK,oBAAoB,GAAG,KAAK,CAAC,uBAAuB;AACvF,WAAK,IAAI,kDAAkD;AAAA,IAC7D;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-SZ7VDCD6.js";
|
|
4
4
|
import "../../chunk-R56PH7YE.js";
|
|
5
5
|
import {
|
|
6
6
|
bootstrapActiveOrg
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-SLL3OBKN.js";
|
|
8
|
+
import "../../chunk-EKJ2CABV.js";
|
|
8
9
|
import {
|
|
9
10
|
apiPost
|
|
10
|
-
} from "../../chunk-
|
|
11
|
+
} from "../../chunk-ZRLYHBPN.js";
|
|
11
12
|
import {
|
|
12
13
|
saveEnvFile,
|
|
13
14
|
saveToken
|
|
14
15
|
} from "../../chunk-W2YERO7E.js";
|
|
15
|
-
import "../../chunk-EKJ2CABV.js";
|
|
16
16
|
import "../../chunk-NSBPE2FW.js";
|
|
17
17
|
|
|
18
18
|
// src/commands/auth/login.ts
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-SZ7VDCD6.js";
|
|
4
4
|
import "../../chunk-R56PH7YE.js";
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-SLL3OBKN.js";
|
|
6
|
+
import "../../chunk-EKJ2CABV.js";
|
|
7
|
+
import "../../chunk-ZRLYHBPN.js";
|
|
7
8
|
import {
|
|
8
9
|
clearEnvFile,
|
|
9
10
|
clearToken
|
|
10
11
|
} from "../../chunk-W2YERO7E.js";
|
|
11
|
-
import "../../chunk-EKJ2CABV.js";
|
|
12
12
|
import "../../chunk-NSBPE2FW.js";
|
|
13
13
|
|
|
14
14
|
// src/commands/auth/logout.ts
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-SZ7VDCD6.js";
|
|
4
4
|
import "../../chunk-R56PH7YE.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-SLL3OBKN.js";
|
|
6
|
+
import "../../chunk-EKJ2CABV.js";
|
|
6
7
|
import {
|
|
7
8
|
apiDelete
|
|
8
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-ZRLYHBPN.js";
|
|
9
10
|
import "../../chunk-W2YERO7E.js";
|
|
10
|
-
import "../../chunk-EKJ2CABV.js";
|
|
11
11
|
import "../../chunk-NSBPE2FW.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/auth/revoke-key.ts
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
} from "../../chunk-BZDKEQKU.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseCommand
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-SZ7VDCD6.js";
|
|
7
7
|
import "../../chunk-R56PH7YE.js";
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-SLL3OBKN.js";
|
|
9
|
+
import "../../chunk-EKJ2CABV.js";
|
|
10
|
+
import "../../chunk-ZRLYHBPN.js";
|
|
10
11
|
import {
|
|
11
12
|
getDefaultConfigDir,
|
|
12
13
|
isAuthenticated,
|
|
13
14
|
loadToken
|
|
14
15
|
} from "../../chunk-W2YERO7E.js";
|
|
15
|
-
import "../../chunk-EKJ2CABV.js";
|
|
16
16
|
import "../../chunk-NSBPE2FW.js";
|
|
17
17
|
|
|
18
18
|
// src/commands/auth/status.ts
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
} from "../../chunk-BZDKEQKU.js";
|
|
6
6
|
import {
|
|
7
7
|
BaseCommand
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-SZ7VDCD6.js";
|
|
9
9
|
import "../../chunk-R56PH7YE.js";
|
|
10
|
-
import "../../chunk-
|
|
10
|
+
import "../../chunk-SLL3OBKN.js";
|
|
11
|
+
import "../../chunk-EKJ2CABV.js";
|
|
11
12
|
import {
|
|
12
13
|
apiGet
|
|
13
|
-
} from "../../chunk-
|
|
14
|
+
} from "../../chunk-ZRLYHBPN.js";
|
|
14
15
|
import "../../chunk-W2YERO7E.js";
|
|
15
|
-
import "../../chunk-EKJ2CABV.js";
|
|
16
16
|
import "../../chunk-NSBPE2FW.js";
|
|
17
17
|
|
|
18
18
|
// src/commands/catalog/index.ts
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-SZ7VDCD6.js";
|
|
4
4
|
import "../../chunk-R56PH7YE.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-SLL3OBKN.js";
|
|
6
|
+
import "../../chunk-EKJ2CABV.js";
|
|
6
7
|
import {
|
|
7
8
|
apiPost
|
|
8
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-ZRLYHBPN.js";
|
|
9
10
|
import "../../chunk-W2YERO7E.js";
|
|
10
|
-
import "../../chunk-EKJ2CABV.js";
|
|
11
11
|
import "../../chunk-NSBPE2FW.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/catalog/recommend.ts
|
package/dist/commands/convert.js
CHANGED
|
@@ -3,14 +3,15 @@ import {
|
|
|
3
3
|
} from "../chunk-7NYKWN7U.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseCommand
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-SZ7VDCD6.js";
|
|
7
7
|
import "../chunk-R56PH7YE.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-SLL3OBKN.js";
|
|
9
|
+
import "../chunk-EKJ2CABV.js";
|
|
9
10
|
import {
|
|
11
|
+
DEFAULT_API_URL,
|
|
10
12
|
apiPost
|
|
11
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-ZRLYHBPN.js";
|
|
12
14
|
import "../chunk-W2YERO7E.js";
|
|
13
|
-
import "../chunk-EKJ2CABV.js";
|
|
14
15
|
import "../chunk-NSBPE2FW.js";
|
|
15
16
|
|
|
16
17
|
// src/commands/convert.ts
|
|
@@ -45,7 +46,7 @@ var Convert = class _Convert extends BaseCommand {
|
|
|
45
46
|
const { args, flags } = await this.parse(_Convert);
|
|
46
47
|
this.requireAuth();
|
|
47
48
|
validateUuid(args.id, "instruction ID");
|
|
48
|
-
const url = new URL(`${process.env.RULEMETRIC_API_URL ??
|
|
49
|
+
const url = new URL(`${process.env.RULEMETRIC_API_URL ?? DEFAULT_API_URL}/api/instructions/${encodeURIComponent(args.id)}/convert`);
|
|
49
50
|
url.searchParams.set("format", flags.format);
|
|
50
51
|
url.searchParams.set("score", String(flags.score));
|
|
51
52
|
const result = await apiPost(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/commands/convert.ts"],
|
|
4
|
-
"sourcesContent": ["import * as fs from 'node:fs';\nimport { Args, Flags } from '@oclif/core';\nimport { BaseCommand } from '../base-command.js';\nimport { apiPost } from '../lib/api-client.js';\nimport { validateUuid } from '../lib/types.js';\nimport type { ConvertResult } from '../lib/types.js';\n\nexport default class Convert extends BaseCommand {\n static override description = 'Convert an instruction to a target format';\n\n static override examples = [\n '<%= config.bin %> convert <id> --format claude-md',\n '<%= config.bin %> convert <id> -f cursorrules --score',\n '<%= config.bin %> convert <id> -f copilot -o .github/copilot-instructions.md',\n ];\n\n static override args = {\n id: Args.string({ description: 'Instruction ID', required: true }),\n };\n\n static override flags = {\n format: Flags.string({\n char: 'f',\n description: 'Target format (e.g., claude-md, cursorrules)',\n required: true,\n }),\n score: Flags.boolean({\n description: 'Include quality score',\n default: false,\n }),\n output: Flags.string({\n char: 'o',\n description: 'Write output to file',\n }),\n };\n\n async run(): Promise<void> {\n const { args, flags } = await this.parse(Convert);\n this.requireAuth();\n validateUuid(args.id, 'instruction ID');\n\n const url = new URL(`${process.env.RULEMETRIC_API_URL ??
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import * as fs from 'node:fs';\nimport { Args, Flags } from '@oclif/core';\nimport { BaseCommand } from '../base-command.js';\nimport { apiPost, DEFAULT_API_URL } from '../lib/api-client.js';\nimport { validateUuid } from '../lib/types.js';\nimport type { ConvertResult } from '../lib/types.js';\n\nexport default class Convert extends BaseCommand {\n static override description = 'Convert an instruction to a target format';\n\n static override examples = [\n '<%= config.bin %> convert <id> --format claude-md',\n '<%= config.bin %> convert <id> -f cursorrules --score',\n '<%= config.bin %> convert <id> -f copilot -o .github/copilot-instructions.md',\n ];\n\n static override args = {\n id: Args.string({ description: 'Instruction ID', required: true }),\n };\n\n static override flags = {\n format: Flags.string({\n char: 'f',\n description: 'Target format (e.g., claude-md, cursorrules)',\n required: true,\n }),\n score: Flags.boolean({\n description: 'Include quality score',\n default: false,\n }),\n output: Flags.string({\n char: 'o',\n description: 'Write output to file',\n }),\n };\n\n async run(): Promise<void> {\n const { args, flags } = await this.parse(Convert);\n this.requireAuth();\n validateUuid(args.id, 'instruction ID');\n\n const url = new URL(`${process.env.RULEMETRIC_API_URL ?? DEFAULT_API_URL}/api/instructions/${encodeURIComponent(args.id)}/convert`);\n url.searchParams.set('format', flags.format);\n url.searchParams.set('score', String(flags.score));\n\n const result = await apiPost<ConvertResult>(\n `${url.pathname}${url.search}`,\n {},\n );\n\n if (flags.output) {\n fs.writeFileSync(flags.output, result.output, 'utf-8');\n this.log(`Written to ${flags.output}`);\n } else {\n this.log(result.output);\n }\n\n if (flags.score && result.score) {\n this.log('');\n this.log(`Quality Score: ${result.score.overall}/100`);\n }\n\n if (result.warnings.length > 0) {\n this.warn(`Warnings: ${result.warnings.join(', ')}`);\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA,YAAY,QAAQ;AACpB,SAAS,MAAM,aAAa;AAM5B,IAAqB,UAArB,MAAqB,iBAAgB,YAAY;AAAA,EAC/C,OAAgB,cAAc;AAAA,EAE9B,OAAgB,WAAW;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EAEA,OAAgB,OAAO;AAAA,IACrB,IAAI,KAAK,OAAO,EAAE,aAAa,kBAAkB,UAAU,KAAK,CAAC;AAAA,EACnE;AAAA,EAEA,OAAgB,QAAQ;AAAA,IACtB,QAAQ,MAAM,OAAO;AAAA,MACnB,MAAM;AAAA,MACN,aAAa;AAAA,MACb,UAAU;AAAA,IACZ,CAAC;AAAA,IACD,OAAO,MAAM,QAAQ;AAAA,MACnB,aAAa;AAAA,MACb,SAAS;AAAA,IACX,CAAC;AAAA,IACD,QAAQ,MAAM,OAAO;AAAA,MACnB,MAAM;AAAA,MACN,aAAa;AAAA,IACf,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,MAAqB;AACzB,UAAM,EAAE,MAAM,MAAM,IAAI,MAAM,KAAK,MAAM,QAAO;AAChD,SAAK,YAAY;AACjB,iBAAa,KAAK,IAAI,gBAAgB;AAEtC,UAAM,MAAM,IAAI,IAAI,GAAG,QAAQ,IAAI,sBAAsB,eAAe,qBAAqB,mBAAmB,KAAK,EAAE,CAAC,UAAU;AAClI,QAAI,aAAa,IAAI,UAAU,MAAM,MAAM;AAC3C,QAAI,aAAa,IAAI,SAAS,OAAO,MAAM,KAAK,CAAC;AAEjD,UAAM,SAAS,MAAM;AAAA,MACnB,GAAG,IAAI,QAAQ,GAAG,IAAI,MAAM;AAAA,MAC5B,CAAC;AAAA,IACH;AAEA,QAAI,MAAM,QAAQ;AAChB,MAAG,iBAAc,MAAM,QAAQ,OAAO,QAAQ,OAAO;AACrD,WAAK,IAAI,cAAc,MAAM,MAAM,EAAE;AAAA,IACvC,OAAO;AACL,WAAK,IAAI,OAAO,MAAM;AAAA,IACxB;AAEA,QAAI,MAAM,SAAS,OAAO,OAAO;AAC/B,WAAK,IAAI,EAAE;AACX,WAAK,IAAI,kBAAkB,OAAO,MAAM,OAAO,MAAM;AAAA,IACvD;AAEA,QAAI,OAAO,SAAS,SAAS,GAAG;AAC9B,WAAK,KAAK,aAAa,OAAO,SAAS,KAAK,IAAI,CAAC,EAAE;AAAA,IACrD;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-SZ7VDCD6.js";
|
|
4
4
|
import "../chunk-R56PH7YE.js";
|
|
5
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-SLL3OBKN.js";
|
|
6
|
+
import "../chunk-EKJ2CABV.js";
|
|
6
7
|
import {
|
|
7
8
|
apiGet
|
|
8
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-ZRLYHBPN.js";
|
|
9
10
|
import "../chunk-W2YERO7E.js";
|
|
10
|
-
import "../chunk-EKJ2CABV.js";
|
|
11
11
|
import "../chunk-NSBPE2FW.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/converters.ts
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
} from "../../chunk-JFDWKLQC.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseCommand
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-SZ7VDCD6.js";
|
|
7
7
|
import "../../chunk-R56PH7YE.js";
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-CWFVBGX2.js";
|
|
10
|
-
import "../../chunk-W2YERO7E.js";
|
|
8
|
+
import "../../chunk-SLL3OBKN.js";
|
|
11
9
|
import "../../chunk-EKJ2CABV.js";
|
|
10
|
+
import "../../chunk-ZRLYHBPN.js";
|
|
11
|
+
import "../../chunk-W2YERO7E.js";
|
|
12
12
|
import "../../chunk-NSBPE2FW.js";
|
|
13
13
|
|
|
14
14
|
// src/commands/crons/list.ts
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
} from "../../chunk-JFDWKLQC.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseCommand
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-SZ7VDCD6.js";
|
|
7
7
|
import "../../chunk-R56PH7YE.js";
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-CWFVBGX2.js";
|
|
10
|
-
import "../../chunk-W2YERO7E.js";
|
|
8
|
+
import "../../chunk-SLL3OBKN.js";
|
|
11
9
|
import "../../chunk-EKJ2CABV.js";
|
|
10
|
+
import "../../chunk-ZRLYHBPN.js";
|
|
11
|
+
import "../../chunk-W2YERO7E.js";
|
|
12
12
|
import "../../chunk-NSBPE2FW.js";
|
|
13
13
|
|
|
14
14
|
// src/commands/crons/run.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-SZ7VDCD6.js";
|
|
4
4
|
import "../chunk-R56PH7YE.js";
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-CWFVBGX2.js";
|
|
7
|
-
import "../chunk-W2YERO7E.js";
|
|
5
|
+
import "../chunk-SLL3OBKN.js";
|
|
8
6
|
import "../chunk-EKJ2CABV.js";
|
|
7
|
+
import "../chunk-ZRLYHBPN.js";
|
|
8
|
+
import "../chunk-W2YERO7E.js";
|
|
9
9
|
import "../chunk-NSBPE2FW.js";
|
|
10
10
|
|
|
11
11
|
// src/commands/dashboard.ts
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-SZ7VDCD6.js";
|
|
4
4
|
import "../../chunk-R56PH7YE.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-SLL3OBKN.js";
|
|
6
|
+
import "../../chunk-EKJ2CABV.js";
|
|
6
7
|
import {
|
|
7
8
|
apiPost
|
|
8
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-ZRLYHBPN.js";
|
|
9
10
|
import "../../chunk-W2YERO7E.js";
|
|
10
|
-
import "../../chunk-EKJ2CABV.js";
|
|
11
11
|
import "../../chunk-NSBPE2FW.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/eval-targets/create.ts
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "../../chunk-BZDKEQKU.js";
|
|
5
5
|
import {
|
|
6
6
|
BaseCommand
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-SZ7VDCD6.js";
|
|
8
8
|
import "../../chunk-R56PH7YE.js";
|
|
9
|
-
import "../../chunk-
|
|
9
|
+
import "../../chunk-SLL3OBKN.js";
|
|
10
|
+
import "../../chunk-EKJ2CABV.js";
|
|
10
11
|
import {
|
|
11
12
|
apiGet
|
|
12
|
-
} from "../../chunk-
|
|
13
|
+
} from "../../chunk-ZRLYHBPN.js";
|
|
13
14
|
import "../../chunk-W2YERO7E.js";
|
|
14
|
-
import "../../chunk-EKJ2CABV.js";
|
|
15
15
|
import "../../chunk-NSBPE2FW.js";
|
|
16
16
|
|
|
17
17
|
// src/commands/eval-targets/list.ts
|
|
@@ -1,46 +1,47 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runAgentLoop
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-XZXS2W24.js";
|
|
9
|
-
import "../../chunk-IKEI4KNV.js";
|
|
10
|
-
import "../../chunk-DUR54APY.js";
|
|
11
|
-
import "../../chunk-FUS5C4SB.js";
|
|
3
|
+
} from "../../chunk-4LHEN2FS.js";
|
|
4
|
+
import "../../chunk-JEJ3J5J6.js";
|
|
5
|
+
import "../../chunk-OTOWLUOJ.js";
|
|
6
|
+
import "../../chunk-WLFX4PYR.js";
|
|
7
|
+
import "../../chunk-Y4BJXXYV.js";
|
|
12
8
|
import "../../chunk-W53GKIZQ.js";
|
|
13
|
-
import "../../chunk-
|
|
9
|
+
import "../../chunk-H3C6EGR2.js";
|
|
14
10
|
import "../../chunk-RQ2TMLKG.js";
|
|
15
|
-
import "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
17
|
-
import "../../chunk-
|
|
18
|
-
import "../../chunk-DGHWRQXL.js";
|
|
19
|
-
import "../../chunk-K3BFZ7KG.js";
|
|
11
|
+
import "../../chunk-IATQXFJA.js";
|
|
12
|
+
import "../../chunk-BCIUSUEV.js";
|
|
13
|
+
import "../../chunk-E3BIT53W.js";
|
|
20
14
|
import "../../chunk-QSN77T7C.js";
|
|
21
15
|
import {
|
|
22
16
|
closeDb
|
|
23
|
-
} from "../../chunk-
|
|
24
|
-
import "../../chunk-
|
|
17
|
+
} from "../../chunk-QNSVCSHG.js";
|
|
18
|
+
import "../../chunk-3POYC5NA.js";
|
|
19
|
+
import "../../chunk-RCMXTLQF.js";
|
|
20
|
+
import "../../chunk-N5A2IQAK.js";
|
|
21
|
+
import "../../chunk-XZXS2W24.js";
|
|
22
|
+
import "../../chunk-FZKLLNDS.js";
|
|
23
|
+
import "../../chunk-DGHWRQXL.js";
|
|
24
|
+
import "../../chunk-DR5WLIOU.js";
|
|
25
25
|
import "../../chunk-J7N3DLH6.js";
|
|
26
26
|
import "../../chunk-52WIYRZH.js";
|
|
27
|
-
import "../../chunk-EKP32DLN.js";
|
|
28
|
-
import "../../chunk-4QGATD5Y.js";
|
|
29
27
|
import "../../chunk-OQSQC7VB.js";
|
|
28
|
+
import "../../chunk-EKP32DLN.js";
|
|
29
|
+
import "../../chunk-F5N6CLJJ.js";
|
|
30
30
|
import "../../chunk-KRBQLMOP.js";
|
|
31
31
|
import "../../chunk-3TIMQ3O6.js";
|
|
32
32
|
import "../../chunk-YNIH3KMU.js";
|
|
33
33
|
import "../../chunk-QN34TGD3.js";
|
|
34
34
|
import {
|
|
35
35
|
BaseCommand
|
|
36
|
-
} from "../../chunk-
|
|
36
|
+
} from "../../chunk-SZ7VDCD6.js";
|
|
37
37
|
import "../../chunk-R56PH7YE.js";
|
|
38
|
-
import "../../chunk-
|
|
39
|
-
import "../../chunk-
|
|
38
|
+
import "../../chunk-SLL3OBKN.js";
|
|
39
|
+
import "../../chunk-EKJ2CABV.js";
|
|
40
|
+
import "../../chunk-ZRLYHBPN.js";
|
|
40
41
|
import {
|
|
42
|
+
getDefaultConfigDir,
|
|
41
43
|
loadToken
|
|
42
44
|
} from "../../chunk-W2YERO7E.js";
|
|
43
|
-
import "../../chunk-EKJ2CABV.js";
|
|
44
45
|
import "../../chunk-NSBPE2FW.js";
|
|
45
46
|
|
|
46
47
|
// ../../packages/telemetry/dist/init.js
|
|
@@ -121,9 +122,6 @@ async function shutdownTelemetry() {
|
|
|
121
122
|
// ../../packages/telemetry/dist/hono-middleware.js
|
|
122
123
|
import { SpanKind, SpanStatusCode } from "@opentelemetry/api";
|
|
123
124
|
|
|
124
|
-
// ../../packages/telemetry/dist/mcp-instrumentation.js
|
|
125
|
-
import { SpanKind as SpanKind2, SpanStatusCode as SpanStatusCode2 } from "@opentelemetry/api";
|
|
126
|
-
|
|
127
125
|
// ../../packages/telemetry/dist/span-attributes.js
|
|
128
126
|
import { trace as trace2, context as otelContext } from "@opentelemetry/api";
|
|
129
127
|
|
|
@@ -157,9 +155,8 @@ async function flushSentry(timeoutMs) {
|
|
|
157
155
|
// src/commands/evals/agent.ts
|
|
158
156
|
import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
|
159
157
|
import { dirname, join } from "node:path";
|
|
160
|
-
import { homedir } from "node:os";
|
|
161
158
|
import { execFileSync } from "node:child_process";
|
|
162
|
-
var AGENT_LOCK_PATH = join(
|
|
159
|
+
var AGENT_LOCK_PATH = join(getDefaultConfigDir(), "evals-agent.lock");
|
|
163
160
|
function pidAlive(pid) {
|
|
164
161
|
try {
|
|
165
162
|
process.kill(pid, 0);
|