@usebitl/cli 0.1.11 → 0.1.12
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/adapters/dist/core.mjs +1 -1
- package/dist/chunks/{chunk-V6S7JUFW.mjs → chunk-ERXNJMQT.mjs} +4 -2
- package/dist/chunks/{src-AT3GZJZ6.mjs → src-4IUSQVOL.mjs} +5 -4
- package/dist/cli.mjs +4 -4
- package/package.json +1 -1
- package/web/assets/{index-BqtWjy33.js → index-DTnW4H6T.js} +1 -1
- package/web/index.html +1 -1
- package/web/sw.js +1 -1
package/adapters/dist/core.mjs
CHANGED
|
@@ -124,6 +124,7 @@ async function keysFromBase64Url(master) {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
// ../../shared/src/session.ts
|
|
127
|
+
var isEmptySession = (s) => s.turnCount === 0 && s.toolCount === 0;
|
|
127
128
|
var sessionKey = (source, sessionId) => `${source}:${sessionId}`;
|
|
128
129
|
var TITLE_LABELS = { locked: "\u{1F512} Can't be opened with this device's key", untitled: "(untitled)" };
|
|
129
130
|
var displayTitle = (s, labels = TITLE_LABELS) => s.aiTitle ?? s.title ?? s.project ?? (s.locked ? labels.locked : labels.untitled);
|
|
@@ -20060,7 +20061,7 @@ function removeCloudLogin(home = bitlHome()) {
|
|
|
20060
20061
|
rmSync(cloudKeyPath(home), { force: true });
|
|
20061
20062
|
}
|
|
20062
20063
|
function clientVersionHeader() {
|
|
20063
|
-
const v = "0.1.
|
|
20064
|
+
const v = "0.1.12";
|
|
20064
20065
|
return v ? { "x-bitl-client": v } : {};
|
|
20065
20066
|
}
|
|
20066
20067
|
function resolveTarget(home = bitlHome()) {
|
|
@@ -20117,7 +20118,7 @@ async function latestVersion(home, now) {
|
|
|
20117
20118
|
return latest;
|
|
20118
20119
|
}
|
|
20119
20120
|
var updateCommand = (install = process.env.BITL_INSTALL) => install === "npx" ? "npx @usebitl/cli@latest start" : "npm i -g @usebitl/cli";
|
|
20120
|
-
async function checkCliUpdate(current = "0.1.
|
|
20121
|
+
async function checkCliUpdate(current = "0.1.12", opts = {}) {
|
|
20121
20122
|
if (!current || process.env.BITL_NO_UPDATE_CHECK === "1") return void 0;
|
|
20122
20123
|
const latest = await latestVersion(opts.home ?? bitlHome(), opts.now ?? Date.now());
|
|
20123
20124
|
if (!latest || compareVersions(latest, current) <= 0) return void 0;
|
|
@@ -20150,6 +20151,7 @@ export {
|
|
|
20150
20151
|
verifyPublicKey,
|
|
20151
20152
|
wrapMasterKey,
|
|
20152
20153
|
unwrapMasterKey,
|
|
20154
|
+
isEmptySession,
|
|
20153
20155
|
sessionKey,
|
|
20154
20156
|
displayTitle,
|
|
20155
20157
|
openSession,
|
|
@@ -8,9 +8,10 @@ import {
|
|
|
8
8
|
__require,
|
|
9
9
|
__toESM,
|
|
10
10
|
checkCliUpdate,
|
|
11
|
+
isEmptySession,
|
|
11
12
|
parseWireRecord,
|
|
12
13
|
sessionKey
|
|
13
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ERXNJMQT.mjs";
|
|
14
15
|
|
|
15
16
|
// ../../../node_modules/.pnpm/bn.js@4.12.5/node_modules/bn.js/lib/bn.js
|
|
16
17
|
var require_bn = __commonJS({
|
|
@@ -12293,8 +12294,8 @@ function mountPush(app, push) {
|
|
|
12293
12294
|
}
|
|
12294
12295
|
|
|
12295
12296
|
// ../../server/src/push.ts
|
|
12296
|
-
var import_web_push = __toESM(require_src2(), 1);
|
|
12297
12297
|
import { createHash } from "node:crypto";
|
|
12298
|
+
var import_web_push = __toESM(require_src2(), 1);
|
|
12298
12299
|
function buildApprovalPayload(a) {
|
|
12299
12300
|
const payload = { v: 1, kind: "approval", id: a.id, key: a.sessionKey, expiresAt: a.expiresAt, request: a.request };
|
|
12300
12301
|
const json2 = JSON.stringify(payload);
|
|
@@ -12355,13 +12356,13 @@ function startPushNotifier(opts) {
|
|
|
12355
12356
|
};
|
|
12356
12357
|
const notify = async (accountId, s) => {
|
|
12357
12358
|
if (!(await push.list(accountId)).length) return;
|
|
12358
|
-
const attention = (await store.listSessions(accountId)).filter((x) => ALERT.has(x.status)).length;
|
|
12359
|
+
const attention = (await store.listSessions(accountId)).filter((x) => ALERT.has(x.status) && !isEmptySession(x)).length;
|
|
12359
12360
|
await sendAll(accountId, buildPayload(s, attention), topicOf(s.key));
|
|
12360
12361
|
};
|
|
12361
12362
|
const off = store.subscribe((change) => {
|
|
12362
12363
|
if (change.type !== "session") return;
|
|
12363
12364
|
const s = change.session;
|
|
12364
|
-
if (!ALERT.has(s.status) || change.prevStatus === s.status) return;
|
|
12365
|
+
if (!ALERT.has(s.status) || change.prevStatus === s.status || isEmptySession(s)) return;
|
|
12365
12366
|
const id = `${change.accountId}
|
|
12366
12367
|
${s.key}`;
|
|
12367
12368
|
const t = Date.now();
|
package/dist/cli.mjs
CHANGED
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
unwrapMasterKey,
|
|
22
22
|
verifyPublicKey,
|
|
23
23
|
wrapMasterKey
|
|
24
|
-
} from "./chunks/chunk-
|
|
24
|
+
} from "./chunks/chunk-ERXNJMQT.mjs";
|
|
25
25
|
|
|
26
26
|
// ../src/index.ts
|
|
27
27
|
import { homedir as homedir2 } from "node:os";
|
|
@@ -453,7 +453,7 @@ async function logout() {
|
|
|
453
453
|
}
|
|
454
454
|
|
|
455
455
|
// ../src/update.ts
|
|
456
|
-
async function updateNotice(current = "0.1.
|
|
456
|
+
async function updateNotice(current = "0.1.12") {
|
|
457
457
|
const u = await checkCliUpdate(current);
|
|
458
458
|
return u && `${t("update.available", { ...u })}
|
|
459
459
|
${t("update.changelog")}`;
|
|
@@ -609,7 +609,7 @@ async function main(argv) {
|
|
|
609
609
|
if (String(typeof warning === "string" ? warning : warning.message).startsWith("SQLite is an experimental feature")) return;
|
|
610
610
|
emitWarning(warning, ...rest2);
|
|
611
611
|
});
|
|
612
|
-
const { startServer } = await import("./chunks/src-
|
|
612
|
+
const { startServer } = await import("./chunks/src-4IUSQVOL.mjs");
|
|
613
613
|
await startServer();
|
|
614
614
|
console.log(t("start.pair", { url: localPairUrl() }));
|
|
615
615
|
return;
|
|
@@ -631,7 +631,7 @@ async function main(argv) {
|
|
|
631
631
|
case "--version":
|
|
632
632
|
case "-v":
|
|
633
633
|
case "version":
|
|
634
|
-
console.log("0.1.
|
|
634
|
+
console.log("0.1.12");
|
|
635
635
|
return;
|
|
636
636
|
case "remote":
|
|
637
637
|
case "away":
|
package/package.json
CHANGED