@deepagents/context 0.37.1 → 0.38.1

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
@@ -185,7 +185,7 @@ Builder functions for user-specific context:
185
185
  - Tagged encoding: `<system-reminder>...</system-reminder>`
186
186
  - Appended to the end of message text or parts
187
187
 
188
- `reminder(..., { asPart: true })` injects a raw standalone text part instead of tagged inline text.
188
+ Part mode (`asPart` set to true) injects a raw standalone text part instead of tagged inline text.
189
189
 
190
190
  When reminders are present, `user(...)` appends metadata to `message.metadata.reminders`:
191
191
 
package/dist/browser.js CHANGED
@@ -40,6 +40,12 @@ function assistant(message2) {
40
40
  }
41
41
  };
42
42
  }
43
+ function toMessageFragment(item) {
44
+ if (isFragment(item) && isMessageFragment(item)) {
45
+ return item;
46
+ }
47
+ return message(item);
48
+ }
43
49
  function message(content) {
44
50
  const message2 = typeof content === "string" ? {
45
51
  id: generateId(),
@@ -1967,7 +1973,7 @@ function reminder(textOrFragment, options) {
1967
1973
  if (typeof text === "string") {
1968
1974
  assertReminderText(text);
1969
1975
  }
1970
- const asPart = options?.asPart ?? fromFragment2;
1976
+ const asPart = options?.asPart ?? false;
1971
1977
  if (options && "when" in options && options.when) {
1972
1978
  return {
1973
1979
  name: "reminder",
@@ -2256,6 +2262,7 @@ export {
2256
2262
  styleGuide,
2257
2263
  term,
2258
2264
  toFragment,
2265
+ toMessageFragment,
2259
2266
  user,
2260
2267
  visualizeGraph,
2261
2268
  workflow