@agentstep/gateway 0.5.36 → 0.5.38

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 (2) hide show
  1. package/dist/gateway.js +265 -37
  2. package/package.json +1 -1
package/dist/gateway.js CHANGED
@@ -158933,7 +158933,7 @@ var init_chunk_7346CKTF = __esm({
158933
158933
  }
158934
158934
  });
158935
158935
 
158936
- // ../agent-sdk/dist/chunk-EOUNXIPM.js
158936
+ // ../agent-sdk/dist/chunk-2HVY2WZL.js
158937
158937
  function listEnvelope(name, item) {
158938
158938
  const schema2 = external_exports.object({
158939
158939
  data: external_exports.array(item),
@@ -158943,9 +158943,9 @@ function listEnvelope(name, item) {
158943
158943
  });
158944
158944
  return registry2.register(name, schema2);
158945
158945
  }
158946
- var import_zod_to_openapi2, UlidId, IsoTimestamp, ErrorEnvelopeSchema, AgentToolsetTool, CustomTool, ToolConfigSchema, McpServerConfigSchema, AgentSkillSchema, ModelConfigSchema, AgentSchema, CreateAgentRequestSchema, UpdateAgentRequestSchema, EnvironmentPackages, EnvironmentNetworking, EnvironmentConfigSchema, EnvironmentSchema, CreateEnvironmentRequestSchema, UpdateEnvironmentRequestSchema, SessionStatsSchema, SessionUsageSchema, SessionStatusSchema, SessionSchema, CreateSessionRequestSchema, UpdateSessionRequestSchema, TextBlock, UserMessageEvent, UserInterruptEvent, UserCustomToolResultEvent, UserToolConfirmationEvent, UserDefineOutcomeEvent, UserEventSchema, UserEventBatchRequestSchema, ManagedEventSchema, VaultSchema, VaultEntrySchema, CreateVaultRequestSchema, UpdateVaultRequestSchema, SetVaultEntryRequestSchema, VaultDeletedResponseSchema, VaultEntryDeletedResponseSchema, BatchOperationSchema, BatchRequestSchema, BatchResultSchema, BatchResponseSchema, AgentListResponseSchema, EnvironmentListResponseSchema, SessionListResponseSchema, EventListResponseSchema, VaultListResponseSchema, VaultEntryListResponseSchema, AgentDeletedResponseSchema, SessionDeletedResponseSchema, EnvironmentDeletedResponseSchema, UserEventAppendResponseSchema, FileScopeSchema, FileRecordSchema, FileListResponseSchema, FileDeletedResponseSchema, VaultCredentialSchema, CreateCredentialRequestSchema, UpdateCredentialRequestSchema, CredentialListResponseSchema, CredentialDeletedResponseSchema, MemoryStoreSchema, CreateMemoryStoreRequestSchema, MemoryStoreListResponseSchema, MemoryStoreDeletedResponseSchema, MemorySchema, CreateMemoryRequestSchema, UpdateMemoryRequestSchema, MemoryListResponseSchema, MemoryDeletedResponseSchema, SessionResourceSchema, AddResourceRequestSchema, ResourceListResponseSchema, ResourceDeletedResponseSchema, KeyScopeSchema, KeyPermissionsSchema, ApiKeySchema, ApiKeyCreatedSchema, CreateApiKeyRequestSchema, PatchApiKeyRequestSchema, ApiKeyListResponseSchema, ApiKeyRevokedResponseSchema, ApiKeyActivityResponseSchema, UpstreamKeySchema, AddUpstreamKeyRequestSchema, PatchUpstreamKeyRequestSchema, UpstreamKeyListResponseSchema, UpstreamKeyDeletedResponseSchema, TenantSchema, CreateTenantRequestSchema, PatchTenantRequestSchema, TenantListResponseSchema, TenantArchivedResponseSchema, AuditEntrySchema, AuditListResponseSchema, TraceListItemSchema, TraceListResponseSchema, SpanNodeSchema, TraceDetailSchema, TraceExportResponseSchema, SkillsCatalogResponseSchema, SkillsSearchResponseSchema, SkillsStatsResponseSchema, SkillsSourcesResponseSchema, MetricsTotalsSchema, MetricsResponseSchema, ApiMetricsResponseSchema, PutSettingRequestSchema, SettingResponseSchema, ProviderStatusResponseSchema, ModelEntrySchema, ModelListResponseSchema, WhoamiResponseSchema, LicenseResponseSchema;
158947
- var init_chunk_EOUNXIPM = __esm({
158948
- "../agent-sdk/dist/chunk-EOUNXIPM.js"() {
158946
+ var import_zod_to_openapi2, UlidId, IsoTimestamp, ErrorEnvelopeSchema, AgentToolsetTool, CustomTool, ToolConfigSchema, McpServerConfigSchema, AgentSkillSchema, ModelConfigSchema, AgentSchema, CreateAgentRequestSchema, UpdateAgentRequestSchema, EnvironmentPackages, EnvironmentNetworking, EnvironmentConfigSchema, EnvironmentSchema, CreateEnvironmentRequestSchema, UpdateEnvironmentRequestSchema, SessionStatsSchema, SessionUsageSchema, SessionStatusSchema, SessionSchema, CreateSessionRequestSchema, UpdateSessionRequestSchema, TextBlock, UserMessageEvent, UserInterruptEvent, UserCustomToolResultEvent, UserToolConfirmationEvent, UserDefineOutcomeEvent, UserEventSchema, UserEventBatchRequestSchema, ManagedEventSchema, VaultSchema, VaultEntrySchema, CreateVaultRequestSchema, UpdateVaultRequestSchema, SetVaultEntryRequestSchema, VaultDeletedResponseSchema, VaultEntryDeletedResponseSchema, BatchOperationSchema, BatchRequestSchema, BatchResultSchema, BatchResponseSchema, AgentListResponseSchema, EnvironmentListResponseSchema, SessionListResponseSchema, EventListResponseSchema, VaultListResponseSchema, VaultEntryListResponseSchema, TrustGrantSchema, UserProfileSchema, UserProfileCreateSchema, UserProfileUpdateSchema, UserProfileListSchema, EnrollmentUrlRequestSchema, EnrollmentUrlResponseSchema, AgentDeletedResponseSchema, SessionDeletedResponseSchema, EnvironmentDeletedResponseSchema, UserEventAppendResponseSchema, FileScopeSchema, FileRecordSchema, FileListResponseSchema, FileDeletedResponseSchema, VaultCredentialSchema, CreateCredentialRequestSchema, UpdateCredentialRequestSchema, CredentialListResponseSchema, CredentialDeletedResponseSchema, MemoryStoreSchema, CreateMemoryStoreRequestSchema, MemoryStoreListResponseSchema, MemoryStoreDeletedResponseSchema, MemorySchema, CreateMemoryRequestSchema, UpdateMemoryRequestSchema, MemoryListResponseSchema, MemoryDeletedResponseSchema, SessionResourceSchema, AddResourceRequestSchema, ResourceListResponseSchema, ResourceDeletedResponseSchema, KeyScopeSchema, KeyPermissionsSchema, ApiKeySchema, ApiKeyCreatedSchema, CreateApiKeyRequestSchema, PatchApiKeyRequestSchema, ApiKeyListResponseSchema, ApiKeyRevokedResponseSchema, ApiKeyActivityResponseSchema, UpstreamKeySchema, AddUpstreamKeyRequestSchema, PatchUpstreamKeyRequestSchema, UpstreamKeyListResponseSchema, UpstreamKeyDeletedResponseSchema, TenantSchema, CreateTenantRequestSchema, PatchTenantRequestSchema, TenantListResponseSchema, TenantArchivedResponseSchema, AuditEntrySchema, AuditListResponseSchema, TraceListItemSchema, TraceListResponseSchema, SpanNodeSchema, TraceDetailSchema, TraceExportResponseSchema, SkillsCatalogResponseSchema, SkillsSearchResponseSchema, SkillsStatsResponseSchema, SkillsSourcesResponseSchema, MetricsTotalsSchema, MetricsResponseSchema, ApiMetricsResponseSchema, PutSettingRequestSchema, SettingResponseSchema, ProviderStatusResponseSchema, ModelEntrySchema, ModelListResponseSchema, WhoamiResponseSchema, LicenseResponseSchema;
158947
+ var init_chunk_2HVY2WZL = __esm({
158948
+ "../agent-sdk/dist/chunk-2HVY2WZL.js"() {
158949
158949
  "use strict";
158950
158950
  init_chunk_7346CKTF();
158951
158951
  init_zod();
@@ -159072,6 +159072,10 @@ var init_chunk_EOUNXIPM = __esm({
159072
159072
  skills: external_exports.array(AgentSkillSchema).openapi({
159073
159073
  description: "Skills injected into the container at session start. For Claude backend, written to .claude/skills/<name>/SKILL.md. For all backends, also written to .agents/skills/<name>/SKILL.md. Non-Claude backends also receive skills prepended to the system prompt."
159074
159074
  }),
159075
+ permission_policy: external_exports.object({
159076
+ always_allow: external_exports.array(external_exports.string()).optional(),
159077
+ always_ask: external_exports.array(external_exports.string()).optional()
159078
+ }).nullable().optional().openapi({ description: "Per-tool permission control." }),
159075
159079
  model_config: ModelConfigSchema.openapi({
159076
159080
  description: "Model configuration options. 'fast' speed enables fast mode on Claude (claude engine only)."
159077
159081
  }),
@@ -159310,6 +159314,7 @@ var init_chunk_EOUNXIPM = __esm({
159310
159314
  vault_ids: external_exports.array(external_exports.string()).nullable().openapi({
159311
159315
  description: "Vault IDs whose entries are injected as environment variables."
159312
159316
  }),
159317
+ user_profile_id: external_exports.string().nullable().optional().openapi({ description: "User profile ID for credential scoping." }),
159313
159318
  parent_session_id: external_exports.string().nullable().openapi({
159314
159319
  description: "Parent session ID if this is a child thread session."
159315
159320
  }),
@@ -159345,7 +159350,17 @@ var init_chunk_EOUNXIPM = __esm({
159345
159350
  uri: external_exports.string().optional(),
159346
159351
  content: external_exports.string().optional()
159347
159352
  })).optional(),
159348
- vault_ids: external_exports.array(external_exports.string()).optional()
159353
+ vault_ids: external_exports.array(external_exports.string()).optional(),
159354
+ user_profile_id: external_exports.string().optional().openapi({ description: "Links session to a user profile for per-user credential scoping." }),
159355
+ outcomes: external_exports.object({
159356
+ description: external_exports.string(),
159357
+ rubric: external_exports.array(external_exports.object({
159358
+ name: external_exports.string(),
159359
+ description: external_exports.string(),
159360
+ weight: external_exports.number().optional()
159361
+ })).optional(),
159362
+ max_iterations: external_exports.number().int().optional()
159363
+ }).optional().openapi({ description: "Success criteria with optional rubric for self-evaluation." })
159349
159364
  }).openapi({
159350
159365
  example: {
159351
159366
  agent: "agent_01ABCDEFG...",
@@ -159543,6 +159558,49 @@ var init_chunk_EOUNXIPM = __esm({
159543
159558
  "VaultEntryListResponse",
159544
159559
  external_exports.object({ data: external_exports.array(VaultEntrySchema) })
159545
159560
  );
159561
+ TrustGrantSchema = registry2.register("TrustGrant", external_exports.object({
159562
+ type: external_exports.literal("vault_credential"),
159563
+ vault_id: external_exports.string(),
159564
+ credential_id: external_exports.string()
159565
+ }));
159566
+ UserProfileSchema = registry2.register("UserProfile", external_exports.object({
159567
+ type: external_exports.literal("user_profile"),
159568
+ id: external_exports.string(),
159569
+ external_id: external_exports.string().nullable(),
159570
+ display_name: external_exports.string().nullable(),
159571
+ trust_grants: external_exports.array(TrustGrantSchema),
159572
+ created_at: external_exports.string(),
159573
+ updated_at: external_exports.string()
159574
+ }));
159575
+ UserProfileCreateSchema = registry2.register("UserProfileCreate", external_exports.object({
159576
+ external_id: external_exports.string().optional(),
159577
+ display_name: external_exports.string().optional(),
159578
+ trust_grants: external_exports.array(TrustGrantSchema).optional()
159579
+ }));
159580
+ UserProfileUpdateSchema = registry2.register("UserProfileUpdate", external_exports.object({
159581
+ external_id: external_exports.string().nullish(),
159582
+ display_name: external_exports.string().nullish(),
159583
+ trust_grants: external_exports.array(TrustGrantSchema).optional()
159584
+ }));
159585
+ UserProfileListSchema = listEnvelope("UserProfileList", UserProfileSchema);
159586
+ EnrollmentUrlRequestSchema = registry2.register("EnrollmentUrlRequest", external_exports.object({
159587
+ vault_id: external_exports.string(),
159588
+ credential_id: external_exports.string().optional(),
159589
+ display_name: external_exports.string().optional(),
159590
+ authorize_url: external_exports.string(),
159591
+ token_endpoint: external_exports.string(),
159592
+ client_id: external_exports.string(),
159593
+ client_secret: external_exports.string().optional(),
159594
+ scope: external_exports.string().optional(),
159595
+ redirect_uri: external_exports.string().optional()
159596
+ }));
159597
+ EnrollmentUrlResponseSchema = registry2.register("EnrollmentUrlResponse", external_exports.object({
159598
+ type: external_exports.literal("enrollment_url"),
159599
+ url: external_exports.string(),
159600
+ state: external_exports.string(),
159601
+ redirect_uri: external_exports.string(),
159602
+ expires_in: external_exports.number()
159603
+ }));
159546
159604
  AgentDeletedResponseSchema = registry2.register(
159547
159605
  "AgentDeletedResponse",
159548
159606
  external_exports.object({ id: UlidId, type: external_exports.literal("agent_deleted") })
@@ -160101,7 +160159,7 @@ var init_chunk_EOUNXIPM = __esm({
160101
160159
  }
160102
160160
  });
160103
160161
 
160104
- // ../agent-sdk/dist/chunk-CNMMJFJI.js
160162
+ // ../agent-sdk/dist/chunk-R43A2QH7.js
160105
160163
  function buildOpenApiDocument(opts) {
160106
160164
  const generator = new import_zod_to_openapi3.OpenApiGeneratorV31(registry2.definitions);
160107
160165
  return generator.generateDocument({
@@ -160134,15 +160192,17 @@ function buildOpenApiDocument(opts) {
160134
160192
  { name: "Tenants", description: "Multi-tenant isolation (global-admin-only)" },
160135
160193
  { name: "Audit", description: "Admin audit trail" },
160136
160194
  { name: "Auth", description: "Caller identity and license info" },
160137
- { name: "Batch", description: "Atomic batch operations" }
160195
+ { name: "Batch", description: "Atomic batch operations" },
160196
+ { name: "User Profiles", description: "User profile management and OAuth enrollment" },
160197
+ { name: "Google Compat", description: "Google Interactions API compatibility layer" }
160138
160198
  ]
160139
160199
  });
160140
160200
  }
160141
160201
  var import_zod_to_openapi3, ErrorResponses;
160142
- var init_chunk_CNMMJFJI = __esm({
160143
- "../agent-sdk/dist/chunk-CNMMJFJI.js"() {
160202
+ var init_chunk_R43A2QH7 = __esm({
160203
+ "../agent-sdk/dist/chunk-R43A2QH7.js"() {
160144
160204
  "use strict";
160145
- init_chunk_EOUNXIPM();
160205
+ init_chunk_2HVY2WZL();
160146
160206
  init_chunk_7346CKTF();
160147
160207
  init_zod();
160148
160208
  import_zod_to_openapi3 = __toESM(require_dist2(), 1);
@@ -161883,6 +161943,97 @@ var init_chunk_CNMMJFJI = __esm({
161883
161943
  ...ErrorResponses
161884
161944
  }
161885
161945
  });
161946
+ registry2.registerPath({
161947
+ method: "post",
161948
+ path: "/v1/user_profiles",
161949
+ tags: ["User Profiles"],
161950
+ summary: "Create user profile",
161951
+ security: [{ ApiKey: [] }],
161952
+ request: {
161953
+ body: {
161954
+ required: true,
161955
+ content: { "application/json": { schema: UserProfileCreateSchema } }
161956
+ }
161957
+ },
161958
+ responses: {
161959
+ 201: {
161960
+ description: "Created",
161961
+ content: { "application/json": { schema: UserProfileSchema } }
161962
+ },
161963
+ ...ErrorResponses
161964
+ }
161965
+ });
161966
+ registry2.registerPath({
161967
+ method: "get",
161968
+ path: "/v1/user_profiles",
161969
+ tags: ["User Profiles"],
161970
+ summary: "List user profiles",
161971
+ security: [{ ApiKey: [] }],
161972
+ responses: {
161973
+ 200: {
161974
+ description: "OK",
161975
+ content: { "application/json": { schema: UserProfileListSchema } }
161976
+ },
161977
+ ...ErrorResponses
161978
+ }
161979
+ });
161980
+ registry2.registerPath({
161981
+ method: "get",
161982
+ path: "/v1/user_profiles/{id}",
161983
+ tags: ["User Profiles"],
161984
+ summary: "Get user profile",
161985
+ security: [{ ApiKey: [] }],
161986
+ request: { params: external_exports.object({ id: external_exports.string() }) },
161987
+ responses: {
161988
+ 200: {
161989
+ description: "OK",
161990
+ content: { "application/json": { schema: UserProfileSchema } }
161991
+ },
161992
+ ...ErrorResponses
161993
+ }
161994
+ });
161995
+ registry2.registerPath({
161996
+ method: "post",
161997
+ path: "/v1/user_profiles/{id}",
161998
+ tags: ["User Profiles"],
161999
+ summary: "Update user profile",
162000
+ security: [{ ApiKey: [] }],
162001
+ request: {
162002
+ params: external_exports.object({ id: external_exports.string() }),
162003
+ body: {
162004
+ required: true,
162005
+ content: { "application/json": { schema: UserProfileUpdateSchema } }
162006
+ }
162007
+ },
162008
+ responses: {
162009
+ 200: {
162010
+ description: "OK",
162011
+ content: { "application/json": { schema: UserProfileSchema } }
162012
+ },
162013
+ ...ErrorResponses
162014
+ }
162015
+ });
162016
+ registry2.registerPath({
162017
+ method: "post",
162018
+ path: "/v1/user_profiles/{id}/enrollment_url",
162019
+ tags: ["User Profiles"],
162020
+ summary: "Generate OAuth enrollment URL",
162021
+ security: [{ ApiKey: [] }],
162022
+ request: {
162023
+ params: external_exports.object({ id: external_exports.string() }),
162024
+ body: {
162025
+ required: true,
162026
+ content: { "application/json": { schema: EnrollmentUrlRequestSchema } }
162027
+ }
162028
+ },
162029
+ responses: {
162030
+ 200: {
162031
+ description: "OK",
162032
+ content: { "application/json": { schema: EnrollmentUrlResponseSchema } }
162033
+ },
162034
+ ...ErrorResponses
162035
+ }
162036
+ });
161886
162037
  registry2.registerPath({
161887
162038
  method: "post",
161888
162039
  path: "/v1/batch",
@@ -161904,6 +162055,76 @@ var init_chunk_CNMMJFJI = __esm({
161904
162055
  ...ErrorResponses
161905
162056
  }
161906
162057
  });
162058
+ registry2.registerPath({
162059
+ method: "post",
162060
+ path: "/google/v1beta/interactions",
162061
+ tags: ["Google Compat"],
162062
+ summary: "Create interaction (Google compat)",
162063
+ description: "Google Interactions API compatibility. Accepts google-genai SDK format.",
162064
+ responses: { 200: { description: "OK" } }
162065
+ });
162066
+ registry2.registerPath({
162067
+ method: "get",
162068
+ path: "/google/v1beta/interactions/{id}",
162069
+ tags: ["Google Compat"],
162070
+ summary: "Get interaction (Google compat)",
162071
+ request: { params: external_exports.object({ id: external_exports.string() }) },
162072
+ responses: { 200: { description: "OK" } }
162073
+ });
162074
+ registry2.registerPath({
162075
+ method: "delete",
162076
+ path: "/google/v1beta/interactions/{id}",
162077
+ tags: ["Google Compat"],
162078
+ summary: "Delete interaction (Google compat)",
162079
+ request: { params: external_exports.object({ id: external_exports.string() }) },
162080
+ responses: { 200: { description: "OK" } }
162081
+ });
162082
+ registry2.registerPath({
162083
+ method: "post",
162084
+ path: "/google/v1beta/interactions/{id}/cancel",
162085
+ tags: ["Google Compat"],
162086
+ summary: "Cancel interaction (Google compat)",
162087
+ request: { params: external_exports.object({ id: external_exports.string() }) },
162088
+ responses: { 200: { description: "OK" } }
162089
+ });
162090
+ registry2.registerPath({
162091
+ method: "post",
162092
+ path: "/google/v1beta/agents",
162093
+ tags: ["Google Compat"],
162094
+ summary: "Create agent (Google compat)",
162095
+ responses: { 201: { description: "Created" } }
162096
+ });
162097
+ registry2.registerPath({
162098
+ method: "get",
162099
+ path: "/google/v1beta/agents",
162100
+ tags: ["Google Compat"],
162101
+ summary: "List agents (Google compat)",
162102
+ responses: { 200: { description: "OK" } }
162103
+ });
162104
+ registry2.registerPath({
162105
+ method: "get",
162106
+ path: "/google/v1beta/agents/{id}",
162107
+ tags: ["Google Compat"],
162108
+ summary: "Get agent (Google compat)",
162109
+ request: { params: external_exports.object({ id: external_exports.string() }) },
162110
+ responses: { 200: { description: "OK" } }
162111
+ });
162112
+ registry2.registerPath({
162113
+ method: "delete",
162114
+ path: "/google/v1beta/agents/{id}",
162115
+ tags: ["Google Compat"],
162116
+ summary: "Delete agent (Google compat)",
162117
+ request: { params: external_exports.object({ id: external_exports.string() }) },
162118
+ responses: { 200: { description: "OK" } }
162119
+ });
162120
+ registry2.registerPath({
162121
+ method: "get",
162122
+ path: "/google/v1beta/files/{fileRef}",
162123
+ tags: ["Google Compat"],
162124
+ summary: "Download environment files (Google compat)",
162125
+ request: { params: external_exports.object({ fileRef: external_exports.string() }) },
162126
+ responses: { 200: { description: "Tar archive", content: { "application/x-tar": { schema: external_exports.string().openapi({ description: "Raw tar archive bytes." }) } } } }
162127
+ });
161907
162128
  }
161908
162129
  });
161909
162130
 
@@ -218189,8 +218410,8 @@ var init_dist2 = __esm({
218189
218410
  "use strict";
218190
218411
  init_chunk_VFSOYCGN();
218191
218412
  init_chunk_2Z4T32WO();
218192
- init_chunk_CNMMJFJI();
218193
- init_chunk_EOUNXIPM();
218413
+ init_chunk_R43A2QH7();
218414
+ init_chunk_2HVY2WZL();
218194
218415
  init_chunk_7346CKTF();
218195
218416
  init_chunk_DC2UMEQH();
218196
218417
  init_chunk_IC2ETYU5();
@@ -219500,7 +219721,7 @@ var init_vaults = __esm({
219500
219721
  }
219501
219722
  });
219502
219723
 
219503
- // ../agent-sdk/dist/chunk-R6NWAM37.js
219724
+ // ../agent-sdk/dist/chunk-VSDPZ77X.js
219504
219725
  function getAgentTenantId2(id) {
219505
219726
  const row = getDb().prepare(`SELECT tenant_id FROM agents WHERE id = ?`).get(id);
219506
219727
  return row?.tenant_id;
@@ -219618,7 +219839,7 @@ function handleCreateSession(request2) {
219618
219839
  const vaultRow = getDb().prepare(`SELECT agent_id, tenant_id FROM vaults WHERE id = ?`).get(vid);
219619
219840
  if (!vaultRow) throw badRequest(`vault not found: ${vid}`);
219620
219841
  assertResourceTenant(auth, vaultRow.tenant_id, `vault not found: ${vid}`);
219621
- if (vaultRow.agent_id !== agent.id) {
219842
+ if (vaultRow.agent_id && vaultRow.agent_id !== agent.id) {
219622
219843
  throw badRequest(
219623
219844
  `vault ${vid} belongs to a different agent \u2014 vaults are scoped per-agent`
219624
219845
  );
@@ -220004,8 +220225,8 @@ function parseMs(v2) {
220004
220225
  return Number.isFinite(t2) ? t2 : void 0;
220005
220226
  }
220006
220227
  var ALLOWED_STATUSES, AgentRef, ResourceSchema, CreateSchema2, UpdateSchema2;
220007
- var init_chunk_R6NWAM37 = __esm({
220008
- "../agent-sdk/dist/chunk-R6NWAM37.js"() {
220228
+ var init_chunk_VSDPZ77X = __esm({
220229
+ "../agent-sdk/dist/chunk-VSDPZ77X.js"() {
220009
220230
  "use strict";
220010
220231
  init_chunk_VCU64NHY();
220011
220232
  init_chunk_ZBWKJ42J();
@@ -220100,7 +220321,7 @@ __export(sessions_exports, {
220100
220321
  var init_sessions = __esm({
220101
220322
  "../agent-sdk/dist/handlers/sessions.js"() {
220102
220323
  "use strict";
220103
- init_chunk_R6NWAM37();
220324
+ init_chunk_VSDPZ77X();
220104
220325
  init_chunk_VCU64NHY();
220105
220326
  init_chunk_ZBWKJ42J();
220106
220327
  init_chunk_23UKWXJH();
@@ -221564,7 +221785,7 @@ var init_bus = __esm({
221564
221785
  }
221565
221786
  });
221566
221787
 
221567
- // ../agent-sdk/dist/chunk-RHSVYAI4.js
221788
+ // ../agent-sdk/dist/chunk-IS37752C.js
221568
221789
  function ensureTable() {
221569
221790
  const db = getDb();
221570
221791
  db.exec(`
@@ -221632,17 +221853,17 @@ function handleCreateInteraction(request2) {
221632
221853
  ).run(interactionId2, sessionId2, seq, result2.status, environmentId ?? null, (/* @__PURE__ */ new Date()).toISOString());
221633
221854
  return jsonOk(buildResponse(interactionId2, result2, environmentId));
221634
221855
  }
221635
- const agentName = data.agent || `auto-${(data.model || "gemini-2.5-flash").replace(/[^a-z0-9-]/g, "-")}`;
221856
+ const modelId = data.model || "gemini-2.5-flash";
221857
+ const agentName = data.agent || `auto-${modelId.replace(/[^a-z0-9-]/g, "-")}`;
221636
221858
  const listReq = new Request(request2.url.replace(/\/google\/v1beta\/interactions.*/, `/v1/agents?limit=1000`), {
221637
221859
  headers: request2.headers
221638
221860
  });
221639
221861
  const listRes = await handleListAgents2(listReq);
221640
221862
  const listBody = await listRes.json();
221641
- const existing = listBody.data?.find((a) => a.name === agentName);
221863
+ const existing = listBody.data?.find((a) => a.name === agentName) ?? (data.agent ? void 0 : listBody.data?.find((a) => a.model?.id === modelId));
221642
221864
  if (existing) {
221643
221865
  agentId = existing.id;
221644
221866
  } else {
221645
- const modelId = data.model || "gemini-2.5-flash";
221646
221867
  const createReq = new Request(request2.url.replace(/\/google\/v1beta\/interactions.*/, `/v1/agents`), {
221647
221868
  method: "POST",
221648
221869
  headers: request2.headers,
@@ -221679,12 +221900,19 @@ function handleCreateInteraction(request2) {
221679
221900
  }
221680
221901
  }
221681
221902
  if (!environmentId) throw badRequest("no environment available");
221903
+ const { listVaults: listVaults2 } = await Promise.resolve().then(() => (init_vaults(), vaults_exports));
221904
+ const { tenantFilter: getTenantFilter } = await Promise.resolve().then(() => (init_scope2(), scope_exports));
221905
+ const tenantVaults = listVaults2({
221906
+ tenantFilter: getTenantFilter(auth)
221907
+ });
221908
+ const vaultIds = tenantVaults.filter((v2) => !v2.archived_at && (v2.agent_id === agentId || !v2.agent_id)).map((v2) => v2.id);
221682
221909
  const sessReq = new Request(request2.url.replace(/\/google\/v1beta\/interactions.*/, `/v1/sessions`), {
221683
221910
  method: "POST",
221684
221911
  headers: request2.headers,
221685
221912
  body: JSON.stringify({
221686
221913
  agent: agentId,
221687
- environment_id: environmentId
221914
+ environment_id: environmentId,
221915
+ ...vaultIds.length > 0 ? { vault_ids: vaultIds } : {}
221688
221916
  })
221689
221917
  });
221690
221918
  const sessRes = await handleCreateSession2(sessReq);
@@ -221939,8 +222167,8 @@ function buildResponse(id, result, environmentId) {
221939
222167
  };
221940
222168
  }
221941
222169
  var CreateSchema4;
221942
- var init_chunk_RHSVYAI4 = __esm({
221943
- "../agent-sdk/dist/chunk-RHSVYAI4.js"() {
222170
+ var init_chunk_IS37752C = __esm({
222171
+ "../agent-sdk/dist/chunk-IS37752C.js"() {
221944
222172
  "use strict";
221945
222173
  init_chunk_RMCBO7K7();
221946
222174
  init_chunk_F4WUVOLE();
@@ -224035,7 +224263,7 @@ function handleUpdateUserProfile(request2, id) {
224035
224263
  return jsonOk(updated);
224036
224264
  });
224037
224265
  }
224038
- var TrustGrantSchema, CreateSchema5, UpdateSchema4;
224266
+ var TrustGrantSchema2, CreateSchema5, UpdateSchema4;
224039
224267
  var init_chunk_2YZUXJAN = __esm({
224040
224268
  "../agent-sdk/dist/chunk-2YZUXJAN.js"() {
224041
224269
  "use strict";
@@ -224044,7 +224272,7 @@ var init_chunk_2YZUXJAN = __esm({
224044
224272
  init_chunk_YOZ6WDP3();
224045
224273
  init_chunk_EZYKRG4W();
224046
224274
  init_zod();
224047
- TrustGrantSchema = external_exports.object({
224275
+ TrustGrantSchema2 = external_exports.object({
224048
224276
  type: external_exports.literal("vault_credential"),
224049
224277
  vault_id: external_exports.string().min(1),
224050
224278
  credential_id: external_exports.string().min(1)
@@ -224052,12 +224280,12 @@ var init_chunk_2YZUXJAN = __esm({
224052
224280
  CreateSchema5 = external_exports.object({
224053
224281
  external_id: external_exports.string().max(256).optional(),
224054
224282
  display_name: external_exports.string().max(256).optional(),
224055
- trust_grants: external_exports.array(TrustGrantSchema).max(50).optional()
224283
+ trust_grants: external_exports.array(TrustGrantSchema2).max(50).optional()
224056
224284
  });
224057
224285
  UpdateSchema4 = external_exports.object({
224058
224286
  external_id: external_exports.string().max(256).nullish(),
224059
224287
  display_name: external_exports.string().max(256).nullish(),
224060
- trust_grants: external_exports.array(TrustGrantSchema).max(50).optional()
224288
+ trust_grants: external_exports.array(TrustGrantSchema2).max(50).optional()
224061
224289
  });
224062
224290
  }
224063
224291
  });
@@ -224462,7 +224690,7 @@ var init_chunk_VIWYYVGR = __esm({
224462
224690
  }
224463
224691
  });
224464
224692
 
224465
- // ../agent-sdk/dist/chunk-NG6NUC3W.js
224693
+ // ../agent-sdk/dist/chunk-CCNG7D6Y.js
224466
224694
  function originFromRequest(request2) {
224467
224695
  const headers3 = request2.headers;
224468
224696
  const proto3 = headers3.get("x-forwarded-proto") ?? new URL(request2.url).protocol.replace(":", "");
@@ -224474,10 +224702,10 @@ async function handleGetOpenApiSpec(request2) {
224474
224702
  const doc = buildOpenApiDocument({ serverUrl });
224475
224703
  return Response.json(doc);
224476
224704
  }
224477
- var init_chunk_NG6NUC3W = __esm({
224478
- "../agent-sdk/dist/chunk-NG6NUC3W.js"() {
224705
+ var init_chunk_CCNG7D6Y = __esm({
224706
+ "../agent-sdk/dist/chunk-CCNG7D6Y.js"() {
224479
224707
  "use strict";
224480
- init_chunk_CNMMJFJI();
224708
+ init_chunk_R43A2QH7();
224481
224709
  }
224482
224710
  });
224483
224711
 
@@ -226657,7 +226885,7 @@ __export(handlers_exports, {
226657
226885
  var init_handlers3 = __esm({
226658
226886
  "../agent-sdk/dist/handlers/index.js"() {
226659
226887
  "use strict";
226660
- init_chunk_RHSVYAI4();
226888
+ init_chunk_IS37752C();
226661
226889
  init_chunk_2HTAIROL();
226662
226890
  init_chunk_PULMO5OO();
226663
226891
  init_chunk_3CDJ2VQN();
@@ -226674,10 +226902,10 @@ var init_handlers3 = __esm({
226674
226902
  init_chunk_W3DA3OFL();
226675
226903
  init_chunk_VIWYYVGR();
226676
226904
  init_chunk_UTGP4X74();
226677
- init_chunk_NG6NUC3W();
226905
+ init_chunk_CCNG7D6Y();
226678
226906
  init_chunk_R7MZNZNC();
226679
226907
  init_chunk_DQIQBMC2();
226680
- init_chunk_R6NWAM37();
226908
+ init_chunk_VSDPZ77X();
226681
226909
  init_chunk_VCU64NHY();
226682
226910
  init_chunk_52K3LOFD();
226683
226911
  init_chunk_2E43SH4Y();
@@ -226704,8 +226932,8 @@ var init_handlers3 = __esm({
226704
226932
  init_chunk_LJ2ZXLLT();
226705
226933
  init_chunk_23UKWXJH();
226706
226934
  init_chunk_ZBFU37UL();
226707
- init_chunk_CNMMJFJI();
226708
- init_chunk_EOUNXIPM();
226935
+ init_chunk_R43A2QH7();
226936
+ init_chunk_2HVY2WZL();
226709
226937
  init_chunk_7346CKTF();
226710
226938
  init_chunk_DC2UMEQH();
226711
226939
  init_chunk_IC2ETYU5();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentstep/gateway",
3
- "version": "0.5.36",
3
+ "version": "0.5.38",
4
4
  "description": "Self-hosted, open-source, Anthropic Managed Agents-compatible. CLI + web UI for running AI agents in sandboxed environments.",
5
5
  "keywords": [
6
6
  "anthropic",