@sema-agent/core 7.1.0 → 7.2.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 +36 -0
- package/dist/agents/cross-session-envelope.d.ts +138 -0
- package/dist/agents/cross-session-envelope.js +191 -0
- package/dist/agents/cross-session-judge.d.ts +119 -0
- package/dist/agents/cross-session-judge.js +184 -0
- package/dist/agents/cross-session-ref.d.ts +52 -0
- package/dist/agents/cross-session-ref.js +64 -0
- package/dist/agents/send-message-tool.d.ts +13 -0
- package/dist/agents/send-message-tool.js +36 -12
- package/dist/core/checkpoint-store.d.ts +189 -3
- package/dist/core/checkpoint-store.js +56 -16
- package/dist/core/hooks.d.ts +15 -8
- package/dist/core/hooks.js +6 -3
- package/dist/core/permission-rule-consent.d.ts +72 -23
- package/dist/core/permission-rule-consent.js +115 -26
- package/dist/core/permission-rule-model.d.ts +245 -51
- package/dist/core/permission-rule-model.js +312 -54
- package/dist/core/permission-rule-org.js +13 -6
- package/dist/core/remote-env.d.ts +8 -1
- package/dist/core/runner/assemble-result.js +2 -1
- package/dist/core/runner/prepare-task.d.ts +39 -1
- package/dist/core/runner/prepare-task.js +278 -113
- package/dist/core/runner/prepare-workspace-restore.d.ts +6 -1
- package/dist/core/runner/prepare-workspace-restore.js +2 -1
- package/dist/core/runner/runtask.js +13 -3
- package/dist/core/task-notification.d.ts +64 -5
- package/dist/core/task-notification.js +25 -4
- package/dist/core/tool-policy.d.ts +11 -0
- package/dist/core/types.d.ts +23 -0
- package/dist/core/untrusted-text.js +17 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.js +5 -2
- package/package.json +1 -1
- package/test/export-surface.snapshot.json +125 -1
|
@@ -140,6 +140,38 @@ export interface TaskNotificationPayload {
|
|
|
140
140
|
peer?: {
|
|
141
141
|
hopChain: string[];
|
|
142
142
|
};
|
|
143
|
+
/**
|
|
144
|
+
* design/385 §1.4 d1 — the delegated-child → parent UPLINK carrier (`SendMessage("main")`). Its
|
|
145
|
+
* PRESENCE is the render discriminator: the frame reaches the parent's model as a top-level
|
|
146
|
+
* `<agent-message from="…">` user frame (the same-process lane's carrier, distinct from both the
|
|
147
|
+
* `<task-notification>` shell and the cross-session envelope) followed by the peer discipline block.
|
|
148
|
+
* `body` is the child's message as bounded by the producer (no discipline block inside it — the
|
|
149
|
+
* block is frame-adjacent by rule). The classic members (`summary`/`result`) stay filled beside it
|
|
150
|
+
* for wire consumers that project the frame as a card; they are not what the model reads.
|
|
151
|
+
* Minted ONLY by the SendMessage uplink leg (engine-side); an external `notify()` cannot wear it.
|
|
152
|
+
*/
|
|
153
|
+
agentMessage?: {
|
|
154
|
+
from: string;
|
|
155
|
+
body: string;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* design/385 §1.4 d1 — the engine-minted PROVENANCE side record of an agent-message frame, a typed
|
|
159
|
+
* key (never model text) so a host can attribute and correlate the injection on the wire:
|
|
160
|
+
* `kind` names the lane, `from` is the sender label the frame's attribute spells, `taskId` the
|
|
161
|
+
* sender's run/agent id, `seq` the producer's per-frame counter (= this payload's `seq`),
|
|
162
|
+
* `agentType` the sender's resolved agent type when the producer knows it. Present exactly when
|
|
163
|
+
* {@link agentMessage} is.
|
|
164
|
+
*/
|
|
165
|
+
_sema_provenance?: SemaProvenance;
|
|
166
|
+
}
|
|
167
|
+
/** design/385 §1.4 d1 — see {@link TaskNotificationPayload._sema_provenance}. `kind` is a closed set
|
|
168
|
+
* with one member today; a future lane adds a member, never a second key. */
|
|
169
|
+
export interface SemaProvenance {
|
|
170
|
+
kind: "agent_message";
|
|
171
|
+
from: string;
|
|
172
|
+
taskId: string;
|
|
173
|
+
seq: number;
|
|
174
|
+
agentType?: string;
|
|
143
175
|
}
|
|
144
176
|
/**
|
|
145
177
|
* design/144 §2 — the caller-facing input of `TaskStream.notify()`: a STRUCTURED external event to inject
|
|
@@ -229,6 +261,23 @@ export declare function attrEscape(value: string): string;
|
|
|
229
261
|
/** Max rendered length of an untrusted attribution label (the external `from="…"` header and the
|
|
230
262
|
* design/171 speaker envelope share it — same concern: a display label, not a payload). */
|
|
231
263
|
export declare const EXTERNAL_SOURCE_MAX = 120;
|
|
264
|
+
/** design/385 §1.4 d1 — the same-process lane's carrier tag (CC `iTe`). */
|
|
265
|
+
export declare const AGENT_MESSAGE_TAG = "agent-message";
|
|
266
|
+
/**
|
|
267
|
+
* design/385 §1.4 d1 — render the child → parent uplink as CC's same-process form: a top-level
|
|
268
|
+
* `<agent-message from="…">` frame (CC `ZSe`: attribute-escaped sender, nested-tag-neutralized body,
|
|
269
|
+
* no header prose — the attribution IS the attribute) followed by the peer discipline block OUTSIDE
|
|
270
|
+
* the frame (design/176 §3.4 placement: a sender-embedded copy inside the body arrives neutralized,
|
|
271
|
+
* so position distinguishes the real block). The body first passes the harness AUTHORITY-family
|
|
272
|
+
* neutralization ({@link neutralizePeerBody}: every engine envelope a model reads as harness speech —
|
|
273
|
+
* `task-notification`, `user_memory`, `skills`, … — not the reminder tag alone), because the child's
|
|
274
|
+
* text is model output; the pre-carrier `<task-notification>` shell entity-escaped every byte of it,
|
|
275
|
+
* and the carrier form must contain at least as much.
|
|
276
|
+
*/
|
|
277
|
+
export declare function renderAgentMessageFrame(frame: {
|
|
278
|
+
from: string;
|
|
279
|
+
body: string;
|
|
280
|
+
}): string;
|
|
232
281
|
export declare function renderTaskNotificationXml(n: TaskNotificationPayload): string;
|
|
233
282
|
/**
|
|
234
283
|
* The BETWEEN-TURNS pending lane. A task notification born while NO turn is
|
|
@@ -341,11 +390,21 @@ export declare class PendingSessionNotifications {
|
|
|
341
390
|
get size(): number;
|
|
342
391
|
}
|
|
343
392
|
/**
|
|
344
|
-
* Delivery-side overflow disclosure: fold the per-task drop counts into the drained payloads.
|
|
345
|
-
*
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
393
|
+
* Delivery-side overflow disclosure: fold the per-task drop counts into the drained payloads. Two
|
|
394
|
+
* carrier shapes, chosen per survivor:
|
|
395
|
+
* · a CLASSIC survivor (renders through the `<task-notification>` shell) is annotated IN PLACE — the
|
|
396
|
+
* first surviving payload of a task that lost events gets a `[task_id]`-prefixed disclosure line
|
|
397
|
+
* prepended to its summary (backgroundTasks 同规: the id keeps the loss addressable via TaskOutput);
|
|
398
|
+
* · an AGENT-MESSAGE survivor (design/385 §1.4 d1; renders as the `<agent-message>` carrier, its
|
|
399
|
+
* `summary` wire-only) is left byte-unchanged, and the disclosure rides as a SEPARATE engine-authored
|
|
400
|
+
* `event` payload inserted immediately AHEAD of it (engine speech never goes inside a peer frame;
|
|
401
|
+
* peer speech never goes inside the authority shell that line renders through).
|
|
402
|
+
* The returned array is therefore NOT a 1:1 image of `drained.items`: it can be longer (one inserted
|
|
403
|
+
* line per disclosed agent-message lane, plus the per-lane "nothing survived" lines and the
|
|
404
|
+
* whole-session line below) — consume it by iteration, never by index-pairing against `items`. The
|
|
405
|
+
* zero-disclosure path returns `drained.items` itself (identity, no allocation). A task whose EVERY
|
|
406
|
+
* pending item was evicted still gets one honest synthetic `event` payload saying so — a fully silent
|
|
407
|
+
* loss is never allowed.
|
|
349
408
|
*/
|
|
350
409
|
export declare function discloseDroppedPending(drained: DrainedPendingNotifications): TaskNotificationPayload[];
|
|
351
410
|
export declare class SystemInjectionQueue<TPayload = TaskNotificationPayload> {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { inlineUntrusted, sanitizeUntrustedText } from "./untrusted-text.js";
|
|
1
|
+
import { escapeEnvelopeTag, inlineUntrusted, sanitizeUntrustedText } from "./untrusted-text.js";
|
|
2
|
+
import { PEER_MESSAGE_NOTICE } from "../agents/peer-admission.js";
|
|
3
|
+
import { neutralizePeerBody } from "../agents/cross-session-envelope.js";
|
|
2
4
|
export const SYSTEM_INJECTION_PRIORITIES = ["now", "next", "later"];
|
|
3
5
|
export function isSystemInjectionPriority(value) {
|
|
4
6
|
return typeof value === "string" && SYSTEM_INJECTION_PRIORITIES.includes(value);
|
|
@@ -46,7 +48,14 @@ export function attrEscape(value) {
|
|
|
46
48
|
return value.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
47
49
|
}
|
|
48
50
|
export const EXTERNAL_SOURCE_MAX = 120;
|
|
51
|
+
export const AGENT_MESSAGE_TAG = "agent-message";
|
|
52
|
+
export function renderAgentMessageFrame(frame) {
|
|
53
|
+
const body = escapeEnvelopeTag(AGENT_MESSAGE_TAG, neutralizePeerBody(frame.body));
|
|
54
|
+
return `<${AGENT_MESSAGE_TAG} from="${attrEscape(frame.from)}">\n${body}\n</${AGENT_MESSAGE_TAG}>\n\n${PEER_MESSAGE_NOTICE}`;
|
|
55
|
+
}
|
|
49
56
|
export function renderTaskNotificationXml(n) {
|
|
57
|
+
if (n.agentMessage !== undefined)
|
|
58
|
+
return renderAgentMessageFrame(n.agentMessage);
|
|
50
59
|
const usage = n.usage === undefined
|
|
51
60
|
? undefined
|
|
52
61
|
: (() => {
|
|
@@ -196,12 +205,24 @@ export function discloseDroppedPending(drained) {
|
|
|
196
205
|
if (drained.dropped.size === 0)
|
|
197
206
|
return [...drained.items, ...sessionLine];
|
|
198
207
|
const disclosed = new Set();
|
|
199
|
-
const out = drained.items.
|
|
208
|
+
const out = drained.items.flatMap((n) => {
|
|
200
209
|
const lane = taskNotificationLaneKey(n);
|
|
201
210
|
const dropped = drained.dropped.get(lane);
|
|
202
211
|
if (dropped === undefined || disclosed.has(lane))
|
|
203
|
-
return n;
|
|
212
|
+
return [n];
|
|
204
213
|
disclosed.add(lane);
|
|
214
|
+
if (n.agentMessage !== undefined) {
|
|
215
|
+
const line = {
|
|
216
|
+
task_id: n.task_id,
|
|
217
|
+
task_type: n.task_type,
|
|
218
|
+
status: "event",
|
|
219
|
+
summary: `[${n.task_id}] ${dropped.count} earlier pending notification(s) from this task were dropped (pending-queue overflow); its latest message follows.`,
|
|
220
|
+
};
|
|
221
|
+
const linePriority = drained.priorities?.get(n);
|
|
222
|
+
if (linePriority !== undefined)
|
|
223
|
+
drained.priorities?.set(line, linePriority);
|
|
224
|
+
return [line, n];
|
|
225
|
+
}
|
|
205
226
|
const annotated = {
|
|
206
227
|
...n,
|
|
207
228
|
summary: `[${n.task_id}] ${dropped.count} earlier pending notification(s) from this task were dropped (pending-queue overflow). ${n.summary}`,
|
|
@@ -209,7 +230,7 @@ export function discloseDroppedPending(drained) {
|
|
|
209
230
|
const priority = drained.priorities?.get(n);
|
|
210
231
|
if (priority !== undefined)
|
|
211
232
|
drained.priorities?.set(annotated, priority);
|
|
212
|
-
return annotated;
|
|
233
|
+
return [annotated];
|
|
213
234
|
});
|
|
214
235
|
for (const [lane, dropped] of drained.dropped) {
|
|
215
236
|
if (disclosed.has(lane))
|
|
@@ -1058,6 +1058,17 @@ export interface AskRequest {
|
|
|
1058
1058
|
* from it across a coverage change — harmlessly, since the record is what gets confirmed.
|
|
1059
1059
|
*/
|
|
1060
1060
|
readonly ruleOffers?: readonly import("./permission-rule-model.js").RuleOffer[];
|
|
1061
|
+
/**
|
|
1062
|
+
* design/382 §2.4 (adversarial-review r3, additive) — the RELATIVE-CD RESOLUTION BASE the offers
|
|
1063
|
+
* above were minted with: the live tracked working directory at adjudication time (the RB-108
|
|
1064
|
+
* value; equal to the task root until an observable `cd` moves the tracker). Present only beside
|
|
1065
|
+
* {@link ruleOffers} when the run has a tracked cwd. A consumer preparing the AUTHORITATIVE
|
|
1066
|
+
* consent record threads it as `prepareCardApproval`'s `execCwd`, so the record re-mints the SAME
|
|
1067
|
+
* directory member this projection displayed — without it, a moved tracker would make the record
|
|
1068
|
+
* resolve `cd ./x` from the task root and persist a rule for a directory the command never
|
|
1069
|
+
* enters. Display/reconstruction context only, never adjudication input.
|
|
1070
|
+
*/
|
|
1071
|
+
readonly execCwd?: string;
|
|
1061
1072
|
/**
|
|
1062
1073
|
* #490 修② — WHY {@link ruleOffers} is absent, when the rule-offer lane is in play and has nothing
|
|
1063
1074
|
* to give. A CLOSED set, mutually exclusive with {@link ruleOffers} (never both, never neither once
|
package/dist/core/types.d.ts
CHANGED
|
@@ -3539,6 +3539,16 @@ export interface TaskResult {
|
|
|
3539
3539
|
* gate): a halt landing AFTER the abort signal already fired neither cut nor stopped anything —
|
|
3540
3540
|
* that ending belongs to the abort, and this seat stays ABSENT rather than signing someone
|
|
3541
3541
|
* else's stop with the halt caller's name. Absent everywhere else; never `false`.
|
|
3542
|
+
*
|
|
3543
|
+
* design/384 slice 2 (TRANSITIONAL narrowing): a `"suspended"` / `"needs_review"` terminal does
|
|
3544
|
+
* NOT carry this seat even when a halt was accepted — those statuses mean a durable park WON its
|
|
3545
|
+
* race with the halt (the row is committed and redeemable; the run is waiting to continue), and
|
|
3546
|
+
* "stopped by the person" beside "waiting to resume" was a self-contradictory pair. The halt's
|
|
3547
|
+
* own receipt (`{turnCut}`) and the `task.turn_interrupted` notice still stand — a seat WAS cut.
|
|
3548
|
+
* Transitional: once halt-boundary source accounting lands (slice 3), the boundary-CONSUMED
|
|
3549
|
+
* suspension arms flip to signing (a probe pinning today's suppressed shape goes red then, by
|
|
3550
|
+
* design). The pass-through law is untouched for every OTHER terminal: a halt racing a real
|
|
3551
|
+
* failure/limit — including one that outranks a committed park — still signs.
|
|
3542
3552
|
*/
|
|
3543
3553
|
haltedByUser?: true;
|
|
3544
3554
|
/**
|
|
@@ -5138,6 +5148,15 @@ export interface TaskStream extends AsyncIterable<TaskEvent> {
|
|
|
5138
5148
|
* steer-family `steering.not_running` once the task has finished (teardown included); a halt
|
|
5139
5149
|
* issued BEFORE the run's first prompt polls the same bounded birth window as {@link steer} and
|
|
5140
5150
|
* then stops the run before its first model turn (an empty, cleanly-halted completed run).
|
|
5151
|
+
*
|
|
5152
|
+
* **Receipt tension, stated (design/384 slice 2):** `{turnCut:true}` and the
|
|
5153
|
+
* `task.turn_interrupted` notice assert facts about the CUT — a seat was cut, no new model turn
|
|
5154
|
+
* starts — and both stay true even when the gate's durable leg still collects to `suspended`:
|
|
5155
|
+
* a park whose store commit was already in flight (or committed) when the cut landed WINS the
|
|
5156
|
+
* fence race, the row is redeemable, and the result then reads `status:"suspended"` WITHOUT
|
|
5157
|
+
* {@link TaskResult.haltedByUser} (the transitional narrowing documented on that seat). A cut
|
|
5158
|
+
* observed BEFORE the commit makes the park concede instead — no row, no card, and the ordinary
|
|
5159
|
+
* halted ending.
|
|
5141
5160
|
*/
|
|
5142
5161
|
halt(): Promise<{
|
|
5143
5162
|
turnCut: boolean;
|
|
@@ -5791,6 +5810,10 @@ export interface EngineNotice {
|
|
|
5791
5810
|
* `detail: { cause: "user_halt", sessionId, runId, taskId? }` — no `inputId` and no
|
|
5792
5811
|
* `actorId`, because no text entered the model and the verb carries no caller identity. A
|
|
5793
5812
|
* consumer keying `detail.inputId` off this row must treat it as ABSENT on this lane.
|
|
5813
|
+
* Fence tension (design/384 slice 2): this notice asserts THE CUT only — when the cut
|
|
5814
|
+
* raced a durable park whose commit was already in flight, the gate's durable leg may
|
|
5815
|
+
* still collect to `suspended` (park wins, row redeemable, no `haltedByUser`); the notice
|
|
5816
|
+
* stands beside that terminal without contradiction, because a seat really was cut.
|
|
5794
5817
|
* In both lanes: one notice per REAL cut (a `now` that found nothing in flight or whose frame
|
|
5795
5818
|
* already rode the imminent boundary, and a halt with nothing in flight, announce nothing — no
|
|
5796
5819
|
* false interrupt claims); `runId` (#499) is the INVOCATION that was cut (the other two ids are
|
|
@@ -196,7 +196,23 @@ export const ENGINE_ENVELOPES = Object.freeze([
|
|
|
196
196
|
tag: "teammate-message",
|
|
197
197
|
kind: "framing",
|
|
198
198
|
mint: "agents/send-message-tool.ts (INTERPOLATED tag — invisible to the literal census)",
|
|
199
|
-
guard: "escapeEnvelopeTag(TEAMMATE_MESSAGE_TAG, …)
|
|
199
|
+
guard: "body through neutralizePeerBody (the authority family, ENGINE_AUTHORITY_ENVELOPE_TAGS) + escapeEnvelopeTag(TEAMMATE_MESSAGE_TAG, …); summary/teammate_id through escapeAttributeValue",
|
|
200
|
+
fenced: false,
|
|
201
|
+
disclosed: false,
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
tag: "agent-message",
|
|
205
|
+
kind: "framing",
|
|
206
|
+
mint: "core/task-notification.ts renderAgentMessageFrame (INTERPOLATED tag — invisible to the literal census; the child → parent uplink carrier)",
|
|
207
|
+
guard: "body through neutralizePeerBody (the authority family, ENGINE_AUTHORITY_ENVELOPE_TAGS — the one helper the three peer carriers share) + escapeEnvelopeTag(AGENT_MESSAGE_TAG, …); the from attribute through attrEscape",
|
|
208
|
+
fenced: false,
|
|
209
|
+
disclosed: false,
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
tag: "cross-session-message",
|
|
213
|
+
kind: "framing",
|
|
214
|
+
mint: "agents/cross-session-envelope.ts buildCrossSessionEnvelope / encodeCcPeerFrame (INTERPOLATED tag — invisible to the literal census)",
|
|
215
|
+
guard: "model-face body through neutralizePeerBody (the authority family, ENGINE_AUTHORITY_ENVELOPE_TAGS) + escapeEnvelopeTag(CROSS_SESSION_MESSAGE_TAG, …); every attribute value typed + under its own regex grammar at build, and the parser rebuilds-and-compares (round trip) before accepting any field. The CC wire codec carries bytes as-is (containment is applied at injection when the model face is re-minted)",
|
|
200
216
|
fenced: false,
|
|
201
217
|
disclosed: false,
|
|
202
218
|
},
|
package/dist/index.d.ts
CHANGED
|
@@ -95,7 +95,7 @@ export { READ_FACE_DEFAULT_DENY_ENTRIES, READ_FACE_BUILTIN_DENY_TABLE, READ_DENY
|
|
|
95
95
|
export { deploymentReadFaceClampNotice, resolveReadFace, type ReadFace, type ReadFaceInputs } from "./tools/fs/index.js";
|
|
96
96
|
export { WRITE_PROTECTED_DEFAULT_TABLE, resolveWriteProtectedTable, compileWriteProtection, type WriteProtectedEntry, type WriteProtectedRow, type WriteProtectedKind, type WriteProtectedHit, type WriteProtectionMatcher, } from "./core/write-protect.js";
|
|
97
97
|
export { InMemoryToolResultStore, OFFLOAD_TOOL_NAME, DEFAULT_TOOL_RESULT_THRESHOLD_CHARS, assertSafeToolResultRef, buildToolResultRef, toolResultContentSegment, MAX_MINTED_TOOL_RESULT_REF_CHARS, type ToolResultProvenance, assertToolResultProvenanceMatch, normalizeToolResultProvenance, toolResultProvenanceOf, ToolResultRefConflictError, TOOL_RESULT_REF_CONFLICT_CODE, type ToolResultStore, type ToolResultSlice, type ToolResultDeletionReport, } from "./core/tool-result-store.js";
|
|
98
|
-
export { InMemoryCheckpointStore, CheckpointError, mintCheckpointId, mintCheckpointToken, checkpointVersionOf, CURRENT_CHECKPOINT_VERSION, MAX_SUPPORTED_CHECKPOINT_VERSION, ORG_ADMISSION_CHECKPOINT_VERSION, F012_CHECKPOINT_VERSION, REAL_APPROVAL_CHECKPOINT_VERSION, RESOURCE_CHECKPOINT_VERSION, TOKEN_CHECKPOINT_VERSION, debitLedger, remainingBudgetMicroUsd, remainingTokens, winnerFromOutcome, validatePendingSteer, readPendingSteerQueue, appendPendingSteer, MAX_PENDING_STEER_CHARS, MAX_PENDING_STEER_ENTRIES, PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES, PENDING_STEER_FROZEN_FIELDS, ACTOR_ASSERTION_FROZEN_FIELDS, MAX_ACTOR_FIELD_CHARS, MAX_STEER_INPUT_ID_CHARS, LEGACY_PENDING_STEER_INPUT_ID, type ActorAssertion, type PendingSteerEntry, type PendingSteerInput, riskSeverity, buildRiskDescriptor, summarizeCheckpoint, type RiskDescriptor, type ProbeCause, type ProbeCauseOperands, type CheckpointStore, type CheckpointSummary, type Checkpoint, type CheckpointToken, type CheckpointGate, type CheckpointState, type SerializedCheckpointState, type CheckpointFaultMode, type PendingAction, type ResumeOutcome, type ResolvedOutcome, type ReopenReason, type ResolveExpectation, type SafetyAxis, type RealApprovalGateBit, type ResourceLedger, type ResourceLimitReason, type PlatformLimitReason, } from "./core/checkpoint-store.js";
|
|
98
|
+
export { InMemoryCheckpointStore, CheckpointError, mintCheckpointId, mintCheckpointToken, checkpointVersionOf, CURRENT_CHECKPOINT_VERSION, MAX_SUPPORTED_CHECKPOINT_VERSION, ORG_ADMISSION_CHECKPOINT_VERSION, F012_CHECKPOINT_VERSION, REAL_APPROVAL_CHECKPOINT_VERSION, RESOURCE_CHECKPOINT_VERSION, TOKEN_CHECKPOINT_VERSION, debitLedger, remainingBudgetMicroUsd, remainingTokens, winnerFromOutcome, validatePendingSteer, readPendingSteerQueue, appendPendingSteer, MAX_PENDING_STEER_CHARS, MAX_PENDING_STEER_ENTRIES, PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES, PENDING_STEER_FROZEN_FIELDS, ACTOR_ASSERTION_FROZEN_FIELDS, MAX_ACTOR_FIELD_CHARS, MAX_STEER_INPUT_ID_CHARS, LEGACY_PENDING_STEER_INPUT_ID, type ActorAssertion, type PendingSteerEntry, type PendingSteerInput, riskSeverity, buildRiskDescriptor, summarizeCheckpoint, type RiskDescriptor, type ProbeCause, type ProbeCauseOperands, type CheckpointStore, type CheckpointSummary, type Checkpoint, type CheckpointToken, type CheckpointGate, type CheckpointState, type SerializedCheckpointState, type CheckpointFaultMode, type PendingAction, type ResumeOutcome, type ResolvedOutcome, type ReopenReason, type ResolveExpectation, type TerminalClaimIntent, type TerminalClaimOutcome, type SafetyAxis, type RealApprovalGateBit, type ResourceLedger, type ResourceLimitReason, type PlatformLimitReason, } from "./core/checkpoint-store.js";
|
|
99
99
|
export { InMemoryUsageWindowStore, GLOBAL_USAGE_KEY, EMPTY_USAGE_WINDOW_RECORD, chargeUsageRecord, readUsageRecord, usageRetryAfterMs, resolveUsageWindows, type UsageWindow, type UsageWindowStore, type UsageWindowReading, type UsageWindowRecord, type UsageSlot, type UsageBucketRow, } from "./core/usage-window-store.js";
|
|
100
100
|
export { FileUsageWindowStore } from "./stores/file/usage-window-store.js";
|
|
101
101
|
export { ENV_LIFETIME_SUSPEND_MARGIN_MS, USAGE_WINDOW_REAP_MARGIN_MS } from "./core/runner/prepare-task.js";
|
|
@@ -118,7 +118,7 @@ export { createSensitivePathPolicy, RECOMMENDED_SENSITIVE_PATTERNS } from "./cor
|
|
|
118
118
|
export { createFsWriteGatePolicy, type FsWriteGatePolicyOptions } from "./core/fs-write-gate-policy.js";
|
|
119
119
|
export { RETIRED_TOOL_NAMES } from "./core/tool-name-aliases.js";
|
|
120
120
|
export { DEFAULT_SUBAGENT_TOOL_NAME } from "./agents/subagent.js";
|
|
121
|
-
export { renderTaskNotificationXml, taskNotificationDedupKey, isDelegatedAgentTerminal, isTerminalTaskNotification, SystemInjectionQueue, type TaskNotificationPayload, type TaskNotificationStatus, type ExternalNotificationInput, type SystemInjection, type SystemInjectionPriority, SYSTEM_INJECTION_PRIORITIES, isSystemInjectionPriority, } from "./core/task-notification.js";
|
|
121
|
+
export { renderTaskNotificationXml, taskNotificationDedupKey, isDelegatedAgentTerminal, isTerminalTaskNotification, SystemInjectionQueue, type TaskNotificationPayload, type TaskNotificationStatus, type ExternalNotificationInput, type SystemInjection, type SystemInjectionPriority, SYSTEM_INJECTION_PRIORITIES, isSystemInjectionPriority, AGENT_MESSAGE_TAG, renderAgentMessageFrame, type SemaProvenance, } from "./core/task-notification.js";
|
|
122
122
|
export { describeStaticWiring, deriveWiringManifest, deriveAskEffective, resolveDeclaredDurability, resolveSubagentTranscriptTier, type SubagentTranscriptTier, resolveAskSeamForm, resolveQuestionSeam, countElicitOptIns, type WiringManifest, type WiringFacts, type WiringLegKind, type AskSeamForm, type AskEffective, type QuestionChannelState, type SeamProvenance, type ParkLaneReason, type ManifestDurability, type StaticWiringDeps, type StaticWiringSpec, } from "./core/wiring-manifest.js";
|
|
123
123
|
export { probeParkRoundTrip, durableParkGapOf, durableParkGapFor, PARK_SELFCHECK_SCOPE_PREFIX, type ParkSelfCheckResult, type ParkProbeFinding, type ParkProbeFindingCode, } from "./core/park-selfcheck.js";
|
|
124
124
|
export { type StoreDurability } from "./core/checkpoint-store.js";
|
|
@@ -166,7 +166,7 @@ export { createPermissionRulePolicy, validatePermissionRules, parsePermissionRul
|
|
|
166
166
|
* and nothing more. Removal is exported without ceremony, because narrowing on a user's behalf is
|
|
167
167
|
* allowed and widening is not.
|
|
168
168
|
*/
|
|
169
|
-
export { parseAllowRuleText, formatAllowRuleText, ruleAdmitsCommand, findAdmittingRule, suggestRulesForCommand, scopeCoversCwd, pathWithinRoot, isRuleLive, renderUntrustedCommandText, BARE_INTERPRETER_NAMES, MAX_RULE_TEXT_CHARS, type PersistedAllowRule, type RuleTombstone, type RuleScope, type RuleDot, type RuleAdd, type RuleAddOrigin, type RuleOffer, type SegmentRuleSuggestion, type SegmentCoverage, type RuleReject, type RuleRejectCode, type ParsedAllowRule, type PersistedRuleTool, type PersistedRuleMatch, } from "./core/permission-rule-model.js";
|
|
169
|
+
export { parseAllowRuleText, formatAllowRuleText, ruleAdmitsCommand, findAdmittingRule, suggestRulesForCommand, scopeCoversCwd, pathWithinRoot, isRuleLive, renderUntrustedCommandText, UNCOVERED_SEGMENT_REASON_BASELINE, RULE_OFFERS_ABSENCE_BASELINE, type UncoveredSegmentDetail, type EditedRuleBreadthWarning, directoryRuleAdmits, BARE_INTERPRETER_NAMES, MAX_RULE_TEXT_CHARS, type PersistedAllowRule, type RuleTombstone, type RuleScope, type RuleDot, type RuleAdd, type RuleAddOrigin, type RuleOffer, type RuleOfferBatchMember, type SegmentRuleSuggestion, type SegmentCoverage, type RuleReject, type RuleRejectCode, type ParsedAllowRule, type PersistedRuleTool, type PersistedRuleMatch, } from "./core/permission-rule-model.js";
|
|
170
170
|
export { removePersistedRule, applyTombstones, sameScope, isValidConsentScope, isValidDurableScope, InMemoryPermissionRuleStore, EMPTY_RULE_STORE, type PermissionRuleStore, type PermissionRuleStoreProvider, type StoredAllowRules, type RemoveResult, type PutResult, joinRuleStates, screenRuleSyncState, collectBelowFrontier, ruleSyncVector, joinFrontiers, dotAtOrBelowFrontier, sameRuleOwner, type RuleSyncState, type RuleSyncFrontier, type RuleSyncDrop, type RuleSyncLandingReport, type RuleOwner, type QuarantinedRuleAdd, PERMISSION_RULE_WRITER, writerOf, foldDelta, addDotsOf, assertDeleteDeltaCarriesNoAdd, assertRedemptionNotQuarantined, assertWriteDeltaScopeDurable, type PermissionRuleWriter, type WritablePermissionRuleStore, type RuleWriteDelta, type RuleAddDelta, type RuleDeleteDelta, type RuleSyncJoinDelta, type RawRuleSyncState, type RedemptionAuthorization, } from "./core/permission-rule-store.js";
|
|
171
171
|
export { syncPermissionRules, parseRuleSyncResponse, PERMISSION_RULE_SYNC_PATH, LOCAL_OWNER_UNSYNCABLE_CODE, type PermissionRuleSyncTransport, type PermissionRuleSyncResult, type RuleSyncRequestBody, type RuleSyncResponseBody, } from "./core/permission-rule-sync.js";
|
|
172
172
|
export { InMemorySessionRuleOverlay, type SessionRuleOverlay, type SessionRuleOverlayAdd, type SessionRuleOverlayApplyResult, } from "./core/permission-rule-session.js";
|
|
@@ -252,6 +252,9 @@ export { createSubagentTool, FORK_SUBAGENT_TYPE, GENERAL_PURPOSE_SUBAGENT_TYPE,
|
|
|
252
252
|
export { getSessionRetainLedger, releaseSessionRetainLedger, } from "./agents/retain-ledger.js";
|
|
253
253
|
export { createSendMessageTool, createAgentContinuationVerb, SEND_MESSAGE_TOOL_NAME, type SendMessageToolOptions, type AgentContinuationReceipt } from "./agents/send-message-tool.js";
|
|
254
254
|
export { createPeerAdmission, peerAdmissionFor, judgePeerAdmission, resolvePeerAdmissionConfig, PEER_ADMISSION_DEFAULTS, PEER_HOP_CHAIN_WINDOW, PEER_MESSAGE_NOTICE, createPeerSelfRef, createPeerInboundChainRef, peerAxisToken, appendHopToken, type PeerAdmission, type PeerAdmissionConfig, type PeerAdmissionOptions, type PeerAdmissionRequest, type PeerAdmissionVerdict, type PeerAdmissionRefusal, type PeerRefusalCode, type PeerAxisTag, type PeerIdentity, type PeerSelfRef, type PeerInboundChainRef, } from "./agents/peer-admission.js";
|
|
255
|
+
export { CROSS_SESSION_MESSAGE_TAG, CROSS_SESSION_MESSAGE_NOTICE, PERMISSION_MODE_CLASSES, isPermissionModeClass, CrossSessionCodecError, PEER_HOP_TOKEN_HEX, PEER_HOP_CHAIN_CARRY_WINDOW, encodePeerAddress, isCanonicalPeerAddress, encodeScopeAttribute, decodeScopeAttribute, canonicalPeerDisplayName, buildCrossSessionEnvelope, parseCrossSessionEnvelope, clampHopChain, encodeCcPeerFrame, decodeCcPeerFrame, type PermissionModeClass, type CrossSessionEnvelopeFields, type CrossSessionEnvelopeParse, type CrossSessionEnvelopeRefusal, type CcPeerFrameFields, type CcPeerFrameParse, } from "./agents/cross-session-envelope.js";
|
|
256
|
+
export { CROSS_SESSION_INBOUND_SETTINGS, isCrossSessionInboundSetting, resolveCrossSessionInboundSetting, CROSS_SESSION_HOLD_CAUSES, describeCrossSessionHoldCause, judgeCrossSessionInbound, foldPermissionModeClass, PEER_SEND_VERDICT_CODES, peerSendVerdictSeverity, type CrossSessionInboundSetting, type CrossSessionSettingSource, type CrossSessionInboundSettingLayers, type ResolvedCrossSessionInboundSetting, type CrossSessionHoldCause, type CrossSessionInboundVerdict, type CrossSessionInboundInput, type PeerSendVerdictCode, type PeerSendVerdict, } from "./agents/cross-session-judge.js";
|
|
257
|
+
export { PEER_REF_MIN, PEER_REF_MAX, PEER_REF_RE, mintPeerRef, formatPeerNameRef, parsePeerNameRef, normalizePeerName, PEER_ADDRESS_PREFIXES, reservedPeerNameReason, type PeerRefEntry, } from "./agents/cross-session-ref.js";
|
|
255
258
|
export { createAgentTranscriptTool, AGENT_TRANSCRIPT_TOOL_NAME, type AgentTranscriptToolOptions, } from "./agents/agent-transcript-tool.js";
|
|
256
259
|
export { defineAgent } from "./agents/agent-definition.js";
|
|
257
260
|
export { builtinAgentDefinitions, BUILTIN_READONLY_DENY_TOOLS, EXPLORE_WHEN_TO_USE, EXPLORE_WHEN_TO_USE_LEAN, PLAN_WHEN_TO_USE, EXPLORE_SYSTEM_PROMPT, PLAN_SYSTEM_PROMPT, } from "./agents/builtin-agents.js";
|
package/dist/index.js
CHANGED
|
@@ -95,7 +95,7 @@ export { createSensitivePathPolicy, RECOMMENDED_SENSITIVE_PATTERNS } from "./cor
|
|
|
95
95
|
export { createFsWriteGatePolicy } from "./core/fs-write-gate-policy.js";
|
|
96
96
|
export { RETIRED_TOOL_NAMES } from "./core/tool-name-aliases.js";
|
|
97
97
|
export { DEFAULT_SUBAGENT_TOOL_NAME } from "./agents/subagent.js";
|
|
98
|
-
export { renderTaskNotificationXml, taskNotificationDedupKey, isDelegatedAgentTerminal, isTerminalTaskNotification, SystemInjectionQueue, SYSTEM_INJECTION_PRIORITIES, isSystemInjectionPriority, } from "./core/task-notification.js";
|
|
98
|
+
export { renderTaskNotificationXml, taskNotificationDedupKey, isDelegatedAgentTerminal, isTerminalTaskNotification, SystemInjectionQueue, SYSTEM_INJECTION_PRIORITIES, isSystemInjectionPriority, AGENT_MESSAGE_TAG, renderAgentMessageFrame, } from "./core/task-notification.js";
|
|
99
99
|
export { describeStaticWiring, deriveWiringManifest, deriveAskEffective, resolveDeclaredDurability, resolveSubagentTranscriptTier, resolveAskSeamForm, resolveQuestionSeam, countElicitOptIns, } from "./core/wiring-manifest.js";
|
|
100
100
|
export { probeParkRoundTrip, durableParkGapOf, durableParkGapFor, PARK_SELFCHECK_SCOPE_PREFIX, } from "./core/park-selfcheck.js";
|
|
101
101
|
export {} from "./core/checkpoint-store.js";
|
|
@@ -126,7 +126,7 @@ export { AUTO_MODE_BASE_PROMPT, AUTO_MODE_PERMISSIONS_EXTERNAL } from "./core/au
|
|
|
126
126
|
export { AUTO_MODE_ARMING_RECIPE_VERSION, autoModeArmingRecipeOf, sanitizeAutoModeArmingRecipe, foldAutoModeArming, } from "./core/auto-mode-arming.js";
|
|
127
127
|
export { rebuildAutoModeDecider, } from "./core/auto-mode-rebuild.js";
|
|
128
128
|
export { createPermissionRulePolicy, validatePermissionRules, parsePermissionRule, wildcardMatch, isNamespacedCoveringRuleName, namespacedRuleNameCovers, } from "./core/permission-rules.js";
|
|
129
|
-
export { parseAllowRuleText, formatAllowRuleText, ruleAdmitsCommand, findAdmittingRule, suggestRulesForCommand, scopeCoversCwd, pathWithinRoot, isRuleLive, renderUntrustedCommandText, BARE_INTERPRETER_NAMES, MAX_RULE_TEXT_CHARS, } from "./core/permission-rule-model.js";
|
|
129
|
+
export { parseAllowRuleText, formatAllowRuleText, ruleAdmitsCommand, findAdmittingRule, suggestRulesForCommand, scopeCoversCwd, pathWithinRoot, isRuleLive, renderUntrustedCommandText, UNCOVERED_SEGMENT_REASON_BASELINE, RULE_OFFERS_ABSENCE_BASELINE, directoryRuleAdmits, BARE_INTERPRETER_NAMES, MAX_RULE_TEXT_CHARS, } from "./core/permission-rule-model.js";
|
|
130
130
|
export { removePersistedRule, applyTombstones, sameScope, isValidConsentScope, isValidDurableScope, InMemoryPermissionRuleStore, EMPTY_RULE_STORE, joinRuleStates, screenRuleSyncState, collectBelowFrontier, ruleSyncVector, joinFrontiers, dotAtOrBelowFrontier, sameRuleOwner, PERMISSION_RULE_WRITER, writerOf, foldDelta, addDotsOf, assertDeleteDeltaCarriesNoAdd, assertRedemptionNotQuarantined, assertWriteDeltaScopeDurable, } from "./core/permission-rule-store.js";
|
|
131
131
|
export { syncPermissionRules, parseRuleSyncResponse, PERMISSION_RULE_SYNC_PATH, LOCAL_OWNER_UNSYNCABLE_CODE, } from "./core/permission-rule-sync.js";
|
|
132
132
|
export { InMemorySessionRuleOverlay, } from "./core/permission-rule-session.js";
|
|
@@ -209,6 +209,9 @@ export { createSubagentTool, FORK_SUBAGENT_TYPE, GENERAL_PURPOSE_SUBAGENT_TYPE,
|
|
|
209
209
|
export { getSessionRetainLedger, releaseSessionRetainLedger, } from "./agents/retain-ledger.js";
|
|
210
210
|
export { createSendMessageTool, createAgentContinuationVerb, SEND_MESSAGE_TOOL_NAME } from "./agents/send-message-tool.js";
|
|
211
211
|
export { createPeerAdmission, peerAdmissionFor, judgePeerAdmission, resolvePeerAdmissionConfig, PEER_ADMISSION_DEFAULTS, PEER_HOP_CHAIN_WINDOW, PEER_MESSAGE_NOTICE, createPeerSelfRef, createPeerInboundChainRef, peerAxisToken, appendHopToken, } from "./agents/peer-admission.js";
|
|
212
|
+
export { CROSS_SESSION_MESSAGE_TAG, CROSS_SESSION_MESSAGE_NOTICE, PERMISSION_MODE_CLASSES, isPermissionModeClass, CrossSessionCodecError, PEER_HOP_TOKEN_HEX, PEER_HOP_CHAIN_CARRY_WINDOW, encodePeerAddress, isCanonicalPeerAddress, encodeScopeAttribute, decodeScopeAttribute, canonicalPeerDisplayName, buildCrossSessionEnvelope, parseCrossSessionEnvelope, clampHopChain, encodeCcPeerFrame, decodeCcPeerFrame, } from "./agents/cross-session-envelope.js";
|
|
213
|
+
export { CROSS_SESSION_INBOUND_SETTINGS, isCrossSessionInboundSetting, resolveCrossSessionInboundSetting, CROSS_SESSION_HOLD_CAUSES, describeCrossSessionHoldCause, judgeCrossSessionInbound, foldPermissionModeClass, PEER_SEND_VERDICT_CODES, peerSendVerdictSeverity, } from "./agents/cross-session-judge.js";
|
|
214
|
+
export { PEER_REF_MIN, PEER_REF_MAX, PEER_REF_RE, mintPeerRef, formatPeerNameRef, parsePeerNameRef, normalizePeerName, PEER_ADDRESS_PREFIXES, reservedPeerNameReason, } from "./agents/cross-session-ref.js";
|
|
212
215
|
export { createAgentTranscriptTool, AGENT_TRANSCRIPT_TOOL_NAME, } from "./agents/agent-transcript-tool.js";
|
|
213
216
|
export { defineAgent } from "./agents/agent-definition.js";
|
|
214
217
|
export { builtinAgentDefinitions, BUILTIN_READONLY_DENY_TOOLS, EXPLORE_WHEN_TO_USE, EXPLORE_WHEN_TO_USE_LEAN, PLAN_WHEN_TO_USE, EXPLORE_SYSTEM_PROMPT, PLAN_SYSTEM_PROMPT, } from "./agents/builtin-agents.js";
|