@sema-agent/core 7.0.0 → 7.0.2
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 +32 -0
- package/dist/agents/launch-receipt-contract.d.ts +34 -0
- package/dist/agents/launch-receipt-contract.js +5 -0
- package/dist/agents/subagent.d.ts +134 -2
- package/dist/agents/subagent.js +160 -35
- package/dist/core/file-history-store.js +24 -2
- package/dist/core/memory-engine/engine.d.ts +62 -5
- package/dist/core/memory-engine/engine.js +90 -19
- package/dist/core/memory-engine/index.d.ts +1 -1
- package/dist/core/memory-engine/layout.d.ts +11 -3
- package/dist/core/roles.d.ts +6 -1
- package/dist/core/roles.js +10 -1
- package/dist/core/runner/prepare-memory.js +29 -22
- package/dist/core/runner/prepare-task.d.ts +3 -2
- package/dist/core/runner/prepare-task.js +13 -8
- package/dist/core/runner/runtask.js +2 -0
- package/dist/core/task-notification.d.ts +20 -0
- package/dist/core/types.d.ts +84 -3
- package/dist/core/wiring-manifest.d.ts +18 -1
- package/dist/index.d.ts +1 -1
- package/dist/orchestration/run-workflow-tool.d.ts +9 -1
- package/dist/orchestration/run-workflow-tool.js +13 -8
- package/dist/orchestration/workflow.d.ts +9 -1
- package/dist/orchestration/workflow.js +22 -14
- package/package.json +1 -1
- package/test/export-surface.snapshot.json +3 -1
package/dist/core/types.d.ts
CHANGED
|
@@ -934,8 +934,14 @@ export interface ToolExecuteContext {
|
|
|
934
934
|
* opted-out session captures nothing, whatever its chosen AgentDefinition says — the opt-out is
|
|
935
935
|
* a floor no selection loosens (the `memoryPersistenceCapable:false` floor's exact law, on the
|
|
936
936
|
* privacy axis). Trusted Runner-filled seat, never a model/tool argument.
|
|
937
|
+
*
|
|
938
|
+
* DUAL FORM (#511 件2): on a deployment whose capture record store is synchronous (the default
|
|
939
|
+
* file trio) this is a plain boolean, byte-identical to before; a Promise-form
|
|
940
|
+
* {@link RunnerDeps.memoryCaptureRecordStore} makes the live read answer a `Promise<boolean>`.
|
|
941
|
+
* Consumers must `await` (identity on the boolean arm) — a bare `=== true` on the Promise arm
|
|
942
|
+
* would coin `false`, the exact un-floored escape this seat closes.
|
|
937
943
|
*/
|
|
938
|
-
memoryCaptureOptedOut?: boolean
|
|
944
|
+
memoryCaptureOptedOut?: boolean | Promise<boolean>;
|
|
939
945
|
/**
|
|
940
946
|
* design/383 §2.5 (rescan post-6.0.0-RC) — the floor seat's THIRD state: TRUE ⇔ the spawning
|
|
941
947
|
* session's capture opt-out state is INDETERMINATE at the moment a delegation tool reads this
|
|
@@ -947,8 +953,10 @@ export interface ToolExecuteContext {
|
|
|
947
953
|
* irreversible record is ever minted off an unreadable state); a readable-and-clean answer
|
|
948
954
|
* proceeds clean. Never TRUE beside {@link memoryCaptureOptedOut} — a known opt-out is
|
|
949
955
|
* determinate. Trusted Runner-filled seat, never a model/tool argument.
|
|
956
|
+
* Dual form like its twin (#511 件2): `boolean` over a sync store, `Promise<boolean>` over a
|
|
957
|
+
* Promise-form store — consumers `await`.
|
|
950
958
|
*/
|
|
951
|
-
memoryCaptureIndeterminate?: boolean
|
|
959
|
+
memoryCaptureIndeterminate?: boolean | Promise<boolean>;
|
|
952
960
|
/** design/383 §2.5 — the spawning session's write-plane control dir (the coordinate its capture
|
|
953
961
|
* record is keyed under), forwarded beside the floor bit so a cross-plane child's record-query
|
|
954
962
|
* leg reads the PARENT's carrier, not its own plane's. Trusted Runner-filled seat. */
|
|
@@ -4646,6 +4654,31 @@ export type TaskEvent = ({
|
|
|
4646
4654
|
* nor an agent-type — the child then keeps its taskId (NOT the raw objective, which could leak a delegated
|
|
4647
4655
|
* secret to a progress-scoped consumer — dual-review Q2). Sanitized (control-char-stripped, length-capped). */
|
|
4648
4656
|
name?: string;
|
|
4657
|
+
/**
|
|
4658
|
+
* The model this sub-run was PREPARED with — the resolved id, read off the leg's prepared model
|
|
4659
|
+
* at the mint, so it is the same value `TaskResult.model` and the `task.start` trace frame carry.
|
|
4660
|
+
* (`task.end` reports the run's totals and has never named a model; there is nothing to join to
|
|
4661
|
+
* there.)
|
|
4662
|
+
*
|
|
4663
|
+
* Why it rides the live lane at all: a delegation may name a tier word (`"sonnet"`), an agent
|
|
4664
|
+
* definition's model, or NOTHING (inherit the caller's current model, or fall to the `subagent`
|
|
4665
|
+
* role) — every one of those resolves somewhere the consumer cannot see, so a shell badging a
|
|
4666
|
+
* running child previously had only the REQUESTED word (or nothing) to render, which is a
|
|
4667
|
+
* different claim from what the child runs on. This is the resolved answer, not the request.
|
|
4668
|
+
*
|
|
4669
|
+
* PREPARED, deliberately, and NOT "whatever is serving this turn" — stated in the first sentence
|
|
4670
|
+
* because the difference is observable. A mid-run DEGRADE switch (`spec.limits.degrade`) or a
|
|
4671
|
+
* gateway re-route moves the serving model without rewriting this field, exactly as
|
|
4672
|
+
* `TaskResult.model` behaves; the switch is announced on its own channel (`TaskResult.degraded`),
|
|
4673
|
+
* and the per-call served id lives on the brain-call telemetry. One name, one meaning, across the
|
|
4674
|
+
* three faces that use it — at the cost of being the leg's declared model rather than a live one.
|
|
4675
|
+
*
|
|
4676
|
+
* Present on every tick this build mints (the frame family is subagent-only by construction, so
|
|
4677
|
+
* there is no lane where a leg has no prepared model). Declared optional for the ordinary reason:
|
|
4678
|
+
* a consumer folding frames from a pre-key producer must keep compiling, and absence there means
|
|
4679
|
+
* "this producer did not state it", never "no model".
|
|
4680
|
+
*/
|
|
4681
|
+
model?: string;
|
|
4649
4682
|
/** The child's most recent tool intent as one human line ("Bash npm test",
|
|
4650
4683
|
* "Edit src/x.ts") — the SAME source/value as the registry sink tick's `currentAction` (residual
|
|
4651
4684
|
* observability, lane B), attached to the FORWARDED frame because every client wire projects this
|
|
@@ -5246,6 +5279,40 @@ export interface BackgroundChildEvent {
|
|
|
5246
5279
|
* waiting for spawn-frame forwarding; `name` stays the design/99 DISPLAY label (description-backed)
|
|
5247
5280
|
* and was never a type field. */
|
|
5248
5281
|
agentType?: string;
|
|
5282
|
+
/**
|
|
5283
|
+
* spawn + tick: the model the ROW runs on — the resolved `ModelRef` the spawner selected for this
|
|
5284
|
+
* child (a per-call `model`, an agent definition's, or the caller's own current model, inherited).
|
|
5285
|
+
* It answers with the SERVED catalog model id wherever that is knowable, because this value sits
|
|
5286
|
+
* beside the child's own `task_progress.model` (the leg's prepared id) and a consumer joins the
|
|
5287
|
+
* two: a row saying "sonnet" next to ticks naming the catalog id it routed to is indistinguishable
|
|
5288
|
+
* from two different children. A `Model` object carries its id — and a per-call word that passed
|
|
5289
|
+
* the spawn gate arrives as exactly that resolved object, so for it the row and the ticks are one
|
|
5290
|
+
* value by construction. A definition/tool-level STRING ref resolves through the catalog in force
|
|
5291
|
+
* at the spawn judgement; the child's own prepare re-resolves such a ref against the runner's live
|
|
5292
|
+
* table, so for those refs alone a catalog hot-swapped between the two reads can lag the row one
|
|
5293
|
+
* generation behind the ticks. The DISPLAY rule survives only as the FALLBACK, for a string the
|
|
5294
|
+
* judgement-time catalog cannot resolve (a CC tier alias then shows its sema tier, never the alias
|
|
5295
|
+
* verbatim). It rides ticks as well as spawn for the same reason
|
|
5296
|
+
* {@link agentType} does: a consumer that only forwards ticks must not have to wait for spawn-frame
|
|
5297
|
+
* forwarding to fill its row. Like `agentType` it is the ROW's own fact and is NEVER copied off a
|
|
5298
|
+
* forwarded frame — a nested descendant's `task_progress` names ITS model, not this row's.
|
|
5299
|
+
*
|
|
5300
|
+
* ABSENT is a fact, not a gap, and there are exactly three ways to get there:
|
|
5301
|
+
* · the delegation named no model anywhere in the chain, so the child runs on the `subagent` ROLE
|
|
5302
|
+
* and its concrete id is only decided at the child's own prepare;
|
|
5303
|
+
* · the RETAIN-LEDGER wake lane (a `SendMessage` resume of a completed child), whose frames are
|
|
5304
|
+
* projected from an `AccessibleTaskRow` — and that row has no model column, so this lane has
|
|
5305
|
+
* nothing to state and will not invent one. Stated precisely because the sibling wake lane does
|
|
5306
|
+
* NOT share the limitation: a tier-3 DURABLE revive re-enters through the ordinary background
|
|
5307
|
+
* spawn, re-derives the model like a first spawn, and its `(revived)` frames carry it whenever
|
|
5308
|
+
* that derivation lands on a model (the durable record keeps a `model` of its own; a recorded
|
|
5309
|
+
* key the current catalog no longer resolves degrades the revival to the inherited model, and a
|
|
5310
|
+
* mount with nothing to inherit then leaves these frames honestly silent);
|
|
5311
|
+
* · a pre-key producer.
|
|
5312
|
+
* In every case the child's own `task_progress` frames still carry the resolved answer, which is the
|
|
5313
|
+
* authority; this field is the row-level convenience beside it.
|
|
5314
|
+
*/
|
|
5315
|
+
model?: string;
|
|
5249
5316
|
/** spawn: the HOST task's DECLARED task id (parent attribution). Omitted when the host
|
|
5250
5317
|
* run declared no task id (the `spec.taskId ?? sessionId` fallback would launder a session id into
|
|
5251
5318
|
* a task-id field — the orphan-pointer shape); {@link parentSessionId} is the always-on linkage. */
|
|
@@ -5359,7 +5426,21 @@ export interface BackgroundChildEvent {
|
|
|
5359
5426
|
stoppedBy?: "user" | "parent" | "system" | (string & {});
|
|
5360
5427
|
/** terminal: bounded human summary (same text the task_notification carries). */
|
|
5361
5428
|
summary?: string;
|
|
5362
|
-
/** tick: live rollup (`task_progress.usage`) · terminal:
|
|
5429
|
+
/** tick: live rollup (`task_progress.usage`) · terminal: the settled
|
|
5430
|
+
* `{tokens, turns, costMicroUsd?, toolUses?, durationMs}`. `costMicroUsd` is own+nested and present
|
|
5431
|
+
* only when that total is KNOWN (RB-368); `toolUses` is the run's own `stats.toolCalls` and is
|
|
5432
|
+
* absent — never zeroed — when the gateway reported no usage. The last two joined the terminal face
|
|
5433
|
+
* to close a reporting asymmetry: the workflow lane's completion notification and the Agent tool's
|
|
5434
|
+
* own sync `<usage>` footer had published both all along, so one child answered "how much work, how
|
|
5435
|
+
* long" on one lane and refused on the other.
|
|
5436
|
+
*
|
|
5437
|
+
* `durationMs` MEASURES DIFFERENT SPANS on the two kinds, which is worth knowing before plotting it:
|
|
5438
|
+
* on a TICK it is the child RUN's own elapsed (the forwarded frame's value, from the run's start);
|
|
5439
|
+
* on the TERMINAL it is the delegation LEG's, from the lane's launch instant — which is earlier, so
|
|
5440
|
+
* a consumer graphing one series sees a step up at settle. Both are true of what they name; neither
|
|
5441
|
+
* can be computed from the other without the spawn/prepare interval, which is why they are not
|
|
5442
|
+
* reconciled into one. The intra-turn activity beat carries a third, narrower shape (`{toolUses}`
|
|
5443
|
+
* alone — there is no honest live token figure on that lane). */
|
|
5363
5444
|
usage?: {
|
|
5364
5445
|
totalTokens?: number;
|
|
5365
5446
|
toolUses?: number;
|
|
@@ -133,7 +133,12 @@ export interface WiringManifest {
|
|
|
133
133
|
* a completed/failed/killed(non-user) subagent minted through the deps-visible assembly is
|
|
134
134
|
* continuable across a process restart. A statement about the DEPS-VISIBLE assembly only: a
|
|
135
135
|
* caller-mounted Agent tool over its own runner is outside this manifest's sight (per-read
|
|
136
|
-
* honest degrade + the integrity notice own that case, never a fabricated tier)
|
|
136
|
+
* honest degrade + the integrity notice own that case, never a fabricated tier) — and that
|
|
137
|
+
* blind spot is load-bearing here, because the store this field is derived from is the ROOT
|
|
138
|
+
* leg's while the store an ordinary child transcript is actually minted through is the AGENT
|
|
139
|
+
* TOOL's runner's ({@link resolveSubagentTranscriptTier} names the rule and the fork-lane
|
|
140
|
+
* exception). The word names ADDRESSABILITY: `none`/`rows` are silent on whether a child
|
|
141
|
+
* transcript reaches disk at all, and only `full` promises the a* handle survives a restart. */
|
|
137
142
|
fleet: {
|
|
138
143
|
backgroundAgentStore: boolean;
|
|
139
144
|
hostChildEventSink: boolean;
|
|
@@ -254,6 +259,18 @@ export type SubagentTranscriptTier = "none" | "rows" | "full";
|
|
|
254
259
|
* fold picked). This is the DEPLOYMENT-level judgment only; the per-handle "did this row's
|
|
255
260
|
* transcript actually land" question belongs to `durableAgentRowProbe` (the S1b release-flip gate)
|
|
256
261
|
* — two different questions, deliberately two named faces (do not merge them back into one).
|
|
262
|
+
*
|
|
263
|
+
* WHICH session store to pass: the one on the runner the Agent tool was mounted with
|
|
264
|
+
* (`SubagentToolOptions.runner.sessions`), because that is the store an ordinary (sync/background)
|
|
265
|
+
* child transcript is minted through — the fork lane deliberately branches through the HOST store
|
|
266
|
+
* instead, see the law on `SubagentToolOptions.runner`. A deployment that serves root tasks from one
|
|
267
|
+
* runner and delegated children from another (a throwaway sub-task store, a routing store) has two
|
|
268
|
+
* different stores here, and passing the ROOT deps' store reports the root lane's fate under the
|
|
269
|
+
* child lane's name. Note what the three words do and do not promise about DISK: this tier names
|
|
270
|
+
* ADDRESSABILITY, not persistence. `none` is returned before any store is inspected, so it covers
|
|
271
|
+
* both "the transcript is on disk but nothing can address it" and "there is no transcript" — an
|
|
272
|
+
* operator asking whether a child conversation is readable afterwards must read the delegation
|
|
273
|
+
* store's own durability + release/evict semantics, not this word.
|
|
257
274
|
*/
|
|
258
275
|
export declare function resolveSubagentTranscriptTier(agentStoreWired: boolean, sessionStore: {
|
|
259
276
|
readonly placements?: {
|
package/dist/index.d.ts
CHANGED
|
@@ -179,7 +179,7 @@ export { AdoptionError, assertAdoptionBootGate, readRootAdoptionFile, writeRootA
|
|
|
179
179
|
export { adoptLocalDataRoot, ackAdoptionConfig, witnessAdoptionConfig, listAdoptionQuarantine, readAdoptionStatus, type AdoptionStatus, type AdoptLocalDataRootOptions, type AdoptLocalDataRootResult, type AdoptionCarriageLeg, type AdoptionCarriageLegContext, type AdoptionConfigWitnessReceipt, } from "./stores/file/adoption/adopt.js";
|
|
180
180
|
export { formatHookFeedback, runToolGate, createHookEnvCapabilities, createPreToolUseConstraintPolicy, type PersistedRuleHit, type PersistedRuleHitRule, type PersistedRuleUnreadable, type PersistedRuleCoverage, type PersistedRuleAnswer, normalizePersistedRuleHit, type Hooks, type HookToolContext, type HookInvocationIdentity, type UserPromptSubmitContext, type PostToolBatchContext, type HookEnvCapabilities, type HookToolOutput, type PreToolUseResult, type PostToolUseResult, type UserPromptSubmitResult, type HookToolFailure, type PostToolUseFailureResult, type PostToolBatchCall, type PostToolBatchResult, type PreCompactContext, type PreCompactResult, type PostCompactContext, type StopFailureContext, type PermissionDeniedPayload, type PermissionDeniedSource, } from "./core/hooks.js";
|
|
181
181
|
export { InMemoryMemoryStore, composeMemoryBlock, composeLayeredMemoryBlock, normalizeMemorySpec, type NormalizedMemorySpec, type MemorySpecInput, supportsConsolidation, supportsPeriodicConsolidation, firstSentence, expandLexicalTerms, lexicalSearchMatch, type Embedder, classifyPromotable, enforcePromotableWriteGate, guardedMemoryStore, MemoryGateError, detectSecret, enforceSecretWriteGate, enforceStructuredNoteSecretGate, type UtilityGate, type MemoryStore, type MemoryVectorMode, type ScoredMemory, type MemoryNoteHeader, type MemoryNoteRecord, type MemoryNoteType, type StructuredNoteInput, } from "./core/memory.js";
|
|
182
|
-
export { MemoryEngine, FileMemoryEngineBackend, memoryBackendContract, assertMemoryBackendSearchEquivalence, type MemoryBackendContractHooks, buildMemoryInstruction, truncateIndex, scanEntryFiles, deriveRepoKey, deriveRepoMemoryDir, deriveControlPlaneDir, deriveRepoControlPlaneDir, resolveMemoryEngineRoot, scopeDirName, ControlPlaneCorruptError, parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, MEMORY_ORIGIN_CAUSES, committedOriginOf, originEquals, consolidationExposedFrontmatter, ambiguousOriginRepresentation, type OriginClearanceRow, type OriginClearanceEvent, type OriginClearanceShadow, committedDistilledOf, distilledEquals, type MemoryEntryDistilled, type MemoryEntryDistilledInput, CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, readIntentCredentials, supersessionFuseCeiling, memoryConsolidationRecommendedNotice, memoryConsolidationCommittedNotice, memoryConsolidationConflictNotice, memoryConsolidationIncompleteNotice, memoryConsolidationRefusedNotice, memoryConsolidationWithheldNotice, type ConsolidationGateRead, type ConsolidationGateRow, type ConsolidationIntent, type ConsolidationIntentCredentialRow, type ConsolidationLeaseSeat, type ConsolidationProductProposal, type ConsolidationProposal, type MemoryConsolidationOptions, type ConsolidationCommitReceipt, type ConsolidationReconcileReport, type ConsolidationResolveReceipt, type ConsolidationPlanSummary, type ConsolidationPlanFoldEvidence, DISTILLER_DEFAULT_MAX_INPUTS_PER_PRODUCT, LLM_DISTILLER_CONTRACT, LLM_DISTILLER_CONTRACT_DL2, LLM_DISTILLER_CONTRACT_DL3, LLM_DISTILLER_CONTRACTS, MEMORY_DISTILLER_CONTRACT_V1, contractGroupingDiff, driveConsolidationToFixpoint, isAliasModelId, llmPlanDistiller, mintExposurePartitionedPlan, mintLlmConsolidationPlan, MEMORY_DISTILLER_PURITY_CONTRACT_V1, detectCleanArmVerbatimLeak, type CleanArmLeakFinding, type CleanArmLeakVerdict, type MemoryDistillerPurityContract, openAiCompatChatSeat, parseJsonAnswer, planParseRepairs, sanitizeLlmGroups, scheduleUnderFuse, type ConsolidationDistillFn, type ConsolidationDriveCycleRow, type ConsolidationDriveEngine, type ConsolidationDriveResult, type ConsolidationFoldState, type DistillerCandidate, type DistillerChatAnswer, type DistillerChatFn, type DistillerChatRequest, type FuseSchedule, type LlmConsolidationPlan, type LlmConsolidationPlanArm, type LlmConsolidationPlanProduct, type LlmDistillerContract, type MintLlmConsolidationPlanResult, type PlanParseRepairs, type SanitizedLlmGroups, CONSOLIDATION_DRIVER_PLANS_DIR, CONSOLIDATION_DRIVER_RUNS_FILE, CONSOLIDATION_RUN_STOP_REASONS, archiveDistillerPlan, readConsolidationDriverRun, runMemoryConsolidationDriver, type ConsolidationDriverEngine, type ConsolidationDriverRunRow, type ConsolidationRunReceipt, type ConsolidationRunStopReason, type RunMemoryConsolidationOptions, isInstructionEntry, type MemoryEntryOrigin, type MemoryOriginCause, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, MEMORY_CAPTURE_OPTOUT_NOTICE, memoryCaptureOptedOutNotice, memoryCaptureOptOutUnpersistedNotice, SESSION_CAPTURE_OPTOUT_DIR, markSessionCaptureOptOut, readSessionCaptureOptOut, listSessionCaptureOptOut, fileSessionCaptureRecordStore, type SessionCaptureOptOutRecord, type SessionCaptureOptOutMarkOutcome, type SessionCaptureRecordStore, readV2HeaderHints, type V2HeaderHints, LINEAGE_FILE, CHALLENGES_FILE, CHALLENGED_HISTORY_FILE, CHALLENGE_LEDGER_MAX_EVENTS, rebuildStrictControlPlaneLedger, type ControlPlaneRebuildReceipt, type StrictControlPlaneLedger, type ChallengeAssignment, type ChallengeEvent, type ChallengedHistoryRow, type LineagePendingTxn, type LineagePromotion, MEMORY_INDEX_FILENAME, MEMORY_INDEX_MAX_LINES, MEMORY_INDEX_MAX_BYTES, MEMORY_SEARCH_TOOL_NAME, MEMORY_GET_TOOL_NAME, MEMORY_INDEX_TOOL_NAME, MEMORY_ENGINE_TOOL_NAMES, type MemorySearchDetails, type MemorySearchHit, type CleanMemorySearchHit, type ExposedMemorySearchHit, MEMORY_EXPOSURE_BANNER, MEMORY_EXPOSURE_HANDLE_TAG, memoryExposureIndexRow, type MemoryGetDetails, type MemoryIndexDetails, type MemoryIndexRow, type CleanMemoryIndexRow, type ExposedMemoryIndexRow, STUB_ARCHIVED_LINE, DEFAULT_MAX_MEMORY_FILES, DEFAULT_MAX_ENTRY_DEPTH, DEFAULT_HARVEST_DEADLINE_MS, DEFAULT_HARVEST_FILE_BUDGET, MASS_DELETION_FUSE_RATIO, scanMemoryWrite, scanMemoryFileName, scanRemediation, MEMORY_FILENAME_SEGMENT_RE, renderAnnouncements, enqueueMemoryAnnouncement, drainMemoryAnnouncements, peekMemoryAnnouncements, bumpScanFuse, scanFuseCount, clearScanFuse, ANNOUNCEMENTS_FILE, MEMORY_ANNOUNCEMENTS_MAX, SCAN_FUSE_FILE, SCAN_FUSE_THRESHOLD, type MemoryAnnouncement, type ScanFinding, type MemoryEngineOptions, type MemoryInjection, type EntryProvenanceAccount, type TransferEvidence, type CommittedBinding, type CommittedEntrySnapshot, type CommittedScopeSnapshots, type EntryCustodyReport, erasureSelectHash, type EraseMemoryEntriesInput, type ErasureSelect, type ErasedBinding, type MemoryErasureAttestation, computeMemoryBundleHash, type MemoryExportBundle, type MemoryImportReport, type MemoryExportSnapshot, type MemoryBundleImportPlan, type BundleChallengeRow, type BundleLineageRow, type BundlePollutedSession, type MemoryBackend, type MemoryEntry, type MemoryEntryFrontmatter, type MemoryEntryHeader, type MemoryScopeEnumeration, type ScoredMemoryEntry, type NotePatch, type PatchReport, type MaterializedFile, type MemorySessionHandle, type HarvestReport, type HarvestRejection, type HarvestRejectionCode, type ParsedEntryFile, type ScannedEntryFile, SCOPE_SEGMENT_MAX_ENCODED, PROJECT_MARKER_PATH, encodeScopeSegment, decodeScopeSegment, parseScopeKey, formatUserScope, formatOrgScope, formatProjScope, formatUserProjScope, isPersonalScope, assertScopeContractPlacement, formatProjectMarker, parseProjectMarker, resolveProjectId, PROJECT_ID_REGEX, type ParsedScopeKey, migrateScope, type MigrateScopeReport, materializeEntriesToFiles, harvestFilesToPatches, projectionsToWriteBack, screenInboundEntries, REMOTE_HARVEST_PER_FILE_BYTES, REMOTE_MASS_DELETION_FUSE_RATIO, type RemoteMemoryFile, type RemoteMemoryBaseline, type RemoteMaterialization, type RemoteHarvestResult, type InboundEntryFinding, deriveProjectMemoryDir, deriveProjectControlDir, recordProjectIdHint, lookupProjectIdHint, PROJECT_ID_HINTS_FILE, reconcileMemoryEntries, nextSyncBaseline, mergeRecallHits, type MemorySyncCursor, type MemorySyncConflict, type MemorySyncPlan, type RecallSource, syncMemoryScope, type MemorySyncTransport, type MemorySyncRequestBody, type MemorySyncResponseBody, type MemorySyncClientConflict, type SyncMemoryScopeOptions, type MemorySyncClientResult, } from "./core/memory-engine/index.js";
|
|
182
|
+
export { MemoryEngine, FileMemoryEngineBackend, memoryBackendContract, assertMemoryBackendSearchEquivalence, type MemoryBackendContractHooks, buildMemoryInstruction, truncateIndex, scanEntryFiles, deriveRepoKey, deriveRepoMemoryDir, deriveControlPlaneDir, deriveRepoControlPlaneDir, resolveMemoryEngineRoot, scopeDirName, ControlPlaneCorruptError, parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, MEMORY_ORIGIN_CAUSES, committedOriginOf, originEquals, consolidationExposedFrontmatter, ambiguousOriginRepresentation, type OriginClearanceRow, type OriginClearanceEvent, type OriginClearanceShadow, committedDistilledOf, distilledEquals, type MemoryEntryDistilled, type MemoryEntryDistilledInput, CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, readIntentCredentials, supersessionFuseCeiling, memoryConsolidationRecommendedNotice, memoryConsolidationCommittedNotice, memoryConsolidationConflictNotice, memoryConsolidationIncompleteNotice, memoryConsolidationRefusedNotice, memoryConsolidationWithheldNotice, type ConsolidationGateRead, type ConsolidationGateRow, type ConsolidationIntent, type ConsolidationIntentCredentialRow, type ConsolidationLeaseSeat, type ConsolidationProductProposal, type ConsolidationProposal, type MemoryConsolidationOptions, type ConsolidationCommitReceipt, type ConsolidationReconcileReport, type ConsolidationResolveReceipt, type ConsolidationPlanSummary, type ConsolidationPlanFoldEvidence, type SessionMemoryStatus, DISTILLER_DEFAULT_MAX_INPUTS_PER_PRODUCT, LLM_DISTILLER_CONTRACT, LLM_DISTILLER_CONTRACT_DL2, LLM_DISTILLER_CONTRACT_DL3, LLM_DISTILLER_CONTRACTS, MEMORY_DISTILLER_CONTRACT_V1, contractGroupingDiff, driveConsolidationToFixpoint, isAliasModelId, llmPlanDistiller, mintExposurePartitionedPlan, mintLlmConsolidationPlan, MEMORY_DISTILLER_PURITY_CONTRACT_V1, detectCleanArmVerbatimLeak, type CleanArmLeakFinding, type CleanArmLeakVerdict, type MemoryDistillerPurityContract, openAiCompatChatSeat, parseJsonAnswer, planParseRepairs, sanitizeLlmGroups, scheduleUnderFuse, type ConsolidationDistillFn, type ConsolidationDriveCycleRow, type ConsolidationDriveEngine, type ConsolidationDriveResult, type ConsolidationFoldState, type DistillerCandidate, type DistillerChatAnswer, type DistillerChatFn, type DistillerChatRequest, type FuseSchedule, type LlmConsolidationPlan, type LlmConsolidationPlanArm, type LlmConsolidationPlanProduct, type LlmDistillerContract, type MintLlmConsolidationPlanResult, type PlanParseRepairs, type SanitizedLlmGroups, CONSOLIDATION_DRIVER_PLANS_DIR, CONSOLIDATION_DRIVER_RUNS_FILE, CONSOLIDATION_RUN_STOP_REASONS, archiveDistillerPlan, readConsolidationDriverRun, runMemoryConsolidationDriver, type ConsolidationDriverEngine, type ConsolidationDriverRunRow, type ConsolidationRunReceipt, type ConsolidationRunStopReason, type RunMemoryConsolidationOptions, isInstructionEntry, type MemoryEntryOrigin, type MemoryOriginCause, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, MEMORY_CAPTURE_OPTOUT_NOTICE, memoryCaptureOptedOutNotice, memoryCaptureOptOutUnpersistedNotice, SESSION_CAPTURE_OPTOUT_DIR, markSessionCaptureOptOut, readSessionCaptureOptOut, listSessionCaptureOptOut, fileSessionCaptureRecordStore, type SessionCaptureOptOutRecord, type SessionCaptureOptOutMarkOutcome, type SessionCaptureRecordStore, readV2HeaderHints, type V2HeaderHints, LINEAGE_FILE, CHALLENGES_FILE, CHALLENGED_HISTORY_FILE, CHALLENGE_LEDGER_MAX_EVENTS, rebuildStrictControlPlaneLedger, type ControlPlaneRebuildReceipt, type StrictControlPlaneLedger, type ChallengeAssignment, type ChallengeEvent, type ChallengedHistoryRow, type LineagePendingTxn, type LineagePromotion, MEMORY_INDEX_FILENAME, MEMORY_INDEX_MAX_LINES, MEMORY_INDEX_MAX_BYTES, MEMORY_SEARCH_TOOL_NAME, MEMORY_GET_TOOL_NAME, MEMORY_INDEX_TOOL_NAME, MEMORY_ENGINE_TOOL_NAMES, type MemorySearchDetails, type MemorySearchHit, type CleanMemorySearchHit, type ExposedMemorySearchHit, MEMORY_EXPOSURE_BANNER, MEMORY_EXPOSURE_HANDLE_TAG, memoryExposureIndexRow, type MemoryGetDetails, type MemoryIndexDetails, type MemoryIndexRow, type CleanMemoryIndexRow, type ExposedMemoryIndexRow, STUB_ARCHIVED_LINE, DEFAULT_MAX_MEMORY_FILES, DEFAULT_MAX_ENTRY_DEPTH, DEFAULT_HARVEST_DEADLINE_MS, DEFAULT_HARVEST_FILE_BUDGET, MASS_DELETION_FUSE_RATIO, scanMemoryWrite, scanMemoryFileName, scanRemediation, MEMORY_FILENAME_SEGMENT_RE, renderAnnouncements, enqueueMemoryAnnouncement, drainMemoryAnnouncements, peekMemoryAnnouncements, bumpScanFuse, scanFuseCount, clearScanFuse, ANNOUNCEMENTS_FILE, MEMORY_ANNOUNCEMENTS_MAX, SCAN_FUSE_FILE, SCAN_FUSE_THRESHOLD, type MemoryAnnouncement, type ScanFinding, type MemoryEngineOptions, type MemoryInjection, type EntryProvenanceAccount, type TransferEvidence, type CommittedBinding, type CommittedEntrySnapshot, type CommittedScopeSnapshots, type EntryCustodyReport, erasureSelectHash, type EraseMemoryEntriesInput, type ErasureSelect, type ErasedBinding, type MemoryErasureAttestation, computeMemoryBundleHash, type MemoryExportBundle, type MemoryImportReport, type MemoryExportSnapshot, type MemoryBundleImportPlan, type BundleChallengeRow, type BundleLineageRow, type BundlePollutedSession, type MemoryBackend, type MemoryEntry, type MemoryEntryFrontmatter, type MemoryEntryHeader, type MemoryScopeEnumeration, type ScoredMemoryEntry, type NotePatch, type PatchReport, type MaterializedFile, type MemorySessionHandle, type HarvestReport, type HarvestRejection, type HarvestRejectionCode, type ParsedEntryFile, type ScannedEntryFile, SCOPE_SEGMENT_MAX_ENCODED, PROJECT_MARKER_PATH, encodeScopeSegment, decodeScopeSegment, parseScopeKey, formatUserScope, formatOrgScope, formatProjScope, formatUserProjScope, isPersonalScope, assertScopeContractPlacement, formatProjectMarker, parseProjectMarker, resolveProjectId, PROJECT_ID_REGEX, type ParsedScopeKey, migrateScope, type MigrateScopeReport, materializeEntriesToFiles, harvestFilesToPatches, projectionsToWriteBack, screenInboundEntries, REMOTE_HARVEST_PER_FILE_BYTES, REMOTE_MASS_DELETION_FUSE_RATIO, type RemoteMemoryFile, type RemoteMemoryBaseline, type RemoteMaterialization, type RemoteHarvestResult, type InboundEntryFinding, deriveProjectMemoryDir, deriveProjectControlDir, recordProjectIdHint, lookupProjectIdHint, PROJECT_ID_HINTS_FILE, reconcileMemoryEntries, nextSyncBaseline, mergeRecallHits, type MemorySyncCursor, type MemorySyncConflict, type MemorySyncPlan, type RecallSource, syncMemoryScope, type MemorySyncTransport, type MemorySyncRequestBody, type MemorySyncResponseBody, type MemorySyncClientConflict, type SyncMemoryScopeOptions, type MemorySyncClientResult, } from "./core/memory-engine/index.js";
|
|
183
183
|
export { SHARED_MEMORY_READ_CAP_BYTES, SHARED_MEMORY_LIST_PAGE_SIZE, SharedMemoryStoreError, type SharedMemoryStoreProvider, type SharedMemoryStoreReader, type SharedMemoryPagedList, type SharedMemoryStoreInfo, type SharedMemoryDocumentEntry, type SharedMemorySnapshot, type SharedMemoryRequestContext, type MemoryListDetails, type MemoryReadDetails, } from "./core/shared-memory/types.js";
|
|
184
184
|
export { sharedMemoryStoreContract, type SharedMemoryFixture, type SharedMemoryStoreContractHooks, } from "./core/shared-memory/contract.js";
|
|
185
185
|
export { termSet, jaccardDistance, cosineDistance } from "./core/memory-vector.js";
|
|
@@ -245,7 +245,15 @@ export interface RunWorkflowToolDeps {
|
|
|
245
245
|
sessionId: string;
|
|
246
246
|
controlDir?: string;
|
|
247
247
|
}>;
|
|
248
|
-
}
|
|
248
|
+
} | Promise<{
|
|
249
|
+
optedOut: boolean;
|
|
250
|
+
indeterminate: boolean;
|
|
251
|
+
controlDir?: string;
|
|
252
|
+
ancestors?: ReadonlyArray<{
|
|
253
|
+
sessionId: string;
|
|
254
|
+
controlDir?: string;
|
|
255
|
+
}>;
|
|
256
|
+
}>;
|
|
249
257
|
/** TRUSTED nesting depth from the run's internals (NOT a tool param) — passed to `startWorkflow` so a
|
|
250
258
|
* cross-process child workflow is rejected by the one-level guard. */
|
|
251
259
|
workflowDepth?: number;
|
|
@@ -3,6 +3,7 @@ import { defineTool, errorResult } from "../core/tools.js";
|
|
|
3
3
|
import { governanceBaselineError, governanceBaselineProblem } from "./governance-baseline-validity.js";
|
|
4
4
|
import { redactSecrets, redactHostLeaks, boundedRedactedSummary } from "../core/untrusted-egress.js";
|
|
5
5
|
import { withDelegationProvenance } from "../core/tool-policy.js";
|
|
6
|
+
import { LAUNCH_RECEIPT_OWN_WORDS_CLAUSE, launchReceiptNoQuoteClause } from "../agents/launch-receipt-contract.js";
|
|
6
7
|
import { startWorkflow } from "./workflow.js";
|
|
7
8
|
import { buildWorkflowPrimitives } from "./workflow-primitives.js";
|
|
8
9
|
import { parseWorkflowMeta, splitWorkflowMeta, workflowScriptReadsClockOrRandom } from "./workflow-meta.js";
|
|
@@ -514,12 +515,17 @@ export async function createRunWorkflowTool(d) {
|
|
|
514
515
|
...(() => {
|
|
515
516
|
if ("memoryCaptureOptedOut" in ctx) {
|
|
516
517
|
return {
|
|
517
|
-
parentMemoryCaptureState: () =>
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
518
|
+
parentMemoryCaptureState: () => {
|
|
519
|
+
const o = ctx.memoryCaptureOptedOut ?? false;
|
|
520
|
+
const i = ctx.memoryCaptureIndeterminate ?? false;
|
|
521
|
+
const build = (optedOut, indeterminate) => ({
|
|
522
|
+
optedOut: optedOut === true,
|
|
523
|
+
indeterminate: indeterminate === true,
|
|
524
|
+
...(ctx.memoryCaptureControlDir !== undefined ? { controlDir: ctx.memoryCaptureControlDir } : {}),
|
|
525
|
+
...(ctx.memoryCaptureAncestors !== undefined ? { ancestors: ctx.memoryCaptureAncestors } : {}),
|
|
526
|
+
});
|
|
527
|
+
return o instanceof Promise || i instanceof Promise ? Promise.all([o, i]).then(([ov, iv]) => build(ov, iv)) : build(o, i);
|
|
528
|
+
},
|
|
523
529
|
};
|
|
524
530
|
}
|
|
525
531
|
return d.parentMemoryCaptureState !== undefined ? { parentMemoryCaptureState: d.parentMemoryCaptureState } : {};
|
|
@@ -630,8 +636,7 @@ export async function createRunWorkflowTool(d) {
|
|
|
630
636
|
task_id: runId,
|
|
631
637
|
status: "started",
|
|
632
638
|
...(persistedScriptPath !== undefined ? { scriptPath: persistedScriptPath } : {}),
|
|
633
|
-
handling: "
|
|
634
|
-
"In your own words, briefly tell the user what you launched; do not echo this result.",
|
|
639
|
+
handling: `${launchReceiptNoQuoteClause(" (the ids above, and scriptPath when present)")} ${LAUNCH_RECEIPT_OWN_WORDS_CLAUSE}`,
|
|
635
640
|
note: (() => {
|
|
636
641
|
const pollExpr = d.taskRegistry ? `TaskOutput({ task_id: "${runId}" })` : undefined;
|
|
637
642
|
const blockingPollExpr = d.taskRegistry ? `TaskOutput({ task_id: "${runId}", block: true })` : undefined;
|
|
@@ -405,7 +405,15 @@ export interface RunWorkflowOptions {
|
|
|
405
405
|
sessionId: string;
|
|
406
406
|
controlDir?: string;
|
|
407
407
|
}>;
|
|
408
|
-
}
|
|
408
|
+
} | Promise<{
|
|
409
|
+
optedOut: boolean;
|
|
410
|
+
indeterminate: boolean;
|
|
411
|
+
controlDir?: string;
|
|
412
|
+
ancestors?: ReadonlyArray<{
|
|
413
|
+
sessionId: string;
|
|
414
|
+
controlDir?: string;
|
|
415
|
+
}>;
|
|
416
|
+
}>;
|
|
409
417
|
/** Call-time getter for the HOST run's RESOLVED Model object. A spawned agent whose
|
|
410
418
|
* fold chain (script spec → agentType → governance baseline) produced NO model inherits the
|
|
411
419
|
* parent's full object — baseUrl/key routing included — instead of falling to a string/role
|
|
@@ -54,11 +54,14 @@ function forReview(text) {
|
|
|
54
54
|
return text;
|
|
55
55
|
return `${text.slice(0, MAX_REVIEWED_PROMPT_CHARS)}\n[…TRUNCATED FOR REVIEW: ${text.length - MAX_REVIEWED_PROMPT_CHARS} further characters follow that the child WILL receive and this review did NOT see]`;
|
|
56
56
|
}
|
|
57
|
-
function workflowModelLabel(spec) {
|
|
57
|
+
function workflowModelLabel(spec, catalog) {
|
|
58
58
|
const model = spec.model;
|
|
59
59
|
if (model === undefined)
|
|
60
60
|
return undefined;
|
|
61
|
-
|
|
61
|
+
if (typeof model !== "string")
|
|
62
|
+
return model.id ?? model.name;
|
|
63
|
+
const served = catalog?.[model]?.id;
|
|
64
|
+
return served ?? resolveModelDisplayLabel(model);
|
|
62
65
|
}
|
|
63
66
|
export const WORKFLOW_SUBAGENT_PROMPT = `You are a subagent spawned by a workflow orchestration script. Use the tools available to complete the task.
|
|
64
67
|
|
|
@@ -441,6 +444,7 @@ export function startWorkflow(runner, fn, opts = {}, internals) {
|
|
|
441
444
|
}
|
|
442
445
|
const concurrency = normalizeConcurrency(opts.concurrency);
|
|
443
446
|
const agentRegistry = workflowAgentRegistry(opts);
|
|
447
|
+
const modelCatalog = runner.agentCatalog?.models;
|
|
444
448
|
const store = opts.store;
|
|
445
449
|
const maxAgents = normalizeWorkflowHardCap("maxAgents", opts.maxAgents);
|
|
446
450
|
const maxLogChars = normalizeWorkflowHardCap("maxLogChars", opts.maxLogChars);
|
|
@@ -615,8 +619,8 @@ export function startWorkflow(runner, fn, opts = {}, internals) {
|
|
|
615
619
|
...(opts.placementRoot !== undefined ? { placementRoot: opts.placementRoot } : {}),
|
|
616
620
|
...(opts.originatingSessionId !== undefined ? { parentSessionId: opts.originatingSessionId } : {}),
|
|
617
621
|
};
|
|
618
|
-
const captureFloorSeatsNow = () => {
|
|
619
|
-
const s = opts.parentMemoryCaptureState?.();
|
|
622
|
+
const captureFloorSeatsNow = async () => {
|
|
623
|
+
const s = await opts.parentMemoryCaptureState?.();
|
|
620
624
|
if (s === undefined)
|
|
621
625
|
return {};
|
|
622
626
|
return {
|
|
@@ -633,11 +637,11 @@ export function startWorkflow(runner, fn, opts = {}, internals) {
|
|
|
633
637
|
const bceParentToolCall = opts.parentToolCallId !== undefined ? { parentToolCallId: opts.parentToolCallId } : {};
|
|
634
638
|
const waIdOf = (callKey) => `wa${createHash("sha256").update(`${runId}:${callKey}`).digest("hex").slice(0, 16)}`;
|
|
635
639
|
const bceLive = new Map();
|
|
636
|
-
const bceSpawn = (callKey, label, agentType, replayed, sessionId) => {
|
|
640
|
+
const bceSpawn = (callKey, label, agentType, replayed, sessionId, model) => {
|
|
637
641
|
if (!bceSink)
|
|
638
642
|
return;
|
|
639
643
|
const id = waIdOf(callKey);
|
|
640
|
-
bceLive.set(id, { callKey, label, ...(agentType !== undefined ? { agentType } : {}), ...(sessionId !== undefined ? { sessionId } : {}) });
|
|
644
|
+
bceLive.set(id, { callKey, label, ...(agentType !== undefined ? { agentType } : {}), ...(sessionId !== undefined ? { sessionId } : {}), ...(model !== undefined ? { model } : {}) });
|
|
641
645
|
bceEmit({
|
|
642
646
|
kind: "spawn",
|
|
643
647
|
taskId: id,
|
|
@@ -648,6 +652,7 @@ export function startWorkflow(runner, fn, opts = {}, internals) {
|
|
|
648
652
|
...(scope !== undefined ? { scope } : {}),
|
|
649
653
|
description: replayed ? `${label} (replayed)` : label,
|
|
650
654
|
agentType: agentType ?? "workflow-agent",
|
|
655
|
+
...(model !== undefined ? { model } : {}),
|
|
651
656
|
name: label,
|
|
652
657
|
...(opts.parentTaskId !== undefined ? { parentTaskId: opts.parentTaskId } : {}),
|
|
653
658
|
workflowRunId: runId,
|
|
@@ -679,6 +684,7 @@ export function startWorkflow(runner, fn, opts = {}, internals) {
|
|
|
679
684
|
workflowRunId: runId,
|
|
680
685
|
...(scope !== undefined ? { scope } : {}),
|
|
681
686
|
...(row.agentType !== undefined ? { agentType: row.agentType } : { agentType: "workflow-agent" }),
|
|
687
|
+
...(row.model !== undefined ? { model: row.model } : {}),
|
|
682
688
|
...(row.sessionId !== undefined ? { sessionId: row.sessionId, transcriptId: row.sessionId } : {}),
|
|
683
689
|
name: e.name ?? row.label,
|
|
684
690
|
progressTaskId: e.taskId,
|
|
@@ -1003,7 +1009,8 @@ export function startWorkflow(runner, fn, opts = {}, internals) {
|
|
|
1003
1009
|
const specForIdentity = inheritedModelSnap !== undefined ? { ...spec, model: inheritedModelSnap } : spec;
|
|
1004
1010
|
const callKey = workflowAgentCallKey(run.agents.length, specForIdentity, agentOpts);
|
|
1005
1011
|
const prompt = boundedRedactedSummary(spec.systemPrompt ? `${spec.systemPrompt}\n\n${spec.objective}` : spec.objective, MAX_TRANSCRIPT_CHARS);
|
|
1006
|
-
const
|
|
1012
|
+
const specForLabel = spec.model === undefined && typeDefModel !== undefined ? { ...spec, model: typeDefModel } : specForIdentity;
|
|
1013
|
+
const model = workflowModelLabel(specForLabel, modelCatalog);
|
|
1007
1014
|
return { label, phase, phaseInstance, groupId, inheritedModelSnap, callKey, prompt, model };
|
|
1008
1015
|
};
|
|
1009
1016
|
const reviewSpawnBeforeLaunch = async (lane, label, callKey, runSpec, effectiveSignal) => {
|
|
@@ -1161,13 +1168,14 @@ export function startWorkflow(runner, fn, opts = {}, internals) {
|
|
|
1161
1168
|
const rs = r.stats;
|
|
1162
1169
|
const cachedOutput = boundedRedactedSummary(r.structuredOutput ?? r.result, MAX_TRANSCRIPT_CHARS);
|
|
1163
1170
|
const at = now();
|
|
1171
|
+
const replayModel = r.model;
|
|
1164
1172
|
const replayRec = {
|
|
1165
1173
|
label,
|
|
1166
1174
|
callKey,
|
|
1167
1175
|
...(groupId !== undefined ? { groupId } : {}),
|
|
1168
1176
|
phase,
|
|
1169
1177
|
prompt,
|
|
1170
|
-
...(
|
|
1178
|
+
...(replayModel !== undefined ? { model: replayModel } : {}),
|
|
1171
1179
|
replayed: true,
|
|
1172
1180
|
status: r.status === "completed" ? "completed" : "failed",
|
|
1173
1181
|
taskStatus: r.status,
|
|
@@ -1185,9 +1193,9 @@ export function startWorkflow(runner, fn, opts = {}, internals) {
|
|
|
1185
1193
|
run.agents.push(replayRec);
|
|
1186
1194
|
if (phaseInstance)
|
|
1187
1195
|
agentPhaseOf.set(replayRec, phaseInstance);
|
|
1188
|
-
emit({ type: "agent_start", runId, label, phase, ...(groupId !== undefined ? { groupId } : {}), callKey, prompt, ...(
|
|
1196
|
+
emit({ type: "agent_start", runId, label, phase, ...(groupId !== undefined ? { groupId } : {}), callKey, prompt, ...(replayModel !== undefined ? { model: replayModel } : {}), replayed: true, ts: at });
|
|
1189
1197
|
emit({ type: "agent_end", runId, label, phase, ...(groupId !== undefined ? { groupId } : {}), status: replayRec.status, output: cachedOutput, ...(rs.toolCalls !== undefined ? { toolCalls: rs.toolCalls } : {}), replayed: true, ts: at });
|
|
1190
|
-
bceSpawn(callKey, label, agentOpts.agentType, true, r.sessionId || undefined);
|
|
1198
|
+
bceSpawn(callKey, label, agentOpts.agentType, true, r.sessionId || undefined, replayModel);
|
|
1191
1199
|
bceTerminal(callKey, replayRec.status === "completed" ? "completed" : "failed", cachedOutput, r.sessionId || undefined, replayRec.stats);
|
|
1192
1200
|
accumulateStats(r, false);
|
|
1193
1201
|
void persist("update");
|
|
@@ -1233,7 +1241,7 @@ export function startWorkflow(runner, fn, opts = {}, internals) {
|
|
|
1233
1241
|
}
|
|
1234
1242
|
rec.startedAt = now();
|
|
1235
1243
|
const bornChildSessionId = resolveChildSessionIdAtSpawn(spec);
|
|
1236
|
-
bceSpawn(callKey, label, agentOpts.agentType, false, bornChildSessionId);
|
|
1244
|
+
bceSpawn(callKey, label, agentOpts.agentType, false, bornChildSessionId, model);
|
|
1237
1245
|
const typedSpec0 = applyWorkflowAgentType(spec, agentOpts.agentType, agentRegistry);
|
|
1238
1246
|
const typedSpec = typedSpec0.model === undefined && inheritedModelSnap !== undefined ? { ...typedSpec0, model: inheritedModelSnap } : typedSpec0;
|
|
1239
1247
|
const framedSpec = withWorkflowChildPersona(typedSpec, agentOpts.schema ?? typedSpec.outputSchema);
|
|
@@ -1247,7 +1255,7 @@ export function startWorkflow(runner, fn, opts = {}, internals) {
|
|
|
1247
1255
|
opts.onForwardEvent(e.type === "task_progress" ? { ...e, workflowRunId: runId, workflowAgentLabel: label } : e);
|
|
1248
1256
|
}
|
|
1249
1257
|
: undefined;
|
|
1250
|
-
const baseInternals = { ...(agentOpts.isolation ? { isolation: agentOpts.isolation } : {}), ...(opts.parentCwd !== undefined ? { parentCwd: opts.parentCwd } : {}), ...spawnAttribution, ...captureFloorSeatsNow(), ...(enrichedForward !== undefined ? { onForwardEvent: enrichedForward } : {}), delegationTaskType: "workflow", agentName: label, onWorkspaceResolved: createWorkspaceObserver(rec) };
|
|
1258
|
+
const baseInternals = { ...(agentOpts.isolation ? { isolation: agentOpts.isolation } : {}), ...(opts.parentCwd !== undefined ? { parentCwd: opts.parentCwd } : {}), ...spawnAttribution, ...(await captureFloorSeatsNow()), ...(enrichedForward !== undefined ? { onForwardEvent: enrichedForward } : {}), delegationTaskType: "workflow", agentName: label, onWorkspaceResolved: createWorkspaceObserver(rec) };
|
|
1251
1259
|
let attempts = 0;
|
|
1252
1260
|
let throttleRetried = false;
|
|
1253
1261
|
let lastAttemptReason;
|
|
@@ -1545,7 +1553,7 @@ export function startWorkflow(runner, fn, opts = {}, internals) {
|
|
|
1545
1553
|
}
|
|
1546
1554
|
rec.startedAt = now();
|
|
1547
1555
|
const childSessionId = resolveChildSessionIdAtSpawn(spec);
|
|
1548
|
-
bceSpawn(callKey, label, agentOpts.agentType, false, childSessionId);
|
|
1556
|
+
bceSpawn(callKey, label, agentOpts.agentType, false, childSessionId, model);
|
|
1549
1557
|
let stream;
|
|
1550
1558
|
try {
|
|
1551
1559
|
const typedSpec0 = applyWorkflowAgentType(spec, agentOpts.agentType, agentRegistry);
|
|
@@ -1566,7 +1574,7 @@ export function startWorkflow(runner, fn, opts = {}, internals) {
|
|
|
1566
1574
|
...(agentOpts.isolation ? { isolation: agentOpts.isolation } : {}),
|
|
1567
1575
|
...(opts.parentCwd !== undefined ? { parentCwd: opts.parentCwd } : {}),
|
|
1568
1576
|
...spawnAttribution,
|
|
1569
|
-
...captureFloorSeatsNow(),
|
|
1577
|
+
...(await captureFloorSeatsNow()),
|
|
1570
1578
|
...(enrichedForwardS !== undefined ? { onForwardEvent: enrichedForwardS } : {}),
|
|
1571
1579
|
delegationTaskType: "workflow",
|
|
1572
1580
|
agentName: label,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_comment": "design/87 L3 — frozen public export surface of src/index.ts (name -> kind). DO NOT edit by hand to silence a red test. A removed/changed entry = a SemVer-BREAKING change; bump MAJOR and update this fixture in the SAME commit (design/87 §4.2 / §5.2). Regenerate via REGEN in test/export-surface.test.ts.",
|
|
3
3
|
"_tierComment": "#435 v1 — machine-readable layering of the public surface: stable = demonstrated by README.md / src/examples; internal = an `Internal`-marked name or a runner/engine deep-subtree declaration (the model seam src/engine/llm is excluded — it is the BYOM contract, not an engine internal); advanced = a supported export the front door does not walk you through. THIS IS AN INITIAL HEURISTIC, derived mechanically and expected to be refined ticket by ticket: no human reviewed these 1700+ entries one by one, and nothing here claims otherwise. Known bias: a short or English-word export name (ok, err, Result, Usage) can match ordinary prose in README.md and land `stable` on a coincidence. Every export MUST carry a tier — a new export with no row fails the gate in export-surface.test.ts.",
|
|
4
|
-
"count":
|
|
4
|
+
"count": 1842,
|
|
5
5
|
"exports": {
|
|
6
6
|
"A2ATaskState": "type",
|
|
7
7
|
"A2ATaskStateReversal": "type",
|
|
@@ -996,6 +996,7 @@
|
|
|
996
996
|
"SessionCaptureOptOutRecord": "interface",
|
|
997
997
|
"SessionCaptureRecordStore": "interface",
|
|
998
998
|
"SessionError": "class",
|
|
999
|
+
"SessionMemoryStatus": "interface",
|
|
999
1000
|
"SessionMetadata": "interface",
|
|
1000
1001
|
"SessionPermissionRules": "interface",
|
|
1001
1002
|
"SessionPlacement": "interface",
|
|
@@ -2839,6 +2840,7 @@
|
|
|
2839
2840
|
"SessionCaptureOptOutRecord": "advanced",
|
|
2840
2841
|
"SessionCaptureRecordStore": "advanced",
|
|
2841
2842
|
"SessionError": "stable",
|
|
2843
|
+
"SessionMemoryStatus": "advanced",
|
|
2842
2844
|
"SessionMetadata": "stable",
|
|
2843
2845
|
"SessionPermissionRules": "advanced",
|
|
2844
2846
|
"SessionPlacement": "advanced",
|