@sema-agent/core 7.16.0 → 7.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +209 -0
- package/dist/agents/builtin-agents.d.ts +3 -3
- package/dist/agents/cross-session-envelope.d.ts +0 -1
- package/dist/agents/cross-session-envelope.js +0 -1
- package/dist/agents/peer-notices.d.ts +0 -9
- package/dist/agents/peer-notices.js +0 -63
- package/dist/agents/subagent.js +7 -15
- package/dist/brain/request-params.d.ts +2 -2
- package/dist/config/defaults.d.ts +0 -7
- package/dist/config/defaults.js +0 -2
- package/dist/core/artifact-host.d.ts +218 -0
- package/dist/core/artifact-host.js +92 -0
- package/dist/core/ask-origin.d.ts +29 -3
- package/dist/core/ask-origin.js +17 -9
- package/dist/core/ask-question.d.ts +25 -0
- package/dist/core/ask-question.js +4 -0
- package/dist/core/ask-unresolvable-notice.d.ts +30 -21
- package/dist/core/ask-unresolvable-notice.js +16 -8
- package/dist/core/auto-compaction.d.ts +10 -10
- package/dist/core/auto-mode-arming.d.ts +2 -2
- package/dist/core/background-agent-store.d.ts +5 -5
- package/dist/core/background-shell.d.ts +1 -1
- package/dist/core/checkpoint-execution-record.d.ts +0 -3
- package/dist/core/checkpoint-execution-record.js +0 -4
- package/dist/core/checkpoint-store.d.ts +71 -99
- package/dist/core/checkpoint-store.js +9 -16
- package/dist/core/context-edit.d.ts +36 -104
- package/dist/core/context-edit.js +37 -60
- package/dist/core/effective-path-target.d.ts +68 -8
- package/dist/core/effective-path-target.js +42 -30
- package/dist/core/engine-notice.d.ts +46 -32
- package/dist/core/env-budget.d.ts +31 -0
- package/dist/core/env-budget.js +39 -0
- package/dist/core/exec-output-tail.d.ts +5 -5
- package/dist/core/file-history-store.js +3 -6
- package/dist/core/fs-write-gate-policy.d.ts +1 -1
- package/dist/core/fs-write-gate-policy.js +3 -3
- package/dist/core/gate-lanes.js +9 -15
- package/dist/core/governance-codes.d.ts +1 -1
- package/dist/core/governance-codes.js +2 -0
- package/dist/core/hands-band.d.ts +1 -1
- package/dist/core/hooks.d.ts +18 -17
- package/dist/core/lsp-session.d.ts +1 -1
- package/dist/core/lsp.d.ts +1 -1
- package/dist/core/lsp.js +5 -4
- package/dist/core/mcp.d.ts +5 -5
- package/dist/core/mcp.js +4 -48
- package/dist/core/memory-engine/engine.js +2 -1
- package/dist/core/memory-engine/layout.d.ts +18 -6
- package/dist/core/memory-engine/layout.js +40 -21
- package/dist/core/memory-recall.d.ts +0 -8
- package/dist/core/memory.d.ts +1 -1
- package/dist/core/oracle-isolation.js +2 -2
- package/dist/core/parent-spec-seat.d.ts +66 -0
- package/dist/core/parent-spec-seat.js +47 -0
- package/dist/core/permission-rule-model.d.ts +11 -6
- package/dist/core/permission-rule-model.js +53 -37
- package/dist/core/permission-rules.js +8 -3
- package/dist/core/physical-path.d.ts +37 -0
- package/dist/core/physical-path.js +30 -0
- package/dist/core/protocol-naming.d.ts +2 -2
- package/dist/core/remote-env.d.ts +1 -1
- package/dist/core/retired-keys.d.ts +19 -0
- package/dist/core/retired-keys.js +15 -0
- package/dist/core/runner/active-skill-scope.js +3 -3
- package/dist/core/runner/assemble-result.d.ts +15 -13
- package/dist/core/runner/assemble-result.js +5 -4
- package/dist/core/runner/compaction-call-options.d.ts +25 -89
- package/dist/core/runner/contracts.d.ts +11 -10
- package/dist/core/runner/gate-exit.js +15 -1
- package/dist/core/runner/halt-attribution.d.ts +35 -0
- package/dist/core/runner/halt-attribution.js +16 -0
- package/dist/core/runner/memory-consolidation.d.ts +0 -2
- package/dist/core/runner/memory-consolidation.js +0 -1
- package/dist/core/runner/prepare-artifact.d.ts +52 -0
- package/dist/core/runner/prepare-artifact.js +63 -0
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +4 -2
- package/dist/core/runner/prepare-caps-and-workflow.js +2 -3
- package/dist/core/runner/prepare-config-doors.d.ts +3 -3
- package/dist/core/runner/prepare-config-doors.js +5 -2
- package/dist/core/runner/prepare-context-lane.d.ts +2 -2
- package/dist/core/runner/prepare-context-lane.js +2 -13
- package/dist/core/runner/prepare-file-history.d.ts +1 -1
- package/dist/core/runner/prepare-file-history.js +3 -52
- package/dist/core/runner/prepare-hands-readface.d.ts +4 -7
- package/dist/core/runner/prepare-hands-readface.js +3 -2
- package/dist/core/runner/prepare-inherited-gate.d.ts +5 -2
- package/dist/core/runner/prepare-inherited-gate.js +7 -8
- package/dist/core/runner/prepare-memory.d.ts +4 -6
- package/dist/core/runner/prepare-memory.js +4 -2
- package/dist/core/runner/prepare-policy-chain.d.ts +3 -3
- package/dist/core/runner/prepare-policy-chain.js +15 -30
- package/dist/core/runner/prepare-prompt-assembly.js +1 -1
- package/dist/core/runner/prepare-question-face.js +2 -1
- package/dist/core/runner/prepare-safety-scan.d.ts +1 -1
- package/dist/core/runner/prepare-suspend-saga.js +0 -2
- package/dist/core/runner/prepare-task.js +12 -11
- package/dist/core/runner/prepare-wiring-manifest.js +9 -7
- package/dist/core/runner/resume-admission.js +2 -1
- package/dist/core/runner/resume-internals-and-config.js +4 -0
- package/dist/core/runner/retired-runner-deps.d.ts +3 -0
- package/dist/core/runner/retired-runner-deps.js +7 -0
- package/dist/core/runner/run-harness-handlers.js +5 -3
- package/dist/core/runner/run-settle-and-teardown.d.ts +1 -1
- package/dist/core/runner/run-settle-and-teardown.js +3 -1
- package/dist/core/runner/session-file-state-replay.js +3 -3
- package/dist/core/runner/session-rule-policy.js +3 -4
- package/dist/core/runner/stream-halt-verbs.js +1 -1
- package/dist/core/runner/stream-steer-verb.js +1 -4
- package/dist/core/runner/workspace-path.js +3 -0
- package/dist/core/runner-deps.d.ts +30 -49
- package/dist/core/safe-notify.d.ts +1 -1
- package/dist/core/sensitive-path-policy.d.ts +1 -1
- package/dist/core/sensitive-path-policy.js +11 -12
- package/dist/core/session.d.ts +2 -2
- package/dist/core/skill-tool-specifier.d.ts +1 -1
- package/dist/core/skills-directory.d.ts +1 -1
- package/dist/core/skills-directory.js +4 -3
- package/dist/core/spec-contract.js +5 -4
- package/dist/core/store-contracts/checkpoint-store-contract.js +1 -1
- package/dist/core/strategy-store.d.ts +8 -11
- package/dist/core/task-event.d.ts +20 -17
- package/dist/core/task-limits.d.ts +1 -1
- package/dist/core/task-notification.d.ts +5 -5
- package/dist/core/task-registry-agent.d.ts +5 -5
- package/dist/core/task-registry-monitor.d.ts +2 -2
- package/dist/core/task-registry-shared.d.ts +32 -28
- package/dist/core/task-registry-shared.js +4 -13
- package/dist/core/task-registry.d.ts +8 -8
- package/dist/core/task-result.d.ts +37 -37
- package/dist/core/task-spec.d.ts +5 -5
- package/dist/core/task-stream.d.ts +16 -11
- package/dist/core/tool-catalog-entries.d.ts +1 -0
- package/dist/core/tool-catalog-entries.js +6 -1
- package/dist/core/tool-conformance.d.ts +0 -2
- package/dist/core/tool-conformance.js +1 -3
- package/dist/core/tool-errors.d.ts +5 -0
- package/dist/core/tool-errors.js +1 -0
- package/dist/core/tool-policy.d.ts +66 -22
- package/dist/core/tool-policy.js +31 -5
- package/dist/core/tool-result-budget.d.ts +1 -1
- package/dist/core/tool-result-store.d.ts +11 -11
- package/dist/core/tool-spec.d.ts +34 -38
- package/dist/core/tools.d.ts +2 -2
- package/dist/core/trace.d.ts +12 -15
- package/dist/core/untrusted-text.d.ts +1 -1
- package/dist/core/wiring-manifest.d.ts +4 -3
- package/dist/core/workflow-journal-store.d.ts +11 -11
- package/dist/engine/execution-env/node-execution-env.d.ts +3 -2
- package/dist/engine/execution-env/node-execution-env.js +8 -5
- package/dist/engine/harness/agent-harness.d.ts +47 -4
- package/dist/engine/harness/agent-harness.js +52 -9
- package/dist/engine/loop/agent-loop.js +15 -8
- package/dist/engine/loop/types.d.ts +5 -0
- package/dist/index.d.ts +20 -14
- package/dist/index.js +16 -10
- package/dist/internal/harness.d.ts +1 -0
- package/dist/orchestration/run-spec.d.ts +3 -0
- package/dist/orchestration/run-spec.js +3 -3
- package/dist/orchestration/run-workflow-tool.d.ts +12 -6
- package/dist/orchestration/run-workflow-tool.js +23 -5
- package/dist/orchestration/workflow-primitives.d.ts +4 -2
- package/dist/orchestration/workflow-primitives.js +1 -4
- package/dist/orchestration/workflow-script-store.js +9 -25
- package/dist/orchestration/workflow-types.d.ts +34 -4
- package/dist/orchestration/workflow-types.js +2 -0
- package/dist/orchestration/workflow.d.ts +39 -7
- package/dist/orchestration/workflow.js +237 -113
- package/dist/prompt-assembly/assemble.d.ts +2 -2
- package/dist/prompt-assembly/assemble.js +9 -9
- package/dist/prompt-assembly/composer.d.ts +6 -7
- package/dist/prompt-assembly/composer.js +10 -10
- package/dist/prompt-assembly/epoch.js +1 -1
- package/dist/prompt-assembly/event-registry.d.ts +0 -21
- package/dist/prompt-assembly/packs/sema-default.js +30 -30
- package/dist/prompt-assembly/types.d.ts +14 -14
- package/dist/prompts/coordinator.d.ts +0 -13
- package/dist/prompts/coordinator.js +0 -3
- package/dist/stores/cc/task-list-store.js +2 -10
- package/dist/stores/file/checkpoint-store.js +1 -5
- package/dist/stores/file/file-history-store.js +2 -2
- package/dist/stores/file/fs-atomic.d.ts +15 -18
- package/dist/stores/file/fs-atomic.js +4 -14
- package/dist/stores/file/mailbox-store.d.ts +7 -11
- package/dist/stores/file/mailbox-store.js +4 -11
- package/dist/stores/file/permission-rule-store.d.ts +4 -35
- package/dist/stores/file/permission-rule-store.js +4 -148
- package/dist/tools/artifact/artifact-text.d.ts +62 -0
- package/dist/tools/artifact/artifact-text.js +68 -0
- package/dist/tools/artifact/artifact-tool.d.ts +52 -0
- package/dist/tools/artifact/artifact-tool.js +351 -0
- package/dist/tools/artifact/local-stub.d.ts +26 -0
- package/dist/tools/artifact/local-stub.js +297 -0
- package/dist/tools/fs/bash-readonly-classifier.d.ts +90 -8
- package/dist/tools/fs/bash-readonly-classifier.js +294 -70
- package/dist/tools/fs/fs-bash.d.ts +14 -10
- package/dist/tools/fs/fs-bash.js +50 -33
- package/dist/tools/fs/fs-search-tools.js +5 -2
- package/dist/tools/fs/fs-shared.d.ts +2 -0
- package/dist/tools/fs/fs-shared.js +3 -11
- package/dist/tools/fs/index.d.ts +4 -0
- package/dist/tools/fs/index.js +4 -1
- package/dist/tools/fs/safety.d.ts +117 -1
- package/dist/tools/fs/safety.js +131 -31
- package/dist/tools/fs/search.js +8 -6
- package/package.json +2 -1
- package/test/export-surface.snapshot.json +119 -39
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export const PARK_TRUTH_UNREADABLE_REASONS = ["store_threw", "record_missing", "record_not_terminal", "parks_unreadable", "checkpoint_store_threw", "capability_not_armed"];
|
|
2
|
+
export const PARK_NOT_PENDING_STATUSES = ["resolved", "expired", "absent"];
|
|
1
3
|
export class WorkflowBudgetExceededError extends Error {
|
|
2
4
|
spent;
|
|
3
5
|
total;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { TSchema } from "typebox";
|
|
2
2
|
import type { InheritedGate, RunnerSelfSeat } from "../core/runner/contracts.js";
|
|
3
|
-
import type { CheckpointToken, ResumeOutcome } from "../core/checkpoint-store.js";
|
|
3
|
+
import type { CheckpointStore, CheckpointToken, ResumeOutcome } from "../core/checkpoint-store.js";
|
|
4
4
|
import type { AgentDefinition, TaskEvent, TaskResult, TaskSpec, ThinkingLevel } from "../core/types.js";
|
|
5
|
+
import { type ParentSpecSeat } from "../core/parent-spec-seat.js";
|
|
5
6
|
import type { WorkflowRunStore } from "../core/workflow-run-store.js";
|
|
6
7
|
import type { WorkflowJournalStore, ResumeClaimArgs } from "../core/workflow-journal-store.js";
|
|
7
8
|
import type { WorkflowRun, WorkflowEvent } from "./workflow-types.js";
|
|
@@ -123,9 +124,7 @@ export declare class WorkflowJournalIncompatibleError extends Error {
|
|
|
123
124
|
readonly fromRunId: string;
|
|
124
125
|
readonly ordinal: number;
|
|
125
126
|
readonly code = "workflow.journal_incompatible";
|
|
126
|
-
constructor(fromRunId: string, ordinal: number
|
|
127
|
-
/** #642: an alternative reason clause (the parked-row cross-check); absent ⇒ the no-terminal-cause wording. */
|
|
128
|
-
reason?: string);
|
|
127
|
+
constructor(fromRunId: string, ordinal: number);
|
|
129
128
|
}
|
|
130
129
|
/**
|
|
131
130
|
* A TRUSTED, run-scoped internal channel carrying the workflow **nesting depth** across a process boundary
|
|
@@ -292,11 +291,16 @@ export interface WorkflowRunContext {
|
|
|
292
291
|
* the checkpoint token the wa* row is parked on (the row's `parkedCheckpointToken`, the redemption key), the
|
|
293
292
|
* caller's decision for it (the same {@link ResumeOutcome} a top-level `runner.resume` takes), and the optional
|
|
294
293
|
* cross-process re-supply of the checkpoint's opaque parent constraints. The token is matched by string equality
|
|
295
|
-
* against the
|
|
294
|
+
* against the parked ordinal's token — an ordinal whose token no entry names re-parks.
|
|
295
|
+
*
|
|
296
|
+
* `outcome` is OPTIONAL. `{ token, outcome }` is a DECISION: a pending checkpoint is driven with it; one the store no
|
|
297
|
+
* longer calls pending is settled (the acknowledgement is implied). `{ token }` alone is an ACKNOWLEDGEMENT: it settles an
|
|
298
|
+
* ordinal whose checkpoint is resolved / expired / absent as a failed row (`workflow.park_not_pending`) so the script
|
|
299
|
+
* continues; if the re-read finds the checkpoint pending again it RE-PARKS — an acknowledgement never authorizes a drive.
|
|
296
300
|
*/
|
|
297
301
|
export interface WorkflowParkedResume {
|
|
298
302
|
token: CheckpointToken;
|
|
299
|
-
outcome
|
|
303
|
+
outcome?: ResumeOutcome;
|
|
300
304
|
inheritedGate?: InheritedGate;
|
|
301
305
|
}
|
|
302
306
|
export interface RunWorkflowOptions {
|
|
@@ -468,9 +472,37 @@ export interface RunWorkflowOptions {
|
|
|
468
472
|
* parked child on with the caller's decision ({@link parkedResume}). Tighten-only: a park capability,
|
|
469
473
|
* never a widening — the decision stays with a person. REQUIRES {@link store} (the wa* row's durable home;
|
|
470
474
|
* refused loudly at entry without it). Threaded by the Workflow tool from the host's trusted seat; a
|
|
471
|
-
* directly-started workflow passes its own. NOT call identity.
|
|
475
|
+
* directly-started workflow passes its own. NOT call identity. REQUIRES {@link checkpointStore} as well: a
|
|
476
|
+
* durable approval whose checkpoint this workflow cannot read back is a park no resume can prove.
|
|
472
477
|
*/
|
|
473
478
|
defaultDurableApproval?: TaskSpec["durableApproval"];
|
|
479
|
+
/**
|
|
480
|
+
* The HOST run's parent SPEC seat ({@link import("../core/parent-spec-seat.js").ParentSpecSeat}: principal / oneShot /
|
|
481
|
+
* clientContext / the frozen question face / the fs-fence widening / envFacts / the declared persistence statement),
|
|
482
|
+
* applied onto every spawned agent at the launch site AFTER the agentType fold by {@link applyParentSpecSeat} — the
|
|
483
|
+
* Task delegation lane's one law: a value the child spec carries (script, definition, baseline) WINS, the seat FILLS
|
|
484
|
+
* an unset one, the two removals (`oneShot: true`, `memoryPersistenceCapable: false`) land unconditionally. Threaded
|
|
485
|
+
* by the Workflow tool from the host's seat; a directly-started workflow passes its own. NOT call identity (host
|
|
486
|
+
* wiring, like the checkpoint seat). Absent ⇒ nothing is applied. The seat the Workflow tool threads carries NO
|
|
487
|
+
* `onQuestion`: the tool strips the host's per-request face (every agent it spawns outlives the launching request)
|
|
488
|
+
* and says so through {@link questionFaceStripped}; a directly-started workflow passes what its own lifetime allows.
|
|
489
|
+
*/
|
|
490
|
+
parentSpecSeat?: ParentSpecSeat;
|
|
491
|
+
/** The engine stripped the spawn turn's per-request question face from the seat above (pair-produced with the strip,
|
|
492
|
+
* `stripSpawnTurnQuestionFace`); rides every spawned agent's internals as `RunInternals.questionFaceStripped` — the
|
|
493
|
+
* wiring manifest's `question.wired: "stripped_bg_lane"` and the posture door's exemption read it. */
|
|
494
|
+
questionFaceStripped?: true;
|
|
495
|
+
/**
|
|
496
|
+
* The checkpoint store this run's children park in — the RESOLVED seat object itself (the same value the Workflow
|
|
497
|
+
* tool injects onto every child spec; a directly-started workflow passes the store its children park in). Its
|
|
498
|
+
* presence ARMS the park lane: a resume then proves every parked ordinal against `get(token)` before anything is
|
|
499
|
+
* dispatched (`WorkflowRun.parks` supplies the keys), and a child whose effective `checkpointStore` is a DIFFERENT
|
|
500
|
+
* object is refused at spawn (`config.invalid_checkpoint_store` — identity, not duck-typing: a caller-built `{get}`
|
|
501
|
+
* wrapper is not the seat). REQUIRES {@link store} (the park's durable row). Absent ⇒ the lane is not armed: a
|
|
502
|
+
* resume of a run that recorded parks is refused (`workflow.park_truth_unreadable` / `capability_not_armed`), a run
|
|
503
|
+
* without parks resumes as before. NOT call identity (deployment wiring, like the store seats).
|
|
504
|
+
*/
|
|
505
|
+
checkpointStore?: CheckpointStore;
|
|
474
506
|
/**
|
|
475
507
|
* #642 — the decisions a resume ({@link resumeFromRunId}) carries for PARKED ordinals of the prior run: at
|
|
476
508
|
* an ordinal whose journal entry is `parked` (a matching call key), the run drives the parked child's own
|