@deepagents/context 5.0.0 → 6.1.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/README.md CHANGED
@@ -32,6 +32,8 @@ with `createVirtualSandbox()`, `createDockerSandbox()`,
32
32
  `createDaytonaSandbox(client, options)`, or `createAgentOsSandbox()` depending
33
33
  on whether commands should run in memory, Docker, Apple Container lightweight
34
34
  VMs, Microsandbox microVMs, managed Daytona sandboxes, or Agent OS.
35
+ Virtual sandboxes can opt into in-process JavaScript execution with
36
+ `createVirtualSandbox({ javascript: true, ... })`.
35
37
 
36
38
  See the docs for the full API surface:
37
39
 
@@ -322,8 +324,10 @@ describe already persisted calls.
322
324
  import {
323
325
  anyToolCalled,
324
326
  elapsedExceeds,
327
+ everyNToolCalls,
325
328
  everyOfLastN,
326
329
  not,
330
+ plan,
327
331
  reminder,
328
332
  toolCalled,
329
333
  toolOutput,
@@ -353,12 +357,29 @@ engine.set(
353
357
  );
354
358
  ```
355
359
 
356
- Other exported helpers include `toolCallCount(...)`,
360
+ Other exported helpers include `everyNToolCalls(...)`, `toolCallCount(...)`,
357
361
  `lastAssistantLength(...)`, `withinLastN(...)`, `everyOfLastN(...)`, and
358
362
  `elapsedExceeds(...)`. See the
359
363
  [Predicates](https://januarylabs.github.io/deepagents/docs/context/predicates)
360
364
  page for the full catalog.
361
365
 
366
+ ### Plan Recitation
367
+
368
+ `plan.instructions()` teaches a sandbox-backed agent to maintain its
369
+ authoritative plan at `/workspace/.deepagents/plan.json`. `plan.review(...)`
370
+ composes a steer reminder that reads and validates that plan when the predicate
371
+ fires, then recites the compact plan projection and asks whether the plan is
372
+ still valid given the latest evidence.
373
+
374
+ ```ts
375
+ engine.set(
376
+ plan.instructions(),
377
+ plan.review({
378
+ when: everyNToolCalls(5),
379
+ }),
380
+ );
381
+ ```
382
+
362
383
  - `stripTextByRanges(text, ranges)` removes offset spans from text and returns the remaining visible content.
363
384
  - `stripReminders(message)` strips inline/part reminders and model-only synthetic reminder payloads from a `UIMessage`.
364
385
  - `isSyntheticReminderMessage(message)` identifies stored model-only reminder carriers so a UI can omit them entirely.
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export * from './lib/estimate.ts';
9
9
  export * from './lib/fragments.ts';
10
10
  export * from './lib/fragments/domain.ts';
11
11
  export * from './lib/fragments/message/user.ts';
12
+ export * from './lib/fragments/plan.ts';
12
13
  export * from './lib/fragments/reminders/index.ts';
13
14
  export * from './lib/fragments/reasoning.ts';
14
15
  export * from './lib/fragments/socratic.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8CAA8C,CAAC;AAC7D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,sCAAsC,CAAC;AACrD,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC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