{
  "markdown": "# prism\n\n`prism` is a TypeScript/Node.js agent harness. Host apps and extension packages\nbring their tools, providers, credentials, storage, and UI; Prism supplies the\ncommon contracts, registries, agent/session runtime, replaceable input/prompt\nand compaction strategies, CLI/RPC adapters, and first-party provider/compaction\npackages. The current 0.4 line publishes the generated package inventory (see\n[Packages](#packages)) with explicit family subpaths and independent package versioning. Prism defines contracts, not apps.\n\n## Current scope\n\n- **Agent/session runtime**: `createAgent`/`createAgentSession`, run prompts,\n  dispatch host tools, subscribe to normalized `AgentEvent` streams, abort runs,\n  compact, and navigate branches.\n- **Field-level classification (0.2.7)**: `applyFieldPolicy` + the fail-closed protected default walk JSON-like values across prompt/tool/artifact/audit/telemetry/persistence/export boundaries with `allow`/`redact`/`tokenize`/`deny` decisions, explicit per-boundary `labelFor` hints, bounded traversal, and sparse-copy allocation; seams at the egress redaction functions, the audit-export redactor hook, and the OpenTelemetry attribute policy. See [docs/data-classification.md](docs/data-classification.md).\n- **Providers and models**: provider/model registries, provider event helpers,\n  credential redaction helpers, mock provider, and an optional\n  OpenAI-compatible provider subpath. Cache support is provider-specific:\n  OpenAI/OpenRouter use best-effort explicit cache hints, NeuralWatt uses\n  best-effort implicit prefix caching, and other providers have route/model-specific\n  or no cache-control support; see [docs/provider-caching.md](docs/provider-caching.md).\n- **First-party packages**: nineteen provider adapter subpaths, two compaction strategies,\n  coding tools/security, JSON Schema validation, MCP, workflows, OpenTelemetry,\n  encrypted credentials, SQLite/PostgreSQL persistence, Linux desktop control,\n  and manifest-only install profiles.\n- **Tools, context, skills**: host-owned tool registry with allow/deny filtering\n  and dispatch, context providers, and a skill registry with progressive\n  disclosure.\n- **Input/prompt/context**: default input and prompt builders, system-prompt\n  layering, and provider-input assembly — every stage replaceable.\n- **Sessions and memory**: in-memory and JSONL session stores, branching/fork/\n  clone, default and LLM compaction strategies, retry policy,\n  observational-memory recall/status/view, and the `@arnilo/prism-memory` family\n  (working/semantic memory plus `/rag`, `/compaction/*`, `/graft`, `/wiki` subpaths).\n- **Extensions and manifests**: extension kernel + event bus, contribution\n  registries, middleware hooks, and data-only package manifests.\n- **Config, settings, security**: layered config merge, settings providers,\n  credential resolvers, trust/permission policies, and secret redaction.\n- **CLI/RPC/server**: `prism --mode print|json|rpc`, `prism init`, optional framework-free authorized Web agent/workflow routes, and explicit MCP server exposure.\n- **Ecosystem parity (0.0.15)**: OpenAI hosted-tool attribution, bounded Responses\n  continuation/Realtime, exact AI SDK V4 mapping, bounded RAG lifecycle/reranking/trust,\n  and consent-bound memory export/rebuild; provider, RAG, and memory packages remain optional.\n- **Co-work contracts (0.0.14)**: conversation/artifact review types, deny-by-default device\n  contracts, and OAuth refresh/revoke helpers; services stay in optional packages.\n\n## Install\n\n```bash\nnpm install @arnilo/prism\n```\n\nFirst-party code packages are separate imports and require `@arnilo/prism` as\na non-optional peer. Install atomic packages directly or choose a manifest-only\nfamily/profile; profiles install packages but expose no alias exports and activate nothing:\n\n```bash\nnpm install @arnilo/prism @arnilo/prism-providers            # core + all provider adapters\nnpm install @arnilo/prism @arnilo/prism-core @arnilo/prism-memory   # replaces prism-base\nnpm install @arnilo/prism @arnilo/prism-coding-tools @arnilo/prism-mcp @arnilo/prism-providers  # replaces prism-code\nnpm install @arnilo/prism @arnilo/prism-core @arnilo/prism-mcp @arnilo/prism-providers          # replaces prism-sdk\nnpm install @arnilo/prism @arnilo/prism-core @arnilo/prism-providers  # pick families explicitly (no umbrella)\nnpm install @arnilo/prism-core/runtime/server @arnilo/prism-core/runtime/workflows    # optional Web API boundary\nnpm install @arnilo/prism-core/runtime/supervisor                         # optional local delegation + A2A 1.0\nnpm install @arnilo/prism-web-tools                          # unified web tools family (root search + /browser + /obscura subpaths)\n```\n\nSee [docs/release-and-install.md](docs/release-and-install.md) for install\nspecifiers, tarball contents, and the offline test budget.\n\n## Quick start\n\nScaffold a project (offline mock test included):\n\n```bash\nnpx --package @arnilo/prism prism init my-agent\n# or, scaffold with a real provider package selected:\nnpx --package @arnilo/prism prism init my-agent --provider openai\n# or, scaffold a full deep research agent from the template gallery:\nnpx --package @arnilo/prism prism init my-research --template deep-research\ncd my-agent && npm install && npm test\n```\n\nList available template gallery starters:\n```bash\nprism init --list-templates\n```\n\n\nOr embed Prism directly:\n\n```ts\nimport { createAgent, createAgentSession, createMockProvider } from \"@arnilo/prism\";\n\n// Host owns the provider. createMockProvider is for tests/demos only.\nconst agent = createAgent({\n  model: { provider: \"mock\", model: \"demo\" },\n  provider: createMockProvider([{ type: \"text\", text: \"Hello\" }, { type: \"done\" }]),\n});\n\nconst session = createAgentSession({ agent });\n\n// Direct result: run/prompt return AgentRunResult (text, usage, status, ids).\nconst result = await session.run(\"Hi\");\nconsole.log(result.text, result.usage?.totalTokens);\n\n// Integrated streaming: subscribe-before-run for one owned run.\nfor await (const event of session.stream(\"Hi again\")) {\n  // AgentEvent: agent_started, message_delta, turn_finished, ...\n}\n\n// Long-lived subscribe() still works when you need a subscriber across runs.\n// `subscribe()` only emits while a run is in progress, so the loop and `run()`\n// must run together; awaiting the loop before calling `run()` would deadlock.\n(async () => {\n  const consumer = (async () => {\n    for await (const event of session.subscribe()) {\n      // AgentEvent: agent_started, message_delta, turn_finished, ...\n    }\n  })();\n  await Promise.all([consumer, session.run(\"Hi\")]);\n})();\n```\n\nRegister a first-party provider package through the extension kernel:\n\n```ts\nimport { createExtensionKernel, createEnvCredentialResolver } from \"@arnilo/prism\";\nimport { createOpenAIProviderPackage } from \"@arnilo/prism-providers/openai\";\n\nconst kernel = createExtensionKernel();\nawait kernel.load([\n  createOpenAIProviderPackage({\n    apiKey: createEnvCredentialResolver({ OPENAI_API_KEY: \"fake\" }, { openai: \"OPENAI_API_KEY\" }),\n  }),\n]);\n```\n\nHosts own credentials. Do not put secrets in prompts, messages, events, stores,\nor logs. Prism never reads `process.env` on its own; credential resolvers are\ncaller-supplied.\n\n## CLI\n\n```bash\nprism --provider mock --model demo -p \"Hi\"          # print mode (default)\nprism --provider mock --mode json -p \"Hi\"            # one event envelope per line\nprintf '{\"id\":\"1\",\"command\":\"prompt\",\"params\":{\"input\":\"Hi\"}}\\n' \\\n  | prism --provider mock --mode rpc                 # LF-delimited JSONL RPC\n```\n\n## Docs\n\n- [docs/index.md](docs/index.md) — navigational map of every public surface.\n- The `examples/` directory holds compile-checked typed examples and runnable\n  offline demos covering providers, auth, tools, stores, compaction, structured\n  output, multimodality, workflows, CLI, and RPC.\n\n## Packages\n\n<!-- generated:package-truth:inventory begin -->\n**10 publishable manifests** — root `@arnilo/prism` plus 9 workspace packages (3 `prism-*` family packages, 6 capability packages). Generated by `node scripts/package-truth.mjs --emit-docs` — do not hand-edit.\n\n| package | version | notes |\n| --- | --- | --- |\n| `@arnilo/prism` | 0.5.5 | core — runtime, CLI/RPC, templates, docs |\n| `@arnilo/prism-coding-tools` | 0.5.5 | family — /agent, /security, /document-reader, /openapi, /computer-use-linux, /dev, /caveman, /ponytail, /impeccable subpaths |\n| `@arnilo/prism-core` | 0.5.5 | family — /runtime, /sessions, /governance, /credentials, /enterprise, /work, /validation subpaths |\n| `@arnilo/prism-providers` | 0.5.5 | family — all provider adapters as `/<adapter>` subpaths |\n| `@arnilo/prism-acp-agent` | 0.5.5 | capability — ACP adapter |\n| `@arnilo/prism-ag-ui` | 0.5.5 | capability — AG-UI/A2A/A2UI adapter |\n| `@arnilo/prism-mcp` | 0.5.5 | capability — MCP client/server/OAuth interop |\n| `@arnilo/prism-memory` | 0.5.5 | capability — memory plus /rag, /compaction/*, /graft, /wiki subpaths |\n| `@arnilo/prism-office` | 0.5.5 | capability — /documents, /sheets, /diagrams subpaths |\n| `@arnilo/prism-web-tools` | 0.5.5 | capability — Brave/Exa/Firecrawl plus peer-gated /browser and /obscura subpaths |\n<!-- generated:package-truth:inventory end -->\n\n## Scripts\n\n| command | action |\n|---------|--------|\n| `npm run build` | Compile TypeScript to `dist/` (core + workspaces) |\n| `npm run typecheck` | Type-check without emitting |\n| `npm test` | Build + run network-free tests |\n| `npm run test:live` | Run live suites whose credentials are present (skip the rest) |\n| `prism --help` | CLI help |\n\n## Non-goals (v1)\n\n- Privileged tools, MCP servers, telemetry, credentials, or databases activated by install — hosts explicitly configure and register every capability.\n- Browser automation or interactive terminal UI in core — hosts may opt into the `@arnilo/prism-web-tools/browser` subpath with their own Playwright lifecycle; Prism does not auto-start browsers or ship a TUI.\n- Provider, credential, extension, or package auto-discovery.\n- Core-owned database drivers, secret persistence, sandbox, or application policy — optional packages implement adapters over host-owned boundaries.\n",
  "bytes": 10169,
  "sha": "ef0b61c7ffd7c609a758dd5af83c8b69291d32fb25c1ad8ee11501a6e4e7cfc1",
  "repo_slug": "ashiqrniloy/prism",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/okf_ashiqrniloy_prism_packages_memory_wiki_i_414b0c5c/readme"
}