@smeltjs/core 0.4.0 → 0.5.0
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/dist/cli/bin.d.ts.map +1 -1
- package/dist/cli/bin.js +9 -4
- package/dist/cli/bin.js.map +1 -1
- package/dist/cli/doctor.d.ts +66 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +137 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/hooks.d.ts +36 -2
- package/dist/cli/hooks.d.ts.map +1 -1
- package/dist/cli/hooks.js +108 -64
- package/dist/cli/hooks.js.map +1 -1
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +8 -14
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/installed.d.ts +56 -0
- package/dist/cli/installed.d.ts.map +1 -0
- package/dist/cli/installed.js +105 -0
- package/dist/cli/installed.js.map +1 -0
- package/dist/cli/lava.d.ts +31 -0
- package/dist/cli/lava.d.ts.map +1 -0
- package/dist/cli/lava.js +82 -0
- package/dist/cli/lava.js.map +1 -0
- package/dist/cli/setup.d.ts +87 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +513 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/cli/shell.d.ts +11 -4
- package/dist/cli/shell.d.ts.map +1 -1
- package/dist/cli/shell.js.map +1 -1
- package/dist/cli/subcommands/agents.d.ts.map +1 -1
- package/dist/cli/subcommands/agents.js +2 -1
- package/dist/cli/subcommands/agents.js.map +1 -1
- package/dist/cli/subcommands/doctor.d.ts +15 -0
- package/dist/cli/subcommands/doctor.d.ts.map +1 -0
- package/dist/cli/subcommands/doctor.js +43 -0
- package/dist/cli/subcommands/doctor.js.map +1 -0
- package/dist/cli/subcommands/flags.d.ts +13 -0
- package/dist/cli/subcommands/flags.d.ts.map +1 -1
- package/dist/cli/subcommands/flags.js +27 -1
- package/dist/cli/subcommands/flags.js.map +1 -1
- package/dist/cli/subcommands/hooks.d.ts.map +1 -1
- package/dist/cli/subcommands/hooks.js +10 -2
- package/dist/cli/subcommands/hooks.js.map +1 -1
- package/dist/cli/subcommands/init.d.ts.map +1 -1
- package/dist/cli/subcommands/init.js +2 -1
- package/dist/cli/subcommands/init.js.map +1 -1
- package/dist/cli/subcommands/registry.d.ts +3 -1
- package/dist/cli/subcommands/registry.d.ts.map +1 -1
- package/dist/cli/subcommands/registry.js +6 -0
- package/dist/cli/subcommands/registry.js.map +1 -1
- package/dist/cli/subcommands/setup.d.ts +23 -0
- package/dist/cli/subcommands/setup.d.ts.map +1 -0
- package/dist/cli/subcommands/setup.js +87 -0
- package/dist/cli/subcommands/setup.js.map +1 -0
- package/dist/cli/subcommands/subcommand.d.ts +1 -1
- package/dist/cli/subcommands/subcommand.d.ts.map +1 -1
- package/dist/cli/subcommands/subcommand.js.map +1 -1
- package/dist/cli/wizard.d.ts +72 -0
- package/dist/cli/wizard.d.ts.map +1 -0
- package/dist/cli/wizard.js +86 -0
- package/dist/cli/wizard.js.map +1 -0
- package/dist/harness/claude-code.d.ts.map +1 -1
- package/dist/harness/claude-code.js +10 -0
- package/dist/harness/claude-code.js.map +1 -1
- package/dist/harness/codex.d.ts.map +1 -1
- package/dist/harness/codex.js +1 -0
- package/dist/harness/codex.js.map +1 -1
- package/dist/harness/grok.d.ts.map +1 -1
- package/dist/harness/grok.js +4 -1
- package/dist/harness/grok.js.map +1 -1
- package/dist/harness/kilocode.d.ts.map +1 -1
- package/dist/harness/kilocode.js +1 -1
- package/dist/harness/kilocode.js.map +1 -1
- package/dist/harness/opencode.d.ts.map +1 -1
- package/dist/harness/opencode.js +10 -0
- package/dist/harness/opencode.js.map +1 -1
- package/dist/harness/profile.d.ts +23 -2
- package/dist/harness/profile.d.ts.map +1 -1
- package/dist/harness/profile.js.map +1 -1
- package/dist/harness/snippet.d.ts +14 -1
- package/dist/harness/snippet.d.ts.map +1 -1
- package/dist/harness/snippet.js +18 -2
- package/dist/harness/snippet.js.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/setup/recipe.d.ts +73 -0
- package/dist/setup/recipe.d.ts.map +1 -0
- package/dist/setup/recipe.js +76 -0
- package/dist/setup/recipe.js.map +1 -0
- package/dist/text/json-edit.d.ts +15 -1
- package/dist/text/json-edit.d.ts.map +1 -1
- package/dist/text/json-edit.js +76 -5
- package/dist/text/json-edit.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/harness/profile.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC;IACvB,gFAAgF;IAChF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,2FAA2F;IAC3F,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,iFAAiF;IACjF,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,sFAAsF;IACtF,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,YAAY,EAAE,SAAS,GAAG,kBAAkB,CAAC;IACtD,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAChD;;;;;OAKG;IACH,QAAQ,CAAC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,qBAAqB,GAAG,cAAc,GAChD,CAAC;IAAE,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;CAAE,CAAC,CAAC;AAE3E,0FAA0F;AAC1F,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,IAAI,qBAAqB,CAEjF;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,qBAAqB,GAAG,WAAW,CAUzE","sourcesContent":["import { shimFromSchema } from '../hooks/shim.ts';\nimport type { HarnessHookSchema, ShimAdapter } from '../hooks/shim.ts';\n\n/**\n * Everything smelt knows about one agent harness, in one place.\n *\n * Before this module existed, a harness's facts lived at seven edit sites: the\n * `HarnessId` union, the `HARNESSES` array, a shim file, a case in `planInstall`, a\n * case in `planRemove`, `MANAGED_EVENTS`, a test fixture — plus a hand-typed id list\n * in the `--harness` help text, which could not be derived because the registry lived\n * in `cli/hooks.ts` and `cli/hooks.ts` imports `CLI_NAME` from `cli/args.ts`. The\n * registry was in the wrong module, and the cycle was the proof.\n *\n * A `HarnessProfile` is the single adapter carrying every per-harness fact, and the\n * registry (`registry.ts`) is `Record<HarnessId, HarnessProfile>` so totality stays a\n * compile error: a new `HarnessId` without a profile does not build. It imports\n * nothing from `cli/`, so `cli/args.ts` derives the `--harness` list and every other\n * rendered view is derived too — the managed event names, the files a re-run reads its\n * toggles back from, the id list in an error message.\n *\n * Installing and removing are **data**, not switch statements: `install` is the list\n * of artefacts `smelt hooks install` writes for this harness, and each artefact's kind\n * is also how `smelt hooks remove` takes it back out — a JSON hook file is merged and\n * strip-merged, a marker block is upserted and stripped, a file that is entirely ours\n * is written and deleted. `planInstall`/`planRemove` fold over the list.\n *\n * The optional sections state capability, never invent it: a harness ships a shim\n * exactly when it carries a {@link hooks} schema (or, for a harness a table cannot\n * express, a hand-written {@link shim}), and only such a profile has a shim script\n * path. What a profile does not claim, the installer does not write.\n */\nexport interface HarnessProfile {\n readonly id: HarnessId;\n /** The harness's own name, as its makers spell it. Shown wherever a tier is. */\n readonly name: string;\n /**\n * The name a *list* of harnesses uses, where the maker's own spelling carries a\n * category suffix a list does not need — \"Codex CLI\" is \"Codex\" in a tier clause,\n * \"Hermes Agent\" is \"Hermes\". Optional, and defaulted by {@link harnessLabel} to\n * {@link name}: only a harness whose prose name differs from its full name carries\n * one, and it carries it here rather than in each of the four places a tier list is\n * rendered. \"Claude Code\" has no suffix to drop, and so has none.\n */\n readonly shortName?: string;\n readonly tier: HarnessTier;\n /** Paths (relative to the project) whose existence means \"this harness is in use here\". */\n readonly detect: readonly string[];\n /** Paths relative to the user's home directory — \"installed on this machine\". */\n readonly detectHome: readonly string[];\n /** The standing-instructions file this harness reads (capability matrix column d). */\n readonly instructionFile: string;\n /**\n * The standing-instructions layer — belt and braces under every shim, and the *only*\n * layer an advisory harness has:\n *\n * - `'snippet'`: upsert the shared marker-bracketed block into\n * {@link instructionFile} (a file several harnesses read, like `AGENTS.md`, is\n * planned once); `remove` strips the block and leaves every other byte.\n * - a renderer: a whole file this harness owns, snippet included — KiloCode's rules\n * file carries two manual enforcement legs the shared snippet has no room for;\n * `remove` deletes it.\n */\n readonly instructions: 'snippet' | HarnessFileContent;\n /** Caveats carried from the capability matrix, shown at install time. */\n readonly caveats: readonly string[];\n /**\n * Everything else `hooks install` writes for this harness, in the order it is\n * written and listed. Empty means instructions only: the advisory tier, where\n * nothing enforces anything and the output says so.\n */\n readonly install: readonly HarnessInstallStep[];\n /**\n * This harness's native pre-tool hook schema, as data. Present exactly when the\n * harness ships a shim script (`dist/hooks/shims/<id>.js`) — absent for the advisory\n * tier, and for opencode, whose hook API is a JavaScript plugin rather than a stdin\n * schema.\n */\n readonly hooks?: HarnessHookSchema;\n /**\n * The escape hatch: a hand-written adapter, for a harness whose schema a table\n * cannot express. Wins over {@link hooks} when both are present.\n */\n readonly shim?: ShimAdapter;\n}\n\n/** How much smelt is willing to claim about a harness. */\nexport type HarnessTier = 'verified' | 'experimental' | 'advisory';\n\n/**\n * Every harness the preset knows. The registry is keyed by this union, so adding an id\n * without writing its profile is a compile error — and the `--harness` help list, the\n * wizard's table and every error message read the registry, never a second list.\n */\nexport type HarnessId =\n | 'claude-code'\n | 'codex'\n | 'gemini'\n | 'grok'\n | 'hermes'\n | 'cursor'\n | 'opencode'\n | 'cline'\n | 'kilocode'\n | 'aider';\n\n/** One line of honesty per tier, shown wherever a tier label appears. */\nexport const TIER_HONESTY: Record<HarnessTier, string> = {\n verified: 'schema verified against primary docs and pinned by fixtures',\n experimental:\n 'schema mapped from the 2026-09-02 capability matrix, not yet smoke-tested against the real binary',\n advisory: 'no usable hook API — instructions only, nothing enforces them',\n};\n\n/**\n * The tiers, in the order every rendered tier list walks them — most claimed first.\n * {@link TIER_HONESTY}'s key order *is* that order, so a tier cannot exist without a\n * line saying what it means, and the order lives once.\n */\nexport const HARNESS_TIERS: readonly HarnessTier[] = Object.keys(TIER_HONESTY) as HarnessTier[];\n\n/**\n * How a list of harnesses spells this one: {@link HarnessProfile.shortName} where the\n * maker's own name carries a suffix a list does not need, else {@link\n * HarnessProfile.name}. The help's tier clause, the wizard's sentences and the site's\n * tier table all render through this, so they cannot spell a harness three ways.\n */\nexport function harnessLabel(profile: HarnessProfile): string {\n return profile.shortName ?? profile.name;\n}\n\n/**\n * What the wizard settled on, as the installer's renderers see it: the toggles, the\n * guard's settings, and the project directory every path is relative to. A renderer\n * takes this and returns bytes; nothing writes.\n */\nexport interface HarnessInstallContext {\n /** Project directory: every path a renderer emits is portable relative to it. */\n readonly cwd: string;\n readonly guard: boolean;\n readonly statsOnStop: boolean;\n readonly mapOnStart: boolean;\n /** Opt-in `smelt agents lint` at session start — shares SessionStart with the map. */\n readonly lintOnStart: boolean;\n readonly thresholdBytes: number;\n /** The `--budget` every suggested command and the snippet quote. */\n readonly budgetBytes: number;\n}\n\n/** A file's bytes, rendered from the wizard's choices. */\nexport type HarnessFileContent = (ctx: HarnessInstallContext) => string;\n\n/**\n * One artefact `hooks install` writes. The kind is also the un-write: `json-hooks` is\n * merged in and strip-merged out, `marker-block` is upserted and stripped,\n * `own-file` is written and deleted.\n */\nexport type HarnessInstallStep = HarnessJsonHooks | HarnessMarkerBlock | HarnessOwnFile;\n\n/**\n * A JSON settings/hooks file the harness reads. Our entries are merged in\n * byte-faithfully and, on `remove`, stripped back out with everything foreign left\n * exactly as it was.\n */\nexport interface HarnessJsonHooks {\n readonly kind: 'json-hooks';\n /** Project-relative path of the file. */\n readonly file: string;\n /** The pre-tool event, in this harness's spelling (`PreToolUse`, `BeforeTool`, …). */\n readonly event: string;\n /**\n * One hook entry per matcher — the tool names the guard wants to see. `undefined`\n * is a matcher-less entry, for a harness whose hook fires on every tool.\n */\n readonly matchers: readonly (string | undefined)[];\n /**\n * The entry shape: `'command-list'` is Claude Code's `{matcher, hooks:[{type,\n * command}]}`, which Codex, Gemini and Grok mirror; `'bare-command'` is Cursor's\n * `{command}`.\n */\n readonly entry: 'command-list' | 'bare-command';\n /**\n * True for a harness whose schema also carries the session-lifecycle events this\n * preset offers — `smelt stats` on Stop, `smelt map` and `smelt agents lint` on\n * SessionStart. The other\n * harnesses wire the guard only, and the wizard's toggles say so.\n */\n readonly lifecycle: boolean;\n /** Top-level keys a *fresh* file must carry (Cursor's `version: 1`). */\n readonly shape?: { readonly version: number };\n}\n\n/** A marker-bracketed block inside a file smelt shares with its owner. */\nexport interface HarnessMarkerBlock {\n readonly kind: 'marker-block';\n readonly file: string;\n readonly block: HarnessFileContent;\n /** The marker line opening the block — also how `remove` finds it. */\n readonly start: string;\n readonly end: string;\n /**\n * Refuse the file instead of editing it when it already carries `contains` and none\n * of ours: Codex's `config.toml` may have a hand-written `[features]` table, and an\n * installer that merged into it would be editing what it was never asked to.\n */\n readonly skipWhen?: { readonly contains: string; readonly why: string };\n}\n\n/** A file that is entirely smelt's: written whole, deleted whole. */\nexport interface HarnessOwnFile {\n readonly kind: 'own-file';\n readonly file: string;\n readonly content: HarnessFileContent;\n /** chmod after writing (Cline's hook must be executable). */\n readonly mode?: number;\n /** True when the file exists only to wire the guard — the guard toggle gates it. */\n readonly guardOnly: boolean;\n}\n\n/**\n * A profile that ships a shim script. Only these have a shim path: `shimScriptPath`\n * takes one, so a harness with no shim cannot name a script that was never built.\n */\nexport type ShimmedHarnessProfile = HarnessProfile &\n ({ readonly hooks: HarnessHookSchema } | { readonly shim: ShimAdapter });\n\n/** True for a profile that ships a shim script — the narrowing `shimScriptPath` needs. */\nexport function hasShim(profile: HarnessProfile): profile is ShimmedHarnessProfile {\n return profile.hooks !== undefined || profile.shim !== undefined;\n}\n\n/**\n * The adapter this profile's shim script runs: the one its {@link HarnessProfile.hooks}\n * schema describes, or the hand-written escape hatch where it carries one.\n */\nexport function shimAdapterOf(profile: ShimmedHarnessProfile): ShimAdapter {\n const { hooks, shim } = profile;\n if (shim !== undefined) return shim;\n /* v8 ignore next 5 -- unreachable: a ShimmedHarnessProfile carries one or the other */\n if (hooks === undefined) {\n throw new Error(\n `smelt: harness \"${profile.id}\" claims a shim but carries neither a hook schema nor an adapter.`,\n );\n }\n return shimFromSchema(hooks);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/harness/profile.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC;IACvB,gFAAgF;IAChF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,2FAA2F;IAC3F,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACn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AAC,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CACzE;AAED,qEAAqE;AACrE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,oFAAoF;IACpF,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,gDAAgD;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,qEAAqE;IACrE,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,qBAAqB,KAAK,OAAO,CAAC;CACzD;AAED;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,cAAc,GAChD,CAAC;IAAE,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;CAAE,CAAC,CAAC;AAE3E,0FAA0F;AAC1F,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,IAAI,qBAAqB,CAEjF;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,qBAAqB,GAAG,WAAW,CAUzE","sourcesContent":["import { shimFromSchema } from '../hooks/shim.ts';\nimport type { HarnessHookSchema, ShimAdapter } from '../hooks/shim.ts';\n\n/**\n * Everything smelt knows about one agent harness, in one place.\n *\n * Before this module existed, a harness's facts lived at seven edit sites: the\n * `HarnessId` union, the `HARNESSES` array, a shim file, a case in `planInstall`, a\n * case in `planRemove`, `MANAGED_EVENTS`, a test fixture — plus a hand-typed id list\n * in the `--harness` help text, which could not be derived because the registry lived\n * in `cli/hooks.ts` and `cli/hooks.ts` imports `CLI_NAME` from `cli/args.ts`. The\n * registry was in the wrong module, and the cycle was the proof.\n *\n * A `HarnessProfile` is the single adapter carrying every per-harness fact, and the\n * registry (`registry.ts`) is `Record<HarnessId, HarnessProfile>` so totality stays a\n * compile error: a new `HarnessId` without a profile does not build. It imports\n * nothing from `cli/`, so `cli/args.ts` derives the `--harness` list and every other\n * rendered view is derived too — the managed event names, the files a re-run reads its\n * toggles back from, the id list in an error message.\n *\n * Installing and removing are **data**, not switch statements: `install` is the list\n * of artefacts `smelt hooks install` writes for this harness, and each artefact's kind\n * is also how `smelt hooks remove` takes it back out — a JSON hook file is merged and\n * strip-merged, a marker block is upserted and stripped, a file that is entirely ours\n * is written and deleted. `planInstall`/`planRemove` fold over the list.\n *\n * The optional sections state capability, never invent it: a harness ships a shim\n * exactly when it carries a {@link hooks} schema (or, for a harness a table cannot\n * express, a hand-written {@link shim}), and only such a profile has a shim script\n * path. What a profile does not claim, the installer does not write.\n */\nexport interface HarnessProfile {\n readonly id: HarnessId;\n /** The harness's own name, as its makers spell it. Shown wherever a tier is. */\n readonly name: string;\n /**\n * The name a *list* of harnesses uses, where the maker's own spelling carries a\n * category suffix a list does not need — \"Codex CLI\" is \"Codex\" in a tier clause,\n * \"Hermes Agent\" is \"Hermes\". Optional, and defaulted by {@link harnessLabel} to\n * {@link name}: only a harness whose prose name differs from its full name carries\n * one, and it carries it here rather than in each of the four places a tier list is\n * rendered. \"Claude Code\" has no suffix to drop, and so has none.\n */\n readonly shortName?: string;\n readonly tier: HarnessTier;\n /** Paths (relative to the project) whose existence means \"this harness is in use here\". */\n readonly detect: readonly string[];\n /** Paths relative to the user's home directory — \"installed on this machine\". */\n readonly detectHome: readonly string[];\n /** The standing-instructions file this harness reads (capability matrix column d). */\n readonly instructionFile: string;\n /**\n * The standing-instructions layer — belt and braces under every shim, and the *only*\n * layer an advisory harness has:\n *\n * - `'snippet'`: upsert the shared marker-bracketed block into\n * {@link instructionFile} (a file several harnesses read, like `AGENTS.md`, is\n * planned once); `remove` strips the block and leaves every other byte.\n * - a renderer: a whole file this harness owns, snippet included — KiloCode's rules\n * file carries two manual enforcement legs the shared snippet has no room for;\n * `remove` deletes it.\n */\n readonly instructions: 'snippet' | HarnessFileContent;\n /** Caveats carried from the capability matrix, shown at install time. */\n readonly caveats: readonly string[];\n /**\n * Everything else `hooks install` writes for this harness, in the order it is\n * written and listed. Empty means instructions only: the advisory tier, where\n * nothing enforces anything and the output says so.\n */\n readonly install: readonly HarnessInstallStep[];\n /**\n * This harness's native pre-tool hook schema, as data. Present exactly when the\n * harness ships a shim script (`dist/hooks/shims/<id>.js`) — absent for the advisory\n * tier, and for opencode, whose hook API is a JavaScript plugin rather than a stdin\n * schema.\n */\n readonly hooks?: HarnessHookSchema;\n /**\n * The escape hatch: a hand-written adapter, for a harness whose schema a table\n * cannot express. Wins over {@link hooks} when both are present.\n */\n readonly shim?: ShimAdapter;\n}\n\n/** How much smelt is willing to claim about a harness. */\nexport type HarnessTier = 'verified' | 'experimental' | 'advisory';\n\n/**\n * Every harness the preset knows. The registry is keyed by this union, so adding an id\n * without writing its profile is a compile error — and the `--harness` help list, the\n * wizard's table and every error message read the registry, never a second list.\n */\nexport type HarnessId =\n | 'claude-code'\n | 'codex'\n | 'gemini'\n | 'grok'\n | 'hermes'\n | 'cursor'\n | 'opencode'\n | 'cline'\n | 'kilocode'\n | 'aider';\n\n/** One line of honesty per tier, shown wherever a tier label appears. */\nexport const TIER_HONESTY: Record<HarnessTier, string> = {\n verified: 'schema verified against primary docs and pinned by fixtures',\n experimental:\n 'schema mapped from the 2026-09-02 capability matrix, not yet smoke-tested against the real binary',\n advisory: 'no usable hook API — instructions only, nothing enforces them',\n};\n\n/**\n * The tiers, in the order every rendered tier list walks them — most claimed first.\n * {@link TIER_HONESTY}'s key order *is* that order, so a tier cannot exist without a\n * line saying what it means, and the order lives once.\n */\nexport const HARNESS_TIERS: readonly HarnessTier[] = Object.keys(TIER_HONESTY) as HarnessTier[];\n\n/**\n * How a list of harnesses spells this one: {@link HarnessProfile.shortName} where the\n * maker's own name carries a suffix a list does not need, else {@link\n * HarnessProfile.name}. The help's tier clause, the wizard's sentences and the site's\n * tier table all render through this, so they cannot spell a harness three ways.\n */\nexport function harnessLabel(profile: HarnessProfile): string {\n return profile.shortName ?? profile.name;\n}\n\n/**\n * What the wizard settled on, as the installer's renderers see it: the toggles, the\n * guard's settings, and the project directory every path is relative to. A renderer\n * takes this and returns bytes; nothing writes.\n */\nexport interface HarnessInstallContext {\n /** Project directory: every path a renderer emits is portable relative to it. */\n readonly cwd: string;\n /** The release writing these bytes — stamped into shared blocks for `smelt doctor`. */\n readonly writtenBy?: string;\n readonly guard: boolean;\n readonly statsOnStop: boolean;\n readonly mapOnStart: boolean;\n /** Opt-in `smelt agents lint` at session start — shares SessionStart with the map. */\n readonly lintOnStart: boolean;\n readonly thresholdBytes: number;\n /** The `--budget` every suggested command and the snippet quote. */\n readonly budgetBytes: number;\n}\n\n/** A file's bytes, rendered from the wizard's choices. */\nexport type HarnessFileContent = (ctx: HarnessInstallContext) => string;\n\n/**\n * One artefact `hooks install` writes. The kind is also the un-write: `json-hooks` is\n * merged in and strip-merged out, `marker-block` is upserted and stripped,\n * `own-file` is written and deleted, `mcp-registration` is nested-merged in and\n * lifted back out.\n */\nexport type HarnessInstallStep =\n HarnessJsonHooks | HarnessMarkerBlock | HarnessOwnFile | HarnessMcpRegistration;\n\n/**\n * A JSON settings/hooks file the harness reads. Our entries are merged in\n * byte-faithfully and, on `remove`, stripped back out with everything foreign left\n * exactly as it was.\n */\nexport interface HarnessJsonHooks {\n readonly kind: 'json-hooks';\n /** Project-relative path of the file. */\n readonly file: string;\n /** The pre-tool event, in this harness's spelling (`PreToolUse`, `BeforeTool`, …). */\n readonly event: string;\n /**\n * One hook entry per matcher — the tool names the guard wants to see. `undefined`\n * is a matcher-less entry, for a harness whose hook fires on every tool.\n */\n readonly matchers: readonly (string | undefined)[];\n /**\n * The entry shape: `'command-list'` is Claude Code's `{matcher, hooks:[{type,\n * command}]}`, which Codex, Gemini and Grok mirror; `'bare-command'` is Cursor's\n * `{command}`.\n */\n readonly entry: 'command-list' | 'bare-command';\n /**\n * True for a harness whose schema also carries the session-lifecycle events this\n * preset offers — `smelt stats` on Stop, `smelt map` and `smelt agents lint` on\n * SessionStart. The other\n * harnesses wire the guard only, and the wizard's toggles say so.\n */\n readonly lifecycle: boolean;\n /** Top-level keys a *fresh* file must carry (Cursor's `version: 1`). */\n readonly shape?: { readonly version: number };\n}\n\n/** A marker-bracketed block inside a file smelt shares with its owner. */\nexport interface HarnessMarkerBlock {\n readonly kind: 'marker-block';\n readonly file: string;\n readonly block: HarnessFileContent;\n /** The marker line opening the block — also how `remove` finds it. */\n readonly start: string;\n readonly end: string;\n /**\n * Refuse the file instead of editing it when it already carries `contains` and none\n * of ours: Codex's `config.toml` may have a hand-written `[features]` table, and an\n * installer that merged into it would be editing what it was never asked to.\n */\n readonly skipWhen?: { readonly contains: string; readonly why: string };\n}\n\n/** A file that is entirely smelt's: written whole, deleted whole. */\nexport interface HarnessOwnFile {\n readonly kind: 'own-file';\n readonly file: string;\n readonly content: HarnessFileContent;\n /** chmod after writing (Cline's hook must be executable). */\n readonly mode?: number;\n /** True when the file exists only to wire the guard — the guard toggle gates it. */\n readonly guardOnly: boolean;\n}\n\n/**\n * An MCP server registration inside a JSON config the harness reads — Claude Code's\n * `.mcp.json` (`mcpServers.smelt`), opencode's `opencode.json` (`mcp.smelt`). The\n * entry is merged in byte-faithfully beside any other servers the user registered,\n * and on `remove` it is lifted back out; a container this install created empty is\n * removed with it, so a file that never carried the key round-trips byte-identical.\n * Harnesses whose registration is TOML (Codex, Grok) do not declare this step — a\n * hand-edit into TOML is exactly the edit `text/json-edit.ts` exists to refuse.\n */\nexport interface HarnessMcpRegistration {\n readonly kind: 'mcp-registration';\n /** Project-relative path of the config file. */\n readonly file: string;\n /** The container key, then the server's name: `['mcpServers', 'smelt']`. */\n readonly path: readonly [string, string];\n /** The server entry as a JSON value — the bytes are the editor's. */\n readonly entry: (ctx: HarnessInstallContext) => unknown;\n}\n\n/**\n * A profile that ships a shim script. Only these have a shim path: `shimScriptPath`\n * takes one, so a harness with no shim cannot name a script that was never built.\n */\nexport type ShimmedHarnessProfile = HarnessProfile &\n ({ readonly hooks: HarnessHookSchema } | { readonly shim: ShimAdapter });\n\n/** True for a profile that ships a shim script — the narrowing `shimScriptPath` needs. */\nexport function hasShim(profile: HarnessProfile): profile is ShimmedHarnessProfile {\n return profile.hooks !== undefined || profile.shim !== undefined;\n}\n\n/**\n * The adapter this profile's shim script runs: the one its {@link HarnessProfile.hooks}\n * schema describes, or the hand-written escape hatch where it carries one.\n */\nexport function shimAdapterOf(profile: ShimmedHarnessProfile): ShimAdapter {\n const { hooks, shim } = profile;\n if (shim !== undefined) return shim;\n /* v8 ignore next 5 -- unreachable: a ShimmedHarnessProfile carries one or the other */\n if (hooks === undefined) {\n throw new Error(\n `smelt: harness \"${profile.id}\" claims a shim but carries neither a hook schema nor an adapter.`,\n );\n }\n return shimFromSchema(hooks);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/harness/profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAyGlD,yEAAyE;AACzE,MAAM,CAAC,MAAM,YAAY,GAAgC;IACvD,QAAQ,EAAE,6DAA6D;IACvE,YAAY,EACV,mGAAmG;IACrG,QAAQ,EAAE,+DAA+D;CAC1E,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAA2B,MAAM,CAAC,IAAI,CAAC,YAAY,CAAkB,CAAC;AAEhG;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,OAAuB;IAClD,OAAO,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;AAC3C,CAAC;AAiGD,0FAA0F;AAC1F,MAAM,UAAU,OAAO,CAAC,OAAuB;IAC7C,OAAO,OAAO,CAAC,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC;AACnE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,OAA8B;IAC1D,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAChC,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACpC,uFAAuF;IACvF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,mBAAmB,OAAO,CAAC,EAAE,mEAAmE,CACjG,CAAC;IACJ,CAAC;IACD,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["import { shimFromSchema } from '../hooks/shim.ts';\nimport type { HarnessHookSchema, ShimAdapter } from '../hooks/shim.ts';\n\n/**\n * Everything smelt knows about one agent harness, in one place.\n *\n * Before this module existed, a harness's facts lived at seven edit sites: the\n * `HarnessId` union, the `HARNESSES` array, a shim file, a case in `planInstall`, a\n * case in `planRemove`, `MANAGED_EVENTS`, a test fixture — plus a hand-typed id list\n * in the `--harness` help text, which could not be derived because the registry lived\n * in `cli/hooks.ts` and `cli/hooks.ts` imports `CLI_NAME` from `cli/args.ts`. The\n * registry was in the wrong module, and the cycle was the proof.\n *\n * A `HarnessProfile` is the single adapter carrying every per-harness fact, and the\n * registry (`registry.ts`) is `Record<HarnessId, HarnessProfile>` so totality stays a\n * compile error: a new `HarnessId` without a profile does not build. It imports\n * nothing from `cli/`, so `cli/args.ts` derives the `--harness` list and every other\n * rendered view is derived too — the managed event names, the files a re-run reads its\n * toggles back from, the id list in an error message.\n *\n * Installing and removing are **data**, not switch statements: `install` is the list\n * of artefacts `smelt hooks install` writes for this harness, and each artefact's kind\n * is also how `smelt hooks remove` takes it back out — a JSON hook file is merged and\n * strip-merged, a marker block is upserted and stripped, a file that is entirely ours\n * is written and deleted. `planInstall`/`planRemove` fold over the list.\n *\n * The optional sections state capability, never invent it: a harness ships a shim\n * exactly when it carries a {@link hooks} schema (or, for a harness a table cannot\n * express, a hand-written {@link shim}), and only such a profile has a shim script\n * path. What a profile does not claim, the installer does not write.\n */\nexport interface HarnessProfile {\n readonly id: HarnessId;\n /** The harness's own name, as its makers spell it. Shown wherever a tier is. */\n readonly name: string;\n /**\n * The name a *list* of harnesses uses, where the maker's own spelling carries a\n * category suffix a list does not need — \"Codex CLI\" is \"Codex\" in a tier clause,\n * \"Hermes Agent\" is \"Hermes\". Optional, and defaulted by {@link harnessLabel} to\n * {@link name}: only a harness whose prose name differs from its full name carries\n * one, and it carries it here rather than in each of the four places a tier list is\n * rendered. \"Claude Code\" has no suffix to drop, and so has none.\n */\n readonly shortName?: string;\n readonly tier: HarnessTier;\n /** Paths (relative to the project) whose existence means \"this harness is in use here\". */\n readonly detect: readonly string[];\n /** Paths relative to the user's home directory — \"installed on this machine\". */\n readonly detectHome: readonly string[];\n /** The standing-instructions file this harness reads (capability matrix column d). */\n readonly instructionFile: string;\n /**\n * The standing-instructions layer — belt and braces under every shim, and the *only*\n * layer an advisory harness has:\n *\n * - `'snippet'`: upsert the shared marker-bracketed block into\n * {@link instructionFile} (a file several harnesses read, like `AGENTS.md`, is\n * planned once); `remove` strips the block and leaves every other byte.\n * - a renderer: a whole file this harness owns, snippet included — KiloCode's rules\n * file carries two manual enforcement legs the shared snippet has no room for;\n * `remove` deletes it.\n */\n readonly instructions: 'snippet' | HarnessFileContent;\n /** Caveats carried from the capability matrix, shown at install time. */\n readonly caveats: readonly string[];\n /**\n * Everything else `hooks install` writes for this harness, in the order it is\n * written and listed. Empty means instructions only: the advisory tier, where\n * nothing enforces anything and the output says so.\n */\n readonly install: readonly HarnessInstallStep[];\n /**\n * This harness's native pre-tool hook schema, as data. Present exactly when the\n * harness ships a shim script (`dist/hooks/shims/<id>.js`) — absent for the advisory\n * tier, and for opencode, whose hook API is a JavaScript plugin rather than a stdin\n * schema.\n */\n readonly hooks?: HarnessHookSchema;\n /**\n * The escape hatch: a hand-written adapter, for a harness whose schema a table\n * cannot express. Wins over {@link hooks} when both are present.\n */\n readonly shim?: ShimAdapter;\n}\n\n/** How much smelt is willing to claim about a harness. */\nexport type HarnessTier = 'verified' | 'experimental' | 'advisory';\n\n/**\n * Every harness the preset knows. The registry is keyed by this union, so adding an id\n * without writing its profile is a compile error — and the `--harness` help list, the\n * wizard's table and every error message read the registry, never a second list.\n */\nexport type HarnessId =\n | 'claude-code'\n | 'codex'\n | 'gemini'\n | 'grok'\n | 'hermes'\n | 'cursor'\n | 'opencode'\n | 'cline'\n | 'kilocode'\n | 'aider';\n\n/** One line of honesty per tier, shown wherever a tier label appears. */\nexport const TIER_HONESTY: Record<HarnessTier, string> = {\n verified: 'schema verified against primary docs and pinned by fixtures',\n experimental:\n 'schema mapped from the 2026-09-02 capability matrix, not yet smoke-tested against the real binary',\n advisory: 'no usable hook API — instructions only, nothing enforces them',\n};\n\n/**\n * The tiers, in the order every rendered tier list walks them — most claimed first.\n * {@link TIER_HONESTY}'s key order *is* that order, so a tier cannot exist without a\n * line saying what it means, and the order lives once.\n */\nexport const HARNESS_TIERS: readonly HarnessTier[] = Object.keys(TIER_HONESTY) as HarnessTier[];\n\n/**\n * How a list of harnesses spells this one: {@link HarnessProfile.shortName} where the\n * maker's own name carries a suffix a list does not need, else {@link\n * HarnessProfile.name}. The help's tier clause, the wizard's sentences and the site's\n * tier table all render through this, so they cannot spell a harness three ways.\n */\nexport function harnessLabel(profile: HarnessProfile): string {\n return profile.shortName ?? profile.name;\n}\n\n/**\n * What the wizard settled on, as the installer's renderers see it: the toggles, the\n * guard's settings, and the project directory every path is relative to. A renderer\n * takes this and returns bytes; nothing writes.\n */\nexport interface HarnessInstallContext {\n /** Project directory: every path a renderer emits is portable relative to it. */\n readonly cwd: string;\n readonly guard: boolean;\n readonly statsOnStop: boolean;\n readonly mapOnStart: boolean;\n /** Opt-in `smelt agents lint` at session start — shares SessionStart with the map. */\n readonly lintOnStart: boolean;\n readonly thresholdBytes: number;\n /** The `--budget` every suggested command and the snippet quote. */\n readonly budgetBytes: number;\n}\n\n/** A file's bytes, rendered from the wizard's choices. */\nexport type HarnessFileContent = (ctx: HarnessInstallContext) => string;\n\n/**\n * One artefact `hooks install` writes. The kind is also the un-write: `json-hooks` is\n * merged in and strip-merged out, `marker-block` is upserted and stripped,\n * `own-file` is written and deleted.\n */\nexport type HarnessInstallStep = HarnessJsonHooks | HarnessMarkerBlock | HarnessOwnFile;\n\n/**\n * A JSON settings/hooks file the harness reads. Our entries are merged in\n * byte-faithfully and, on `remove`, stripped back out with everything foreign left\n * exactly as it was.\n */\nexport interface HarnessJsonHooks {\n readonly kind: 'json-hooks';\n /** Project-relative path of the file. */\n readonly file: string;\n /** The pre-tool event, in this harness's spelling (`PreToolUse`, `BeforeTool`, …). */\n readonly event: string;\n /**\n * One hook entry per matcher — the tool names the guard wants to see. `undefined`\n * is a matcher-less entry, for a harness whose hook fires on every tool.\n */\n readonly matchers: readonly (string | undefined)[];\n /**\n * The entry shape: `'command-list'` is Claude Code's `{matcher, hooks:[{type,\n * command}]}`, which Codex, Gemini and Grok mirror; `'bare-command'` is Cursor's\n * `{command}`.\n */\n readonly entry: 'command-list' | 'bare-command';\n /**\n * True for a harness whose schema also carries the session-lifecycle events this\n * preset offers — `smelt stats` on Stop, `smelt map` and `smelt agents lint` on\n * SessionStart. The other\n * harnesses wire the guard only, and the wizard's toggles say so.\n */\n readonly lifecycle: boolean;\n /** Top-level keys a *fresh* file must carry (Cursor's `version: 1`). */\n readonly shape?: { readonly version: number };\n}\n\n/** A marker-bracketed block inside a file smelt shares with its owner. */\nexport interface HarnessMarkerBlock {\n readonly kind: 'marker-block';\n readonly file: string;\n readonly block: HarnessFileContent;\n /** The marker line opening the block — also how `remove` finds it. */\n readonly start: string;\n readonly end: string;\n /**\n * Refuse the file instead of editing it when it already carries `contains` and none\n * of ours: Codex's `config.toml` may have a hand-written `[features]` table, and an\n * installer that merged into it would be editing what it was never asked to.\n */\n readonly skipWhen?: { readonly contains: string; readonly why: string };\n}\n\n/** A file that is entirely smelt's: written whole, deleted whole. */\nexport interface HarnessOwnFile {\n readonly kind: 'own-file';\n readonly file: string;\n readonly content: HarnessFileContent;\n /** chmod after writing (Cline's hook must be executable). */\n readonly mode?: number;\n /** True when the file exists only to wire the guard — the guard toggle gates it. */\n readonly guardOnly: boolean;\n}\n\n/**\n * A profile that ships a shim script. Only these have a shim path: `shimScriptPath`\n * takes one, so a harness with no shim cannot name a script that was never built.\n */\nexport type ShimmedHarnessProfile = HarnessProfile &\n ({ readonly hooks: HarnessHookSchema } | { readonly shim: ShimAdapter });\n\n/** True for a profile that ships a shim script — the narrowing `shimScriptPath` needs. */\nexport function hasShim(profile: HarnessProfile): profile is ShimmedHarnessProfile {\n return profile.hooks !== undefined || profile.shim !== undefined;\n}\n\n/**\n * The adapter this profile's shim script runs: the one its {@link HarnessProfile.hooks}\n * schema describes, or the hand-written escape hatch where it carries one.\n */\nexport function shimAdapterOf(profile: ShimmedHarnessProfile): ShimAdapter {\n const { hooks, shim } = profile;\n if (shim !== undefined) return shim;\n /* v8 ignore next 5 -- unreachable: a ShimmedHarnessProfile carries one or the other */\n if (hooks === undefined) {\n throw new Error(\n `smelt: harness \"${profile.id}\" claims a shim but carries neither a hook schema nor an adapter.`,\n );\n }\n return shimFromSchema(hooks);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/harness/profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAyGlD,yEAAyE;AACzE,MAAM,CAAC,MAAM,YAAY,GAAgC;IACvD,QAAQ,EAAE,6DAA6D;IACvE,YAAY,EACV,mGAAmG;IACrG,QAAQ,EAAE,+DAA+D;CAC1E,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAA2B,MAAM,CAAC,IAAI,CAAC,YAAY,CAAkB,CAAC;AAEhG;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,OAAuB;IAClD,OAAO,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;AAC3C,CAAC;AAwHD,0FAA0F;AAC1F,MAAM,UAAU,OAAO,CAAC,OAAuB;IAC7C,OAAO,OAAO,CAAC,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC;AACnE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,OAA8B;IAC1D,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAChC,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACpC,uFAAuF;IACvF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,mBAAmB,OAAO,CAAC,EAAE,mEAAmE,CACjG,CAAC;IACJ,CAAC;IACD,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["import { shimFromSchema } from '../hooks/shim.ts';\nimport type { HarnessHookSchema, ShimAdapter } from '../hooks/shim.ts';\n\n/**\n * Everything smelt knows about one agent harness, in one place.\n *\n * Before this module existed, a harness's facts lived at seven edit sites: the\n * `HarnessId` union, the `HARNESSES` array, a shim file, a case in `planInstall`, a\n * case in `planRemove`, `MANAGED_EVENTS`, a test fixture — plus a hand-typed id list\n * in the `--harness` help text, which could not be derived because the registry lived\n * in `cli/hooks.ts` and `cli/hooks.ts` imports `CLI_NAME` from `cli/args.ts`. The\n * registry was in the wrong module, and the cycle was the proof.\n *\n * A `HarnessProfile` is the single adapter carrying every per-harness fact, and the\n * registry (`registry.ts`) is `Record<HarnessId, HarnessProfile>` so totality stays a\n * compile error: a new `HarnessId` without a profile does not build. It imports\n * nothing from `cli/`, so `cli/args.ts` derives the `--harness` list and every other\n * rendered view is derived too — the managed event names, the files a re-run reads its\n * toggles back from, the id list in an error message.\n *\n * Installing and removing are **data**, not switch statements: `install` is the list\n * of artefacts `smelt hooks install` writes for this harness, and each artefact's kind\n * is also how `smelt hooks remove` takes it back out — a JSON hook file is merged and\n * strip-merged, a marker block is upserted and stripped, a file that is entirely ours\n * is written and deleted. `planInstall`/`planRemove` fold over the list.\n *\n * The optional sections state capability, never invent it: a harness ships a shim\n * exactly when it carries a {@link hooks} schema (or, for a harness a table cannot\n * express, a hand-written {@link shim}), and only such a profile has a shim script\n * path. What a profile does not claim, the installer does not write.\n */\nexport interface HarnessProfile {\n readonly id: HarnessId;\n /** The harness's own name, as its makers spell it. Shown wherever a tier is. */\n readonly name: string;\n /**\n * The name a *list* of harnesses uses, where the maker's own spelling carries a\n * category suffix a list does not need — \"Codex CLI\" is \"Codex\" in a tier clause,\n * \"Hermes Agent\" is \"Hermes\". Optional, and defaulted by {@link harnessLabel} to\n * {@link name}: only a harness whose prose name differs from its full name carries\n * one, and it carries it here rather than in each of the four places a tier list is\n * rendered. \"Claude Code\" has no suffix to drop, and so has none.\n */\n readonly shortName?: string;\n readonly tier: HarnessTier;\n /** Paths (relative to the project) whose existence means \"this harness is in use here\". */\n readonly detect: readonly string[];\n /** Paths relative to the user's home directory — \"installed on this machine\". */\n readonly detectHome: readonly string[];\n /** The standing-instructions file this harness reads (capability matrix column d). */\n readonly instructionFile: string;\n /**\n * The standing-instructions layer — belt and braces under every shim, and the *only*\n * layer an advisory harness has:\n *\n * - `'snippet'`: upsert the shared marker-bracketed block into\n * {@link instructionFile} (a file several harnesses read, like `AGENTS.md`, is\n * planned once); `remove` strips the block and leaves every other byte.\n * - a renderer: a whole file this harness owns, snippet included — KiloCode's rules\n * file carries two manual enforcement legs the shared snippet has no room for;\n * `remove` deletes it.\n */\n readonly instructions: 'snippet' | HarnessFileContent;\n /** Caveats carried from the capability matrix, shown at install time. */\n readonly caveats: readonly string[];\n /**\n * Everything else `hooks install` writes for this harness, in the order it is\n * written and listed. Empty means instructions only: the advisory tier, where\n * nothing enforces anything and the output says so.\n */\n readonly install: readonly HarnessInstallStep[];\n /**\n * This harness's native pre-tool hook schema, as data. Present exactly when the\n * harness ships a shim script (`dist/hooks/shims/<id>.js`) — absent for the advisory\n * tier, and for opencode, whose hook API is a JavaScript plugin rather than a stdin\n * schema.\n */\n readonly hooks?: HarnessHookSchema;\n /**\n * The escape hatch: a hand-written adapter, for a harness whose schema a table\n * cannot express. Wins over {@link hooks} when both are present.\n */\n readonly shim?: ShimAdapter;\n}\n\n/** How much smelt is willing to claim about a harness. */\nexport type HarnessTier = 'verified' | 'experimental' | 'advisory';\n\n/**\n * Every harness the preset knows. The registry is keyed by this union, so adding an id\n * without writing its profile is a compile error — and the `--harness` help list, the\n * wizard's table and every error message read the registry, never a second list.\n */\nexport type HarnessId =\n | 'claude-code'\n | 'codex'\n | 'gemini'\n | 'grok'\n | 'hermes'\n | 'cursor'\n | 'opencode'\n | 'cline'\n | 'kilocode'\n | 'aider';\n\n/** One line of honesty per tier, shown wherever a tier label appears. */\nexport const TIER_HONESTY: Record<HarnessTier, string> = {\n verified: 'schema verified against primary docs and pinned by fixtures',\n experimental:\n 'schema mapped from the 2026-09-02 capability matrix, not yet smoke-tested against the real binary',\n advisory: 'no usable hook API — instructions only, nothing enforces them',\n};\n\n/**\n * The tiers, in the order every rendered tier list walks them — most claimed first.\n * {@link TIER_HONESTY}'s key order *is* that order, so a tier cannot exist without a\n * line saying what it means, and the order lives once.\n */\nexport const HARNESS_TIERS: readonly HarnessTier[] = Object.keys(TIER_HONESTY) as HarnessTier[];\n\n/**\n * How a list of harnesses spells this one: {@link HarnessProfile.shortName} where the\n * maker's own name carries a suffix a list does not need, else {@link\n * HarnessProfile.name}. The help's tier clause, the wizard's sentences and the site's\n * tier table all render through this, so they cannot spell a harness three ways.\n */\nexport function harnessLabel(profile: HarnessProfile): string {\n return profile.shortName ?? profile.name;\n}\n\n/**\n * What the wizard settled on, as the installer's renderers see it: the toggles, the\n * guard's settings, and the project directory every path is relative to. A renderer\n * takes this and returns bytes; nothing writes.\n */\nexport interface HarnessInstallContext {\n /** Project directory: every path a renderer emits is portable relative to it. */\n readonly cwd: string;\n /** The release writing these bytes — stamped into shared blocks for `smelt doctor`. */\n readonly writtenBy?: string;\n readonly guard: boolean;\n readonly statsOnStop: boolean;\n readonly mapOnStart: boolean;\n /** Opt-in `smelt agents lint` at session start — shares SessionStart with the map. */\n readonly lintOnStart: boolean;\n readonly thresholdBytes: number;\n /** The `--budget` every suggested command and the snippet quote. */\n readonly budgetBytes: number;\n}\n\n/** A file's bytes, rendered from the wizard's choices. */\nexport type HarnessFileContent = (ctx: HarnessInstallContext) => string;\n\n/**\n * One artefact `hooks install` writes. The kind is also the un-write: `json-hooks` is\n * merged in and strip-merged out, `marker-block` is upserted and stripped,\n * `own-file` is written and deleted, `mcp-registration` is nested-merged in and\n * lifted back out.\n */\nexport type HarnessInstallStep =\n HarnessJsonHooks | HarnessMarkerBlock | HarnessOwnFile | HarnessMcpRegistration;\n\n/**\n * A JSON settings/hooks file the harness reads. Our entries are merged in\n * byte-faithfully and, on `remove`, stripped back out with everything foreign left\n * exactly as it was.\n */\nexport interface HarnessJsonHooks {\n readonly kind: 'json-hooks';\n /** Project-relative path of the file. */\n readonly file: string;\n /** The pre-tool event, in this harness's spelling (`PreToolUse`, `BeforeTool`, …). */\n readonly event: string;\n /**\n * One hook entry per matcher — the tool names the guard wants to see. `undefined`\n * is a matcher-less entry, for a harness whose hook fires on every tool.\n */\n readonly matchers: readonly (string | undefined)[];\n /**\n * The entry shape: `'command-list'` is Claude Code's `{matcher, hooks:[{type,\n * command}]}`, which Codex, Gemini and Grok mirror; `'bare-command'` is Cursor's\n * `{command}`.\n */\n readonly entry: 'command-list' | 'bare-command';\n /**\n * True for a harness whose schema also carries the session-lifecycle events this\n * preset offers — `smelt stats` on Stop, `smelt map` and `smelt agents lint` on\n * SessionStart. The other\n * harnesses wire the guard only, and the wizard's toggles say so.\n */\n readonly lifecycle: boolean;\n /** Top-level keys a *fresh* file must carry (Cursor's `version: 1`). */\n readonly shape?: { readonly version: number };\n}\n\n/** A marker-bracketed block inside a file smelt shares with its owner. */\nexport interface HarnessMarkerBlock {\n readonly kind: 'marker-block';\n readonly file: string;\n readonly block: HarnessFileContent;\n /** The marker line opening the block — also how `remove` finds it. */\n readonly start: string;\n readonly end: string;\n /**\n * Refuse the file instead of editing it when it already carries `contains` and none\n * of ours: Codex's `config.toml` may have a hand-written `[features]` table, and an\n * installer that merged into it would be editing what it was never asked to.\n */\n readonly skipWhen?: { readonly contains: string; readonly why: string };\n}\n\n/** A file that is entirely smelt's: written whole, deleted whole. */\nexport interface HarnessOwnFile {\n readonly kind: 'own-file';\n readonly file: string;\n readonly content: HarnessFileContent;\n /** chmod after writing (Cline's hook must be executable). */\n readonly mode?: number;\n /** True when the file exists only to wire the guard — the guard toggle gates it. */\n readonly guardOnly: boolean;\n}\n\n/**\n * An MCP server registration inside a JSON config the harness reads — Claude Code's\n * `.mcp.json` (`mcpServers.smelt`), opencode's `opencode.json` (`mcp.smelt`). The\n * entry is merged in byte-faithfully beside any other servers the user registered,\n * and on `remove` it is lifted back out; a container this install created empty is\n * removed with it, so a file that never carried the key round-trips byte-identical.\n * Harnesses whose registration is TOML (Codex, Grok) do not declare this step — a\n * hand-edit into TOML is exactly the edit `text/json-edit.ts` exists to refuse.\n */\nexport interface HarnessMcpRegistration {\n readonly kind: 'mcp-registration';\n /** Project-relative path of the config file. */\n readonly file: string;\n /** The container key, then the server's name: `['mcpServers', 'smelt']`. */\n readonly path: readonly [string, string];\n /** The server entry as a JSON value — the bytes are the editor's. */\n readonly entry: (ctx: HarnessInstallContext) => unknown;\n}\n\n/**\n * A profile that ships a shim script. Only these have a shim path: `shimScriptPath`\n * takes one, so a harness with no shim cannot name a script that was never built.\n */\nexport type ShimmedHarnessProfile = HarnessProfile &\n ({ readonly hooks: HarnessHookSchema } | { readonly shim: ShimAdapter });\n\n/** True for a profile that ships a shim script — the narrowing `shimScriptPath` needs. */\nexport function hasShim(profile: HarnessProfile): profile is ShimmedHarnessProfile {\n return profile.hooks !== undefined || profile.shim !== undefined;\n}\n\n/**\n * The adapter this profile's shim script runs: the one its {@link HarnessProfile.hooks}\n * schema describes, or the hand-written escape hatch where it carries one.\n */\nexport function shimAdapterOf(profile: ShimmedHarnessProfile): ShimAdapter {\n const { hooks, shim } = profile;\n if (shim !== undefined) return shim;\n /* v8 ignore next 5 -- unreachable: a ShimmedHarnessProfile carries one or the other */\n if (hooks === undefined) {\n throw new Error(\n `smelt: harness \"${profile.id}\" claims a shim but carries neither a hook schema nor an adapter.`,\n );\n }\n return shimFromSchema(hooks);\n}\n"]}
|
|
@@ -10,10 +10,23 @@ export declare const SNIPPET_START_HASH = "# smelt:hooks v1 start";
|
|
|
10
10
|
export declare const SNIPPET_END_HASH = "# smelt:hooks v1 end";
|
|
11
11
|
/** Substring that identifies a file (or JSON hook entry) as written by this installer. */
|
|
12
12
|
export declare const OURS_TOKEN = "smelt:hooks";
|
|
13
|
+
/**
|
|
14
|
+
* The version stamp, as the block's second line: which release wrote these bytes.
|
|
15
|
+
* The markers above stay byte-stable across releases — an upgrade must find the old
|
|
16
|
+
* block to replace it — so the version travels *inside* the block, where replacing
|
|
17
|
+
* the block replaces it. `smelt doctor` reads it back with {@link snippetStampVersion};
|
|
18
|
+
* a block without the line was written before stamping existed, and doctor says so
|
|
19
|
+
* instead of guessing a version nobody recorded.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SNIPPET_STAMP_LINE: (version: string) => string;
|
|
22
|
+
/** The version a block was written by, or `undefined` when it predates stamping. */
|
|
23
|
+
export declare function snippetStampVersion(text: string): string | undefined;
|
|
13
24
|
/**
|
|
14
25
|
* The instruction snippet — belt and braces under every shim, and the *only* layer
|
|
15
26
|
* for advisory harnesses. It teaches the three commands, and in particular what to do
|
|
16
27
|
* after a guard deny: run the named replacement, then `smelt retrieve` per marker.
|
|
28
|
+
* `writtenBy` stamps the block for `smelt doctor`; omitted (legacy callers) the block
|
|
29
|
+
* simply carries no version line.
|
|
17
30
|
*/
|
|
18
|
-
export declare function instructionSnippet(thresholdBytes: number, budgetBytes: number): string;
|
|
31
|
+
export declare function instructionSnippet(thresholdBytes: number, budgetBytes: number, writtenBy?: string): string;
|
|
19
32
|
//# sourceMappingURL=snippet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snippet.d.ts","sourceRoot":"","sources":["../../src/harness/snippet.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,oFAAoF;AACpF,eAAO,MAAM,gBAAgB,kCAAkC,CAAC;AAChE,eAAO,MAAM,cAAc,gCAAgC,CAAC;AAC5D,eAAO,MAAM,kBAAkB,2BAA2B,CAAC;AAC3D,eAAO,MAAM,gBAAgB,yBAAyB,CAAC;AAEvD,0FAA0F;AAC1F,eAAO,MAAM,UAAU,gBAAgB,CAAC;AAExC
|
|
1
|
+
{"version":3,"file":"snippet.d.ts","sourceRoot":"","sources":["../../src/harness/snippet.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,oFAAoF;AACpF,eAAO,MAAM,gBAAgB,kCAAkC,CAAC;AAChE,eAAO,MAAM,cAAc,gCAAgC,CAAC;AAC5D,eAAO,MAAM,kBAAkB,2BAA2B,CAAC;AAC3D,eAAO,MAAM,gBAAgB,yBAAyB,CAAC;AAEvD,0FAA0F;AAC1F,eAAO,MAAM,UAAU,gBAAgB,CAAC;AAExC;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,YAAa,MAAM,KAAG,MACO,CAAC;AAE7D,oFAAoF;AACpF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIpE;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAuBR","sourcesContent":["/**\n * The text every harness shares: the marker lines that bracket a block this installer\n * owns inside somebody else's file, the token that identifies a hook entry as ours,\n * and the instruction snippet itself.\n */\n\n/** Marker lines bracketing every block this installer owns inside a shared file. */\nexport const SNIPPET_START_MD = '<!-- smelt:hooks v1 start -->';\nexport const SNIPPET_END_MD = '<!-- smelt:hooks v1 end -->';\nexport const SNIPPET_START_HASH = '# smelt:hooks v1 start';\nexport const SNIPPET_END_HASH = '# smelt:hooks v1 end';\n\n/** Substring that identifies a file (or JSON hook entry) as written by this installer. */\nexport const OURS_TOKEN = 'smelt:hooks';\n\n/**\n * The version stamp, as the block's second line: which release wrote these bytes.\n * The markers above stay byte-stable across releases — an upgrade must find the old\n * block to replace it — so the version travels *inside* the block, where replacing\n * the block replaces it. `smelt doctor` reads it back with {@link snippetStampVersion};\n * a block without the line was written before stamping existed, and doctor says so\n * instead of guessing a version nobody recorded.\n */\nexport const SNIPPET_STAMP_LINE = (version: string): string =>\n `<!-- smelt:hooks written-by @smeltjs/core ${version} -->`;\n\n/** The version a block was written by, or `undefined` when it predates stamping. */\nexport function snippetStampVersion(text: string): string | undefined {\n return /<!-- smelt:hooks written-by @smeltjs\\/core (\\d+\\.\\d+\\.\\d+)(?:[-+][^>]*)? -->/u.exec(\n text,\n )?.[1];\n}\n\n/**\n * The instruction snippet — belt and braces under every shim, and the *only* layer\n * for advisory harnesses. It teaches the three commands, and in particular what to do\n * after a guard deny: run the named replacement, then `smelt retrieve` per marker.\n * `writtenBy` stamps the block for `smelt doctor`; omitted (legacy callers) the block\n * simply carries no version line.\n */\nexport function instructionSnippet(\n thresholdBytes: number,\n budgetBytes: number,\n writtenBy?: string,\n): string {\n const stamp = writtenBy === undefined ? '' : `${SNIPPET_STAMP_LINE(writtenBy)}\\n`;\n return `${SNIPPET_START_MD}\n${stamp}\n## smelt — context discipline\n\nThis project uses [smelt](https://github.com/smeltjs/smelt) to keep large tool output\nout of the context window, reversibly.\n\n- Do not read files over ${String(thresholdBytes)} bytes raw. Run\n \\`smelt <file> --budget ${String(budgetBytes)} --focus <what you are looking for>\\`\n instead (repeat \\`--focus\\` per term). Focused regions survive verbatim; everything\n else collapses into a one-line marker stating what was removed.\n- Every marker ends in \\`retrieve(\"hash\")\\`. \\`smelt retrieve <hash>\\` prints the\n exact original bytes back. Retrieve what you actually need — retrievals are counted,\n and \\`smelt stats\\` reports the honest expansion rate.\n- For orientation, \\`smelt map . --budget ${String(budgetBytes)}\\` prints a ranked\n symbol map of the repository.\n- If a smelt guard hook denies a raw read, run the exact replacement command named in\n the denial, then \\`smelt retrieve\\` any marker you need expanded.\n\n${SNIPPET_END_MD}\n`;\n}\n"]}
|
package/dist/harness/snippet.js
CHANGED
|
@@ -10,14 +10,30 @@ export const SNIPPET_START_HASH = '# smelt:hooks v1 start';
|
|
|
10
10
|
export const SNIPPET_END_HASH = '# smelt:hooks v1 end';
|
|
11
11
|
/** Substring that identifies a file (or JSON hook entry) as written by this installer. */
|
|
12
12
|
export const OURS_TOKEN = 'smelt:hooks';
|
|
13
|
+
/**
|
|
14
|
+
* The version stamp, as the block's second line: which release wrote these bytes.
|
|
15
|
+
* The markers above stay byte-stable across releases — an upgrade must find the old
|
|
16
|
+
* block to replace it — so the version travels *inside* the block, where replacing
|
|
17
|
+
* the block replaces it. `smelt doctor` reads it back with {@link snippetStampVersion};
|
|
18
|
+
* a block without the line was written before stamping existed, and doctor says so
|
|
19
|
+
* instead of guessing a version nobody recorded.
|
|
20
|
+
*/
|
|
21
|
+
export const SNIPPET_STAMP_LINE = (version) => `<!-- smelt:hooks written-by @smeltjs/core ${version} -->`;
|
|
22
|
+
/** The version a block was written by, or `undefined` when it predates stamping. */
|
|
23
|
+
export function snippetStampVersion(text) {
|
|
24
|
+
return /<!-- smelt:hooks written-by @smeltjs\/core (\d+\.\d+\.\d+)(?:[-+][^>]*)? -->/u.exec(text)?.[1];
|
|
25
|
+
}
|
|
13
26
|
/**
|
|
14
27
|
* The instruction snippet — belt and braces under every shim, and the *only* layer
|
|
15
28
|
* for advisory harnesses. It teaches the three commands, and in particular what to do
|
|
16
29
|
* after a guard deny: run the named replacement, then `smelt retrieve` per marker.
|
|
30
|
+
* `writtenBy` stamps the block for `smelt doctor`; omitted (legacy callers) the block
|
|
31
|
+
* simply carries no version line.
|
|
17
32
|
*/
|
|
18
|
-
export function instructionSnippet(thresholdBytes, budgetBytes) {
|
|
33
|
+
export function instructionSnippet(thresholdBytes, budgetBytes, writtenBy) {
|
|
34
|
+
const stamp = writtenBy === undefined ? '' : `${SNIPPET_STAMP_LINE(writtenBy)}\n`;
|
|
19
35
|
return `${SNIPPET_START_MD}
|
|
20
|
-
|
|
36
|
+
${stamp}
|
|
21
37
|
## smelt — context discipline
|
|
22
38
|
|
|
23
39
|
This project uses [smelt](https://github.com/smeltjs/smelt) to keep large tool output
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snippet.js","sourceRoot":"","sources":["../../src/harness/snippet.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,oFAAoF;AACpF,MAAM,CAAC,MAAM,gBAAgB,GAAG,+BAA+B,CAAC;AAChE,MAAM,CAAC,MAAM,cAAc,GAAG,6BAA6B,CAAC;AAC5D,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,CAAC;AAC3D,MAAM,CAAC,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAEvD,0FAA0F;AAC1F,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC;AAExC
|
|
1
|
+
{"version":3,"file":"snippet.js","sourceRoot":"","sources":["../../src/harness/snippet.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,oFAAoF;AACpF,MAAM,CAAC,MAAM,gBAAgB,GAAG,+BAA+B,CAAC;AAChE,MAAM,CAAC,MAAM,cAAc,GAAG,6BAA6B,CAAC;AAC5D,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,CAAC;AAC3D,MAAM,CAAC,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAEvD,0FAA0F;AAC1F,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC;AAExC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAe,EAAU,EAAE,CAC5D,6CAA6C,OAAO,MAAM,CAAC;AAE7D,oFAAoF;AACpF,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAO,+EAA+E,CAAC,IAAI,CACzF,IAAI,CACL,EAAE,CAAC,CAAC,CAAC,CAAC;AACT,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,cAAsB,EACtB,WAAmB,EACnB,SAAkB;IAElB,MAAM,KAAK,GAAG,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,kBAAkB,CAAC,SAAS,CAAC,IAAI,CAAC;IAClF,OAAO,GAAG,gBAAgB;EAC1B,KAAK;;;;;;2BAMoB,MAAM,CAAC,cAAc,CAAC;4BACrB,MAAM,CAAC,WAAW,CAAC;;;;;;4CAMH,MAAM,CAAC,WAAW,CAAC;;;;;EAK7D,cAAc;CACf,CAAC;AACF,CAAC","sourcesContent":["/**\n * The text every harness shares: the marker lines that bracket a block this installer\n * owns inside somebody else's file, the token that identifies a hook entry as ours,\n * and the instruction snippet itself.\n */\n\n/** Marker lines bracketing every block this installer owns inside a shared file. */\nexport const SNIPPET_START_MD = '<!-- smelt:hooks v1 start -->';\nexport const SNIPPET_END_MD = '<!-- smelt:hooks v1 end -->';\nexport const SNIPPET_START_HASH = '# smelt:hooks v1 start';\nexport const SNIPPET_END_HASH = '# smelt:hooks v1 end';\n\n/** Substring that identifies a file (or JSON hook entry) as written by this installer. */\nexport const OURS_TOKEN = 'smelt:hooks';\n\n/**\n * The version stamp, as the block's second line: which release wrote these bytes.\n * The markers above stay byte-stable across releases — an upgrade must find the old\n * block to replace it — so the version travels *inside* the block, where replacing\n * the block replaces it. `smelt doctor` reads it back with {@link snippetStampVersion};\n * a block without the line was written before stamping existed, and doctor says so\n * instead of guessing a version nobody recorded.\n */\nexport const SNIPPET_STAMP_LINE = (version: string): string =>\n `<!-- smelt:hooks written-by @smeltjs/core ${version} -->`;\n\n/** The version a block was written by, or `undefined` when it predates stamping. */\nexport function snippetStampVersion(text: string): string | undefined {\n return /<!-- smelt:hooks written-by @smeltjs\\/core (\\d+\\.\\d+\\.\\d+)(?:[-+][^>]*)? -->/u.exec(\n text,\n )?.[1];\n}\n\n/**\n * The instruction snippet — belt and braces under every shim, and the *only* layer\n * for advisory harnesses. It teaches the three commands, and in particular what to do\n * after a guard deny: run the named replacement, then `smelt retrieve` per marker.\n * `writtenBy` stamps the block for `smelt doctor`; omitted (legacy callers) the block\n * simply carries no version line.\n */\nexport function instructionSnippet(\n thresholdBytes: number,\n budgetBytes: number,\n writtenBy?: string,\n): string {\n const stamp = writtenBy === undefined ? '' : `${SNIPPET_STAMP_LINE(writtenBy)}\\n`;\n return `${SNIPPET_START_MD}\n${stamp}\n## smelt — context discipline\n\nThis project uses [smelt](https://github.com/smeltjs/smelt) to keep large tool output\nout of the context window, reversibly.\n\n- Do not read files over ${String(thresholdBytes)} bytes raw. Run\n \\`smelt <file> --budget ${String(budgetBytes)} --focus <what you are looking for>\\`\n instead (repeat \\`--focus\\` per term). Focused regions survive verbatim; everything\n else collapses into a one-line marker stating what was removed.\n- Every marker ends in \\`retrieve(\"hash\")\\`. \\`smelt retrieve <hash>\\` prints the\n exact original bytes back. Retrieve what you actually need — retrievals are counted,\n and \\`smelt stats\\` reports the honest expansion rate.\n- For orientation, \\`smelt map . --budget ${String(budgetBytes)}\\` prints a ranked\n symbol map of the repository.\n- If a smelt guard hook denies a raw read, run the exact replacement command named in\n the denial, then \\`smelt retrieve\\` any marker you need expanded.\n\n${SNIPPET_END_MD}\n`;\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -48,8 +48,20 @@ export { CONFIG_FILE_NAME, CONFIG_VERSION, configuredStore, findConfigFile, load
|
|
|
48
48
|
export type { ConfiguredStore, LoadedConfig, SmeltConfig, SmeltConfigStore } from './cli/config.ts';
|
|
49
49
|
export { MEASURE_STUB_FILE, measureStubSource, RERANK_STUB_FILE, rerankStubSource, runInit, } from './cli/init.ts';
|
|
50
50
|
export type { InitIo } from './cli/init.ts';
|
|
51
|
+
export { runSetup } from './cli/setup.ts';
|
|
52
|
+
export type { SetupCheck, SetupFileAction, SetupIo, SetupOptions, SetupReceipt, } from './cli/setup.ts';
|
|
53
|
+
export { runDoctor } from './cli/doctor.ts';
|
|
54
|
+
export type { DoctorBlock, DoctorConfig, DoctorIo, DoctorMcp, DoctorOptions, DoctorReceipt, } from './cli/doctor.ts';
|
|
51
55
|
export { retrieveStats } from './stats.ts';
|
|
52
56
|
export type { RawRetrieveCounters } from './stats.ts';
|
|
57
|
+
/**
|
|
58
|
+
* The SetupRecipe: the one true way to put smelt on a machine, as data. Public for the
|
|
59
|
+
* same reason the harness views are — something outside this package renders it (the
|
|
60
|
+
* site's fact generator), and the docs and skill are pinned to it rather than retyping
|
|
61
|
+
* it. See `src/setup/recipe.ts`.
|
|
62
|
+
*/
|
|
63
|
+
export { SETUP_RECIPE, SETUP_STEPS } from './setup/recipe.ts';
|
|
64
|
+
export type { SetupRecipe, SetupStep } from './setup/recipe.ts';
|
|
53
65
|
export { LANGUAGE_PROFILES, profileFor, profileForPath, structuralLanguages, } from './lang/registry.ts';
|
|
54
66
|
export type { LanguageProfile, LanguageStructure, RepoMapFacts } from './lang/profile.ts';
|
|
55
67
|
/**
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,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,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,YAAY,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACnF,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACrF,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,YAAY,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;;;;GAKG;AACH,OAAO,EACL,WAAW,EACX,eAAe,EACf,cAAc,EACd,OAAO,EACP,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,aAAa,EACb,SAAS,GACV,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,WAAW,EACX,YAAY,EACZ,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,UAAU,GACX,MAAM,gBAAgB,CAAC;AAExB;;;;GAIG;AACH,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC","sourcesContent":["import type { ApplyOptions, MarkerBuilder, MarkerInfo } from './apply.ts';\n\n/**\n * The public surface: a barrel over the modules that hold the reasoning.\n *\n * `createSmelter()` itself lives in `./smelter.ts` so that nothing inside `src/` has\n * to import this file to build a smelter — the CLI's default verb does exactly that,\n * and a barrel that imports the CLI which imports the barrel is a cycle whose only\n * symptom is a registry evaluating to `undefined` in whichever module the loader\n * entered first. Every name is re-exported here, so consumers see no difference.\n */\n\nexport type { ApplyOptions, MarkerBuilder, MarkerInfo };\nexport {\n applyPlan,\n defaultMarker,\n MARKER_FORMAT_VERSION,\n markerPricing,\n reconstruct,\n} from './apply.ts';\nexport { detectLanguage, SUPPORTED_LANGUAGES } from './detect.ts';\nexport * from './errors.ts';\nexport { contentHash, HASH_LENGTH } from './hash.ts';\nexport {\n ALLOWED_NODE_BUILTINS,\n ALLOWED_PACKAGES,\n ALLOWED_URL_SCHEMES,\n assertLocalResource,\n FORBIDDEN_GLOBALS,\n FORBIDDEN_NODE_MODULES,\n FORBIDDEN_PACKAGES,\n} from './net/policy.ts';\nexport type { LocalResource } from './net/policy.ts';\nexport { clearGrammarCache, grammarPath, loadGrammar, WASM_BY_LANGUAGE } from './plan/grammar.ts';\nexport { AUTO_PLANNER_ID, AutoPlanner, planAuto } from './plan/auto.ts';\nexport type { AutoPlannerOptions } from './plan/auto.ts';\nexport { LEXICAL_PLANNER_ID, LexicalPlanner, planLexical } from './plan/lexical.ts';\nexport type { LexicalPlannerOptions } from './plan/lexical.ts';\nexport { DEFAULT_STRATEGY, isStrategy, PLANNERS, STRATEGIES } from './plan/planners.ts';\nexport type { PlannerFactoryOptions } from './plan/planners.ts';\nexport {\n isStructuralLanguage,\n planStructural,\n STRUCTURAL_LANGUAGES,\n STRUCTURAL_PLANNER_ID,\n StructuralPlanner,\n} from './plan/structural.ts';\nexport type { StructuralLanguage, StructuralPlannerOptions } from './plan/structural.ts';\nexport { createRetrieveTool, RETRIEVE_TOOL_NAME } from './retrieve.ts';\nexport { unconfiguredDistillStage, unconfiguredRerankStage } from './stages.ts';\nexport { MemoryElisionStore } from './store.ts';\nexport {\n DIRECTORY_STORE_FORMAT,\n DIRECTORY_STORE_VERSION,\n DirectoryElisionStore,\n} from './store-dir.ts';\nexport type { DirectoryElisionStoreOptions } from './store-dir.ts';\nexport * from './types.ts';\nexport {\n CLI_JSON_FORMAT,\n CLI_NAME,\n cliUsage,\n EXIT,\n formatReport,\n parseSmeltArgs,\n runCli,\n} from './cli/run.ts';\nexport type { AnswerStream, CliIo, CliJsonEnvelope, SmeltInvocation } from './cli/run.ts';\nexport {\n ANTHROPIC_PROMPT_CACHE_FACTS,\n CACHE_BREAKER_RULES,\n detectCacheBreakers,\n findPrefixDivergence,\n} from './cache/prefix.ts';\nexport type {\n CacheWarning,\n PrefixDivergence,\n PromptStructure,\n PromptTool,\n} from './cache/prefix.ts';\nexport { MARKER_LINE_COMMENT_LEADERS, markerForLanguage } from './apply.ts';\nexport {\n buildRepoMap,\n DEFAULT_REPO_IGNORE,\n REPO_MAP_CACHE_CORRUPT_RULE,\n REPO_MAP_ID,\n REPO_MAP_PATH_ONLY_RULE,\n REPO_MAP_RANKED_RULE,\n REPO_MAP_UNREFERENCED_RULE,\n} from './repomap/map.ts';\nexport type {\n RepoMap,\n RepoMapCacheCounts,\n RepoMapEntry,\n RepoMapOptions,\n RepoMapPathEntry,\n RepoMapReason,\n RepoMapWarning,\n} from './repomap/map.ts';\nexport { PAGERANK_DAMPING, PAGERANK_ITERATIONS, rankDefinitions } from './repomap/rank.ts';\nexport type { FileTagsEntry, RankedDefinition } from './repomap/rank.ts';\nexport { extractTags } from './repomap/tags.ts';\nexport type { DefinitionTag, FileTags, ReferenceTag } from './repomap/tags.ts';\nexport { TAGS_CACHE_FORMAT, TAGS_CACHE_VERSION, tagsCacheKey } from './repomap/cache.ts';\nexport { nodeFsReader } from './repomap/reader.ts';\nexport type { DirEntry, FileStat, RepoReader } from './repomap/reader.ts';\nexport {\n CONFIG_FILE_NAME,\n CONFIG_VERSION,\n configuredStore,\n findConfigFile,\n loadNearestConfig,\n parseConfig,\n renderConfig,\n resolveStorePath,\n} from './cli/config.ts';\nexport type { ConfiguredStore, LoadedConfig, SmeltConfig, SmeltConfigStore } from './cli/config.ts';\nexport {\n MEASURE_STUB_FILE,\n measureStubSource,\n RERANK_STUB_FILE,\n rerankStubSource,\n runInit,\n} from './cli/init.ts';\nexport type { InitIo } from './cli/init.ts';\nexport { retrieveStats } from './stats.ts';\nexport type { RawRetrieveCounters } from './stats.ts';\nexport {\n LANGUAGE_PROFILES,\n profileFor,\n profileForPath,\n structuralLanguages,\n} from './lang/registry.ts';\nexport type { LanguageProfile, LanguageStructure, RepoMapFacts } from './lang/profile.ts';\n/**\n * The harness registry's rendered views. Public for the same reason the ops seam is:\n * something outside this package renders them — the site's `facts.json` generator —\n * and the alternative is a second copy of the tier table typed into a React component,\n * which is exactly the drift `harnessesByTier()` exists to end.\n */\nexport { harnessesByTier, harnessNames, HARNESSES, HARNESS_IDS } from './harness/registry.ts';\nexport type { HarnessTierGroup } from './harness/registry.ts';\nexport { harnessLabel, HARNESS_TIERS, TIER_HONESTY } from './harness/profile.ts';\nexport type { HarnessId, HarnessTier } from './harness/profile.ts';\nexport { resolveRun } from './cli/subcommands/smelt.ts';\nexport type { ResolvedRun } from './cli/subcommands/smelt.ts';\nexport { REPO_MAP_FOCUS_RULE } from './repomap/map.ts';\nexport { CLI_MAP_JSON_FORMAT, formatMapReport, resolveMapRun } from './cli/run.ts';\nexport type { CliInvocation, CliMapJsonEnvelope, MapInvocation } from './cli/run.ts';\nexport type { MapReportInput } from './cli/report.ts';\nexport type { ResolvedMapRun } from './cli/subcommands/map.ts';\n\n/**\n * The operations seam — the four verbs and the laws their inputs must satisfy, below\n * every front door. `@smeltjs/mcp` consumes these as an ordinary dependency, so the\n * `smelt` CLI and the MCP tools run the same middle instead of two copies of it. See\n * `src/ops/index.ts` for what belongs here and what stays in an adapter.\n */\nexport {\n budgetFault,\n budgetMalformed,\n budgetRequired,\n mapTree,\n openStore,\n readBlob,\n readCounters,\n readTree,\n resolveStrategy,\n retrieveBytes,\n smeltBlob,\n} from './ops/index.ts';\nexport type {\n BudgetFault,\n BudgetNaming,\n MapTreeOp,\n ReadCountersOp,\n ResolvedStrategy,\n RetrieveBytesOp,\n Ruling,\n SmeltBlobOp,\n SmeltBlobOutcome,\n StrategySource,\n TreeNaming,\n} from './ops/index.ts';\n\n/**\n * Which planner a smelter uses, named by string. The names, their factories, and this\n * type all come from the one {@link PLANNERS} registry in `src/plan/planners.ts`, so\n * the CLI's validation and help text cannot drift from what `createSmelter` builds.\n */\nexport type { Strategy } from './plan/planners.ts';\n\nexport { createSmelter } from './smelter.ts';\nexport type { Smelter, SmelterConfig, SmeltCallOptions } from './smelter.ts';\n"]}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE1E;;;;;;;;GAQG;AAEH,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC;AACxD,OAAO,EACL,SAAS,EACT,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClE,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAClG,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACxE,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpF,YAAY,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAA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,cAAc,EACd,OAAO,EACP,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,aAAa,EACb,SAAS,GACV,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,WAAW,EACX,YAAY,EACZ,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,UAAU,GACX,MAAM,gBAAgB,CAAC;AAExB;;;;GAIG;AACH,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC","sourcesContent":["import type { ApplyOptions, MarkerBuilder, MarkerInfo } from './apply.ts';\n\n/**\n * The public surface: a barrel over the modules that hold the reasoning.\n *\n * `createSmelter()` itself lives in `./smelter.ts` so that nothing inside `src/` has\n * to import this file to build a smelter — the CLI's default verb does exactly that,\n * and a barrel that imports the CLI which imports the barrel is a cycle whose only\n * symptom is a registry evaluating to `undefined` in whichever module the loader\n * entered first. Every name is re-exported here, so consumers see no difference.\n */\n\nexport type { ApplyOptions, MarkerBuilder, MarkerInfo };\nexport {\n applyPlan,\n defaultMarker,\n MARKER_FORMAT_VERSION,\n markerPricing,\n reconstruct,\n} from './apply.ts';\nexport { detectLanguage, SUPPORTED_LANGUAGES } from './detect.ts';\nexport * from './errors.ts';\nexport { contentHash, HASH_LENGTH } from './hash.ts';\nexport {\n ALLOWED_NODE_BUILTINS,\n ALLOWED_PACKAGES,\n ALLOWED_URL_SCHEMES,\n assertLocalResource,\n FORBIDDEN_GLOBALS,\n FORBIDDEN_NODE_MODULES,\n FORBIDDEN_PACKAGES,\n} from './net/policy.ts';\nexport type { LocalResource } from './net/policy.ts';\nexport { clearGrammarCache, grammarPath, loadGrammar, WASM_BY_LANGUAGE } from './plan/grammar.ts';\nexport { AUTO_PLANNER_ID, AutoPlanner, planAuto } from './plan/auto.ts';\nexport type { AutoPlannerOptions } from './plan/auto.ts';\nexport { LEXICAL_PLANNER_ID, LexicalPlanner, planLexical } from './plan/lexical.ts';\nexport type { LexicalPlannerOptions } from './plan/lexical.ts';\nexport { DEFAULT_STRATEGY, isStrategy, PLANNERS, STRATEGIES } from './plan/planners.ts';\nexport type { PlannerFactoryOptions } from './plan/planners.ts';\nexport {\n isStructuralLanguage,\n planStructural,\n STRUCTURAL_LANGUAGES,\n STRUCTURAL_PLANNER_ID,\n StructuralPlanner,\n} from './plan/structural.ts';\nexport type { StructuralLanguage, StructuralPlannerOptions } from './plan/structural.ts';\nexport { createRetrieveTool, RETRIEVE_TOOL_NAME } from './retrieve.ts';\nexport { unconfiguredDistillStage, unconfiguredRerankStage } from './stages.ts';\nexport { MemoryElisionStore } from './store.ts';\nexport {\n DIRECTORY_STORE_FORMAT,\n DIRECTORY_STORE_VERSION,\n DirectoryElisionStore,\n} from './store-dir.ts';\nexport type { DirectoryElisionStoreOptions } from './store-dir.ts';\nexport * from './types.ts';\nexport {\n CLI_JSON_FORMAT,\n CLI_NAME,\n cliUsage,\n EXIT,\n formatReport,\n parseSmeltArgs,\n runCli,\n} from './cli/run.ts';\nexport type { AnswerStream, CliIo, CliJsonEnvelope, SmeltInvocation } from './cli/run.ts';\nexport {\n ANTHROPIC_PROMPT_CACHE_FACTS,\n CACHE_BREAKER_RULES,\n detectCacheBreakers,\n findPrefixDivergence,\n} from './cache/prefix.ts';\nexport type {\n CacheWarning,\n PrefixDivergence,\n PromptStructure,\n PromptTool,\n} from './cache/prefix.ts';\nexport { MARKER_LINE_COMMENT_LEADERS, markerForLanguage } from './apply.ts';\nexport {\n buildRepoMap,\n DEFAULT_REPO_IGNORE,\n REPO_MAP_CACHE_CORRUPT_RULE,\n REPO_MAP_ID,\n REPO_MAP_PATH_ONLY_RULE,\n REPO_MAP_RANKED_RULE,\n REPO_MAP_UNREFERENCED_RULE,\n} from './repomap/map.ts';\nexport type {\n RepoMap,\n RepoMapCacheCounts,\n RepoMapEntry,\n RepoMapOptions,\n RepoMapPathEntry,\n RepoMapReason,\n RepoMapWarning,\n} from './repomap/map.ts';\nexport { PAGERANK_DAMPING, PAGERANK_ITERATIONS, rankDefinitions } from './repomap/rank.ts';\nexport type { FileTagsEntry, RankedDefinition } from './repomap/rank.ts';\nexport { extractTags } from './repomap/tags.ts';\nexport type { DefinitionTag, FileTags, ReferenceTag } from './repomap/tags.ts';\nexport { TAGS_CACHE_FORMAT, TAGS_CACHE_VERSION, tagsCacheKey } from './repomap/cache.ts';\nexport { nodeFsReader } from './repomap/reader.ts';\nexport type { DirEntry, FileStat, RepoReader } from './repomap/reader.ts';\nexport {\n CONFIG_FILE_NAME,\n CONFIG_VERSION,\n configuredStore,\n findConfigFile,\n loadNearestConfig,\n parseConfig,\n renderConfig,\n resolveStorePath,\n} from './cli/config.ts';\nexport type { ConfiguredStore, LoadedConfig, SmeltConfig, SmeltConfigStore } from './cli/config.ts';\nexport {\n MEASURE_STUB_FILE,\n measureStubSource,\n RERANK_STUB_FILE,\n rerankStubSource,\n runInit,\n} from './cli/init.ts';\nexport type { InitIo } from './cli/init.ts';\nexport { runSetup } from './cli/setup.ts';\nexport type {\n SetupCheck,\n SetupFileAction,\n SetupIo,\n SetupOptions,\n SetupReceipt,\n} from './cli/setup.ts';\nexport { runDoctor } from './cli/doctor.ts';\nexport type {\n DoctorBlock,\n DoctorConfig,\n DoctorIo,\n DoctorMcp,\n DoctorOptions,\n DoctorReceipt,\n} from './cli/doctor.ts';\nexport { retrieveStats } from './stats.ts';\nexport type { RawRetrieveCounters } from './stats.ts';\n\n/**\n * The SetupRecipe: the one true way to put smelt on a machine, as data. Public for the\n * same reason the harness views are — something outside this package renders it (the\n * site's fact generator), and the docs and skill are pinned to it rather than retyping\n * it. See `src/setup/recipe.ts`.\n */\nexport { SETUP_RECIPE, SETUP_STEPS } from './setup/recipe.ts';\nexport type { SetupRecipe, SetupStep } from './setup/recipe.ts';\nexport {\n LANGUAGE_PROFILES,\n profileFor,\n profileForPath,\n structuralLanguages,\n} from './lang/registry.ts';\nexport type { LanguageProfile, LanguageStructure, RepoMapFacts } from './lang/profile.ts';\n/**\n * The harness registry's rendered views. Public for the same reason the ops seam is:\n * something outside this package renders them — the site's `facts.json` generator —\n * and the alternative is a second copy of the tier table typed into a React component,\n * which is exactly the drift `harnessesByTier()` exists to end.\n */\nexport { harnessesByTier, harnessNames, HARNESSES, HARNESS_IDS } from './harness/registry.ts';\nexport type { HarnessTierGroup } from './harness/registry.ts';\nexport { harnessLabel, HARNESS_TIERS, TIER_HONESTY } from './harness/profile.ts';\nexport type { HarnessId, HarnessTier } from './harness/profile.ts';\nexport { resolveRun } from './cli/subcommands/smelt.ts';\nexport type { ResolvedRun } from './cli/subcommands/smelt.ts';\nexport { REPO_MAP_FOCUS_RULE } from './repomap/map.ts';\nexport { CLI_MAP_JSON_FORMAT, formatMapReport, resolveMapRun } from './cli/run.ts';\nexport type { CliInvocation, CliMapJsonEnvelope, MapInvocation } from './cli/run.ts';\nexport type { MapReportInput } from './cli/report.ts';\nexport type { ResolvedMapRun } from './cli/subcommands/map.ts';\n\n/**\n * The operations seam — the four verbs and the laws their inputs must satisfy, below\n * every front door. `@smeltjs/mcp` consumes these as an ordinary dependency, so the\n * `smelt` CLI and the MCP tools run the same middle instead of two copies of it. See\n * `src/ops/index.ts` for what belongs here and what stays in an adapter.\n */\nexport {\n budgetFault,\n budgetMalformed,\n budgetRequired,\n mapTree,\n openStore,\n readBlob,\n readCounters,\n readTree,\n resolveStrategy,\n retrieveBytes,\n smeltBlob,\n} from './ops/index.ts';\nexport type {\n BudgetFault,\n BudgetNaming,\n MapTreeOp,\n ReadCountersOp,\n ResolvedStrategy,\n RetrieveBytesOp,\n Ruling,\n SmeltBlobOp,\n SmeltBlobOutcome,\n StrategySource,\n TreeNaming,\n} from './ops/index.ts';\n\n/**\n * Which planner a smelter uses, named by string. The names, their factories, and this\n * type all come from the one {@link PLANNERS} registry in `src/plan/planners.ts`, so\n * the CLI's validation and help text cannot drift from what `createSmelter` builds.\n */\nexport type { Strategy } from './plan/planners.ts';\n\nexport { createSmelter } from './smelter.ts';\nexport type { Smelter, SmelterConfig, SmeltCallOptions } from './smelter.ts';\n"]}
|
package/dist/index.js
CHANGED
|
@@ -23,7 +23,16 @@ export { TAGS_CACHE_FORMAT, TAGS_CACHE_VERSION, tagsCacheKey } from './repomap/c
|
|
|
23
23
|
export { nodeFsReader } from './repomap/reader.js';
|
|
24
24
|
export { CONFIG_FILE_NAME, CONFIG_VERSION, configuredStore, findConfigFile, loadNearestConfig, parseConfig, renderConfig, resolveStorePath, } from './cli/config.js';
|
|
25
25
|
export { MEASURE_STUB_FILE, measureStubSource, RERANK_STUB_FILE, rerankStubSource, runInit, } from './cli/init.js';
|
|
26
|
+
export { runSetup } from './cli/setup.js';
|
|
27
|
+
export { runDoctor } from './cli/doctor.js';
|
|
26
28
|
export { retrieveStats } from './stats.js';
|
|
29
|
+
/**
|
|
30
|
+
* The SetupRecipe: the one true way to put smelt on a machine, as data. Public for the
|
|
31
|
+
* same reason the harness views are — something outside this package renders it (the
|
|
32
|
+
* site's fact generator), and the docs and skill are pinned to it rather than retyping
|
|
33
|
+
* it. See `src/setup/recipe.ts`.
|
|
34
|
+
*/
|
|
35
|
+
export { SETUP_RECIPE, SETUP_STEPS } from './setup/recipe.js';
|
|
27
36
|
export { LANGUAGE_PROFILES, profileFor, profileForPath, structuralLanguages, } from './lang/registry.js';
|
|
28
37
|
/**
|
|
29
38
|
* The harness registry's rendered views. Public for the same reason the ops seam is:
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,SAAS,EACT,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,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e,EACf,cAAc,EACd,OAAO,EACP,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,aAAa,EACb,SAAS,GACV,MAAM,gBAAgB,CAAC;AAsBxB,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC","sourcesContent":["import type { ApplyOptions, MarkerBuilder, MarkerInfo } from './apply.ts';\n\n/**\n * The public surface: a barrel over the modules that hold the reasoning.\n *\n * `createSmelter()` itself lives in `./smelter.ts` so that nothing inside `src/` has\n * to import this file to build a smelter — the CLI's default verb does exactly that,\n * and a barrel that imports the CLI which imports the barrel is a cycle whose only\n * symptom is a registry evaluating to `undefined` in whichever module the loader\n * entered first. Every name is re-exported here, so consumers see no difference.\n */\n\nexport type { ApplyOptions, MarkerBuilder, MarkerInfo };\nexport {\n applyPlan,\n defaultMarker,\n MARKER_FORMAT_VERSION,\n markerPricing,\n reconstruct,\n} from './apply.ts';\nexport { detectLanguage, SUPPORTED_LANGUAGES } from './detect.ts';\nexport * from './errors.ts';\nexport { contentHash, HASH_LENGTH } from './hash.ts';\nexport {\n ALLOWED_NODE_BUILTINS,\n ALLOWED_PACKAGES,\n ALLOWED_URL_SCHEMES,\n assertLocalResource,\n FORBIDDEN_GLOBALS,\n FORBIDDEN_NODE_MODULES,\n FORBIDDEN_PACKAGES,\n} from './net/policy.ts';\nexport type { LocalResource } from './net/policy.ts';\nexport { clearGrammarCache, grammarPath, loadGrammar, WASM_BY_LANGUAGE } from './plan/grammar.ts';\nexport { AUTO_PLANNER_ID, AutoPlanner, planAuto } from './plan/auto.ts';\nexport type { AutoPlannerOptions } from './plan/auto.ts';\nexport { LEXICAL_PLANNER_ID, LexicalPlanner, planLexical } from './plan/lexical.ts';\nexport type { LexicalPlannerOptions } from './plan/lexical.ts';\nexport { DEFAULT_STRATEGY, isStrategy, PLANNERS, STRATEGIES } from './plan/planners.ts';\nexport type { PlannerFactoryOptions } from './plan/planners.ts';\nexport {\n isStructuralLanguage,\n planStructural,\n STRUCTURAL_LANGUAGES,\n STRUCTURAL_PLANNER_ID,\n StructuralPlanner,\n} from './plan/structural.ts';\nexport type { StructuralLanguage, StructuralPlannerOptions } from './plan/structural.ts';\nexport { createRetrieveTool, RETRIEVE_TOOL_NAME } from './retrieve.ts';\nexport { unconfiguredDistillStage, unconfiguredRerankStage } from './stages.ts';\nexport { MemoryElisionStore } from './store.ts';\nexport {\n DIRECTORY_STORE_FORMAT,\n DIRECTORY_STORE_VERSION,\n DirectoryElisionStore,\n} from './store-dir.ts';\nexport type { DirectoryElisionStoreOptions } from './store-dir.ts';\nexport * from './types.ts';\nexport {\n CLI_JSON_FORMAT,\n CLI_NAME,\n cliUsage,\n EXIT,\n formatReport,\n parseSmeltArgs,\n runCli,\n} from './cli/run.ts';\nexport type { AnswerStream, CliIo, CliJsonEnvelope, SmeltInvocation } from './cli/run.ts';\nexport {\n ANTHROPIC_PROMPT_CACHE_FACTS,\n CACHE_BREAKER_RULES,\n detectCacheBreakers,\n findPrefixDivergence,\n} from './cache/prefix.ts';\nexport type {\n CacheWarning,\n PrefixDivergence,\n PromptStructure,\n PromptTool,\n} from './cache/prefix.ts';\nexport { MARKER_LINE_COMMENT_LEADERS, markerForLanguage } from './apply.ts';\nexport {\n buildRepoMap,\n DEFAULT_REPO_IGNORE,\n REPO_MAP_CACHE_CORRUPT_RULE,\n REPO_MAP_ID,\n REPO_MAP_PATH_ONLY_RULE,\n REPO_MAP_RANKED_RULE,\n REPO_MAP_UNREFERENCED_RULE,\n} from './repomap/map.ts';\nexport type {\n RepoMap,\n RepoMapCacheCounts,\n RepoMapEntry,\n RepoMapOptions,\n RepoMapPathEntry,\n RepoMapReason,\n RepoMapWarning,\n} from './repomap/map.ts';\nexport { PAGERANK_DAMPING, PAGERANK_ITERATIONS, rankDefinitions } from './repomap/rank.ts';\nexport type { FileTagsEntry, RankedDefinition } from './repomap/rank.ts';\nexport { extractTags } from './repomap/tags.ts';\nexport type { DefinitionTag, FileTags, ReferenceTag } from './repomap/tags.ts';\nexport { TAGS_CACHE_FORMAT, TAGS_CACHE_VERSION, tagsCacheKey } from './repomap/cache.ts';\nexport { nodeFsReader } from './repomap/reader.ts';\nexport type { DirEntry, FileStat, RepoReader } from './repomap/reader.ts';\nexport {\n CONFIG_FILE_NAME,\n CONFIG_VERSION,\n configuredStore,\n findConfigFile,\n loadNearestConfig,\n parseConfig,\n renderConfig,\n resolveStorePath,\n} from './cli/config.ts';\nexport type { ConfiguredStore, LoadedConfig, SmeltConfig, SmeltConfigStore } from './cli/config.ts';\nexport {\n MEASURE_STUB_FILE,\n measureStubSource,\n RERANK_STUB_FILE,\n rerankStubSource,\n runInit,\n} from './cli/init.ts';\nexport type { InitIo } from './cli/init.ts';\nexport { retrieveStats } from './stats.ts';\nexport type { RawRetrieveCounters } from './stats.ts';\nexport {\n LANGUAGE_PROFILES,\n profileFor,\n profileForPath,\n structuralLanguages,\n} from './lang/registry.ts';\nexport type { LanguageProfile, LanguageStructure, RepoMapFacts } from './lang/profile.ts';\n/**\n * The harness registry's rendered views. Public for the same reason the ops seam is:\n * something outside this package renders them — the site's `facts.json` generator —\n * and the alternative is a second copy of the tier table typed into a React component,\n * which is exactly the drift `harnessesByTier()` exists to end.\n */\nexport { harnessesByTier, harnessNames, HARNESSES, HARNESS_IDS } from './harness/registry.ts';\nexport type { HarnessTierGroup } from './harness/registry.ts';\nexport { harnessLabel, HARNESS_TIERS, TIER_HONESTY } from './harness/profile.ts';\nexport type { HarnessId, HarnessTier } from './harness/profile.ts';\nexport { resolveRun } from './cli/subcommands/smelt.ts';\nexport type { ResolvedRun } from './cli/subcommands/smelt.ts';\nexport { REPO_MAP_FOCUS_RULE } from './repomap/map.ts';\nexport { CLI_MAP_JSON_FORMAT, formatMapReport, resolveMapRun } from './cli/run.ts';\nexport type { CliInvocation, CliMapJsonEnvelope, MapInvocation } from './cli/run.ts';\nexport type { MapReportInput } from './cli/report.ts';\nexport type { ResolvedMapRun } from './cli/subcommands/map.ts';\n\n/**\n * The operations seam — the four verbs and the laws their inputs must satisfy, below\n * every front door. `@smeltjs/mcp` consumes these as an ordinary dependency, so the\n * `smelt` CLI and the MCP tools run the same middle instead of two copies of it. See\n * `src/ops/index.ts` for what belongs here and what stays in an adapter.\n */\nexport {\n budgetFault,\n budgetMalformed,\n budgetRequired,\n mapTree,\n openStore,\n readBlob,\n readCounters,\n readTree,\n resolveStrategy,\n retrieveBytes,\n smeltBlob,\n} from './ops/index.ts';\nexport type {\n BudgetFault,\n BudgetNaming,\n MapTreeOp,\n ReadCountersOp,\n ResolvedStrategy,\n RetrieveBytesOp,\n Ruling,\n SmeltBlobOp,\n SmeltBlobOutcome,\n StrategySource,\n TreeNaming,\n} from './ops/index.ts';\n\n/**\n * Which planner a smelter uses, named by string. The names, their factories, and this\n * type all come from the one {@link PLANNERS} registry in `src/plan/planners.ts`, so\n * the CLI's validation and help text cannot drift from what `createSmelter` builds.\n */\nexport type { Strategy } from './plan/planners.ts';\n\nexport { createSmelter } from './smelter.ts';\nexport type { Smelter, SmelterConfig, SmeltCallOptions } from './smelter.ts';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,SAAS,EACT,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClE,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAClG,OAAO,EAAE,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ApplyOptions, MarkerBuilder, MarkerInfo } from './apply.ts';\n\n/**\n * The public surface: a barrel over the modules that hold the reasoning.\n *\n * `createSmelter()` itself lives in `./smelter.ts` so that nothing inside `src/` has\n * to import this file to build a smelter — the CLI's default verb does exactly that,\n * and a barrel that imports the CLI which imports the barrel is a cycle whose only\n * symptom is a registry evaluating to `undefined` in whichever module the loader\n * entered first. Every name is re-exported here, so consumers see no difference.\n */\n\nexport type { ApplyOptions, MarkerBuilder, MarkerInfo };\nexport {\n applyPlan,\n defaultMarker,\n MARKER_FORMAT_VERSION,\n markerPricing,\n reconstruct,\n} from './apply.ts';\nexport { detectLanguage, SUPPORTED_LANGUAGES } from './detect.ts';\nexport * from './errors.ts';\nexport { contentHash, HASH_LENGTH } from './hash.ts';\nexport {\n ALLOWED_NODE_BUILTINS,\n ALLOWED_PACKAGES,\n ALLOWED_URL_SCHEMES,\n assertLocalResource,\n FORBIDDEN_GLOBALS,\n FORBIDDEN_NODE_MODULES,\n FORBIDDEN_PACKAGES,\n} from './net/policy.ts';\nexport type { LocalResource } from './net/policy.ts';\nexport { clearGrammarCache, grammarPath, loadGrammar, WASM_BY_LANGUAGE } from './plan/grammar.ts';\nexport { AUTO_PLANNER_ID, AutoPlanner, planAuto } from './plan/auto.ts';\nexport type { AutoPlannerOptions } from './plan/auto.ts';\nexport { LEXICAL_PLANNER_ID, LexicalPlanner, planLexical } from './plan/lexical.ts';\nexport type { LexicalPlannerOptions } from './plan/lexical.ts';\nexport { DEFAULT_STRATEGY, isStrategy, PLANNERS, STRATEGIES } from './plan/planners.ts';\nexport type { PlannerFactoryOptions } from './plan/planners.ts';\nexport {\n isStructuralLanguage,\n planStructural,\n STRUCTURAL_LANGUAGES,\n STRUCTURAL_PLANNER_ID,\n StructuralPlanner,\n} from './plan/structural.ts';\nexport type { StructuralLanguage, StructuralPlannerOptions } from './plan/structural.ts';\nexport { createRetrieveTool, RETRIEVE_TOOL_NAME } from './retrieve.ts';\nexport { unconfiguredDistillStage, unconfiguredRerankStage } from './stages.ts';\nexport { MemoryElisionStore } from './store.ts';\nexport {\n DIRECTORY_STORE_FORMAT,\n DIRECTORY_STORE_VERSION,\n DirectoryElisionStore,\n} from './store-dir.ts';\nexport type { DirectoryElisionStoreOptions } from './store-dir.ts';\nexport * from './types.ts';\nexport {\n CLI_JSON_FORMAT,\n CLI_NAME,\n cliUsage,\n EXIT,\n formatReport,\n parseSmeltArgs,\n runCli,\n} from './cli/run.ts';\nexport type { AnswerStream, CliIo, CliJsonEnvelope, SmeltInvocation } from './cli/run.ts';\nexport {\n ANTHROPIC_PROMPT_CACHE_FACTS,\n CACHE_BREAKER_RULES,\n detectCacheBreakers,\n findPrefixDivergence,\n} from './cache/prefix.ts';\nexport type {\n CacheWarning,\n PrefixDivergence,\n PromptStructure,\n PromptTool,\n} from './cache/prefix.ts';\nexport { MARKER_LINE_COMMENT_LEADERS, markerForLanguage } from './apply.ts';\nexport {\n buildRepoMap,\n DEFAULT_REPO_IGNORE,\n REPO_MAP_CACHE_CORRUPT_RULE,\n REPO_MAP_ID,\n REPO_MAP_PATH_ONLY_RULE,\n REPO_MAP_RANKED_RULE,\n REPO_MAP_UNREFERENCED_RULE,\n} from './repomap/map.ts';\nexport type {\n RepoMap,\n RepoMapCacheCounts,\n RepoMapEntry,\n RepoMapOptions,\n RepoMapPathEntry,\n RepoMapReason,\n RepoMapWarning,\n} from './repomap/map.ts';\nexport { PAGERANK_DAMPING, PAGERANK_ITERATIONS, rankDefinitions } from './repomap/rank.ts';\nexport type { FileTagsEntry, RankedDefinition } from './repomap/rank.ts';\nexport { extractTags } from './repomap/tags.ts';\nexport type { DefinitionTag, FileTags, ReferenceTag } from './repomap/tags.ts';\nexport { TAGS_CACHE_FORMAT, TAGS_CACHE_VERSION, tagsCacheKey } from './repomap/cache.ts';\nexport { nodeFsReader } from './repomap/reader.ts';\nexport type { DirEntry, FileStat, RepoReader } from './repomap/reader.ts';\nexport {\n CONFIG_FILE_NAME,\n CONFIG_VERSION,\n configuredStore,\n findConfigFile,\n loadNearestConfig,\n parseConfig,\n renderConfig,\n resolveStorePath,\n} from './cli/config.ts';\nexport type { ConfiguredStore, LoadedConfig, SmeltConfig, SmeltConfigStore } from './cli/config.ts';\nexport {\n MEASURE_STUB_FILE,\n measureStubSource,\n RERANK_STUB_FILE,\n rerankStubSource,\n runInit,\n} from './cli/init.ts';\nexport type { InitIo } from './cli/init.ts';\nexport { runSetup } from './cli/setup.ts';\nexport type {\n SetupCheck,\n SetupFileAction,\n SetupIo,\n SetupOptions,\n SetupReceipt,\n} from './cli/setup.ts';\nexport { runDoctor } from './cli/doctor.ts';\nexport type {\n DoctorBlock,\n DoctorConfig,\n DoctorIo,\n DoctorMcp,\n DoctorOptions,\n DoctorReceipt,\n} from './cli/doctor.ts';\nexport { retrieveStats } from './stats.ts';\nexport type { RawRetrieveCounters } from './stats.ts';\n\n/**\n * The SetupRecipe: the one true way to put smelt on a machine, as data. Public for the\n * same reason the harness views are — something outside this package renders it (the\n * site's fact generator), and the docs and skill are pinned to it rather than retyping\n * it. See `src/setup/recipe.ts`.\n */\nexport { SETUP_RECIPE, SETUP_STEPS } from './setup/recipe.ts';\nexport type { SetupRecipe, SetupStep } from './setup/recipe.ts';\nexport {\n LANGUAGE_PROFILES,\n profileFor,\n profileForPath,\n structuralLanguages,\n} from './lang/registry.ts';\nexport type { LanguageProfile, LanguageStructure, RepoMapFacts } from './lang/profile.ts';\n/**\n * The harness registry's rendered views. Public for the same reason the ops seam is:\n * something outside this package renders them — the site's `facts.json` generator —\n * and the alternative is a second copy of the tier table typed into a React component,\n * which is exactly the drift `harnessesByTier()` exists to end.\n */\nexport { harnessesByTier, harnessNames, HARNESSES, HARNESS_IDS } from './harness/registry.ts';\nexport type { HarnessTierGroup } from './harness/registry.ts';\nexport { harnessLabel, HARNESS_TIERS, TIER_HONESTY } from './harness/profile.ts';\nexport type { HarnessId, HarnessTier } from './harness/profile.ts';\nexport { resolveRun } from './cli/subcommands/smelt.ts';\nexport type { ResolvedRun } from './cli/subcommands/smelt.ts';\nexport { REPO_MAP_FOCUS_RULE } from './repomap/map.ts';\nexport { CLI_MAP_JSON_FORMAT, formatMapReport, resolveMapRun } from './cli/run.ts';\nexport type { CliInvocation, CliMapJsonEnvelope, MapInvocation } from './cli/run.ts';\nexport type { MapReportInput } from './cli/report.ts';\nexport type { ResolvedMapRun } from './cli/subcommands/map.ts';\n\n/**\n * The operations seam — the four verbs and the laws their inputs must satisfy, below\n * every front door. `@smeltjs/mcp` consumes these as an ordinary dependency, so the\n * `smelt` CLI and the MCP tools run the same middle instead of two copies of it. See\n * `src/ops/index.ts` for what belongs here and what stays in an adapter.\n */\nexport {\n budgetFault,\n budgetMalformed,\n budgetRequired,\n mapTree,\n openStore,\n readBlob,\n readCounters,\n readTree,\n resolveStrategy,\n retrieveBytes,\n smeltBlob,\n} from './ops/index.ts';\nexport type {\n BudgetFault,\n BudgetNaming,\n MapTreeOp,\n ReadCountersOp,\n ResolvedStrategy,\n RetrieveBytesOp,\n Ruling,\n SmeltBlobOp,\n SmeltBlobOutcome,\n StrategySource,\n TreeNaming,\n} from './ops/index.ts';\n\n/**\n * Which planner a smelter uses, named by string. The names, their factories, and this\n * type all come from the one {@link PLANNERS} registry in `src/plan/planners.ts`, so\n * the CLI's validation and help text cannot drift from what `createSmelter` builds.\n */\nexport type { Strategy } from './plan/planners.ts';\n\nexport { createSmelter } from './smelter.ts';\nexport type { Smelter, SmelterConfig, SmeltCallOptions } from './smelter.ts';\n"]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The SetupRecipe (CONTEXT.md): the one true way to put smelt on a machine — the
|
|
3
|
+
* install commands, the init defaults, the store default, the hooks step, the MCP
|
|
4
|
+
* registration — held as data, because prose is never the source. Every rendering
|
|
5
|
+
* derives from this module or is pinned to it by a guard
|
|
6
|
+
* (`test/guards/setup-recipe.test.ts`); the same facts used to be retyped until the
|
|
7
|
+
* store default existed under three doc spellings, one of them wrong, and the MCP
|
|
8
|
+
* registration command lived in four places at once.
|
|
9
|
+
*
|
|
10
|
+
* This module imports nothing and does nothing: it is the fact layer every setup
|
|
11
|
+
* surface reads, and the seam the `setup` verb, the skill pack, and the site's fact
|
|
12
|
+
* generator hang off.
|
|
13
|
+
*/
|
|
14
|
+
export declare const SETUP_RECIPE: {
|
|
15
|
+
readonly install: {
|
|
16
|
+
/** The library, into a project — npm's spelling, and its siblings beside it. */
|
|
17
|
+
readonly library: 'npm install @smeltjs/core';
|
|
18
|
+
readonly libraryPnpm: 'pnpm add @smeltjs/core';
|
|
19
|
+
readonly libraryBun: 'bun add @smeltjs/core';
|
|
20
|
+
/** The CLI, onto the machine. (Not named `global`: that word is Law 1's.) */
|
|
21
|
+
readonly globalInstall: 'npm install -g @smeltjs/core';
|
|
22
|
+
/** The CLI, without installing it. */
|
|
23
|
+
readonly oneShot: 'npx @smeltjs/core';
|
|
24
|
+
/** The CLI over Homebrew, from smelt's own tap (KOT-248 seeds it). */
|
|
25
|
+
readonly brewInstall: 'brew install smeltjs/tap/smelt';
|
|
26
|
+
/** The Homebrew upgrade — the first half of the update loop doctor completes. */
|
|
27
|
+
readonly brewUpgrade: 'brew upgrade smelt';
|
|
28
|
+
/** The SkillPack, installed by an agent's owner (ADR-0002). */
|
|
29
|
+
readonly skillInstall: 'npx skills add smeltjs/smelt';
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The budget the setup path writes when its caller names none — the number every
|
|
33
|
+
* example already uses. Written loudly and recorded with its provenance; the
|
|
34
|
+
* `smelt` verb's own budget-required refusal is untouched by it.
|
|
35
|
+
*/
|
|
36
|
+
readonly recommendedBudgetBytes: 4000;
|
|
37
|
+
readonly store: {
|
|
38
|
+
/** Where the persistent store lives, relative to smelt.config.json. */
|
|
39
|
+
readonly defaultDir: '.smelt/store';
|
|
40
|
+
};
|
|
41
|
+
readonly mcp: {
|
|
42
|
+
/** The MCP server, run from the project directory. */
|
|
43
|
+
readonly run: 'npx @smeltjs/mcp';
|
|
44
|
+
/**
|
|
45
|
+
* Registration as Claude Code's CLI spells it — the canonical string while the
|
|
46
|
+
* harness profiles cannot yet carry per-harness registration; the
|
|
47
|
+
* mcp-registration step kind generalizes this per harness.
|
|
48
|
+
*/
|
|
49
|
+
readonly register: 'claude mcp add smelt -- npx @smeltjs/mcp';
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export type SetupRecipe = typeof SETUP_RECIPE;
|
|
53
|
+
/**
|
|
54
|
+
* The recipe's run command as a spawn array — derived once, beside the fact it comes
|
|
55
|
+
* from, because two harness profiles need the array and a second `.split(' ')` would
|
|
56
|
+
* be the second spelling this module exists to end.
|
|
57
|
+
*/
|
|
58
|
+
export declare const MCP_RUN_ARGS: readonly string[];
|
|
59
|
+
/** One step of the recipe, in the order a new machine walks it. */
|
|
60
|
+
export interface SetupStep {
|
|
61
|
+
readonly id: 'install' | 'init' | 'hooks' | 'mcp' | 'verify';
|
|
62
|
+
readonly title: string;
|
|
63
|
+
readonly command: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The recipe's steps, in order, ending in the verification that makes "set up" a
|
|
67
|
+
* claim with evidence. The install and MCP commands are named facts above; the init,
|
|
68
|
+
* hooks and verify steps name the verbs and the canonical invocation — the wizard
|
|
69
|
+
* each is, not a fact the recipe owns, except the budget the verify step carries,
|
|
70
|
+
* which is the recipe's.
|
|
71
|
+
*/
|
|
72
|
+
export declare const SETUP_STEPS: readonly SetupStep[];
|
|
73
|
+
//# sourceMappingURL=recipe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipe.d.ts","sourceRoot":"","sources":["../../src/setup/recipe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY;aACvB,OAAO;QACL,gFAAgF;iBAChF,OAAO,EAAE,2BAA2B;iBACpC,WAAW,EAAE,wBAAwB;iBACrC,UAAU,EAAE,uBAAuB;QACnC,6EAA6E;iBAC7E,aAAa,EAAE,8BAA8B;QAC7C,sCAAsC;iBACtC,OAAO,EAAE,mBAAmB;QAC5B,sEAAsE;iBACtE,WAAW,EAAE,gCAAgC;QAC7C,iFAAiF;iBACjF,WAAW,EAAE,oBAAoB;QACjC,+DAA+D;iBAC/D,YAAY,EAAE,8BAA8B;;IAE9C;;;;OAIG;aACH,sBAAsB,EAAE,IAAI;aAC5B,KAAK;QACH,uEAAuE;iBACvE,UAAU,EAAE,cAAc;;aAE5B,GAAG;QACD,sDAAsD;iBACtD,GAAG,EAAE,kBAAkB;QACvB;;;;WAIG;iBACH,QAAQ,EAAE,0CAA0C;;CAE9C,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,OAAO,YAAY,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,SAAS,MAAM,EAAoC,CAAC;AAE/E,mEAAmE;AACnE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC7D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EAU3C,CAAC","sourcesContent":["/**\n * The SetupRecipe (CONTEXT.md): the one true way to put smelt on a machine — the\n * install commands, the init defaults, the store default, the hooks step, the MCP\n * registration — held as data, because prose is never the source. Every rendering\n * derives from this module or is pinned to it by a guard\n * (`test/guards/setup-recipe.test.ts`); the same facts used to be retyped until the\n * store default existed under three doc spellings, one of them wrong, and the MCP\n * registration command lived in four places at once.\n *\n * This module imports nothing and does nothing: it is the fact layer every setup\n * surface reads, and the seam the `setup` verb, the skill pack, and the site's fact\n * generator hang off.\n */\nexport const SETUP_RECIPE = {\n install: {\n /** The library, into a project — npm's spelling, and its siblings beside it. */\n library: 'npm install @smeltjs/core',\n libraryPnpm: 'pnpm add @smeltjs/core',\n libraryBun: 'bun add @smeltjs/core',\n /** The CLI, onto the machine. (Not named `global`: that word is Law 1's.) */\n globalInstall: 'npm install -g @smeltjs/core',\n /** The CLI, without installing it. */\n oneShot: 'npx @smeltjs/core',\n /** The CLI over Homebrew, from smelt's own tap (KOT-248 seeds it). */\n brewInstall: 'brew install smeltjs/tap/smelt',\n /** The Homebrew upgrade — the first half of the update loop doctor completes. */\n brewUpgrade: 'brew upgrade smelt',\n /** The SkillPack, installed by an agent's owner (ADR-0002). */\n skillInstall: 'npx skills add smeltjs/smelt',\n },\n /**\n * The budget the setup path writes when its caller names none — the number every\n * example already uses. Written loudly and recorded with its provenance; the\n * `smelt` verb's own budget-required refusal is untouched by it.\n */\n recommendedBudgetBytes: 4000,\n store: {\n /** Where the persistent store lives, relative to smelt.config.json. */\n defaultDir: '.smelt/store',\n },\n mcp: {\n /** The MCP server, run from the project directory. */\n run: 'npx @smeltjs/mcp',\n /**\n * Registration as Claude Code's CLI spells it — the canonical string while the\n * harness profiles cannot yet carry per-harness registration; the\n * mcp-registration step kind generalizes this per harness.\n */\n register: 'claude mcp add smelt -- npx @smeltjs/mcp',\n },\n} as const;\n\nexport type SetupRecipe = typeof SETUP_RECIPE;\n\n/**\n * The recipe's run command as a spawn array — derived once, beside the fact it comes\n * from, because two harness profiles need the array and a second `.split(' ')` would\n * be the second spelling this module exists to end.\n */\nexport const MCP_RUN_ARGS: readonly string[] = SETUP_RECIPE.mcp.run.split(' ');\n\n/** One step of the recipe, in the order a new machine walks it. */\nexport interface SetupStep {\n readonly id: 'install' | 'init' | 'hooks' | 'mcp' | 'verify';\n readonly title: string;\n readonly command: string;\n}\n\n/**\n * The recipe's steps, in order, ending in the verification that makes \"set up\" a\n * claim with evidence. The install and MCP commands are named facts above; the init,\n * hooks and verify steps name the verbs and the canonical invocation — the wizard\n * each is, not a fact the recipe owns, except the budget the verify step carries,\n * which is the recipe's.\n */\nexport const SETUP_STEPS: readonly SetupStep[] = [\n { id: 'install', title: 'install the CLI', command: SETUP_RECIPE.install.globalInstall },\n { id: 'init', title: 'write smelt.config.json', command: 'smelt init' },\n { id: 'hooks', title: 'wire the hooks preset', command: 'smelt hooks install' },\n { id: 'mcp', title: 'register the MCP server', command: SETUP_RECIPE.mcp.register },\n {\n id: 'verify',\n title: 'prove the round trip on a real file',\n command: `smelt <file> --budget ${SETUP_RECIPE.recommendedBudgetBytes} --focus <focus>`,\n },\n];\n"]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The SetupRecipe (CONTEXT.md): the one true way to put smelt on a machine — the
|
|
3
|
+
* install commands, the init defaults, the store default, the hooks step, the MCP
|
|
4
|
+
* registration — held as data, because prose is never the source. Every rendering
|
|
5
|
+
* derives from this module or is pinned to it by a guard
|
|
6
|
+
* (`test/guards/setup-recipe.test.ts`); the same facts used to be retyped until the
|
|
7
|
+
* store default existed under three doc spellings, one of them wrong, and the MCP
|
|
8
|
+
* registration command lived in four places at once.
|
|
9
|
+
*
|
|
10
|
+
* This module imports nothing and does nothing: it is the fact layer every setup
|
|
11
|
+
* surface reads, and the seam the `setup` verb, the skill pack, and the site's fact
|
|
12
|
+
* generator hang off.
|
|
13
|
+
*/
|
|
14
|
+
export const SETUP_RECIPE = {
|
|
15
|
+
install: {
|
|
16
|
+
/** The library, into a project — npm's spelling, and its siblings beside it. */
|
|
17
|
+
library: 'npm install @smeltjs/core',
|
|
18
|
+
libraryPnpm: 'pnpm add @smeltjs/core',
|
|
19
|
+
libraryBun: 'bun add @smeltjs/core',
|
|
20
|
+
/** The CLI, onto the machine. (Not named `global`: that word is Law 1's.) */
|
|
21
|
+
globalInstall: 'npm install -g @smeltjs/core',
|
|
22
|
+
/** The CLI, without installing it. */
|
|
23
|
+
oneShot: 'npx @smeltjs/core',
|
|
24
|
+
/** The CLI over Homebrew, from smelt's own tap (KOT-248 seeds it). */
|
|
25
|
+
brewInstall: 'brew install smeltjs/tap/smelt',
|
|
26
|
+
/** The Homebrew upgrade — the first half of the update loop doctor completes. */
|
|
27
|
+
brewUpgrade: 'brew upgrade smelt',
|
|
28
|
+
/** The SkillPack, installed by an agent's owner (ADR-0002). */
|
|
29
|
+
skillInstall: 'npx skills add smeltjs/smelt',
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* The budget the setup path writes when its caller names none — the number every
|
|
33
|
+
* example already uses. Written loudly and recorded with its provenance; the
|
|
34
|
+
* `smelt` verb's own budget-required refusal is untouched by it.
|
|
35
|
+
*/
|
|
36
|
+
recommendedBudgetBytes: 4000,
|
|
37
|
+
store: {
|
|
38
|
+
/** Where the persistent store lives, relative to smelt.config.json. */
|
|
39
|
+
defaultDir: '.smelt/store',
|
|
40
|
+
},
|
|
41
|
+
mcp: {
|
|
42
|
+
/** The MCP server, run from the project directory. */
|
|
43
|
+
run: 'npx @smeltjs/mcp',
|
|
44
|
+
/**
|
|
45
|
+
* Registration as Claude Code's CLI spells it — the canonical string while the
|
|
46
|
+
* harness profiles cannot yet carry per-harness registration; the
|
|
47
|
+
* mcp-registration step kind generalizes this per harness.
|
|
48
|
+
*/
|
|
49
|
+
register: 'claude mcp add smelt -- npx @smeltjs/mcp',
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* The recipe's run command as a spawn array — derived once, beside the fact it comes
|
|
54
|
+
* from, because two harness profiles need the array and a second `.split(' ')` would
|
|
55
|
+
* be the second spelling this module exists to end.
|
|
56
|
+
*/
|
|
57
|
+
export const MCP_RUN_ARGS = SETUP_RECIPE.mcp.run.split(' ');
|
|
58
|
+
/**
|
|
59
|
+
* The recipe's steps, in order, ending in the verification that makes "set up" a
|
|
60
|
+
* claim with evidence. The install and MCP commands are named facts above; the init,
|
|
61
|
+
* hooks and verify steps name the verbs and the canonical invocation — the wizard
|
|
62
|
+
* each is, not a fact the recipe owns, except the budget the verify step carries,
|
|
63
|
+
* which is the recipe's.
|
|
64
|
+
*/
|
|
65
|
+
export const SETUP_STEPS = [
|
|
66
|
+
{ id: 'install', title: 'install the CLI', command: SETUP_RECIPE.install.globalInstall },
|
|
67
|
+
{ id: 'init', title: 'write smelt.config.json', command: 'smelt init' },
|
|
68
|
+
{ id: 'hooks', title: 'wire the hooks preset', command: 'smelt hooks install' },
|
|
69
|
+
{ id: 'mcp', title: 'register the MCP server', command: SETUP_RECIPE.mcp.register },
|
|
70
|
+
{
|
|
71
|
+
id: 'verify',
|
|
72
|
+
title: 'prove the round trip on a real file',
|
|
73
|
+
command: `smelt <file> --budget ${SETUP_RECIPE.recommendedBudgetBytes} --focus <focus>`,
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
//# sourceMappingURL=recipe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipe.js","sourceRoot":"","sources":["../../src/setup/recipe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,OAAO,EAAE;QACP,gFAAgF;QAChF,OAAO,EAAE,2BAA2B;QACpC,WAAW,EAAE,wBAAwB;QACrC,UAAU,EAAE,uBAAuB;QACnC,6EAA6E;QAC7E,aAAa,EAAE,8BAA8B;QAC7C,sCAAsC;QACtC,OAAO,EAAE,mBAAmB;QAC5B,sEAAsE;QACtE,WAAW,EAAE,gCAAgC;QAC7C,iFAAiF;QACjF,WAAW,EAAE,oBAAoB;QACjC,+DAA+D;QAC/D,YAAY,EAAE,8BAA8B;KAC7C;IACD;;;;OAIG;IACH,sBAAsB,EAAE,IAAI;IAC5B,KAAK,EAAE;QACL,uEAAuE;QACvE,UAAU,EAAE,cAAc;KAC3B;IACD,GAAG,EAAE;QACH,sDAAsD;QACtD,GAAG,EAAE,kBAAkB;QACvB;;;;WAIG;QACH,QAAQ,EAAE,0CAA0C;KACrD;CACO,CAAC;AAIX;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAsB,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAS/E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAyB;IAC/C,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,aAAa,EAAE;IACxF,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,yBAAyB,EAAE,OAAO,EAAE,YAAY,EAAE;IACvE,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,uBAAuB,EAAE,OAAO,EAAE,qBAAqB,EAAE;IAC/E,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,yBAAyB,EAAE,OAAO,EAAE,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE;IACnF;QACE,EAAE,EAAE,QAAQ;QACZ,KAAK,EAAE,qCAAqC;QAC5C,OAAO,EAAE,yBAAyB,YAAY,CAAC,sBAAsB,kBAAkB;KACxF;CACF,CAAC","sourcesContent":["/**\n * The SetupRecipe (CONTEXT.md): the one true way to put smelt on a machine — the\n * install commands, the init defaults, the store default, the hooks step, the MCP\n * registration — held as data, because prose is never the source. Every rendering\n * derives from this module or is pinned to it by a guard\n * (`test/guards/setup-recipe.test.ts`); the same facts used to be retyped until the\n * store default existed under three doc spellings, one of them wrong, and the MCP\n * registration command lived in four places at once.\n *\n * This module imports nothing and does nothing: it is the fact layer every setup\n * surface reads, and the seam the `setup` verb, the skill pack, and the site's fact\n * generator hang off.\n */\nexport const SETUP_RECIPE = {\n install: {\n /** The library, into a project — npm's spelling, and its siblings beside it. */\n library: 'npm install @smeltjs/core',\n libraryPnpm: 'pnpm add @smeltjs/core',\n libraryBun: 'bun add @smeltjs/core',\n /** The CLI, onto the machine. (Not named `global`: that word is Law 1's.) */\n globalInstall: 'npm install -g @smeltjs/core',\n /** The CLI, without installing it. */\n oneShot: 'npx @smeltjs/core',\n /** The CLI over Homebrew, from smelt's own tap (KOT-248 seeds it). */\n brewInstall: 'brew install smeltjs/tap/smelt',\n /** The Homebrew upgrade — the first half of the update loop doctor completes. */\n brewUpgrade: 'brew upgrade smelt',\n /** The SkillPack, installed by an agent's owner (ADR-0002). */\n skillInstall: 'npx skills add smeltjs/smelt',\n },\n /**\n * The budget the setup path writes when its caller names none — the number every\n * example already uses. Written loudly and recorded with its provenance; the\n * `smelt` verb's own budget-required refusal is untouched by it.\n */\n recommendedBudgetBytes: 4000,\n store: {\n /** Where the persistent store lives, relative to smelt.config.json. */\n defaultDir: '.smelt/store',\n },\n mcp: {\n /** The MCP server, run from the project directory. */\n run: 'npx @smeltjs/mcp',\n /**\n * Registration as Claude Code's CLI spells it — the canonical string while the\n * harness profiles cannot yet carry per-harness registration; the\n * mcp-registration step kind generalizes this per harness.\n */\n register: 'claude mcp add smelt -- npx @smeltjs/mcp',\n },\n} as const;\n\nexport type SetupRecipe = typeof SETUP_RECIPE;\n\n/**\n * The recipe's run command as a spawn array — derived once, beside the fact it comes\n * from, because two harness profiles need the array and a second `.split(' ')` would\n * be the second spelling this module exists to end.\n */\nexport const MCP_RUN_ARGS: readonly string[] = SETUP_RECIPE.mcp.run.split(' ');\n\n/** One step of the recipe, in the order a new machine walks it. */\nexport interface SetupStep {\n readonly id: 'install' | 'init' | 'hooks' | 'mcp' | 'verify';\n readonly title: string;\n readonly command: string;\n}\n\n/**\n * The recipe's steps, in order, ending in the verification that makes \"set up\" a\n * claim with evidence. The install and MCP commands are named facts above; the init,\n * hooks and verify steps name the verbs and the canonical invocation — the wizard\n * each is, not a fact the recipe owns, except the budget the verify step carries,\n * which is the recipe's.\n */\nexport const SETUP_STEPS: readonly SetupStep[] = [\n { id: 'install', title: 'install the CLI', command: SETUP_RECIPE.install.globalInstall },\n { id: 'init', title: 'write smelt.config.json', command: 'smelt init' },\n { id: 'hooks', title: 'wire the hooks preset', command: 'smelt hooks install' },\n { id: 'mcp', title: 'register the MCP server', command: SETUP_RECIPE.mcp.register },\n {\n id: 'verify',\n title: 'prove the round trip on a real file',\n command: `smelt <file> --budget ${SETUP_RECIPE.recommendedBudgetBytes} --focus <focus>`,\n },\n];\n"]}
|