@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.
- package/CHANGELOG.md +115 -0
- package/dist/agents/subagent.d.ts +10 -0
- package/dist/agents/subagent.js +29 -2
- package/dist/core/auto-compaction.d.ts +23 -0
- package/dist/core/auto-compaction.js +8 -0
- package/dist/core/checkpoint-store.d.ts +16 -0
- package/dist/core/context-guard.d.ts +41 -0
- package/dist/core/context-guard.js +76 -0
- package/dist/core/governance-codes.js +4 -0
- package/dist/core/memory-engine/engine.d.ts +142 -0
- package/dist/core/memory-engine/engine.js +265 -3
- package/dist/core/memory-engine/file-backend.d.ts +490 -16
- package/dist/core/memory-engine/file-backend.js +1099 -36
- package/dist/core/memory-engine/index.d.ts +2 -2
- package/dist/core/memory-engine/index.js +1 -1
- package/dist/core/memory-engine/layout.d.ts +42 -2
- package/dist/core/memory-engine/layout.js +76 -12
- package/dist/core/memory-engine/memory-backend-contract.d.ts +13 -0
- package/dist/core/memory-engine/memory-backend-contract.js +89 -0
- package/dist/core/park-selfcheck.d.ts +5 -0
- package/dist/core/protocol-table.d.ts +4 -4
- package/dist/core/runner/assemble-result.d.ts +8 -0
- package/dist/core/runner/assemble-result.js +4 -1
- package/dist/core/runner/git-status-frame.d.ts +219 -0
- package/dist/core/runner/git-status-frame.js +212 -0
- package/dist/core/runner/prepare-memory.d.ts +11 -1
- package/dist/core/runner/prepare-memory.js +48 -2
- package/dist/core/runner/prepare-task.d.ts +21 -0
- package/dist/core/runner/prepare-task.js +28 -35
- package/dist/core/runner/runtask.js +270 -5
- package/dist/core/task-registry-agent.d.ts +15 -0
- package/dist/core/task-registry-agent.js +9 -0
- package/dist/core/task-registry.d.ts +3 -0
- package/dist/core/task-registry.js +4 -1
- package/dist/core/types.d.ts +122 -7
- package/dist/engine/harness/types.d.ts +65 -1
- package/dist/engine/harness/types.js +20 -0
- package/dist/engine/session/import-validate.js +10 -1
- package/dist/engine/session/session.d.ts +37 -1
- package/dist/engine/session/session.js +56 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/internal/harness-types.d.ts +1 -0
- package/dist/internal/harness.d.ts +2 -0
- package/dist/internal/harness.js +2 -0
- package/dist/prompt-assembly/epoch.js +1 -1
- package/dist/prompt-assembly/event-registry.js +1 -0
- package/dist/prompts/default.d.ts +20 -7
- package/dist/prompts/default.js +2 -7
- package/package.json +1 -1
- package/test/export-surface.snapshot.json +13 -1
package/dist/prompts/default.js
CHANGED
|
@@ -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
|
-
|
|
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
|
"_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":
|
|
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",
|