@deepagents/experimental 7.3.0 → 7.5.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 (31) hide show
  1. package/README.md +3 -0
  2. package/dist/index.js +9 -9
  3. package/dist/index.js.map +3 -3
  4. package/dist/providers/claude/index.js +5 -3
  5. package/dist/providers/claude/index.js.map +2 -2
  6. package/dist/providers/claude/local-credentials.d.ts.map +1 -1
  7. package/dist/providers/codex/index.js +3 -1
  8. package/dist/providers/codex/index.js.map +2 -2
  9. package/dist/providers/codex/local-credentials.d.ts.map +1 -1
  10. package/dist/zukhruf/agent.d.ts +3 -1
  11. package/dist/zukhruf/agent.d.ts.map +1 -1
  12. package/dist/zukhruf/index.js +9 -9
  13. package/dist/zukhruf/index.js.map +3 -3
  14. package/dist/zukhruf/mailbox/ddl.sqlite.d.ts +1 -1
  15. package/dist/zukhruf/mailbox/ddl.sqlite.d.ts.map +1 -1
  16. package/dist/zukhruf/mailbox/sqlite.store.d.ts.map +1 -1
  17. package/dist/zukhruf/plugins/conversation-scheduling/index.d.ts.map +1 -1
  18. package/dist/zukhruf/plugins/conversation-scheduling/index.js +8 -11
  19. package/dist/zukhruf/plugins/conversation-scheduling/index.js.map +2 -2
  20. package/dist/zukhruf/plugins/http/index.d.ts.map +1 -1
  21. package/dist/zukhruf/plugins/http/index.js +40 -20
  22. package/dist/zukhruf/plugins/http/index.js.map +2 -2
  23. package/dist/zukhruf/plugins/schedules/http.js.map +1 -1
  24. package/dist/zukhruf/plugins/schedules/index.d.ts.map +1 -1
  25. package/dist/zukhruf/plugins/schedules/index.js +15 -16
  26. package/dist/zukhruf/plugins/schedules/index.js.map +3 -3
  27. package/dist/zukhruf/plugins/uploads/http.js.map +1 -1
  28. package/dist/zukhruf/plugins/uploads/index.js +7 -8
  29. package/dist/zukhruf/plugins/uploads/index.js.map +2 -2
  30. package/dist/zukhruf/runtime/agent-turn-executor.d.ts.map +1 -1
  31. package/package.json +9 -8
@@ -189,13 +189,12 @@ function defineInstructions(...fragments) {
189
189
 
190
190
  // packages/experimental/src/zukhruf/mailbox/sqlite.store.ts
191
191
  import { Declaration } from "@zukhruf/sqlite-drift";
192
+ import { open } from "@zukhruf/sqlite-open";
192
193
  import { transaction } from "@zukhruf/sqlite-transaction";
193
- import { DatabaseSync } from "node:sqlite";
194
194
  import { z } from "zod";
195
195
 
196
196
  // packages/experimental/src/zukhruf/mailbox/ddl.sqlite.ts
197
197
  var SETUP = `
198
- PRAGMA journal_mode = WAL;
199
198
  PRAGMA synchronous = NORMAL;
200
199
  `;
201
200
  var statements = [
@@ -279,7 +278,6 @@ function assertConversationId(value, label) {
279
278
 
280
279
  // packages/experimental/src/zukhruf/mailbox/sqlite.store.ts
281
280
  var tables = new Declaration(statements, { rows: "keep" });
282
- var BUSY_TIMEOUT_MS = 5e3;
283
281
  var conversationIdSchema = z.object({
284
282
  chatId: z.string(),
285
283
  userId: z.string()
@@ -304,7 +302,7 @@ var SqliteMailboxStore = class extends MailboxStore {
304
302
  #database;
305
303
  constructor(path3) {
306
304
  super();
307
- this.#database = new DatabaseSync(path3, { timeout: BUSY_TIMEOUT_MS });
305
+ this.#database = open(path3);
308
306
  this.#database.exec(SETUP);
309
307
  tables.apply(this.#database);
310
308
  }
@@ -2071,12 +2069,12 @@ function replacementRange(messages, keepLastMessages) {
2071
2069
  while (messages[start]?.role === "system") start++;
2072
2070
  let limit = messages.length - keepLastMessages;
2073
2071
  const links = /* @__PURE__ */ new Map();
2074
- const link = (key, index, open) => {
2072
+ const link = (key, index, open2) => {
2075
2073
  const previous = links.get(key);
2076
2074
  links.set(key, {
2077
2075
  first: previous?.first ?? index,
2078
2076
  last: index,
2079
- open: open ?? previous?.open ?? false
2077
+ open: open2 ?? previous?.open ?? false
2080
2078
  });
2081
2079
  };
2082
2080
  for (const [index, message] of messages.entries()) {
@@ -2105,8 +2103,8 @@ function replacementRange(messages, keepLastMessages) {
2105
2103
  }
2106
2104
  }
2107
2105
  const crossings = new Int32Array(messages.length + 1);
2108
- for (const { first, last, open } of links.values()) {
2109
- if (open) limit = Math.min(limit, first);
2106
+ for (const { first, last, open: open2 } of links.values()) {
2107
+ if (open2) limit = Math.min(limit, first);
2110
2108
  crossings[first + 1]++;
2111
2109
  crossings[last + 1]--;
2112
2110
  }
@@ -2197,7 +2195,7 @@ ${options.instructions}` : SUMMARY_PROMPT,
2197
2195
  abortSignal
2198
2196
  });
2199
2197
  abortSignal?.throwIfAborted();
2200
- const usage = generated.totalUsage;
2198
+ const { usage } = generated;
2201
2199
  if (generated.finishReason !== "stop" || generated.content.some(
2202
2200
  (part) => part.type !== "text" && part.type !== "reasoning"
2203
2201
  )) {
@@ -2779,6 +2777,7 @@ var AgentTurnExecutor = class {
2779
2777
  chatId: turn.chatId,
2780
2778
  userId: turn.userId
2781
2779
  });
2780
+ await using _turnSandbox = sandbox.sandbox;
2782
2781
  const agentSkills = await this.#skillsFor(
2783
2782
  turn,
2784
2783
  declaration.name,
@@ -2814,6 +2813,7 @@ var AgentTurnExecutor = class {
2814
2813
  reasoning: declaration.reasoning,
2815
2814
  maxOutputTokens: declaration.maxOutputTokens,
2816
2815
  timeout: declaration.timeout,
2816
+ stopWhen: declaration.stopWhen,
2817
2817
  toolCallConcurrency: declaration.toolCallConcurrency,
2818
2818
  experimental_toolApprovalSecret: declaration.experimental_toolApprovalSecret,
2819
2819
  sandbox,