@agentstep/agent-sdk 0.5.35 → 0.5.37
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/{chunk-75US4UAE.js → chunk-2E43SH4Y.js} +1 -1
- package/dist/{chunk-QZE37OGX.js → chunk-2HTAIROL.js} +1 -1
- package/dist/{chunk-SAI6LBXW.js → chunk-2HVY2WZL.js} +79 -5
- package/dist/{chunk-ZHEE6UTX.js → chunk-2YZUXJAN.js} +1 -1
- package/dist/{chunk-GABMXDZZ.js → chunk-2Z4T32WO.js} +1 -1
- package/dist/{chunk-SUEPFZN2.js → chunk-3CDJ2VQN.js} +1 -1
- package/dist/{chunk-XXAO5YYL.js → chunk-3IO3EGWP.js} +1 -1
- package/dist/{chunk-HHLVVJGT.js → chunk-3RK6EX7J.js} +1 -1
- package/dist/{chunk-3LYNN5VT.js → chunk-3WPVSQGI.js} +1 -1
- package/dist/{chunk-SWGCL54X.js → chunk-3XGUMXGR.js} +132 -132
- package/dist/{chunk-ZAUWB5DQ.js → chunk-4XB2CJPE.js} +1 -1
- package/dist/{chunk-6NFK5RJX.js → chunk-52K3LOFD.js} +1 -1
- package/dist/{chunk-AD2WPGDN.js → chunk-5BIX3H2D.js} +1 -1
- package/dist/{chunk-K3LM6O44.js → chunk-AE7UG76I.js} +1 -1
- package/dist/{chunk-NQ6BN7WH.js → chunk-BVBVWMQS.js} +16 -9
- package/dist/{chunk-IMJTHYN3.js → chunk-CCNG7D6Y.js} +1 -1
- package/dist/{chunk-LR6FK2J7.js → chunk-DQIQBMC2.js} +1 -1
- package/dist/{chunk-JIXRTWYL.js → chunk-FH2IOAQM.js} +1 -1
- package/dist/{chunk-ZACPJA3G.js → chunk-HGV3Y4PS.js} +1 -1
- package/dist/{chunk-VQM2MCQR.js → chunk-JFIJEF4N.js} +2 -2
- package/dist/{chunk-FCPZF7KJ.js → chunk-L2ZB7TCF.js} +1 -1
- package/dist/{chunk-2R4IT7HG.js → chunk-L7X2UMNJ.js} +2 -2
- package/dist/{chunk-YKPRNV6J.js → chunk-LJ2ZXLLT.js} +2 -4
- package/dist/{chunk-GBBQD6VY.js → chunk-MG2DS6QE.js} +1 -1
- package/dist/{chunk-GFZ2WIVH.js → chunk-NO77URFL.js} +1 -1
- package/dist/{chunk-OEYLPPID.js → chunk-OMGJEZJS.js} +2 -2
- package/dist/{chunk-6CODFATQ.js → chunk-PUAK45BO.js} +2 -2
- package/dist/{chunk-X7UWCDYG.js → chunk-PULMO5OO.js} +1 -1
- package/dist/{chunk-PWLWDWRL.js → chunk-R43A2QH7.js} +171 -2
- package/dist/{chunk-BSAF4YJB.js → chunk-R6NWAM37.js} +4 -4
- package/dist/{chunk-3EI7IPMI.js → chunk-R7MZNZNC.js} +1 -1
- package/dist/{chunk-4EKHW6VS.js → chunk-RMCBO7K7.js} +5 -3
- package/dist/{chunk-LKHJLSYG.js → chunk-SP26BYYZ.js} +2 -2
- package/dist/{chunk-6NEWWPL4.js → chunk-TBLHBMA5.js} +1 -1
- package/dist/{chunk-JDAOTVWV.js → chunk-VIWYYVGR.js} +1 -1
- package/dist/{chunk-IYE5USSW.js → chunk-VRWXVIIG.js} +10 -2
- package/dist/{chunk-3EWEKBVC.js → chunk-VWCIN45Y.js} +1 -1
- package/dist/{chunk-CZ4N5FJW.js → chunk-W3DA3OFL.js} +1 -1
- package/dist/{chunk-FHOJOLXU.js → chunk-XLVZ5236.js} +1 -1
- package/dist/{chunk-KYKVHH7I.js → chunk-YAJJ7KHX.js} +1 -1
- package/dist/{chunk-P7V3S2T3.js → chunk-ZDURV2LI.js} +4 -4
- package/dist/{chunk-25E64UIV.js → chunk-ZPTYXWUO.js} +1 -1
- package/dist/containers/lifecycle.js +1 -1
- package/dist/db/files.js +1 -1
- package/dist/handlers/agents.js +7 -7
- package/dist/handlers/api_keys.js +7 -7
- package/dist/handlers/audit.js +7 -7
- package/dist/handlers/batch.js +7 -7
- package/dist/handlers/credentials.js +8 -8
- package/dist/handlers/enrollment.js +7 -7
- package/dist/handlers/environments.js +7 -7
- package/dist/handlers/events.js +7 -7
- package/dist/handlers/files.js +8 -8
- package/dist/handlers/google-compat/agents.js +7 -7
- package/dist/handlers/google-compat/files.js +7 -7
- package/dist/handlers/google-compat/index.js +9 -9
- package/dist/handlers/google-compat/interactions.js +7 -7
- package/dist/handlers/index.js +43 -43
- package/dist/handlers/license.js +7 -7
- package/dist/handlers/memory.js +7 -7
- package/dist/handlers/metrics.js +7 -7
- package/dist/handlers/models.js +7 -7
- package/dist/handlers/openapi.js +3 -3
- package/dist/handlers/providers.js +7 -7
- package/dist/handlers/resources.js +7 -7
- package/dist/handlers/sessions.js +8 -8
- package/dist/handlers/settings.js +7 -7
- package/dist/handlers/skills-write.js +7 -7
- package/dist/handlers/skills.js +7 -7
- package/dist/handlers/stream.js +6 -6
- package/dist/handlers/tenants.js +7 -7
- package/dist/handlers/threads.js +7 -7
- package/dist/handlers/traces.js +7 -7
- package/dist/handlers/ui.js +1 -1
- package/dist/handlers/upstream_keys.js +7 -7
- package/dist/handlers/user-profiles.js +7 -7
- package/dist/handlers/vaults.js +7 -7
- package/dist/handlers/whoami.js +7 -7
- package/dist/handlers/work.js +7 -7
- package/dist/http.js +6 -6
- package/dist/index.js +9 -9
- package/dist/init.js +5 -5
- package/dist/openapi/schemas.js +15 -1
- package/dist/openapi/spec.js +2 -2
- package/dist/sessions/driver.js +2 -2
- package/dist/sessions/sweeper.js +2 -2
- package/dist/sessions/threads.js +2 -2
- package/dist/shutdown.js +3 -3
- package/dist/sync/anthropic.js +1 -1
- package/dist/sync/container-file-sync.js +1 -1
- package/dist/sync/file-sync.js +1 -1
- package/dist/workers/runner.js +3 -3
- package/package.json +1 -1
- package/dist/handlers/ui.d.ts +0 -6
- package/dist/handlers/ui.d.ts.map +0 -1
- /package/dist/{chunk-ZCCHLDLC.js → chunk-IL2CZHNC.js} +0 -0
- /package/dist/{chunk-AUEKXYNE.js → chunk-VCU64NHY.js} +0 -0
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
jsonOk,
|
|
9
9
|
paginatedOk,
|
|
10
10
|
routeWrap
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-RMCBO7K7.js";
|
|
12
12
|
import {
|
|
13
13
|
forwardToAnthropic,
|
|
14
14
|
validateAnthropicProxy
|
|
@@ -220,7 +220,10 @@ async function resolveSkillInputs(skills, nowIso) {
|
|
|
220
220
|
}
|
|
221
221
|
var CreateSchema = z.object({
|
|
222
222
|
name: z.string().min(1),
|
|
223
|
-
model: z.
|
|
223
|
+
model: z.union([
|
|
224
|
+
z.string().min(1).transform((s) => ({ id: s })),
|
|
225
|
+
z.object({ id: z.string().min(1), speed: z.enum(["standard", "fast"]).optional() })
|
|
226
|
+
]),
|
|
224
227
|
description: z.string().max(2048).optional(),
|
|
225
228
|
metadata: z.record(z.string(), z.string().max(512)).optional(),
|
|
226
229
|
system: z.string().nullish(),
|
|
@@ -276,7 +279,10 @@ var CreateSchema = z.object({
|
|
|
276
279
|
var UpdateSchema = z.object({
|
|
277
280
|
version: z.number().int().min(1),
|
|
278
281
|
name: z.string().min(1).optional(),
|
|
279
|
-
model: z.
|
|
282
|
+
model: z.union([
|
|
283
|
+
z.string().min(1).transform((s) => ({ id: s })),
|
|
284
|
+
z.object({ id: z.string().min(1), speed: z.enum(["standard", "fast"]).optional() })
|
|
285
|
+
]).optional(),
|
|
280
286
|
description: z.string().max(2048).optional(),
|
|
281
287
|
metadata: z.record(z.string(), z.string().max(512)).optional(),
|
|
282
288
|
system: z.string().nullish(),
|
|
@@ -351,7 +357,7 @@ function handleCreateAgent(request) {
|
|
|
351
357
|
}
|
|
352
358
|
const backend = resolveBackend(backendName);
|
|
353
359
|
const modelId = parsed.data.model.id;
|
|
354
|
-
const modelSpeed = parsed.data.model.speed;
|
|
360
|
+
const modelSpeed = "speed" in parsed.data.model ? parsed.data.model.speed : void 0;
|
|
355
361
|
const { isValidModelForEngine, FALLBACK_MODELS } = await import("./backends/models.js");
|
|
356
362
|
if (!isValidModelForEngine(backendName, modelId)) {
|
|
357
363
|
throw badRequest(
|
|
@@ -408,7 +414,7 @@ function handleListAgents(request) {
|
|
|
408
414
|
const limit = url.searchParams.get("limit");
|
|
409
415
|
const order = url.searchParams.get("order");
|
|
410
416
|
const includeArchived = url.searchParams.get("include_archived") === "true";
|
|
411
|
-
const cursor = decodeCursor(url.searchParams.get("page"));
|
|
417
|
+
const cursor = decodeCursor(url.searchParams.get("after_id") ?? url.searchParams.get("page"));
|
|
412
418
|
const requestedLimit = limit ? Number(limit) : 20;
|
|
413
419
|
const data = listAgents({
|
|
414
420
|
limit: requestedLimit,
|
|
@@ -450,7 +456,7 @@ function handleUpdateAgent(request, id) {
|
|
|
450
456
|
throw conflict(`Version mismatch: expected ${current.version}, got ${parsed.data.version}`);
|
|
451
457
|
}
|
|
452
458
|
const modelId = parsed.data.model?.id;
|
|
453
|
-
const modelSpeed = parsed.data.model
|
|
459
|
+
const modelSpeed = parsed.data.model && "speed" in parsed.data.model ? parsed.data.model.speed : void 0;
|
|
454
460
|
let mcpRecord;
|
|
455
461
|
if (parsed.data.mcp_servers !== void 0) {
|
|
456
462
|
mcpRecord = {};
|
|
@@ -517,7 +523,7 @@ function handleListAgentVersions(request, id) {
|
|
|
517
523
|
loadAgentForCaller(auth, id);
|
|
518
524
|
const url = new URL(req.url);
|
|
519
525
|
const limit = url.searchParams.get("limit");
|
|
520
|
-
const cursorRaw = decodeCursor(url.searchParams.get("page"));
|
|
526
|
+
const cursorRaw = decodeCursor(url.searchParams.get("after_id") ?? url.searchParams.get("page"));
|
|
521
527
|
const cursor = cursorRaw ? Number(cursorRaw) : void 0;
|
|
522
528
|
const requestedLimit = limit ? Number(limit) : 20;
|
|
523
529
|
const data = listAgentVersions(id, {
|
|
@@ -525,8 +531,9 @@ function handleListAgentVersions(request, id) {
|
|
|
525
531
|
cursor
|
|
526
532
|
});
|
|
527
533
|
const hasMore = data.length === requestedLimit;
|
|
528
|
-
const
|
|
529
|
-
|
|
534
|
+
const firstId = data.length > 0 ? String(data[0].version) : null;
|
|
535
|
+
const lastId = data.length > 0 ? String(data[data.length - 1].version) : null;
|
|
536
|
+
return jsonOk({ data, has_more: hasMore, first_id: firstId, last_id: lastId });
|
|
530
537
|
});
|
|
531
538
|
}
|
|
532
539
|
|
|
@@ -11,14 +11,14 @@ import {
|
|
|
11
11
|
getFileRecord,
|
|
12
12
|
listFiles,
|
|
13
13
|
updateFileStoragePath
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LJ2ZXLLT.js";
|
|
15
15
|
import {
|
|
16
16
|
assertResourceTenant
|
|
17
17
|
} from "./chunk-23UKWXJH.js";
|
|
18
18
|
import {
|
|
19
19
|
jsonOk,
|
|
20
20
|
routeWrap
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-RMCBO7K7.js";
|
|
22
22
|
import {
|
|
23
23
|
getDb,
|
|
24
24
|
init_client
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadVaultForCaller
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NO77URFL.js";
|
|
4
4
|
import {
|
|
5
5
|
jsonOk,
|
|
6
6
|
paginatedOk,
|
|
7
7
|
routeWrap
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-RMCBO7K7.js";
|
|
9
9
|
import {
|
|
10
10
|
archiveCredential,
|
|
11
11
|
createCredential,
|
|
@@ -99,8 +99,7 @@ function listFiles(opts) {
|
|
|
99
99
|
const hasMore2 = rows2.length > limit;
|
|
100
100
|
if (hasMore2) rows2.pop();
|
|
101
101
|
const records2 = rows2.map(hydrate);
|
|
102
|
-
|
|
103
|
-
return { data: records2, next_page: nextPage2 };
|
|
102
|
+
return { data: records2, has_more: hasMore2, first_id: records2[0]?.id ?? null, last_id: records2[records2.length - 1]?.id ?? null };
|
|
104
103
|
}
|
|
105
104
|
let cursorCondition;
|
|
106
105
|
if (opts?.after_id) {
|
|
@@ -113,8 +112,7 @@ function listFiles(opts) {
|
|
|
113
112
|
const hasMore = rows.length > limit;
|
|
114
113
|
if (hasMore) rows.pop();
|
|
115
114
|
const records = rows.map(hydrate);
|
|
116
|
-
|
|
117
|
-
return { data: records, next_page: nextPage };
|
|
115
|
+
return { data: records, has_more: hasMore, first_id: records[0]?.id ?? null, last_id: records[records.length - 1]?.id ?? null };
|
|
118
116
|
}
|
|
119
117
|
function countFilesForScope(scopeId) {
|
|
120
118
|
const db = getDrizzle();
|
|
@@ -25,14 +25,14 @@ import {
|
|
|
25
25
|
jsonOk,
|
|
26
26
|
paginatedOk,
|
|
27
27
|
routeWrap
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-RMCBO7K7.js";
|
|
29
29
|
import {
|
|
30
30
|
forwardToAnthropic
|
|
31
31
|
} from "./chunk-JFHYXFAL.js";
|
|
32
32
|
import {
|
|
33
33
|
runTurn,
|
|
34
34
|
writePermissionResponse
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-YAJJ7KHX.js";
|
|
36
36
|
import {
|
|
37
37
|
enqueueTurn
|
|
38
38
|
} from "./chunk-B3W3E5CS.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
jsonOk,
|
|
14
14
|
paginatedOk,
|
|
15
15
|
routeWrap
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-RMCBO7K7.js";
|
|
17
17
|
import {
|
|
18
18
|
getEnvironment
|
|
19
19
|
} from "./chunk-NSUVDKNC.js";
|
|
@@ -36,7 +36,7 @@ function handleListWork(request, envId) {
|
|
|
36
36
|
assertSelfHostedEnv(envId);
|
|
37
37
|
const url = new URL(req.url);
|
|
38
38
|
const requestedLimit = Number(url.searchParams.get("limit") || "20");
|
|
39
|
-
const cursor = decodeCursor(url.searchParams.get("page"));
|
|
39
|
+
const cursor = decodeCursor(url.searchParams.get("after_id") ?? url.searchParams.get("page"));
|
|
40
40
|
const state = url.searchParams.get("state") ?? void 0;
|
|
41
41
|
const items = listWorkItems(envId, { limit: requestedLimit, cursor, state });
|
|
42
42
|
return paginatedOk(items, requestedLimit);
|
|
@@ -24,6 +24,8 @@ import {
|
|
|
24
24
|
CreateVaultRequestSchema,
|
|
25
25
|
CredentialDeletedResponseSchema,
|
|
26
26
|
CredentialListResponseSchema,
|
|
27
|
+
EnrollmentUrlRequestSchema,
|
|
28
|
+
EnrollmentUrlResponseSchema,
|
|
27
29
|
EnvironmentDeletedResponseSchema,
|
|
28
30
|
EnvironmentListResponseSchema,
|
|
29
31
|
EnvironmentSchema,
|
|
@@ -76,6 +78,10 @@ import {
|
|
|
76
78
|
UpstreamKeySchema,
|
|
77
79
|
UserEventAppendResponseSchema,
|
|
78
80
|
UserEventBatchRequestSchema,
|
|
81
|
+
UserProfileCreateSchema,
|
|
82
|
+
UserProfileListSchema,
|
|
83
|
+
UserProfileSchema,
|
|
84
|
+
UserProfileUpdateSchema,
|
|
79
85
|
VaultCredentialSchema,
|
|
80
86
|
VaultDeletedResponseSchema,
|
|
81
87
|
VaultEntryDeletedResponseSchema,
|
|
@@ -84,7 +90,7 @@ import {
|
|
|
84
90
|
VaultListResponseSchema,
|
|
85
91
|
VaultSchema,
|
|
86
92
|
WhoamiResponseSchema
|
|
87
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-2HVY2WZL.js";
|
|
88
94
|
import {
|
|
89
95
|
registry
|
|
90
96
|
} from "./chunk-7346CKTF.js";
|
|
@@ -1829,6 +1835,97 @@ registry.registerPath({
|
|
|
1829
1835
|
...ErrorResponses
|
|
1830
1836
|
}
|
|
1831
1837
|
});
|
|
1838
|
+
registry.registerPath({
|
|
1839
|
+
method: "post",
|
|
1840
|
+
path: "/v1/user_profiles",
|
|
1841
|
+
tags: ["User Profiles"],
|
|
1842
|
+
summary: "Create user profile",
|
|
1843
|
+
security: [{ ApiKey: [] }],
|
|
1844
|
+
request: {
|
|
1845
|
+
body: {
|
|
1846
|
+
required: true,
|
|
1847
|
+
content: { "application/json": { schema: UserProfileCreateSchema } }
|
|
1848
|
+
}
|
|
1849
|
+
},
|
|
1850
|
+
responses: {
|
|
1851
|
+
201: {
|
|
1852
|
+
description: "Created",
|
|
1853
|
+
content: { "application/json": { schema: UserProfileSchema } }
|
|
1854
|
+
},
|
|
1855
|
+
...ErrorResponses
|
|
1856
|
+
}
|
|
1857
|
+
});
|
|
1858
|
+
registry.registerPath({
|
|
1859
|
+
method: "get",
|
|
1860
|
+
path: "/v1/user_profiles",
|
|
1861
|
+
tags: ["User Profiles"],
|
|
1862
|
+
summary: "List user profiles",
|
|
1863
|
+
security: [{ ApiKey: [] }],
|
|
1864
|
+
responses: {
|
|
1865
|
+
200: {
|
|
1866
|
+
description: "OK",
|
|
1867
|
+
content: { "application/json": { schema: UserProfileListSchema } }
|
|
1868
|
+
},
|
|
1869
|
+
...ErrorResponses
|
|
1870
|
+
}
|
|
1871
|
+
});
|
|
1872
|
+
registry.registerPath({
|
|
1873
|
+
method: "get",
|
|
1874
|
+
path: "/v1/user_profiles/{id}",
|
|
1875
|
+
tags: ["User Profiles"],
|
|
1876
|
+
summary: "Get user profile",
|
|
1877
|
+
security: [{ ApiKey: [] }],
|
|
1878
|
+
request: { params: z.object({ id: z.string() }) },
|
|
1879
|
+
responses: {
|
|
1880
|
+
200: {
|
|
1881
|
+
description: "OK",
|
|
1882
|
+
content: { "application/json": { schema: UserProfileSchema } }
|
|
1883
|
+
},
|
|
1884
|
+
...ErrorResponses
|
|
1885
|
+
}
|
|
1886
|
+
});
|
|
1887
|
+
registry.registerPath({
|
|
1888
|
+
method: "post",
|
|
1889
|
+
path: "/v1/user_profiles/{id}",
|
|
1890
|
+
tags: ["User Profiles"],
|
|
1891
|
+
summary: "Update user profile",
|
|
1892
|
+
security: [{ ApiKey: [] }],
|
|
1893
|
+
request: {
|
|
1894
|
+
params: z.object({ id: z.string() }),
|
|
1895
|
+
body: {
|
|
1896
|
+
required: true,
|
|
1897
|
+
content: { "application/json": { schema: UserProfileUpdateSchema } }
|
|
1898
|
+
}
|
|
1899
|
+
},
|
|
1900
|
+
responses: {
|
|
1901
|
+
200: {
|
|
1902
|
+
description: "OK",
|
|
1903
|
+
content: { "application/json": { schema: UserProfileSchema } }
|
|
1904
|
+
},
|
|
1905
|
+
...ErrorResponses
|
|
1906
|
+
}
|
|
1907
|
+
});
|
|
1908
|
+
registry.registerPath({
|
|
1909
|
+
method: "post",
|
|
1910
|
+
path: "/v1/user_profiles/{id}/enrollment_url",
|
|
1911
|
+
tags: ["User Profiles"],
|
|
1912
|
+
summary: "Generate OAuth enrollment URL",
|
|
1913
|
+
security: [{ ApiKey: [] }],
|
|
1914
|
+
request: {
|
|
1915
|
+
params: z.object({ id: z.string() }),
|
|
1916
|
+
body: {
|
|
1917
|
+
required: true,
|
|
1918
|
+
content: { "application/json": { schema: EnrollmentUrlRequestSchema } }
|
|
1919
|
+
}
|
|
1920
|
+
},
|
|
1921
|
+
responses: {
|
|
1922
|
+
200: {
|
|
1923
|
+
description: "OK",
|
|
1924
|
+
content: { "application/json": { schema: EnrollmentUrlResponseSchema } }
|
|
1925
|
+
},
|
|
1926
|
+
...ErrorResponses
|
|
1927
|
+
}
|
|
1928
|
+
});
|
|
1832
1929
|
registry.registerPath({
|
|
1833
1930
|
method: "post",
|
|
1834
1931
|
path: "/v1/batch",
|
|
@@ -1850,6 +1947,76 @@ registry.registerPath({
|
|
|
1850
1947
|
...ErrorResponses
|
|
1851
1948
|
}
|
|
1852
1949
|
});
|
|
1950
|
+
registry.registerPath({
|
|
1951
|
+
method: "post",
|
|
1952
|
+
path: "/google/v1beta/interactions",
|
|
1953
|
+
tags: ["Google Compat"],
|
|
1954
|
+
summary: "Create interaction (Google compat)",
|
|
1955
|
+
description: "Google Interactions API compatibility. Accepts google-genai SDK format.",
|
|
1956
|
+
responses: { 200: { description: "OK" } }
|
|
1957
|
+
});
|
|
1958
|
+
registry.registerPath({
|
|
1959
|
+
method: "get",
|
|
1960
|
+
path: "/google/v1beta/interactions/{id}",
|
|
1961
|
+
tags: ["Google Compat"],
|
|
1962
|
+
summary: "Get interaction (Google compat)",
|
|
1963
|
+
request: { params: z.object({ id: z.string() }) },
|
|
1964
|
+
responses: { 200: { description: "OK" } }
|
|
1965
|
+
});
|
|
1966
|
+
registry.registerPath({
|
|
1967
|
+
method: "delete",
|
|
1968
|
+
path: "/google/v1beta/interactions/{id}",
|
|
1969
|
+
tags: ["Google Compat"],
|
|
1970
|
+
summary: "Delete interaction (Google compat)",
|
|
1971
|
+
request: { params: z.object({ id: z.string() }) },
|
|
1972
|
+
responses: { 200: { description: "OK" } }
|
|
1973
|
+
});
|
|
1974
|
+
registry.registerPath({
|
|
1975
|
+
method: "post",
|
|
1976
|
+
path: "/google/v1beta/interactions/{id}/cancel",
|
|
1977
|
+
tags: ["Google Compat"],
|
|
1978
|
+
summary: "Cancel interaction (Google compat)",
|
|
1979
|
+
request: { params: z.object({ id: z.string() }) },
|
|
1980
|
+
responses: { 200: { description: "OK" } }
|
|
1981
|
+
});
|
|
1982
|
+
registry.registerPath({
|
|
1983
|
+
method: "post",
|
|
1984
|
+
path: "/google/v1beta/agents",
|
|
1985
|
+
tags: ["Google Compat"],
|
|
1986
|
+
summary: "Create agent (Google compat)",
|
|
1987
|
+
responses: { 201: { description: "Created" } }
|
|
1988
|
+
});
|
|
1989
|
+
registry.registerPath({
|
|
1990
|
+
method: "get",
|
|
1991
|
+
path: "/google/v1beta/agents",
|
|
1992
|
+
tags: ["Google Compat"],
|
|
1993
|
+
summary: "List agents (Google compat)",
|
|
1994
|
+
responses: { 200: { description: "OK" } }
|
|
1995
|
+
});
|
|
1996
|
+
registry.registerPath({
|
|
1997
|
+
method: "get",
|
|
1998
|
+
path: "/google/v1beta/agents/{id}",
|
|
1999
|
+
tags: ["Google Compat"],
|
|
2000
|
+
summary: "Get agent (Google compat)",
|
|
2001
|
+
request: { params: z.object({ id: z.string() }) },
|
|
2002
|
+
responses: { 200: { description: "OK" } }
|
|
2003
|
+
});
|
|
2004
|
+
registry.registerPath({
|
|
2005
|
+
method: "delete",
|
|
2006
|
+
path: "/google/v1beta/agents/{id}",
|
|
2007
|
+
tags: ["Google Compat"],
|
|
2008
|
+
summary: "Delete agent (Google compat)",
|
|
2009
|
+
request: { params: z.object({ id: z.string() }) },
|
|
2010
|
+
responses: { 200: { description: "OK" } }
|
|
2011
|
+
});
|
|
2012
|
+
registry.registerPath({
|
|
2013
|
+
method: "get",
|
|
2014
|
+
path: "/google/v1beta/files/{fileRef}",
|
|
2015
|
+
tags: ["Google Compat"],
|
|
2016
|
+
summary: "Download environment files (Google compat)",
|
|
2017
|
+
request: { params: z.object({ fileRef: z.string() }) },
|
|
2018
|
+
responses: { 200: { description: "Tar archive", content: { "application/x-tar": { schema: z.string().openapi({ description: "Raw tar archive bytes." }) } } } }
|
|
2019
|
+
});
|
|
1853
2020
|
function buildOpenApiDocument(opts) {
|
|
1854
2021
|
const generator = new OpenApiGeneratorV31(registry.definitions);
|
|
1855
2022
|
return generator.generateDocument({
|
|
@@ -1882,7 +2049,9 @@ function buildOpenApiDocument(opts) {
|
|
|
1882
2049
|
{ name: "Tenants", description: "Multi-tenant isolation (global-admin-only)" },
|
|
1883
2050
|
{ name: "Audit", description: "Admin audit trail" },
|
|
1884
2051
|
{ name: "Auth", description: "Caller identity and license info" },
|
|
1885
|
-
{ name: "Batch", description: "Atomic batch operations" }
|
|
2052
|
+
{ name: "Batch", description: "Atomic batch operations" },
|
|
2053
|
+
{ name: "User Profiles", description: "User profile management and OAuth enrollment" },
|
|
2054
|
+
{ name: "Google Compat", description: "Google Interactions API compatibility layer" }
|
|
1886
2055
|
]
|
|
1887
2056
|
});
|
|
1888
2057
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
syncAndCreateSession
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VCU64NHY.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveRemoteSessionId,
|
|
6
6
|
upsertSync
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
jsonOk,
|
|
24
24
|
paginatedOk,
|
|
25
25
|
routeWrap
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-RMCBO7K7.js";
|
|
27
27
|
import {
|
|
28
28
|
forwardToAnthropic
|
|
29
29
|
} from "./chunk-JFHYXFAL.js";
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
} from "./chunk-LAWTTG2E.js";
|
|
44
44
|
import {
|
|
45
45
|
releaseSession
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-IL2CZHNC.js";
|
|
47
47
|
import {
|
|
48
48
|
appendEvent,
|
|
49
49
|
dropEmitter
|
|
@@ -514,7 +514,7 @@ function handleListSessions(request) {
|
|
|
514
514
|
const limit = url.searchParams.get("limit");
|
|
515
515
|
const order = url.searchParams.get("order");
|
|
516
516
|
const includeArchived = url.searchParams.get("include_archived") === "true";
|
|
517
|
-
const cursor = decodeCursor(url.searchParams.get("page"));
|
|
517
|
+
const cursor = decodeCursor(url.searchParams.get("after_id") ?? url.searchParams.get("page"));
|
|
518
518
|
const agentId = url.searchParams.get("agent_id") ?? void 0;
|
|
519
519
|
const agentVersion = url.searchParams.get("agent_version");
|
|
520
520
|
const environmentId = url.searchParams.get("environment_id") ?? void 0;
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-HVUWXUUI.js";
|
|
11
11
|
import {
|
|
12
12
|
ensureInitialized
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ZDURV2LI.js";
|
|
14
14
|
import {
|
|
15
15
|
captureException
|
|
16
16
|
} from "./chunk-3MQ2FWXS.js";
|
|
@@ -66,11 +66,13 @@ function jsonOk(body, status = 200) {
|
|
|
66
66
|
}
|
|
67
67
|
function paginatedOk(data, requestedLimit) {
|
|
68
68
|
const hasMore = data.length === requestedLimit;
|
|
69
|
-
const
|
|
70
|
-
|
|
69
|
+
const firstId = data.length > 0 ? data[0].id : null;
|
|
70
|
+
const lastId = data.length > 0 ? data[data.length - 1].id : null;
|
|
71
|
+
return jsonOk({ data, has_more: hasMore, first_id: firstId, last_id: lastId });
|
|
71
72
|
}
|
|
72
73
|
function decodeCursor(page) {
|
|
73
74
|
if (!page) return void 0;
|
|
75
|
+
if (page.includes("_")) return page;
|
|
74
76
|
try {
|
|
75
77
|
return Buffer.from(page, "base64url").toString("utf8");
|
|
76
78
|
} catch {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
jsonOk,
|
|
12
12
|
paginatedOk,
|
|
13
13
|
routeWrap
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-RMCBO7K7.js";
|
|
15
15
|
import {
|
|
16
16
|
forwardToAnthropic
|
|
17
17
|
} from "./chunk-JFHYXFAL.js";
|
|
@@ -165,7 +165,7 @@ function handleListEnvironments(request) {
|
|
|
165
165
|
const limit = url.searchParams.get("limit");
|
|
166
166
|
const order = url.searchParams.get("order");
|
|
167
167
|
const includeArchived = url.searchParams.get("include_archived") === "true";
|
|
168
|
-
const cursor = decodeCursor(url.searchParams.get("page"));
|
|
168
|
+
const cursor = decodeCursor(url.searchParams.get("after_id") ?? url.searchParams.get("page"));
|
|
169
169
|
const requestedLimit = limit ? Number(limit) : 20;
|
|
170
170
|
const data = listEnvironments({
|
|
171
171
|
limit: requestedLimit,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
jsonOk,
|
|
3
3
|
routeWrap
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RMCBO7K7.js";
|
|
5
5
|
import {
|
|
6
6
|
init_ids,
|
|
7
7
|
newId
|
|
@@ -144,12 +144,20 @@ function handleCreateInteraction(request) {
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
if (!environmentId) throw badRequest("no environment available");
|
|
147
|
+
const { listVaults } = await import("./db/vaults.js");
|
|
148
|
+
const { tenantFilter: getTenantFilter } = await import("./auth/scope.js");
|
|
149
|
+
const tenantVaults = listVaults({
|
|
150
|
+
tenantFilter: getTenantFilter(auth)
|
|
151
|
+
});
|
|
152
|
+
const agentVaults = tenantVaults.filter((v) => v.agent_id === agentId || !v.agent_id);
|
|
153
|
+
const vaultIds = agentVaults.filter((v) => !v.archived_at).map((v) => v.id);
|
|
147
154
|
const sessReq = new Request(request.url.replace(/\/google\/v1beta\/interactions.*/, `/v1/sessions`), {
|
|
148
155
|
method: "POST",
|
|
149
156
|
headers: request.headers,
|
|
150
157
|
body: JSON.stringify({
|
|
151
158
|
agent: agentId,
|
|
152
|
-
environment_id: environmentId
|
|
159
|
+
environment_id: environmentId,
|
|
160
|
+
...vaultIds.length > 0 ? { vault_ids: vaultIds } : {}
|
|
153
161
|
})
|
|
154
162
|
});
|
|
155
163
|
const sessRes = await handleCreateSession(sessReq);
|