@sulala/agent-os 0.1.4 → 0.1.6
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 -0
- package/data/agents/briefing_agent.json +12 -0
- package/data/agents/dev_agent.json +10 -0
- package/data/agents/manager_agent.json +11 -0
- package/data/agents/media_agent.json +10 -0
- package/data/agents/personal_agent.json +11 -0
- package/data/agents/research_agent.json +10 -0
- package/data/agents/social_media_agent.json +10 -0
- package/data/agents/writer_agent.json +10 -0
- package/data/skills/bluesky/SKILL.md +63 -0
- package/data/skills/bluesky/config.schema.json +17 -0
- package/data/skills/bluesky/scripts/post.sh +48 -0
- package/data/skills/bluesky/scripts/timeline.sh +37 -0
- package/data/skills/date/SKILL.md +53 -0
- package/data/skills/fetch/SKILL.md +42 -0
- package/data/skills/file-search/SKILL.md +122 -0
- package/data/skills/file-stats/SKILL.md +68 -0
- package/data/skills/git/SKILL.md +60 -0
- package/data/skills/gmail/SKILL.md +55 -0
- package/data/skills/gmail/references/send-email.md +54 -0
- package/data/skills/gmail/scripts/send_email.py +94 -0
- package/data/skills/hash/SKILL.md +56 -0
- package/data/skills/jq/SKILL.md +66 -0
- package/data/skills/markdown-to-html/SKILL.md +47 -0
- package/data/skills/memory/SKILL.md +64 -0
- package/data/skills/qr-code/SKILL.md +65 -0
- package/data/skills/rss/SKILL.md +40 -0
- package/data/skills/sulala-portal/SKILL.md +92 -0
- package/data/skills/translate/SKILL.md +52 -0
- package/data/skills/weather/SKILL.md +59 -0
- package/data/skills/web-search/SKILL.md +55 -0
- package/data/skills/web-search/config.schema.json +12 -0
- package/data/skills/web-search/scripts/search.sh +21 -0
- package/data/skills/webhook/SKILL.md +101 -0
- package/data/skills/webhook/config.schema.json +11 -0
- package/data/skills/webhook/scripts/post.sh +13 -0
- package/data/skills/youtube/SKILL.md +91 -0
- package/data/skills/youtube/config.schema.json +11 -0
- package/data/skills/youtube/package.json +8 -0
- package/data/skills/youtube/references/youtube-upload.md +65 -0
- package/data/skills/youtube/requirements.txt +3 -0
- package/data/skills/youtube/scripts/youtube_upload.js +200 -0
- package/data/skills/youtube/scripts/youtube_upload.py +125 -0
- package/data/templates/BOOT.md +11 -0
- package/data/templates/BOOTSTRAP.md +62 -0
- package/data/templates/HEARTBEAT.md +12 -0
- package/data/templates/IDENTITY.dev.md +62 -0
- package/data/templates/IDENTITY.md +60 -0
- package/data/templates/SYSTEM.dev.md +82 -0
- package/data/templates/SYSTEM.md +65 -0
- package/data/templates/TOOLS.dev.md +24 -0
- package/data/templates/TOOLS.md +47 -0
- package/data/templates/USER.dev.md +18 -0
- package/data/templates/USER.md +23 -0
- package/dist/cli.js +22 -13
- package/dist/index.js +14 -5
- package/package.json +3 -2
package/dist/cli.js
CHANGED
|
@@ -559,6 +559,7 @@ var init_agent = __esm(() => {
|
|
|
559
559
|
|
|
560
560
|
// src/core/agent-registry.ts
|
|
561
561
|
import { readdir, readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2, unlink } from "fs/promises";
|
|
562
|
+
import { existsSync } from "fs";
|
|
562
563
|
import { join as join2 } from "path";
|
|
563
564
|
function setAgentStore(store) {
|
|
564
565
|
agentStore = store;
|
|
@@ -567,7 +568,15 @@ function getAgentsDir() {
|
|
|
567
568
|
return process.env.AGENT_OS_AGENTS_DIR || DEFAULT_AGENTS_DIR;
|
|
568
569
|
}
|
|
569
570
|
function getSeedAgentsDir() {
|
|
570
|
-
|
|
571
|
+
if (process.env.AGENT_OS_SEED_AGENTS_DIR)
|
|
572
|
+
return process.env.AGENT_OS_SEED_AGENTS_DIR;
|
|
573
|
+
const fromDist = join2(import.meta.dir, "..", "data", "agents");
|
|
574
|
+
const fromSrc = join2(import.meta.dir, "..", "..", "data", "agents");
|
|
575
|
+
if (existsSync(fromDist))
|
|
576
|
+
return fromDist;
|
|
577
|
+
if (existsSync(fromSrc))
|
|
578
|
+
return fromSrc;
|
|
579
|
+
return join2(process.cwd(), "data", "agents");
|
|
571
580
|
}
|
|
572
581
|
async function insertSeedAgentFromFile(seedDir, name, skipIfExists) {
|
|
573
582
|
if (!agentStore)
|
|
@@ -15562,7 +15571,7 @@ __export(exports_server, {
|
|
|
15562
15571
|
startServer: () => startServer
|
|
15563
15572
|
});
|
|
15564
15573
|
import { join as join13, dirname, resolve as resolve4 } from "path";
|
|
15565
|
-
import { mkdirSync, existsSync } from "fs";
|
|
15574
|
+
import { mkdirSync, existsSync as existsSync2 } from "fs";
|
|
15566
15575
|
function broadcastEvent(event) {
|
|
15567
15576
|
const msg = JSON.stringify(event);
|
|
15568
15577
|
for (const ws of wsClients) {
|
|
@@ -15572,7 +15581,7 @@ function broadcastEvent(event) {
|
|
|
15572
15581
|
}
|
|
15573
15582
|
}
|
|
15574
15583
|
function serveDashboard(pathname) {
|
|
15575
|
-
if (!
|
|
15584
|
+
if (!existsSync2(DASHBOARD_DIST) || !existsSync2(join13(DASHBOARD_DIST, "index.html"))) {
|
|
15576
15585
|
return null;
|
|
15577
15586
|
}
|
|
15578
15587
|
const decoded = decodeURIComponent(pathname);
|
|
@@ -15581,7 +15590,7 @@ function serveDashboard(pathname) {
|
|
|
15581
15590
|
}
|
|
15582
15591
|
const subpath = decoded === "/" ? "index.html" : decoded.slice(1);
|
|
15583
15592
|
const filePath = join13(DASHBOARD_DIST, subpath);
|
|
15584
|
-
if (
|
|
15593
|
+
if (existsSync2(filePath)) {
|
|
15585
15594
|
const file = Bun.file(filePath);
|
|
15586
15595
|
const ext = subpath.split(".").pop() ?? "";
|
|
15587
15596
|
const mime = {
|
|
@@ -15602,7 +15611,7 @@ function serveDashboard(pathname) {
|
|
|
15602
15611
|
});
|
|
15603
15612
|
}
|
|
15604
15613
|
const indexPath = join13(DASHBOARD_DIST, "index.html");
|
|
15605
|
-
if (
|
|
15614
|
+
if (existsSync2(indexPath)) {
|
|
15606
15615
|
return new Response(Bun.file(indexPath), {
|
|
15607
15616
|
headers: { "Content-Type": "text/html" }
|
|
15608
15617
|
});
|
|
@@ -16064,7 +16073,7 @@ init_agent_registry();
|
|
|
16064
16073
|
init_runtime();
|
|
16065
16074
|
import { join as join14, dirname as dirname2 } from "path";
|
|
16066
16075
|
import { readFile as readFile10, writeFile as writeFile6, mkdir as mkdir7, unlink as unlink2 } from "fs/promises";
|
|
16067
|
-
import { existsSync as
|
|
16076
|
+
import { existsSync as existsSync3, readFileSync } from "fs";
|
|
16068
16077
|
var PID_FILE = join14(getAgentOsHome(), "sulala.pid");
|
|
16069
16078
|
var DEFAULT_PORT = 3010;
|
|
16070
16079
|
function openDashboard() {
|
|
@@ -16124,7 +16133,7 @@ async function cmdStart(args) {
|
|
|
16124
16133
|
await mkdir7(getAgentOsHome(), { recursive: true });
|
|
16125
16134
|
const projectRoot = join14(import.meta.dir, "..");
|
|
16126
16135
|
const distEntry = join14(projectRoot, "dist", "index.js");
|
|
16127
|
-
const serverEntry =
|
|
16136
|
+
const serverEntry = existsSync3(distEntry) ? "dist/index.js" : "src/index.ts";
|
|
16128
16137
|
const child = Bun.spawn(["bun", "run", serverEntry], {
|
|
16129
16138
|
cwd: projectRoot,
|
|
16130
16139
|
stdout: "ignore",
|
|
@@ -16141,7 +16150,7 @@ async function cmdStart(args) {
|
|
|
16141
16150
|
await startServer2();
|
|
16142
16151
|
}
|
|
16143
16152
|
async function cmdStop() {
|
|
16144
|
-
if (!
|
|
16153
|
+
if (!existsSync3(PID_FILE)) {
|
|
16145
16154
|
console.error("No PID file found. Is the server running with 'sulala start --daemon'?");
|
|
16146
16155
|
process.exit(1);
|
|
16147
16156
|
}
|
|
@@ -16169,7 +16178,7 @@ function getMemoryDbPath() {
|
|
|
16169
16178
|
return process.env.AGENT_MEMORY_DB_PATH ?? join14(getAgentOsHome(), "database.db");
|
|
16170
16179
|
}
|
|
16171
16180
|
async function startServerDaemonIfNeeded() {
|
|
16172
|
-
if (
|
|
16181
|
+
if (existsSync3(PID_FILE)) {
|
|
16173
16182
|
try {
|
|
16174
16183
|
const pidStr = await readFile10(PID_FILE, "utf-8");
|
|
16175
16184
|
const pid = parseInt(pidStr.trim(), 10);
|
|
@@ -16182,7 +16191,7 @@ async function startServerDaemonIfNeeded() {
|
|
|
16182
16191
|
await mkdir7(getAgentOsHome(), { recursive: true });
|
|
16183
16192
|
const projectRoot = join14(import.meta.dir, "..");
|
|
16184
16193
|
const distEntry = join14(projectRoot, "dist", "index.js");
|
|
16185
|
-
const serverEntry =
|
|
16194
|
+
const serverEntry = existsSync3(distEntry) ? "dist/index.js" : "src/index.ts";
|
|
16186
16195
|
const child = Bun.spawn(["bun", "run", serverEntry], {
|
|
16187
16196
|
cwd: projectRoot,
|
|
16188
16197
|
stdout: "ignore",
|
|
@@ -16199,7 +16208,7 @@ async function cmdOnboard() {
|
|
|
16199
16208
|
await mkdir7(home, { recursive: true });
|
|
16200
16209
|
await mkdir7(dirname2(getMemoryDbPath()), { recursive: true });
|
|
16201
16210
|
const configPath = join14(home, "config.json");
|
|
16202
|
-
if (!
|
|
16211
|
+
if (!existsSync3(configPath)) {
|
|
16203
16212
|
await writeFile6(configPath, JSON.stringify({
|
|
16204
16213
|
provider: null,
|
|
16205
16214
|
api_key: null,
|
|
@@ -16254,7 +16263,7 @@ async function cmdUpdate() {
|
|
|
16254
16263
|
console.warn("Could not update package from npm (run 'bun install -g @sulala/agent-os@latest' manually):", err.trim() || out.trim());
|
|
16255
16264
|
}
|
|
16256
16265
|
const dbPath = getMemoryDbPath();
|
|
16257
|
-
if (!
|
|
16266
|
+
if (!existsSync3(dbPath)) {
|
|
16258
16267
|
console.log("No database found. Run 'sulala onboard' to set up agents and skills.");
|
|
16259
16268
|
return;
|
|
16260
16269
|
}
|
|
@@ -16273,7 +16282,7 @@ async function cmdRun(args) {
|
|
|
16273
16282
|
process.exit(1);
|
|
16274
16283
|
}
|
|
16275
16284
|
const dbPath = getMemoryDbPath();
|
|
16276
|
-
if (
|
|
16285
|
+
if (existsSync3(dbPath)) {
|
|
16277
16286
|
setAgentStore(new MemoryStore(dbPath));
|
|
16278
16287
|
}
|
|
16279
16288
|
const agent = await getAgent(agentId);
|
package/dist/index.js
CHANGED
|
@@ -11243,6 +11243,7 @@ async function handleMemoryDelete(idRaw, store) {
|
|
|
11243
11243
|
|
|
11244
11244
|
// src/core/agent-registry.ts
|
|
11245
11245
|
import { readdir, readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2, unlink } from "fs/promises";
|
|
11246
|
+
import { existsSync } from "fs";
|
|
11246
11247
|
import { join as join2 } from "path";
|
|
11247
11248
|
|
|
11248
11249
|
// src/types/agent.ts
|
|
@@ -11326,7 +11327,15 @@ function getAgentsDir() {
|
|
|
11326
11327
|
return process.env.AGENT_OS_AGENTS_DIR || DEFAULT_AGENTS_DIR;
|
|
11327
11328
|
}
|
|
11328
11329
|
function getSeedAgentsDir() {
|
|
11329
|
-
|
|
11330
|
+
if (process.env.AGENT_OS_SEED_AGENTS_DIR)
|
|
11331
|
+
return process.env.AGENT_OS_SEED_AGENTS_DIR;
|
|
11332
|
+
const fromDist = join2(import.meta.dir, "..", "data", "agents");
|
|
11333
|
+
const fromSrc = join2(import.meta.dir, "..", "..", "data", "agents");
|
|
11334
|
+
if (existsSync(fromDist))
|
|
11335
|
+
return fromDist;
|
|
11336
|
+
if (existsSync(fromSrc))
|
|
11337
|
+
return fromSrc;
|
|
11338
|
+
return join2(process.cwd(), "data", "agents");
|
|
11330
11339
|
}
|
|
11331
11340
|
async function insertSeedAgentFromFile(seedDir, name, skipIfExists) {
|
|
11332
11341
|
if (!agentStore)
|
|
@@ -15460,7 +15469,7 @@ async function loadPlugins() {
|
|
|
15460
15469
|
// src/server.ts
|
|
15461
15470
|
init_config();
|
|
15462
15471
|
import { join as join13, dirname, resolve as resolve4 } from "path";
|
|
15463
|
-
import { mkdirSync, existsSync } from "fs";
|
|
15472
|
+
import { mkdirSync, existsSync as existsSync2 } from "fs";
|
|
15464
15473
|
var PORT = parseInt(process.env.PORT ?? "3010", 10);
|
|
15465
15474
|
var DASHBOARD_DIST = resolve4(join13(import.meta.dir, "..", "dashboard", "dist"));
|
|
15466
15475
|
var HOST = process.env.HOST ?? "127.0.0.1";
|
|
@@ -15488,7 +15497,7 @@ function broadcastEvent(event) {
|
|
|
15488
15497
|
}
|
|
15489
15498
|
}
|
|
15490
15499
|
function serveDashboard(pathname) {
|
|
15491
|
-
if (!
|
|
15500
|
+
if (!existsSync2(DASHBOARD_DIST) || !existsSync2(join13(DASHBOARD_DIST, "index.html"))) {
|
|
15492
15501
|
return null;
|
|
15493
15502
|
}
|
|
15494
15503
|
const decoded = decodeURIComponent(pathname);
|
|
@@ -15497,7 +15506,7 @@ function serveDashboard(pathname) {
|
|
|
15497
15506
|
}
|
|
15498
15507
|
const subpath = decoded === "/" ? "index.html" : decoded.slice(1);
|
|
15499
15508
|
const filePath = join13(DASHBOARD_DIST, subpath);
|
|
15500
|
-
if (
|
|
15509
|
+
if (existsSync2(filePath)) {
|
|
15501
15510
|
const file = Bun.file(filePath);
|
|
15502
15511
|
const ext = subpath.split(".").pop() ?? "";
|
|
15503
15512
|
const mime = {
|
|
@@ -15518,7 +15527,7 @@ function serveDashboard(pathname) {
|
|
|
15518
15527
|
});
|
|
15519
15528
|
}
|
|
15520
15529
|
const indexPath = join13(DASHBOARD_DIST, "index.html");
|
|
15521
|
-
if (
|
|
15530
|
+
if (existsSync2(indexPath)) {
|
|
15522
15531
|
return new Response(Bun.file(indexPath), {
|
|
15523
15532
|
headers: { "Content-Type": "text/html" }
|
|
15524
15533
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sulala/agent-os",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"dist",
|
|
26
|
-
"dashboard/dist"
|
|
26
|
+
"dashboard/dist",
|
|
27
|
+
"data"
|
|
27
28
|
],
|
|
28
29
|
"engines": {
|
|
29
30
|
"bun": ">=1.0.0"
|