Skip to content

tao3k/typescript-lang-project-harness

Repository files navigation

typescript-lang-project-harness

Standalone project-level TypeScript language harness for agent repair loops, local checks, and CI policy gates.

The package keeps one strict boundary: TypeScript semantics come from the TypeScript Compiler API, native tsconfig parsing, and parser-owned project facts. Rule packs and search packets consume those facts instead of treating source text as the source of truth.

Use

import { assertTypeScriptProjectHarnessClean } from "typescript-lang-project-harness";

assertTypeScriptProjectHarnessClean(new URL(".", import.meta.url));

For compact repair output:

import {
  renderTypeScriptProjectHarnessAgentCompactText,
  runTypeScriptProjectHarness,
} from "typescript-lang-project-harness";

const report = runTypeScriptProjectHarness(".");
console.log(renderTypeScriptProjectHarnessAgentCompactText(report));

CLI

The public binary is ts-harness.

ts-harness search workspace .
ts-harness search prime --view seeds .
ts-harness search owner src/index.ts --view seeds .
ts-harness search fzf OrderStatus .
ts-harness search fzf --query-set OrderStatus --query-set findOrderStatus owner tests .
rg -n "OrderStatus" src tests | ts-harness search ingest .

ts-harness check --changed .
ts-harness check --full .
ts-harness agent doctor --json .
ts-harness agent install --client codex .
ts-harness agent guide --client codex .

Compact text is the default agent surface. --json emits the shared semantic search packet, and agent doctor --json emits the semantic language registry. agent install --client codex writes .codex/config.toml so Codex hooks route raw TypeScript/JavaScript source reads and broad candidate searches back through ts-harness search packets. Existing multi-language hook config is preserved: the installer updates its own marked block or appends one when another harness already owns hooks. agent guide --client codex prints the command-line guide used in hook denials; every actionable line uses the installed ts-harness binary. The provider identity is:

languageId=typescript
providerId=ts-harness
binary=ts-harness
namespace=agent.semantic-protocols.languages.typescript.ts-harness

Rule Packs

Default project execution evaluates:

  1. typescript.syntax
  2. typescript.semantic
  3. typescript.project_policy
  4. typescript.modularity
  5. typescript.test_layout
  6. typescript.agent_policy
  7. typescript.extension_policy

Blocking rules represent broken parser/project promises. Advisory rules stay visible to agents without failing the default gate unless the caller promotes them or uses the explicit agent test-gate assertion.

Validation

npm run check:implementation
npm run check:policy
npm run lint
npm run format:check
npm run test:implementation
npm run test:policy
npm run harness
git diff --check

Documentation

Durable package material lives under docs/:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages