@sema-agent/core 5.35.0 → 5.37.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 (51) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/dist/agents/subagent.d.ts +10 -0
  3. package/dist/agents/subagent.js +29 -2
  4. package/dist/core/auto-compaction.d.ts +23 -0
  5. package/dist/core/auto-compaction.js +8 -0
  6. package/dist/core/checkpoint-store.d.ts +16 -0
  7. package/dist/core/context-guard.d.ts +41 -0
  8. package/dist/core/context-guard.js +76 -0
  9. package/dist/core/governance-codes.js +4 -0
  10. package/dist/core/memory-engine/engine.d.ts +142 -0
  11. package/dist/core/memory-engine/engine.js +265 -3
  12. package/dist/core/memory-engine/file-backend.d.ts +490 -16
  13. package/dist/core/memory-engine/file-backend.js +1099 -36
  14. package/dist/core/memory-engine/index.d.ts +2 -2
  15. package/dist/core/memory-engine/index.js +1 -1
  16. package/dist/core/memory-engine/layout.d.ts +42 -2
  17. package/dist/core/memory-engine/layout.js +76 -12
  18. package/dist/core/memory-engine/memory-backend-contract.d.ts +13 -0
  19. package/dist/core/memory-engine/memory-backend-contract.js +89 -0
  20. package/dist/core/park-selfcheck.d.ts +5 -0
  21. package/dist/core/protocol-table.d.ts +4 -4
  22. package/dist/core/runner/assemble-result.d.ts +8 -0
  23. package/dist/core/runner/assemble-result.js +4 -1
  24. package/dist/core/runner/git-status-frame.d.ts +219 -0
  25. package/dist/core/runner/git-status-frame.js +212 -0
  26. package/dist/core/runner/prepare-memory.d.ts +11 -1
  27. package/dist/core/runner/prepare-memory.js +48 -2
  28. package/dist/core/runner/prepare-task.d.ts +21 -0
  29. package/dist/core/runner/prepare-task.js +28 -35
  30. package/dist/core/runner/runtask.js +270 -5
  31. package/dist/core/task-registry-agent.d.ts +15 -0
  32. package/dist/core/task-registry-agent.js +9 -0
  33. package/dist/core/task-registry.d.ts +3 -0
  34. package/dist/core/task-registry.js +4 -1
  35. package/dist/core/types.d.ts +122 -7
  36. package/dist/engine/harness/types.d.ts +65 -1
  37. package/dist/engine/harness/types.js +20 -0
  38. package/dist/engine/session/import-validate.js +10 -1
  39. package/dist/engine/session/session.d.ts +37 -1
  40. package/dist/engine/session/session.js +56 -1
  41. package/dist/index.d.ts +2 -2
  42. package/dist/index.js +1 -1
  43. package/dist/internal/harness-types.d.ts +1 -0
  44. package/dist/internal/harness.d.ts +2 -0
  45. package/dist/internal/harness.js +2 -0
  46. package/dist/prompt-assembly/epoch.js +1 -1
  47. package/dist/prompt-assembly/event-registry.js +1 -0
  48. package/dist/prompts/default.d.ts +20 -7
  49. package/dist/prompts/default.js +2 -7
  50. package/package.json +1 -1
  51. package/test/export-surface.snapshot.json +13 -1
@@ -196,6 +196,7 @@ Only use \`/tmp\` if the user explicitly requests it.
196
196
  The scratchpad directory is session-specific, isolated from the user's project, and can generally be used without permission prompts. Treat it as ephemeral — it may not survive a long suspension or a resume on a different worker; keep durable outputs in the working directory.`;
197
197
  }
198
198
  export const GIT_STATUS_MAX_CHARS = 2000;
199
+ export const GIT_SNAPSHOT_CC_PREAMBLE = "This is the git status at the start of the conversation. Note that this status is a snapshot in time, and will not update during the conversation.";
199
200
  export function buildGitSnapshot(p) {
200
201
  const tool = p.statusToolName ?? "Bash";
201
202
  const status = sanitizeUntrustedText(p.status.trim());
@@ -205,7 +206,7 @@ export function buildGitSnapshot(p) {
205
206
  `\n... (truncated because it exceeds 2k characters. If you need more information, run "git status" using ${tool})`
206
207
  : status;
207
208
  return [
208
- "This is the git status at the start of the conversation. Note that this status is a snapshot in time, and will not update during the conversation.",
209
+ GIT_SNAPSHOT_CC_PREAMBLE,
209
210
  `Current branch: ${inlineUntrusted(p.branch)}`,
210
211
  `Main branch (you will usually use this for PRs): ${inlineUntrusted(p.mainBranch)}`,
211
212
  ...(p.userName ? [`Git user: ${inlineUntrusted(p.userName)}`] : []),
@@ -255,10 +256,6 @@ export function buildEnvironmentContext(facts) {
255
256
  }
256
257
  if (facts.isGitRepo !== undefined)
257
258
  lines.push(`Is a git repository: ${facts.isGitRepo ? "yes" : "no"}`);
258
- if (facts.gitBranch)
259
- lines.push(`Git branch: ${inlineUntrusted(facts.gitBranch)}`);
260
- if (facts.gitDirty !== undefined)
261
- lines.push(`Git working tree: ${facts.gitDirty ? "has uncommitted changes" : "clean"}`);
262
259
  if (facts.gitWorktreeRoot)
263
260
  lines.push(`Git worktree root: ${inlineUntrusted(facts.gitWorktreeRoot)}`);
264
261
  if (facts.isLinkedWorktree) {
@@ -302,8 +299,6 @@ export function buildEnvironmentContext(facts) {
302
299
  }
303
300
  const base = lines.length > 0 ? `# Environment\n${lines.join("\n")}` : "";
304
301
  const sections = [base, ...(facts.scratchpadDir ? [buildScratchpadSection(facts.scratchpadDir)] : [])].filter((s) => s.length > 0);
305
- if (facts.gitSnapshot)
306
- sections.push(facts.gitSnapshot);
307
302
  return sections.join("\n\n");
308
303
  }
309
304
  export const CODE_AGENT_PROMPT = `You are a capable software-engineering agent that acts through tools.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/core",
3
- "version": "5.35.0",
3
+ "version": "5.37.0",
4
4
  "description": "Stateless, task-oriented AI agent core",
5
5
  "type": "module",
6
6
  "license": "BUSL-1.1",
@@ -1,6 +1,6 @@
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
- "count": 1562,
3
+ "count": 1574,
4
4
  "exports": {
5
5
  "A2ATaskState": "type",
6
6
  "A2ATaskStateReversal": "type",
@@ -171,6 +171,9 @@
171
171
  "CircuitBreakerOptions": "interface",
172
172
  "CodeReviewMode": "type",
173
173
  "CodeToolsConfig": "interface",
174
+ "CommittedBinding": "type",
175
+ "CommittedEntrySnapshot": "type",
176
+ "CommittedScopeSnapshots": "type",
174
177
  "CompactOutcome": "type",
175
178
  "CompactionWindowSafetyInfo": "interface",
176
179
  "CompiledEventPrompt": "interface",
@@ -243,10 +246,16 @@
243
246
  "EXPLORE_WHEN_TO_USE": "variable",
244
247
  "EXPLORE_WHEN_TO_USE_LEAN": "variable",
245
248
  "EffectiveConfigField": "interface",
249
+ "EffectiveMemoryScopes": "type",
246
250
  "EffectivePermissionRule": "interface",
247
251
  "Embedder": "interface",
248
252
  "EngineNotice": "interface",
253
+ "EntryCustodyReport": "interface",
254
+ "EntryProvenanceAccount": "interface",
249
255
  "EnvironmentFacts": "interface",
256
+ "EraseMemoryEntriesInput": "interface",
257
+ "ErasedBinding": "type",
258
+ "ErasureSelect": "type",
250
259
  "EscalationRecord": "interface",
251
260
  "EscalationTrigger": "type",
252
261
  "EventDedupe": "type",
@@ -456,6 +465,7 @@
456
465
  "MemoryEntry": "interface",
457
466
  "MemoryEntryFrontmatter": "interface",
458
467
  "MemoryEntryHeader": "interface",
468
+ "MemoryErasureAttestation": "interface",
459
469
  "MemoryGateError": "class",
460
470
  "MemoryGetDetails": "interface",
461
471
  "MemoryInjection": "interface",
@@ -968,6 +978,7 @@
968
978
  "ToolSpec": "interface",
969
979
  "TraceEvent": "type",
970
980
  "TracerHook": "type",
981
+ "TransferEvidence": "interface",
971
982
  "TransportLspSession": "class",
972
983
  "TripwireResult": "interface",
973
984
  "TtlSessionStore": "class",
@@ -1256,6 +1267,7 @@
1256
1267
  "enqueueMemoryAnnouncement": "function",
1257
1268
  "ensureDir": "function",
1258
1269
  "entryFromFile": "function",
1270
+ "erasureSelectHash": "function",
1259
1271
  "err": "function",
1260
1272
  "errorClassOf": "function",
1261
1273
  "eventDefaultOn": "function",