← Catalog

@agimon-ai/po-cache

Provider prompt cache policy and deterministic routing for Po

Extension

Install

Install with PiG

pig install npm:@agimon-ai/po-cache

Install with Pi

pi install npm:@agimon-ai/po-cache
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

README

Written by the package's publisher, shown as published in version 0.0.0-alpha.197 (README.md). PiG does not review it.

@agimon-ai/po-cache

Provider prompt-cache policy and deterministic routing for Po.

Po loads this package as fixed core. It derives stable provider cache keys from the active session composition and applies them only to supported provider requests.

Alpha: cache routing and provider integration may change between releases.

Requirements

  • Node.js 24 or newer

Install

A Po installation already includes this package. Do not add it to .po/presets.yaml.

Package behavior

Po derives an opaque provider cache key from stable model-visible state: the composition fingerprint, ordered domains, profile, persona, active modes, effective model, and child prompt projection. Returning to equivalent state restores the same key. Provider expiry or eviction can still make the cache cold.

The native session contribution rewrites only a nonblank cache key already emitted for an allowlisted OpenAI-family wire API. It preserves supported retention and provider cache markers, does not add unsupported fields to proxies, and reports only provider-observed token usage. Telemetry reports current provider residency as unknown.

Help

The published package includes llms.txt and src/prompts/po-use-cache/SKILL.md. While Po Help is active, the extension adds po-use-cache to the live Help catalog. The contribution follows Help provider replacement and is removed when the extension shuts down.

Development

pnpm build
pnpm typecheck
pnpm test
pnpm lint
npm pack --dry-run

Repository agents run architectural checks through the lint code-mode namespace.

The live OpenAI canary is opt-in. It reports provider cached_tokens; a cold result does not fail the test deterministically:

PO_CACHE_LIVE_OPENAI=1 \
OPENAI_API_KEY=... \
PO_CACHE_LIVE_OPENAI_MODEL=... \
pnpm exec vitest run tests/live/openaiPromptCache.live.test.ts

Maintained by Agimon.

License

MIT. See LICENSE.