@sema-agent/core 7.29.0 → 7.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +361 -0
- package/dist/agents/child-model-seat.d.ts +59 -7
- package/dist/agents/child-model-seat.js +33 -7
- package/dist/agents/cross-session-judge.d.ts +27 -5
- package/dist/agents/cross-session-judge.js +23 -12
- package/dist/agents/list-agents-tool.d.ts +31 -6
- package/dist/agents/list-agents-tool.js +66 -14
- package/dist/agents/peer-admission.d.ts +20 -8
- package/dist/agents/peer-admission.js +21 -12
- package/dist/agents/peer-directory.d.ts +29 -0
- package/dist/agents/peer-directory.js +20 -0
- package/dist/agents/peer-held-queue.d.ts +31 -4
- package/dist/agents/peer-held-queue.js +32 -1
- package/dist/agents/peer-session-drain.d.ts +91 -13
- package/dist/agents/peer-session-drain.js +409 -102
- package/dist/agents/read-inbox-tool.d.ts +22 -0
- package/dist/agents/read-inbox-tool.js +39 -0
- package/dist/agents/roster-store.d.ts +2 -4
- package/dist/agents/roster-store.js +1 -1
- package/dist/agents/send-message-tool.d.ts +4 -4
- package/dist/agents/send-message-tool.js +22 -2
- package/dist/agents/subagent.js +62 -44
- package/dist/agents/team-role.d.ts +34 -0
- package/dist/agents/team-role.js +17 -0
- package/dist/agents/verify.js +2 -2
- package/dist/core/auto-compaction.d.ts +42 -0
- package/dist/core/auto-compaction.js +35 -2
- package/dist/core/child-clamp-seats.d.ts +11 -0
- package/dist/core/child-clamp-seats.js +3 -0
- package/dist/core/context-edit.d.ts +3 -2
- package/dist/core/context-edit.js +6 -5
- package/dist/core/context-guard.d.ts +2 -1
- package/dist/core/context-guard.js +3 -2
- package/dist/core/context-settings.d.ts +103 -0
- package/dist/core/context-settings.js +60 -0
- package/dist/core/engine-notice.d.ts +11 -1
- package/dist/core/frame-settlement.d.ts +97 -0
- package/dist/core/frame-settlement.js +36 -0
- package/dist/core/governance-codes.d.ts +1 -1
- package/dist/core/governance-codes.js +2 -0
- package/dist/core/hooks.d.ts +10 -10
- package/dist/core/mailbox-store.d.ts +41 -7
- package/dist/core/mailbox-store.js +9 -3
- package/dist/core/parent-spec-seat.d.ts +14 -1
- package/dist/core/parent-spec-seat.js +6 -0
- package/dist/core/permission-rule-model.js +1 -1
- package/dist/core/roles.d.ts +20 -0
- package/dist/core/roles.js +35 -16
- package/dist/core/runner/assemble-result.d.ts +2 -0
- package/dist/core/runner/assemble-result.js +1 -1
- package/dist/core/runner/compaction-call-options.d.ts +26 -2
- package/dist/core/runner/compaction-call-options.js +9 -0
- package/dist/core/runner/compaction-seams.d.ts +4 -3
- package/dist/core/runner/compaction-seams.js +13 -6
- package/dist/core/runner/contracts.d.ts +56 -7
- package/dist/core/runner/decide-continuation.d.ts +2 -1
- package/dist/core/runner/decide-continuation.js +11 -10
- package/dist/core/runner/initial-run-state.js +1 -1
- package/dist/core/runner/prepare-caps-and-workflow.js +9 -1
- package/dist/core/runner/prepare-config-doors.js +4 -1
- package/dist/core/runner/prepare-context-lane.d.ts +9 -2
- package/dist/core/runner/prepare-context-lane.js +15 -10
- package/dist/core/runner/prepare-delegation-surface.d.ts +3 -2
- package/dist/core/runner/prepare-delegation-surface.js +9 -3
- package/dist/core/runner/prepare-file-history.js +10 -8
- package/dist/core/runner/prepare-gate-stations.d.ts +4 -0
- package/dist/core/runner/prepare-gate-stations.js +3 -1
- package/dist/core/runner/prepare-inherited-gate.js +1 -0
- package/dist/core/runner/prepare-prompt-inputs.d.ts +6 -0
- package/dist/core/runner/prepare-prompt-inputs.js +2 -1
- package/dist/core/runner/prepare-task.js +22 -9
- package/dist/core/runner/prepare-wiring-manifest.d.ts +6 -1
- package/dist/core/runner/prepare-wiring-manifest.js +6 -1
- package/dist/core/runner/retired-runner-deps.d.ts +3 -1
- package/dist/core/runner/retired-runner-deps.js +1 -0
- package/dist/core/runner/run-compaction-machinery.d.ts +4 -2
- package/dist/core/runner/run-compaction-machinery.js +5 -3
- package/dist/core/runner/run-harness-handlers.js +1 -1
- package/dist/core/runner/run-identity-wiring.js +19 -1
- package/dist/core/runner/run-leg.js +1 -1
- package/dist/core/runner/run-notification-lane.js +8 -2
- package/dist/core/runner/run-recovery-lanes.js +9 -5
- package/dist/core/runner/run-settle-and-teardown.d.ts +4 -22
- package/dist/core/runner/run-settle-and-teardown.js +6 -10
- package/dist/core/runner/run-stop-and-final-verify.js +1 -0
- package/dist/core/runner/run-terminal-adoption.js +5 -5
- package/dist/core/runner/run-turn-boundary.js +32 -5
- package/dist/core/runner/runtask.d.ts +8 -1
- package/dist/core/runner/runtask.js +32 -1
- package/dist/core/runner-deps.d.ts +44 -13
- package/dist/core/swappable-deps.d.ts +20 -4
- package/dist/core/swappable-deps.js +6 -1
- package/dist/core/task-event.d.ts +5 -0
- package/dist/core/task-notification.d.ts +144 -2
- package/dist/core/task-notification.js +154 -5
- package/dist/core/task-result.d.ts +14 -0
- package/dist/core/task-spec.d.ts +7 -0
- package/dist/core/tool-catalog-entries.js +2 -1
- package/dist/core/tool-conformance.js +1 -0
- package/dist/core/tool-policy.d.ts +9 -4
- package/dist/core/tool-spec.d.ts +14 -0
- package/dist/core/wiring-manifest.d.ts +12 -0
- package/dist/core/wiring-manifest.js +5 -1
- package/dist/engine/harness/agent-harness.d.ts +14 -1
- package/dist/engine/harness/agent-harness.js +28 -3
- package/dist/engine/harness/types.d.ts +3 -1
- package/dist/engine/llm/types.d.ts +8 -7
- package/dist/engine/llm/types.js +1 -1
- package/dist/engine/session/import-validate.js +4 -0
- package/dist/index.d.ts +10 -7
- package/dist/index.js +7 -5
- package/dist/orchestration/run-workflow-tool.d.ts +4 -4
- package/dist/orchestration/workflow.d.ts +1 -1
- package/dist/orchestration/workflow.js +8 -5
- package/dist/shell/lex.d.ts +30 -51
- package/dist/shell/lex.js +237 -284
- package/dist/stores/cc/mailbox-store.js +3 -2
- package/dist/stores/file/corrupt-read-sink.d.ts +28 -2
- package/dist/stores/file/file-history-store.d.ts +2 -4
- package/dist/stores/file/file-history-store.js +1 -1
- package/dist/stores/file/fs-atomic.d.ts +16 -11
- package/dist/stores/file/fs-atomic.js +17 -6
- package/dist/stores/file/index.d.ts +5 -6
- package/dist/stores/file/index.js +1 -1
- package/dist/stores/file/mailbox-store.d.ts +4 -9
- package/dist/stores/file/mailbox-store.js +29 -30
- package/dist/stores/file/session-policy-store.d.ts +2 -0
- package/dist/stores/file/session-policy-store.js +1 -1
- package/dist/stores/file/session-store.d.ts +11 -7
- package/dist/stores/file/session-store.js +23 -16
- package/dist/stores/file/shared-ledger.js +3 -14
- package/dist/stores/file/tool-result-store.d.ts +2 -0
- package/dist/stores/file/tool-result-store.js +5 -2
- package/dist/stores/file/workflow-journal-store.js +14 -9
- package/dist/tools/fs/bash-program-position.d.ts +15 -24
- package/dist/tools/fs/bash-program-position.js +11 -29
- package/dist/tools/fs/bash-readonly-classifier.d.ts +125 -117
- package/dist/tools/fs/bash-readonly-classifier.js +400 -272
- package/dist/tools/fs/shell-read-check.js +3 -3
- package/dist/tools/fs/shell-read-establish.js +1 -1
- package/dist/tools/fs/shell-read-plan.d.ts +11 -6
- package/dist/tools/fs/shell-read-plan.js +167 -183
- package/dist/tools/fs/shell-read-word.d.ts +50 -0
- package/dist/tools/fs/shell-read-word.js +59 -0
- package/dist/tools/fs/shell-reentry-text.d.ts +10 -0
- package/dist/tools/fs/shell-reentry-text.js +73 -0
- package/package.json +1 -1
- package/test/export-surface.snapshot.json +58 -8
- package/wire-changes/core@7.30.0.json +1821 -0
|
@@ -8,7 +8,7 @@ import { planShellReads } from "./shell-read-plan.js";
|
|
|
8
8
|
import { createShellReadEstablisher, establishShellReadsLexically } from "./shell-read-establish.js";
|
|
9
9
|
import { allFindings, decideShellRead, foldShellReadFindings, judgeEstablishedPlan, readRootGrantCandidateOf, } from "./shell-read-judge.js";
|
|
10
10
|
import { normalizeReadRootCandidate } from "../../core/read-root-candidate.js";
|
|
11
|
-
import {
|
|
11
|
+
import { argvOf, lexShellText } from "../../shell/lex.js";
|
|
12
12
|
function containmentDetails(paths) {
|
|
13
13
|
return { type: "readonly_out_of_root", code: "readonly_out_of_root", paths };
|
|
14
14
|
}
|
|
@@ -18,9 +18,9 @@ function shellCommandOf(args) {
|
|
|
18
18
|
return typeof command === "string" ? command : undefined;
|
|
19
19
|
}
|
|
20
20
|
function declineSentence(segment) {
|
|
21
|
-
const lexed = lexShellText(segment.text
|
|
21
|
+
const lexed = lexShellText(segment.text);
|
|
22
22
|
if (!("reject" in lexed) && lexed.segments[0] !== undefined) {
|
|
23
|
-
const pos = readProgramPosition(
|
|
23
|
+
const pos = readProgramPosition(argvOf(lexed.segments[0]));
|
|
24
24
|
if (pos.refusal !== undefined)
|
|
25
25
|
return programPositionRefusalSentence(pos.refusal);
|
|
26
26
|
if (pos.argvFromStdin) {
|
|
@@ -94,7 +94,7 @@ function basesFor(candidate, boundary) {
|
|
|
94
94
|
}
|
|
95
95
|
function lexicalReadsOf(candidate, boundary) {
|
|
96
96
|
if (candidate.expands === "unresolvable") {
|
|
97
|
-
return [{ candidate, established: "unestablishable", spellings: [candidate.spelled], cause: `"${candidate.raw}" is rewritten by the shell before the program sees it` }];
|
|
97
|
+
return [{ candidate, established: "unestablishable", spellings: [candidate.spelled, ...(candidate.floorSpelled !== undefined ? [candidate.floorSpelled] : [])], cause: `"${candidate.raw}" is rewritten by the shell before the program sees it` }];
|
|
98
98
|
}
|
|
99
99
|
const bases = basesFor(candidate, boundary);
|
|
100
100
|
if (bases === "unmodelled") {
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* The read boundary today re-derives "which words may be read" at several sites (the compound walk, the
|
|
5
5
|
* containment-only gate, the refused-command whitelist, the execute-time recheck), each with its own idea
|
|
6
6
|
* of launchers, option slots, redirections and re-entry. This module is the single extraction those sites
|
|
7
|
-
* are to consume: a pure, zero-I/O function over the
|
|
8
|
-
* reader (`bash-program-position.ts`), returning every path word a command MAY read, each tagged with its
|
|
7
|
+
* are to consume: a pure, zero-I/O function over the one lexer's word FACTS (`src/shell/lex.ts`) and the
|
|
8
|
+
* program-position reader (`bash-program-position.ts`), returning every path word a command MAY read, each tagged with its
|
|
9
9
|
* PROVENANCE (why it is a candidate) and the working-directory candidates it is relative to. Establishment
|
|
10
10
|
* (`shell-read-establish.ts`) and judgment are downstream; nothing here decides allow/ask/deny.
|
|
11
11
|
*
|
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
* · an UNLISTED program hands every word of its argv (a program declared to open no path operand hands none);
|
|
16
16
|
* · a LAUNCHER chain is peeled to its program and the chain's own words are never candidates; a launcher
|
|
17
17
|
* option the row cannot read is recorded as a decline and every word after it is handed over;
|
|
18
|
-
* · a SHELL re-entry (`sh -c S`, `eval S`, a launcher handing text to a shell, `env -S S
|
|
19
|
-
*
|
|
18
|
+
* · a SHELL re-entry (`sh -c S`, `eval S`, a launcher handing text to a shell, `env -S S`, a builtin's code-body
|
|
19
|
+
* operand the shell runs later — `trap S SIG`, `alias N=S`, `mapfile -C S`) carries its text as a NESTED plan;
|
|
20
|
+
* an argv re-entry (`xargs`) is a decline unless the target opens nothing it is handed;
|
|
20
21
|
* · an INTERPRETER's inline program is a shape fact (`reentry:"interpreter"`), never parsed, never a finding;
|
|
21
22
|
* · `<` targets are read candidates, `>`-family targets are write targets (tagged, not read), here-documents
|
|
22
23
|
* and here-strings are data (an UNQUOTED here-document body's substitutions are nested plans);
|
|
@@ -35,7 +36,8 @@ export type ReadCandidateProvenance = (typeof READ_CANDIDATE_PROVENANCES)[number
|
|
|
35
36
|
export interface ShellReadDeclarations {
|
|
36
37
|
/** The listed read verbs. They decide whether a segment is read by verb slots or word by word, never whether it hands candidates. */
|
|
37
38
|
readonly readers: ReadonlySet<string>;
|
|
38
|
-
/**
|
|
39
|
+
/** The declared home: a word that spells it (`$HOME` / `${HOME}` — {@link homeExpansionOf}) is named by it,
|
|
40
|
+
* unless the command may rebind `HOME` (then `~` is unresolvable too); `~` itself is left to establishment. */
|
|
39
41
|
readonly homeDir?: string;
|
|
40
42
|
/** The working directory the first segment's relative words resolve against. */
|
|
41
43
|
readonly cwd: string;
|
|
@@ -60,6 +62,9 @@ export interface ReadCandidate {
|
|
|
60
62
|
* A deny row is a floor, so the judge resolves the spelling against these for deny rows ONLY — never to
|
|
61
63
|
* establish a read. `cd sub && cd $'\x2e' && cat <deny row under sub>` (bash: `cd .`) is refused through it. */
|
|
62
64
|
readonly floorBases?: readonly string[];
|
|
65
|
+
/** A home word the plan does not place (the text may rebind `HOME`, or it sits in a value): spelled with the DECLARED
|
|
66
|
+
* home. A deny row is a floor: the judge reads it for deny rows ONLY, never to establish a read. */
|
|
67
|
+
readonly floorSpelled?: string;
|
|
63
68
|
}
|
|
64
69
|
/** How the shell reached one segment — what the base-candidate walk needs from the connectors. */
|
|
65
70
|
export interface SegmentReach {
|
|
@@ -118,4 +123,4 @@ export interface ShellReadPlan {
|
|
|
118
123
|
readonly strayRedirection: boolean;
|
|
119
124
|
};
|
|
120
125
|
}
|
|
121
|
-
export declare function planShellReads(command: string, decl: ShellReadDeclarations, depth?: number): ShellReadPlan;
|
|
126
|
+
export declare function planShellReads(command: string, decl: ShellReadDeclarations, depth?: number, homeRebound?: boolean): ShellReadPlan;
|