@sema-agent/core 7.17.7 → 7.18.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.
Files changed (163) hide show
  1. package/CHANGELOG.md +140 -13
  2. package/dist/agents/send-message-tool.js +1 -0
  3. package/dist/agents/subagent.d.ts +1 -0
  4. package/dist/agents/subagent.js +5 -0
  5. package/dist/agents/teacher.js +1 -0
  6. package/dist/agents/verify.js +3 -0
  7. package/dist/brain/route-adjudicator.d.ts +18 -0
  8. package/dist/brain/route-adjudicator.js +16 -0
  9. package/dist/core/agent-definition.d.ts +10 -0
  10. package/dist/core/artifact-host.d.ts +41 -4
  11. package/dist/core/artifact-host.js +18 -2
  12. package/dist/core/auto-mode.d.ts +141 -45
  13. package/dist/core/auto-mode.js +109 -3
  14. package/dist/core/checkpoint-store.d.ts +16 -2
  15. package/dist/core/engine-notice.d.ts +47 -1
  16. package/dist/core/engine-notice.js +7 -0
  17. package/dist/core/gate-lanes.js +2 -1
  18. package/dist/core/gate-outcome.d.ts +17 -2
  19. package/dist/core/gate-outcome.js +16 -0
  20. package/dist/core/governance-codes.d.ts +1 -1
  21. package/dist/core/governance-codes.js +8 -0
  22. package/dist/core/hook-seats.d.ts +66 -0
  23. package/dist/core/hook-seats.js +37 -0
  24. package/dist/core/runner/advertised-writable-dirs.d.ts +8 -3
  25. package/dist/core/runner/assemble-result.d.ts +2 -1
  26. package/dist/core/runner/assemble-result.js +1 -1
  27. package/dist/core/runner/classifier-ladder.d.ts +89 -0
  28. package/dist/core/runner/classifier-ladder.js +65 -0
  29. package/dist/core/runner/contracts.d.ts +69 -13
  30. package/dist/core/runner/decide-continuation.d.ts +1 -3
  31. package/dist/core/runner/decide-continuation.js +1 -7
  32. package/dist/core/runner/deferral-census.d.ts +52 -0
  33. package/dist/core/runner/deferral-census.js +44 -0
  34. package/dist/core/runner/derived-route-fallback.d.ts +8 -4
  35. package/dist/core/runner/derived-route-fallback.js +8 -3
  36. package/dist/core/runner/gate-exit.d.ts +12 -0
  37. package/dist/core/runner/gate-exit.js +6 -3
  38. package/dist/core/runner/prepare-artifact.d.ts +10 -2
  39. package/dist/core/runner/prepare-artifact.js +5 -4
  40. package/dist/core/runner/prepare-caps-and-workflow.d.ts +4 -2
  41. package/dist/core/runner/prepare-caps-and-workflow.js +30 -31
  42. package/dist/core/runner/prepare-config-doors.d.ts +1 -1
  43. package/dist/core/runner/prepare-config-doors.js +5 -3
  44. package/dist/core/runner/prepare-defer-classify.d.ts +13 -19
  45. package/dist/core/runner/prepare-defer-classify.js +8 -3
  46. package/dist/core/runner/prepare-gate-stations.d.ts +26 -0
  47. package/dist/core/runner/prepare-gate-stations.js +1 -1
  48. package/dist/core/runner/prepare-hands-readface.d.ts +24 -7
  49. package/dist/core/runner/prepare-hands-readface.js +60 -24
  50. package/dist/core/runner/prepare-inherited-gate.d.ts +17 -4
  51. package/dist/core/runner/prepare-inherited-gate.js +10 -2
  52. package/dist/core/runner/prepare-lsp.d.ts +2 -2
  53. package/dist/core/runner/prepare-lsp.js +1 -1
  54. package/dist/core/runner/prepare-policy-chain.js +2 -0
  55. package/dist/core/runner/prepare-project-context.js +4 -2
  56. package/dist/core/runner/prepare-prompt-inputs.d.ts +4 -2
  57. package/dist/core/runner/prepare-prompt-inputs.js +4 -1
  58. package/dist/core/runner/prepare-run-refs.d.ts +9 -1
  59. package/dist/core/runner/prepare-run-refs.js +3 -2
  60. package/dist/core/runner/prepare-suspend-saga.d.ts +5 -0
  61. package/dist/core/runner/prepare-suspend-saga.js +5 -2
  62. package/dist/core/runner/prepare-task.js +18 -13
  63. package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +5 -0
  64. package/dist/core/runner/prepare-tool-disclosure-mount.js +10 -2
  65. package/dist/core/runner/prepare-turn-wiring.d.ts +8 -4
  66. package/dist/core/runner/prepare-turn-wiring.js +3 -2
  67. package/dist/core/runner/prepare-wiring-manifest.d.ts +5 -5
  68. package/dist/core/runner/prepare-wiring-manifest.js +5 -2
  69. package/dist/core/runner/resume-checkpoint-screen.js +7 -0
  70. package/dist/core/runner/run-harness-handlers.js +4 -1
  71. package/dist/core/runner/run-identity-wiring.js +6 -2
  72. package/dist/core/runner/run-leg.d.ts +2 -0
  73. package/dist/core/runner/run-leg.js +35 -41
  74. package/dist/core/runner/run-notification-lane.js +55 -27
  75. package/dist/core/runner/run-settle-and-teardown.js +1 -0
  76. package/dist/core/runner/run-terminal-adoption.js +16 -13
  77. package/dist/core/runner/run-turn-boundary.js +3 -1
  78. package/dist/core/runner/runtask.d.ts +6 -5
  79. package/dist/core/runner/runtask.js +26 -14
  80. package/dist/core/runner/skill-base-dir.d.ts +54 -0
  81. package/dist/core/runner/skill-base-dir.js +42 -0
  82. package/dist/core/runner/synthetic-tools.d.ts +16 -19
  83. package/dist/core/runner/synthetic-tools.js +18 -10
  84. package/dist/core/runner/tool-defer-gate.d.ts +22 -9
  85. package/dist/core/runner/tool-defer-gate.js +15 -5
  86. package/dist/core/runner/tool-disclosure.d.ts +5 -0
  87. package/dist/core/runner/tool-disclosure.js +2 -0
  88. package/dist/core/runner/tool-progress-lane.d.ts +42 -0
  89. package/dist/core/runner/tool-progress-lane.js +61 -0
  90. package/dist/core/runner-deps.d.ts +48 -7
  91. package/dist/core/swappable-deps.d.ts +9 -7
  92. package/dist/core/swappable-deps.js +7 -3
  93. package/dist/core/task-event.d.ts +96 -29
  94. package/dist/core/task-notification.d.ts +142 -16
  95. package/dist/core/task-notification.js +106 -0
  96. package/dist/core/task-result.d.ts +9 -1
  97. package/dist/core/task-spec.d.ts +20 -3
  98. package/dist/core/tighten-task-spec.js +7 -5
  99. package/dist/core/tool-model-gate.d.ts +1 -1
  100. package/dist/core/tool-search-setting.d.ts +78 -0
  101. package/dist/core/tool-search-setting.js +90 -0
  102. package/dist/core/tool-spec.d.ts +8 -0
  103. package/dist/core/types.d.ts +1 -1
  104. package/dist/core/types.js +1 -1
  105. package/dist/core/wiring-manifest.d.ts +46 -0
  106. package/dist/core/wiring-manifest.js +9 -1
  107. package/dist/engine/execution-env/node-execution-env.js +10 -4
  108. package/dist/engine/harness/agent-harness.d.ts +42 -0
  109. package/dist/engine/harness/agent-harness.js +61 -29
  110. package/dist/engine/loop/agent-loop.d.ts +68 -3
  111. package/dist/engine/loop/agent-loop.js +109 -16
  112. package/dist/index.d.ts +10 -5
  113. package/dist/index.js +9 -5
  114. package/dist/internal/harness.d.ts +1 -1
  115. package/dist/orchestration/run-workflow-tool.d.ts +3 -0
  116. package/dist/orchestration/run-workflow-tool.js +6 -1
  117. package/dist/orchestration/workflow-governance.d.ts +7 -1
  118. package/dist/orchestration/workflow-governance.js +9 -5
  119. package/dist/orchestration/workflow-primitives.d.ts +3 -0
  120. package/dist/orchestration/workflow-primitives.js +6 -1
  121. package/dist/orchestration/workflow-types.d.ts +48 -13
  122. package/dist/orchestration/workflow-types.js +1 -1
  123. package/dist/orchestration/workflow.js +45 -17
  124. package/dist/prompt-assembly/epoch.js +2 -0
  125. package/dist/prompt-assembly/packs/sema-default.js +2 -2
  126. package/dist/prompt-assembly/section-usage.d.ts +26 -0
  127. package/dist/prompt-assembly/section-usage.js +10 -0
  128. package/dist/prompt-assembly/types.d.ts +8 -6
  129. package/dist/prompts/default.d.ts +13 -0
  130. package/dist/prompts/default.js +16 -8
  131. package/dist/tools/artifact/artifact-text.d.ts +10 -1
  132. package/dist/tools/artifact/artifact-text.js +6 -3
  133. package/dist/tools/artifact/artifact-tool.d.ts +12 -2
  134. package/dist/tools/artifact/artifact-tool.js +203 -70
  135. package/dist/tools/artifact/conformance.d.ts +56 -0
  136. package/dist/tools/artifact/conformance.js +349 -0
  137. package/dist/tools/artifact/local-stub.js +1 -1
  138. package/dist/tools/artifact/reject-breaker.d.ts +28 -0
  139. package/dist/tools/artifact/reject-breaker.js +42 -0
  140. package/dist/tools/fs/bash-lexer.d.ts +132 -0
  141. package/dist/tools/fs/bash-lexer.js +563 -0
  142. package/dist/tools/fs/bash-program-position.d.ts +142 -0
  143. package/dist/tools/fs/bash-program-position.js +125 -0
  144. package/dist/tools/fs/bash-readonly-classifier.d.ts +54 -16
  145. package/dist/tools/fs/bash-readonly-classifier.js +121 -552
  146. package/dist/tools/fs/containment-face.d.ts +89 -0
  147. package/dist/tools/fs/containment-face.js +81 -0
  148. package/dist/tools/fs/fs-bash.d.ts +46 -1
  149. package/dist/tools/fs/fs-bash.js +158 -22
  150. package/dist/tools/fs/fs-read.d.ts +1 -1
  151. package/dist/tools/fs/fs-search-tools.d.ts +3 -3
  152. package/dist/tools/fs/fs-write.d.ts +4 -3
  153. package/dist/tools/fs/fs-write.js +9 -9
  154. package/dist/tools/fs/index.d.ts +24 -5
  155. package/dist/tools/fs/index.js +18 -6
  156. package/dist/tools/fs/repo-map.d.ts +2 -2
  157. package/dist/tools/fs/safety.d.ts +3 -3
  158. package/dist/tools/fs/safety.js +4 -4
  159. package/package.json +1 -1
  160. package/test/export-surface.snapshot.json +85 -9
  161. package/wire-changes/core@7.17.7.json +49 -0
  162. package/dist/tools/fs/read-face.d.ts +0 -68
  163. package/dist/tools/fs/read-face.js +0 -47
@@ -0,0 +1,49 @@
1
+ {
2
+ "repo": "core",
3
+ "version": "7.17.7",
4
+ "from": "adb5afdddf8b01be7b9b8a8394251eea7fe2ee19",
5
+ "to": "d45dba221924363df3176b96550267398c24e26b",
6
+ "added": [],
7
+ "removed": [],
8
+ "changed": [],
9
+ "narrowed": [
10
+ {
11
+ "id": "F1",
12
+ "source": "behaviorFlips.summary",
13
+ "text": "Narrowing — an INTERPRETER whose program is argument text is the argument-as-program family's fourth member (#791; B-120; test [7227]): one table (26 rows: perl / ruby / python / node / php / lua / tclsh / wish / expect / awk family / jq / bc / dc / sqlite3 / psql / osascript / Rscript / julia / ghci / groovy / bun) declares per interpreter how its program arrives — text-valued options (`-e`/`-c`/`--eval`/`-r`/`-p`), bundle letters (`-pe`/`-lne`/`-0777e`), the program OPERAND (awk program, jq filter, the SQL after a database) and the `stdin when unnamed` rule — and the presence of such a program refuses the whole command through the family's existing mint (`unjudgedProgramTextRefusal`). What is judged is PRESENCE, never CONTENT."
14
+ },
15
+ {
16
+ "id": "F2",
17
+ "source": "behaviorFlips.summary",
18
+ "text": "Narrowing — ONE launcher option grammar, read by every reader that has to find the program word (#792; B-120; test [7227]): `LAUNCHER_OPTION_GRAMMAR` (time's `-p`/`-f <fmt>`/`-o <file>`/`-a`/`-v`) was read by the boundary walk and by the single-command boundary face but NOT by the whitelist's head scan, `argvReentryUnjudged`, nor the bounded poll loop's base-move reader; `time -p xargs cat <<< <path>` therefore fell through the argv re-entry member that `xargs cat <<< <path>` had been refused by since 7.17.5."
19
+ },
20
+ {
21
+ "id": "F3",
22
+ "source": "behaviorFlips.summary",
23
+ "text": "Narrowing — an APPLET DISPATCHER is a launcher and the shell re-entry member is spelled by every shell (#791 complement pass, ruled arm 3): `busybox` joins `COMMAND_LAUNCHERS` (already on the rule lane's curated interpreter table, so the pinned subset relation holds) and `SHELL_REENTRY_PROGRAM_RE` gains `ash|mksh|yash|pdksh` (+ `csh|tcsh` from the receipt round)."
24
+ }
25
+ ],
26
+ "closedSetMembers": [],
27
+ "typeKeys": [],
28
+ "declarationMoves": [],
29
+ "mintMoves": [],
30
+ "criteriaObserves": [
31
+ {
32
+ "kind": "typeMember",
33
+ "name": "AskRequest.ruleOffersAbsence",
34
+ "assertions": [
35
+ "G1.a",
36
+ "G2.a",
37
+ "G3.a"
38
+ ]
39
+ }
40
+ ],
41
+ "consumersHint": {
42
+ "cli": [],
43
+ "server": [],
44
+ "sdk": [],
45
+ "note": "scanned cli@f985d9cb server@4406f7fd sdk@6910789 — a name listed is MENTIONED there today, which is evidence of consumption, not proof of it"
46
+ },
47
+ "breakingCount": 0,
48
+ "breakingItems": []
49
+ }
@@ -1,68 +0,0 @@
1
- /** The read-face containment state. `"roots"` = the containment judgment runs.
2
- * `"open"` = the containment step is skipped (canonicalization, deny set, UNC out-of-set refusal
3
- * and the type gates all still run). */
4
- export type ReadFace = "open" | "roots";
5
- /** Loud value gate: a `readFace` seat carries exactly "open" | "roots" — anything else (case
6
- * variants, truthy garbage) refuses at wiring time, never folds to a default. Exported
7
- * module-internally (not on the package surface) so prepare's unconditional config-guard leg can
8
- * screen the seats on runs that never mount hands. The resolver itself also runs on every hands-less
9
- * leg; this screen still fires first, so a garbage value refuses before any leg-shape branching. */
10
- export declare function assertReadFaceValue(v: unknown, seat: string): ReadFace | undefined;
11
- /** Inputs to {@link resolveReadFace} — all structural/declaration facts, never permission modes
12
- * (a deliberate axis separation: this shape carries facts, not verdicts). */
13
- export interface ReadFaceInputs {
14
- /** TaskSpec.readFace (raw — validated here). The TASK layer: may only tighten under governance. */
15
- specReadFace?: unknown;
16
- /** RunnerDeps.readFace / HandsToolkitOptions.readFace (raw) — the DEPLOYMENT's own declaration. */
17
- depsReadFace?: unknown;
18
- /** The verifier read-only mount (`handsReadOnly` / toolkit `readOnly`): its containment is a
19
- * LOAD-BEARING wall (bash_readonly is genuinely confined by it) — never openable. */
20
- readOnlyMount: boolean;
21
- /** Org governance declared (`RunnerDeps.permissionRuleStore.partitions.org === true`): default roots; the task layer
22
- * may not open (tighten-only under governance; the deps layer, being the deployment's own
23
- * declaration, still may). */
24
- orgGoverned: boolean;
25
- /** Is the FULL shell (`core.bash@1`) structurally reachable on this mount? Computed BEFORE
26
- * tool-band assembly from spec-time facts (env kind / handsReadOnly / Bash exclusion — every
27
- * exclusion source is spec-time-frozen, so this is always computable). When false, the roots fence
28
- * is the ONLY read boundary, so no IMPLICIT default may open the face; an EXPLICIT "open" on
29
- * either seat still wins (row 4 of the order is a default, not a clamp). */
30
- fullShellReachable: boolean;
31
- /** Observation hook for the ONE silent branch of the order: row 1's deployment-seat clamp
32
- * (readOnly mount + deps "open" + NO task seat). Fired exactly when the deps declaration was the
33
- * deciding seat and the mount overrode it — not when a task-level "roots" pinned the same value
34
- * anyway (the mount changed nothing there, and announcing it would claim a false cause), and
35
- * never on the throw rows (those are already loud). The resolver stays the single owner of the
36
- * clamp predicate; stations own delivery/dedup ({@link deploymentReadFaceClampNotice}). */
37
- onDeploymentClamp?: () => void;
38
- }
39
- /**
40
- * The ONE resolution order, first hit wins. prepare-task AND createHandsToolkit both call this — a
41
- * library-direct mount gets identical validation and identical defaults.
42
- *
43
- * 1. read-only (verifier) mount → ROOTS; an explicit "open" on the TASK seat is a genuine
44
- * per-call CONTRADICTION and refuses loudly (never silently pick a side). An "open" on the
45
- * DEPLOYMENT seat alone is a deployment-wide default, not a per-task assertion — it silently
46
- * CLAMPS to roots (stricter-wins), the same seat distinction row 2 draws for org governance.
47
- * 2. org-governed: TaskSpec "open" refuses (task layer only tightens); deps "open" wins;
48
- * otherwise ROOTS.
49
- * 3. explicit seat: spec ?? deps.
50
- * 4. bash-less mount: ROOTS (the fence is the only read boundary there — "the fence guards
51
- * nothing bash reaches anyway" does not hold, so no implicit default may open it).
52
- * 5. default: ROOTS — the engine never opens implicitly.
53
- */
54
- export declare function resolveReadFace(i: ReadFaceInputs): ReadFace;
55
- /**
56
- * The ONE text of the deployment-clamp announcement (`config.read_face_deployment_clamped`).
57
- * Both stations deliver THIS object through their own `deliverEngineNotice` call (prepare-task with
58
- * the `RunnerDeps.onNotice` seat, once per notice sink — the sink, not the deps object, because the
59
- * Runner rebuilds its deps; `createHandsToolkit` with its band-local `HandsToolkitOptions.onNotice`
60
- * seat — toolkit creation is itself the one-per-mount boot moment, and an absent seat prints the
61
- * same line via `console.warn`). Built here, import-free, so the message can never fork between
62
- * the stations.
63
- */
64
- export declare function deploymentReadFaceClampNotice(): {
65
- code: string;
66
- message: string;
67
- detail: Record<string, unknown>;
68
- };
@@ -1,47 +0,0 @@
1
- export function assertReadFaceValue(v, seat) {
2
- if (v === undefined)
3
- return undefined;
4
- if (v === "open" || v === "roots")
5
- return v;
6
- const e = new Error(`${seat}: invalid readFace value ${JSON.stringify(v)} — expected "open" or "roots" (bad values refuse loudly; nothing falls back to a default).`);
7
- e.code = "config.read_face_invalid";
8
- throw e;
9
- }
10
- export function resolveReadFace(i) {
11
- const spec = assertReadFaceValue(i.specReadFace, "TaskSpec.readFace");
12
- const deps = assertReadFaceValue(i.depsReadFace, "readFace (deployment seat)");
13
- if (i.readOnlyMount) {
14
- if (spec === "open") {
15
- const e = new Error(`readFace: "open" contradicts the read-only (verifier) mount — that mount's containment is load-bearing (its read-only shell face is confined by it) and is never openable. Drop the readFace declaration or the readOnly mount.`);
16
- e.code = "config.read_face_readonly_conflict";
17
- throw e;
18
- }
19
- if (deps === "open" && spec === undefined)
20
- i.onDeploymentClamp?.();
21
- return "roots";
22
- }
23
- if (i.orgGoverned) {
24
- if (spec === "open") {
25
- const e = new Error(`TaskSpec.readFace: "open" is refused under organization governance — the task layer may only tighten (set RunnerDeps.readFace: "open" if the DEPLOYMENT declares the open read face).`);
26
- e.code = "config.read_face_org_task_escalation";
27
- throw e;
28
- }
29
- if (spec === "roots")
30
- return "roots";
31
- return deps ?? "roots";
32
- }
33
- if (spec !== undefined)
34
- return spec;
35
- if (deps !== undefined)
36
- return deps;
37
- if (!i.fullShellReachable)
38
- return "roots";
39
- return "roots";
40
- }
41
- export function deploymentReadFaceClampNotice() {
42
- return {
43
- code: "config.read_face_deployment_clamped",
44
- message: `readFace (deployment seat): the deployment-wide "open" declaration is not in force on this read-only (verifier) mount — clamped to "roots" (stricter-wins: the mount's containment is load-bearing and never openable). Other mounts still honor "open".`,
45
- detail: { seat: "readFace (deployment seat)", declared: "open", inForce: "roots", cause: "read_only_mount" },
46
- };
47
- }