@codemieai/code 0.15.4 → 0.15.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/agents/core/session/SessionStore.d.ts +6 -0
- package/dist/agents/core/session/SessionStore.d.ts.map +1 -1
- package/dist/agents/core/session/SessionStore.js +38 -0
- package/dist/agents/core/session/SessionStore.js.map +1 -1
- package/dist/agents/core/session/types.d.ts +2 -0
- package/dist/agents/core/session/types.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.models.d.ts +18 -2
- package/dist/agents/plugins/claude/claude.models.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.models.js +109 -61
- package/dist/agents/plugins/claude/claude.models.js.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.js +25 -4
- package/dist/agents/plugins/claude/claude.plugin.js.map +1 -1
- package/dist/agents/plugins/claude/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/agents/plugins/claude/plugin/skills/codemie-assistant-builder/SKILL.md +177 -0
- package/dist/agents/plugins/claude/plugin/skills/codemie-assistant-builder/agents/grader.md +38 -0
- package/dist/agents/plugins/claude/plugin/skills/codemie-assistant-builder/agents/improver.md +40 -0
- package/dist/agents/plugins/claude/plugin/skills/codemie-sdk/SKILL.md +10 -1
- package/dist/agents/plugins/claude/plugin/skills/codemie-sdk/examples/assistants.md +23 -0
- package/dist/agents/plugins/claude/plugin/statusline.bundle.mjs +57 -21
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.d.ts +13 -0
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.d.ts.map +1 -1
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js +27 -1
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js.map +1 -1
- package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.d.ts +6 -0
- package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.d.ts.map +1 -1
- package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js +21 -0
- package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js.map +1 -1
- package/dist/agents/plugins/claude/session/processors/messages-before.d.ts +11 -0
- package/dist/agents/plugins/claude/session/processors/messages-before.d.ts.map +1 -0
- package/dist/agents/plugins/claude/session/processors/messages-before.js +15 -0
- package/dist/agents/plugins/claude/session/processors/messages-before.js.map +1 -0
- package/dist/agents/plugins/claude/statusline-installer.d.ts +9 -0
- package/dist/agents/plugins/claude/statusline-installer.d.ts.map +1 -1
- package/dist/agents/plugins/claude/statusline-installer.js +42 -27
- package/dist/agents/plugins/claude/statusline-installer.js.map +1 -1
- package/dist/cli/commands/analytics/index.d.ts.map +1 -1
- package/dist/cli/commands/analytics/index.js +50 -6
- package/dist/cli/commands/analytics/index.js.map +1 -1
- package/dist/cli/commands/analytics/types.d.ts +6 -0
- package/dist/cli/commands/analytics/types.d.ts.map +1 -1
- package/dist/cli/commands/doctor/checks/NpmPrefixOverrideCheck.d.ts +9 -0
- package/dist/cli/commands/doctor/checks/NpmPrefixOverrideCheck.d.ts.map +1 -0
- package/dist/cli/commands/doctor/checks/NpmPrefixOverrideCheck.js +42 -0
- package/dist/cli/commands/doctor/checks/NpmPrefixOverrideCheck.js.map +1 -0
- package/dist/cli/commands/doctor/checks/index.d.ts +1 -0
- package/dist/cli/commands/doctor/checks/index.d.ts.map +1 -1
- package/dist/cli/commands/doctor/checks/index.js +1 -0
- package/dist/cli/commands/doctor/checks/index.js.map +1 -1
- package/dist/cli/commands/doctor/index.d.ts.map +1 -1
- package/dist/cli/commands/doctor/index.js +2 -1
- package/dist/cli/commands/doctor/index.js.map +1 -1
- package/dist/cli/commands/sdk/assistant-builder/checks.d.ts +4 -0
- package/dist/cli/commands/sdk/assistant-builder/checks.d.ts.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/checks.js +32 -0
- package/dist/cli/commands/sdk/assistant-builder/checks.js.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/commands.d.ts +6 -0
- package/dist/cli/commands/sdk/assistant-builder/commands.d.ts.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/commands.js +278 -0
- package/dist/cli/commands/sdk/assistant-builder/commands.js.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/conversations.d.ts +26 -0
- package/dist/cli/commands/sdk/assistant-builder/conversations.d.ts.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/conversations.js +45 -0
- package/dist/cli/commands/sdk/assistant-builder/conversations.js.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/normalize.d.ts +11 -0
- package/dist/cli/commands/sdk/assistant-builder/normalize.d.ts.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/normalize.js +43 -0
- package/dist/cli/commands/sdk/assistant-builder/normalize.js.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/output.d.ts +10 -0
- package/dist/cli/commands/sdk/assistant-builder/output.d.ts.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/output.js +29 -0
- package/dist/cli/commands/sdk/assistant-builder/output.js.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/report/compare.d.ts +23 -0
- package/dist/cli/commands/sdk/assistant-builder/report/compare.d.ts.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/report/compare.js +66 -0
- package/dist/cli/commands/sdk/assistant-builder/report/compare.js.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/report/html.d.ts +9 -0
- package/dist/cli/commands/sdk/assistant-builder/report/html.d.ts.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/report/html.js +87 -0
- package/dist/cli/commands/sdk/assistant-builder/report/html.js.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/report/summary.d.ts +31 -0
- package/dist/cli/commands/sdk/assistant-builder/report/summary.d.ts.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/report/summary.js +56 -0
- package/dist/cli/commands/sdk/assistant-builder/report/summary.js.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/report/workspace.d.ts +19 -0
- package/dist/cli/commands/sdk/assistant-builder/report/workspace.d.ts.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/report/workspace.js +112 -0
- package/dist/cli/commands/sdk/assistant-builder/report/workspace.js.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/runner.d.ts +32 -0
- package/dist/cli/commands/sdk/assistant-builder/runner.d.ts.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/runner.js +109 -0
- package/dist/cli/commands/sdk/assistant-builder/runner.js.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/scenarios.d.ts +5 -0
- package/dist/cli/commands/sdk/assistant-builder/scenarios.d.ts.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/scenarios.js +66 -0
- package/dist/cli/commands/sdk/assistant-builder/scenarios.js.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/types.d.ts +70 -0
- package/dist/cli/commands/sdk/assistant-builder/types.d.ts.map +1 -0
- package/dist/cli/commands/sdk/assistant-builder/types.js +2 -0
- package/dist/cli/commands/sdk/assistant-builder/types.js.map +1 -0
- package/dist/cli/commands/sdk/assistants.d.ts.map +1 -1
- package/dist/cli/commands/sdk/assistants.js +2 -0
- package/dist/cli/commands/sdk/assistants.js.map +1 -1
- package/dist/cli/commands/sdk/services/assistants.d.ts +20 -1
- package/dist/cli/commands/sdk/services/assistants.d.ts.map +1 -1
- package/dist/cli/commands/sdk/services/assistants.js +80 -2
- package/dist/cli/commands/sdk/services/assistants.js.map +1 -1
- package/dist/cli/commands/sdk/utils/cli-utils.js +1 -1
- package/dist/cli/commands/sdk/utils/cli-utils.js.map +1 -1
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +4 -3
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/frameworks/plugins/codegraph.plugin.js +2 -2
- package/dist/frameworks/plugins/codegraph.plugin.js.map +1 -1
- package/dist/providers/plugins/sso/sso.http-client.d.ts +5 -0
- package/dist/providers/plugins/sso/sso.http-client.d.ts.map +1 -1
- package/dist/providers/plugins/sso/sso.http-client.js.map +1 -1
- package/dist/telemetry/clients/claude-desktop/ClaudeDesktopTelemetryAdapter.d.ts +3 -0
- package/dist/telemetry/clients/claude-desktop/ClaudeDesktopTelemetryAdapter.d.ts.map +1 -1
- package/dist/telemetry/clients/claude-desktop/ClaudeDesktopTelemetryAdapter.js +43 -2
- package/dist/telemetry/clients/claude-desktop/ClaudeDesktopTelemetryAdapter.js.map +1 -1
- package/dist/telemetry/clients/claude-desktop/claude-desktop.discovery.d.ts.map +1 -1
- package/dist/telemetry/clients/claude-desktop/claude-desktop.discovery.js +12 -10
- package/dist/telemetry/clients/claude-desktop/claude-desktop.discovery.js.map +1 -1
- package/dist/telemetry/runtime/DesktopRepositoryResolver.d.ts.map +1 -1
- package/dist/telemetry/runtime/DesktopRepositoryResolver.js +33 -6
- package/dist/telemetry/runtime/DesktopRepositoryResolver.js.map +1 -1
- package/dist/telemetry/runtime/DesktopTelemetryRuntime.d.ts +2 -0
- package/dist/telemetry/runtime/DesktopTelemetryRuntime.d.ts.map +1 -1
- package/dist/telemetry/runtime/DesktopTelemetryRuntime.js +61 -10
- package/dist/telemetry/runtime/DesktopTelemetryRuntime.js.map +1 -1
- package/dist/telemetry/runtime/checkpoints.d.ts +6 -0
- package/dist/telemetry/runtime/checkpoints.d.ts.map +1 -1
- package/dist/telemetry/runtime/checkpoints.js.map +1 -1
- package/dist/telemetry/runtime/types.d.ts +5 -0
- package/dist/telemetry/runtime/types.d.ts.map +1 -1
- package/dist/utils/cli-bin.d.ts.map +1 -1
- package/dist/utils/cli-bin.js +3 -4
- package/dist/utils/cli-bin.js.map +1 -1
- package/dist/utils/cli-updater.d.ts +1 -0
- package/dist/utils/cli-updater.d.ts.map +1 -1
- package/dist/utils/cli-updater.js +5 -2
- package/dist/utils/cli-updater.js.map +1 -1
- package/dist/utils/npm-prefix.d.ts +48 -0
- package/dist/utils/npm-prefix.d.ts.map +1 -0
- package/dist/utils/npm-prefix.js +142 -0
- package/dist/utils/npm-prefix.js.map +1 -0
- package/dist/utils/paths.d.ts +7 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +10 -0
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/platform.d.ts +10 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/utils/platform.js +14 -0
- package/dist/utils/platform.js.map +1 -0
- package/dist/utils/pricing.json +9 -1
- package/dist/utils/processes.d.ts.map +1 -1
- package/dist/utils/processes.js +6 -3
- package/dist/utils/processes.js.map +1 -1
- package/package.json +2 -2
- package/scripts/bundle-statusline.mjs +14 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* npm Prefix Utilities
|
|
3
|
+
*
|
|
4
|
+
* Resolves the npm prefix CodeMie runs from and detects the per-user prefix override that
|
|
5
|
+
* older CodeMie installers wrote to `.npmrc`.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Get the npm prefix the running CodeMie package was installed into, derived from its
|
|
9
|
+
* location: `<prefix>\node_modules\@codemieai\code` on win32,
|
|
10
|
+
* `<prefix>/lib/node_modules/@codemieai/code` on POSIX.
|
|
11
|
+
*
|
|
12
|
+
* @param packageDir - Package root to inspect; defaults to the running package's own root.
|
|
13
|
+
* @param platform - Platform whose path rules and layout to use; defaults to `process.platform`.
|
|
14
|
+
* @returns The prefix, or `null` when `packageDir` does not match the layout (dev checkout,
|
|
15
|
+
* `npm link`) or, on win32, when `<prefix>\codemie.cmd` is missing (project-local dependency,
|
|
16
|
+
* npx cache).
|
|
17
|
+
*/
|
|
18
|
+
export declare function getCodemieNpmPrefix(packageDir?: string, platform?: NodeJS.Platform): string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Path of the per-user npm prefix that older CodeMie installers wrote to `.npmrc`.
|
|
21
|
+
*
|
|
22
|
+
* @param platform - Platform to resolve the path for; defaults to `process.platform`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getLegacyNpmPrefixPath(platform?: NodeJS.Platform): string;
|
|
25
|
+
/**
|
|
26
|
+
* Extract the last `prefix=` value from `.npmrc` content, with surrounding quotes removed.
|
|
27
|
+
*/
|
|
28
|
+
export declare function parseNpmrcPrefix(content: string): string | null;
|
|
29
|
+
/**
|
|
30
|
+
* Read the `prefix` set in the user-level `.npmrc` (the file `npm config get userconfig` points to).
|
|
31
|
+
*
|
|
32
|
+
* Unlike `npm config get prefix`, this ignores `NPM_CONFIG_PREFIX` and global/project config.
|
|
33
|
+
*
|
|
34
|
+
* @returns The prefix, or `null` when it is not set or the file cannot be read.
|
|
35
|
+
*/
|
|
36
|
+
export declare function getUserNpmrcPrefix(): Promise<string | null>;
|
|
37
|
+
/**
|
|
38
|
+
* The prefix of the running CodeMie copy, or npm's global prefix when it cannot be derived.
|
|
39
|
+
*/
|
|
40
|
+
export declare function getCodemieOrGlobalNpmPrefix(): Promise<string | null>;
|
|
41
|
+
/**
|
|
42
|
+
* `--prefix` args that keep an npm global install/uninstall/list next to the running CodeMie copy.
|
|
43
|
+
*
|
|
44
|
+
* @returns `[]` when CodeMie runs from npm's global prefix, from a dev checkout, or when either
|
|
45
|
+
* prefix cannot be resolved; otherwise `['--prefix', <CodeMie prefix>]`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function getNpmPrefixArgs(): Promise<string[]>;
|
|
48
|
+
//# sourceMappingURL=npm-prefix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npm-prefix.d.ts","sourceRoot":"","sources":["../../src/utils/npm-prefix.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA2BH;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,GAAE,MAAqD,EACjE,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAC3C,MAAM,GAAG,IAAI,CAwBf;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,MAAM,CAK3F;AAqBD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAS/D;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAWjE;AAED;;GAEG;AACH,wBAAsB,2BAA2B,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAE1E;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAY1D"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* npm Prefix Utilities
|
|
3
|
+
*
|
|
4
|
+
* Resolves the npm prefix CodeMie runs from and detects the per-user prefix override that
|
|
5
|
+
* older CodeMie installers wrote to `.npmrc`.
|
|
6
|
+
*/
|
|
7
|
+
import path from 'path';
|
|
8
|
+
import { existsSync } from 'fs';
|
|
9
|
+
import { readFile } from 'fs/promises';
|
|
10
|
+
import { homedir } from 'os';
|
|
11
|
+
import { getDirname, isSamePath } from '../utils/paths.js';
|
|
12
|
+
import { getPathModule, isWindows } from '../utils/platform.js';
|
|
13
|
+
import { exec } from '../utils/exec.js';
|
|
14
|
+
const WIN32_LAYOUT = ['node_modules', '@codemieai', 'code'];
|
|
15
|
+
const POSIX_LAYOUT = ['lib', 'node_modules', '@codemieai', 'code'];
|
|
16
|
+
function findPackageRoot(startDir) {
|
|
17
|
+
let dir = startDir;
|
|
18
|
+
for (;;) {
|
|
19
|
+
if (existsSync(path.join(dir, 'package.json'))) {
|
|
20
|
+
return dir;
|
|
21
|
+
}
|
|
22
|
+
const parent = path.dirname(dir);
|
|
23
|
+
if (parent === dir) {
|
|
24
|
+
return startDir;
|
|
25
|
+
}
|
|
26
|
+
dir = parent;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get the npm prefix the running CodeMie package was installed into, derived from its
|
|
31
|
+
* location: `<prefix>\node_modules\@codemieai\code` on win32,
|
|
32
|
+
* `<prefix>/lib/node_modules/@codemieai/code` on POSIX.
|
|
33
|
+
*
|
|
34
|
+
* @param packageDir - Package root to inspect; defaults to the running package's own root.
|
|
35
|
+
* @param platform - Platform whose path rules and layout to use; defaults to `process.platform`.
|
|
36
|
+
* @returns The prefix, or `null` when `packageDir` does not match the layout (dev checkout,
|
|
37
|
+
* `npm link`) or, on win32, when `<prefix>\codemie.cmd` is missing (project-local dependency,
|
|
38
|
+
* npx cache).
|
|
39
|
+
*/
|
|
40
|
+
export function getCodemieNpmPrefix(packageDir = findPackageRoot(getDirname(import.meta.url)), platform = process.platform) {
|
|
41
|
+
const p = getPathModule(platform);
|
|
42
|
+
const windows = isWindows(platform);
|
|
43
|
+
const layout = windows ? WIN32_LAYOUT : POSIX_LAYOUT;
|
|
44
|
+
const parts = p.resolve(packageDir).split(p.sep);
|
|
45
|
+
if (parts.length <= layout.length) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
const tail = parts.slice(-layout.length);
|
|
49
|
+
const matchesLayout = tail.every((part, i) => windows ? part.toLowerCase() === layout[i].toLowerCase() : part === layout[i]);
|
|
50
|
+
if (!matchesLayout) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
const prefix = parts.slice(0, -layout.length).join(p.sep) || p.sep;
|
|
54
|
+
if (windows && !existsSync(p.join(prefix, 'codemie.cmd'))) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return prefix;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Path of the per-user npm prefix that older CodeMie installers wrote to `.npmrc`.
|
|
61
|
+
*
|
|
62
|
+
* @param platform - Platform to resolve the path for; defaults to `process.platform`.
|
|
63
|
+
*/
|
|
64
|
+
export function getLegacyNpmPrefixPath(platform = process.platform) {
|
|
65
|
+
if (isWindows(platform)) {
|
|
66
|
+
return path.join(process.env.LOCALAPPDATA ?? '', 'CodeMie', 'npm-prefix');
|
|
67
|
+
}
|
|
68
|
+
return path.join(homedir(), '.codemie', 'npm-prefix');
|
|
69
|
+
}
|
|
70
|
+
async function readNpmValue(args) {
|
|
71
|
+
try {
|
|
72
|
+
const result = await exec('npm', args, { shell: isWindows() });
|
|
73
|
+
if (result.code !== 0) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
return result.stdout.trim() || null;
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
let globalNpmPrefix;
|
|
83
|
+
function getGlobalNpmPrefix() {
|
|
84
|
+
globalNpmPrefix ??= readNpmValue(['prefix', '-g']);
|
|
85
|
+
return globalNpmPrefix;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Extract the last `prefix=` value from `.npmrc` content, with surrounding quotes removed.
|
|
89
|
+
*/
|
|
90
|
+
export function parseNpmrcPrefix(content) {
|
|
91
|
+
let prefix = null;
|
|
92
|
+
for (const line of content.split(/\r?\n/)) {
|
|
93
|
+
const match = /^\s*prefix\s*=\s*(.*?)\s*$/.exec(line);
|
|
94
|
+
if (match) {
|
|
95
|
+
prefix = match[1].replace(/^"(.*)"$/, '$1') || null;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return prefix;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Read the `prefix` set in the user-level `.npmrc` (the file `npm config get userconfig` points to).
|
|
102
|
+
*
|
|
103
|
+
* Unlike `npm config get prefix`, this ignores `NPM_CONFIG_PREFIX` and global/project config.
|
|
104
|
+
*
|
|
105
|
+
* @returns The prefix, or `null` when it is not set or the file cannot be read.
|
|
106
|
+
*/
|
|
107
|
+
export async function getUserNpmrcPrefix() {
|
|
108
|
+
const userConfigPath = await readNpmValue(['config', 'get', 'userconfig']);
|
|
109
|
+
if (!userConfigPath) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
try {
|
|
113
|
+
return parseNpmrcPrefix(await readFile(userConfigPath, 'utf8'));
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* The prefix of the running CodeMie copy, or npm's global prefix when it cannot be derived.
|
|
121
|
+
*/
|
|
122
|
+
export async function getCodemieOrGlobalNpmPrefix() {
|
|
123
|
+
return getCodemieNpmPrefix() ?? getGlobalNpmPrefix();
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* `--prefix` args that keep an npm global install/uninstall/list next to the running CodeMie copy.
|
|
127
|
+
*
|
|
128
|
+
* @returns `[]` when CodeMie runs from npm's global prefix, from a dev checkout, or when either
|
|
129
|
+
* prefix cannot be resolved; otherwise `['--prefix', <CodeMie prefix>]`.
|
|
130
|
+
*/
|
|
131
|
+
export async function getNpmPrefixArgs() {
|
|
132
|
+
const codemiePrefix = getCodemieNpmPrefix();
|
|
133
|
+
if (!codemiePrefix) {
|
|
134
|
+
return [];
|
|
135
|
+
}
|
|
136
|
+
const globalPrefix = await getGlobalNpmPrefix();
|
|
137
|
+
if (!globalPrefix || isSamePath(codemiePrefix, globalPrefix)) {
|
|
138
|
+
return [];
|
|
139
|
+
}
|
|
140
|
+
return ['--prefix', codemiePrefix];
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=npm-prefix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npm-prefix.js","sourceRoot":"","sources":["../../src/utils/npm-prefix.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB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ACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B;IAC/C,OAAO,mBAAmB,EAAE,IAAI,kBAAkB,EAAE,CAAC;AACvD,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,MAAM,aAAa,GAAG,mBAAmB,EAAE,CAAC;IAC5C,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,YAAY,GAAG,MAAM,kBAAkB,EAAE,CAAC;IAChD,IAAI,CAAC,YAAY,IAAI,UAAU,CAAC,aAAa,EAAE,YAAY,CAAC,EAAE,CAAC;QAC7D,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AACrC,CAAC"}
|
package/dist/utils/paths.d.ts
CHANGED
|
@@ -142,6 +142,13 @@ export declare function validatePathDepth(filePath: string, baseDirName: string,
|
|
|
142
142
|
* // Returns: false (prevented traversal attack)
|
|
143
143
|
*/
|
|
144
144
|
export declare function isPathWithinDirectory(workingDir: string, resolvedPath: string): boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Check whether two paths point to the same location, ignoring trailing separators and,
|
|
147
|
+
* on win32, letter case.
|
|
148
|
+
*
|
|
149
|
+
* @param platform - Platform whose path rules to use; defaults to `process.platform`.
|
|
150
|
+
*/
|
|
151
|
+
export declare function isSamePath(a: string, b: string, platform?: NodeJS.Platform): boolean;
|
|
145
152
|
/**
|
|
146
153
|
* Validate if a string matches UUID format (any version)
|
|
147
154
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/utils/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/utils/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;A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,YAAY,EAAE,MAAM,GAAG,MAAM,CAE3D;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAMvC;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAEzD;AAYD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAalE;AAMD;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAExD"}
|
package/dist/utils/paths.js
CHANGED
|
@@ -13,6 +13,7 @@ import path from 'path';
|
|
|
13
13
|
import { homedir } from 'os';
|
|
14
14
|
import { fileURLToPath } from 'url';
|
|
15
15
|
import { dirname } from 'path';
|
|
16
|
+
import { getPathModule } from './platform.js';
|
|
16
17
|
// ============================================================================
|
|
17
18
|
// Path Normalization and Manipulation
|
|
18
19
|
// ============================================================================
|
|
@@ -203,6 +204,15 @@ export function isPathWithinDirectory(workingDir, resolvedPath) {
|
|
|
203
204
|
// If path starts with '..' or is an absolute path, it's outside workingDir
|
|
204
205
|
return !relative.startsWith('..') && !path.isAbsolute(relative);
|
|
205
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* Check whether two paths point to the same location, ignoring trailing separators and,
|
|
209
|
+
* on win32, letter case.
|
|
210
|
+
*
|
|
211
|
+
* @param platform - Platform whose path rules to use; defaults to `process.platform`.
|
|
212
|
+
*/
|
|
213
|
+
export function isSamePath(a, b, platform = process.platform) {
|
|
214
|
+
return getPathModule(platform).relative(a, b) === '';
|
|
215
|
+
}
|
|
206
216
|
// ============================================================================
|
|
207
217
|
// UUID Validation Utilities
|
|
208
218
|
// ============================================================================
|
package/dist/utils/paths.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/utils/paths.ts"],"names":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,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAEjD,IAAI,QAAQ,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACzB,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC;IAC7E,CAAC;IAED,OAAO,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,SAAS,CAAC;AACpD,CAAC;AAED,+EAA+E;AAC/E,4BAA4B;AAC5B,+EAA+E;AAE/E;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,aAAqB;IAC9C,OAAO,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform helpers.
|
|
3
|
+
*/
|
|
4
|
+
import path from 'path';
|
|
5
|
+
export declare function isWindows(platform?: NodeJS.Platform): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* The `path` implementation whose separator and case rules match `platform`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getPathModule(platform?: NodeJS.Platform): path.PlatformPath;
|
|
10
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/utils/platform.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,wBAAgB,SAAS,CAAC,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,OAAO,CAE/E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,IAAI,CAAC,YAAY,CAE7F"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform helpers.
|
|
3
|
+
*/
|
|
4
|
+
import path from 'path';
|
|
5
|
+
export function isWindows(platform = process.platform) {
|
|
6
|
+
return platform === 'win32';
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The `path` implementation whose separator and case rules match `platform`.
|
|
10
|
+
*/
|
|
11
|
+
export function getPathModule(platform = process.platform) {
|
|
12
|
+
return isWindows(platform) ? path.win32 : path.posix;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=platform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../../src/utils/platform.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,UAAU,SAAS,CAAC,WAA4B,OAAO,CAAC,QAAQ;IACpE,OAAO,QAAQ,KAAK,OAAO,CAAC;AAC9B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,WAA4B,OAAO,CAAC,QAAQ;IACxE,OAAO,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;AACvD,CAAC"}
|
package/dist/utils/pricing.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"claude5": "Sonnet 5 and Opus 5 standard API-equivalent token rates verified 2026-09-15; Fable 5/5.1, Mythos 5/5.1 and Opus 4.7/4.8 verified 2026-09-27 at https://platform.claude.com/docs/en/about-claude/pricing; excludes additional tool charges. Sonnet 5's planned September 1 price increase was cancelled.",
|
|
20
20
|
"t10CatalogReconciliation": "Rows added 2026-09-26 to price catalog ids that resolvePrice() found unpriced (unify-analytics-cost-command T10), each verified against one official vendor page/API on that date. claude-opus-5-5: $4/$20 base, $5/$8 5m/1h cache write, $0.20 cache read (0.05x multiplier), bedrockRegionalMultiplier 1.1 (Opus 4.5+ scope) — https://platform.claude.com/docs/en/about-claude/pricing (Model pricing table row 'Claude Opus 5.5'). gpt-5-5: short-context Standard row '$5.00 | $0.50 | - | $30.00' — https://developers.openai.com/api/docs/pricing ('Standard Pricing Tables', row 'gpt-5.5 (<272K context length)'); cache-write column is '-' (not stated) so cacheWrite mirrors input, matching this table's existing gpt-5-4 handling. gpt-5-6-luna/-sol/-terra and gpt-6-luna/-sol: short-context Standard rows from the same OpenAI page/table, e.g. 'gpt-6-sol | $2.00 | $0.20 | $2.50 | $10.00'; these rows do state a real cache-write price (~1.25x input) so it is recorded as-is rather than mirrored. deepseek-v4-pro: peak (weekday 01:00-04:00/06:00-10:00 UTC) cache-miss input $1.32, cache-hit input $0.044, output $3.96 — https://api-docs.deepseek.com/quick_start/pricing/; off-peak (all other hours, including weekends) is exactly half: $0.66/$0.022/$1.98; peak chosen as the flat row like every other entry in this table, no time-of-day tiering supported by the schema; cacheWrite mirrors input per this table's deepseek-chat/deepseek-reasoner precedent. gemini-3-6-flash/gemini-3-8-flash: paid-tier Standard pricing 'through Dec 31, 2026' — $0.75 input/$3.75 output/$0.075 context-caching — https://ai.google.dev/gemini-api/docs/pricing; scheduled to double to $1.50/$7.50/$0.15 on 2027-01-01, not yet in effect as of verification; cacheWrite mirrors input per this table's gemini-3-5-flash/gemini-3-7-flash precedent. gemini-3-1-flash-image: Standard pricing 'Input: $0.50 (text/image); Output: $3 (text/thinking), $60.00 (images)' — https://ai.google.dev/gemini-api/docs/pricing; output field records the $60 image-generation rate (not the $3 text/thinking rate), matching this table's existing gemini-3-1-flash-image-preview/gemini-2-5-flash-image rows, which use the same convention (schema has no separate image-output field); cacheRead/cacheWrite 0 (no cache pricing published for this model). grok-4-6: base tier (<200k prompt tokens) row 'grok-4.6 (< 200k prompt tokens) | 500k | $2.00 | $0.50 | $6.00' — https://docs.x.ai/developers/models; xAI doubles every rate for prompts >=200k tokens, not represented here (schema is flat), so this is the base/short-context tier, consistent with this table's other short-context-only entries; cacheWrite mirrors input per this table's grok-4/grok-4-1-fast precedent. qwen3-coder-30b-a3b-v1 and qwen3-coder-480b-a35b-v1: AWS Bedrock on-demand Standard tier, US East (N. Virginia) — official AWS Price List API https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrock/20260926004940/us-east-1/index.json (also rendered at https://aws.amazon.com/bedrock/pricing/), SKU usagetype 'qwen.qwen3-coder-30b-a3b-instruct-mantle-{input,output}-tokens-standard' = $0.00015/$0.0006 per 1K tokens ($0.15/$0.60 per 1M) and 'qwen.qwen3-coder-480b-a35b-instruct-mantle-{input,output}-tokens-standard' = $0.00045/$0.0018 per 1K tokens ($0.45/$1.80 per 1M); no cache pricing published for either. Checked but NOT added (no official page states a price for the exact catalog id): claude-4-5-sonnet / claude-4-5-sonnet-vertex now resolve via the T1 reorder fallback onto the existing claude-sonnet-4-5 row, so no new row was needed."
|
|
21
21
|
},
|
|
22
|
-
"note": "codemie: added claude 4-7/4-8 tier estimates 2026-06-08; added kimi-for-coding alias and normalized kimi-k2-5 key 2026-06-15; added claude-sonnet-5 pinned entry 2026-07-01 (current resolution order: exact match, then one trailing snapshot suffix stripped, then a version-first Claude id reordered to its family-first table key, else unpriced — no family/tier fallback; see resolvePrice() in pricing.ts); corrected claude-sonnet-5 to its real $2/$10 rate 2026-09-15 (was pinned at the old Sonnet 4.x $3/$15 rate — Anthropic's introductory $2/$10 pricing for Sonnet 5 became standard instead of increasing to $3/$15 as originally scheduled); added per-row bedrockRegionalMultiplier 2026-09-15 to every Sonnet 4.5+/Haiku 4.5+/Opus 4.5+ row (including their dated snapshots) — Amazon Bedrock bills a regional/multi-region endpoint (a US/EU/JP/AU cross-region inference profile, or a single named AWS region) at this multiplier over its global endpoint, for exactly these generations and later; see https://platform.claude.com/docs/en/build-with-claude/claude-in-amazon-bedrock#regions. Applied by lookupPrice() (pricing.ts) and lookupRate() (statusline.mjs) when isBedrockRegionalPremium() (bedrock-pricing.mjs) detects a non-global Bedrock region qualifier on the raw model id — never a flat account-wide discount, and never on a pre-4.5 row that has no such field. Added 14 catalog-pricing-reconciliation rows 2026-09-26 (unify-analytics-cost-command T10): claude-opus-5-5, gpt-5-5, gpt-5-6-luna, gpt-5-6-sol, gpt-5-6-terra, gpt-6-luna, gpt-6-sol, deepseek-v4-pro, gemini-3-6-flash, gemini-3-8-flash, gemini-3-1-flash-image, grok-4-6, qwen3-coder-30b-a3b-v1, qwen3-coder-480b-a35b-v1 — each sourced from one official vendor pricing page/API, see notes.t10CatalogReconciliation for exact quotes and URLs. deepseek-v4-pro and qwen3-coder-30b-a3b-v1 (Bedrock) remain named 'unresolved' in the T3 report's prior draft; the AWS official Price List API resolved the qwen rows where the rendered pricing page alone was ambiguous. 2026-09-27: added claude-fable-5-1 / claude-mythos-5-1 ($10/$50, cache read $0.25 = 0.025x input) and claude-fable-5 / claude-mythos-5 ($10/$50, cache read $1), and removed the estimated flag from claude-opus-4-7 / claude-opus-4-8 (published at $5/$25, cache read $0.50) — all verified at https://platform.claude.com/docs/en/about-claude/pricing. claude-sonnet-4-7, claude-sonnet-4-8 and claude-haiku-4-6 are not on that page and stay estimated. 2026-09-27: added gpt-6-astra ($10/$1/$50 short-context tier; long tier $20/$2/$75), gpt-5-5-pro ($30/$180, no cached-input discount), gpt-5-4-mini ($0.75/$0.075/$4.50) and gpt-5-4-nano ($0.20/$0.02/$1.25), and corrected rounded cacheRead on gpt-5-1 (0.125), o4-mini (0.275) and gpt-4o-mini (0.075) — standard tier at https://developers.openai.com/api/docs/pricing. 2026-09-27: added kimi-k3 ($3/$15, cache read $0.30, cache write $3, 1h cache write $6) with an identical bare `k3` alias row (kimi-code logs the bare id `k3`, and resolvePrice() does not strip a provider-less prefix), and kimi-k2-6 ($0.95/$4, cache read $0.16, cache write $0.95) — https://platform.kimi.ai/docs/pricing/chat. k3 used through api.kimi.com/coding is billed as a flat Kimi Code subscription, so its report cost is an API-equivalent estimate, not an invoice. kimi-k2.5 is no longer listed on that page; its existing row is kept as last published."
|
|
22
|
+
"note": "codemie: added claude 4-7/4-8 tier estimates 2026-06-08; added kimi-for-coding alias and normalized kimi-k2-5 key 2026-06-15; added claude-sonnet-5 pinned entry 2026-07-01 (current resolution order: exact match, then one trailing snapshot suffix stripped, then a version-first Claude id reordered to its family-first table key, else unpriced — no family/tier fallback; see resolvePrice() in pricing.ts); corrected claude-sonnet-5 to its real $2/$10 rate 2026-09-15 (was pinned at the old Sonnet 4.x $3/$15 rate — Anthropic's introductory $2/$10 pricing for Sonnet 5 became standard instead of increasing to $3/$15 as originally scheduled); added per-row bedrockRegionalMultiplier 2026-09-15 to every Sonnet 4.5+/Haiku 4.5+/Opus 4.5+ row (including their dated snapshots) — Amazon Bedrock bills a regional/multi-region endpoint (a US/EU/JP/AU cross-region inference profile, or a single named AWS region) at this multiplier over its global endpoint, for exactly these generations and later; see https://platform.claude.com/docs/en/build-with-claude/claude-in-amazon-bedrock#regions. Applied by lookupPrice() (pricing.ts) and lookupRate() (statusline.mjs) when isBedrockRegionalPremium() (bedrock-pricing.mjs) detects a non-global Bedrock region qualifier on the raw model id — never a flat account-wide discount, and never on a pre-4.5 row that has no such field. Added 14 catalog-pricing-reconciliation rows 2026-09-26 (unify-analytics-cost-command T10): claude-opus-5-5, gpt-5-5, gpt-5-6-luna, gpt-5-6-sol, gpt-5-6-terra, gpt-6-luna, gpt-6-sol, deepseek-v4-pro, gemini-3-6-flash, gemini-3-8-flash, gemini-3-1-flash-image, grok-4-6, qwen3-coder-30b-a3b-v1, qwen3-coder-480b-a35b-v1 — each sourced from one official vendor pricing page/API, see notes.t10CatalogReconciliation for exact quotes and URLs. deepseek-v4-pro and qwen3-coder-30b-a3b-v1 (Bedrock) remain named 'unresolved' in the T3 report's prior draft; the AWS official Price List API resolved the qwen rows where the rendered pricing page alone was ambiguous. 2026-09-27: added claude-fable-5-1 / claude-mythos-5-1 ($10/$50, cache read $0.25 = 0.025x input) and claude-fable-5 / claude-mythos-5 ($10/$50, cache read $1), and removed the estimated flag from claude-opus-4-7 / claude-opus-4-8 (published at $5/$25, cache read $0.50) — all verified at https://platform.claude.com/docs/en/about-claude/pricing. claude-sonnet-4-7, claude-sonnet-4-8 and claude-haiku-4-6 are not on that page and stay estimated. 2026-09-27: added gpt-6-astra ($10/$1/$50 short-context tier; long tier $20/$2/$75), gpt-5-5-pro ($30/$180, no cached-input discount), gpt-5-4-mini ($0.75/$0.075/$4.50) and gpt-5-4-nano ($0.20/$0.02/$1.25), and corrected rounded cacheRead on gpt-5-1 (0.125), o4-mini (0.275) and gpt-4o-mini (0.075) — standard tier at https://developers.openai.com/api/docs/pricing. 2026-09-27: added kimi-k3 ($3/$15, cache read $0.30, cache write $3, 1h cache write $6) with an identical bare `k3` alias row (kimi-code logs the bare id `k3`, and resolvePrice() does not strip a provider-less prefix), and kimi-k2-6 ($0.95/$4, cache read $0.16, cache write $0.95) — https://platform.kimi.ai/docs/pricing/chat. k3 used through api.kimi.com/coding is billed as a flat Kimi Code subscription, so its report cost is an API-equivalent estimate, not an invoice. kimi-k2.5 is no longer listed on that page; its existing row is kept as last published. 2026-09-29: added claude-sonnet-5-5 ($2/$10, cache read $0.20, cache write $2.50, 1h cache write $4, bedrockRegionalMultiplier 1.1 per the page's \"all future models\" scope) — https://platform.claude.com/docs/en/about-claude/pricing (Model pricing table row 'Claude Sonnet 5.5')."
|
|
23
23
|
},
|
|
24
24
|
"claude-sonnet-5": {
|
|
25
25
|
"input": 2,
|
|
@@ -29,6 +29,14 @@
|
|
|
29
29
|
"cacheWrite1h": 4.0,
|
|
30
30
|
"bedrockRegionalMultiplier": 1.1
|
|
31
31
|
},
|
|
32
|
+
"claude-sonnet-5-5": {
|
|
33
|
+
"input": 2,
|
|
34
|
+
"output": 10,
|
|
35
|
+
"cacheRead": 0.2,
|
|
36
|
+
"cacheWrite": 2.5,
|
|
37
|
+
"cacheWrite1h": 4.0,
|
|
38
|
+
"bedrockRegionalMultiplier": 1.1
|
|
39
|
+
},
|
|
32
40
|
"claude-fable-5-1": {
|
|
33
41
|
"input": 10,
|
|
34
42
|
"output": 50,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processes.d.ts","sourceRoot":"","sources":["../../src/utils/processes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EAAE,IAAI,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"processes.d.ts","sourceRoot":"","sources":["../../src/utils/processes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EAAE,IAAI,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAUpE;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAWrE;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAuB5E;AAMD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,wCAAwC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,+CAA+C;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,oBAAoB;IACnC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9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AAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAsB9E;AAGD,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/utils/processes.js
CHANGED
|
@@ -10,6 +10,7 @@ import os from 'node:os';
|
|
|
10
10
|
import { logger } from './logger.js';
|
|
11
11
|
import { exec } from './exec.js';
|
|
12
12
|
import { extractRepository } from './paths.js';
|
|
13
|
+
import { getNpmPrefixArgs } from '../utils/npm-prefix.js';
|
|
13
14
|
const execAsync = promisify(childProcessExec);
|
|
14
15
|
// ============================================================================
|
|
15
16
|
// Command Detection
|
|
@@ -98,7 +99,7 @@ export async function installGlobal(packageName, options = {}) {
|
|
|
98
99
|
timeout,
|
|
99
100
|
shell: isWindows // npm is a .cmd file on Windows
|
|
100
101
|
};
|
|
101
|
-
const args = ['install', '-g'];
|
|
102
|
+
const args = ['install', '-g', ...(await getNpmPrefixArgs())];
|
|
102
103
|
if (options.force) {
|
|
103
104
|
args.push('--force');
|
|
104
105
|
}
|
|
@@ -137,7 +138,8 @@ export async function uninstallGlobal(packageName, options = {}) {
|
|
|
137
138
|
timeout,
|
|
138
139
|
shell: isWindows // npm is a .cmd file on Windows
|
|
139
140
|
};
|
|
140
|
-
const
|
|
141
|
+
const args = ['uninstall', '-g', ...(await getNpmPrefixArgs()), packageName];
|
|
142
|
+
const result = await exec('npm', args, execOptions);
|
|
141
143
|
if (result.code !== 0) {
|
|
142
144
|
throw new Error(`npm uninstall exited with code ${result.code}: ${result.stderr || result.stdout}`);
|
|
143
145
|
}
|
|
@@ -173,7 +175,8 @@ export async function listGlobal(packageName, options = {}) {
|
|
|
173
175
|
timeout,
|
|
174
176
|
shell: isWindows // npm is a .cmd file on Windows
|
|
175
177
|
};
|
|
176
|
-
const
|
|
178
|
+
const args = ['list', '-g', ...(await getNpmPrefixArgs()), packageName];
|
|
179
|
+
const result = await exec('npm', args, execOptions);
|
|
177
180
|
// Exit code 0 = installed, 1 = not found, >1 = error
|
|
178
181
|
return result.code === 0;
|
|
179
182
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processes.js","sourceRoot":"","sources":["../../src/utils/processes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,IAAI,gBAAgB,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAqC,MAAM,WAAW,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"processes.js","sourceRoot":"","sources":["../../src/utils/processes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,IAAI,gBAAgB,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAqC,MAAM,WAAW,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,SAAS,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAAC;AAE9C,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAAe;IACjD,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,EAAE,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAC;QAC5C,oFAAoF;QACpF,MAAM,YAAY,GAA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AAE,KAAK,CAAC,CAAC;QAC/D,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,oDAAoD;AACpD,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codemieai/code",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.6",
|
|
4
4
|
"description": "Unified AI coding assistant CLI - Manage Claude Code, Gemini & custom agents. Multi-provider support (OpenAI, Azure, LiteLLM, SSO). Built-in LangGraph agent with file operations & git integration.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"@modelcontextprotocol/server": "2.0.0-alpha.2",
|
|
130
130
|
"chalk": "^5.3.0",
|
|
131
131
|
"cli-table3": "^0.6.5",
|
|
132
|
-
"codemie-sdk": "^0.1.
|
|
132
|
+
"codemie-sdk": "^0.1.648",
|
|
133
133
|
"commander": "^11.1.0",
|
|
134
134
|
"cors": "^2.8.5",
|
|
135
135
|
"dedent": "^1.7.1",
|
|
@@ -17,12 +17,24 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import * as esbuild from 'esbuild';
|
|
20
|
-
import { fileURLToPath } from 'url';
|
|
20
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
21
21
|
import { dirname, join } from 'path';
|
|
22
22
|
|
|
23
23
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
24
24
|
const rootDir = join(__dirname, '..');
|
|
25
25
|
|
|
26
|
+
// The rate card is built by the same code the analytics report prices with (priceTable() merges
|
|
27
|
+
// pricing.json with CodeMie-only rows such as `claude-smart-router`) and inlined into the bundle,
|
|
28
|
+
// so the statusline has no runtime dependency on a sibling file that can be missing or stale.
|
|
29
|
+
// Runs after `tsc`, which is where dist/utils/pricing.js comes from (see the `build` script).
|
|
30
|
+
const pricingModule = join(rootDir, 'dist/utils/pricing.js');
|
|
31
|
+
let priceTable;
|
|
32
|
+
try {
|
|
33
|
+
({ priceTable } = await import(pathToFileURL(pricingModule).href));
|
|
34
|
+
} catch (error) {
|
|
35
|
+
throw new Error(`Cannot embed the rate card: ${pricingModule} is missing — run \`tsc\` (npm run build) first. ${error.message}`);
|
|
36
|
+
}
|
|
37
|
+
|
|
26
38
|
await esbuild.build({
|
|
27
39
|
entryPoints: [join(rootDir, 'src/agents/plugins/claude/plugin/statusline.ts')],
|
|
28
40
|
outfile: join(rootDir, 'dist/agents/plugins/claude/plugin/statusline.bundle.mjs'),
|
|
@@ -31,6 +43,7 @@ await esbuild.build({
|
|
|
31
43
|
format: 'esm',
|
|
32
44
|
target: 'node20',
|
|
33
45
|
tsconfig: join(rootDir, 'tsconfig.json'),
|
|
46
|
+
define: { __CODEMIE_PRICE_TABLE__: JSON.stringify(JSON.stringify(priceTable())) },
|
|
34
47
|
logLevel: 'info',
|
|
35
48
|
});
|
|
36
49
|
|