sarvam-agents-client 0.3.2 → 0.4.1
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/README.md +36 -23
- package/dist/apis/AgentConversationsApi.d.ts +2 -2
- package/dist/apis/AgentConversationsApi.js +2 -2
- package/dist/apis/AgentsApi.d.ts +195 -5
- package/dist/apis/AgentsApi.js +478 -5
- package/dist/apis/ArtifactsApi.d.ts +8 -4
- package/dist/apis/ArtifactsApi.js +8 -4
- package/dist/apis/ConversationsApi.d.ts +2 -0
- package/dist/apis/ConversationsApi.js +6 -0
- package/dist/client.d.ts +16 -0
- package/dist/client.js +21 -0
- package/dist/compose/deploy.d.ts +37 -7
- package/dist/compose/deploy.js +105 -19
- package/dist/compose/errors.d.ts +1 -1
- package/dist/compose/errors.js +1 -1
- package/dist/compose/index.d.ts +1 -1
- package/dist/compose/index.js +2 -1
- package/dist/compose/run.d.ts +5 -1
- package/dist/compose/run.js +9 -9
- package/dist/compose/settingsTransport.d.ts +14 -0
- package/dist/compose/settingsTransport.js +151 -14
- package/dist/compose/transport.d.ts +14 -0
- package/dist/compose/transport.js +3 -0
- package/dist/compose/webhook.d.ts +18 -3
- package/dist/compose/webhook.js +59 -10
- package/dist/compose/webhookSecrets.d.ts +64 -0
- package/dist/compose/webhookSecrets.js +255 -0
- package/dist/esm/apis/AgentConversationsApi.d.ts +2 -2
- package/dist/esm/apis/AgentConversationsApi.js +2 -2
- package/dist/esm/apis/AgentsApi.d.ts +195 -5
- package/dist/esm/apis/AgentsApi.js +478 -5
- package/dist/esm/apis/ArtifactsApi.d.ts +8 -4
- package/dist/esm/apis/ArtifactsApi.js +8 -4
- package/dist/esm/apis/ConversationsApi.d.ts +2 -0
- package/dist/esm/apis/ConversationsApi.js +6 -0
- package/dist/esm/client.d.ts +16 -0
- package/dist/esm/client.js +17 -0
- package/dist/esm/compose/deploy.d.ts +37 -7
- package/dist/esm/compose/deploy.js +105 -20
- package/dist/esm/compose/errors.d.ts +1 -1
- package/dist/esm/compose/errors.js +1 -1
- package/dist/esm/compose/index.d.ts +1 -1
- package/dist/esm/compose/index.js +1 -1
- package/dist/esm/compose/run.d.ts +5 -1
- package/dist/esm/compose/run.js +9 -9
- package/dist/esm/compose/settingsTransport.d.ts +14 -0
- package/dist/esm/compose/settingsTransport.js +151 -14
- package/dist/esm/compose/transport.d.ts +14 -0
- package/dist/esm/compose/transport.js +2 -1
- package/dist/esm/compose/webhook.d.ts +18 -3
- package/dist/esm/compose/webhook.js +55 -9
- package/dist/esm/compose/webhookSecrets.d.ts +64 -0
- package/dist/esm/compose/webhookSecrets.js +250 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/models/AgentAttachmentDiff.d.ts +50 -0
- package/dist/esm/models/AgentAttachmentDiff.js +55 -0
- package/dist/esm/models/AgentContentsResource.d.ts +71 -0
- package/dist/esm/models/AgentContentsResource.js +70 -0
- package/dist/esm/models/AgentDeploy.d.ts +33 -0
- package/dist/esm/models/AgentDeploy.js +41 -0
- package/dist/esm/models/AgentDraftResource.d.ts +51 -0
- package/dist/esm/models/AgentDraftResource.js +52 -0
- package/dist/esm/models/AgentFileContent.d.ts +38 -0
- package/dist/esm/models/AgentFileContent.js +47 -0
- package/dist/esm/models/AgentHistoryResource.d.ts +71 -0
- package/dist/esm/models/AgentHistoryResource.js +66 -0
- package/dist/esm/models/AgentResource.d.ts +21 -0
- package/dist/esm/models/AgentResource.js +12 -0
- package/dist/esm/models/AgentSkillFilePin.d.ts +44 -0
- package/dist/esm/models/AgentSkillFilePin.js +51 -0
- package/dist/esm/models/AgentSubagentEntry.d.ts +38 -0
- package/dist/esm/models/AgentSubagentEntry.js +47 -0
- package/dist/esm/models/AgentVersionCreate.d.ts +32 -0
- package/dist/esm/models/AgentVersionCreate.js +41 -0
- package/dist/esm/models/AgentVersionDiffResource.d.ts +87 -0
- package/dist/esm/models/AgentVersionDiffResource.js +78 -0
- package/dist/esm/models/AgentVersionPick.d.ts +32 -0
- package/dist/esm/models/AgentVersionPick.js +43 -0
- package/dist/esm/models/AgentVersionResource.d.ts +56 -0
- package/dist/esm/models/AgentVersionResource.js +57 -0
- package/dist/esm/models/AppResource.d.ts +12 -0
- package/dist/esm/models/AppResource.js +4 -0
- package/dist/esm/models/ResponseInput.d.ts +6 -0
- package/dist/esm/models/ResponseInput.js +2 -0
- package/dist/esm/models/SkillUpdateResource.d.ts +38 -0
- package/dist/esm/models/SkillUpdateResource.js +47 -0
- package/dist/esm/models/index.d.ts +13 -0
- package/dist/esm/models/index.js +13 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -0
- package/dist/models/AgentAttachmentDiff.d.ts +50 -0
- package/dist/models/AgentAttachmentDiff.js +62 -0
- package/dist/models/AgentContentsResource.d.ts +71 -0
- package/dist/models/AgentContentsResource.js +77 -0
- package/dist/models/AgentDeploy.d.ts +33 -0
- package/dist/models/AgentDeploy.js +48 -0
- package/dist/models/AgentDraftResource.d.ts +51 -0
- package/dist/models/AgentDraftResource.js +59 -0
- package/dist/models/AgentFileContent.d.ts +38 -0
- package/dist/models/AgentFileContent.js +54 -0
- package/dist/models/AgentHistoryResource.d.ts +71 -0
- package/dist/models/AgentHistoryResource.js +74 -0
- package/dist/models/AgentResource.d.ts +21 -0
- package/dist/models/AgentResource.js +13 -1
- package/dist/models/AgentSkillFilePin.d.ts +44 -0
- package/dist/models/AgentSkillFilePin.js +58 -0
- package/dist/models/AgentSubagentEntry.d.ts +38 -0
- package/dist/models/AgentSubagentEntry.js +54 -0
- package/dist/models/AgentVersionCreate.d.ts +32 -0
- package/dist/models/AgentVersionCreate.js +48 -0
- package/dist/models/AgentVersionDiffResource.d.ts +87 -0
- package/dist/models/AgentVersionDiffResource.js +85 -0
- package/dist/models/AgentVersionPick.d.ts +32 -0
- package/dist/models/AgentVersionPick.js +50 -0
- package/dist/models/AgentVersionResource.d.ts +56 -0
- package/dist/models/AgentVersionResource.js +64 -0
- package/dist/models/AppResource.d.ts +12 -0
- package/dist/models/AppResource.js +4 -0
- package/dist/models/ResponseInput.d.ts +6 -0
- package/dist/models/ResponseInput.js +2 -0
- package/dist/models/SkillUpdateResource.d.ts +38 -0
- package/dist/models/SkillUpdateResource.js +54 -0
- package/dist/models/index.d.ts +13 -0
- package/dist/models/index.js +13 -0
- package/package.json +1 -1
- package/src/apis/AgentConversationsApi.ts +2 -2
- package/src/apis/AgentsApi.ts +737 -6
- package/src/apis/ArtifactsApi.ts +8 -4
- package/src/apis/ConversationsApi.ts +10 -0
- package/src/client.ts +21 -0
- package/src/compose/deploy.ts +126 -20
- package/src/compose/errors.ts +1 -1
- package/src/compose/index.ts +1 -1
- package/src/compose/run.ts +6 -2
- package/src/compose/settingsTransport.ts +154 -16
- package/src/compose/transport.ts +15 -0
- package/src/compose/webhook.ts +64 -11
- package/src/compose/webhookSecrets.ts +257 -0
- package/src/index.ts +4 -0
- package/src/models/AgentAttachmentDiff.ts +93 -0
- package/src/models/AgentContentsResource.ts +142 -0
- package/src/models/AgentDeploy.ts +66 -0
- package/src/models/AgentDraftResource.ts +99 -0
- package/src/models/AgentFileContent.ts +75 -0
- package/src/models/AgentHistoryResource.ts +121 -0
- package/src/models/AgentResource.ts +26 -0
- package/src/models/AgentSkillFilePin.ts +84 -0
- package/src/models/AgentSubagentEntry.ts +75 -0
- package/src/models/AgentVersionCreate.ts +65 -0
- package/src/models/AgentVersionDiffResource.ts +154 -0
- package/src/models/AgentVersionPick.ts +66 -0
- package/src/models/AgentVersionResource.ts +101 -0
- package/src/models/AppResource.ts +16 -0
- package/src/models/ResponseInput.ts +8 -0
- package/src/models/SkillUpdateResource.ts +75 -0
- package/src/models/index.ts +13 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
+
};
|
|
13
|
+
var _WebhookSecrets_backend;
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.WebhookSecrets = exports.PLACEHOLDER_DESCRIPTION = exports.SECRET_DESCRIPTION = void 0;
|
|
16
|
+
exports.secretBackend = secretBackend;
|
|
17
|
+
/**
|
|
18
|
+
* `client.webhooks`: set, rotate, check and delete an agent webhook's signing secret (as Python's
|
|
19
|
+
* `sarvam_agents.compose.webhook_secrets`).
|
|
20
|
+
*
|
|
21
|
+
* The public surface is `WebhookSecrets`. Where the secret lives is behind `SecretBackend`, one small interface with
|
|
22
|
+
* one implementation today, `CustomApiBackend`: the secret is a bearer Custom API the SDK creates, owns and binds to
|
|
23
|
+
* the agent, always with `enabledForChats: false` (`CustomApiCreate` defaults it to true, which would let the agent's
|
|
24
|
+
* sandbox be handed the secret on requests to the webhook's host). When the server ships dedicated secret endpoints
|
|
25
|
+
* (SARC-2597: PUT/DELETE secret, rotate-secret, secretStatus), a second backend replaces this one in `secretBackend`
|
|
26
|
+
* and nothing else changes.
|
|
27
|
+
*
|
|
28
|
+
* No secret is logged, kept on an object or put in an error message.
|
|
29
|
+
*/
|
|
30
|
+
const CustomAPIsApi_js_1 = require("../apis/CustomAPIsApi.js");
|
|
31
|
+
const runtime_js_1 = require("../runtime.js");
|
|
32
|
+
const errors_js_1 = require("./errors.js");
|
|
33
|
+
// Loaded on first use, so the root entry point (which exports `Client`) does not import `node:crypto` up front.
|
|
34
|
+
const loadWebhook = () => Promise.resolve().then(() => require("./webhook.js"));
|
|
35
|
+
const loadCrypto = () => Promise.resolve().then(() => require("../webhooks.js"));
|
|
36
|
+
/** Every Custom API the SDK creates for a webhook secret carries this description (and its name). */
|
|
37
|
+
exports.SECRET_DESCRIPTION = "Webhook signing secret managed by the Sarvam Agents SDK (client.webhooks). Do not edit.";
|
|
38
|
+
/** The description of the random secret `deploy` stores when none is set yet: `secretStatus` reads it as
|
|
39
|
+
* `"missing"`, and `setSecret`/`rotateSecret` overwrite it with `SECRET_DESCRIPTION`. */
|
|
40
|
+
exports.PLACEHOLDER_DESCRIPTION = "Webhook signing secret managed by the Sarvam Agents SDK (client.webhooks). Placeholder: call client.webhooks.set_secret";
|
|
41
|
+
const OWNED = [exports.SECRET_DESCRIPTION, exports.PLACEHOLDER_DESCRIPTION];
|
|
42
|
+
const PAGE = 100;
|
|
43
|
+
/** Throws `SecretFormatError` unless `secret` is `whsec_` plus base64 of 24 to 64 bytes (the verifier's own parser). */
|
|
44
|
+
async function checkSecret(secret) {
|
|
45
|
+
(await loadCrypto()).sign(secret, { msgId: "check", timestamp: 0, body: "" });
|
|
46
|
+
}
|
|
47
|
+
async function urlOf(hook) {
|
|
48
|
+
const url = typeof hook === "string" ? hook : hook === null || hook === void 0 ? void 0 : hook.url;
|
|
49
|
+
if (typeof url !== "string")
|
|
50
|
+
throw new errors_js_1.UserError("webhook: pass the webhook's URL (a string) or a webhook");
|
|
51
|
+
const problem = (await loadWebhook()).urlProblem(url);
|
|
52
|
+
if (problem !== null)
|
|
53
|
+
throw new errors_js_1.UserError("webhook: " + problem);
|
|
54
|
+
return url;
|
|
55
|
+
}
|
|
56
|
+
function agent(agentId) {
|
|
57
|
+
if (typeof agentId !== "string" || agentId.trim() === "")
|
|
58
|
+
throw new errors_js_1.UserError("agentId: pass the agent's id");
|
|
59
|
+
return agentId;
|
|
60
|
+
}
|
|
61
|
+
function status(err) {
|
|
62
|
+
return err instanceof runtime_js_1.ResponseError ? err.response.status : 0;
|
|
63
|
+
}
|
|
64
|
+
/** The server's reason, never its raw body: a 422 may echo the request, and the request carries the secret. */
|
|
65
|
+
async function apiMessage(err, secret) {
|
|
66
|
+
var _a, _b;
|
|
67
|
+
let message;
|
|
68
|
+
if (err instanceof runtime_js_1.ResponseError) {
|
|
69
|
+
try {
|
|
70
|
+
message = (_b = (_a = ((await err.response.clone().json()))) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
71
|
+
}
|
|
72
|
+
catch (_c) {
|
|
73
|
+
message = undefined;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (typeof message !== "string" || !message || (secret !== undefined && message.includes(secret))) {
|
|
77
|
+
return `HTTP ${status(err) || "error"}`;
|
|
78
|
+
}
|
|
79
|
+
return message;
|
|
80
|
+
}
|
|
81
|
+
/** Today's store: a bearer Custom API the SDK owns, bound to the agent, never enabled for chats. */
|
|
82
|
+
class CustomApiBackend {
|
|
83
|
+
constructor(api) {
|
|
84
|
+
this.api = api;
|
|
85
|
+
}
|
|
86
|
+
/** The caller's Custom APIs named exactly `name` (`q` also matches substrings and hosts). */
|
|
87
|
+
async named(name) {
|
|
88
|
+
const found = [];
|
|
89
|
+
let offset = 0;
|
|
90
|
+
for (;;) {
|
|
91
|
+
const result = await this.api.listCustomApis({ q: name, limit: PAGE, offset });
|
|
92
|
+
for (const item of result.data)
|
|
93
|
+
if (item.name === name)
|
|
94
|
+
found.push(item);
|
|
95
|
+
offset += result.data.length;
|
|
96
|
+
if (result.data.length === 0 || !result.hasMore)
|
|
97
|
+
return found;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/** The Custom APIs named `name` that the SDK created; throws when only someone else's has the name. */
|
|
101
|
+
async owned(name) {
|
|
102
|
+
const named = await this.named(name);
|
|
103
|
+
const owned = named.filter((item) => { var _a; return OWNED.includes((_a = item.description) !== null && _a !== void 0 ? _a : ""); });
|
|
104
|
+
if (named.length > 0 && owned.length === 0) {
|
|
105
|
+
throw new errors_js_1.UserError(`a Custom API named '${name}' exists that the SDK did not create; it was left alone. ` +
|
|
106
|
+
"Rename or delete it, then try again");
|
|
107
|
+
}
|
|
108
|
+
return owned;
|
|
109
|
+
}
|
|
110
|
+
async bind(agentId, customApiId) {
|
|
111
|
+
const bound = (await this.api.listAgentCustomApis({ agentId })).data;
|
|
112
|
+
if (bound.some((item) => item.id === customApiId))
|
|
113
|
+
return;
|
|
114
|
+
try {
|
|
115
|
+
await this.api.bindCustomApi({ agentId, bindCustomApiBody: { customApiId } });
|
|
116
|
+
}
|
|
117
|
+
catch (err) {
|
|
118
|
+
if (status(err) === 409)
|
|
119
|
+
return; // bound meanwhile
|
|
120
|
+
throw new errors_js_1.UserError(`could not bind the webhook secret to agent ${agentId}: ${await apiMessage(err)}`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/** PATCH the secret in, always asking for `enabledForChats: false`. The server switches chats off by detaching a
|
|
124
|
+
* capability, and answers 404 when there is nothing to detach (the API is already off). Then the API is read
|
|
125
|
+
* back: only when it exists and is off is the PATCH sent again without the switch, so the secret still lands and
|
|
126
|
+
* chats stay off. */
|
|
127
|
+
async update(customApiId, host, description, secret) {
|
|
128
|
+
const patch = (off) => this.api.updateCustomApi({ customApiId, customApiUpdate: {
|
|
129
|
+
host, description, auth: { type: "bearer", token: secret }, ...off,
|
|
130
|
+
} });
|
|
131
|
+
try {
|
|
132
|
+
await patch({ enabledForChats: false });
|
|
133
|
+
}
|
|
134
|
+
catch (err) {
|
|
135
|
+
if (status(err) !== 404)
|
|
136
|
+
throw err;
|
|
137
|
+
if ((await this.api.getCustomApi({ customApiId })).enabledForChats !== false)
|
|
138
|
+
throw err; // gone (404) or on
|
|
139
|
+
await patch({});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
async store(agentId, url, secret, owned, description = exports.SECRET_DESCRIPTION) {
|
|
143
|
+
const { secretCredentialName, webhookHost } = await loadWebhook();
|
|
144
|
+
const name = secretCredentialName(agentId, url);
|
|
145
|
+
const host = webhookHost(url);
|
|
146
|
+
let customApiId;
|
|
147
|
+
try {
|
|
148
|
+
if (owned.length > 0) {
|
|
149
|
+
customApiId = owned[0].id;
|
|
150
|
+
await this.update(customApiId, host, description, secret);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
customApiId = (await this.api.createCustomApi({ customApiCreate: {
|
|
154
|
+
name, description, host, enabledForChats: false, auth: { type: "bearer", token: secret },
|
|
155
|
+
} })).id;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
catch (err) {
|
|
159
|
+
if (!(err instanceof runtime_js_1.ResponseError))
|
|
160
|
+
throw err;
|
|
161
|
+
throw new errors_js_1.UserError(`could not store the webhook secret for ${host}: ${await apiMessage(err, secret)}`);
|
|
162
|
+
}
|
|
163
|
+
await this.bind(agentId, customApiId);
|
|
164
|
+
return name;
|
|
165
|
+
}
|
|
166
|
+
async put(agentId, url, secret) {
|
|
167
|
+
await this.store(agentId, url, secret, await this.owned((await loadWebhook()).secretCredentialName(agentId, url)));
|
|
168
|
+
}
|
|
169
|
+
async status(agentId, url) {
|
|
170
|
+
const name = (await loadWebhook()).secretCredentialName(agentId, url);
|
|
171
|
+
// Not a placeholder, not someone else's.
|
|
172
|
+
const stored = (await this.named(name)).filter((item) => item.description === exports.SECRET_DESCRIPTION).map((i) => i.id);
|
|
173
|
+
if (stored.length === 0)
|
|
174
|
+
return "missing";
|
|
175
|
+
const bound = (await this.api.listAgentCustomApis({ agentId })).data;
|
|
176
|
+
return bound.some((item) => stored.includes(item.id)) ? "set" : "missing";
|
|
177
|
+
}
|
|
178
|
+
async delete(agentId, url) {
|
|
179
|
+
for (const item of await this.owned((await loadWebhook()).secretCredentialName(agentId, url))) {
|
|
180
|
+
try {
|
|
181
|
+
await this.api.unbindCustomApi({ agentId, customApiId: item.id });
|
|
182
|
+
}
|
|
183
|
+
catch (err) {
|
|
184
|
+
if (status(err) !== 404)
|
|
185
|
+
throw err;
|
|
186
|
+
}
|
|
187
|
+
try {
|
|
188
|
+
await this.api.deleteCustomApi({ customApiId: item.id });
|
|
189
|
+
}
|
|
190
|
+
catch (err) {
|
|
191
|
+
if (status(err) !== 404)
|
|
192
|
+
throw err;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
async ensure(agentId, url) {
|
|
197
|
+
const name = (await loadWebhook()).secretCredentialName(agentId, url);
|
|
198
|
+
const owned = await this.owned(name);
|
|
199
|
+
if (owned.length > 0) {
|
|
200
|
+
await this.bind(agentId, owned[0].id);
|
|
201
|
+
return { name, status: owned[0].description === exports.SECRET_DESCRIPTION ? "set" : "missing" };
|
|
202
|
+
}
|
|
203
|
+
console.warn(`agent ${agentId}: webhook ${url} has no signing secret yet; stored a random one nobody holds, so ` +
|
|
204
|
+
"deliveries fail verification until you call client.webhooks.setSecret");
|
|
205
|
+
const stored = await this.store(agentId, url, (await loadCrypto()).generateSecret(), owned, exports.PLACEHOLDER_DESCRIPTION);
|
|
206
|
+
return { name: stored, status: "missing" };
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/** The one place that picks where secrets live. */
|
|
210
|
+
function secretBackend(api) {
|
|
211
|
+
var _a;
|
|
212
|
+
return new CustomApiBackend((_a = api.customApis) !== null && _a !== void 0 ? _a : new CustomAPIsApi_js_1.CustomAPIsApi(api.config));
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* `client.webhooks`: the signing secret of each agent.json webhook.
|
|
216
|
+
*
|
|
217
|
+
* `webhook` is the webhook's URL (or a webhook object); the secret covers the URL's host. Secrets are `whsec_` plus
|
|
218
|
+
* base64 of 24 to 64 bytes.
|
|
219
|
+
*/
|
|
220
|
+
class WebhookSecrets {
|
|
221
|
+
constructor(config) {
|
|
222
|
+
_WebhookSecrets_backend.set(this, void 0);
|
|
223
|
+
__classPrivateFieldSet(this, _WebhookSecrets_backend, secretBackend({ config }), "f");
|
|
224
|
+
}
|
|
225
|
+
/** Store `secret` (a new generated one when left out) as the webhook's signing secret and return it. A malformed
|
|
226
|
+
* secret throws `SecretFormatError` before anything is sent. */
|
|
227
|
+
async setSecret(agentId, webhook, secret) {
|
|
228
|
+
const id = agent(agentId);
|
|
229
|
+
const url = await urlOf(webhook);
|
|
230
|
+
const value = secret === undefined ? (await loadCrypto()).generateSecret() : secret;
|
|
231
|
+
if (secret !== undefined)
|
|
232
|
+
await checkSecret(secret);
|
|
233
|
+
await __classPrivateFieldGet(this, _WebhookSecrets_backend, "f").put(id, url, value);
|
|
234
|
+
return value;
|
|
235
|
+
}
|
|
236
|
+
/** Replace the webhook's signing secret with a new generated one and return it. Have your receiver accept the old
|
|
237
|
+
* and the new secret for a few minutes: a delivery still retrying is signed with the new one. */
|
|
238
|
+
async rotateSecret(agentId, webhook) {
|
|
239
|
+
return this.setSecret(agentId, webhook);
|
|
240
|
+
}
|
|
241
|
+
/** `"set"` when the agent has a signing secret stored by `setSecret` or `rotateSecret` for the webhook; `"missing"`
|
|
242
|
+
* otherwise, including while it holds the placeholder a deploy stored. */
|
|
243
|
+
async secretStatus(agentId, webhook) {
|
|
244
|
+
const id = agent(agentId);
|
|
245
|
+
return __classPrivateFieldGet(this, _WebhookSecrets_backend, "f").status(id, await urlOf(webhook));
|
|
246
|
+
}
|
|
247
|
+
/** Remove the webhook's signing secret. Only what the SDK stored is removed; a Custom API you made yourself is
|
|
248
|
+
* never touched. Deliveries to the webhook fail until a new secret is set or the webhook is removed. */
|
|
249
|
+
async deleteSecret(agentId, webhook) {
|
|
250
|
+
const id = agent(agentId);
|
|
251
|
+
await __classPrivateFieldGet(this, _WebhookSecrets_backend, "f").delete(id, await urlOf(webhook));
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
exports.WebhookSecrets = WebhookSecrets;
|
|
255
|
+
_WebhookSecrets_backend = new WeakMap();
|
|
@@ -43,12 +43,12 @@ export interface ListAgentConversationsRequest {
|
|
|
43
43
|
*/
|
|
44
44
|
export declare class AgentConversationsApi extends runtime.BaseAPI {
|
|
45
45
|
/**
|
|
46
|
-
* Presign one file of a session from the log, signed on each click. The file belongs to the session\'s user, not to the caller, so the in-app presign (scoped to the caller) would 404. Instead: 1. List the session\'s artifacts as its owner and require ``artifact_id`` among them. Without this check, an agent owner could presign any file of that user by guessing an id, not just this session\'s. 2. Presign
|
|
46
|
+
* Presign one file of a session from the log, signed on each click. The file belongs to the session\'s user, not to the caller, so the in-app presign (scoped to the caller) would 404. Instead: 1. List the session\'s artifacts as its owner and require ``artifact_id`` among them. Without this check, an agent owner could presign any file of that user by guessing an id, not just this session\'s. 2. Presign with the owner\'s identity, as share links do. The artifact service still checks the ids against the artifact\'s real owner. The URL is a presigned S3 URL while the file is plaintext; clients that can follow file-gateway URLs use the v2 route.
|
|
47
47
|
* Agent Conversation Artifact Download Url Route
|
|
48
48
|
*/
|
|
49
49
|
agentConversationArtifactDownloadUrlRaw(requestParameters: AgentConversationArtifactDownloadUrlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DownloadUrlResponse>>;
|
|
50
50
|
/**
|
|
51
|
-
* Presign one file of a session from the log, signed on each click. The file belongs to the session\'s user, not to the caller, so the in-app presign (scoped to the caller) would 404. Instead: 1. List the session\'s artifacts as its owner and require ``artifact_id`` among them. Without this check, an agent owner could presign any file of that user by guessing an id, not just this session\'s. 2. Presign
|
|
51
|
+
* Presign one file of a session from the log, signed on each click. The file belongs to the session\'s user, not to the caller, so the in-app presign (scoped to the caller) would 404. Instead: 1. List the session\'s artifacts as its owner and require ``artifact_id`` among them. Without this check, an agent owner could presign any file of that user by guessing an id, not just this session\'s. 2. Presign with the owner\'s identity, as share links do. The artifact service still checks the ids against the artifact\'s real owner. The URL is a presigned S3 URL while the file is plaintext; clients that can follow file-gateway URLs use the v2 route.
|
|
52
52
|
* Agent Conversation Artifact Download Url Route
|
|
53
53
|
*/
|
|
54
54
|
agentConversationArtifactDownloadUrl(requestParameters: AgentConversationArtifactDownloadUrlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DownloadUrlResponse>;
|
|
@@ -18,7 +18,7 @@ import { AgentConversationDetailFromJSON, DownloadUrlResponseFromJSON, MessagesR
|
|
|
18
18
|
*/
|
|
19
19
|
export class AgentConversationsApi extends runtime.BaseAPI {
|
|
20
20
|
/**
|
|
21
|
-
* Presign one file of a session from the log, signed on each click. The file belongs to the session\'s user, not to the caller, so the in-app presign (scoped to the caller) would 404. Instead: 1. List the session\'s artifacts as its owner and require ``artifact_id`` among them. Without this check, an agent owner could presign any file of that user by guessing an id, not just this session\'s. 2. Presign
|
|
21
|
+
* Presign one file of a session from the log, signed on each click. The file belongs to the session\'s user, not to the caller, so the in-app presign (scoped to the caller) would 404. Instead: 1. List the session\'s artifacts as its owner and require ``artifact_id`` among them. Without this check, an agent owner could presign any file of that user by guessing an id, not just this session\'s. 2. Presign with the owner\'s identity, as share links do. The artifact service still checks the ids against the artifact\'s real owner. The URL is a presigned S3 URL while the file is plaintext; clients that can follow file-gateway URLs use the v2 route.
|
|
22
22
|
* Agent Conversation Artifact Download Url Route
|
|
23
23
|
*/
|
|
24
24
|
async agentConversationArtifactDownloadUrlRaw(requestParameters, initOverrides) {
|
|
@@ -55,7 +55,7 @@ export class AgentConversationsApi extends runtime.BaseAPI {
|
|
|
55
55
|
return new runtime.JSONApiResponse(response, (jsonValue) => DownloadUrlResponseFromJSON(jsonValue));
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
|
-
* Presign one file of a session from the log, signed on each click. The file belongs to the session\'s user, not to the caller, so the in-app presign (scoped to the caller) would 404. Instead: 1. List the session\'s artifacts as its owner and require ``artifact_id`` among them. Without this check, an agent owner could presign any file of that user by guessing an id, not just this session\'s. 2. Presign
|
|
58
|
+
* Presign one file of a session from the log, signed on each click. The file belongs to the session\'s user, not to the caller, so the in-app presign (scoped to the caller) would 404. Instead: 1. List the session\'s artifacts as its owner and require ``artifact_id`` among them. Without this check, an agent owner could presign any file of that user by guessing an id, not just this session\'s. 2. Presign with the owner\'s identity, as share links do. The artifact service still checks the ids against the artifact\'s real owner. The URL is a presigned S3 URL while the file is plaintext; clients that can follow file-gateway URLs use the v2 route.
|
|
59
59
|
* Agent Conversation Artifact Download Url Route
|
|
60
60
|
*/
|
|
61
61
|
async agentConversationArtifactDownloadUrl(requestParameters, initOverrides) {
|
|
@@ -10,12 +10,25 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime.js';
|
|
13
|
-
import type { AgentCreate, AgentResource, AgentSearchChannel, AgentSettingsResponse, AgentTemplateResource, AgentUpdate, EntityCategory, EntityListAgentResource, EntityListAgentTemplateResource, FileNodeView, FileWriteBody, InstructionsBody, InstructionsResponse, PageFileNodeView, PublishRequest, Scope } from '../models/index.js';
|
|
13
|
+
import type { AgentContentsResource, AgentCreate, AgentDeploy, AgentDraftResource, AgentHistoryResource, AgentResource, AgentSearchChannel, AgentSettingsResponse, AgentTemplateResource, AgentUpdate, AgentVersionCreate, AgentVersionDiffResource, AgentVersionPick, AgentVersionResource, EntityCategory, EntityListAgentResource, EntityListAgentTemplateResource, FileNodeView, FileWriteBody, InstructionsBody, InstructionsResponse, PageFileNodeView, PublishRequest, Scope, SkillUpdateResource } from '../models/index.js';
|
|
14
|
+
export interface AcceptSkillUpdateRequest {
|
|
15
|
+
agentId: string;
|
|
16
|
+
skillId: string;
|
|
17
|
+
}
|
|
18
|
+
export interface BranchFromVersionRequest {
|
|
19
|
+
agentId: string;
|
|
20
|
+
agentVersionPick: AgentVersionPick;
|
|
21
|
+
}
|
|
14
22
|
export interface CloneAgentRequest {
|
|
15
23
|
agentId: string;
|
|
16
24
|
origin?: CloneAgentOriginEnum;
|
|
17
25
|
xPanjaOrigin?: CloneAgentXPanjaOriginEnum;
|
|
18
26
|
}
|
|
27
|
+
export interface CompareVersionsRequest {
|
|
28
|
+
agentId: string;
|
|
29
|
+
fromVersion?: number | null;
|
|
30
|
+
toVersion?: number | null;
|
|
31
|
+
}
|
|
19
32
|
export interface CreateAgentRequest {
|
|
20
33
|
agentCreate: AgentCreate;
|
|
21
34
|
origin?: CreateAgentOriginEnum;
|
|
@@ -24,8 +37,13 @@ export interface CreateAgentRequest {
|
|
|
24
37
|
export interface DeleteAgentRequest {
|
|
25
38
|
agentId: string;
|
|
26
39
|
}
|
|
40
|
+
export interface DeleteVersionRequest {
|
|
41
|
+
agentId: string;
|
|
42
|
+
version: number;
|
|
43
|
+
}
|
|
27
44
|
export interface DeployAgentRequest {
|
|
28
45
|
agentId: string;
|
|
46
|
+
agentDeploy?: AgentDeploy;
|
|
29
47
|
}
|
|
30
48
|
export interface GetAgentRequest {
|
|
31
49
|
agentId: string;
|
|
@@ -45,9 +63,16 @@ export interface GetAgentSettingsSchemaRequest {
|
|
|
45
63
|
export interface GetAgentTemplateRequest {
|
|
46
64
|
templateId: string;
|
|
47
65
|
}
|
|
66
|
+
export interface GetDraftRequest {
|
|
67
|
+
agentId: string;
|
|
68
|
+
}
|
|
48
69
|
export interface GetInstructionsRequest {
|
|
49
70
|
agentId: string;
|
|
50
71
|
}
|
|
72
|
+
export interface GetVersionRequest {
|
|
73
|
+
agentId: string;
|
|
74
|
+
version: number;
|
|
75
|
+
}
|
|
51
76
|
export interface ListAgentFileHistoryRequest {
|
|
52
77
|
agentId: string;
|
|
53
78
|
filePath: string;
|
|
@@ -76,6 +101,15 @@ export interface ListAgentsRequest {
|
|
|
76
101
|
origin?: ListAgentsOriginEnum;
|
|
77
102
|
xPanjaOrigin?: ListAgentsXPanjaOriginEnum;
|
|
78
103
|
}
|
|
104
|
+
export interface ListHistoryRequest {
|
|
105
|
+
agentId: string;
|
|
106
|
+
}
|
|
107
|
+
export interface ListSkillUpdatesRequest {
|
|
108
|
+
agentId: string;
|
|
109
|
+
}
|
|
110
|
+
export interface ListVersionsRequest {
|
|
111
|
+
agentId: string;
|
|
112
|
+
}
|
|
79
113
|
export interface PatchAgentSettingsRequest {
|
|
80
114
|
agentId: string;
|
|
81
115
|
body: object;
|
|
@@ -97,9 +131,25 @@ export interface PutInstructionsRequest {
|
|
|
97
131
|
agentId: string;
|
|
98
132
|
instructionsBody: InstructionsBody;
|
|
99
133
|
}
|
|
134
|
+
export interface ResumeAgentRequest {
|
|
135
|
+
agentId: string;
|
|
136
|
+
}
|
|
137
|
+
export interface SaveVersionRequest {
|
|
138
|
+
agentId: string;
|
|
139
|
+
agentVersionCreate: AgentVersionCreate;
|
|
140
|
+
}
|
|
100
141
|
export interface UndeployAgentRequest {
|
|
101
142
|
agentId: string;
|
|
102
143
|
}
|
|
144
|
+
export interface UndoAttachmentEditRequest {
|
|
145
|
+
agentId: string;
|
|
146
|
+
kind: UndoAttachmentEditKindEnum;
|
|
147
|
+
targetId: string;
|
|
148
|
+
}
|
|
149
|
+
export interface UndoFileEditRequest {
|
|
150
|
+
agentId: string;
|
|
151
|
+
path: string;
|
|
152
|
+
}
|
|
103
153
|
export interface UnpublishAgentRequest {
|
|
104
154
|
agentId: string;
|
|
105
155
|
publishRequest?: PublishRequest;
|
|
@@ -112,6 +162,26 @@ export interface UpdateAgentRequest {
|
|
|
112
162
|
*
|
|
113
163
|
*/
|
|
114
164
|
export declare class AgentsApi extends runtime.BaseAPI {
|
|
165
|
+
/**
|
|
166
|
+
* Move the whole skill to its current files in the draft.
|
|
167
|
+
* Accept Skill Update
|
|
168
|
+
*/
|
|
169
|
+
acceptSkillUpdateRaw(requestParameters: AcceptSkillUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentDraftResource>>;
|
|
170
|
+
/**
|
|
171
|
+
* Move the whole skill to its current files in the draft.
|
|
172
|
+
* Accept Skill Update
|
|
173
|
+
*/
|
|
174
|
+
acceptSkillUpdate(requestParameters: AcceptSkillUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentDraftResource>;
|
|
175
|
+
/**
|
|
176
|
+
* Replace the draft so it reads as ``version`` (\"Edit from vN\").
|
|
177
|
+
* Branch From Version
|
|
178
|
+
*/
|
|
179
|
+
branchFromVersionRaw(requestParameters: BranchFromVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentDraftResource>>;
|
|
180
|
+
/**
|
|
181
|
+
* Replace the draft so it reads as ``version`` (\"Edit from vN\").
|
|
182
|
+
* Branch From Version
|
|
183
|
+
*/
|
|
184
|
+
branchFromVersion(requestParameters: BranchFromVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentDraftResource>;
|
|
115
185
|
/**
|
|
116
186
|
* Clone any agent the caller can *see* into a fresh private copy they own (no ownership required — clone is the non-owner\'s path to editing). Panja deep-clones skills + copies MCP/collection bindings; the clone is born ``user``-scoped. With ``origin=managed_agents`` the clone is tagged as a managed agent in ``draft`` (deploy state is never copied).
|
|
117
187
|
* Clone Agent
|
|
@@ -122,6 +192,16 @@ export declare class AgentsApi extends runtime.BaseAPI {
|
|
|
122
192
|
* Clone Agent
|
|
123
193
|
*/
|
|
124
194
|
cloneAgent(requestParameters: CloneAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentResource>;
|
|
195
|
+
/**
|
|
196
|
+
* What ``toVersion`` changes relative to ``fromVersion``. Omitted ``fromVersion`` is the live version (the deploy screen); omitted ``toVersion`` is the draft (the save dialog).
|
|
197
|
+
* Compare Versions
|
|
198
|
+
*/
|
|
199
|
+
compareVersionsRaw(requestParameters: CompareVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentVersionDiffResource>>;
|
|
200
|
+
/**
|
|
201
|
+
* What ``toVersion`` changes relative to ``fromVersion``. Omitted ``fromVersion`` is the live version (the deploy screen); omitted ``toVersion`` is the draft (the save dialog).
|
|
202
|
+
* Compare Versions
|
|
203
|
+
*/
|
|
204
|
+
compareVersions(requestParameters: CompareVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentVersionDiffResource>;
|
|
125
205
|
/**
|
|
126
206
|
* Create an agent, born ``user``-scoped and owned by the caller. ``llm_config`` is deployment-gated (ACCEPT_AGENT_LLM_CONFIG, same rule as v1): where disabled a non-null value is a 400, and the server stamps the fleet default so a fresh agent runs out of the box. ``instructions``, if given, is written as the initial ``AGENT.md``. ``origin=managed_agents`` also tags the new agent as a managed agent (``draft``) once the gateway create has succeeded; the gateway call itself is unchanged.
|
|
127
207
|
* Create Agent
|
|
@@ -143,12 +223,22 @@ export declare class AgentsApi extends runtime.BaseAPI {
|
|
|
143
223
|
*/
|
|
144
224
|
deleteAgent(requestParameters: DeleteAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
145
225
|
/**
|
|
146
|
-
*
|
|
226
|
+
* Delete a never-live version; 409 ``VERSION_WAS_LIVE`` otherwise.
|
|
227
|
+
* Delete Version
|
|
228
|
+
*/
|
|
229
|
+
deleteVersionRaw(requestParameters: DeleteVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
230
|
+
/**
|
|
231
|
+
* Delete a never-live version; 409 ``VERSION_WAS_LIVE`` otherwise.
|
|
232
|
+
* Delete Version
|
|
233
|
+
*/
|
|
234
|
+
deleteVersion(requestParameters: DeleteVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
235
|
+
/**
|
|
236
|
+
* Make a saved version what end users get, on every surface. With ``version``, that version goes live (newer or older: a rollback is a deploy of an older one); 409 ``MISSING_DEPENDENCIES`` names anything it uses that was deleted. Without a body, the newest saved version goes live (idempotent), as before versions. The UI labels this *Publish*; the API noun is ``deploy`` because ``/publish`` already means widening the agent\'s audience (scope), which deploying does not change.
|
|
147
237
|
* Deploy Agent
|
|
148
238
|
*/
|
|
149
239
|
deployAgentRaw(requestParameters: DeployAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentResource>>;
|
|
150
240
|
/**
|
|
151
|
-
*
|
|
241
|
+
* Make a saved version what end users get, on every surface. With ``version``, that version goes live (newer or older: a rollback is a deploy of an older one); 409 ``MISSING_DEPENDENCIES`` names anything it uses that was deleted. Without a body, the newest saved version goes live (idempotent), as before versions. The UI labels this *Publish*; the API noun is ``deploy`` because ``/publish`` already means widening the agent\'s audience (scope), which deploying does not change.
|
|
152
242
|
* Deploy Agent
|
|
153
243
|
*/
|
|
154
244
|
deployAgent(requestParameters: DeployAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentResource>;
|
|
@@ -202,6 +292,16 @@ export declare class AgentsApi extends runtime.BaseAPI {
|
|
|
202
292
|
* Get Agent Template
|
|
203
293
|
*/
|
|
204
294
|
getAgentTemplate(requestParameters: GetAgentTemplateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentTemplateResource>;
|
|
295
|
+
/**
|
|
296
|
+
* The draft (what Preview runs) and whether it has unsaved changes.
|
|
297
|
+
* Get Draft
|
|
298
|
+
*/
|
|
299
|
+
getDraftRaw(requestParameters: GetDraftRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentDraftResource>>;
|
|
300
|
+
/**
|
|
301
|
+
* The draft (what Preview runs) and whether it has unsaved changes.
|
|
302
|
+
* Get Draft
|
|
303
|
+
*/
|
|
304
|
+
getDraft(requestParameters: GetDraftRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentDraftResource>;
|
|
205
305
|
/**
|
|
206
306
|
* Get Instructions
|
|
207
307
|
*/
|
|
@@ -210,6 +310,16 @@ export declare class AgentsApi extends runtime.BaseAPI {
|
|
|
210
310
|
* Get Instructions
|
|
211
311
|
*/
|
|
212
312
|
getInstructions(requestParameters: GetInstructionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InstructionsResponse>;
|
|
313
|
+
/**
|
|
314
|
+
* What a saved version is made of (read-only).
|
|
315
|
+
* Get Version
|
|
316
|
+
*/
|
|
317
|
+
getVersionRaw(requestParameters: GetVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentContentsResource>>;
|
|
318
|
+
/**
|
|
319
|
+
* What a saved version is made of (read-only).
|
|
320
|
+
* Get Version
|
|
321
|
+
*/
|
|
322
|
+
getVersion(requestParameters: GetVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentContentsResource>;
|
|
213
323
|
/**
|
|
214
324
|
* List Agent File History Route
|
|
215
325
|
*/
|
|
@@ -246,6 +356,36 @@ export declare class AgentsApi extends runtime.BaseAPI {
|
|
|
246
356
|
* List Agents
|
|
247
357
|
*/
|
|
248
358
|
listAgents(requestParameters?: ListAgentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EntityListAgentResource>;
|
|
359
|
+
/**
|
|
360
|
+
* Every deploy, rollback, pause and resume, newest first.
|
|
361
|
+
* List History
|
|
362
|
+
*/
|
|
363
|
+
listHistoryRaw(requestParameters: ListHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<AgentHistoryResource>>>;
|
|
364
|
+
/**
|
|
365
|
+
* Every deploy, rollback, pause and resume, newest first.
|
|
366
|
+
* List History
|
|
367
|
+
*/
|
|
368
|
+
listHistory(requestParameters: ListHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<AgentHistoryResource>>;
|
|
369
|
+
/**
|
|
370
|
+
* Skills whose files changed since the agent pinned them.
|
|
371
|
+
* List Skill Updates
|
|
372
|
+
*/
|
|
373
|
+
listSkillUpdatesRaw(requestParameters: ListSkillUpdatesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<SkillUpdateResource>>>;
|
|
374
|
+
/**
|
|
375
|
+
* Skills whose files changed since the agent pinned them.
|
|
376
|
+
* List Skill Updates
|
|
377
|
+
*/
|
|
378
|
+
listSkillUpdates(requestParameters: ListSkillUpdatesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<SkillUpdateResource>>;
|
|
379
|
+
/**
|
|
380
|
+
* Saved versions, newest first (deleted ones left out).
|
|
381
|
+
* List Versions
|
|
382
|
+
*/
|
|
383
|
+
listVersionsRaw(requestParameters: ListVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<AgentVersionResource>>>;
|
|
384
|
+
/**
|
|
385
|
+
* Saved versions, newest first (deleted ones left out).
|
|
386
|
+
* List Versions
|
|
387
|
+
*/
|
|
388
|
+
listVersions(requestParameters: ListVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<AgentVersionResource>>;
|
|
249
389
|
/**
|
|
250
390
|
* JSON Merge Patch (RFC 7396) onto the latest settings; ``null`` removes a key.
|
|
251
391
|
* Patch Agent Settings
|
|
@@ -293,15 +433,55 @@ export declare class AgentsApi extends runtime.BaseAPI {
|
|
|
293
433
|
*/
|
|
294
434
|
putInstructions(requestParameters: PutInstructionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InstructionsResponse>;
|
|
295
435
|
/**
|
|
296
|
-
*
|
|
436
|
+
* Bring the paused version back live; 409 ``NOT_PAUSED`` otherwise.
|
|
437
|
+
* Resume Agent
|
|
438
|
+
*/
|
|
439
|
+
resumeAgentRaw(requestParameters: ResumeAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentResource>>;
|
|
440
|
+
/**
|
|
441
|
+
* Bring the paused version back live; 409 ``NOT_PAUSED`` otherwise.
|
|
442
|
+
* Resume Agent
|
|
443
|
+
*/
|
|
444
|
+
resumeAgent(requestParameters: ResumeAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentResource>;
|
|
445
|
+
/**
|
|
446
|
+
* Save the draft as the next version; 409 ``NO_CHANGES`` on an empty draft. Nothing is deployed.
|
|
447
|
+
* Save Version
|
|
448
|
+
*/
|
|
449
|
+
saveVersionRaw(requestParameters: SaveVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentVersionResource>>;
|
|
450
|
+
/**
|
|
451
|
+
* Save the draft as the next version; 409 ``NO_CHANGES`` on an empty draft. Nothing is deployed.
|
|
452
|
+
* Save Version
|
|
453
|
+
*/
|
|
454
|
+
saveVersion(requestParameters: SaveVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentVersionResource>;
|
|
455
|
+
/**
|
|
456
|
+
* Pause the live version: every surface stops answering (API sessions get 409 ``AGENT_NOT_DEPLOYED`` on their next turn) and ``/resume`` brings the same version back. The builder and Playground keep working. Idempotent: a no-op when nothing is live.
|
|
297
457
|
* Undeploy Agent
|
|
298
458
|
*/
|
|
299
459
|
undeployAgentRaw(requestParameters: UndeployAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentResource>>;
|
|
300
460
|
/**
|
|
301
|
-
*
|
|
461
|
+
* Pause the live version: every surface stops answering (API sessions get 409 ``AGENT_NOT_DEPLOYED`` on their next turn) and ``/resume`` brings the same version back. The builder and Playground keep working. Idempotent: a no-op when nothing is live.
|
|
302
462
|
* Undeploy Agent
|
|
303
463
|
*/
|
|
304
464
|
undeployAgent(requestParameters: UndeployAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentResource>;
|
|
465
|
+
/**
|
|
466
|
+
* Undo the draft\'s attach or detach of one skill / app / knowledge base / sub-agent.
|
|
467
|
+
* Undo Attachment Edit
|
|
468
|
+
*/
|
|
469
|
+
undoAttachmentEditRaw(requestParameters: UndoAttachmentEditRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentDraftResource>>;
|
|
470
|
+
/**
|
|
471
|
+
* Undo the draft\'s attach or detach of one skill / app / knowledge base / sub-agent.
|
|
472
|
+
* Undo Attachment Edit
|
|
473
|
+
*/
|
|
474
|
+
undoAttachmentEdit(requestParameters: UndoAttachmentEditRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentDraftResource>;
|
|
475
|
+
/**
|
|
476
|
+
* Undo the draft\'s edit or removal of one file.
|
|
477
|
+
* Undo File Edit
|
|
478
|
+
*/
|
|
479
|
+
undoFileEditRaw(requestParameters: UndoFileEditRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentDraftResource>>;
|
|
480
|
+
/**
|
|
481
|
+
* Undo the draft\'s edit or removal of one file.
|
|
482
|
+
* Undo File Edit
|
|
483
|
+
*/
|
|
484
|
+
undoFileEdit(requestParameters: UndoFileEditRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentDraftResource>;
|
|
305
485
|
/**
|
|
306
486
|
* Narrow the agent back to the owner\'s private (``user``) scope in one move. Owner-only; a gateway 409 (a shared channel/default would be left dangling) surfaces as ``CHAT_CONFLICT``.
|
|
307
487
|
* Unpublish Agent
|
|
@@ -379,3 +559,13 @@ export declare const ListAgentsXPanjaOriginEnum: {
|
|
|
379
559
|
readonly ManagedAgents: "managed_agents";
|
|
380
560
|
};
|
|
381
561
|
export type ListAgentsXPanjaOriginEnum = typeof ListAgentsXPanjaOriginEnum[keyof typeof ListAgentsXPanjaOriginEnum];
|
|
562
|
+
/**
|
|
563
|
+
* @export
|
|
564
|
+
*/
|
|
565
|
+
export declare const UndoAttachmentEditKindEnum: {
|
|
566
|
+
readonly Skill: "skill";
|
|
567
|
+
readonly App: "app";
|
|
568
|
+
readonly Collection: "collection";
|
|
569
|
+
readonly Subagent: "subagent";
|
|
570
|
+
};
|
|
571
|
+
export type UndoAttachmentEditKindEnum = typeof UndoAttachmentEditKindEnum[keyof typeof UndoAttachmentEditKindEnum];
|