@sema-agent/core 7.64.0 → 7.66.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 +571 -0
- package/dist/agents/delegation-registry-seat.d.ts +15 -0
- package/dist/agents/delegation-registry-seat.js +13 -0
- package/dist/agents/org-delivery-gate.d.ts +8 -1
- package/dist/agents/org-delivery-gate.js +9 -3
- package/dist/agents/peer-held-queue.js +1 -1
- package/dist/agents/peer-idle.js +1 -1
- package/dist/agents/peer-session-drain.d.ts +51 -12
- package/dist/agents/peer-session-drain.js +47 -34
- package/dist/agents/read-inbox-tool.d.ts +6 -2
- package/dist/agents/read-inbox-tool.js +18 -5
- package/dist/agents/subagent.d.ts +3 -1
- package/dist/agents/subagent.js +84 -77
- package/dist/brain/reasoning.d.ts +2 -0
- package/dist/brain/reasoning.js +1 -0
- package/dist/core/allow-entry.d.ts +9 -0
- package/dist/core/allow-entry.js +7 -1
- package/dist/core/ask-origin.d.ts +23 -3
- package/dist/core/ask-origin.js +11 -1
- package/dist/core/auto-promote.d.ts +3 -2
- package/dist/core/background-agent-store.d.ts +7 -0
- package/dist/core/checkpoint-store.d.ts +2 -3
- package/dist/core/context-settings.d.ts +1 -2
- package/dist/core/context-settings.js +1 -1
- package/dist/core/engine-attestation.d.ts +2 -2
- package/dist/core/engine-notice.d.ts +13 -1
- package/dist/core/engine-notice.js +3 -1
- package/dist/core/file-history-store.d.ts +2 -2
- package/dist/core/file-history-store.js +0 -4
- package/dist/core/gate-fold.js +3 -1
- package/dist/core/governance-codes.d.ts +6 -4
- package/dist/core/governance-codes.js +5 -3
- package/dist/core/human-input-projection.d.ts +9 -0
- package/dist/core/human-input-projection.js +13 -0
- package/dist/core/input-author.d.ts +66 -6
- package/dist/core/input-author.js +21 -3
- package/dist/core/leg-identity.d.ts +18 -2
- package/dist/core/leg-identity.js +5 -7
- package/dist/core/mailbox-store.d.ts +1 -1
- package/dist/core/memory-engine/consolidation.d.ts +30 -10
- package/dist/core/memory-engine/consolidation.js +41 -6
- package/dist/core/memory-engine/control-objects.d.ts +36 -3
- package/dist/core/memory-engine/control-objects.js +134 -12
- package/dist/core/memory-engine/control-plane-adoption.d.ts +13 -9
- package/dist/core/memory-engine/control-plane-adoption.js +58 -31
- package/dist/core/memory-engine/delegation-settlement.d.ts +75 -52
- package/dist/core/memory-engine/delegation-settlement.js +211 -228
- package/dist/core/memory-engine/dual-root.d.ts +3 -2
- package/dist/core/memory-engine/dual-root.js +5 -1
- package/dist/core/memory-engine/engine.d.ts +33 -16
- package/dist/core/memory-engine/engine.js +213 -177
- package/dist/core/memory-engine/file-backend.d.ts +21 -12
- package/dist/core/memory-engine/file-backend.js +58 -104
- package/dist/core/memory-engine/index.d.ts +2 -2
- package/dist/core/memory-engine/index.js +2 -2
- package/dist/core/memory-engine/layout.d.ts +184 -83
- package/dist/core/memory-engine/layout.js +267 -172
- package/dist/core/memory-engine/memory-age.d.ts +12 -0
- package/dist/core/memory-engine/memory-age.js +17 -0
- package/dist/core/memory-engine/memory-backend-contract.js +12 -11
- package/dist/core/memory-engine/memory-deployment.d.ts +4 -3
- package/dist/core/memory-engine/memory-deployment.js +6 -3
- package/dist/core/memory-engine/origin-clearance.d.ts +43 -15
- package/dist/core/memory-engine/origin-clearance.js +142 -58
- package/dist/core/memory-engine/tools.d.ts +2 -2
- package/dist/core/memory-engine/tools.js +7 -7
- package/dist/core/memory-engine/types.d.ts +16 -10
- package/dist/core/memory-vector.d.ts +6 -14
- package/dist/core/memory.d.ts +0 -462
- package/dist/core/memory.js +0 -333
- package/dist/core/model-receipt.d.ts +2 -1
- package/dist/core/model-receipt.js +5 -0
- package/dist/core/mods/dollar.d.ts +12 -0
- package/dist/core/mods/kernel/dispatch.d.ts +3 -1
- package/dist/core/mods/kernel/dispatch.js +5 -2
- package/dist/core/mods/kernel/events.d.ts +3 -1
- package/dist/core/mods/kernel/events.js +2 -2
- package/dist/core/mods/prompt-submit.d.ts +4 -0
- package/dist/core/mods/prompt-submit.js +24 -0
- package/dist/core/mods/stations.d.ts +23 -4
- package/dist/core/mods/stations.js +14 -7
- package/dist/core/permission-rule-consent.d.ts +49 -18
- package/dist/core/permission-rule-consent.js +59 -38
- package/dist/core/permission-rule-store.d.ts +24 -14
- package/dist/core/retention.d.ts +2 -7
- package/dist/core/retention.js +0 -1
- package/dist/core/retired-host-table-account.d.ts +19 -0
- package/dist/core/retired-host-table-account.js +28 -0
- package/dist/core/retired-tool-name-account.d.ts +60 -0
- package/dist/core/retired-tool-name-account.js +32 -0
- package/dist/core/roles.d.ts +3 -1
- package/dist/core/roles.js +5 -2
- package/dist/core/runner/classifier-ladder.d.ts +3 -1
- package/dist/core/runner/classifier-ladder.js +2 -2
- package/dist/core/runner/compact-session.js +2 -1
- package/dist/core/runner/contracts.d.ts +9 -9
- package/dist/core/runner/delegation-owner.d.ts +0 -8
- package/dist/core/runner/delegation-owner.js +1 -3
- package/dist/core/runner/gate-exit.js +9 -2
- package/dist/core/runner/memory-consolidation-driver.js +2 -2
- package/dist/core/runner/prepare-config-doors.js +1 -1
- package/dist/core/runner/prepare-delegation-surface.d.ts +1 -1
- package/dist/core/runner/prepare-delegation-surface.js +5 -3
- package/dist/core/runner/prepare-gate-stations.d.ts +8 -5
- package/dist/core/runner/prepare-gate-stations.js +13 -5
- package/dist/core/runner/prepare-inherited-gate.js +2 -0
- package/dist/core/runner/prepare-memory-engine-session.js +1 -1
- package/dist/core/runner/prepare-memory.js +35 -14
- package/dist/core/runner/prepare-policy-chain.js +12 -3
- package/dist/core/runner/prepare-project-context.js +2 -2
- package/dist/core/runner/prepare-task.d.ts +9 -1
- package/dist/core/runner/prepare-task.js +6 -5
- package/dist/core/runner/prepare-wiring-manifest.js +5 -4
- package/dist/core/runner/prompt-suggestions.js +1 -1
- package/dist/core/runner/run-identity-wiring.js +2 -2
- package/dist/core/runner/run-leg.js +3 -3
- package/dist/core/runner/run-notification-lane.d.ts +3 -0
- package/dist/core/runner/run-notification-lane.js +2 -2
- package/dist/core/runner/runtask.js +6 -3
- package/dist/core/runner/steer-admission.d.ts +11 -2
- package/dist/core/runner/stream-steer-verb.d.ts +5 -2
- package/dist/core/runner/stream-steer-verb.js +67 -14
- package/dist/core/runner/sub-agent-deny-lists.d.ts +8 -8
- package/dist/core/runner/sub-agent-deny-lists.js +22 -8
- package/dist/core/runner-deps.d.ts +4 -4
- package/dist/core/secret-env.d.ts +2 -2
- package/dist/core/secret-env.js +6 -20
- package/dist/core/session-store.d.ts +6 -6
- package/dist/core/session-store.js +3 -3
- package/dist/core/shell-run-candidates.js +3 -3
- package/dist/core/side-query.js +1 -1
- package/dist/core/skill-grant.d.ts +7 -0
- package/dist/core/skill-grant.js +14 -5
- package/dist/core/store-contracts/background-agent-store-contract.js +13 -0
- package/dist/core/task-event.d.ts +14 -0
- package/dist/core/task-notification.d.ts +35 -8
- package/dist/core/task-notification.js +31 -13
- package/dist/core/task-registry-agent.js +1 -0
- package/dist/core/task-registry-shared.d.ts +4 -0
- package/dist/core/tool-errors.d.ts +3 -3
- package/dist/core/tool-policy.js +2 -3
- package/dist/core/tool-spec.d.ts +20 -10
- package/dist/core/user-attachment.d.ts +5 -1
- package/dist/core/user-attachment.js +11 -5
- package/dist/core/write-protect.d.ts +16 -0
- package/dist/core/write-protect.js +10 -0
- package/dist/engine/harness/agent-harness.d.ts +19 -11
- package/dist/engine/harness/agent-harness.js +7 -4
- package/dist/engine/llm/types.d.ts +22 -10
- package/dist/engine/session/repo-utils.d.ts +14 -4
- package/dist/engine/session/repo-utils.js +5 -4
- package/dist/index.d.ts +10 -8
- package/dist/index.js +9 -7
- package/dist/prompts/default.d.ts +1 -2
- package/dist/scenarios/full-body.d.ts +1 -1
- package/dist/shell/lex.d.ts +50 -15
- package/dist/shell/lex.js +43 -9
- package/dist/stores/file/adoption/adopt.d.ts +1 -1
- package/dist/stores/file/index.d.ts +1 -15
- package/dist/stores/file/index.js +1 -15
- package/dist/stores/file/permission-rule-store.d.ts +12 -1
- package/dist/stores/file/permission-rule-store.js +31 -4
- package/dist/stores/file/session-store.js +1 -1
- package/dist/tools/fs/fs-bash.js +3 -3
- package/dist/tools/fs/removal-targets.d.ts +8 -2
- package/dist/tools/fs/removal-targets.js +31 -4
- package/dist/tools/fs/shell-read-argv.js +7 -1
- package/dist/tools/fs/shell-read-bindings.d.ts +21 -5
- package/dist/tools/fs/shell-read-bindings.js +130 -44
- package/dist/tools/fs/shell-read-plan.js +95 -29
- package/dist/tools/fs/shell-read-sourced.d.ts +25 -0
- package/dist/tools/fs/shell-read-sourced.js +119 -0
- package/dist/tools/fs/shell-read-word.d.ts +2 -2
- package/dist/tools/fs/shell-read-word.js +4 -5
- package/dist/tools/fs/shell-read-workdir.d.ts +19 -3
- package/dist/tools/fs/shell-read-workdir.js +60 -15
- package/dist/tools/fs/shell-reentry-text.d.ts +10 -2
- package/dist/tools/fs/shell-reentry-text.js +11 -4
- package/package.json +2 -2
- package/test/export-surface.snapshot.json +21 -79
- package/wire-changes/core-stores-sql@7.65.0.json +30 -0
- package/wire-changes/core-stores-sql@7.66.0.json +30 -0
- package/wire-changes/core@7.65.0.json +1650 -0
- package/wire-changes/core@7.66.0.json +1218 -0
- package/wire-changes/mods-kernel@7.65.0.json +30 -0
- package/wire-changes/mods-kernel@7.66.0.json +65 -0
- package/wire-changes/primitives@7.65.0.json +337 -0
- package/wire-changes/primitives@7.66.0.json +30 -0
- package/dist/core/memory-recall.d.ts +0 -208
- package/dist/core/memory-recall.js +0 -136
- package/dist/stores/file/memory-store.d.ts +0 -124
- package/dist/stores/file/memory-store.js +0 -353
|
@@ -118,8 +118,9 @@ export declare function mergeHarvestReports(a: HarvestReport, b: HarvestReport):
|
|
|
118
118
|
* otherwise, and carries `historyUnknown` when either store that resolved it could not judge its history;
|
|
119
119
|
* - `evidenceCapability` is `"journal"` only when both are; `custodyState` is the worse of the two
|
|
120
120
|
* (`damaged` ≻ `capability-absent` ≻ `complete`);
|
|
121
|
-
* - each carrier class adds `removed` / `remaining
|
|
122
|
-
* missing); `quarantineUnattributed` / `derivedEntries` add their
|
|
121
|
+
* - each carrier class adds `removed` / `remaining` (and `unreadable` when both stores answer it), and is
|
|
122
|
+
* `unverified` when either store's answer is (or is missing); `quarantineUnattributed` / `derivedEntries` add their
|
|
123
|
+
* counts the same way; `replay` is
|
|
123
124
|
* `"converges"` only when both are; `propagation` stays `"local-store-only"` (every store merged is local).
|
|
124
125
|
*/
|
|
125
126
|
export declare function mergeErasureAttestations(a: MemoryErasureAttestation, b: MemoryErasureAttestation): MemoryErasureAttestation;
|
|
@@ -161,7 +161,11 @@ export function mergeErasureAttestations(a, b) {
|
|
|
161
161
|
notFound.set(row.id, unknown ? { id: row.id, historyUnknown: true } : { id: row.id });
|
|
162
162
|
}
|
|
163
163
|
const answered = (x) => typeof x === "object" && x !== null && typeof x.removed === "number" && typeof x.remaining === "number";
|
|
164
|
-
const
|
|
164
|
+
const unreadable = (x, y) => {
|
|
165
|
+
const [p, q] = [Reflect.get(x, "unreadable"), Reflect.get(y, "unreadable")];
|
|
166
|
+
return typeof p === "number" && typeof q === "number" ? { unreadable: p + q } : {};
|
|
167
|
+
};
|
|
168
|
+
const carrier = (x, y) => (answered(x) && answered(y) ? { removed: x.removed + y.removed, remaining: x.remaining + y.remaining, ...unreadable(x, y) } : { unverified: true });
|
|
165
169
|
const counted = (x) => typeof x === "object" && x !== null && typeof x.count === "number";
|
|
166
170
|
const count = (x, y) => (counted(x) && counted(y) ? { count: x.count + y.count } : { unverified: true });
|
|
167
171
|
const custodyRank = { complete: 0, "capability-absent": 1, damaged: 2 };
|
|
@@ -280,9 +280,10 @@ export interface MemoryEngineOptions {
|
|
|
280
280
|
*/
|
|
281
281
|
provenance?: "off" | "carry";
|
|
282
282
|
/**
|
|
283
|
-
* design/383 §2.1b — the capture opt-out record's control-plane carrier. Absent = the
|
|
284
|
-
*
|
|
285
|
-
*
|
|
283
|
+
* design/383 §2.1b — the capture opt-out record's control-plane carrier. Absent = the `capture` objects
|
|
284
|
+
* of the governance store this engine keeps its documents in (#3484 — the File store over this
|
|
285
|
+
* engine's control dir: byte-identical names and bytes; the store the backend carries: one carrier
|
|
286
|
+
* for every replica). A deployment whose control plane is not durable across resume replicas
|
|
286
287
|
* (server cloud form) supplies its own store here; see {@link import("./layout.js").SessionCaptureRecordStore}
|
|
287
288
|
* for the fail-closed contract each leg must keep.
|
|
288
289
|
*/
|
|
@@ -873,6 +874,9 @@ export declare class MemoryEngine {
|
|
|
873
874
|
private readonly memoryDir;
|
|
874
875
|
private readonly controlDir;
|
|
875
876
|
private readonly governanceStore;
|
|
877
|
+
/** `true` ⇔ the governance store is the File store at {@link controlDir} itself: that plane's records are this store's
|
|
878
|
+
* own, and its v1 documents are converted in place by the layout adoption (#3484). */
|
|
879
|
+
private readonly ownsControlPlaneRecords;
|
|
876
880
|
private readonly now;
|
|
877
881
|
private readonly perScopeBudgetBytes;
|
|
878
882
|
private readonly perFileBytes;
|
|
@@ -1084,10 +1088,10 @@ export declare class MemoryEngine {
|
|
|
1084
1088
|
* ignore it exactly as before.
|
|
1085
1089
|
*/
|
|
1086
1090
|
markSessionPolluted(sessionId: string, reason: string, cause?: import("./types.js").MemoryOriginCause): Promise<SessionPollutionMarkOutcome>;
|
|
1087
|
-
/** The session's pollution record (in-process mark first, then the durable marker
|
|
1088
|
-
* clean. Reads are side-effect-free. */
|
|
1089
|
-
sessionPollution(sessionId: string): SessionPollutionRecord | undefined
|
|
1090
|
-
/** design/383 §2.1b — the record carrier (defaults to the
|
|
1091
|
+
/** The session's pollution record (in-process mark first, then the durable marker kept by the
|
|
1092
|
+
* governance store) — undefined = clean. Reads are side-effect-free. */
|
|
1093
|
+
sessionPollution(sessionId: string): Promise<SessionPollutionRecord | undefined>;
|
|
1094
|
+
/** design/383 §2.1b — the record carrier (defaults to the governance store's `capture` objects). */
|
|
1091
1095
|
private readonly captureRecords;
|
|
1092
1096
|
/** In-process half of the one-way record: a session opted out in THIS process reads opted-out here
|
|
1093
1097
|
* even before/independent of the durable read (the harvest legs and read closures consult this
|
|
@@ -1271,8 +1275,8 @@ export declare class MemoryEngine {
|
|
|
1271
1275
|
* (conflicts reported, replay converges), and the attestation carries
|
|
1272
1276
|
* `evidenceCapability: "none"` + `custodyState: "capability-absent"` throughout — a silent
|
|
1273
1277
|
* downgrade is the forbidden shape. The read faces show this lane no carrier beyond the deleted
|
|
1274
|
-
* entries, so every store carrier class
|
|
1275
|
-
* degraded lane never answers `complete`. Applied deletes close their lineage rows (the same
|
|
1278
|
+
* entries, so every store carrier class but `quarantineCopy` (its copies deleted by id, {@link eraseQuarantineCopies})
|
|
1279
|
+
* answers `unverified` (and `replay: "unsupported"`): the degraded lane never answers `complete`. Applied deletes close their lineage rows (the same
|
|
1276
1280
|
* space hygiene the organic tombstone path takes).
|
|
1277
1281
|
*
|
|
1278
1282
|
* Authorization: `input.expectedScopes` (the import's seat; contract on its JSDoc). A grant-bearing
|
|
@@ -1286,6 +1290,11 @@ export declare class MemoryEngine {
|
|
|
1286
1290
|
*/
|
|
1287
1291
|
eraseMemoryEntries(input: EraseMemoryEntriesInput): Promise<MemoryErasureAttestation>;
|
|
1288
1292
|
private eraseMemoryEntriesCore;
|
|
1293
|
+
/** #3463 — the `clearanceCustody` class of an evidence face's attestation. A face that counted it (the File face, over
|
|
1294
|
+
* the same governance store) stands; one that did not — the class absent, or `unverified` (a face that never kept the
|
|
1295
|
+
* clearances) — is answered here, over the governance store the engine keeps the clearances in, for every resolved id
|
|
1296
|
+
* a conflict did not keep standing; an account that cannot be read or updated answers the class unverified. */
|
|
1297
|
+
private answerClearanceCustody;
|
|
1289
1298
|
/**
|
|
1290
1299
|
* design/178 v2-b (rescan hardening) — the erase-time DERIVED-INDEX sweep, both lanes. MEMORY.md
|
|
1291
1300
|
* is the engine's model-visible distillation of entry frontmatter (name + description — routinely
|
|
@@ -1479,8 +1488,9 @@ export declare class MemoryEngine {
|
|
|
1479
1488
|
resolveSettlement(settleId: string, to: "clean" | "external", requestId: string): Promise<void>;
|
|
1480
1489
|
/** §4.2③ — the hold valve: `"release"` commits the held entry at the next harvest WITH a
|
|
1481
1490
|
* `"static"`-cause marker (a valve release is not a cleanliness proof); `"discard"` disposes it
|
|
1482
|
-
* to quarantine. Audited (requestId required).
|
|
1483
|
-
|
|
1491
|
+
* to quarantine. Audited (requestId required). Answers a Promise: the verdict is written to the hold ledger through
|
|
1492
|
+
* the governance store; a refused call (`memory.hold_resolve_*`) rejects it. */
|
|
1493
|
+
resolveHold(holdId: string, action: "release" | "discard", requestId: string): Promise<void>;
|
|
1484
1494
|
/** §3.6 — the session-account valve: close a dangling foreign row WITHOUT adjudication (the
|
|
1485
1495
|
* residue arm keeps firing until the next full-domain harvest closes normally — a valve close
|
|
1486
1496
|
* must not launder the window it covers). It also ends the session's leg (no live writer of its
|
|
@@ -1488,9 +1498,10 @@ export declare class MemoryEngine {
|
|
|
1488
1498
|
resolveSessionAccount(sessionId: string, requestId: string): Promise<void>;
|
|
1489
1499
|
/** Read face: every delegation settlement row with its folded effective status (host audit). */
|
|
1490
1500
|
readDelegationSettlements(): Promise<EffectiveSettlement[]>;
|
|
1491
|
-
/** Read face: every instruction-hold row (host audit; custody bytes are addressable
|
|
1492
|
-
* `captureName
|
|
1493
|
-
|
|
1501
|
+
/** Read face: every instruction-hold row (host audit; custody bytes are addressable as the governance store's
|
|
1502
|
+
* `hold` object `captureName`, and a disposed hold's as its `quarantine` object `disposition.quarantineName`). Answers
|
|
1503
|
+
* a Promise: the ledger is read through the governance store. */
|
|
1504
|
+
readInstructionHolds(): Promise<HoldRow[]>;
|
|
1494
1505
|
/** Read face: the dangling foreign session-account rows a given session would classify residue
|
|
1495
1506
|
* against (host audit for the §3.6 valve). */
|
|
1496
1507
|
readDanglingSessionAccounts(selfSessionId: string): Promise<Awaited<ReturnType<typeof foreignDanglingSessionAccounts>>>;
|
|
@@ -1822,8 +1833,10 @@ export declare class MemoryEngine {
|
|
|
1822
1833
|
provenance: EntryProvenanceAccount;
|
|
1823
1834
|
}>>;
|
|
1824
1835
|
/** §13-4② read half — the clearance audit trail (pending rows are crash-recovery seats: their
|
|
1825
|
-
* custody carries the cleared bytes; a later {@link clearEntryOrigin} call resumes them).
|
|
1826
|
-
|
|
1836
|
+
* custody carries the cleared bytes; a later {@link clearEntryOrigin} call resumes them). Read through the
|
|
1837
|
+
* governance store the engine keeps its documents in (#3484: a Promise — the store is awaited). A row whose custody
|
|
1838
|
+
* an erasure took answers `entryText: ""` and `custodyErased: true` (#3463). */
|
|
1839
|
+
listOriginClearances(): Promise<OriginClearanceRow[]>;
|
|
1827
1840
|
/**
|
|
1828
1841
|
* §13-4② — the audited UN-MARK valve. There is deliberately NO in-place strip spelling anywhere
|
|
1829
1842
|
* (the backend immutability law stands untouched); the clear rides the law's own single legal
|
|
@@ -1954,6 +1967,10 @@ export declare class MemoryEngine {
|
|
|
1954
1967
|
/** {@link refuseOutsideStore} as a value, for a site whose failure lane is a report row rather than a
|
|
1955
1968
|
* throw: the refusal's text, or `undefined` when the act may proceed. */
|
|
1956
1969
|
private storeActRefusedText;
|
|
1970
|
+
/** Contain the suspect file at `path` (its already-read `content`): keep its copy among the governance store's
|
|
1971
|
+
* `quarantine` objects, then — the anchor read again after that await, at the act — take it off the plane
|
|
1972
|
+
* ({@link clearContainedPath}). A refused act leaves the path untouched and says why in `detail`. */
|
|
1973
|
+
private containSuspect;
|
|
1957
1974
|
/** The memory dir against its anchor ({@link anchorStoreRoot}), read every time: at every mount and at the head
|
|
1958
1975
|
* of every face acting on the memory dir itself; answers the anchored root. With a `handle`, its mount root
|
|
1959
1976
|
* must be the anchored one too (a handle mounted before a re-anchor names a tree the store no longer has). */
|