@nexrall/code-core 1.4.61 → 1.4.62
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/agent/loop.d.ts +1 -1
- package/dist/agent/loop.d.ts.map +1 -1
- package/dist/agent/loop.js +51 -2
- package/dist/api/client.d.ts +40 -0
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +51 -2
- package/dist/auth/index.d.ts +23 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +52 -0
- package/dist/tools/executor.js +2 -2
- package/dist/types.d.ts +28 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/agent/loop.d.ts
CHANGED
|
@@ -96,7 +96,7 @@ export declare function executeAgentMemoryWrite(input: Record<string, unknown>,
|
|
|
96
96
|
* final answer, or the user pressed Ctrl+C and already knows why it stopped.
|
|
97
97
|
* EVERYTHING else owes the user an explanation, which is what stopReasonNotice covers.
|
|
98
98
|
*/
|
|
99
|
-
export type StopReason = 'clean' | 'aborted' | 'reported-elsewhere' | 'empty-response' | 'output-limit' | 'no-balance' | 'stalled' | 'stalled-repeat' | 'budget' | 'unknown';
|
|
99
|
+
export type StopReason = 'clean' | 'aborted' | 'reported-elsewhere' | 'empty-response' | 'output-limit' | 'no-balance' | 'no-team-budget' | 'team-unavailable' | 'stalled' | 'stalled-repeat' | 'budget' | 'unknown';
|
|
100
100
|
/**
|
|
101
101
|
* The message shown when a run ends for any reason other than a clean finish.
|
|
102
102
|
*
|
package/dist/agent/loop.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../src/agent/loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAKP,UAAU,EACV,gBAAgB,EAChB,UAAU,EACX,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../src/agent/loop.ts"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AC,MAAM,EAAE,OAAO,CAAC,EAC9B,OAAO,EAAE,gBAAgB,EACzB,UAAU,EAAE,SAAS,EAAE,GACtB,OAAO,CAAC,UAAU,CAAC,CAyBrB;AAID,wBAAsB,YAAY,CAChC,eAAe,EAAE,OAAO,EAAE,EAC1B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,OAAO,EAAE,CAAC,CA0qCpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAqCtE"}
|
package/dist/agent/loop.js
CHANGED
|
@@ -73,6 +73,7 @@ exports.runAgentLoop = runAgentLoop;
|
|
|
73
73
|
exports.trimToResumableBoundary = trimToResumableBoundary;
|
|
74
74
|
const types_1 = require("../types");
|
|
75
75
|
const client_1 = require("../api/client");
|
|
76
|
+
const index_1 = require("../auth/index");
|
|
76
77
|
const executor_1 = require("../tools/executor");
|
|
77
78
|
const agentTypes_1 = require("./agentTypes");
|
|
78
79
|
const skills_1 = require("./skills");
|
|
@@ -86,7 +87,7 @@ const planMode_1 = require("./planMode");
|
|
|
86
87
|
const worktreeEnforcement_1 = require("./worktreeEnforcement");
|
|
87
88
|
const agentRegistry_1 = require("./agentRegistry");
|
|
88
89
|
const sandbox_1 = require("../tools/sandbox");
|
|
89
|
-
const
|
|
90
|
+
const index_2 = require("../plugins/index");
|
|
90
91
|
const testIntegrity_1 = require("./testIntegrity");
|
|
91
92
|
const flaky_1 = require("./flaky");
|
|
92
93
|
const claimEvidence_1 = require("./claimEvidence");
|
|
@@ -107,7 +108,7 @@ function loadHooks(workDir) {
|
|
|
107
108
|
}
|
|
108
109
|
catch { /* ignore */ }
|
|
109
110
|
// Merge plugin-provided hooks AFTER the project's own (project hooks run first).
|
|
110
|
-
const fromPlugins = (0,
|
|
111
|
+
const fromPlugins = (0, index_2.pluginHooks)(workDir);
|
|
111
112
|
const merged = { ...fromSettings };
|
|
112
113
|
for (const phase of Object.keys(fromPlugins)) {
|
|
113
114
|
const extra = fromPlugins[phase];
|
|
@@ -411,6 +412,14 @@ function stopReasonNotice(reason, ctx = {}) {
|
|
|
411
412
|
case 'no-balance':
|
|
412
413
|
return `\n\ud83d\udcb3 Stopped: your balance is empty, so the request was rejected before it started. ` +
|
|
413
414
|
`Top up and send "continue" \u2014 no tokens were used for this turn.\n`;
|
|
415
|
+
case 'no-team-budget':
|
|
416
|
+
return `\n\ud83d\udcb3 Stopped: the team budget you are billing to is empty, so the request was rejected ` +
|
|
417
|
+
`before it started. Ask your team admin to add funds \u2014 or switch "Bill to" back to Personal \u2014 ` +
|
|
418
|
+
`and send "continue". No tokens were used for this turn.\n`;
|
|
419
|
+
case 'team-unavailable':
|
|
420
|
+
return `\n\u26a0\ufe0f Stopped: that team is no longer available for billing (you may have been removed, or the ` +
|
|
421
|
+
`team was suspended). "Bill to" has been reset to your Personal account, so sending "continue" will ` +
|
|
422
|
+
`run on your own wallet.\n`;
|
|
414
423
|
case 'stalled':
|
|
415
424
|
return `\n\ud83d\uded1 Stopped: the last ${STALL_LIMIT} tool rounds all failed, so the agent looked stuck. ` +
|
|
416
425
|
`Fix the underlying error (or grant the needed permission) and send "continue".\n`;
|
|
@@ -429,6 +438,17 @@ function stopReasonNotice(reason, ctx = {}) {
|
|
|
429
438
|
`send "continue" to resume.\n`;
|
|
430
439
|
}
|
|
431
440
|
}
|
|
441
|
+
// Error codes that mean "this team cannot pay for anything right now" — the
|
|
442
|
+
// pre-flight refusals routes/code.js returns when a request names a team
|
|
443
|
+
// (migration 139). Kept as one list so the loop's auto-fallback and the server's
|
|
444
|
+
// vocabulary cannot drift apart silently.
|
|
445
|
+
const TEAM_SCOPE_ERROR_CODES = new Set([
|
|
446
|
+
'team_unavailable',
|
|
447
|
+
'team_not_found',
|
|
448
|
+
'not_a_member',
|
|
449
|
+
'member_suspended',
|
|
450
|
+
'team_suspended',
|
|
451
|
+
]);
|
|
432
452
|
// Resolve the soft iteration budget. Precedence:
|
|
433
453
|
// options.maxIterations → env NEXRALL_MAX_ITERATIONS → settings.maxIterations → default
|
|
434
454
|
//
|
|
@@ -3008,6 +3028,23 @@ async function runAgentLoop(initialMessages, options) {
|
|
|
3008
3028
|
// low/zero-balance nudge a mid-turn 'balance_status' event would, instead of a
|
|
3009
3029
|
// generic "Stream failed: Insufficient balance…" error with no actionable UI.
|
|
3010
3030
|
const status = err.status;
|
|
3031
|
+
const code = err.code;
|
|
3032
|
+
// Pre-flight 402 can mean one of TWO things now: the personal wallet is empty,
|
|
3033
|
+
// or the TEAM pool the user chose to bill to has run out (migration 139). They
|
|
3034
|
+
// need opposite calls to action — "top up your wallet" vs "ask your team
|
|
3035
|
+
// admin" — so the server's `code` decides which notice the user gets. Getting
|
|
3036
|
+
// this wrong would tell an employee to top up a wallet they never chose, for a
|
|
3037
|
+
// bill their employer was supposed to pay.
|
|
3038
|
+
if (status === 402 && code === 'team_budget_exhausted') {
|
|
3039
|
+
const remaining = err.remaining ?? 0;
|
|
3040
|
+
const teamId = err.teamId;
|
|
3041
|
+
// Prefer the client's own rich UI where it exists…
|
|
3042
|
+
options.onTeamBudgetStatus?.({ teamId, remaining });
|
|
3043
|
+
// …and fall back to the plain-text notice otherwise. Deliberately NOT the
|
|
3044
|
+
// wallet bubble: its "top up" button pays the wrong account.
|
|
3045
|
+
stopReason = options.onTeamBudgetStatus ? 'reported-elsewhere' : 'no-team-budget';
|
|
3046
|
+
break;
|
|
3047
|
+
}
|
|
3011
3048
|
if (status === 402) {
|
|
3012
3049
|
const balance = err.balance ?? 0;
|
|
3013
3050
|
// Prefer the rich, actionable UI (a persistent bubble with a link to Billing)
|
|
@@ -3022,6 +3059,18 @@ async function runAgentLoop(initialMessages, options) {
|
|
|
3022
3059
|
stopReason = options.onBalanceStatus ? 'reported-elsewhere' : 'no-balance';
|
|
3023
3060
|
break;
|
|
3024
3061
|
}
|
|
3062
|
+
// A 403 naming a TEAM problem means the "Bill to" choice is no longer usable:
|
|
3063
|
+
// the member was removed, the team was suspended/deleted, or the account never
|
|
3064
|
+
// had access. Reset the stored choice so the NEXT turn bills the personal wallet
|
|
3065
|
+
// instead of failing the same way forever — and SAY so (stopReasonNotice),
|
|
3066
|
+
// because a silent downgrade after the user explicitly chose a company is the
|
|
3067
|
+
// trust bug docs/TEAMS_ENTERPRISE_BUDGETS_2026-09.md §D4 warns about. The reset
|
|
3068
|
+
// is what makes "send continue" work; the notice is what makes it honest.
|
|
3069
|
+
if (status === 403 && typeof code === 'string' && TEAM_SCOPE_ERROR_CODES.has(code)) {
|
|
3070
|
+
(0, index_1.setBillingTeamId)(null);
|
|
3071
|
+
stopReason = 'team-unavailable';
|
|
3072
|
+
break;
|
|
3073
|
+
}
|
|
3025
3074
|
runSimpleHooks(hooks.OnError, options.workDir);
|
|
3026
3075
|
// Carry the work already done in this turn out with the error. The loop
|
|
3027
3076
|
// owns a COPY of the caller's history, so a plain throw would strand every
|
package/dist/api/client.d.ts
CHANGED
|
@@ -131,6 +131,46 @@ export interface DescribeAttachmentResult {
|
|
|
131
131
|
}
|
|
132
132
|
export declare function describeAttachment(kind: 'image' | 'pdf', data: string, mediaType?: string, name?: string): Promise<DescribeAttachmentResult>;
|
|
133
133
|
export declare function getBalance(): Promise<number>;
|
|
134
|
+
/**
|
|
135
|
+
* One team the caller belongs to, as the server's role-aware DTO
|
|
136
|
+
* (services/teams.js teamViewToDto). The pool fields are present only for
|
|
137
|
+
* owners/admins — a plain member receives just their own numbers, which is why
|
|
138
|
+
* they are optional here rather than a lie about what everyone gets.
|
|
139
|
+
*/
|
|
140
|
+
export interface OrgTeam {
|
|
141
|
+
id: number;
|
|
142
|
+
name: string;
|
|
143
|
+
role: 'owner' | 'admin' | 'member';
|
|
144
|
+
status: 'active' | 'suspended';
|
|
145
|
+
teamStatus: 'active' | 'suspended';
|
|
146
|
+
/** What THIS member may still spend this month — computed server-side; never re-derive it. */
|
|
147
|
+
remainingUsd: number;
|
|
148
|
+
limitUsd: number | null;
|
|
149
|
+
spentUsd: number;
|
|
150
|
+
memberCount: number;
|
|
151
|
+
lastActiveAt?: string | null;
|
|
152
|
+
poolBalanceUsd?: number;
|
|
153
|
+
teamSpentThisMonthUsd?: number;
|
|
154
|
+
periodLimitUsd?: number | null;
|
|
155
|
+
allowOverage?: boolean;
|
|
156
|
+
defaultMemberLimitUsd?: number | null;
|
|
157
|
+
ownerUserId?: number;
|
|
158
|
+
}
|
|
159
|
+
export interface OrgsResult {
|
|
160
|
+
personal: {
|
|
161
|
+
balance: number;
|
|
162
|
+
};
|
|
163
|
+
teams: OrgTeam[];
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Personal balance + every team the caller belongs to, in one call.
|
|
167
|
+
*
|
|
168
|
+
* Throws on failure — INCLUDING a 404 from a backend that predates migration
|
|
169
|
+
* 139. Callers treat any failure as "no teams to offer" and keep the personal
|
|
170
|
+
* flow, which is exactly what an old server means; that decision belongs to
|
|
171
|
+
* them, not here, so this function does not soften real errors into empty data.
|
|
172
|
+
*/
|
|
173
|
+
export declare function getOrgs(): Promise<OrgsResult>;
|
|
134
174
|
export interface CodeModelInfo {
|
|
135
175
|
id: string;
|
|
136
176
|
label: string;
|
package/dist/api/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAA8B,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAiErH,eAAO,MAAM,QAAQ,QAAmB,CAAC;AAIzC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAC5D,OAAO,EAAE,CAAC,EAAE,EACZ,UAAU,EAAE,KAAK,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,I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AAI,EAAE,aAAa,EAAE,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,IAAI,SAAK,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAyBxE;AAID,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CA+B1E;AAID,wBAAsB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CA0BhF;AAID,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAqB3D"}
|
package/dist/api/client.js
CHANGED
|
@@ -10,6 +10,7 @@ exports.cancelTurn = cancelTurn;
|
|
|
10
10
|
exports.revokeRefreshToken = revokeRefreshToken;
|
|
11
11
|
exports.describeAttachment = describeAttachment;
|
|
12
12
|
exports.getBalance = getBalance;
|
|
13
|
+
exports.getOrgs = getOrgs;
|
|
13
14
|
exports.getCodeModels = getCodeModels;
|
|
14
15
|
exports.getUsageDaily = getUsageDaily;
|
|
15
16
|
exports.exchangeVscodeCode = exchangeVscodeCode;
|
|
@@ -463,7 +464,7 @@ async function streamChat(messages, options, onEvent) {
|
|
|
463
464
|
{
|
|
464
465
|
method: 'POST',
|
|
465
466
|
headers: authHeaders(),
|
|
466
|
-
body: JSON.stringify({ messages, model, env, editorContext, nexrallMd, mode, effort, clientType, extraTools, agents, skills, turnId, canWriteSharedMemory, hasOwnAgentStore, canSpawnSubAgents, canBrowseWeb }),
|
|
467
|
+
body: JSON.stringify({ messages, model, env, editorContext, nexrallMd, mode, effort, clientType, extraTools, agents, skills, turnId, canWriteSharedMemory, hasOwnAgentStore, canSpawnSubAgents, canBrowseWeb, teamId: (0, index_1.getBillingTeamId)() }),
|
|
467
468
|
signal,
|
|
468
469
|
},
|
|
469
470
|
];
|
|
@@ -864,12 +865,25 @@ async function streamChat(messages, options, onEvent) {
|
|
|
864
865
|
const errText = errorBodyOverride ?? await response.text();
|
|
865
866
|
let errMsg = `API error ${response.status}`;
|
|
866
867
|
let balance;
|
|
868
|
+
// code/remaining/teamId are the team-billing fields (migration 139). The
|
|
869
|
+
// pre-flight refusal for an exhausted team sends code:'team_budget_exhausted'
|
|
870
|
+
// and NO `balance` — reading only `balance` would make it indistinguishable
|
|
871
|
+
// from an empty personal wallet, and the two need opposite calls to action.
|
|
872
|
+
let code;
|
|
873
|
+
let remaining;
|
|
874
|
+
let teamId;
|
|
867
875
|
try {
|
|
868
876
|
const parsed = JSON.parse(errText);
|
|
869
877
|
if (parsed.error)
|
|
870
878
|
errMsg = parsed.error;
|
|
871
879
|
if (typeof parsed.balance === 'number')
|
|
872
880
|
balance = parsed.balance;
|
|
881
|
+
if (typeof parsed.code === 'string')
|
|
882
|
+
code = parsed.code;
|
|
883
|
+
if (typeof parsed.remaining === 'number')
|
|
884
|
+
remaining = parsed.remaining;
|
|
885
|
+
if (typeof parsed.teamId === 'number')
|
|
886
|
+
teamId = parsed.teamId;
|
|
873
887
|
}
|
|
874
888
|
catch {
|
|
875
889
|
errMsg = errText || errMsg;
|
|
@@ -888,6 +902,10 @@ async function streamChat(messages, options, onEvent) {
|
|
|
888
902
|
throw Object.assign(new Error(errMsg), {
|
|
889
903
|
status: response.status,
|
|
890
904
|
balance,
|
|
905
|
+
// Team-billing context (migration 139) — see the parse above.
|
|
906
|
+
...(code ? { code } : {}),
|
|
907
|
+
...(remaining !== undefined ? { remaining } : {}),
|
|
908
|
+
...(teamId !== undefined ? { teamId } : {}),
|
|
891
909
|
...(forbiddenExhausted ? { retryable: true } : {}),
|
|
892
910
|
...(sessionExpired ? { authExpired: true } : {}),
|
|
893
911
|
});
|
|
@@ -1615,7 +1633,7 @@ async function describeAttachment(kind, data, mediaType, name) {
|
|
|
1615
1633
|
const fetchOnce = () => (0, node_fetch_1.default)(`${exports.API_BASE}/api/code/assets/describe`, {
|
|
1616
1634
|
method: 'POST',
|
|
1617
1635
|
headers: { ...authHeaders(), 'Content-Type': 'application/json' },
|
|
1618
|
-
body: JSON.stringify({ kind, data, media_type: mediaType, name }),
|
|
1636
|
+
body: JSON.stringify({ kind, data, media_type: mediaType, name, teamId: (0, index_1.getBillingTeamId)() }),
|
|
1619
1637
|
});
|
|
1620
1638
|
let response = await fetchOnce();
|
|
1621
1639
|
// Same silent-refresh pattern as every other authenticated call here — an
|
|
@@ -1669,6 +1687,37 @@ async function getBalance() {
|
|
|
1669
1687
|
const data = (await response.json());
|
|
1670
1688
|
return typeof data.balance === 'number' ? data.balance : 0;
|
|
1671
1689
|
}
|
|
1690
|
+
/**
|
|
1691
|
+
* Personal balance + every team the caller belongs to, in one call.
|
|
1692
|
+
*
|
|
1693
|
+
* Throws on failure — INCLUDING a 404 from a backend that predates migration
|
|
1694
|
+
* 139. Callers treat any failure as "no teams to offer" and keep the personal
|
|
1695
|
+
* flow, which is exactly what an old server means; that decision belongs to
|
|
1696
|
+
* them, not here, so this function does not soften real errors into empty data.
|
|
1697
|
+
*/
|
|
1698
|
+
async function getOrgs() {
|
|
1699
|
+
const fetchOnce = () => (0, node_fetch_1.default)(`${exports.API_BASE}/api/code/orgs`, { method: 'GET', headers: authHeaders() });
|
|
1700
|
+
let response = await fetchOnce();
|
|
1701
|
+
// Same silent-refresh pattern as getBalance: on an expired token this is
|
|
1702
|
+
// frequently the first call the panel makes.
|
|
1703
|
+
if (response.status === 401 || response.status === 403) {
|
|
1704
|
+
const body = await response.text().catch(() => '');
|
|
1705
|
+
if (isExpiredTokenResponse(response.status, body) && await refreshAccessToken()) {
|
|
1706
|
+
response = await fetchOnce();
|
|
1707
|
+
}
|
|
1708
|
+
else {
|
|
1709
|
+
throw new Error(`API error ${response.status}: ${body}`);
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
if (!response.ok) {
|
|
1713
|
+
throw new Error(`API error ${response.status}`);
|
|
1714
|
+
}
|
|
1715
|
+
const json = (await response.json());
|
|
1716
|
+
return {
|
|
1717
|
+
personal: { balance: typeof json.personal?.balance === 'number' ? json.personal.balance : 0 },
|
|
1718
|
+
teams: Array.isArray(json.teams) ? json.teams : [],
|
|
1719
|
+
};
|
|
1720
|
+
}
|
|
1672
1721
|
async function getCodeModels() {
|
|
1673
1722
|
const fetchOnce = () => (0, node_fetch_1.default)(`${exports.API_BASE}/api/code/models`, { method: 'GET', headers: authHeaders() });
|
|
1674
1723
|
let response = await fetchOnce();
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -25,4 +25,27 @@ export declare function getRefreshToken(): string | null;
|
|
|
25
25
|
* skipped just because the access token is what the caller needed.
|
|
26
26
|
*/
|
|
27
27
|
export declare function updateTokens(token: string, refreshToken?: string): void;
|
|
28
|
+
/**
|
|
29
|
+
* The team whose budget this installation's usage is billed to, or null for the
|
|
30
|
+
* personal wallet.
|
|
31
|
+
*
|
|
32
|
+
* Deliberately NOT honoured under NEXRALL_TOKEN: that path is CI/headless, has
|
|
33
|
+
* no config file identity of its own, and charging a company's pool from a
|
|
34
|
+
* build job that merely happens to run on someone's machine is worse than the
|
|
35
|
+
* convenience. env-token runs always bill the token owner.
|
|
36
|
+
*
|
|
37
|
+
* A malformed stored value (hand-edited config, or written by a future version)
|
|
38
|
+
* reads as null rather than being passed through — the server would refuse it
|
|
39
|
+
* anyway, and failing toward "personal" is the honest, visible outcome.
|
|
40
|
+
*/
|
|
41
|
+
export declare function getBillingTeamId(): number | null;
|
|
42
|
+
/**
|
|
43
|
+
* Persist the "Bill to" choice. `null` clears it (back to the personal wallet).
|
|
44
|
+
*
|
|
45
|
+
* Reads the file directly rather than via loadAuth() for the same reason
|
|
46
|
+
* updateTokens does: under NEXRALL_TOKEN, loadAuth returns a synthetic
|
|
47
|
+
* single-field object, and writing THAT back would destroy the user's real
|
|
48
|
+
* stored credentials. Any other fields already in the file are preserved.
|
|
49
|
+
*/
|
|
50
|
+
export declare function setBillingTeamId(teamId: number | null): void;
|
|
28
51
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/auth/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAiB3C,wBAAgB,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAGjD;AAED,wBAAgB,QAAQ,IAAI,UAAU,GAAG,IAAI,CAwB5C;AAED,wBAAgB,SAAS,IAAI,IAAI,CAQhC;AAED,wBAAgB,eAAe,IAAI,OAAO,CAGzC;AAED,wBAAgB,QAAQ,IAAI,MAAM,GAAG,IAAI,CAGxC;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAM/C;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAsBvE"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAiB3C,wBAAgB,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAGjD;AAED,wBAAgB,QAAQ,IAAI,UAAU,GAAG,IAAI,CAwB5C;AAED,wBAAgB,SAAS,IAAI,IAAI,CAQhC;AAED,wBAAgB,eAAe,IAAI,OAAO,CAGzC;AAED,wBAAgB,QAAQ,IAAI,MAAM,GAAG,IAAI,CAGxC;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAM/C;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAsBvE;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAIhD;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAoB5D"}
|
package/dist/auth/index.js
CHANGED
|
@@ -40,6 +40,8 @@ exports.isAuthenticated = isAuthenticated;
|
|
|
40
40
|
exports.getToken = getToken;
|
|
41
41
|
exports.getRefreshToken = getRefreshToken;
|
|
42
42
|
exports.updateTokens = updateTokens;
|
|
43
|
+
exports.getBillingTeamId = getBillingTeamId;
|
|
44
|
+
exports.setBillingTeamId = setBillingTeamId;
|
|
43
45
|
const fs = __importStar(require("fs"));
|
|
44
46
|
const path = __importStar(require("path"));
|
|
45
47
|
const os = __importStar(require("os"));
|
|
@@ -150,4 +152,54 @@ function updateTokens(token, refreshToken) {
|
|
|
150
152
|
};
|
|
151
153
|
fs.writeFileSync(CONFIG_FILE, JSON.stringify(next, null, 2), { mode: 0o600 });
|
|
152
154
|
}
|
|
155
|
+
// ─── Billing target ("Bill to", migration 139) ────────────────────────────────
|
|
156
|
+
/**
|
|
157
|
+
* The team whose budget this installation's usage is billed to, or null for the
|
|
158
|
+
* personal wallet.
|
|
159
|
+
*
|
|
160
|
+
* Deliberately NOT honoured under NEXRALL_TOKEN: that path is CI/headless, has
|
|
161
|
+
* no config file identity of its own, and charging a company's pool from a
|
|
162
|
+
* build job that merely happens to run on someone's machine is worse than the
|
|
163
|
+
* convenience. env-token runs always bill the token owner.
|
|
164
|
+
*
|
|
165
|
+
* A malformed stored value (hand-edited config, or written by a future version)
|
|
166
|
+
* reads as null rather than being passed through — the server would refuse it
|
|
167
|
+
* anyway, and failing toward "personal" is the honest, visible outcome.
|
|
168
|
+
*/
|
|
169
|
+
function getBillingTeamId() {
|
|
170
|
+
const auth = loadAuth();
|
|
171
|
+
const v = auth?.billingTeamId;
|
|
172
|
+
return typeof v === 'number' && Number.isSafeInteger(v) && v > 0 ? v : null;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Persist the "Bill to" choice. `null` clears it (back to the personal wallet).
|
|
176
|
+
*
|
|
177
|
+
* Reads the file directly rather than via loadAuth() for the same reason
|
|
178
|
+
* updateTokens does: under NEXRALL_TOKEN, loadAuth returns a synthetic
|
|
179
|
+
* single-field object, and writing THAT back would destroy the user's real
|
|
180
|
+
* stored credentials. Any other fields already in the file are preserved.
|
|
181
|
+
*/
|
|
182
|
+
function setBillingTeamId(teamId) {
|
|
183
|
+
let existing = {};
|
|
184
|
+
try {
|
|
185
|
+
if (fs.existsSync(CONFIG_FILE)) {
|
|
186
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf-8'));
|
|
187
|
+
if (typeof parsed === 'object' && parsed !== null)
|
|
188
|
+
existing = parsed;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
catch { /* corrupt or unreadable — start clean rather than refuse to save */ }
|
|
192
|
+
ensureConfigDir();
|
|
193
|
+
const next = { ...existing };
|
|
194
|
+
if (typeof teamId === 'number' && Number.isSafeInteger(teamId) && teamId > 0) {
|
|
195
|
+
next.billingTeamId = teamId;
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
// Removed rather than set to null: an older client reading this file must
|
|
199
|
+
// see exactly what it saw before the field existed ("bill personal"), and
|
|
200
|
+
// `null` in a JSON config is a shape nothing else in this file uses.
|
|
201
|
+
delete next.billingTeamId;
|
|
202
|
+
}
|
|
203
|
+
fs.writeFileSync(CONFIG_FILE, JSON.stringify(next, null, 2), { mode: 0o600 });
|
|
204
|
+
}
|
|
153
205
|
//# sourceMappingURL=index.js.map
|
package/dist/tools/executor.js
CHANGED
|
@@ -2566,7 +2566,7 @@ async function generateImage(input, workDir, abortSignal) {
|
|
|
2566
2566
|
let cost;
|
|
2567
2567
|
let balance;
|
|
2568
2568
|
try {
|
|
2569
|
-
const r = await _httpsPost(`${client_1.API_BASE}/api/code/assets/generate`, JSON.stringify({ prompt, aspect_ratio: aspectRatio }), { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` }, 170000, abortSignal);
|
|
2569
|
+
const r = await _httpsPost(`${client_1.API_BASE}/api/code/assets/generate`, JSON.stringify({ prompt, aspect_ratio: aspectRatio, teamId: (0, auth_1.getBillingTeamId)() }), { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` }, 170000, abortSignal);
|
|
2570
2570
|
let json = {};
|
|
2571
2571
|
try {
|
|
2572
2572
|
json = JSON.parse(r.body);
|
|
@@ -2701,7 +2701,7 @@ async function webSearch(input, _workDir, abortSignal) {
|
|
|
2701
2701
|
if (!token)
|
|
2702
2702
|
return { error: 'Not authenticated. Run `nexrall-code login` first.' };
|
|
2703
2703
|
try {
|
|
2704
|
-
const r = await _httpsPost(`${client_1.API_BASE}/api/code/tools/web_search`, JSON.stringify({ query }), { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` }, 30000, abortSignal);
|
|
2704
|
+
const r = await _httpsPost(`${client_1.API_BASE}/api/code/tools/web_search`, JSON.stringify({ query, teamId: (0, auth_1.getBillingTeamId)() }), { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` }, 30000, abortSignal);
|
|
2705
2705
|
let json = {};
|
|
2706
2706
|
try {
|
|
2707
2707
|
json = JSON.parse(r.body);
|
package/dist/types.d.ts
CHANGED
|
@@ -225,6 +225,22 @@ export interface AuthConfig {
|
|
|
225
225
|
*/
|
|
226
226
|
refreshToken?: string;
|
|
227
227
|
email?: string;
|
|
228
|
+
/**
|
|
229
|
+
* Which TEAM's budget this installation's usage is billed to (migration
|
|
230
|
+
* 139), or absent for the personal wallet.
|
|
231
|
+
*
|
|
232
|
+
* Stored in the SAME config file as the token on purpose: the CLI, the VS
|
|
233
|
+
* Code extension and the desktop app all read this one file, so "Bill to
|
|
234
|
+
* Acme" chosen in one client is the choice every client obeys — a
|
|
235
|
+
* per-client copy would silently bill two different wallets for the same
|
|
236
|
+
* person, which is the single worst failure this feature can have.
|
|
237
|
+
*
|
|
238
|
+
* ABSENT also covers two legitimate cases: a config written before this
|
|
239
|
+
* field existed, and NEXRALL_TOKEN (CI/headless — no config identity, and
|
|
240
|
+
* billing a company by accident from a build job is worse than the
|
|
241
|
+
* convenience).
|
|
242
|
+
*/
|
|
243
|
+
billingTeamId?: number;
|
|
228
244
|
}
|
|
229
245
|
export interface PermissionRequest {
|
|
230
246
|
tool: string;
|
|
@@ -327,6 +343,18 @@ export interface AgentLoopOptions {
|
|
|
327
343
|
* `zero` distinguishes an already-empty wallet from merely running low.
|
|
328
344
|
*/
|
|
329
345
|
onBalanceStatus?: (balance: number | null, zero: boolean) => void;
|
|
346
|
+
/**
|
|
347
|
+
* Fired instead of onBalanceStatus when a pre-flight 402 was specifically a
|
|
348
|
+
* TEAM-BUDGET refusal (migration 139, `code: 'team_budget_exhausted'`).
|
|
349
|
+
* The call to action is different from an empty wallet — "ask your team
|
|
350
|
+
* admin to add funds", not "top up your wallet" — so a client that renders
|
|
351
|
+
* its own bubble must be able to tell them apart. When this is absent the
|
|
352
|
+
* loop falls back to a plain-text notice, never to the wallet bubble.
|
|
353
|
+
*/
|
|
354
|
+
onTeamBudgetStatus?: (info: {
|
|
355
|
+
teamId?: number;
|
|
356
|
+
remaining: number;
|
|
357
|
+
}) => void;
|
|
330
358
|
/**
|
|
331
359
|
* Fired once per `streamChat()` call (i.e. once per API round-trip, including
|
|
332
360
|
* every automatic reconnect/retry attempt and every pause_turn round) with the
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot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;IAC7B;;;;;;;;OAQG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,6CAA6C;IAC7C,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;gBAEb,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAOzF;AAED,0EAA0E;AAC1E,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,cAAc,CAEpE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,EAAE,GAAG,IAAI,CAG7D"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexrall/code-core",
|
|
3
|
-
"version": "1.4.
|
|
4
|
-
"description": "Core agent loop, tools, and extension primitives for Nexrall Code
|
|
3
|
+
"version": "1.4.62",
|
|
4
|
+
"description": "Core agent loop, tools, and extension primitives for Nexrall Code — embed an AI coding agent in any Node.js application.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Nexrall <support@nexrall.com> (https://nexrall.com)",
|
|
7
7
|
"homepage": "https://github.com/nexrall/nexrall-code#readme",
|