How udayanirogi/promptcapsule works
PromptCapsule packages prompts as portable inline capsules or vault references, then reconstructs them with integrity checks and optional HMAC verification. The primary workflow is pack, hand off the capsule string, and unpack; long prompts additionally require access to the same vault. The Python convenience API and CLI provide entry points, while the core owns encoding and decoding and invokes the selected storage backend. README capabilities include SQLite, in-memory, GitHub Gist, and S3 backends. Backend and CLI details are based on sampled source; some core implementation sections were omitted.
Main entry points: simple.py pack / unpack · core.py Vault backend contract · cli.py CLI commands · backends.py SQLite backend
Components 15
User interfaces
- pack / unpack
promptcapsule/simple.py - CLI commands
promptcapsule/cli.py
Capsule processing
- Encode / decode
promptcapsule/core.py - HMAC utilities
promptcapsule/integrity.py
Vault storage
- Vault backend contract
promptcapsule/core.py - In-memory backend
promptcapsule/backends.py - SQLite backend
promptcapsule/backends.py - GitHub Gist backend
promptcapsule/backends.py - S3 backend
promptcapsule/backends.py
Other components
- Application or agent
- Capsule string
- SQLite vault file
- GitHub Gist service
- AWS S3 service
- Prompt text
Connections 20
- Application or agent → pack / unpack: calls pack / unpack
- pack / unpack → Encode / decode: compresses / decompresses
- pack / unpack → Vault backend contract: resolves vault
- Encode / decode → Vault backend contract: stores / retrieves
- Encode / decode → HMAC utilities: creates signatures
- pack / unpack → Capsule string: returns capsule
- Capsule string → pack / unpack: supplies capsule
- pack / unpack → Prompt text: returns text
- Prompt text → pack / unpack: supplies text
- Application or agent → CLI commands: runs command
- CLI commands → pack / unpack: packs prompt
- CLI commands → Encode / decode: decompresses / verifies
- CLI commands → Vault backend contract: resolves vault
- In-memory backend → Vault backend contract: implements
- SQLite backend → Vault backend contract: implements
- GitHub Gist backend → Vault backend contract: implements
- S3 backend → Vault backend contract: implements
- SQLite backend → SQLite vault file: reads / writes
- GitHub Gist backend → GitHub Gist service: reads / writes
- S3 backend → AWS S3 service: reads / writes