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

@civaapple/qi-capability

v0.5.1

Published

Default-deny Qi capability leases, credentials, delegation, and redaction

Readme

@civaapple/qi-capability

Default-deny capability leases, narrowed delegation, policy traces, and opaque credential handles.

Purpose

This package decides whether a specific subject may perform a described effect on bounded resources for a particular intent and time. It makes authority visible, expiring, countable, and delegable only by narrowing.

Non-goals

  • Tool schemas and discovery do not grant capabilities.
  • The broker never executes tools or exposes raw credentials to model context.
  • A child Agent cannot infer or widen parent authority.

Core model

An ActionIntent is checked against a CapabilityLease covering subject, effects, resources, lifetime, and use limits. Optional frozen Run mode (ask / plan / agent) may only narrow matches via mode-policy (ADR 0011); it never invents authority beyond leases. Delegation intersects the requested child scope with the parent. CredentialHandle binds secret access to subject and intent while the secret stays behind the broker.

redactSensitiveText() and redactSensitiveValue() provide the deterministic last-resort boundary for secret material discovered outside the broker, such as plaintext repository configuration. They return only sanitized values and category/count summaries; matched material is never included in metadata.

Behavioral invariants

  • Deny by default when no current lease matches the complete intent.
  • Mode policy denies Ask/Plan-forbidden tools and effects even when a broader launch lease exists.
  • Lease expiry and use limits are enforced independently of tool validation.
  • Delegation only narrows scope and emits an inspectable policy trace.
  • Credential material is not serialized into Session, context, or tool catalogs.
  • High-confidence credential assignments, authorization values, provider tokens, URL credentials, and private keys are redacted before provider reuse or durable persistence.

Failure semantics

Authorization returns a structured allow or deny decision. Callers persist denials as outcomes and must not enter an executor. Missing, expired, exhausted, or mismatched leases remain distinguishable in policy evidence.

Install and minimal use

npm install @civaapple/qi-capability
import { InMemoryCapabilityBroker } from "@civaapple/qi-capability";

const broker = new InMemoryCapabilityBroker();
const decision = await broker.authorize({
  actionId: "act_example",
  subject: "main-agent",
  tool: "read",
  effect: "read",
  resources: ["workspace:file:README.md"],
});
// decision.outcome is "denied" until an explicit matching lease is granted.

Public API

CapabilityBroker, InMemoryCapabilityBroker, lease and intent types, delegation types, InMemoryCredentialBroker (including withCredential), EncryptedFileCredentialStore, and deterministic redaction utilities.

Change guide

New effect classes or resource matching rules require denial tests, delegation monotonicity tests, and updates to tool and coordinator integration. Never make authorization depend only on a tool name.

Verification

Use tests/tools-capability.test.mjs, tests/workspace-safety.test.mjs, and tests/coordinator.test.mjs.

Further reading