shadow-claw 1.43.0 → 1.44.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.
Files changed (104) hide show
  1. package/.well-known/mcp/server-card.json +1 -1
  2. package/.well-known/mcp.json +1 -1
  3. package/dist/cli/chunk--nlZNQrZ2.js +1 -0
  4. package/dist/cli/{chunk-CbhVal4Q.js → chunk-2IASlfOI.js} +1 -1
  5. package/dist/cli/chunk-2zUw4dTY.js +1 -0
  6. package/dist/cli/{chunk-C_vLt0YP2.js → chunk-B2WxN9-12.js} +11 -11
  7. package/dist/cli/{chunk-Cweo3Jpw.js → chunk-B5hVBRV-.js} +1 -1
  8. package/dist/cli/chunk-B7vuMvBg.js +1 -0
  9. package/dist/cli/{chunk-C9b5a_Uy.js → chunk-B9Fx2rWZ.js} +1 -1
  10. package/dist/cli/chunk-BChoeGdY2.js +1 -0
  11. package/dist/cli/{chunk-CcWCWTJe.js → chunk-BJmbRsHN.js} +1 -1
  12. package/dist/cli/{chunk-BN0tqRNn.js → chunk-BQyGyg86.js} +1 -1
  13. package/dist/cli/chunk-B_FQjokZ.js +1 -0
  14. package/dist/cli/chunk-BaAL1yLC.js +1 -0
  15. package/dist/cli/{chunk-L61wFp4H2.js → chunk-BaSEVtTB2.js} +1 -1
  16. package/dist/cli/chunk-BckYclkX2.js +1 -0
  17. package/dist/cli/chunk-Bh0Uxjld.js +1 -0
  18. package/dist/cli/{chunk-D57WTK9e2.js → chunk-By9miObI2.js} +2 -2
  19. package/dist/cli/chunk-C0cwwqX52.js +1 -0
  20. package/dist/cli/{chunk-DJ1pR9f82.js → chunk-C0vTb5Ur2.js} +1 -1
  21. package/dist/cli/{chunk-BBCAo_6N2.js → chunk-C3iVPEyi2.js} +1 -1
  22. package/dist/cli/{chunk-D3NWfUvq2.js → chunk-CJpZQ6NS2.js} +1 -1
  23. package/dist/cli/{chunk-Dhh0lHO6.js → chunk-CKksk-lA.js} +1 -1
  24. package/dist/cli/chunk-CKm7-SCu.js +1 -0
  25. package/dist/cli/{chunk-BPcMKhha2.js → chunk-CLKlXl_32.js} +1 -1
  26. package/dist/cli/{chunk-rvRQOKXp.js → chunk-CQeDQc3C.js} +1 -1
  27. package/dist/cli/{chunk-DYGlH-un.js → chunk-CSMegkz6.js} +1 -1
  28. package/dist/cli/{chunk-B1TEXFG-2.js → chunk-CTnzEqW82.js} +1 -1
  29. package/dist/cli/chunk-CiHV_7H62.js +1 -0
  30. package/dist/cli/{chunk-D9F645K62.js → chunk-CimeIb1j2.js} +1 -1
  31. package/dist/cli/{chunk-D-lQkf5X.js → chunk-CjhfhiNM.js} +1 -1
  32. package/dist/cli/{chunk-BTe1dZD0.js → chunk-ClBaEe8W.js} +1 -1
  33. package/dist/cli/{chunk-BmDywCXL.js → chunk-Cvv2Fuue.js} +1 -1
  34. package/dist/cli/{chunk-DcYfXgpg2.js → chunk-Cx8_qww-2.js} +1 -1
  35. package/dist/cli/{chunk-CvKmsXS02.js → chunk-D0UlHLhC2.js} +1 -1
  36. package/dist/cli/chunk-D0jQVYRk.js +5 -0
  37. package/dist/cli/chunk-D0sHV-Z82.js +1 -0
  38. package/dist/cli/{chunk-DeMPVxlQ.js → chunk-D2FGpjOO.js} +1 -1
  39. package/dist/cli/chunk-D3cH54jW.js +1 -0
  40. package/dist/cli/{chunk-Di4LxQG-2.js → chunk-D9dG7jP92.js} +1 -1
  41. package/dist/cli/{chunk-qTCLBos1.js → chunk-DKw-oTLT.js} +1 -1
  42. package/dist/cli/{chunk-BHnjkiBp2.js → chunk-DOkl85Te2.js} +1 -1
  43. package/dist/cli/{chunk-XS0fMLl1.js → chunk-DPySd-KC.js} +1 -1
  44. package/dist/cli/{chunk-BkTdHRZ6.js → chunk-DSleWP3c.js} +1 -1
  45. package/dist/cli/chunk-DjKQO7aV.js +1 -0
  46. package/dist/cli/{chunk-CA8_jPwF2.js → chunk-Dk750_9R2.js} +11 -11
  47. package/dist/cli/{chunk-nsFY_QXf.js → chunk-Do2xLVwC.js} +1 -1
  48. package/dist/cli/{chunk-DcMyZrds.js → chunk-DoVkBeQv.js} +1 -1
  49. package/dist/cli/chunk-DrB5Gd6y2.js +1 -0
  50. package/dist/cli/chunk-DwKjgkq92.js +1 -0
  51. package/dist/cli/{chunk-DJU6hg1K2.js → chunk-DxZ6DcRo2.js} +63 -63
  52. package/dist/cli/chunk-IGlHHKOH.js +1 -0
  53. package/dist/cli/{chunk-CpoiOFRV.js → chunk-NclDuGcY.js} +1 -1
  54. package/dist/cli/{chunk-CeFei3f_2.js → chunk-TO5qzf3J2.js} +303 -303
  55. package/dist/cli/{chunk-swUMQyE2.js → chunk-TYwbIsK9.js} +9 -9
  56. package/dist/cli/{chunk-CWs_KY8q.js → chunk-Xz02ooJU.js} +1 -1
  57. package/dist/cli/{chunk-DfKXmvNq.js → chunk-e4ARaRhY.js} +1 -1
  58. package/dist/cli/{chunk-DuTr5h_-.js → chunk-g3j2rSPJ.js} +9 -9
  59. package/dist/cli/{chunk-JMI-k9_C.js → chunk-j0KG-6x9.js} +1 -1
  60. package/dist/cli/chunk-ud_DUk_f2.js +1 -0
  61. package/dist/cli/{chunk-BzqpsHxW2.js → chunk-zUKEZHmz2.js} +1 -1
  62. package/dist/cli/cli.js +2 -2
  63. package/dist/headless-agent.js +10 -10
  64. package/dist/public/.well-known/mcp/server-card.json +1 -1
  65. package/dist/public/.well-known/mcp.json +1 -1
  66. package/dist/public/docs/example/article/index.html +1 -1
  67. package/dist/public/docs/publishing/index.html +1 -1
  68. package/dist/public/docs/skill-creator/index.html +1 -1
  69. package/dist/public/docs/subsystems/cli.md +4 -0
  70. package/dist/public/index.html +1 -1
  71. package/dist/public/main/index.html +1 -1
  72. package/dist/public/main/memory/index.html +1 -1
  73. package/dist/public/service-worker.js +1 -1
  74. package/dist/server.js +761 -761
  75. package/package.json +1 -1
  76. package/src/cli/cli.ts +5 -1
  77. package/src/cli/commands/agent.test.ts +97 -4
  78. package/src/cli/commands/agent.ts +28 -2
  79. package/src/db/sqlite/openSqliteDatabase.test.ts +24 -0
  80. package/src/db/sqlite/openSqliteDatabase.ts +8 -1
  81. package/dist/cli/chunk-0WvYaMdi.js +0 -1
  82. package/dist/cli/chunk-BXNdnbwK.js +0 -1
  83. package/dist/cli/chunk-BlNmgi3c2.js +0 -1
  84. package/dist/cli/chunk-C7irE8d42.js +0 -1
  85. package/dist/cli/chunk-Cbbk_aex2.js +0 -1
  86. package/dist/cli/chunk-CdNTakxH2.js +0 -1
  87. package/dist/cli/chunk-Cqd6ZDkT.js +0 -1
  88. package/dist/cli/chunk-CvoMdhST2.js +0 -1
  89. package/dist/cli/chunk-DCRmnjTH.js +0 -1
  90. package/dist/cli/chunk-DFLqhyP_.js +0 -5
  91. package/dist/cli/chunk-DLUNHJGc.js +0 -1
  92. package/dist/cli/chunk-DfwnnpVo.js +0 -1
  93. package/dist/cli/chunk-DhJvrfsM.js +0 -1
  94. package/dist/cli/chunk-DhQQhCTL2.js +0 -1
  95. package/dist/cli/chunk-Drx4e34U.js +0 -1
  96. package/dist/cli/chunk-DwEMut0N.js +0 -1
  97. package/dist/cli/chunk-STsbFGCh2.js +0 -1
  98. /package/dist/cli/{chunk-Bb_85Mew.js → chunk-Bb_85Mew2.js} +0 -0
  99. /package/dist/cli/{chunk-CrWRlKmP.js → chunk-CrWRlKmP2.js} +0 -0
  100. /package/dist/cli/{chunk-D2vZJXHH2.js → chunk-D2vZJXHH.js} +0 -0
  101. /package/dist/cli/{chunk-D5U9WJ9X.js → chunk-D5U9WJ9X2.js} +0 -0
  102. /package/dist/cli/{chunk-DV5sRVN1.js → chunk-DV5sRVN12.js} +0 -0
  103. /package/dist/cli/{chunk-DXSwo4q72.js → chunk-DXSwo4q7.js} +0 -0
  104. /package/dist/cli/{chunk-Dv5oFrVy2.js → chunk-Dv5oFrVy.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shadow-claw",
3
- "version": "1.43.0",
3
+ "version": "1.44.0",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0",
6
6
  "description": "ShadowClaw - multi-runtime AI assistant.",
package/src/cli/cli.ts CHANGED
@@ -1228,7 +1228,7 @@ program.commandsGroup("Headless Agent:");
1228
1228
  program
1229
1229
  .command("agent [action] [args...]")
1230
1230
  .description(
1231
- "Run the headless CLI agent (init | model | skills | tools | tool | skill | import | run | listen)",
1231
+ "Run the headless CLI agent (init | model | skills | tools | tool | skill | import | run | clear | listen)",
1232
1232
  )
1233
1233
  .optionsGroup("Agent Options:")
1234
1234
  .option(
@@ -1274,6 +1274,10 @@ program
1274
1274
  true,
1275
1275
  )
1276
1276
  .option("--no-stream", "Disable streaming response tokens to stdout")
1277
+ .option(
1278
+ "--no-history",
1279
+ "Do not load prior conversation history for `agent run`",
1280
+ )
1277
1281
  .option(
1278
1282
  "--progress",
1279
1283
  "Show progress bar during model downloads (default: true)",
@@ -100,8 +100,8 @@ describe("agent init", () => {
100
100
 
101
101
  it("defaults workspace to a unique random isolated sandbox when options.workspace is not provided", async () => {
102
102
  const { runAgentInit } = await import("./agent.js");
103
- const result1 = await runAgentInit({});
104
- const result2 = await runAgentInit({});
103
+ const result1 = await runAgentInit({ yes: true });
104
+ const result2 = await runAgentInit({ yes: true });
105
105
  const basePrefix = path.join(tmpdir(), "shadow-claw", "workspace-");
106
106
  expect(result1.workspace.startsWith(basePrefix)).toBe(true);
107
107
  expect(result2.workspace.startsWith(basePrefix)).toBe(true);
@@ -127,8 +127,14 @@ describe("agent init", () => {
127
127
  const basePrefix = path.join(tmpdir(), "shadow-claw", "workspace-");
128
128
 
129
129
  // 1. Without workspace option, defaults to a unique fallback in tmpdir
130
- const resDefault1 = await bootstrapHeadlessAgent({ quiet: true });
131
- const resDefault2 = await bootstrapHeadlessAgent({ quiet: true });
130
+ const resDefault1 = await bootstrapHeadlessAgent({
131
+ quiet: true,
132
+ yes: true,
133
+ });
134
+ const resDefault2 = await bootstrapHeadlessAgent({
135
+ quiet: true,
136
+ yes: true,
137
+ });
132
138
  expect(resDefault1.workspaceDir.startsWith(basePrefix)).toBe(true);
133
139
  expect(resDefault2.workspaceDir.startsWith(basePrefix)).toBe(true);
134
140
  expect(resDefault1.workspaceDir).not.toBe(resDefault2.workspaceDir);
@@ -143,6 +149,7 @@ describe("agent init", () => {
143
149
  const resCache = await bootstrapHeadlessAgent({
144
150
  cacheDir: customCache,
145
151
  quiet: true,
152
+ yes: true,
146
153
  });
147
154
  expect(resCache.workspaceDir.startsWith(basePrefix)).toBe(true);
148
155
  closeSqliteDatabase?.();
@@ -153,6 +160,7 @@ describe("agent init", () => {
153
160
  workspace: explicitWorkspace,
154
161
  cacheDir: customCache,
155
162
  quiet: true,
163
+ yes: true,
156
164
  });
157
165
  expect(resExplicit.workspaceDir).toBe(path.resolve(explicitWorkspace));
158
166
  closeSqliteDatabase?.();
@@ -1347,6 +1355,91 @@ describe("runAgentRun — --output file", () => {
1347
1355
  });
1348
1356
  });
1349
1357
 
1358
+ describe("agent clear and run --no-history", () => {
1359
+ let tmpDir;
1360
+
1361
+ beforeEach(async () => {
1362
+ tmpDir = await mkdtemp(path.join(tmpdir(), "sc-agent-clear-test-"));
1363
+ });
1364
+
1365
+ afterEach(async () => {
1366
+ const { closeSqliteDatabase } =
1367
+ await import("../../db/sqlite/openSqliteDatabase.js");
1368
+ closeSqliteDatabase?.();
1369
+ await rm(tmpDir, { recursive: true, force: true });
1370
+ });
1371
+
1372
+ async function runWith(prompt, extra = {}) {
1373
+ const { runAgentRun } = await import("./agent.js");
1374
+ const seen: any[] = [];
1375
+
1376
+ await runAgentRun(prompt, {
1377
+ workspace: tmpDir,
1378
+ provider: "openrouter",
1379
+ apiKey: "sk-or-v1-test",
1380
+ quiet: true,
1381
+ _stdinData: null,
1382
+ invokeHandler: async (_db, payload) => {
1383
+ seen.push(payload.messages);
1384
+ },
1385
+ ...extra,
1386
+ });
1387
+
1388
+ return seen[0] as any[];
1389
+ }
1390
+
1391
+ it("includes prior messages by default", async () => {
1392
+ await runWith("first");
1393
+ const messages = await runWith("second");
1394
+
1395
+ expect(messages.map((m) => m.content)).toEqual(["first", "second"]);
1396
+ });
1397
+
1398
+ it("--no-history omits prior messages", async () => {
1399
+ await runWith("first");
1400
+ const messages = await runWith("second", { history: false });
1401
+
1402
+ expect(messages.map((m) => m.content)).toEqual(["second"]);
1403
+ });
1404
+
1405
+ it("agent clear removes stored history for the group", async () => {
1406
+ const { runAgentCommand } = await import("./agent.js");
1407
+
1408
+ await runWith("first");
1409
+
1410
+ const result = await runAgentCommand("clear", [], {
1411
+ workspace: tmpDir,
1412
+ quiet: true,
1413
+ _stdinData: null,
1414
+ });
1415
+
1416
+ expect(result).toEqual({ success: true, groupId: "server:main" });
1417
+
1418
+ const messages = await runWith("second");
1419
+ expect(messages.map((m) => m.content)).toEqual(["second"]);
1420
+ });
1421
+
1422
+ it("agent clear only affects the targeted --group", async () => {
1423
+ const { runAgentCommand } = await import("./agent.js");
1424
+
1425
+ await runWith("keep", { group: "server:a" });
1426
+ await runWith("drop", { group: "server:b" });
1427
+
1428
+ await runAgentCommand("clear", [], {
1429
+ workspace: tmpDir,
1430
+ quiet: true,
1431
+ group: "server:b",
1432
+ _stdinData: null,
1433
+ });
1434
+
1435
+ const a = await runWith("next", { group: "server:a" });
1436
+ const b = await runWith("next", { group: "server:b" });
1437
+
1438
+ expect(a.map((m) => m.content)).toEqual(["keep", "next"]);
1439
+ expect(b.map((m) => m.content)).toEqual(["next"]);
1440
+ });
1441
+ });
1442
+
1350
1443
  describe("runAgentRun — verbose logging of prompting steps", () => {
1351
1444
  let tmpDir;
1352
1445
  let originalStderrWrite;
@@ -412,6 +412,26 @@ export async function runAgentTool(
412
412
  };
413
413
  }
414
414
 
415
+ /**
416
+ * Delete all stored messages for a conversation group.
417
+ */
418
+ export async function runAgentClear(
419
+ options: Record<string, any> = {},
420
+ ): Promise<{ success: boolean; groupId: string }> {
421
+ const { db, core } = await bootstrapHeadlessAgent(options);
422
+ const groupId =
423
+ options.group || core.DEFAULT_SERVER_GROUP_ID || DEFAULT_SERVER_GROUP_ID;
424
+ const { clearGroupMessages } = await import("../../db/clearGroupMessages.js");
425
+
426
+ await clearGroupMessages(db, groupId);
427
+
428
+ if (!options.quiet) {
429
+ console.log(`Cleared conversation history for group "${groupId}".`);
430
+ }
431
+
432
+ return { success: true, groupId };
433
+ }
434
+
415
435
  /**
416
436
  * Execute a skill by name directly via its declarative tool chain.
417
437
  * @param {string} skillName
@@ -1057,7 +1077,10 @@ export async function runAgentRun(
1057
1077
 
1058
1078
  // 4. Load recent message history
1059
1079
  let history = [];
1060
- if (typeof core.getRecentMessages === "function") {
1080
+ if (
1081
+ options.history !== false &&
1082
+ typeof core.getRecentMessages === "function"
1083
+ ) {
1061
1084
  try {
1062
1085
  history = await core.getRecentMessages(db, groupId, 50);
1063
1086
  } catch {}
@@ -1909,6 +1932,9 @@ export async function runAgentCommand(
1909
1932
  return await runAgentSkill(skillName, actualOptions);
1910
1933
  }
1911
1934
 
1935
+ case "clear":
1936
+ return await runAgentClear(actualOptions);
1937
+
1912
1938
  case "run": {
1913
1939
  // Prompt may be empty when data is piped via stdin
1914
1940
  const prompt = actualArgs.join(" ") || "";
@@ -1953,7 +1979,7 @@ export async function runAgentCommand(
1953
1979
 
1954
1980
  default: {
1955
1981
  console.log(
1956
- "Usage: shadow-claw agent <init|model|skills|tools|tool|skill|import|run|listen> [args...]",
1982
+ "Usage: shadow-claw agent <init|model|skills|tools|tool|skill|import|run|clear|listen> [args...]",
1957
1983
  );
1958
1984
  }
1959
1985
  }
@@ -127,6 +127,30 @@ describe("openSqliteDatabase", () => {
127
127
  expect(db1).toBe(db2);
128
128
  });
129
129
 
130
+ it("opens the requested database when the path changes", async () => {
131
+ const { openSqliteDatabase } = await import("./openSqliteDatabase.js");
132
+ const firstPath = path.join(tmpDir, "first.db");
133
+ const secondPath = path.join(tmpDir, "second.db");
134
+ const firstDb = openSqliteDatabase(firstPath);
135
+ firstDb.db
136
+ .prepare("INSERT INTO config (key, value) VALUES (?, ?)")
137
+ .run("marker", "first database");
138
+
139
+ const secondDb = openSqliteDatabase(secondPath);
140
+ expect(secondDb).not.toBe(firstDb);
141
+ expect(
142
+ secondDb.db.prepare("SELECT * FROM config WHERE key = ?").get("marker"),
143
+ ).toBeUndefined();
144
+
145
+ const reopenedFirstDb = openSqliteDatabase(firstPath);
146
+ expect(reopenedFirstDb).not.toBe(firstDb);
147
+ expect(
148
+ reopenedFirstDb.db
149
+ .prepare("SELECT value FROM config WHERE key = ?")
150
+ .get("marker"),
151
+ ).toEqual({ value: "first database" });
152
+ });
153
+
130
154
  it("closeSqliteDatabase clears the cache so a new DB can be opened", async () => {
131
155
  const { openSqliteDatabase, closeSqliteDatabase } =
132
156
  await import("./openSqliteDatabase.js");
@@ -1,8 +1,10 @@
1
1
  import { DatabaseSync } from "node:sqlite";
2
+ import path from "node:path";
2
3
  import { wrapSqliteDatabase } from "./types.js";
3
4
  import type { ShadowClawSqliteDatabase } from "./types.js";
4
5
 
5
6
  let cachedDb: ShadowClawSqliteDatabase | null = null;
7
+ let cachedDbPath: string | null = null;
6
8
 
7
9
  const addColumn = (
8
10
  raw: DatabaseSync,
@@ -31,10 +33,13 @@ const addColumn = (
31
33
  export function openSqliteDatabase(
32
34
  dbPath: string = "database/agent.db",
33
35
  ): ShadowClawSqliteDatabase {
34
- if (cachedDb) {
36
+ const resolvedDbPath = dbPath === ":memory:" ? dbPath : path.resolve(dbPath);
37
+ if (cachedDb && cachedDbPath === resolvedDbPath) {
35
38
  return cachedDb;
36
39
  }
37
40
 
41
+ closeSqliteDatabase();
42
+
38
43
  const raw = new DatabaseSync(dbPath);
39
44
 
40
45
  raw.exec(`
@@ -126,6 +131,7 @@ export function openSqliteDatabase(
126
131
  addColumn(raw, "messages", "subagent", "INTEGER");
127
132
 
128
133
  cachedDb = wrapSqliteDatabase(raw);
134
+ cachedDbPath = resolvedDbPath;
129
135
  return cachedDb;
130
136
  }
131
137
 
@@ -138,4 +144,5 @@ export function closeSqliteDatabase(): void {
138
144
  cachedDb.db.close();
139
145
  cachedDb = null;
140
146
  }
147
+ cachedDbPath = null;
141
148
  }
@@ -1 +0,0 @@
1
- import{t as e}from"./chunk-Dhh0lHO6.js";export{e as getConfig};
@@ -1 +0,0 @@
1
- import{o as e,t}from"./chunk-swUMQyE2.js";export{t as resolveAgentProvider,e as runAgentRun};
@@ -1 +0,0 @@
1
- import{t as e}from"./chunk-DcYfXgpg2.js";export{e as fetchDiscoveryManifest};
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-CeFei3f_2.js";export{e as orchestratorStore};
@@ -1 +0,0 @@
1
- import{t as e}from"./chunk-BHnjkiBp2.js";export{e as importRemoteArtifacts};
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-DJU6hg1K2.js";export{e as orchestratorStore};
@@ -1 +0,0 @@
1
- import{t as e}from"./chunk-Cweo3Jpw.js";export{e as getAgentCore};
@@ -1 +0,0 @@
1
- import{t as e}from"./chunk-DFLqhyP_.js";function t(t){return e(t,`tasks`,`readonly`,e=>e.getAll()).then(e=>e.map(e=>({...e,enabled:!!e.enabled})))}export{t};
@@ -1 +0,0 @@
1
- import{o as e,t}from"./chunk-DuTr5h_-.js";export{t as resolveAgentProvider,e as runAgentRun};
@@ -1,5 +0,0 @@
1
- let e=null,t=null;const n=new Promise(e=>{t=e});function r(){return e?Promise.resolve(e):n}function i(n){if(!n)throw Error(`Database not initialized`);e=n,t&&=(t(n),null)}function a(){e=null}function o(e){return typeof e==`object`&&!!e&&e.__brand===`ShadowClawSqliteDatabase`}function s(e){return{__brand:`ShadowClawSqliteDatabase`,db:e}}function c(e,t){return{get(n){let r;if(t===`config`)r=e.prepare(`SELECT key, value FROM config WHERE key = ?`).get(n)??void 0;else if(t===`tasks`){let t=e.prepare(`SELECT * FROM tasks WHERE id = ?`).get(n);t&&(r={...t,enabled:!!t.enabled,tools:t.tools?JSON.parse(t.tools):void 0})}else r=t===`messages`?e.prepare(`SELECT * FROM messages WHERE id = ?`).get(n)??void 0:e.prepare(`SELECT * FROM ${t} WHERE id = ?`).get(n)??void 0;return{result:r,onsuccess:null,onerror:null}},getAll(){let n;return n=t===`config`?e.prepare(`SELECT key, value FROM config ORDER BY key`).all()??[]:t===`tasks`?(e.prepare(`SELECT * FROM tasks ORDER BY createdAt DESC`).all()??[]).map(e=>({...e,enabled:!!e.enabled,tools:e.tools?JSON.parse(e.tools):void 0})):e.prepare(`SELECT * FROM ${t}`).all()??[],{result:n,onsuccess:null,onerror:null}},put(n){if(t===`config`)e.prepare(`INSERT OR REPLACE INTO config (key, value) VALUES (?, ?)`).run(n.key,typeof n.value==`string`?n.value:JSON.stringify(n.value));else if(t===`tasks`)e.prepare(`INSERT OR REPLACE INTO tasks
2
- (id, groupId, enabled, schedule, prompt, tools, lastRun, createdAt, type, freshContext, subagent, name, task_order)
3
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(n.id,n.groupId,+!!n.enabled,n.schedule??null,n.prompt??``,n.tools?JSON.stringify(n.tools):null,n.lastRun??null,n.createdAt,n.type??null,n.freshContext?1:null,n.subagent?1:null,n.name??null,n.order??null);else if(t===`messages`)e.prepare(`INSERT OR REPLACE INTO messages
4
- (id, groupId, timestamp, content, sender, channel, isFromMe, isTrigger, attachments, a2uiAction, a2uiEnvelopes, freshContext, subagent)
5
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(n.id,n.groupId,n.timestamp,n.content,n.sender,n.channel??`chat`,+!!n.isFromMe,+!!n.isTrigger,n.attachments?JSON.stringify(n.attachments):null,n.a2uiAction?JSON.stringify(n.a2uiAction):null,n.a2uiEnvelopes?JSON.stringify(n.a2uiEnvelopes):null,n.freshContext?1:null,n.subagent?1:null);else{let r=Object.keys(n),i=r.map(()=>`?`).join(`, `),a=r.map(e=>{let t=n[e];return typeof t==`object`&&t?JSON.stringify(t):t});e.prepare(`INSERT OR REPLACE INTO ${t} (${r.join(`, `)}) VALUES (${i})`).run(...a)}return{result:void 0,onsuccess:null,onerror:null}},delete(n){return t===`config`?e.prepare(`DELETE FROM config WHERE key = ?`).run(n):t===`tasks`?e.prepare(`DELETE FROM tasks WHERE id = ?`).run(n):e.prepare(`DELETE FROM ${t} WHERE id = ?`).run(n),{result:void 0,onsuccess:null,onerror:null}}}}function l(e,t,n,r){return new Promise((n,i)=>{try{let i=r(c(e.db,t)),a=i.onsuccess;typeof a==`function`&&a(),n(i.result)}catch(e){i(e)}})}function u(e,t,n,r){return e?o(e)?l(e,t,n,r):new Promise((i,a)=>{try{let o=e.transaction(t,n);if(!o)return a(Error(`failed to get transaction`));let s=r(o.objectStore(t));s.onsuccess=()=>i(s.result),s.onerror=()=>a(s.error)}catch(e){a(e)}}):Promise.reject(Error(`failed to get database, cannot update task.`))}export{a,r as i,o as n,i as o,s as r,u as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./chunk-JMI-k9_C.js";export{e as getAgentCore};
@@ -1 +0,0 @@
1
- import{i as e,n as t}from"./chunk-CpukYBmh2.js";import"./chunk-CKTtKg5g2.js";import"./chunk-BDSNQ5RN2.js";import"./chunk-D5-oZBwJ2.js";import"./chunk-WU98h6LV2.js";import{t as n}from"./chunk-BqdBlNeB2.js";import{n as r}from"./chunk-CM3Wphe32.js";import{n as i}from"./chunk-Ceh1EmaK2.js";import{n as ee,r as te}from"./chunk-CMzREth02.js";import{n as a}from"./chunk-WuS6FxYJ2.js";import{n as o}from"./chunk-BSibS-UP2.js";import{t as s}from"./chunk-CsJqx78R2.js";import{n as c}from"./chunk-D2vZJXHH2.js";import{n as l}from"./chunk-8ibqxpZe.js";import{n as u}from"./chunk-BdcFlehf.js";import"./chunk-BbpS-dVt.js";import{t as d}from"./chunk-C0X9vvn1.js";import{t as f}from"./chunk-xyH3CrC7.js";import{n as p}from"./chunk-C4Rhej0q.js";import{t as m}from"./chunk-UfE0cnVW.js";import{n as h}from"./chunk-DNVLx9yQ.js";import{n as g}from"./chunk-DHLYAKo9.js";import{n as _,r as v}from"./chunk-DFCQBfpa.js";import{n as y}from"./chunk-DG8IUX4e.js";import{t as b}from"./chunk-BGtNqH44.js";import{n as x}from"./chunk-EymYeDgA.js";import"./chunk-CXo-vnAT.js";import{t as S}from"./chunk-VWDhz2t7.js";import{t as C}from"./chunk-DZQewX_z2.js";import"./chunk-DM0gnIm72.js";import"./chunk-BGeceqqc2.js";import"./chunk-IC92tFkM2.js";import{n as w}from"./chunk-vY9my1592.js";import"./chunk-BKit4qBU2.js";import{t as T}from"./chunk-U9qmJIE02.js";import"./chunk-DCswFaKf2.js";import{r as E}from"./chunk-DnLEebfy2.js";import{n as D}from"./chunk-BEF7I3nl2.js";import{n as O}from"./chunk-CT_5OHPZ2.js";import{n as k}from"./chunk-Dxv5kWua2.js";import{t as A}from"./chunk-Bx1COF_D2.js";import{n as j}from"./chunk-5_W2yDzN2.js";import{n as M}from"./chunk-DfCRRExB2.js";import{n as N}from"./chunk-CE4DzJ7f2.js";import{i as P,n as F,o as I}from"./chunk-Dgfg_DPl2.js";import{t as L}from"./chunk-BCQKXsrv2.js";import{t as R}from"./chunk-BzAUqCQA2.js";import{n as z}from"./chunk-1UAmSdpX2.js";import{t as B}from"./chunk-CV0-VS6z2.js";import{n as V}from"./chunk-B-Y6t6AY2.js";import{n as H}from"./chunk-BmMZ9lDJ2.js";import{n as U,r as W}from"./chunk-Dv5oFrVy2.js";import{n as G}from"./chunk-DacX6Hjm.js";import{t as K}from"./chunk-AtotJng0.js";import{t as q}from"./chunk-CeW84Op5.js";import{n as J}from"./chunk-WiHy2T-K.js";import{t as ne}from"./chunk-Ca7P4IL7.js";import{t as Y}from"./chunk-D5mnlEve.js";import{t as X}from"./chunk-9cKL1HMO.js";import{t as Z}from"./chunk-Bo2U7stk.js";import{t as re}from"./chunk-DAjJj7AF.js";import{t as ie}from"./chunk-CQbWKpl5.js";import{n as ae}from"./chunk-j8Hbx-bs.js";import{n as oe}from"./chunk-AVKDR2dx.js";import{t as se}from"./chunk-iR1AGZGi.js";import{t as ce}from"./chunk-BX1Qcy0V.js";import{t as le}from"./chunk-CFKqH_2W.js";import{n as ue}from"./chunk-jhLQ4boT.js";import{t as de}from"./chunk-BH53s7Ns.js";import{n as fe}from"./chunk-Cr04RzyD.js";import{n as pe}from"./chunk-DqgR-tFt.js";import"./chunk-Db9MbB8U.js";import{a as me,n as he,o as ge}from"./chunk-0dwVMU-a.js";import{n as _e}from"./chunk-CCCnHPn5.js";import{n as ve}from"./chunk-BsbJJGhj.js";import{t as ye}from"./chunk-DONGo0Q7.js";import{t as be}from"./chunk-5TfhGCmp.js";import{n as xe}from"./chunk-CzkWjMXt.js";import{t as Q}from"./chunk-D2IrRatU.js";import{t as Se}from"./chunk-CvqvtO-h.js";import{t as Ce}from"./chunk-DqIaE7oc.js";import{t as we}from"./chunk-B2OvszL8.js";import{n as Te}from"./chunk-DOTe8jvc.js";import{n as Ee}from"./chunk-Csvhbj3e.js";import{n as De}from"./chunk-DvAObJVY.js";import{t as Oe}from"./chunk-DcK6zJ0i.js";import{n as ke}from"./chunk-Df86FSvY.js";var Ae=[g,a,Te,Ee,De,Oe,ke,be,u,xe,Q,o,Se,Ce,we,de,fe,pe,ge,he,me,_e,ve,n,ye,ae,l,d,oe,se,ce,le,ue,y,Y,X,Z,c,re,ie,S,i,m,q,h,_,v,e,t,J,ne,W,U,s,te,ee,G,r,p,f,K,L,R,z,b,B,V,H,x,D,O,k,A,j,M,N,P,F,I,C,w,T,E];function je(){return Ae}var $=new Map;for(let e of je())$.set(e.name,new Set(e.flags.map(e=>e.flag)));function Me(e,t,n){let r=$.get(t);if(!(!r||r.size===0))for(let i of n)r.has(i)&&e.hit(`cmd:flag:${t}:${i}`)}export{Me as emitFlagCoverage};
@@ -1 +0,0 @@
1
- import{n as e}from"./chunk-CcWCWTJe.js";export{e as runWebRtcListenCommand};
@@ -1 +0,0 @@
1
- import{t as e}from"./chunk-Di4LxQG-2.js";export{e as fetchDiscoveryManifest};
@@ -1 +0,0 @@
1
- var e=class{constructor(e){this.modelName=e}static availability(e){return`available`}createSession(e,t,n){throw Error(`Not implemented`)}async generateContent(e){throw Error(`Not implemented`)}async generateContentStream(e){throw Error(`Not implemented`)}async countTokens(e){throw Error(`Not implemented`)}convertSchema(e){return e}},t={firebase:{modelName:`gemini-3.1-flash-lite`},gemini:{modelName:`gemini-flash-lite-latest`},openai:{modelName:`gpt-4o`},transformers:{modelName:`onnx-community/gemma-3-1b-it-ONNX-GQA`,device:`webgpu`,dtype:`q4f16`},webllm:{modelName:`Llama-3.2-3B-Instruct-q4f32_1-MLC`}};export{t as n,e as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./chunk-DfKXmvNq.js";export{e as runWebRtcListenCommand};
@@ -1 +0,0 @@
1
- import{t as e}from"./chunk-B1TEXFG-2.js";export{e as importRemoteArtifacts};