@tech-leads-club/harness-toolkit 0.11.0 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/tlc-cli.ts CHANGED
@@ -30,7 +30,6 @@ import {
30
30
  } from "../src/platform/paths.ts";
31
31
  import { type Row, render, type Screen, type Section } from "../src/platform/screen.ts";
32
32
  import { createStyle, PLAIN, type Style } from "../src/platform/style.ts";
33
- import { scaffold } from "../tools/new-provider.ts";
34
33
 
35
34
  export class UsageError extends Error {}
36
35
 
@@ -862,43 +861,6 @@ export function setGateCommand(root: string, field: GateField, argv: string[], i
862
861
  return `grind.${field}Command = ${JSON.stringify(argv)}`;
863
862
  }
864
863
 
865
- const REGISTRY_TYPE_IMPORT = 'import type { ProviderPort } from "./provider.port.ts";\n';
866
- const REGISTRY_ARRAY = /export const providers: ProviderPort\[\] = \[([^\]]*)\];/;
867
-
868
- // invariant: an append, never a reorder — the new entry always lands last in `providers`, so every existing provider's detection-order position is unchanged.
869
- export function appendProviderToRegistry(text: string, name: string): string {
870
- if (!text.includes(REGISTRY_TYPE_IMPORT)) {
871
- throw new Error("provider.registry.ts: could not find the ProviderPort type-import anchor line");
872
- }
873
- const withImport = text.replace(
874
- REGISTRY_TYPE_IMPORT,
875
- `import { ${name}Provider } from "./${name}/index.ts";\n${REGISTRY_TYPE_IMPORT}`,
876
- );
877
-
878
- const match = REGISTRY_ARRAY.exec(withImport);
879
- if (!match) {
880
- throw new Error("provider.registry.ts: could not find the providers array literal");
881
- }
882
- const existing = (match[1] ?? "").trim();
883
- const appended = existing.length > 0 ? `${existing}, ${name}Provider` : `${name}Provider`;
884
- return withImport.replace(REGISTRY_ARRAY, `export const providers: ProviderPort[] = [${appended}];`);
885
- }
886
-
887
- /**
888
- * The full `tlc harness new-provider` flow: T5's scaffold, then a real import appended to
889
- * provider.registry.ts — in that order, so a refused scaffold never touches the registry.
890
- */
891
- export function runNewProvider(name: string, root: string): { ok: true } | { ok: false; reason: string } {
892
- const scaffolded = scaffold(name, root);
893
- if (!scaffolded.ok) {
894
- return scaffolded;
895
- }
896
- const registryPath = join(root, "src", "providers", "provider.registry.ts");
897
- const current = readFileSync(registryPath, "utf8");
898
- writeFileSync(registryPath, appendProviderToRegistry(current, name), "utf8");
899
- return { ok: true };
900
- }
901
-
902
864
  export function helpScreen(): Screen {
903
865
  return {
904
866
  title: "tlc harness",
@@ -1205,7 +1167,6 @@ export type Action =
1205
1167
  | { kind: "prices-lookup"; modelId: string; provider: string }
1206
1168
  | { kind: "entry"; entry: string; args: string[] }
1207
1169
  | { kind: "install"; args: string[] }
1208
- | { kind: "new-provider"; name: string }
1209
1170
  | { kind: "unknown"; cmd: string };
1210
1171
 
1211
1172
  export function route(args: string[]): Action {
@@ -1334,13 +1295,6 @@ export function route(args: string[]): Action {
1334
1295
  return { kind: "entry", entry: "init-project", args: args.slice(1) };
1335
1296
  case "install":
1336
1297
  return { kind: "install", args: args.slice(1) };
1337
- case "new-provider": {
1338
- const name = args[1];
1339
- if (!name) {
1340
- throw new UsageError("usage: tlc harness new-provider <name>");
1341
- }
1342
- return { kind: "new-provider", name };
1343
- }
1344
1298
  // why: the exit has to be as easy to find as the entrance. An operator who cannot get the harness off their
1345
1299
  // machine without hand-editing settings.json will not try it on a second one
1346
1300
  // ([/decisions/ad-066.md](/decisions/ad-066.md)).
@@ -1863,17 +1817,6 @@ async function main(argv: string[]): Promise<void> {
1863
1817
  case "install":
1864
1818
  runInstall(action.args, root);
1865
1819
  break;
1866
- case "new-provider": {
1867
- const result = runNewProvider(action.name, process.cwd());
1868
- if (!result.ok) {
1869
- console.error(`new-provider: refusing — ${result.reason}`);
1870
- process.exit(1);
1871
- }
1872
- console.log(
1873
- `new-provider: scaffolded src/providers/${action.name}/, docs/providers/${action.name}.md, and appended ${action.name}Provider to provider.registry.ts`,
1874
- );
1875
- break;
1876
- }
1877
1820
  case "entry":
1878
1821
  runEntry(action.entry, json ? [...action.args, JSON_FLAG] : action.args, root);
1879
1822
  break;