@tangle-network/agent-app 0.46.15 → 0.46.17
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/README.md +9 -8
- package/dist/VaultPane-YKZ6YJGI.js +7 -0
- package/dist/assets/schema.d.ts +10 -10
- package/dist/assistant/index.js +1 -1
- package/dist/chat-react/index.js +1 -1
- package/dist/chat-routes/index.js +1 -1
- package/dist/chat-store/schema.d.ts +5 -5
- package/dist/{chunk-QL7HXXXL.js → chunk-55E3K3Q6.js} +2 -1
- package/dist/chunk-55E3K3Q6.js.map +1 -0
- package/dist/{chunk-VWTODXRW.js → chunk-ICLUEQYX.js} +2 -8
- package/dist/chunk-ICLUEQYX.js.map +1 -0
- package/dist/{chunk-3PFKLSIZ.js → chunk-P2EC5VHG.js} +1 -1
- package/dist/{chunk-3PFKLSIZ.js.map → chunk-P2EC5VHG.js.map} +1 -1
- package/dist/{chunk-CCIQXW6N.js → chunk-RXHGOLZR.js} +2 -2
- package/dist/chunk-RXHGOLZR.js.map +1 -0
- package/dist/config/index.d.ts +62 -62
- package/dist/design-canvas/schema.d.ts +6 -6
- package/dist/documents/pdf-inspector.d.ts +5 -7
- package/dist/documents/pdf-inspector.js.map +1 -1
- package/dist/intakes/drizzle/schema.d.ts +2 -2
- package/dist/interactions/contract.d.ts +3 -3
- package/dist/peer-floors/check.js +1 -1
- package/dist/peer-floors/cli.js +1 -1
- package/dist/plans/index.d.ts +1 -1
- package/dist/preset-cloudflare/index.d.ts +36 -36
- package/dist/record/drizzle/schema.d.ts +1 -1
- package/dist/run/index.d.ts +1 -1
- package/dist/sandbox/index.d.ts +2 -2
- package/dist/sandbox/index.js +1 -1
- package/dist/sequences/schema.d.ts +10 -10
- package/dist/signoff/proof-record.d.ts +11 -11
- package/dist/studio-react/styles.d.ts +2 -0
- package/dist/teams/drizzle/invitations-schema.d.ts +3 -3
- package/dist/teams/drizzle/schema.d.ts +6 -6
- package/dist/teams/roles.d.ts +3 -3
- package/dist/theme/styles.d.ts +2 -0
- package/dist/theme/tailwind-preset.d.ts +1 -1
- package/dist/tools/mcp-rpc.d.ts +1 -1
- package/dist/tools/openai.d.ts +1 -1
- package/dist/turn-stream/core.d.ts +15 -15
- package/dist/vault/VaultPane.d.ts +2 -2
- package/dist/vault/index.js +1 -1
- package/dist/vault/lazy.js +1 -1
- package/dist/web/index.d.ts +5 -5
- package/dist/web-react/entry-composer.d.ts +1 -3
- package/dist/web-react/index.js +1 -1
- package/package.json +65 -57
- package/dist/VaultPane-IGJKB6CX.js +0 -7
- package/dist/chunk-CCIQXW6N.js.map +0 -1
- package/dist/chunk-QL7HXXXL.js.map +0 -1
- package/dist/chunk-VWTODXRW.js.map +0 -1
- /package/dist/{VaultPane-IGJKB6CX.js.map → VaultPane-YKZ6YJGI.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/peer-floors/check.ts","../src/peer-floors/dependency-source.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs'\nimport { dirname, join } from 'node:path'\n\n/**\n * The second half of this gate lives in `./dependency-source` and ships on the\n * SAME subpath and the SAME `agent-app-peer-check` bin, because it answers the\n * question underneath this one: a floor comparison reads a version, and a\n * version is not an identity — a vendored `pnpm pack` of an unmerged branch\n * carries the same `0.45.33` a real release does.\n */\nexport * from './dependency-source'\n\n/**\n * Audit a consumer's installed tree against the peer floors this package\n * declares.\n *\n * A peer floor is not documentation — it encodes a WIRE CONTRACT, and breaking\n * one is invisible to every other gate. `pnpm` only WARNS on an unmet peer when\n * the package is also a direct dependency, and says nothing at all for an unmet\n * OPTIONAL peer, which is how most of the substrate is declared here. So a\n * product can sit below a floor with a clean install, a clean typecheck, a green\n * suite and a successful deploy, and fail only on a live wire call:\n *\n * `@tangle-network/sandbox` 0.15.0 → 0.15.1 changed the sidecar spawn body\n * from `{ command }` to `{ executable, args }`. Below the floor, every\n * `box.exec()` on a live sandbox returns 400 `Unrecognized key: \"command\"`.\n *\n * `@tangle-network/agent-interface` 0.38.0 changed MCP config values from\n * plain strings to tagged public/secret-ref objects. Below the floor, this\n * package fails at MODULE LOAD with \"does not provide an export named\n * defineAgentProfilePublicConfig\" — while `tsc` reports zero errors, because\n * the types resolve and only the runtime export is missing.\n *\n * That second shape is why this exists as its own gate: typecheck cannot see it,\n * and a suite only sees it as dozens of unrelated-looking import failures.\n */\n\n/** Installed, and inside the declared range. */\nexport type PeerFloorVerdict =\n | 'satisfied'\n /** Installed and BELOW the floor — the silent case this module exists for. */\n | 'below-floor'\n /** Not installed and never asked for. A legitimate answer for an optional peer. */\n | 'absent-unused'\n /** Declared by the app, yet no version could be read, so the floor went\n * UNCHECKED. Reported as a failure rather than a pass this did not earn. */\n | 'absent-but-declared'\n\nexport interface PeerFloorRow {\n readonly name: string\n readonly range: string\n readonly installed: string | null\n readonly verdict: PeerFloorVerdict\n}\n\nexport interface PeerFloorReport {\n readonly shellVersion: string\n readonly rows: readonly PeerFloorRow[]\n readonly violations: readonly PeerFloorRow[]\n readonly ok: boolean\n}\n\nexport interface CheckPeerFloorsOptions {\n /** Directory of the app under audit — the one whose `package.json` and\n * installed tree are read. */\n appDir: string\n /** Package whose peer floors are the contract. Defaults to this shell. */\n shell?: string\n /** Only audit peers under this scope. Third-party peers (react, drizzle) are\n * the app's own business, not part of the Tangle wire contract. Pass `''` to\n * audit every peer. */\n scope?: string\n /** Floors to audit against, when the shell is not resolvable from `appDir` —\n * the package auditing ITSELF, which has no copy of itself in its own\n * `node_modules`. Without this a package cannot check that the contract it\n * publishes is one its own dev install satisfies. */\n shellManifest?: { version?: string; peerDependencies?: Record<string, string> }\n /** Directory name to walk for installed packages. Overridable so a test can\n * point at a committed fixture tree — `node_modules` is gitignored\n * everywhere, so a fixture using that name could not be committed, and a\n * calibration proof that is not committed is a proof that stops running. */\n modulesDir?: string\n}\n\n/**\n * Read a package's manifest off disk, walking `modulesDir` up from `fromDir`.\n *\n * Deliberately NOT `require.resolve('<name>/package.json')`: most of these\n * packages omit `./package.json` from their `exports` map, so that throws\n * ERR_PACKAGE_PATH_NOT_EXPORTED — and a try/catch around it reports an INSTALLED\n * package as absent, turning the whole audit into a silent no-op. Walking the\n * tree is exports-map-independent and mirrors Node's own resolution order, so\n * the version reported is the version that would actually load.\n *\n * The walk STOPS at the repository root — a directory containing `.git` — and\n * never climbs past it. Node itself would keep going, but a `node_modules`\n * above a checkout belongs to something else entirely, and letting it answer\n * silently changes the verdict: a stray `/tmp/node_modules` shadowing one\n * package produced a confident FAIL for a repo that was above every floor. A\n * check that reports the wrong tree is worse than no check.\n *\n * Returns null only when no directory for the package exists inside the repo,\n * which is the genuine not-installed case.\n */\nfunction readInstalledManifest(\n name: string,\n fromDir: string,\n modulesDir: string,\n): { version?: string; peerDependencies?: Record<string, string> } | null {\n let dir = fromDir\n for (;;) {\n const manifest = join(dir, modulesDir, name, 'package.json')\n if (existsSync(manifest)) {\n return JSON.parse(readFileSync(manifest, 'utf8')) as {\n version?: string\n peerDependencies?: Record<string, string>\n }\n }\n // Repo boundary: stop here rather than inheriting an unrelated tree.\n if (existsSync(join(dir, '.git'))) return null\n const parent = dirname(dir)\n if (parent === dir) return null\n dir = parent\n }\n}\n\n/**\n * Minimal range satisfaction for the ranges peer floors actually use:\n * `>=x <y`, `^x.y.z`, `~x.y.z`, `x.y.z`, and `*`/`x`.\n *\n * Hand-rolled rather than taking a `semver` dependency, because this package\n * ships zero runtime dependencies and a checker that forces one on every\n * consumer is a worse trade than 40 lines of comparison. Prerelease versions\n * compare by their release part — a floor is about the wire contract, and a\n * prerelease of a satisfying version speaks it.\n */\nfunction parseVersion(version: string): [number, number, number] {\n const [core] = version.split(/[-+]/)\n const parts = (core ?? '').split('.').map((p) => Number.parseInt(p, 10))\n return [parts[0] ?? 0, parts[1] ?? 0, parts[2] ?? 0]\n}\n\nfunction compare(a: string, b: string): number {\n const va = parseVersion(a)\n const vb = parseVersion(b)\n for (let i = 0; i < 3; i += 1) {\n if (va[i]! !== vb[i]!) return va[i]! < vb[i]! ? -1 : 1\n }\n return 0\n}\n\nfunction satisfiesComparator(version: string, comparator: string): boolean {\n const trimmed = comparator.trim()\n if (!trimmed || trimmed === '*' || trimmed === 'x') return true\n const match = /^(>=|<=|>|<|=|\\^|~)?\\s*v?(.+)$/.exec(trimmed)\n if (!match) return false\n const [, op = '=', target = ''] = match\n const cmp = compare(version, target)\n switch (op) {\n case '>=': return cmp >= 0\n case '<=': return cmp <= 0\n case '>': return cmp > 0\n case '<': return cmp < 0\n case '=': return cmp === 0\n case '~': {\n // ~1.2.3 allows patch bumps; ~1.2 allows minor.\n const [major, minor] = parseVersion(target)\n const [vMajor, vMinor] = parseVersion(version)\n return cmp >= 0 && vMajor === major && vMinor === minor\n }\n case '^': {\n // A caret on a 0.x version is MINOR-locked: ^0.36.0 can never resolve to\n // 0.38.0. That is the single most common reason a floor cannot be met by\n // reinstalling, so it is modelled exactly rather than approximated.\n const [major, minor] = parseVersion(target)\n const [vMajor, vMinor] = parseVersion(version)\n if (cmp < 0) return false\n if (major > 0) return vMajor === major\n if (minor > 0) return vMajor === 0 && vMinor === minor\n return vMajor === 0 && vMinor === 0\n }\n default: return false\n }\n}\n\nexport function satisfiesRange(version: string, range: string): boolean {\n // `||` is alternation; whitespace inside an alternative is conjunction.\n return range.split('||').some((alternative) =>\n alternative.trim().split(/\\s+/).filter(Boolean).every((c) => satisfiesComparator(version, c)),\n )\n}\n\n/** Audit one app directory against the shell's declared peer floors. */\nexport function checkPeerFloors(options: CheckPeerFloorsOptions): PeerFloorReport {\n const {\n appDir,\n shell = '@tangle-network/agent-app',\n scope = '@tangle-network/',\n modulesDir = 'node_modules',\n } = options\n\n const shellManifest = options.shellManifest ?? readInstalledManifest(shell, appDir, modulesDir)\n if (!shellManifest) throw new Error(`${shell} is not installed under ${appDir}`)\n\n const appManifest = JSON.parse(readFileSync(join(appDir, 'package.json'), 'utf8')) as {\n dependencies?: Record<string, string>\n devDependencies?: Record<string, string>\n optionalDependencies?: Record<string, string>\n }\n const declared = {\n ...appManifest.dependencies,\n ...appManifest.devDependencies,\n ...appManifest.optionalDependencies,\n }\n\n const floors = Object.entries(shellManifest.peerDependencies ?? {})\n .filter(([name]) => name.startsWith(scope))\n\n const rows = floors.map(([name, range]): PeerFloorRow => {\n const installed = readInstalledManifest(name, appDir, modulesDir)?.version ?? null\n if (installed === null) {\n return { name, range, installed, verdict: declared[name] ? 'absent-but-declared' : 'absent-unused' }\n }\n return {\n name,\n range,\n installed,\n verdict: satisfiesRange(installed, range) ? 'satisfied' : 'below-floor',\n }\n })\n\n const violations = rows.filter((row) => row.verdict === 'below-floor' || row.verdict === 'absent-but-declared')\n return {\n shellVersion: shellManifest.version ?? 'unknown',\n rows,\n violations,\n ok: violations.length === 0,\n }\n}\n\n/** The failure message for one violating row. Split out so a caller can raise\n * it from a test and a CLI can print it identically. */\nexport function describePeerFloorViolation(row: PeerFloorRow, shellVersion: string, shell = '@tangle-network/agent-app'): string {\n if (row.verdict === 'below-floor') {\n return `PEER FLOOR VIOLATED: ${shell}@${shellVersion} requires ${row.name}@${row.range}, `\n + `but ${row.installed} is installed. A peer floor encodes a wire contract — bump the `\n + `dependency, do not widen the floor. A caret on a 0.x version is minor-locked `\n + `(^0.36.0 can never resolve to 0.38.0), so reinstalling alone will not fix this: `\n + `change the pin, in EVERY place it appears including pnpm.overrides.`\n }\n return `${row.name} is a declared dependency of this app, but no installed version could be `\n + `read, so its peer floor ${row.range} went UNCHECKED. Failing loudly rather than `\n + `reporting a pass this guard did not earn.`\n}\n\nexport function formatPeerFloorReport(report: PeerFloorReport, shell = '@tangle-network/agent-app'): string {\n const width = Math.max(...report.rows.map((r) => r.name.length), 4)\n const lines = [\n `${shell}@${report.shellVersion} — peer floors`,\n '',\n ...report.rows.map((row) =>\n ` ${row.verdict === 'satisfied' ? 'ok ' : row.verdict.startsWith('absent') ? '-- ' : 'FAIL'} `\n + `${row.name.padEnd(width)} installed ${(row.installed ?? '(none)').padEnd(10)} floor ${row.range}`),\n '',\n report.ok\n ? `all ${report.rows.length} floors satisfied`\n : report.violations.map((row) => describePeerFloorViolation(row, report.shellVersion, shell)).join('\\n\\n'),\n ]\n return lines.join('\\n')\n}\n","import { createHash } from 'node:crypto'\nimport { existsSync, lstatSync, readFileSync, readdirSync, statSync } from 'node:fs'\nimport { basename, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path'\n\n/**\n * Audit where a repository's dependencies COME FROM.\n *\n * `/peer-floors` already answers \"is the installed version inside the declared\n * range\". This answers the question underneath it — \"is the installed package\n * the one the registry publishes at all\" — because a version number is not an\n * identity. Two artifacts can carry `0.45.33` and ship different APIs, and every\n * gate that reads a version reads the same number for both.\n *\n * THE MEASURED DEFECT. insurance-agent's `pnpm-workspace.yaml` carried\n *\n * overrides:\n * '@tangle-network/agent-app': file:./vendor/agent-app/tangle-network-agent-app-0.45.33.tgz\n *\n * — a 2.6 MB `pnpm pack` of an UNMERGED pull request, committed into the\n * product repo (`insurance-agent` f7d0f51 removed it). It installed cleanly,\n * typechecked green and passed sign-off while the product ran code that existed\n * in no published release. Note where it was NOT: `package.json` still read\n * `\"@tangle-network/agent-app\": \"^0.45.33\"`, a perfectly ordinary registry\n * range. A check that reads only the root manifest's `dependencies` sees\n * nothing. The override lane is the one that shipped, so the override lane —\n * `pnpm-workspace.yaml`, `pnpm.overrides`, `resolutions` — is audited first.\n *\n * The second shape is worse because nothing declares it at all: a worktree was\n * found whose installed `agent-app@0.45.29` had `dist/spend/index.d.ts`\n * replaced with a newer version's content by hand. The manifest, the lockfile\n * and the version on disk all agreed; only the bytes disagreed, and the product\n * typechecked green against an API its declared dependency does not ship. See\n * `checkInstalledIntegrity` below for exactly how much of that class is\n * catchable cheaply and exactly how much is not.\n */\n\n/** How a specifier says a dependency should be obtained. */\nexport type DependencySourceProtocol =\n /** Resolvable from the registry by anyone: `^1.2.3`, `1.2.3`, `npm:x@1`. */\n | 'registry'\n /** `workspace:` — another package in this same repo. Reviewable in one diff. */\n | 'workspace'\n /** `catalog:` — indirection into `pnpm-workspace.yaml`, which is itself audited. */\n | 'catalog'\n /** A local path. Whether it is legitimate depends on WHERE it points. */\n | 'file'\n | 'link'\n | 'portal'\n /** A path or URL ending in a packed tarball. Opaque bytes; never legitimate. */\n | 'tarball'\n /** A git ref or a remote URL that is not the registry. */\n | 'git'\n | 'remote'\n\nconst TARBALL = /\\.(?:tgz|tar\\.gz)$/i\n\n/**\n * Classify one dependency specifier by the SOURCE it names.\n *\n * Pure and exported so a consumer can reuse the vocabulary, and so the rule can\n * be tested without a filesystem. Nothing here decides legitimacy — `file:` on\n * a directory inside the repo is correct and `file:` on a tarball never is, and\n * that distinction needs the disk (`resolveLocalPathSource`).\n */\nexport function classifyDependencySpecifier(specifier: string): DependencySourceProtocol {\n const spec = specifier.trim()\n if (spec.startsWith('workspace:')) return 'workspace'\n if (spec.startsWith('catalog:')) return 'catalog'\n for (const protocol of ['file:', 'link:', 'portal:'] as const) {\n if (spec.startsWith(protocol)) {\n const path = spec.slice(protocol.length)\n if (TARBALL.test(path)) return 'tarball'\n return protocol.slice(0, -1) as 'file' | 'link' | 'portal'\n }\n }\n if (/^(?:git|git\\+ssh|git\\+https?|git\\+file|ssh):/.test(spec)) return 'git'\n if (/^(?:github|gitlab|bitbucket):/.test(spec)) return 'git'\n if (/^https?:\\/\\//.test(spec)) return TARBALL.test(spec.split(/[?#]/)[0] ?? '') ? 'tarball' : 'remote'\n // `owner/repo` and `owner/repo#ref` are npm's GitHub shorthand. A scoped\n // package name (`@scope/name`) also contains a slash, hence the leading-@ guard.\n if (/^[\\w.-]+\\/[\\w.-]+(?:#.+)?$/.test(spec) && !spec.startsWith('@')) return 'git'\n return 'registry'\n}\n\n/** A protocol that resolves from the registry, or from this repo's own sources. */\nfunction isReproducible(protocol: DependencySourceProtocol): boolean {\n return protocol === 'registry' || protocol === 'workspace' || protocol === 'catalog'\n}\n\n/**\n * The legitimate-exception rule, stated once so it is not a path allowlist.\n *\n * agent-app's own `playground/package.json` declares\n * `\"@tangle-network/agent-app\": \"file:..\"` and that is CORRECT: the playground\n * depends on the package it lives inside. The property that makes it correct is\n * not its path — it is that the dependency is satisfied by SOURCE ALREADY IN\n * THIS REPOSITORY, under version control, changing only in a diff a reviewer\n * sees. So the rule is:\n *\n * A `file:` / `link:` / `portal:` specifier is exempt when it resolves to a\n * DIRECTORY inside this repository holding a `package.json` whose `name` is\n * the dependency being declared.\n *\n * Every clause is load-bearing. A DIRECTORY, because a `.tgz` is opaque bytes\n * that no diff shows — a packed tarball is never exempt, wherever it sits.\n * INSIDE THIS REPOSITORY, because `file:../../agent-app` is a path on one\n * machine: it resolves for its author and for nobody else, and a sign-off gate\n * that installs into a clean export dies at install. NAME MATCHES, because a\n * path pointing at some other package's source is a mis-wire, not a\n * self-reference.\n */\nexport type LocalPathSource =\n /** In-repo directory whose package.json names this dependency. Legitimate. */\n | 'in-repo-source'\n /** Points outside the repository — reproducible on one machine only. */\n | 'outside-repo'\n /** Nothing there, or not a directory (a packed tarball lands here too). */\n | 'not-a-directory'\n /** An in-repo directory, but it is a different package. */\n | 'name-mismatch'\n\nexport function resolveLocalPathSource(args: {\n /** Directory of the manifest that made the declaration. */\n fromDir: string\n /** Root of the repository the declaration must stay inside. */\n repoDir: string\n /** The path part of the specifier, protocol already stripped. */\n path: string\n /** The dependency name the path is claimed to satisfy. */\n name: string\n}): LocalPathSource {\n const root = resolve(args.repoDir)\n const target = isAbsolute(args.path) ? resolve(args.path) : resolve(args.fromDir, args.path)\n if (target !== root && !target.startsWith(root + sep)) return 'outside-repo'\n const manifest = join(target, 'package.json')\n if (!existsSync(manifest) || !statSync(target).isDirectory()) return 'not-a-directory'\n let declared: string | undefined\n try {\n declared = (JSON.parse(readFileSync(manifest, 'utf8')) as { name?: string }).name\n } catch {\n return 'not-a-directory'\n }\n return declared === args.name ? 'in-repo-source' : 'name-mismatch'\n}\n\n/** Which of the five scans produced a finding. Kept on the row because the fix\n * differs: a declaration is edited, an installed tree is reinstalled. */\nexport type DependencySourceCheck =\n /** A `dependencies`-family field in some `package.json`. */\n | 'declared'\n /** `pnpm.overrides` / `resolutions` / `pnpm-workspace.yaml` — the lane that shipped. */\n | 'override'\n /** `pnpm-lock.yaml` — what actually resolved, whatever the manifests now say. */\n | 'lockfile'\n /** A packed tarball sitting in the source tree. */\n | 'vendored-tarball'\n /** The installed tree on disk. */\n | 'installed'\n\nexport interface DependencySourceFinding {\n readonly check: DependencySourceCheck\n /** Dependency name, or `null` for a stray tarball that names no dependency. */\n readonly name: string | null\n readonly specifier: string | null\n readonly protocol: DependencySourceProtocol | null\n /** Repo-relative location, with the key or line that carries it. */\n readonly where: string\n /** Why this is a finding, and what to do about it. */\n readonly detail: string\n}\n\n/**\n * What the on-disk integrity pass was able to examine — reported on EVERY run,\n * clean or not, because \"checked nothing\" and \"checked everything and found\n * nothing\" render identically otherwise. This module's own doctrine: an\n * unchecked contract is never a pass it did not earn.\n */\nexport interface InstalledIntegrityCoverage {\n /** The only basis implemented. See `checkInstalledIntegrity`'s limits. */\n readonly basis: 'store-cas'\n /** False for npm, yarn, a pruned CI cache, or a store on another machine.\n * Nothing was verified, and the report says so rather than reading clean. */\n readonly storeLocated: boolean\n readonly packagesExamined: number\n readonly filesExamined: number\n /** Files settled by reading their bytes rather than by a shared inode. */\n readonly filesHashed: number\n}\n\nexport interface DependencySourceReport {\n readonly repoDir: string\n readonly manifestsScanned: number\n readonly lockfileScanned: boolean\n readonly integrity: InstalledIntegrityCoverage\n readonly findings: readonly DependencySourceFinding[]\n readonly ok: boolean\n}\n\nexport interface CheckDependencySourcesOptions {\n /** Repository root to audit. */\n repoDir: string\n /** Scope filter for the on-disk integrity pass. `''` examines every package. */\n scope?: string\n /** Directory name holding the installed tree. Overridable so a committed\n * fixture can use `fixture_modules` — `node_modules` is gitignored\n * everywhere, and a calibration proof that is not committed stops running. */\n modulesDir?: string\n /** Repo-relative path prefixes the source-tree walk skips. The escape hatch\n * for a repo that genuinely carries a tarball as test data — and for this\n * package's own calibration fixtures, whose purpose is to CONTAIN the\n * violation. */\n exclude?: readonly string[]\n}\n\n/** Directories a source-tree walk must never descend into: build output and\n * installed packages are not declarations, and walking them turns a\n * sub-second scan into a minute. */\nconst SKIP_DIRS = new Set([\n 'node_modules', '.git', 'dist', 'build', 'out', 'coverage',\n '.wrangler', '.react-router', '.next', '.turbo', '.cache', 'storybook-static',\n])\n\nfunction walkSourceTree(\n dir: string,\n repoDir: string,\n exclude: readonly string[],\n seen: { manifests: string[]; tarballs: string[] },\n): void {\n let entries: import('node:fs').Dirent[]\n try {\n entries = readdirSync(dir, { withFileTypes: true })\n } catch {\n return\n }\n for (const entry of entries) {\n const full = join(dir, entry.name)\n const rel = relative(repoDir, full).split(sep).join('/')\n if (exclude.some((prefix) => rel === prefix || rel.startsWith(`${prefix}/`))) continue\n if (entry.isDirectory()) {\n if (SKIP_DIRS.has(entry.name)) continue\n walkSourceTree(full, repoDir, exclude, seen)\n } else if (entry.isFile()) {\n if (entry.name === 'package.json') seen.manifests.push(full)\n else if (TARBALL.test(entry.name)) seen.tarballs.push(full)\n }\n }\n}\n\n/* ---------------------------------------------------------------------------\n * A line reader for the two YAML files that matter.\n *\n * Deliberately not a YAML dependency: this package ships zero runtime deps and\n * forcing one on every consumer to read four block mappings is the worse trade\n * — the same call `/peer-floors` made about `semver`. The shapes read here are\n * `pnpm-workspace.yaml`'s `overrides`/`catalog`/`catalogs` and\n * `pnpm-lock.yaml`'s `overrides`/`importers`/`packages`/`snapshots`, all of\n * which pnpm emits as plain two-space block mappings of scalars.\n * ------------------------------------------------------------------------ */\n\ninterface YamlLine {\n readonly indent: number\n readonly key: string\n readonly value: string\n /** Enclosing keys, outermost first, excluding this line's own key. */\n readonly path: readonly string[]\n readonly lineNumber: number\n}\n\nfunction unquote(text: string): string {\n const t = text.trim()\n if ((t.startsWith(\"'\") && t.endsWith(\"'\")) || (t.startsWith('\"') && t.endsWith('\"'))) {\n return t.slice(1, -1)\n }\n return t\n}\n\nfunction readYamlLines(text: string): YamlLine[] {\n const out: YamlLine[] = []\n // Innermost key seen at each indent level, so a `specifier:` line can name\n // the dependency it belongs to.\n const stack: string[] = []\n text.split('\\n').forEach((raw, index) => {\n if (!raw.trim() || raw.trimStart().startsWith('#')) return\n const indent = raw.length - raw.trimStart().length\n const match = /^\\s*(?:'((?:[^']|'')*)'|\"([^\"]*)\"|([^\\s:#][^:]*?))\\s*:(?:\\s+(.*))?$/.exec(raw)\n if (!match) return\n const key = (match[1] ?? match[2] ?? match[3] ?? '').replace(/''/g, \"'\")\n // A trailing ` # comment` is a comment only outside quotes; every value pnpm\n // writes here is unquoted or fully quoted, so splitting on ` #` is exact.\n const rawValue = (match[4] ?? '').split(' #')[0] ?? ''\n const depth = Math.floor(indent / 2)\n stack.length = depth\n const path = [...stack]\n stack[depth] = key\n out.push({ indent, key, value: unquote(rawValue), path, lineNumber: index + 1 })\n })\n return out\n}\n\n/** The top-level section a nested line sits under. */\nfunction sectionOf(line: YamlLine): string | undefined {\n return line.indent === 0 ? line.key : line.path[0]\n}\n\n/* ------------------------------------------------------------------------ */\n\nconst DEP_FIELDS = ['dependencies', 'devDependencies', 'optionalDependencies', 'peerDependencies'] as const\n\n/**\n * Judge one declaration and produce a finding, or `null` when it is fine.\n *\n * One function so the manifest lane, the override lane and the lockfile lane\n * cannot drift into three different opinions about the same specifier.\n */\nfunction judge(args: {\n check: DependencySourceCheck\n name: string\n specifier: string\n where: string\n fromDir: string\n repoDir: string\n}): DependencySourceFinding | null {\n const protocol = classifyDependencySpecifier(args.specifier)\n if (isReproducible(protocol)) return null\n\n const base = { check: args.check, name: args.name, specifier: args.specifier, protocol, where: args.where }\n\n if (protocol === 'tarball') {\n return {\n ...base,\n detail: 'resolves a PACKED TARBALL, not a published release. A .tgz is opaque bytes that no '\n + 'diff shows and no registry can reproduce: the version inside it can collide with a real '\n + 'release and ship a different API. Publish the change and pin the published range.',\n }\n }\n if (protocol === 'git' || protocol === 'remote') {\n return {\n ...base,\n detail: `resolves from ${protocol === 'git' ? 'a git ref' : 'a remote URL'} rather than the `\n + 'registry, so what installs depends on what that ref points at today. Publish the change '\n + 'and pin the published range.',\n }\n }\n\n const path = args.specifier.slice(args.specifier.indexOf(':') + 1)\n const source = resolveLocalPathSource({ fromDir: args.fromDir, repoDir: args.repoDir, path, name: args.name })\n if (source === 'in-repo-source') return null\n const why: Record<Exclude<LocalPathSource, 'in-repo-source'>, string> = {\n 'outside-repo': 'points OUTSIDE this repository, so it resolves on one machine and nowhere else — '\n + 'a clean checkout, a CI runner and a sign-off gate that installs into an exported tree all '\n + 'get a different answer or fail at install.',\n 'not-a-directory': 'does not resolve to a package directory in this repository. A local specifier '\n + 'is only legitimate when it points at in-repo SOURCE a reviewer sees in the diff.',\n 'name-mismatch': `resolves to an in-repo directory that declares a DIFFERENT package name, so the `\n + `dependency ${args.name} is being satisfied by something else entirely.`,\n }\n return { ...base, detail: `${why[source]} (${source})` }\n}\n\nfunction scanManifest(file: string, repoDir: string): DependencySourceFinding[] {\n let manifest: Record<string, unknown>\n try {\n manifest = JSON.parse(readFileSync(file, 'utf8')) as Record<string, unknown>\n } catch {\n return []\n }\n const fromDir = dirname(file)\n const where = relative(repoDir, file).split(sep).join('/') || 'package.json'\n const findings: DependencySourceFinding[] = []\n\n for (const field of DEP_FIELDS) {\n const block = manifest[field]\n if (!block || typeof block !== 'object') continue\n for (const [name, specifier] of Object.entries(block as Record<string, unknown>)) {\n if (typeof specifier !== 'string') continue\n const finding = judge({ check: 'declared', name, specifier, where: `${where} → ${field}`, fromDir, repoDir })\n if (finding) findings.push(finding)\n }\n }\n\n // The lane insurance's defect actually used. `resolutions` is yarn/npm's\n // spelling of the same authority; both silently outrank every range above.\n const overrideBlocks: Array<[string, unknown]> = [\n ['pnpm.overrides', (manifest.pnpm as { overrides?: unknown } | undefined)?.overrides],\n ['resolutions', manifest.resolutions],\n ]\n for (const [label, block] of overrideBlocks) {\n if (!block || typeof block !== 'object') continue\n for (const [name, specifier] of Object.entries(block as Record<string, unknown>)) {\n if (typeof specifier !== 'string') continue\n const finding = judge({\n check: 'override',\n // An override key can carry a range suffix (`foo@1 > bar`); the package\n // name is the leading segment.\n name: overrideKeyName(name),\n specifier,\n where: `${where} → ${label}['${name}']`,\n fromDir,\n repoDir,\n })\n if (finding) findings.push(finding)\n }\n }\n return findings\n}\n\n/** `@scope/pkg@^1 > dep` and `pkg@1` both name `pkg` / `@scope/pkg`. */\nfunction overrideKeyName(key: string): string {\n const head = (key.split('>').pop() ?? key).trim()\n const at = head.lastIndexOf('@')\n return at > 0 ? head.slice(0, at) : head\n}\n\nfunction scanWorkspaceYaml(file: string, repoDir: string): DependencySourceFinding[] {\n const findings: DependencySourceFinding[] = []\n const where = relative(repoDir, file).split(sep).join('/')\n for (const line of readYamlLines(readFileSync(file, 'utf8'))) {\n const section = sectionOf(line)\n if (section !== 'overrides' && section !== 'catalog' && section !== 'catalogs') continue\n if (line.indent === 0 || !line.value) continue\n const finding = judge({\n check: 'override',\n name: overrideKeyName(line.key),\n specifier: line.value,\n where: `${where}:${line.lineNumber} → ${[...line.path, line.key].join('.')}`,\n fromDir: dirname(file),\n repoDir,\n })\n if (finding) findings.push(finding)\n }\n return findings\n}\n\n/**\n * The lockfile is the only file that reports what ACTUALLY resolved. A manifest\n * can be cleaned up while `pnpm-lock.yaml` still resolves a tarball, and the\n * install follows the lockfile.\n *\n * Three shapes carry it, all present in the real insurance-agent lockfile:\n * overrides: '@tangle-network/agent-app': file:./vendor/…-0.45.33.tgz\n * importers: specifier: file:vendor/…-0.45.33.tgz\n * packages: '@tangle-network/agent-app@file:vendor/…-0.45.33.tgz':\n */\nfunction scanLockfile(file: string, repoDir: string): DependencySourceFinding[] {\n const findings: DependencySourceFinding[] = []\n const where = relative(repoDir, file).split(sep).join('/')\n const fromDir = dirname(file)\n const seen = new Set<string>()\n const push = (finding: DependencySourceFinding | null): void => {\n if (!finding) return\n const key = `${finding.name}|${finding.specifier}`\n if (seen.has(key)) return\n seen.add(key)\n findings.push(finding)\n }\n\n for (const line of readYamlLines(readFileSync(file, 'utf8'))) {\n const section = sectionOf(line)\n if (section === 'overrides' && line.indent > 0 && line.value) {\n push(judge({\n check: 'lockfile',\n name: overrideKeyName(line.key),\n specifier: line.value,\n where: `${where}:${line.lineNumber} → overrides`,\n fromDir,\n repoDir,\n }))\n continue\n }\n if (section === 'importers' && line.key === 'specifier' && line.value) {\n push(judge({\n check: 'lockfile',\n name: line.path[line.path.length - 1] ?? '(unknown)',\n specifier: line.value,\n where: `${where}:${line.lineNumber} → importers`,\n fromDir,\n repoDir,\n }))\n continue\n }\n if ((section === 'packages' || section === 'snapshots') && line.indent === 2 && !line.value) {\n const parsed = parsePackageKey(line.key)\n if (!parsed) continue\n push(judge({\n check: 'lockfile',\n name: parsed.name,\n specifier: parsed.reference,\n where: `${where}:${line.lineNumber} → ${section}`,\n fromDir,\n repoDir,\n }))\n }\n }\n return findings\n}\n\n/**\n * `'@scope/name@file:vendor/x.tgz'` → name + reference.\n *\n * The peer-suffix is stripped FIRST: a snapshot key looks like\n * `@radix-ui/react-dialog@1.1.23(@types/react@19.2.17)`, and the last `@` in\n * that string sits inside the suffix, not at the version boundary.\n */\nfunction parsePackageKey(key: string): { name: string; reference: string } | null {\n const withoutPeers = key.replace(/\\(.*\\)$/, '')\n const at = withoutPeers.lastIndexOf('@')\n if (at <= 0) return null\n return { name: withoutPeers.slice(0, at), reference: withoutPeers.slice(at + 1) }\n}\n\n/**\n * pnpm's virtual store encodes a dependency's SOURCE in the directory name:\n * a registry package is `@tangle-network+agent-app@0.45.33`, while the\n * vendored one installed as\n * `file+vendor+agent-app+tangle-network-agent-app-0.45.33.tgz`.\n *\n * This is install evidence that survives a tidied manifest and a regenerated\n * lockfile, which is why it is scanned separately rather than trusted to follow\n * from them.\n */\nfunction scanVirtualStore(\n repoDir: string,\n modulesDir: string,\n): DependencySourceFinding[] {\n const store = join(repoDir, modulesDir, '.pnpm')\n if (!existsSync(store)) return []\n const findings: DependencySourceFinding[] = []\n for (const entry of readdirSync(store, { withFileTypes: true })) {\n if (!entry.isDirectory() || entry.name === modulesDir) continue\n const protocolMatch = /^(file|link|portal|git|https?)\\+/.exec(entry.name)\n if (!protocolMatch) continue\n const protocol = protocolMatch[1] as string\n // pnpm encodes `/` as `+` for the whole remainder of a path-protocol key.\n const encoded = entry.name.slice(protocol.length + 1)\n const name = installedPackageName(join(store, entry.name), modulesDir)\n const where = `${modulesDir}/.pnpm/${entry.name}`\n\n if (protocol === 'file' || protocol === 'link' || protocol === 'portal') {\n const path = encoded.split('+').join('/')\n const specifier = `${protocol}:${path}`\n const finding = judge({\n check: 'installed',\n name: name ?? path,\n specifier,\n where,\n // A virtual-store path is written relative to the install root.\n fromDir: repoDir,\n repoDir,\n })\n if (finding) findings.push(finding)\n continue\n }\n findings.push({\n check: 'installed',\n name,\n specifier: encoded.split('+++').join('://').split('+').join('/'),\n protocol: protocol === 'git' ? 'git' : 'remote',\n where,\n detail: 'is INSTALLED from a git ref or remote URL rather than the registry. The manifests may '\n + 'read clean — this is what the tree on disk actually holds. Reinstall from a published range.',\n })\n }\n return findings\n}\n\n/**\n * The package a virtual-store entry belongs to: the one REAL directory under\n * its nested module dir (its dependencies are all symlinks).\n *\n * The nested level takes `modulesDir` too, not a hardcoded `node_modules`.\n * In a real install both levels ARE `node_modules`, so nothing changes there —\n * but a COMMITTED fixture cannot carry a `node_modules` path segment at any\n * depth, because every repo gitignores that name. Hardcoding it here made this\n * module's own calibration tree un-committable, which is the failure the\n * `fixture_modules` convention exists to prevent, reintroduced one level down.\n */\nfunction installedPackageName(entryDir: string, modulesDir: string): string | null {\n const nested = join(entryDir, modulesDir)\n if (!existsSync(nested)) return null\n for (const child of readdirSync(nested, { withFileTypes: true })) {\n if (child.name === '.bin' || child.isSymbolicLink()) continue\n if (!child.isDirectory()) continue\n if (child.name.startsWith('@')) {\n const scopeDir = join(nested, child.name)\n for (const scoped of readdirSync(scopeDir, { withFileTypes: true })) {\n if (scoped.isSymbolicLink() || !scoped.isDirectory()) continue\n if (existsSync(join(scopeDir, scoped.name, 'package.json'))) return `${child.name}/${scoped.name}`\n }\n continue\n }\n if (existsSync(join(nested, child.name, 'package.json'))) return child.name\n }\n return null\n}\n\n/* ---------------------------------------------------------------------------\n * On-disk integrity — and an honest account of its ceiling.\n *\n * WHAT WAS CONSIDERED AND REJECTED. Full verification means comparing the\n * installed bytes against the PUBLISHED tarball. `pnpm-lock.yaml` records that\n * tarball's `integrity` (`sha512-…`) and nothing about its contents, and the\n * tarball is not on disk: pnpm unpacks into a content-addressed store and keeps\n * the per-file digests in an INDEX whose location and format change between\n * pnpm majors — pnpm 10 writes JSON under `store/v10/index/`, pnpm 11 writes one\n * SQLite database (measured: `~/.local/share/pnpm/store/v11/index.db`, 57 MB).\n * Reading it means a SQLite dependency plus a coupling to store internals, in a\n * package that ships zero runtime dependencies; re-fetching the tarball means\n * network access inside a gate that must run offline in seconds. So full\n * verification is NOT affordable and is not attempted.\n *\n * WHAT IS AFFORDABLE. The store is CONTENT-ADDRESSED: a file's bytes live at\n * `<store>/files/<first 2 hex>/<rest>` of their own sha512, a layout that has\n * survived v3 → v10 → v11 while the index format changed twice. So a file's\n * bytes can be asked one question with no dependency and no network — \"has this\n * store ever held these bytes?\" Bytes that came out of a package pnpm installed\n * are in there by construction. Bytes typed in afterwards are not.\n *\n * Two steps, because hashing 30,000 files per run would not be cheap:\n * 1. `nlink > 1` — the file shares an inode, so it IS a store blob. No hash.\n * This settles ~99% of files at the cost of one `lstat`.\n * 2. Everything else is hashed and looked up in the store CAS.\n *\n * THE HARD-LINK COUNT ALONE IS NOT THE SIGNAL, and believing it was is the\n * mistake this design corrects. An earlier cut reported any package holding\n * both linked and unlinked files as tampered. Measured across five real fleet\n * repos it fired once — on legal-agent's `@tangle-network/agent-interface@0.32.0`,\n * whose `dist/environment-provider.js` is `nlink == 1` — and that finding was\n * FALSE: `npm pack @tangle-network/agent-interface@0.32.0` yields the identical\n * 11-byte `export {};`. pnpm simply wrote that copy instead of linking it. A\n * 1-in-5-repos false alarm is a gate people switch off, and the CAS lookup is\n * what tells the two apart: those bytes ARE in the store.\n *\n * MEASURED after adding the lookup: 5 fleet repos, 0 findings, 0 false alarms.\n *\n * WHAT IT CANNOT CATCH, precisely — do not read a clean integrity line as more:\n * 1. A patch whose content came from ANOTHER package or version ALREADY in\n * this store. CAS membership proves \"this store has held these bytes\", not\n * \"these bytes belong to this package at this version\". The measured\n * defect — a `dist/spend/index.d.ts` overwritten with a NEWER version's\n * copy — is caught only when that newer version was never installed on the\n * machine. This is the real ceiling; closing it needs the per-file index.\n * 2. An edit that PRESERVES the inode (`> file`, `cp onto`). The link\n * survives and the STORE copy is corrupted with it, so both agree.\n * 3. A tampered store: everything resolves, everything agrees, all wrong.\n * 4. Anything at all when the store cannot be located — npm, yarn, a store on\n * another machine, a pruned CI cache. That is reported as NOT VERIFIED\n * rather than as a pass, and it is never a finding, because failing every\n * non-pnpm consumer forever is how a gate gets deleted.\n * ------------------------------------------------------------------------ */\n\n/**\n * Every content-addressed `files/` directory this install could have linked\n * from, read out of `node_modules/.modules.yaml` — pure `fs`, no `pnpm store\n * path` subprocess.\n *\n * More than one, because a long-lived machine has several store majors side by\n * side and an existing tree can be linked from an older one: measured on\n * legal-agent, `dist/index.js` resolves in `store/v10/files` while\n * `dist/environment-provider.js` resolves in `store/v10/v11/files`. Checking\n * only the configured one reports a linked file as unknown.\n */\nfunction locateStoreCas(repoDir: string, modulesDir: string): string[] {\n const modulesState = join(repoDir, modulesDir, '.modules.yaml')\n if (!existsSync(modulesState)) return []\n let configured: string | undefined\n try {\n const text = readFileSync(modulesState, 'utf8')\n // pnpm 11 writes JSON under the .yaml name; older versions write YAML.\n configured = (/\"storeDir\"\\s*:\\s*\"((?:[^\"\\\\]|\\\\.)*)\"/.exec(text)?.[1]\n ?? /^storeDir:\\s*(.+)$/m.exec(text)?.[1])?.trim()\n } catch {\n return []\n }\n if (!configured) return []\n const root = unquote(configured.replace(/\\\\\\\\/g, '\\\\'))\n const candidates = new Set<string>([root, dirname(root)])\n for (const base of [root, dirname(root)]) {\n try {\n for (const entry of readdirSync(base, { withFileTypes: true })) {\n if (entry.isDirectory() && /^v\\d+$/.test(entry.name)) candidates.add(join(base, entry.name))\n }\n } catch { /* an unreadable store is simply not a candidate */ }\n }\n return [...candidates].map((dir) => join(dir, 'files')).filter((dir) => existsSync(dir))\n}\n\nfunction collectFiles(dir: string, modulesDir: string, out: string[] = []): string[] {\n let entries: import('node:fs').Dirent[]\n try {\n entries = readdirSync(dir, { withFileTypes: true })\n } catch {\n return out\n }\n for (const entry of entries) {\n // A package's own nested `node_modules` holds pnpm-GENERATED `.bin` shims\n // and symlinks, never store content. Including it made 3 of this repo's 8\n // installed @tangle-network packages look partially replaced.\n if (entry.name === modulesDir) continue\n const full = join(dir, entry.name)\n if (entry.isSymbolicLink()) continue\n if (entry.isDirectory()) collectFiles(full, modulesDir, out)\n else if (entry.isFile()) out.push(full)\n }\n return out\n}\n\n/** Does any reachable store hold these exact bytes? `-exec` is pnpm's suffix\n * for the executable-mode copy of the same content. */\nfunction storeHolds(casDirs: readonly string[], bytes: Buffer): boolean {\n const hex = createHash('sha512').update(bytes).digest('hex')\n const tail = join(hex.slice(0, 2), hex.slice(2))\n return casDirs.some((dir) => existsSync(join(dir, tail)) || existsSync(join(dir, `${tail}-exec`)))\n}\n\n/**\n * Check each installed package under `scope` against the content-addressed\n * store it was installed from. Returns coverage alongside findings, because a\n * pass that verified nothing must not render like a pass that verified\n * everything.\n */\nexport function checkInstalledIntegrity(args: {\n repoDir: string\n modulesDir: string\n scope: string\n}): { coverage: InstalledIntegrityCoverage; findings: DependencySourceFinding[] } {\n const virtualStore = join(args.repoDir, args.modulesDir, '.pnpm')\n const casDirs = locateStoreCas(args.repoDir, args.modulesDir)\n const findings: DependencySourceFinding[] = []\n let packagesExamined = 0\n let filesExamined = 0\n let filesHashed = 0\n\n if (casDirs.length > 0 && existsSync(virtualStore)) {\n for (const entry of readdirSync(virtualStore, { withFileTypes: true })) {\n if (!entry.isDirectory() || entry.name === args.modulesDir) continue\n const entryDir = join(virtualStore, entry.name)\n const name = installedPackageName(entryDir, args.modulesDir)\n if (!name || !name.startsWith(args.scope)) continue\n const packageDir = join(entryDir, args.modulesDir, name)\n if (!existsSync(packageDir)) continue\n\n const files = collectFiles(packageDir, args.modulesDir)\n if (files.length === 0) continue\n packagesExamined += 1\n filesExamined += files.length\n\n const foreign: string[] = []\n for (const file of files) {\n try {\n // A shared inode IS a store blob — settled without reading the file.\n if (lstatSync(file).nlink > 1) continue\n filesHashed += 1\n if (storeHolds(casDirs, readFileSync(file))) continue\n foreign.push(relative(packageDir, file).split(sep).join('/'))\n } catch { /* a file that vanished mid-walk is not evidence */ }\n }\n if (foreign.length === 0) continue\n\n const shown = foreign.slice(0, 5)\n findings.push({\n check: 'installed',\n name,\n specifier: null,\n protocol: null,\n where: `${args.modulesDir}/.pnpm/${entry.name} → ${shown.join(', ')}`\n + `${foreign.length > shown.length ? ` (+${foreign.length - shown.length} more)` : ''}`,\n detail: `holds ${foreign.length} file(s) whose bytes this pnpm store has never contained — the `\n + 'shape of a package HAND-PATCHED after install. The version on disk, the manifest and the '\n + 'lockfile all still agree; only the bytes do not, which is how a product typechecks green '\n + 'against an API its declared dependency does not ship. Delete the tree and reinstall '\n + `(\\`rm -rf ${args.modulesDir} && pnpm install --frozen-lockfile\\`), then publish whatever `\n + 'change made the patch look necessary.',\n })\n }\n }\n\n return {\n coverage: {\n basis: 'store-cas',\n storeLocated: casDirs.length > 0,\n packagesExamined,\n filesExamined,\n filesHashed,\n },\n findings,\n }\n}\n\n/** Audit one repository for dependencies whose source is not the registry. */\nexport function checkDependencySources(options: CheckDependencySourcesOptions): DependencySourceReport {\n const repoDir = resolve(options.repoDir)\n const { scope = '@tangle-network/', modulesDir = 'node_modules', exclude = [] } = options\n\n const seen = { manifests: [] as string[], tarballs: [] as string[] }\n walkSourceTree(repoDir, repoDir, exclude, seen)\n\n const findings: DependencySourceFinding[] = []\n for (const manifest of seen.manifests) findings.push(...scanManifest(manifest, repoDir))\n\n const workspaceYaml = join(repoDir, 'pnpm-workspace.yaml')\n if (existsSync(workspaceYaml)) findings.push(...scanWorkspaceYaml(workspaceYaml, repoDir))\n\n const lockfile = join(repoDir, 'pnpm-lock.yaml')\n const lockfileScanned = existsSync(lockfile)\n if (lockfileScanned) findings.push(...scanLockfile(lockfile, repoDir))\n\n for (const tarball of seen.tarballs) {\n findings.push({\n check: 'vendored-tarball',\n name: null,\n specifier: null,\n protocol: 'tarball',\n where: relative(repoDir, tarball).split(sep).join('/'),\n detail: 'is a PACKED TARBALL committed into the source tree. Even when nothing points at it today, '\n + 'it is a build nobody can reproduce from the registry sitting one `file:` line away from '\n + `shipping. Delete it; if ${basename(tarball)} is genuinely test data, move it under a path `\n + 'passed to `--exclude`.',\n })\n }\n\n findings.push(...scanVirtualStore(repoDir, modulesDir))\n const integrity = checkInstalledIntegrity({ repoDir, modulesDir, scope })\n findings.push(...integrity.findings)\n\n return {\n repoDir,\n manifestsScanned: seen.manifests.length,\n lockfileScanned,\n integrity: integrity.coverage,\n findings,\n ok: findings.length === 0,\n }\n}\n\nconst CHECK_LABEL: Record<DependencySourceCheck, string> = {\n declared: 'DECLARED',\n override: 'OVERRIDE',\n lockfile: 'LOCKFILE',\n 'vendored-tarball': 'TARBALL',\n installed: 'INSTALLED',\n}\n\n/** One finding rendered as the failure a reader has to act on. */\nexport function describeDependencySourceFinding(finding: DependencySourceFinding): string {\n const subject = finding.name\n ? `${finding.name}${finding.specifier ? ` (${finding.specifier})` : ''}`\n : finding.where\n return `DEPENDENCY SOURCE: ${subject} ${finding.detail}\\n at ${finding.where}`\n}\n\nexport function formatDependencySourceReport(report: DependencySourceReport): string {\n const { integrity } = report\n // Printed on EVERY report, clean or not: \"verified nothing\" and \"verified\n // everything and found nothing\" are otherwise the same green line, which is\n // this gate's own failure class turned on itself.\n const integrityLine = integrity.storeLocated\n ? ` integrity (${integrity.basis}): ${integrity.packagesExamined} package(s), `\n + `${integrity.filesExamined} file(s), ${integrity.filesHashed} hashed against the store`\n : ` integrity (${integrity.basis}): NOT VERIFIED — no pnpm content-addressed store is reachable `\n + 'from this tree, so no installed bytes were checked against anything'\n const lines = [\n 'dependency sources',\n '',\n ` scanned ${report.manifestsScanned} manifest(s), `\n + `${report.lockfileScanned ? 'pnpm-lock.yaml' : 'no lockfile'}`,\n integrityLine,\n '',\n ]\n if (report.ok) {\n lines.push(\n integrity.storeLocated && integrity.packagesExamined > 0\n ? ' ok every declared source is the registry, and every installed byte came from the store'\n : ' ok every declared source is the registry — installed bytes UNVERIFIED (see above)',\n )\n } else {\n for (const finding of report.findings) {\n lines.push(` FAIL [${CHECK_LABEL[finding.check]}] ${describeDependencySourceFinding(finding)}`, '')\n }\n }\n return lines.join('\\n')\n}\n"],"mappings":";AAAA,SAAS,cAAAA,aAAY,gBAAAC,qBAAoB;AACzC,SAAS,WAAAC,UAAS,QAAAC,aAAY;;;ACD9B,SAAS,kBAAkB;AAC3B,SAAS,YAAY,WAAW,cAAc,aAAa,gBAAgB;AAC3E,SAAS,UAAU,SAAS,YAAY,MAAM,UAAU,SAAS,WAAW;AAoD5E,IAAM,UAAU;AAUT,SAAS,4BAA4B,WAA6C;AACvF,QAAM,OAAO,UAAU,KAAK;AAC5B,MAAI,KAAK,WAAW,YAAY,EAAG,QAAO;AAC1C,MAAI,KAAK,WAAW,UAAU,EAAG,QAAO;AACxC,aAAW,YAAY,CAAC,SAAS,SAAS,SAAS,GAAY;AAC7D,QAAI,KAAK,WAAW,QAAQ,GAAG;AAC7B,YAAM,OAAO,KAAK,MAAM,SAAS,MAAM;AACvC,UAAI,QAAQ,KAAK,IAAI,EAAG,QAAO;AAC/B,aAAO,SAAS,MAAM,GAAG,EAAE;AAAA,IAC7B;AAAA,EACF;AACA,MAAI,+CAA+C,KAAK,IAAI,EAAG,QAAO;AACtE,MAAI,gCAAgC,KAAK,IAAI,EAAG,QAAO;AACvD,MAAI,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CAAC,EAAE,KAAK,MAAM;AAAA,EAC7G;AACA,SAAO,MAAM,KAAK,IAAI;AACxB;","names":["existsSync","readFileSync","dirname","join","join","existsSync","readFileSync","dirname"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/vault/VaultPane.tsx","../src/vault/ConfirmDialog.tsx"],"sourcesContent":["/**\n * The shared 3-pane vault: tree | artifact viewer | optional agent dock. This is\n * pure shell MECHANISM — selection, the dirty-guard + pending-nav state machine,\n * rich/source editor modes, create/delete/refresh, skeletons, an error boundary,\n * and an empty state. It renders NO file tree and NO artifact viewer of its own:\n * those arrive through the `renderTree` / `renderArtifact` / `renderDock` seams,\n * so a product wires sandbox-ui's RichFileTree + FileArtifactPane in ~10 lines.\n *\n * Data flows exclusively through `port` (a `VaultDataPort`). The pane never\n * imports a fetch client, a router, a toast system, or a markdown library — the\n * optional `codec` seam supplies rich/source parsing (identity passthrough by\n * default). Chrome uses the shared theme tokens (bg-card, border-border, …).\n */\n\nimport {\n Component,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ErrorInfo,\n type MouseEvent,\n type ReactNode,\n} from 'react'\nimport { Download, Folder, Trash2 } from 'lucide-react'\nimport { ConfirmDialog } from './ConfirmDialog'\nimport type {\n VaultEditorMode,\n VaultFile,\n VaultMarkdownCodec,\n VaultOperation,\n VaultOperationFailure,\n VaultOperationPhase,\n VaultPaneProps,\n VaultRichParts,\n VaultTreeNode,\n} from './contracts'\n\nconst IDENTITY_CODEC: VaultMarkdownCodec = {\n parse: (raw) => raw,\n serialize: (parts) => (typeof parts === 'string' ? parts : String(parts ?? '')),\n}\n\ntype PendingNav = { type: 'open'; path: string } | { type: 'close' } | null\n\ninterface TreeRefreshContext {\n operation: Extract<VaultOperation, 'list' | 'create' | 'delete'>\n phase: VaultOperationPhase\n path?: string\n selectAfterRecovery?: string\n}\n\ninterface TreeFailureState {\n failure: VaultOperationFailure\n context: TreeRefreshContext\n}\n\nconst LIST_CONTEXT: TreeRefreshContext = { operation: 'list', phase: 'operation' }\n\nfunction operationMessage(error: unknown, fallback: string): string {\n return error instanceof Error && error.message ? error.message : fallback\n}\n\nfunction treeFailureMessage(failure: VaultOperationFailure): string {\n if (failure.phase !== 'post-mutation-refresh') return failure.message\n const completed = failure.operation === 'create' ? 'created' : 'deleted'\n return `The file was ${completed}, but the Vault couldn't refresh. ${failure.message}`\n}\n\ninterface TreePaths {\n files: Set<string>\n directories: Set<string>\n}\n\n// Directories are collected alongside files because a click on one has to be\n// RECOGNIZED to be answered — dropping them here is what made a folder row a\n// dead target: the path resolved to nothing and every downstream branch was\n// keyed on a file.\nfunction collectTreePaths(nodes: VaultTreeNode[], into: TreePaths): TreePaths {\n for (const node of nodes) {\n if (node.type === 'file') into.files.add(node.path)\n else into.directories.add(node.path)\n if (node.children) collectTreePaths(node.children, into)\n }\n return into\n}\n\nfunction resolveFilePath(rawPath: string, filePaths: Set<string>): string | null {\n if (filePaths.has(rawPath)) return rawPath\n const path = rawPath.replace(/^\\/+|\\/+$/g, '')\n return filePaths.has(path) ? path : null\n}\n\nfunction resolveTreePath(rawPath: string, paths: TreePaths): { path: string; type: 'file' | 'directory' } | null {\n const file = resolveFilePath(rawPath, paths.files)\n if (file) return { path: file, type: 'file' }\n if (paths.directories.has(rawPath)) return { path: rawPath, type: 'directory' }\n const trimmed = rawPath.replace(/^\\/+|\\/+$/g, '')\n return paths.directories.has(trimmed) ? { path: trimmed, type: 'directory' } : null\n}\n\nfunction findDirectory(nodes: VaultTreeNode[], path: string): VaultTreeNode | null {\n for (const node of nodes) {\n if (node.type === 'directory' && node.path === path) return node\n const found = node.children ? findDirectory(node.children, path) : null\n if (found) return found\n }\n return null\n}\n\n/** The clicked tree row, files and directories alike. The type travels with the\n * path so the caller routes on it instead of discarding everything that is not\n * a file. */\nfunction treeClickTarget(event: MouseEvent<HTMLElement>): { path: string; type: string } | null {\n const read = (el: HTMLElement) => {\n const path = el.dataset.itemPath\n return path ? { path, type: el.dataset.itemType ?? '' } : null\n }\n\n const path = event.nativeEvent.composedPath?.() ?? []\n for (const item of path) {\n if (!(item instanceof HTMLElement)) continue\n if (item.dataset.type !== 'item') continue\n return read(item)\n }\n\n const target = event.target instanceof HTMLElement\n ? event.target.closest('[data-type=\"item\"]')\n : null\n return target instanceof HTMLElement ? read(target) : null\n}\n\n// Case-insensitive name filter over the tree: files survive when their name\n// matches; a directory survives whole (with all its children) when its own name\n// matches, otherwise only when some descendant survives.\nfunction filterNodes(nodes: VaultTreeNode[], q: string): VaultTreeNode[] {\n const out: VaultTreeNode[] = []\n for (const node of nodes) {\n if (node.type === 'file') {\n if (node.name.toLowerCase().includes(q)) out.push(node)\n } else if (node.name.toLowerCase().includes(q)) {\n out.push(node)\n } else {\n const children = filterNodes(node.children ?? [], q)\n if (children.length > 0) out.push({ ...node, children })\n }\n }\n return out\n}\n\nclass EditorErrorBoundary extends Component<{ children: ReactNode; onReset?: () => void }, { error: unknown }> {\n state: { error: unknown } = { error: null }\n static getDerivedStateFromError(error: unknown) {\n return { error }\n }\n componentDidCatch(error: unknown, info: ErrorInfo) {\n console.error('Vault crashed:', error, info)\n }\n render() {\n if (this.state.error) {\n const msg = this.state.error instanceof Error\n ? this.state.error.message\n : typeof this.state.error === 'string'\n ? this.state.error\n : 'Something went wrong loading the vault'\n return (\n <div className=\"flex h-full flex-1 flex-col items-center justify-center p-8 text-center\">\n <h3 className=\"mb-1 text-sm font-medium text-foreground\">Vault failed to load</h3>\n <p className=\"mb-4 max-w-xs text-xs text-muted-foreground\">{String(msg)}</p>\n <button\n type=\"button\"\n onClick={() => { this.setState({ error: null }); this.props.onReset?.() }}\n className=\"inline-flex h-8 items-center rounded-md border border-border px-3 text-xs font-medium text-foreground transition-colors hover:bg-muted\"\n >\n Try again\n </button>\n </div>\n )\n }\n return this.props.children\n }\n}\n\n/**\n * A skeleton is a picture of a wait, and a picture is exactly what a screen\n * reader cannot see. `aria-hidden` on the shimmer bars is right — they carry no\n * information — but hiding them without saying anything else is what left the\n * whole load silent. The container announces the wait instead: `aria-busy` for\n * the state, a `status` live region so arrival is reported, and a real text\n * label, since a live region with only decorative children announces nothing.\n */\nfunction SkeletonRegion({ label, className, children }: { label: string; className: string; children: ReactNode }) {\n // The live region is a SIBLING of the shimmer, not a wrapper around it: the\n // shimmer container keeps its exact classes and its exact position in the\n // parent's layout, so adding the announcement cannot move a pixel. Wrapping\n // it would put a new box between `space-y-*` and the bars it spaces.\n return (\n <>\n <span role=\"status\" aria-live=\"polite\" aria-busy={true} className=\"sr-only\">\n {label}\n </span>\n <div className={className} aria-hidden=\"true\">\n {children}\n </div>\n </>\n )\n}\n\nfunction TreeSkeleton() {\n return (\n <SkeletonRegion label=\"Loading files…\" className=\"space-y-2 p-4\">\n {[32, 48, 40, 52].map((w, i) => (\n <div key={i} className=\"h-4 animate-pulse rounded bg-muted\" style={{ width: `${w * 4}px` }} />\n ))}\n </SkeletonRegion>\n )\n}\n\nfunction EditorSkeleton() {\n return (\n <SkeletonRegion label=\"Loading file…\" className=\"space-y-3 p-8\">\n <div className=\"h-5 w-1/2 animate-pulse rounded bg-muted\" />\n <div className=\"h-4 w-full animate-pulse rounded bg-muted\" />\n <div className=\"h-4 w-3/4 animate-pulse rounded bg-muted\" />\n <div className=\"h-4 w-2/3 animate-pulse rounded bg-muted\" />\n </SkeletonRegion>\n )\n}\n\nfunction EmptyState() {\n return (\n <div className=\"flex h-full flex-col items-center justify-center p-8 text-center\">\n <h3 className=\"text-sm font-medium text-foreground\">Open a vault document</h3>\n <p className=\"mt-1 max-w-xs text-xs text-muted-foreground\">\n Select a file from the directory, or create a new one.\n </p>\n </div>\n )\n}\n\nfunction ReadErrorState({ message, onRetry }: { message: string; onRetry: () => void }) {\n return (\n <div className=\"flex h-full flex-col items-center justify-center gap-3 p-8 text-center\">\n <div>\n <h3 className=\"text-sm font-medium text-foreground\">Couldn't open this file</h3>\n <p className=\"mt-1 max-w-md text-xs text-muted-foreground\">{message}</p>\n </div>\n <button\n type=\"button\"\n onClick={onRetry}\n className=\"inline-flex h-8 items-center rounded-md border border-border px-3 text-xs font-medium text-foreground transition-colors hover:bg-muted\"\n >\n Retry\n </button>\n </div>\n )\n}\n\nfunction TreeErrorState({ message, onRetry }: { message: string; onRetry: () => void }) {\n return (\n <div role=\"alert\" className=\"flex h-full flex-col items-center justify-center gap-3 p-6 text-center\">\n <div>\n <h3 className=\"text-sm font-medium text-foreground\">Couldn't load the Vault</h3>\n <p className=\"mt-1 max-w-xs text-xs text-muted-foreground\">{message}</p>\n </div>\n <button\n type=\"button\"\n onClick={onRetry}\n className=\"inline-flex h-8 items-center rounded-md border border-border px-3 text-xs font-medium text-foreground transition-colors hover:bg-muted\"\n >\n Retry\n </button>\n </div>\n )\n}\n\nfunction OperationErrorAlert({\n message,\n retryLabel,\n onRetry,\n onDismiss,\n}: {\n message: string\n retryLabel: string\n onRetry: () => void\n onDismiss: () => void\n}) {\n return (\n <div\n role=\"alert\"\n className=\"flex shrink-0 items-center justify-between gap-3 border-b border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive\"\n >\n <span className=\"min-w-0 flex-1\">{message}</span>\n <div className=\"flex shrink-0 items-center gap-3\">\n <button type=\"button\" aria-label={retryLabel} onClick={onRetry} className=\"font-medium underline-offset-2 hover:underline\">\n Retry\n </button>\n <button type=\"button\" onClick={onDismiss} className=\"underline-offset-2 hover:underline\">\n Dismiss\n </button>\n </div>\n </div>\n )\n}\n\nexport function VaultPane(props: VaultPaneProps) {\n const {\n port,\n renderTree,\n renderArtifact,\n renderDock,\n canWrite = true,\n selectedPath: controlledPath,\n onSelectedPathChange,\n onOperationError,\n codec,\n className,\n dockToggle,\n refreshKey,\n headerActions,\n onDownloadFile,\n pathBarClassName,\n } = props\n\n const activeCodec = codec ?? IDENTITY_CODEC\n const controlled = controlledPath !== undefined\n const isMarkdownCapable = codec !== undefined\n // `false` → a persistent dock (no toggle, always open with the selected file).\n const persistentDock = dockToggle === false\n const dockToggleCfg = dockToggle ? dockToggle : { label: 'Discuss', disabledWhenDirty: true }\n\n const [tree, setTree] = useState<VaultTreeNode[]>([])\n const [treeLoading, setTreeLoading] = useState(true)\n const [treeLoaded, setTreeLoaded] = useState(false)\n const [treeError, setTreeError] = useState<TreeFailureState | null>(null)\n const [internalPath, setInternalPath] = useState<string | null>(null)\n const selectedPath = controlled ? (controlledPath ?? null) : internalPath\n\n const [selectedFile, setSelectedFile] = useState<VaultFile | null>(null)\n const [fileLoading, setFileLoading] = useState(false)\n const [readError, setReadError] = useState<string | null>(null)\n const [reloadNonce, setReloadNonce] = useState(0)\n const [saving, setSaving] = useState(false)\n const [saveError, setSaveError] = useState<VaultOperationFailure | null>(null)\n\n const [editorMode, setEditorMode] = useState<VaultEditorMode>('rich')\n const [richDraft, setRichDraft] = useState<VaultRichParts>('')\n const [sourceDraft, setSourceDraft] = useState('')\n const [isDirty, setIsDirty] = useState(false)\n\n const [createOpen, setCreateOpen] = useState(false)\n const [newPath, setNewPath] = useState('')\n const [creating, setCreating] = useState(false)\n const [createError, setCreateError] = useState<VaultOperationFailure | null>(null)\n const [deleteOpen, setDeleteOpen] = useState(false)\n const [deleting, setDeleting] = useState(false)\n const [deleteError, setDeleteError] = useState<VaultOperationFailure | null>(null)\n const [dockOpen, setDockOpen] = useState(false)\n const [pendingNav, setPendingNav] = useState<PendingNav>(null)\n const [query, setQuery] = useState('')\n const [folderPath, setFolderPath] = useState<string | null>(null)\n\n const savedContentRef = useRef('')\n const loadedPathRef = useRef<string | null>(null)\n const onOperationErrorRef = useRef(onOperationError)\n onOperationErrorRef.current = onOperationError\n\n const treePaths = useMemo(\n () => collectTreePaths(tree, { files: new Set<string>(), directories: new Set<string>() }),\n [tree],\n )\n const filePaths = treePaths.files\n const resolvedSelectedPath = useMemo(\n () => selectedPath ? resolveFilePath(selectedPath, filePaths) : null,\n [selectedPath, filePaths],\n )\n // The clicked folder, resolved against the CURRENT tree — a folder that a\n // refresh removed stops being the active one on its own, so neither the\n // search scope nor the create target can point at a directory that is gone.\n const activeFolderNode = useMemo(\n () => (folderPath ? findDirectory(tree, folderPath) : null),\n [tree, folderPath],\n )\n const activeFolder = activeFolderNode?.path ?? null\n const treeRoot = useMemo<VaultTreeNode>(\n () => ({ name: 'Vault', path: '', type: 'directory', children: tree }),\n [tree],\n )\n // With no query the whole vault stays on screen: the tree renderer owns\n // expansion (both sandbox-ui trees keep it internal), so re-rooting on a\n // plain folder click would fight the expand the click already performs. The\n // folder scopes the SEARCH, which is where a narrowed list is what the reader\n // asked for.\n const visibleRoot = useMemo<VaultTreeNode>(() => {\n const q = query.trim().toLowerCase()\n if (!q) return treeRoot\n const base = activeFolderNode ?? treeRoot\n return { ...base, children: filterNodes(base.children ?? [], q) }\n }, [treeRoot, activeFolderNode, query])\n\n const commitPath = useCallback(\n (next: string | null) => {\n if (!controlled) setInternalPath(next)\n onSelectedPathChange?.(next)\n },\n [controlled, onSelectedPathChange],\n )\n\n const reportFailure = useCallback((\n operation: VaultOperation,\n phase: VaultOperationPhase,\n error: unknown,\n fallback: string,\n path?: string,\n ): VaultOperationFailure => {\n const failure: VaultOperationFailure = {\n operation,\n phase,\n path,\n message: operationMessage(error, fallback),\n cause: error,\n }\n try {\n onOperationErrorRef.current?.(failure)\n } catch (callbackError) {\n console.error('Vault onOperationError callback failed:', callbackError)\n }\n return failure\n }, [])\n\n const refresh = useCallback(async (context: TreeRefreshContext = LIST_CONTEXT): Promise<boolean> => {\n setTreeLoading(true)\n setTreeError(null)\n try {\n setTree(await port.listTree())\n setTreeLoaded(true)\n return true\n } catch (error) {\n const failure = reportFailure(\n context.operation,\n context.phase,\n error,\n 'Failed to load the Vault',\n context.path,\n )\n setTreeError({ failure, context })\n return false\n } finally {\n setTreeLoading(false)\n }\n }, [port, reportFailure])\n\n useEffect(() => {\n setTree([])\n setTreeLoaded(false)\n setTreeError(null)\n }, [port])\n\n useEffect(() => {\n void refresh()\n }, [refresh, refreshKey])\n\n const retryTree = useCallback(async () => {\n if (!treeError) return\n const { context } = treeError\n const recovered = await refresh(context)\n if (recovered && context.selectAfterRecovery) commitPath(context.selectAfterRecovery)\n }, [treeError, refresh, commitPath])\n\n useEffect(() => {\n if (!selectedPath) {\n setSelectedFile(null)\n setFileLoading(false)\n setReadError(null)\n loadedPathRef.current = null\n return\n }\n if (treeLoading || !treeLoaded) return\n if (!resolvedSelectedPath) {\n commitPath(null)\n setSelectedFile(null)\n setFileLoading(false)\n setReadError(null)\n loadedPathRef.current = null\n return\n }\n let cancelled = false\n const path = resolvedSelectedPath\n if (path !== selectedPath) commitPath(path)\n setFileLoading(true)\n setReadError(null)\n void (async () => {\n try {\n const file = await port.readFile(path)\n if (!cancelled) setSelectedFile(file)\n } catch (err) {\n // Surface read failures instead of making them indistinguishable from\n // the intentionally empty \"no file selected\" state.\n if (!cancelled) {\n const failure = reportFailure('read', 'operation', err, 'Failed to read file', path)\n setSelectedFile(null)\n setReadError(failure.message)\n }\n } finally {\n if (!cancelled) setFileLoading(false)\n }\n })()\n return () => {\n cancelled = true\n }\n }, [port, selectedPath, resolvedSelectedPath, treeLoading, treeLoaded, refreshKey, reloadNonce, commitPath, reportFailure])\n\n useEffect(() => {\n if (!selectedFile) {\n loadedPathRef.current = null\n savedContentRef.current = ''\n setRichDraft('')\n setSourceDraft('')\n setEditorMode('rich')\n setIsDirty(false)\n setSaveError(null)\n return\n }\n const pathChanged = loadedPathRef.current !== selectedFile.path\n loadedPathRef.current = selectedFile.path\n savedContentRef.current = selectedFile.content\n setRichDraft(activeCodec.parse(selectedFile.content))\n setSourceDraft(selectedFile.content)\n if (pathChanged) setEditorMode('rich')\n setIsDirty(false)\n setSaveError(null)\n setDockOpen(false)\n }, [selectedFile, activeCodec])\n\n const guardedOpen = useCallback(\n (path: string) => {\n if (path === selectedPath) return\n if (isDirty) {\n setPendingNav({ type: 'open', path })\n return\n }\n commitPath(path)\n },\n [isDirty, selectedPath, commitPath],\n )\n\n // Clicking a folder makes it the vault's active folder: the search narrows to\n // it and a new file lands inside it. Clicking it again clears that — the same\n // row is the way back out, so the gesture is reversible where it was made.\n const toggleFolder = useCallback((path: string) => {\n setFolderPath((current) => (current === path ? null : path))\n }, [])\n\n // Some tree models keep their original selection callback while resetting\n // paths internally. Keep the callable stable, but have it execute the latest\n // path validation and dirty-guard logic.\n const selectFileRef = useRef<(path: string) => void>(() => {})\n selectFileRef.current = (rawPath: string) => {\n const target = resolveTreePath(rawPath, treePaths)\n if (!target) return\n if (target.type === 'file') {\n guardedOpen(target.path)\n return\n }\n toggleFolder(target.path)\n }\n const handleTreeSelect = useCallback((path: string) => selectFileRef.current(path), [])\n\n const guardedClose = useCallback(() => {\n if (isDirty) {\n setPendingNav({ type: 'close' })\n return\n }\n commitPath(null)\n setSelectedFile(null)\n }, [isDirty, commitPath])\n\n const confirmDiscard = useCallback(() => {\n const nav = pendingNav\n setPendingNav(null)\n setIsDirty(false)\n if (!nav) return\n if (nav.type === 'open') {\n commitPath(nav.path)\n } else {\n commitPath(null)\n setSelectedFile(null)\n }\n }, [pendingNav, commitPath])\n\n const showRichMode = useCallback(() => {\n setEditorMode((mode) => {\n if (mode === 'rich') return mode\n setRichDraft(activeCodec.parse(sourceDraft))\n setIsDirty(sourceDraft !== savedContentRef.current)\n return 'rich'\n })\n }, [activeCodec, sourceDraft])\n\n const showSourceMode = useCallback(() => {\n setEditorMode((mode) => {\n if (mode === 'source') return mode\n const content = isDirty ? activeCodec.serialize(richDraft) : savedContentRef.current\n setSourceDraft(content)\n setIsDirty(content !== savedContentRef.current)\n return 'source'\n })\n }, [activeCodec, isDirty, richDraft])\n\n const onSourceChange = useCallback((next: string) => {\n setSourceDraft(next)\n setIsDirty(next !== savedContentRef.current)\n }, [])\n\n const onRichChange = useCallback((next: VaultRichParts) => {\n setRichDraft(next)\n setIsDirty(activeCodec.serialize(next) !== savedContentRef.current)\n }, [activeCodec])\n\n const saveCurrent = useCallback(async () => {\n if (!selectedFile) return\n const content = editorMode === 'source' ? sourceDraft : activeCodec.serialize(richDraft)\n setSaving(true)\n setSaveError(null)\n try {\n await port.writeFile(selectedFile.path, content)\n savedContentRef.current = content\n setSelectedFile({ ...selectedFile, content })\n setSourceDraft(content)\n setRichDraft(activeCodec.parse(content))\n setIsDirty(false)\n } catch (error) {\n setSaveError(reportFailure('save', 'operation', error, 'Failed to save file', selectedFile.path))\n } finally {\n setSaving(false)\n }\n }, [selectedFile, editorMode, sourceDraft, richDraft, activeCodec, port, reportFailure])\n\n const handleCreate = useCallback(async () => {\n const trimmed = newPath.trim()\n // Same rule as the confirm button, enforced here too: the dialog can also be\n // confirmed by keyboard, and a directory path is not a file to create.\n if (!trimmed || !(trimmed.split('/').pop()?.trim())) return\n setCreating(true)\n setCreateError(null)\n try {\n const created = await port.createFile(trimmed)\n setCreateOpen(false)\n setNewPath('')\n const refreshed = await refresh({\n operation: 'create',\n phase: 'post-mutation-refresh',\n path: created,\n selectAfterRecovery: created,\n })\n if (refreshed) commitPath(created)\n } catch (error) {\n setCreateError(reportFailure('create', 'operation', error, 'Failed to create file', trimmed))\n } finally {\n setCreating(false)\n }\n }, [newPath, port, refresh, commitPath, reportFailure])\n\n const handleDelete = useCallback(async () => {\n if (!selectedFile) return\n const path = selectedFile.path\n setDeleting(true)\n setDeleteError(null)\n try {\n await port.deleteFile(path)\n setDeleteOpen(false)\n setIsDirty(false)\n commitPath(null)\n setSelectedFile(null)\n await refresh({ operation: 'delete', phase: 'post-mutation-refresh', path })\n } catch (error) {\n setDeleteError(reportFailure('delete', 'operation', error, 'Failed to delete file', path))\n } finally {\n setDeleting(false)\n }\n }, [selectedFile, port, refresh, commitPath, reportFailure])\n\n const createFileName = newPath.trim().split('/').pop()?.trim() ?? ''\n\n let treeContent: ReactNode\n if (treeLoading || (!treeLoaded && !treeError)) {\n treeContent = <TreeSkeleton />\n } else if (!treeLoaded && treeError) {\n treeContent = <TreeErrorState message={treeFailureMessage(treeError.failure)} onRetry={() => void retryTree()} />\n } else {\n treeContent = (\n <>\n {treeError && (\n <OperationErrorAlert\n message={treeFailureMessage(treeError.failure)}\n retryLabel=\"Retry vault refresh\"\n onRetry={() => void retryTree()}\n onDismiss={() => setTreeError(null)}\n />\n )}\n {renderTree({\n root: visibleRoot,\n selectedPath: resolvedSelectedPath ?? undefined,\n onSelect: handleTreeSelect,\n })}\n </>\n )\n }\n\n return (\n <EditorErrorBoundary onReset={() => { commitPath(null); setSelectedFile(null) }}>\n <div className={`flex min-h-0 flex-1 overflow-hidden ${className ?? ''}`}>\n <div className=\"flex w-[23rem] min-w-[23rem] flex-col border-r border-border bg-background\">\n <div className=\"flex items-center gap-2 border-b border-border px-4 py-3\">\n <div className=\"min-w-0 flex-1\">\n <input\n type=\"text\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n placeholder={activeFolder ? `Search ${activeFolder}…` : 'Search…'}\n aria-label=\"Search vault\"\n className=\"h-8 w-full rounded-md border border-border bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground\"\n />\n </div>\n <div className=\"flex shrink-0 items-center gap-1\">\n {headerActions}\n <button\n type=\"button\"\n aria-label=\"Refresh vault\"\n onClick={() => void refresh()}\n className=\"inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\"\n >\n ↻\n </button>\n {canWrite && (\n <button\n type=\"button\"\n aria-label={activeFolder ? `New vault file in ${activeFolder}` : 'New vault file'}\n onClick={() => { setCreateError(null); setNewPath(activeFolder ? `${activeFolder}/` : ''); setCreateOpen(true) }}\n className=\"inline-flex h-8 w-8 items-center justify-center rounded-md bg-primary text-primary-foreground transition-colors hover:bg-primary/90\"\n >\n +\n </button>\n )}\n </div>\n </div>\n {activeFolder && (\n <div className=\"flex items-center gap-1.5 border-b border-border bg-muted/40 px-4 py-1.5 text-xs\">\n <Folder className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />\n <span data-vault-folder className=\"min-w-0 flex-1 truncate font-medium text-foreground\" title={activeFolder}>\n {activeFolder}\n </span>\n <button\n type=\"button\"\n aria-label=\"Clear the active folder\"\n onClick={() => setFolderPath(null)}\n className=\"shrink-0 rounded px-1 text-muted-foreground underline-offset-2 transition-colors hover:text-foreground hover:underline\"\n >\n Clear\n </button>\n </div>\n )}\n <div\n className=\"flex-1 overflow-y-auto\"\n onClickCapture={(event) => {\n const target = treeClickTarget(event)\n if (target) handleTreeSelect(target.path)\n }}\n >\n {treeContent}\n </div>\n </div>\n\n <div className=\"flex min-w-0 flex-1 flex-col overflow-hidden\">\n {selectedFile && (\n <div className={`flex shrink-0 items-center justify-between border-b border-border px-4 py-1.5 ${pathBarClassName ?? 'bg-card'}`}>\n <span data-vault-path className=\"truncate text-xs font-medium text-foreground\">{selectedFile.path}</span>\n <div className=\"flex items-center gap-1\">\n {canWrite && isMarkdownCapable && (\n <div className=\"mr-1 flex items-center gap-1\">\n <button\n type=\"button\"\n aria-label=\"Edit as rich text\"\n aria-pressed={editorMode === 'rich'}\n onClick={showRichMode}\n className={`inline-flex h-7 items-center rounded px-2 text-xs transition-colors ${\n editorMode === 'rich'\n ? 'bg-primary text-primary-foreground'\n : 'text-muted-foreground hover:bg-muted hover:text-foreground'\n }`}\n >\n Rich\n </button>\n <button\n type=\"button\"\n aria-label=\"Edit as source\"\n aria-pressed={editorMode === 'source'}\n onClick={showSourceMode}\n className={`inline-flex h-7 items-center rounded px-2 text-xs transition-colors ${\n editorMode === 'source'\n ? 'bg-primary text-primary-foreground'\n : 'text-muted-foreground hover:bg-muted hover:text-foreground'\n }`}\n >\n Source\n </button>\n </div>\n )}\n {renderDock && !persistentDock && (\n <button\n type=\"button\"\n aria-label={dockToggleCfg.label}\n aria-pressed={dockOpen}\n disabled={(dockToggleCfg.disabledWhenDirty ?? true) && isDirty}\n title={(dockToggleCfg.disabledWhenDirty ?? true) && isDirty ? 'Save your changes first' : (dockToggleCfg.title ?? dockToggleCfg.label)}\n onClick={() => setDockOpen((v) => !v)}\n className={`inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs transition-colors disabled:pointer-events-none disabled:opacity-40 ${\n dockOpen\n ? 'bg-primary text-primary-foreground'\n : 'text-muted-foreground hover:bg-muted hover:text-foreground'\n }`}\n >\n {dockToggleCfg.label}\n </button>\n )}\n {onDownloadFile && (\n <button\n type=\"button\"\n aria-label=\"Download this file\"\n title=\"Download file\"\n onClick={() => onDownloadFile(selectedFile)}\n className=\"inline-flex h-7 w-7 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\"\n >\n <Download className=\"h-4 w-4\" />\n </button>\n )}\n {canWrite && (\n <button\n type=\"button\"\n aria-label=\"Delete this file\"\n title=\"Delete file\"\n onClick={() => { setDeleteError(null); setDeleteOpen(true) }}\n className=\"inline-flex h-7 w-7 items-center justify-center rounded text-destructive/70 transition-colors hover:bg-destructive/10 hover:text-destructive\"\n >\n <Trash2 className=\"h-4 w-4\" />\n </button>\n )}\n </div>\n </div>\n )}\n {selectedFile && saveError && (\n <OperationErrorAlert\n message={saveError.message}\n retryLabel=\"Retry save\"\n onRetry={() => void saveCurrent()}\n onDismiss={() => setSaveError(null)}\n />\n )}\n <div className=\"flex-1 overflow-hidden\">\n {fileLoading ? (\n <EditorSkeleton />\n ) : readError ? (\n <ReadErrorState message={readError} onRetry={() => setReloadNonce((n) => n + 1)} />\n ) : selectedFile && canWrite && isMarkdownCapable && editorMode === 'source' ? (\n <SourceEditor\n path={selectedFile.path}\n content={sourceDraft}\n saving={saving}\n dirty={isDirty}\n onChange={onSourceChange}\n onSave={() => void saveCurrent()}\n />\n ) : selectedFile ? (\n renderArtifact({\n file: selectedFile,\n loading: false,\n mode: editorMode,\n canWrite,\n richDraft,\n dirty: isDirty,\n onRichChange,\n onSave: () => void saveCurrent(),\n })\n ) : (\n <EmptyState />\n )}\n </div>\n </div>\n\n {renderDock && selectedFile && renderDock({\n file: selectedFile,\n open: persistentDock ? true : dockOpen,\n onClose: persistentDock ? () => {} : () => setDockOpen(false),\n })}\n\n <ConfirmDialog\n open={createOpen}\n title=\"Create vault file\"\n description={activeFolder ? `Add a new document to ${activeFolder}.` : 'Add a new document to this vault.'}\n confirmLabel={creating ? 'Creating…' : 'Create'}\n // A prefilled folder is a path with no file name yet, so emptiness is\n // not the test — `folder/` would otherwise be sent to the port as a\n // file to create.\n confirmDisabled={creating || !createFileName}\n onConfirm={() => void handleCreate()}\n onCancel={() => { setCreateOpen(false); setNewPath(''); setCreateError(null) }}\n >\n <div className=\"space-y-2\">\n <input\n value={newPath}\n autoFocus\n onChange={(e) => setNewPath(e.target.value)}\n placeholder=\"e.g. playbooks/new-strategy.md\"\n aria-label=\"New file path\"\n className=\"h-9 w-full rounded-md border border-border bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground\"\n />\n {createError && <p role=\"alert\" className=\"text-xs text-destructive\">{createError.message}</p>}\n </div>\n </ConfirmDialog>\n\n <ConfirmDialog\n open={deleteOpen}\n title=\"Delete file?\"\n description={`This permanently removes ${selectedFile?.path ?? 'this file'} from the vault.`}\n confirmLabel={deleting ? 'Deleting…' : 'Delete file'}\n confirmDisabled={deleting}\n destructive\n onConfirm={() => void handleDelete()}\n onCancel={() => { setDeleteOpen(false); setDeleteError(null) }}\n >\n {deleteError && <p role=\"alert\" className=\"text-xs text-destructive\">{deleteError.message}</p>}\n </ConfirmDialog>\n\n <ConfirmDialog\n open={pendingNav !== null}\n title=\"Discard unsaved changes?\"\n description=\"Your edits to this document haven't been saved. Continue and lose them?\"\n confirmLabel=\"Discard changes\"\n destructive\n onConfirm={confirmDiscard}\n onCancel={() => setPendingNav(null)}\n />\n </div>\n </EditorErrorBoundary>\n )\n}\n\nfunction SourceEditor({\n path,\n content,\n saving,\n dirty,\n onChange,\n onSave,\n}: {\n path: string\n content: string\n saving: boolean\n dirty: boolean\n onChange: (content: string) => void\n onSave: () => void\n}) {\n return (\n <div className=\"flex h-full min-h-0 flex-col bg-background\">\n <div className=\"flex items-center justify-between gap-2 border-b border-border px-4 py-2\">\n <p className=\"truncate font-mono text-xs text-muted-foreground\">{path}</p>\n <div className=\"flex shrink-0 items-center gap-2\">\n <span className=\"rounded-full border border-border bg-background px-2.5 py-1 text-xs text-muted-foreground\">\n {dirty ? 'Unsaved changes' : 'Saved'}\n </span>\n <button\n type=\"button\"\n onClick={onSave}\n disabled={saving || !dirty}\n className=\"inline-flex h-7 items-center rounded-md bg-primary px-2 text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:pointer-events-none disabled:opacity-50\"\n >\n {saving ? 'Saving…' : 'Save'}\n </button>\n </div>\n </div>\n <textarea\n value={content}\n onChange={(event) => onChange(event.target.value)}\n spellCheck={false}\n aria-label=\"Source editor\"\n // Full-bleed editor: keep the floor's ring but draw it inside the border\n // box, since an outward ring on a `flex-1` pane child is clipped.\n className=\"min-h-0 flex-1 resize-none border-0 bg-background p-4 font-mono text-sm leading-6 text-foreground focus-visible:[outline-offset:-2px]\"\n />\n </div>\n )\n}\n","/**\n * Self-contained confirm dialog — no dialog library. A focus-trapped modal with\n * Esc-to-cancel and Enter-to-confirm, used for create / delete / discard-unsaved\n * flows so the pane carries zero UI-kit dependency.\n */\n\nimport { useEffect, useRef, type ReactNode } from 'react'\n\nexport interface ConfirmDialogProps {\n open: boolean\n title: string\n description?: ReactNode\n confirmLabel?: string\n cancelLabel?: string\n /** Styles the confirm button as a destructive action. */\n destructive?: boolean\n /** Disables the confirm button (e.g. while the action is in flight). */\n confirmDisabled?: boolean\n onConfirm: () => void\n onCancel: () => void\n /** Optional body (e.g. an input field for the create flow). */\n children?: ReactNode\n}\n\nexport function ConfirmDialog({\n open,\n title,\n description,\n confirmLabel = 'Confirm',\n cancelLabel = 'Cancel',\n destructive = false,\n confirmDisabled = false,\n onConfirm,\n onCancel,\n children,\n}: ConfirmDialogProps) {\n const panelRef = useRef<HTMLDivElement>(null)\n const confirmRef = useRef<HTMLButtonElement>(null)\n\n useEffect(() => {\n if (!open) return\n confirmRef.current?.focus()\n }, [open])\n\n if (!open) return null\n\n function onKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n event.preventDefault()\n onCancel()\n return\n }\n if (event.key === 'Enter' && !confirmDisabled) {\n event.preventDefault()\n onConfirm()\n return\n }\n if (event.key !== 'Tab') return\n const focusable = panelRef.current?.querySelectorAll<HTMLElement>(\n 'button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])',\n )\n if (!focusable || focusable.length === 0) return\n const first = focusable[0]\n const last = focusable[focusable.length - 1]\n const active = document.activeElement as HTMLElement | null\n if (event.shiftKey && active === first) {\n event.preventDefault()\n last?.focus()\n } else if (!event.shiftKey && active === last) {\n event.preventDefault()\n first?.focus()\n }\n }\n\n return (\n <div\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4\"\n onMouseDown={(e) => { if (e.target === e.currentTarget) onCancel() }}\n >\n <div\n ref={panelRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={title}\n onKeyDown={onKeyDown}\n className=\"w-full max-w-md rounded-lg border border-border bg-card p-5 shadow-lg\"\n >\n <h2 className=\"text-sm font-semibold text-foreground\">{title}</h2>\n {description && <p className=\"mt-1.5 text-xs text-muted-foreground\">{description}</p>}\n {children && <div className=\"mt-3\">{children}</div>}\n <div className=\"mt-5 flex justify-end gap-2\">\n <button\n type=\"button\"\n onClick={onCancel}\n className=\"inline-flex h-8 items-center rounded-md px-3 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\"\n >\n {cancelLabel}\n </button>\n <button\n ref={confirmRef}\n type=\"button\"\n onClick={onConfirm}\n disabled={confirmDisabled}\n className={`inline-flex h-8 items-center rounded-md px-3 text-xs font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 ${\n destructive\n ? 'bg-destructive text-destructive-foreground hover:bg-destructive/90'\n : 'bg-primary text-primary-foreground hover:bg-primary/90'\n }`}\n >\n {confirmLabel}\n </button>\n </div>\n </div>\n </div>\n )\n}\n"],"mappings":";AAcA;AAAA,EACE;AAAA,EACA;AAAA,EAC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