@agentstep/gateway 0.5.38 → 0.5.39

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 +18 -11
  2. package/package.json +1 -1
package/dist/gateway.js CHANGED
@@ -221785,7 +221785,7 @@ var init_bus = __esm({
221785
221785
  }
221786
221786
  });
221787
221787
 
221788
- // ../agent-sdk/dist/chunk-IS37752C.js
221788
+ // ../agent-sdk/dist/chunk-KSKJ7IYH.js
221789
221789
  function ensureTable() {
221790
221790
  const db = getDb();
221791
221791
  db.exec(`
@@ -221860,7 +221860,19 @@ function handleCreateInteraction(request2) {
221860
221860
  });
221861
221861
  const listRes = await handleListAgents2(listReq);
221862
221862
  const listBody = await listRes.json();
221863
- const existing = listBody.data?.find((a) => a.name === agentName) ?? (data.agent ? void 0 : listBody.data?.find((a) => a.model?.id === modelId));
221863
+ const { listVaults: listVaults2 } = await Promise.resolve().then(() => (init_vaults(), vaults_exports));
221864
+ const { tenantFilter: getTenantFilter } = await Promise.resolve().then(() => (init_scope2(), scope_exports));
221865
+ const allVaults = listVaults2({ tenantFilter: getTenantFilter(auth) }).filter((v2) => !v2.archived_at);
221866
+ let existing;
221867
+ if (data.agent) {
221868
+ existing = listBody.data?.find((a) => a.name === agentName);
221869
+ } else {
221870
+ const modelMatches = listBody.data?.filter((a) => a.model?.id === modelId) ?? [];
221871
+ const withVaults = modelMatches.filter(
221872
+ (a) => allVaults.some((v2) => v2.agent_id === a.id || !v2.agent_id)
221873
+ );
221874
+ existing = modelMatches.find((a) => allVaults.some((v2) => v2.agent_id === a.id)) ?? withVaults[0] ?? modelMatches[0];
221875
+ }
221864
221876
  if (existing) {
221865
221877
  agentId = existing.id;
221866
221878
  } else {
@@ -221900,12 +221912,7 @@ function handleCreateInteraction(request2) {
221900
221912
  }
221901
221913
  }
221902
221914
  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);
221915
+ const vaultIds = allVaults.filter((v2) => v2.agent_id === agentId || !v2.agent_id).map((v2) => v2.id);
221909
221916
  const sessReq = new Request(request2.url.replace(/\/google\/v1beta\/interactions.*/, `/v1/sessions`), {
221910
221917
  method: "POST",
221911
221918
  headers: request2.headers,
@@ -222167,8 +222174,8 @@ function buildResponse(id, result, environmentId) {
222167
222174
  };
222168
222175
  }
222169
222176
  var CreateSchema4;
222170
- var init_chunk_IS37752C = __esm({
222171
- "../agent-sdk/dist/chunk-IS37752C.js"() {
222177
+ var init_chunk_KSKJ7IYH = __esm({
222178
+ "../agent-sdk/dist/chunk-KSKJ7IYH.js"() {
222172
222179
  "use strict";
222173
222180
  init_chunk_RMCBO7K7();
222174
222181
  init_chunk_F4WUVOLE();
@@ -226885,7 +226892,7 @@ __export(handlers_exports, {
226885
226892
  var init_handlers3 = __esm({
226886
226893
  "../agent-sdk/dist/handlers/index.js"() {
226887
226894
  "use strict";
226888
- init_chunk_IS37752C();
226895
+ init_chunk_KSKJ7IYH();
226889
226896
  init_chunk_2HTAIROL();
226890
226897
  init_chunk_PULMO5OO();
226891
226898
  init_chunk_3CDJ2VQN();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentstep/gateway",
3
- "version": "0.5.38",
3
+ "version": "0.5.39",
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",