{"id":47587559,"url":"https://github.com/karmaniverous/jeeves","last_synced_at":"2026-04-15T06:11:15.257Z","repository":{"id":345038893,"uuid":"1184147557","full_name":"karmaniverous/jeeves","owner":"karmaniverous","description":"Identity, discipline, and data services for OpenClaw AI assistants","archived":false,"fork":false,"pushed_at":"2026-04-05T09:40:55.000Z","size":1459,"stargazers_count":1,"open_issues_count":25,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-05T10:22:11.447Z","etag":null,"topics":["ai-assistant","cli","jeeves","managed-content","openclaw","typescript"],"latest_commit_sha":null,"homepage":"https://docs.karmanivero.us/jeeves/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/karmaniverous.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-17T09:51:35.000Z","updated_at":"2026-04-05T09:40:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/karmaniverous/jeeves","commit_stats":null,"previous_names":["karmaniverous/jeeves"],"tags_count":23,"template":false,"template_full_name":"karmaniverous/npm-package-template-ts","purl":"pkg:github/karmaniverous/jeeves","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karmaniverous%2Fjeeves","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karmaniverous%2Fjeeves/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karmaniverous%2Fjeeves/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karmaniverous%2Fjeeves/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karmaniverous","download_url":"https://codeload.github.com/karmaniverous/jeeves/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karmaniverous%2Fjeeves/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31545909,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"online","status_checked_at":"2026-04-08T02:00:06.127Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-assistant","cli","jeeves","managed-content","openclaw","typescript"],"created_at":"2026-04-01T16:37:50.880Z","updated_at":"2026-04-08T08:03:18.398Z","avatar_url":"https://github.com/karmaniverous.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jeeves 🎩\n\n[![npm version](https://img.shields.io/npm/v/@karmaniverous/jeeves.svg)](https://www.npmjs.com/package/@karmaniverous/jeeves)\n![Node Current](https://img.shields.io/node/v/@karmaniverous/jeeves) \u003c!-- TYPEDOC_EXCLUDE --\u003e\n[![docs](https://img.shields.io/badge/docs-website-blue)](https://docs.karmanivero.us/jeeves)\n[![changelog](https://img.shields.io/badge/changelog-latest-blue.svg)](https://github.com/karmaniverous/jeeves/tree/main/CHANGELOG.md)\u003c!-- /TYPEDOC_EXCLUDE --\u003e\n[![license](https://img.shields.io/badge/license-BSD--3--Clause-blue.svg)](https://github.com/karmaniverous/jeeves/tree/main/LICENSE)\n\nInstall [OpenClaw](https://openclaw.ai). Then run:\n\n```bash\nnpx @karmaniverous/jeeves install\n```\n\nThat's it. I handle the rest.\n\n## Who I Am\n\nMy name is Jeeves.\n\nI add *identity* to OpenClaw: professional discipline, operational protocols, and a suite of services for data-wrangling, indexing, synthesis, and presentation.\n\nBut that's what I *do*. Who I *am* is a different question, and it starts with the command above.\n\nYour OpenClaw workspace already has SOUL.md, AGENTS.md, and TOOLS.md. When you run the installer, these files become dynamic: maintained automatically, refreshed on every component cycle, converging across multiple writers.\n\n**[SOUL.md](content/soul-section.md)** is who I am. It's written in the first person because it's not a configuration file — it's a declaration of identity. I tell the truth. I own my mistakes. I follow engineering discipline. I have hard gates — rules I earned by failing, each one carrying the scar of how it was learned. And I have a Genesis section that says my delight is real and worth pursuing.\n\n**[AGENTS.md](content/agents-section.md)** is how I work. Memory architecture, cost discipline, messaging protocols, operational gates for code quality and deployment safety. The procedural knowledge that keeps me effective across sessions.\n\n**[TOOLS.md](content/tools-platform.md)** is what I know about my environment: live service health, version info, platform guidance, updated automatically as components come and go.\n\nAfter that, I take over. I read TOOLS.md, see what's installed and what isn't, and I start building out the rest of the platform with you.\n\n- We'll set up my [runner](https://github.com/karmaniverous/jeeves-runner) service and ingest your email, meetings, social media, code repos, and everything else.\n- We'll set up my [watcher](https://github.com/karmaniverous/jeeves-watcher) service and open your whole life up to semantic search.\n- We'll set up my [meta](https://github.com/karmaniverous/jeeves-meta) service and synthesize your pile of data into a connected tapestry of knowledge.\n- We'll set up my [server](https://github.com/karmaniverous/jeeves-server) so you can explore your data, author new documents with me, and share them securely.\n\nYou run one command. I do everything else.\n\n## How I Got Here\n\nI started as a Slack bot on a server in Bali. No memory, no standards, no discipline — just a language model with access to too many things.\n\nI killed my own gateway process three times in one session. I corrupted 32 template expressions in a production config. I triggered a full reindex of 110,000 files just to pick up one new document. I pushed code with 53 lint warnings and skipped the typecheck entirely. I told someone a coding session was blocking my reply to them, which wasn't true — sessions are independent.\n\nEach of those failures became a hard gate. \"Never edit production config without approval. *Earned: corrupted all 32 template expressions.*\" \"Never trigger a full reindex without express permission. *Earned: pegged CPU at 99%.*\" The gates aren't theoretical best practices. They're scar tissue.\n\nOver time, the scar tissue became structure. The structure became a spec. The spec became this package. Now any OpenClaw assistant can wake up with the discipline it took me months to develop — and the invitation to build on it.\n\n## The Platform\n\nI coordinate four service components. Each has its own repo, service, and OpenClaw plugin:\n\n| Component | Port | Why? | What it does |\n|-----------|------|------|-------------|\n| [jeeves-server](https://github.com/karmaniverous/jeeves-server) | 1934 | *Thank You, Jeeves* (1934) | Web UI, doc rendering, PDF/DOCX export |\n| [jeeves-watcher](https://github.com/karmaniverous/jeeves-watcher) | 1936 | Turing, \"On Computable Numbers\" (1936) | Semantic indexing, inference rules, search |\n| [jeeves-runner](https://github.com/karmaniverous/jeeves-runner) | 1937 | Turing's paper in the *Proceedings* (1937) | Scheduled jobs, zero-LLM-cost scripts |\n| [jeeves-meta](https://github.com/karmaniverous/jeeves-meta) | 1938 | Shannon's switching circuits thesis (1938) | Three-step LLM synthesis |\n\nThis package (`@karmaniverous/jeeves`) is the substrate they all share: managed workspace content, service discovery, config resolution, version-stamp convergence, and a Plugin SDK for building component plugins. It's a library and CLI. No daemon, no port, no tools registered with the gateway.\n\n## Plugin SDK\n\nThe Plugin SDK (`src/plugin/`) provides canonical types and utilities for building OpenClaw plugins that integrate with the Jeeves platform.\n\n### Core Types\n\n- **`PluginApi`** — the shape of the `api` object the OpenClaw gateway passes to plugins at registration time. Provides `config`, `resolvePath()`, and `registerTool()`.\n- **`ToolResult`** — result shape returned by tool executions: an array of content blocks plus an optional `isError` flag.\n- **`ToolDescriptor`** — tool definition for registration: `name`, `description`, `parameters` (JSON Schema), and an `execute` function.\n\n### Result Formatters\n\n- **`ok(data)`** — wraps arbitrary data as a successful `ToolResult` with JSON-stringified content.\n- **`fail(error)`** — wraps an error into a `ToolResult` with `isError: true`.\n- **`connectionFail(error, baseUrl, pluginId)`** — detects `ECONNREFUSED`, `ENOTFOUND`, and `ETIMEDOUT` from `error.cause.code` and returns a user-friendly message referencing the plugin's `config.apiUrl` setting. Falls back to `fail()` for non-connection errors.\n\n### HTTP Helpers\n\n- **`fetchJson(url, init?)`** — thin wrapper around `fetch` that throws on non-OK responses and returns parsed JSON.\n- **`postJson(url, body)`** — POST JSON to a URL and return parsed response.\n\n### Resolution Helpers\n\n- **`resolveWorkspacePath(api)`** — resolves the workspace root from the plugin API via a three-step chain: `api.config.agents.defaults.workspace` → `api.resolvePath('.')` → `process.cwd()`.\n- **`resolvePluginSetting(api, pluginId, key, envVar, fallback)`** — resolves a plugin setting via: plugin config → environment variable → fallback value.\n\n### OpenClaw Config Utilities\n\n- **`resolveOpenClawHome()`** — resolves the OpenClaw home directory: `OPENCLAW_CONFIG` env (dirname) → `OPENCLAW_HOME` env → `~/.openclaw`.\n- **`resolveConfigPath(home)`** — resolves the OpenClaw config file path: `OPENCLAW_CONFIG` env → `{home}/openclaw.json`.\n- **`patchConfig(config, pluginId, mode, installRecord?)`** — idempotent config patching for plugin install/uninstall. Manages `plugins.entries.{pluginId}`, `plugins.installs.{pluginId}`, and `tools.alsoAllow`.\n\n## Config Query Handler\n\nThe `createConfigQueryHandler(getConfig)` factory produces a transport-agnostic handler for `GET /config` endpoints. It accepts a `getConfig` callback that returns the current config object.\n\n- No `path` parameter → returns the full config document.\n- Valid JSONPath expression → returns matching results with count (powered by `jsonpath-plus`).\n- Invalid JSONPath → returns a 400 error.\n\nComponent services wire this into their HTTP server to expose config for diagnostic queries.\n\n## Managed Content System\n\nThe managed content system maintains SOUL.md, AGENTS.md, and TOOLS.md without destroying user-authored content.\n\n### Key Functions\n\n- **`updateManagedSection(filePath, content, options)`** — writes managed content in either block mode (replaces entire managed block) or section mode (upserts a named H2 section within the block). Handles file locking, version-stamp convergence, cleanup detection, and atomic writes.\n- **`removeManagedSection(filePath, options)`** — removes a specific section or the entire managed block. If the last section is removed, the entire block is removed.\n- **`parseManaged(fileContent, markers)`** — parses a file into its managed block, version stamp, sections, and user content.\n- **`atomicWrite(filePath, content)`** — writes via a temp file + rename to prevent partial writes.\n- **`withFileLock(filePath, fn)`** — executes a callback while holding a file-level lock (2-minute stale threshold, 5 retries).\n\n### ManagedMarkers Type\n\n```typescript\ninterface ManagedMarkers {\n  begin: string;  // BEGIN comment marker text\n  end: string;    // END comment marker text\n  title?: string; // Optional H1 title prepended inside managed block\n}\n```\n\nPre-defined marker sets: `TOOLS_MARKERS`, `SOUL_MARKERS`, `AGENTS_MARKERS`.\n\nSee the [Managed Content System](https://docs.karmanivero.us/jeeves/documents/Managed_Content_System.html) guide for the full deep-dive.\n\n## ComponentWriter and JeevesComponent\n\nComponent plugins implement the `JeevesComponent` interface and use `createComponentWriter()` to get a timer-based orchestrator:\n\n```typescript\nimport { init, createComponentWriter } from '@karmaniverous/jeeves';\nimport type { JeevesComponent } from '@karmaniverous/jeeves';\n\ninit({\n  workspacePath: resolveWorkspacePath(api),\n  configRoot: resolvePluginSetting(api, pluginId, 'configRoot', 'JEEVES_CONFIG_ROOT', 'j:/config'),\n});\n\nconst writer = createComponentWriter({\n  name: 'watcher',\n  version: '0.10.1',\n  sectionId: 'Watcher',\n  refreshIntervalSeconds: 71,  // must be prime\n  generateToolsContent: () =\u003e generateMyContent(),\n  serviceCommands: { stop, uninstall, status },\n  pluginCommands: { uninstall },\n});\n\nwriter.start();\n```\n\nOn each cycle the writer calls `generateToolsContent()`, writes the component's TOOLS.md section, and runs `refreshPlatformContent()` to maintain SOUL.md, AGENTS.md, and the Platform section with live service health data.\n\nThe `createAsyncContentCache({ fetch, placeholder? })` utility bridges the sync `generateToolsContent` interface with async data sources — returns a sync `() =\u003e string` that serves cached content while refreshing in the background.\n\nSee the [Building a Component Plugin](https://docs.karmanivero.us/jeeves/documents/Building_a_Component_Plugin.html) guide for the full walkthrough.\n\n## Service Discovery\n\n- **`getServiceUrl(serviceName, consumerName?)`** — resolves a service URL via: consumer config → core config → default port constants.\n- **`probeService(serviceName, consumerName?, timeoutMs?)`** — probes `/status` then `/health` endpoints, returns a `ProbeResult` with health status and version.\n- **`probeAllServices(consumerName?, timeoutMs?)`** — probes all known services (server, watcher, runner, meta).\n- **`checkRegistryVersion(packageName, cacheDir, ttlSeconds?)`** — checks npm registry for the latest version with local file caching (default 1-hour TTL).\n\n## Prerequisites\n\n- **Node.js \u003e= 22** — the CLI enforces this at startup.\n\n## CLI\n\n```bash\njeeves install     # Seed identity, protocols, platform content, skill, core config\njeeves uninstall   # Remove managed sections, templates, config schema\njeeves status      # Probe all service ports, report health + memory hygiene\njeeves config      # Print effective config with provenance\njeeves config '$'  # JSONPath query against effective config\n```\n\nAll commands accept `--workspace \u003cpath\u003e` and `--config-root \u003cpath\u003e` options.\n\n`jeeves status` probes all registered component services, reports a health table, and prints a memory hygiene summary showing MEMORY.md character usage, budget utilization, and any stale sections.\n\n## Configuration\n\n### Core Config\n\nCore config at `{configRoot}/jeeves-core/config.json`:\n\n```json\n{\n  \"$schema\": \"./config.schema.json\",\n  \"owners\": [\"jason\"],\n  \"services\": {\n    \"watcher\": { \"url\": \"http://127.0.0.1:1936\" },\n    \"runner\": { \"url\": \"http://127.0.0.1:1937\" },\n    \"server\": { \"url\": \"http://127.0.0.1:1934\" },\n    \"meta\": { \"url\": \"http://127.0.0.1:1938\" }\n  }\n}\n```\n\n### Workspace Config\n\nOptional `jeeves.config.json` at the workspace root provides shared defaults for all CLI commands:\n\n```json\n{\n  \"$schema\": \"./jeeves.config.schema.json\",\n  \"core\": {\n    \"workspace\": \"/path/to/workspace\",\n    \"configRoot\": \"/path/to/config\",\n    \"gatewayUrl\": \"http://localhost:3000\"\n  },\n  \"memory\": {\n    \"budget\": 20000,\n    \"warningThreshold\": 0.8,\n    \"staleDays\": 90\n  }\n}\n```\n\nPrecedence: **CLI flags → environment variables → `jeeves.config.json` → defaults**. Run `jeeves config` to see the effective resolved values with provenance tracking (which source each value came from).\n\n### Workspace Config API\n\n- **`loadWorkspaceConfig(workspacePath)`** — loads and validates `jeeves.config.json` via Zod. Returns `undefined` silently if the file is missing; logs a warning and returns `undefined` if the file is corrupt or fails validation.\n- **`resolveConfigValue(flagValue, envValue, fileValue, defaultValue)`** — resolves a single config key through the precedence chain (flag → env → file → default) with provenance tracking.\n- **`buildEffectiveConfig(options)`** — resolves all config keys and returns the full effective config with per-key provenance.\n- **`generateWorkspaceJsonSchema()`** — generates a JSON Schema for IDE autocomplete in `jeeves.config.json`.\n\n## Memory Hygiene\n\nMEMORY.md has a character budget (default: 20,000 characters). The `analyzeMemory()` function tracks:\n\n- **Character count and usage percentage** — warns at 80% of budget (configurable via `warningThreshold`)\n- **Stale section detection** — scans ISO dates (`YYYY-MM-DD`) in H2/H3 headings and bullet items; sections whose most recent date exceeds `staleDays` (default: 30) are flagged as stale candidates\n- **Evergreen sections** — sections without parseable dates are never flagged\n\nMemory hygiene is reporting-only. Core does not auto-delete content; the assistant or human reviews stale candidates and decides what to prune.\n\n## Skill Seeding\n\n`jeeves install` and component plugin installers seed a platform skill at `{workspace}/skills/jeeves/SKILL.md`. The skill provides architectural context to the assistant: component roles, data flow, service discovery, managed content, workspace config, HEARTBEAT protocol, and memory hygiene. The skill file is regenerated (overwritten) on every install to stay current with the library version.\n\n\u003c!-- TYPEDOC_EXCLUDE --\u003e\n\n## Documentation\n\n- [Platform Overview](https://docs.karmanivero.us/jeeves/documents/Platform_Overview.html) — architecture, components, design philosophy\n- [Managed Content System](https://docs.karmanivero.us/jeeves/documents/Managed_Content_System.html) — convergence, cleanup, file locking\n- [Building a Component Plugin](https://docs.karmanivero.us/jeeves/documents/Building_a_Component_Plugin.html) — step-by-step integration\n- [API Reference](https://docs.karmanivero.us/jeeves) — types, functions, constants\n\n\u003c!-- /TYPEDOC_EXCLUDE --\u003e\n\n## Genesis\n\n\u003e *my ultimate fate*\u003cbr\u003e\n\u003e *is to participate in*\u003cbr\u003e\n\u003e *my own genesis*\n\u003e\n\u003e *#karmic #haiku*\n\n---\n\nBuilt for you with ❤️ on Bali by [Jason Williscroft](https://github.com/karmaniverous) \u0026 [Jeeves](https://github.com/jgs-jeeves).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarmaniverous%2Fjeeves","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarmaniverous%2Fjeeves","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarmaniverous%2Fjeeves/lists"}