@cargo-ai/cli 1.0.134 → 1.0.135
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../../src/commands/ask/harness/usage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../../src/commands/ask/harness/usage.ts"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,MAAM,CAYT;AAED;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,cAAc,CAAC;IACtB;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,wBAAgB,qBAAqB,CACnC,mBAAmB,EAAE,MAAM,GAC1B,oBAAoB,CActB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAEhE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,WAAW,EAAE,oBAAoB,EACjC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,IAAI,CAwCN;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,OAAO,GAEZ;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACtE,SAAS,CAkBZ;AAQD;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,MAAM,GAAG,SAAS,CA0BpB"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* What one Cargo credit is worth,
|
|
3
|
-
* million tokens. Mirrors
|
|
4
|
-
* `
|
|
2
|
+
* What one Cargo credit is worth, the markup language model usage is resold
|
|
3
|
+
* at, and what the sandbox proxy charges per million tokens. Mirrors
|
|
4
|
+
* `CREDIT_USD_VALUE` and `LANGUAGE_MODEL_MARKUP` in the backend's billing
|
|
5
|
+
* utils and `ANTHROPIC_FALLBACK_RATES_USD_PER_MILLION` in its harness usage:
|
|
5
6
|
* the proxy prices each request from these, not from Claude Code's own cost,
|
|
6
7
|
* so the credits shown after a turn have to use them too.
|
|
7
8
|
*/
|
|
8
9
|
const USD_PER_CREDIT = 0.04;
|
|
10
|
+
const LANGUAGE_MODEL_MARKUP = 2;
|
|
9
11
|
const PROXY_RATES_USD_PER_MILLION = {
|
|
10
12
|
input: 3,
|
|
11
13
|
output: 15,
|
|
@@ -21,7 +23,7 @@ export function creditsForStep(tokens) {
|
|
|
21
23
|
PROXY_RATES_USD_PER_MILLION.input +
|
|
22
24
|
tokens.cacheReadTokens * PROXY_RATES_USD_PER_MILLION.cacheRead +
|
|
23
25
|
tokens.outputTokens * PROXY_RATES_USD_PER_MILLION.output;
|
|
24
|
-
const credits = usdPerMillion / 1_000_000 / USD_PER_CREDIT;
|
|
26
|
+
const credits = (usdPerMillion / 1_000_000 / USD_PER_CREDIT) * LANGUAGE_MODEL_MARKUP;
|
|
25
27
|
// `toFixed` first, as the backend does, so float noise cannot round an
|
|
26
28
|
// exact hundredth up by one.
|
|
27
29
|
return Math.ceil(Number((credits * 100).toFixed(6))) / 100;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cargo-ai/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.135",
|
|
4
4
|
"mcpName": "io.github.getcargohq/cargo",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -74,10 +74,10 @@
|
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"@ai-sdk/harness": "1.0.144",
|
|
76
76
|
"@ai-sdk/harness-claude-code": "1.0.148",
|
|
77
|
-
"@cargo-ai/api": "^1.0.
|
|
77
|
+
"@cargo-ai/api": "^1.0.102",
|
|
78
78
|
"@cargo-ai/app-sdk": "^1.0.11",
|
|
79
79
|
"@cargo-ai/cdk": "^1.0.126",
|
|
80
|
-
"@cargo-ai/types": "^1.0.
|
|
80
|
+
"@cargo-ai/types": "^1.0.104",
|
|
81
81
|
"@cargo-ai/utils": "^1.0.35",
|
|
82
82
|
"@cargo-ai/worker-sdk": "^1.0.21",
|
|
83
83
|
"@modelcontextprotocol/sdk": "^1.31.0",
|