@agentstep/agent-sdk 0.5.37 → 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.
- package/dist/{chunk-VRWXVIIG.js → chunk-IS37752C.js} +4 -5
- package/dist/{chunk-R6NWAM37.js → chunk-VSDPZ77X.js} +1 -1
- package/dist/handlers/google-compat/index.js +1 -1
- package/dist/handlers/google-compat/interactions.js +1 -1
- package/dist/handlers/index.js +2 -2
- package/dist/handlers/sessions.js +1 -1
- package/package.json +1 -1
|
@@ -97,17 +97,17 @@ function handleCreateInteraction(request) {
|
|
|
97
97
|
).run(interactionId2, sessionId2, seq, result2.status, environmentId ?? null, (/* @__PURE__ */ new Date()).toISOString());
|
|
98
98
|
return jsonOk(buildResponse(interactionId2, result2, environmentId));
|
|
99
99
|
}
|
|
100
|
-
const
|
|
100
|
+
const modelId = data.model || "gemini-2.5-flash";
|
|
101
|
+
const agentName = data.agent || `auto-${modelId.replace(/[^a-z0-9-]/g, "-")}`;
|
|
101
102
|
const listReq = new Request(request.url.replace(/\/google\/v1beta\/interactions.*/, `/v1/agents?limit=1000`), {
|
|
102
103
|
headers: request.headers
|
|
103
104
|
});
|
|
104
105
|
const listRes = await handleListAgents(listReq);
|
|
105
106
|
const listBody = await listRes.json();
|
|
106
|
-
const existing = listBody.data?.find((a) => a.name === agentName);
|
|
107
|
+
const existing = listBody.data?.find((a) => a.name === agentName) ?? (data.agent ? void 0 : listBody.data?.find((a) => a.model?.id === modelId));
|
|
107
108
|
if (existing) {
|
|
108
109
|
agentId = existing.id;
|
|
109
110
|
} else {
|
|
110
|
-
const modelId = data.model || "gemini-2.5-flash";
|
|
111
111
|
const createReq = new Request(request.url.replace(/\/google\/v1beta\/interactions.*/, `/v1/agents`), {
|
|
112
112
|
method: "POST",
|
|
113
113
|
headers: request.headers,
|
|
@@ -149,8 +149,7 @@ function handleCreateInteraction(request) {
|
|
|
149
149
|
const tenantVaults = listVaults({
|
|
150
150
|
tenantFilter: getTenantFilter(auth)
|
|
151
151
|
});
|
|
152
|
-
const
|
|
153
|
-
const vaultIds = agentVaults.filter((v) => !v.archived_at).map((v) => v.id);
|
|
152
|
+
const vaultIds = tenantVaults.filter((v) => !v.archived_at && (v.agent_id === agentId || !v.agent_id)).map((v) => v.id);
|
|
154
153
|
const sessReq = new Request(request.url.replace(/\/google\/v1beta\/interactions.*/, `/v1/sessions`), {
|
|
155
154
|
method: "POST",
|
|
156
155
|
headers: request.headers,
|
|
@@ -254,7 +254,7 @@ function handleCreateSession(request) {
|
|
|
254
254
|
const vaultRow = getDb().prepare(`SELECT agent_id, tenant_id FROM vaults WHERE id = ?`).get(vid);
|
|
255
255
|
if (!vaultRow) throw badRequest(`vault not found: ${vid}`);
|
|
256
256
|
assertResourceTenant(auth, vaultRow.tenant_id, `vault not found: ${vid}`);
|
|
257
|
-
if (vaultRow.agent_id !== agent.id) {
|
|
257
|
+
if (vaultRow.agent_id && vaultRow.agent_id !== agent.id) {
|
|
258
258
|
throw badRequest(
|
|
259
259
|
`vault ${vid} belongs to a different agent \u2014 vaults are scoped per-agent`
|
|
260
260
|
);
|
package/dist/handlers/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
handleCreateInteraction,
|
|
5
5
|
handleDeleteInteraction,
|
|
6
6
|
handleGetInteraction
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-IS37752C.js";
|
|
8
8
|
import {
|
|
9
9
|
handleCreateGoogleAgent,
|
|
10
10
|
handleDeleteGoogleAgent,
|
|
@@ -103,7 +103,7 @@ import {
|
|
|
103
103
|
handleGetSession,
|
|
104
104
|
handleListSessions,
|
|
105
105
|
handleUpdateSession
|
|
106
|
-
} from "../chunk-
|
|
106
|
+
} from "../chunk-VSDPZ77X.js";
|
|
107
107
|
import "../chunk-VCU64NHY.js";
|
|
108
108
|
import {
|
|
109
109
|
handleGetSetting,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"license": "Apache-2.0",
|
|
3
3
|
"name": "@agentstep/agent-sdk",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.38",
|
|
5
5
|
"description": "Core engine for AgentStep Gateway \u2014 backends, sandbox providers, session orchestration, and vault encryption.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"anthropic",
|