@aexhq/sdk 0.13.6 → 0.13.8
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 +14 -14
- package/dist/_contracts/connection-ticket.d.ts +8 -7
- package/dist/_contracts/connection-ticket.js +20 -14
- package/dist/_contracts/event-envelope.d.ts +17 -18
- package/dist/_contracts/event-envelope.js +10 -11
- package/dist/_contracts/managed-key.d.ts +27 -1
- package/dist/_contracts/managed-key.js +75 -4
- package/dist/_contracts/operations.d.ts +9 -20
- package/dist/_contracts/operations.js +33 -82
- package/dist/_contracts/proxy-protocol.d.ts +35 -2
- package/dist/_contracts/proxy-protocol.js +34 -1
- package/dist/_contracts/run-artifacts.d.ts +12 -10
- package/dist/_contracts/run-artifacts.js +13 -11
- package/dist/_contracts/run-config.d.ts +7 -0
- package/dist/_contracts/run-config.js +93 -24
- package/dist/_contracts/run-custody.d.ts +3 -3
- package/dist/_contracts/run-custody.js +5 -5
- package/dist/_contracts/run-record.d.ts +5 -17
- package/dist/_contracts/run-record.js +4 -15
- package/dist/_contracts/run-retention.d.ts +2 -2
- package/dist/_contracts/run-retention.js +3 -3
- package/dist/_contracts/run-unit.d.ts +4 -5
- package/dist/_contracts/runner-event.d.ts +7 -8
- package/dist/_contracts/runner-event.js +7 -8
- package/dist/_contracts/side-effect-audit.d.ts +2 -2
- package/dist/_contracts/side-effect-audit.js +3 -3
- package/dist/_contracts/stable.d.ts +1 -1
- package/dist/_contracts/stable.js +1 -1
- package/dist/_contracts/submission.d.ts +15 -11
- package/dist/_contracts/submission.js +18 -14
- package/dist/cli.mjs +127 -127
- package/dist/cli.mjs.sha256 +1 -1
- package/dist/client.d.ts +14 -58
- package/dist/client.js +304 -168
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/cleanup.md +4 -4
- package/docs/credentials.md +5 -5
- package/docs/events.md +5 -5
- package/docs/outputs.md +23 -25
- package/docs/product-boundaries.md +5 -5
- package/docs/provider-runtime-capabilities.md +1 -1
- package/docs/quickstart.md +12 -12
- package/docs/run-config.md +1 -1
- package/docs/run-record.md +6 -9
- package/docs/skills.md +23 -25
- package/package.json +2 -2
|
@@ -4,9 +4,9 @@ import type { Run, RunEvent, Output } from "./runtime-types.js";
|
|
|
4
4
|
import type { PlatformSubmission } from "./submission.js";
|
|
5
5
|
export declare const RUN_RECORD_SCHEMA_VERSION: "aex.run-record.v1";
|
|
6
6
|
export declare const RUN_RECORD_MANIFEST_SCHEMA_VERSION: "aex.run-record.manifest.v1";
|
|
7
|
-
export type RunRecordArchiveNamespaceV1 = "metadata" | "events" | "outputs"
|
|
7
|
+
export type RunRecordArchiveNamespaceV1 = "metadata" | "events" | "outputs";
|
|
8
8
|
export type RunRecordFileStatusV1 = "present" | "absent" | "pending" | "unavailable" | "not_applicable" | "error";
|
|
9
|
-
export type RunRecordArchiveFileRoleV1 = "run_metadata" | "submission_snapshot" | "cost" | "custody" | "typed_events" | "
|
|
9
|
+
export type RunRecordArchiveFileRoleV1 = "run_metadata" | "submission_snapshot" | "cost" | "custody" | "typed_events" | "coordinator_events_manifest" | "output";
|
|
10
10
|
export interface RunRecordSubmissionSnapshotV1 {
|
|
11
11
|
readonly submission: PlatformSubmission;
|
|
12
12
|
}
|
|
@@ -21,14 +21,8 @@ export interface RunRecordMetadataV1 {
|
|
|
21
21
|
readonly custody?: CustodyManifestV1;
|
|
22
22
|
}
|
|
23
23
|
export interface RunRecordEventsV1 {
|
|
24
|
-
/**
|
|
25
|
-
* Typed `channel: "event"` records. This is the current SDK
|
|
26
|
-
* `events/events.jsonl` export. Log-channel records are not mixed into this
|
|
27
|
-
* file.
|
|
28
|
-
*/
|
|
24
|
+
/** Typed `channel: "event"` records in the SDK `events/events.jsonl` export. */
|
|
29
25
|
readonly typed: readonly RunEvent[];
|
|
30
|
-
readonly logs?: readonly RunEvent[];
|
|
31
|
-
readonly all?: readonly RunEvent[];
|
|
32
26
|
}
|
|
33
27
|
export interface RunRecordV1 {
|
|
34
28
|
readonly schemaVersion: typeof RUN_RECORD_SCHEMA_VERSION;
|
|
@@ -36,7 +30,6 @@ export interface RunRecordV1 {
|
|
|
36
30
|
readonly metadata: RunRecordMetadataV1;
|
|
37
31
|
readonly events: RunRecordEventsV1;
|
|
38
32
|
readonly outputs: readonly Output[];
|
|
39
|
-
readonly logs: readonly Output[];
|
|
40
33
|
readonly manifest: RunRecordManifestV1;
|
|
41
34
|
}
|
|
42
35
|
export interface RunRecordNamespaceV1 {
|
|
@@ -63,7 +56,7 @@ export interface RunRecordArtifactSummaryV1 {
|
|
|
63
56
|
readonly contentType?: string;
|
|
64
57
|
}
|
|
65
58
|
export interface RunRecordDownloadErrorV1 {
|
|
66
|
-
readonly namespace: "outputs"
|
|
59
|
+
readonly namespace: "outputs";
|
|
67
60
|
readonly id: string;
|
|
68
61
|
readonly filename: string | null;
|
|
69
62
|
readonly message: string;
|
|
@@ -80,20 +73,16 @@ export interface RunRecordManifestV1 {
|
|
|
80
73
|
* presence state for optional run-record members.
|
|
81
74
|
*/
|
|
82
75
|
readonly outputs: readonly RunRecordArtifactSummaryV1[];
|
|
83
|
-
readonly logs: readonly RunRecordArtifactSummaryV1[];
|
|
84
76
|
readonly errors: readonly RunRecordDownloadErrorV1[];
|
|
85
77
|
}
|
|
86
78
|
export interface BuildRunRecordDownloadManifestV1Input {
|
|
87
79
|
readonly runId: string;
|
|
88
80
|
readonly outputs: readonly RunRecordArtifactSummaryV1[];
|
|
89
|
-
readonly logs: readonly RunRecordArtifactSummaryV1[];
|
|
90
81
|
readonly errors?: readonly RunRecordDownloadErrorV1[];
|
|
91
82
|
readonly typedEventCount?: number;
|
|
92
83
|
readonly submission?: RunRecordFileManifestInputV1;
|
|
93
84
|
readonly cost?: RunRecordFileManifestInputV1;
|
|
94
85
|
readonly custody?: RunRecordFileManifestInputV1;
|
|
95
|
-
readonly logEvents?: RunRecordFileManifestInputV1;
|
|
96
|
-
readonly allEvents?: RunRecordFileManifestInputV1;
|
|
97
86
|
readonly coordinatorEventsManifest?: RunRecordFileManifestInputV1;
|
|
98
87
|
}
|
|
99
88
|
export interface RunRecordFileManifestInputV1 {
|
|
@@ -106,8 +95,7 @@ export interface RunRecordArchiveEntryForRedactionV1 {
|
|
|
106
95
|
readonly contentType?: string;
|
|
107
96
|
/**
|
|
108
97
|
* Customer-authored output bytes are intentionally outside the public-record
|
|
109
|
-
* redaction guarantee. Metadata, event exports, manifests
|
|
110
|
-
* remain scanned.
|
|
98
|
+
* redaction guarantee. Metadata, event exports, and manifests remain scanned.
|
|
111
99
|
*/
|
|
112
100
|
readonly customerContent?: boolean;
|
|
113
101
|
}
|
|
@@ -12,7 +12,6 @@ export class RunRecordArchiveRedactionError extends Error {
|
|
|
12
12
|
}
|
|
13
13
|
export function buildRunRecordDownloadManifestV1(input) {
|
|
14
14
|
const outputs = input.outputs.map((file) => normalizeArtifactSummary(file));
|
|
15
|
-
const logs = input.logs.map((file) => normalizeArtifactSummary(file));
|
|
16
15
|
const errors = (input.errors ?? []).map((error) => Object.freeze({ ...error }));
|
|
17
16
|
return Object.freeze({
|
|
18
17
|
schemaVersion: RUN_RECORD_MANIFEST_SCHEMA_VERSION,
|
|
@@ -20,9 +19,8 @@ export function buildRunRecordDownloadManifestV1(input) {
|
|
|
20
19
|
runId: input.runId,
|
|
21
20
|
namespaces: Object.freeze([
|
|
22
21
|
namespace("metadata", "Run metadata, submission snapshot, custody, and cost files."),
|
|
23
|
-
namespace("events", "Typed event-channel exports
|
|
24
|
-
namespace("outputs", "Captured deliverables produced by the run.")
|
|
25
|
-
namespace("logs", "Platform diagnostics and runtime log artifacts.")
|
|
22
|
+
namespace("events", "Typed event-channel exports."),
|
|
23
|
+
namespace("outputs", "Captured deliverables produced by the run.")
|
|
26
24
|
]),
|
|
27
25
|
files: Object.freeze([
|
|
28
26
|
file("metadata", "metadata/run.json", "run_metadata", "present"),
|
|
@@ -32,14 +30,10 @@ export function buildRunRecordDownloadManifestV1(input) {
|
|
|
32
30
|
file("events", "events/events.jsonl", "typed_events", "present", {
|
|
33
31
|
recordCount: input.typedEventCount ?? 0
|
|
34
32
|
}),
|
|
35
|
-
file("events", "events/logs.jsonl", "log_events", input.logEvents?.status ?? "unavailable", recordCountExtra(input.logEvents)),
|
|
36
|
-
file("events", "events/all.jsonl", "all_events", input.allEvents?.status ?? "unavailable", recordCountExtra(input.allEvents)),
|
|
37
33
|
file("events", "events/manifest.json", "coordinator_events_manifest", input.coordinatorEventsManifest?.status ?? "unavailable"),
|
|
38
|
-
...outputs.map((output) => artifactFile("outputs", "output", "outputs/", output))
|
|
39
|
-
...logs.map((log) => artifactFile("logs", "log", "logs/", log))
|
|
34
|
+
...outputs.map((output) => artifactFile("outputs", "output", "outputs/", output))
|
|
40
35
|
]),
|
|
41
36
|
outputs: Object.freeze(outputs),
|
|
42
|
-
logs: Object.freeze(logs),
|
|
43
37
|
errors: Object.freeze(errors)
|
|
44
38
|
});
|
|
45
39
|
}
|
|
@@ -60,11 +54,6 @@ function file(namespaceName, path, role, status, extra) {
|
|
|
60
54
|
...(extra?.recordCount !== undefined ? { recordCount: extra.recordCount } : {})
|
|
61
55
|
});
|
|
62
56
|
}
|
|
63
|
-
function recordCountExtra(input) {
|
|
64
|
-
return input?.status === "present" && input.recordCount !== undefined
|
|
65
|
-
? { recordCount: input.recordCount }
|
|
66
|
-
: undefined;
|
|
67
|
-
}
|
|
68
57
|
function artifactFile(namespaceName, role, prefix, artifact) {
|
|
69
58
|
return Object.freeze({
|
|
70
59
|
namespace: namespaceName,
|
|
@@ -138,7 +127,7 @@ function isAllowedArchiveHighEntropyField(entryPath, finding) {
|
|
|
138
127
|
if (finding.reason !== "high_entropy_token" || !entryPath.endsWith("manifest.json")) {
|
|
139
128
|
return false;
|
|
140
129
|
}
|
|
141
|
-
return /^\$(?:\.files\[\d+\]|\.outputs\[\d+\]
|
|
130
|
+
return /^\$(?:\.files\[\d+\]|\.outputs\[\d+\])\.id$/.test(finding.path);
|
|
142
131
|
}
|
|
143
132
|
function parseArchiveTextValues(path, text) {
|
|
144
133
|
if (/\.json$/i.test(path)) {
|
|
@@ -12,7 +12,7 @@ export declare const RUN_DELETION_CANDIDATE_STATUSES: readonly ["selected", "blo
|
|
|
12
12
|
export type RunDeletionCandidateStatus = (typeof RUN_DELETION_CANDIDATE_STATUSES)[number];
|
|
13
13
|
export declare const RUN_DELETION_BLOCKERS: readonly ["non_terminal", "already_deleted", "concurrent_delete", "retention_policy_disabled", "unexpired", "held", "retention_exempt", "unresolved_cleanup", "unresolved_custody"];
|
|
14
14
|
export type RunDeletionBlocker = (typeof RUN_DELETION_BLOCKERS)[number];
|
|
15
|
-
export declare const RUN_DELETION_COUNT_CLASSES: readonly ["
|
|
15
|
+
export declare const RUN_DELETION_COUNT_CLASSES: readonly ["object_store_objects", "outputs", "logs", "events", "assets", "db_event_rows", "db_output_rows", "capture_failures", "storage_samples", "custody_manifests"];
|
|
16
16
|
export type RunDeletionCountClass = (typeof RUN_DELETION_COUNT_CLASSES)[number];
|
|
17
17
|
export declare const RUN_DELETION_COUNT_STATUSES: readonly ["counted", "not_counted", "partial", "failed"];
|
|
18
18
|
export type RunDeletionCountStatus = (typeof RUN_DELETION_COUNT_STATUSES)[number];
|
|
@@ -180,7 +180,7 @@ export interface RunDeletionManifestWriteResult {
|
|
|
180
180
|
export interface RunDeletionManifestWriter {
|
|
181
181
|
writeRunDeletionManifest(input: RunDeletionManifestInput): Promise<RunDeletionManifestWriteResult>;
|
|
182
182
|
}
|
|
183
|
-
export type RunRetentionRedactionReason = "forbidden_field_name" | "signed_url" | "
|
|
183
|
+
export type RunRetentionRedactionReason = "forbidden_field_name" | "signed_url" | "object_store_key" | "vault_id" | "private_resource_handle" | "hash_like_value";
|
|
184
184
|
export interface RunRetentionRedactionFinding {
|
|
185
185
|
readonly path: string;
|
|
186
186
|
readonly reason: RunRetentionRedactionReason;
|
|
@@ -19,7 +19,7 @@ export const RUN_DELETION_BLOCKERS = [
|
|
|
19
19
|
"unresolved_custody"
|
|
20
20
|
];
|
|
21
21
|
export const RUN_DELETION_COUNT_CLASSES = [
|
|
22
|
-
"
|
|
22
|
+
"object_store_objects",
|
|
23
23
|
"outputs",
|
|
24
24
|
"logs",
|
|
25
25
|
"events",
|
|
@@ -426,7 +426,7 @@ function scanStringValue(value, path, findings) {
|
|
|
426
426
|
}
|
|
427
427
|
const forbiddenStringPatterns = Object.freeze([
|
|
428
428
|
{ reason: "signed_url", regex: /[?&](?:X-Amz-Signature|X-Amz-Credential|X-Amz-Algorithm|AWSAccessKeyId)=/i },
|
|
429
|
-
{ reason: "
|
|
429
|
+
{ reason: "object_store_key", regex: /(^|[\s"'`])(?:runs|assets)\/[^?<#\s"'`]+/i },
|
|
430
430
|
{ reason: "vault_id", regex: /\b(?:vault|vlt|secret)[_:-][A-Za-z0-9][A-Za-z0-9_-]{7,}\b/i },
|
|
431
431
|
{
|
|
432
432
|
reason: "private_resource_handle",
|
|
@@ -435,7 +435,7 @@ const forbiddenStringPatterns = Object.freeze([
|
|
|
435
435
|
{ reason: "hash_like_value", regex: /\b(?:sha256|hash)[:_-][A-Fa-f0-9]{16,}\b/ }
|
|
436
436
|
]);
|
|
437
437
|
function isForbiddenRetentionFieldName(key) {
|
|
438
|
-
return /^(path|paths|objectKey|objectKeys|
|
|
438
|
+
return /^(path|paths|objectKey|objectKeys|objectStoreKey|objectStoreKeys|fileName|filename|filenames|size|sizes|bytes|byteCount|hash|hashes|providerId|providerIds|vaultId|vaultIds|resourceId|resourceIds|handle|handles|signedUrl|signedUrls|url|urls)$/i.test(key);
|
|
439
439
|
}
|
|
440
440
|
function assertSafeIdentifier(value, field) {
|
|
441
441
|
assertNonEmptyString(value, field);
|
|
@@ -70,17 +70,16 @@ export interface RunUnitEventPage {
|
|
|
70
70
|
readonly nextCursor?: string;
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
|
-
* One gzipped JSONL page of raw provider events captured
|
|
74
|
-
* Bytes are downloaded
|
|
75
|
-
* archive zip. `
|
|
76
|
-
* into a signed URL for clients.
|
|
73
|
+
* One gzipped JSONL page of raw provider events captured for the run record.
|
|
74
|
+
* Bytes are downloaded through auth-gated routes or surfaced inside the
|
|
75
|
+
* per-run archive zip. `artifactPath` is run-record relative.
|
|
77
76
|
*/
|
|
78
77
|
export interface RunUnitRawEventPage {
|
|
79
78
|
readonly attempt: number;
|
|
80
79
|
readonly page: number;
|
|
81
80
|
readonly byteSize: number;
|
|
82
81
|
readonly eventCount: number;
|
|
83
|
-
readonly
|
|
82
|
+
readonly artifactPath: string;
|
|
84
83
|
readonly contentEncoding: "gzip";
|
|
85
84
|
readonly createdAt: string;
|
|
86
85
|
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Unified runner event schema. The managed runtime feeds one shape into
|
|
3
3
|
* the hosted aex event pipeline:
|
|
4
4
|
*
|
|
5
|
-
* -
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* - The per-run managed runtime POSTs batches of NDJSON events to
|
|
6
|
+
* `/runs/{id}/runner/events`; the runtime adapter translates each
|
|
7
|
+
* event into one or more `RunnerEvent`s.
|
|
8
8
|
*
|
|
9
9
|
* The downstream subscribers (dashboard, SDK `streamEvents`, observable
|
|
10
10
|
* spans) never see runtime-specific wire shapes — they only see
|
|
@@ -25,14 +25,13 @@ export declare const RUNNER_EVENT_VERSION: 1;
|
|
|
25
25
|
* doesn't fit is mapped to `notification` so the data is captured
|
|
26
26
|
* even when no UI handler exists yet.
|
|
27
27
|
*
|
|
28
|
-
* - `runtime_started` —
|
|
29
|
-
*
|
|
30
|
-
* accepted the first turn).
|
|
28
|
+
* - `runtime_started` — the managed runtime announced "ready" or
|
|
29
|
+
* accepted the first turn.
|
|
31
30
|
* - `assistant_text` — model text delta.
|
|
32
31
|
* - `tool_request` — model emitted a tool_use / function call.
|
|
33
32
|
* - `tool_response` — tool result delivered back to the model.
|
|
34
|
-
* - `skill_loaded` — a skill was loaded
|
|
35
|
-
*
|
|
33
|
+
* - `skill_loaded` — a skill was loaded from a provider ref or
|
|
34
|
+
* a workspace folder mount.
|
|
36
35
|
* - `file_uploaded` — a file became available to the agent
|
|
37
36
|
* (Files API id OR workspace path).
|
|
38
37
|
* - `notification` — runtime/extension notification; catch-all
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Unified runner event schema. The managed runtime feeds one shape into
|
|
3
3
|
* the hosted aex event pipeline:
|
|
4
4
|
*
|
|
5
|
-
* -
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* - The per-run managed runtime POSTs batches of NDJSON events to
|
|
6
|
+
* `/runs/{id}/runner/events`; the runtime adapter translates each
|
|
7
|
+
* event into one or more `RunnerEvent`s.
|
|
8
8
|
*
|
|
9
9
|
* The downstream subscribers (dashboard, SDK `streamEvents`, observable
|
|
10
10
|
* spans) never see runtime-specific wire shapes — they only see
|
|
@@ -24,14 +24,13 @@ export const RUNNER_EVENT_VERSION = 1;
|
|
|
24
24
|
* doesn't fit is mapped to `notification` so the data is captured
|
|
25
25
|
* even when no UI handler exists yet.
|
|
26
26
|
*
|
|
27
|
-
* - `runtime_started` —
|
|
28
|
-
*
|
|
29
|
-
* accepted the first turn).
|
|
27
|
+
* - `runtime_started` — the managed runtime announced "ready" or
|
|
28
|
+
* accepted the first turn.
|
|
30
29
|
* - `assistant_text` — model text delta.
|
|
31
30
|
* - `tool_request` — model emitted a tool_use / function call.
|
|
32
31
|
* - `tool_response` — tool result delivered back to the model.
|
|
33
|
-
* - `skill_loaded` — a skill was loaded
|
|
34
|
-
*
|
|
32
|
+
* - `skill_loaded` — a skill was loaded from a provider ref or
|
|
33
|
+
* a workspace folder mount.
|
|
35
34
|
* - `file_uploaded` — a file became available to the agent
|
|
36
35
|
* (Files API id OR workspace path).
|
|
37
36
|
* - `notification` — runtime/extension notification; catch-all
|
|
@@ -19,7 +19,7 @@ export declare const SIDE_EFFECT_AUDIT_COUNT_NAMES: readonly ["requestBytes", "r
|
|
|
19
19
|
export type SideEffectAuditCountName = (typeof SIDE_EFFECT_AUDIT_COUNT_NAMES)[number];
|
|
20
20
|
export declare const SIDE_EFFECT_AUDIT_TIMESTAMP_NAMES: readonly ["startedAt", "finishedAt", "observedAt", "decidedAt", "deletedAt", "tombstonedAt", "terminalAt", "expiresAt"];
|
|
21
21
|
export type SideEffectAuditTimestampName = (typeof SIDE_EFFECT_AUDIT_TIMESTAMP_NAMES)[number];
|
|
22
|
-
export declare const SIDE_EFFECT_AUDIT_METADATA_EXCLUDED_VALUE_CLASSES: readonly ["headers", "bodies", "raw_urls", "raw_paths", "query_strings", "provider_response_bodies", "signed_urls", "
|
|
22
|
+
export declare const SIDE_EFFECT_AUDIT_METADATA_EXCLUDED_VALUE_CLASSES: readonly ["headers", "bodies", "raw_urls", "raw_paths", "query_strings", "provider_response_bodies", "signed_urls", "object_store_keys", "vault_ids", "resource_handles", "bearer_hashes", "secret_values", "customer_or_agent_identity", "private_pricing_or_provider_deployment"];
|
|
23
23
|
export type SideEffectAuditMetadataExcludedValueClass = (typeof SIDE_EFFECT_AUDIT_METADATA_EXCLUDED_VALUE_CLASSES)[number];
|
|
24
24
|
export interface SideEffectAuditPrincipalV1 {
|
|
25
25
|
readonly type: SideEffectAuditActorPrincipalType;
|
|
@@ -107,7 +107,7 @@ export interface SideEffectAuditRunScopedInput {
|
|
|
107
107
|
readonly correlation?: SideEffectAuditCorrelationInput;
|
|
108
108
|
readonly metadata?: SideEffectAuditMetadataInput;
|
|
109
109
|
}
|
|
110
|
-
export type SideEffectAuditRedactionReason = "forbidden_field_name" | "bearer_token" | "provider_key" | "signed_url" | "
|
|
110
|
+
export type SideEffectAuditRedactionReason = "forbidden_field_name" | "bearer_token" | "provider_key" | "signed_url" | "object_store_key" | "vault_id" | "private_resource_handle" | "raw_url" | "raw_path" | "high_entropy_token";
|
|
111
111
|
export interface SideEffectAuditRedactionFinding {
|
|
112
112
|
readonly path: string;
|
|
113
113
|
readonly reason: SideEffectAuditRedactionReason;
|
|
@@ -116,7 +116,7 @@ export const SIDE_EFFECT_AUDIT_METADATA_EXCLUDED_VALUE_CLASSES = [
|
|
|
116
116
|
"query_strings",
|
|
117
117
|
"provider_response_bodies",
|
|
118
118
|
"signed_urls",
|
|
119
|
-
"
|
|
119
|
+
"object_store_keys",
|
|
120
120
|
"vault_ids",
|
|
121
121
|
"resource_handles",
|
|
122
122
|
"bearer_hashes",
|
|
@@ -422,7 +422,7 @@ const forbiddenStringPatterns = Object.freeze([
|
|
|
422
422
|
regex: /\b(?:sk-(?:ant|proj|live|test|deepseek|openai)|xox[baprs]-|AIza)[A-Za-z0-9_-]{8,}/i
|
|
423
423
|
},
|
|
424
424
|
{ reason: "signed_url", regex: /[?&](?:X-Amz-Signature|X-Amz-Credential|X-Amz-Algorithm|AWSAccessKeyId)=/i },
|
|
425
|
-
{ reason: "
|
|
425
|
+
{ reason: "object_store_key", regex: /(^|[\s"'`])(?:runs|assets)\/[^?<#\s"'`]+/i },
|
|
426
426
|
{ reason: "vault_id", regex: /\b(?:vault|vlt|secret)[_:-][A-Za-z0-9][A-Za-z0-9_-]{7,}\b/i },
|
|
427
427
|
{
|
|
428
428
|
reason: "private_resource_handle",
|
|
@@ -433,7 +433,7 @@ const forbiddenStringPatterns = Object.freeze([
|
|
|
433
433
|
{ reason: "high_entropy_token", regex: /\b(?=[A-Za-z0-9_-]{40,}\b)(?=.*[A-Za-z])(?=.*\d)[A-Za-z0-9_-]{40,}\b/ }
|
|
434
434
|
]);
|
|
435
435
|
function isForbiddenAuditFieldName(key) {
|
|
436
|
-
return /^(authorization|headers?|requestHeaders?|responseHeaders?|body|requestBody|responseBody|rawBody|prompt|url|rawUrl|href|query|queryString|path|rawPath|signedUrl|
|
|
436
|
+
return /^(authorization|headers?|requestHeaders?|responseHeaders?|body|requestBody|responseBody|rawBody|prompt|url|rawUrl|href|query|queryString|path|rawPath|signedUrl|objectStoreKey|objectKey|vaultId|providerResponseBody|providerAccountId|providerDeployment|rateCard|rateCardVersion|margin|discount|calculator|reconciliation|resourceHandle|privateResourceHandle|bearerHash|tokenHash|apiKey|secretValue|sessionId|providerSessionId|agentId|customerId|endUserId|identity|email)$/i.test(key);
|
|
437
437
|
}
|
|
438
438
|
function assertSafeIdentifier(value, field) {
|
|
439
439
|
assertNonEmptyString(value, field);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Canonical hosted aex API plane URL. Used as the default `baseUrl`
|
|
3
|
-
* for the SDK `
|
|
3
|
+
* for the SDK `AgentExecutor` and the host-side CLI `--aex-url`
|
|
4
4
|
* flag.
|
|
5
5
|
*
|
|
6
6
|
* Pinned to `api.aex.dev` on purpose: the dashboard at
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
/**
|
|
3
3
|
* Canonical hosted aex API plane URL. Used as the default `baseUrl`
|
|
4
|
-
* for the SDK `
|
|
4
|
+
* for the SDK `AgentExecutor` and the host-side CLI `--aex-url`
|
|
5
5
|
* flag.
|
|
6
6
|
*
|
|
7
7
|
* Pinned to `api.aex.dev` on purpose: the dashboard at
|
|
@@ -77,23 +77,18 @@ export interface PlatformPackage {
|
|
|
77
77
|
export declare function packageInstallString(pkg: PlatformPackage): string;
|
|
78
78
|
export interface PlatformAnthropicSecrets {
|
|
79
79
|
readonly apiKey: string;
|
|
80
|
-
readonly baseUrl?: string;
|
|
81
80
|
}
|
|
82
81
|
export interface PlatformDeepseekSecrets {
|
|
83
82
|
readonly apiKey: string;
|
|
84
|
-
readonly baseUrl?: string;
|
|
85
83
|
}
|
|
86
84
|
export interface PlatformOpenAISecrets {
|
|
87
85
|
readonly apiKey: string;
|
|
88
|
-
readonly baseUrl?: string;
|
|
89
86
|
}
|
|
90
87
|
export interface PlatformGeminiSecrets {
|
|
91
88
|
readonly apiKey: string;
|
|
92
|
-
readonly baseUrl?: string;
|
|
93
89
|
}
|
|
94
90
|
export interface PlatformMistralSecrets {
|
|
95
91
|
readonly apiKey: string;
|
|
96
|
-
readonly baseUrl?: string;
|
|
97
92
|
}
|
|
98
93
|
/**
|
|
99
94
|
* Run-time provider selector. Aex exposes one customer interface
|
|
@@ -233,10 +228,9 @@ export interface PlatformSubmission {
|
|
|
233
228
|
*/
|
|
234
229
|
readonly outputs?: PlatformOutputCaptureConfig;
|
|
235
230
|
/**
|
|
236
|
-
* Optional override for the
|
|
237
|
-
* the runner container. Each entry is the bare name
|
|
238
|
-
*
|
|
239
|
-
* `crates/goose-cli/src/cli.rs` `with-builtin` flag). The platform
|
|
231
|
+
* Optional override for the managed-runtime builtin extensions enabled
|
|
232
|
+
* inside the runner container. Each entry is the bare extension name
|
|
233
|
+
* accepted by the selected runtime. The platform
|
|
240
234
|
* default is `["developer"]` which gives the agent shell + write +
|
|
241
235
|
* edit + tree tools (bash, grep via shell, file read via shell or
|
|
242
236
|
* editor, file edit). To opt in to more tools (e.g. web search via
|
|
@@ -244,14 +238,20 @@ export interface PlatformSubmission {
|
|
|
244
238
|
* out of all builtins (pure-MCP setup), pass an empty array.
|
|
245
239
|
*
|
|
246
240
|
* Validation:
|
|
247
|
-
* - Each entry matches /^[a-z][a-z0-9_-]{0,63}$/ (
|
|
248
|
-
* naming convention).
|
|
241
|
+
* - Each entry matches /^[a-z][a-z0-9_-]{0,63}$/ (managed-runtime
|
|
242
|
+
* builtin naming convention).
|
|
249
243
|
* - Max 16 entries.
|
|
250
244
|
* - Deduplicated.
|
|
251
245
|
*
|
|
252
246
|
* The dispatcher accepts and persists it for snapshot fidelity.
|
|
253
247
|
*/
|
|
254
248
|
readonly builtins?: readonly string[];
|
|
249
|
+
/**
|
|
250
|
+
* Assistant-output granularity. `buffered` (the default) emits one event per
|
|
251
|
+
* assistant message; `stream` emits the agent's per-token text deltas as they
|
|
252
|
+
* arrive. Buffered is quieter and cheaper; stream suits live typing UIs.
|
|
253
|
+
*/
|
|
254
|
+
readonly outputMode?: OutputMode;
|
|
255
255
|
/**
|
|
256
256
|
* Platform-injection controls. The platform prepends a small system
|
|
257
257
|
* prompt (see `platformSystemPrompt`) ahead of `system` to explain
|
|
@@ -353,6 +353,10 @@ export interface ParseRunSubmissionOptions {
|
|
|
353
353
|
readonly managedKeyPolicy?: ManagedKeyPolicyV1;
|
|
354
354
|
}
|
|
355
355
|
export declare function parseRunSubmissionRequest(input: unknown, options?: ParseRunSubmissionOptions): PlatformRunSubmissionRequest;
|
|
356
|
+
/** Assistant-output granularity values. Buffered is the platform default. */
|
|
357
|
+
export declare const OUTPUT_MODES: readonly ["buffered", "stream"];
|
|
358
|
+
export type OutputMode = (typeof OUTPUT_MODES)[number];
|
|
359
|
+
export declare const DEFAULT_OUTPUT_MODE: OutputMode;
|
|
356
360
|
/**
|
|
357
361
|
* Codes emitted when a submission contains features the active runtime cannot
|
|
358
362
|
* serve. Code values are stable so dashboard / SDK error rendering can branch
|
|
@@ -567,24 +567,14 @@ function parseInlineSecrets(input) {
|
|
|
567
567
|
function parseProviderSecret(input, provider) {
|
|
568
568
|
const field = `secrets.${provider}`;
|
|
569
569
|
const value = requireRecord(input, field);
|
|
570
|
-
const allowed = new Set(["apiKey"
|
|
570
|
+
const allowed = new Set(["apiKey"]);
|
|
571
571
|
for (const key of Object.keys(value)) {
|
|
572
572
|
if (!allowed.has(key)) {
|
|
573
|
-
throw new Error(`${field}.${key} is not an allowed field; permitted: apiKey
|
|
573
|
+
throw new Error(`${field}.${key} is not an allowed field; permitted: apiKey`);
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
576
|
const apiKey = requireString(value.apiKey, `${field}.apiKey`);
|
|
577
|
-
|
|
578
|
-
if (rawBaseUrl === undefined) {
|
|
579
|
-
return { apiKey };
|
|
580
|
-
}
|
|
581
|
-
// Reuse the proxy-endpoint URL guard so provider baseUrl gets the
|
|
582
|
-
// same protection: https-only, no credentials, no query/fragment.
|
|
583
|
-
// The provider-proxy in the dashboard forwards a customer-controlled
|
|
584
|
-
// baseUrl to the upstream — accepting http:// (or a userinfo-laden
|
|
585
|
-
// URL) here is an SSRF / credential-leak vector.
|
|
586
|
-
const baseUrl = parseProxyBaseUrl(rawBaseUrl, `${field}.baseUrl`);
|
|
587
|
-
return { apiKey, baseUrl };
|
|
577
|
+
return { apiKey };
|
|
588
578
|
}
|
|
589
579
|
function parseMcpServerSecrets(input) {
|
|
590
580
|
if (input === undefined) {
|
|
@@ -972,6 +962,7 @@ function parseSubmission(input) {
|
|
|
972
962
|
"metadata",
|
|
973
963
|
"outputs",
|
|
974
964
|
"builtins",
|
|
965
|
+
"outputMode",
|
|
975
966
|
"platform"
|
|
976
967
|
]);
|
|
977
968
|
for (const key of Object.keys(value)) {
|
|
@@ -991,6 +982,7 @@ function parseSubmission(input) {
|
|
|
991
982
|
const metadata = optionalJsonRecord(value.metadata, "submission.metadata");
|
|
992
983
|
const outputs = parseOutputs(value.outputs);
|
|
993
984
|
const builtins = parseBuiltins(value.builtins);
|
|
985
|
+
const outputMode = parseOutputMode(value.outputMode);
|
|
994
986
|
const platform = parsePlatformConfig(value.platform);
|
|
995
987
|
return {
|
|
996
988
|
model,
|
|
@@ -1005,6 +997,7 @@ function parseSubmission(input) {
|
|
|
1005
997
|
...(metadata ? { metadata } : {}),
|
|
1006
998
|
...(outputs ? { outputs } : {}),
|
|
1007
999
|
...(builtins !== undefined ? { builtins } : {}),
|
|
1000
|
+
...(outputMode !== undefined ? { outputMode } : {}),
|
|
1008
1001
|
...(platform ? { platform } : {})
|
|
1009
1002
|
};
|
|
1010
1003
|
}
|
|
@@ -1024,6 +1017,17 @@ function parsePlatformConfig(input) {
|
|
|
1024
1017
|
}
|
|
1025
1018
|
return { systemPrompt: value.systemPrompt };
|
|
1026
1019
|
}
|
|
1020
|
+
/** Assistant-output granularity values. Buffered is the platform default. */
|
|
1021
|
+
export const OUTPUT_MODES = ["buffered", "stream"];
|
|
1022
|
+
export const DEFAULT_OUTPUT_MODE = "buffered";
|
|
1023
|
+
function parseOutputMode(input) {
|
|
1024
|
+
if (input === undefined || input === null)
|
|
1025
|
+
return undefined;
|
|
1026
|
+
if (typeof input !== "string" || !OUTPUT_MODES.includes(input)) {
|
|
1027
|
+
throw new Error(`submission.outputMode must be one of ${OUTPUT_MODES.join(", ")}`);
|
|
1028
|
+
}
|
|
1029
|
+
return input;
|
|
1030
|
+
}
|
|
1027
1031
|
const BUILTIN_NAME_PATTERN = /^[a-z][a-z0-9_-]{0,63}$/;
|
|
1028
1032
|
const MAX_BUILTINS = 16;
|
|
1029
1033
|
function parseBuiltins(input) {
|
|
@@ -1043,7 +1047,7 @@ function parseBuiltins(input) {
|
|
|
1043
1047
|
throw new Error(`submission.builtins[${i}] must be a string`);
|
|
1044
1048
|
}
|
|
1045
1049
|
if (!BUILTIN_NAME_PATTERN.test(v)) {
|
|
1046
|
-
throw new Error(`submission.builtins[${i}] (${JSON.stringify(v)}) is not a valid
|
|
1050
|
+
throw new Error(`submission.builtins[${i}] (${JSON.stringify(v)}) is not a valid managed-runtime builtin name; expected /^[a-z][a-z0-9_-]{0,63}$/`);
|
|
1047
1051
|
}
|
|
1048
1052
|
if (seen.has(v))
|
|
1049
1053
|
continue; // dedupe silently
|