Commit Graph

36 Commits

Author SHA1 Message Date
github-actions[bot] 41f1e38f65 chore: version packages (#164)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-02 22:40:11 -08:00
Christian Bromann 90ade665a3 fix(deepagents): fix type issues (#174)
* fix(deepagents): fix type issues

* fix types

* minor tweak
2026-02-02 22:35:00 -08:00
Christian Bromann 7038d247a8 fix(deepagents): resolve dangling tool_call_id when rejecting parallel tool calls (#173)
* fix(deepagents): resolve dangling tool_call_id when rejecting parallel tool calls

* type improvements

* format
2026-02-02 21:41:32 -08:00
Christian Bromann dff8977d20 fix(deepagents): remove obsolete import 2026-02-02 21:15:52 -08:00
Maahir Sachdev e4f9f8d8c8 fix: missing files in skillsMiddleware schema (#160)
* fix missing files in skillsMiddleware

* Update tests

* Add integration tests + fixes

* Restore skills.test.ts from main

* Update tests to unit from integration

* Update unit tests

* fix test

* changeset
2026-02-02 21:11:51 -08:00
Christian Bromann c674c619cd fix(deepagents): prevent infinite loop when read_file returns large content (#172)
* fix(deepagents): prevent infinite loop when read_file returns large content (#82)

When a tool returned a large result with few but very long lines, the
agent could enter an infinite eviction/read loop. The content would be
evicted to the filesystem, then read_file would return all the content
(since it only had a line limit, not a character limit), which would
again exceed the eviction threshold.

fixes #82

* export FileData from right place

* add changesets
2026-02-02 21:10:56 -08:00
Christian Bromann 52675bd939 fix(deepagents): handle empty oldString in performStringReplacement (#170)
* fix: handle empty oldString in performStringReplacement (#161)

When both file content and oldString are empty, `content.split("")`
returns an empty array, causing `occurrences` to be -1 and returning
an invalid success response.

This change:
- Adds special case handling for empty files: when both content and
  oldString are empty, treat it as "set initial content" and return
  [newString, 0]
- Returns a clear error when oldString is empty but file has content
- Adds comprehensive tests for empty oldString scenarios

This allows users to edit empty files by passing oldString="" with
their desired content, while preventing ambiguous empty replacements
on non-empty files.

fixes #161

* retrigger
2026-02-02 21:08:30 -08:00
Christian Bromann e6d895bdf9 fix(middleware): avoid unnecessary REMOVE_ALL_MESSAGES in PatchToolCallsMiddleware (#169)
* fix(middleware): avoid unnecessary REMOVE_ALL_MESSAGES in PatchToolCallsMiddleware

The middleware was unconditionally triggering REMOVE_ALL_MESSAGES on every
request, even when there were no dangling tool calls to patch. This caused
unnecessary frontend re-renders and UI flickering when using useStream with
fetchStateHistory: true.

Added a needsPatch flag to track whether any dangling tool calls are found,
and only trigger the state rebuild when patching is actually needed.

Fixes #127

* retrigger

* fix test

* add changeset
2026-02-02 21:08:12 -08:00
Maahir Sachdev 0fe09a51de fix: missing files/memoryContents in memory middleware (#159)
* Update memory state schmea

* Update tests

* Update testing

* changeset

* Update libs/deepagents/src/middleware/memory.test.ts

* Update libs/deepagents/src/middleware/memory.test.ts

* Update libs/deepagents/src/middleware/memory.test.ts

* Update libs/deepagents/src/middleware/memory.test.ts

* Update libs/deepagents/src/middleware/memory.test.ts

* Update libs/deepagents/src/middleware/memory.test.ts

---------

Co-authored-by: Christian Bromann <git@bromann.dev>
2026-02-02 20:07:59 -08:00
Youngho Kim 0ef8362f80 test(deepagents): add unit tests for createPatchToolCallsMiddleware (#168) 2026-02-02 10:28:37 -08:00
Christian Bromann 0b65b09864 fix(deepagents): copy LICENSE file into published package 2026-02-01 19:14:00 -08:00
dependabot[bot] 9acbdca34d build(deps-dev): bump the minor-deps-updates-main group across 1 directory with 5 updates (#152)
Bumps the minor-deps-updates-main group with 5 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [globals](https://github.com/sindresorhus/globals) | `17.0.0` | `17.2.0` |
| [prettier](https://github.com/prettier/prettier) | `3.7.4` | `3.8.1` |
| [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) | `8.53.1` | `8.54.0` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `25.0.10` | `25.1.0` |
| [tsdown](https://github.com/rolldown/tsdown) | `0.19.0` | `0.20.1` |



Updates `globals` from 17.0.0 to 17.2.0
- [Release notes](https://github.com/sindresorhus/globals/releases)
- [Commits](https://github.com/sindresorhus/globals/compare/v17.0.0...v17.2.0)

Updates `prettier` from 3.7.4 to 3.8.1
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.7.4...3.8.1)

Updates `typescript-eslint` from 8.53.1 to 8.54.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.54.0/packages/typescript-eslint)

Updates `@types/node` from 25.0.10 to 25.1.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `tsdown` from 0.19.0 to 0.20.1
- [Release notes](https://github.com/rolldown/tsdown/releases)
- [Commits](https://github.com/rolldown/tsdown/compare/v0.19.0...v0.20.1)

---
updated-dependencies:
- dependency-name: globals
  dependency-version: 17.2.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-deps-updates-main
- dependency-name: prettier
  dependency-version: 3.8.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-deps-updates-main
- dependency-name: typescript-eslint
  dependency-version: 8.54.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-deps-updates-main
- dependency-name: "@types/node"
  dependency-version: 25.1.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-deps-updates-main
- dependency-name: tsdown
  dependency-version: 0.20.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-deps-updates-main
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-30 09:31:08 -08:00
github-actions[bot] fa41f08580 chore: version packages (#151)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-28 10:55:12 -08:00
Christian Bromann 8a92e572ea fix(deepagents): use new StateSchema class (#145)
* fix(deepagents): use new StateSchema class

* format

* fix bundling

* run unit tests also in windows

* revert

* fix windows test issue

* bump lc

* bump lc

* path normalization
2026-01-28 10:52:38 -08:00
github-actions[bot] eb79cdc1e7 chore: version packages (#140)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-23 13:24:49 -08:00
Christian Bromann ef821a7d7b feat(deepagents): align JS implementation with Python deepagents (#139)
* feat(deepagents): align JS implementation with Python deepagents

This commit addresses divergences between the JavaScript and Python
implementations of the deepagents library, porting several features
from Python and adding comprehensive test coverage.

Changes:

Deprecation:
- Mark `createAgentMemoryMiddleware` as deprecated in favor of
  `createMemoryMiddleware` which uses BackendProtocol abstraction

Filesystem middleware (fs.ts):
- Port comprehensive tool descriptions from Python's filesystem.py
- Add TOOLS_EXCLUDED_FROM_EVICTION constant for eviction control
- Add NUM_CHARS_PER_TOKEN constant for token estimation
- Add createContentPreview() for showing head/tail of large results
- Update eviction logic to skip excluded tools and show content preview

Path validation (backends/utils.ts):
- Add validateFilePath() with security checks for path traversal
- Reject Windows absolute paths and tilde expansion
- Support allowedPrefixes validation

Skills middleware (skills.ts):
- Show "(higher priority)" indicator for last source in locations
- Display allowedTools in skill list when specified

Summarization middleware (summarization.ts):
- Port SummarizationMiddleware from Python with backend offloading
- Support conversation history persistence to filesystem
- Add tool argument truncation for old messages
- Re-export base summarizationMiddleware from langchain

Middleware utilities (utils.ts):
- Add appendToSystemMessage() helper
- Add prependToSystemMessage() helper

* format

* fix test
2026-01-23 13:22:31 -08:00
github-actions[bot] 5596fa1e68 chore: version packages (#135)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-22 13:25:31 -08:00
Christian Bromann 0fa85f6169 chore(deepagents): update deps and re-establish old interfaces (#133)
* chore(deepagents): update deps

* add changeset

* re-estebalish old interfaces

* format

* skip new integration test for now
2026-01-22 13:20:07 -08:00
github-actions[bot] de2b4f1bec chore: version packages (#126)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-16 12:53:36 -08:00
Christian Bromann 06a2631b9e fix(deepagents): align with Python interfaces (#125)
* fix(deepagents): align with Python interfaces

* fix test

* cr

* add changelog
2026-01-16 12:46:10 -08:00
Christian Bromann 67018b2443 fix(deepagents): port backend agnostic skills (#124)
* fix(deepagents): port backend agnostic skills

* update test
2026-01-16 10:58:05 -08:00
Christian Bromann c648cd67b5 feat(deepagents): add MemoryMiddleware for AGENTS.md support (#123)
* feat(deepagents): add MemoryMiddleware for AGENTS.md support

Port of langchain-ai/deepagents#646 to TypeScript.

Adds MemoryMiddleware that loads persistent context from AGENTS.md files
following the agents.md specification. Unlike skills (which are on-demand),
memory is always loaded at agent startup and injected into the system prompt.

Changes:
- Add createMemoryMiddleware in middleware/memory.ts
- Add `memory` parameter to createDeepAgent for automatic middleware setup
- Export MemoryMiddleware from package index
- Add unit tests for memory loading and prompt injection

Usage:
const agent = createDeepAgent({
  memory: [
    "~/.deepagents/AGENTS.md",
    "./.deepagents/AGENTS.md",
  ],
});

* add example
2026-01-16 10:53:39 -08:00
github-actions[bot] bdf9186a14 chore: version packages (#121)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-15 17:19:34 -08:00
Christian Bromann a70b29721e fix(deepagents): define type bag to better type extraction (#113)
* fix(deepagents): define type bag to better type extraction

* remove unnecessary generic param
2026-01-15 17:17:59 -08:00
dependabot[bot] 8740987427 build(deps-dev): bump the major-deps-updates-main group with 2 updates (#117)
Bumps the major-deps-updates-main group with 2 updates: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) and [@types/uuid](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/uuid).


Updates `@types/node` from 22.19.3 to 25.0.7
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `@types/uuid` from 10.0.0 to 11.0.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/uuid)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 25.0.7
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: major-deps-updates-main
- dependency-name: "@types/uuid"
  dependency-version: 11.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: major-deps-updates-main
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-14 14:13:18 -08:00
dependabot[bot] 391a047f99 build(deps-dev): bump the minor-deps-updates-main group with 2 updates (#116)
Bumps the minor-deps-updates-main group with 2 updates: [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) and [tsdown](https://github.com/rolldown/tsdown).


Updates `typescript-eslint` from 8.52.0 to 8.53.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.53.0/packages/typescript-eslint)

Updates `tsdown` from 0.15.12 to 0.19.0
- [Release notes](https://github.com/rolldown/tsdown/releases)
- [Commits](https://github.com/rolldown/tsdown/compare/v0.15.12...v0.19.0)

---
updated-dependencies:
- dependency-name: typescript-eslint
  dependency-version: 8.53.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-deps-updates-main
- dependency-name: tsdown
  dependency-version: 0.19.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-deps-updates-main
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-13 12:39:32 -08:00
github-actions[bot] ddb1b444a5 chore: version packages (#110)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-10 21:23:59 -08:00
Christian Bromann 3e1151dc98 fix(internal): another readme fix (#108) 2026-01-10 21:17:46 -08:00
Christian Bromann 362f9401a6 fix(deepagents): update Readme.md (#107)
* fix(deepagents): update Readme.md

* use image from blog

* update docs link
2026-01-10 21:15:33 -08:00
Christian Bromann 3f5d99887f fix(deepagents): use proper ToolMessage.isInstance (#106) 2026-01-10 21:03:23 -08:00
Christian Bromann 1450d82e74 fix(deepagents): properly merge system prompt with base prompt (#105) 2026-01-10 20:53:22 -08:00
Christian Bromann 5f4f3e2488 fix(deepagents): support SystemMessage as prompt (#104) 2026-01-10 20:44:19 -08:00
Christian Bromann aada8e8c54 fix(deepagents): improve type inference (#103)
* fix(deepagents): properly implement type inferrence

* recognise built-in middleware

* make it a type test
2026-01-10 20:41:00 -08:00
github-actions[bot] 5170cd174f chore: version packages (#100)
* chore: version packages

* Update libs/deepagents/CHANGELOG.md

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Christian Bromann <git@bromann.dev>
2026-01-09 15:49:45 -08:00
Christian Bromann 550866f44f feat: bundle deepagent-cli from deepagents (#99)
* internal: migrate to libs

* release process

* no need of npm tokens

* feat: bundle deepagent-cli from deepagents

* only for mac now

* fix

* fix linter

* tweak

* Potential fix for code scanning alert no. 14: Workflow does not contain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 18: Uncontrolled command line

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* allow console in scripts

* make it experimental

* allow in CLI as well

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-01-09 15:31:10 -08:00
Christian Bromann 321ecf3193 chore: migrate to libs (#98)
* internal: migrate to libs

* format

* update

* format

* codespell

* release process

* format

* update deps

* no need of npm tokens

* fix lock file

* type strictness

* no need for withLangGraph

* format

* fix

* remove withLanggraph

* add changeset
2026-01-09 15:10:42 -08:00