@aexhq/sdk 0.46.4-canary → 0.50.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/LICENSE +201 -0
- package/NOTICE +38 -0
- package/README.md +23 -31
- package/dist/client/aex.d.ts +33 -0
- package/dist/client/aex.js +98 -0
- package/dist/client/aex.js.map +1 -0
- package/dist/client/credentials.d.ts +25 -0
- package/dist/client/credentials.js +97 -0
- package/dist/client/credentials.js.map +1 -0
- package/dist/client/routing.d.ts +7 -0
- package/dist/client/routing.js +29 -0
- package/dist/client/routing.js.map +1 -0
- package/dist/downloads/download.d.ts +25 -0
- package/dist/downloads/download.js +53 -0
- package/dist/downloads/download.js.map +1 -0
- package/dist/generated/errors.d.ts +12 -0
- package/dist/generated/errors.js +81 -0
- package/dist/generated/errors.js.map +1 -0
- package/dist/generated/resources.d.ts +730 -0
- package/dist/generated/resources.js +606 -0
- package/dist/generated/resources.js.map +1 -0
- package/dist/generated/routes.d.ts +42 -0
- package/dist/generated/routes.js +2101 -0
- package/dist/generated/routes.js.map +1 -0
- package/dist/index.d.ts +20 -50
- package/dist/index.js +11 -62
- package/dist/index.js.map +1 -1
- package/dist/observations/stream.d.ts +1 -0
- package/dist/observations/stream.js +18 -0
- package/dist/observations/stream.js.map +1 -0
- package/dist/transport/errors.d.ts +60 -0
- package/dist/transport/errors.js +107 -0
- package/dist/transport/errors.js.map +1 -0
- package/dist/transport/pagination.d.ts +8 -0
- package/dist/transport/pagination.js +34 -0
- package/dist/transport/pagination.js.map +1 -0
- package/dist/transport/retry.d.ts +21 -0
- package/dist/transport/retry.js +37 -0
- package/dist/transport/retry.js.map +1 -0
- package/dist/transport/transport.d.ts +25 -0
- package/dist/transport/transport.js +28 -0
- package/dist/transport/transport.js.map +1 -0
- package/package.json +63 -30
- package/dist/_contracts/account-operations.d.ts +0 -101
- package/dist/_contracts/account-operations.js +0 -242
- package/dist/_contracts/account-types.d.ts +0 -461
- package/dist/_contracts/account-types.js +0 -1
- package/dist/_contracts/api-key.d.ts +0 -61
- package/dist/_contracts/api-key.js +0 -101
- package/dist/_contracts/api-routes.d.ts +0 -20
- package/dist/_contracts/api-routes.js +0 -109
- package/dist/_contracts/archive-limits.d.ts +0 -3
- package/dist/_contracts/archive-limits.js +0 -23
- package/dist/_contracts/asset-authoring.d.ts +0 -22
- package/dist/_contracts/asset-authoring.js +0 -106
- package/dist/_contracts/asset-bundle.d.ts +0 -64
- package/dist/_contracts/asset-bundle.js +0 -263
- package/dist/_contracts/asset-upload-helper.d.ts +0 -31
- package/dist/_contracts/asset-upload-helper.js +0 -84
- package/dist/_contracts/billing-admission.d.ts +0 -29
- package/dist/_contracts/billing-admission.js +0 -28
- package/dist/_contracts/bundle-manifest.d.ts +0 -89
- package/dist/_contracts/bundle-manifest.js +0 -158
- package/dist/_contracts/canonical-sha256.d.ts +0 -8
- package/dist/_contracts/canonical-sha256.js +0 -8
- package/dist/_contracts/connection-ticket.d.ts +0 -22
- package/dist/_contracts/connection-ticket.js +0 -54
- package/dist/_contracts/continuation-event.d.ts +0 -31
- package/dist/_contracts/continuation-event.js +0 -6
- package/dist/_contracts/contract-parse-error.d.ts +0 -12
- package/dist/_contracts/contract-parse-error.js +0 -51
- package/dist/_contracts/error-codes.d.ts +0 -26
- package/dist/_contracts/error-codes.js +0 -116
- package/dist/_contracts/error-factory.d.ts +0 -32
- package/dist/_contracts/error-factory.js +0 -174
- package/dist/_contracts/event-envelope.d.ts +0 -471
- package/dist/_contracts/event-envelope.js +0 -501
- package/dist/_contracts/event-stream-client.d.ts +0 -122
- package/dist/_contracts/event-stream-client.js +0 -445
- package/dist/_contracts/event-view.d.ts +0 -44
- package/dist/_contracts/event-view.js +0 -69
- package/dist/_contracts/failure-class.d.ts +0 -29
- package/dist/_contracts/failure-class.js +0 -73
- package/dist/_contracts/http.d.ts +0 -135
- package/dist/_contracts/http.js +0 -434
- package/dist/_contracts/ids.d.ts +0 -66
- package/dist/_contracts/ids.js +0 -119
- package/dist/_contracts/index.d.ts +0 -42
- package/dist/_contracts/index.js +0 -52
- package/dist/_contracts/internal.d.ts +0 -55
- package/dist/_contracts/internal.js +0 -113
- package/dist/_contracts/models.d.ts +0 -30
- package/dist/_contracts/models.js +0 -28
- package/dist/_contracts/operation-core.d.ts +0 -36
- package/dist/_contracts/operation-core.js +0 -70
- package/dist/_contracts/operations.d.ts +0 -218
- package/dist/_contracts/operations.js +0 -1496
- package/dist/_contracts/otlp-projection.d.ts +0 -78
- package/dist/_contracts/otlp-projection.js +0 -171
- package/dist/_contracts/post-hook.d.ts +0 -31
- package/dist/_contracts/post-hook.js +0 -61
- package/dist/_contracts/provider-fault.d.ts +0 -34
- package/dist/_contracts/provider-fault.js +0 -68
- package/dist/_contracts/retry-core.d.ts +0 -29
- package/dist/_contracts/retry-core.js +0 -79
- package/dist/_contracts/runner-event.d.ts +0 -117
- package/dist/_contracts/runner-event.js +0 -172
- package/dist/_contracts/runtime-kind.d.ts +0 -60
- package/dist/_contracts/runtime-kind.js +0 -70
- package/dist/_contracts/runtime-manifest.d.ts +0 -121
- package/dist/_contracts/runtime-manifest.js +0 -83
- package/dist/_contracts/runtime-security-profile.d.ts +0 -26
- package/dist/_contracts/runtime-security-profile.js +0 -73
- package/dist/_contracts/runtime-sizes.d.ts +0 -104
- package/dist/_contracts/runtime-sizes.js +0 -111
- package/dist/_contracts/runtime-types.d.ts +0 -618
- package/dist/_contracts/runtime-types.js +0 -58
- package/dist/_contracts/schemas/asset-bundle.d.ts +0 -70
- package/dist/_contracts/schemas/asset-bundle.js +0 -107
- package/dist/_contracts/schemas/asset-ref.d.ts +0 -61
- package/dist/_contracts/schemas/asset-ref.js +0 -118
- package/dist/_contracts/schemas/bundle-manifest.d.ts +0 -66
- package/dist/_contracts/schemas/bundle-manifest.js +0 -77
- package/dist/_contracts/schemas/index.d.ts +0 -32
- package/dist/_contracts/schemas/index.js +0 -30
- package/dist/_contracts/schemas/mcp-server.d.ts +0 -99
- package/dist/_contracts/schemas/mcp-server.js +0 -209
- package/dist/_contracts/schemas/models.d.ts +0 -29
- package/dist/_contracts/schemas/models.js +0 -51
- package/dist/_contracts/schemas/numeric.d.ts +0 -18
- package/dist/_contracts/schemas/numeric.js +0 -28
- package/dist/_contracts/schemas/post-hook.d.ts +0 -45
- package/dist/_contracts/schemas/post-hook.js +0 -68
- package/dist/_contracts/schemas/response-assets.d.ts +0 -75
- package/dist/_contracts/schemas/response-assets.js +0 -81
- package/dist/_contracts/schemas/response-billing.d.ts +0 -208
- package/dist/_contracts/schemas/response-billing.js +0 -139
- package/dist/_contracts/schemas/response-common.d.ts +0 -132
- package/dist/_contracts/schemas/response-common.js +0 -162
- package/dist/_contracts/schemas/response-identity.d.ts +0 -648
- package/dist/_contracts/schemas/response-identity.js +0 -131
- package/dist/_contracts/schemas/response-mcp-servers.d.ts +0 -51
- package/dist/_contracts/schemas/response-mcp-servers.js +0 -32
- package/dist/_contracts/schemas/response-secrets.d.ts +0 -50
- package/dist/_contracts/schemas/response-secrets.js +0 -32
- package/dist/_contracts/schemas/response-sessions-internal.d.ts +0 -200
- package/dist/_contracts/schemas/response-sessions-internal.js +0 -142
- package/dist/_contracts/schemas/response-sessions.d.ts +0 -1598
- package/dist/_contracts/schemas/response-sessions.js +0 -377
- package/dist/_contracts/schemas/response-webhooks.d.ts +0 -76
- package/dist/_contracts/schemas/response-webhooks.js +0 -42
- package/dist/_contracts/schemas/response-workspace.d.ts +0 -225
- package/dist/_contracts/schemas/response-workspace.js +0 -99
- package/dist/_contracts/schemas/runtime-kind.d.ts +0 -31
- package/dist/_contracts/schemas/runtime-kind.js +0 -29
- package/dist/_contracts/schemas/runtime-security-profile.d.ts +0 -28
- package/dist/_contracts/schemas/runtime-security-profile.js +0 -26
- package/dist/_contracts/schemas/runtime-sizes.d.ts +0 -70
- package/dist/_contracts/schemas/runtime-sizes.js +0 -127
- package/dist/_contracts/schemas/session-limits.d.ts +0 -34
- package/dist/_contracts/schemas/session-limits.js +0 -39
- package/dist/_contracts/schemas/session-machine.d.ts +0 -23
- package/dist/_contracts/schemas/session-machine.js +0 -24
- package/dist/_contracts/schemas/session-request-config.d.ts +0 -58
- package/dist/_contracts/schemas/session-request-config.js +0 -134
- package/dist/_contracts/schemas/session-webhook.d.ts +0 -11
- package/dist/_contracts/schemas/session-webhook.js +0 -38
- package/dist/_contracts/schemas/side-effect-audit.d.ts +0 -98
- package/dist/_contracts/schemas/side-effect-audit.js +0 -102
- package/dist/_contracts/schemas/submission-assets.d.ts +0 -117
- package/dist/_contracts/schemas/submission-assets.js +0 -147
- package/dist/_contracts/schemas/submission-body.d.ts +0 -251
- package/dist/_contracts/schemas/submission-body.js +0 -378
- package/dist/_contracts/schemas/submission-environment.d.ts +0 -79
- package/dist/_contracts/schemas/submission-environment.js +0 -179
- package/dist/_contracts/schemas/submission-request.d.ts +0 -158
- package/dist/_contracts/schemas/submission-request.js +0 -49
- package/dist/_contracts/schemas/submission-secrets.d.ts +0 -47
- package/dist/_contracts/schemas/submission-secrets.js +0 -108
- package/dist/_contracts/schemas/wire.d.ts +0 -118
- package/dist/_contracts/schemas/wire.js +0 -171
- package/dist/_contracts/schemas/workspace-resources.d.ts +0 -50
- package/dist/_contracts/schemas/workspace-resources.js +0 -87
- package/dist/_contracts/sdk-errors.d.ts +0 -212
- package/dist/_contracts/sdk-errors.js +0 -313
- package/dist/_contracts/sdk-secrets.d.ts +0 -67
- package/dist/_contracts/sdk-secrets.js +0 -427
- package/dist/_contracts/session-archive.d.ts +0 -16
- package/dist/_contracts/session-archive.js +0 -92
- package/dist/_contracts/session-artifacts.d.ts +0 -189
- package/dist/_contracts/session-artifacts.js +0 -264
- package/dist/_contracts/session-config.d.ts +0 -373
- package/dist/_contracts/session-config.js +0 -562
- package/dist/_contracts/session-cost-types.d.ts +0 -211
- package/dist/_contracts/session-cost-types.js +0 -69
- package/dist/_contracts/session-cost.d.ts +0 -8
- package/dist/_contracts/session-cost.js +0 -582
- package/dist/_contracts/session-custody.d.ts +0 -165
- package/dist/_contracts/session-custody.js +0 -345
- package/dist/_contracts/session-file-query.d.ts +0 -14
- package/dist/_contracts/session-file-query.js +0 -178
- package/dist/_contracts/session-record.d.ts +0 -112
- package/dist/_contracts/session-record.js +0 -165
- package/dist/_contracts/session-retention.d.ts +0 -201
- package/dist/_contracts/session-retention.js +0 -450
- package/dist/_contracts/side-effect-audit.d.ts +0 -126
- package/dist/_contracts/side-effect-audit.js +0 -520
- package/dist/_contracts/sse.d.ts +0 -74
- package/dist/_contracts/sse.js +0 -227
- package/dist/_contracts/stable.d.ts +0 -45
- package/dist/_contracts/stable.js +0 -62
- package/dist/_contracts/status.d.ts +0 -25
- package/dist/_contracts/status.js +0 -57
- package/dist/_contracts/submission-limits.d.ts +0 -61
- package/dist/_contracts/submission-limits.js +0 -60
- package/dist/_contracts/submission.d.ts +0 -547
- package/dist/_contracts/submission.js +0 -812
- package/dist/_contracts/suggest.d.ts +0 -15
- package/dist/_contracts/suggest.js +0 -53
- package/dist/_contracts/testing/response-bindings.d.ts +0 -45
- package/dist/_contracts/testing/response-bindings.js +0 -256
- package/dist/_contracts/testing/wire-conformance-entry.d.ts +0 -10
- package/dist/_contracts/testing/wire-conformance-entry.js +0 -8
- package/dist/_contracts/testing/wire-conformance.d.ts +0 -169
- package/dist/_contracts/testing/wire-conformance.js +0 -276
- package/dist/_contracts/turn-trace.d.ts +0 -28
- package/dist/_contracts/turn-trace.js +0 -1
- package/dist/_contracts/unknown-field-error.d.ts +0 -13
- package/dist/_contracts/unknown-field-error.js +0 -21
- package/dist/_contracts/value-guards.d.ts +0 -20
- package/dist/_contracts/value-guards.js +0 -34
- package/dist/_contracts/webhook-verify.d.ts +0 -34
- package/dist/_contracts/webhook-verify.js +0 -93
- package/dist/_contracts/wire-observer.d.ts +0 -49
- package/dist/_contracts/wire-observer.js +0 -34
- package/dist/_contracts/workflow-status.d.ts +0 -7
- package/dist/_contracts/workflow-status.js +0 -43
- package/dist/_contracts/workspace-resources.d.ts +0 -98
- package/dist/_contracts/workspace-resources.js +0 -39
- package/dist/archive-limits.d.ts +0 -1
- package/dist/archive-limits.js +0 -2
- package/dist/archive-limits.js.map +0 -1
- package/dist/asset-upload.d.ts +0 -47
- package/dist/asset-upload.js +0 -269
- package/dist/asset-upload.js.map +0 -1
- package/dist/bundle.d.ts +0 -9
- package/dist/bundle.js +0 -20
- package/dist/bundle.js.map +0 -1
- package/dist/canonical-zip.d.ts +0 -68
- package/dist/canonical-zip.js +0 -355
- package/dist/canonical-zip.js.map +0 -1
- package/dist/cli.mjs +0 -12048
- package/dist/cli.mjs.sha256 +0 -1
- package/dist/client-types.d.ts +0 -192
- package/dist/client-types.js +0 -2
- package/dist/client-types.js.map +0 -1
- package/dist/client.d.ts +0 -464
- package/dist/client.js +0 -1207
- package/dist/client.js.map +0 -1
- package/dist/event-projection.d.ts +0 -22
- package/dist/event-projection.js +0 -380
- package/dist/event-projection.js.map +0 -1
- package/dist/fetch-archive.d.ts +0 -16
- package/dist/fetch-archive.js +0 -252
- package/dist/fetch-archive.js.map +0 -1
- package/dist/file.d.ts +0 -96
- package/dist/file.js +0 -272
- package/dist/file.js.map +0 -1
- package/dist/instructions.d.ts +0 -20
- package/dist/instructions.js +0 -40
- package/dist/instructions.js.map +0 -1
- package/dist/legacy-session-provider-fault.d.ts +0 -7
- package/dist/legacy-session-provider-fault.js +0 -38
- package/dist/legacy-session-provider-fault.js.map +0 -1
- package/dist/mcp-server.d.ts +0 -84
- package/dist/mcp-server.js +0 -117
- package/dist/mcp-server.js.map +0 -1
- package/dist/node-fs.d.ts +0 -29
- package/dist/node-fs.js +0 -19
- package/dist/node-fs.js.map +0 -1
- package/dist/node-walk.d.ts +0 -69
- package/dist/node-walk.js +0 -151
- package/dist/node-walk.js.map +0 -1
- package/dist/path-basename.d.ts +0 -5
- package/dist/path-basename.js +0 -9
- package/dist/path-basename.js.map +0 -1
- package/dist/retry.d.ts +0 -70
- package/dist/retry.js +0 -155
- package/dist/retry.js.map +0 -1
- package/dist/secret.d.ts +0 -65
- package/dist/secret.js +0 -110
- package/dist/secret.js.map +0 -1
- package/dist/session-validate.d.ts +0 -100
- package/dist/session-validate.js +0 -303
- package/dist/session-validate.js.map +0 -1
- package/dist/skill.d.ts +0 -99
- package/dist/skill.js +0 -169
- package/dist/skill.js.map +0 -1
- package/dist/submission-wire.d.ts +0 -13
- package/dist/submission-wire.js +0 -69
- package/dist/submission-wire.js.map +0 -1
- package/dist/tool.d.ts +0 -41
- package/dist/tool.js +0 -76
- package/dist/tool.js.map +0 -1
- package/dist/version.d.ts +0 -9
- package/dist/version.js +0 -10
- package/dist/version.js.map +0 -1
- package/docs/authentication.md +0 -125
- package/docs/billing.md +0 -164
- package/docs/cleanup.md +0 -27
- package/docs/concepts/agent-tools.md +0 -47
- package/docs/concepts/composition.md +0 -60
- package/docs/concepts/providers-and-runtimes.md +0 -121
- package/docs/concepts/sessions.md +0 -51
- package/docs/concepts/subagents.md +0 -35
- package/docs/credentials.md +0 -116
- package/docs/defaults.md +0 -51
- package/docs/errors.md +0 -258
- package/docs/events.md +0 -143
- package/docs/files.md +0 -130
- package/docs/limits-and-quotas.md +0 -114
- package/docs/limits.md +0 -51
- package/docs/mcp.md +0 -47
- package/docs/networking.md +0 -114
- package/docs/provider-runtime-capabilities.md +0 -32
- package/docs/public-surface.json +0 -73
- package/docs/quickstart.md +0 -135
- package/docs/release.md +0 -44
- package/docs/retries.md +0 -108
- package/docs/secrets.md +0 -141
- package/docs/session-config.md +0 -51
- package/docs/session-record.md +0 -58
- package/docs/skills.md +0 -65
- package/docs/telemetry.md +0 -66
- package/docs/testing.md +0 -35
- package/docs/vision-skills.md +0 -94
- package/docs/webhooks.md +0 -143
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import { SessionStateError } from "./sdk-errors.js";
|
|
2
|
-
/** Package-private path-selector guard shared by transport orchestration. */
|
|
3
|
-
export function isPathSelector(selector) {
|
|
4
|
-
return Boolean(selector && typeof selector === "object" && "path" in selector);
|
|
5
|
-
}
|
|
6
|
-
function normalizeSessionFileLookupPath(path) {
|
|
7
|
-
return path.replace(/\\/g, "/").replace(/^\/+/, "");
|
|
8
|
-
}
|
|
9
|
-
export function resolveSessionFileSelector(files, selector, sessionId) {
|
|
10
|
-
const target = normalizeSessionFileLookupPath(selector.path);
|
|
11
|
-
if (!target) {
|
|
12
|
-
throw new SessionStateError("files.download: file path must be non-empty", { sessionId, path: selector.path });
|
|
13
|
-
}
|
|
14
|
-
const matches = files.filter((file) => {
|
|
15
|
-
if (typeof file.filename !== "string")
|
|
16
|
-
return false;
|
|
17
|
-
const filename = normalizeSessionFileLookupPath(file.filename);
|
|
18
|
-
if (selector.match === "suffix") {
|
|
19
|
-
return filename === target || filename.endsWith(`/${target}`);
|
|
20
|
-
}
|
|
21
|
-
return filename === target;
|
|
22
|
-
});
|
|
23
|
-
if (matches.length === 1)
|
|
24
|
-
return matches[0];
|
|
25
|
-
if (matches.length > 1) {
|
|
26
|
-
throw new SessionStateError(`files.download: file path "${selector.path}" matched multiple files`, { sessionId, path: selector.path, matches: matches.map((file) => file.filename ?? file.id) });
|
|
27
|
-
}
|
|
28
|
-
throw new SessionStateError(`files.download: file path "${selector.path}" was not found`, {
|
|
29
|
-
sessionId,
|
|
30
|
-
path: selector.path
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
export function filterSessionFiles(files, query) {
|
|
34
|
-
return files.filter((file) => sessionFileMatchesQuery(file, query));
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* The single filename-matcher for cross-session / per-session file SEARCH. A
|
|
38
|
-
* string is a case-insensitive SUBSTRING match; a RegExp is tested as given (and
|
|
39
|
-
* reset to `lastIndex = 0` so a reused `/g` regex is safe). Sharing this SSoT is
|
|
40
|
-
* what closes the T16 crash class: session-file search no longer assumes `filename`
|
|
41
|
-
* is a string and passes a RegExp into `escapeRegExp(...).replace(...)`.
|
|
42
|
-
*/
|
|
43
|
-
export function toFilenameMatcher(filename) {
|
|
44
|
-
if (typeof filename === "string") {
|
|
45
|
-
const needle = filename.toLowerCase();
|
|
46
|
-
return (name) => name.toLowerCase().includes(needle);
|
|
47
|
-
}
|
|
48
|
-
return (name) => {
|
|
49
|
-
filename.lastIndex = 0;
|
|
50
|
-
return filename.test(name);
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
export function classifySessionFile(file) {
|
|
54
|
-
const contentType = normalizeContentType(file.contentType);
|
|
55
|
-
if (contentType) {
|
|
56
|
-
if (contentType === "application/json" || contentType.endsWith("+json") || contentType.includes("json")) {
|
|
57
|
-
return "json";
|
|
58
|
-
}
|
|
59
|
-
if (contentType.startsWith("text/"))
|
|
60
|
-
return "text";
|
|
61
|
-
if (contentType.startsWith("image/"))
|
|
62
|
-
return "image";
|
|
63
|
-
if (contentType.startsWith("audio/"))
|
|
64
|
-
return "audio";
|
|
65
|
-
if (contentType.startsWith("video/"))
|
|
66
|
-
return "video";
|
|
67
|
-
if (contentType === "application/pdf")
|
|
68
|
-
return "pdf";
|
|
69
|
-
if (contentType === "application/zip" ||
|
|
70
|
-
contentType === "application/gzip" ||
|
|
71
|
-
contentType === "application/x-gzip" ||
|
|
72
|
-
contentType === "application/x-tar" ||
|
|
73
|
-
contentType === "application/x-7z-compressed" ||
|
|
74
|
-
contentType === "application/vnd.rar" ||
|
|
75
|
-
contentType === "application/zstd") {
|
|
76
|
-
return "archive";
|
|
77
|
-
}
|
|
78
|
-
if (contentType === "application/octet-stream")
|
|
79
|
-
return "binary";
|
|
80
|
-
return "unknown";
|
|
81
|
-
}
|
|
82
|
-
const extension = extensionOf(file.filename);
|
|
83
|
-
if (!extension)
|
|
84
|
-
return "unknown";
|
|
85
|
-
if (["json", "jsonl", "ndjson"].includes(extension))
|
|
86
|
-
return "json";
|
|
87
|
-
if (["txt", "log", "md", "markdown", "csv", "tsv", "xml", "html", "htm", "yaml", "yml"].includes(extension)) {
|
|
88
|
-
return "text";
|
|
89
|
-
}
|
|
90
|
-
if (["png", "jpg", "jpeg", "gif", "webp", "avif", "bmp", "tif", "tiff", "svg"].includes(extension)) {
|
|
91
|
-
return "image";
|
|
92
|
-
}
|
|
93
|
-
if (["mp3", "wav", "flac", "m4a", "aac", "ogg", "oga", "opus"].includes(extension))
|
|
94
|
-
return "audio";
|
|
95
|
-
if (["mp4", "mov", "m4v", "webm", "mkv", "avi"].includes(extension))
|
|
96
|
-
return "video";
|
|
97
|
-
if (extension === "pdf")
|
|
98
|
-
return "pdf";
|
|
99
|
-
if (["zip", "tar", "tgz", "gz", "bz2", "xz", "7z", "rar", "zst"].includes(extension))
|
|
100
|
-
return "archive";
|
|
101
|
-
if (["bin", "exe", "dll", "so", "dylib", "dmg", "iso"].includes(extension))
|
|
102
|
-
return "binary";
|
|
103
|
-
return "unknown";
|
|
104
|
-
}
|
|
105
|
-
function sessionFileMatchesQuery(file, query) {
|
|
106
|
-
const normalizedPath = typeof file.filename === "string" ? normalizeSessionFileQueryPath(file.filename) : "";
|
|
107
|
-
if (query.path !== undefined && normalizedPath !== normalizeSessionFileQueryPath(query.path)) {
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
if (query.filename !== undefined) {
|
|
111
|
-
const basename = basenameOf(normalizedPath);
|
|
112
|
-
if (typeof query.filename === "string") {
|
|
113
|
-
if (basename !== query.filename)
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
query.filename.lastIndex = 0;
|
|
118
|
-
if (!query.filename.test(basename))
|
|
119
|
-
return false;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
if (query.dir !== undefined && !directoryMatches(normalizedPath, query.dir, query.recursive ?? true)) {
|
|
123
|
-
return false;
|
|
124
|
-
}
|
|
125
|
-
if (query.extension !== undefined && extensionOf(normalizedPath) !== normalizeExtension(query.extension)) {
|
|
126
|
-
return false;
|
|
127
|
-
}
|
|
128
|
-
if (query.contentType !== undefined && !contentTypeMatches(file.contentType, query.contentType)) {
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
if (query.type !== undefined && classifySessionFile(file) !== query.type) {
|
|
132
|
-
return false;
|
|
133
|
-
}
|
|
134
|
-
return true;
|
|
135
|
-
}
|
|
136
|
-
function normalizeSessionFileQueryPath(path) {
|
|
137
|
-
let normalized = path.replace(/\\/g, "/").replace(/^\/+/, "");
|
|
138
|
-
while (normalized === "files" || normalized.startsWith("files/")) {
|
|
139
|
-
normalized = normalized === "files" ? "" : normalized.slice("files/".length);
|
|
140
|
-
}
|
|
141
|
-
return normalized.replace(/\/+$/, "");
|
|
142
|
-
}
|
|
143
|
-
function basenameOf(path) {
|
|
144
|
-
return path.split("/").filter(Boolean).pop() ?? "";
|
|
145
|
-
}
|
|
146
|
-
function directoryMatches(path, dir, recursive) {
|
|
147
|
-
const normalizedDir = normalizeSessionFileQueryPath(dir);
|
|
148
|
-
if (normalizedDir.length === 0)
|
|
149
|
-
return true;
|
|
150
|
-
const prefix = `${normalizedDir}/`;
|
|
151
|
-
if (!path.startsWith(prefix))
|
|
152
|
-
return false;
|
|
153
|
-
const remainder = path.slice(prefix.length);
|
|
154
|
-
return remainder.length > 0 && (recursive || !remainder.includes("/"));
|
|
155
|
-
}
|
|
156
|
-
function normalizeExtension(extension) {
|
|
157
|
-
return extension.replace(/^\.+/, "").toLowerCase();
|
|
158
|
-
}
|
|
159
|
-
function extensionOf(path) {
|
|
160
|
-
if (!path)
|
|
161
|
-
return "";
|
|
162
|
-
const basename = basenameOf(normalizeSessionFileQueryPath(path));
|
|
163
|
-
const index = basename.lastIndexOf(".");
|
|
164
|
-
return index > 0 && index < basename.length - 1 ? basename.slice(index + 1).toLowerCase() : "";
|
|
165
|
-
}
|
|
166
|
-
function normalizeContentType(contentType) {
|
|
167
|
-
return (contentType ?? "").split(";")[0].trim().toLowerCase();
|
|
168
|
-
}
|
|
169
|
-
function contentTypeMatches(actual, expected) {
|
|
170
|
-
const normalizedActual = normalizeContentType(actual);
|
|
171
|
-
const normalizedExpected = normalizeContentType(expected);
|
|
172
|
-
if (!normalizedActual || !normalizedExpected)
|
|
173
|
-
return false;
|
|
174
|
-
if (normalizedExpected.endsWith("/*")) {
|
|
175
|
-
return normalizedActual.startsWith(normalizedExpected.slice(0, -1));
|
|
176
|
-
}
|
|
177
|
-
return normalizedActual === normalizedExpected;
|
|
178
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import type { SessionCostTelemetry } from "./session-cost.js";
|
|
2
|
-
import { type CustodyManifestV1, type CustodyRedactionFinding } from "./session-custody.js";
|
|
3
|
-
import type { AexEvent } from "./event-envelope.js";
|
|
4
|
-
import type { Session, SessionFile } from "./runtime-types.js";
|
|
5
|
-
import type { PlatformSubmission } from "./submission.js";
|
|
6
|
-
export declare const SESSION_RECORD_SCHEMA_VERSION: "aex.session-record.v1";
|
|
7
|
-
export declare const SESSION_RECORD_MANIFEST_SCHEMA_VERSION: "aex.session-record.manifest.v1";
|
|
8
|
-
export type SessionRecordArchiveNamespaceV1 = "metadata" | "events" | "files";
|
|
9
|
-
export type SessionRecordFileStatusV1 = "present" | "absent" | "pending" | "unavailable" | "not_applicable" | "error";
|
|
10
|
-
export type SessionRecordArchiveFileRoleV1 = "session_metadata" | "submission_snapshot" | "cost" | "custody" | "typed_events" | "coordinator_events_manifest" | "file";
|
|
11
|
-
export interface SessionRecordSubmissionSnapshotV1 {
|
|
12
|
-
readonly submission: PlatformSubmission;
|
|
13
|
-
}
|
|
14
|
-
export interface SessionRecordCostV1 {
|
|
15
|
-
readonly status: SessionRecordFileStatusV1;
|
|
16
|
-
readonly telemetry?: SessionCostTelemetry;
|
|
17
|
-
}
|
|
18
|
-
export interface SessionRecordMetadataV1 {
|
|
19
|
-
readonly session: Session;
|
|
20
|
-
readonly submission?: SessionRecordSubmissionSnapshotV1;
|
|
21
|
-
readonly cost?: SessionRecordCostV1;
|
|
22
|
-
readonly custody?: CustodyManifestV1;
|
|
23
|
-
}
|
|
24
|
-
export interface SessionRecordEventsV1 {
|
|
25
|
-
/** Typed `channel: "event"` records in the SDK `events/events.jsonl` export. */
|
|
26
|
-
readonly typed: readonly AexEvent[];
|
|
27
|
-
}
|
|
28
|
-
export interface SessionRecordV1 {
|
|
29
|
-
readonly schemaVersion: typeof SESSION_RECORD_SCHEMA_VERSION;
|
|
30
|
-
readonly sessionId: string;
|
|
31
|
-
readonly metadata: SessionRecordMetadataV1;
|
|
32
|
-
readonly events: SessionRecordEventsV1;
|
|
33
|
-
readonly sessionFiles: readonly SessionFile[];
|
|
34
|
-
readonly manifest: SessionRecordManifestV1;
|
|
35
|
-
}
|
|
36
|
-
export interface SessionRecordNamespaceV1 {
|
|
37
|
-
readonly name: SessionRecordArchiveNamespaceV1;
|
|
38
|
-
readonly prefix: `${SessionRecordArchiveNamespaceV1}/`;
|
|
39
|
-
readonly status: SessionRecordFileStatusV1;
|
|
40
|
-
readonly description: string;
|
|
41
|
-
}
|
|
42
|
-
export interface SessionRecordArchiveFileV1 {
|
|
43
|
-
readonly namespace: SessionRecordArchiveNamespaceV1;
|
|
44
|
-
readonly path: string;
|
|
45
|
-
readonly role: SessionRecordArchiveFileRoleV1;
|
|
46
|
-
readonly status: SessionRecordFileStatusV1;
|
|
47
|
-
readonly id?: string;
|
|
48
|
-
readonly filename?: string | null;
|
|
49
|
-
readonly sizeBytes?: number;
|
|
50
|
-
readonly contentType?: string;
|
|
51
|
-
readonly recordCount?: number;
|
|
52
|
-
}
|
|
53
|
-
export interface SessionRecordArtifactSummaryV1 {
|
|
54
|
-
readonly id: string;
|
|
55
|
-
readonly filename: string | null;
|
|
56
|
-
readonly sizeBytes?: number;
|
|
57
|
-
readonly contentType?: string;
|
|
58
|
-
}
|
|
59
|
-
export interface SessionRecordDownloadErrorV1 {
|
|
60
|
-
readonly namespace: "files";
|
|
61
|
-
readonly id: string;
|
|
62
|
-
readonly filename: string | null;
|
|
63
|
-
readonly message: string;
|
|
64
|
-
}
|
|
65
|
-
export interface SessionRecordManifestV1 {
|
|
66
|
-
readonly schemaVersion: typeof SESSION_RECORD_MANIFEST_SCHEMA_VERSION;
|
|
67
|
-
readonly sessionRecordSchemaVersion: typeof SESSION_RECORD_SCHEMA_VERSION;
|
|
68
|
-
readonly sessionId: string;
|
|
69
|
-
readonly namespaces: readonly SessionRecordNamespaceV1[];
|
|
70
|
-
readonly files: readonly SessionRecordArchiveFileV1[];
|
|
71
|
-
/** Captured session files included in the archive. */
|
|
72
|
-
readonly sessionFiles: readonly SessionRecordArtifactSummaryV1[];
|
|
73
|
-
readonly errors: readonly SessionRecordDownloadErrorV1[];
|
|
74
|
-
}
|
|
75
|
-
export interface BuildSessionRecordDownloadManifestV1Input {
|
|
76
|
-
readonly sessionId: string;
|
|
77
|
-
readonly sessionFiles: readonly SessionRecordArtifactSummaryV1[];
|
|
78
|
-
readonly errors?: readonly SessionRecordDownloadErrorV1[];
|
|
79
|
-
readonly typedEventCount?: number;
|
|
80
|
-
readonly submission?: SessionRecordFileManifestInputV1;
|
|
81
|
-
readonly cost?: SessionRecordFileManifestInputV1;
|
|
82
|
-
readonly custody?: SessionRecordFileManifestInputV1;
|
|
83
|
-
readonly coordinatorEventsManifest?: SessionRecordFileManifestInputV1;
|
|
84
|
-
}
|
|
85
|
-
export interface SessionRecordFileManifestInputV1 {
|
|
86
|
-
readonly status: SessionRecordFileStatusV1;
|
|
87
|
-
readonly recordCount?: number;
|
|
88
|
-
}
|
|
89
|
-
export interface SessionRecordArchiveEntryForRedactionV1 {
|
|
90
|
-
readonly path: string;
|
|
91
|
-
readonly bytes: Uint8Array;
|
|
92
|
-
readonly contentType?: string;
|
|
93
|
-
/**
|
|
94
|
-
* Customer-authored file bytes are intentionally outside the public-record
|
|
95
|
-
* redaction guarantee. Metadata, event exports, and manifests remain scanned.
|
|
96
|
-
*/
|
|
97
|
-
readonly customerContent?: boolean;
|
|
98
|
-
}
|
|
99
|
-
export interface SessionRecordArchiveRedactionFindingV1 {
|
|
100
|
-
readonly entryPath: string;
|
|
101
|
-
readonly path: string;
|
|
102
|
-
readonly reason: CustodyRedactionFinding["reason"];
|
|
103
|
-
readonly valueLength?: number;
|
|
104
|
-
}
|
|
105
|
-
export declare class SessionRecordArchiveRedactionError extends Error {
|
|
106
|
-
readonly code = "session_record_archive_not_public_safe";
|
|
107
|
-
readonly findings: readonly SessionRecordArchiveRedactionFindingV1[];
|
|
108
|
-
constructor(findings: readonly SessionRecordArchiveRedactionFindingV1[]);
|
|
109
|
-
}
|
|
110
|
-
export declare function buildSessionRecordDownloadManifestV1(input: BuildSessionRecordDownloadManifestV1Input): SessionRecordManifestV1;
|
|
111
|
-
export declare function scanSessionRecordArchiveEntriesV1(entries: readonly SessionRecordArchiveEntryForRedactionV1[]): readonly SessionRecordArchiveRedactionFindingV1[];
|
|
112
|
-
export declare function assertSessionRecordArchivePublicSafeV1(entries: readonly SessionRecordArchiveEntryForRedactionV1[]): void;
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { scanCustodyPayloadForSensitiveValues } from "./session-custody.js";
|
|
2
|
-
export const SESSION_RECORD_SCHEMA_VERSION = "aex.session-record.v1";
|
|
3
|
-
export const SESSION_RECORD_MANIFEST_SCHEMA_VERSION = "aex.session-record.manifest.v1";
|
|
4
|
-
export class SessionRecordArchiveRedactionError extends Error {
|
|
5
|
-
code = "session_record_archive_not_public_safe";
|
|
6
|
-
findings;
|
|
7
|
-
constructor(findings) {
|
|
8
|
-
super(`session record archive contains non-public data at ${formatArchiveFindingPaths(findings)}`);
|
|
9
|
-
this.name = "SessionRecordArchiveRedactionError";
|
|
10
|
-
this.findings = Object.freeze([...findings]);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export function buildSessionRecordDownloadManifestV1(input) {
|
|
14
|
-
const sessionFiles = input.sessionFiles.map((file) => normalizeArtifactSummary(file));
|
|
15
|
-
const errors = (input.errors ?? []).map((error) => Object.freeze({ ...error }));
|
|
16
|
-
return Object.freeze({
|
|
17
|
-
schemaVersion: SESSION_RECORD_MANIFEST_SCHEMA_VERSION,
|
|
18
|
-
sessionRecordSchemaVersion: SESSION_RECORD_SCHEMA_VERSION,
|
|
19
|
-
sessionId: input.sessionId,
|
|
20
|
-
namespaces: Object.freeze([
|
|
21
|
-
namespace("metadata", "Session record metadata, submission snapshot, custody, and cost files."),
|
|
22
|
-
namespace("events", "Typed event-channel exports."),
|
|
23
|
-
namespace("files", "Captured files produced by the session.")
|
|
24
|
-
]),
|
|
25
|
-
files: Object.freeze([
|
|
26
|
-
file("metadata", "metadata/session.json", "session_metadata", "present"),
|
|
27
|
-
file("metadata", "metadata/submission.json", "submission_snapshot", input.submission?.status ?? "unavailable"),
|
|
28
|
-
file("metadata", "metadata/cost.json", "cost", input.cost?.status ?? "pending"),
|
|
29
|
-
file("metadata", "metadata/custody.json", "custody", input.custody?.status ?? "pending"),
|
|
30
|
-
file("events", "events/events.jsonl", "typed_events", "present", {
|
|
31
|
-
recordCount: input.typedEventCount ?? 0
|
|
32
|
-
}),
|
|
33
|
-
file("events", "events/manifest.json", "coordinator_events_manifest", input.coordinatorEventsManifest?.status ?? "unavailable"),
|
|
34
|
-
...sessionFiles.map((fileSummary) => artifactFile("files", "file", "files/", fileSummary))
|
|
35
|
-
]),
|
|
36
|
-
sessionFiles: Object.freeze(sessionFiles),
|
|
37
|
-
errors: Object.freeze(errors)
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
function namespace(name, description) {
|
|
41
|
-
return Object.freeze({
|
|
42
|
-
name,
|
|
43
|
-
prefix: `${name}/`,
|
|
44
|
-
status: "present",
|
|
45
|
-
description
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
function file(namespaceName, path, role, status, extra) {
|
|
49
|
-
return Object.freeze({
|
|
50
|
-
namespace: namespaceName,
|
|
51
|
-
path,
|
|
52
|
-
role,
|
|
53
|
-
status,
|
|
54
|
-
...(extra?.recordCount !== undefined ? { recordCount: extra.recordCount } : {})
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
function artifactFile(namespaceName, role, prefix, artifact) {
|
|
58
|
-
return Object.freeze({
|
|
59
|
-
namespace: namespaceName,
|
|
60
|
-
path: `${prefix}${artifact.filename ?? artifact.id}`,
|
|
61
|
-
role,
|
|
62
|
-
status: "present",
|
|
63
|
-
id: artifact.id,
|
|
64
|
-
filename: artifact.filename,
|
|
65
|
-
...(artifact.sizeBytes !== undefined ? { sizeBytes: artifact.sizeBytes } : {}),
|
|
66
|
-
...(artifact.contentType !== undefined ? { contentType: artifact.contentType } : {})
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
function normalizeArtifactSummary(input) {
|
|
70
|
-
return Object.freeze({
|
|
71
|
-
id: input.id,
|
|
72
|
-
filename: input.filename,
|
|
73
|
-
...(input.sizeBytes !== undefined ? { sizeBytes: input.sizeBytes } : {}),
|
|
74
|
-
...(input.contentType !== undefined ? { contentType: input.contentType } : {})
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
export function scanSessionRecordArchiveEntriesV1(entries) {
|
|
78
|
-
const findings = [];
|
|
79
|
-
for (const entry of entries) {
|
|
80
|
-
if (entry.customerContent || !shouldScanArchiveEntry(entry)) {
|
|
81
|
-
continue;
|
|
82
|
-
}
|
|
83
|
-
for (const finding of scanArchiveEntry(entry)) {
|
|
84
|
-
findings.push(finding);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return Object.freeze(findings);
|
|
88
|
-
}
|
|
89
|
-
export function assertSessionRecordArchivePublicSafeV1(entries) {
|
|
90
|
-
const findings = scanSessionRecordArchiveEntriesV1(entries);
|
|
91
|
-
if (findings.length > 0) {
|
|
92
|
-
throw new SessionRecordArchiveRedactionError(findings);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
function shouldScanArchiveEntry(entry) {
|
|
96
|
-
if (entry.path.startsWith("files/")) {
|
|
97
|
-
return false;
|
|
98
|
-
}
|
|
99
|
-
const contentType = entry.contentType?.toLowerCase() ?? "";
|
|
100
|
-
if (contentType.startsWith("text/") ||
|
|
101
|
-
contentType.includes("json") ||
|
|
102
|
-
contentType.includes("xml") ||
|
|
103
|
-
contentType.includes("yaml")) {
|
|
104
|
-
return true;
|
|
105
|
-
}
|
|
106
|
-
return /\.(?:json|jsonl|ndjson|txt|log|md|csv|tsv|ya?ml)$/i.test(entry.path);
|
|
107
|
-
}
|
|
108
|
-
function scanArchiveEntry(entry) {
|
|
109
|
-
const text = new TextDecoder().decode(entry.bytes);
|
|
110
|
-
const parsedValues = parseArchiveTextValues(entry.path, text);
|
|
111
|
-
const rawFindings = parsedValues.length > 0
|
|
112
|
-
? parsedValues.flatMap((value) => [...scanCustodyPayloadForSensitiveValues(value.value)].map((finding) => ({
|
|
113
|
-
...finding,
|
|
114
|
-
path: `${value.path}${finding.path === "$" ? "" : finding.path.slice(1)}`
|
|
115
|
-
})))
|
|
116
|
-
: scanCustodyPayloadForSensitiveValues(text);
|
|
117
|
-
return Object.freeze(rawFindings
|
|
118
|
-
.filter((finding) => !isAllowedArchiveHighEntropyField(entry.path, finding))
|
|
119
|
-
.map((finding) => Object.freeze({
|
|
120
|
-
entryPath: entry.path,
|
|
121
|
-
path: finding.path,
|
|
122
|
-
reason: finding.reason,
|
|
123
|
-
...(finding.valueLength !== undefined ? { valueLength: finding.valueLength } : {})
|
|
124
|
-
})));
|
|
125
|
-
}
|
|
126
|
-
function isAllowedArchiveHighEntropyField(entryPath, finding) {
|
|
127
|
-
if (finding.reason !== "high_entropy_token" || !entryPath.endsWith("manifest.json")) {
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
|
-
return /^\$(?:\.files\[\d+\]|\.sessionFiles\[\d+\])\.id$/.test(finding.path);
|
|
131
|
-
}
|
|
132
|
-
function parseArchiveTextValues(path, text) {
|
|
133
|
-
if (/\.json$/i.test(path)) {
|
|
134
|
-
const parsed = tryParseJson(text);
|
|
135
|
-
return parsed.ok ? Object.freeze([{ path: "$", value: parsed.value }]) : Object.freeze([]);
|
|
136
|
-
}
|
|
137
|
-
if (/\.(?:jsonl|ndjson)$/i.test(path)) {
|
|
138
|
-
const values = [];
|
|
139
|
-
const lines = text.split(/\r?\n/);
|
|
140
|
-
for (let i = 0; i < lines.length; i++) {
|
|
141
|
-
const line = lines[i];
|
|
142
|
-
if (!line?.trim()) {
|
|
143
|
-
continue;
|
|
144
|
-
}
|
|
145
|
-
const parsed = tryParseJson(line);
|
|
146
|
-
if (!parsed.ok) {
|
|
147
|
-
return Object.freeze([]);
|
|
148
|
-
}
|
|
149
|
-
values.push({ path: `$[${i}]`, value: parsed.value });
|
|
150
|
-
}
|
|
151
|
-
return Object.freeze(values);
|
|
152
|
-
}
|
|
153
|
-
return Object.freeze([]);
|
|
154
|
-
}
|
|
155
|
-
function tryParseJson(text) {
|
|
156
|
-
try {
|
|
157
|
-
return { ok: true, value: JSON.parse(text) };
|
|
158
|
-
}
|
|
159
|
-
catch {
|
|
160
|
-
return { ok: false };
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
function formatArchiveFindingPaths(findings) {
|
|
164
|
-
return findings.map((finding) => `${finding.entryPath}${finding.path} (${finding.reason})`).join(", ");
|
|
165
|
-
}
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
export declare const SESSION_RETENTION_SCHEMA_VERSION = 1;
|
|
2
|
-
export declare const SESSION_DELETION_MANIFEST_KIND = "aex.session_deletion_manifest.v1";
|
|
3
|
-
export declare const SESSION_DELETION_JOB_KIND = "aex.session_deletion_job.v1";
|
|
4
|
-
export declare const SESSION_DELETION_MANIFEST_CONTENT_TYPE = "application/json; charset=utf-8";
|
|
5
|
-
export declare const SESSION_RETENTION_REDACTION_SCANNER_VERSION = 1;
|
|
6
|
-
export declare const SESSION_DELETION_REASONS: readonly ["manual_delete", "retention_gc"];
|
|
7
|
-
export type SessionDeletionReason = (typeof SESSION_DELETION_REASONS)[number];
|
|
8
|
-
export declare const SESSION_DELETION_MANIFEST_MODES: readonly ["dry_run", "final"];
|
|
9
|
-
export type SessionDeletionManifestMode = (typeof SESSION_DELETION_MANIFEST_MODES)[number];
|
|
10
|
-
export declare const SESSION_DELETION_CANDIDATE_STATUSES: readonly ["selected", "blocked"];
|
|
11
|
-
export type SessionDeletionCandidateStatus = (typeof SESSION_DELETION_CANDIDATE_STATUSES)[number];
|
|
12
|
-
export declare const SESSION_DELETION_BLOCKERS: readonly ["non_terminal", "retention_policy_disabled", "missing_terminal_at", "unexpired", "held", "retention_exempt", "unresolved_cleanup", "unresolved_custody"];
|
|
13
|
-
export type SessionDeletionBlocker = (typeof SESSION_DELETION_BLOCKERS)[number];
|
|
14
|
-
export declare const SESSION_DELETION_COUNT_CLASSES: readonly ["object_store_objects", "files", "logs", "events", "assets", "db_event_rows", "db_file_rows", "capture_failures", "storage_samples", "custody_manifests"];
|
|
15
|
-
export type SessionDeletionCountClass = (typeof SESSION_DELETION_COUNT_CLASSES)[number];
|
|
16
|
-
export declare const SESSION_DELETION_COUNT_STATUSES: readonly ["counted", "not_counted", "partial", "failed"];
|
|
17
|
-
export type SessionDeletionCountStatus = (typeof SESSION_DELETION_COUNT_STATUSES)[number];
|
|
18
|
-
export declare const SESSION_DELETION_JOB_STATUSES: readonly ["queued", "planning", "blocked", "manifest_written", "deleting", "delete_failed", "completed", "failed"];
|
|
19
|
-
export type SessionDeletionJobStatus = (typeof SESSION_DELETION_JOB_STATUSES)[number];
|
|
20
|
-
export declare const SESSION_DELETION_PROOF_STATUSES: readonly ["not_started", "running", "completed", "failed"];
|
|
21
|
-
export type SessionDeletionProofStatus = (typeof SESSION_DELETION_PROOF_STATUSES)[number];
|
|
22
|
-
export declare const SESSION_DELETION_WRITE_STATUSES: readonly ["not_written", "written", "write_failed"];
|
|
23
|
-
export type SessionDeletionWriteStatus = (typeof SESSION_DELETION_WRITE_STATUSES)[number];
|
|
24
|
-
export declare const SESSION_RETENTION_EXCLUDED_VALUE_CLASSES: readonly ["raw_paths", "object_keys", "filenames", "object_sizes", "hashes", "provider_ids", "vault_ids", "resource_ids", "resource_handles", "signed_urls"];
|
|
25
|
-
export type SessionRetentionExcludedValueClass = (typeof SESSION_RETENTION_EXCLUDED_VALUE_CLASSES)[number];
|
|
26
|
-
export interface SessionRetentionPolicyV1 {
|
|
27
|
-
readonly mode: "retain_indefinitely" | "delete_after_days";
|
|
28
|
-
readonly manualDelete: "enabled";
|
|
29
|
-
readonly automaticDeletion: "disabled" | "enabled";
|
|
30
|
-
readonly retentionDays?: number;
|
|
31
|
-
}
|
|
32
|
-
export interface SessionRetentionPolicyInput {
|
|
33
|
-
readonly automaticDeletion?: boolean;
|
|
34
|
-
readonly retentionDays?: number;
|
|
35
|
-
}
|
|
36
|
-
export interface SessionDeletionCandidateSessionV1 {
|
|
37
|
-
readonly sessionId: string;
|
|
38
|
-
readonly workspaceId: string;
|
|
39
|
-
readonly status: string;
|
|
40
|
-
readonly createdAt?: string;
|
|
41
|
-
readonly terminalAt?: string;
|
|
42
|
-
readonly held?: boolean;
|
|
43
|
-
readonly retentionExempt?: boolean;
|
|
44
|
-
readonly unresolvedCleanup?: boolean;
|
|
45
|
-
readonly unresolvedCustody?: boolean;
|
|
46
|
-
}
|
|
47
|
-
export interface SessionDeletionBlockerV1 {
|
|
48
|
-
readonly code: SessionDeletionBlocker;
|
|
49
|
-
readonly observedAt: string;
|
|
50
|
-
}
|
|
51
|
-
export interface SessionDeletionCandidateV1 {
|
|
52
|
-
readonly status: SessionDeletionCandidateStatus;
|
|
53
|
-
readonly reason: SessionDeletionReason;
|
|
54
|
-
readonly evaluatedAt: string;
|
|
55
|
-
readonly eligibleAt?: string;
|
|
56
|
-
readonly blockers: readonly SessionDeletionBlockerV1[];
|
|
57
|
-
}
|
|
58
|
-
export interface SessionDeletionCandidateInput {
|
|
59
|
-
readonly session: SessionDeletionCandidateSessionV1;
|
|
60
|
-
readonly reason: SessionDeletionReason;
|
|
61
|
-
readonly policy?: SessionRetentionPolicyV1 | SessionRetentionPolicyInput;
|
|
62
|
-
readonly now: string;
|
|
63
|
-
}
|
|
64
|
-
export interface SessionDeletionCountV1 {
|
|
65
|
-
readonly class: SessionDeletionCountClass | string;
|
|
66
|
-
readonly count: number;
|
|
67
|
-
readonly status: SessionDeletionCountStatus;
|
|
68
|
-
readonly countedAt?: string;
|
|
69
|
-
readonly errorClass?: string;
|
|
70
|
-
}
|
|
71
|
-
export interface SessionDeletionManifestSessionV1 {
|
|
72
|
-
readonly sessionId: string;
|
|
73
|
-
readonly workspaceId: string;
|
|
74
|
-
readonly status: string;
|
|
75
|
-
readonly createdAt?: string;
|
|
76
|
-
readonly terminalAt?: string;
|
|
77
|
-
readonly eligibleAt?: string;
|
|
78
|
-
}
|
|
79
|
-
export interface SessionDeletionManifestRequestV1 {
|
|
80
|
-
readonly reason: SessionDeletionReason;
|
|
81
|
-
readonly actorClass: "user" | "api_key" | "system" | "operator";
|
|
82
|
-
}
|
|
83
|
-
export interface SessionDeletionManifestSummaryV1 {
|
|
84
|
-
readonly totalCount: number;
|
|
85
|
-
readonly failedCountClasses: number;
|
|
86
|
-
readonly partialCountClasses: number;
|
|
87
|
-
readonly blockerCount: number;
|
|
88
|
-
readonly counts: readonly SessionDeletionCountV1[];
|
|
89
|
-
}
|
|
90
|
-
export interface SessionDeletionManifestRedactionV1 {
|
|
91
|
-
readonly policy: "counts_status_timestamps_only";
|
|
92
|
-
readonly scannerVersion: typeof SESSION_RETENTION_REDACTION_SCANNER_VERSION;
|
|
93
|
-
readonly excludes: readonly SessionRetentionExcludedValueClass[];
|
|
94
|
-
}
|
|
95
|
-
export interface SessionDeletionManifestV1 {
|
|
96
|
-
readonly schemaVersion: typeof SESSION_RETENTION_SCHEMA_VERSION;
|
|
97
|
-
readonly kind: typeof SESSION_DELETION_MANIFEST_KIND;
|
|
98
|
-
readonly generatedAt: string;
|
|
99
|
-
readonly mode: SessionDeletionManifestMode;
|
|
100
|
-
readonly session: SessionDeletionManifestSessionV1;
|
|
101
|
-
readonly request: SessionDeletionManifestRequestV1;
|
|
102
|
-
readonly candidate: SessionDeletionCandidateV1;
|
|
103
|
-
readonly summary: SessionDeletionManifestSummaryV1;
|
|
104
|
-
readonly redaction: SessionDeletionManifestRedactionV1;
|
|
105
|
-
}
|
|
106
|
-
export interface SessionDeletionManifestInput {
|
|
107
|
-
readonly generatedAt: string;
|
|
108
|
-
readonly mode: SessionDeletionManifestMode;
|
|
109
|
-
readonly session: SessionDeletionCandidateSessionV1;
|
|
110
|
-
readonly request: SessionDeletionManifestRequestV1;
|
|
111
|
-
readonly candidate?: SessionDeletionCandidateV1;
|
|
112
|
-
readonly policy?: SessionRetentionPolicyV1 | SessionRetentionPolicyInput;
|
|
113
|
-
readonly counts?: readonly SessionDeletionCountV1[];
|
|
114
|
-
}
|
|
115
|
-
export interface SessionDeletionManifestProofV1 {
|
|
116
|
-
readonly status: SessionDeletionWriteStatus;
|
|
117
|
-
readonly mode?: SessionDeletionManifestMode;
|
|
118
|
-
readonly writtenAt?: string;
|
|
119
|
-
}
|
|
120
|
-
export interface SessionDeletionPurgeProofV1 {
|
|
121
|
-
readonly status: SessionDeletionProofStatus;
|
|
122
|
-
readonly startedAt?: string;
|
|
123
|
-
readonly completedAt?: string;
|
|
124
|
-
readonly deletedObjectCount?: number;
|
|
125
|
-
}
|
|
126
|
-
export interface SessionDeletionOrderProofV1 {
|
|
127
|
-
readonly manifest: SessionDeletionManifestProofV1;
|
|
128
|
-
readonly purge: SessionDeletionPurgeProofV1;
|
|
129
|
-
}
|
|
130
|
-
export interface SessionDeletionJobV1 {
|
|
131
|
-
readonly schemaVersion: typeof SESSION_RETENTION_SCHEMA_VERSION;
|
|
132
|
-
readonly kind: typeof SESSION_DELETION_JOB_KIND;
|
|
133
|
-
readonly jobId: string;
|
|
134
|
-
readonly sessionId: string;
|
|
135
|
-
readonly workspaceId: string;
|
|
136
|
-
readonly reason: SessionDeletionReason;
|
|
137
|
-
readonly mode: SessionDeletionManifestMode;
|
|
138
|
-
readonly status: SessionDeletionJobStatus;
|
|
139
|
-
readonly createdAt: string;
|
|
140
|
-
readonly updatedAt?: string;
|
|
141
|
-
readonly order: SessionDeletionOrderProofV1;
|
|
142
|
-
readonly candidate?: SessionDeletionCandidateV1;
|
|
143
|
-
readonly summary?: SessionDeletionManifestSummaryV1;
|
|
144
|
-
}
|
|
145
|
-
export interface SessionDeletionJobInput {
|
|
146
|
-
readonly jobId: string;
|
|
147
|
-
readonly sessionId: string;
|
|
148
|
-
readonly workspaceId: string;
|
|
149
|
-
readonly reason: SessionDeletionReason;
|
|
150
|
-
readonly mode: SessionDeletionManifestMode;
|
|
151
|
-
readonly status: SessionDeletionJobStatus;
|
|
152
|
-
readonly createdAt: string;
|
|
153
|
-
readonly updatedAt?: string;
|
|
154
|
-
readonly order: SessionDeletionOrderProofV1;
|
|
155
|
-
readonly candidate?: SessionDeletionCandidateV1;
|
|
156
|
-
readonly summary?: SessionDeletionManifestSummaryV1;
|
|
157
|
-
}
|
|
158
|
-
export interface SessionDeletionManifestWriteObject {
|
|
159
|
-
readonly sessionId: string;
|
|
160
|
-
readonly workspaceId: string;
|
|
161
|
-
readonly contentType: typeof SESSION_DELETION_MANIFEST_CONTENT_TYPE;
|
|
162
|
-
readonly manifest: SessionDeletionManifestV1;
|
|
163
|
-
}
|
|
164
|
-
export interface SessionDeletionManifestObjectStore {
|
|
165
|
-
putSessionDeletionManifestObject(object: SessionDeletionManifestWriteObject): Promise<void>;
|
|
166
|
-
}
|
|
167
|
-
export interface SessionDeletionManifestWriteResult {
|
|
168
|
-
readonly status: "written";
|
|
169
|
-
readonly schemaVersion: typeof SESSION_RETENTION_SCHEMA_VERSION;
|
|
170
|
-
readonly sessionId: string;
|
|
171
|
-
readonly workspaceId: string;
|
|
172
|
-
readonly writtenAt: string;
|
|
173
|
-
readonly mode: SessionDeletionManifestMode;
|
|
174
|
-
}
|
|
175
|
-
export interface SessionDeletionManifestWriter {
|
|
176
|
-
writeSessionDeletionManifest(input: SessionDeletionManifestInput): Promise<SessionDeletionManifestWriteResult>;
|
|
177
|
-
}
|
|
178
|
-
export type SessionRetentionRedactionReason = "forbidden_field_name" | "uninspectable_value" | "bearer_token" | "provider_key" | "signed_url" | "object_store_key" | "vault_id" | "private_resource_handle" | "high_entropy_token" | "hash_like_value";
|
|
179
|
-
export interface SessionRetentionRedactionFinding {
|
|
180
|
-
readonly path: string;
|
|
181
|
-
readonly reason: SessionRetentionRedactionReason;
|
|
182
|
-
readonly valueLength?: number;
|
|
183
|
-
}
|
|
184
|
-
export declare class SessionRetentionValidationError extends Error {
|
|
185
|
-
readonly code = "session_retention_contract_invalid";
|
|
186
|
-
constructor(message: string);
|
|
187
|
-
}
|
|
188
|
-
export declare class SessionRetentionRedactionError extends Error {
|
|
189
|
-
readonly code = "session_retention_payload_not_public_safe";
|
|
190
|
-
readonly findings: readonly SessionRetentionRedactionFinding[];
|
|
191
|
-
constructor(findings: readonly SessionRetentionRedactionFinding[]);
|
|
192
|
-
}
|
|
193
|
-
export declare function createSessionDeletionManifestWriter(store: SessionDeletionManifestObjectStore): SessionDeletionManifestWriter;
|
|
194
|
-
export declare function writeSessionDeletionManifest(store: SessionDeletionManifestObjectStore, input: SessionDeletionManifestInput): Promise<SessionDeletionManifestWriteResult>;
|
|
195
|
-
export declare function buildSessionRetentionPolicy(input?: SessionRetentionPolicyInput): SessionRetentionPolicyV1;
|
|
196
|
-
export declare function evaluateSessionDeletionCandidate(input: SessionDeletionCandidateInput): SessionDeletionCandidateV1;
|
|
197
|
-
export declare function buildSessionDeletionManifest(input: SessionDeletionManifestInput): SessionDeletionManifestV1;
|
|
198
|
-
export declare function assertSessionDeletionOrder(proof: SessionDeletionOrderProofV1): void;
|
|
199
|
-
export declare function buildSessionDeletionJob(input: SessionDeletionJobInput): SessionDeletionJobV1;
|
|
200
|
-
export declare function scanSessionRetentionPayloadForSensitiveValues(input: unknown): readonly SessionRetentionRedactionFinding[];
|
|
201
|
-
export declare function assertPublicSafeSessionRetentionPayload(input: unknown): void;
|