qodewk 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +255 -69
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -14352,6 +14352,28 @@ function harvestTrailerFootprints(repoPath, commitMessage, headSha, commitDate)
|
|
|
14352
14352
|
}
|
|
14353
14353
|
return footprints;
|
|
14354
14354
|
}
|
|
14355
|
+
function discoverAntigravityEnvironment() {
|
|
14356
|
+
const isAgent = process.env.ANTIGRAVITY_AGENT === "1" || Boolean(process.env.ANTIGRAVITY_CONVERSATION_ID);
|
|
14357
|
+
const homedir12 = os2.homedir();
|
|
14358
|
+
const antigravityDir = process.env.ANTIGRAVITY_APP_DATA_DIR || path2.join(homedir12, ".gemini", "antigravity");
|
|
14359
|
+
if (isAgent) {
|
|
14360
|
+
return {
|
|
14361
|
+
provider: "antigravity",
|
|
14362
|
+
model: "claude-sonnet-4-6-thinking",
|
|
14363
|
+
confidence: 0.85,
|
|
14364
|
+
mode: "observed"
|
|
14365
|
+
};
|
|
14366
|
+
}
|
|
14367
|
+
if (fs.existsSync(antigravityDir)) {
|
|
14368
|
+
return {
|
|
14369
|
+
provider: "antigravity",
|
|
14370
|
+
model: "claude-sonnet-4-6-thinking",
|
|
14371
|
+
confidence: 0.65,
|
|
14372
|
+
mode: "estimated"
|
|
14373
|
+
};
|
|
14374
|
+
}
|
|
14375
|
+
return null;
|
|
14376
|
+
}
|
|
14355
14377
|
|
|
14356
14378
|
// ../core/dist/harvester/antigravity.js
|
|
14357
14379
|
var fs2 = __toESM(require("fs"), 1);
|
|
@@ -14396,7 +14418,8 @@ function scoreFootprint(fp, gitCtx) {
|
|
|
14396
14418
|
if (found)
|
|
14397
14419
|
matches++;
|
|
14398
14420
|
}
|
|
14399
|
-
const
|
|
14421
|
+
const maxPossibleMatches = Math.min(normChanged.length, normEdited.length);
|
|
14422
|
+
const ratio = maxPossibleMatches > 0 ? matches / maxPossibleMatches : 0;
|
|
14400
14423
|
if (matches > 0) {
|
|
14401
14424
|
score += ratio * 0.4;
|
|
14402
14425
|
} else {
|
|
@@ -15777,7 +15800,8 @@ function parseSinceOption2(since) {
|
|
|
15777
15800
|
return void 0;
|
|
15778
15801
|
}
|
|
15779
15802
|
async function harvestUniversalFootprints(options) {
|
|
15780
|
-
const
|
|
15803
|
+
const parsedSince = parseSinceOption2(options.since);
|
|
15804
|
+
const sinceDate = parsedSince ? new Date(parsedSince.getTime() - 24 * 60 * 60 * 1e3) : void 0;
|
|
15781
15805
|
const alias = options.projectAlias || "";
|
|
15782
15806
|
let allFootprints = [];
|
|
15783
15807
|
if (!options.platform || options.platform === "all" || options.platform === "antigravity") {
|
|
@@ -16335,7 +16359,7 @@ async function runDiagnostics(options = {}) {
|
|
|
16335
16359
|
}
|
|
16336
16360
|
return {
|
|
16337
16361
|
overallStatus,
|
|
16338
|
-
version: "0.10.
|
|
16362
|
+
version: "0.10.1",
|
|
16339
16363
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
16340
16364
|
repoPath,
|
|
16341
16365
|
agents,
|
|
@@ -17184,6 +17208,44 @@ var RECEIPT_HORIZON_ITEMS = [
|
|
|
17184
17208
|
description: "Return to previous screen"
|
|
17185
17209
|
}
|
|
17186
17210
|
];
|
|
17211
|
+
var SHARE_HORIZON_ITEMS = [
|
|
17212
|
+
{
|
|
17213
|
+
id: "latest",
|
|
17214
|
+
key: "1",
|
|
17215
|
+
label: "Latest Changes (Default)",
|
|
17216
|
+
description: "Publish git working tree or latest commit to cloud"
|
|
17217
|
+
},
|
|
17218
|
+
{
|
|
17219
|
+
id: "today",
|
|
17220
|
+
key: "2",
|
|
17221
|
+
label: "Today's Work Session",
|
|
17222
|
+
description: "Publish commits & agent activity since midnight (--today)"
|
|
17223
|
+
},
|
|
17224
|
+
{
|
|
17225
|
+
id: "yesterday",
|
|
17226
|
+
key: "3",
|
|
17227
|
+
label: "Yesterday's Work",
|
|
17228
|
+
description: "Publish activity from yesterday to now (--since yesterday)"
|
|
17229
|
+
},
|
|
17230
|
+
{
|
|
17231
|
+
id: "week",
|
|
17232
|
+
key: "4",
|
|
17233
|
+
label: "Past 7 Days (Sprint)",
|
|
17234
|
+
description: "Publish weekly sprint telemetry across all agents (--since 7d)"
|
|
17235
|
+
},
|
|
17236
|
+
{
|
|
17237
|
+
id: "custom",
|
|
17238
|
+
key: "5",
|
|
17239
|
+
label: "Custom Duration",
|
|
17240
|
+
description: "Specify hours (e.g. 12h) or days (e.g. 3d, 14d) to publish"
|
|
17241
|
+
},
|
|
17242
|
+
{
|
|
17243
|
+
id: "back",
|
|
17244
|
+
key: "0",
|
|
17245
|
+
label: "Back to Main Menu",
|
|
17246
|
+
description: "Return to previous screen"
|
|
17247
|
+
}
|
|
17248
|
+
];
|
|
17187
17249
|
function buildMenuFrame(selectedIndex, items = MENU_ITEMS, title = "Telemetry Control Panel", subtitle = "\u2191\u2193 move \xB7 enter select \xB7 0-7 quick jump \xB7 q quit", options = {}) {
|
|
17188
17250
|
const lines = [];
|
|
17189
17251
|
const push = (line) => lines.push(line);
|
|
@@ -17196,7 +17258,7 @@ function buildMenuFrame(selectedIndex, items = MENU_ITEMS, title = "Telemetry Co
|
|
|
17196
17258
|
}
|
|
17197
17259
|
push("");
|
|
17198
17260
|
const badge = bg.teal(import_picocolors3.default.bold(colors.ink(" qodewk ")));
|
|
17199
|
-
push(` ${colors.mutedSoft("\u250C")} ${badge} ${import_picocolors3.default.dim("v0.10.
|
|
17261
|
+
push(` ${colors.mutedSoft("\u250C")} ${badge} ${import_picocolors3.default.dim("v0.10.1")}`);
|
|
17200
17262
|
push(` ${colors.mutedSoft("\u2502")}`);
|
|
17201
17263
|
if (options.actionContext) {
|
|
17202
17264
|
push(` ${colors.teal("\u25C7")} ${import_picocolors3.default.dim("Action:")} ${import_picocolors3.default.white(options.actionContext)}`);
|
|
@@ -17206,7 +17268,17 @@ function buildMenuFrame(selectedIndex, items = MENU_ITEMS, title = "Telemetry Co
|
|
|
17206
17268
|
const branch = options.repoContext?.branch ? `(${options.repoContext.branch})` : "";
|
|
17207
17269
|
push(` ${colors.teal("\u25C7")} ${import_picocolors3.default.dim("Repository:")} ${import_picocolors3.default.white(repo)} ${import_picocolors3.default.dim(branch)}`);
|
|
17208
17270
|
push(` ${colors.mutedSoft("\u2502")}`);
|
|
17209
|
-
|
|
17271
|
+
let telemetryLabel = "Multi-Model Rate Cards (Active)";
|
|
17272
|
+
try {
|
|
17273
|
+
const agEnv = discoverAntigravityEnvironment();
|
|
17274
|
+
if (agEnv && agEnv.mode === "observed") {
|
|
17275
|
+
telemetryLabel = "Google Antigravity (Active)";
|
|
17276
|
+
} else if (agEnv) {
|
|
17277
|
+
telemetryLabel = "Google Antigravity Detected";
|
|
17278
|
+
}
|
|
17279
|
+
} catch {
|
|
17280
|
+
}
|
|
17281
|
+
push(` ${colors.teal("\u25C7")} ${import_picocolors3.default.dim("Telemetry:")} ${import_picocolors3.default.white(telemetryLabel)}`);
|
|
17210
17282
|
push(` ${colors.mutedSoft("\u2502")}`);
|
|
17211
17283
|
}
|
|
17212
17284
|
push(` ${colors.coral("\u25C6")} ${import_picocolors3.default.bold(import_picocolors3.default.white(title))}`);
|
|
@@ -17268,6 +17340,85 @@ function waitForKeyToReturn() {
|
|
|
17268
17340
|
process.stdin.once("data", onKey);
|
|
17269
17341
|
});
|
|
17270
17342
|
}
|
|
17343
|
+
function waitForKeyOrAction(promptText) {
|
|
17344
|
+
return new Promise((resolve6) => {
|
|
17345
|
+
console.log(promptText);
|
|
17346
|
+
if (!process.stdin.isTTY) {
|
|
17347
|
+
resolve6("");
|
|
17348
|
+
return;
|
|
17349
|
+
}
|
|
17350
|
+
const wasRaw = process.stdin.isRaw;
|
|
17351
|
+
process.stdin.setRawMode(true);
|
|
17352
|
+
process.stdin.resume();
|
|
17353
|
+
const onKey = (data) => {
|
|
17354
|
+
process.stdin.removeListener("data", onKey);
|
|
17355
|
+
if (wasRaw !== void 0) process.stdin.setRawMode(wasRaw);
|
|
17356
|
+
const str = data.toString();
|
|
17357
|
+
resolve6(str);
|
|
17358
|
+
};
|
|
17359
|
+
process.stdin.once("data", onKey);
|
|
17360
|
+
});
|
|
17361
|
+
}
|
|
17362
|
+
async function publishReceiptToCloud(receipt) {
|
|
17363
|
+
if (process.env.QODEWK_TELEMETRY === "off") {
|
|
17364
|
+
console.log(import_picocolors3.default.yellow("\n Cloud publishing is disabled by QODEWK_TELEMETRY=off."));
|
|
17365
|
+
return null;
|
|
17366
|
+
}
|
|
17367
|
+
const sanitized = sanitizeReceiptForShare(receipt);
|
|
17368
|
+
let body = JSON.stringify(sanitized);
|
|
17369
|
+
if (Buffer.byteLength(body, "utf-8") > SHARE_PAYLOAD_MAX_BYTES && sanitized.ai.sessions) {
|
|
17370
|
+
const trimmed2 = {
|
|
17371
|
+
...sanitized,
|
|
17372
|
+
ai: { ...sanitized.ai, sessions: void 0 }
|
|
17373
|
+
};
|
|
17374
|
+
body = JSON.stringify(trimmed2);
|
|
17375
|
+
}
|
|
17376
|
+
if (Buffer.byteLength(body, "utf-8") > SHARE_PAYLOAD_MAX_BYTES) {
|
|
17377
|
+
console.error(import_picocolors3.default.red(" Sanitized receipt still exceeds the 50 KB cloud payload limit."));
|
|
17378
|
+
return null;
|
|
17379
|
+
}
|
|
17380
|
+
const endpoint = resolveApiUrl();
|
|
17381
|
+
console.log(import_picocolors3.default.dim(`
|
|
17382
|
+
[\xB7] Publishing receipt to ${endpoint}...`));
|
|
17383
|
+
try {
|
|
17384
|
+
const response = await fetch(endpoint, {
|
|
17385
|
+
method: "POST",
|
|
17386
|
+
headers: {
|
|
17387
|
+
"Content-Type": "application/json",
|
|
17388
|
+
"Content-Length": String(Buffer.byteLength(body, "utf-8"))
|
|
17389
|
+
},
|
|
17390
|
+
body
|
|
17391
|
+
});
|
|
17392
|
+
if (!response.ok) {
|
|
17393
|
+
const errText = await response.text().catch(() => "");
|
|
17394
|
+
if (response.status === 503) {
|
|
17395
|
+
console.log(import_picocolors3.default.yellow("\n Notice: Remote server requires durable storage (Supabase or PostgreSQL) in production"));
|
|
17396
|
+
console.log(import_picocolors3.default.dim(" to protect receipts from serverless cold-start data loss."));
|
|
17397
|
+
console.log(import_picocolors3.default.dim(` Endpoint: ${endpoint}`));
|
|
17398
|
+
console.log(colors.green("\n [\u2713] Your receipt is safely saved locally in: ~/.qodewk/state.db"));
|
|
17399
|
+
console.log(import_picocolors3.default.dim(" You can also save it as a local Git note: qodewk --notes\n"));
|
|
17400
|
+
return null;
|
|
17401
|
+
}
|
|
17402
|
+
throw new Error(`API responded with ${response.status}: ${errText.slice(0, 100)}`);
|
|
17403
|
+
}
|
|
17404
|
+
const data = await response.json();
|
|
17405
|
+
const db = new LocalStateDB();
|
|
17406
|
+
db.saveReceipt(sanitized, data.claimToken);
|
|
17407
|
+
db.close();
|
|
17408
|
+
console.log("");
|
|
17409
|
+
console.log(colors.green(" [\u2713] Published successfully."));
|
|
17410
|
+
console.log(` ${import_picocolors3.default.dim("Public URL:")} ${import_picocolors3.default.underline(import_picocolors3.default.cyan(data.url))}`);
|
|
17411
|
+
console.log(` ${import_picocolors3.default.bold(colors.amber("Claim token:"))} ${colors.amber(data.claimToken)}`);
|
|
17412
|
+
console.log(import_picocolors3.default.dim(" (Saved to ~/.qodewk/state.db for future authorship proofs)\n"));
|
|
17413
|
+
await renderTerminalReceipt(sanitized, data.url);
|
|
17414
|
+
return data;
|
|
17415
|
+
} catch (err) {
|
|
17416
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
17417
|
+
console.error(import_picocolors3.default.red(`
|
|
17418
|
+
Share failed: ${message}`));
|
|
17419
|
+
return null;
|
|
17420
|
+
}
|
|
17421
|
+
}
|
|
17271
17422
|
var cachedRepoContext = null;
|
|
17272
17423
|
async function getRepoContext() {
|
|
17273
17424
|
if (cachedRepoContext) return cachedRepoContext;
|
|
@@ -17300,12 +17451,16 @@ async function runInteractiveMenu() {
|
|
|
17300
17451
|
let selectedIndex = 0;
|
|
17301
17452
|
let active = true;
|
|
17302
17453
|
let lastRenderedLinesCount = 0;
|
|
17303
|
-
const getActiveItems = () =>
|
|
17454
|
+
const getActiveItems = () => {
|
|
17455
|
+
if (currentScreen === "receipt_horizon") return RECEIPT_HORIZON_ITEMS;
|
|
17456
|
+
if (currentScreen === "share_horizon") return SHARE_HORIZON_ITEMS;
|
|
17457
|
+
return MENU_ITEMS;
|
|
17458
|
+
};
|
|
17304
17459
|
const render = () => {
|
|
17305
17460
|
const items = getActiveItems();
|
|
17306
|
-
const title = currentScreen === "main" ? "Telemetry Control Panel" : "Generate Local Receipt";
|
|
17461
|
+
const title = currentScreen === "main" ? "Telemetry Control Panel" : currentScreen === "receipt_horizon" ? "Generate Local Receipt" : "Publish Receipt to Cloud";
|
|
17307
17462
|
const subtitle = currentScreen === "main" ? "\u2191\u2193 move \xB7 enter select \xB7 0-7 quick jump \xB7 q quit" : "\u2191\u2193 move \xB7 enter select \xB7 0-5 quick jump \xB7 esc / 0 back";
|
|
17308
|
-
const actionContext = currentScreen === "receipt_horizon" ? "Generate Local Receipt" : void 0;
|
|
17463
|
+
const actionContext = currentScreen === "receipt_horizon" ? "Generate Local Receipt" : currentScreen === "share_horizon" ? "Publish Receipt to Cloud" : void 0;
|
|
17309
17464
|
const showBanner = currentScreen === "main";
|
|
17310
17465
|
const frame = buildMenuFrame(selectedIndex, items, title, subtitle, {
|
|
17311
17466
|
repoContext,
|
|
@@ -17360,10 +17515,55 @@ async function runInteractiveMenu() {
|
|
|
17360
17515
|
db.saveReceipt(receipt);
|
|
17361
17516
|
db.close();
|
|
17362
17517
|
await renderTerminalReceipt(receipt);
|
|
17518
|
+
console.log("");
|
|
17519
|
+
const actionKey = await waitForKeyOrAction(
|
|
17520
|
+
` ${colors.coral("[s]")} ${import_picocolors3.default.white("Publish this receipt to cloud")} \xB7 ${import_picocolors3.default.dim("[any other key] Return to menu")}`
|
|
17521
|
+
);
|
|
17522
|
+
if (actionKey.trim().toLowerCase() === "s") {
|
|
17523
|
+
await publishReceiptToCloud(receipt);
|
|
17524
|
+
await waitForKeyToReturn();
|
|
17525
|
+
}
|
|
17363
17526
|
} catch (err) {
|
|
17364
17527
|
const message = err instanceof Error ? err.message : String(err);
|
|
17365
17528
|
console.error(import_picocolors3.default.red(`
|
|
17366
17529
|
Failed to generate receipt: ${message}`));
|
|
17530
|
+
await waitForKeyToReturn();
|
|
17531
|
+
}
|
|
17532
|
+
currentScreen = "main";
|
|
17533
|
+
selectedIndex = 0;
|
|
17534
|
+
};
|
|
17535
|
+
const executeShareHorizon = async (item) => {
|
|
17536
|
+
cleanup();
|
|
17537
|
+
console.log("");
|
|
17538
|
+
lastRenderedLinesCount = 0;
|
|
17539
|
+
let since = void 0;
|
|
17540
|
+
let label = "latest git diff";
|
|
17541
|
+
if (item.id === "today") {
|
|
17542
|
+
since = "today";
|
|
17543
|
+
label = "today's work session (--today)";
|
|
17544
|
+
} else if (item.id === "yesterday") {
|
|
17545
|
+
since = "yesterday";
|
|
17546
|
+
label = "yesterday's work (--since yesterday)";
|
|
17547
|
+
} else if (item.id === "week") {
|
|
17548
|
+
since = "7d";
|
|
17549
|
+
label = "past 7 days weekly sprint (--since 7d)";
|
|
17550
|
+
} else if (item.id === "custom") {
|
|
17551
|
+
console.log(import_picocolors3.default.bold(import_picocolors3.default.white(" Custom Telemetry Horizon for Cloud Publish")));
|
|
17552
|
+
console.log(import_picocolors3.default.dim(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
17553
|
+
const input = await askLine(" \u203A Enter duration or date (e.g. 12h, 3d, 2026-10-01): ");
|
|
17554
|
+
if (input) {
|
|
17555
|
+
since = input;
|
|
17556
|
+
label = `custom range: ${input}`;
|
|
17557
|
+
}
|
|
17558
|
+
}
|
|
17559
|
+
console.log(import_picocolors3.default.dim(` [\xB7] Generating and publishing receipt for ${label}...`));
|
|
17560
|
+
try {
|
|
17561
|
+
const receipt = await generateReceipt({ since, isPublic: false });
|
|
17562
|
+
await publishReceiptToCloud(receipt);
|
|
17563
|
+
} catch (err) {
|
|
17564
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
17565
|
+
console.error(import_picocolors3.default.red(`
|
|
17566
|
+
Share failed: ${message}`));
|
|
17367
17567
|
}
|
|
17368
17568
|
await waitForKeyToReturn();
|
|
17369
17569
|
currentScreen = "main";
|
|
@@ -17409,64 +17609,8 @@ async function runInteractiveMenu() {
|
|
|
17409
17609
|
break;
|
|
17410
17610
|
}
|
|
17411
17611
|
case "share": {
|
|
17412
|
-
|
|
17413
|
-
|
|
17414
|
-
const receipt = await generateReceipt({ isPublic: false });
|
|
17415
|
-
if (process.env.QODEWK_TELEMETRY === "off") {
|
|
17416
|
-
console.log(import_picocolors3.default.yellow("\n Cloud publishing is disabled by QODEWK_TELEMETRY=off."));
|
|
17417
|
-
await renderTerminalReceipt(receipt);
|
|
17418
|
-
await waitForKeyToReturn();
|
|
17419
|
-
break;
|
|
17420
|
-
}
|
|
17421
|
-
const sanitized = sanitizeReceiptForShare(receipt);
|
|
17422
|
-
let body = JSON.stringify(sanitized);
|
|
17423
|
-
if (Buffer.byteLength(body, "utf-8") > SHARE_PAYLOAD_MAX_BYTES && sanitized.ai.sessions) {
|
|
17424
|
-
const trimmed2 = {
|
|
17425
|
-
...sanitized,
|
|
17426
|
-
ai: { ...sanitized.ai, sessions: void 0 }
|
|
17427
|
-
};
|
|
17428
|
-
body = JSON.stringify(trimmed2);
|
|
17429
|
-
}
|
|
17430
|
-
const endpoint = resolveApiUrl();
|
|
17431
|
-
console.log(import_picocolors3.default.dim(` [\xB7] Uploading metadata to ${endpoint}...`));
|
|
17432
|
-
const response = await fetch(endpoint, {
|
|
17433
|
-
method: "POST",
|
|
17434
|
-
headers: {
|
|
17435
|
-
"Content-Type": "application/json",
|
|
17436
|
-
"Content-Length": String(Buffer.byteLength(body, "utf-8"))
|
|
17437
|
-
},
|
|
17438
|
-
body
|
|
17439
|
-
});
|
|
17440
|
-
if (!response.ok) {
|
|
17441
|
-
const errText = await response.text().catch(() => "");
|
|
17442
|
-
if (response.status === 503) {
|
|
17443
|
-
console.log(import_picocolors3.default.yellow("\n Notice: Remote server requires durable storage (Supabase or PostgreSQL) in production"));
|
|
17444
|
-
console.log(import_picocolors3.default.dim(" to protect receipts from serverless cold-start data loss."));
|
|
17445
|
-
console.log(import_picocolors3.default.dim(` Endpoint: ${endpoint}`));
|
|
17446
|
-
console.log(colors.green("\n [\u2713] Your receipt is safely saved locally in: ~/.qodewk/state.db"));
|
|
17447
|
-
console.log(import_picocolors3.default.dim(" You can also save it as a local Git note: qodewk --notes\n"));
|
|
17448
|
-
await renderTerminalReceipt(sanitized);
|
|
17449
|
-
await waitForKeyToReturn();
|
|
17450
|
-
break;
|
|
17451
|
-
}
|
|
17452
|
-
throw new Error(`API responded with ${response.status}${errText ? `: ${errText.slice(0, 100)}` : ""}`);
|
|
17453
|
-
}
|
|
17454
|
-
const data = await response.json();
|
|
17455
|
-
const db = new LocalStateDB();
|
|
17456
|
-
db.saveReceipt(sanitized, data.claimToken);
|
|
17457
|
-
db.close();
|
|
17458
|
-
console.log("");
|
|
17459
|
-
console.log(colors.green(" [\u2713] Published successfully."));
|
|
17460
|
-
console.log(` ${import_picocolors3.default.dim("Public URL:")} ${import_picocolors3.default.underline(import_picocolors3.default.cyan(data.url))}`);
|
|
17461
|
-
console.log(` ${import_picocolors3.default.bold(colors.amber("Claim token:"))} ${colors.amber(data.claimToken)}`);
|
|
17462
|
-
console.log(import_picocolors3.default.dim(" (Saved to ~/.qodewk/state.db for future authorship proofs)\n"));
|
|
17463
|
-
await renderTerminalReceipt(sanitized, data.url);
|
|
17464
|
-
} catch (err) {
|
|
17465
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
17466
|
-
console.error(import_picocolors3.default.red(`
|
|
17467
|
-
Share failed: ${message}`));
|
|
17468
|
-
}
|
|
17469
|
-
await waitForKeyToReturn();
|
|
17612
|
+
currentScreen = "share_horizon";
|
|
17613
|
+
selectedIndex = 0;
|
|
17470
17614
|
break;
|
|
17471
17615
|
}
|
|
17472
17616
|
case "hooks": {
|
|
@@ -17629,6 +17773,20 @@ async function runInteractiveMenu() {
|
|
|
17629
17773
|
}
|
|
17630
17774
|
console.log("");
|
|
17631
17775
|
console.log(` ${colors.green("[\u2713]")} ${import_picocolors3.default.dim("Privacy guarantee: raw source code is never stored in SQLite")}`);
|
|
17776
|
+
if (recent.length > 0) {
|
|
17777
|
+
console.log("");
|
|
17778
|
+
const ans = await askLine(" \u203A Enter receipt ID prefix to publish to cloud [Enter to return]: ");
|
|
17779
|
+
if (ans) {
|
|
17780
|
+
const matched = recent.find((r2) => r2.receipt.receipt.id.toLowerCase().startsWith(ans.toLowerCase()));
|
|
17781
|
+
if (matched) {
|
|
17782
|
+
await publishReceiptToCloud(matched.receipt);
|
|
17783
|
+
await waitForKeyToReturn();
|
|
17784
|
+
return;
|
|
17785
|
+
} else {
|
|
17786
|
+
console.log(import_picocolors3.default.yellow(` No stored receipt matching '${ans}' found.`));
|
|
17787
|
+
}
|
|
17788
|
+
}
|
|
17789
|
+
}
|
|
17632
17790
|
} catch (err) {
|
|
17633
17791
|
const message = err instanceof Error ? err.message : String(err);
|
|
17634
17792
|
console.error(import_picocolors3.default.red(` Failed to inspect storage: ${message}`));
|
|
@@ -17695,8 +17853,14 @@ async function runInteractiveMenu() {
|
|
|
17695
17853
|
if (active) startLoop();
|
|
17696
17854
|
return;
|
|
17697
17855
|
}
|
|
17856
|
+
if (selected.id === "share") {
|
|
17857
|
+
currentScreen = "share_horizon";
|
|
17858
|
+
selectedIndex = 0;
|
|
17859
|
+
if (active) startLoop();
|
|
17860
|
+
return;
|
|
17861
|
+
}
|
|
17698
17862
|
await executeSelectedAction();
|
|
17699
|
-
} else {
|
|
17863
|
+
} else if (currentScreen === "receipt_horizon") {
|
|
17700
17864
|
if (selected.id === "back") {
|
|
17701
17865
|
currentScreen = "main";
|
|
17702
17866
|
selectedIndex = 0;
|
|
@@ -17704,6 +17868,14 @@ async function runInteractiveMenu() {
|
|
|
17704
17868
|
return;
|
|
17705
17869
|
}
|
|
17706
17870
|
await executeReceiptHorizon(selected);
|
|
17871
|
+
} else if (currentScreen === "share_horizon") {
|
|
17872
|
+
if (selected.id === "back") {
|
|
17873
|
+
currentScreen = "main";
|
|
17874
|
+
selectedIndex = 0;
|
|
17875
|
+
if (active) startLoop();
|
|
17876
|
+
return;
|
|
17877
|
+
}
|
|
17878
|
+
await executeShareHorizon(selected);
|
|
17707
17879
|
}
|
|
17708
17880
|
if (active) {
|
|
17709
17881
|
startLoop();
|
|
@@ -17720,8 +17892,14 @@ async function runInteractiveMenu() {
|
|
|
17720
17892
|
if (active) startLoop();
|
|
17721
17893
|
return;
|
|
17722
17894
|
}
|
|
17895
|
+
if (selected.id === "share") {
|
|
17896
|
+
currentScreen = "share_horizon";
|
|
17897
|
+
selectedIndex = 0;
|
|
17898
|
+
if (active) startLoop();
|
|
17899
|
+
return;
|
|
17900
|
+
}
|
|
17723
17901
|
await executeSelectedAction();
|
|
17724
|
-
} else {
|
|
17902
|
+
} else if (currentScreen === "receipt_horizon") {
|
|
17725
17903
|
if (selected.id === "back") {
|
|
17726
17904
|
currentScreen = "main";
|
|
17727
17905
|
selectedIndex = 0;
|
|
@@ -17729,6 +17907,14 @@ async function runInteractiveMenu() {
|
|
|
17729
17907
|
return;
|
|
17730
17908
|
}
|
|
17731
17909
|
await executeReceiptHorizon(selected);
|
|
17910
|
+
} else if (currentScreen === "share_horizon") {
|
|
17911
|
+
if (selected.id === "back") {
|
|
17912
|
+
currentScreen = "main";
|
|
17913
|
+
selectedIndex = 0;
|
|
17914
|
+
if (active) startLoop();
|
|
17915
|
+
return;
|
|
17916
|
+
}
|
|
17917
|
+
await executeShareHorizon(selected);
|
|
17732
17918
|
}
|
|
17733
17919
|
if (active) {
|
|
17734
17920
|
startLoop();
|
|
@@ -17758,7 +17944,7 @@ function resolveCliVersion() {
|
|
|
17758
17944
|
}
|
|
17759
17945
|
} catch {
|
|
17760
17946
|
}
|
|
17761
|
-
return "0.10.
|
|
17947
|
+
return "0.10.1";
|
|
17762
17948
|
}
|
|
17763
17949
|
function resolveSince(options) {
|
|
17764
17950
|
return options.today ? "today" : options.since;
|