chompyy 0.5.0 → 0.6.0
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/README.md +11 -0
- package/dist/agentlimits.js +77 -0
- package/dist/agentusage.js +96 -0
- package/dist/appstate.js +63 -3
- package/dist/away.js +44 -5
- package/dist/blueprint.js +3 -7
- package/dist/board.js +1 -0
- package/dist/cli.js +263 -5
- package/dist/codexquota.js +106 -0
- package/dist/codexusage.js +10 -0
- package/dist/config.js +2 -0
- package/dist/context.js +30 -0
- package/dist/costs.js +1 -0
- package/dist/demon.js +20 -0
- package/dist/label.js +33 -0
- package/dist/menu.js +17 -0
- package/dist/nightcap.js +60 -0
- package/dist/nudge.js +47 -18
- package/dist/pacing.js +16 -1
- package/dist/questions.js +71 -0
- package/dist/recap.js +74 -0
- package/dist/receipt.js +48 -0
- package/dist/recipe.js +79 -0
- package/dist/stamps.js +14 -0
- package/dist/triggers.js +5 -0
- package/dist/usage.js +21 -1
- package/dist/vendor/codeburn/antigravity.js +309 -0
- package/dist/vendor/codeburn/codex.js +429 -0
- package/dist/vendor/codeburn/copilot.js +292 -0
- package/dist/vendor/codeburn/gemini.js +195 -0
- package/dist/vendor/codeburn/grokbot.js +182 -0
- package/dist/vendor/codeburn/kimi.js +178 -0
- package/dist/vendor/codeburn/shims/chalk.js +14 -0
- package/dist/vendor/codeburn/shims/strip-ansi.js +6 -0
- package/dist/vendor/codeburn/src/act/backup.js +83 -0
- package/dist/vendor/codeburn/src/act/model-defaults.js +151 -0
- package/dist/vendor/codeburn/src/act/types.js +37 -0
- package/dist/vendor/codeburn/src/bash-utils.js +204 -0
- package/dist/vendor/codeburn/src/behavioral-weight.js +47 -0
- package/dist/vendor/codeburn/src/cache-dir.js +26 -0
- package/dist/vendor/codeburn/src/cache-refresh-lock.js +543 -0
- package/dist/vendor/codeburn/src/cache-sweep.js +67 -0
- package/dist/vendor/codeburn/src/classifier.js +209 -0
- package/dist/vendor/codeburn/src/claude-identity.js +223 -0
- package/dist/vendor/codeburn/src/codex-cache.js +377 -0
- package/dist/vendor/codeburn/src/codex-fork-replay.js +232 -0
- package/dist/vendor/codeburn/src/codex-jsonl-fields.js +99 -0
- package/dist/vendor/codeburn/src/codex-session-index.js +113 -0
- package/dist/vendor/codeburn/src/codex-throughput.js +544 -0
- package/dist/vendor/codeburn/src/compare-stats.js +405 -0
- package/dist/vendor/codeburn/src/config.js +145 -0
- package/dist/vendor/codeburn/src/content-utils.js +56 -0
- package/dist/vendor/codeburn/src/context-tree-codex.js +329 -0
- package/dist/vendor/codeburn/src/context-tree.js +664 -0
- package/dist/vendor/codeburn/src/copilot-aiu.js +16 -0
- package/dist/vendor/codeburn/src/currency.js +189 -0
- package/dist/vendor/codeburn/src/cursor-cache.js +238 -0
- package/dist/vendor/codeburn/src/cursor-import.js +402 -0
- package/dist/vendor/codeburn/src/cursor-sync.js +256 -0
- package/dist/vendor/codeburn/src/daily-cache.js +2036 -0
- package/dist/vendor/codeburn/src/data/litellm-snapshot.json +1 -0
- package/dist/vendor/codeburn/src/data/pricing-fallback.json +1 -0
- package/dist/vendor/codeburn/src/day-aggregator.js +327 -0
- package/dist/vendor/codeburn/src/editor-data-dir.js +11 -0
- package/dist/vendor/codeburn/src/fetch-utils.js +18 -0
- package/dist/vendor/codeburn/src/format.js +118 -0
- package/dist/vendor/codeburn/src/fs-utils.js +270 -0
- package/dist/vendor/codeburn/src/git-origin.js +334 -0
- package/dist/vendor/codeburn/src/granular-history.js +328 -0
- package/dist/vendor/codeburn/src/hermes-session-ledger.js +512 -0
- package/dist/vendor/codeburn/src/launcher-homes.js +142 -0
- package/dist/vendor/codeburn/src/live-sessions.js +358 -0
- package/dist/vendor/codeburn/src/math-utils.js +8 -0
- package/dist/vendor/codeburn/src/menubar-json.js +294 -0
- package/dist/vendor/codeburn/src/models.js +1879 -0
- package/dist/vendor/codeburn/src/optimize-one-hour-cache.js +92 -0
- package/dist/vendor/codeburn/src/optimize.js +4110 -0
- package/dist/vendor/codeburn/src/parse-workers.js +219 -0
- package/dist/vendor/codeburn/src/parser.js +6953 -0
- package/dist/vendor/codeburn/src/path-privacy.js +26 -0
- package/dist/vendor/codeburn/src/plans.js +135 -0
- package/dist/vendor/codeburn/src/pr-signals.js +132 -0
- package/dist/vendor/codeburn/src/project-filter-warnings.js +33 -0
- package/dist/vendor/codeburn/src/provider-issues.js +30 -0
- package/dist/vendor/codeburn/src/providers/amp.js +286 -0
- package/dist/vendor/codeburn/src/providers/antigravity.js +1731 -0
- package/dist/vendor/codeburn/src/providers/claude.js +551 -0
- package/dist/vendor/codeburn/src/providers/cline-cli.js +401 -0
- package/dist/vendor/codeburn/src/providers/cline.js +63 -0
- package/dist/vendor/codeburn/src/providers/codebuff.js +336 -0
- package/dist/vendor/codeburn/src/providers/codewhale.js +442 -0
- package/dist/vendor/codeburn/src/providers/codex.js +1720 -0
- package/dist/vendor/codeburn/src/providers/command-code.js +196 -0
- package/dist/vendor/codeburn/src/providers/copilot.js +3278 -0
- package/dist/vendor/codeburn/src/providers/crush.js +226 -0
- package/dist/vendor/codeburn/src/providers/cursor-agent.js +837 -0
- package/dist/vendor/codeburn/src/providers/cursor.js +1163 -0
- package/dist/vendor/codeburn/src/providers/devin.js +569 -0
- package/dist/vendor/codeburn/src/providers/droid.js +324 -0
- package/dist/vendor/codeburn/src/providers/dsh.js +690 -0
- package/dist/vendor/codeburn/src/providers/forge.js +245 -0
- package/dist/vendor/codeburn/src/providers/gemini.js +230 -0
- package/dist/vendor/codeburn/src/providers/goose.js +252 -0
- package/dist/vendor/codeburn/src/providers/grok.js +581 -0
- package/dist/vendor/codeburn/src/providers/grokbot.js +290 -0
- package/dist/vendor/codeburn/src/providers/hermes.js +771 -0
- package/dist/vendor/codeburn/src/providers/ibm-bob.js +53 -0
- package/dist/vendor/codeburn/src/providers/index.js +360 -0
- package/dist/vendor/codeburn/src/providers/kilo-code.js +50 -0
- package/dist/vendor/codeburn/src/providers/kimi.js +363 -0
- package/dist/vendor/codeburn/src/providers/kimicode.js +402 -0
- package/dist/vendor/codeburn/src/providers/kiro.js +1174 -0
- package/dist/vendor/codeburn/src/providers/lingtai-tui.js +372 -0
- package/dist/vendor/codeburn/src/providers/mistral-vibe-unified.js +236 -0
- package/dist/vendor/codeburn/src/providers/mistral-vibe.js +405 -0
- package/dist/vendor/codeburn/src/providers/mux.js +242 -0
- package/dist/vendor/codeburn/src/providers/open-design.js +217 -0
- package/dist/vendor/codeburn/src/providers/openclaude.js +309 -0
- package/dist/vendor/codeburn/src/providers/openclaw.js +442 -0
- package/dist/vendor/codeburn/src/providers/opencode-file-parser.js +131 -0
- package/dist/vendor/codeburn/src/providers/opencode.js +91 -0
- package/dist/vendor/codeburn/src/providers/pi.js +429 -0
- package/dist/vendor/codeburn/src/providers/quickdesk.js +491 -0
- package/dist/vendor/codeburn/src/providers/qwen.js +193 -0
- package/dist/vendor/codeburn/src/providers/session-message.js +118 -0
- package/dist/vendor/codeburn/src/providers/sqlite-session-parser.js +457 -0
- package/dist/vendor/codeburn/src/providers/types.js +5 -0
- package/dist/vendor/codeburn/src/providers/vercel-gateway.js +135 -0
- package/dist/vendor/codeburn/src/providers/vscode-cline-parser.js +212 -0
- package/dist/vendor/codeburn/src/providers/warp.js +575 -0
- package/dist/vendor/codeburn/src/providers/zcode.js +249 -0
- package/dist/vendor/codeburn/src/providers/zed.js +187 -0
- package/dist/vendor/codeburn/src/providers/zerostack.js +139 -0
- package/dist/vendor/codeburn/src/quota/antigravity.js +310 -0
- package/dist/vendor/codeburn/src/quota/claude.js +244 -0
- package/dist/vendor/codeburn/src/quota/cursor.js +301 -0
- package/dist/vendor/codeburn/src/quota/security.js +299 -0
- package/dist/vendor/codeburn/src/quota/types.js +1 -0
- package/dist/vendor/codeburn/src/scan-facts.js +99 -0
- package/dist/vendor/codeburn/src/session-cache.js +3040 -0
- package/dist/vendor/codeburn/src/session-count-label.js +14 -0
- package/dist/vendor/codeburn/src/session-output.js +139 -0
- package/dist/vendor/codeburn/src/session-population.js +30 -0
- package/dist/vendor/codeburn/src/sessions-report.js +1342 -0
- package/dist/vendor/codeburn/src/sqlite.js +528 -0
- package/dist/vendor/codeburn/src/sync/otlp.js +420 -0
- package/dist/vendor/codeburn/src/telemetry-snapshot.js +244 -0
- package/dist/vendor/codeburn/src/token-estimate.js +5 -0
- package/dist/vendor/codeburn/src/types.js +16 -0
- package/dist/vendor/codeburn/src/work-units.js +126 -0
- package/dist/vendor/codeburn/src/workflow-insights.js +228 -0
- package/dist/vendor/codeburn/src/wsl.js +198 -0
- package/dist/vendor/codeburn/src/yield.js +666 -0
- package/package.json +1 -1
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/** Find a direct property in a JSON object without decoding its values. */
|
|
2
|
+
export function findRawObjectField(source, objectStart, field) {
|
|
3
|
+
const fieldBytes = Buffer.from(field, 'utf-8');
|
|
4
|
+
let depth = 0;
|
|
5
|
+
let rootStarted = false;
|
|
6
|
+
let inString = false;
|
|
7
|
+
let escaped = false;
|
|
8
|
+
for (let i = objectStart; i < source.length; i++) {
|
|
9
|
+
const byte = source[i];
|
|
10
|
+
if (!rootStarted) {
|
|
11
|
+
if (byte === 0x20 || byte === 0x09 || byte === 0x0a || byte === 0x0d)
|
|
12
|
+
continue;
|
|
13
|
+
if (byte !== 0x7b)
|
|
14
|
+
return undefined; // {
|
|
15
|
+
rootStarted = true;
|
|
16
|
+
depth = 1;
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
if (inString) {
|
|
20
|
+
if (escaped)
|
|
21
|
+
escaped = false;
|
|
22
|
+
else if (byte === 0x5c)
|
|
23
|
+
escaped = true; // \\
|
|
24
|
+
else if (byte === 0x22)
|
|
25
|
+
inString = false; // "
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (byte === 0x22) {
|
|
29
|
+
const keyStart = i + 1;
|
|
30
|
+
let keyEnd = keyStart;
|
|
31
|
+
let keyEscaped = false;
|
|
32
|
+
for (; keyEnd < source.length; keyEnd++) {
|
|
33
|
+
const keyByte = source[keyEnd];
|
|
34
|
+
if (keyEscaped) {
|
|
35
|
+
keyEscaped = false;
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (keyByte === 0x5c) {
|
|
39
|
+
keyEscaped = true;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (keyByte === 0x22)
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
if (depth === 1 && keyEnd < source.length) {
|
|
46
|
+
// Most strings at depth 1 are values, including potentially huge
|
|
47
|
+
// image results. Check the key/value delimiter and exact short-key
|
|
48
|
+
// length before comparing bytes so scanning never materializes them.
|
|
49
|
+
let colon = keyEnd + 1;
|
|
50
|
+
while (colon < source.length && (source[colon] === 0x20 || source[colon] === 0x09 || source[colon] === 0x0a || source[colon] === 0x0d))
|
|
51
|
+
colon++;
|
|
52
|
+
if (source[colon] === 0x3a && keyEnd - keyStart === fieldBytes.length && source.subarray(keyStart, keyEnd).equals(fieldBytes)) {
|
|
53
|
+
let valueStart = colon + 1;
|
|
54
|
+
while (valueStart < source.length && (source[valueStart] === 0x20 || source[valueStart] === 0x09 || source[valueStart] === 0x0a || source[valueStart] === 0x0d))
|
|
55
|
+
valueStart++;
|
|
56
|
+
return { keyStart: i, valueStart };
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
i = keyEnd;
|
|
60
|
+
inString = false;
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (byte === 0x7b || byte === 0x5b)
|
|
64
|
+
depth++; // { or [
|
|
65
|
+
else if (byte === 0x7d || byte === 0x5d)
|
|
66
|
+
depth--; // } or ]
|
|
67
|
+
if (depth <= 0)
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
export function getRawObjectFieldWindow(source, objectStart, field, windowBytes = 4096) {
|
|
73
|
+
const bounds = findRawObjectField(source, objectStart, field);
|
|
74
|
+
return bounds ? source.subarray(bounds.keyStart, Math.min(source.length, bounds.keyStart + windowBytes)).toString('utf-8') : undefined;
|
|
75
|
+
}
|
|
76
|
+
/** Read a short direct string property while bounding how much is decoded. */
|
|
77
|
+
export function getRawJsonStringFieldAtObject(source, objectStart, field, maxBytes = 4096) {
|
|
78
|
+
const bounds = findRawObjectField(source, objectStart, field);
|
|
79
|
+
if (!bounds || source[bounds.valueStart] !== 0x22)
|
|
80
|
+
return undefined;
|
|
81
|
+
let escaped = false;
|
|
82
|
+
const valueEndLimit = Math.min(source.length, bounds.valueStart + maxBytes + 1);
|
|
83
|
+
for (let i = bounds.valueStart + 1; i < valueEndLimit; i++) {
|
|
84
|
+
const byte = source[i];
|
|
85
|
+
if (escaped)
|
|
86
|
+
escaped = false;
|
|
87
|
+
else if (byte === 0x5c)
|
|
88
|
+
escaped = true;
|
|
89
|
+
else if (byte === 0x22) {
|
|
90
|
+
try {
|
|
91
|
+
return JSON.parse(source.subarray(bounds.valueStart, i + 1).toString('utf-8'));
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// @ts-nocheck: codeburn type-checks this under its own tsconfig; Chompyy adds noUncheckedIndexedAccess (see UPSTREAM.md)
|
|
2
|
+
import { createReadStream } from 'fs';
|
|
3
|
+
import { stat } from 'fs/promises';
|
|
4
|
+
import { dirname, join } from 'path';
|
|
5
|
+
import { createInterface } from 'readline';
|
|
6
|
+
import { codex } from './providers/codex.js';
|
|
7
|
+
import { sanitizeModelForDisplay } from './models.js';
|
|
8
|
+
import { inferSessionProvider } from './session-output.js';
|
|
9
|
+
// This optional display index must never turn a report into an unbounded read.
|
|
10
|
+
const MAX_INDEX_BYTES = 64 * 1024 * 1024;
|
|
11
|
+
async function codexHomes() {
|
|
12
|
+
return [...new Set((await codex.probeRoots()).map(root => dirname(root.path)))];
|
|
13
|
+
}
|
|
14
|
+
/** The resident server also caches rendered output. Stat the optional indexes
|
|
15
|
+
* per request so creation, replacement, removal and renames bypass that memo. */
|
|
16
|
+
export async function codexSessionIndexFingerprint() {
|
|
17
|
+
try {
|
|
18
|
+
const parts = [];
|
|
19
|
+
for (const home of await codexHomes()) {
|
|
20
|
+
const path = join(home, 'session_index.jsonl');
|
|
21
|
+
try {
|
|
22
|
+
const info = await stat(path);
|
|
23
|
+
parts.push([path, info.dev, info.ino, info.size, info.mtimeMs, info.ctimeMs, info.mode]);
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
if (err.code !== 'ENOENT')
|
|
27
|
+
return null;
|
|
28
|
+
parts.push([path, 'missing']);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return JSON.stringify(parts);
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/** Read append-only name records, without changing the usage caches or index. */
|
|
38
|
+
export async function readCodexSessionNames(homes) {
|
|
39
|
+
const names = new Map();
|
|
40
|
+
for (const home of new Set(homes)) {
|
|
41
|
+
const path = join(home, 'session_index.jsonl');
|
|
42
|
+
try {
|
|
43
|
+
const info = await stat(path);
|
|
44
|
+
if (!info.isFile() || info.size > MAX_INDEX_BYTES)
|
|
45
|
+
continue;
|
|
46
|
+
const stream = createReadStream(path, { encoding: 'utf8', end: MAX_INDEX_BYTES - 1 });
|
|
47
|
+
const lines = createInterface({ input: stream, crlfDelay: Infinity });
|
|
48
|
+
try {
|
|
49
|
+
for await (const line of lines) {
|
|
50
|
+
if (!line.trim())
|
|
51
|
+
continue;
|
|
52
|
+
let entry;
|
|
53
|
+
try {
|
|
54
|
+
entry = JSON.parse(line);
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (!entry || typeof entry !== 'object' || Array.isArray(entry))
|
|
60
|
+
continue;
|
|
61
|
+
const { id, thread_name: name, updated_at: updatedAt } = entry;
|
|
62
|
+
if (typeof id !== 'string' || !id.trim() || typeof name !== 'string' || !name.trim())
|
|
63
|
+
continue;
|
|
64
|
+
const title = sanitizeModelForDisplay(name.trim());
|
|
65
|
+
const timestamp = typeof updatedAt === 'string' ? Date.parse(updatedAt) : NaN;
|
|
66
|
+
const time = Number.isFinite(timestamp) ? timestamp : -Infinity;
|
|
67
|
+
const previous = names.get(id);
|
|
68
|
+
// Timestamped records win over older snapshots; equal/missing dates
|
|
69
|
+
// use append order. Blank or malformed records never erase a name.
|
|
70
|
+
if (!previous || time >= previous.updatedAt)
|
|
71
|
+
names.set(id, { title, updatedAt: time });
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
finally {
|
|
75
|
+
lines.close();
|
|
76
|
+
stream.destroy();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
// Missing, unreadable or concurrently replaced indexes are optional.
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return new Map([...names].map(([id, value]) => [id, value.title]));
|
|
84
|
+
}
|
|
85
|
+
/** Overlay at the public report boundary, including memory/disk cache hits.
|
|
86
|
+
* Copies preserve the transcript fallback if a later read loses the index. */
|
|
87
|
+
export async function applyCodexSessionNames(projects) {
|
|
88
|
+
if (!projects.some(p => p.sessions.some(s => inferSessionProvider(s) === 'codex')))
|
|
89
|
+
return projects;
|
|
90
|
+
let homes;
|
|
91
|
+
try {
|
|
92
|
+
homes = await codexHomes();
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return projects;
|
|
96
|
+
}
|
|
97
|
+
const names = await readCodexSessionNames(homes);
|
|
98
|
+
if (names.size === 0)
|
|
99
|
+
return projects;
|
|
100
|
+
return projects.map(project => ({
|
|
101
|
+
...project,
|
|
102
|
+
sessions: project.sessions.map(session => {
|
|
103
|
+
// Modern rollouts store payload.id, while CodeBurn's existing identity
|
|
104
|
+
// falls back to the rollout filename. Join by its UUID without changing
|
|
105
|
+
// that identity (or invalidating/rekeying any accounting caches).
|
|
106
|
+
const threadId = session.sessionId.match(/^rollout-.+-([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i)?.[1];
|
|
107
|
+
const title = inferSessionProvider(session) === 'codex'
|
|
108
|
+
? names.get(session.sessionId) ?? (threadId ? names.get(threadId) : undefined)
|
|
109
|
+
: undefined;
|
|
110
|
+
return title === undefined ? session : { ...session, title };
|
|
111
|
+
}),
|
|
112
|
+
}));
|
|
113
|
+
}
|