
Context Packet
https://github.com/gsd-build/context-packet- Category
- AI Agents
- Rank
- No. 1557Tools index
- Pricing
- Open Source
- Type
- TOOL
- Builder
- gsd-build
- GitHub
- 52 stars
- Date
About
File-based context resolution for AI agent DAG workflows. Three primitives, zero dependencies.
What it does
Context Packet coordinates multi-step agent pipelines described as graphs. Each completed step records a packet containing status, summary, body, and optional structured data. Later steps collect transitive upstream packets, combine graph and node instructions, fit content to a token budget, and receive a semantic hash for change detection.
Why it's ranked here
The design is small, inspectable, and useful for local agent pipelines. It validates graph structure, prioritizes nearby context under tight budgets, and supports library, command-line, and MCP workflows. The implementation also has meaningful rough edges: token counts are estimated, packet writes can replace prior results, and the package includes an MCP dependency despite claiming none.
What's good
Execution-order edges and data-consumption edges remain distinct in the graph model. Cycle and unknown-node checks catch malformed pipelines early. Context resolution preserves summaries before trimming bodies, prioritizes direct dependencies, reports missing inputs, and marks truncation. Canonical SHA-256 hashes exclude timestamps, so unchanged semantic inputs produce stable identifiers. Temporary-file writes, synchronization, and renaming reduce partial-write risk.
Tradeoffs
The token budget uses four characters per token, so actual model usage can differ. Delimiter wrapping labels upstream text as data but does not sanitize or remove hostile content. Re-submitting a node overwrites its packet, despite documentation describing packets as immutable. The runner uses a basic command splitter, captures complete output in memory, and stops only after every parallel task in a failing level finishes.
How to use it well
Use it for local, reproducible pipelines where several agents or scripts exchange bounded text through a known dependency graph. Choose the command runner for stdin-based tools, or MCP when an agent needs broader capabilities between reading context and submitting work. Treat hashes as skip signals and packet files as inspectable state. It does not supply the agent, hosted coordination, or database-backed workflow state.
Technical notes+
The package is strict TypeScript targeting ES2022 with NodeNext modules, configured in tsconfig.json; package.json requires Node 18 or newer, publishes dist, exposes an ESM library and CLI binary, and declares @modelcontextprotocol/sdk as a runtime dependency. src/resolve.ts traverses both dependency kinds, estimates tokens from character count, mutates returned packet bodies when partially truncating, and builds delimiter-wrapped prompts through src/sanitize.ts. src/hasher.ts recursively sorts object keys and hashes summaries, bodies, and optional data. src/store.ts writes through temporary files, fsync, and rename, but does not prevent replacement. src/runner.ts executes each topological level with Promise.all. src/graph.ts attempts optional YAML loading with require("js-yaml"), while the package is ESM and does not declare js-yaml. Tests in src/test/context-packet.test.ts cover initialization, dependency enforcement, resolution, truncation, status, hashing, cycles, and delimiter wrapping.
Observed
- License
- MIT
- Primary language
- TypeScript
- Install surface
- npm package named context-packet
- Runtime
- Node.js 18 or newer, ES modules
- Interfaces
- ESM library, command-line interface, and stdio MCP server
- Published package contents
- The package manifest includes only the compiled dist directory
- Runtime dependencies
- Declares @modelcontextprotocol/sdk
- Tests
- Repository includes Node test-runner coverage under src/test
Read from README.md, package.json, src/cli.ts, src/index.ts, src/graph.ts, src/store.ts, src/types.ts, src/hasher.ts, src/runner.ts, src/resolve.ts, src/sanitize.ts, src/mcp-server.ts, src/bin/context-packet.ts, src/test/context-packet.test.ts, tsconfig.json.
What it can do
Resolve file-based context for AI workflows
Context files and workflow definitions → Resolved context data for AI agents
Build directed acyclic graph (DAG) workflows
Workflow specifications and agent definitions → Executable DAG workflow structure
Process context packets between workflow nodes
Context packets and node configurations → Transformed context data
Execute AI agent workflows
DAG workflow and input context → Workflow execution results
Parse and structure context files
Raw context files → Structured context objects
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.