@sema-agent/core 7.37.1 → 7.38.1
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/CHANGELOG.md +168 -0
- package/dist/agents/observer.js +1 -1
- package/dist/agents/peer-notices.js +4 -4
- package/dist/agents/subagent.js +1 -1
- package/dist/agents/team-role.js +2 -2
- package/dist/brain/anthropic.js +10 -9
- package/dist/brain/errors.d.ts +26 -0
- package/dist/brain/errors.js +34 -0
- package/dist/brain/input-too-long.d.ts +0 -31
- package/dist/brain/input-too-long.js +1 -18
- package/dist/brain/open-responses.js +10 -9
- package/dist/brain/openai.js +10 -9
- package/dist/brain/status-sink.d.ts +1 -1
- package/dist/brain/stream-engine.js +10 -2
- package/dist/brain/stream-shared.d.ts +11 -3
- package/dist/brain/stream-shared.js +4 -2
- package/dist/brain/tool-call-id.d.ts +29 -8
- package/dist/brain/tool-call-id.js +36 -6
- package/dist/brain/tool-call-repair.js +1 -1
- package/dist/core/a2a-task-state.js +2 -2
- package/dist/core/artifact-host.js +6 -6
- package/dist/core/ask-origin.js +6 -6
- package/dist/core/ask-unresolvable-notice.js +1 -1
- package/dist/core/auto-mode.js +4 -4
- package/dist/core/background-agent-store.js +2 -2
- package/dist/core/checkpoint-execution-record.js +1 -1
- package/dist/core/checkpoint-store.d.ts +2 -2
- package/dist/core/checkpoint-store.js +2 -2
- package/dist/core/child-clamp-seats.js +3 -3
- package/dist/core/compliance.js +1 -1
- package/dist/core/context-edit.js +1 -1
- package/dist/core/context-guard.d.ts +0 -19
- package/dist/core/context-guard.js +0 -38
- package/dist/core/decision-receipt.d.ts +27 -1
- package/dist/core/decision-receipt.js +176 -1
- package/dist/core/engine-notice.d.ts +60 -8
- package/dist/core/engine-notice.js +2 -1
- package/dist/core/gate-fold.js +3 -2
- package/dist/core/gate-outcome.js +4 -4
- package/dist/core/governance-codes.d.ts +221 -13
- package/dist/core/governance-codes.js +104 -4
- package/dist/core/hook-seats.js +2 -2
- package/dist/core/hooks.d.ts +21 -2
- package/dist/core/hooks.js +4 -1
- package/dist/core/mailbox-store.js +3 -3
- package/dist/core/mcp-failure.js +4 -4
- package/dist/core/mcp-injection-drop.js +1 -1
- package/dist/core/memory-engine/consolidation.js +1 -1
- package/dist/core/memory-engine/delegation-settlement.d.ts +8 -0
- package/dist/core/memory-engine/delegation-settlement.js +7 -0
- package/dist/core/memory-engine/engine.d.ts +12 -2
- package/dist/core/memory-engine/engine.js +10 -6
- package/dist/core/memory-engine/export-bundle.js +1 -1
- package/dist/core/memory-engine/layout.d.ts +6 -6
- package/dist/core/memory-engine/layout.js +6 -8
- package/dist/core/memory-engine/session-write-home.d.ts +30 -0
- package/dist/core/memory-engine/session-write-home.js +34 -0
- package/dist/core/memory-engine/tools.js +1 -1
- package/dist/core/memory-engine/types.js +1 -1
- package/dist/core/memory.js +1 -1
- package/dist/core/mode-policy.d.ts +10 -1
- package/dist/core/mode-policy.js +15 -7
- package/dist/core/model-seat.js +1 -1
- package/dist/core/permission-rule-model.js +3 -3
- package/dist/core/permission-rule-store.js +2 -2
- package/dist/core/read-only-shell-table.js +8 -8
- package/dist/core/retention.js +2 -2
- package/dist/core/runner/assemble-result.js +15 -5
- package/dist/core/runner/classifier-ladder.js +1 -1
- package/dist/core/runner/denial-limit-arms.d.ts +2 -0
- package/dist/core/runner/denial-limit-arms.js +6 -2
- package/dist/core/runner/inherited-ask-grants.d.ts +6 -5
- package/dist/core/runner/inherited-ask-grants.js +3 -2
- package/dist/core/runner/prepare-artifact.d.ts +3 -2
- package/dist/core/runner/prepare-context-lane.d.ts +19 -15
- package/dist/core/runner/prepare-context-lane.js +11 -15
- package/dist/core/runner/prepare-gate-stations.js +5 -5
- package/dist/core/runner/prepare-hands-readface.d.ts +4 -3
- package/dist/core/runner/prepare-hands-readface.js +1 -0
- package/dist/core/runner/prepare-inherited-gate.js +1 -1
- package/dist/core/runner/prepare-policy-chain.js +10 -10
- package/dist/core/runner/prepare-turn-wiring.d.ts +2 -2
- package/dist/core/runner/run-harness-handlers.js +3 -0
- package/dist/core/runner/run-identity-wiring.d.ts +1 -1
- package/dist/core/runner/run-identity-wiring.js +0 -2
- package/dist/core/runner/run-leg.js +2 -2
- package/dist/core/runner/run-stop-and-final-verify.js +1 -0
- package/dist/core/runner/run-turn-boundary.js +1 -1
- package/dist/core/runner/session-mode-seats.d.ts +11 -3
- package/dist/core/runner/session-mode-seats.js +6 -0
- package/dist/core/runner/session-rule-policy.js +2 -3
- package/dist/core/runner/stream-steer-verb.js +1 -1
- package/dist/core/runner/tool-call-id-fold-seat.js +16 -9
- package/dist/core/runner/tool-turn-repair-seat.d.ts +11 -1
- package/dist/core/runner/tool-turn-repair-seat.js +35 -0
- package/dist/core/runner/turn-attachments.js +1 -1
- package/dist/core/runtime-caps.js +1 -1
- package/dist/core/safety-axis-vocab.d.ts +5 -0
- package/dist/core/safety-axis-vocab.js +5 -0
- package/dist/core/session-reconcile.d.ts +9 -7
- package/dist/core/session-reconcile.js +21 -1
- package/dist/core/shared-memory/types.js +1 -1
- package/dist/core/side-query.d.ts +6 -1
- package/dist/core/store-contracts/read-back-shape-contract.js +1 -1
- package/dist/core/swappable-deps.js +1 -1
- package/dist/core/task-notification.js +4 -4
- package/dist/core/task-registry-shared.js +1 -1
- package/dist/core/terminal-cause.d.ts +19 -0
- package/dist/core/tool-face.js +6 -6
- package/dist/core/tool-policy.d.ts +17 -11
- package/dist/core/tool-policy.js +38 -72
- package/dist/core/tool-roster.js +1 -1
- package/dist/core/tool-search-setting.js +1 -1
- package/dist/core/trace.d.ts +5 -4
- package/dist/core/types.d.ts +2 -2
- package/dist/core/types.js +1 -1
- package/dist/core/wiring-manifest.js +2 -2
- package/dist/core/write-protect.js +1 -1
- package/dist/engine/harness/agent-harness.js +10 -6
- package/dist/engine/llm/tool-turns.d.ts +93 -4
- package/dist/engine/llm/tool-turns.js +63 -9
- package/dist/engine/llm/types.d.ts +11 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +4 -2
- package/dist/internal/llm.d.ts +2 -2
- package/dist/internal/llm.js +1 -1
- package/dist/orchestration/workflow-governance.js +2 -2
- package/dist/orchestration/workflow-types.js +2 -2
- package/dist/shell/lex.js +7 -7
- package/dist/tools/fs/bash-program-position.js +2 -2
- package/dist/tools/fs/fs-shared.d.ts +2 -1
- package/dist/tools/fs/fs-shared.js +1 -1
- package/dist/tools/fs/index.d.ts +13 -6
- package/dist/tools/fs/index.js +12 -4
- package/dist/tools/fs/read-deny-home.d.ts +98 -45
- package/dist/tools/fs/read-deny-home.js +294 -117
- package/dist/tools/fs/read-deny.d.ts +2 -2
- package/dist/tools/fs/read-deny.js +2 -2
- package/dist/tools/fs/safety.d.ts +2 -0
- package/dist/tools/fs/safety.js +2 -2
- package/dist/tools/fs/search.d.ts +4 -3
- package/dist/tools/fs/search.js +3 -3
- package/dist/tools/fs/shell-read-check.d.ts +9 -0
- package/dist/tools/fs/shell-read-check.js +3 -2
- package/dist/tools/fs/shell-read-establish.d.ts +3 -0
- package/dist/tools/fs/shell-read-establish.js +1 -1
- package/dist/tools/fs/shell-read-identity.d.ts +4 -3
- package/dist/tools/fs/shell-read-identity.js +2 -2
- package/dist/tools/fs/shell-read-judge.js +2 -2
- package/dist/tools/fs/shell-read-plan.js +2 -2
- package/dist/tools/fs/shell-read-write-targets.js +1 -1
- package/package.json +1 -1
- package/test/export-surface.snapshot.json +17 -1
- package/wire-changes/core@7.38.0.json +664 -0
- package/wire-changes/core@7.38.1.json +56 -0
package/dist/tools/fs/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import { BASH_READONLY_DEFAULT_ALLOW } from "./bash-readonly-classifier.js";
|
|
|
16
16
|
export { BASH_CLASSIFY_EXTRA_ALLOW, bashClassifyDefaultAllow } from "./bash-readonly-classifier.js";
|
|
17
17
|
import { checkedReadDenyHomes, compileReadDeny, compileWriteDeny, readDenyBuiltinConfigOf, readDenyPatternRun } from "./read-deny.js";
|
|
18
18
|
import { withGateTimeout } from "../../core/gate-bounded-await.js";
|
|
19
|
-
import { placeReadDenyAtHome, readDenyPlacedLater } from "./read-deny-home.js";
|
|
19
|
+
import { carryHomeViews, homeViewsAt, placeReadDenyAtHome, placementViewsOf, readDenyPlacedLater, sayPlacementLost } from "./read-deny-home.js";
|
|
20
20
|
import { deploymentFaceClampNotice, resolveContainmentFace } from "./containment-face.js";
|
|
21
21
|
export * from "./containment-face.js";
|
|
22
22
|
import {} from "./fs-shared.js";
|
|
@@ -48,9 +48,17 @@ export function createHandsToolkit(env, readFileState, rootCanonical, opts = {})
|
|
|
48
48
|
const compileAt = (homes, linked) => compileReadDeny(readDenyAdditions, "HandsToolkitOptions.readDenyPatterns", readDenyBuiltinCfg, readDenyRules, homes, linked);
|
|
49
49
|
const unplaced = compileAt([]);
|
|
50
50
|
const carried = readDenyHomes !== undefined && opts.readDenyHomeLinks !== undefined;
|
|
51
|
+
const carriedViews = carried ? placementViewsOf(opts.readDenyHomes) : undefined;
|
|
52
|
+
if (carried && carriedViews === undefined)
|
|
53
|
+
sayPlacementLost();
|
|
51
54
|
const placesNothing = !unplaced.entries.some((e) => readDenyPatternRun(e.pattern).homeAnchored);
|
|
52
|
-
const late = carried || placesNothing ? undefined : readDenyPlacedLater(unplaced, () => placeReadDenyAtHome(env, compileAt, readDenyHomes));
|
|
53
|
-
const readDeny = late?.matcher ??
|
|
55
|
+
const late = carried || placesNothing ? undefined : readDenyPlacedLater(carryHomeViews(unplaced, homeViewsAt(env, [])), () => placeReadDenyAtHome(env, compileAt, readDenyHomes));
|
|
56
|
+
const readDeny = late?.matcher ??
|
|
57
|
+
(carried
|
|
58
|
+
? carriedViews !== undefined
|
|
59
|
+
? carryHomeViews(compileAt(readDenyHomes, opts.readDenyHomeLinks), carriedViews)
|
|
60
|
+
: carryHomeViews(unplaced, homeViewsAt(env, []))
|
|
61
|
+
: carryHomeViews(unplaced, homeViewsAt(env, readDenyHomes ?? [])));
|
|
54
62
|
const afterPlacement = (tool) => late === undefined
|
|
55
63
|
? tool
|
|
56
64
|
: {
|
|
@@ -61,7 +69,7 @@ export function createHandsToolkit(env, readFileState, rootCanonical, opts = {})
|
|
|
61
69
|
},
|
|
62
70
|
};
|
|
63
71
|
const writeDenyCompiled = compileWriteDeny(readDenyRules);
|
|
64
|
-
const writeDeny = writeDenyCompiled.ruleRows.length > 0 ? writeDenyCompiled : undefined;
|
|
72
|
+
const writeDeny = writeDenyCompiled.ruleRows.length > 0 ? carryHomeViews(writeDenyCompiled, readDeny.homeViews) : undefined;
|
|
65
73
|
const readFace = resolveContainmentFace({
|
|
66
74
|
kind: "read",
|
|
67
75
|
depsFace: opts.readFace,
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import type { ExecutionEnv } from "../../internal/harness-types.js";
|
|
2
2
|
import { type PathFamily } from "./safety.js";
|
|
3
3
|
import { type ReadDenyMatcher } from "./read-deny.js";
|
|
4
|
-
/** The
|
|
5
|
-
*
|
|
4
|
+
/** The one bound every probe of an AUXILIARY home shares within one placement (see the module head): long enough for a
|
|
5
|
+
* local directory's canonical spelling, its chain of identities and its rows' heads, short enough that a hung home
|
|
6
|
+
* costs a placement seconds, not the gate's bound. */
|
|
7
|
+
export declare const AUXILIARY_HOME_PROBE_MS = 2000;
|
|
8
|
+
/** {@link declaredReadDenyHomesAnswered}'s anchor list. */
|
|
6
9
|
export declare function declaredReadDenyHomes(env: Pick<ExecutionEnv, "homeDir">): string[];
|
|
7
|
-
/** The declared home and, where the environment's canonical
|
|
8
|
-
* symlink), that spelling too: the faces judge canonical keys beside
|
|
9
|
-
* the spelled home would never meet a canonical key. A home the
|
|
10
|
+
/** The declared home and the account home ({@link declaredReadDenyHomes}) and, where the environment's canonical
|
|
11
|
+
* spelling of one differs (a home reached through a symlink), that spelling too: the faces judge canonical keys beside
|
|
12
|
+
* the spelled views, so a row placed only at the spelled home would never meet a canonical key. A home the
|
|
13
|
+
* environment cannot resolve keeps its spelling — the account home's probe waits at most {@link AUXILIARY_HOME_PROBE_MS}.
|
|
14
|
+
* `[]` — the rows hold their run at every location — where the environment declares no home, where the account lookup
|
|
15
|
+
* gave no answer, or where the declared home's own probe did not answer (ask again later). */
|
|
10
16
|
export declare function readDenyHomesOf(env: Pick<ExecutionEnv, "homeDir" | "canonicalPath">, signal?: AbortSignal): Promise<string[]>;
|
|
11
17
|
/**
|
|
12
18
|
* Where the home-anchored rows of a table LEAD beyond the home's own spellings, keyed by the row's pattern — the
|
|
@@ -15,16 +21,20 @@ export declare function readDenyHomesOf(env: Pick<ExecutionEnv, "homeDir" | "can
|
|
|
15
21
|
* (`canonicalizeTarget`: the longest existing prefix resolved, the rest rejoined); a location that differs from every
|
|
16
22
|
* home's own spelling of the head is where one of the head's segments is a link, and the row is placed there too.
|
|
17
23
|
* · a head that resolves to its own spelling under a home adds nothing (the row is already placed there);
|
|
18
|
-
* · a head that
|
|
19
|
-
*
|
|
24
|
+
* · a head under a spelling that is no directory (a segment of it is a file, a symlink to a file, a device node or a
|
|
25
|
+
* socket — the environment answers `not_directory` for the head) has nothing below it: an answer that adds nothing;
|
|
26
|
+
* · any other head that cannot be resolved (an unanswered or refused probe — a directory the probe may not enter — a
|
|
27
|
+
* probe that throws) adds nothing, and the answer is not WHOLE (`whole: false`): the row stays placed at the home's
|
|
28
|
+
* spellings until the mount places again;
|
|
20
29
|
* · a row whose head is empty (`~/.sema.*`) has no location to resolve and adds nothing;
|
|
21
|
-
* · the heads are resolved together, so one placement waits at most one probe bound
|
|
30
|
+
* · the heads are resolved together, so one placement waits at most one probe bound — or, with `deadline` (an absolute
|
|
31
|
+
* time), each head until then: a head still unresolved at the deadline is a head that did not answer;
|
|
22
32
|
* · read per placement — a link created afterwards is followed from the next placement on.
|
|
23
33
|
*/
|
|
24
34
|
export declare function readDenyHomeLinksOf(env: ExecutionEnv, entries: readonly {
|
|
25
35
|
readonly pattern: string;
|
|
26
36
|
readonly caseSensitive?: boolean;
|
|
27
|
-
}[], homes: readonly string[], signal?: AbortSignal): Promise<{
|
|
37
|
+
}[], homes: readonly string[], signal?: AbortSignal, deadline?: number): Promise<{
|
|
28
38
|
readonly linked: Map<string, string[]>;
|
|
29
39
|
readonly whole: boolean;
|
|
30
40
|
}>;
|
|
@@ -38,15 +48,81 @@ export declare function whereItLeads(env: ExecutionEnv, at: string, family?: Pat
|
|
|
38
48
|
* placed narrower than that base's own canonical spelling. The whole walk waits at most one bounded-await deadline.
|
|
39
49
|
* `undefined` when no prefix answers in time. */
|
|
40
50
|
export declare function whereItsAnsweredPrefixLeads(env: ExecutionEnv, at: string, family?: PathFamily, signal?: AbortSignal): Promise<string | undefined>;
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
51
|
+
/** The environment surface a home view reads. */
|
|
52
|
+
export type HomeViewEnv = Pick<ExecutionEnv, "homeDir" | "canonicalPath" | "fileIdentity">;
|
|
53
|
+
/**
|
|
54
|
+
* The HOME VIEWS of one placement — the one reader every face that judges a deny row by location uses (the structured
|
|
55
|
+
* read and write tools' target judgment, the shell station's establishment, the search walker, the ripgrep leg's output
|
|
56
|
+
* check and its scope choice). A judge carries the source its placement made ({@link HomeViewsCarrier}); a judgment
|
|
57
|
+
* takes one {@link HomeViews} from it ({@link homeViewsOf}).
|
|
58
|
+
*
|
|
59
|
+
* The view of a path is the path itself when it IS a directory on a home's chain (each home's canonical spelling and
|
|
60
|
+
* each of its ancestors, matched by {@link ExecutionEnv.fileIdentity}) — that directory's canonical spelling — and
|
|
61
|
+
* otherwise its parent's view with its own name rejoined. One identity keeps ONE spelling, and a row is placed at a
|
|
62
|
+
* HOME's spelling: a directory that IS a home (its own identity answered) keeps the home's own spelling over an
|
|
63
|
+
* ancestor's (a declared home below a mount of the account home meets the account home's identity at an ancestor); a
|
|
64
|
+
* home whose own identity did not answer has no directory to claim. Homes in order: the declared home, then the
|
|
65
|
+
* auxiliary homes. The homes are the placement's:
|
|
66
|
+
* · the DECLARED home (`env.homeDir`, no lookup) is always among them — whatever the account lookup answered — and its
|
|
67
|
+
* chain is read by the first judgment that asks, kept once every level answered, and asked again by the next
|
|
68
|
+
* judgment otherwise (a home that does not exist yet is read once it does);
|
|
69
|
+
* · each AUXILIARY home's chain is the one its placement read, once ({@link AUXILIARY_HOME_PROBE_MS}); a chain that did
|
|
70
|
+
* not answer stays unanswered for that placement.
|
|
71
|
+
*/
|
|
72
|
+
export interface HomeViewSource {
|
|
73
|
+
/** The home views of one judgment (a tool call, a command's establishment, one search): a view per directory is read
|
|
74
|
+
* once and shared by every path below it. */
|
|
75
|
+
views(signal?: AbortSignal): HomeViews;
|
|
76
|
+
}
|
|
77
|
+
/** A judgment's views. `of` answers the view only where it differs from the path as spelled; `undefined` otherwise, and
|
|
78
|
+
* wherever it cannot be read: no `fileIdentity` seat, no home, a level of the path whose identity fails (the path is
|
|
79
|
+
* judged as spelled, never wider). A level that does not exist (a write's missing tail) takes its parent's view.
|
|
80
|
+
* `leaf: "file"` skips the path's own identity (a file is never a directory on the chain). */
|
|
81
|
+
export interface HomeViews {
|
|
82
|
+
of(path: string, opts?: {
|
|
83
|
+
readonly leaf?: "file";
|
|
84
|
+
}): Promise<string | undefined>;
|
|
85
|
+
}
|
|
86
|
+
/** A judge that carries the home views of the placement its rows were compiled at. */
|
|
87
|
+
export interface HomeViewsCarrier {
|
|
88
|
+
readonly homeViews?: HomeViewSource;
|
|
89
|
+
}
|
|
90
|
+
/** A read deny judge with its placement's home views. */
|
|
91
|
+
export type PlacedReadDenyMatcher = ReadDenyMatcher & {
|
|
92
|
+
readonly homeViews: HomeViewSource;
|
|
93
|
+
};
|
|
94
|
+
/** The views of the placement that returned `homes` — the very list object, as the engine hands it on (the Runner's
|
|
95
|
+
* tool band). `undefined` for any other list: a copy, or a host's own. A mount that was handed the engine's placement
|
|
96
|
+
* and cannot find its views has lost it: an engine defect, which the mount names ({@link sayPlacementLost}) and answers
|
|
97
|
+
* by holding its home-anchored rows at every location — never by reading the homes a second time. */
|
|
98
|
+
export declare function placementViewsOf(homes: readonly string[]): HomeViewSource | undefined;
|
|
99
|
+
/** The line a mount says when the engine handed it a home list that is not its placement's (an engine defect, said every
|
|
100
|
+
* time: no latch). */
|
|
101
|
+
export declare function sayPlacementLost(): void;
|
|
102
|
+
/** The home views over a home list fixed now — a mount that places nothing itself (a toolkit handed its placement, or
|
|
103
|
+
* one whose table has no home-anchored row) and the public shell judgment: the declared home, and every entry of
|
|
104
|
+
* `homes` that is not the declared home as an auxiliary home, read once, at once. */
|
|
105
|
+
export declare function homeViewsAt(env: HomeViewEnv, homes: readonly string[]): HomeViewSource;
|
|
106
|
+
/** The home views of one judgment, off the judge it judges with: the views of the judge's placement. A judge that
|
|
107
|
+
* carries none (one built outside a mount) reads the declared home alone. */
|
|
108
|
+
export declare function homeViewsOf(env: HomeViewEnv, judge: HomeViewsCarrier | undefined, signal?: AbortSignal): HomeViews;
|
|
109
|
+
/** A judge with the home views `source` gives it. */
|
|
110
|
+
export declare function carryHomeViews<T extends object>(judge: T, source: HomeViewSource): T & {
|
|
111
|
+
readonly homeViews: HomeViewSource;
|
|
112
|
+
};
|
|
113
|
+
/** One mount's read-deny judge with its home-anchored rows placed, and the home views of that placement:
|
|
114
|
+
* · the HOME SET — `homes` when the mount carries a list (the account is not asked and no home is added), else the
|
|
115
|
+
* declared home and the account lookup's answer ({@link declaredReadDenyHomes}); every home of the set is anchored at
|
|
116
|
+
* its spelling and, where the environment answered one, its canonical spelling — one rule for both forms;
|
|
117
|
+
* · the DECLARED home's canonical spelling under the tree's gate bound, and its rows' heads ({@link readDenyHomeLinksOf}):
|
|
118
|
+
* a declared home, or a head under it, that did not answer leaves the placement not WHOLE — and an account lookup
|
|
119
|
+
* with no answer, or a declared home that did not answer, places nothing: the rows are held anywhere (`compile([])`)
|
|
120
|
+
* rather than at a spelling that may miss the home's canonical one;
|
|
121
|
+
* · each AUXILIARY home (see the module head) read once under {@link AUXILIARY_HOME_PROBE_MS} — its spellings, its
|
|
122
|
+
* chain, its rows' heads — at the same time; whatever of it did not answer costs that home alone and never `whole`.
|
|
123
|
+
* `compile` is the mount's own compile; the rows' patterns are read off its compile at no home. */
|
|
48
124
|
export declare function placeReadDenyAtHome(env: ExecutionEnv, compile: (homes: readonly string[], linked?: ReadonlyMap<string, readonly string[]>) => ReadDenyMatcher, homes?: readonly string[], signal?: AbortSignal): Promise<{
|
|
49
|
-
readonly matcher:
|
|
125
|
+
readonly matcher: PlacedReadDenyMatcher;
|
|
50
126
|
readonly homes: readonly string[];
|
|
51
127
|
readonly linked: ReadonlyMap<string, readonly string[]>;
|
|
52
128
|
readonly whole: boolean;
|
|
@@ -58,36 +134,13 @@ export declare function placeReadDenyAtHome(env: ExecutionEnv, compile: (homes:
|
|
|
58
134
|
* (either way) and, while no placement has come back WHOLE (a failed one, or one with a head that did not answer),
|
|
59
135
|
* places again first — an unanswered lookup is never kept as the answer. A failed placement leaves the table it
|
|
60
136
|
* replaced (the rows held anywhere, or an earlier placement), never unplaced-and-narrow. The mount holds its read faces
|
|
61
|
-
* until `ready()`.
|
|
137
|
+
* until `ready()`. The judge's home views are the latest settled placement's: a judgment that asks for one waits for the
|
|
138
|
+
* placement in flight (it never starts one).
|
|
62
139
|
*/
|
|
63
|
-
export declare function readDenyPlacedLater(unplaced:
|
|
64
|
-
readonly matcher:
|
|
140
|
+
export declare function readDenyPlacedLater(unplaced: PlacedReadDenyMatcher, place: () => Promise<{
|
|
141
|
+
readonly matcher: PlacedReadDenyMatcher;
|
|
65
142
|
readonly whole: boolean;
|
|
66
143
|
}>): {
|
|
67
|
-
readonly matcher:
|
|
144
|
+
readonly matcher: PlacedReadDenyMatcher;
|
|
68
145
|
readonly ready: () => Promise<void>;
|
|
69
146
|
};
|
|
70
|
-
/** The environment surface a home view reads. */
|
|
71
|
-
export type HomeViewEnv = Pick<ExecutionEnv, "homeDir" | "canonicalPath" | "fileIdentity">;
|
|
72
|
-
/**
|
|
73
|
-
* A path's HOME VIEW — the one reader every face that judges a deny row by location uses (the structured read and
|
|
74
|
-
* write tools' target judgment, the shell station's establishment, the search walker, the ripgrep leg's output check
|
|
75
|
-
* and its scope choice). The view of a path is the path itself when it IS a directory on the home's chain (the
|
|
76
|
-
* canonical home and each of its ancestors, matched by {@link ExecutionEnv.fileIdentity}) — that directory's
|
|
77
|
-
* canonical spelling — and otherwise its parent's view with its own name rejoined. `of` answers the view only where
|
|
78
|
-
* it differs from the path as spelled; `undefined` otherwise, and wherever it cannot be read:
|
|
79
|
-
* · the environment declares no home, no `fileIdentity`, or its home does not resolve ⇒ no view (the spelling form);
|
|
80
|
-
* a home, or a level of its chain, that could not be read is asked again by the next judgment — an unanswered
|
|
81
|
-
* lookup is never kept as the answer;
|
|
82
|
-
* · a level that does not exist (a write's missing tail) has no identity of its own and takes its parent's view;
|
|
83
|
-
* · any other failure at a level stops the view there: the path is judged as spelled, never wider.
|
|
84
|
-
* `leaf: "file"` skips the path's own identity (a file is never a directory on the chain).
|
|
85
|
-
*/
|
|
86
|
-
export interface HomeViews {
|
|
87
|
-
of(path: string, opts?: {
|
|
88
|
-
readonly leaf?: "file";
|
|
89
|
-
}): Promise<string | undefined>;
|
|
90
|
-
}
|
|
91
|
-
/** The home views of one judgment (a tool call, a command's establishment, one search): a view per directory is read
|
|
92
|
-
* once and shared by every path below it. */
|
|
93
|
-
export declare function homeViewsOf(env: HomeViewEnv, signal?: AbortSignal): HomeViews;
|