npm.io
0.3.0 • Published 2d ago

@polymerix-labs/agents-core

Licence
MIT
Version
0.3.0
Deps
0
Size
46 kB
Vulns
0
Weekly
0

@polymerix-labs/agents-core

Protocol-agnostic core for the dont-break agent surfaces: a typed client for the query API plus the 7 tool definitions shared by every adapter (MCP, CLI, OpenAPI).

Most users never install this package directly — install @polymerix-labs/dont-break-mcp (for Cursor / Claude / any MCP host) or @polymerix-labs/dont-break-query (for CI and shells) instead. Use agents-core when building a custom integration (LangChain tools, a bot, an internal service).

What it provides

  • QueryApiClient — typed HTTP client for the 7 query endpoints of the dont-break gateway (JWT auth, tenant-scoped URLs, actionable error messages).
  • TOOLS — the 7 tool definitions (name, agent-oriented description, JSON Schema inputSchema, execute) that adapters render into their own protocol:
Tool Purpose
find_symbol Resolve names/paths into node ids (always call first)
get_dependencies What a node depends on
get_dependents Who depends on a node
get_impact Blast radius of a change (files and/or nodes)
find_path Cheapest dependency routes between two nodes
get_do_not_touch Danger list: high fan-in + low stability
get_arch_status Practicability report + verdict
  • configFromEnv — resolves DONT_BREAK_API_URL, DONT_BREAK_TOKEN, DONT_BREAK_WORKSPACE, DONT_BREAK_PROJECT.

All business logic (weights, caps, thresholds, verdicts) lives server-side; this package is a pure transport and receives result DTOs only.

Usage

import { configFromEnv, QueryApiClient, TOOLS, getTool } from "@polymerix-labs/agents-core";

const client = new QueryApiClient(configFromEnv());

// Direct client usage
const matches = await client.find("PokemonAdapter", { kind: "class" });
const impact = await client.impact({ files: [matches[0].relative_path!] });

// Tool-definition usage (what MCP/CLI adapters do)
const result = await getTool("get_arch_status")!.execute(client, {});

Configuration

Variable Meaning
DONT_BREAK_API_URL Gateway base URL
DONT_BREAK_TOKEN JWT bearer token
DONT_BREAK_WORKSPACE Workspace id
DONT_BREAK_PROJECT Project slug

The dont-break extension's Connect your agent panel generates these values for you.

License

MIT

Keywords