@agentsky/sky 2.2.1 → 2.3.0
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-TMLNYYYY.js → chunk-2KQLWHHC.js} +66 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.js +46 -6
- package/dist/products.d.ts +585 -0
- package/dist/products.js +207 -0
- package/dist/{src-NNPV5GRJ.js → src-EGXYUSME.js} +7 -2
- package/package.json +21 -6
|
@@ -19030,12 +19030,17 @@ var REASONING_EFFORTS = {
|
|
|
19030
19030
|
kimi_code: null,
|
|
19031
19031
|
opencode: ["none", "minimal", "low", "medium", "high", "xhigh", "max"]
|
|
19032
19032
|
};
|
|
19033
|
-
function
|
|
19034
|
-
const
|
|
19033
|
+
function reasoningEffortsForModel(agentType, model) {
|
|
19034
|
+
const normalized = model?.split("/").at(-1);
|
|
19035
|
+
if (normalized === "gpt-6.1-sol" && (agentType === "codex" || agentType === "hermes")) return ["low", "medium", "high", "xhigh", "max"];
|
|
19036
|
+
return REASONING_EFFORTS[agentType];
|
|
19037
|
+
}
|
|
19038
|
+
function isModelEffortSupported(agentType, model, effort) {
|
|
19039
|
+
const allowed = reasoningEffortsForModel(agentType, model);
|
|
19035
19040
|
return allowed !== null && allowed.includes(effort);
|
|
19036
19041
|
}
|
|
19037
19042
|
function reasoningEffortDocLine() {
|
|
19038
|
-
return Object.entries(REASONING_EFFORTS).map(([type, values]) => values ? `${type}: ${values.join("/")}` : `${type}: not supported`).join("; ");
|
|
19043
|
+
return Object.entries(REASONING_EFFORTS).map(([type, values]) => values ? `${type}: ${values.join("/")}` : `${type}: not supported`).join("; ") + "; codex/hermes + gpt-6.1-sol: low/medium/high/xhigh/max";
|
|
19039
19044
|
}
|
|
19040
19045
|
|
|
19041
19046
|
// ../../packages/spec/src/acp-catalog.ts
|
|
@@ -21055,9 +21060,12 @@ function systemPlacementError(events) {
|
|
|
21055
21060
|
}
|
|
21056
21061
|
return null;
|
|
21057
21062
|
}
|
|
21058
|
-
var sendEventsSchema = external_exports.object({ events: external_exports.array(sessionEventSchema).min(1).max(MAX_EVENTS_PER_REQUEST) }).strict().superRefine((body, ctx) => {
|
|
21063
|
+
var sendEventsSchema = external_exports.object({ events: external_exports.array(sessionEventSchema).min(1).max(MAX_EVENTS_PER_REQUEST), requireIdle: external_exports.boolean().optional() }).strict().superRefine((body, ctx) => {
|
|
21059
21064
|
const error61 = systemPlacementError(body.events);
|
|
21060
21065
|
if (error61) ctx.addIssue({ code: "custom", message: error61, path: ["events"] });
|
|
21066
|
+
if (body.requireIdle && (body.events[0]?.type !== "user.message" || body.events.filter((event) => event.type === "user.message").length !== 1 || body.events.some((event) => event.type === "user.interrupt"))) {
|
|
21067
|
+
ctx.addIssue({ code: "custom", message: "requireIdle accepts one user.message and an optional system.message", path: ["events"] });
|
|
21068
|
+
}
|
|
21061
21069
|
});
|
|
21062
21070
|
var podMessageIdSchema = external_exports.string().regex(/^[A-Za-z0-9._:-]{1,128}$/);
|
|
21063
21071
|
var podTurnBodySchema = external_exports.object({
|
|
@@ -21121,6 +21129,10 @@ var usageReportSchema = external_exports.object({
|
|
|
21121
21129
|
basis: external_exports.enum(["provider", "estimated"]).default("provider"),
|
|
21122
21130
|
interrupted: external_exports.boolean().default(false),
|
|
21123
21131
|
durationMs: external_exports.number().int().min(0).nullish(),
|
|
21132
|
+
/** Supplier request start, set by the trusted model gateway. */
|
|
21133
|
+
occurredAt: external_exports.iso.datetime({ offset: true }).nullish(),
|
|
21134
|
+
/** Trusted product origin captured by the model gateway at call start. */
|
|
21135
|
+
promotionScope: external_exports.enum(["ANY", "PLAYGROUND"]).optional(),
|
|
21124
21136
|
// RFC-0071 gateway-sourced fields; absent on pod reports.
|
|
21125
21137
|
/** Vendor-assigned response id — auditable against the vendor. */
|
|
21126
21138
|
upstreamRequestId: external_exports.string().max(200).nullish(),
|
|
@@ -21132,6 +21144,13 @@ var usageReportSchema = external_exports.object({
|
|
|
21132
21144
|
usageRaw: external_exports.unknown().nullish()
|
|
21133
21145
|
});
|
|
21134
21146
|
|
|
21147
|
+
// ../../packages/spec/src/connection-support.ts
|
|
21148
|
+
var CHANNEL_IDS = ["slack", "telegram", "whatsapp", "imessage", "discord", "lark", "teams", "x", "email", "gchat", "line", "buzz"];
|
|
21149
|
+
var connectionSupportSchema = external_exports.object({
|
|
21150
|
+
channels: external_exports.union([external_exports.literal("all"), external_exports.array(external_exports.enum(CHANNEL_IDS)).transform((ids) => [...new Set(ids)])]),
|
|
21151
|
+
connectors: external_exports.enum(["all", "none"])
|
|
21152
|
+
}).strict();
|
|
21153
|
+
|
|
21135
21154
|
// ../../packages/spec/src/index.ts
|
|
21136
21155
|
var NATIVE_AGENT_TYPES = [
|
|
21137
21156
|
"hermes",
|
|
@@ -21146,7 +21165,7 @@ var NATIVE_AGENT_TYPES = [
|
|
|
21146
21165
|
];
|
|
21147
21166
|
var GENERAL_PURPOSE_NATIVE_AGENT_TYPES = NATIVE_AGENT_TYPES.filter((type) => type !== "jev");
|
|
21148
21167
|
var AGENT_TYPES = [...NATIVE_AGENT_TYPES, ...ACP_AGENT_TYPES];
|
|
21149
|
-
var
|
|
21168
|
+
var LEGACY_CAPABILITY_IDS = [
|
|
21150
21169
|
"embedding.openai",
|
|
21151
21170
|
"embedding.voyage",
|
|
21152
21171
|
"rerank.voyage",
|
|
@@ -21179,6 +21198,25 @@ var CAPABILITY_IDS = [
|
|
|
21179
21198
|
"minimax.h3",
|
|
21180
21199
|
"fish-audio.transcribe"
|
|
21181
21200
|
];
|
|
21201
|
+
var GATEWAY_CAPABILITY_IDS = [
|
|
21202
|
+
"exa.answer",
|
|
21203
|
+
"googlemap.geocode",
|
|
21204
|
+
"googlemap.places",
|
|
21205
|
+
"agentmail.list-inboxes",
|
|
21206
|
+
"social-boost.catalog",
|
|
21207
|
+
"tinyfish.search",
|
|
21208
|
+
"tinyfish.profile-list",
|
|
21209
|
+
"meta.transcribe",
|
|
21210
|
+
"minimax.tts",
|
|
21211
|
+
"elevenlabs.sound",
|
|
21212
|
+
"zai.transcribe",
|
|
21213
|
+
"openai.transcribe",
|
|
21214
|
+
"fish-audio.tts",
|
|
21215
|
+
"google.image",
|
|
21216
|
+
"openai.image-2.5",
|
|
21217
|
+
"wan.image"
|
|
21218
|
+
];
|
|
21219
|
+
var CAPABILITY_IDS = [...LEGACY_CAPABILITY_IDS, ...GATEWAY_CAPABILITY_IDS];
|
|
21182
21220
|
var allowedLlms = {
|
|
21183
21221
|
jev: ["typesafe/jev-1.13"],
|
|
21184
21222
|
agoragentic_acp: ["harness-default"],
|
|
@@ -21225,6 +21263,9 @@ var allowedLlms = {
|
|
|
21225
21263
|
hermes: [
|
|
21226
21264
|
"deepseek-v4-pro",
|
|
21227
21265
|
"deepseek-flash",
|
|
21266
|
+
"gpt-6.1-sol",
|
|
21267
|
+
"gpt-6-sol",
|
|
21268
|
+
"gpt-6-luna",
|
|
21228
21269
|
"gpt-5.6-sol",
|
|
21229
21270
|
"gpt-5.6-terra",
|
|
21230
21271
|
"gpt-5.6-luna",
|
|
@@ -21235,6 +21276,7 @@ var allowedLlms = {
|
|
|
21235
21276
|
"kimi-k3",
|
|
21236
21277
|
"kimi-k2.7-code",
|
|
21237
21278
|
"grok-4.6",
|
|
21279
|
+
"claude-opus-5-5",
|
|
21238
21280
|
"claude-opus-5",
|
|
21239
21281
|
"claude-fable-5-1",
|
|
21240
21282
|
"claude-sonnet-5",
|
|
@@ -21245,6 +21287,7 @@ var allowedLlms = {
|
|
|
21245
21287
|
"deepseek-v4-flash"
|
|
21246
21288
|
],
|
|
21247
21289
|
claude_code: [
|
|
21290
|
+
"claude-opus-5-5",
|
|
21248
21291
|
"claude-opus-5",
|
|
21249
21292
|
"claude-fable-5-1",
|
|
21250
21293
|
"claude-sonnet-5",
|
|
@@ -21254,6 +21297,9 @@ var allowedLlms = {
|
|
|
21254
21297
|
"claude-fable-5"
|
|
21255
21298
|
],
|
|
21256
21299
|
codex: [
|
|
21300
|
+
"gpt-6.1-sol",
|
|
21301
|
+
"gpt-6-sol",
|
|
21302
|
+
"gpt-6-luna",
|
|
21257
21303
|
"gpt-5.6-sol",
|
|
21258
21304
|
"gpt-5.6-terra",
|
|
21259
21305
|
"gpt-5.6-luna",
|
|
@@ -21276,6 +21322,7 @@ var allowedLlms = {
|
|
|
21276
21322
|
"kimi-k3",
|
|
21277
21323
|
"kimi-k2.7-code",
|
|
21278
21324
|
"grok-4.6",
|
|
21325
|
+
"claude-opus-5-5",
|
|
21279
21326
|
"claude-opus-5",
|
|
21280
21327
|
"claude-fable-5-1",
|
|
21281
21328
|
"claude-sonnet-5",
|
|
@@ -21297,6 +21344,7 @@ var allowedLlms = {
|
|
|
21297
21344
|
"kimi-k3",
|
|
21298
21345
|
"kimi-k2.7-code",
|
|
21299
21346
|
"grok-4.6",
|
|
21347
|
+
"claude-opus-5-5",
|
|
21300
21348
|
"claude-opus-5",
|
|
21301
21349
|
"claude-fable-5-1",
|
|
21302
21350
|
"claude-sonnet-5",
|
|
@@ -21328,6 +21376,7 @@ var allowedLlms = {
|
|
|
21328
21376
|
"glm-5.3",
|
|
21329
21377
|
"glm-5.3-flash",
|
|
21330
21378
|
"grok-4.6",
|
|
21379
|
+
"claude-opus-5-5",
|
|
21331
21380
|
"claude-opus-5",
|
|
21332
21381
|
"claude-fable-5-1",
|
|
21333
21382
|
"claude-sonnet-5",
|
|
@@ -21348,6 +21397,7 @@ var allowedLlms = {
|
|
|
21348
21397
|
"kimi-k3",
|
|
21349
21398
|
"kimi-k2.7-code",
|
|
21350
21399
|
"grok-4.6",
|
|
21400
|
+
"claude-opus-5-5",
|
|
21351
21401
|
"claude-opus-5",
|
|
21352
21402
|
"claude-fable-5-1",
|
|
21353
21403
|
"claude-sonnet-5",
|
|
@@ -21381,6 +21431,9 @@ var SELECTABLE_LLMS = [
|
|
|
21381
21431
|
function isCompatible(agentType, llm) {
|
|
21382
21432
|
return allowedLlms[agentType].includes(llm);
|
|
21383
21433
|
}
|
|
21434
|
+
function defaultLlm(agentType) {
|
|
21435
|
+
return allowedLlms[agentType][0];
|
|
21436
|
+
}
|
|
21384
21437
|
function modelSubscriptionProviderFor(agentType, llm) {
|
|
21385
21438
|
if (agentType === "claude_code" && llm.startsWith("claude-")) return "anthropic";
|
|
21386
21439
|
if (agentType === "codex" && llm.startsWith("gpt-")) return "openai";
|
|
@@ -21577,14 +21630,21 @@ export {
|
|
|
21577
21630
|
external_exports,
|
|
21578
21631
|
splitMcpServers,
|
|
21579
21632
|
mcpServersFromKept,
|
|
21633
|
+
userMessageEventSchema,
|
|
21634
|
+
systemMessageEventSchema,
|
|
21580
21635
|
messagePartSchema,
|
|
21581
21636
|
REASONING_EFFORT_VALUES,
|
|
21582
|
-
|
|
21637
|
+
isModelEffortSupported,
|
|
21583
21638
|
reasoningEffortDocLine,
|
|
21639
|
+
sessionResourcesParamSchema,
|
|
21584
21640
|
AGENT_TYPES,
|
|
21585
21641
|
supersededBy,
|
|
21642
|
+
defaultLlm,
|
|
21586
21643
|
modelSubscriptionProviderFor,
|
|
21587
21644
|
capabilitiesSchema,
|
|
21645
|
+
instructionFileSchema,
|
|
21588
21646
|
skillRefSchema,
|
|
21647
|
+
skillsArraySchema,
|
|
21648
|
+
mcpServersSchema,
|
|
21589
21649
|
customDataSchema
|
|
21590
21650
|
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
package/dist/index.js
CHANGED
|
@@ -4,15 +4,16 @@ import {
|
|
|
4
4
|
REASONING_EFFORT_VALUES,
|
|
5
5
|
capabilitiesSchema,
|
|
6
6
|
customDataSchema,
|
|
7
|
+
defaultLlm,
|
|
7
8
|
external_exports,
|
|
8
|
-
|
|
9
|
+
isModelEffortSupported,
|
|
9
10
|
mcpServersFromKept,
|
|
10
11
|
modelSubscriptionProviderFor,
|
|
11
12
|
reasoningEffortDocLine,
|
|
12
13
|
skillRefSchema,
|
|
13
14
|
splitMcpServers,
|
|
14
15
|
supersededBy
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-2KQLWHHC.js";
|
|
16
17
|
|
|
17
18
|
// src/index.ts
|
|
18
19
|
import { existsSync as existsSync4, writeFileSync as writeFileSync4 } from "fs";
|
|
@@ -60,7 +61,7 @@ function currentUniverse() {
|
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
// src/version.ts
|
|
63
|
-
var CLI_VERSION = "2.
|
|
64
|
+
var CLI_VERSION = "2.3.0";
|
|
64
65
|
var USER_AGENT = `sky-cli/${CLI_VERSION} (${process.platform}; node/${process.versions.node})`;
|
|
65
66
|
|
|
66
67
|
// src/api.ts
|
|
@@ -108,6 +109,7 @@ async function api(method, path, body, opts = {}) {
|
|
|
108
109
|
body: body !== void 0 ? JSON.stringify(body) : void 0
|
|
109
110
|
});
|
|
110
111
|
if (!res.ok) await parseError(res);
|
|
112
|
+
if (res.status === 204) return void 0;
|
|
111
113
|
return await res.json();
|
|
112
114
|
}
|
|
113
115
|
async function postEvents(sessionId, events, idempotencyKey) {
|
|
@@ -162,7 +164,7 @@ async function resolveSessionRef(ref) {
|
|
|
162
164
|
return agent2.defaultSessionId;
|
|
163
165
|
}
|
|
164
166
|
async function* streamEvents(sessionId, signal) {
|
|
165
|
-
const { parseSseStream } = await import("./src-
|
|
167
|
+
const { parseSseStream } = await import("./src-EGXYUSME.js");
|
|
166
168
|
const res = await fetch(
|
|
167
169
|
`${apiBase()}/sessions/${encodeURIComponent(sessionId)}/stream`,
|
|
168
170
|
{
|
|
@@ -341,7 +343,7 @@ function readAgentFile(path) {
|
|
|
341
343
|
throw new Error(`${path}: ${issue?.path.join(".") ?? ""} ${issue?.message ?? "invalid"}`);
|
|
342
344
|
}
|
|
343
345
|
const file = parsed.data;
|
|
344
|
-
if (file.reasoning_effort && file.type && !
|
|
346
|
+
if (file.reasoning_effort && file.type && !isModelEffortSupported(file.type, file.llm ?? defaultLlm(file.type), file.reasoning_effort)) {
|
|
345
347
|
throw new Error(
|
|
346
348
|
`${path}: reasoning_effort '${file.reasoning_effort}' is not available for ${file.type} \u2014 ${reasoningEffortDocLine()}`
|
|
347
349
|
);
|
|
@@ -1147,7 +1149,7 @@ function renderResource(r) {
|
|
|
1147
1149
|
const ref = r.checkout ? `@${r.checkout.type === "branch" ? r.checkout.name : r.checkout.sha}` : "";
|
|
1148
1150
|
return `${r.id} repo ${r.mount_path} ${r.url}${ref}`;
|
|
1149
1151
|
}
|
|
1150
|
-
session.command("create <agent>").description("create a session (
|
|
1152
|
+
session.command("create <agent>").description("create a session (starts provisioning by default)").option("--title <title>", "session title").option("--message <text>", "start the first turn immediately, provisioning even with --deferred").option("--deferred", "leave the session idle without a pod until its first turn").option("--vcpus <n>", "machine vCPUs: 1, 2, 4 or 8 (default 2)").option("--memory <mb>", "machine memory in MB, 256MB steps (default 4096)").option("--file <path...>", "mount local files read-only in the working directory: path[:/mount] (uploaded first)").option("--repo <url...>", "clone GitHub repositories into the working directory: https://github.com/{owner}/{repo}[@branch|@sha]").option("--repo-token <token>", "token for the --repo clones; compiled into the sandbox's egress policy, never sent to it").action(
|
|
1151
1153
|
run(
|
|
1152
1154
|
async (agentRef, opts) => {
|
|
1153
1155
|
const resources = await resourceParams(opts);
|
|
@@ -1156,6 +1158,7 @@ session.command("create <agent>").description("create a session (the pod is prov
|
|
|
1156
1158
|
...opts.title ? { title: opts.title } : {},
|
|
1157
1159
|
...opts.vcpus !== void 0 ? { vcpus: Number(opts.vcpus) } : {},
|
|
1158
1160
|
...opts.memory !== void 0 ? { memoryMb: Number(opts.memory) } : {},
|
|
1161
|
+
...opts.deferred ? { provision: "deferred" } : {},
|
|
1159
1162
|
...resources.length ? { resources } : {},
|
|
1160
1163
|
...opts.message ? { initial_events: [{ type: "user.message", content: [{ type: "text", text: opts.message }] }] } : {}
|
|
1161
1164
|
});
|
|
@@ -1277,6 +1280,43 @@ sessionResources.command("rotate <ref> <rid> <token>").description("replace a re
|
|
|
1277
1280
|
console.log(`Rotated ${updated.id}`);
|
|
1278
1281
|
})
|
|
1279
1282
|
);
|
|
1283
|
+
var sessionPorts = session.command("ports").description("local servers in the session's pod, each exposed on an origin of its own");
|
|
1284
|
+
var portsPath = (id) => `/sessions/${encodeURIComponent(id)}/ports`;
|
|
1285
|
+
function renderPort(p) {
|
|
1286
|
+
return `${String(p.port).padEnd(5)} ${p.visibility.padEnd(7)} ${p.url}`;
|
|
1287
|
+
}
|
|
1288
|
+
sessionPorts.command("list <ref>").description("the session's exposed ports, oldest first").action(
|
|
1289
|
+
run(async (ref) => {
|
|
1290
|
+
const id = await resolveSessionRef(ref);
|
|
1291
|
+
const { ports } = await api("GET", portsPath(id));
|
|
1292
|
+
if (!ports.length) {
|
|
1293
|
+
console.log("No exposed ports. `sky session ports expose <session> <port>` exposes one.");
|
|
1294
|
+
return;
|
|
1295
|
+
}
|
|
1296
|
+
for (const p of ports) console.log(renderPort(p));
|
|
1297
|
+
})
|
|
1298
|
+
);
|
|
1299
|
+
sessionPorts.command("expose <ref> <port>").description("expose a port the agent's local server listens on; prints its address").option("--public", "anyone with the address may open it; without it the port is private (only entry links admit a browser), and an already public port is made private again").action(
|
|
1300
|
+
run(async (ref, port, opts) => {
|
|
1301
|
+
const id = await resolveSessionRef(ref);
|
|
1302
|
+
const exposed = await api("PUT", `${portsPath(id)}/${encodeURIComponent(port)}`, { visibility: opts.public ? "public" : "private" });
|
|
1303
|
+
console.log(renderPort(exposed));
|
|
1304
|
+
})
|
|
1305
|
+
);
|
|
1306
|
+
sessionPorts.command("open <ref> <port>").description("print an entry link for an exposed port \u2014 single-use and good for a minute on a private port").action(
|
|
1307
|
+
run(async (ref, port) => {
|
|
1308
|
+
const id = await resolveSessionRef(ref);
|
|
1309
|
+
const grant = await api("POST", `${portsPath(id)}/${encodeURIComponent(port)}/grants`, {});
|
|
1310
|
+
console.log(grant.url);
|
|
1311
|
+
})
|
|
1312
|
+
);
|
|
1313
|
+
sessionPorts.command("revoke <ref> <port>").description("stop exposing a port; its address answers 404 from then on").action(
|
|
1314
|
+
run(async (ref, port) => {
|
|
1315
|
+
const id = await resolveSessionRef(ref);
|
|
1316
|
+
await api("DELETE", `${portsPath(id)}/${encodeURIComponent(port)}`);
|
|
1317
|
+
console.log(`Revoked port ${port}`);
|
|
1318
|
+
})
|
|
1319
|
+
);
|
|
1280
1320
|
async function uploadAttachments(opts) {
|
|
1281
1321
|
const files2 = [];
|
|
1282
1322
|
for (const path of [...opts.image ?? [], ...opts.file ?? []]) {
|
|
@@ -0,0 +1,585 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const agentAddonsSchema: z.ZodObject<{
|
|
4
|
+
vault_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5
|
+
environment_id: z.ZodOptional<z.ZodString>;
|
|
6
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7
|
+
type: z.ZodLiteral<"file">;
|
|
8
|
+
file_id: z.ZodString;
|
|
9
|
+
mount_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
type: z.ZodLiteral<"github_repository">;
|
|
12
|
+
url: z.ZodString;
|
|
13
|
+
authorization_token: z.ZodOptional<z.ZodString>;
|
|
14
|
+
checkout: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
15
|
+
type: z.ZodLiteral<"branch">;
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
18
|
+
type: z.ZodLiteral<"commit">;
|
|
19
|
+
sha: z.ZodString;
|
|
20
|
+
}, z.core.$strip>], "type">>>;
|
|
21
|
+
mount_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
|
+
}, z.core.$strip>], "type">>>;
|
|
23
|
+
instructions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
content: z.ZodDefault<z.ZodString>;
|
|
26
|
+
}, z.core.$strip>>>;
|
|
27
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
28
|
+
type: z.ZodLiteral<"skill">;
|
|
29
|
+
skillId: z.ZodString;
|
|
30
|
+
version: z.ZodDefault<z.ZodString>;
|
|
31
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
32
|
+
type: z.ZodLiteral<"github">;
|
|
33
|
+
url: z.ZodString;
|
|
34
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
35
|
+
tokenSecretRef: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>], "type">>>;
|
|
37
|
+
mcp_servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
38
|
+
type: z.ZodDefault<z.ZodLiteral<"url">>;
|
|
39
|
+
name: z.ZodString;
|
|
40
|
+
url: z.ZodString;
|
|
41
|
+
tools: z.ZodOptional<z.ZodObject<{
|
|
42
|
+
include: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
43
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
44
|
+
}, z.core.$strip>>;
|
|
45
|
+
}, z.core.$strip>>>;
|
|
46
|
+
capabilities: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodPreprocess<z.ZodEnum<{
|
|
47
|
+
"embedding.openai": "embedding.openai";
|
|
48
|
+
"embedding.voyage": "embedding.voyage";
|
|
49
|
+
"rerank.voyage": "rerank.voyage";
|
|
50
|
+
"ocr.mistral": "ocr.mistral";
|
|
51
|
+
"exa.search": "exa.search";
|
|
52
|
+
"exa.contents": "exa.contents";
|
|
53
|
+
"tinyfish.fetch": "tinyfish.fetch";
|
|
54
|
+
"tinyfish.browser": "tinyfish.browser";
|
|
55
|
+
"dataforseo.serp": "dataforseo.serp";
|
|
56
|
+
"dataforseo.ai-keywords": "dataforseo.ai-keywords";
|
|
57
|
+
"dataforseo.llm-responses": "dataforseo.llm-responses";
|
|
58
|
+
"dataforseo.app-info": "dataforseo.app-info";
|
|
59
|
+
"dataforseo.app-search": "dataforseo.app-search";
|
|
60
|
+
"dataforseo.backlinks": "dataforseo.backlinks";
|
|
61
|
+
"dataforseo.business-reviews": "dataforseo.business-reviews";
|
|
62
|
+
"dataforseo.business-pinterest": "dataforseo.business-pinterest";
|
|
63
|
+
"dataforseo.content-analysis": "dataforseo.content-analysis";
|
|
64
|
+
"dataforseo.technologies": "dataforseo.technologies";
|
|
65
|
+
"dataforseo.keyword-data": "dataforseo.keyword-data";
|
|
66
|
+
"dataforseo.labs": "dataforseo.labs";
|
|
67
|
+
"dataforseo.amazon": "dataforseo.amazon";
|
|
68
|
+
"dataforseo.onpage": "dataforseo.onpage";
|
|
69
|
+
"gptimage.generate": "gptimage.generate";
|
|
70
|
+
"rembg.remove-background": "rembg.remove-background";
|
|
71
|
+
"seedance.generate": "seedance.generate";
|
|
72
|
+
"mm.i2v": "mm.i2v";
|
|
73
|
+
"wan.t2v": "wan.t2v";
|
|
74
|
+
"wan.i2v": "wan.i2v";
|
|
75
|
+
"happyhorse.t2v": "happyhorse.t2v";
|
|
76
|
+
"minimax.h3": "minimax.h3";
|
|
77
|
+
"fish-audio.transcribe": "fish-audio.transcribe";
|
|
78
|
+
"exa.answer": "exa.answer";
|
|
79
|
+
"googlemap.geocode": "googlemap.geocode";
|
|
80
|
+
"googlemap.places": "googlemap.places";
|
|
81
|
+
"agentmail.list-inboxes": "agentmail.list-inboxes";
|
|
82
|
+
"social-boost.catalog": "social-boost.catalog";
|
|
83
|
+
"tinyfish.search": "tinyfish.search";
|
|
84
|
+
"tinyfish.profile-list": "tinyfish.profile-list";
|
|
85
|
+
"meta.transcribe": "meta.transcribe";
|
|
86
|
+
"minimax.tts": "minimax.tts";
|
|
87
|
+
"elevenlabs.sound": "elevenlabs.sound";
|
|
88
|
+
"zai.transcribe": "zai.transcribe";
|
|
89
|
+
"openai.transcribe": "openai.transcribe";
|
|
90
|
+
"fish-audio.tts": "fish-audio.tts";
|
|
91
|
+
"google.image": "google.image";
|
|
92
|
+
"openai.image-2.5": "openai.image-2.5";
|
|
93
|
+
"wan.image": "wan.image";
|
|
94
|
+
}>, unknown>>>>;
|
|
95
|
+
model: z.ZodOptional<z.ZodString>;
|
|
96
|
+
reasoning_effort: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
97
|
+
none: "none";
|
|
98
|
+
off: "off";
|
|
99
|
+
minimal: "minimal";
|
|
100
|
+
low: "low";
|
|
101
|
+
medium: "medium";
|
|
102
|
+
high: "high";
|
|
103
|
+
xhigh: "xhigh";
|
|
104
|
+
max: "max";
|
|
105
|
+
ultra: "ultra";
|
|
106
|
+
}>>>;
|
|
107
|
+
vcpus: z.ZodOptional<z.ZodNumber>;
|
|
108
|
+
memory_mb: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
model_billing: z.ZodOptional<z.ZodEnum<{
|
|
110
|
+
platform: "platform";
|
|
111
|
+
account: "account";
|
|
112
|
+
}>>;
|
|
113
|
+
session_budget: z.ZodOptional<z.ZodObject<{
|
|
114
|
+
type: z.ZodLiteral<"limit">;
|
|
115
|
+
max_list_cost: z.ZodObject<{
|
|
116
|
+
amount: z.ZodString;
|
|
117
|
+
currency: z.ZodLiteral<"USD">;
|
|
118
|
+
}, z.core.$strip>;
|
|
119
|
+
}, z.core.$strip>>;
|
|
120
|
+
}, z.core.$strict>;
|
|
121
|
+
declare const createProductAgentSchema: z.ZodObject<{
|
|
122
|
+
product: z.ZodString;
|
|
123
|
+
name: z.ZodOptional<z.ZodString>;
|
|
124
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
125
|
+
addons: z.ZodOptional<z.ZodObject<{
|
|
126
|
+
vault_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
127
|
+
environment_id: z.ZodOptional<z.ZodString>;
|
|
128
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
129
|
+
type: z.ZodLiteral<"file">;
|
|
130
|
+
file_id: z.ZodString;
|
|
131
|
+
mount_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
132
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
133
|
+
type: z.ZodLiteral<"github_repository">;
|
|
134
|
+
url: z.ZodString;
|
|
135
|
+
authorization_token: z.ZodOptional<z.ZodString>;
|
|
136
|
+
checkout: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
137
|
+
type: z.ZodLiteral<"branch">;
|
|
138
|
+
name: z.ZodString;
|
|
139
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
140
|
+
type: z.ZodLiteral<"commit">;
|
|
141
|
+
sha: z.ZodString;
|
|
142
|
+
}, z.core.$strip>], "type">>>;
|
|
143
|
+
mount_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
144
|
+
}, z.core.$strip>], "type">>>;
|
|
145
|
+
instructions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
146
|
+
name: z.ZodString;
|
|
147
|
+
content: z.ZodDefault<z.ZodString>;
|
|
148
|
+
}, z.core.$strip>>>;
|
|
149
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
150
|
+
type: z.ZodLiteral<"skill">;
|
|
151
|
+
skillId: z.ZodString;
|
|
152
|
+
version: z.ZodDefault<z.ZodString>;
|
|
153
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
154
|
+
type: z.ZodLiteral<"github">;
|
|
155
|
+
url: z.ZodString;
|
|
156
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
157
|
+
tokenSecretRef: z.ZodOptional<z.ZodString>;
|
|
158
|
+
}, z.core.$strip>], "type">>>;
|
|
159
|
+
mcp_servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
160
|
+
type: z.ZodDefault<z.ZodLiteral<"url">>;
|
|
161
|
+
name: z.ZodString;
|
|
162
|
+
url: z.ZodString;
|
|
163
|
+
tools: z.ZodOptional<z.ZodObject<{
|
|
164
|
+
include: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
165
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
166
|
+
}, z.core.$strip>>;
|
|
167
|
+
}, z.core.$strip>>>;
|
|
168
|
+
capabilities: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodPreprocess<z.ZodEnum<{
|
|
169
|
+
"embedding.openai": "embedding.openai";
|
|
170
|
+
"embedding.voyage": "embedding.voyage";
|
|
171
|
+
"rerank.voyage": "rerank.voyage";
|
|
172
|
+
"ocr.mistral": "ocr.mistral";
|
|
173
|
+
"exa.search": "exa.search";
|
|
174
|
+
"exa.contents": "exa.contents";
|
|
175
|
+
"tinyfish.fetch": "tinyfish.fetch";
|
|
176
|
+
"tinyfish.browser": "tinyfish.browser";
|
|
177
|
+
"dataforseo.serp": "dataforseo.serp";
|
|
178
|
+
"dataforseo.ai-keywords": "dataforseo.ai-keywords";
|
|
179
|
+
"dataforseo.llm-responses": "dataforseo.llm-responses";
|
|
180
|
+
"dataforseo.app-info": "dataforseo.app-info";
|
|
181
|
+
"dataforseo.app-search": "dataforseo.app-search";
|
|
182
|
+
"dataforseo.backlinks": "dataforseo.backlinks";
|
|
183
|
+
"dataforseo.business-reviews": "dataforseo.business-reviews";
|
|
184
|
+
"dataforseo.business-pinterest": "dataforseo.business-pinterest";
|
|
185
|
+
"dataforseo.content-analysis": "dataforseo.content-analysis";
|
|
186
|
+
"dataforseo.technologies": "dataforseo.technologies";
|
|
187
|
+
"dataforseo.keyword-data": "dataforseo.keyword-data";
|
|
188
|
+
"dataforseo.labs": "dataforseo.labs";
|
|
189
|
+
"dataforseo.amazon": "dataforseo.amazon";
|
|
190
|
+
"dataforseo.onpage": "dataforseo.onpage";
|
|
191
|
+
"gptimage.generate": "gptimage.generate";
|
|
192
|
+
"rembg.remove-background": "rembg.remove-background";
|
|
193
|
+
"seedance.generate": "seedance.generate";
|
|
194
|
+
"mm.i2v": "mm.i2v";
|
|
195
|
+
"wan.t2v": "wan.t2v";
|
|
196
|
+
"wan.i2v": "wan.i2v";
|
|
197
|
+
"happyhorse.t2v": "happyhorse.t2v";
|
|
198
|
+
"minimax.h3": "minimax.h3";
|
|
199
|
+
"fish-audio.transcribe": "fish-audio.transcribe";
|
|
200
|
+
"exa.answer": "exa.answer";
|
|
201
|
+
"googlemap.geocode": "googlemap.geocode";
|
|
202
|
+
"googlemap.places": "googlemap.places";
|
|
203
|
+
"agentmail.list-inboxes": "agentmail.list-inboxes";
|
|
204
|
+
"social-boost.catalog": "social-boost.catalog";
|
|
205
|
+
"tinyfish.search": "tinyfish.search";
|
|
206
|
+
"tinyfish.profile-list": "tinyfish.profile-list";
|
|
207
|
+
"meta.transcribe": "meta.transcribe";
|
|
208
|
+
"minimax.tts": "minimax.tts";
|
|
209
|
+
"elevenlabs.sound": "elevenlabs.sound";
|
|
210
|
+
"zai.transcribe": "zai.transcribe";
|
|
211
|
+
"openai.transcribe": "openai.transcribe";
|
|
212
|
+
"fish-audio.tts": "fish-audio.tts";
|
|
213
|
+
"google.image": "google.image";
|
|
214
|
+
"openai.image-2.5": "openai.image-2.5";
|
|
215
|
+
"wan.image": "wan.image";
|
|
216
|
+
}>, unknown>>>>;
|
|
217
|
+
model: z.ZodOptional<z.ZodString>;
|
|
218
|
+
reasoning_effort: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
219
|
+
none: "none";
|
|
220
|
+
off: "off";
|
|
221
|
+
minimal: "minimal";
|
|
222
|
+
low: "low";
|
|
223
|
+
medium: "medium";
|
|
224
|
+
high: "high";
|
|
225
|
+
xhigh: "xhigh";
|
|
226
|
+
max: "max";
|
|
227
|
+
ultra: "ultra";
|
|
228
|
+
}>>>;
|
|
229
|
+
vcpus: z.ZodOptional<z.ZodNumber>;
|
|
230
|
+
memory_mb: z.ZodOptional<z.ZodNumber>;
|
|
231
|
+
model_billing: z.ZodOptional<z.ZodEnum<{
|
|
232
|
+
platform: "platform";
|
|
233
|
+
account: "account";
|
|
234
|
+
}>>;
|
|
235
|
+
session_budget: z.ZodOptional<z.ZodObject<{
|
|
236
|
+
type: z.ZodLiteral<"limit">;
|
|
237
|
+
max_list_cost: z.ZodObject<{
|
|
238
|
+
amount: z.ZodString;
|
|
239
|
+
currency: z.ZodLiteral<"USD">;
|
|
240
|
+
}, z.core.$strip>;
|
|
241
|
+
}, z.core.$strip>>;
|
|
242
|
+
}, z.core.$strict>>;
|
|
243
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
244
|
+
}, z.core.$strict>;
|
|
245
|
+
declare const prepareProductSessionSchema: z.ZodObject<{
|
|
246
|
+
product: z.ZodString;
|
|
247
|
+
addons: z.ZodOptional<z.ZodObject<{
|
|
248
|
+
vault_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
249
|
+
environment_id: z.ZodOptional<z.ZodString>;
|
|
250
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
251
|
+
type: z.ZodLiteral<"file">;
|
|
252
|
+
file_id: z.ZodString;
|
|
253
|
+
mount_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
254
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
255
|
+
type: z.ZodLiteral<"github_repository">;
|
|
256
|
+
url: z.ZodString;
|
|
257
|
+
authorization_token: z.ZodOptional<z.ZodString>;
|
|
258
|
+
checkout: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
259
|
+
type: z.ZodLiteral<"branch">;
|
|
260
|
+
name: z.ZodString;
|
|
261
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
262
|
+
type: z.ZodLiteral<"commit">;
|
|
263
|
+
sha: z.ZodString;
|
|
264
|
+
}, z.core.$strip>], "type">>>;
|
|
265
|
+
mount_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
266
|
+
}, z.core.$strip>], "type">>>;
|
|
267
|
+
instructions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
268
|
+
name: z.ZodString;
|
|
269
|
+
content: z.ZodDefault<z.ZodString>;
|
|
270
|
+
}, z.core.$strip>>>;
|
|
271
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
272
|
+
type: z.ZodLiteral<"skill">;
|
|
273
|
+
skillId: z.ZodString;
|
|
274
|
+
version: z.ZodDefault<z.ZodString>;
|
|
275
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
276
|
+
type: z.ZodLiteral<"github">;
|
|
277
|
+
url: z.ZodString;
|
|
278
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
279
|
+
tokenSecretRef: z.ZodOptional<z.ZodString>;
|
|
280
|
+
}, z.core.$strip>], "type">>>;
|
|
281
|
+
mcp_servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
282
|
+
type: z.ZodDefault<z.ZodLiteral<"url">>;
|
|
283
|
+
name: z.ZodString;
|
|
284
|
+
url: z.ZodString;
|
|
285
|
+
tools: z.ZodOptional<z.ZodObject<{
|
|
286
|
+
include: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
287
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
288
|
+
}, z.core.$strip>>;
|
|
289
|
+
}, z.core.$strip>>>;
|
|
290
|
+
capabilities: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodPreprocess<z.ZodEnum<{
|
|
291
|
+
"embedding.openai": "embedding.openai";
|
|
292
|
+
"embedding.voyage": "embedding.voyage";
|
|
293
|
+
"rerank.voyage": "rerank.voyage";
|
|
294
|
+
"ocr.mistral": "ocr.mistral";
|
|
295
|
+
"exa.search": "exa.search";
|
|
296
|
+
"exa.contents": "exa.contents";
|
|
297
|
+
"tinyfish.fetch": "tinyfish.fetch";
|
|
298
|
+
"tinyfish.browser": "tinyfish.browser";
|
|
299
|
+
"dataforseo.serp": "dataforseo.serp";
|
|
300
|
+
"dataforseo.ai-keywords": "dataforseo.ai-keywords";
|
|
301
|
+
"dataforseo.llm-responses": "dataforseo.llm-responses";
|
|
302
|
+
"dataforseo.app-info": "dataforseo.app-info";
|
|
303
|
+
"dataforseo.app-search": "dataforseo.app-search";
|
|
304
|
+
"dataforseo.backlinks": "dataforseo.backlinks";
|
|
305
|
+
"dataforseo.business-reviews": "dataforseo.business-reviews";
|
|
306
|
+
"dataforseo.business-pinterest": "dataforseo.business-pinterest";
|
|
307
|
+
"dataforseo.content-analysis": "dataforseo.content-analysis";
|
|
308
|
+
"dataforseo.technologies": "dataforseo.technologies";
|
|
309
|
+
"dataforseo.keyword-data": "dataforseo.keyword-data";
|
|
310
|
+
"dataforseo.labs": "dataforseo.labs";
|
|
311
|
+
"dataforseo.amazon": "dataforseo.amazon";
|
|
312
|
+
"dataforseo.onpage": "dataforseo.onpage";
|
|
313
|
+
"gptimage.generate": "gptimage.generate";
|
|
314
|
+
"rembg.remove-background": "rembg.remove-background";
|
|
315
|
+
"seedance.generate": "seedance.generate";
|
|
316
|
+
"mm.i2v": "mm.i2v";
|
|
317
|
+
"wan.t2v": "wan.t2v";
|
|
318
|
+
"wan.i2v": "wan.i2v";
|
|
319
|
+
"happyhorse.t2v": "happyhorse.t2v";
|
|
320
|
+
"minimax.h3": "minimax.h3";
|
|
321
|
+
"fish-audio.transcribe": "fish-audio.transcribe";
|
|
322
|
+
"exa.answer": "exa.answer";
|
|
323
|
+
"googlemap.geocode": "googlemap.geocode";
|
|
324
|
+
"googlemap.places": "googlemap.places";
|
|
325
|
+
"agentmail.list-inboxes": "agentmail.list-inboxes";
|
|
326
|
+
"social-boost.catalog": "social-boost.catalog";
|
|
327
|
+
"tinyfish.search": "tinyfish.search";
|
|
328
|
+
"tinyfish.profile-list": "tinyfish.profile-list";
|
|
329
|
+
"meta.transcribe": "meta.transcribe";
|
|
330
|
+
"minimax.tts": "minimax.tts";
|
|
331
|
+
"elevenlabs.sound": "elevenlabs.sound";
|
|
332
|
+
"zai.transcribe": "zai.transcribe";
|
|
333
|
+
"openai.transcribe": "openai.transcribe";
|
|
334
|
+
"fish-audio.tts": "fish-audio.tts";
|
|
335
|
+
"google.image": "google.image";
|
|
336
|
+
"openai.image-2.5": "openai.image-2.5";
|
|
337
|
+
"wan.image": "wan.image";
|
|
338
|
+
}>, unknown>>>>;
|
|
339
|
+
model: z.ZodOptional<z.ZodString>;
|
|
340
|
+
reasoning_effort: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
341
|
+
none: "none";
|
|
342
|
+
off: "off";
|
|
343
|
+
minimal: "minimal";
|
|
344
|
+
low: "low";
|
|
345
|
+
medium: "medium";
|
|
346
|
+
high: "high";
|
|
347
|
+
xhigh: "xhigh";
|
|
348
|
+
max: "max";
|
|
349
|
+
ultra: "ultra";
|
|
350
|
+
}>>>;
|
|
351
|
+
vcpus: z.ZodOptional<z.ZodNumber>;
|
|
352
|
+
memory_mb: z.ZodOptional<z.ZodNumber>;
|
|
353
|
+
model_billing: z.ZodOptional<z.ZodEnum<{
|
|
354
|
+
platform: "platform";
|
|
355
|
+
account: "account";
|
|
356
|
+
}>>;
|
|
357
|
+
session_budget: z.ZodOptional<z.ZodObject<{
|
|
358
|
+
type: z.ZodLiteral<"limit">;
|
|
359
|
+
max_list_cost: z.ZodObject<{
|
|
360
|
+
amount: z.ZodString;
|
|
361
|
+
currency: z.ZodLiteral<"USD">;
|
|
362
|
+
}, z.core.$strip>;
|
|
363
|
+
}, z.core.$strip>>;
|
|
364
|
+
}, z.core.$strict>>;
|
|
365
|
+
title: z.ZodOptional<z.ZodString>;
|
|
366
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
367
|
+
}, z.core.$strict>;
|
|
368
|
+
declare const createRunSchema: z.ZodObject<{
|
|
369
|
+
product: z.ZodString;
|
|
370
|
+
input: z.ZodUnknown & z.ZodType<{}, unknown, z.core.$ZodTypeInternals<{}, unknown>>;
|
|
371
|
+
addons: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
372
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
373
|
+
stream: z.ZodOptional<z.ZodBoolean>;
|
|
374
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
375
|
+
}, z.core.$strict>;
|
|
376
|
+
declare const runEventsSchema: z.ZodObject<{
|
|
377
|
+
events: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
378
|
+
type: z.ZodLiteral<"user.message">;
|
|
379
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
380
|
+
type: z.ZodLiteral<"text">;
|
|
381
|
+
text: z.ZodString;
|
|
382
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
383
|
+
type: z.ZodLiteral<"image">;
|
|
384
|
+
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
385
|
+
type: z.ZodLiteral<"base64">;
|
|
386
|
+
media_type: z.ZodString;
|
|
387
|
+
data: z.ZodString;
|
|
388
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
389
|
+
type: z.ZodLiteral<"url">;
|
|
390
|
+
url: z.ZodString;
|
|
391
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
392
|
+
type: z.ZodLiteral<"file">;
|
|
393
|
+
file_id: z.ZodString;
|
|
394
|
+
}, z.core.$strict>], "type">;
|
|
395
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
396
|
+
type: z.ZodLiteral<"document">;
|
|
397
|
+
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
398
|
+
type: z.ZodLiteral<"base64">;
|
|
399
|
+
media_type: z.ZodString;
|
|
400
|
+
data: z.ZodString;
|
|
401
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
402
|
+
type: z.ZodLiteral<"text">;
|
|
403
|
+
media_type: z.ZodDefault<z.ZodLiteral<"text/plain">>;
|
|
404
|
+
data: z.ZodString;
|
|
405
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
406
|
+
type: z.ZodLiteral<"url">;
|
|
407
|
+
url: z.ZodString;
|
|
408
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
409
|
+
type: z.ZodLiteral<"file">;
|
|
410
|
+
file_id: z.ZodString;
|
|
411
|
+
}, z.core.$strict>], "type">;
|
|
412
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
413
|
+
context: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
414
|
+
}, z.core.$strict>], "type">>;
|
|
415
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
416
|
+
type: z.ZodLiteral<"system.message">;
|
|
417
|
+
content: z.ZodArray<z.ZodObject<{
|
|
418
|
+
type: z.ZodLiteral<"text">;
|
|
419
|
+
text: z.ZodString;
|
|
420
|
+
}, z.core.$strict>>;
|
|
421
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
422
|
+
type: z.ZodLiteral<"user.interrupt">;
|
|
423
|
+
}, z.core.$strict>]>>;
|
|
424
|
+
}, z.core.$strict>;
|
|
425
|
+
declare const publishProductSchema: z.ZodObject<{
|
|
426
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
427
|
+
description: z.ZodOptional<z.ZodString>;
|
|
428
|
+
}, z.core.$strict>;
|
|
429
|
+
type AgentAddons = z.infer<typeof agentAddonsSchema>;
|
|
430
|
+
type CreateProductAgentInput = z.infer<typeof createProductAgentSchema>;
|
|
431
|
+
type PrepareProductSessionInput = z.infer<typeof prepareProductSessionSchema>;
|
|
432
|
+
type CreateRunInput = z.infer<typeof createRunSchema>;
|
|
433
|
+
declare const publicRunSchema: z.ZodObject<{
|
|
434
|
+
id: z.ZodString;
|
|
435
|
+
product: z.ZodNullable<z.ZodString>;
|
|
436
|
+
session_id: z.ZodNullable<z.ZodString>;
|
|
437
|
+
status: z.ZodEnum<{
|
|
438
|
+
queued: "queued";
|
|
439
|
+
running: "running";
|
|
440
|
+
waiting_input: "waiting_input";
|
|
441
|
+
stopping: "stopping";
|
|
442
|
+
completed: "completed";
|
|
443
|
+
interrupted: "interrupted";
|
|
444
|
+
failed: "failed";
|
|
445
|
+
blocked: "blocked";
|
|
446
|
+
reconciling: "reconciling";
|
|
447
|
+
}>;
|
|
448
|
+
output: z.ZodUnknown;
|
|
449
|
+
output_available: z.ZodOptional<z.ZodBoolean>;
|
|
450
|
+
usage: z.ZodUnknown;
|
|
451
|
+
billing: z.ZodUnknown;
|
|
452
|
+
error: z.ZodUnknown;
|
|
453
|
+
artifact: z.ZodOptional<z.ZodObject<{
|
|
454
|
+
id: z.ZodString;
|
|
455
|
+
mediaType: z.ZodString;
|
|
456
|
+
url: z.ZodString;
|
|
457
|
+
}, z.core.$strip>>;
|
|
458
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
459
|
+
goal_id: z.ZodOptional<z.ZodString>;
|
|
460
|
+
iteration: z.ZodOptional<z.ZodNumber>;
|
|
461
|
+
routine_run_id: z.ZodOptional<z.ZodString>;
|
|
462
|
+
routine_id: z.ZodOptional<z.ZodString>;
|
|
463
|
+
}, z.core.$strip>>;
|
|
464
|
+
created_at: z.ZodString;
|
|
465
|
+
completed_at: z.ZodNullable<z.ZodString>;
|
|
466
|
+
}, z.core.$strip>;
|
|
467
|
+
type PublicRun = z.infer<typeof publicRunSchema>;
|
|
468
|
+
|
|
469
|
+
declare const connectionSupportSchema: z.ZodObject<{
|
|
470
|
+
channels: z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
471
|
+
line: "line";
|
|
472
|
+
email: "email";
|
|
473
|
+
slack: "slack";
|
|
474
|
+
telegram: "telegram";
|
|
475
|
+
whatsapp: "whatsapp";
|
|
476
|
+
imessage: "imessage";
|
|
477
|
+
discord: "discord";
|
|
478
|
+
lark: "lark";
|
|
479
|
+
teams: "teams";
|
|
480
|
+
x: "x";
|
|
481
|
+
gchat: "gchat";
|
|
482
|
+
buzz: "buzz";
|
|
483
|
+
}>>, z.ZodTransform<("line" | "email" | "slack" | "telegram" | "whatsapp" | "imessage" | "discord" | "lark" | "teams" | "x" | "gchat" | "buzz")[], ("line" | "email" | "slack" | "telegram" | "whatsapp" | "imessage" | "discord" | "lark" | "teams" | "x" | "gchat" | "buzz")[]>>]>;
|
|
484
|
+
connectors: z.ZodEnum<{
|
|
485
|
+
none: "none";
|
|
486
|
+
all: "all";
|
|
487
|
+
}>;
|
|
488
|
+
}, z.core.$strict>;
|
|
489
|
+
type ConnectionSupport = z.infer<typeof connectionSupportSchema>;
|
|
490
|
+
|
|
491
|
+
type RunControlInput = z.infer<typeof runEventsSchema>;
|
|
492
|
+
type PublishProductInput = z.infer<typeof publishProductSchema>;
|
|
493
|
+
type ExecutionProjection = {
|
|
494
|
+
protocol: "legacy" | "runs";
|
|
495
|
+
generation: number;
|
|
496
|
+
product: string | null;
|
|
497
|
+
product_version: string | null;
|
|
498
|
+
active_run_id: string | null;
|
|
499
|
+
addons_revision: number;
|
|
500
|
+
};
|
|
501
|
+
type PreparedProductSession = {
|
|
502
|
+
id: string;
|
|
503
|
+
execution: ExecutionProjection;
|
|
504
|
+
} & Record<string, unknown>;
|
|
505
|
+
type ProductRequest = {
|
|
506
|
+
idempotencyKey: string;
|
|
507
|
+
signal?: AbortSignal;
|
|
508
|
+
};
|
|
509
|
+
type Product = {
|
|
510
|
+
id: string;
|
|
511
|
+
version: string | null;
|
|
512
|
+
kind: "agent" | "model" | "tool";
|
|
513
|
+
name: string;
|
|
514
|
+
agent_type?: string;
|
|
515
|
+
available: boolean;
|
|
516
|
+
customizable: boolean;
|
|
517
|
+
capabilities: {
|
|
518
|
+
session: boolean;
|
|
519
|
+
runs: boolean;
|
|
520
|
+
steering: boolean;
|
|
521
|
+
interrupt: boolean;
|
|
522
|
+
ordinary_session_preparation?: boolean;
|
|
523
|
+
runs_billing_modes?: string[];
|
|
524
|
+
};
|
|
525
|
+
pricing: unknown;
|
|
526
|
+
input_schema: object;
|
|
527
|
+
output_schema: object;
|
|
528
|
+
addons_schema: object;
|
|
529
|
+
native_operations?: object[];
|
|
530
|
+
connection_support?: ConnectionSupport;
|
|
531
|
+
};
|
|
532
|
+
type RunEvent = {
|
|
533
|
+
id: string;
|
|
534
|
+
run_id: string;
|
|
535
|
+
created_at: string;
|
|
536
|
+
type: string;
|
|
537
|
+
data: Record<string, unknown>;
|
|
538
|
+
};
|
|
539
|
+
type RunEventPage = {
|
|
540
|
+
events: RunEvent[];
|
|
541
|
+
cursor: string | null;
|
|
542
|
+
};
|
|
543
|
+
type RunObservation = {
|
|
544
|
+
cursor?: string;
|
|
545
|
+
signal?: AbortSignal;
|
|
546
|
+
};
|
|
547
|
+
type RunControlReceipt = {
|
|
548
|
+
run_id: string;
|
|
549
|
+
command_id: string;
|
|
550
|
+
status: string;
|
|
551
|
+
};
|
|
552
|
+
/** An API failure never implies that an admission or supplier execution was retried. */
|
|
553
|
+
declare class ProductApiError extends Error {
|
|
554
|
+
readonly status: number;
|
|
555
|
+
readonly code: string;
|
|
556
|
+
constructor(status: number, code: string, message: string);
|
|
557
|
+
}
|
|
558
|
+
/** Public product client. Persist the request and key before sending; replay them unchanged after an unknown result. */
|
|
559
|
+
declare function createProductClient(options: {
|
|
560
|
+
token: string | (() => string | Promise<string>);
|
|
561
|
+
universe: string;
|
|
562
|
+
baseUrl?: string;
|
|
563
|
+
fetch?: typeof fetch;
|
|
564
|
+
}): {
|
|
565
|
+
list(signal?: AbortSignal): Promise<Product[]>;
|
|
566
|
+
prepare(input: PrepareProductSessionInput, context: ProductRequest): Promise<PreparedProductSession>;
|
|
567
|
+
create(input: CreateProductAgentInput, context: ProductRequest): Promise<{
|
|
568
|
+
id: string;
|
|
569
|
+
} & Record<string, unknown>>;
|
|
570
|
+
publish(agentId: string, input: PublishProductInput, context: ProductRequest): Promise<{
|
|
571
|
+
product: string;
|
|
572
|
+
version: string;
|
|
573
|
+
}>;
|
|
574
|
+
delist(agentId: string, context: ProductRequest): Promise<{
|
|
575
|
+
product: string;
|
|
576
|
+
status: "delisted";
|
|
577
|
+
}>;
|
|
578
|
+
start(input: Omit<CreateRunInput, "stream">, context: ProductRequest): Promise<PublicRun>;
|
|
579
|
+
read(runId: string, signal?: AbortSignal): Promise<PublicRun>;
|
|
580
|
+
control(runId: string, input: RunControlInput, context: ProductRequest): Promise<RunControlReceipt>;
|
|
581
|
+
events(runId: string, context?: RunObservation): Promise<RunEventPage>;
|
|
582
|
+
observe(runId: string, context?: RunObservation): Promise<Response>;
|
|
583
|
+
};
|
|
584
|
+
|
|
585
|
+
export { type AgentAddons, type CreateProductAgentInput, type CreateRunInput, type ExecutionProjection, type PrepareProductSessionInput, type PreparedProductSession, type Product, ProductApiError, type ProductRequest, type PublicRun, type PublishProductInput, type RunControlInput, type RunControlReceipt, type RunEvent, type RunEventPage, type RunObservation, createProductClient };
|
package/dist/products.js
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import {
|
|
2
|
+
REASONING_EFFORT_VALUES,
|
|
3
|
+
capabilitiesSchema,
|
|
4
|
+
external_exports,
|
|
5
|
+
instructionFileSchema,
|
|
6
|
+
mcpServersSchema,
|
|
7
|
+
sessionResourcesParamSchema,
|
|
8
|
+
skillsArraySchema,
|
|
9
|
+
systemMessageEventSchema,
|
|
10
|
+
userMessageEventSchema
|
|
11
|
+
} from "./chunk-2KQLWHHC.js";
|
|
12
|
+
|
|
13
|
+
// ../../packages/spec/src/compatibility.ts
|
|
14
|
+
var capabilityInputsSchema = capabilitiesSchema;
|
|
15
|
+
|
|
16
|
+
// ../../packages/spec/src/products.ts
|
|
17
|
+
var budgetSchema = external_exports.object({
|
|
18
|
+
type: external_exports.literal("limit"),
|
|
19
|
+
max_list_cost: external_exports.object({
|
|
20
|
+
amount: external_exports.string().min(1).max(15).describe('Whole US cents as an integer decimal string, e.g. "125" for $1.25'),
|
|
21
|
+
currency: external_exports.literal("USD")
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
var productRefSchema = external_exports.string().min(1).max(240);
|
|
25
|
+
var agentAddonsSchema = external_exports.object({
|
|
26
|
+
vault_ids: external_exports.array(external_exports.string().min(1)).max(10).optional(),
|
|
27
|
+
environment_id: external_exports.string().min(1).optional(),
|
|
28
|
+
resources: sessionResourcesParamSchema.optional(),
|
|
29
|
+
instructions: external_exports.array(instructionFileSchema).max(20).optional(),
|
|
30
|
+
skills: skillsArraySchema.optional(),
|
|
31
|
+
mcp_servers: mcpServersSchema.optional(),
|
|
32
|
+
capabilities: capabilityInputsSchema.optional(),
|
|
33
|
+
model: external_exports.string().min(1).optional(),
|
|
34
|
+
reasoning_effort: external_exports.enum(REASONING_EFFORT_VALUES).nullable().optional(),
|
|
35
|
+
vcpus: external_exports.number().int().positive().optional(),
|
|
36
|
+
memory_mb: external_exports.number().int().positive().optional(),
|
|
37
|
+
model_billing: external_exports.enum(["platform", "account"]).optional(),
|
|
38
|
+
session_budget: budgetSchema.optional()
|
|
39
|
+
}).strict();
|
|
40
|
+
var modelAddonsSchema = external_exports.object({
|
|
41
|
+
max_output_tokens: external_exports.number().int().positive().optional(),
|
|
42
|
+
temperature: external_exports.number().finite().optional(),
|
|
43
|
+
top_p: external_exports.number().finite().optional(),
|
|
44
|
+
stop: external_exports.union([external_exports.string(), external_exports.array(external_exports.string())]).optional(),
|
|
45
|
+
response_format: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
46
|
+
tools: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown())).optional(),
|
|
47
|
+
tool_choice: external_exports.union([external_exports.string(), external_exports.record(external_exports.string(), external_exports.unknown())]).optional()
|
|
48
|
+
}).strict();
|
|
49
|
+
var modelNativeEnvelopeSchema = external_exports.discriminatedUnion("wire", [
|
|
50
|
+
external_exports.object({ wire: external_exports.literal("openai"), path: external_exports.enum(["/v1/chat/completions", "/v1/responses", "/v1/embeddings"]), body: external_exports.record(external_exports.string(), external_exports.unknown()) }).strict(),
|
|
51
|
+
external_exports.object({ wire: external_exports.literal("anthropic"), path: external_exports.literal("/v1/messages"), body: external_exports.record(external_exports.string(), external_exports.unknown()) }).strict(),
|
|
52
|
+
external_exports.object({ wire: external_exports.literal("decisions"), path: external_exports.literal("/api/alpha/decisions"), body: external_exports.record(external_exports.string(), external_exports.unknown()) }).strict()
|
|
53
|
+
]);
|
|
54
|
+
var modelRunInputSchema = external_exports.union([external_exports.string().min(1), modelNativeEnvelopeSchema, external_exports.record(external_exports.string(), external_exports.unknown())]).superRefine((input, context) => {
|
|
55
|
+
if (typeof input === "object" && ["wire", "path", "body"].some((key) => key in input) && !modelNativeEnvelopeSchema.safeParse(input).success) {
|
|
56
|
+
context.addIssue({ code: "custom", message: "Native model envelopes require a registered wire, path and object body, with no additional fields" });
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
var createProductAgentSchema = external_exports.object({
|
|
60
|
+
product: productRefSchema,
|
|
61
|
+
name: external_exports.string().max(60).optional(),
|
|
62
|
+
instructions: external_exports.string().max(1e5).optional(),
|
|
63
|
+
addons: agentAddonsSchema.optional(),
|
|
64
|
+
metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
65
|
+
}).strict();
|
|
66
|
+
var prepareProductSessionSchema = external_exports.object({
|
|
67
|
+
product: productRefSchema,
|
|
68
|
+
addons: agentAddonsSchema.optional(),
|
|
69
|
+
title: external_exports.string().max(120).optional(),
|
|
70
|
+
metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
71
|
+
}).strict();
|
|
72
|
+
var createRunSchema = external_exports.object({
|
|
73
|
+
product: productRefSchema,
|
|
74
|
+
input: external_exports.unknown().refine((value) => value !== void 0 && value !== null, "input is required"),
|
|
75
|
+
addons: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
76
|
+
session_id: external_exports.string().min(1).optional(),
|
|
77
|
+
stream: external_exports.boolean().optional(),
|
|
78
|
+
metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
79
|
+
}).strict();
|
|
80
|
+
var agentRunInputSchema = external_exports.union([
|
|
81
|
+
external_exports.string().min(1).max(5e5),
|
|
82
|
+
external_exports.object({ events: external_exports.array(external_exports.union([userMessageEventSchema, systemMessageEventSchema])).min(1).max(2).refine((events) => events[0]?.type === "user.message" && (events.length === 1 || events[1]?.type === "system.message"), "A Run starts with one user message and an optional trailing system message") }).strict()
|
|
83
|
+
]);
|
|
84
|
+
var runEventsSchema = external_exports.object({
|
|
85
|
+
events: external_exports.array(external_exports.union([
|
|
86
|
+
userMessageEventSchema,
|
|
87
|
+
systemMessageEventSchema,
|
|
88
|
+
external_exports.object({ type: external_exports.literal("user.interrupt") }).strict()
|
|
89
|
+
])).min(1).max(2).refine(
|
|
90
|
+
(events) => events.length === 1 && events[0]?.type === "user.interrupt" || events[0]?.type === "user.message" && (events.length === 1 || events[1]?.type === "system.message"),
|
|
91
|
+
"Controls accept one interrupt or one user message with an optional trailing system message"
|
|
92
|
+
)
|
|
93
|
+
}).strict();
|
|
94
|
+
var publishProductSchema = external_exports.object({
|
|
95
|
+
slug: external_exports.string().regex(/^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9-]*$/).max(180).optional(),
|
|
96
|
+
description: external_exports.string().max(2e3).optional()
|
|
97
|
+
}).strict();
|
|
98
|
+
var migrateSessionExecutionSchema = external_exports.object({
|
|
99
|
+
execution: external_exports.object({ product: productRefSchema, expected_generation: external_exports.number().int().min(0) }).strict()
|
|
100
|
+
}).strict();
|
|
101
|
+
var sessionAddonsPatchSchema = external_exports.object({
|
|
102
|
+
addons: external_exports.object({ skills: skillsArraySchema.optional(), capabilities: capabilityInputsSchema.optional() }).strict().refine((value) => value.skills !== void 0 || value.capabilities !== void 0, "Supply a skills or capabilities overlay"),
|
|
103
|
+
expected_addons_revision: external_exports.number().int().min(0),
|
|
104
|
+
metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
105
|
+
}).strict();
|
|
106
|
+
var publicRunSchema = external_exports.object({
|
|
107
|
+
id: external_exports.string(),
|
|
108
|
+
product: external_exports.string().nullable(),
|
|
109
|
+
session_id: external_exports.string().nullable(),
|
|
110
|
+
status: external_exports.enum(["queued", "running", "waiting_input", "stopping", "completed", "interrupted", "failed", "blocked", "reconciling"]),
|
|
111
|
+
output: external_exports.unknown(),
|
|
112
|
+
output_available: external_exports.boolean().optional(),
|
|
113
|
+
usage: external_exports.unknown(),
|
|
114
|
+
billing: external_exports.unknown(),
|
|
115
|
+
error: external_exports.unknown(),
|
|
116
|
+
artifact: external_exports.object({ id: external_exports.string(), mediaType: external_exports.string(), url: external_exports.string().url() }).optional(),
|
|
117
|
+
source: external_exports.object({ goal_id: external_exports.string().optional(), iteration: external_exports.number().int().optional(), routine_run_id: external_exports.string().optional(), routine_id: external_exports.string().optional() }).optional(),
|
|
118
|
+
created_at: external_exports.string(),
|
|
119
|
+
completed_at: external_exports.string().nullable()
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
// src/products.ts
|
|
123
|
+
var ProductApiError = class extends Error {
|
|
124
|
+
constructor(status, code, message) {
|
|
125
|
+
super(message);
|
|
126
|
+
this.status = status;
|
|
127
|
+
this.code = code;
|
|
128
|
+
this.name = "ProductApiError";
|
|
129
|
+
}
|
|
130
|
+
status;
|
|
131
|
+
code;
|
|
132
|
+
};
|
|
133
|
+
function createProductClient(options) {
|
|
134
|
+
const transport = options.fetch ?? fetch;
|
|
135
|
+
const base = (options.baseUrl ?? "https://api.agentsky.dev/v1").replace(/\/$/, "");
|
|
136
|
+
const pathId = (id) => encodeURIComponent(id);
|
|
137
|
+
async function request(method, path, body, requestOptions, stream = false) {
|
|
138
|
+
const serializedBody = body === void 0 ? void 0 : JSON.stringify(body);
|
|
139
|
+
const token = typeof options.token === "function" ? await options.token() : options.token;
|
|
140
|
+
const response = await transport(`${base}${path}`, {
|
|
141
|
+
method,
|
|
142
|
+
signal: requestOptions?.signal,
|
|
143
|
+
headers: {
|
|
144
|
+
authorization: `Bearer ${token}`,
|
|
145
|
+
"x-universe": options.universe,
|
|
146
|
+
...body === void 0 ? {} : { "content-type": "application/json" },
|
|
147
|
+
...stream ? { accept: "text/event-stream" } : {},
|
|
148
|
+
...requestOptions?.idempotencyKey ? { "idempotency-key": requestOptions.idempotencyKey } : {}
|
|
149
|
+
},
|
|
150
|
+
...serializedBody === void 0 ? {} : { body: serializedBody }
|
|
151
|
+
});
|
|
152
|
+
if (!response.ok) {
|
|
153
|
+
const error = await response.json().catch(() => null);
|
|
154
|
+
throw new ProductApiError(
|
|
155
|
+
response.status,
|
|
156
|
+
typeof error?.error?.code === "string" ? error.error.code : "http_error",
|
|
157
|
+
typeof error?.error?.message === "string" ? error.error.message : response.statusText
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
return response;
|
|
161
|
+
}
|
|
162
|
+
function admissionKey(value) {
|
|
163
|
+
if (typeof value?.idempotencyKey !== "string" || !/^[\x21-\x7e]{1,200}$/.test(value.idempotencyKey)) throw new Error("Provide a stable Idempotency-Key containing 1\u2013200 visible ASCII characters.");
|
|
164
|
+
return { idempotencyKey: value.idempotencyKey, signal: value.signal };
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
async list(signal) {
|
|
168
|
+
return (await (await request("GET", "/products", void 0, { signal })).json()).products;
|
|
169
|
+
},
|
|
170
|
+
async prepare(input, context) {
|
|
171
|
+
const result = await (await request("POST", "/sessions", prepareProductSessionSchema.parse(input), admissionKey(context))).json();
|
|
172
|
+
return result.session;
|
|
173
|
+
},
|
|
174
|
+
async create(input, context) {
|
|
175
|
+
const result = await (await request("POST", "/agents", createProductAgentSchema.parse(input), admissionKey(context))).json();
|
|
176
|
+
return result.agent;
|
|
177
|
+
},
|
|
178
|
+
async publish(agentId, input, context) {
|
|
179
|
+
return (await request("POST", `/agents/${pathId(agentId)}/publish`, publishProductSchema.parse(input), admissionKey(context))).json();
|
|
180
|
+
},
|
|
181
|
+
async delist(agentId, context) {
|
|
182
|
+
return (await request("DELETE", `/agents/${pathId(agentId)}/publish`, void 0, admissionKey(context))).json();
|
|
183
|
+
},
|
|
184
|
+
async start(input, context) {
|
|
185
|
+
const response = await request("POST", "/runs", createRunSchema.parse({ ...input, stream: false }), admissionKey(context));
|
|
186
|
+
return (await response.json()).run;
|
|
187
|
+
},
|
|
188
|
+
async read(runId, signal) {
|
|
189
|
+
return (await (await request("GET", `/runs/${pathId(runId)}`, void 0, { signal })).json()).run;
|
|
190
|
+
},
|
|
191
|
+
async control(runId, input, context) {
|
|
192
|
+
return (await request("POST", `/runs/${pathId(runId)}/events`, runEventsSchema.parse(input), admissionKey(context))).json();
|
|
193
|
+
},
|
|
194
|
+
async events(runId, context = {}) {
|
|
195
|
+
const query = context.cursor ? `?cursor=${encodeURIComponent(context.cursor)}` : "";
|
|
196
|
+
return (await request("GET", `/runs/${pathId(runId)}/events${query}`, void 0, { signal: context.signal })).json();
|
|
197
|
+
},
|
|
198
|
+
async observe(runId, context = {}) {
|
|
199
|
+
const query = context.cursor ? `?cursor=${encodeURIComponent(context.cursor)}` : "";
|
|
200
|
+
return request("GET", `/runs/${pathId(runId)}/events${query}`, void 0, { signal: context.signal }, true);
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
export {
|
|
205
|
+
ProductApiError,
|
|
206
|
+
createProductClient
|
|
207
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
external_exports,
|
|
3
3
|
messagePartSchema
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2KQLWHHC.js";
|
|
5
5
|
|
|
6
6
|
// ../../packages/chat/src/stream.ts
|
|
7
7
|
async function* parseSseStream(body) {
|
|
@@ -89,6 +89,7 @@ var internalEventSchema = external_exports.object({
|
|
|
89
89
|
agentInstanceId: external_exports.string().min(1).optional(),
|
|
90
90
|
message: external_exports.object({
|
|
91
91
|
id: external_exports.string().optional(),
|
|
92
|
+
podId: external_exports.string().min(1).optional(),
|
|
92
93
|
parts: external_exports.array(messagePartSchema).min(1)
|
|
93
94
|
}).optional(),
|
|
94
95
|
/** A pre-built lifecycle event from the web host (session.updated /
|
|
@@ -216,6 +217,7 @@ function textFromParts(parts) {
|
|
|
216
217
|
function normalizeBaseUrl(baseUrl) {
|
|
217
218
|
return baseUrl.endsWith("/") ? baseUrl : `${baseUrl}/`;
|
|
218
219
|
}
|
|
220
|
+
var PROMOTION_SCOPE_HEADER = "x-agentsky-promotion-scope";
|
|
219
221
|
async function postSessionEvents(args) {
|
|
220
222
|
const url = new URL(
|
|
221
223
|
`/api/v1/sessions/${encodeURIComponent(args.sessionId)}/events`,
|
|
@@ -227,7 +229,9 @@ async function postSessionEvents(args) {
|
|
|
227
229
|
headers: {
|
|
228
230
|
authorization: `Bearer ${token}`,
|
|
229
231
|
"content-type": "application/json",
|
|
230
|
-
...args.idempotencyKey ? { "idempotency-key": args.idempotencyKey } : {}
|
|
232
|
+
...args.idempotencyKey ? { "idempotency-key": args.idempotencyKey } : {},
|
|
233
|
+
...args.routineRunId ? { "x-agentsky-routine-run": args.routineRunId } : {},
|
|
234
|
+
...args.promotionScope ? { [PROMOTION_SCOPE_HEADER]: args.promotionScope } : {}
|
|
231
235
|
},
|
|
232
236
|
body,
|
|
233
237
|
signal: AbortSignal.timeout(args.timeoutMs ?? 95e3)
|
|
@@ -261,6 +265,7 @@ async function readResult(response) {
|
|
|
261
265
|
};
|
|
262
266
|
}
|
|
263
267
|
export {
|
|
268
|
+
PROMOTION_SCOPE_HEADER,
|
|
264
269
|
classifyPodSendError,
|
|
265
270
|
classifyPodSendStatus,
|
|
266
271
|
getPodHealth,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentsky/sky",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "sky — the AgentSky developer CLI: launch and talk to long-lived agents from your terminal.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -15,13 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"dev": "tsx src/index.ts",
|
|
18
|
-
"build": "tsup src/index.ts --format esm --target node20 --clean",
|
|
18
|
+
"build": "tsup src/index.ts src/products.ts --format esm --target node20 --clean",
|
|
19
19
|
"test": "vitest run",
|
|
20
20
|
"typecheck": "tsc --noEmit"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"commander": "^14.0.0",
|
|
24
|
-
"smol-toml": "^1.4.2"
|
|
24
|
+
"smol-toml": "^1.4.2",
|
|
25
|
+
"zod": "4.5.4"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
28
|
"@agent/chat": "*",
|
|
@@ -30,14 +31,28 @@
|
|
|
30
31
|
"tsup": "^8.5.0",
|
|
31
32
|
"tsx": "^4.22.4",
|
|
32
33
|
"typescript": "^5",
|
|
33
|
-
"vitest": "^3.0.0"
|
|
34
|
-
"zod": "^4.4.3"
|
|
34
|
+
"vitest": "^3.0.0"
|
|
35
35
|
},
|
|
36
36
|
"tsup": {
|
|
37
37
|
"noExternal": [
|
|
38
38
|
"@agent/chat",
|
|
39
39
|
"@agent/spec",
|
|
40
40
|
"zod"
|
|
41
|
-
]
|
|
41
|
+
],
|
|
42
|
+
"dts": {
|
|
43
|
+
"compilerOptions": {
|
|
44
|
+
"ignoreDeprecations": "6.0"
|
|
45
|
+
},
|
|
46
|
+
"resolve": [
|
|
47
|
+
"@agent/spec",
|
|
48
|
+
"@agent/spec/products"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"exports": {
|
|
53
|
+
"./products": {
|
|
54
|
+
"types": "./dist/products.d.ts",
|
|
55
|
+
"import": "./dist/products.js"
|
|
56
|
+
}
|
|
42
57
|
}
|
|
43
58
|
}
|