Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript
15.6 KB
Raw Blame
{
  "name": "gbrain",
  "description": "Postgres-native personal knowledge brain with hybrid RAG search",
  "type": "module",
  "imports": {
    "#postgres": {
      "types": "./vendor/postgres/types/index.d.ts",
      "require": "./vendor/postgres/cjs/src/index.js",
      "default": "./vendor/postgres/src/index.js"
    }
  },
  "main": "src/core/index.ts",
  "bin": {
    "gbrain": "src/cli.ts"
  },
  "exports": {
    ".": "./src/core/index.ts",
    "./engine": "./src/core/engine.ts",
    "./types": "./src/core/types.ts",
    "./operations": "./src/core/operations.ts",
    "./minions": "./src/core/minions/index.ts",
    "./engine-factory": "./src/core/engine-factory.ts",
    "./engine-open": "./src/core/engine-open.ts",
    "./pglite-engine": "./src/core/pglite-engine.ts",
    "./link-extraction": "./src/core/link-extraction.ts",
    "./import-file": "./src/core/import-file.ts",
    "./transcription": "./src/core/transcription.ts",
    "./embedding": "./src/core/embedding.ts",
    "./config": "./src/core/config.ts",
    "./markdown": "./src/core/markdown.ts",
    "./backoff": "./src/core/backoff.ts",
    "./search/hybrid": "./src/core/search/hybrid.ts",
    "./search/expansion": "./src/core/search/expansion.ts",
    "./search/evidence-delivery": "./src/core/search/evidence-delivery.ts",
    "./eval/longmemeval/reader": "./src/eval/longmemeval/reader.ts",
    "./think": "./src/core/think/index.ts",
    "./ai/gateway": "./src/core/ai/gateway.ts",
    "./ai/invocation-guard": "./src/core/ai/invocation-guard.ts",
    "./core/model-pricing": "./src/core/model-pricing.ts",
    "./extract": "./src/commands/extract.ts",
    "./ingestion": "./src/core/ingestion/index.ts",
    "./ingestion/test-harness": "./src/core/ingestion/test-harness.ts",
    "./core/guardrails": "./src/core/guardrails.ts",
    "./core/skillopt": "./src/core/skillopt/index.ts",
    "./skill-resolver": "./src/core/skills/resolver/index.ts",
    "./pglite-lock": "./src/core/pglite-lock.ts",
    "./version": "./src/version.ts"
  },
  "scripts": {
    "dev": "bun run src/cli.ts",
    "build": "bun build --compile --no-compile-autoload-bunfig --define GBRAIN_BUILD_COMMIT=\\\"$(git rev-parse HEAD)\\\" --outfile bin/gbrain src/cli.ts src/core/skills/resolver/hook-worker.ts",
    "rust:build": "bun rust/scripts/build.ts",
    "build:all": "bun build --compile --no-compile-autoload-bunfig --define GBRAIN_BUILD_COMMIT=\\\"$(git rev-parse HEAD)\\\" --target=bun-darwin-arm64 --outfile bin/gbrain-darwin-arm64 src/cli.ts src/core/skills/resolver/hook-worker.ts && bun build --compile --no-compile-autoload-bunfig --define GBRAIN_BUILD_COMMIT=\\\"$(git rev-parse HEAD)\\\" --target=bun-linux-x64 --outfile bin/gbrain-linux-x64 src/cli.ts src/core/skills/resolver/hook-worker.ts",
    "build:admin": "cd admin && bun run build && cd .. && bun run scripts/build-admin-embedded.ts",
    "build:admin-embedded": "bun run scripts/build-admin-embedded.ts",
    "build:schema": "bun run scripts/build-schema.ts",
    "build:schema-migrations": "bun run scripts/build-schema-migrations.ts",
    "new:migration": "bun run scripts/build-schema-migrations.ts --new",
    "build:llms": "bun run scripts/build-llms.ts",
    "wave-security-scan": "bash scripts/wave-security-scan.sh",
    "audit:contributors": "bun scripts/contributor-audit.ts",
    "build:flag-registry": "bun run scripts/generate-flag-registry.ts",
    "build:operation-manifest": "bun run scripts/build-operation-manifest.ts",
    "weights:mine": "bun run scripts/mine-shard-weights.ts",
    "build:pglite-snapshot": "bun run scripts/build-pglite-snapshot.ts",
    "bench:efficiency": "bash scripts/bench/efficiency/run-all.sh",
    "bench:parity": "bash scripts/bench/contract-parity.sh",
    "test": "bash scripts/run-unit-parallel.sh",
    "test:admin": "playwright test --config admin/playwright.config.ts",
    "eval:autocut": "bun test test/search/autocut-eval.test.ts",
    "test:full": "bun run verify && bash scripts/run-unit-parallel.sh && bun run test:slow && (if [ -n \"$DATABASE_URL\" ]; then bash scripts/run-e2e.sh; else echo '[test:full] skipped E2E (no DATABASE_URL); run docker-compose -f docker-compose.ci.yml up + bun run test:e2e to include' 1>&2; fi)",
    "verify": "bash scripts/run-verify-parallel.sh",
    "check:source-config-leak": "bash scripts/check-source-config-leak.sh",
    "check:no-pii-agent-voice": "bash scripts/check-no-pii-in-agent-voice.sh",
    "check:synthetic-corpus-privacy": "bash scripts/check-synthetic-corpus-privacy.sh",
    "check:system-of-record": "bash scripts/check-system-of-record.sh",
    "check:admin-scope-drift": "bash scripts/check-admin-scope-drift.sh",
    "check:cli-exec": "bash scripts/check-cli-executable.sh",
    "check:engine-dynamic-import": "bash scripts/check-engine-dynamic-import.sh",
    "check:file-url-pathname": "bash scripts/check-file-url-pathname.sh",
    "check:grok-pin": "bash scripts/check-grok-pin.sh",
    "check:opencode-pin": "bash scripts/check-opencode-pin.sh",
    "check:pin-doc-privacy": "bash scripts/check-pin-doc-privacy.sh",
    "check:gateway-routed": "bash scripts/check-gateway-routed-no-direct-anthropic.sh",
    "check:worker-pool-atomicity": "bash scripts/check-worker-pool-atomicity.sh",
    "check:doc-history": "bash scripts/check-key-files-current-state.sh",
    "check:docs-repo-paths": "bun test --timeout 60000 test/docs-repo-paths.test.ts",
    "check:resolver": "bun src/cli.ts check-resolvable --strict --skills-dir skills/",
    "check:skill-brain-first": "bash scripts/check-skill-brain-first.sh",
    "check:skill-publication": "bun scripts/check-skill-publication.ts",
    "check:skill-health": "bun scripts/check-skill-health.ts",
    "check:plugin-tree": "bash scripts/check-plugin-tree.sh",
    "check:wasm": "bash scripts/check-wasm-embedded.sh",
    "check:pglite-embedded": "bash scripts/check-pglite-embedded.sh",
    "check:skills-embedded": "bash scripts/check-skills-embedded.sh",
    "check:image-decoders": "bash scripts/check-image-decoders-embedded.sh",
    "check:newlines": "bash scripts/check-trailing-newline.sh",
    "test:compile-smoke": "bun test test/binary-self-update-compiled.serial.test.ts",
    "test:agent-voice": "bash scripts/test-agent-voice.sh",
    "test:e2e": "bash scripts/run-e2e.sh",
    "trust:smoke": "bun scripts/trust-smoke.ts",
    "test:slow": "bash scripts/run-slow-tests.sh",
    "test:stress": "bun run scripts/stress/run.ts",
    "test:scale": "bun scripts/scale/run.ts",
    "test:heavy": "bash scripts/run-heavy.sh",
    "test:profile": "bash scripts/profile-tests.sh",
    "test:serial": "bash scripts/run-serial-tests.sh",
    "test:convergence": "GBRAIN_TEST_CONVERGENCE=1 bun --no-env-file test --timeout=3600000 test/sync-convergence.serial.test.ts",
    "test:busy-agent": "GBRAIN_TEST_BUSY_AGENT=1 bun --no-env-file test --timeout=3600000 test/busy-agent-soak.serial.test.ts",
    "test:tla": "bash scripts/spec/tlc.sh && bun scripts/spec/mutants.ts drain-lease && bun scripts/spec/mutants.ts refresh-barrier",
    "ci:local": "bash scripts/ci-local.sh",
    "ci:local:diff": "bash scripts/ci-local.sh --diff",
    "ci:ubicloud": "bun run scripts/ci-ubicloud.ts",
    "ci:ubicloud:diff": "bun run scripts/ci-ubicloud.ts --diff",
    "ci:select-e2e": "bun run scripts/select-e2e.ts",
    "typecheck": "node --max-old-space-size=8192 node_modules/typescript/bin/tsc --noEmit --incremental --tsBuildInfoFile node_modules/.cache/gbrain-typecheck.tsbuildinfo",
    "check:jsonb": "bash scripts/check-jsonb-pattern.sh",
    "check:jsonb-params": "node scripts/check-jsonb-params.mjs",
    "check:search-path": "bash scripts/check-search-path.sh",
    "check:no-double-retry": "bash scripts/check-no-double-retry.sh",
    "check:batch-audit-site": "bash scripts/check-batch-audit-site.sh",
    "check:worker-lock-renewal-shape": "bash scripts/check-worker-lock-renewal-shape.sh",
    "check:bootstrap-tag": "bash scripts/check-bootstrap-tag.sh",
    "check:install-ref": "bun scripts/check-install-ref.ts",
    "check:bootstrap-templates": "bash scripts/check-bootstrap-templates.sh",
    "check:source-id-projection": "bash scripts/check-source-id-projection.sh",
    "check:privacy": "bash scripts/check-privacy.sh",
    "check:proposal-pii": "bash scripts/check-proposal-pii.sh",
    "check:eval-glossary": "bash scripts/check-eval-glossary-fresh.sh",
    "check:tool-catalog": "bash scripts/check-tool-catalog-fresh.sh",
    "check:skills-manifest": "bash scripts/check-skills-manifest-fresh.sh",
    "check:skills-lock-history": "bun scripts/check-skills-lock-history.ts",
    "check:test-names": "bash scripts/check-test-real-names.sh",
    "check:test-fragment-reads": "bash scripts/check-test-fragment-reads.sh",
    "check:progress": "bash scripts/check-progress-to-stdout.sh",
    "check:no-tracked-symlinks": "bash scripts/check-no-tracked-symlinks.sh",
    "check:admin-build": "bash scripts/check-admin-build.sh",
    "check:admin-embedded": "bash scripts/check-admin-embedded.sh",
    "check:test-isolation": "bash scripts/check-test-isolation.sh",
    "check:test-env-opt-ins": "bun scripts/check-test-env-opt-ins.ts",
    "check:postgres-lanes": "bun scripts/check-postgres-lane-coverage.ts",
    "check:weight-coverage": "bun scripts/check-weight-coverage.ts",
    "check:recipe-pricing": "bun scripts/check-recipe-pricing.ts",
    "check:fuzz-purity": "bash scripts/check-fuzz-purity.sh",
    "check:operations-filter-bypass": "bash scripts/check-operations-filter-bypass.sh",
    "check:fixture-privacy": "bash scripts/check-fixture-privacy.sh",
    "check:conversation-parser": "bun src/cli.ts eval conversation-parser test/fixtures/conversation-formats/all.jsonl --no-llm",
    "check:eval-chronicle": "bun src/cli.ts eval chronicle",
    "check:eval-canary": "bun run scripts/run-eval-canary.ts",
    "check:pg-url-redaction": "bash scripts/check-pg-url-redaction.sh",
    "check:source-scope-onboard": "bash scripts/check-source-scope-onboard.sh",
    "check:getpage-scope": "node scripts/check-getpage-scoped-write.mjs",
    "check:relative-dotdot": "node scripts/check-relative-dotdot.mjs",
    "check:origin-assignment": "node scripts/check-origin-assignment.mjs",
    "prepublish:clawhub": "bun run build:all",
    "publish:clawhub": "clawhub package publish . --family bundle-plugin",
    "check:skill-refs": "bun scripts/check-skill-refs.mjs",
    "gate:skills": "bash scripts/skills-commit-gate.sh",
    "check:guard-self-test": "bash scripts/guard-self-test.sh",
    "build:error-codes": "bun scripts/build-error-codes.ts",
    "check:error-codes": "bun scripts/build-error-codes.ts --check",
    "check:write-gate-regex": "bun scripts/check-write-gate-regex.ts",
    "build:agent-protocol": "bun scripts/build-agent-protocol.ts",
    "check:agent-protocol": "bun scripts/build-agent-protocol.ts --check",
    "check:agent-contract": "bun scripts/check-agent-contract.ts",
    "check:no-legacy-getconnection": "bash scripts/check-no-legacy-getconnection.sh",
    "check:module-size": "bash scripts/check-module-size.sh",
    "check:core-guard-coverage": "node scripts/check-core-guard-coverage.mjs",
    "check:function-size": "bun scripts/check-function-size.ts",
    "check:item-allowlist-catches": "bun scripts/check-item-allowlist-catches.ts",
    "check:layering": "bun scripts/check-layering.ts",
    "check:ai-sdk-importers": "bun scripts/check-ai-sdk-importers.ts",
    "check:durable-flush": "bun scripts/check-durable-flush.ts",
    "check:schema-error-predicates": "bun scripts/check-schema-error-predicates.ts",
    "check:dynamic-ci": "bun scripts/check-dynamic-ci.ts",
    "check:windows-hide": "bun scripts/check-windows-hide.ts",
    "check:engine-sql-ratchet": "bun scripts/check-engine-sql-ratchet.ts",
    "check:engine-raw-sql-ratchet": "bun scripts/check-engine-raw-sql-ratchet.ts",
    "check:engine-kind-branches": "bun scripts/check-engine-kind-branches.ts",
    "check:core-world-reads": "bun scripts/check-core-world-reads.ts",
    "check:derived-census": "bun scripts/check-derived-census.ts",
    "check:chunk-visibility": "bun scripts/check-chunk-visibility.ts",
    "check:page-body-readers": "bun scripts/check-page-body-readers.ts",
    "check:engine-sql-dynamic": "bun scripts/check-engine-sql-dynamic.ts",
    "check:migration-projection": "bun scripts/check-migration-projection.ts",
    "check:remote-privacy-reads": "bun scripts/check-remote-privacy-reads.ts",
    "check:engine-sql-brands": "bun scripts/check-engine-sql-brands.ts",
    "check:sync-run-state": "bun scripts/check-sync-run-state.ts",
    "check:schema-migrations": "bash scripts/check-schema-migrations-fresh.sh",
    "check:schema-fresh": "bash scripts/check-schema-fresh.sh",
    "check:retired-phrases": "bash scripts/check-retired-phrases.sh",
    "check:shared-tree-git": "bash scripts/check-shared-tree-git.sh",
    "check:bash32": "bash scripts/check-bash32.sh",
    "check:schema-migration-order": "bun scripts/check-schema-migration-order.ts",
    "check:behavior-since": "bun scripts/check-behavior-since.ts",
    "check:public-surface": "bun scripts/check-public-surface.ts",
    "check:changelog-headings": "bun scripts/check-changelog-headings.ts",
    "check:compile-autoload": "bash scripts/check-compile-autoload.sh",
    "check:vendor-postgres": "bash scripts/check-vendor-postgres.sh",
    "check:structural-manifest": "bash scripts/check-structural-manifest.sh",
    "regen:all": "bun scripts/regen-all.ts",
    "release:restamp": "bun scripts/release-restamp.ts",
    "release:unstamp": "bun scripts/release-restamp.ts --unstamp",
    "migrations:renumber": "bun scripts/release-restamp.ts --renumber",
    "check:regen-all": "bun scripts/regen-all.ts --check",
    "check:orphan-modules": "node scripts/check-orphan-modules.mjs",
    "check:test-placeholders": "node scripts/check-test-placeholders.mjs",
    "build:harness-docs": "bun run scripts/build-harness-docs.ts"
  },
  "openclaw": {
    "compat": {
      "pluginApi": ">=2026.4.0"
    },
    "extensions": [
      "./src/openclaw-context-engine.ts"
    ]
  },
  "dependencies": {
    "@ai-sdk/anthropic": "^3.0.125",
    "@ai-sdk/google": "^3.0.64",
    "@ai-sdk/openai": "^3.0.53",
    "@ai-sdk/openai-compatible": "^2.0.41",
    "@ai-sdk/provider-utils": "4.0.56",
    "@anthropic-ai/sdk": "^0.30.0",
    "@aws-sdk/client-s3": "^3.1028.0",
    "@aws-sdk/s3-request-presigner": "3.1028.0",
    "@dqbd/tiktoken": "^1.0.22",
    "@electric-sql/pglite": "0.4.3",
    "@jsquash/avif": "^2.1.1",
    "@jsquash/png": "^3.1.1",
    "@modelcontextprotocol/sdk": "1.32.1",
    "ai": "^6.0.168",
    "chokidar": "^4.0.3",
    "cookie-parser": "^1.4.7",
    "cors": "^2.8.5",
    "detect-libc": "2.0.4",
    "eventsource-parser": "^3.0.8",
    "exifr": "^7.1.3",
    "express": "^5.1.0",
    "express-rate-limit": "^7.5.0",
    "heic-decode": "^2.1.0",
    "js-yaml": "^4.3.2",
    "jsonc-parser": "^3.3.1",
    "marked": "^18.0.2",
    "openai": "^4.0.0",
    "pgvector": "^0.2.0",
    "tree-sitter-wasms": "0.1.13",
    "web-tree-sitter": "0.22.6",
    "zod": "^4.6.6"
  },
  "devDependencies": {
    "@playwright/test": "1.63.0",
    "@types/bun": "latest",
    "@types/cookie-parser": "^1.4.7",
    "@types/cors": "^2.8.19",
    "@types/express": "^5.0.6",
    "@types/js-yaml": "^4.0.9",
    "bun-types": "^1.3.13",
    "fast-check": "^4.8.0",
    "typescript": "^5.6.0"
  },
  "trustedDependencies": [
    "@electric-sql/pglite"
  ],
  "engines": {
    "bun": ">=1.4.4"
  },
  "license": "MIT",
  "version": "0.60.737.0",
  "overrides": {
    "@aws-sdk/util-format-url": "3.972.9",
    "@ai-sdk/provider-utils": "4.0.56",
    "@hono/node-server": "^2.1.6",
    "fast-uri": "^3.1.9",
    "body-parser": "^2.4.0",
    "fast-xml-builder": "^1.1.7",
    "fast-xml-parser": "^5.7.0",
    "form-data": "^4.0.6",
    "hono": "^4.13.16",
    "ip-address": "^10.7.4",
    "qs": "6.16.1",
    "js-yaml": "^4.3.2",
    "undici": "^6.29.1",
    "zod": "^4.6.6"
  }
}