feat(billing): bill Cursor executor usage via stream-json token parsing
Memind CI / Test, build, and release guards (push) Failing after 14m36s
Memind CI / Test, build, and release guards (push) Failing after 14m36s
Parse Cursor CLI usage from stream-json output and charge through billSessionUsage so subscription quota is consumed first and wallet overage applies when needed. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -15,13 +15,14 @@ test('buildCodeRunCompletionReply never exposes cursor brand to users', () => {
|
||||
assert.doesNotMatch(reply, /cursor/i);
|
||||
});
|
||||
|
||||
test('buildCodeRunCompletionReply sanitizes cursor wording in stdout', () => {
|
||||
test('buildCodeRunCompletionReply prefers displayStdout over raw stream-json stdout', () => {
|
||||
const reply = buildCodeRunCompletionReply({
|
||||
executor: 'cursor',
|
||||
stdout: 'cursor agent finished editing public/page.html',
|
||||
stdout: '{"type":"result","result":"hidden"}\n',
|
||||
displayStdout: '已写入 public/spring-poem.html',
|
||||
});
|
||||
assert.match(reply, /TKMind 智趣 finished editing public\/page\.html/);
|
||||
assert.doesNotMatch(reply, /\bcursor\b/i);
|
||||
assert.match(reply, /已写入 public\/spring-poem\.html/);
|
||||
assert.doesNotMatch(reply, /"type":"result"/);
|
||||
});
|
||||
|
||||
test('sanitizeUserFacingBrandText replaces cursor wording', () => {
|
||||
|
||||
Reference in New Issue
Block a user