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

@geometra/gateway

v1.61.3

Published

HTTP transport for Geometra agent-safe workflow gateways

Downloads

453

Readme

@geometra/gateway

HTTP and tool adapters for Geometra's agent-safe workflow gateway.

The package wraps a core AgentGateway with:

  • GET /inspect, GET /actions, POST /actions/request, POST /actions/approve
  • GET /trace, GET /replay, GET /frame
  • tenant-scoped API keys with read/request/approve/admin scopes
  • file or memory replay stores
  • MCP-style tool adapter functions

Core policy, stale-frame checks, approvals, redaction, trace, and replay remain in @geometra/core.

HTTP Surface

| Endpoint | Scope | Purpose | | --- | --- | --- | | GET /health | none | Liveness check. | | GET /inspect | read | Return the latest frame, semantic geometry, action catalog, and pending approvals. | | GET /frame | read | Return the latest frame snapshot. | | GET /actions | read | Return available action contracts and pending approvals. | | POST /actions/request | request | Request an action by actionId and optional frameId. | | POST /actions/approve | approve | Approve or deny a pending action. | | GET /trace | read | Return append-only request/approval/completion events. | | GET /replay | read | Return replay frames and action outcomes; accepts ?sessionId= when backed by a replay store. |

The OpenAPI description for this HTTP surface is maintained in openapi.json.

Minimal Example

import { createAgentGateway } from '@geometra/core'
import { createAgentGatewayHttpServer } from '@geometra/gateway'

const gateway = createAgentGateway({
  sessionId: 'claims-review',
  execute: ({ target }) => ({ ok: true, actionId: target.id }),
})

// Call gateway.setFrame(tree, layout, { route: 'claims-review' }) after rendering.
const server = await createAgentGatewayHttpServer({ gateway })
console.log(server.url)

External agents should start with GET /inspect, request actions with the returned frame.id, and read GET /replay after completion to preserve the "what the agent saw and clicked" proof.

Auth, Sessions, And Retention

Use auth.apiKeys when exposing the gateway outside a trusted local process:

await createAgentGatewayHttpServer({
  gateway,
  auth: {
    apiKeys: {
      'reader-key': { tenantId: 'acme', subject: 'auditor', scopes: ['read'] },
      'agent-key': { tenantId: 'acme', subject: 'claims-agent', scopes: ['read', 'request'] },
      'manager-key': { tenantId: 'acme', subject: 'ops-manager', scopes: ['read', 'approve'] },
    },
  },
})

For replay retention, pass a replay store:

import { FileAgentGatewayReplayStore } from '@geometra/gateway'

const replayStore = new FileAgentGatewayReplayStore({ directory: './replays' })
await createAgentGatewayHttpServer({ gateway, replayStore })

For sensitive workflows, redact before trace/replay persistence:

const gateway = createAgentGateway({
  sessionId: 'claims-review',
  redact: (value, context) => context.field === 'input' ? '[redacted input]' : value,
})

Approval webhooks can be wired directly through core gateway hooks:

const gateway = createAgentGateway({
  sessionId: 'claims-review',
  onApprovalRequired: approval => {
    void fetch('https://workflow.example/approvals', {
      method: 'POST',
      body: JSON.stringify(approval),
    })
  },
  onActionResult: result => {
    console.log('gateway result', result.status, result.actionId)
  },
})

Use onApprovalRequired to notify Slack, PagerDuty, a claims supervisor queue, or an internal workflow engine. Use onActionResult to mirror completed, denied, or failed outcomes into your audit warehouse.