@aexhq/sdk 0.23.0 → 0.25.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/README.md +36 -125
- package/dist/_contracts/models.js +1 -2
- package/dist/_contracts/operations.d.ts +2 -2
- package/dist/_contracts/operations.js +4 -4
- package/dist/_contracts/provider-support.d.ts +23 -23
- package/dist/_contracts/provider-support.js +7 -14
- package/dist/_contracts/run-config.d.ts +24 -0
- package/dist/_contracts/run-config.js +6 -0
- package/dist/_contracts/run-trace.d.ts +7 -5
- package/dist/_contracts/run-trace.js +7 -5
- package/dist/_contracts/run-unit.js +21 -3
- package/dist/_contracts/runtime-types.d.ts +7 -8
- package/dist/_contracts/submission.d.ts +13 -1
- package/dist/_contracts/submission.js +93 -4
- package/dist/bundle.d.ts +13 -0
- package/dist/bundle.js +51 -0
- package/dist/bundle.js.map +1 -1
- package/dist/cli.mjs +13 -18
- package/dist/cli.mjs.sha256 +1 -1
- package/dist/client.d.ts +10 -4
- package/dist/client.js +61 -10
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/tool.d.ts +41 -0
- package/dist/tool.js +138 -0
- package/dist/tool.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/concepts/agent-tools.md +48 -0
- package/docs/concepts/composition.md +43 -0
- package/docs/concepts/providers-and-runtimes.md +53 -0
- package/docs/concepts/runs.md +40 -0
- package/docs/credentials.md +3 -1
- package/docs/limits.md +44 -0
- package/docs/provider-runtime-capabilities.md +52 -54
- package/docs/public-surface.json +81 -0
- package/docs/quickstart.md +28 -105
- package/docs/run-config.md +1 -1
- package/docs/secrets.md +123 -0
- package/docs/vision-skills.md +3 -6
- package/package.json +2 -2
- package/docs/product-boundaries.md +0 -57
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PROXY_ENDPOINT_DEFAULTS, type ProxyAuthShape, type ProxyMethod, type ProxyRetryPolicy, type ProxyResponseMode } from "./proxy-protocol.js";
|
|
2
2
|
export { PROXY_ENDPOINT_DEFAULTS };
|
|
3
|
-
import type { AgentsMdRef, FileRef, McpServerRef, SkillRef } from "./run-config.js";
|
|
3
|
+
import type { AgentsMdRef, FileRef, McpServerRef, SkillRef, ToolRef } from "./run-config.js";
|
|
4
4
|
import { type RuntimeSize } from "./runtime-sizes.js";
|
|
5
5
|
import { type PlatformPostHook, type PlatformPostHookInput } from "./post-hook.js";
|
|
6
6
|
import { type RunModel } from "./models.js";
|
|
@@ -298,6 +298,7 @@ export interface PlatformSubmission {
|
|
|
298
298
|
readonly system?: string;
|
|
299
299
|
readonly prompt: readonly string[];
|
|
300
300
|
readonly skills: readonly SkillRef[];
|
|
301
|
+
readonly tools?: readonly ToolRef[];
|
|
301
302
|
readonly agentsMd: readonly AgentsMdRef[];
|
|
302
303
|
readonly files: readonly FileRef[];
|
|
303
304
|
readonly mcpServers: readonly McpServerRef[];
|
|
@@ -368,6 +369,17 @@ export interface PlatformOutputCaptureConfig {
|
|
|
368
369
|
* platform-mandatory denies always apply and cannot be re-included.
|
|
369
370
|
*/
|
|
370
371
|
readonly deniedDirs?: readonly string[];
|
|
372
|
+
/**
|
|
373
|
+
* Maximum time the platform may spend capturing outputs after the agent exits.
|
|
374
|
+
* Positive integer milliseconds; values above the platform maximum are clamped.
|
|
375
|
+
*/
|
|
376
|
+
readonly captureTimeoutMs?: number;
|
|
377
|
+
/** Maximum size of a single captured file in bytes. Positive integer. */
|
|
378
|
+
readonly maxFileBytes?: number;
|
|
379
|
+
/** Maximum total captured output bytes for the run. Positive integer. */
|
|
380
|
+
readonly maxTotalBytes?: number;
|
|
381
|
+
/** Maximum number of captured files for the run. Positive integer. */
|
|
382
|
+
readonly maxFiles?: number;
|
|
371
383
|
}
|
|
372
384
|
export interface PlatformInjectionConfig {
|
|
373
385
|
readonly systemPrompt?: "default" | "off";
|
|
@@ -4,7 +4,7 @@ import { authShapeHeaderName, PROXY_ALLOWED_METHODS, PROXY_ENDPOINT_DEFAULTS, PR
|
|
|
4
4
|
// existing `@aexhq/contracts` consumers of `PROXY_ENDPOINT_DEFAULTS` are
|
|
5
5
|
// unaffected by the move.
|
|
6
6
|
export { PROXY_ENDPOINT_DEFAULTS };
|
|
7
|
-
import { parseAssetRefFields, parseMcpServerRef, parseSkillRef } from "./run-config.js";
|
|
7
|
+
import { TOOL_NAME_PATTERN, normaliseSkillBundlePath, parseAssetRefFields, parseMcpServerRef, parseSkillRef } from "./run-config.js";
|
|
8
8
|
import { parseRunTimeout, parseRuntimeSize } from "./runtime-sizes.js";
|
|
9
9
|
import { parsePostHook } from "./post-hook.js";
|
|
10
10
|
import { assertRunModelMatchesProvider, parseRunModel } from "./models.js";
|
|
@@ -1113,6 +1113,7 @@ export function parseSubmission(input) {
|
|
|
1113
1113
|
"system",
|
|
1114
1114
|
"prompt",
|
|
1115
1115
|
"skills",
|
|
1116
|
+
"tools",
|
|
1116
1117
|
"agentsMd",
|
|
1117
1118
|
"files",
|
|
1118
1119
|
"mcpServers",
|
|
@@ -1134,6 +1135,7 @@ export function parseSubmission(input) {
|
|
|
1134
1135
|
const system = optionalString(value.system, "submission.system");
|
|
1135
1136
|
const prompt = parsePrompt(value.prompt);
|
|
1136
1137
|
const skills = parseSkills(value.skills);
|
|
1138
|
+
const tools = parseTools(value.tools);
|
|
1137
1139
|
const agentsMd = parseAgentsMd(value.agentsMd);
|
|
1138
1140
|
const files = parseFiles(value.files);
|
|
1139
1141
|
const mcpServers = parseMcpServers(value.mcpServers);
|
|
@@ -1150,6 +1152,7 @@ export function parseSubmission(input) {
|
|
|
1150
1152
|
...(system ? { system } : {}),
|
|
1151
1153
|
prompt,
|
|
1152
1154
|
skills,
|
|
1155
|
+
tools,
|
|
1153
1156
|
agentsMd,
|
|
1154
1157
|
files,
|
|
1155
1158
|
mcpServers,
|
|
@@ -1296,12 +1299,13 @@ const MAX_OUTPUT_DIRS = 32;
|
|
|
1296
1299
|
* the field.
|
|
1297
1300
|
*/
|
|
1298
1301
|
const MAX_OUTPUT_DIR_BYTES = 512;
|
|
1302
|
+
const MAX_OUTPUT_CAPTURE_TIMEOUT_MS = 6 * 60 * 60 * 1000;
|
|
1299
1303
|
function parseOutputs(input) {
|
|
1300
1304
|
if (input === undefined || input === null) {
|
|
1301
1305
|
return undefined;
|
|
1302
1306
|
}
|
|
1303
1307
|
const value = requireRecord(input, "submission.outputs");
|
|
1304
|
-
const allowed = new Set(["allowedDirs", "deniedDirs"]);
|
|
1308
|
+
const allowed = new Set(["allowedDirs", "deniedDirs", "captureTimeoutMs", "maxFileBytes", "maxTotalBytes", "maxFiles"]);
|
|
1305
1309
|
for (const key of Object.keys(value)) {
|
|
1306
1310
|
if (!allowed.has(key)) {
|
|
1307
1311
|
throw new Error(`submission.outputs.${key} is not an allowed field; permitted: ${[...allowed].join(", ")}`);
|
|
@@ -1309,14 +1313,37 @@ function parseOutputs(input) {
|
|
|
1309
1313
|
}
|
|
1310
1314
|
const allowedDirs = parseOutputAllowedDirs(value.allowedDirs);
|
|
1311
1315
|
const deniedDirs = parseOutputDeniedDirs(value.deniedDirs);
|
|
1312
|
-
|
|
1316
|
+
const captureTimeoutMs = parseOutputPositiveInteger(value.captureTimeoutMs, "submission.outputs.captureTimeoutMs", {
|
|
1317
|
+
max: MAX_OUTPUT_CAPTURE_TIMEOUT_MS,
|
|
1318
|
+
clamp: true
|
|
1319
|
+
});
|
|
1320
|
+
const maxFileBytes = parseOutputPositiveInteger(value.maxFileBytes, "submission.outputs.maxFileBytes");
|
|
1321
|
+
const maxTotalBytes = parseOutputPositiveInteger(value.maxTotalBytes, "submission.outputs.maxTotalBytes");
|
|
1322
|
+
const maxFiles = parseOutputPositiveInteger(value.maxFiles, "submission.outputs.maxFiles");
|
|
1323
|
+
if (!allowedDirs && !deniedDirs && captureTimeoutMs === undefined && maxFileBytes === undefined && maxTotalBytes === undefined && maxFiles === undefined) {
|
|
1313
1324
|
return undefined;
|
|
1314
1325
|
}
|
|
1315
1326
|
return {
|
|
1316
1327
|
...(allowedDirs ? { allowedDirs } : {}),
|
|
1317
|
-
...(deniedDirs ? { deniedDirs } : {})
|
|
1328
|
+
...(deniedDirs ? { deniedDirs } : {}),
|
|
1329
|
+
...(captureTimeoutMs !== undefined ? { captureTimeoutMs } : {}),
|
|
1330
|
+
...(maxFileBytes !== undefined ? { maxFileBytes } : {}),
|
|
1331
|
+
...(maxTotalBytes !== undefined ? { maxTotalBytes } : {}),
|
|
1332
|
+
...(maxFiles !== undefined ? { maxFiles } : {})
|
|
1318
1333
|
};
|
|
1319
1334
|
}
|
|
1335
|
+
function parseOutputPositiveInteger(input, field, options = {}) {
|
|
1336
|
+
if (input === undefined) {
|
|
1337
|
+
return undefined;
|
|
1338
|
+
}
|
|
1339
|
+
if (typeof input !== "number" || !Number.isInteger(input) || input <= 0) {
|
|
1340
|
+
throw new Error(`${field} must be a positive integer`);
|
|
1341
|
+
}
|
|
1342
|
+
if (options.max !== undefined && input > options.max) {
|
|
1343
|
+
return options.clamp ? options.max : input;
|
|
1344
|
+
}
|
|
1345
|
+
return input;
|
|
1346
|
+
}
|
|
1320
1347
|
function parseOutputAllowedDirs(input) {
|
|
1321
1348
|
if (input === undefined) {
|
|
1322
1349
|
return undefined;
|
|
@@ -1481,6 +1508,68 @@ function parseSkills(input) {
|
|
|
1481
1508
|
return ref;
|
|
1482
1509
|
});
|
|
1483
1510
|
}
|
|
1511
|
+
function parseTools(input) {
|
|
1512
|
+
if (input === undefined) {
|
|
1513
|
+
return [];
|
|
1514
|
+
}
|
|
1515
|
+
if (!Array.isArray(input)) {
|
|
1516
|
+
throw new Error("submission.tools must be an array of ToolRef objects");
|
|
1517
|
+
}
|
|
1518
|
+
const seenNames = new Set();
|
|
1519
|
+
const seenAssetIds = new Set();
|
|
1520
|
+
return input.map((item, index) => {
|
|
1521
|
+
const path = `submission.tools[${index}]`;
|
|
1522
|
+
const raw = requireRecord(item, path);
|
|
1523
|
+
for (const key of Object.keys(raw)) {
|
|
1524
|
+
if (key !== "kind" &&
|
|
1525
|
+
key !== "assetId" &&
|
|
1526
|
+
key !== "name" &&
|
|
1527
|
+
key !== "description" &&
|
|
1528
|
+
key !== "input_schema" &&
|
|
1529
|
+
key !== "entry") {
|
|
1530
|
+
throw new Error(`${path}.${key} is not an allowed field for ToolRef; permitted: kind, assetId, name, description, input_schema, entry`);
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
if (raw.kind !== "asset") {
|
|
1534
|
+
throw new Error(`${path}.kind must be 'asset' (got ${JSON.stringify(raw.kind)})`);
|
|
1535
|
+
}
|
|
1536
|
+
const fields = parseAssetRefFields({ kind: raw.kind, assetId: raw.assetId, name: raw.name }, path);
|
|
1537
|
+
if (!TOOL_NAME_PATTERN.test(fields.name)) {
|
|
1538
|
+
throw new Error(`${path}.name must match ${TOOL_NAME_PATTERN.source}`);
|
|
1539
|
+
}
|
|
1540
|
+
if (fields.name.includes("__")) {
|
|
1541
|
+
throw new Error(`${path}.name must not contain "__"; that separator is reserved for MCP tools`);
|
|
1542
|
+
}
|
|
1543
|
+
if (seenNames.has(fields.name)) {
|
|
1544
|
+
throw new Error(`submission.tools duplicate name: ${fields.name}`);
|
|
1545
|
+
}
|
|
1546
|
+
seenNames.add(fields.name);
|
|
1547
|
+
if (seenAssetIds.has(fields.assetId)) {
|
|
1548
|
+
throw new Error(`submission.tools duplicate assetId: ${fields.assetId}`);
|
|
1549
|
+
}
|
|
1550
|
+
seenAssetIds.add(fields.assetId);
|
|
1551
|
+
const description = requireString(raw.description, `${path}.description`);
|
|
1552
|
+
if (description.trim().length === 0 || description.length > 2048) {
|
|
1553
|
+
throw new Error(`${path}.description must be non-empty and <= 2048 chars`);
|
|
1554
|
+
}
|
|
1555
|
+
const inputSchema = requireRecord(raw.input_schema, `${path}.input_schema`);
|
|
1556
|
+
if (!isJsonValue(inputSchema)) {
|
|
1557
|
+
throw new Error(`${path}.input_schema must be JSON-serializable`);
|
|
1558
|
+
}
|
|
1559
|
+
if (inputSchema.type !== "object") {
|
|
1560
|
+
throw new Error(`${path}.input_schema.type must be "object"`);
|
|
1561
|
+
}
|
|
1562
|
+
const entry = normaliseSkillBundlePath(requireString(raw.entry, `${path}.entry`));
|
|
1563
|
+
return {
|
|
1564
|
+
kind: "asset",
|
|
1565
|
+
assetId: fields.assetId,
|
|
1566
|
+
name: fields.name,
|
|
1567
|
+
description,
|
|
1568
|
+
input_schema: inputSchema,
|
|
1569
|
+
entry
|
|
1570
|
+
};
|
|
1571
|
+
});
|
|
1572
|
+
}
|
|
1484
1573
|
function parseAgentsMd(input) {
|
|
1485
1574
|
if (input === undefined)
|
|
1486
1575
|
return [];
|
package/dist/bundle.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ToolInputSchema } from "./_contracts/index.js";
|
|
1
2
|
/**
|
|
2
3
|
* In-memory skill bundle: a flat path -> bytes map and the
|
|
3
4
|
* deterministically-zipped representation.
|
|
@@ -22,6 +23,18 @@ export interface BundledSkill {
|
|
|
22
23
|
/** Inline files map: path -> contents (UTF-8 string or raw bytes). */
|
|
23
24
|
export type SkillFiles = Readonly<Record<string, string | Uint8Array>>;
|
|
24
25
|
export declare function bundleSkillFiles(files: SkillFiles): BundledSkill;
|
|
26
|
+
export interface BundledTool {
|
|
27
|
+
readonly zip: Uint8Array;
|
|
28
|
+
readonly fileCount: number;
|
|
29
|
+
readonly compressedSize: number;
|
|
30
|
+
}
|
|
31
|
+
export interface ToolBundleManifest {
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly description: string;
|
|
34
|
+
readonly input_schema: ToolInputSchema;
|
|
35
|
+
readonly entry: string;
|
|
36
|
+
}
|
|
37
|
+
export declare function bundleToolFiles(files: SkillFiles, manifest: ToolBundleManifest): BundledTool;
|
|
25
38
|
/**
|
|
26
39
|
* Compute `sha256:<hex>` of the given canonicalised zip bytes. Used by
|
|
27
40
|
* `Skill.fromFiles` / `Skill.fromPath` to populate the
|
package/dist/bundle.js
CHANGED
|
@@ -53,6 +53,57 @@ export function bundleSkillFiles(files) {
|
|
|
53
53
|
}
|
|
54
54
|
return { zip, fileCount: entries.length, compressedSize: zip.byteLength };
|
|
55
55
|
}
|
|
56
|
+
export function bundleToolFiles(files, manifest) {
|
|
57
|
+
if (!files || typeof files !== "object") {
|
|
58
|
+
throw new Error("Tool files map is required");
|
|
59
|
+
}
|
|
60
|
+
const entries = Object.entries(files);
|
|
61
|
+
if (entries.length === 0) {
|
|
62
|
+
throw new Error("Tool files map cannot be empty");
|
|
63
|
+
}
|
|
64
|
+
if (entries.length > SKILL_BUNDLE_LIMITS.maxFiles) {
|
|
65
|
+
throw new Error(`Tool bundle exceeds ${SKILL_BUNDLE_LIMITS.maxFiles} file limit (got ${entries.length})`);
|
|
66
|
+
}
|
|
67
|
+
const collected = new Map();
|
|
68
|
+
let totalDecompressed = 0;
|
|
69
|
+
let hasEntry = false;
|
|
70
|
+
const entryPath = validateSkillBundleEntry({ path: manifest.entry, size: 0 }).path;
|
|
71
|
+
for (const [rawPath, contents] of entries) {
|
|
72
|
+
const bytes = typeof contents === "string" ? TEXT.encode(contents) : contents;
|
|
73
|
+
if (!(bytes instanceof Uint8Array)) {
|
|
74
|
+
throw new Error(`Tool file "${rawPath}" must be a string or Uint8Array`);
|
|
75
|
+
}
|
|
76
|
+
const entry = validateSkillBundleEntry({ path: rawPath, size: bytes.byteLength });
|
|
77
|
+
totalDecompressed += bytes.byteLength;
|
|
78
|
+
if (totalDecompressed > SKILL_BUNDLE_LIMITS.maxDecompressedBytes) {
|
|
79
|
+
throw new Error(`Tool bundle exceeds decompressed cap of ${SKILL_BUNDLE_LIMITS.maxDecompressedBytes} bytes`);
|
|
80
|
+
}
|
|
81
|
+
if (collected.has(entry.path)) {
|
|
82
|
+
throw new Error(`Tool bundle contains duplicate path: ${entry.path}`);
|
|
83
|
+
}
|
|
84
|
+
if (entry.path === entryPath)
|
|
85
|
+
hasEntry = true;
|
|
86
|
+
collected.set(entry.path, bytes);
|
|
87
|
+
}
|
|
88
|
+
if (!hasEntry) {
|
|
89
|
+
throw new Error(`Tool bundle entry "${entryPath}" must exist in files`);
|
|
90
|
+
}
|
|
91
|
+
const manifestBytes = TEXT.encode(`${JSON.stringify(manifest, null, 2)}\n`);
|
|
92
|
+
if (collected.has("tool.json")) {
|
|
93
|
+
throw new Error('Tool bundle files must not include reserved "tool.json"; pass manifest fields to Tool.fromFiles instead');
|
|
94
|
+
}
|
|
95
|
+
collected.set("tool.json", manifestBytes);
|
|
96
|
+
const sorted = [...collected.entries()].sort((a, b) => (a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0));
|
|
97
|
+
const zippable = {};
|
|
98
|
+
for (const [path, bytes] of sorted) {
|
|
99
|
+
zippable[path] = [bytes, { mtime: ZIP_EPOCH }];
|
|
100
|
+
}
|
|
101
|
+
const zip = zipSync(zippable, { level: 6 });
|
|
102
|
+
if (zip.byteLength > SKILL_BUNDLE_LIMITS.maxCompressedBytes) {
|
|
103
|
+
throw new Error(`Tool bundle exceeds compressed cap of ${SKILL_BUNDLE_LIMITS.maxCompressedBytes} bytes (got ${zip.byteLength})`);
|
|
104
|
+
}
|
|
105
|
+
return { zip, fileCount: collected.size, compressedSize: zip.byteLength };
|
|
106
|
+
}
|
|
56
107
|
const ZIP_EPOCH = new Date(Date.UTC(1980, 0, 1));
|
|
57
108
|
/**
|
|
58
109
|
* Compute `sha256:<hex>` of the given canonicalised zip bytes. Used by
|
package/dist/bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAiB,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,
|
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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
|
// ../contracts/dist/provider-support.js
|
|
36
36
|
var COMMON_DOCS = [
|
|
37
|
-
{ label: "
|
|
37
|
+
{ label: "Secrets", href: "secrets.md" },
|
|
38
38
|
{ label: "Events", href: "events.md" }
|
|
39
39
|
];
|
|
40
40
|
var COMMON_EVIDENCE = [
|
|
@@ -89,7 +89,7 @@ var PROVIDER_PUBLIC_SUPPORT = {
|
|
|
89
89
|
},
|
|
90
90
|
openai: {
|
|
91
91
|
displayName: "OpenAI",
|
|
92
|
-
status: "
|
|
92
|
+
status: "supported",
|
|
93
93
|
docsAnchor: "openai",
|
|
94
94
|
docs: COMMON_DOCS,
|
|
95
95
|
evidence: COMMON_EVIDENCE,
|
|
@@ -99,7 +99,7 @@ var PROVIDER_PUBLIC_SUPPORT = {
|
|
|
99
99
|
},
|
|
100
100
|
gemini: {
|
|
101
101
|
displayName: "Gemini",
|
|
102
|
-
status: "
|
|
102
|
+
status: "supported",
|
|
103
103
|
docsAnchor: "gemini",
|
|
104
104
|
docs: COMMON_DOCS,
|
|
105
105
|
evidence: COMMON_EVIDENCE,
|
|
@@ -109,7 +109,7 @@ var PROVIDER_PUBLIC_SUPPORT = {
|
|
|
109
109
|
},
|
|
110
110
|
mistral: {
|
|
111
111
|
displayName: "Mistral",
|
|
112
|
-
status: "
|
|
112
|
+
status: "supported",
|
|
113
113
|
docsAnchor: "mistral",
|
|
114
114
|
docs: COMMON_DOCS,
|
|
115
115
|
evidence: COMMON_EVIDENCE,
|
|
@@ -119,7 +119,7 @@ var PROVIDER_PUBLIC_SUPPORT = {
|
|
|
119
119
|
},
|
|
120
120
|
openrouter: {
|
|
121
121
|
displayName: "OpenRouter",
|
|
122
|
-
status: "
|
|
122
|
+
status: "supported",
|
|
123
123
|
docsAnchor: "openrouter",
|
|
124
124
|
docs: COMMON_DOCS,
|
|
125
125
|
evidence: COMMON_EVIDENCE,
|
|
@@ -128,13 +128,9 @@ var PROVIDER_PUBLIC_SUPPORT = {
|
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
130
|
// Doubao (ByteDance) via the official Ark API — international BytePlus gateway.
|
|
131
|
-
// Wired + parser/routing-verified but not yet proven against a live BytePlus
|
|
132
|
-
// account, so `live-unverified`. Promote to `supported` (and swap COMMON_EVIDENCE
|
|
133
|
-
// for a DOUBAO_MANAGED_EVIDENCE pointer to live-sdk-doubao.test.ts) once the
|
|
134
|
-
// live run passes.
|
|
135
131
|
doubao: {
|
|
136
132
|
displayName: "Doubao",
|
|
137
|
-
status: "
|
|
133
|
+
status: "supported",
|
|
138
134
|
docsAnchor: "doubao",
|
|
139
135
|
docs: COMMON_DOCS,
|
|
140
136
|
evidence: COMMON_EVIDENCE,
|
|
@@ -143,11 +139,9 @@ var PROVIDER_PUBLIC_SUPPORT = {
|
|
|
143
139
|
}
|
|
144
140
|
},
|
|
145
141
|
// Doubao (ByteDance) via the official Ark API — China Volcengine gateway.
|
|
146
|
-
// Same wiring as `doubao`; additionally gated on CF Worker egress reaching the
|
|
147
|
-
// Beijing host (see apps/egress-probe). `live-unverified` until proven live.
|
|
148
142
|
"doubao-cn": {
|
|
149
143
|
displayName: "Doubao (China)",
|
|
150
|
-
status: "
|
|
144
|
+
status: "supported",
|
|
151
145
|
docsAnchor: "doubao-cn",
|
|
152
146
|
docs: COMMON_DOCS,
|
|
153
147
|
evidence: COMMON_EVIDENCE,
|
|
@@ -179,8 +173,7 @@ var MODEL_PROVIDER_IDS = {
|
|
|
179
173
|
// China Volcengine Ark gateway (`doubao-cn`). Ark accepts the API-format
|
|
180
174
|
// model NAME directly in the chat-completions `model` field (no `ep-…`
|
|
181
175
|
// inference-endpoint id). The native strings are the same Ark catalog ids on
|
|
182
|
-
// both gateways
|
|
183
|
-
// (both providers ship `live-unverified` until then — provider-support.ts).
|
|
176
|
+
// both gateways.
|
|
184
177
|
// pro — Doubao Seed 1.8 (flagship, 256K context).
|
|
185
178
|
// flash — Doubao Seed 1.6 Flash (fast/cheap, 256K context).
|
|
186
179
|
"doubao-seed-pro": { doubao: "doubao-seed-1-8-251228", "doubao-cn": "doubao-seed-1-8-251228" },
|
|
@@ -817,6 +810,7 @@ var RUNTIME_KINDS = ["managed"];
|
|
|
817
810
|
var MIN_REDACTION_TARGET_BYTES = 4;
|
|
818
811
|
var MIN_PROXY_SECRET_BYTES = 8;
|
|
819
812
|
var _MIN_PROXY_SECRET_BYTES_OK = MIN_PROXY_SECRET_BYTES >= MIN_REDACTION_TARGET_BYTES;
|
|
813
|
+
var MAX_OUTPUT_CAPTURE_TIMEOUT_MS = 6 * 60 * 60 * 1e3;
|
|
820
814
|
|
|
821
815
|
// ../contracts/dist/connection-ticket.js
|
|
822
816
|
var encoder = new TextEncoder();
|
|
@@ -1421,6 +1415,7 @@ __export(operations_exports, {
|
|
|
1421
1415
|
getRun: () => getRun,
|
|
1422
1416
|
getRunUnit: () => getRunUnit,
|
|
1423
1417
|
getSecret: () => getSecret,
|
|
1418
|
+
getSecretValue: () => getSecretValue,
|
|
1424
1419
|
getSkill: () => getSkill,
|
|
1425
1420
|
listAgentsMd: () => listAgentsMd,
|
|
1426
1421
|
listFiles: () => listFiles,
|
|
@@ -1429,7 +1424,6 @@ __export(operations_exports, {
|
|
|
1429
1424
|
listSecrets: () => listSecrets,
|
|
1430
1425
|
listSkills: () => listSkills,
|
|
1431
1426
|
resolveOutputFileSelector: () => resolveOutputFileSelector,
|
|
1432
|
-
revealSecret: () => revealSecret,
|
|
1433
1427
|
rotateSecret: () => rotateSecret,
|
|
1434
1428
|
submitRun: () => submitRun,
|
|
1435
1429
|
submitRunMultipart: () => submitRunMultipart,
|
|
@@ -2557,8 +2551,8 @@ async function getSecret(http, name) {
|
|
|
2557
2551
|
const result = await http.request(`/api/secrets/${encodeURIComponent(name)}`);
|
|
2558
2552
|
return unwrapSecret(result);
|
|
2559
2553
|
}
|
|
2560
|
-
async function
|
|
2561
|
-
return http.request(`/api/secrets/${encodeURIComponent(name)}/
|
|
2554
|
+
async function getSecretValue(http, name) {
|
|
2555
|
+
return http.request(`/api/secrets/${encodeURIComponent(name)}/get_value`, {
|
|
2562
2556
|
method: "POST"
|
|
2563
2557
|
});
|
|
2564
2558
|
}
|
|
@@ -3497,6 +3491,7 @@ async function runRunCmd(io2, argv) {
|
|
|
3497
3491
|
agentsMd: [],
|
|
3498
3492
|
files: [],
|
|
3499
3493
|
mcpServers: mcpServersForSubmission,
|
|
3494
|
+
tools: [],
|
|
3500
3495
|
...runConfig.environment ? { environment: runConfig.environment } : {},
|
|
3501
3496
|
...runConfig.metadata ? { metadata: runConfig.metadata } : {}
|
|
3502
3497
|
};
|
package/dist/cli.mjs.sha256
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
762430dc71b8a73c4ee49790997d44ada327ea0eec648cf7c26714ee785ba86e cli.mjs
|
package/dist/client.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { McpServer } from "./mcp-server.js";
|
|
|
6
6
|
import { ProxyEndpoint } from "./proxy-endpoint.js";
|
|
7
7
|
import { Secret } from "./secret.js";
|
|
8
8
|
import { Skill } from "./skill.js";
|
|
9
|
+
import { Tool } from "./tool.js";
|
|
9
10
|
export interface AgentExecutorOptions {
|
|
10
11
|
/** Workspace-scoped SDK API token. */
|
|
11
12
|
readonly apiToken: string;
|
|
@@ -83,6 +84,7 @@ export interface SubmitOptions {
|
|
|
83
84
|
readonly system?: string;
|
|
84
85
|
readonly prompt: string | readonly string[];
|
|
85
86
|
readonly skills?: readonly Skill[];
|
|
87
|
+
readonly tools?: readonly Tool[];
|
|
86
88
|
readonly agentsMd?: readonly AgentsMd[];
|
|
87
89
|
readonly files?: readonly File[];
|
|
88
90
|
readonly mcpServers?: readonly McpServer[];
|
|
@@ -131,6 +133,10 @@ export interface SubmitOptions {
|
|
|
131
133
|
readonly outputs?: {
|
|
132
134
|
readonly allowedDirs?: readonly string[];
|
|
133
135
|
readonly deniedDirs?: readonly string[];
|
|
136
|
+
readonly captureTimeoutMs?: number;
|
|
137
|
+
readonly maxFileBytes?: number;
|
|
138
|
+
readonly maxTotalBytes?: number;
|
|
139
|
+
readonly maxFiles?: number;
|
|
134
140
|
};
|
|
135
141
|
/**
|
|
136
142
|
* Override the managed runtime builtin extensions enabled inside the runner.
|
|
@@ -313,11 +319,11 @@ export declare class FilesClient {
|
|
|
313
319
|
* Lifecycle parity with assets/skills: a `Secret.value(...)` is per-run and
|
|
314
320
|
* gone at terminal; `set` (or promoting an ephemeral via `secret.upload`)
|
|
315
321
|
* persists a named, searchable workspace secret you can `get` (metadata),
|
|
316
|
-
* `
|
|
322
|
+
* `get_value` (audited value), `rotate`, `list`, and `delete`. The identity is the
|
|
317
323
|
* `name`; the value rotates under that stable name.
|
|
318
324
|
*
|
|
319
325
|
* Values are write-only: `set`/`rotate` send the value in the request BODY (never
|
|
320
|
-
* the URL); `get`/`list` return metadata only; `
|
|
326
|
+
* the URL); `get`/`list` return metadata only; `get_value` is the explicit audited
|
|
321
327
|
* value read.
|
|
322
328
|
*/
|
|
323
329
|
export declare class SecretsClient {
|
|
@@ -332,8 +338,8 @@ export declare class SecretsClient {
|
|
|
332
338
|
list(): Promise<readonly SecretRecord[]>;
|
|
333
339
|
/** Metadata for one workspace secret by name. Never returns the value. */
|
|
334
340
|
get(name: string): Promise<SecretRecord>;
|
|
335
|
-
/** Audited value read — the
|
|
336
|
-
|
|
341
|
+
/** Audited value read — the preferred path that returns a workspace secret value. */
|
|
342
|
+
get_value(name: string): Promise<SecretReveal>;
|
|
337
343
|
/** Replace the value of an existing workspace secret; bumps its version. */
|
|
338
344
|
rotate(args: {
|
|
339
345
|
readonly name: string;
|
package/dist/client.js
CHANGED
|
@@ -6,6 +6,7 @@ import { McpServer } from "./mcp-server.js";
|
|
|
6
6
|
import { splitProxyEndpoints } from "./proxy-endpoint.js";
|
|
7
7
|
import { splitSecretEnv } from "./secret.js";
|
|
8
8
|
import { Skill } from "./skill.js";
|
|
9
|
+
import { Tool } from "./tool.js";
|
|
9
10
|
/**
|
|
10
11
|
* Workspace skill admin operations exposed under `client.skills`.
|
|
11
12
|
*
|
|
@@ -136,11 +137,11 @@ export class FilesClient {
|
|
|
136
137
|
* Lifecycle parity with assets/skills: a `Secret.value(...)` is per-run and
|
|
137
138
|
* gone at terminal; `set` (or promoting an ephemeral via `secret.upload`)
|
|
138
139
|
* persists a named, searchable workspace secret you can `get` (metadata),
|
|
139
|
-
* `
|
|
140
|
+
* `get_value` (audited value), `rotate`, `list`, and `delete`. The identity is the
|
|
140
141
|
* `name`; the value rotates under that stable name.
|
|
141
142
|
*
|
|
142
143
|
* Values are write-only: `set`/`rotate` send the value in the request BODY (never
|
|
143
|
-
* the URL); `get`/`list` return metadata only; `
|
|
144
|
+
* the URL); `get`/`list` return metadata only; `get_value` is the explicit audited
|
|
144
145
|
* value read.
|
|
145
146
|
*/
|
|
146
147
|
export class SecretsClient {
|
|
@@ -160,9 +161,9 @@ export class SecretsClient {
|
|
|
160
161
|
get(name) {
|
|
161
162
|
return operations.getSecret(this.#http, name);
|
|
162
163
|
}
|
|
163
|
-
/** Audited value read — the
|
|
164
|
-
|
|
165
|
-
return operations.
|
|
164
|
+
/** Audited value read — the preferred path that returns a workspace secret value. */
|
|
165
|
+
get_value(name) {
|
|
166
|
+
return operations.getSecretValue(this.#http, name);
|
|
166
167
|
}
|
|
167
168
|
/** Replace the value of an existing workspace secret; bumps its version. */
|
|
168
169
|
rotate(args) {
|
|
@@ -360,20 +361,23 @@ export class AgentExecutor {
|
|
|
360
361
|
throw new AexError("RUNTIME_UNSUPPORTED", `AgentExecutor.submit: runtime must be one of: ${RUNTIME_KINDS.join(", ")} ` +
|
|
361
362
|
`(got ${JSON.stringify(options.runtime)})`);
|
|
362
363
|
}
|
|
363
|
-
// Walk Skill / AgentsMd / File instances. Inline drafts are eagerly
|
|
364
|
+
// Walk Skill / Tool / AgentsMd / File instances. Inline drafts are eagerly
|
|
364
365
|
// uploaded to the content-addressable asset store here (before POST /runs)
|
|
365
366
|
// and referenced as plain `kind:"asset"` refs. Already-materialized asset
|
|
366
367
|
// refs pass through unchanged.
|
|
367
368
|
const uploader = (args) => this._uploadAsset(args);
|
|
368
369
|
const preparedSkills = await prepareSkills(options.skills ?? [], uploader);
|
|
370
|
+
const preparedTools = await prepareTools(options.tools ?? [], uploader);
|
|
369
371
|
const preparedAgentsMd = await prepareAgentsMd(options.agentsMd ?? [], uploader);
|
|
370
372
|
const preparedFiles = await prepareFiles(options.files ?? [], uploader);
|
|
371
373
|
const { submissionMcpServers, mergedMcpSecrets } = mergeMcpServers(options.mcpServers ?? [], options.secrets.mcpServers ?? []);
|
|
374
|
+
const outputCapture = outputsForWire(options.outputs);
|
|
372
375
|
const submission = {
|
|
373
376
|
model: options.model,
|
|
374
377
|
...(options.system ? { system: options.system } : {}),
|
|
375
378
|
prompt,
|
|
376
379
|
skills: preparedSkills,
|
|
380
|
+
tools: preparedTools,
|
|
377
381
|
agentsMd: preparedAgentsMd,
|
|
378
382
|
files: preparedFiles,
|
|
379
383
|
// submissionMcpServers may contain workspace refs of the shape
|
|
@@ -393,10 +397,7 @@ export class AgentExecutor {
|
|
|
393
397
|
? { environment: options.environment }
|
|
394
398
|
: {}),
|
|
395
399
|
...(options.metadata ? { metadata: options.metadata } : {}),
|
|
396
|
-
...(
|
|
397
|
-
((options.outputs.allowedDirs?.length ?? 0) > 0 || (options.outputs.deniedDirs?.length ?? 0) > 0)
|
|
398
|
-
? { outputs: options.outputs }
|
|
399
|
-
: {}),
|
|
400
|
+
...(outputCapture ? { outputs: outputCapture } : {}),
|
|
400
401
|
// Pass-through `builtins` verbatim — including an empty array,
|
|
401
402
|
// which is the "disable all builtins" signal. Distinguish from
|
|
402
403
|
// omitted (default applies) via `!== undefined`.
|
|
@@ -731,6 +732,28 @@ function postHookForWire(input) {
|
|
|
731
732
|
}
|
|
732
733
|
return input;
|
|
733
734
|
}
|
|
735
|
+
function outputsForWire(outputs) {
|
|
736
|
+
if (outputs === undefined) {
|
|
737
|
+
return undefined;
|
|
738
|
+
}
|
|
739
|
+
const allowedDirs = outputs.allowedDirs?.filter((dir) => dir.length > 0);
|
|
740
|
+
const deniedDirs = outputs.deniedDirs?.filter((dir) => dir.length > 0);
|
|
741
|
+
const hasNumericOverride = outputs.captureTimeoutMs !== undefined ||
|
|
742
|
+
outputs.maxFileBytes !== undefined ||
|
|
743
|
+
outputs.maxTotalBytes !== undefined ||
|
|
744
|
+
outputs.maxFiles !== undefined;
|
|
745
|
+
if ((allowedDirs?.length ?? 0) === 0 && (deniedDirs?.length ?? 0) === 0 && !hasNumericOverride) {
|
|
746
|
+
return undefined;
|
|
747
|
+
}
|
|
748
|
+
return {
|
|
749
|
+
...(allowedDirs && allowedDirs.length > 0 ? { allowedDirs } : {}),
|
|
750
|
+
...(deniedDirs && deniedDirs.length > 0 ? { deniedDirs } : {}),
|
|
751
|
+
...(outputs.captureTimeoutMs !== undefined ? { captureTimeoutMs: outputs.captureTimeoutMs } : {}),
|
|
752
|
+
...(outputs.maxFileBytes !== undefined ? { maxFileBytes: outputs.maxFileBytes } : {}),
|
|
753
|
+
...(outputs.maxTotalBytes !== undefined ? { maxTotalBytes: outputs.maxTotalBytes } : {}),
|
|
754
|
+
...(outputs.maxFiles !== undefined ? { maxFiles: outputs.maxFiles } : {})
|
|
755
|
+
};
|
|
756
|
+
}
|
|
734
757
|
/** Walk Skill[], eagerly upload drafts as assets, and return plain asset refs. */
|
|
735
758
|
async function prepareSkills(skills, uploader) {
|
|
736
759
|
const refs = [];
|
|
@@ -765,6 +788,34 @@ async function prepareSkills(skills, uploader) {
|
|
|
765
788
|
}
|
|
766
789
|
return refs;
|
|
767
790
|
}
|
|
791
|
+
async function prepareTools(tools, uploader) {
|
|
792
|
+
const refs = [];
|
|
793
|
+
for (let i = 0; i < tools.length; i++) {
|
|
794
|
+
const entry = tools[i];
|
|
795
|
+
if (!(entry instanceof Tool)) {
|
|
796
|
+
throw new Error(`AgentExecutor.submit: tools[${i}] must be a Tool instance`);
|
|
797
|
+
}
|
|
798
|
+
if (entry.isConsumed) {
|
|
799
|
+
throw new Error(`AgentExecutor.submit: tools[${i}] was already consumed by a prior submit`);
|
|
800
|
+
}
|
|
801
|
+
const ref = entry.ref;
|
|
802
|
+
if (ref.kind === "draft") {
|
|
803
|
+
const bundle = entry._takeDraftBundle();
|
|
804
|
+
if (!bundle) {
|
|
805
|
+
throw new Error(`AgentExecutor.submit: tools[${i}] is draft but has no bytes`);
|
|
806
|
+
}
|
|
807
|
+
const uploaded = await uploader({
|
|
808
|
+
bytes: bundle.bytes,
|
|
809
|
+
hash: bundle.contentHash,
|
|
810
|
+
contentType: "application/zip"
|
|
811
|
+
});
|
|
812
|
+
refs.push({ ...bundle.ref, assetId: uploaded.assetId });
|
|
813
|
+
continue;
|
|
814
|
+
}
|
|
815
|
+
refs.push(ref);
|
|
816
|
+
}
|
|
817
|
+
return refs;
|
|
818
|
+
}
|
|
768
819
|
/** Walk AgentsMd[], eagerly upload drafts as assets, and return plain asset refs. */
|
|
769
820
|
async function prepareAgentsMd(agentsMds, uploader) {
|
|
770
821
|
const refs = [];
|