bazilion 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +282 -56
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +451 -65
- package/dist/daemon.js.map +1 -1
- package/dist/worker.js +18 -18
- package/dist/worker.js.map +1 -1
- package/package.json +3 -3
package/dist/worker.js
CHANGED
|
@@ -76,6 +76,12 @@ import { existsSync as existsSync5, rmSync as rmSync2 } from "fs";
|
|
|
76
76
|
import { writeFileSync as writeFileSync3 } from "fs";
|
|
77
77
|
import { join as join7 } from "path";
|
|
78
78
|
|
|
79
|
+
// ../daemon/src/core/profile-group/spawn.ts
|
|
80
|
+
import { readdirSync as readdirSync3, rmSync as rmSync4 } from "fs";
|
|
81
|
+
|
|
82
|
+
// ../daemon/src/core/profile-group/rm-with-retry.ts
|
|
83
|
+
import { rmSync as rmSync3 } from "fs";
|
|
84
|
+
|
|
79
85
|
// ../daemon/src/core/services.ts
|
|
80
86
|
var SERVICES = [
|
|
81
87
|
// --- LLM providers (configured via API keys / URLs) ---
|
|
@@ -446,7 +452,7 @@ import { createHash, randomBytes as randomBytes2, randomUUID as randomUUID4 } fr
|
|
|
446
452
|
import { existsSync as existsSync6, readFileSync as readFileSync4 } from "fs";
|
|
447
453
|
|
|
448
454
|
// ../daemon/src/core/skills/import.ts
|
|
449
|
-
import { cpSync, existsSync as existsSync7, mkdtempSync, readdirSync as
|
|
455
|
+
import { cpSync, existsSync as existsSync7, mkdtempSync, readdirSync as readdirSync4, rmSync as rmSync5, statSync as statSync2 } from "fs";
|
|
450
456
|
import { tmpdir } from "os";
|
|
451
457
|
import { basename, join as join8, resolve as resolve2, sep } from "path";
|
|
452
458
|
import AdmZip from "adm-zip";
|
|
@@ -459,9 +465,9 @@ import { parse as parseYaml } from "yaml";
|
|
|
459
465
|
import {
|
|
460
466
|
existsSync as existsSync8,
|
|
461
467
|
mkdirSync as mkdirSync4,
|
|
462
|
-
readdirSync as
|
|
468
|
+
readdirSync as readdirSync5,
|
|
463
469
|
readFileSync as readFileSync6,
|
|
464
|
-
rmSync as
|
|
470
|
+
rmSync as rmSync6,
|
|
465
471
|
statSync as statSync3,
|
|
466
472
|
writeFileSync as writeFileSync4
|
|
467
473
|
} from "fs";
|
|
@@ -494,7 +500,7 @@ function safeKey(root, key) {
|
|
|
494
500
|
}
|
|
495
501
|
function walkMd(dir, prefix, out) {
|
|
496
502
|
if (!existsSync8(dir)) return;
|
|
497
|
-
for (const e of
|
|
503
|
+
for (const e of readdirSync5(dir, { withFileTypes: true })) {
|
|
498
504
|
if (e.name.startsWith(".")) continue;
|
|
499
505
|
const full = join9(dir, e.name);
|
|
500
506
|
const key = prefix ? `${prefix}/${e.name}` : e.name;
|
|
@@ -569,7 +575,7 @@ function qmdBackend(root) {
|
|
|
569
575
|
},
|
|
570
576
|
async remove(key) {
|
|
571
577
|
const path = safeKey(root, key);
|
|
572
|
-
if (existsSync8(path))
|
|
578
|
+
if (existsSync8(path)) rmSync6(path);
|
|
573
579
|
const store = await getStore(root);
|
|
574
580
|
await store.update();
|
|
575
581
|
}
|
|
@@ -695,7 +701,7 @@ function piMessagesToProviderView(messages) {
|
|
|
695
701
|
}
|
|
696
702
|
|
|
697
703
|
// ../daemon/src/runtime/pi/session.ts
|
|
698
|
-
import { existsSync as existsSync11, mkdirSync as mkdirSync5, readdirSync as
|
|
704
|
+
import { existsSync as existsSync11, mkdirSync as mkdirSync5, readdirSync as readdirSync7, statSync as statSync5 } from "fs";
|
|
699
705
|
import { basename as basename2, join as join13 } from "path";
|
|
700
706
|
import {
|
|
701
707
|
AuthStorage,
|
|
@@ -856,7 +862,7 @@ This group's USER.md is empty. As you learn STABLE facts about the human (prefer
|
|
|
856
862
|
import { Type as Type2 } from "typebox";
|
|
857
863
|
|
|
858
864
|
// ../daemon/src/runtime/tools/bootstrap.ts
|
|
859
|
-
import { existsSync as existsSync10, rmSync as
|
|
865
|
+
import { existsSync as existsSync10, rmSync as rmSync7 } from "fs";
|
|
860
866
|
import { join as join11 } from "path";
|
|
861
867
|
function bootstrapTool(agentDir) {
|
|
862
868
|
return {
|
|
@@ -868,7 +874,7 @@ function bootstrapTool(agentDir) {
|
|
|
868
874
|
async invoke() {
|
|
869
875
|
const path = join11(agentDir, "BOOTSTRAP.md");
|
|
870
876
|
if (existsSync10(path)) {
|
|
871
|
-
|
|
877
|
+
rmSync7(path);
|
|
872
878
|
return "BOOTSTRAP.md removed. Bootstrap is complete.";
|
|
873
879
|
}
|
|
874
880
|
return "BOOTSTRAP.md was already removed.";
|
|
@@ -877,7 +883,7 @@ function bootstrapTool(agentDir) {
|
|
|
877
883
|
}
|
|
878
884
|
|
|
879
885
|
// ../daemon/src/runtime/tools/home.ts
|
|
880
|
-
import { readdirSync as
|
|
886
|
+
import { readdirSync as readdirSync6, readFileSync as readFileSync8, statSync as statSync4, writeFileSync as writeFileSync5 } from "fs";
|
|
881
887
|
import { join as join12 } from "path";
|
|
882
888
|
var HOME_FILES_READABLE = [
|
|
883
889
|
"IDENTITY.md",
|
|
@@ -969,7 +975,7 @@ function homeTools(agentDir) {
|
|
|
969
975
|
if (entries.length === 0) {
|
|
970
976
|
const dirEntries = (() => {
|
|
971
977
|
try {
|
|
972
|
-
return
|
|
978
|
+
return readdirSync6(agentDir);
|
|
973
979
|
} catch {
|
|
974
980
|
return [];
|
|
975
981
|
}
|
|
@@ -1754,13 +1760,7 @@ function webTools(opts) {
|
|
|
1754
1760
|
extracted = { text: body };
|
|
1755
1761
|
}
|
|
1756
1762
|
if (isHtml && !firecrawlDisabled && extracted.text.length < FIRECRAWL_FALLBACK_THRESHOLD) {
|
|
1757
|
-
const rescued = await firecrawlScrape(
|
|
1758
|
-
result.finalUrl,
|
|
1759
|
-
mode,
|
|
1760
|
-
env,
|
|
1761
|
-
fetchFn,
|
|
1762
|
-
timeoutMs
|
|
1763
|
-
);
|
|
1763
|
+
const rescued = await firecrawlScrape(result.finalUrl, mode, env, fetchFn, timeoutMs);
|
|
1764
1764
|
if (rescued) {
|
|
1765
1765
|
extracted = {
|
|
1766
1766
|
...rescued,
|
|
@@ -2019,7 +2019,7 @@ function createBazilionResourceLoader(appendSystemPrompt) {
|
|
|
2019
2019
|
function findMostRecent(sessionDir) {
|
|
2020
2020
|
if (!existsSync11(sessionDir)) return null;
|
|
2021
2021
|
let newest = null;
|
|
2022
|
-
for (const entry of
|
|
2022
|
+
for (const entry of readdirSync7(sessionDir)) {
|
|
2023
2023
|
if (!entry.endsWith(".jsonl")) continue;
|
|
2024
2024
|
const path = join13(sessionDir, entry);
|
|
2025
2025
|
try {
|