blun-king-cli 9.1.27 → 9.1.29
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 +1 -1
- package/blun.mjs +138 -13
- package/package.json +7 -3
package/README.md
CHANGED
package/blun.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// BLUN_BUILD_INPUT_SHA256:
|
|
2
|
+
// BLUN_BUILD_INPUT_SHA256:caecfec8b26d5cc33673c8d6dc45eaa60e9ff8906987070715b558edb6425867
|
|
3
3
|
import { fileURLToPath as __cjsShimFileURLToPath } from 'node:url';
|
|
4
4
|
import { dirname as __cjsShimDirname } from 'node:path';
|
|
5
5
|
const __filename = __cjsShimFileURLToPath(import.meta.url);
|
|
@@ -338783,6 +338783,49 @@ function registerAcpCommand(parent) {
|
|
|
338783
338783
|
}
|
|
338784
338784
|
});
|
|
338785
338785
|
}
|
|
338786
|
+
const APPEARANCE_PRESETS = [
|
|
338787
|
+
{
|
|
338788
|
+
id: "dark",
|
|
338789
|
+
appearance: {
|
|
338790
|
+
foreground: "#F4F4F5",
|
|
338791
|
+
surface: "#171717"
|
|
338792
|
+
}
|
|
338793
|
+
},
|
|
338794
|
+
{
|
|
338795
|
+
id: "black",
|
|
338796
|
+
appearance: {
|
|
338797
|
+
foreground: "#F5F5F5",
|
|
338798
|
+
surface: "#000000"
|
|
338799
|
+
}
|
|
338800
|
+
},
|
|
338801
|
+
{
|
|
338802
|
+
id: "light",
|
|
338803
|
+
appearance: {
|
|
338804
|
+
foreground: "#171717",
|
|
338805
|
+
surface: "#FFFFFF"
|
|
338806
|
+
}
|
|
338807
|
+
},
|
|
338808
|
+
{
|
|
338809
|
+
id: "blue",
|
|
338810
|
+
appearance: {
|
|
338811
|
+
foreground: "#EAF2FF",
|
|
338812
|
+
surface: "#071827"
|
|
338813
|
+
}
|
|
338814
|
+
},
|
|
338815
|
+
{
|
|
338816
|
+
id: "green",
|
|
338817
|
+
appearance: {
|
|
338818
|
+
foreground: "#D8FFE6",
|
|
338819
|
+
surface: "#071A12"
|
|
338820
|
+
}
|
|
338821
|
+
}
|
|
338822
|
+
];
|
|
338823
|
+
function appearancePresetId(appearance) {
|
|
338824
|
+
if (appearance === void 0) return "default";
|
|
338825
|
+
const foreground = appearance.foreground?.toUpperCase();
|
|
338826
|
+
const surface = appearance.surface?.toUpperCase();
|
|
338827
|
+
return APPEARANCE_PRESETS.find((candidate) => candidate.appearance.foreground === foreground && candidate.appearance.surface === surface)?.id ?? "custom";
|
|
338828
|
+
}
|
|
338786
338829
|
const APPEARANCE_TEXT_TOKENS = [
|
|
338787
338830
|
"text",
|
|
338788
338831
|
"textStrong",
|
|
@@ -398718,13 +398761,13 @@ async function ensureSafeDirectory(path, create, recursive) {
|
|
|
398718
398761
|
}
|
|
398719
398762
|
function validateRegistry(value, context) {
|
|
398720
398763
|
if (!isRecord$8(value) || value["version"] !== 1) throw new WorkspaceError("registry_invalid", "Unsupported workspace registry version.");
|
|
398721
|
-
if (!hasExactKeys
|
|
398764
|
+
if (!hasExactKeys(value, REGISTRY_KEYS)) throw new WorkspaceError("registry_invalid", "Workspace registry contains unknown fields.");
|
|
398722
398765
|
if (value["repoFingerprint"] !== context.repoFingerprint || value["primaryRoot"] !== context.primaryRoot || !isRecord$8(value["workspaces"])) throw new WorkspaceError("registry_invalid", "Workspace registry does not match this repository.");
|
|
398723
398766
|
for (const [name, record] of Object.entries(value["workspaces"])) if (!isWorkspaceRecord(record) || record.name !== name) throw new WorkspaceError("registry_invalid", "Workspace registry contains an invalid entry.");
|
|
398724
398767
|
return value;
|
|
398725
398768
|
}
|
|
398726
398769
|
function isWorkspaceRecord(value) {
|
|
398727
|
-
if (!isRecord$8(value) || !hasExactKeys
|
|
398770
|
+
if (!isRecord$8(value) || !hasExactKeys(value, WORKSPACE_RECORD_KEYS)) return false;
|
|
398728
398771
|
return typeof value["name"] === "string" && typeof value["path"] === "string" && typeof value["branch"] === "string" && typeof value["baseCommit"] === "string" && typeof value["repoFingerprint"] === "string" && isCanonicalIsoTimestamp(value["createdAt"]);
|
|
398729
398772
|
}
|
|
398730
398773
|
function isCanonicalIsoTimestamp(value) {
|
|
@@ -398736,7 +398779,7 @@ function isRecord$8(value) {
|
|
|
398736
398779
|
const prototype = Object.getPrototypeOf(value);
|
|
398737
398780
|
return prototype === Object.prototype || prototype === null;
|
|
398738
398781
|
}
|
|
398739
|
-
function hasExactKeys
|
|
398782
|
+
function hasExactKeys(value, keys) {
|
|
398740
398783
|
return Object.keys(value).length === keys.length && keys.every((key) => Object.hasOwn(value, key));
|
|
398741
398784
|
}
|
|
398742
398785
|
async function writeRegistryAtomic(repoStorageRoot, registry) {
|
|
@@ -398822,7 +398865,7 @@ async function readRegistryLockMetadata(lockPath) {
|
|
|
398822
398865
|
if (error.code !== void 0) throw error;
|
|
398823
398866
|
return;
|
|
398824
398867
|
}
|
|
398825
|
-
if (!isRecord$8(value) || !hasExactKeys
|
|
398868
|
+
if (!isRecord$8(value) || !hasExactKeys(value, [
|
|
398826
398869
|
"version",
|
|
398827
398870
|
"pid",
|
|
398828
398871
|
"createdAt",
|
|
@@ -412310,6 +412353,56 @@ var EditorSelectorComponent = class extends ChoicePickerComponent {
|
|
|
412310
412353
|
};
|
|
412311
412354
|
//#endregion
|
|
412312
412355
|
//#region src/tui/components/dialogs/appearance-selector.ts
|
|
412356
|
+
var AppearancePresetSelectorComponent = class extends ChoicePickerComponent {
|
|
412357
|
+
constructor(options) {
|
|
412358
|
+
const labels = {
|
|
412359
|
+
dark: options.copy.darkLabel,
|
|
412360
|
+
black: options.copy.blackLabel,
|
|
412361
|
+
light: options.copy.lightLabel,
|
|
412362
|
+
blue: options.copy.blueLabel,
|
|
412363
|
+
green: options.copy.greenLabel
|
|
412364
|
+
};
|
|
412365
|
+
const choices = [
|
|
412366
|
+
{
|
|
412367
|
+
value: "default",
|
|
412368
|
+
label: options.copy.defaultLabel
|
|
412369
|
+
},
|
|
412370
|
+
...APPEARANCE_PRESETS.map((preset) => ({
|
|
412371
|
+
value: preset.id,
|
|
412372
|
+
label: `${chalk.bgHex(preset.appearance.surface).hex(preset.appearance.foreground)(" Aa ")} ${labels[preset.id]}`,
|
|
412373
|
+
description: `${options.copy.foreground} ${preset.appearance.foreground} · ${options.copy.surface} ${preset.appearance.surface}`
|
|
412374
|
+
})),
|
|
412375
|
+
{
|
|
412376
|
+
value: "custom",
|
|
412377
|
+
label: options.copy.customLabel
|
|
412378
|
+
}
|
|
412379
|
+
];
|
|
412380
|
+
super({
|
|
412381
|
+
title: options.copy.title,
|
|
412382
|
+
options: choices,
|
|
412383
|
+
currentValue: appearancePresetId(options.initialValue),
|
|
412384
|
+
onSelect: (value) => {
|
|
412385
|
+
if (value === "custom") {
|
|
412386
|
+
options.onSelect({ kind: "custom" });
|
|
412387
|
+
return;
|
|
412388
|
+
}
|
|
412389
|
+
if (value === "default") {
|
|
412390
|
+
options.onSelect({
|
|
412391
|
+
kind: "preset",
|
|
412392
|
+
value: void 0
|
|
412393
|
+
});
|
|
412394
|
+
return;
|
|
412395
|
+
}
|
|
412396
|
+
const preset = APPEARANCE_PRESETS.find((candidate) => candidate.id === value);
|
|
412397
|
+
if (preset !== void 0) options.onSelect({
|
|
412398
|
+
kind: "preset",
|
|
412399
|
+
value: { ...preset.appearance }
|
|
412400
|
+
});
|
|
412401
|
+
},
|
|
412402
|
+
onCancel: options.onCancel
|
|
412403
|
+
});
|
|
412404
|
+
}
|
|
412405
|
+
};
|
|
412313
412406
|
var AppearanceSelectorComponent = class extends Container {
|
|
412314
412407
|
options;
|
|
412315
412408
|
focused = false;
|
|
@@ -417164,6 +417257,22 @@ function showThemePicker(host) {
|
|
|
417164
417257
|
}
|
|
417165
417258
|
function showAppearancePicker(host) {
|
|
417166
417259
|
const original = host.state.appState.appearance;
|
|
417260
|
+
host.mountEditorReplacement(new AppearancePresetSelectorComponent({
|
|
417261
|
+
copy: appearancePresetSelectorCopy(),
|
|
417262
|
+
initialValue: original,
|
|
417263
|
+
onSelect: (result) => {
|
|
417264
|
+
if (result.kind === "custom") {
|
|
417265
|
+
showCustomAppearancePicker(host, original);
|
|
417266
|
+
return;
|
|
417267
|
+
}
|
|
417268
|
+
host.restoreEditorAfter(() => saveAppearanceChoice(host, result.value));
|
|
417269
|
+
},
|
|
417270
|
+
onCancel: () => {
|
|
417271
|
+
host.restoreEditor();
|
|
417272
|
+
}
|
|
417273
|
+
}));
|
|
417274
|
+
}
|
|
417275
|
+
function showCustomAppearancePicker(host, original) {
|
|
417167
417276
|
host.mountEditorReplacement(new AppearanceSelectorComponent({
|
|
417168
417277
|
getBasePalette: () => host.getAppearanceBasePalette(),
|
|
417169
417278
|
copy: appearanceSelectorCopy(),
|
|
@@ -417180,6 +417289,20 @@ function showAppearancePicker(host) {
|
|
|
417180
417289
|
}
|
|
417181
417290
|
}));
|
|
417182
417291
|
}
|
|
417292
|
+
function appearancePresetSelectorCopy() {
|
|
417293
|
+
return {
|
|
417294
|
+
title: uiText("appearance.title"),
|
|
417295
|
+
defaultLabel: uiText("actionStyle.default.label"),
|
|
417296
|
+
darkLabel: `BLUN ${uiText("theme.dark")}`,
|
|
417297
|
+
blackLabel: "BLUN Black",
|
|
417298
|
+
lightLabel: `BLUN ${uiText("theme.light")}`,
|
|
417299
|
+
blueLabel: "BLUN Blue",
|
|
417300
|
+
greenLabel: "BLUN Green",
|
|
417301
|
+
customLabel: uiText("appearance.title"),
|
|
417302
|
+
foreground: uiText("appearance.foreground"),
|
|
417303
|
+
surface: uiText("appearance.surface")
|
|
417304
|
+
};
|
|
417305
|
+
}
|
|
417183
417306
|
function appearanceSelectorCopy() {
|
|
417184
417307
|
return {
|
|
417185
417308
|
title: uiText("appearance.title"),
|
|
@@ -492708,7 +492831,7 @@ var CustomerMistakeClientState = class {
|
|
|
492708
492831
|
this.preparationController = void 0;
|
|
492709
492832
|
}
|
|
492710
492833
|
};
|
|
492711
|
-
const MISTAKE_CONSENT_PATH = "/
|
|
492834
|
+
const MISTAKE_CONSENT_PATH = "/api/me/preferences";
|
|
492712
492835
|
var CustomerMistakeBrokerError = class extends Error {
|
|
492713
492836
|
code;
|
|
492714
492837
|
status;
|
|
@@ -492720,9 +492843,15 @@ var CustomerMistakeBrokerError = class extends Error {
|
|
|
492720
492843
|
}
|
|
492721
492844
|
};
|
|
492722
492845
|
function parseMistakeConsent(payload) {
|
|
492723
|
-
if (!isRecord$4(payload)
|
|
492724
|
-
const
|
|
492725
|
-
|
|
492846
|
+
if (!isRecord$4(payload)) return void 0;
|
|
492847
|
+
const settings = (isRecord$4(payload["data"]) ? payload["data"] : payload)["settings"];
|
|
492848
|
+
const dataControls = isRecord$4(settings) ? settings["data_controls"] : void 0;
|
|
492849
|
+
if (!isRecord$4(dataControls)) return void 0;
|
|
492850
|
+
const asked = dataControls["mistake_consent_asked"];
|
|
492851
|
+
const allowed = dataControls["allow_mistake"];
|
|
492852
|
+
if (typeof asked !== "boolean" || typeof allowed !== "boolean") return void 0;
|
|
492853
|
+
if (!asked) return { status: "never_asked" };
|
|
492854
|
+
return { status: allowed ? "share_sanitized" : "disabled" };
|
|
492726
492855
|
}
|
|
492727
492856
|
var CustomerMistakeBrokerClient = class {
|
|
492728
492857
|
options;
|
|
@@ -492831,10 +492960,6 @@ function normalizeBaseUrl(value) {
|
|
|
492831
492960
|
if (url.protocol !== "https:" || url.username.length > 0 || url.password.length > 0 || url.search.length > 0 || url.hash.length > 0 || url.pathname !== "/" && url.pathname !== "") throw new CustomerMistakeBrokerError("INVALID_PAYLOAD");
|
|
492832
492961
|
return url.origin;
|
|
492833
492962
|
}
|
|
492834
|
-
function hasExactKeys(value, expected) {
|
|
492835
|
-
const keys = Object.keys(value);
|
|
492836
|
-
return keys.length === expected.length && expected.every((key) => keys.includes(key));
|
|
492837
|
-
}
|
|
492838
492963
|
function isRecord$4(value) {
|
|
492839
492964
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
492840
492965
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blun-king-cli",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.29",
|
|
4
4
|
"description": "BLUN CLI - your own AI agent with a Telegram channel. Get it done. With BLUN.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"x64",
|
|
23
23
|
"arm64"
|
|
24
24
|
],
|
|
25
|
-
"dependencies": {},
|
|
26
25
|
"optionalDependencies": {
|
|
27
26
|
"@mariozechner/clipboard": "^0.3.9",
|
|
28
27
|
"node-pty": "^1.1.0"
|
|
@@ -45,5 +44,10 @@
|
|
|
45
44
|
"cli",
|
|
46
45
|
"assistant"
|
|
47
46
|
],
|
|
48
|
-
"author": "BLUN"
|
|
47
|
+
"author": "BLUN",
|
|
48
|
+
"main": "index.js",
|
|
49
|
+
"directories": {
|
|
50
|
+
"test": "test"
|
|
51
|
+
},
|
|
52
|
+
"type": "commonjs"
|
|
49
53
|
}
|