@sema-agent/server 7.79.3 → 7.80.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/http/dispatch.js +28 -8
- package/dist/http/route-ctx.d.ts +101 -4
- package/dist/http/route-ctx.js +4 -0
- package/dist/http/route-table.d.ts +71 -43
- package/dist/http/route-table.js +111 -187
- package/dist/http/routes/a2a-serve.d.ts +18 -3
- package/dist/http/routes/a2a-serve.js +25 -23
- package/dist/http/routes/admin-config-refresh.d.ts +9 -2
- package/dist/http/routes/admin-config-refresh.js +32 -31
- package/dist/http/routes/admin-drain.d.ts +9 -2
- package/dist/http/routes/admin-drain.js +32 -31
- package/dist/http/routes/admin-memory-optout.d.ts +28 -2
- package/dist/http/routes/admin-memory-optout.js +26 -39
- package/dist/http/routes/adoption.d.ts +15 -2
- package/dist/http/routes/adoption.js +52 -52
- package/dist/http/routes/agents-roster.d.ts +9 -2
- package/dist/http/routes/agents-roster.js +82 -80
- package/dist/http/routes/approvals-assistant.d.ts +58 -5
- package/dist/http/routes/approvals-assistant.js +37 -38
- package/dist/http/routes/attachments.d.ts +22 -2
- package/dist/http/routes/attachments.js +81 -72
- package/dist/http/routes/capabilities.d.ts +21 -2
- package/dist/http/routes/capabilities.js +174 -170
- package/dist/http/routes/config-catalog.d.ts +9 -2
- package/dist/http/routes/config-catalog.js +28 -31
- package/dist/http/routes/devices.d.ts +24 -2
- package/dist/http/routes/devices.js +19 -21
- package/dist/http/routes/diagnostics.d.ts +9 -2
- package/dist/http/routes/diagnostics.js +41 -43
- package/dist/http/routes/fleet.d.ts +11 -2
- package/dist/http/routes/fleet.js +23 -22
- package/dist/http/routes/images.d.ts +63 -9
- package/dist/http/routes/images.js +53 -46
- package/dist/http/routes/leader.d.ts +20 -2
- package/dist/http/routes/leader.js +43 -40
- package/dist/http/routes/memory-bundle.d.ts +15 -2
- package/dist/http/routes/memory-bundle.js +38 -38
- package/dist/http/routes/memory-compliance.d.ts +16 -4
- package/dist/http/routes/memory-compliance.js +44 -45
- package/dist/http/routes/memory-consolidation.d.ts +14 -2
- package/dist/http/routes/memory-consolidation.js +66 -66
- package/dist/http/routes/memory-origin.d.ts +23 -4
- package/dist/http/routes/memory-origin.js +65 -65
- package/dist/http/routes/memory-policy.d.ts +21 -2
- package/dist/http/routes/memory-policy.js +119 -115
- package/dist/http/routes/notify-wake.d.ts +21 -11
- package/dist/http/routes/notify-wake.js +118 -116
- package/dist/http/routes/observability.d.ts +16 -2
- package/dist/http/routes/observability.js +54 -51
- package/dist/http/routes/retention-ops.d.ts +19 -2
- package/dist/http/routes/retention-ops.js +20 -22
- package/dist/http/routes/rules.d.ts +36 -2
- package/dist/http/routes/rules.js +22 -24
- package/dist/http/routes/run-memory-capture.d.ts +10 -3
- package/dist/http/routes/run-memory-capture.js +84 -84
- package/dist/http/routes/runs.d.ts +102 -22
- package/dist/http/routes/runs.js +71 -88
- package/dist/http/routes/session-sync.d.ts +41 -2
- package/dist/http/routes/session-sync.js +25 -23
- package/dist/http/routes/sessions-list.d.ts +16 -2
- package/dist/http/routes/sessions-list.js +78 -75
- package/dist/http/routes/sessions.d.ts +77 -2
- package/dist/http/routes/sessions.js +50 -47
- package/dist/http/routes/shared-memory.d.ts +19 -2
- package/dist/http/routes/shared-memory.js +65 -63
- package/dist/http/routes/side-query.d.ts +11 -2
- package/dist/http/routes/side-query.js +81 -79
- package/dist/http/routes/tasks.d.ts +17 -2
- package/dist/http/routes/tasks.js +18 -11
- package/dist/http/routes/trace-usage.d.ts +40 -2
- package/dist/http/routes/trace-usage.js +46 -35
- package/dist/http/routes/workflows.d.ts +35 -3
- package/dist/http/routes/workflows.js +29 -29
- package/package.json +1 -1
|
@@ -6,19 +6,13 @@ import { bindSseLifecycle } from "../sse-lifecycle.js";
|
|
|
6
6
|
import { sendJson, sendError, sseHeaders, SSE_MAX_STREAM_MS, SSE_HEARTBEAT_IDLE_MS } from "../send.js";
|
|
7
7
|
import { filterFingerprint } from "../cursor-fingerprint.js";
|
|
8
8
|
import { gatedPrincipal } from "../principal-gate.js";
|
|
9
|
-
|
|
10
|
-
const TOOL_RESULTS_SUB = "/tool-results/";
|
|
9
|
+
import { assertNever } from "../route-ctx.js";
|
|
11
10
|
const TOOL_RESULT_LIMIT_CAP = 262_144;
|
|
12
11
|
const TOOL_RESULT_OFFSET_CAP = 2_147_483_646;
|
|
13
|
-
export async function handleTraceUsage(req, res,
|
|
14
|
-
const miss = { fell: false };
|
|
15
|
-
await handleTraceUsageBody(req, res, url, ctx, miss);
|
|
16
|
-
return !miss.fell;
|
|
17
|
-
}
|
|
18
|
-
async function handleTraceUsageBody(req, res, url, ctx, miss) {
|
|
12
|
+
export async function handleTraceUsage(req, res, match, ctx) {
|
|
19
13
|
const { deps } = ctx;
|
|
20
14
|
const { isFleetWide, safeDecode } = ctx.helpers;
|
|
21
|
-
if (
|
|
15
|
+
if (match.decl.id === "tasks-source-summary") {
|
|
22
16
|
if (!isFleetWide(req)) {
|
|
23
17
|
sendError(res, 401, "auth.unauthorized", "unauthorized");
|
|
24
18
|
return;
|
|
@@ -27,13 +21,16 @@ async function handleTraceUsageBody(req, res, url, ctx, miss) {
|
|
|
27
21
|
sendError(res, 501, "capability.run_store_required", "trace API requires a durable run store (DB_BACKEND=mysql|pg|local)");
|
|
28
22
|
return;
|
|
29
23
|
}
|
|
30
|
-
const q = new
|
|
24
|
+
const q = new URLSearchParams(match.search);
|
|
31
25
|
const sinceSec = Math.min(30 * 86_400, Math.max(60, Number(q.get("sinceSec") ?? 86_400) || 86_400));
|
|
32
26
|
sendJson(res, 200, { sinceSec, rows: await deps.runStore.sourceSummary(Date.now() - sinceSec * 1000) });
|
|
33
27
|
return;
|
|
34
28
|
}
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
if (match.decl.id === "task-trace-list" ||
|
|
30
|
+
match.decl.id === "task-trace-turns" ||
|
|
31
|
+
match.decl.id === "task-trace-stream" ||
|
|
32
|
+
match.decl.id === "task-trace-artifacts" ||
|
|
33
|
+
match.decl.id === "task-tool-result") {
|
|
37
34
|
const fleetWide = isFleetWide(req);
|
|
38
35
|
const gateOwner = fleetWide ? null : (gatedPrincipal(req, deps.config) || null);
|
|
39
36
|
if (!fleetWide && gateOwner === null) {
|
|
@@ -44,9 +41,8 @@ async function handleTraceUsageBody(req, res, url, ctx, miss) {
|
|
|
44
41
|
sendError(res, 501, "capability.run_store_required", "trace API requires a durable run store (DB_BACKEND=mysql|pg|local)");
|
|
45
42
|
return;
|
|
46
43
|
}
|
|
47
|
-
const query = new
|
|
48
|
-
const taskId =
|
|
49
|
-
const sub = traceMatch[2];
|
|
44
|
+
const query = new URLSearchParams(match.search);
|
|
45
|
+
const taskId = match.params.taskId;
|
|
50
46
|
let ownedRun;
|
|
51
47
|
if (taskId && gateOwner !== null) {
|
|
52
48
|
const run = await deps.runStore.getRun(taskId);
|
|
@@ -56,24 +52,31 @@ async function handleTraceUsageBody(req, res, url, ctx, miss) {
|
|
|
56
52
|
}
|
|
57
53
|
ownedRun = run;
|
|
58
54
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
55
|
+
switch (match.decl.id) {
|
|
56
|
+
case "task-trace-list":
|
|
57
|
+
await handleTaskList(res, deps.runStore, query, gateOwner);
|
|
58
|
+
return;
|
|
59
|
+
case "task-trace-turns":
|
|
60
|
+
await handleTaskTurns(res, deps.runStore, taskId, query);
|
|
61
|
+
return;
|
|
62
|
+
case "task-trace-stream":
|
|
63
|
+
await streamTaskTrace(req, res, deps.runStore, taskId, deps.config.runStaleSec * 1000, match.search);
|
|
64
|
+
return;
|
|
65
|
+
case "task-trace-artifacts":
|
|
66
|
+
await handleTaskArtifacts(res, deps.runStore, taskId);
|
|
67
|
+
return;
|
|
68
|
+
case "task-tool-result":
|
|
69
|
+
await handleToolResult(res, deps.toolResultStore, deps.runStore, taskId, ownedRun, safeDecode(match.params.ref), query);
|
|
70
|
+
return;
|
|
71
|
+
default:
|
|
72
|
+
return assertNever(match.decl.id);
|
|
69
73
|
}
|
|
70
|
-
else
|
|
71
|
-
sendError(res, 404, "not_found.route", "not found");
|
|
72
|
-
return;
|
|
73
74
|
}
|
|
74
|
-
if (
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
if (match.decl.id !== "usage-analytics")
|
|
76
|
+
return assertNever(match.decl.id);
|
|
77
|
+
{
|
|
78
|
+
const sub = match.params.sub;
|
|
79
|
+
{
|
|
77
80
|
if (!deps.runStore) {
|
|
78
81
|
sendError(res, 501, "capability.run_store_required", "usage analytics requires a run store");
|
|
79
82
|
return;
|
|
@@ -84,7 +87,7 @@ async function handleTraceUsageBody(req, res, url, ctx, miss) {
|
|
|
84
87
|
sendError(res, 401, "auth.unauthorized", "unauthorized");
|
|
85
88
|
return;
|
|
86
89
|
}
|
|
87
|
-
const q = new
|
|
90
|
+
const q = new URLSearchParams(match.search);
|
|
88
91
|
const parseT = (v, dflt) => {
|
|
89
92
|
if (!v)
|
|
90
93
|
return dflt;
|
|
@@ -130,7 +133,6 @@ async function handleTraceUsageBody(req, res, url, ctx, miss) {
|
|
|
130
133
|
return;
|
|
131
134
|
}
|
|
132
135
|
}
|
|
133
|
-
miss.fell = true;
|
|
134
136
|
}
|
|
135
137
|
function encodeCursor(c, f) {
|
|
136
138
|
return Buffer.from(JSON.stringify({ ...c, f })).toString("base64url");
|
|
@@ -234,13 +236,13 @@ async function handleTaskTurns(res, runStore, taskId, query) {
|
|
|
234
236
|
const nextCursor = eligible.length > limit && oldest ? String(oldest.seq) : undefined;
|
|
235
237
|
sendJson(res, 200, { turns, ...(nextCursor ? { nextCursor } : {}), retainedFrom });
|
|
236
238
|
}
|
|
237
|
-
async function streamTaskTrace(req, res, runStore, taskId, staleMs) {
|
|
239
|
+
async function streamTaskTrace(req, res, runStore, taskId, staleMs, search) {
|
|
238
240
|
const run0 = await runStore.getRun(taskId);
|
|
239
241
|
if (!run0) {
|
|
240
242
|
sendError(res, 404, "not_found.run", "task not found");
|
|
241
243
|
return;
|
|
242
244
|
}
|
|
243
|
-
const lastId = Number(req.headers["last-event-id"] ?? new
|
|
245
|
+
const lastId = Number(req.headers["last-event-id"] ?? new URLSearchParams(search).get("from") ?? 0);
|
|
244
246
|
let from = Number.isFinite(lastId) ? lastId : 0;
|
|
245
247
|
if (from > 0) {
|
|
246
248
|
const retainedFrom = await runStore.retainedFrom(taskId);
|
|
@@ -293,4 +295,13 @@ async function streamTaskTrace(req, res, runStore, taskId, staleMs) {
|
|
|
293
295
|
}
|
|
294
296
|
res.end();
|
|
295
297
|
}
|
|
298
|
+
export const TRACE_USAGE_ROUTES = [
|
|
299
|
+
{ id: "tasks-source-summary", path: "/v1/tasks/source-summary", methods: ["GET"] },
|
|
300
|
+
{ id: "task-trace-list", path: "/v1/tasks", methods: ["GET"] },
|
|
301
|
+
{ id: "task-tool-result", pattern: /^\/v1\/tasks\/(?<taskId>[^/]+)\/tool-results\/(?<ref>[^/]+)$/, label: "/v1/tasks/:id/tool-results/:ref", methods: ["GET"] },
|
|
302
|
+
{ id: "task-trace-turns", pattern: /^\/v1\/tasks\/(?<taskId>[^/]+)\/turns$/, label: "/v1/tasks/:id/$sub", methods: ["GET"] },
|
|
303
|
+
{ id: "task-trace-stream", pattern: /^\/v1\/tasks\/(?<taskId>[^/]+)\/stream$/, label: "/v1/tasks/:id/$sub", methods: ["GET"] },
|
|
304
|
+
{ id: "task-trace-artifacts", pattern: /^\/v1\/tasks\/(?<taskId>[^/]+)\/artifacts$/, label: "/v1/tasks/:id/$sub", methods: ["GET"] },
|
|
305
|
+
{ id: "usage-analytics", pattern: /^\/v1\/usage\/(?<sub>summary|series|breakdown)$/, label: "/v1/usage/$sub", methods: ["GET"] },
|
|
306
|
+
];
|
|
296
307
|
//# sourceMappingURL=trace-usage.js.map
|
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
-
import type { RouteCtx } from "../route-ctx.js";
|
|
3
|
-
export declare function handleWorkflows(req: IncomingMessage, res: ServerResponse, url: string, ctx: RouteCtx): Promise<boolean>;
|
|
2
|
+
import type { RouteCtx, RouteMatch, RouteIdsOf } from "../route-ctx.js";
|
|
4
3
|
/** SVC-5 的 steer 路——`handle()` 里位置在 tasks/runs 之后(鉴权门之后),故是**独立**的域入口。 */
|
|
5
|
-
|
|
4
|
+
/** 路由体 = 从 `server.ts` 的 `handle()` 里**整段剪切**过来的原文(唯一改动:统一去缩进两格)。裸 `return;`
|
|
5
|
+
* = 「本域已应答」;走到函数尾才是「没匹配上」。跨域的东西一律在首行解构出来。 */
|
|
6
|
+
export declare function handleWorkflows(req: IncomingMessage, res: ServerResponse, match: RouteMatch<WorkflowsRouteId>, ctx: RouteCtx): Promise<void>;
|
|
7
|
+
/** 同上纪律(SVC-5 steer 段)。 */
|
|
8
|
+
export declare function handleWorkflowAgentSteer(req: IncomingMessage, res: ServerResponse, match: RouteMatch<WorkflowAgentSteerRouteId>, ctx: RouteCtx): Promise<void>;
|
|
9
|
+
export declare const WORKFLOWS_ROUTES: readonly [{
|
|
10
|
+
readonly id: "workflows-list";
|
|
11
|
+
readonly path: "/v1/workflows";
|
|
12
|
+
readonly methods: readonly ["GET"];
|
|
13
|
+
}, {
|
|
14
|
+
readonly id: "workflow-stream";
|
|
15
|
+
readonly pattern: RegExp;
|
|
16
|
+
readonly label: "/v1/workflows/:id/$sub";
|
|
17
|
+
readonly methods: readonly ["GET"];
|
|
18
|
+
}, {
|
|
19
|
+
readonly id: "workflow-journal";
|
|
20
|
+
readonly pattern: RegExp;
|
|
21
|
+
readonly label: "/v1/workflows/:id/$sub";
|
|
22
|
+
readonly methods: readonly ["GET"];
|
|
23
|
+
}, {
|
|
24
|
+
readonly id: "workflow-detail";
|
|
25
|
+
readonly pattern: RegExp;
|
|
26
|
+
readonly label: "/v1/workflows/:id";
|
|
27
|
+
readonly methods: readonly ["GET"];
|
|
28
|
+
}];
|
|
29
|
+
/** 本域可分派行的 `id` 闭集 —— handler 的 `switch` 按它判穷尽(漏一口 = 编译红)。 */
|
|
30
|
+
export type WorkflowsRouteId = RouteIdsOf<typeof WORKFLOWS_ROUTES>;
|
|
31
|
+
export declare const WORKFLOW_AGENT_STEER_ROUTES: readonly [{
|
|
32
|
+
readonly id: "workflow-agent-steer";
|
|
33
|
+
readonly pattern: RegExp;
|
|
34
|
+
readonly label: "/v1/workflows/:id/agents/:aid/steer";
|
|
35
|
+
readonly methods: readonly ["POST"];
|
|
36
|
+
}];
|
|
37
|
+
export type WorkflowAgentSteerRouteId = RouteIdsOf<typeof WORKFLOW_AGENT_STEER_ROUTES>;
|
|
6
38
|
//# sourceMappingURL=workflows.d.ts.map
|
|
@@ -10,23 +10,11 @@ const JOURNAL_PROJECTION_MEMO_CAP = 1024;
|
|
|
10
10
|
const journalProjectionMemo = new Map();
|
|
11
11
|
import { sendJson, sendError, sseHeaders } from "../send.js";
|
|
12
12
|
import { gatedPrincipal, explicitOperatorOk, sendPrincipalRefusal } from "../principal-gate.js";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export async function handleWorkflows(req, res, url, ctx) {
|
|
16
|
-
const miss = { fell: false };
|
|
17
|
-
await handleWorkflowsReadBody(req, res, url, ctx, miss);
|
|
18
|
-
return !miss.fell;
|
|
19
|
-
}
|
|
20
|
-
export async function handleWorkflowAgentSteer(req, res, url, ctx) {
|
|
21
|
-
const miss = { fell: false };
|
|
22
|
-
await handleWorkflowAgentSteerBody(req, res, url, ctx, miss);
|
|
23
|
-
return !miss.fell;
|
|
24
|
-
}
|
|
25
|
-
async function handleWorkflowsReadBody(req, res, url, ctx, miss) {
|
|
13
|
+
import { assertNever } from "../route-ctx.js";
|
|
14
|
+
export async function handleWorkflows(req, res, match, ctx) {
|
|
26
15
|
const { deps } = ctx;
|
|
27
16
|
const { runSessionAcceptOk } = ctx.helpers;
|
|
28
|
-
|
|
29
|
-
if (wfMatch) {
|
|
17
|
+
{
|
|
30
18
|
const principal = gatedPrincipal(req, deps.config);
|
|
31
19
|
if (deps.config.requirePrincipal && !principal) {
|
|
32
20
|
sendPrincipalRefusal(res, req, deps.config);
|
|
@@ -37,10 +25,10 @@ async function handleWorkflowsReadBody(req, res, url, ctx, miss) {
|
|
|
37
25
|
return;
|
|
38
26
|
}
|
|
39
27
|
const scope = principal ?? "default";
|
|
40
|
-
const wfId =
|
|
41
|
-
const isStream =
|
|
42
|
-
if (
|
|
43
|
-
const q = new
|
|
28
|
+
const wfId = match.params.runId;
|
|
29
|
+
const isStream = match.decl.id === "workflow-stream";
|
|
30
|
+
if (match.decl.id === "workflows-list") {
|
|
31
|
+
const q = new URLSearchParams(match.search);
|
|
44
32
|
const statusFilter = q.get("status");
|
|
45
33
|
const limit = Math.min(100, Math.max(1, Number(q.get("limit") ?? 50) || 50));
|
|
46
34
|
const sessionFilter = q.get("session");
|
|
@@ -63,14 +51,14 @@ async function handleWorkflowsReadBody(req, res, url, ctx, miss) {
|
|
|
63
51
|
sendError(res, 404, "not_found.workflow", "workflow not found");
|
|
64
52
|
return;
|
|
65
53
|
}
|
|
66
|
-
if (!runSessionAcceptOk(req, res, { sessionId: run.originatingSessionId ?? null },
|
|
54
|
+
if (!runSessionAcceptOk(req, res, { sessionId: run.originatingSessionId ?? null }, match.decl.id === "workflow-journal" ? "workflow.journal" : isStream ? "workflow.stream" : "workflow.detail", "workflow not found"))
|
|
67
55
|
return;
|
|
68
|
-
if (
|
|
56
|
+
if (match.decl.id === "workflow-journal") {
|
|
69
57
|
if (!deps.workflowJournalStore) {
|
|
70
58
|
sendError(res, 501, "capability.workflow_store_required", "workflow journal requires the journal store (SELF_ORCHESTRATION_ENABLED + a store backend)");
|
|
71
59
|
return;
|
|
72
60
|
}
|
|
73
|
-
const jq = new
|
|
61
|
+
const jq = new URLSearchParams(match.search);
|
|
74
62
|
const jLimit = Math.min(50, Math.max(1, Number(jq.get("limit") ?? 20) || 20));
|
|
75
63
|
const jOffset = Math.max(0, Number(jq.get("offset") ?? 0) || 0);
|
|
76
64
|
const MAX_ROW_BYTES = 64 * 1024;
|
|
@@ -148,13 +136,17 @@ async function handleWorkflowsReadBody(req, res, url, ctx, miss) {
|
|
|
148
136
|
sendJson(res, 200, summarizeWorkflowDetail(run));
|
|
149
137
|
return;
|
|
150
138
|
}
|
|
151
|
-
miss.fell = true;
|
|
152
139
|
}
|
|
153
|
-
async function
|
|
140
|
+
export async function handleWorkflowAgentSteer(req, res, match, ctx) {
|
|
154
141
|
const { deps } = ctx;
|
|
155
142
|
const { readJson, rateLimited, quotaExceeded, leaseDenied, safeDecode, runSessionAcceptOk } = ctx.helpers;
|
|
156
|
-
|
|
157
|
-
|
|
143
|
+
switch (match.decl.id) {
|
|
144
|
+
case "workflow-agent-steer":
|
|
145
|
+
break;
|
|
146
|
+
default:
|
|
147
|
+
return assertNever(match.decl.id);
|
|
148
|
+
}
|
|
149
|
+
{
|
|
158
150
|
if (rateLimited(req, res) || quotaExceeded(req, res) || (await leaseDenied(req, res)))
|
|
159
151
|
return;
|
|
160
152
|
if (!deps.workflowRunStore) {
|
|
@@ -166,8 +158,8 @@ async function handleWorkflowAgentSteerBody(req, res, url, ctx, miss) {
|
|
|
166
158
|
sendPrincipalRefusal(res, req, deps.config);
|
|
167
159
|
return;
|
|
168
160
|
}
|
|
169
|
-
const wfRunId = safeDecode(
|
|
170
|
-
const label = safeDecode(
|
|
161
|
+
const wfRunId = safeDecode(match.params.runId);
|
|
162
|
+
const label = safeDecode(match.params.label);
|
|
171
163
|
if (wfRunId === null || label === null) {
|
|
172
164
|
sendError(res, 400, "request.path_malformed", "malformed workflow path (invalid percent-encoding)");
|
|
173
165
|
return;
|
|
@@ -227,7 +219,6 @@ async function handleWorkflowAgentSteerBody(req, res, url, ctx, miss) {
|
|
|
227
219
|
: `workflow is ${wfRun.status} — agent is not running`);
|
|
228
220
|
return;
|
|
229
221
|
}
|
|
230
|
-
miss.fell = true;
|
|
231
222
|
}
|
|
232
223
|
const LegApprovalKeysSchema = z
|
|
233
224
|
.object({
|
|
@@ -397,4 +388,13 @@ async function streamWorkflowRun(req, res, runId, scope) {
|
|
|
397
388
|
if (!res.writableEnded)
|
|
398
389
|
res.end();
|
|
399
390
|
}
|
|
391
|
+
export const WORKFLOWS_ROUTES = [
|
|
392
|
+
{ id: "workflows-list", path: "/v1/workflows", methods: ["GET"] },
|
|
393
|
+
{ id: "workflow-stream", pattern: /^\/v1\/workflows\/(?<runId>[^/]+)\/stream$/, label: "/v1/workflows/:id/$sub", methods: ["GET"] },
|
|
394
|
+
{ id: "workflow-journal", pattern: /^\/v1\/workflows\/(?<runId>[^/]+)\/journal$/, label: "/v1/workflows/:id/$sub", methods: ["GET"] },
|
|
395
|
+
{ id: "workflow-detail", pattern: /^\/v1\/workflows\/(?<runId>[^/]+)$/, label: "/v1/workflows/:id", methods: ["GET"] },
|
|
396
|
+
];
|
|
397
|
+
export const WORKFLOW_AGENT_STEER_ROUTES = [
|
|
398
|
+
{ id: "workflow-agent-steer", pattern: /^\/v1\/workflows\/(?<runId>[^/]+)\/agents\/(?<label>[^/]+)\/steer$/, label: "/v1/workflows/:id/agents/:aid/steer", methods: ["POST"] },
|
|
399
|
+
];
|
|
400
400
|
//# sourceMappingURL=workflows.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/server",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.80.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",
|