@sema-agent/core
Version:
Stateless, task-oriented AI agent core
21 lines (20 loc) • 1.71 kB
TypeScript
import type { ExecutionEnv } from "../internal/harness-types.js";
import { type PathFamily } from "../tools/fs/safety.js";
/**
* Every spelling the leaf symlink chain of `path` passes through, or `[]`.
*
* `[]` has ONE reading for the VERDICT — nothing to judge beyond the spelling and the terminal — reached four
* ways that are deliberately the same word: no `canonicalChain` declared, a refused namespace spelling, an
* empty chain, and the environment answering `ok: false`. An unanswerable chain is never a refusal: this
* reader's callers are path guards whose own absence law says a view that cannot answer does not vote, and a
* second refusal law over one target would be a second rule. The spelling is anchored as the canonicalizer
* anchors it (`baseCwd`). A refused namespace spelling and a win-form UNC spelling are not walked (the reference
* CLI's variant set stops at a network spelling); the share is recognized by the throat's own `isUncSpelling`.
*
* `onUnanswerable` separates ONE of those four from the rest for a caller that DISCLOSES its absent views: the
* environment was ASKED and could not answer (`ok: false`), which is a fact about that environment. The other
* three are not failures — nothing was asked, or the answer was genuinely "no hops" — so they stay silent. The
* verdict is `[]` either way; this sink changes nothing about what is judged, only what is said out loud. A
* throwing sink is the caller's bug and is not caught here.
*/
export declare function symlinkChainHops(env: ExecutionEnv, path: string, signal: AbortSignal | undefined, family: PathFamily, baseCwd?: string, onUnanswerable?: (cause: string) => void): Promise<readonly string[]>;