@sema-agent/server 1.311.0 → 1.313.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/auth-keys.d.ts +14 -0
- package/dist/auth-keys.js +31 -0
- package/dist/brain.d.ts +1 -1
- package/dist/capabilities/select-environment-tool.d.ts +1 -1
- package/dist/config-types.d.ts +306 -0
- package/dist/config-types.js +2 -0
- package/dist/config.d.ts +4 -305
- package/dist/config.js +1 -1
- package/dist/env-facts.d.ts +1 -1
- package/dist/fleet/fleet-bus.d.ts +1 -0
- package/dist/fleet/fleet-bus.js +1 -0
- package/dist/hooks/hook-llm.d.ts +1 -1
- package/dist/http/server.d.ts +5 -85
- package/dist/http/wire-types.d.ts +84 -0
- package/dist/http/wire-types.js +2 -0
- package/dist/images/manifest.d.ts +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/per-task-image.d.ts +2 -2
- package/dist/plugins/file-run-store.d.ts +1 -1
- package/dist/plugins/local-session-store.d.ts +2 -2
- package/dist/plugins/local-session-store.js +1 -1
- package/dist/plugins/mailbox-store-sql.d.ts +2 -2
- package/dist/plugins/mailbox-store-sql.js +8 -4
- package/dist/plugins/memory-run-store.d.ts +1 -1
- package/dist/plugins/pg-image-bake.d.ts +2 -2
- package/dist/plugins/pg-image-bake.js +1 -1
- package/dist/plugins/pg-image-index.d.ts +2 -2
- package/dist/plugins/pg-image-index.js +1 -1
- package/dist/plugins/pg-pool.d.ts +1 -1
- package/dist/plugins/pg-run-store.d.ts +1 -1
- package/dist/plugins/pg-run-store.js +1 -1
- package/dist/plugins/pg-session-storage.d.ts +2 -2
- package/dist/plugins/pg-session-storage.js +2 -2
- package/dist/plugins/pg-tool-result-store.js +1 -1
- package/dist/plugins/session-store.d.ts +1 -1
- package/dist/plugins/sql-escape.d.ts +2 -0
- package/dist/plugins/sql-escape.js +4 -0
- package/dist/plugins/store-backend.d.ts +1 -1
- package/dist/plugins/store-contracts.d.ts +205 -0
- package/dist/plugins/store-contracts.js +61 -0
- package/dist/plugins/tidb-image-bake.d.ts +3 -95
- package/dist/plugins/tidb-image-bake.js +3 -35
- package/dist/plugins/tidb-image-index.d.ts +3 -76
- package/dist/plugins/tidb-image-index.js +2 -26
- package/dist/plugins/tidb-pool.d.ts +1 -1
- package/dist/plugins/tidb-run-store.d.ts +2 -32
- package/dist/plugins/tidb-run-store.js +1 -1
- package/dist/plugins/tidb-session-store.d.ts +2 -2
- package/dist/plugins/tidb-session-store.js +2 -2
- package/dist/plugins/tidb-tool-result-store.d.ts +1 -1
- package/dist/plugins/tidb-tool-result-store.js +2 -3
- package/dist/security.d.ts +6 -16
- package/dist/security.js +1 -30
- package/dist/sema-registry.d.ts +1 -1
- package/dist/session-sync-kernel.d.ts +47 -0
- package/dist/session-sync-kernel.js +47 -0
- package/dist/session-sync.d.ts +3 -45
- package/dist/session-sync.js +2 -46
- package/dist/trace/artifacts.d.ts +1 -1
- package/dist/trace/core-keyset-guard.d.ts +2 -2
- package/dist/trace/project.d.ts +2 -1
- package/dist/trace/project.js +1 -0
- package/package.json +2 -2
package/dist/security.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { IncomingMessage } from "node:http";
|
|
2
2
|
import { FileMemoryEngineBackend, type SessionStore, type SessionTreeEntry } from "@sema-agent/core";
|
|
3
|
-
import type { ServiceConfig } from "./config.js";
|
|
4
|
-
import type { TaskRequestBody } from "./http/
|
|
5
|
-
import type { StagingHandle } from "./session-sync.js";
|
|
3
|
+
import type { ServiceConfig } from "./config-types.js";
|
|
4
|
+
import type { TaskRequestBody } from "./http/wire-types.js";
|
|
5
|
+
import type { StagingHandle } from "./session-sync-kernel.js";
|
|
6
|
+
import type { ApprovalHmacKey, PrincipalJwtKey } from "./auth-keys.js";
|
|
7
|
+
export { parseApprovalHmacKeys, parsePrincipalJwks } from "./auth-keys.js";
|
|
8
|
+
export type { ApprovalHmacKey, PrincipalJwtKey } from "./auth-keys.js";
|
|
6
9
|
export interface SessionListItem {
|
|
7
10
|
sessionId: string;
|
|
8
11
|
owner: string | null;
|
|
@@ -92,12 +95,6 @@ export declare function memorySpecForRequest(scope: string | undefined, memoryWr
|
|
|
92
95
|
writeScope?: string | null;
|
|
93
96
|
scopeContract?: "v2";
|
|
94
97
|
} | undefined;
|
|
95
|
-
export interface ApprovalHmacKey {
|
|
96
|
-
kid: string;
|
|
97
|
-
key: string;
|
|
98
|
-
status?: "active" | "retiring";
|
|
99
|
-
}
|
|
100
|
-
export declare function parseApprovalHmacKeys(raw: string | undefined): ApprovalHmacKey[];
|
|
101
98
|
export declare function approvalHmacMessage(env: {
|
|
102
99
|
sessionId: string;
|
|
103
100
|
boundCallId?: string | null;
|
|
@@ -113,13 +110,6 @@ export declare function verifyApprovalHmac(env: {
|
|
|
113
110
|
decision: string;
|
|
114
111
|
reason?: string | null;
|
|
115
112
|
}, mac: string, kid: string | undefined, keys: ApprovalHmacKey[]): boolean;
|
|
116
|
-
export interface PrincipalJwtKey {
|
|
117
|
-
kid: string;
|
|
118
|
-
alg: "EdDSA" | "RS256" | "ES256";
|
|
119
|
-
key: string;
|
|
120
|
-
status?: "active" | "retiring";
|
|
121
|
-
}
|
|
122
|
-
export declare function parsePrincipalJwks(raw: string | undefined): PrincipalJwtKey[];
|
|
123
113
|
export declare function verifyPrincipalJwt(token: string, keys: PrincipalJwtKey[], expect: {
|
|
124
114
|
iss: string;
|
|
125
115
|
aud: string;
|
package/dist/security.js
CHANGED
|
@@ -2,6 +2,7 @@ import { createHash, createHmac, createPublicKey, timingSafeEqual, verify as cry
|
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { uuidv7, FileMemoryEngineBackend, resolveMemoryEngineRoot, deriveControlPlaneDir, formatUserScope, formatProjScope } from "@sema-agent/core";
|
|
4
4
|
import { PROJECT_ID_REGEX } from "@sema-agent/registry-core";
|
|
5
|
+
export { parseApprovalHmacKeys, parsePrincipalJwks } from "./auth-keys.js";
|
|
5
6
|
const UUIDV7_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
|
6
7
|
export function isUuidV7(s) {
|
|
7
8
|
return UUIDV7_RE.test(s);
|
|
@@ -162,19 +163,6 @@ export function memorySpecForRequest(scope, memoryWrite, defaultScopes) {
|
|
|
162
163
|
const v2 = isV2(scope) || extras.some(isV2) ? { scopeContract: "v2" } : {};
|
|
163
164
|
return memoryWrite === false ? { scope, ...layered, writeScope: null, ...v2 } : { scope, ...layered, ...v2 };
|
|
164
165
|
}
|
|
165
|
-
export function parseApprovalHmacKeys(raw) {
|
|
166
|
-
if (!raw)
|
|
167
|
-
return [];
|
|
168
|
-
try {
|
|
169
|
-
const v = JSON.parse(raw);
|
|
170
|
-
if (!Array.isArray(v))
|
|
171
|
-
return [];
|
|
172
|
-
return v.filter((k) => !!k && typeof k.kid === "string" && typeof k.key === "string");
|
|
173
|
-
}
|
|
174
|
-
catch {
|
|
175
|
-
return [];
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
166
|
export function approvalHmacMessage(env) {
|
|
179
167
|
return JSON.stringify([env.sessionId, env.boundCallId ?? null, env.boundInputHash ?? null, env.decision, env.reason ?? null]);
|
|
180
168
|
}
|
|
@@ -200,23 +188,6 @@ export function verifyApprovalHmac(env, mac, kid, keys) {
|
|
|
200
188
|
}
|
|
201
189
|
return false;
|
|
202
190
|
}
|
|
203
|
-
export function parsePrincipalJwks(raw) {
|
|
204
|
-
if (!raw)
|
|
205
|
-
return [];
|
|
206
|
-
const ALGS = new Set(["EdDSA", "RS256", "ES256"]);
|
|
207
|
-
try {
|
|
208
|
-
const v = JSON.parse(raw);
|
|
209
|
-
if (!Array.isArray(v))
|
|
210
|
-
return [];
|
|
211
|
-
return v.filter((k) => {
|
|
212
|
-
const e = k;
|
|
213
|
-
return !!e && typeof e.kid === "string" && typeof e.key === "string" && typeof e.alg === "string" && ALGS.has(e.alg);
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
catch {
|
|
217
|
-
return [];
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
191
|
function b64urlToBuf(s) {
|
|
221
192
|
return Buffer.from(s, "base64url");
|
|
222
193
|
}
|
package/dist/sema-registry.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { McpServerSpec } from "@sema-agent/core";
|
|
2
2
|
import { type EntitlementRuntimeCaps } from "@sema-agent/registry-core";
|
|
3
|
-
import type { ScopedMcpServer, ServiceConfig } from "./config.js";
|
|
3
|
+
import type { ScopedMcpServer, ServiceConfig } from "./config-types.js";
|
|
4
4
|
import { type SealedKeyOpener } from "./sealed-key.js";
|
|
5
5
|
import type { Autonomy, CommandRule } from "./runtime-governance.js";
|
|
6
6
|
import type { Logger } from "./observability/logger.js";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { SessionTreeEntry } from "@sema-agent/core";
|
|
2
|
+
export interface StagingHandle {
|
|
3
|
+
readonly stagingId: string;
|
|
4
|
+
readonly realSessionId: string;
|
|
5
|
+
appendBatch(entries: SessionTreeEntry[]): Promise<void>;
|
|
6
|
+
commit(owner: string | null, opts?: {
|
|
7
|
+
resolution?: "overwrite-dst";
|
|
8
|
+
}): Promise<{
|
|
9
|
+
relation: SyncRelation["relation"];
|
|
10
|
+
}>;
|
|
11
|
+
abort(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export type ImportStagingStore = {
|
|
14
|
+
beginImportStaging(realSessionId: string, token: string): StagingHandle;
|
|
15
|
+
sweepStagingSessions?(): Promise<number>;
|
|
16
|
+
};
|
|
17
|
+
export declare function stagingIdFor(realSessionId: string, token: string): string;
|
|
18
|
+
export declare const STAGING_ID_MARKER = "#stg-";
|
|
19
|
+
export declare function realIdOfStaging(stagingId: string): string | null;
|
|
20
|
+
export type SyncRelation = {
|
|
21
|
+
relation: "fresh";
|
|
22
|
+
} | {
|
|
23
|
+
relation: "identical";
|
|
24
|
+
} | {
|
|
25
|
+
relation: "fast_forward";
|
|
26
|
+
newEntryIds: string[];
|
|
27
|
+
} | {
|
|
28
|
+
relation: "stale";
|
|
29
|
+
dstAheadBy: string[];
|
|
30
|
+
} | {
|
|
31
|
+
relation: "fork";
|
|
32
|
+
commonAncestor: string | null;
|
|
33
|
+
srcExclusive: string[];
|
|
34
|
+
dstExclusive: string[];
|
|
35
|
+
};
|
|
36
|
+
export declare function classifySyncRelationship(srcEntries: SessionTreeEntry[], dstEntries: SessionTreeEntry[] | null): SyncRelation;
|
|
37
|
+
export declare function classifySyncRelationshipByIds(srcIds: string[], dstIds: string[] | null): SyncRelation;
|
|
38
|
+
export declare class SyncConflictError extends Error {
|
|
39
|
+
readonly sessionId: string;
|
|
40
|
+
readonly relation: Extract<SyncRelation, {
|
|
41
|
+
relation: "fork" | "stale";
|
|
42
|
+
}>;
|
|
43
|
+
constructor(sessionId: string, relation: Extract<SyncRelation, {
|
|
44
|
+
relation: "fork" | "stale";
|
|
45
|
+
}>);
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=session-sync-kernel.d.ts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export function stagingIdFor(realSessionId, token) {
|
|
2
|
+
return `${realSessionId}#stg-${token}`;
|
|
3
|
+
}
|
|
4
|
+
export const STAGING_ID_MARKER = "#stg-";
|
|
5
|
+
export function realIdOfStaging(stagingId) {
|
|
6
|
+
const i = stagingId.indexOf(STAGING_ID_MARKER);
|
|
7
|
+
return i < 0 ? null : stagingId.slice(0, i);
|
|
8
|
+
}
|
|
9
|
+
export function classifySyncRelationship(srcEntries, dstEntries) {
|
|
10
|
+
return classifySyncRelationshipByIds(srcEntries.map((e) => e.id), dstEntries === null ? null : dstEntries.map((e) => e.id));
|
|
11
|
+
}
|
|
12
|
+
export function classifySyncRelationshipByIds(srcIds, dstIds) {
|
|
13
|
+
if (dstIds === null || dstIds.length === 0)
|
|
14
|
+
return { relation: "fresh" };
|
|
15
|
+
const srcSet = new Set(srcIds);
|
|
16
|
+
const dstSet = new Set(dstIds);
|
|
17
|
+
if (srcSet.size === dstSet.size && [...srcSet].every((id) => dstSet.has(id)))
|
|
18
|
+
return { relation: "identical" };
|
|
19
|
+
const allDstInSrc = [...dstSet].every((id) => srcSet.has(id));
|
|
20
|
+
const allSrcInDst = [...srcSet].every((id) => dstSet.has(id));
|
|
21
|
+
if (allDstInSrc && !allSrcInDst) {
|
|
22
|
+
const newEntryIds = srcIds.filter((id) => !dstSet.has(id));
|
|
23
|
+
return { relation: "fast_forward", newEntryIds };
|
|
24
|
+
}
|
|
25
|
+
if (allSrcInDst && !allDstInSrc) {
|
|
26
|
+
const dstAheadBy = dstIds.filter((id) => !srcSet.has(id));
|
|
27
|
+
return { relation: "stale", dstAheadBy };
|
|
28
|
+
}
|
|
29
|
+
const srcExclusive = srcIds.filter((id) => !dstSet.has(id));
|
|
30
|
+
const dstExclusive = dstIds.filter((id) => !srcSet.has(id));
|
|
31
|
+
let commonAncestor = null;
|
|
32
|
+
for (const id of srcIds)
|
|
33
|
+
if (dstSet.has(id))
|
|
34
|
+
commonAncestor = id;
|
|
35
|
+
return { relation: "fork", commonAncestor, srcExclusive, dstExclusive };
|
|
36
|
+
}
|
|
37
|
+
export class SyncConflictError extends Error {
|
|
38
|
+
sessionId;
|
|
39
|
+
relation;
|
|
40
|
+
constructor(sessionId, relation) {
|
|
41
|
+
super(`session-sync: refusing to import session ${sessionId} — ${relation.relation} (would lose destination history; resolve explicitly)`);
|
|
42
|
+
this.sessionId = sessionId;
|
|
43
|
+
this.relation = relation;
|
|
44
|
+
this.name = "SyncConflictError";
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=session-sync-kernel.js.map
|
package/dist/session-sync.d.ts
CHANGED
|
@@ -1,51 +1,9 @@
|
|
|
1
1
|
import type { StoreBackend } from "./plugins/store-backend.js";
|
|
2
|
+
import { type SyncRelation } from "./session-sync-kernel.js";
|
|
2
3
|
import type { SessionTreeEntry, SessionRulesRecord } from "@sema-agent/core";
|
|
3
4
|
export type BlobGetter = (hash: string) => Promise<Uint8Array | undefined>;
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
readonly realSessionId: string;
|
|
7
|
-
appendBatch(entries: SessionTreeEntry[]): Promise<void>;
|
|
8
|
-
commit(owner: string | null, opts?: {
|
|
9
|
-
resolution?: "overwrite-dst";
|
|
10
|
-
}): Promise<{
|
|
11
|
-
relation: SyncRelation["relation"];
|
|
12
|
-
}>;
|
|
13
|
-
abort(): Promise<void>;
|
|
14
|
-
}
|
|
15
|
-
export type ImportStagingStore = {
|
|
16
|
-
beginImportStaging(realSessionId: string, token: string): StagingHandle;
|
|
17
|
-
sweepStagingSessions?(): Promise<number>;
|
|
18
|
-
};
|
|
19
|
-
export declare function stagingIdFor(realSessionId: string, token: string): string;
|
|
20
|
-
export declare const STAGING_ID_MARKER = "#stg-";
|
|
21
|
-
export declare function realIdOfStaging(stagingId: string): string | null;
|
|
22
|
-
export type SyncRelation = {
|
|
23
|
-
relation: "fresh";
|
|
24
|
-
} | {
|
|
25
|
-
relation: "identical";
|
|
26
|
-
} | {
|
|
27
|
-
relation: "fast_forward";
|
|
28
|
-
newEntryIds: string[];
|
|
29
|
-
} | {
|
|
30
|
-
relation: "stale";
|
|
31
|
-
dstAheadBy: string[];
|
|
32
|
-
} | {
|
|
33
|
-
relation: "fork";
|
|
34
|
-
commonAncestor: string | null;
|
|
35
|
-
srcExclusive: string[];
|
|
36
|
-
dstExclusive: string[];
|
|
37
|
-
};
|
|
38
|
-
export declare function classifySyncRelationship(srcEntries: SessionTreeEntry[], dstEntries: SessionTreeEntry[] | null): SyncRelation;
|
|
39
|
-
export declare function classifySyncRelationshipByIds(srcIds: string[], dstIds: string[] | null): SyncRelation;
|
|
40
|
-
export declare class SyncConflictError extends Error {
|
|
41
|
-
readonly sessionId: string;
|
|
42
|
-
readonly relation: Extract<SyncRelation, {
|
|
43
|
-
relation: "fork" | "stale";
|
|
44
|
-
}>;
|
|
45
|
-
constructor(sessionId: string, relation: Extract<SyncRelation, {
|
|
46
|
-
relation: "fork" | "stale";
|
|
47
|
-
}>);
|
|
48
|
-
}
|
|
5
|
+
export { stagingIdFor, STAGING_ID_MARKER, realIdOfStaging, classifySyncRelationship, classifySyncRelationshipByIds, SyncConflictError } from "./session-sync-kernel.js";
|
|
6
|
+
export type { StagingHandle, ImportStagingStore, SyncRelation } from "./session-sync-kernel.js";
|
|
49
7
|
export interface SessionBundle {
|
|
50
8
|
sessionId: string;
|
|
51
9
|
entries: SessionTreeEntry[];
|
package/dist/session-sync.js
CHANGED
|
@@ -1,51 +1,7 @@
|
|
|
1
1
|
import { identicalIdsAlsoIdenticalContent } from "./session-sync-content.js";
|
|
2
|
+
import { classifySyncRelationship, SyncConflictError } from "./session-sync-kernel.js";
|
|
2
3
|
import { validateEntriesForImport, normalizeRules, stripRev } from "@sema-agent/core";
|
|
3
|
-
export
|
|
4
|
-
return `${realSessionId}#stg-${token}`;
|
|
5
|
-
}
|
|
6
|
-
export const STAGING_ID_MARKER = "#stg-";
|
|
7
|
-
export function realIdOfStaging(stagingId) {
|
|
8
|
-
const i = stagingId.indexOf(STAGING_ID_MARKER);
|
|
9
|
-
return i < 0 ? null : stagingId.slice(0, i);
|
|
10
|
-
}
|
|
11
|
-
export function classifySyncRelationship(srcEntries, dstEntries) {
|
|
12
|
-
return classifySyncRelationshipByIds(srcEntries.map((e) => e.id), dstEntries === null ? null : dstEntries.map((e) => e.id));
|
|
13
|
-
}
|
|
14
|
-
export function classifySyncRelationshipByIds(srcIds, dstIds) {
|
|
15
|
-
if (dstIds === null || dstIds.length === 0)
|
|
16
|
-
return { relation: "fresh" };
|
|
17
|
-
const srcSet = new Set(srcIds);
|
|
18
|
-
const dstSet = new Set(dstIds);
|
|
19
|
-
if (srcSet.size === dstSet.size && [...srcSet].every((id) => dstSet.has(id)))
|
|
20
|
-
return { relation: "identical" };
|
|
21
|
-
const allDstInSrc = [...dstSet].every((id) => srcSet.has(id));
|
|
22
|
-
const allSrcInDst = [...srcSet].every((id) => dstSet.has(id));
|
|
23
|
-
if (allDstInSrc && !allSrcInDst) {
|
|
24
|
-
const newEntryIds = srcIds.filter((id) => !dstSet.has(id));
|
|
25
|
-
return { relation: "fast_forward", newEntryIds };
|
|
26
|
-
}
|
|
27
|
-
if (allSrcInDst && !allDstInSrc) {
|
|
28
|
-
const dstAheadBy = dstIds.filter((id) => !srcSet.has(id));
|
|
29
|
-
return { relation: "stale", dstAheadBy };
|
|
30
|
-
}
|
|
31
|
-
const srcExclusive = srcIds.filter((id) => !dstSet.has(id));
|
|
32
|
-
const dstExclusive = dstIds.filter((id) => !srcSet.has(id));
|
|
33
|
-
let commonAncestor = null;
|
|
34
|
-
for (const id of srcIds)
|
|
35
|
-
if (dstSet.has(id))
|
|
36
|
-
commonAncestor = id;
|
|
37
|
-
return { relation: "fork", commonAncestor, srcExclusive, dstExclusive };
|
|
38
|
-
}
|
|
39
|
-
export class SyncConflictError extends Error {
|
|
40
|
-
sessionId;
|
|
41
|
-
relation;
|
|
42
|
-
constructor(sessionId, relation) {
|
|
43
|
-
super(`session-sync: refusing to import session ${sessionId} — ${relation.relation} (would lose destination history; resolve explicitly)`);
|
|
44
|
-
this.sessionId = sessionId;
|
|
45
|
-
this.relation = relation;
|
|
46
|
-
this.name = "SyncConflictError";
|
|
47
|
-
}
|
|
48
|
-
}
|
|
4
|
+
export { stagingIdFor, STAGING_ID_MARKER, realIdOfStaging, classifySyncRelationship, classifySyncRelationshipByIds, SyncConflictError } from "./session-sync-kernel.js";
|
|
49
5
|
function ownerAware(backend) {
|
|
50
6
|
return backend.session();
|
|
51
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { TaskNotificationPayload, BackgroundChildEvent, RosterEntry, AskRequest, TaskEvent } from "@sema-agent/core";
|
|
2
2
|
type AssertAllKeysHandled<T extends never> = T;
|
|
3
|
-
type NotificationProjected = "task_id" | "task_type" | "toolUseId" | "status" | "summary" | "result" | "output_file" | "usage" | "sessionId" | "seq" | "lines" | "stoppedBy" | "source" | "exitCode" | "partial" | "diagnostics" | "recentSteps" | "editedFiles" | "resumable";
|
|
3
|
+
type NotificationProjected = "task_id" | "task_type" | "toolUseId" | "status" | "summary" | "result" | "output_file" | "usage" | "sessionId" | "seq" | "lines" | "stoppedBy" | "source" | "exitCode" | "partial" | "diagnostics" | "recentSteps" | "editedFiles" | "resumable" | "completionId";
|
|
4
4
|
type _GuardNotification = AssertAllKeysHandled<Exclude<keyof TaskNotificationPayload, NotificationProjected>>;
|
|
5
|
-
type BgNotifProjected = "taskId" | "sessionId" | "seq" | "status" | "summary" | "stoppedBy" | "resumable" | "recentSteps" | "editedFiles" | "usage" | "transcriptId" | "rootSessionId" | "parentTaskId" | "parentToolCallId";
|
|
5
|
+
type BgNotifProjected = "taskId" | "sessionId" | "seq" | "status" | "summary" | "stoppedBy" | "resumable" | "recentSteps" | "editedFiles" | "usage" | "transcriptId" | "rootSessionId" | "parentTaskId" | "parentToolCallId" | "completionId";
|
|
6
6
|
type BgNotifExcluded = "kind" | "sessionScoped" | "owner" | "scope" | "description" | "agentType" | "name" | "currentAction" | "currentTool" | "parentSessionId" | "startedAt" | "workflowRunId" | "progressTaskId" | "progressParentTaskId";
|
|
7
7
|
type _GuardBgNotif = AssertAllKeysHandled<Exclude<keyof BackgroundChildEvent, BgNotifProjected | BgNotifExcluded>>;
|
|
8
8
|
type RosterProjected = "name" | "agentId" | "sessionId" | "toolUseId" | "owner" | "scope" | "sessionScoped" | "rootSessionId" | "model" | "createdAt";
|
package/dist/trace/project.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TaskResult } from "@sema-agent/core";
|
|
2
|
-
import type { RunEvent, RunRecord } from "../plugins/
|
|
2
|
+
import type { RunEvent, RunRecord } from "../plugins/store-contracts.js";
|
|
3
3
|
import type { ModelUsageDelta, ModelUsageTracker, PromptManifestRecord } from "../budget.js";
|
|
4
4
|
type AppendFn = (type: string, data: unknown) => Promise<void>;
|
|
5
5
|
type GetEventsFn = (taskId: string, afterSeq: number) => Promise<RunEvent[]>;
|
|
@@ -108,6 +108,7 @@ export declare function taskNotificationEventData(ev: {
|
|
|
108
108
|
edits: number;
|
|
109
109
|
}>;
|
|
110
110
|
resumable?: boolean;
|
|
111
|
+
completionId?: string;
|
|
111
112
|
};
|
|
112
113
|
eventId?: string;
|
|
113
114
|
parentToolCallId?: string;
|
package/dist/trace/project.js
CHANGED
|
@@ -92,6 +92,7 @@ export function taskNotificationEventData(ev) {
|
|
|
92
92
|
...(n.seq !== undefined ? { seq: n.seq } : {}),
|
|
93
93
|
...(n.lines !== undefined ? { lines: n.lines.map((l) => redactSecrets(l)) } : {}),
|
|
94
94
|
...(n.stoppedBy !== undefined ? { stoppedBy: n.stoppedBy } : {}),
|
|
95
|
+
...(n.completionId !== undefined ? { completionId: n.completionId } : {}),
|
|
95
96
|
...(n.source !== undefined ? { source: redactSecrets(n.source) } : {}),
|
|
96
97
|
...(n.exitCode !== undefined ? { exitCode: n.exitCode } : {}),
|
|
97
98
|
...(n.partial !== undefined ? { partial: n.partial } : {}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.313.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": "^1.
|
|
54
|
+
"@sema-agent/core": "^1.452.0",
|
|
55
55
|
"@sema-agent/registry-core": "^0.10.21",
|
|
56
56
|
"e2b": "^2.28.0",
|
|
57
57
|
"libsodium-wrappers": "^0.8.4",
|