@deepagents/context 7.5.2 → 7.7.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 (60) hide show
  1. package/README.md +12 -10
  2. package/dist/index.js +1409 -1807
  3. package/dist/index.js.map +4 -4
  4. package/dist/lib/agent.d.ts +21 -21
  5. package/dist/lib/agent.d.ts.map +1 -1
  6. package/dist/lib/fragments/plan-shared.d.ts.map +1 -1
  7. package/dist/lib/sandbox/apple-container-sandbox.d.ts +2 -2
  8. package/dist/lib/sandbox/apple-container-sandbox.d.ts.map +1 -1
  9. package/dist/lib/sandbox/bash-tool.d.ts +2 -4
  10. package/dist/lib/sandbox/bash-tool.d.ts.map +1 -1
  11. package/dist/lib/sandbox/container-engine.d.ts +53 -27
  12. package/dist/lib/sandbox/container-engine.d.ts.map +1 -1
  13. package/dist/lib/sandbox/container-sandbox.d.ts +6 -3
  14. package/dist/lib/sandbox/container-sandbox.d.ts.map +1 -1
  15. package/dist/lib/sandbox/container-session.d.ts +19 -0
  16. package/dist/lib/sandbox/container-session.d.ts.map +1 -0
  17. package/dist/lib/sandbox/daytona-sandbox.d.ts +39 -48
  18. package/dist/lib/sandbox/daytona-sandbox.d.ts.map +1 -1
  19. package/dist/lib/sandbox/docker-sandbox.d.ts +31 -131
  20. package/dist/lib/sandbox/docker-sandbox.d.ts.map +1 -1
  21. package/dist/lib/sandbox/index.d.ts +0 -1
  22. package/dist/lib/sandbox/index.d.ts.map +1 -1
  23. package/dist/lib/sandbox/microsandbox-sandbox.d.ts +6 -13
  24. package/dist/lib/sandbox/microsandbox-sandbox.d.ts.map +1 -1
  25. package/dist/lib/sandbox/read-file-tool/index.d.ts +2 -2
  26. package/dist/lib/sandbox/read-file-tool/index.d.ts.map +1 -1
  27. package/dist/lib/sandbox/read-file-tool/text.d.ts.map +1 -1
  28. package/dist/lib/sandbox/session.d.ts +40 -0
  29. package/dist/lib/sandbox/session.d.ts.map +1 -0
  30. package/dist/lib/sandbox/strace/file-changes.d.ts +20 -14
  31. package/dist/lib/sandbox/strace/file-changes.d.ts.map +1 -1
  32. package/dist/lib/sandbox/strace/index.d.ts +1 -1
  33. package/dist/lib/sandbox/strace/index.d.ts.map +1 -1
  34. package/dist/lib/sandbox/strace/index.js +7 -6
  35. package/dist/lib/sandbox/strace/index.js.map +2 -2
  36. package/dist/lib/sandbox/types.d.ts +38 -78
  37. package/dist/lib/sandbox/types.d.ts.map +1 -1
  38. package/dist/lib/sandbox/virtual-sandbox.d.ts +3 -3
  39. package/dist/lib/sandbox/virtual-sandbox.d.ts.map +1 -1
  40. package/dist/lib/telemetry/console-telemetry.d.ts +7 -1
  41. package/dist/lib/telemetry/console-telemetry.d.ts.map +1 -1
  42. package/dist/lib/telemetry/file/file-telemetry.d.ts +6 -0
  43. package/dist/lib/telemetry/file/file-telemetry.d.ts.map +1 -1
  44. package/dist/lib/telemetry/file/index.js +18 -12
  45. package/dist/lib/telemetry/file/index.js.map +2 -2
  46. package/dist/lib/telemetry/index.js +10 -6
  47. package/dist/lib/telemetry/index.js.map +2 -2
  48. package/dist/lib/telemetry/safe-serialize.d.ts +1 -1
  49. package/dist/lib/telemetry/safe-serialize.d.ts.map +1 -1
  50. package/dist/lib/tracing/batch-processor.d.ts +7 -1
  51. package/dist/lib/tracing/batch-processor.d.ts.map +1 -1
  52. package/dist/lib/tracing/index.js +24 -16
  53. package/dist/lib/tracing/index.js.map +2 -2
  54. package/dist/lib/tracing/openai-traces-integration.d.ts +9 -3
  55. package/dist/lib/tracing/openai-traces-integration.d.ts.map +1 -1
  56. package/package.json +23 -19
  57. package/dist/lib/sandbox/cli-process.d.ts +0 -35
  58. package/dist/lib/sandbox/cli-process.d.ts.map +0 -1
  59. package/dist/lib/sandbox/read-file.d.ts +0 -9
  60. package/dist/lib/sandbox/read-file.d.ts.map +0 -1
package/README.md CHANGED
@@ -29,7 +29,7 @@ The server-side package also ships the sandbox primitives used by
29
29
  `@deepagents/text2sql` and other tool-driven agents. Use `createBashTool()`
30
30
  with `createVirtualSandbox()`, `createDockerSandbox()`,
31
31
  `createAppleContainerSandbox()`, `createMicrosandboxSandbox()`, or
32
- `createDaytonaSandbox(client, options)` depending on whether commands should
32
+ `createDaytonaSandbox(daytona.v2, options)` depending on whether commands should
33
33
  run in memory, Docker, Apple Container lightweight VMs, Microsandbox microVMs,
34
34
  or managed Daytona sandboxes.
35
35
  Virtual sandboxes can opt into in-process JavaScript execution with
@@ -46,23 +46,25 @@ For same-host Linux Docker daemons, `gcs({ hostPath, mountPath })` provides a
46
46
  typed bind-volume helper over a host `gcsfuse` mount. For remote daemons, keep
47
47
  cloud wiring in the daemon/plugin layer and attach the resulting named volume.
48
48
 
49
- `createDaytonaSandbox(client, options)` takes a caller-owned Daytona client plus either a
50
- stable `name` (get-or-create) or `sandboxId` (attach). One of those identifiers
51
- is required because `dispose()` releases only the local wrapper and never
52
- deletes the underlying Daytona sandbox.
49
+ `createDaytonaSandbox(daytona.v2, options)` takes a Daytona v2 client plus either
50
+ `sandboxId` (attach) or the SDK's own create options, where a `name` makes the
51
+ create a get-or-create. `dispose()` deletes a sandbox it created and leaves one
52
+ it attached to.
53
53
 
54
54
  ### File-change tracking
55
55
 
56
56
  `withStraceFileChanges()` decorates a real sandbox backend so each command,
57
- spawn, or file write reports the mutations it caused as a `FileChange[]`
57
+ spawn, file write, or file delete reports the mutations it caused as a `FileChange[]`
58
58
  (`{ op: 'write' | 'delete' | 'rename'; path; from?; timestamp }`).
59
- Consume changes via the `onFileChanges` callback (fires per command, spawn, or
60
- `writeFiles` call). Bash tool calls also receive
59
+ Consume changes via the `onFileChanges` callback (fires per command, spawn, file
60
+ write, or `deleteFile` that removed a file). Bash tool calls also receive
61
61
  `tool-result.output.meta.fileChanges` as hidden host-only metadata.
62
62
 
63
63
  Scope which paths are reported with `include` glob patterns (required — a path
64
64
  must match at least one); drop noise such as uploaded skills with optional
65
65
  `exclude` patterns. Both match absolute paths via Node's `path.matchesGlob`.
66
+ `createBashTool()` creates its working directory and uploads its files through the
67
+ decorator, so a callback that must not see that setup excludes those paths.
66
68
 
67
69
  ```ts
68
70
  const backend = await createDockerSandbox({ image: 'my-image-with-strace' });
@@ -74,11 +76,11 @@ const tracked = await withStraceFileChanges(backend, {
74
76
  });
75
77
  const sandbox = await createBashTool({
76
78
  sandbox: tracked,
77
- destination: '/workspace',
79
+ workingDirectory: '/workspace',
78
80
  });
79
81
  ```
80
82
 
81
- Tracking uses `strace` (per `executeCommand` and per `spawn`) when you compose
83
+ Tracking uses `strace` (per `run` and per `spawn`) when you compose
82
84
  the `withStraceFileChanges()` decorator. The decorator itself does **no**
83
85
  self-test — it trusts that strace tracing works in the sandbox, because "strace
84
86
  works here" is an invariant of the (image + host kernel + seccomp/caps) that is