@sema-agent/core 7.0.2 → 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.
Files changed (66) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/dist/agents/cross-session-envelope.d.ts +138 -0
  3. package/dist/agents/cross-session-envelope.js +191 -0
  4. package/dist/agents/cross-session-judge.d.ts +119 -0
  5. package/dist/agents/cross-session-judge.js +184 -0
  6. package/dist/agents/cross-session-ref.d.ts +52 -0
  7. package/dist/agents/cross-session-ref.js +64 -0
  8. package/dist/agents/repair-loop.d.ts +8 -7
  9. package/dist/agents/roster-store.d.ts +7 -2
  10. package/dist/agents/send-message-tool.d.ts +13 -0
  11. package/dist/agents/send-message-tool.js +36 -12
  12. package/dist/brain/errors.d.ts +18 -0
  13. package/dist/brain/errors.js +3 -0
  14. package/dist/brain/stream-engine.js +6 -4
  15. package/dist/core/checkpoint-store.d.ts +189 -3
  16. package/dist/core/checkpoint-store.js +56 -16
  17. package/dist/core/context-edit.d.ts +3 -0
  18. package/dist/core/governance-codes.d.ts +1 -1
  19. package/dist/core/governance-codes.js +4 -0
  20. package/dist/core/hooks.d.ts +34 -7
  21. package/dist/core/hooks.js +14 -8
  22. package/dist/core/image-downsample.d.ts +4 -3
  23. package/dist/core/permission-rule-consent.d.ts +72 -23
  24. package/dist/core/permission-rule-consent.js +115 -26
  25. package/dist/core/permission-rule-model.d.ts +245 -51
  26. package/dist/core/permission-rule-model.js +312 -54
  27. package/dist/core/permission-rule-org.js +13 -6
  28. package/dist/core/remote-env.d.ts +8 -1
  29. package/dist/core/roles.d.ts +30 -8
  30. package/dist/core/roles.js +12 -8
  31. package/dist/core/runner/assemble-result.js +2 -1
  32. package/dist/core/runner/prepare-task.d.ts +41 -2
  33. package/dist/core/runner/prepare-task.js +353 -152
  34. package/dist/core/runner/prepare-workspace-restore.d.ts +6 -1
  35. package/dist/core/runner/prepare-workspace-restore.js +2 -1
  36. package/dist/core/runner/runtask.d.ts +12 -3
  37. package/dist/core/runner/runtask.js +45 -7
  38. package/dist/core/safety-axis-vocab.d.ts +1 -1
  39. package/dist/core/strategy-store.d.ts +4 -1
  40. package/dist/core/task-notification.d.ts +64 -5
  41. package/dist/core/task-notification.js +25 -4
  42. package/dist/core/task-registry-shared.d.ts +7 -3
  43. package/dist/core/tool-errors.d.ts +1 -1
  44. package/dist/core/tool-policy.d.ts +51 -7
  45. package/dist/core/tool-policy.js +63 -9
  46. package/dist/core/types.d.ts +110 -9
  47. package/dist/core/untrusted-text.js +17 -1
  48. package/dist/engine/compaction/compaction.js +6 -2
  49. package/dist/engine/harness/agent-harness.d.ts +28 -6
  50. package/dist/engine/harness/agent-harness.js +34 -2
  51. package/dist/engine/harness/messages.js +4 -0
  52. package/dist/engine/harness/types.d.ts +37 -0
  53. package/dist/engine/harness/types.js +5 -0
  54. package/dist/engine/session/session.js +3 -2
  55. package/dist/index.d.ts +6 -3
  56. package/dist/index.js +5 -2
  57. package/dist/internal/harness.d.ts +1 -0
  58. package/dist/internal/harness.js +1 -0
  59. package/dist/orchestration/builtin-workflows.d.ts +17 -9
  60. package/dist/orchestration/run-workflow-tool.js +7 -2
  61. package/dist/orchestration/workflow-governance.js +1 -1
  62. package/dist/orchestration/workflow-types.d.ts +1 -0
  63. package/dist/orchestration/workflow.js +1 -1
  64. package/dist/stores/file/mailbox-store.d.ts +2 -1
  65. package/package.json +1 -1
  66. package/test/export-surface.snapshot.json +125 -1
@@ -22,12 +22,17 @@ import type { NamedWorkflowListing } from "./workflow-script-store.js";
22
22
  /** The built-in round-based discussion workflow's registered name. */
23
23
  export declare const DISCUSSION_WORKFLOW_NAME = "discussion";
24
24
  /**
25
- * The registered name this built-in carried before the C-R14 vocabulary ruling (2026-08-16), kept
26
- * resolvable for ONE minor: "team" now names the agent-teams family (persistent named teammates) only,
27
- * and a one-off multi-agent debate is a "discussion".
25
+ * The registered name this built-in carried before the C-R14 vocabulary ruling (2026-08-16): "team" now
26
+ * names the agent-teams family (persistent named teammates) only, and a one-off multi-agent debate is a
27
+ * "discussion".
28
28
  *
29
- * @deprecated Use {@link DISCUSSION_WORKFLOW_NAME}. Removed in the next minor; the retired spelling still
30
- * RESOLVES via {@link canonicalWorkflowName} until then, but the listing/card face shows the new name only.
29
+ * RETENTION, as a fact rather than a plan: the ruling's original "kept resolvable for ONE minor" window
30
+ * LAPSED. The alias has stayed on the public export surface from the 5.37.0 window through 7.x, across
31
+ * BOTH the 6.0.0 and 7.0.0 BREAKING windows. It is therefore retained until a removal is announced in a
32
+ * named BREAKING window's ship post — no minor removes it by default.
33
+ *
34
+ * @deprecated Use {@link DISCUSSION_WORKFLOW_NAME}. The retired spelling still RESOLVES via
35
+ * {@link canonicalWorkflowName}, but the listing/card face shows the new name only.
31
36
  */
32
37
  export declare const TEAM_DISCUSSION_WORKFLOW_NAME = "discussion";
33
38
  /**
@@ -35,7 +40,8 @@ export declare const TEAM_DISCUSSION_WORKFLOW_NAME = "discussion";
35
40
  * retired alias. The canonical name is the authority: a resolution reached through an alias returns the
36
41
  * canonical definition (its `meta.name`, hence every run/card projection, is the new name).
37
42
  *
38
- * @deprecated together with the alias table — this becomes an identity function next minor (C-R14).
43
+ * @deprecated together with the alias table — it becomes an identity function when that table is removed
44
+ * in an announced BREAKING window (C-R14).
39
45
  */
40
46
  export declare function canonicalWorkflowName(name: string): string;
41
47
  /**
@@ -72,7 +78,8 @@ export declare function retiredWorkflowNameAliases(canonicalName: string): strin
72
78
  * Callers must apply the deployment's `builtinWorkflows` opt-out BEFORE using this: the equivalence is a
73
79
  * fact about the built-in registry, so a deployment that removed the built-ins removed the alias with them.
74
80
  *
75
- * @deprecated together with the alias table — collapses to `[requested]` next minor (C-R14).
81
+ * @deprecated together with the alias table — collapses to `[requested]` when that table is removed in an
82
+ * announced BREAKING window (C-R14).
76
83
  */
77
84
  export declare function workflowNameProbeOrder(requested: string): string[];
78
85
  /**
@@ -82,8 +89,9 @@ export declare function workflowNameProbeOrder(requested: string): string[];
82
89
  */
83
90
  export declare const DISCUSSION_SCRIPT = "export const meta = {\n name: \"discussion\",\n description: \"Round-based discussion: configurable members debate a topic across rounds (each member sees the transcript so far), then a finalizer synthesizes a structured verdict.\",\n whenToUse: \"Use for a genuinely contested question that benefits from several perspectives arguing across rounds - design trade-offs, plan or risk reviews, adversarial critique of a proposal. Do NOT use it for a single factual question, a task with one obvious answer, or a budget-sensitive run: every round costs one agent call per member, so a discussion is never cheaper than asking once. args (all optional): { topic, members?: [{ role, prompt?, model? }], rounds?, finalizer?: { prompt?, model? } }. Hard ceilings: members is capped at 6 and rounds is capped at 5 regardless of what you pass; the run reports it via log() and a capped field on the result when a request exceeds either.\",\n phases: [\n { title: \"Discussion\" },\n { title: \"Synthesis\" },\n ],\n};\n// Zero-config runnable (design/140 \u00A76 1c): every arg has an opinionated fallback.\nconst raw = args;\nconst a = raw !== null && typeof raw === \"object\" && !Array.isArray(raw) ? raw : {};\nconst topic =\n typeof a.topic === \"string\" && a.topic.trim() !== \"\"\n ? a.topic\n : typeof raw === \"string\" && raw.trim() !== \"\"\n ? raw // ergonomic form: a bare string args IS the topic\n : \"No topic was provided. Discuss: what information should a caller supply to make a discussion like this productive, and when should they NOT convene one?\";\nconst defaultMembers = [\n { role: \"advocate\", prompt: \"Make the strongest constructive case. Propose concrete options and argue their benefits with specifics.\" },\n { role: \"skeptic\", prompt: \"Stress-test every claim made so far. Surface risks, hidden costs, failure modes, and cheaper alternatives.\" },\n];\nconst rawMembers = Array.isArray(a.members) && a.members.length > 0 ? a.members : defaultMembers;\nconst members = rawMembers.slice(0, 6).map((m, i) => {\n const mm = m !== null && typeof m === \"object\" ? m : {};\n const member = {\n role: typeof mm.role === \"string\" && mm.role.trim() !== \"\" ? mm.role : \"member-\" + (i + 1),\n prompt: typeof mm.prompt === \"string\" && mm.prompt.trim() !== \"\" ? mm.prompt : \"Contribute your own distinct perspective: be concrete, give reasons, and engage with what others said.\",\n };\n if (typeof mm.model === \"string\" && mm.model.trim() !== \"\") member.model = mm.model;\n // Slot-tools carrier (design/140 \u2461-3 + F4): a member may BE a registered agent type ({agent:\"reviewer\"}) \u2014\n // persona/tools/model then come from the deployment's AgentDefinition (role library), args stay thin.\n if (typeof mm.agent === \"string\" && mm.agent.trim() !== \"\") member.agent = mm.agent;\n return member;\n});\n// Deterministic budget truncation (design/140 \u00A71 \u9884\u7B97 row): a HARD rounds ceiling + member cap \u2014 never an\n// evaluator agent. The engine's budget/maxAgents hard stops remain the backstop.\nconst requestedRounds = Math.floor(Number(a.rounds));\nconst normalizedRounds = Number.isFinite(requestedRounds) && requestedRounds >= 1 ? requestedRounds : 2;\nconst rounds = Math.min(normalizedRounds, 5);\n// RB-380 disclosure: the member/round slices above are silent by construction (Array.prototype.slice /\n// Math.min just drop the excess) \u2014 record + surface it instead of a caller finding out only by counting\n// transcript entries. Fires only when a request actually exceeded a ceiling (never on the common path).\nconst capNotes = [];\nif (rawMembers.length > 6) capNotes.push(\"requested \" + rawMembers.length + \" members, capped at 6\");\nif (normalizedRounds > 5) capNotes.push(\"requested \" + normalizedRounds + \" rounds, capped at 5\");\nfor (const note of capNotes) log(\"discussion: \" + note);\nconst fin = a.finalizer !== null && typeof a.finalizer === \"object\" && !Array.isArray(a.finalizer) ? a.finalizer : {};\nconst finalizerPrompt = typeof fin.prompt === \"string\" && fin.prompt.trim() !== \"\"\n ? fin.prompt\n : \"You are the synthesis lead. Read the full discussion transcript and produce the final verdict: the decision/answer, the key supporting points, and the strongest unresolved dissent (if any). Do not introduce new arguments of your own.\";\nconst clip = (s) => { const t = String(s); return t.length > 4000 ? t.slice(0, 4000) + \" ...[truncated]\" : t; };\nconst isBudgetStop = (e) => e !== null && typeof e === \"object\" && e.code === \"workflow.budget_exceeded\";\n\nphase(\"Discussion\");\nconst transcript = [];\nlet truncated = null;\nfor (let r = 1; r <= rounds && truncated === null; r++) {\n // Deterministic early stop on an exhausted budget (a live read of the engine budget; the engine's\n // hard WorkflowBudgetExceededError remains the backstop if a member call itself crosses the line).\n if (budget.total !== null && budget.remaining() <= 0) { truncated = \"budget exhausted before round \" + r; break; }\n for (const m of members) {\n const history = transcript.length === 0 ? \"(none yet - you open the discussion)\" : transcript.join(\"\\n\\n\");\n const spec = {\n objective:\n \"Discussion on: \" + topic + \"\\n\\n\" +\n 'You are \"' + m.role + '\" in round ' + r + \" of \" + rounds + \".\\n\" +\n \"Your brief: \" + m.prompt + \"\\n\\n\" +\n \"Transcript so far:\\n\" + history + \"\\n\\n\" +\n \"Respond to the strongest points others made (do not repeat yourself), then advance your own position. Be concise: a few tight paragraphs at most.\",\n };\n if (m.model !== undefined) spec.modelName = m.model;\n let res;\n try {\n res = await agent(spec, m.agent !== undefined ? { label: m.role + \"-r\" + r, phase: \"Discussion\", agentType: m.agent } : { label: m.role + \"-r\" + r, phase: \"Discussion\" });\n } catch (e) {\n // The engine's budget hard stop: keep what the discussion already produced instead of failing the run.\n if (isBudgetStop(e)) { truncated = \"budget exhausted at \" + m.role + \", round \" + r; break; }\n throw e;\n }\n const text = res && res.status === \"completed\" ? clip(res.result) : \"(no contribution - agent ended \" + (res ? res.status : \"unknown\") + \")\";\n transcript.push(m.role + \" (round \" + r + \"): \" + text);\n }\n}\n\nphase(\"Synthesis\");\nconst finalSpec = {\n objective:\n finalizerPrompt + \"\\n\\nTopic: \" + topic + \"\\n\\nFull transcript:\\n\" +\n (transcript.length === 0 ? \"(the discussion produced no contributions)\" : transcript.join(\"\\n\\n\")) +\n (truncated ? \"\\n\\nNote: the discussion was cut short (\" + truncated + \").\" : \"\"),\n};\nif (typeof fin.model === \"string\" && fin.model.trim() !== \"\") finalSpec.modelName = fin.model;\nlet verdict = null;\ntry {\n verdict = await agent(finalSpec, {\n label: \"finalizer\",\n phase: \"Synthesis\",\n schema: {\n type: \"object\",\n properties: {\n decision: { type: \"string\", description: \"The final answer/decision, one paragraph.\" },\n keyPoints: { type: \"array\", items: { type: \"string\" }, description: \"The strongest supporting points from the discussion.\" },\n dissent: { type: \"string\", description: \"The strongest unresolved counter-position, if any.\" },\n },\n required: [\"decision\", \"keyPoints\"],\n },\n });\n} catch (e) {\n // Budget died before synthesis: return the transcript honestly rather than failing the whole run.\n if (!isBudgetStop(e)) throw e;\n truncated = truncated === null ? \"budget exhausted before synthesis\" : truncated;\n}\n\nreturn {\n topic,\n rounds,\n members: members.map((m) => m.role),\n ...(capNotes.length > 0 ? { capped: capNotes } : {}),\n ...(truncated ? { truncated } : {}),\n transcript,\n verdict: verdict && verdict.structuredOutput !== undefined ? verdict.structuredOutput : (verdict ? verdict.result : null),\n};\n";
84
91
  /**
85
- * @deprecated Use {@link DISCUSSION_SCRIPT}. Retired spelling kept for one minor (C-R14) so a deployment
86
- * importing the constant by its old name keeps compiling; the value is the SAME script (its `meta.name`
92
+ * @deprecated Use {@link DISCUSSION_SCRIPT}. Retired spelling retained (C-R14; the original one-minor
93
+ * window lapsed removal needs an announced BREAKING window) so a deployment importing the constant by
94
+ * its old name keeps compiling; the value is the SAME script (its `meta.name`
87
95
  * is the new `discussion`).
88
96
  */
89
97
  export declare const TEAM_DISCUSSION_SCRIPT = "export const meta = {\n name: \"discussion\",\n description: \"Round-based discussion: configurable members debate a topic across rounds (each member sees the transcript so far), then a finalizer synthesizes a structured verdict.\",\n whenToUse: \"Use for a genuinely contested question that benefits from several perspectives arguing across rounds - design trade-offs, plan or risk reviews, adversarial critique of a proposal. Do NOT use it for a single factual question, a task with one obvious answer, or a budget-sensitive run: every round costs one agent call per member, so a discussion is never cheaper than asking once. args (all optional): { topic, members?: [{ role, prompt?, model? }], rounds?, finalizer?: { prompt?, model? } }. Hard ceilings: members is capped at 6 and rounds is capped at 5 regardless of what you pass; the run reports it via log() and a capped field on the result when a request exceeds either.\",\n phases: [\n { title: \"Discussion\" },\n { title: \"Synthesis\" },\n ],\n};\n// Zero-config runnable (design/140 \u00A76 1c): every arg has an opinionated fallback.\nconst raw = args;\nconst a = raw !== null && typeof raw === \"object\" && !Array.isArray(raw) ? raw : {};\nconst topic =\n typeof a.topic === \"string\" && a.topic.trim() !== \"\"\n ? a.topic\n : typeof raw === \"string\" && raw.trim() !== \"\"\n ? raw // ergonomic form: a bare string args IS the topic\n : \"No topic was provided. Discuss: what information should a caller supply to make a discussion like this productive, and when should they NOT convene one?\";\nconst defaultMembers = [\n { role: \"advocate\", prompt: \"Make the strongest constructive case. Propose concrete options and argue their benefits with specifics.\" },\n { role: \"skeptic\", prompt: \"Stress-test every claim made so far. Surface risks, hidden costs, failure modes, and cheaper alternatives.\" },\n];\nconst rawMembers = Array.isArray(a.members) && a.members.length > 0 ? a.members : defaultMembers;\nconst members = rawMembers.slice(0, 6).map((m, i) => {\n const mm = m !== null && typeof m === \"object\" ? m : {};\n const member = {\n role: typeof mm.role === \"string\" && mm.role.trim() !== \"\" ? mm.role : \"member-\" + (i + 1),\n prompt: typeof mm.prompt === \"string\" && mm.prompt.trim() !== \"\" ? mm.prompt : \"Contribute your own distinct perspective: be concrete, give reasons, and engage with what others said.\",\n };\n if (typeof mm.model === \"string\" && mm.model.trim() !== \"\") member.model = mm.model;\n // Slot-tools carrier (design/140 \u2461-3 + F4): a member may BE a registered agent type ({agent:\"reviewer\"}) \u2014\n // persona/tools/model then come from the deployment's AgentDefinition (role library), args stay thin.\n if (typeof mm.agent === \"string\" && mm.agent.trim() !== \"\") member.agent = mm.agent;\n return member;\n});\n// Deterministic budget truncation (design/140 \u00A71 \u9884\u7B97 row): a HARD rounds ceiling + member cap \u2014 never an\n// evaluator agent. The engine's budget/maxAgents hard stops remain the backstop.\nconst requestedRounds = Math.floor(Number(a.rounds));\nconst normalizedRounds = Number.isFinite(requestedRounds) && requestedRounds >= 1 ? requestedRounds : 2;\nconst rounds = Math.min(normalizedRounds, 5);\n// RB-380 disclosure: the member/round slices above are silent by construction (Array.prototype.slice /\n// Math.min just drop the excess) \u2014 record + surface it instead of a caller finding out only by counting\n// transcript entries. Fires only when a request actually exceeded a ceiling (never on the common path).\nconst capNotes = [];\nif (rawMembers.length > 6) capNotes.push(\"requested \" + rawMembers.length + \" members, capped at 6\");\nif (normalizedRounds > 5) capNotes.push(\"requested \" + normalizedRounds + \" rounds, capped at 5\");\nfor (const note of capNotes) log(\"discussion: \" + note);\nconst fin = a.finalizer !== null && typeof a.finalizer === \"object\" && !Array.isArray(a.finalizer) ? a.finalizer : {};\nconst finalizerPrompt = typeof fin.prompt === \"string\" && fin.prompt.trim() !== \"\"\n ? fin.prompt\n : \"You are the synthesis lead. Read the full discussion transcript and produce the final verdict: the decision/answer, the key supporting points, and the strongest unresolved dissent (if any). Do not introduce new arguments of your own.\";\nconst clip = (s) => { const t = String(s); return t.length > 4000 ? t.slice(0, 4000) + \" ...[truncated]\" : t; };\nconst isBudgetStop = (e) => e !== null && typeof e === \"object\" && e.code === \"workflow.budget_exceeded\";\n\nphase(\"Discussion\");\nconst transcript = [];\nlet truncated = null;\nfor (let r = 1; r <= rounds && truncated === null; r++) {\n // Deterministic early stop on an exhausted budget (a live read of the engine budget; the engine's\n // hard WorkflowBudgetExceededError remains the backstop if a member call itself crosses the line).\n if (budget.total !== null && budget.remaining() <= 0) { truncated = \"budget exhausted before round \" + r; break; }\n for (const m of members) {\n const history = transcript.length === 0 ? \"(none yet - you open the discussion)\" : transcript.join(\"\\n\\n\");\n const spec = {\n objective:\n \"Discussion on: \" + topic + \"\\n\\n\" +\n 'You are \"' + m.role + '\" in round ' + r + \" of \" + rounds + \".\\n\" +\n \"Your brief: \" + m.prompt + \"\\n\\n\" +\n \"Transcript so far:\\n\" + history + \"\\n\\n\" +\n \"Respond to the strongest points others made (do not repeat yourself), then advance your own position. Be concise: a few tight paragraphs at most.\",\n };\n if (m.model !== undefined) spec.modelName = m.model;\n let res;\n try {\n res = await agent(spec, m.agent !== undefined ? { label: m.role + \"-r\" + r, phase: \"Discussion\", agentType: m.agent } : { label: m.role + \"-r\" + r, phase: \"Discussion\" });\n } catch (e) {\n // The engine's budget hard stop: keep what the discussion already produced instead of failing the run.\n if (isBudgetStop(e)) { truncated = \"budget exhausted at \" + m.role + \", round \" + r; break; }\n throw e;\n }\n const text = res && res.status === \"completed\" ? clip(res.result) : \"(no contribution - agent ended \" + (res ? res.status : \"unknown\") + \")\";\n transcript.push(m.role + \" (round \" + r + \"): \" + text);\n }\n}\n\nphase(\"Synthesis\");\nconst finalSpec = {\n objective:\n finalizerPrompt + \"\\n\\nTopic: \" + topic + \"\\n\\nFull transcript:\\n\" +\n (transcript.length === 0 ? \"(the discussion produced no contributions)\" : transcript.join(\"\\n\\n\")) +\n (truncated ? \"\\n\\nNote: the discussion was cut short (\" + truncated + \").\" : \"\"),\n};\nif (typeof fin.model === \"string\" && fin.model.trim() !== \"\") finalSpec.modelName = fin.model;\nlet verdict = null;\ntry {\n verdict = await agent(finalSpec, {\n label: \"finalizer\",\n phase: \"Synthesis\",\n schema: {\n type: \"object\",\n properties: {\n decision: { type: \"string\", description: \"The final answer/decision, one paragraph.\" },\n keyPoints: { type: \"array\", items: { type: \"string\" }, description: \"The strongest supporting points from the discussion.\" },\n dissent: { type: \"string\", description: \"The strongest unresolved counter-position, if any.\" },\n },\n required: [\"decision\", \"keyPoints\"],\n },\n });\n} catch (e) {\n // Budget died before synthesis: return the transcript honestly rather than failing the whole run.\n if (!isBudgetStop(e)) throw e;\n truncated = truncated === null ? \"budget exhausted before synthesis\" : truncated;\n}\n\nreturn {\n topic,\n rounds,\n members: members.map((m) => m.role),\n ...(capNotes.length > 0 ? { capped: capNotes } : {}),\n ...(truncated ? { truncated } : {}),\n transcript,\n verdict: verdict && verdict.structuredOutput !== undefined ? verdict.structuredOutput : (verdict ? verdict.result : null),\n};\n";
@@ -332,8 +332,13 @@ export async function createRunWorkflowTool(d) {
332
332
  "body (equivalently, pass { phase: 'Fix' } in an agent's opts). Give each stage a phase so progress " +
333
333
  "renders as stage groups; use the same titles you declared in meta.phases.\n" +
334
334
  "• spec.modelName works only when the deployment configured a workflow model allowlist, and its legal " +
335
- "values are that deployment's own model CATALOG KEYS not generic tier words (a bare 'opus'/'sonnet'/" +
336
- "'haiku' is a name the catalog almost certainly does not hold, and is refused rather than approximated). " +
335
+ "values are the names on THAT allowlist which the deployment's model CATALOG KEYS also hold a name " +
336
+ "off the allowlist, and a listed name the catalog lacks, are both refused rather than approximated. " +
337
+ "Generic tier words ('opus'/'sonnet'/'haiku'/'pro'/'flash'/'best') are not a separate namespace: on a " +
338
+ "deployment that configured tier bindings they become ordinary catalog keys, but only the ones its " +
339
+ "bindings actually resolve; on one that did not they are simply absent, unless its catalog happens to " +
340
+ "declare that literal name. Either way the allowlist is the gate, so a tier word is legal here only " +
341
+ "when this deployment allowlisted it, never as a shortcut around it. " +
337
342
  "It also goes on the SPEC (the first argument), never in an agent()'s options object; `model` is accepted " +
338
343
  "there as an alias for the same field. If unsure, omit it and the agent runs on the deployment's default " +
339
344
  "role.\n" +
@@ -99,7 +99,7 @@ export function resolveModelName(name, allowlist, models) {
99
99
  if (!allowlist.includes(name)) {
100
100
  throw new WorkflowModelNotAllowedError(name, `not in the workflow model allowlist [${allowlist.join(", ")}]`);
101
101
  }
102
- const model = models?.[name];
102
+ const model = models !== undefined && Object.hasOwn(models, name) ? models[name] : undefined;
103
103
  if (!model) {
104
104
  throw new WorkflowModelNotAllowedError(name, "allowed by name but not present in RunnerDeps.models");
105
105
  }
@@ -392,6 +392,7 @@ export type WorkflowEvent = {
392
392
  output?: string;
393
393
  errorCode?: string;
394
394
  toolCalls?: number;
395
+ modelResolved?: string;
395
396
  replayed?: boolean;
396
397
  ts: number;
397
398
  } | {
@@ -60,7 +60,7 @@ function workflowModelLabel(spec, catalog) {
60
60
  return undefined;
61
61
  if (typeof model !== "string")
62
62
  return model.id ?? model.name;
63
- const served = catalog?.[model]?.id;
63
+ const served = catalog !== undefined && Object.hasOwn(catalog, model) ? catalog[model]?.id : undefined;
64
64
  return served ?? resolveModelDisplayLabel(model);
65
65
  }
66
66
  export const WORKFLOW_SUBAGENT_PROMPT = `You are a subagent spawned by a workflow orchestration script. Use the tools available to complete the task.
@@ -30,7 +30,8 @@ export declare class FileMailboxStore implements MailboxStore {
30
30
  * file can never disagree. Before this, `AgentOne` and `agentone` produced two DIFFERENT shared-state
31
31
  * keys but the SAME file on a case-insensitive filesystem (macOS/Windows default) — one recipient read
32
32
  * the other's messages after a restart. Folding is also the semantically correct answer, not just the
33
- * safe one: the addressing layer's `normalizeAgentName` (task-registry.ts:621) already lowercases, so
33
+ * safe one: the addressing layer's `normalizeAgentName` (defined in core/task-registry-shared.ts and
34
+ * re-exported by task-registry.ts) already lowercases, so
34
35
  * two case-variant handles ARE the same agent; this makes the storage layer say so explicitly instead of
35
36
  * depending on an upstream coincidence, and behave identically on case-SENSITIVE filesystems (Linux),
36
37
  * where the old code silently split one logical agent's mail across two boxes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/core",
3
- "version": "7.0.2",
3
+ "version": "7.2.0",
4
4
  "description": "Stateless, task-oriented AI agent core",
5
5
  "type": "module",
6
6
  "license": "BUSL-1.1",