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

@cuylabs/agent-foundry-agentserver-responses

v5.6.1

Published

TypeScript Foundry Agent Server Responses-protocol host (mirrors azure-ai-agentserver-responses)

Readme

@cuylabs/agent-foundry-agentserver-responses

TypeScript host for the Foundry Hosted Agents Responses protocol.

This package mirrors Python azure-ai-agentserver-responses: it plugs into @cuylabs/agent-foundry-agentserver-core and adds the Responses protocol HTTP surface: create, stream with SSE, cancel, delete, replay, and input-item listing.

Docs

The quick start stays in this README. Deeper package docs live in docs/:

| Document | Purpose | | --- | --- | | docs/hosting.md | Express lifecycle, route layout, execution, and tracing | | docs/store.md | Foundry storage, in-memory storage, stream replay, and custom providers | | docs/protocol.md | Endpoint behavior, modes, IDs, validation, and OpenAPI | | docs/agent-core-bridge.md | How agent-foundry-hosting/responses adapts agent-core turns | | docs/python-parity.md | Current parity against Python, TypeSpec, and production-readiness gaps |

Example samples live in samples/.

Public subpath exports are available for the same conceptual areas as the Python package:

import { FoundryStorageProvider } from "@cuylabs/agent-foundry-agentserver-responses/store";
import { TextResponse } from "@cuylabs/agent-foundry-agentserver-responses/streaming";
import {
  ResponseContext,
  TextResponse,
  runResponsesServer,
  type CreateResponse,
} from "@cuylabs/agent-foundry-agentserver-responses";

await runResponsesServer({
  port: 8088,
  async handler(request: CreateResponse, context: ResponseContext) {
    const text = await context.getInputText();
    return new TextResponse(context, request, {
      text: `Echo: ${text}`,
    });
  },
});

Durable Storage

Durable storage is the persistence layer behind the Responses protocol. The host process can always keep response state in memory, but that state is lost when the container restarts and it cannot be shared across replicas. A durable provider stores the response snapshot, the resolved input items, history item IDs, and item lookup records in Foundry storage so GET /responses/{id}, GET /responses/{id}/input_items, and future turns using previous_response_id keep working outside the current Node.js process.

For local development, InMemoryResponseProvider is still the default. In a hosted Foundry environment, pass FoundryStorageProvider explicitly:

import { DefaultAzureCredential } from "@azure/identity";
import { runResponsesServer } from "@cuylabs/agent-foundry-agentserver-responses";
import {
  FoundryStorageProvider,
} from "@cuylabs/agent-foundry-agentserver-responses/store";

await runResponsesServer({
  handler,
  store: new FoundryStorageProvider({
    credential: new DefaultAzureCredential(),
  }),
});

The storage provider follows the Python SDK storage API shape: POST /storage/responses, GET/POST/DELETE /storage/responses/{id}, GET /storage/responses/{id}/input_items, POST /storage/items/batch/retrieve, and GET /storage/history/item_ids. Stream replay is a separate provider capability; when a durable provider does not implement stream replay, the host uses in-process replay storage.

Schema Models

The Python package has generated model classes from the Responses OpenAPI schema. This TypeScript package now exposes the protocol-level model surface as strong structural types (CreateResponse, ResponseObject, OutputItem, ResponseStreamEvent) plus runtime validation for the hosted-agent semantics that matter at the server boundary, such as background=true requiring store=true, stream_options requiring stream=true, metadata limits, ID format validation, and cursor pagination. The long-term direction should be to replace or augment these structural types with generated TypeScript models from the same OpenAPI source, while preserving the handler/provider interfaces in this package.

Endpoints

| Method | Route | Description | | --- | --- | --- | | POST | /responses | Create a response | | GET | /responses/{response_id} | Retrieve a response snapshot, or SSE replay with ?stream=true | | POST | /responses/{response_id}/cancel | Cancel a background response | | DELETE | /responses/{response_id} | Delete a stored response | | GET | /responses/{response_id}/input_items | List input items |

Layering

This package is protocol-level and agent-agnostic. Use @cuylabs/agent-foundry-hosting/responses to bridge @cuylabs/agent-core or @cuylabs/agent-server into this protocol package, matching the existing Invocations split.