@sema-agent/server 1.318.0 → 1.319.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/dist/capabilities/scenarios.js +2 -2
- package/dist/http/routes/runs.js +1 -1
- package/dist/leader/leader.js +2 -2
- package/dist/leader/wire.js +2 -2
- package/dist/main.js +2 -2
- package/dist/plugins/fork-routing-session-store.d.ts +2 -2
- package/dist/task-settings.js +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CODE_AGENT_PROMPT, CODE_SYSTEM_PROMPT, DEFAULT_SYSTEM_PROMPT,
|
|
1
|
+
import { CODE_AGENT_PROMPT, CODE_SYSTEM_PROMPT, DEFAULT_SYSTEM_PROMPT, assembleCodeTools, createGiteaIssueTool, defaultTaskRegistry } from "@sema-agent/core";
|
|
2
2
|
import { HttpError } from "../security.js";
|
|
3
3
|
import { nowTool } from "./builtin-tools.js";
|
|
4
4
|
import { GiteaClient, parseRepo, repoToolsFor } from "./repo-tools.js";
|
|
@@ -38,7 +38,7 @@ export function buildScenarios(deps) {
|
|
|
38
38
|
return {
|
|
39
39
|
tools: [
|
|
40
40
|
nowTool(),
|
|
41
|
-
...
|
|
41
|
+
...assembleCodeTools({
|
|
42
42
|
...(deps.webFetchSummarize ? { webFetch: { summarize: deps.webFetchSummarize } } : {}),
|
|
43
43
|
todoWrite: false,
|
|
44
44
|
taskList: true,
|
package/dist/http/routes/runs.js
CHANGED
|
@@ -454,7 +454,7 @@ async function handleRunsBody(req, res, url, ctx, miss) {
|
|
|
454
454
|
leafId,
|
|
455
455
|
gate: { kind: "task_done" },
|
|
456
456
|
pendingAction: { kind: "task_done" },
|
|
457
|
-
state: { activeTools: [], nestedStats: { tokens: 0, turns: 0, tasks: 0,
|
|
457
|
+
state: { activeTools: [], nestedStats: { tokens: 0, turns: 0, tasks: 0, costMicroUsd: 0 } },
|
|
458
458
|
status: "pending",
|
|
459
459
|
createdAt: Date.now(),
|
|
460
460
|
sourceTaskId: taskId,
|
package/dist/leader/leader.js
CHANGED
|
@@ -187,7 +187,7 @@ export async function runLeaderTask(task, durableBaseSha, deps) {
|
|
|
187
187
|
try {
|
|
188
188
|
const rr = await w.runner.runTaskStream({ ...sub.spec, objective: deps.moduleGate.repairObjective(sub, verdict.reason ?? ""), sessionId: `${w.sessionId}-r${attempt + 1}` }).result();
|
|
189
189
|
if (r.stats && rr?.stats)
|
|
190
|
-
r.stats = { ...r.stats, tokens: (r.stats.tokens ?? 0) + (rr.stats.tokens ?? 0),
|
|
190
|
+
r.stats = { ...r.stats, tokens: (r.stats.tokens ?? 0) + (rr.stats.tokens ?? 0), costMicroUsd: (r.stats.costMicroUsd ?? 0) + (rr.stats.costMicroUsd ?? 0) };
|
|
191
191
|
}
|
|
192
192
|
catch (e) {
|
|
193
193
|
r.status = "failed";
|
|
@@ -288,7 +288,7 @@ export async function runLeaderTask(task, durableBaseSha, deps) {
|
|
|
288
288
|
if (sus1)
|
|
289
289
|
return sus1;
|
|
290
290
|
if (deps.replan?.budgetUsd !== undefined) {
|
|
291
|
-
const spent = reports.reduce((s, r) => s + (r.stats?.
|
|
291
|
+
const spent = reports.reduce((s, r) => s + (r.stats?.costMicroUsd ?? 0) / 1e6, 0);
|
|
292
292
|
if (spent > deps.replan.budgetUsd) {
|
|
293
293
|
return collapseToSingle("budget", `fan-out spent $${spent.toFixed(4)} > budget $${deps.replan.budgetUsd}`);
|
|
294
294
|
}
|
package/dist/leader/wire.js
CHANGED
|
@@ -107,7 +107,7 @@ export function createLeaderRunner(cfg) {
|
|
|
107
107
|
.result();
|
|
108
108
|
if (res.status !== "completed")
|
|
109
109
|
throw new Error(`repair round ${round} did not complete (status=${res.status})`);
|
|
110
|
-
return { costUsd: res.stats?.
|
|
110
|
+
return { costUsd: res.stats?.costMicroUsd !== undefined ? res.stats.costMicroUsd / 1e6 : undefined, note: res.result?.slice(0, 200) };
|
|
111
111
|
}
|
|
112
112
|
finally {
|
|
113
113
|
for (const f of oracleFiles) {
|
|
@@ -152,7 +152,7 @@ export function createLeaderRunner(cfg) {
|
|
|
152
152
|
.result();
|
|
153
153
|
if (res.status !== "completed")
|
|
154
154
|
throw new Error(`conflict-resolve round ${round} did not complete (status=${res.status})`);
|
|
155
|
-
return { costUsd: res.stats?.
|
|
155
|
+
return { costUsd: res.stats?.costMicroUsd !== undefined ? res.stats.costMicroUsd / 1e6 : undefined, note: res.result?.slice(0, 200) };
|
|
156
156
|
}
|
|
157
157
|
finally {
|
|
158
158
|
for (const f of oracleFiles) {
|
package/dist/main.js
CHANGED
|
@@ -5,7 +5,7 @@ import { homedir } from "node:os";
|
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import { loadRemoteExec } from "@sema-agent/registry-core/node";
|
|
7
7
|
import { skillContentHash } from "@sema-agent/registry-core";
|
|
8
|
-
import { Runner, TtlSessionStore, uuidv7, FileRosterStore, FileBackgroundAgentStore, FileMailboxStore, defaultTaskRegistry, combinePolicies, createDurableQuestionPolicy, createAllowDenyPolicy, tightenTaskSpec, isThinkingLevel, QUESTION_AWAITS_RESUME, FileWorkflowRunStore, InMemoryWorkflowRunStore, workflowsCapability, NodeLspManager, createFileWorkflowScriptStore, expandTiers, NodeExecutionEnv, CenterPromptSource, FilePromptArtifactStore, FilePromptSourceStateStore, MemoryPromptArtifactStore, MemoryPromptSourceStateStore, verifyPromptArtifact,
|
|
8
|
+
import { Runner, TtlSessionStore, uuidv7, FileRosterStore, FileBackgroundAgentStore, FileMailboxStore, defaultTaskRegistry, combinePolicies, createDurableQuestionPolicy, createAllowDenyPolicy, tightenTaskSpec, isThinkingLevel, QUESTION_AWAITS_RESUME, FileWorkflowRunStore, InMemoryWorkflowRunStore, workflowsCapability, NodeLspManager, createFileWorkflowScriptStore, expandTiers, NodeExecutionEnv, CenterPromptSource, FilePromptArtifactStore, FilePromptSourceStateStore, MemoryPromptArtifactStore, MemoryPromptSourceStateStore, verifyPromptArtifact, createWebFetchSummarizer, resolveTaskModel as coreResolveTaskModel } from "@sema-agent/core";
|
|
9
9
|
import { PgMemoryEngineBackend, ensurePgMemoryEngineSchema } from "./plugins/memory-engine-pg.js";
|
|
10
10
|
import { TiDBMemoryEngineBackend, ensureTiDBMemoryEngineSchema } from "./plugins/memory-engine-tidb.js";
|
|
11
11
|
import { PgMemoryHistoryStore, ensurePgMemoryHistorySchema, PgMemorySyncStore, ensurePgMemorySyncSchema } from "./plugins/memory-sync-store-pg.js";
|
|
@@ -1328,7 +1328,7 @@ async function main() {
|
|
|
1328
1328
|
})();
|
|
1329
1329
|
if (!model)
|
|
1330
1330
|
throw new Error("summarize model unresolved for this deployment");
|
|
1331
|
-
return
|
|
1331
|
+
return createWebFetchSummarizer(brain, model)(content, prompt, signal);
|
|
1332
1332
|
};
|
|
1333
1333
|
const scenarioDeps = {
|
|
1334
1334
|
runner, subRunner, model: "default", skills, repoClient, requirePrincipal: config.requirePrincipal,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SessionStore, AcquiredSession,
|
|
1
|
+
import type { SessionStore, AcquiredSession, SessionStoreSummary } from "@sema-agent/core";
|
|
2
2
|
export declare class ForkRoutingSessionStore implements SessionStore {
|
|
3
3
|
private readonly host;
|
|
4
4
|
private readonly transient;
|
|
@@ -17,7 +17,7 @@ export declare class ForkRoutingSessionStore implements SessionStore {
|
|
|
17
17
|
pin(sessionId: string): void | Promise<void>;
|
|
18
18
|
unpin(sessionId: string): void | Promise<void>;
|
|
19
19
|
noteTaskRun(sessionId: string, taskId: string): void | Promise<void>;
|
|
20
|
-
list(): Promise<
|
|
20
|
+
list(): Promise<SessionStoreSummary[]>;
|
|
21
21
|
promoteToHost(sessionId: string): Promise<void>;
|
|
22
22
|
fork(sourceId: string, owner?: string | null): Promise<string | null>;
|
|
23
23
|
get size(): number;
|
package/dist/task-settings.js
CHANGED
|
@@ -114,7 +114,7 @@ export function providerDropsAppend(provider, userSystemPrompt) {
|
|
|
114
114
|
return false;
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
return
|
|
117
|
+
return false;
|
|
118
118
|
}
|
|
119
119
|
export function acceptAppendSystemPrompt(v, warn, packDropsAppend) {
|
|
120
120
|
if (v === undefined)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.319.0",
|
|
4
4
|
"description": "Sema Server — the server/API implementation layer for Sema, wiring core, registry, model providers, and cloud agent execution. Built on @sema-agent/core.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BUSL-1.1",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"build:binary:run-local:darwin-arm64": "bun build --compile --target=bun-darwin-arm64 src/run-local.ts --outfile dist/run-local-darwin-arm64"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@sema-agent/core": "^
|
|
54
|
+
"@sema-agent/core": "^2.0.0",
|
|
55
55
|
"@sema-agent/registry-core": "^0.10.21",
|
|
56
56
|
"e2b": "^2.28.0",
|
|
57
57
|
"libsodium-wrappers": "^0.8.4",
|