sidekick-agent-hub 0.18.2 → 0.18.3
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 +20 -0
- package/dist/sidekick-cli.mjs +630 -56
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -130,6 +130,26 @@ Use `--json` for machine-readable output. Use `--provider codex` to explicitly c
|
|
|
130
130
|
|
|
131
131
|
When multi-account is enabled, `sidekick quota` shows the active account email above the quota bars.
|
|
132
132
|
|
|
133
|
+
### Quota History
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
sidekick quota history
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Renders a 13-week, GitHub-contributions-style heatmap of quota utilization for the current workspace. Each cell is one day; brightness encodes the peak utilization observed (`· ░ ▒ ▓ █` → ≤0% / <25% / <50% / <75% / ≥75%). Days that hit `available: false` render as a red `×`.
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
Claude · 13 weeks · 41 day(s) with samples
|
|
143
|
+
Sun ·░▒▒▓█░░░ ·░░·· ·▒▒
|
|
144
|
+
Mon ··▒▒▓█▒░· ·░░·· ·▒▓
|
|
145
|
+
…
|
|
146
|
+
Peak 92% · Avg 38% · Samples 612
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Flags: `--weeks <n>` (1-26, default 13), `--provider claude|codex` (default both, stacked), `--workspace <path>` (default `cwd`). `--json` emits a `{ workspaceId, weeks, providers: { claude?, codex? }, generatedAt }` payload — the same shape consumed by the VS Code dashboard's Quota History panel.
|
|
150
|
+
|
|
151
|
+
History is stored at `~/.config/sidekick/quota-history/<workspaceId>/<provider>.jsonl` (mode `0600`, 60-second debounce, 91-day retention). The workspace id is `sha256(realpath)[0..16]`, so the same folder yields the same store whether sampled from the CLI or VS Code.
|
|
152
|
+
|
|
133
153
|
## Account Management
|
|
134
154
|
|
|
135
155
|
```bash
|
package/dist/sidekick-cli.mjs
CHANGED
|
@@ -18963,6 +18963,356 @@ var require_quotaSnapshots = __commonJS({
|
|
|
18963
18963
|
}
|
|
18964
18964
|
});
|
|
18965
18965
|
|
|
18966
|
+
// ../sidekick-shared/dist/quotaHistory.js
|
|
18967
|
+
var require_quotaHistory = __commonJS({
|
|
18968
|
+
"../sidekick-shared/dist/quotaHistory.js"(exports) {
|
|
18969
|
+
"use strict";
|
|
18970
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
18971
|
+
if (k2 === void 0) k2 = k;
|
|
18972
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18973
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18974
|
+
desc = { enumerable: true, get: function() {
|
|
18975
|
+
return m[k];
|
|
18976
|
+
} };
|
|
18977
|
+
}
|
|
18978
|
+
Object.defineProperty(o, k2, desc);
|
|
18979
|
+
} : function(o, m, k, k2) {
|
|
18980
|
+
if (k2 === void 0) k2 = k;
|
|
18981
|
+
o[k2] = m[k];
|
|
18982
|
+
});
|
|
18983
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
18984
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18985
|
+
} : function(o, v) {
|
|
18986
|
+
o["default"] = v;
|
|
18987
|
+
});
|
|
18988
|
+
var __importStar = exports && exports.__importStar || /* @__PURE__ */ function() {
|
|
18989
|
+
var ownKeys = function(o) {
|
|
18990
|
+
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
18991
|
+
var ar = [];
|
|
18992
|
+
for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
|
|
18993
|
+
return ar;
|
|
18994
|
+
};
|
|
18995
|
+
return ownKeys(o);
|
|
18996
|
+
};
|
|
18997
|
+
return function(mod) {
|
|
18998
|
+
if (mod && mod.__esModule) return mod;
|
|
18999
|
+
var result = {};
|
|
19000
|
+
if (mod != null) {
|
|
19001
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
19002
|
+
}
|
|
19003
|
+
__setModuleDefault(result, mod);
|
|
19004
|
+
return result;
|
|
19005
|
+
};
|
|
19006
|
+
}();
|
|
19007
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19008
|
+
exports.getWorkspaceIdFromPath = getWorkspaceIdFromPath2;
|
|
19009
|
+
exports.appendQuotaHistorySample = appendQuotaHistorySample;
|
|
19010
|
+
exports.readQuotaHistoryRange = readQuotaHistoryRange;
|
|
19011
|
+
exports.readQuotaHistoryDailyBuckets = readQuotaHistoryDailyBuckets2;
|
|
19012
|
+
exports.pruneQuotaHistory = pruneQuotaHistory;
|
|
19013
|
+
exports._resetQuotaHistoryInMemoryStateForTests = _resetQuotaHistoryInMemoryStateForTests;
|
|
19014
|
+
var crypto = __importStar(__require("crypto"));
|
|
19015
|
+
var fs9 = __importStar(__require("fs"));
|
|
19016
|
+
var path8 = __importStar(__require("path"));
|
|
19017
|
+
var paths_1 = require_paths();
|
|
19018
|
+
var quotaSnapshots_1 = require_quotaSnapshots();
|
|
19019
|
+
var DEFAULT_MIN_INTERVAL_MS = 6e4;
|
|
19020
|
+
var DEFAULT_RETENTION_DAYS = 91;
|
|
19021
|
+
var PRUNE_FILESIZE_THRESHOLD = 16 * 1024;
|
|
19022
|
+
var MS_PER_DAY2 = 864e5;
|
|
19023
|
+
var appendChains = /* @__PURE__ */ new Map();
|
|
19024
|
+
var lastWriteCache = /* @__PURE__ */ new Map();
|
|
19025
|
+
function getWorkspaceIdFromPath2(workspacePath) {
|
|
19026
|
+
let resolved;
|
|
19027
|
+
try {
|
|
19028
|
+
resolved = fs9.realpathSync(workspacePath);
|
|
19029
|
+
} catch {
|
|
19030
|
+
resolved = path8.resolve(workspacePath);
|
|
19031
|
+
}
|
|
19032
|
+
return crypto.createHash("sha256").update(resolved).digest("hex").slice(0, 16);
|
|
19033
|
+
}
|
|
19034
|
+
function getHistoryFilePath(workspaceId, provider) {
|
|
19035
|
+
return path8.join((0, paths_1.getConfigDir)(), "quota-history", workspaceId, `${provider}.jsonl`);
|
|
19036
|
+
}
|
|
19037
|
+
function ensureHistoryDir(workspaceId) {
|
|
19038
|
+
fs9.mkdirSync(path8.join((0, paths_1.getConfigDir)(), "quota-history", workspaceId), { recursive: true, mode: 448 });
|
|
19039
|
+
}
|
|
19040
|
+
function parseSampleLine(line) {
|
|
19041
|
+
const trimmed = line.trim();
|
|
19042
|
+
if (!trimmed)
|
|
19043
|
+
return null;
|
|
19044
|
+
try {
|
|
19045
|
+
const parsed = JSON.parse(trimmed);
|
|
19046
|
+
if (parsed && typeof parsed === "object" && typeof parsed.timestamp === "string" && parsed.fiveHour && parsed.sevenDay) {
|
|
19047
|
+
return parsed;
|
|
19048
|
+
}
|
|
19049
|
+
return null;
|
|
19050
|
+
} catch {
|
|
19051
|
+
return null;
|
|
19052
|
+
}
|
|
19053
|
+
}
|
|
19054
|
+
function readLastSampleTimestampMs(filePath) {
|
|
19055
|
+
let fd;
|
|
19056
|
+
try {
|
|
19057
|
+
fd = fs9.openSync(filePath, "r");
|
|
19058
|
+
const stat = fs9.fstatSync(fd);
|
|
19059
|
+
if (stat.size === 0)
|
|
19060
|
+
return null;
|
|
19061
|
+
const chunkSize = 4096;
|
|
19062
|
+
let remaining = stat.size;
|
|
19063
|
+
let buffer = Buffer.alloc(0);
|
|
19064
|
+
while (remaining > 0) {
|
|
19065
|
+
const readSize = Math.min(chunkSize, remaining);
|
|
19066
|
+
const chunk = Buffer.alloc(readSize);
|
|
19067
|
+
fs9.readSync(fd, chunk, 0, readSize, remaining - readSize);
|
|
19068
|
+
buffer = Buffer.concat([chunk, buffer]);
|
|
19069
|
+
remaining -= readSize;
|
|
19070
|
+
const text = buffer.toString("utf8");
|
|
19071
|
+
const trimmedRight = text.replace(/\n+$/, "");
|
|
19072
|
+
const lastNewline = trimmedRight.lastIndexOf("\n");
|
|
19073
|
+
if (lastNewline >= 0) {
|
|
19074
|
+
const lastLine = trimmedRight.slice(lastNewline + 1);
|
|
19075
|
+
const sample = parseSampleLine(lastLine);
|
|
19076
|
+
return sample ? Date.parse(sample.timestamp) || null : null;
|
|
19077
|
+
}
|
|
19078
|
+
if (remaining === 0) {
|
|
19079
|
+
const sample = parseSampleLine(trimmedRight);
|
|
19080
|
+
return sample ? Date.parse(sample.timestamp) || null : null;
|
|
19081
|
+
}
|
|
19082
|
+
}
|
|
19083
|
+
return null;
|
|
19084
|
+
} catch (err) {
|
|
19085
|
+
if (err?.code === "ENOENT")
|
|
19086
|
+
return null;
|
|
19087
|
+
return null;
|
|
19088
|
+
} finally {
|
|
19089
|
+
if (fd !== void 0) {
|
|
19090
|
+
try {
|
|
19091
|
+
fs9.closeSync(fd);
|
|
19092
|
+
} catch {
|
|
19093
|
+
}
|
|
19094
|
+
}
|
|
19095
|
+
}
|
|
19096
|
+
}
|
|
19097
|
+
function atomicRewriteFile(filePath, contents) {
|
|
19098
|
+
const tmp = `${filePath}.${process.pid}.${Date.now()}.${crypto.randomBytes(8).toString("hex")}.tmp`;
|
|
19099
|
+
try {
|
|
19100
|
+
fs9.writeFileSync(tmp, contents, { encoding: "utf8", mode: 384 });
|
|
19101
|
+
fs9.renameSync(tmp, filePath);
|
|
19102
|
+
} catch (error) {
|
|
19103
|
+
try {
|
|
19104
|
+
fs9.rmSync(tmp, { force: true });
|
|
19105
|
+
} catch {
|
|
19106
|
+
}
|
|
19107
|
+
throw error;
|
|
19108
|
+
}
|
|
19109
|
+
}
|
|
19110
|
+
function pruneFileSync(filePath, retentionDays) {
|
|
19111
|
+
let stat;
|
|
19112
|
+
try {
|
|
19113
|
+
stat = fs9.statSync(filePath);
|
|
19114
|
+
} catch {
|
|
19115
|
+
return { kept: 0, pruned: 0 };
|
|
19116
|
+
}
|
|
19117
|
+
if (stat.size === 0)
|
|
19118
|
+
return { kept: 0, pruned: 0 };
|
|
19119
|
+
const cutoffMs = Date.now() - retentionDays * MS_PER_DAY2;
|
|
19120
|
+
const raw = fs9.readFileSync(filePath, "utf8");
|
|
19121
|
+
const lines = raw.split("\n");
|
|
19122
|
+
const keptLines = [];
|
|
19123
|
+
let pruned = 0;
|
|
19124
|
+
for (const line of lines) {
|
|
19125
|
+
if (!line.trim())
|
|
19126
|
+
continue;
|
|
19127
|
+
const sample = parseSampleLine(line);
|
|
19128
|
+
if (!sample) {
|
|
19129
|
+
pruned += 1;
|
|
19130
|
+
continue;
|
|
19131
|
+
}
|
|
19132
|
+
const ts = Date.parse(sample.timestamp);
|
|
19133
|
+
if (Number.isFinite(ts) && ts >= cutoffMs) {
|
|
19134
|
+
keptLines.push(line);
|
|
19135
|
+
} else {
|
|
19136
|
+
pruned += 1;
|
|
19137
|
+
}
|
|
19138
|
+
}
|
|
19139
|
+
if (pruned > 0) {
|
|
19140
|
+
atomicRewriteFile(filePath, keptLines.length > 0 ? keptLines.join("\n") + "\n" : "");
|
|
19141
|
+
}
|
|
19142
|
+
return { kept: keptLines.length, pruned };
|
|
19143
|
+
}
|
|
19144
|
+
function sampleToQuotaState(sample) {
|
|
19145
|
+
const providerId = sample.runtimeProvider === "claude" ? "claude-code" : "codex";
|
|
19146
|
+
return {
|
|
19147
|
+
fiveHour: { utilization: sample.fiveHour.utilization, resetsAt: sample.fiveHour.resetsAt },
|
|
19148
|
+
sevenDay: { utilization: sample.sevenDay.utilization, resetsAt: sample.sevenDay.resetsAt },
|
|
19149
|
+
available: sample.available,
|
|
19150
|
+
error: sample.error,
|
|
19151
|
+
providerId,
|
|
19152
|
+
source: sample.source ?? "session",
|
|
19153
|
+
capturedAt: sample.timestamp,
|
|
19154
|
+
stale: sample.stale
|
|
19155
|
+
};
|
|
19156
|
+
}
|
|
19157
|
+
async function runAppend(sample, filePath, options) {
|
|
19158
|
+
let lastTs = lastWriteCache.get(filePath);
|
|
19159
|
+
if (lastTs === void 0) {
|
|
19160
|
+
const fromDisk = readLastSampleTimestampMs(filePath);
|
|
19161
|
+
if (fromDisk !== null) {
|
|
19162
|
+
lastTs = fromDisk;
|
|
19163
|
+
lastWriteCache.set(filePath, fromDisk);
|
|
19164
|
+
}
|
|
19165
|
+
}
|
|
19166
|
+
const sampleTs = Date.parse(sample.timestamp);
|
|
19167
|
+
if (lastTs !== void 0 && Number.isFinite(sampleTs) && sampleTs - lastTs < options.minIntervalMs) {
|
|
19168
|
+
return;
|
|
19169
|
+
}
|
|
19170
|
+
ensureHistoryDir(sample.workspaceId);
|
|
19171
|
+
const line = JSON.stringify(sample) + "\n";
|
|
19172
|
+
await fs9.promises.appendFile(filePath, line, { encoding: "utf8", mode: 384 });
|
|
19173
|
+
lastWriteCache.set(filePath, Number.isFinite(sampleTs) ? sampleTs : Date.now());
|
|
19174
|
+
try {
|
|
19175
|
+
const stat = await fs9.promises.stat(filePath);
|
|
19176
|
+
if (stat.size >= PRUNE_FILESIZE_THRESHOLD) {
|
|
19177
|
+
pruneFileSync(filePath, options.retentionDays);
|
|
19178
|
+
}
|
|
19179
|
+
} catch {
|
|
19180
|
+
}
|
|
19181
|
+
try {
|
|
19182
|
+
const providerId = sample.runtimeProvider === "claude" ? "claude-code" : "codex";
|
|
19183
|
+
(0, quotaSnapshots_1.writeQuotaSnapshot)(providerId, sample.providerId, sampleToQuotaState(sample));
|
|
19184
|
+
} catch {
|
|
19185
|
+
}
|
|
19186
|
+
}
|
|
19187
|
+
async function appendQuotaHistorySample(sample, options = {}) {
|
|
19188
|
+
const resolved = {
|
|
19189
|
+
minIntervalMs: options.minIntervalMs ?? DEFAULT_MIN_INTERVAL_MS,
|
|
19190
|
+
retentionDays: options.retentionDays ?? DEFAULT_RETENTION_DAYS
|
|
19191
|
+
};
|
|
19192
|
+
const filePath = getHistoryFilePath(sample.workspaceId, sample.runtimeProvider);
|
|
19193
|
+
const previous = appendChains.get(filePath) ?? Promise.resolve();
|
|
19194
|
+
const next = previous.then(() => runAppend(sample, filePath, resolved)).catch(() => {
|
|
19195
|
+
});
|
|
19196
|
+
appendChains.set(filePath, next);
|
|
19197
|
+
try {
|
|
19198
|
+
await next;
|
|
19199
|
+
} finally {
|
|
19200
|
+
if (appendChains.get(filePath) === next) {
|
|
19201
|
+
appendChains.delete(filePath);
|
|
19202
|
+
}
|
|
19203
|
+
}
|
|
19204
|
+
}
|
|
19205
|
+
function defaultRangeMs() {
|
|
19206
|
+
const toMs = Date.now();
|
|
19207
|
+
const fromMs = toMs - DEFAULT_RETENTION_DAYS * MS_PER_DAY2;
|
|
19208
|
+
return { fromMs, toMs };
|
|
19209
|
+
}
|
|
19210
|
+
async function readQuotaHistoryRange(options) {
|
|
19211
|
+
const filePath = getHistoryFilePath(options.workspaceId, options.provider);
|
|
19212
|
+
let raw;
|
|
19213
|
+
try {
|
|
19214
|
+
raw = await fs9.promises.readFile(filePath, "utf8");
|
|
19215
|
+
} catch (err) {
|
|
19216
|
+
if (err?.code === "ENOENT")
|
|
19217
|
+
return [];
|
|
19218
|
+
throw err;
|
|
19219
|
+
}
|
|
19220
|
+
const { fromMs: defaultFromMs, toMs: defaultToMs } = defaultRangeMs();
|
|
19221
|
+
const fromMs = options.from ? Date.parse(options.from) : defaultFromMs;
|
|
19222
|
+
const toMs = options.to ? Date.parse(options.to) : defaultToMs;
|
|
19223
|
+
const samples = [];
|
|
19224
|
+
for (const line of raw.split("\n")) {
|
|
19225
|
+
const sample = parseSampleLine(line);
|
|
19226
|
+
if (!sample)
|
|
19227
|
+
continue;
|
|
19228
|
+
const ts = Date.parse(sample.timestamp);
|
|
19229
|
+
if (!Number.isFinite(ts))
|
|
19230
|
+
continue;
|
|
19231
|
+
if (ts < fromMs || ts > toMs)
|
|
19232
|
+
continue;
|
|
19233
|
+
samples.push(sample);
|
|
19234
|
+
}
|
|
19235
|
+
samples.sort((a, b) => Date.parse(a.timestamp) - Date.parse(b.timestamp));
|
|
19236
|
+
return samples;
|
|
19237
|
+
}
|
|
19238
|
+
function utcDateString(ms) {
|
|
19239
|
+
return new Date(ms).toISOString().slice(0, 10);
|
|
19240
|
+
}
|
|
19241
|
+
function addDaysUtc(dateString, days) {
|
|
19242
|
+
const ms = Date.parse(`${dateString}T00:00:00Z`) + days * MS_PER_DAY2;
|
|
19243
|
+
return utcDateString(ms);
|
|
19244
|
+
}
|
|
19245
|
+
async function readQuotaHistoryDailyBuckets2(options) {
|
|
19246
|
+
const samples = await readQuotaHistoryRange(options);
|
|
19247
|
+
const { fromMs: defaultFromMs, toMs: defaultToMs } = defaultRangeMs();
|
|
19248
|
+
const fromMs = options.from ? Date.parse(options.from) : defaultFromMs;
|
|
19249
|
+
const toMs = options.to ? Date.parse(options.to) : defaultToMs;
|
|
19250
|
+
const startDate = utcDateString(fromMs);
|
|
19251
|
+
const endDate = utcDateString(toMs);
|
|
19252
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
19253
|
+
for (const sample of samples) {
|
|
19254
|
+
const day = sample.timestamp.slice(0, 10);
|
|
19255
|
+
const bucket = grouped.get(day);
|
|
19256
|
+
if (bucket) {
|
|
19257
|
+
bucket.push(sample);
|
|
19258
|
+
} else {
|
|
19259
|
+
grouped.set(day, [sample]);
|
|
19260
|
+
}
|
|
19261
|
+
}
|
|
19262
|
+
const buckets = [];
|
|
19263
|
+
let cursor = startDate;
|
|
19264
|
+
for (let i = 0; i <= 366 && cursor <= endDate; i += 1) {
|
|
19265
|
+
const daySamples = grouped.get(cursor);
|
|
19266
|
+
if (!daySamples || daySamples.length === 0) {
|
|
19267
|
+
buckets.push({
|
|
19268
|
+
date: cursor,
|
|
19269
|
+
samples: 0,
|
|
19270
|
+
maxUtilizationFiveHour: 0,
|
|
19271
|
+
maxUtilizationSevenDay: 0,
|
|
19272
|
+
avgUtilizationFiveHour: 0,
|
|
19273
|
+
avgUtilizationSevenDay: 0,
|
|
19274
|
+
anyUnavailable: false
|
|
19275
|
+
});
|
|
19276
|
+
} else {
|
|
19277
|
+
let maxFive = 0;
|
|
19278
|
+
let maxSeven = 0;
|
|
19279
|
+
let sumFive = 0;
|
|
19280
|
+
let sumSeven = 0;
|
|
19281
|
+
let anyUnavailable = false;
|
|
19282
|
+
for (const s of daySamples) {
|
|
19283
|
+
maxFive = Math.max(maxFive, s.fiveHour.utilization);
|
|
19284
|
+
maxSeven = Math.max(maxSeven, s.sevenDay.utilization);
|
|
19285
|
+
sumFive += s.fiveHour.utilization;
|
|
19286
|
+
sumSeven += s.sevenDay.utilization;
|
|
19287
|
+
if (!s.available)
|
|
19288
|
+
anyUnavailable = true;
|
|
19289
|
+
}
|
|
19290
|
+
const n = daySamples.length;
|
|
19291
|
+
buckets.push({
|
|
19292
|
+
date: cursor,
|
|
19293
|
+
samples: n,
|
|
19294
|
+
maxUtilizationFiveHour: maxFive,
|
|
19295
|
+
maxUtilizationSevenDay: maxSeven,
|
|
19296
|
+
avgUtilizationFiveHour: Math.round(sumFive / n * 100) / 100,
|
|
19297
|
+
avgUtilizationSevenDay: Math.round(sumSeven / n * 100) / 100,
|
|
19298
|
+
anyUnavailable
|
|
19299
|
+
});
|
|
19300
|
+
}
|
|
19301
|
+
cursor = addDaysUtc(cursor, 1);
|
|
19302
|
+
}
|
|
19303
|
+
return buckets;
|
|
19304
|
+
}
|
|
19305
|
+
async function pruneQuotaHistory(workspaceId, provider, retentionDays = DEFAULT_RETENTION_DAYS) {
|
|
19306
|
+
const filePath = getHistoryFilePath(workspaceId, provider);
|
|
19307
|
+
return pruneFileSync(filePath, retentionDays);
|
|
19308
|
+
}
|
|
19309
|
+
function _resetQuotaHistoryInMemoryStateForTests() {
|
|
19310
|
+
appendChains.clear();
|
|
19311
|
+
lastWriteCache.clear();
|
|
19312
|
+
}
|
|
19313
|
+
}
|
|
19314
|
+
});
|
|
19315
|
+
|
|
18966
19316
|
// ../sidekick-shared/dist/codexQuota.js
|
|
18967
19317
|
var require_codexQuota = __commonJS({
|
|
18968
19318
|
"../sidekick-shared/dist/codexQuota.js"(exports) {
|
|
@@ -19425,6 +19775,7 @@ var require_codexQuotaWatcher = __commonJS({
|
|
|
19425
19775
|
var codexProfiles_1 = require_codexProfiles();
|
|
19426
19776
|
var codexQuota_1 = require_codexQuota();
|
|
19427
19777
|
var quotaSnapshots_1 = require_quotaSnapshots();
|
|
19778
|
+
var quotaHistory_1 = require_quotaHistory();
|
|
19428
19779
|
var codex_1 = require_codex();
|
|
19429
19780
|
var DEFAULT_DISCOVERY_POLL_INTERVAL_MS = 3e4;
|
|
19430
19781
|
function accountEmail(account) {
|
|
@@ -19463,6 +19814,8 @@ var require_codexQuotaWatcher = __commonJS({
|
|
|
19463
19814
|
watchFile;
|
|
19464
19815
|
maxTailBytes;
|
|
19465
19816
|
maxSessionFiles;
|
|
19817
|
+
workspaceId;
|
|
19818
|
+
appendHistorySample;
|
|
19466
19819
|
listeners = [];
|
|
19467
19820
|
discoveryTimer;
|
|
19468
19821
|
provider = null;
|
|
@@ -19481,6 +19834,8 @@ var require_codexQuotaWatcher = __commonJS({
|
|
|
19481
19834
|
this.watchFile = options.watchFile ?? fs9.watch;
|
|
19482
19835
|
this.maxTailBytes = options.maxTailBytes;
|
|
19483
19836
|
this.maxSessionFiles = options.maxSessionFiles;
|
|
19837
|
+
this.workspaceId = options.workspaceId;
|
|
19838
|
+
this.appendHistorySample = options.appendHistorySample ?? quotaHistory_1.appendQuotaHistorySample;
|
|
19484
19839
|
}
|
|
19485
19840
|
start() {
|
|
19486
19841
|
if (this.running)
|
|
@@ -19577,6 +19932,28 @@ var require_codexQuotaWatcher = __commonJS({
|
|
|
19577
19932
|
const account = this.getActiveAccount();
|
|
19578
19933
|
if (account) {
|
|
19579
19934
|
this.writeSnapshot("codex", account.id, liveQuota);
|
|
19935
|
+
if (this.workspaceId) {
|
|
19936
|
+
const sample = {
|
|
19937
|
+
timestamp: liveQuota.capturedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
19938
|
+
runtimeProvider: "codex",
|
|
19939
|
+
providerId: account.id,
|
|
19940
|
+
workspaceId: this.workspaceId,
|
|
19941
|
+
fiveHour: { utilization: liveQuota.fiveHour.utilization, resetsAt: liveQuota.fiveHour.resetsAt },
|
|
19942
|
+
sevenDay: { utilization: liveQuota.sevenDay.utilization, resetsAt: liveQuota.sevenDay.resetsAt },
|
|
19943
|
+
available: liveQuota.available,
|
|
19944
|
+
error: liveQuota.error,
|
|
19945
|
+
source: liveQuota.source,
|
|
19946
|
+
stale: liveQuota.stale
|
|
19947
|
+
};
|
|
19948
|
+
try {
|
|
19949
|
+
const result = this.appendHistorySample(sample);
|
|
19950
|
+
if (result && typeof result.catch === "function") {
|
|
19951
|
+
result.catch(() => {
|
|
19952
|
+
});
|
|
19953
|
+
}
|
|
19954
|
+
} catch {
|
|
19955
|
+
}
|
|
19956
|
+
}
|
|
19580
19957
|
}
|
|
19581
19958
|
this.emitState(enrichQuotaState({
|
|
19582
19959
|
...liveQuota,
|
|
@@ -36417,8 +36794,8 @@ var require_dist = __commonJS({
|
|
|
36417
36794
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36418
36795
|
exports.findActiveClaudeSession = exports.discoverSessionDirectory = exports.getClaudeSessionDirectory = exports.encodeClaudeWorkspacePath = exports.detectSessionActivity = exports.extractTaskInfo = exports.scanSubagentDir = exports.normalizeCodexToolInput = exports.normalizeCodexToolName = exports.extractPatchFilePaths = exports.CodexRolloutParser = exports.parseDbPartData = exports.parseDbMessageData = exports.convertOpenCodeMessage = exports.detectPlanModeFromText = exports.normalizeToolInput = exports.normalizeToolName = exports.TRUNCATION_PATTERNS = exports.JsonlParser = exports.CodexProvider = exports.OpenCodeProvider = exports.ClaudeCodeProvider = exports.getAllDetectedProviders = exports.detectProvider = exports.readClaudeCodePlanFiles = exports.getPlanAnalytics = exports.writePlans = exports.getLatestPlan = exports.readPlans = exports.readLatestHandoff = exports.readHistory = exports.readNotes = exports.readDecisions = exports.readTasks = exports.getProjectSlugRaw = exports.getProjectSlug = exports.encodeWorkspacePath = exports.getGlobalDataPath = exports.getProjectDataPath = exports.getConfigDir = exports.MAX_PLANS_PER_PROJECT = exports.PLAN_SCHEMA_VERSION = exports.createEmptyTokenTotals = exports.HISTORICAL_DATA_SCHEMA_VERSION = exports.STALENESS_THRESHOLDS = exports.IMPORTANCE_DECAY_FACTORS = exports.KNOWLEDGE_NOTE_SCHEMA_VERSION = exports.DECISION_LOG_SCHEMA_VERSION = exports.normalizeTaskStatus = exports.TASK_PERSISTENCE_SCHEMA_VERSION = void 0;
|
|
36419
36796
|
exports.deleteSnapshot = exports.loadSnapshot = exports.saveSnapshot = exports.parseTodoDependencies = exports.EventAggregator = exports.getRandomPhrase = exports.PHRASE_CATEGORIES = exports.ALL_PHRASES = exports.HIGHLIGHT_CSS = exports.clearHighlightCache = exports.highlightEvent = exports.formatSessionJson = exports.formatSessionMarkdown = exports.formatSessionText = exports.classifyNoise = exports.shouldMergeWithPrevious = exports.classifyFollowEvent = exports.classifyMessage = exports.getSoftNoiseReason = exports.isHardNoiseFollowEvent = exports.isHardNoise = exports.formatToolSummary = exports.formatTokenCount = exports.formatDurationMs = exports.createJsonlTail = exports.toFollowEvents = exports.createWatcher = exports.parseChangelog = exports.extractProposedPlanShared = exports.parsePlanMarkdownShared = exports.PlanExtractor = exports.composeContext = exports.FilterEngine = exports.searchSessions = exports.CodexDatabase = exports.OpenCodeDatabase = exports.discoverDebugLogs = exports.collapseDuplicates = exports.filterByLevel = exports.parseDebugLog = exports.scanSubagentTraces = exports.findAllSessionsWithWorktrees = exports.discoverWorktreeSiblings = exports.resolveWorktreeMainRepo = exports.getAllClaudeProjectFolders = exports.decodeEncodedPath = exports.getMostRecentlyActiveSessionDir = exports.findSubdirectorySessionDirs = exports.findSessionsInDirectory = exports.findAllClaudeSessions = void 0;
|
|
36420
|
-
exports.
|
|
36421
|
-
exports.fetchPeakHoursStatus = exports.fetchOpenAIStatus = exports.fetchProviderStatus = exports.permissionModeSchema = exports.sessionEventSchema = exports.sessionMessageSchema = exports.messageUsageSchema = exports.extractToolCalls = exports.extractToolCall = exports.extractTokenUsage = exports.LITELLM_CATALOG_URL = exports.normalizeLiteLlmCatalog = exports.hydratePricingCatalog = exports.formatCost = exports.sortModelIds = exports.compareModelIds = exports.getModelDisplayInfo = exports.shortModelName = exports.mergeCostSources = exports.calculateCostWithProvenance = exports.calculateCostWithPricing = exports.calculateCost = exports.getModelInfo = exports.getModelPricing = exports.parseModelId = exports.DEFAULT_CONTEXT_WINDOW = exports.getModelContextWindowSize = exports.MultiProviderQuotaService = exports.CodexQuotaWatcher = exports.resolveCodexQuotaFromLocalSources = exports.resolveCodexQuota = exports.readLatestCodexQuotaFromRollouts = exports.quotaFromCodexRateLimits = void 0;
|
|
36797
|
+
exports.appendQuotaHistorySample = exports.writeQuotaSnapshot = exports.readQuotaSnapshot = exports.QuotaPoller = exports.describeQuotaFailure = exports.fetchQuota = exports.removeCodexAccount = exports.switchToCodexAccount = exports.finalizeCodexAccount = exports.prepareCodexAccount = exports.getCodexExecutionEnv = exports.resolveSidekickCodexHome = exports.getActiveCodexAccount = exports.listCodexAccounts = exports.getSystemCodexHome = exports.getCodexMonitoringHomes = exports.getCodexProfileHome = exports.getCodexProfilesDir = exports.getActiveAccountStatus = exports.removeSavedAccountProfile = exports.replaceSavedAccountProfiles = exports.setActiveSavedAccount = exports.upsertSavedAccountProfile = exports.getActiveSavedAccount = exports.listSavedAccountProfiles = exports.writeSavedAccountRegistry = exports.readSavedAccountRegistry = exports.getAccountsDir = exports.isMultiAccountEnabled = exports.getActiveAccount = exports.listAccounts = exports.removeAccount = exports.switchToAccount = exports.addCurrentAccount = exports.readActiveClaudeAccount = exports.writeAccountRegistry = exports.readAccountRegistry = exports.ensureDefaultAccounts = exports.readClaudeMaxAccessTokenSync = exports.readClaudeMaxCredentials = exports.writeActiveCredentials = exports.readActiveCredentials = exports.openInBrowser = exports.parseTranscript = exports.generateHtmlReport = exports.PatternExtractor = exports.HeatmapTracker = exports.FrequencyTracker = exports.getSnapshotPath = exports.isSnapshotValid = void 0;
|
|
36798
|
+
exports.fetchPeakHoursStatus = exports.fetchOpenAIStatus = exports.fetchProviderStatus = exports.permissionModeSchema = exports.sessionEventSchema = exports.sessionMessageSchema = exports.messageUsageSchema = exports.extractToolCalls = exports.extractToolCall = exports.extractTokenUsage = exports.LITELLM_CATALOG_URL = exports.normalizeLiteLlmCatalog = exports.hydratePricingCatalog = exports.formatCost = exports.sortModelIds = exports.compareModelIds = exports.getModelDisplayInfo = exports.shortModelName = exports.mergeCostSources = exports.calculateCostWithProvenance = exports.calculateCostWithPricing = exports.calculateCost = exports.getModelInfo = exports.getModelPricing = exports.parseModelId = exports.DEFAULT_CONTEXT_WINDOW = exports.getModelContextWindowSize = exports.MultiProviderQuotaService = exports.CodexQuotaWatcher = exports.resolveCodexQuotaFromLocalSources = exports.resolveCodexQuota = exports.readLatestCodexQuotaFromRollouts = exports.quotaFromCodexRateLimits = exports.fetchCodexQuotaFromApi = exports.getWorkspaceIdFromPath = exports.pruneQuotaHistory = exports.readQuotaHistoryDailyBuckets = exports.readQuotaHistoryRange = void 0;
|
|
36422
36799
|
var taskPersistence_1 = require_taskPersistence();
|
|
36423
36800
|
Object.defineProperty(exports, "TASK_PERSISTENCE_SCHEMA_VERSION", { enumerable: true, get: function() {
|
|
36424
36801
|
return taskPersistence_1.TASK_PERSISTENCE_SCHEMA_VERSION;
|
|
@@ -36923,6 +37300,22 @@ var require_dist = __commonJS({
|
|
|
36923
37300
|
Object.defineProperty(exports, "writeQuotaSnapshot", { enumerable: true, get: function() {
|
|
36924
37301
|
return quotaSnapshots_1.writeQuotaSnapshot;
|
|
36925
37302
|
} });
|
|
37303
|
+
var quotaHistory_1 = require_quotaHistory();
|
|
37304
|
+
Object.defineProperty(exports, "appendQuotaHistorySample", { enumerable: true, get: function() {
|
|
37305
|
+
return quotaHistory_1.appendQuotaHistorySample;
|
|
37306
|
+
} });
|
|
37307
|
+
Object.defineProperty(exports, "readQuotaHistoryRange", { enumerable: true, get: function() {
|
|
37308
|
+
return quotaHistory_1.readQuotaHistoryRange;
|
|
37309
|
+
} });
|
|
37310
|
+
Object.defineProperty(exports, "readQuotaHistoryDailyBuckets", { enumerable: true, get: function() {
|
|
37311
|
+
return quotaHistory_1.readQuotaHistoryDailyBuckets;
|
|
37312
|
+
} });
|
|
37313
|
+
Object.defineProperty(exports, "pruneQuotaHistory", { enumerable: true, get: function() {
|
|
37314
|
+
return quotaHistory_1.pruneQuotaHistory;
|
|
37315
|
+
} });
|
|
37316
|
+
Object.defineProperty(exports, "getWorkspaceIdFromPath", { enumerable: true, get: function() {
|
|
37317
|
+
return quotaHistory_1.getWorkspaceIdFromPath;
|
|
37318
|
+
} });
|
|
36926
37319
|
var codexQuota_1 = require_codexQuota();
|
|
36927
37320
|
Object.defineProperty(exports, "fetchCodexQuotaFromApi", { enumerable: true, get: function() {
|
|
36928
37321
|
return codexQuota_1.fetchCodexQuotaFromApi;
|
|
@@ -39271,7 +39664,7 @@ var init_UpdateCheckService = __esm({
|
|
|
39271
39664
|
/** Run the update check (one-shot). */
|
|
39272
39665
|
async check() {
|
|
39273
39666
|
try {
|
|
39274
|
-
const current = "0.18.
|
|
39667
|
+
const current = "0.18.3";
|
|
39275
39668
|
const cached = this.readCache();
|
|
39276
39669
|
let latest;
|
|
39277
39670
|
if (cached && Date.now() - cached.checkedAt < CACHE_TTL_MS) {
|
|
@@ -79888,7 +80281,7 @@ function StatusBar({
|
|
|
79888
80281
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text, { children: parseBlessedTags(BRAND_INLINE) }),
|
|
79889
80282
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Text, { dimColor: true, children: [
|
|
79890
80283
|
" v",
|
|
79891
|
-
"0.18.
|
|
80284
|
+
"0.18.3"
|
|
79892
80285
|
] }),
|
|
79893
80286
|
updateInfo && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Text, { color: "yellow", children: [
|
|
79894
80287
|
" (v",
|
|
@@ -80278,7 +80671,7 @@ function ChangelogOverlay({ entries, scrollOffset }) {
|
|
|
80278
80671
|
" ",
|
|
80279
80672
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { bold: true, color: "cyan", children: [
|
|
80280
80673
|
"Terminal Dashboard v",
|
|
80281
|
-
"0.18.
|
|
80674
|
+
"0.18.3"
|
|
80282
80675
|
] }),
|
|
80283
80676
|
latestDate ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { color: "gray", children: [
|
|
80284
80677
|
" \u2014 ",
|
|
@@ -80600,7 +80993,7 @@ var init_mouse = __esm({
|
|
|
80600
80993
|
var CHANGELOG_default;
|
|
80601
80994
|
var init_CHANGELOG = __esm({
|
|
80602
80995
|
"CHANGELOG.md"() {
|
|
80603
|
-
CHANGELOG_default = '# Changelog\n\nAll notable changes to the Sidekick Agent Hub CLI will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n## [0.18.2] - 2026-05-19\n\n### Added\n\n- **`sidekick quota --refresh`**: New flag on the `quota` command that, for Codex, explicitly refreshes from the ChatGPT usage API before falling back to local rollout data and cached snapshots. Without the flag, the Codex quota path stays fully local and makes no upstream network call\n\n### Changed\n\n- **Codex quota is local-only by default**: `sidekick quota --provider codex` now delegates to the new `resolveCodexQuota` orchestrator in `sidekick-shared`. It checks the current workspace\'s most recent rollout, then recent account-level rollouts under `CODEX_HOME/sessions`, then the active account\'s cached snapshot \u2014 no upstream network call unless `--refresh` is passed. Failure output continues to include structured `failureKind` / `httpStatus` / `retryAfterMs` fields under `--json`\n- **Bundled `sidekick-shared` 0.18.2**: Picks up the new Codex quota orchestrator (`resolveCodexQuota`, `resolveCodexQuotaFromLocalSources`, `readLatestCodexQuotaFromRollouts`, `fetchCodexQuotaFromApi`), the relaxed `CodexRateLimits` shape (nullable `resets_at` / `window_minutes`), the rate-limit-only `token_count` event emission in `JsonlSessionWatcher`, and `state_N.sqlite` discovery in `CodexDatabase` + provider auto-detect\n\n## [0.18.1] - 2026-05-08\n\n### Changed\n\n- **Shared dashboard formatting**: terminal dashboard `fmtNum()` and `formatDuration()` now delegate to `formatTokenCount()` and `formatDurationMs()` from `sidekick-shared`, keeping the existing CLI surface (uppercase `K`/`M` suffix, compact `1m5s` style) while removing forked rounding logic\n\n## [0.18.0] - 2026-05-08\n\n### Changed\n\n- **Bundled `sidekick-shared` 0.18.0**: Picks up the new provider-aware quota orchestration surface \u2014 `MultiProviderQuotaService`, `CodexQuotaWatcher`, `getActiveAccountStatus()`, `extractToolCall()`, cost-provenance helpers (`calculateCostWithProvenance`, `mergeCostSources`), and model display helpers (`shortModelName`, `getModelDisplayInfo`, `compareModelIds`, `sortModelIds`). `parseModelId()` also now recognizes legacy Claude IDs such as `claude-3-opus-20240229` and `claude-3-5-sonnet-20241022`\n- **No CLI runtime changes**: This release ships the shared library upgrade for downstream tooling alignment; `sidekick quota`, `sidekick status`, and the live dashboard keep using the existing polling path. Wiring the new orchestrator into the CLI will land in a follow-up release\n\n## [0.17.7] - 2026-04-28\n\n### Fixed\n\n- **Quota snapshot write race**: Updated the bundled `sidekick-shared` snapshot writer so concurrent `sidekick quota` / Codex session updates no longer collide on `quota-snapshots.json.tmp` or throw `ENOENT`. Failed writes now also clean up their partial temp files instead of leaving orphans in `~/.config/sidekick/`\n\n## [0.17.6] - 2026-04-19\n\n### Added\n\n- **`sidekick peak` command**: One-shot check for Claude\'s current peak-hours state \u2014 weekdays 13:00\u201319:00 UTC, when session limits drain faster on Free/Pro/Max/Team subscriptions. Prints a color-coded status block with a countdown to the next transition. Data comes from the public `promoclock.co/api/status` endpoint (third-party, unaffiliated with Anthropic) with a graceful fallback when unreachable. `--json` emits the full raw state\n- **Peak-hours block in `sidekick status`**: When the active provider is `claude-code`, the Claude + OpenAI health blocks are now followed by a **Claude Peak Hours** block (off-peak or in-peak, with countdown). Gated on the provider so OpenCode / Codex users don\'t trigger an unnecessary third-party fetch. `--json` output includes the new `peak` field\n- **Peak-hours summary in `sidekick quota`**: Claude subscription quota output now shows a **Peak** line under the 5-hour / 7-day bars \u2014 green dot off-peak, orange dot during an active peak, with a countdown to the next transition. `--json` output includes the new `peak` field\n\n## [0.17.5] - 2026-04-18\n\n### Added\n\n- **Default account bootstrap at CLI startup**: The CLI now calls `ensureDefaultAccounts()` from `sidekick-shared` at module load and awaits the result inside a Commander `preAction` hook, so the first real subcommand blocks briefly on the bootstrap while `--version` and `--help` stay instant. When a system Claude Code or Codex credential exists and no saved account is active for that provider yet, the CLI registers it as "Default" \u2014 `sidekick quota`, `sidekick account`, and `sidekick stats` now reflect the active account on first run without requiring an explicit `sidekick account --add` first. Idempotent, never overwrites manually saved accounts, and all errors are swallowed so startup is never blocked\n\nThanks to [@B33pBeeps](https://github.com/B33pBeeps) (Juan Fourie) for contributing this feature in [#16](https://github.com/cesarandreslopez/sidekick-agent-hub/pull/16).\n\n## [0.17.4] - 2026-04-17\n\n### Changed\n\n- **Pricing hydration import migrated to `sidekick-shared/node`**: `cli.ts` now imports `hydratePricingCatalog` from the new Node-only subpath and keeps `detectProvider` on the package root. Runtime behavior is unchanged; the split makes the CLI\'s import surface self-documenting (hydration is explicitly a Node API) and aligns the CLI with the shared library\'s new versioned public API contract\n\n## [0.17.3] - 2026-04-17\n\n### Changed\n\n- **Version sync with the VS Code extension**: Republished to keep CLI, extension, and shared-library versions aligned after a cosmetic changelog fix in 0.17.3. No CLI code changes \u2014 functionally identical to 0.17.2\n\n## [0.17.2] - 2026-04-17\n\n### Added\n\n- **LiteLLM pricing hydration on startup**: The CLI now fetches the LiteLLM pricing catalog on startup and caches to `~/.config/sidekick/pricing-catalog.json` with a 24-hour TTL, 3s timeout, and stale-cache fallback \u2014 new model prices are picked up without a CLI upgrade\n- **Expanded pricing coverage**: GPT-4o, GPT-4.1, GPT-5.x, o1, o3, and o3-mini families are now priced alongside the existing Claude entries\n- **Real-dollar Codex / Claude Code costs**: `EventAggregator` computes cost from the pricing table when the session provider doesn\'t report one, so `sidekick` live dashboards now show actual dollars for Codex and Claude Code sessions\n- **`stats` footer lists unpriced models**: `sidekick stats` prints any models encountered with no pricing entry so missing coverage is visible\n\n### Fixed\n\n- **Context-gauge % wrong for Opus 4.7 (1M) and other new models**: The dashboard\'s context gauge was dividing by 200K for Claude Opus 4.7 (native 1M), inflating the displayed %. The shared model \u2192 context-window map now includes Opus/Sonnet 4.7 (1M), GPT-5.4 (1.05M), GPT-5.3-Codex (400K), and GPT-5.3-Codex-Spark (128K). Claude Code\'s `[1m]` suffix is now also honored as an explicit 1M marker\n- **Silent Sonnet-priced fallback for unknown models**: Codex, GPT-5.x, and o-series rows were being rendered at Sonnet rates. Unknown-model rows now render as `\u2014` in yellow instead of inventing a dollar figure\n\n### Changed\n\n- **`historical-data.json` schema v2**: reads `priced` flag and `unpricedModelIds` from records written by the latest VS Code extension; v1 records still read correctly\n\n## [0.17.1] - 2026-04-13\n\n### Fixed\n\n- **Codex multi-home session discovery**: Provider detection now scans all candidate Codex home directories, fixing missed sessions when the managed profile home is empty but the system `~/.codex/` has activity\n\n## [0.17.0] - 2026-04-13\n\n### Added\n\n- **Multi-provider account management**: `sidekick account` now supports `--provider codex` for Codex profile management alongside Claude Code accounts\n- **Codex account lifecycle**: `--add` prepares a profile and spawns `codex login`; `--switch-to` and `--remove` accept email, label, or profile ID\n- **Quota snapshot fallback**: `sidekick quota` for Codex shows cached rate-limit snapshots when no active session exists, with "cached from" timestamp\n\n### Fixed\n\n- **Email normalization**: Claude account lookup normalizes email case for reliable matching\n\n## [0.16.1] - 2026-03-27\n\n### Fixed\n\n- **Dashboard provider status scoping**: The TUI now shows degraded-service notices only for the monitored provider \u2014 Claude for Claude Code sessions, OpenAI for Codex sessions, and no status banner for OpenCode\n\n## [0.16.0] - 2026-03-23\n\n### Changed\n\n- **Consistent cost formatting**: All cost displays (`stats`, `context`, Sessions panel, narrative prompt) now use shared `formatCost()` with intelligent decimal precision (4 places for < $0.01, 2 otherwise)\n- **QuotaService**: Rewritten to wrap shared `QuotaPoller` with exponential backoff instead of manual polling loop\n- **modelContext**: Now re-exports `getModelInfo` from shared library alongside `getContextWindowSize`\n\n## [0.15.2] - 2026-03-18\n\n### Fixed\n\n- **CLI help descriptions**: Updated `quota` and `status` command descriptions to reflect provider-aware behavior\n- **`sidekick quota --provider`**: Added local `--provider` option so `sidekick quota --provider codex` works naturally\n\n## [0.15.0] - 2026-03-18\n\n### Added\n\n- **OpenAI status page monitoring**: CLI dashboard now shows OpenAI API status alongside Claude API status\n- **Codex rate limits in dashboard**: Sessions panel displays Codex rate-limit data with "Rate Limits" header instead of "Quota"\n- **Provider-aware `sidekick quota` command**: Detects active provider and shows Codex rate limits, Claude subscription quota, or an informational message for OpenCode\n\n### Fixed\n\n- **QuotaService polling for Codex**: Dashboard no longer starts Claude OAuth quota polling when the active provider is Codex\n\n## [0.14.2] - 2026-03-16\n\n### Fixed\n\n- **Quota polling interval**: Reduced quota refresh from every 30 seconds to every 5 minutes to avoid unnecessary API calls\n- **SessionsPanel `detailWidth()` call**: Removed unused parameter from `detailWidth()` in the Sessions panel quota rendering\n\n## [0.14.1] - 2026-03-14\n\n### Fixed\n\n- **Per-model context window sizes**: Dashboard context gauge now shows correct utilization for Claude Opus 4.6 (1M context) and other models with non-200K windows\n\n### Changed\n\n- **Shared model context lookup**: CLI dashboard now uses the centralized `getModelContextWindowSize()` from `sidekick-shared` instead of a local duplicate map\n\n## [0.14.0] - 2026-03-12\n\n### Added\n\n- **`sidekick account` Command**: Manage Claude Code accounts from the terminal \u2014 list saved accounts, add the current account with an optional label, switch to the next or a specific account, and remove accounts. Supports `--json` output for scripting\n- **Quota Account Label**: `sidekick quota` now shows the active account email and label above the quota bars when multi-account is enabled\n- **macOS Keychain Support**: `sidekick account` and `sidekick quota` now read and write credentials via the system Keychain on macOS, fixing account switching and quota checks on Mac\n\n## [0.13.8] - 2026-03-12\n\n### Changed\n\n- **Structured quota failure output**: `sidekick quota` now renders consistent auth, rate-limit, server, network, and unexpected-failure copy from shared quota failure descriptors while preserving `--json` machine-readable output\n- **Dashboard unavailable quota rendering**: The Sessions panel now shows Claude Code quota failures inline instead of hiding the quota section whenever subscription data is unavailable\n- **Quota transition toasts**: The Ink dashboard now fires low-noise toast notifications only when Claude Code quota failure state changes, avoiding repeated alerts every polling interval\n\n## [0.13.7] - 2026-03-11\n\n### Changed\n\n- **npm README sync**: Updated the published CLI package README to reflect current OpenCode monitoring behavior, platform-specific data directories, and the `sqlite3` runtime requirement\n- **README badge cleanup**: Removed the Ask DeepWiki badge from the published CLI package README; the repo root README still keeps it\n\n## [0.13.6] - 2026-03-11\n\n### Changed\n\n- **Refreshed CLI Dashboard Wordmark**: Updated the dashboard wordmark/header styling for a cleaner splash and dashboard identity\n\n### Fixed\n\n- **OpenCode dashboard startup**: OpenCode DB-backed session discovery now resolves projects by worktree, sandboxes, and session directory instead of quietly behaving like no session exists\n- **OpenCode runtime notices**: The CLI now prints an OpenCode-only actionable notice when `opencode.db` exists but `sqlite3` is missing, blocked, or otherwise unusable in the current shell environment\n\n## [0.13.5] - 2026-03-10\n\n### Added\n\n- **`sidekick status` Command**: One-shot Claude API status check with color-coded text output and `--json` mode\n- **Dashboard Status Banner**: Status bar shows a colored `\u25CF API minor/major/critical` indicator when Claude is degraded; Sessions panel Summary tab shows an "API Status" section with affected components and active incident details. Polls every 60s\n\n## [0.13.4] - 2026-03-08\n\n### Fixed\n\n- **Onboarding Phrase Spam**: Splash screen and detail pane motivational phrases memoized \u2014 no longer flicker every render tick (fixes [#13](https://github.com/cesarandreslopez/sidekick-agent-hub/issues/13))\n\n### Changed\n\n- **Simplified Logo**: Replaced 6-line ASCII robot art with compact text header in splash, help, and changelog overlays\n- **Removed Dead Code**: Removed unused `getSplashContent()` and `HELP_HEADER` exports from branding module\n\n## [0.13.3] - 2026-03-04\n\n_No CLI-specific changes in this release._\n\n## [0.13.2] - 2026-03-04\n\n_No CLI-specific changes in this release._\n\n## [0.13.1] - 2026-03-04\n\n### Added\n\n- **`sidekick quota` Command**: One-shot subscription quota check showing 5-hour and 7-day utilization with color-coded progress bars and reset countdowns \u2014 supports `--json` for machine-readable output\n- **Quota Projections**: Elapsed-time projections shown in `sidekick quota` output and TUI dashboard quota section \u2014 displays projected end-of-window utilization next to current value (e.g., `40% \u2192 100%`), included in `--json` output as `projectedFiveHour` / `projectedSevenDay`\n\n## [0.13.0] - 2026-03-03\n\n_No CLI-specific changes in this release._\n\n## [0.12.10] - 2026-03-01\n\n### Added\n\n- **Events Panel** (key 7): Scrollable live event stream with colored type badges (`[USR]`, `[AST]`, `[TOOL]`, `[RES]`), timestamps, and keyword-highlighted summaries; detail tabs for full event JSON and surrounding context\n- **Charts Panel** (key 8): Tool frequency horizontal bars, event type distribution, 60-minute activity heatmap using `\u2591\u2592\u2593\u2588` intensity characters, and pattern analysis with frequency bars and template text\n- **Multi-Mode Filter**: `/` filter overlay now supports four modes \u2014 substring, fuzzy, regex, and date range \u2014 Tab cycles modes, regex mode shows red validation errors\n- **Search Term Highlighting**: Active filter terms highlighted in blue within side list items\n- **Timeline Keyword Coloring**: Event summaries in the Sessions panel Timeline tab now use semantic keyword coloring \u2014 errors red, success green, tool names cyan, file paths magenta\n\n### Removed\n\n- **Search Panel**: Removed redundant Search panel (previously key 7) \u2014 the `/` filter with multi-mode support serves the same purpose\n\n## [0.12.9] - 2026-02-28\n\n### Added\n\n- **Standalone Data Commands**: `sidekick tasks`, `sidekick decisions`, `sidekick notes`, `sidekick stats`, `sidekick handoff` for accessing project data without launching the TUI\n- **`sidekick search <query>`**: Cross-session full-text search from the terminal\n- **`sidekick context`**: Composite output of tasks, decisions, notes, and handoff for piping into other tools\n- **`--list` flag on `sidekick dump`**: Discover available session IDs before requiring `--session <id>`\n- **Search Panel**: Search panel (panel 7) wired into the TUI dashboard\n\n### Changed\n\n- **`taskMerger` utility**: Duplicate `mergeTasks` logic extracted into shared `taskMerger` utility\n- **Model constants**: Hardcoded model IDs extracted to named constants\n\n### Fixed\n\n- **`convention` icon**: Notes panel icon replaced with valid `tip` type\n- **Linux clipboard**: Now supports Wayland (`wl-copy`) and `xsel` fallbacks, with error messages instead of silent failure\n- **`provider.dispose()`**: Added to `dump` and `report` commands (prevents SQLite connection leaks)\n\n## [0.12.8] - 2026-02-28\n\n### Changed\n\n- **Dashboard UI/UX Polish**: Visual overhaul for better hierarchy, consistency, and readability\n - Splash screen and help overlay now display the robot ASCII logo\n - Toast notifications show severity icons (\u2718 error, \u26A0 warning, \u25CF info) with inner padding\n - Focused pane uses double-border for clear focus indication\n - Section dividers (`\u2500\u2500 Title \u2500\u2500\u2500\u2500`) replace bare bold headers in summary, agents, and context attribution\n - Tab bar: active tab underlined in magenta, inactive tabs dimmed, bracket syntax removed\n - Status bar: segmented layout with `\u2502` separators; keys bold, labels dim\n - Summary metrics condensed: elapsed/events/compactions on one line, tokens on one line with cache rate and cost\n - Sparklines display peak metadata annotations\n - Progress bars use blessed color tags for consistent coloring\n - Help overlay uses dot-leader alignment for all keybinding rows\n - Empty state hints per panel (e.g. "Tasks appear as your agent works.")\n - Session picker groups sessions by provider with section headers when multiple providers are present\n\n## [0.12.7] - 2026-02-27\n\n### Added\n\n- **HTML Session Report**: `sidekick report` command generates a self-contained HTML report and opens it in the default browser\n - Options: `--session`, `--output`, `--theme` (dark/light), `--no-open`, `--no-thinking`\n - TUI Dashboard: press `r` to generate and open an HTML report for the current session\n\n## [0.12.6] - 2026-02-26\n\n### Added\n\n- **Session Dump Command**: `sidekick dump` exports session data in text, markdown, or JSON format with `--format`, `--width`, and `--expand` options\n- **Plans Panel Re-enabled**: Plans panel restored in CLI dashboard with plan file discovery from `~/.claude/plans/`\n- **Enhanced Status Bar**: Session info display improved with richer metadata\n\n### Fixed\n\n- **Old snapshot format migration**: Restoring pre-0.12.3 session snapshots no longer shows empty timeline entries\n\n### Changed\n\n- **Phrase library moved to shared**: CLI-specific phrase formatting kept local, all phrase content now from `sidekick-shared`\n\n## [0.12.5] - 2026-02-24\n\n### Fixed\n\n- **Update check too slow to notice new versions**: Reduced npm registry cache TTL from 24 hours to 4 hours so upgrade notices appear sooner after a new release\n\n## [0.12.4] - 2026-02-24\n\n### Fixed\n\n- **Session crash on upgrade**: Fixed `d.timestamp.getTime is not a function` error when restoring tool call data from session snapshots \u2014 `Date` objects were serialized to strings by JSON but not rehydrated on restore, causing the session monitor to crash on first run after upgrading from 0.12.2 to 0.12.3\n\n## [0.12.3] - 2026-02-24\n\n### Added\n\n- **Latest-node indicator**: The most recently added node in tree and boxed mind map views is now marked with a yellow indicator\n- **Plan analytics in mind map**: Tree and boxed views now display plan progress and per-step metrics\n - Tree view: plan header shows completion stats; steps show complexity, duration, tokens, tool calls, and errors in metadata brackets\n - Box view: progress bar with completion percentage; steps show right-aligned metrics; subtitle shows step count and total duration\n- **Cross-provider plan extraction**: Shared `PlanExtractor` now handles Claude Code (EnterPlanMode/ExitPlanMode) and OpenCode (`<proposed_plan>` XML) plans \u2014 previously only Codex plans were shown\n- **Enriched plan data model**: Plan steps include duration, token count, tool call count, and error messages\n- **Phase-grouped plan display**: When a plan has phase structure, tree and boxed views group steps under phase headers with context lines from the original plan markdown\n- **Node type filter**: Press `f` on the Mind Map tab to cycle through node type filters (file, tool, task, subagent, command, plan, knowledge-note) \u2014 non-matching sections render dimmed in grey\n\n### Fixed\n\n- **Kanban board regression**: Subagent and plan-step tasks now correctly appear in the kanban board\n\n### Changed\n\n- **Plans panel temporarily disabled**: The Plans panel in the CLI dashboard is disabled until plan-mode event capture is reliably working end-to-end. Plan nodes in the mind map remain active.\n- `DashboardState` now delegates to shared `EventAggregator` instead of maintaining its own aggregation logic\n\n## [0.12.2] - 2026-02-23\n\n### Added\n\n- **Update notifications**: The dashboard now checks the npm registry for newer versions on startup and shows a yellow banner in the status bar when an update is available (e.g., `v0.13.0 available \u2014 npm i -g sidekick-agent-hub`). Results are cached for 24 hours to avoid repeated network requests.\n\n## [0.12.1] - 2026-02-23\n\n### Fixed\n\n- **VS Code integration**: Fixed exit code 127 when the extension launches the CLI dashboard on systems using nvm or volta (node binary not found when shell init is bypassed)\n\n## [0.12.0] - 2026-02-22\n\n### Added\n\n- **"Open CLI Dashboard" VS Code Integration**: New VS Code command `Sidekick: Open CLI Dashboard` launches the TUI dashboard in an integrated terminal\n - Install the CLI with `npm install -g sidekick-agent-hub`\n\n## [0.11.0] - 2026-02-19\n\n### Added\n\n- **Initial Release**: Full-screen TUI dashboard for monitoring agent sessions from the terminal\n - Ink-based terminal UI with panels for sessions, tasks, kanban, mind map, notes, decisions, search, files, and git diff\n - Multi-provider support: auto-detects Claude Code, OpenCode, and Codex sessions\n - Reads from `~/.config/sidekick/` \u2014 the same data files the VS Code extension writes\n - Usage: `sidekick dashboard [--project <path>] [--provider <id>]`\n';
|
|
80996
|
+
CHANGELOG_default = '# Changelog\n\nAll notable changes to the Sidekick Agent Hub CLI will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n## [0.18.3] - 2026-05-19\n\n### Added\n\n- **`sidekick quota history`**: New subcommand that renders a 13-week GitHub-contributions-style heatmap of quota utilization for the current workspace. Flags: `--weeks <n>` (1-26, default 13), `--provider claude|codex` (default both), `--workspace <path>` (default cwd). Bucketed glyphs (`\xB7 \u2591 \u2592 \u2593 \u2588`) are color-coded by utilization band (\u22640 / <25 / <50 / <75 / \u226575), with per-provider rows and a peak / avg / unavailable-days / samples footer. Days that hit `available: false` render as a red `\xD7`. With `--json`, emits a `{ workspaceId, weeks, providers: { claude?, codex? }, generatedAt }` payload \u2014 the same shape consumed by the VS Code dashboard\n\n### Changed\n\n- **Bundled `sidekick-shared` 0.18.3**: Picks up the new per-workspace quota history surface (`appendQuotaHistorySample`, `readQuotaHistoryRange`, `readQuotaHistoryDailyBuckets`, `pruneQuotaHistory`, `getWorkspaceIdFromPath`) and the optional `workspaceId` / `appendHistorySample` hooks on `CodexQuotaWatcher`\n\n## [0.18.2] - 2026-05-19\n\n### Added\n\n- **`sidekick quota --refresh`**: New flag on the `quota` command that, for Codex, explicitly refreshes from the ChatGPT usage API before falling back to local rollout data and cached snapshots. Without the flag, the Codex quota path stays fully local and makes no upstream network call\n\n### Changed\n\n- **Codex quota is local-only by default**: `sidekick quota --provider codex` now delegates to the new `resolveCodexQuota` orchestrator in `sidekick-shared`. It checks the current workspace\'s most recent rollout, then recent account-level rollouts under `CODEX_HOME/sessions`, then the active account\'s cached snapshot \u2014 no upstream network call unless `--refresh` is passed. Failure output continues to include structured `failureKind` / `httpStatus` / `retryAfterMs` fields under `--json`\n- **Bundled `sidekick-shared` 0.18.2**: Picks up the new Codex quota orchestrator (`resolveCodexQuota`, `resolveCodexQuotaFromLocalSources`, `readLatestCodexQuotaFromRollouts`, `fetchCodexQuotaFromApi`), the relaxed `CodexRateLimits` shape (nullable `resets_at` / `window_minutes`), the rate-limit-only `token_count` event emission in `JsonlSessionWatcher`, and `state_N.sqlite` discovery in `CodexDatabase` + provider auto-detect\n\n## [0.18.1] - 2026-05-08\n\n### Changed\n\n- **Shared dashboard formatting**: terminal dashboard `fmtNum()` and `formatDuration()` now delegate to `formatTokenCount()` and `formatDurationMs()` from `sidekick-shared`, keeping the existing CLI surface (uppercase `K`/`M` suffix, compact `1m5s` style) while removing forked rounding logic\n\n## [0.18.0] - 2026-05-08\n\n### Changed\n\n- **Bundled `sidekick-shared` 0.18.0**: Picks up the new provider-aware quota orchestration surface \u2014 `MultiProviderQuotaService`, `CodexQuotaWatcher`, `getActiveAccountStatus()`, `extractToolCall()`, cost-provenance helpers (`calculateCostWithProvenance`, `mergeCostSources`), and model display helpers (`shortModelName`, `getModelDisplayInfo`, `compareModelIds`, `sortModelIds`). `parseModelId()` also now recognizes legacy Claude IDs such as `claude-3-opus-20240229` and `claude-3-5-sonnet-20241022`\n- **No CLI runtime changes**: This release ships the shared library upgrade for downstream tooling alignment; `sidekick quota`, `sidekick status`, and the live dashboard keep using the existing polling path. Wiring the new orchestrator into the CLI will land in a follow-up release\n\n## [0.17.7] - 2026-04-28\n\n### Fixed\n\n- **Quota snapshot write race**: Updated the bundled `sidekick-shared` snapshot writer so concurrent `sidekick quota` / Codex session updates no longer collide on `quota-snapshots.json.tmp` or throw `ENOENT`. Failed writes now also clean up their partial temp files instead of leaving orphans in `~/.config/sidekick/`\n\n## [0.17.6] - 2026-04-19\n\n### Added\n\n- **`sidekick peak` command**: One-shot check for Claude\'s current peak-hours state \u2014 weekdays 13:00\u201319:00 UTC, when session limits drain faster on Free/Pro/Max/Team subscriptions. Prints a color-coded status block with a countdown to the next transition. Data comes from the public `promoclock.co/api/status` endpoint (third-party, unaffiliated with Anthropic) with a graceful fallback when unreachable. `--json` emits the full raw state\n- **Peak-hours block in `sidekick status`**: When the active provider is `claude-code`, the Claude + OpenAI health blocks are now followed by a **Claude Peak Hours** block (off-peak or in-peak, with countdown). Gated on the provider so OpenCode / Codex users don\'t trigger an unnecessary third-party fetch. `--json` output includes the new `peak` field\n- **Peak-hours summary in `sidekick quota`**: Claude subscription quota output now shows a **Peak** line under the 5-hour / 7-day bars \u2014 green dot off-peak, orange dot during an active peak, with a countdown to the next transition. `--json` output includes the new `peak` field\n\n## [0.17.5] - 2026-04-18\n\n### Added\n\n- **Default account bootstrap at CLI startup**: The CLI now calls `ensureDefaultAccounts()` from `sidekick-shared` at module load and awaits the result inside a Commander `preAction` hook, so the first real subcommand blocks briefly on the bootstrap while `--version` and `--help` stay instant. When a system Claude Code or Codex credential exists and no saved account is active for that provider yet, the CLI registers it as "Default" \u2014 `sidekick quota`, `sidekick account`, and `sidekick stats` now reflect the active account on first run without requiring an explicit `sidekick account --add` first. Idempotent, never overwrites manually saved accounts, and all errors are swallowed so startup is never blocked\n\nThanks to [@B33pBeeps](https://github.com/B33pBeeps) (Juan Fourie) for contributing this feature in [#16](https://github.com/cesarandreslopez/sidekick-agent-hub/pull/16).\n\n## [0.17.4] - 2026-04-17\n\n### Changed\n\n- **Pricing hydration import migrated to `sidekick-shared/node`**: `cli.ts` now imports `hydratePricingCatalog` from the new Node-only subpath and keeps `detectProvider` on the package root. Runtime behavior is unchanged; the split makes the CLI\'s import surface self-documenting (hydration is explicitly a Node API) and aligns the CLI with the shared library\'s new versioned public API contract\n\n## [0.17.3] - 2026-04-17\n\n### Changed\n\n- **Version sync with the VS Code extension**: Republished to keep CLI, extension, and shared-library versions aligned after a cosmetic changelog fix in 0.17.3. No CLI code changes \u2014 functionally identical to 0.17.2\n\n## [0.17.2] - 2026-04-17\n\n### Added\n\n- **LiteLLM pricing hydration on startup**: The CLI now fetches the LiteLLM pricing catalog on startup and caches to `~/.config/sidekick/pricing-catalog.json` with a 24-hour TTL, 3s timeout, and stale-cache fallback \u2014 new model prices are picked up without a CLI upgrade\n- **Expanded pricing coverage**: GPT-4o, GPT-4.1, GPT-5.x, o1, o3, and o3-mini families are now priced alongside the existing Claude entries\n- **Real-dollar Codex / Claude Code costs**: `EventAggregator` computes cost from the pricing table when the session provider doesn\'t report one, so `sidekick` live dashboards now show actual dollars for Codex and Claude Code sessions\n- **`stats` footer lists unpriced models**: `sidekick stats` prints any models encountered with no pricing entry so missing coverage is visible\n\n### Fixed\n\n- **Context-gauge % wrong for Opus 4.7 (1M) and other new models**: The dashboard\'s context gauge was dividing by 200K for Claude Opus 4.7 (native 1M), inflating the displayed %. The shared model \u2192 context-window map now includes Opus/Sonnet 4.7 (1M), GPT-5.4 (1.05M), GPT-5.3-Codex (400K), and GPT-5.3-Codex-Spark (128K). Claude Code\'s `[1m]` suffix is now also honored as an explicit 1M marker\n- **Silent Sonnet-priced fallback for unknown models**: Codex, GPT-5.x, and o-series rows were being rendered at Sonnet rates. Unknown-model rows now render as `\u2014` in yellow instead of inventing a dollar figure\n\n### Changed\n\n- **`historical-data.json` schema v2**: reads `priced` flag and `unpricedModelIds` from records written by the latest VS Code extension; v1 records still read correctly\n\n## [0.17.1] - 2026-04-13\n\n### Fixed\n\n- **Codex multi-home session discovery**: Provider detection now scans all candidate Codex home directories, fixing missed sessions when the managed profile home is empty but the system `~/.codex/` has activity\n\n## [0.17.0] - 2026-04-13\n\n### Added\n\n- **Multi-provider account management**: `sidekick account` now supports `--provider codex` for Codex profile management alongside Claude Code accounts\n- **Codex account lifecycle**: `--add` prepares a profile and spawns `codex login`; `--switch-to` and `--remove` accept email, label, or profile ID\n- **Quota snapshot fallback**: `sidekick quota` for Codex shows cached rate-limit snapshots when no active session exists, with "cached from" timestamp\n\n### Fixed\n\n- **Email normalization**: Claude account lookup normalizes email case for reliable matching\n\n## [0.16.1] - 2026-03-27\n\n### Fixed\n\n- **Dashboard provider status scoping**: The TUI now shows degraded-service notices only for the monitored provider \u2014 Claude for Claude Code sessions, OpenAI for Codex sessions, and no status banner for OpenCode\n\n## [0.16.0] - 2026-03-23\n\n### Changed\n\n- **Consistent cost formatting**: All cost displays (`stats`, `context`, Sessions panel, narrative prompt) now use shared `formatCost()` with intelligent decimal precision (4 places for < $0.01, 2 otherwise)\n- **QuotaService**: Rewritten to wrap shared `QuotaPoller` with exponential backoff instead of manual polling loop\n- **modelContext**: Now re-exports `getModelInfo` from shared library alongside `getContextWindowSize`\n\n## [0.15.2] - 2026-03-18\n\n### Fixed\n\n- **CLI help descriptions**: Updated `quota` and `status` command descriptions to reflect provider-aware behavior\n- **`sidekick quota --provider`**: Added local `--provider` option so `sidekick quota --provider codex` works naturally\n\n## [0.15.0] - 2026-03-18\n\n### Added\n\n- **OpenAI status page monitoring**: CLI dashboard now shows OpenAI API status alongside Claude API status\n- **Codex rate limits in dashboard**: Sessions panel displays Codex rate-limit data with "Rate Limits" header instead of "Quota"\n- **Provider-aware `sidekick quota` command**: Detects active provider and shows Codex rate limits, Claude subscription quota, or an informational message for OpenCode\n\n### Fixed\n\n- **QuotaService polling for Codex**: Dashboard no longer starts Claude OAuth quota polling when the active provider is Codex\n\n## [0.14.2] - 2026-03-16\n\n### Fixed\n\n- **Quota polling interval**: Reduced quota refresh from every 30 seconds to every 5 minutes to avoid unnecessary API calls\n- **SessionsPanel `detailWidth()` call**: Removed unused parameter from `detailWidth()` in the Sessions panel quota rendering\n\n## [0.14.1] - 2026-03-14\n\n### Fixed\n\n- **Per-model context window sizes**: Dashboard context gauge now shows correct utilization for Claude Opus 4.6 (1M context) and other models with non-200K windows\n\n### Changed\n\n- **Shared model context lookup**: CLI dashboard now uses the centralized `getModelContextWindowSize()` from `sidekick-shared` instead of a local duplicate map\n\n## [0.14.0] - 2026-03-12\n\n### Added\n\n- **`sidekick account` Command**: Manage Claude Code accounts from the terminal \u2014 list saved accounts, add the current account with an optional label, switch to the next or a specific account, and remove accounts. Supports `--json` output for scripting\n- **Quota Account Label**: `sidekick quota` now shows the active account email and label above the quota bars when multi-account is enabled\n- **macOS Keychain Support**: `sidekick account` and `sidekick quota` now read and write credentials via the system Keychain on macOS, fixing account switching and quota checks on Mac\n\n## [0.13.8] - 2026-03-12\n\n### Changed\n\n- **Structured quota failure output**: `sidekick quota` now renders consistent auth, rate-limit, server, network, and unexpected-failure copy from shared quota failure descriptors while preserving `--json` machine-readable output\n- **Dashboard unavailable quota rendering**: The Sessions panel now shows Claude Code quota failures inline instead of hiding the quota section whenever subscription data is unavailable\n- **Quota transition toasts**: The Ink dashboard now fires low-noise toast notifications only when Claude Code quota failure state changes, avoiding repeated alerts every polling interval\n\n## [0.13.7] - 2026-03-11\n\n### Changed\n\n- **npm README sync**: Updated the published CLI package README to reflect current OpenCode monitoring behavior, platform-specific data directories, and the `sqlite3` runtime requirement\n- **README badge cleanup**: Removed the Ask DeepWiki badge from the published CLI package README; the repo root README still keeps it\n\n## [0.13.6] - 2026-03-11\n\n### Changed\n\n- **Refreshed CLI Dashboard Wordmark**: Updated the dashboard wordmark/header styling for a cleaner splash and dashboard identity\n\n### Fixed\n\n- **OpenCode dashboard startup**: OpenCode DB-backed session discovery now resolves projects by worktree, sandboxes, and session directory instead of quietly behaving like no session exists\n- **OpenCode runtime notices**: The CLI now prints an OpenCode-only actionable notice when `opencode.db` exists but `sqlite3` is missing, blocked, or otherwise unusable in the current shell environment\n\n## [0.13.5] - 2026-03-10\n\n### Added\n\n- **`sidekick status` Command**: One-shot Claude API status check with color-coded text output and `--json` mode\n- **Dashboard Status Banner**: Status bar shows a colored `\u25CF API minor/major/critical` indicator when Claude is degraded; Sessions panel Summary tab shows an "API Status" section with affected components and active incident details. Polls every 60s\n\n## [0.13.4] - 2026-03-08\n\n### Fixed\n\n- **Onboarding Phrase Spam**: Splash screen and detail pane motivational phrases memoized \u2014 no longer flicker every render tick (fixes [#13](https://github.com/cesarandreslopez/sidekick-agent-hub/issues/13))\n\n### Changed\n\n- **Simplified Logo**: Replaced 6-line ASCII robot art with compact text header in splash, help, and changelog overlays\n- **Removed Dead Code**: Removed unused `getSplashContent()` and `HELP_HEADER` exports from branding module\n\n## [0.13.3] - 2026-03-04\n\n_No CLI-specific changes in this release._\n\n## [0.13.2] - 2026-03-04\n\n_No CLI-specific changes in this release._\n\n## [0.13.1] - 2026-03-04\n\n### Added\n\n- **`sidekick quota` Command**: One-shot subscription quota check showing 5-hour and 7-day utilization with color-coded progress bars and reset countdowns \u2014 supports `--json` for machine-readable output\n- **Quota Projections**: Elapsed-time projections shown in `sidekick quota` output and TUI dashboard quota section \u2014 displays projected end-of-window utilization next to current value (e.g., `40% \u2192 100%`), included in `--json` output as `projectedFiveHour` / `projectedSevenDay`\n\n## [0.13.0] - 2026-03-03\n\n_No CLI-specific changes in this release._\n\n## [0.12.10] - 2026-03-01\n\n### Added\n\n- **Events Panel** (key 7): Scrollable live event stream with colored type badges (`[USR]`, `[AST]`, `[TOOL]`, `[RES]`), timestamps, and keyword-highlighted summaries; detail tabs for full event JSON and surrounding context\n- **Charts Panel** (key 8): Tool frequency horizontal bars, event type distribution, 60-minute activity heatmap using `\u2591\u2592\u2593\u2588` intensity characters, and pattern analysis with frequency bars and template text\n- **Multi-Mode Filter**: `/` filter overlay now supports four modes \u2014 substring, fuzzy, regex, and date range \u2014 Tab cycles modes, regex mode shows red validation errors\n- **Search Term Highlighting**: Active filter terms highlighted in blue within side list items\n- **Timeline Keyword Coloring**: Event summaries in the Sessions panel Timeline tab now use semantic keyword coloring \u2014 errors red, success green, tool names cyan, file paths magenta\n\n### Removed\n\n- **Search Panel**: Removed redundant Search panel (previously key 7) \u2014 the `/` filter with multi-mode support serves the same purpose\n\n## [0.12.9] - 2026-02-28\n\n### Added\n\n- **Standalone Data Commands**: `sidekick tasks`, `sidekick decisions`, `sidekick notes`, `sidekick stats`, `sidekick handoff` for accessing project data without launching the TUI\n- **`sidekick search <query>`**: Cross-session full-text search from the terminal\n- **`sidekick context`**: Composite output of tasks, decisions, notes, and handoff for piping into other tools\n- **`--list` flag on `sidekick dump`**: Discover available session IDs before requiring `--session <id>`\n- **Search Panel**: Search panel (panel 7) wired into the TUI dashboard\n\n### Changed\n\n- **`taskMerger` utility**: Duplicate `mergeTasks` logic extracted into shared `taskMerger` utility\n- **Model constants**: Hardcoded model IDs extracted to named constants\n\n### Fixed\n\n- **`convention` icon**: Notes panel icon replaced with valid `tip` type\n- **Linux clipboard**: Now supports Wayland (`wl-copy`) and `xsel` fallbacks, with error messages instead of silent failure\n- **`provider.dispose()`**: Added to `dump` and `report` commands (prevents SQLite connection leaks)\n\n## [0.12.8] - 2026-02-28\n\n### Changed\n\n- **Dashboard UI/UX Polish**: Visual overhaul for better hierarchy, consistency, and readability\n - Splash screen and help overlay now display the robot ASCII logo\n - Toast notifications show severity icons (\u2718 error, \u26A0 warning, \u25CF info) with inner padding\n - Focused pane uses double-border for clear focus indication\n - Section dividers (`\u2500\u2500 Title \u2500\u2500\u2500\u2500`) replace bare bold headers in summary, agents, and context attribution\n - Tab bar: active tab underlined in magenta, inactive tabs dimmed, bracket syntax removed\n - Status bar: segmented layout with `\u2502` separators; keys bold, labels dim\n - Summary metrics condensed: elapsed/events/compactions on one line, tokens on one line with cache rate and cost\n - Sparklines display peak metadata annotations\n - Progress bars use blessed color tags for consistent coloring\n - Help overlay uses dot-leader alignment for all keybinding rows\n - Empty state hints per panel (e.g. "Tasks appear as your agent works.")\n - Session picker groups sessions by provider with section headers when multiple providers are present\n\n## [0.12.7] - 2026-02-27\n\n### Added\n\n- **HTML Session Report**: `sidekick report` command generates a self-contained HTML report and opens it in the default browser\n - Options: `--session`, `--output`, `--theme` (dark/light), `--no-open`, `--no-thinking`\n - TUI Dashboard: press `r` to generate and open an HTML report for the current session\n\n## [0.12.6] - 2026-02-26\n\n### Added\n\n- **Session Dump Command**: `sidekick dump` exports session data in text, markdown, or JSON format with `--format`, `--width`, and `--expand` options\n- **Plans Panel Re-enabled**: Plans panel restored in CLI dashboard with plan file discovery from `~/.claude/plans/`\n- **Enhanced Status Bar**: Session info display improved with richer metadata\n\n### Fixed\n\n- **Old snapshot format migration**: Restoring pre-0.12.3 session snapshots no longer shows empty timeline entries\n\n### Changed\n\n- **Phrase library moved to shared**: CLI-specific phrase formatting kept local, all phrase content now from `sidekick-shared`\n\n## [0.12.5] - 2026-02-24\n\n### Fixed\n\n- **Update check too slow to notice new versions**: Reduced npm registry cache TTL from 24 hours to 4 hours so upgrade notices appear sooner after a new release\n\n## [0.12.4] - 2026-02-24\n\n### Fixed\n\n- **Session crash on upgrade**: Fixed `d.timestamp.getTime is not a function` error when restoring tool call data from session snapshots \u2014 `Date` objects were serialized to strings by JSON but not rehydrated on restore, causing the session monitor to crash on first run after upgrading from 0.12.2 to 0.12.3\n\n## [0.12.3] - 2026-02-24\n\n### Added\n\n- **Latest-node indicator**: The most recently added node in tree and boxed mind map views is now marked with a yellow indicator\n- **Plan analytics in mind map**: Tree and boxed views now display plan progress and per-step metrics\n - Tree view: plan header shows completion stats; steps show complexity, duration, tokens, tool calls, and errors in metadata brackets\n - Box view: progress bar with completion percentage; steps show right-aligned metrics; subtitle shows step count and total duration\n- **Cross-provider plan extraction**: Shared `PlanExtractor` now handles Claude Code (EnterPlanMode/ExitPlanMode) and OpenCode (`<proposed_plan>` XML) plans \u2014 previously only Codex plans were shown\n- **Enriched plan data model**: Plan steps include duration, token count, tool call count, and error messages\n- **Phase-grouped plan display**: When a plan has phase structure, tree and boxed views group steps under phase headers with context lines from the original plan markdown\n- **Node type filter**: Press `f` on the Mind Map tab to cycle through node type filters (file, tool, task, subagent, command, plan, knowledge-note) \u2014 non-matching sections render dimmed in grey\n\n### Fixed\n\n- **Kanban board regression**: Subagent and plan-step tasks now correctly appear in the kanban board\n\n### Changed\n\n- **Plans panel temporarily disabled**: The Plans panel in the CLI dashboard is disabled until plan-mode event capture is reliably working end-to-end. Plan nodes in the mind map remain active.\n- `DashboardState` now delegates to shared `EventAggregator` instead of maintaining its own aggregation logic\n\n## [0.12.2] - 2026-02-23\n\n### Added\n\n- **Update notifications**: The dashboard now checks the npm registry for newer versions on startup and shows a yellow banner in the status bar when an update is available (e.g., `v0.13.0 available \u2014 npm i -g sidekick-agent-hub`). Results are cached for 24 hours to avoid repeated network requests.\n\n## [0.12.1] - 2026-02-23\n\n### Fixed\n\n- **VS Code integration**: Fixed exit code 127 when the extension launches the CLI dashboard on systems using nvm or volta (node binary not found when shell init is bypassed)\n\n## [0.12.0] - 2026-02-22\n\n### Added\n\n- **"Open CLI Dashboard" VS Code Integration**: New VS Code command `Sidekick: Open CLI Dashboard` launches the TUI dashboard in an integrated terminal\n - Install the CLI with `npm install -g sidekick-agent-hub`\n\n## [0.11.0] - 2026-02-19\n\n### Added\n\n- **Initial Release**: Full-screen TUI dashboard for monitoring agent sessions from the terminal\n - Ink-based terminal UI with panels for sessions, tasks, kanban, mind map, notes, decisions, search, files, and git diff\n - Multi-provider support: auto-detects Claude Code, OpenCode, and Codex sessions\n - Reads from `~/.config/sidekick/` \u2014 the same data files the VS Code extension writes\n - Usage: `sidekick dashboard [--project <path>] [--provider <id>]`\n';
|
|
80604
80997
|
}
|
|
80605
80998
|
});
|
|
80606
80999
|
|
|
@@ -82919,6 +83312,183 @@ var init_quota = __esm({
|
|
|
82919
83312
|
}
|
|
82920
83313
|
});
|
|
82921
83314
|
|
|
83315
|
+
// src/commands/quotaHistory.ts
|
|
83316
|
+
var quotaHistory_exports = {};
|
|
83317
|
+
__export(quotaHistory_exports, {
|
|
83318
|
+
bucketForUtilization: () => bucketForUtilization,
|
|
83319
|
+
colorForBucket: () => colorForBucket,
|
|
83320
|
+
quotaHistoryAction: () => quotaHistoryAction,
|
|
83321
|
+
renderProviderHeatmap: () => renderProviderHeatmap
|
|
83322
|
+
});
|
|
83323
|
+
function bucketForUtilization(util) {
|
|
83324
|
+
if (util <= 0) return 0;
|
|
83325
|
+
if (util < 25) return 1;
|
|
83326
|
+
if (util < 50) return 2;
|
|
83327
|
+
if (util < 75) return 3;
|
|
83328
|
+
return 4;
|
|
83329
|
+
}
|
|
83330
|
+
function colorForBucket(bucket) {
|
|
83331
|
+
switch (bucket) {
|
|
83332
|
+
case 0:
|
|
83333
|
+
return source_default.dim;
|
|
83334
|
+
case 1:
|
|
83335
|
+
return source_default.green;
|
|
83336
|
+
case 2:
|
|
83337
|
+
return source_default.yellow;
|
|
83338
|
+
case 3:
|
|
83339
|
+
return source_default.hex("#ff8800");
|
|
83340
|
+
case 4:
|
|
83341
|
+
return source_default.red.bold;
|
|
83342
|
+
default:
|
|
83343
|
+
return source_default.white;
|
|
83344
|
+
}
|
|
83345
|
+
}
|
|
83346
|
+
function bucketsToCells(buckets) {
|
|
83347
|
+
return buckets.map((b) => ({
|
|
83348
|
+
date: b.date,
|
|
83349
|
+
utilization: Math.max(b.maxUtilizationFiveHour, b.maxUtilizationSevenDay),
|
|
83350
|
+
unavailable: b.anyUnavailable,
|
|
83351
|
+
samples: b.samples
|
|
83352
|
+
}));
|
|
83353
|
+
}
|
|
83354
|
+
function renderProviderHeatmap(label, cells, weeks) {
|
|
83355
|
+
const cols = weeks;
|
|
83356
|
+
const rows = 7;
|
|
83357
|
+
const totalCells = cols * rows;
|
|
83358
|
+
let firstDayOfWeek = 0;
|
|
83359
|
+
if (cells.length > 0) {
|
|
83360
|
+
firstDayOfWeek = (/* @__PURE__ */ new Date(`${cells[0].date}T00:00:00Z`)).getUTCDay();
|
|
83361
|
+
}
|
|
83362
|
+
const padded = [];
|
|
83363
|
+
for (let i = 0; i < firstDayOfWeek; i += 1) padded.push(null);
|
|
83364
|
+
for (const cell of cells) padded.push(cell);
|
|
83365
|
+
while (padded.length < totalCells) padded.push(null);
|
|
83366
|
+
while (padded.length > totalCells) padded.shift();
|
|
83367
|
+
const lines = [];
|
|
83368
|
+
for (let row = 0; row < rows; row += 1) {
|
|
83369
|
+
const dayLabel = source_default.dim(DAY_LABELS[row].padEnd(4));
|
|
83370
|
+
const glyphs = [];
|
|
83371
|
+
for (let col = 0; col < cols; col += 1) {
|
|
83372
|
+
const cell = padded[col * rows + row];
|
|
83373
|
+
if (!cell) {
|
|
83374
|
+
glyphs.push(source_default.dim(" "));
|
|
83375
|
+
continue;
|
|
83376
|
+
}
|
|
83377
|
+
if (cell.unavailable && cell.samples > 0) {
|
|
83378
|
+
glyphs.push(source_default.red("\xD7"));
|
|
83379
|
+
continue;
|
|
83380
|
+
}
|
|
83381
|
+
const bucket = bucketForUtilization(cell.utilization);
|
|
83382
|
+
glyphs.push(colorForBucket(bucket)(BUCKET_GLYPHS[bucket]));
|
|
83383
|
+
}
|
|
83384
|
+
lines.push(`${dayLabel}${glyphs.join("")}`);
|
|
83385
|
+
}
|
|
83386
|
+
let peak = 0;
|
|
83387
|
+
let sum = 0;
|
|
83388
|
+
let sampledDays = 0;
|
|
83389
|
+
let unavailableDays = 0;
|
|
83390
|
+
let totalSamples = 0;
|
|
83391
|
+
for (const cell of cells) {
|
|
83392
|
+
if (cell.samples === 0) continue;
|
|
83393
|
+
sampledDays += 1;
|
|
83394
|
+
totalSamples += cell.samples;
|
|
83395
|
+
if (cell.utilization > peak) peak = cell.utilization;
|
|
83396
|
+
sum += cell.utilization;
|
|
83397
|
+
if (cell.unavailable) unavailableDays += 1;
|
|
83398
|
+
}
|
|
83399
|
+
const avg = sampledDays > 0 ? Math.round(sum / sampledDays) : 0;
|
|
83400
|
+
const peakColor = colorForBucket(bucketForUtilization(peak));
|
|
83401
|
+
const avgColor = colorForBucket(bucketForUtilization(avg));
|
|
83402
|
+
const header = source_default.bold(label) + source_default.dim(` \xB7 ${weeks} weeks \xB7 ${sampledDays} day(s) with samples`);
|
|
83403
|
+
const footer = [
|
|
83404
|
+
`Peak ${peakColor(`${peak}%`)}`,
|
|
83405
|
+
`Avg ${avgColor(`${avg}%`)}`,
|
|
83406
|
+
unavailableDays > 0 ? source_default.red(`Unavailable ${unavailableDays} day(s)`) : null,
|
|
83407
|
+
source_default.dim(`Samples ${totalSamples.toLocaleString()}`)
|
|
83408
|
+
].filter(Boolean).join(" \xB7 ");
|
|
83409
|
+
return [header, ...lines, footer].join("\n");
|
|
83410
|
+
}
|
|
83411
|
+
function legend() {
|
|
83412
|
+
const swatches = BUCKET_GLYPHS.map((g, i) => colorForBucket(i)(g)).join("");
|
|
83413
|
+
return source_default.dim("Less ") + swatches + source_default.dim(" More");
|
|
83414
|
+
}
|
|
83415
|
+
function parseProviderFilter(value) {
|
|
83416
|
+
if (typeof value !== "string") return "auto";
|
|
83417
|
+
const lower = value.toLowerCase();
|
|
83418
|
+
if (lower === "claude" || lower === "claude-code") return "claude";
|
|
83419
|
+
if (lower === "codex") return "codex";
|
|
83420
|
+
return "auto";
|
|
83421
|
+
}
|
|
83422
|
+
function clampWeeks(value) {
|
|
83423
|
+
const parsed = typeof value === "string" ? Number.parseInt(value, 10) : typeof value === "number" ? value : 13;
|
|
83424
|
+
if (!Number.isFinite(parsed)) return 13;
|
|
83425
|
+
return Math.max(1, Math.min(26, parsed));
|
|
83426
|
+
}
|
|
83427
|
+
async function quotaHistoryAction(_localOpts, cmd) {
|
|
83428
|
+
const globalOpts = cmd.parent?.parent?.opts() ?? cmd.parent?.opts() ?? {};
|
|
83429
|
+
const localOpts = cmd.opts();
|
|
83430
|
+
const jsonOutput = !!globalOpts.json;
|
|
83431
|
+
const weeks = clampWeeks(localOpts.weeks);
|
|
83432
|
+
const providerFilter = parseProviderFilter(localOpts.provider ?? globalOpts.provider);
|
|
83433
|
+
const workspacePath = typeof localOpts.workspace === "string" && localOpts.workspace ? localOpts.workspace : process.cwd();
|
|
83434
|
+
const workspaceId = (0, import_sidekick_shared30.getWorkspaceIdFromPath)(workspacePath);
|
|
83435
|
+
const toMs = Date.now();
|
|
83436
|
+
const fromMs = toMs - (weeks * 7 - 1) * MS_PER_DAY;
|
|
83437
|
+
const from = new Date(fromMs).toISOString();
|
|
83438
|
+
const to = new Date(toMs).toISOString();
|
|
83439
|
+
const wanted = providerFilter === "auto" ? ["claude", "codex"] : [providerFilter];
|
|
83440
|
+
const providerCells = {};
|
|
83441
|
+
for (const provider of wanted) {
|
|
83442
|
+
const buckets = await (0, import_sidekick_shared30.readQuotaHistoryDailyBuckets)({ workspaceId, provider, from, to });
|
|
83443
|
+
providerCells[provider] = bucketsToCells(buckets);
|
|
83444
|
+
}
|
|
83445
|
+
const payload = {
|
|
83446
|
+
workspaceId,
|
|
83447
|
+
weeks,
|
|
83448
|
+
providers: {
|
|
83449
|
+
...providerCells.claude ? { claude: { cells: providerCells.claude } } : {},
|
|
83450
|
+
...providerCells.codex ? { codex: { cells: providerCells.codex } } : {}
|
|
83451
|
+
},
|
|
83452
|
+
generatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
83453
|
+
};
|
|
83454
|
+
if (jsonOutput) {
|
|
83455
|
+
process.stdout.write(JSON.stringify(payload, null, 2) + "\n");
|
|
83456
|
+
return;
|
|
83457
|
+
}
|
|
83458
|
+
const sections = [];
|
|
83459
|
+
const claudeHasData = (payload.providers.claude?.cells ?? []).some((c) => c.samples > 0);
|
|
83460
|
+
const codexHasData = (payload.providers.codex?.cells ?? []).some((c) => c.samples > 0);
|
|
83461
|
+
if (providerFilter === "auto" && !claudeHasData && !codexHasData) {
|
|
83462
|
+
process.stdout.write(
|
|
83463
|
+
source_default.yellow(`No quota history yet for workspace ${source_default.bold(workspaceId)}.`) + "\n" + source_default.dim(`Run a Claude Max or Codex session in this workspace, or override with --workspace <path>.`) + "\n"
|
|
83464
|
+
);
|
|
83465
|
+
return;
|
|
83466
|
+
}
|
|
83467
|
+
if (payload.providers.claude && (providerFilter !== "auto" || claudeHasData)) {
|
|
83468
|
+
sections.push(renderProviderHeatmap("Claude", payload.providers.claude.cells, weeks));
|
|
83469
|
+
}
|
|
83470
|
+
if (payload.providers.codex && (providerFilter !== "auto" || codexHasData)) {
|
|
83471
|
+
sections.push(renderProviderHeatmap("Codex", payload.providers.codex.cells, weeks));
|
|
83472
|
+
}
|
|
83473
|
+
const header = source_default.dim(`workspace ${workspaceId} \xB7 ${from.slice(0, 10)} \u2192 ${to.slice(0, 10)}`);
|
|
83474
|
+
process.stdout.write(`${header}
|
|
83475
|
+
${legend()}
|
|
83476
|
+
|
|
83477
|
+
${sections.join("\n\n")}
|
|
83478
|
+
`);
|
|
83479
|
+
}
|
|
83480
|
+
var import_sidekick_shared30, MS_PER_DAY, BUCKET_GLYPHS, DAY_LABELS;
|
|
83481
|
+
var init_quotaHistory = __esm({
|
|
83482
|
+
"src/commands/quotaHistory.ts"() {
|
|
83483
|
+
"use strict";
|
|
83484
|
+
init_source();
|
|
83485
|
+
import_sidekick_shared30 = __toESM(require_dist(), 1);
|
|
83486
|
+
MS_PER_DAY = 864e5;
|
|
83487
|
+
BUCKET_GLYPHS = ["\xB7", "\u2591", "\u2592", "\u2593", "\u2588"];
|
|
83488
|
+
DAY_LABELS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
83489
|
+
}
|
|
83490
|
+
});
|
|
83491
|
+
|
|
82922
83492
|
// src/commands/status.ts
|
|
82923
83493
|
var status_exports = {};
|
|
82924
83494
|
__export(status_exports, {
|
|
@@ -82965,9 +83535,9 @@ async function statusAction(_opts, cmd) {
|
|
|
82965
83535
|
const providerId = resolveProviderId(globalOpts);
|
|
82966
83536
|
const wantsPeak = providerId === "claude-code";
|
|
82967
83537
|
const [claude, openai, peak] = await Promise.all([
|
|
82968
|
-
(0,
|
|
82969
|
-
(0,
|
|
82970
|
-
wantsPeak ? (0,
|
|
83538
|
+
(0, import_sidekick_shared31.fetchProviderStatus)(),
|
|
83539
|
+
(0, import_sidekick_shared31.fetchOpenAIStatus)(),
|
|
83540
|
+
wantsPeak ? (0, import_sidekick_shared31.fetchPeakHoursStatus)() : Promise.resolve(null)
|
|
82971
83541
|
]);
|
|
82972
83542
|
if (jsonOutput) {
|
|
82973
83543
|
process.stdout.write(JSON.stringify({ claude, openai, peak }, null, 2) + "\n");
|
|
@@ -82981,12 +83551,12 @@ async function statusAction(_opts, cmd) {
|
|
|
82981
83551
|
printPeakHoursBlock(peak);
|
|
82982
83552
|
}
|
|
82983
83553
|
}
|
|
82984
|
-
var
|
|
83554
|
+
var import_sidekick_shared31;
|
|
82985
83555
|
var init_status = __esm({
|
|
82986
83556
|
"src/commands/status.ts"() {
|
|
82987
83557
|
"use strict";
|
|
82988
83558
|
init_source();
|
|
82989
|
-
|
|
83559
|
+
import_sidekick_shared31 = __toESM(require_dist(), 1);
|
|
82990
83560
|
init_peakHoursRender();
|
|
82991
83561
|
init_cli();
|
|
82992
83562
|
}
|
|
@@ -83000,18 +83570,18 @@ __export(peak_exports, {
|
|
|
83000
83570
|
async function peakAction(_opts, cmd) {
|
|
83001
83571
|
const globalOpts = cmd.parent.opts();
|
|
83002
83572
|
const jsonOutput = !!globalOpts.json;
|
|
83003
|
-
const state = await (0,
|
|
83573
|
+
const state = await (0, import_sidekick_shared32.fetchPeakHoursStatus)();
|
|
83004
83574
|
if (jsonOutput) {
|
|
83005
83575
|
process.stdout.write(JSON.stringify(state, null, 2) + "\n");
|
|
83006
83576
|
return;
|
|
83007
83577
|
}
|
|
83008
83578
|
printPeakHoursBlock(state);
|
|
83009
83579
|
}
|
|
83010
|
-
var
|
|
83580
|
+
var import_sidekick_shared32;
|
|
83011
83581
|
var init_peak = __esm({
|
|
83012
83582
|
"src/commands/peak.ts"() {
|
|
83013
83583
|
"use strict";
|
|
83014
|
-
|
|
83584
|
+
import_sidekick_shared32 = __toESM(require_dist(), 1);
|
|
83015
83585
|
init_peakHoursRender();
|
|
83016
83586
|
}
|
|
83017
83587
|
});
|
|
@@ -83043,13 +83613,13 @@ async function accountAction(_opts, cmd) {
|
|
|
83043
83613
|
}
|
|
83044
83614
|
function claudeAccountAction(opts, jsonOutput) {
|
|
83045
83615
|
if (opts.add) {
|
|
83046
|
-
const result = (0,
|
|
83616
|
+
const result = (0, import_sidekick_shared33.addCurrentAccount)(opts.label);
|
|
83047
83617
|
if (!result.success) {
|
|
83048
83618
|
process.stderr.write(source_default.red(result.error ?? "Failed to save account.") + "\n");
|
|
83049
83619
|
process.exit(1);
|
|
83050
83620
|
return;
|
|
83051
83621
|
}
|
|
83052
|
-
const active2 = (0,
|
|
83622
|
+
const active2 = (0, import_sidekick_shared33.readActiveClaudeAccount)();
|
|
83053
83623
|
if (jsonOutput) {
|
|
83054
83624
|
process.stdout.write(JSON.stringify({ action: "added", provider: "claude-code", email: active2?.email, label: opts.label }) + "\n");
|
|
83055
83625
|
} else {
|
|
@@ -83058,14 +83628,14 @@ function claudeAccountAction(opts, jsonOutput) {
|
|
|
83058
83628
|
return;
|
|
83059
83629
|
}
|
|
83060
83630
|
if (opts.remove) {
|
|
83061
|
-
const accounts2 = (0,
|
|
83631
|
+
const accounts2 = (0, import_sidekick_shared33.listAccounts)();
|
|
83062
83632
|
const target = findClaudeAccount(opts.remove, accounts2);
|
|
83063
83633
|
if (!target) {
|
|
83064
83634
|
process.stderr.write(source_default.red(`Account "${opts.remove}" not found.`) + "\n");
|
|
83065
83635
|
process.exit(1);
|
|
83066
83636
|
return;
|
|
83067
83637
|
}
|
|
83068
|
-
const result = (0,
|
|
83638
|
+
const result = (0, import_sidekick_shared33.removeAccount)(target.uuid);
|
|
83069
83639
|
if (!result.success) {
|
|
83070
83640
|
process.stderr.write(source_default.red(result.error ?? "Failed to remove account.") + "\n");
|
|
83071
83641
|
process.exit(1);
|
|
@@ -83079,14 +83649,14 @@ function claudeAccountAction(opts, jsonOutput) {
|
|
|
83079
83649
|
return;
|
|
83080
83650
|
}
|
|
83081
83651
|
if (opts.switchTo) {
|
|
83082
|
-
const accounts2 = (0,
|
|
83652
|
+
const accounts2 = (0, import_sidekick_shared33.listAccounts)();
|
|
83083
83653
|
const target = findClaudeAccount(opts.switchTo, accounts2);
|
|
83084
83654
|
if (!target) {
|
|
83085
83655
|
process.stderr.write(source_default.red(`Account "${opts.switchTo}" not found.`) + "\n");
|
|
83086
83656
|
process.exit(1);
|
|
83087
83657
|
return;
|
|
83088
83658
|
}
|
|
83089
|
-
const result = (0,
|
|
83659
|
+
const result = (0, import_sidekick_shared33.switchToAccount)(target.uuid);
|
|
83090
83660
|
if (!result.success) {
|
|
83091
83661
|
process.stderr.write(source_default.red(result.error ?? "Failed to switch.") + "\n");
|
|
83092
83662
|
process.exit(1);
|
|
@@ -83100,17 +83670,17 @@ function claudeAccountAction(opts, jsonOutput) {
|
|
|
83100
83670
|
return;
|
|
83101
83671
|
}
|
|
83102
83672
|
if (opts.switch) {
|
|
83103
|
-
const accounts2 = (0,
|
|
83673
|
+
const accounts2 = (0, import_sidekick_shared33.listAccounts)();
|
|
83104
83674
|
if (accounts2.length < 2) {
|
|
83105
83675
|
process.stderr.write(source_default.yellow("Need at least 2 saved accounts to switch.") + "\n");
|
|
83106
83676
|
process.exit(1);
|
|
83107
83677
|
return;
|
|
83108
83678
|
}
|
|
83109
|
-
const active2 = (0,
|
|
83679
|
+
const active2 = (0, import_sidekick_shared33.getActiveAccount)();
|
|
83110
83680
|
const currentIdx = active2 ? accounts2.findIndex((a) => a.uuid === active2.uuid) : -1;
|
|
83111
83681
|
const nextIdx = (currentIdx + 1) % accounts2.length;
|
|
83112
83682
|
const target = accounts2[nextIdx];
|
|
83113
|
-
const result = (0,
|
|
83683
|
+
const result = (0, import_sidekick_shared33.switchToAccount)(target.uuid);
|
|
83114
83684
|
if (!result.success) {
|
|
83115
83685
|
process.stderr.write(source_default.red(result.error ?? "Failed to switch.") + "\n");
|
|
83116
83686
|
process.exit(1);
|
|
@@ -83123,9 +83693,9 @@ function claudeAccountAction(opts, jsonOutput) {
|
|
|
83123
83693
|
}
|
|
83124
83694
|
return;
|
|
83125
83695
|
}
|
|
83126
|
-
const accounts = (0,
|
|
83696
|
+
const accounts = (0, import_sidekick_shared33.listAccounts)();
|
|
83127
83697
|
if (accounts.length === 0) {
|
|
83128
|
-
const current = (0,
|
|
83698
|
+
const current = (0, import_sidekick_shared33.readActiveClaudeAccount)();
|
|
83129
83699
|
if (jsonOutput) {
|
|
83130
83700
|
process.stdout.write(JSON.stringify({ provider: "claude-code", accounts: [], current: current ?? null }) + "\n");
|
|
83131
83701
|
} else if (current) {
|
|
@@ -83137,14 +83707,14 @@ function claudeAccountAction(opts, jsonOutput) {
|
|
|
83137
83707
|
return;
|
|
83138
83708
|
}
|
|
83139
83709
|
if (jsonOutput) {
|
|
83140
|
-
const active2 = (0,
|
|
83710
|
+
const active2 = (0, import_sidekick_shared33.getActiveAccount)();
|
|
83141
83711
|
process.stdout.write(JSON.stringify({
|
|
83142
83712
|
provider: "claude-code",
|
|
83143
83713
|
accounts: accounts.map((a) => ({ ...a, active: a.uuid === active2?.uuid }))
|
|
83144
83714
|
}, null, 2) + "\n");
|
|
83145
83715
|
return;
|
|
83146
83716
|
}
|
|
83147
|
-
const active = (0,
|
|
83717
|
+
const active = (0, import_sidekick_shared33.getActiveAccount)();
|
|
83148
83718
|
process.stdout.write(source_default.bold("Claude Accounts\n"));
|
|
83149
83719
|
process.stdout.write(source_default.dim("\u2500".repeat(50) + "\n"));
|
|
83150
83720
|
for (const account of accounts) {
|
|
@@ -83191,7 +83761,7 @@ function codexAccountAction(opts, jsonOutput) {
|
|
|
83191
83761
|
process.exit(1);
|
|
83192
83762
|
return;
|
|
83193
83763
|
}
|
|
83194
|
-
const prepared = (0,
|
|
83764
|
+
const prepared = (0, import_sidekick_shared33.prepareCodexAccount)(opts.label);
|
|
83195
83765
|
if (!prepared.success) {
|
|
83196
83766
|
process.stderr.write(source_default.red(prepared.error ?? "Failed to prepare Codex account.") + "\n");
|
|
83197
83767
|
process.exit(1);
|
|
@@ -83209,14 +83779,14 @@ function codexAccountAction(opts, jsonOutput) {
|
|
|
83209
83779
|
process.exit(1);
|
|
83210
83780
|
return;
|
|
83211
83781
|
}
|
|
83212
|
-
const finalized = (0,
|
|
83782
|
+
const finalized = (0, import_sidekick_shared33.finalizeCodexAccount)(prepared.profileId);
|
|
83213
83783
|
if (!finalized.success) {
|
|
83214
83784
|
process.stderr.write(source_default.red(finalized.error ?? "Failed to finalize Codex account.") + "\n");
|
|
83215
83785
|
process.exit(1);
|
|
83216
83786
|
return;
|
|
83217
83787
|
}
|
|
83218
83788
|
}
|
|
83219
|
-
const active2 = (0,
|
|
83789
|
+
const active2 = (0, import_sidekick_shared33.getActiveCodexAccount)();
|
|
83220
83790
|
if (jsonOutput) {
|
|
83221
83791
|
process.stdout.write(JSON.stringify({
|
|
83222
83792
|
action: "added",
|
|
@@ -83232,14 +83802,14 @@ function codexAccountAction(opts, jsonOutput) {
|
|
|
83232
83802
|
return;
|
|
83233
83803
|
}
|
|
83234
83804
|
if (opts.remove) {
|
|
83235
|
-
const accounts2 = (0,
|
|
83805
|
+
const accounts2 = (0, import_sidekick_shared33.listCodexAccounts)();
|
|
83236
83806
|
const target = findCodexAccount(opts.remove, accounts2);
|
|
83237
83807
|
if (!target) {
|
|
83238
83808
|
process.stderr.write(source_default.red(`Codex account "${opts.remove}" not found.`) + "\n");
|
|
83239
83809
|
process.exit(1);
|
|
83240
83810
|
return;
|
|
83241
83811
|
}
|
|
83242
|
-
const result = (0,
|
|
83812
|
+
const result = (0, import_sidekick_shared33.removeCodexAccount)(target.id);
|
|
83243
83813
|
if (!result.success) {
|
|
83244
83814
|
process.stderr.write(source_default.red(result.error ?? "Failed to remove Codex account.") + "\n");
|
|
83245
83815
|
process.exit(1);
|
|
@@ -83253,14 +83823,14 @@ function codexAccountAction(opts, jsonOutput) {
|
|
|
83253
83823
|
return;
|
|
83254
83824
|
}
|
|
83255
83825
|
if (opts.switchTo) {
|
|
83256
|
-
const accounts2 = (0,
|
|
83826
|
+
const accounts2 = (0, import_sidekick_shared33.listCodexAccounts)();
|
|
83257
83827
|
const target = findCodexAccount(opts.switchTo, accounts2);
|
|
83258
83828
|
if (!target) {
|
|
83259
83829
|
process.stderr.write(source_default.red(`Codex account "${opts.switchTo}" not found.`) + "\n");
|
|
83260
83830
|
process.exit(1);
|
|
83261
83831
|
return;
|
|
83262
83832
|
}
|
|
83263
|
-
const result = (0,
|
|
83833
|
+
const result = (0, import_sidekick_shared33.switchToCodexAccount)(target.id);
|
|
83264
83834
|
if (!result.success) {
|
|
83265
83835
|
process.stderr.write(source_default.red(result.error ?? "Failed to switch Codex account.") + "\n");
|
|
83266
83836
|
process.exit(1);
|
|
@@ -83274,17 +83844,17 @@ function codexAccountAction(opts, jsonOutput) {
|
|
|
83274
83844
|
return;
|
|
83275
83845
|
}
|
|
83276
83846
|
if (opts.switch) {
|
|
83277
|
-
const accounts2 = (0,
|
|
83847
|
+
const accounts2 = (0, import_sidekick_shared33.listCodexAccounts)();
|
|
83278
83848
|
if (accounts2.length < 2) {
|
|
83279
83849
|
process.stderr.write(source_default.yellow("Need at least 2 saved Codex accounts to switch.") + "\n");
|
|
83280
83850
|
process.exit(1);
|
|
83281
83851
|
return;
|
|
83282
83852
|
}
|
|
83283
|
-
const active2 = (0,
|
|
83853
|
+
const active2 = (0, import_sidekick_shared33.getActiveCodexAccount)();
|
|
83284
83854
|
const currentIdx = active2 ? accounts2.findIndex((account) => account.id === active2.id) : -1;
|
|
83285
83855
|
const nextIdx = (currentIdx + 1) % accounts2.length;
|
|
83286
83856
|
const target = accounts2[nextIdx];
|
|
83287
|
-
const result = (0,
|
|
83857
|
+
const result = (0, import_sidekick_shared33.switchToCodexAccount)(target.id);
|
|
83288
83858
|
if (!result.success) {
|
|
83289
83859
|
process.stderr.write(source_default.red(result.error ?? "Failed to switch Codex account.") + "\n");
|
|
83290
83860
|
process.exit(1);
|
|
@@ -83297,7 +83867,7 @@ function codexAccountAction(opts, jsonOutput) {
|
|
|
83297
83867
|
}
|
|
83298
83868
|
return;
|
|
83299
83869
|
}
|
|
83300
|
-
const accounts = (0,
|
|
83870
|
+
const accounts = (0, import_sidekick_shared33.listCodexAccounts)();
|
|
83301
83871
|
if (accounts.length === 0) {
|
|
83302
83872
|
if (jsonOutput) {
|
|
83303
83873
|
process.stdout.write(JSON.stringify({ provider: "codex", accounts: [], current: null }) + "\n");
|
|
@@ -83307,7 +83877,7 @@ function codexAccountAction(opts, jsonOutput) {
|
|
|
83307
83877
|
return;
|
|
83308
83878
|
}
|
|
83309
83879
|
if (jsonOutput) {
|
|
83310
|
-
const active2 = (0,
|
|
83880
|
+
const active2 = (0, import_sidekick_shared33.getActiveCodexAccount)();
|
|
83311
83881
|
process.stdout.write(JSON.stringify({
|
|
83312
83882
|
provider: "codex",
|
|
83313
83883
|
accounts: accounts.map((account) => ({
|
|
@@ -83317,7 +83887,7 @@ function codexAccountAction(opts, jsonOutput) {
|
|
|
83317
83887
|
}, null, 2) + "\n");
|
|
83318
83888
|
return;
|
|
83319
83889
|
}
|
|
83320
|
-
const active = (0,
|
|
83890
|
+
const active = (0, import_sidekick_shared33.getActiveCodexAccount)();
|
|
83321
83891
|
process.stdout.write(source_default.bold("Codex Accounts\n"));
|
|
83322
83892
|
process.stdout.write(source_default.dim("\u2500".repeat(50) + "\n"));
|
|
83323
83893
|
for (const account of accounts) {
|
|
@@ -83328,12 +83898,12 @@ function codexAccountAction(opts, jsonOutput) {
|
|
|
83328
83898
|
`);
|
|
83329
83899
|
}
|
|
83330
83900
|
}
|
|
83331
|
-
var
|
|
83901
|
+
var import_sidekick_shared33;
|
|
83332
83902
|
var init_account = __esm({
|
|
83333
83903
|
"src/commands/account.ts"() {
|
|
83334
83904
|
"use strict";
|
|
83335
83905
|
init_source();
|
|
83336
|
-
|
|
83906
|
+
import_sidekick_shared33 = __toESM(require_dist(), 1);
|
|
83337
83907
|
init_cli();
|
|
83338
83908
|
}
|
|
83339
83909
|
});
|
|
@@ -83348,12 +83918,12 @@ async function handoffAction(_opts, cmd) {
|
|
|
83348
83918
|
const workspacePath = globalOpts.project || process.cwd();
|
|
83349
83919
|
const jsonOutput = !!globalOpts.json;
|
|
83350
83920
|
try {
|
|
83351
|
-
const rawSlug = (0,
|
|
83352
|
-
const resolvedSlug = (0,
|
|
83921
|
+
const rawSlug = (0, import_sidekick_shared34.getProjectSlugRaw)(workspacePath);
|
|
83922
|
+
const resolvedSlug = (0, import_sidekick_shared34.getProjectSlug)(workspacePath);
|
|
83353
83923
|
const slugs = rawSlug !== resolvedSlug ? [rawSlug, resolvedSlug] : [rawSlug];
|
|
83354
83924
|
let content = null;
|
|
83355
83925
|
for (const slug of slugs) {
|
|
83356
|
-
content = await (0,
|
|
83926
|
+
content = await (0, import_sidekick_shared34.readLatestHandoff)(slug);
|
|
83357
83927
|
if (content) break;
|
|
83358
83928
|
}
|
|
83359
83929
|
if (!content) {
|
|
@@ -83378,12 +83948,12 @@ async function handoffAction(_opts, cmd) {
|
|
|
83378
83948
|
process.exit(1);
|
|
83379
83949
|
}
|
|
83380
83950
|
}
|
|
83381
|
-
var
|
|
83951
|
+
var import_sidekick_shared34;
|
|
83382
83952
|
var init_handoff = __esm({
|
|
83383
83953
|
"src/commands/handoff.ts"() {
|
|
83384
83954
|
"use strict";
|
|
83385
83955
|
init_source();
|
|
83386
|
-
|
|
83956
|
+
import_sidekick_shared34 = __toESM(require_dist(), 1);
|
|
83387
83957
|
}
|
|
83388
83958
|
});
|
|
83389
83959
|
|
|
@@ -83397,35 +83967,35 @@ function resolveProviderId(opts, defaultProvider = "auto") {
|
|
|
83397
83967
|
if (defaultProvider !== "auto") {
|
|
83398
83968
|
return defaultProvider;
|
|
83399
83969
|
}
|
|
83400
|
-
return (0,
|
|
83970
|
+
return (0, import_sidekick_shared35.detectProvider)();
|
|
83401
83971
|
}
|
|
83402
83972
|
function resolveProvider(opts) {
|
|
83403
83973
|
const id = resolveProviderId(opts);
|
|
83404
83974
|
switch (id) {
|
|
83405
83975
|
case "opencode":
|
|
83406
|
-
return new
|
|
83976
|
+
return new import_sidekick_shared36.OpenCodeProvider();
|
|
83407
83977
|
case "codex":
|
|
83408
|
-
return new
|
|
83978
|
+
return new import_sidekick_shared36.CodexProvider();
|
|
83409
83979
|
case "claude-code":
|
|
83410
83980
|
default:
|
|
83411
|
-
return new
|
|
83981
|
+
return new import_sidekick_shared36.ClaudeCodeProvider();
|
|
83412
83982
|
}
|
|
83413
83983
|
}
|
|
83414
|
-
var
|
|
83984
|
+
var import_sidekick_shared35, import_node, import_sidekick_shared36, defaultAccountsReady, program2, dashCmd, dumpCmd, ctxCmd, reportCmd, searchCmd, tasksCmd, decisionsCmd, notesCmd, statsCmd, quotaCmd, statusCmd, peakCmd, accountCmd, handoffCmd;
|
|
83415
83985
|
var init_cli = __esm({
|
|
83416
83986
|
"src/cli.ts"() {
|
|
83417
83987
|
init_esm();
|
|
83418
|
-
import_sidekick_shared34 = __toESM(require_dist(), 1);
|
|
83419
|
-
import_node = __toESM(require_node(), 1);
|
|
83420
83988
|
import_sidekick_shared35 = __toESM(require_dist(), 1);
|
|
83989
|
+
import_node = __toESM(require_node(), 1);
|
|
83990
|
+
import_sidekick_shared36 = __toESM(require_dist(), 1);
|
|
83421
83991
|
(0, import_node.hydratePricingCatalog)({
|
|
83422
83992
|
cacheDir: path7.join(os5.homedir(), ".config", "sidekick")
|
|
83423
83993
|
}).catch(() => {
|
|
83424
83994
|
});
|
|
83425
|
-
defaultAccountsReady = (0,
|
|
83995
|
+
defaultAccountsReady = (0, import_sidekick_shared35.ensureDefaultAccounts)().catch(() => {
|
|
83426
83996
|
});
|
|
83427
83997
|
program2 = new Command();
|
|
83428
|
-
program2.name("sidekick").description("Query Sidekick project intelligence from the command line").version("0.18.
|
|
83998
|
+
program2.name("sidekick").description("Query Sidekick project intelligence from the command line").version("0.18.3").option("--json", "Output as JSON").option("--project <path>", "Override project path (default: cwd)").option("--provider <id>", "Provider: claude-code, opencode, codex, auto (default: auto)");
|
|
83429
83999
|
program2.hook("preAction", async () => {
|
|
83430
84000
|
await defaultAccountsReady;
|
|
83431
84001
|
});
|
|
@@ -83479,6 +84049,10 @@ var init_cli = __esm({
|
|
|
83479
84049
|
const { quotaAction: quotaAction2 } = await Promise.resolve().then(() => (init_quota(), quota_exports));
|
|
83480
84050
|
return quotaAction2(_opts, cmd);
|
|
83481
84051
|
});
|
|
84052
|
+
quotaCmd.command("history").description("Render a 13-week heatmap of quota utilization for the current workspace").option("--weeks <n>", "Weeks of history to render (default: 13, clamped 1-26)", "13").option("--provider <id>", "Limit to a single runtime provider: claude or codex (default: both)").option("--workspace <path>", "Workspace path used to derive the history scope (default: cwd)").action(async (_opts, cmd) => {
|
|
84053
|
+
const { quotaHistoryAction: quotaHistoryAction2 } = await Promise.resolve().then(() => (init_quotaHistory(), quotaHistory_exports));
|
|
84054
|
+
return quotaHistoryAction2(_opts, cmd);
|
|
84055
|
+
});
|
|
83482
84056
|
program2.addCommand(quotaCmd);
|
|
83483
84057
|
statusCmd = new Command("status").description("Show API status (Claude and OpenAI)").action(async (_opts, cmd) => {
|
|
83484
84058
|
const { statusAction: statusAction2 } = await Promise.resolve().then(() => (init_status(), status_exports));
|