@aexhq/sdk 0.25.0 → 0.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/_contracts/index.d.ts +0 -1
- package/dist/_contracts/index.js +0 -1
- package/dist/_contracts/operations.d.ts +11 -3
- package/dist/_contracts/operations.js +216 -6
- package/dist/_contracts/provider-support.d.ts +2 -13
- package/dist/_contracts/provider-support.js +2 -14
- package/dist/_contracts/proxy-protocol.d.ts +4 -2
- package/dist/_contracts/proxy-protocol.js +10 -3
- package/dist/_contracts/run-config.d.ts +4 -4
- package/dist/_contracts/run-config.js +4 -5
- package/dist/_contracts/run-cost.d.ts +3 -11
- package/dist/_contracts/run-cost.js +2 -57
- package/dist/_contracts/run-custody.d.ts +1 -52
- package/dist/_contracts/run-custody.js +3 -87
- package/dist/_contracts/run-retention.d.ts +1 -5
- package/dist/_contracts/run-retention.js +2 -14
- package/dist/_contracts/run-unit.d.ts +2 -2
- package/dist/_contracts/runtime-security-profile.js +1 -1
- package/dist/_contracts/runtime-types.d.ts +36 -10
- package/dist/_contracts/side-effect-audit.d.ts +4 -5
- package/dist/_contracts/side-effect-audit.js +1 -4
- package/dist/_contracts/status.d.ts +3 -4
- package/dist/_contracts/status.js +3 -8
- package/dist/_contracts/submission.d.ts +66 -41
- package/dist/_contracts/submission.js +78 -29
- package/dist/cli.mjs +226 -46
- package/dist/cli.mjs.sha256 +1 -1
- package/dist/client.d.ts +19 -17
- package/dist/client.js +22 -9
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/concepts/agent-tools.md +26 -21
- package/docs/credentials.md +5 -3
- package/docs/events.md +12 -0
- package/docs/limits.md +10 -1
- package/docs/outputs.md +58 -0
- package/docs/provider-runtime-capabilities.md +1 -1
- package/docs/public-surface.json +1 -1
- package/docs/release.md +1 -1
- package/docs/run-config.md +1 -1
- package/docs/skills.md +3 -3
- package/docs/vision-skills.md +11 -13
- package/package.json +2 -2
- package/dist/_contracts/managed-key.d.ts +0 -101
- package/dist/_contracts/managed-key.js +0 -181
package/dist/cli.mjs
CHANGED
|
@@ -25,11 +25,16 @@ var PROXY_RESPONSE_MODES = ["status_only", "headers_only", "full"];
|
|
|
25
25
|
var PROXY_ENDPOINT_DEFAULTS = {
|
|
26
26
|
allowHeaders: [],
|
|
27
27
|
responseMode: "headers_only",
|
|
28
|
-
|
|
28
|
+
// 10 MiB. The body is buffered into the Worker to enforce this cap, while the
|
|
29
|
+
// launch default fits practical multimodal/tool POSTs without every endpoint
|
|
30
|
+
// needing an override.
|
|
31
|
+
maxRequestBytes: 10 * 1024 * 1024,
|
|
29
32
|
// Unlimited (0). The request body is buffered to enforce its cap, so that
|
|
30
33
|
// stays finite; the response is streamed, so it does not need one.
|
|
31
34
|
maxResponseBytes: 0,
|
|
32
|
-
|
|
35
|
+
// 5 minutes. Long-running upstream tool/model calls should not fail under a
|
|
36
|
+
// development-oriented 10s ceiling; endpoints can still set a smaller value.
|
|
37
|
+
timeoutMs: 5 * 60 * 1e3
|
|
33
38
|
};
|
|
34
39
|
|
|
35
40
|
// ../contracts/dist/provider-support.js
|
|
@@ -69,7 +74,6 @@ var DEEPSEEK_MANAGED_EVIDENCE = [
|
|
|
69
74
|
var PROVIDER_PUBLIC_SUPPORT = {
|
|
70
75
|
anthropic: {
|
|
71
76
|
displayName: "Anthropic",
|
|
72
|
-
status: "supported",
|
|
73
77
|
docsAnchor: "anthropic",
|
|
74
78
|
docs: COMMON_DOCS,
|
|
75
79
|
evidence: [...COMMON_EVIDENCE, ...ANTHROPIC_MANAGED_EVIDENCE],
|
|
@@ -79,7 +83,6 @@ var PROVIDER_PUBLIC_SUPPORT = {
|
|
|
79
83
|
},
|
|
80
84
|
deepseek: {
|
|
81
85
|
displayName: "DeepSeek",
|
|
82
|
-
status: "supported",
|
|
83
86
|
docsAnchor: "deepseek",
|
|
84
87
|
docs: COMMON_DOCS,
|
|
85
88
|
evidence: [...COMMON_EVIDENCE, ...DEEPSEEK_MANAGED_EVIDENCE],
|
|
@@ -89,7 +92,6 @@ var PROVIDER_PUBLIC_SUPPORT = {
|
|
|
89
92
|
},
|
|
90
93
|
openai: {
|
|
91
94
|
displayName: "OpenAI",
|
|
92
|
-
status: "supported",
|
|
93
95
|
docsAnchor: "openai",
|
|
94
96
|
docs: COMMON_DOCS,
|
|
95
97
|
evidence: COMMON_EVIDENCE,
|
|
@@ -99,7 +101,6 @@ var PROVIDER_PUBLIC_SUPPORT = {
|
|
|
99
101
|
},
|
|
100
102
|
gemini: {
|
|
101
103
|
displayName: "Gemini",
|
|
102
|
-
status: "supported",
|
|
103
104
|
docsAnchor: "gemini",
|
|
104
105
|
docs: COMMON_DOCS,
|
|
105
106
|
evidence: COMMON_EVIDENCE,
|
|
@@ -109,7 +110,6 @@ var PROVIDER_PUBLIC_SUPPORT = {
|
|
|
109
110
|
},
|
|
110
111
|
mistral: {
|
|
111
112
|
displayName: "Mistral",
|
|
112
|
-
status: "supported",
|
|
113
113
|
docsAnchor: "mistral",
|
|
114
114
|
docs: COMMON_DOCS,
|
|
115
115
|
evidence: COMMON_EVIDENCE,
|
|
@@ -119,7 +119,6 @@ var PROVIDER_PUBLIC_SUPPORT = {
|
|
|
119
119
|
},
|
|
120
120
|
openrouter: {
|
|
121
121
|
displayName: "OpenRouter",
|
|
122
|
-
status: "supported",
|
|
123
122
|
docsAnchor: "openrouter",
|
|
124
123
|
docs: COMMON_DOCS,
|
|
125
124
|
evidence: COMMON_EVIDENCE,
|
|
@@ -130,7 +129,6 @@ var PROVIDER_PUBLIC_SUPPORT = {
|
|
|
130
129
|
// Doubao (ByteDance) via the official Ark API — international BytePlus gateway.
|
|
131
130
|
doubao: {
|
|
132
131
|
displayName: "Doubao",
|
|
133
|
-
status: "supported",
|
|
134
132
|
docsAnchor: "doubao",
|
|
135
133
|
docs: COMMON_DOCS,
|
|
136
134
|
evidence: COMMON_EVIDENCE,
|
|
@@ -141,7 +139,6 @@ var PROVIDER_PUBLIC_SUPPORT = {
|
|
|
141
139
|
// Doubao (ByteDance) via the official Ark API — China Volcengine gateway.
|
|
142
140
|
"doubao-cn": {
|
|
143
141
|
displayName: "Doubao (China)",
|
|
144
|
-
status: "supported",
|
|
145
142
|
docsAnchor: "doubao-cn",
|
|
146
143
|
docs: COMMON_DOCS,
|
|
147
144
|
evidence: COMMON_EVIDENCE,
|
|
@@ -215,9 +212,7 @@ var TERMINAL_RUN_STATUSES = [
|
|
|
215
212
|
"failed",
|
|
216
213
|
"timed_out",
|
|
217
214
|
"cancelled",
|
|
218
|
-
"cleanup_failed"
|
|
219
|
-
"pending_delete",
|
|
220
|
-
"deleted"
|
|
215
|
+
"cleanup_failed"
|
|
221
216
|
];
|
|
222
217
|
var terminalRunStatuses = new Set(TERMINAL_RUN_STATUSES);
|
|
223
218
|
|
|
@@ -755,7 +750,7 @@ var RUNTIME_SECURITY_PROFILE_CONFIG = Object.freeze({
|
|
|
755
750
|
}),
|
|
756
751
|
standard: Object.freeze({
|
|
757
752
|
name: "standard",
|
|
758
|
-
defaultNetworkingMode: "
|
|
753
|
+
defaultNetworkingMode: "open",
|
|
759
754
|
allowOpenNetworking: true,
|
|
760
755
|
allowRuntimePackages: true,
|
|
761
756
|
allowCustomerEnvVars: true,
|
|
@@ -773,27 +768,6 @@ var RUNTIME_SECURITY_PROFILE_CONFIG = Object.freeze({
|
|
|
773
768
|
})
|
|
774
769
|
});
|
|
775
770
|
|
|
776
|
-
// ../contracts/dist/managed-key.js
|
|
777
|
-
var MANAGED_KEY_POLICY_SCHEMA_VERSION = 1;
|
|
778
|
-
var BLOCKED_MANAGED_KEY_FEATURE_POLICY_V1 = Object.freeze({
|
|
779
|
-
files: "disabled",
|
|
780
|
-
packages: "disabled",
|
|
781
|
-
builtins: "disabled",
|
|
782
|
-
mcpServers: "disabled",
|
|
783
|
-
proxyEndpoints: "disabled",
|
|
784
|
-
openNetworking: "disabled"
|
|
785
|
-
});
|
|
786
|
-
var BLOCKED_MANAGED_KEY_POLICY_V1 = Object.freeze({
|
|
787
|
-
schemaVersion: MANAGED_KEY_POLICY_SCHEMA_VERSION,
|
|
788
|
-
credentialMode: "managed",
|
|
789
|
-
launchStage: "blocked",
|
|
790
|
-
privateImplementationAvailable: false,
|
|
791
|
-
billingRequired: true,
|
|
792
|
-
providers: Object.freeze([]),
|
|
793
|
-
runtimes: Object.freeze([]),
|
|
794
|
-
features: BLOCKED_MANAGED_KEY_FEATURE_POLICY_V1
|
|
795
|
-
});
|
|
796
|
-
|
|
797
771
|
// ../contracts/dist/submission.js
|
|
798
772
|
var RUN_PROVIDERS = [
|
|
799
773
|
"anthropic",
|
|
@@ -897,13 +871,9 @@ var forbiddenStringPatterns = Object.freeze([
|
|
|
897
871
|
{
|
|
898
872
|
reason: "private_resource_handle",
|
|
899
873
|
// `<keyword><sep><id>` opaque handles (`session_a1B2c3D4e5`, `file_9f8e7d…`).
|
|
900
|
-
// The keyword set overlaps ordinary
|
|
901
|
-
//
|
|
902
|
-
//
|
|
903
|
-
// `session_handoff_contract`, `agent-judgment` — read straight out of a
|
|
904
|
-
// skill-pack doc in tool-result text). The `accept` predicate keeps the shape
|
|
905
|
-
// but requires the id segment to look minted rather than spelled — i.e. carry
|
|
906
|
-
// a digit — so genuine handles stay flagged while dictionary-word prose does not.
|
|
874
|
+
// The keyword set overlaps ordinary prose, so require the id segment to
|
|
875
|
+
// carry a digit. That keeps genuine minted handles flagged while avoiding
|
|
876
|
+
// dictionary-word chains such as `agent_decision_failure`.
|
|
907
877
|
regex: /\b(?:machine|session|agent|file|skill|env|resource|handle|token_hash|bearer_hash)[_:-][A-Za-z0-9][A-Za-z0-9_-]{7,}\b/i,
|
|
908
878
|
accept: isMintedResourceHandle
|
|
909
879
|
},
|
|
@@ -1390,6 +1360,7 @@ function extractErrorMessage(body) {
|
|
|
1390
1360
|
var operations_exports = {};
|
|
1391
1361
|
__export(operations_exports, {
|
|
1392
1362
|
cancelRun: () => cancelRun,
|
|
1363
|
+
classifyOutput: () => classifyOutput,
|
|
1393
1364
|
createAgentsMd: () => createAgentsMd,
|
|
1394
1365
|
createFile: () => createFile,
|
|
1395
1366
|
createOutputLink: () => createOutputLink,
|
|
@@ -1407,6 +1378,10 @@ __export(operations_exports, {
|
|
|
1407
1378
|
downloadMetadata: () => downloadMetadata,
|
|
1408
1379
|
downloadOutput: () => downloadOutput,
|
|
1409
1380
|
downloadOutputs: () => downloadOutputs,
|
|
1381
|
+
eventArchiveLink: () => eventArchiveLink,
|
|
1382
|
+
filterOutputs: () => filterOutputs,
|
|
1383
|
+
findOutput: () => findOutput,
|
|
1384
|
+
findOutputs: () => findOutputs,
|
|
1410
1385
|
findSkillByHash: () => findSkillByHash,
|
|
1411
1386
|
findSkillByName: () => findSkillByName,
|
|
1412
1387
|
getAgentsMd: () => getAgentsMd,
|
|
@@ -1423,6 +1398,8 @@ __export(operations_exports, {
|
|
|
1423
1398
|
listRunEvents: () => listRunEvents,
|
|
1424
1399
|
listSecrets: () => listSecrets,
|
|
1425
1400
|
listSkills: () => listSkills,
|
|
1401
|
+
normalizeOutputLinkExpiresIn: () => normalizeOutputLinkExpiresIn,
|
|
1402
|
+
outputLink: () => outputLink,
|
|
1426
1403
|
resolveOutputFileSelector: () => resolveOutputFileSelector,
|
|
1427
1404
|
rotateSecret: () => rotateSecret,
|
|
1428
1405
|
submitRun: () => submitRun,
|
|
@@ -2173,12 +2150,50 @@ async function listRunEvents(http, runId) {
|
|
|
2173
2150
|
async function getCoordinatorTicket(http, runId) {
|
|
2174
2151
|
return http.request(`/api/runs/${encodeURIComponent(runId)}/events/ticket`, { method: "POST" });
|
|
2175
2152
|
}
|
|
2176
|
-
async function listOutputs(http, runId) {
|
|
2153
|
+
async function listOutputs(http, runId, query) {
|
|
2177
2154
|
const result = await http.request(`/api/runs/${encodeURIComponent(runId)}/outputs`);
|
|
2178
|
-
return result.outputs;
|
|
2155
|
+
return query === void 0 ? result.outputs : filterOutputs(result.outputs, query);
|
|
2156
|
+
}
|
|
2157
|
+
async function findOutputs(http, runId, query) {
|
|
2158
|
+
return listOutputs(http, runId, query);
|
|
2159
|
+
}
|
|
2160
|
+
async function findOutput(http, runId, query) {
|
|
2161
|
+
const matches = await findOutputs(http, runId, query);
|
|
2162
|
+
if (matches.length === 0)
|
|
2163
|
+
return null;
|
|
2164
|
+
if (matches.length === 1)
|
|
2165
|
+
return matches[0];
|
|
2166
|
+
throw new RunStateError("findOutput: output query matched multiple files", {
|
|
2167
|
+
runId,
|
|
2168
|
+
matches: matches.map((output) => output.filename ?? output.id)
|
|
2169
|
+
});
|
|
2170
|
+
}
|
|
2171
|
+
async function outputLink(http, runId, selectorOrQuery, options) {
|
|
2172
|
+
const output = await resolveOutputLinkTarget(http, runId, selectorOrQuery);
|
|
2173
|
+
const expiresInSeconds = normalizeOutputLinkExpiresIn(options?.expiresIn);
|
|
2174
|
+
const result = await http.request(`/api/runs/${encodeURIComponent(runId)}/outputs/${encodeURIComponent(output.id)}/link`, {
|
|
2175
|
+
method: "POST",
|
|
2176
|
+
body: JSON.stringify({ expiresInSeconds })
|
|
2177
|
+
});
|
|
2178
|
+
return {
|
|
2179
|
+
...result,
|
|
2180
|
+
expiresInSeconds: result.expiresInSeconds ?? expiresInSeconds,
|
|
2181
|
+
output: result.output ?? output
|
|
2182
|
+
};
|
|
2179
2183
|
}
|
|
2180
|
-
async function createOutputLink(http, runId,
|
|
2181
|
-
return http
|
|
2184
|
+
async function createOutputLink(http, runId, selectorOrQuery, options) {
|
|
2185
|
+
return outputLink(http, runId, selectorOrQuery, options);
|
|
2186
|
+
}
|
|
2187
|
+
async function eventArchiveLink(http, runId, options) {
|
|
2188
|
+
const expiresInSeconds = normalizeOutputLinkExpiresIn(options?.expiresIn);
|
|
2189
|
+
const result = await http.request(`/api/runs/${encodeURIComponent(runId)}/events/link`, {
|
|
2190
|
+
method: "POST",
|
|
2191
|
+
body: JSON.stringify({ expiresInSeconds })
|
|
2192
|
+
});
|
|
2193
|
+
return {
|
|
2194
|
+
...result,
|
|
2195
|
+
expiresInSeconds: result.expiresInSeconds ?? expiresInSeconds
|
|
2196
|
+
};
|
|
2182
2197
|
}
|
|
2183
2198
|
function resolveOutputFileSelector(outputs, selector, runId) {
|
|
2184
2199
|
if (isPathSelector(selector)) {
|
|
@@ -2263,6 +2278,171 @@ function isPathSelector(selector) {
|
|
|
2263
2278
|
function normalizeOutputLookupPath(path) {
|
|
2264
2279
|
return path.replace(/\\/g, "/").replace(/^\/+/, "");
|
|
2265
2280
|
}
|
|
2281
|
+
function filterOutputs(outputs, query) {
|
|
2282
|
+
return outputs.filter((output) => outputMatchesQuery(output, query));
|
|
2283
|
+
}
|
|
2284
|
+
function classifyOutput(output) {
|
|
2285
|
+
const contentType = normalizeContentType(output.contentType);
|
|
2286
|
+
if (contentType) {
|
|
2287
|
+
if (contentType === "application/json" || contentType.endsWith("+json") || contentType.includes("json")) {
|
|
2288
|
+
return "json";
|
|
2289
|
+
}
|
|
2290
|
+
if (contentType.startsWith("text/"))
|
|
2291
|
+
return "text";
|
|
2292
|
+
if (contentType.startsWith("image/"))
|
|
2293
|
+
return "image";
|
|
2294
|
+
if (contentType.startsWith("audio/"))
|
|
2295
|
+
return "audio";
|
|
2296
|
+
if (contentType.startsWith("video/"))
|
|
2297
|
+
return "video";
|
|
2298
|
+
if (contentType === "application/pdf")
|
|
2299
|
+
return "pdf";
|
|
2300
|
+
if (contentType === "application/zip" || contentType === "application/gzip" || contentType === "application/x-gzip" || contentType === "application/x-tar" || contentType === "application/x-7z-compressed" || contentType === "application/vnd.rar" || contentType === "application/zstd") {
|
|
2301
|
+
return "archive";
|
|
2302
|
+
}
|
|
2303
|
+
if (contentType === "application/octet-stream")
|
|
2304
|
+
return "binary";
|
|
2305
|
+
return "unknown";
|
|
2306
|
+
}
|
|
2307
|
+
const extension = extensionOf(output.filename);
|
|
2308
|
+
if (!extension)
|
|
2309
|
+
return "unknown";
|
|
2310
|
+
if (["json", "jsonl", "ndjson"].includes(extension))
|
|
2311
|
+
return "json";
|
|
2312
|
+
if (["txt", "log", "md", "markdown", "csv", "tsv", "xml", "html", "htm", "yaml", "yml"].includes(extension)) {
|
|
2313
|
+
return "text";
|
|
2314
|
+
}
|
|
2315
|
+
if (["png", "jpg", "jpeg", "gif", "webp", "avif", "bmp", "tif", "tiff", "svg"].includes(extension)) {
|
|
2316
|
+
return "image";
|
|
2317
|
+
}
|
|
2318
|
+
if (["mp3", "wav", "flac", "m4a", "aac", "ogg", "oga", "opus"].includes(extension))
|
|
2319
|
+
return "audio";
|
|
2320
|
+
if (["mp4", "mov", "m4v", "webm", "mkv", "avi"].includes(extension))
|
|
2321
|
+
return "video";
|
|
2322
|
+
if (extension === "pdf")
|
|
2323
|
+
return "pdf";
|
|
2324
|
+
if (["zip", "tar", "tgz", "gz", "bz2", "xz", "7z", "rar", "zst"].includes(extension))
|
|
2325
|
+
return "archive";
|
|
2326
|
+
if (["bin", "exe", "dll", "so", "dylib", "dmg", "iso"].includes(extension))
|
|
2327
|
+
return "binary";
|
|
2328
|
+
return "unknown";
|
|
2329
|
+
}
|
|
2330
|
+
function normalizeOutputLinkExpiresIn(input = "1h") {
|
|
2331
|
+
if (typeof input === "number") {
|
|
2332
|
+
if (!Number.isFinite(input) || input <= 0) {
|
|
2333
|
+
throw new RunStateError("outputLink: expiresIn must be a positive number of seconds", {
|
|
2334
|
+
expiresIn: input
|
|
2335
|
+
});
|
|
2336
|
+
}
|
|
2337
|
+
return Math.floor(input);
|
|
2338
|
+
}
|
|
2339
|
+
if (input === "15m")
|
|
2340
|
+
return 15 * 60;
|
|
2341
|
+
if (input === "1h")
|
|
2342
|
+
return 60 * 60;
|
|
2343
|
+
if (input === "1d")
|
|
2344
|
+
return 24 * 60 * 60;
|
|
2345
|
+
throw new RunStateError('outputLink: expiresIn must be seconds, "15m", "1h", or "1d"', {
|
|
2346
|
+
expiresIn: input
|
|
2347
|
+
});
|
|
2348
|
+
}
|
|
2349
|
+
async function resolveOutputLinkTarget(http, runId, selectorOrQuery) {
|
|
2350
|
+
if (typeof selectorOrQuery === "string") {
|
|
2351
|
+
if (selectorOrQuery.length === 0) {
|
|
2352
|
+
throw new RunStateError("outputLink: selector must include an output id or query", { runId });
|
|
2353
|
+
}
|
|
2354
|
+
return { id: selectorOrQuery };
|
|
2355
|
+
}
|
|
2356
|
+
if (hasOutputId(selectorOrQuery)) {
|
|
2357
|
+
if (selectorOrQuery.id.length === 0) {
|
|
2358
|
+
throw new RunStateError("outputLink: selector must include an output id or query", { runId });
|
|
2359
|
+
}
|
|
2360
|
+
return selectorOrQuery;
|
|
2361
|
+
}
|
|
2362
|
+
if (isPathSelector(selectorOrQuery) && selectorOrQuery.match === "suffix") {
|
|
2363
|
+
return resolveOutputFileSelector(await listOutputs(http, runId), selectorOrQuery, runId);
|
|
2364
|
+
}
|
|
2365
|
+
const match = await findOutput(http, runId, selectorOrQuery);
|
|
2366
|
+
if (match)
|
|
2367
|
+
return match;
|
|
2368
|
+
throw new RunStateError("outputLink: output query matched no files", { runId });
|
|
2369
|
+
}
|
|
2370
|
+
function outputMatchesQuery(output, query) {
|
|
2371
|
+
const normalizedPath = typeof output.filename === "string" ? normalizeOutputQueryPath(output.filename) : "";
|
|
2372
|
+
if (query.path !== void 0 && normalizedPath !== normalizeOutputQueryPath(query.path)) {
|
|
2373
|
+
return false;
|
|
2374
|
+
}
|
|
2375
|
+
if (query.filename !== void 0) {
|
|
2376
|
+
const basename2 = basenameOf(normalizedPath);
|
|
2377
|
+
if (typeof query.filename === "string") {
|
|
2378
|
+
if (basename2 !== query.filename)
|
|
2379
|
+
return false;
|
|
2380
|
+
} else {
|
|
2381
|
+
query.filename.lastIndex = 0;
|
|
2382
|
+
if (!query.filename.test(basename2))
|
|
2383
|
+
return false;
|
|
2384
|
+
}
|
|
2385
|
+
}
|
|
2386
|
+
if (query.dir !== void 0 && !directoryMatches(normalizedPath, query.dir, query.recursive ?? true)) {
|
|
2387
|
+
return false;
|
|
2388
|
+
}
|
|
2389
|
+
if (query.extension !== void 0 && extensionOf(normalizedPath) !== normalizeExtension(query.extension)) {
|
|
2390
|
+
return false;
|
|
2391
|
+
}
|
|
2392
|
+
if (query.contentType !== void 0 && !contentTypeMatches(output.contentType, query.contentType)) {
|
|
2393
|
+
return false;
|
|
2394
|
+
}
|
|
2395
|
+
if (query.type !== void 0 && classifyOutput(output) !== query.type) {
|
|
2396
|
+
return false;
|
|
2397
|
+
}
|
|
2398
|
+
return true;
|
|
2399
|
+
}
|
|
2400
|
+
function hasOutputId(value) {
|
|
2401
|
+
return Boolean(value && typeof value === "object" && "id" in value && typeof value.id === "string");
|
|
2402
|
+
}
|
|
2403
|
+
function normalizeOutputQueryPath(path) {
|
|
2404
|
+
let normalized = path.replace(/\\/g, "/").replace(/^\/+/, "");
|
|
2405
|
+
while (normalized === "outputs" || normalized.startsWith("outputs/")) {
|
|
2406
|
+
normalized = normalized === "outputs" ? "" : normalized.slice("outputs/".length);
|
|
2407
|
+
}
|
|
2408
|
+
return normalized.replace(/\/+$/, "");
|
|
2409
|
+
}
|
|
2410
|
+
function basenameOf(path) {
|
|
2411
|
+
return path.split("/").filter(Boolean).pop() ?? "";
|
|
2412
|
+
}
|
|
2413
|
+
function directoryMatches(path, dir, recursive) {
|
|
2414
|
+
const normalizedDir = normalizeOutputQueryPath(dir);
|
|
2415
|
+
if (normalizedDir.length === 0)
|
|
2416
|
+
return true;
|
|
2417
|
+
const prefix = `${normalizedDir}/`;
|
|
2418
|
+
if (!path.startsWith(prefix))
|
|
2419
|
+
return false;
|
|
2420
|
+
const remainder = path.slice(prefix.length);
|
|
2421
|
+
return remainder.length > 0 && (recursive || !remainder.includes("/"));
|
|
2422
|
+
}
|
|
2423
|
+
function normalizeExtension(extension) {
|
|
2424
|
+
return extension.replace(/^\.+/, "").toLowerCase();
|
|
2425
|
+
}
|
|
2426
|
+
function extensionOf(path) {
|
|
2427
|
+
if (!path)
|
|
2428
|
+
return "";
|
|
2429
|
+
const basename2 = basenameOf(normalizeOutputQueryPath(path));
|
|
2430
|
+
const index = basename2.lastIndexOf(".");
|
|
2431
|
+
return index > 0 && index < basename2.length - 1 ? basename2.slice(index + 1).toLowerCase() : "";
|
|
2432
|
+
}
|
|
2433
|
+
function normalizeContentType(contentType) {
|
|
2434
|
+
return (contentType ?? "").split(";")[0].trim().toLowerCase();
|
|
2435
|
+
}
|
|
2436
|
+
function contentTypeMatches(actual, expected) {
|
|
2437
|
+
const normalizedActual = normalizeContentType(actual);
|
|
2438
|
+
const normalizedExpected = normalizeContentType(expected);
|
|
2439
|
+
if (!normalizedActual || !normalizedExpected)
|
|
2440
|
+
return false;
|
|
2441
|
+
if (normalizedExpected.endsWith("/*")) {
|
|
2442
|
+
return normalizedActual.startsWith(normalizedExpected.slice(0, -1));
|
|
2443
|
+
}
|
|
2444
|
+
return normalizedActual === normalizedExpected;
|
|
2445
|
+
}
|
|
2266
2446
|
async function download(http, runId) {
|
|
2267
2447
|
const [run, events, outputs] = await Promise.all([
|
|
2268
2448
|
getRun(http, runId),
|
package/dist/cli.mjs.sha256
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1b28b0b2c5ae5867dad0581510c232cf2cf956226db8efc20e66d97549a0d3b0 cli.mjs
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpClient, SecretString, type AexEvent, type AgentsMdRecord, type CredentialMode, type DebugSink, type FetchLike, type FileRecord, type Output, type OutputMode, type PlatformEnvironmentInput, type PlatformSubmission, type PlatformInlineSecrets, type PlatformProxyEndpoint, type PlatformProxyEndpointAuth, type PlatformPostHookInput, type Run, type RunModel, type RunEvent, type RunProvider, type SecretRecord, type SecretReveal, type RunUnit, type Builtin, type RuntimeSize, type RuntimeKind, type
|
|
1
|
+
import { HttpClient, SecretString, type AexEvent, type AgentsMdRecord, type CredentialMode, type DebugSink, type FetchLike, type FileRecord, type Output, type OutputFileType, type OutputLink, type OutputLinkOptions, type OutputQuery, type OutputMode, type PlatformEnvironmentInput, type PlatformSubmission, type PlatformInlineSecrets, type PlatformProxyEndpoint, type PlatformProxyEndpointAuth, type PlatformPostHookInput, type Run, type RunModel, type RunEvent, type RunProvider, type SecretRecord, type SecretReveal, type RunUnit, type Builtin, type RuntimeSize, type RuntimeKind, type Skill as SkillRecord, type WhoAmI } from "./_contracts/index.js";
|
|
2
2
|
import { AgentsMd } from "./agents-md.js";
|
|
3
3
|
import { type UploadedAsset } from "./asset-upload.js";
|
|
4
4
|
import { File } from "./file.js";
|
|
@@ -51,8 +51,6 @@ export interface SubmitOptions {
|
|
|
51
51
|
/**
|
|
52
52
|
* Credential source for upstream provider access. Omitted defaults to
|
|
53
53
|
* `"byok"`, which requires `secrets.apiKey`.
|
|
54
|
-
* `"managed"` is reserved for paid managed-key mode and currently fails
|
|
55
|
-
* closed until the hosted private implementation is wired.
|
|
56
54
|
*/
|
|
57
55
|
readonly credentialMode?: CredentialMode;
|
|
58
56
|
/**
|
|
@@ -139,19 +137,17 @@ export interface SubmitOptions {
|
|
|
139
137
|
readonly maxFiles?: number;
|
|
140
138
|
};
|
|
141
139
|
/**
|
|
142
|
-
* Override the managed runtime
|
|
140
|
+
* Override the managed runtime builtins enabled inside the runner.
|
|
143
141
|
* Each entry is one of the closed {@link Builtin} set — prefer the
|
|
144
142
|
* {@link Builtins} symbol const so a typo is a compile error.
|
|
145
143
|
*
|
|
146
|
-
* - Omitted (default): the runner enables `
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
* - Empty array: the agent runs with zero
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
* `[Builtins.DEVELOPER, Builtins.COMPUTER_CONTROLLER]` to add
|
|
154
|
-
* web fetch/scrape alongside the default shell/edit toolkit.
|
|
144
|
+
* - Omitted (default): the runner enables `DEFAULT_BUILTINS`
|
|
145
|
+
* (`web_search`, `web_fetch`, `read`, `edit`, `glob`, `grep`, `head`,
|
|
146
|
+
* `tail`).
|
|
147
|
+
* - Empty array: the agent runs with zero builtins — useful for pure-MCP
|
|
148
|
+
* setups where every tool comes from a submitted `mcpServers` entry.
|
|
149
|
+
* - Custom list: narrows or extends the surface, e.g.
|
|
150
|
+
* `[Builtins.WEB_SEARCH, Builtins.NOTEBOOK]`.
|
|
155
151
|
*
|
|
156
152
|
* Validation: each entry must be a member of {@link Builtins}, max 16
|
|
157
153
|
* entries, deduplicated server-side.
|
|
@@ -213,6 +209,7 @@ export interface OutputFileIdSelector {
|
|
|
213
209
|
readonly id: string;
|
|
214
210
|
}
|
|
215
211
|
export type OutputFileSelector = Output | OutputFileIdSelector | OutputFilePathSelector;
|
|
212
|
+
export type OutputLinkSelector = string | OutputFileSelector | OutputQuery;
|
|
216
213
|
export interface OutputDownloadOptions {
|
|
217
214
|
readonly to?: string;
|
|
218
215
|
}
|
|
@@ -505,10 +502,15 @@ export declare class AgentExecutor {
|
|
|
505
502
|
waitForRun(runId: string, options?: WaitForRunOptions): Promise<Run>;
|
|
506
503
|
/** Short alias for `waitForRun`. */
|
|
507
504
|
wait(runId: string, options?: WaitForRunOptions): Promise<Run>;
|
|
508
|
-
listOutputs(runId: string): Promise<readonly Output[]>;
|
|
505
|
+
listOutputs(runId: string, query?: OutputQuery): Promise<readonly Output[]>;
|
|
509
506
|
/** Short alias for `listOutputs`. */
|
|
510
|
-
outputs(runId: string): Promise<readonly Output[]>;
|
|
511
|
-
|
|
507
|
+
outputs(runId: string, query?: OutputQuery): Promise<readonly Output[]>;
|
|
508
|
+
findOutputs(runId: string, query: OutputQuery): Promise<readonly Output[]>;
|
|
509
|
+
findOutput(runId: string, query: OutputQuery): Promise<Output | null>;
|
|
510
|
+
outputLink(runId: string, selectorOrQuery: OutputLinkSelector, options?: OutputLinkOptions): Promise<OutputLink>;
|
|
511
|
+
createOutputLink(runId: string, selectorOrQuery: OutputLinkSelector, options?: OutputLinkOptions): Promise<OutputLink>;
|
|
512
|
+
fetchOutput(runId: string, selectorOrQuery: OutputLinkSelector, options?: OutputLinkOptions): Promise<Response>;
|
|
513
|
+
eventArchiveLink(runId: string, options?: OutputLinkOptions): Promise<OutputLink>;
|
|
512
514
|
/**
|
|
513
515
|
* Download captured deliverables. Omit `selector` to receive the full
|
|
514
516
|
* outputs namespace as a zip; pass an id, Output object, or path selector
|
|
@@ -546,4 +548,4 @@ export declare class AgentExecutor {
|
|
|
546
548
|
/** Download only the run record (the `metadata` namespace) as a zip. */
|
|
547
549
|
downloadMetadata(runId: string, options?: OutputDownloadOptions): Promise<Uint8Array>;
|
|
548
550
|
}
|
|
549
|
-
export type { PlatformProxyEndpoint, PlatformProxyEndpointAuth };
|
|
551
|
+
export type { OutputFileType, OutputLink, OutputLinkOptions, OutputQuery, PlatformProxyEndpoint, PlatformProxyEndpointAuth };
|
package/dist/client.js
CHANGED
|
@@ -332,9 +332,6 @@ export class AgentExecutor {
|
|
|
332
332
|
}
|
|
333
333
|
const provider = options.provider ?? supportedProviders[0] ?? DEFAULT_RUN_PROVIDER;
|
|
334
334
|
const credentialMode = parseCredentialMode(options.credentialMode);
|
|
335
|
-
if (credentialMode === "managed") {
|
|
336
|
-
throw new AexError("CREDENTIAL_INVALID", "AgentExecutor.submit: credentialMode \"managed\" is not available without a private managed-key implementation");
|
|
337
|
-
}
|
|
338
335
|
if (!options.secrets) {
|
|
339
336
|
throw new Error("AgentExecutor.submit: secrets is required");
|
|
340
337
|
}
|
|
@@ -550,15 +547,31 @@ export class AgentExecutor {
|
|
|
550
547
|
wait(runId, options) {
|
|
551
548
|
return this.waitForRun(runId, options);
|
|
552
549
|
}
|
|
553
|
-
listOutputs(runId) {
|
|
554
|
-
return operations.listOutputs(this.#http, runId);
|
|
550
|
+
listOutputs(runId, query) {
|
|
551
|
+
return operations.listOutputs(this.#http, runId, query);
|
|
555
552
|
}
|
|
556
553
|
/** Short alias for `listOutputs`. */
|
|
557
|
-
outputs(runId) {
|
|
558
|
-
return this.listOutputs(runId);
|
|
554
|
+
outputs(runId, query) {
|
|
555
|
+
return this.listOutputs(runId, query);
|
|
556
|
+
}
|
|
557
|
+
findOutputs(runId, query) {
|
|
558
|
+
return operations.findOutputs(this.#http, runId, query);
|
|
559
|
+
}
|
|
560
|
+
findOutput(runId, query) {
|
|
561
|
+
return operations.findOutput(this.#http, runId, query);
|
|
562
|
+
}
|
|
563
|
+
outputLink(runId, selectorOrQuery, options) {
|
|
564
|
+
return operations.outputLink(this.#http, runId, selectorOrQuery, options);
|
|
565
|
+
}
|
|
566
|
+
createOutputLink(runId, selectorOrQuery, options) {
|
|
567
|
+
return this.outputLink(runId, selectorOrQuery, options);
|
|
568
|
+
}
|
|
569
|
+
async fetchOutput(runId, selectorOrQuery, options) {
|
|
570
|
+
const link = await this.outputLink(runId, selectorOrQuery, options);
|
|
571
|
+
return (this.#fetch ?? fetch)(link.url);
|
|
559
572
|
}
|
|
560
|
-
|
|
561
|
-
return operations.
|
|
573
|
+
eventArchiveLink(runId, options) {
|
|
574
|
+
return operations.eventArchiveLink(this.#http, runId, options);
|
|
562
575
|
}
|
|
563
576
|
async downloadOutput(runId, selectorOrOptions, options) {
|
|
564
577
|
const hasSelector = selectorOrOptions !== undefined && !isOutputDownloadOptionsOnly(selectorOrOptions);
|