@agentstep/agent-sdk 0.5.34 → 0.5.36

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.
Files changed (108) hide show
  1. package/dist/{chunk-75US4UAE.js → chunk-2E43SH4Y.js} +1 -1
  2. package/dist/chunk-2HTAIROL.js +164 -0
  3. package/dist/{chunk-SAI6LBXW.js → chunk-2HVY2WZL.js} +79 -5
  4. package/dist/{chunk-ZHEE6UTX.js → chunk-2YZUXJAN.js} +1 -1
  5. package/dist/{chunk-GABMXDZZ.js → chunk-2Z4T32WO.js} +1 -1
  6. package/dist/{chunk-SUEPFZN2.js → chunk-3CDJ2VQN.js} +1 -1
  7. package/dist/{chunk-XXAO5YYL.js → chunk-3IO3EGWP.js} +1 -1
  8. package/dist/{chunk-HHLVVJGT.js → chunk-3RK6EX7J.js} +1 -1
  9. package/dist/{chunk-3LYNN5VT.js → chunk-3WPVSQGI.js} +1 -1
  10. package/dist/{chunk-SWGCL54X.js → chunk-3XGUMXGR.js} +132 -132
  11. package/dist/{chunk-ZAUWB5DQ.js → chunk-4XB2CJPE.js} +1 -1
  12. package/dist/{chunk-6NFK5RJX.js → chunk-52K3LOFD.js} +1 -1
  13. package/dist/{chunk-AD2WPGDN.js → chunk-5BIX3H2D.js} +1 -1
  14. package/dist/{chunk-K3LM6O44.js → chunk-AE7UG76I.js} +1 -1
  15. package/dist/{chunk-NQ6BN7WH.js → chunk-BVBVWMQS.js} +16 -9
  16. package/dist/{chunk-IMJTHYN3.js → chunk-CCNG7D6Y.js} +1 -1
  17. package/dist/{chunk-LR6FK2J7.js → chunk-DQIQBMC2.js} +1 -1
  18. package/dist/{chunk-JIXRTWYL.js → chunk-FH2IOAQM.js} +1 -1
  19. package/dist/{chunk-ZACPJA3G.js → chunk-HGV3Y4PS.js} +1 -1
  20. package/dist/{chunk-VQM2MCQR.js → chunk-JFIJEF4N.js} +2 -2
  21. package/dist/{chunk-FCPZF7KJ.js → chunk-L2ZB7TCF.js} +1 -1
  22. package/dist/{chunk-2R4IT7HG.js → chunk-L7X2UMNJ.js} +2 -2
  23. package/dist/{chunk-YKPRNV6J.js → chunk-LJ2ZXLLT.js} +2 -4
  24. package/dist/{chunk-GBBQD6VY.js → chunk-MG2DS6QE.js} +1 -1
  25. package/dist/{chunk-GFZ2WIVH.js → chunk-NO77URFL.js} +1 -1
  26. package/dist/{chunk-OEYLPPID.js → chunk-OMGJEZJS.js} +2 -2
  27. package/dist/{chunk-6CODFATQ.js → chunk-PUAK45BO.js} +2 -2
  28. package/dist/chunk-PULMO5OO.js +99 -0
  29. package/dist/{chunk-PWLWDWRL.js → chunk-R43A2QH7.js} +171 -2
  30. package/dist/{chunk-BSAF4YJB.js → chunk-R6NWAM37.js} +4 -4
  31. package/dist/{chunk-3EI7IPMI.js → chunk-R7MZNZNC.js} +1 -1
  32. package/dist/{chunk-OANORRFX.js → chunk-RHSVYAI4.js} +145 -9
  33. package/dist/{chunk-4EKHW6VS.js → chunk-RMCBO7K7.js} +5 -3
  34. package/dist/{chunk-LKHJLSYG.js → chunk-SP26BYYZ.js} +2 -2
  35. package/dist/{chunk-6NEWWPL4.js → chunk-TBLHBMA5.js} +1 -1
  36. package/dist/{chunk-JDAOTVWV.js → chunk-VIWYYVGR.js} +1 -1
  37. package/dist/{chunk-3EWEKBVC.js → chunk-VWCIN45Y.js} +1 -1
  38. package/dist/{chunk-CZ4N5FJW.js → chunk-W3DA3OFL.js} +1 -1
  39. package/dist/{chunk-FHOJOLXU.js → chunk-XLVZ5236.js} +1 -1
  40. package/dist/{chunk-KYKVHH7I.js → chunk-YAJJ7KHX.js} +1 -1
  41. package/dist/{chunk-P7V3S2T3.js → chunk-ZDURV2LI.js} +4 -4
  42. package/dist/{chunk-25E64UIV.js → chunk-ZPTYXWUO.js} +1 -1
  43. package/dist/containers/lifecycle.js +1 -1
  44. package/dist/db/files.js +1 -1
  45. package/dist/handlers/agents.js +7 -7
  46. package/dist/handlers/api_keys.js +7 -7
  47. package/dist/handlers/audit.js +7 -7
  48. package/dist/handlers/batch.js +7 -7
  49. package/dist/handlers/credentials.js +8 -8
  50. package/dist/handlers/enrollment.js +7 -7
  51. package/dist/handlers/environments.js +7 -7
  52. package/dist/handlers/events.js +7 -7
  53. package/dist/handlers/files.js +8 -8
  54. package/dist/handlers/google-compat/agents.js +106 -0
  55. package/dist/handlers/google-compat/files.js +101 -0
  56. package/dist/handlers/google-compat/index.js +31 -10
  57. package/dist/handlers/google-compat/interactions.js +15 -9
  58. package/dist/handlers/index.d.ts +33 -0
  59. package/dist/handlers/index.d.ts.map +1 -0
  60. package/dist/handlers/index.js +63 -43
  61. package/dist/handlers/license.js +7 -7
  62. package/dist/handlers/memory.js +7 -7
  63. package/dist/handlers/metrics.js +7 -7
  64. package/dist/handlers/models.js +7 -7
  65. package/dist/handlers/openapi.d.ts +2 -0
  66. package/dist/handlers/openapi.d.ts.map +1 -0
  67. package/dist/handlers/openapi.js +3 -3
  68. package/dist/handlers/providers.js +7 -7
  69. package/dist/handlers/resources.js +7 -7
  70. package/dist/handlers/sessions.js +8 -8
  71. package/dist/handlers/settings.js +7 -7
  72. package/dist/handlers/skills-write.js +7 -7
  73. package/dist/handlers/skills.js +7 -7
  74. package/dist/handlers/stream.js +6 -6
  75. package/dist/handlers/tenants.js +7 -7
  76. package/dist/handlers/threads.js +7 -7
  77. package/dist/handlers/traces.js +7 -7
  78. package/dist/handlers/ui.js +1 -1
  79. package/dist/handlers/upstream_keys.js +7 -7
  80. package/dist/handlers/user-profiles.js +7 -7
  81. package/dist/handlers/vaults.js +7 -7
  82. package/dist/handlers/whoami.js +7 -7
  83. package/dist/handlers/work.js +7 -7
  84. package/dist/http.js +6 -6
  85. package/dist/index.d.ts +48 -0
  86. package/dist/index.d.ts.map +1 -0
  87. package/dist/index.js +9 -9
  88. package/dist/init.js +5 -5
  89. package/dist/openapi/schemas.d.ts +5855 -0
  90. package/dist/openapi/schemas.d.ts.map +1 -0
  91. package/dist/openapi/schemas.js +15 -1
  92. package/dist/openapi/spec.d.ts +4 -0
  93. package/dist/openapi/spec.d.ts.map +1 -0
  94. package/dist/openapi/spec.js +2 -2
  95. package/dist/sessions/driver.js +2 -2
  96. package/dist/sessions/sweeper.js +2 -2
  97. package/dist/sessions/threads.js +2 -2
  98. package/dist/shutdown.js +3 -3
  99. package/dist/sync/anthropic.js +1 -1
  100. package/dist/sync/container-file-sync.js +1 -1
  101. package/dist/sync/file-sync.js +1 -1
  102. package/dist/workers/runner.js +3 -3
  103. package/package.json +1 -1
  104. package/dist/handlers/ui.d.ts +0 -6
  105. package/dist/handlers/ui.d.ts.map +0 -1
  106. /package/dist/{chunk-B5RR422E.js → chunk-DI6IMZ3P.js} +0 -0
  107. /package/dist/{chunk-ZCCHLDLC.js → chunk-IL2CZHNC.js} +0 -0
  108. /package/dist/{chunk-AUEKXYNE.js → chunk-VCU64NHY.js} +0 -0
@@ -10,7 +10,7 @@ import {
10
10
  jsonOk,
11
11
  paginatedOk,
12
12
  routeWrap
13
- } from "./chunk-4EKHW6VS.js";
13
+ } from "./chunk-RMCBO7K7.js";
14
14
  import {
15
15
  subscribe
16
16
  } from "./chunk-RES4BCTF.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  jsonOk,
3
3
  routeWrap
4
- } from "./chunk-4EKHW6VS.js";
4
+ } from "./chunk-RMCBO7K7.js";
5
5
  import {
6
6
  readSetting,
7
7
  writeSetting
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-JFHYXFAL.js";
13
13
  import {
14
14
  ensureInitialized
15
- } from "./chunk-P7V3S2T3.js";
15
+ } from "./chunk-ZDURV2LI.js";
16
16
  import {
17
17
  getProxiedTenantId,
18
18
  isProxied
@@ -6,7 +6,7 @@ import {
6
6
  reconcileDockerOrphanSandboxes,
7
7
  reconcileOrphanSandboxes,
8
8
  releaseSession
9
- } from "./chunk-ZCCHLDLC.js";
9
+ } from "./chunk-IL2CZHNC.js";
10
10
  import {
11
11
  appendEvent,
12
12
  dropEmitter
@@ -8,7 +8,7 @@ import {
8
8
  jsonOk,
9
9
  paginatedOk,
10
10
  routeWrap
11
- } from "./chunk-4EKHW6VS.js";
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.object({ id: z.string().min(1), speed: z.enum(["standard", "fast"]).optional() }),
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.object({ id: z.string().min(1), speed: z.enum(["standard", "fast"]).optional() }).optional(),
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?.speed;
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 nextPage = hasMore && data.length > 0 ? Buffer.from(String(data[data.length - 1].version)).toString("base64url") : null;
529
- return jsonOk({ data, next_page: nextPage });
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
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  buildOpenApiDocument
3
- } from "./chunk-PWLWDWRL.js";
3
+ } from "./chunk-R43A2QH7.js";
4
4
 
5
5
  // src/handlers/openapi.ts
6
6
  function originFromRequest(request) {
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  jsonOk,
6
6
  routeWrap
7
- } from "./chunk-4EKHW6VS.js";
7
+ } from "./chunk-RMCBO7K7.js";
8
8
  import {
9
9
  getProxiedTenantId
10
10
  } from "./chunk-DZKBUOYU.js";
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  jsonOk,
23
23
  routeWrap
24
- } from "./chunk-4EKHW6VS.js";
24
+ } from "./chunk-RMCBO7K7.js";
25
25
  import {
26
26
  badRequest,
27
27
  notFound
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  markStopping
3
- } from "./chunk-K3LM6O44.js";
3
+ } from "./chunk-AE7UG76I.js";
4
4
  import {
5
5
  closeDb,
6
6
  init_client,
@@ -11,14 +11,14 @@ import {
11
11
  getFileRecord,
12
12
  listFiles,
13
13
  updateFileStoragePath
14
- } from "./chunk-YKPRNV6J.js";
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-4EKHW6VS.js";
21
+ } from "./chunk-RMCBO7K7.js";
22
22
  import {
23
23
  getDb,
24
24
  init_client
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  jsonOk,
6
6
  routeWrap
7
- } from "./chunk-4EKHW6VS.js";
7
+ } from "./chunk-RMCBO7K7.js";
8
8
 
9
9
  // src/handlers/license.ts
10
10
  function handleGetLicense(request) {
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  loadVaultForCaller
3
- } from "./chunk-GFZ2WIVH.js";
3
+ } from "./chunk-NO77URFL.js";
4
4
  import {
5
5
  jsonOk,
6
6
  paginatedOk,
7
7
  routeWrap
8
- } from "./chunk-4EKHW6VS.js";
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
- const nextPage2 = hasMore2 && records2.length > 0 ? Buffer.from(records2[records2.length - 1].id).toString("base64url") : null;
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
- const nextPage = hasMore && records.length > 0 ? Buffer.from(records[records.length - 1].id).toString("base64url") : null;
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();
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  paginatedOk,
10
10
  routeWrap
11
- } from "./chunk-4EKHW6VS.js";
11
+ } from "./chunk-RMCBO7K7.js";
12
12
  import {
13
13
  badRequest
14
14
  } from "./chunk-EZYKRG4W.js";
@@ -7,7 +7,7 @@ import {
7
7
  jsonOk,
8
8
  paginatedOk,
9
9
  routeWrap
10
- } from "./chunk-4EKHW6VS.js";
10
+ } from "./chunk-RMCBO7K7.js";
11
11
  import {
12
12
  archiveVault,
13
13
  createVault,
@@ -25,14 +25,14 @@ import {
25
25
  jsonOk,
26
26
  paginatedOk,
27
27
  routeWrap
28
- } from "./chunk-4EKHW6VS.js";
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-KYKVHH7I.js";
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-4EKHW6VS.js";
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);
@@ -0,0 +1,99 @@
1
+ import {
2
+ readFile
3
+ } from "./chunk-STPT3SWU.js";
4
+ import {
5
+ routeWrap
6
+ } from "./chunk-RMCBO7K7.js";
7
+ import {
8
+ getDb,
9
+ init_client
10
+ } from "./chunk-AGIXZFHQ.js";
11
+ import {
12
+ badRequest,
13
+ notFound
14
+ } from "./chunk-EZYKRG4W.js";
15
+
16
+ // src/handlers/google-compat/files.ts
17
+ init_client();
18
+ function buildTarArchive(files) {
19
+ const blocks = [];
20
+ for (const file of files) {
21
+ const header = Buffer.alloc(512, 0);
22
+ const name = file.name.slice(0, 100);
23
+ header.write(name, 0, Math.min(name.length, 100), "utf8");
24
+ header.write("0000644\0", 100, 8, "utf8");
25
+ header.write("0000000\0", 108, 8, "utf8");
26
+ header.write("0000000\0", 116, 8, "utf8");
27
+ header.write(file.data.length.toString(8).padStart(11, "0") + "\0", 124, 12, "utf8");
28
+ const mtime = Math.floor(Date.now() / 1e3);
29
+ header.write(mtime.toString(8).padStart(11, "0") + "\0", 136, 12, "utf8");
30
+ header.write(" ", 148, 8, "utf8");
31
+ header.write("0", 156, 1, "utf8");
32
+ header.write("ustar\0", 257, 6, "utf8");
33
+ header.write("00", 263, 2, "utf8");
34
+ let checksum = 0;
35
+ for (let i = 0; i < 512; i++) {
36
+ checksum += header[i];
37
+ }
38
+ header.write(checksum.toString(8).padStart(6, "0") + "\0 ", 148, 8, "utf8");
39
+ blocks.push(header);
40
+ blocks.push(file.data);
41
+ const remainder = file.data.length % 512;
42
+ if (remainder > 0) {
43
+ blocks.push(Buffer.alloc(512 - remainder, 0));
44
+ }
45
+ }
46
+ blocks.push(Buffer.alloc(1024, 0));
47
+ return Buffer.concat(blocks);
48
+ }
49
+ function handleGetEnvironmentFiles(request, fileRef) {
50
+ return routeWrap(request, async () => {
51
+ const match = fileRef.match(/^environment-(.+):download$/);
52
+ if (!match) {
53
+ throw badRequest("Invalid file reference format. Expected: environment-<envId>:download");
54
+ }
55
+ const envId = match[1];
56
+ const db = getDb();
57
+ const env = db.prepare(`SELECT id FROM environments WHERE id = ?`).get(envId);
58
+ if (!env) {
59
+ throw notFound(`environment not found: ${envId}`);
60
+ }
61
+ const sessions = db.prepare(
62
+ `SELECT id FROM sessions WHERE environment_id = ?`
63
+ ).all(envId);
64
+ if (sessions.length === 0) {
65
+ const emptyTar = Buffer.alloc(1024, 0);
66
+ return new Response(emptyTar, {
67
+ headers: {
68
+ "Content-Type": "application/x-tar",
69
+ "Content-Length": String(emptyTar.length)
70
+ }
71
+ });
72
+ }
73
+ const sessionIds = sessions.map((s) => s.id);
74
+ const placeholders = sessionIds.map(() => "?").join(",");
75
+ const fileRows = db.prepare(
76
+ `SELECT * FROM files WHERE scope_type = 'session' AND scope_id IN (${placeholders})`
77
+ ).all(...sessionIds);
78
+ const tarFiles = [];
79
+ for (const row of fileRows) {
80
+ if (row.storage_path.startsWith("remote:")) continue;
81
+ try {
82
+ const data = readFile(row.storage_path);
83
+ tarFiles.push({ name: row.filename, data });
84
+ } catch {
85
+ }
86
+ }
87
+ const tar = buildTarArchive(tarFiles);
88
+ return new Response(tar, {
89
+ headers: {
90
+ "Content-Type": "application/x-tar",
91
+ "Content-Length": String(tar.length)
92
+ }
93
+ });
94
+ });
95
+ }
96
+
97
+ export {
98
+ handleGetEnvironmentFiles
99
+ };
@@ -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-SAI6LBXW.js";
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-AUEKXYNE.js";
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-4EKHW6VS.js";
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-ZCCHLDLC.js";
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;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  jsonOk,
3
3
  routeWrap
4
- } from "./chunk-4EKHW6VS.js";
4
+ } from "./chunk-RMCBO7K7.js";
5
5
  import {
6
6
  resolveContainerProvider
7
7
  } from "./chunk-XLMNSDUJ.js";