@deepagents/context 5.0.0 → 6.0.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
@@ -322,8 +322,10 @@ describe already persisted calls.
322
322
  import {
323
323
  anyToolCalled,
324
324
  elapsedExceeds,
325
+ everyNToolCalls,
325
326
  everyOfLastN,
326
327
  not,
328
+ plan,
327
329
  reminder,
328
330
  toolCalled,
329
331
  toolOutput,
@@ -353,12 +355,29 @@ engine.set(
353
355
  );
354
356
  ```
355
357
 
356
- Other exported helpers include `toolCallCount(...)`,
358
+ Other exported helpers include `everyNToolCalls(...)`, `toolCallCount(...)`,
357
359
  `lastAssistantLength(...)`, `withinLastN(...)`, `everyOfLastN(...)`, and
358
360
  `elapsedExceeds(...)`. See the
359
361
  [Predicates](https://januarylabs.github.io/deepagents/docs/context/predicates)
360
362
  page for the full catalog.
361
363
 
364
+ ### Plan Recitation
365
+
366
+ `plan.instructions()` teaches a sandbox-backed agent to maintain its
367
+ authoritative plan at `/workspace/.deepagents/plan.json`. `plan.review(...)`
368
+ composes a steer reminder that reads and validates that plan when the predicate
369
+ fires, then recites the compact plan projection and asks whether the plan is
370
+ still valid given the latest evidence.
371
+
372
+ ```ts
373
+ engine.set(
374
+ plan.instructions(),
375
+ plan.review({
376
+ when: everyNToolCalls(5),
377
+ }),
378
+ );
379
+ ```
380
+
362
381
  - `stripTextByRanges(text, ranges)` removes offset spans from text and returns the remaining visible content.
363
382
  - `stripReminders(message)` strips inline/part reminders and model-only synthetic reminder payloads from a `UIMessage`.
364
383
  - `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;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uCAAuC,CAAC;AACtD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gB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