npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-patchouli-agent-loop

v0.1.5

Published

Official DeepSeek Harness Agent Loop adapter for Patchouli

Readme

dsh-patchouli-agent-loop

Cordis plugin adapting the official DeepSeek Harness Agent Loop to the in-process ctx.patchouli service. It owns the model tools and Agent Loop hooks; it does not implement memory storage, indexing, extraction, or prompt generation. Hook payloads are lossless JSON snapshots interpreted by registered MemoryPlugins.

The default Patchouli DSH bundle loads this package automatically.

retrieve:
  sessionStart: false
  preStep: true
  turnStopping: false
  toolPostExecute: false
store:
  agentCreated: false
  agentDisposed: false
  requestError: false
  agentError: false
  turnEnd: true
  toolResult: false
modelTools:
  retrieve: true
  update: true

| Direction | Data point | Delivery | | --- | --- | --- | | retrieve | agent/session-start | Best-effort agent.inject() because the official event is not awaited | | retrieve | agent/pre-step | Awaited; recall JSON is appended to accepted step messages | | retrieve | agent/turn-stopping | Awaited; recall JSON is passed to agent.inject() | | retrieve | tools/post-execute | Awaited; recall JSON is appended to additionalContexts | | update | agent/created | Per-Session update queue | | update | agent/disposed | Per-Session update queue | | update | agent/request-error | Per-Session update queue, without changing retry policy | | update | agent/error | Per-Session update queue | | update | session/turn-end | Complete durable turn event slice; enabled by default | | update | tools/result | Frozen final Tool execution and result |

All calls use { meta, data }. meta.attributes.point identifies the row, while data contains only facts visible at that point. Updates are serialized per Session, and the adapter extends session/flush to wait for admitted update work.

session/turn-end is deferred until ctx.sessions.flush(session) completes, then the completed turn is read back through ctx.sessionPersistence starting at its turn/start sequence. data.events therefore contains the exact durable turn slice without replaying cumulative Session history. Other observations include the Session header but omit session.events unless a hook explicitly supplies a bounded event slice. The connector requires the official sessionPersistence service for this boundary.

The memory_retrieve Tool accepts an optional open JSON metadata object and forwards it unchanged as data.metadata for plugin-defined filtering.

The memory_update Tool accepts optional messages and resources; at least one must be present. A resource is a JSON request for a workspace file, not its bytes:

{
  "resources": [{
    "kind": "workspace-file",
    "path": "docs/design.pdf",
    "mediaType": "application/pdf",
    "role": "source"
  }]
}

The Agent Loop adapter never reads that path. The separate Artifact Ingestor validates it against the Session workspace through ctx.fs and transfers its bytes through the default Patchouli storage service. Image content blocks already carry durable DSH attachment references and need no model-supplied resource.