@aexhq/sdk 0.39.0 → 0.40.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 +22 -16
- package/dist/_contracts/api-key.d.ts +49 -0
- package/dist/_contracts/api-key.js +87 -0
- package/dist/_contracts/bundle-manifest.d.ts +86 -0
- package/dist/_contracts/bundle-manifest.js +157 -0
- package/dist/_contracts/error-codes.d.ts +26 -0
- package/dist/_contracts/error-codes.js +79 -0
- package/dist/_contracts/error-factory.d.ts +32 -0
- package/dist/_contracts/error-factory.js +142 -0
- package/dist/_contracts/event-envelope.d.ts +33 -10
- package/dist/_contracts/event-envelope.js +46 -10
- package/dist/_contracts/event-view.d.ts +123 -0
- package/dist/_contracts/event-view.js +120 -0
- package/dist/_contracts/http.js +12 -3
- package/dist/_contracts/index.d.ts +8 -4
- package/dist/_contracts/index.js +11 -7
- package/dist/_contracts/models.d.ts +15 -0
- package/dist/_contracts/models.js +33 -0
- package/dist/_contracts/operations.d.ts +53 -2
- package/dist/_contracts/operations.js +119 -7
- package/dist/_contracts/run-record.d.ts +3 -2
- package/dist/_contracts/runtime-types.d.ts +126 -36
- package/dist/_contracts/runtime-types.js +33 -1
- package/dist/_contracts/sdk-errors.d.ts +61 -2
- package/dist/_contracts/sdk-errors.js +83 -3
- package/dist/_contracts/sdk-secrets.js +31 -6
- package/dist/_contracts/stable.d.ts +14 -0
- package/dist/_contracts/stable.js +14 -0
- package/dist/_contracts/status.d.ts +28 -1
- package/dist/_contracts/status.js +48 -3
- package/dist/_contracts/submission.d.ts +79 -2
- package/dist/_contracts/submission.js +148 -5
- package/dist/_contracts/suggest.d.ts +15 -0
- package/dist/_contracts/suggest.js +54 -0
- package/dist/asset-upload.d.ts +26 -0
- package/dist/asset-upload.js +218 -3
- package/dist/asset-upload.js.map +1 -1
- package/dist/bundle.d.ts +14 -3
- package/dist/bundle.js +34 -14
- package/dist/bundle.js.map +1 -1
- package/dist/canonical-zip.d.ts +68 -0
- package/dist/canonical-zip.js +307 -0
- package/dist/canonical-zip.js.map +1 -0
- package/dist/cli.mjs +1923 -338
- package/dist/cli.mjs.sha256 +1 -1
- package/dist/client.d.ts +217 -58
- package/dist/client.js +749 -261
- package/dist/client.js.map +1 -1
- package/dist/file.d.ts +33 -6
- package/dist/file.js +120 -54
- package/dist/file.js.map +1 -1
- package/dist/index.d.ts +17 -8
- package/dist/index.js +26 -9
- package/dist/index.js.map +1 -1
- package/dist/node-fs.d.ts +26 -9
- package/dist/node-fs.js +13 -38
- package/dist/node-fs.js.map +1 -1
- package/dist/node-walk.d.ts +69 -0
- package/dist/node-walk.js +146 -0
- package/dist/node-walk.js.map +1 -0
- package/dist/retry.d.ts +9 -13
- package/dist/retry.js +18 -17
- package/dist/retry.js.map +1 -1
- package/dist/skill.d.ts +16 -4
- package/dist/skill.js +18 -9
- package/dist/skill.js.map +1 -1
- package/dist/tool.d.ts +14 -2
- package/dist/tool.js +33 -7
- package/dist/tool.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/authentication.md +29 -5
- package/docs/billing.md +6 -0
- package/docs/concepts/agent-tools.md +11 -0
- package/docs/defaults.md +1 -0
- package/docs/errors.md +64 -4
- package/docs/events.md +84 -49
- package/docs/limits-and-quotas.md +24 -0
- package/docs/networking.md +7 -1
- package/docs/outputs.md +36 -7
- package/docs/quickstart.md +17 -7
- package/docs/run-config.md +3 -3
- package/docs/secrets.md +14 -0
- package/examples/feature-tour.ts +4 -6
- package/examples/spike-settle-latency.ts +125 -0
- package/package.json +4 -3
- package/dist/_contracts/event-guards.d.ts +0 -67
- package/dist/_contracts/event-guards.js +0 -36
package/dist/file.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","sourceRoot":"","sources":["../src/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;
|
|
1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AiB,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAClE,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,IAAI,EAAE,CAAC;IAC1C,OAAO,QAAQ,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;AAC3C,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAY;IACrC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAChE,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAChD,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* `McpServer`, `AgentsMd`, `File`, and `Secret`. Everything else is types,
|
|
6
6
|
* errors, and event type guards re-exported from `@aexhq/contracts`.
|
|
7
7
|
*/
|
|
8
|
-
export { Aex, AgentsMdClient, FilesClient, SecretsClient, SessionClient, SessionHandle, SessionTurnStream, SkillsClient } from "./client.js";
|
|
9
|
-
export type { AexOptions, Message, OutputDownloadOptions, OutputFilePathMatch, OutputFilePathSelector, OutputFileSelector, OutputLinkSelector, RunCollectOptions, RunResult, SessionCreateOptions, SessionEnvironmentOptions, SessionEvents, SessionInput, SessionMessages, SessionOutputs, SessionOverrides, SessionRunOptions, SessionRunResult, SessionSendOptions, SessionTurnResult, SessionWebhooks, StreamEventsOptions, WaitForRunOptions } from "./client.js";
|
|
8
|
+
export { Aex, AgentsMdClient, ChildRunHandle, FilesClient, OutputsClient, SecretsClient, SessionClient, SessionHandle, SessionTurnStream, SkillsClient } from "./client.js";
|
|
9
|
+
export type { AexOptions, BatchOptions, Message, OutputDownloadOptions, OutputFilePathMatch, OutputFilePathSelector, OutputFileSelector, OutputLinkSelector, PerSessionOutputSearchQuery, RunCollectOptions, RunEvents, RunOutputs, RunResult, SessionCreateOptions, SessionEnvironmentOptions, SessionEvents, SessionInput, SessionMessages, SessionOutputs, SessionOverrides, SessionRunOptions, SessionRunResult, SessionSendOptions, SessionTerminalRead, SessionTurnResult, SessionWebhooks, SettleAwait, StreamEventsOptions, SubmitResult, WaitForRunOptions } from "./client.js";
|
|
10
10
|
export { Tool } from "./tool.js";
|
|
11
11
|
export { Skill } from "./skill.js";
|
|
12
12
|
export { AgentsMd } from "./agents-md.js";
|
|
@@ -15,23 +15,32 @@ export { McpServer } from "./mcp-server.js";
|
|
|
15
15
|
export { Secret } from "./secret.js";
|
|
16
16
|
export type { SecretEnvSubmissionEntry } from "./secret.js";
|
|
17
17
|
export { bundleSkillFiles, hashSkillBundle } from "./bundle.js";
|
|
18
|
-
export type { BundledSkill, BundledTool, SkillFiles, ToolBundleManifest } from "./bundle.js";
|
|
19
|
-
export { AexApiError, AexError, AexNetworkError, CleanupError, CredentialValidationError, ProviderError, RunConfigValidationError, RunStateError } from "./_contracts/index.js";
|
|
18
|
+
export type { BundledSkill, BundledTool, BundleMeta, SkillFiles, ToolBundleManifest } from "./bundle.js";
|
|
19
|
+
export { AEX_API_ERROR_CODES, AEX_API_ERROR_MESSAGES, AEX_API_ERROR_REMEDIES, AexApiError, AexAuthError, AexError, AexIdempotencyConflictError, AexNetworkError, AexNotFoundError, CleanupError, CredentialValidationError, ProviderError, RunConfigValidationError, RunStateError, apiErrorFromResponse, isAexApiErrorCode, isAuthError, isIdempotencyConflict, isInsufficientScope, isNotFound } from "./_contracts/index.js";
|
|
20
|
+
export type { AexApiErrorCode } from "./_contracts/index.js";
|
|
20
21
|
export { AexRateLimitError, isRateLimited, isThrottleFault, parseProviderFault } from "./retry.js";
|
|
21
22
|
export type { ProviderFault, RetryOptions } from "./retry.js";
|
|
22
23
|
export { MCP_SERVER_NAME_PATTERN, SKILL_BUNDLE_LIMITS, SKILL_NAME_PATTERN, SKILL_RESERVED_NAMES, SkillBundleValidationError, normaliseSkillBundlePath, validateSkillBundleEntry, validateSkillBundleManifest } from "./_contracts/index.js";
|
|
23
24
|
export type { AssetRef, AgentsMdRef, FileRef, McpServerRef, SkillBundleEntry, SkillBundleManifest, SkillRecord as SkillRecordWire, SkillRef, ToolInputSchema, ToolRef } from "./_contracts/index.js";
|
|
24
|
-
export type { AgentsMdRecord as AgentsMdRecordWire, BillingCheckoutPlanKey, BillingCheckoutRequest, BillingHostedSession, BillingLedgerEntry, BillingLedgerPage, BillingLedgerQuery, BillingPortalRequest, BillingSummary, FileRecord as FileRecordWire, Output, OutputFileType, OutputLink, OutputLinkOptions, OutputQuery, OutputSearchQuery, OutputSearchHit, OutputSearchPage, OutputText, ProviderEvent, ReadOutputTextOptions, Run, Session, SessionEvent, SessionListPage, SessionListQuery, SessionRetentionPolicy, SessionStatus, SessionSummary, SessionTurn, RunRecordArchiveFileV1, RunRecordArchiveFileRoleV1, RunRecordArchiveNamespaceV1, RunRecordCostV1, RunRecordDownloadErrorV1, RunRecordFileStatusV1, RunRecordManifestV1, RunRecordMetadataV1, RunRecordNamespaceV1, RunRecordSubmissionSnapshotV1, RunRecordV1,
|
|
25
|
+
export type { AgentsMdRecord as AgentsMdRecordWire, BillingCheckoutPlanKey, BillingCheckoutRequest, BillingHostedSession, BillingLedgerEntry, BillingLedgerPage, BillingLedgerQuery, BillingPortalRequest, BillingSummary, FileRecord as FileRecordWire, Output, OutputFileType, OutputLink, OutputLinkOptions, OutputQuery, OutputSearchQuery, OutputSearchHit, OutputSearchPage, OutputText, ProviderEvent, ReadOutputTextOptions, Run, Session, SessionEvent, SessionListPage, SessionListQuery, SessionRetentionPolicy, SessionStatus, SessionSummary, SessionTurn, RunRecordArchiveFileV1, RunRecordArchiveFileRoleV1, RunRecordArchiveNamespaceV1, RunRecordCostV1, RunRecordDownloadErrorV1, RunRecordFileStatusV1, RunRecordManifestV1, RunRecordMetadataV1, RunRecordNamespaceV1, RunRecordSubmissionSnapshotV1, RunRecordV1, RunWebhookDelivery, RunWebhookDeliveryStatus, RuntimeManifest, SecretRecord, UsageSummary, WebhookSigningSecret, WhoAmI } from "./_contracts/index.js";
|
|
25
26
|
export type { PlatformInlineSecrets as InlineSecrets, PlatformMcpServerSecret as McpServerSecret, PlatformEnvironment as RunEnvironment, PlatformRunSubmissionRequest, RunLimits, RunWebhookSpec, } from "./_contracts/index.js";
|
|
26
27
|
export { CUSTODY_MANIFEST_SCHEMA_VERSION, RUN_RECORD_MANIFEST_SCHEMA_VERSION, RUN_RECORD_SCHEMA_VERSION, DEFAULT_RUNTIME_SIZE, RUNTIME_SIZE_PRESETS, RUNTIME_SIZES } from "./_contracts/index.js";
|
|
27
28
|
export { RuntimeSizes as Sizes } from "./_contracts/index.js";
|
|
28
29
|
export type { RuntimeResources, RuntimeSize } from "./_contracts/index.js";
|
|
29
30
|
export { BUILTIN_TOOL_NAMES, BuiltinTools, DEFAULT_BUILTIN_TOOLS, resolveBuiltinToolNames } from "./_contracts/index.js";
|
|
30
31
|
export type { BuiltinToolName } from "./_contracts/index.js";
|
|
31
|
-
export { DEFAULT_RUN_PROVIDER, RUN_MODELS, RUN_MODELS_BY_PROVIDER, MODEL_PROVIDER_IDS, Models, providerForModel, providersForModel, resolveProviderModelId, isRunModel, parseRunModel, Providers, RUN_PROVIDERS } from "./_contracts/index.js";
|
|
32
|
+
export { DEFAULT_RUN_PROVIDER, RUN_MODELS, RUN_MODELS_BY_PROVIDER, MODEL_PROVIDER_IDS, Models, providerForModel, providersForModel, resolveModelProvider, resolveProviderModelId, isRunModel, parseRunModel, Providers, RUN_PROVIDERS, suggest } from "./_contracts/index.js";
|
|
32
33
|
export type { RunModel, RunProvider } from "./_contracts/index.js";
|
|
33
|
-
export {
|
|
34
|
-
export type {
|
|
34
|
+
export { usageFromProviderUsage } from "./_contracts/index.js";
|
|
35
|
+
export type { BatchItemResult, BatchResult, ChildRunRef, ResolvableRunRef, RunOutcome, RunRefusalReason, SettledResult } from "./_contracts/index.js";
|
|
36
|
+
export { SESSION_STATUSES, SESSION_TERMINAL_OUTCOMES, isTerminalSessionStatus } from "./_contracts/index.js";
|
|
37
|
+
export type { SessionTerminalOutcome } from "./_contracts/index.js";
|
|
38
|
+
export { PLANE_BASE_URLS, parseApiKey } from "./_contracts/index.js";
|
|
39
|
+
export type { ApiKeyPlane, ParsedApiKey } from "./_contracts/index.js";
|
|
40
|
+
export { RESPONSE_FORMAT_KINDS, STREAMABLE_SHAPES, isStreamableProvider, parseApprovalGate, parseResponseFormat } from "./_contracts/index.js";
|
|
41
|
+
export type { ApprovalGate, ResponseFormat, ResponseFormatKind, StreamableShape } from "./_contracts/index.js";
|
|
42
|
+
export { AEX_RUN_SETTLED_NAME } from "./_contracts/index.js";
|
|
43
|
+
export type { AexEventView, TextMessageEventView, ToolCallResultEventView, ToolCallStartEventView } from "./_contracts/index.js";
|
|
35
44
|
export { SecretString, redactSecrets } from "./_contracts/index.js";
|
|
36
45
|
export { verifyAexWebhook } from "./_contracts/index.js";
|
|
37
46
|
export type { VerifyAexWebhookInput } from "./_contracts/index.js";
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* `McpServer`, `AgentsMd`, `File`, and `Secret`. Everything else is types,
|
|
6
6
|
* errors, and event type guards re-exported from `@aexhq/contracts`.
|
|
7
7
|
*/
|
|
8
|
-
export { Aex, AgentsMdClient, FilesClient, SecretsClient, SessionClient, SessionHandle, SessionTurnStream, SkillsClient } from "./client.js";
|
|
8
|
+
export { Aex, AgentsMdClient, ChildRunHandle, FilesClient, OutputsClient, SecretsClient, SessionClient, SessionHandle, SessionTurnStream, SkillsClient } from "./client.js";
|
|
9
9
|
// Composition primitives
|
|
10
10
|
export { Tool } from "./tool.js";
|
|
11
11
|
export { Skill } from "./skill.js";
|
|
@@ -14,8 +14,10 @@ export { File } from "./file.js";
|
|
|
14
14
|
export { McpServer } from "./mcp-server.js";
|
|
15
15
|
export { Secret } from "./secret.js";
|
|
16
16
|
export { bundleSkillFiles, hashSkillBundle } from "./bundle.js";
|
|
17
|
-
// Errors
|
|
18
|
-
|
|
17
|
+
// Errors. One wire→exception factory (`apiErrorFromResponse`) + a stable
|
|
18
|
+
// `apiCode` on every `AexApiError`; typed subclasses (`AexAuthError` /
|
|
19
|
+
// `AexIdempotencyConflictError` / `AexNotFoundError`) each narrow with a guard.
|
|
20
|
+
export { AEX_API_ERROR_CODES, AEX_API_ERROR_MESSAGES, AEX_API_ERROR_REMEDIES, AexApiError, AexAuthError, AexError, AexIdempotencyConflictError, AexNetworkError, AexNotFoundError, CleanupError, CredentialValidationError, ProviderError, RunConfigValidationError, RunStateError, apiErrorFromResponse, isAexApiErrorCode, isAuthError, isIdempotencyConflict, isInsufficientScope, isNotFound } from "./_contracts/index.js";
|
|
19
21
|
// Built-in transport resilience. Every BFF request is retried on transient
|
|
20
22
|
// failures (429/5xx/529 + network errors) with bounded backoff + jitter,
|
|
21
23
|
// honoring `Retry-After`; tune or disable via the client's `retry` option.
|
|
@@ -36,12 +38,27 @@ export { RuntimeSizes as Sizes } from "./_contracts/index.js";
|
|
|
36
38
|
export { BUILTIN_TOOL_NAMES, BuiltinTools, DEFAULT_BUILTIN_TOOLS, resolveBuiltinToolNames } from "./_contracts/index.js";
|
|
37
39
|
// Provider/model surface. Provider choice decides the upstream model route;
|
|
38
40
|
// execution uses the managed path.
|
|
39
|
-
export { DEFAULT_RUN_PROVIDER, RUN_MODELS, RUN_MODELS_BY_PROVIDER, MODEL_PROVIDER_IDS, Models, providerForModel, providersForModel, resolveProviderModelId, isRunModel, parseRunModel, Providers, RUN_PROVIDERS } from "./_contracts/index.js";
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
export {
|
|
41
|
+
export { DEFAULT_RUN_PROVIDER, RUN_MODELS, RUN_MODELS_BY_PROVIDER, MODEL_PROVIDER_IDS, Models, providerForModel, providersForModel, resolveModelProvider, resolveProviderModelId, isRunModel, parseRunModel, Providers, RUN_PROVIDERS, suggest } from "./_contracts/index.js";
|
|
42
|
+
// Unified settled-result / batch / typed-decode / lineage surface (WS3/WS8/WS10).
|
|
43
|
+
export { usageFromProviderUsage } from "./_contracts/index.js";
|
|
44
|
+
// Status vocabulary (WS1): the terminal-outcome half + guard, bound to the run
|
|
45
|
+
// outcome SSoT. The bare session `error` is retired — a failed turn is `failed`.
|
|
46
|
+
export { SESSION_STATUSES, SESSION_TERMINAL_OUTCOMES, isTerminalSessionStatus } from "./_contracts/index.js";
|
|
47
|
+
// Self-describing API-key codec + plane routing (WS11): the constructor parses
|
|
48
|
+
// the key to derive the plane baseUrl and fail fast on a plane mismatch.
|
|
49
|
+
export { PLANE_BASE_URLS, parseApiKey } from "./_contracts/index.js";
|
|
50
|
+
// Structured-output (schema-decode), HITL approval-gate, and the streaming
|
|
51
|
+
// capability model (WS9/WS10).
|
|
52
|
+
export { RESPONSE_FORMAT_KINDS, STREAMABLE_SHAPES, isStreamableProvider, parseApprovalGate, parseResponseFormat } from "./_contracts/index.js";
|
|
53
|
+
// Event methods. Every event the SDK yields — the turn stream (`session.send()`),
|
|
54
|
+
// `session.events().list()`, `session.events().streamEnvelopes()`, and
|
|
55
|
+
// `RunResult.events` — is an `AexEventView`: the coordinator envelope enriched
|
|
56
|
+
// with one type-guard METHOD per standardized event type, so a consumer branches
|
|
57
|
+
// with `event.isTextMessage()` / `event.isToolCallStart()` / `event.isRunError()`
|
|
58
|
+
// / … instead of a free-function guard or a raw `event.type === "…"` compare.
|
|
59
|
+
// `isTextMessage()` / `isToolCallStart()` / `isToolCallResult()` additionally
|
|
60
|
+
// NARROW `event.data` to that type's fields (e.g. `event.data.text` is `string`).
|
|
61
|
+
export { AEX_RUN_SETTLED_NAME } from "./_contracts/index.js";
|
|
45
62
|
// Secret utilities
|
|
46
63
|
export { SecretString, redactSecrets } from "./_contracts/index.js";
|
|
47
64
|
// Webhook verification — customers verify inbound run webhooks (Standard
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,GAAG,EACH,cAAc,EACd,WAAW,EACX,aAAa,EACb,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,YAAY,EACb,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,GAAG,EACH,cAAc,EACd,cAAc,EACd,WAAW,EACX,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,YAAY,EACb,MAAM,aAAa,CAAC;AAkCrB,yBAAyB;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGhE,yEAAyE;AACzE,uEAAuE;AACvE,gFAAgF;AAChF,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,2BAA2B,EAC3B,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,yBAAyB,EACzB,aAAa,EACb,wBAAwB,EACxB,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,WAAW,EACX,qBAAqB,EACrB,mBAAmB,EACnB,UAAU,EACX,MAAM,kB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AAE,MAAM,kBAAkB,CAAC;AAGhE,2EAA2E;AAC3E,+BAA+B;AAC/B,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAG1B,kFAAkF;AAClF,uEAAuE;AACvE,+EAA+E;AAC/E,iFAAiF;AACjF,kFAAkF;AAClF,8EAA8E;AAC9E,8EAA8E;AAC9E,kFAAkF;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAQxD,mBAAmB;AACnB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE/D,yEAAyE;AACzE,6EAA6E;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/node-fs.d.ts
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BundleMeta } from "./bundle.js";
|
|
2
|
+
import { type IgnoreOptions } from "./node-walk.js";
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Fidelity-aware read of a local skill/tool directory into an in-memory files map
|
|
5
|
+
* plus its bundle metadata. Delegates to the shared {@link walkDirectory} (the
|
|
6
|
+
* SAME fidelity walk `File.fromPath` uses), so skills/tools now honor `.aexignore`
|
|
7
|
+
* + the always-on defaults (`.git/`, `node_modules/`, …), capture executable bits
|
|
8
|
+
* + symlinks into `meta` (destined for the `.aexmeta.json` sidecar), and never
|
|
9
|
+
* silently vanish a non-regular file (surfaced in `dropped`).
|
|
8
10
|
*
|
|
9
|
-
*
|
|
10
|
-
* `
|
|
11
|
+
* INVARIANT: for a directory with NO exec bits, NO symlinks, and NO ignored paths,
|
|
12
|
+
* `meta` is empty → the downstream bundler emits NO sidecar, so the bundle bytes
|
|
13
|
+
* are byte-identical to the pre-fidelity `readDirectoryAsFiles` output (dedup
|
|
14
|
+
* continuity). Only metadata (or an `.aexignore`/ignored path) changes the bytes.
|
|
15
|
+
*
|
|
16
|
+
* Bun/Node filesystem runtimes only. Browser callers pass a pre-built files map to
|
|
17
|
+
* `bundleSkillFiles` / `bundleToolFiles` directly and never reach this module.
|
|
11
18
|
*/
|
|
12
|
-
export
|
|
19
|
+
export interface DirectoryBundle {
|
|
20
|
+
/** Regular-file bytes, keyed by forward-slash bundle-relative path. */
|
|
21
|
+
readonly files: Record<string, Uint8Array>;
|
|
22
|
+
/** Exec bits + symlinks → the `.aexmeta.json` sidecar (empty ⇒ no sidecar emitted). */
|
|
23
|
+
readonly meta: BundleMeta;
|
|
24
|
+
/** Non-regular files skipped (FIFO/socket/device) — never silently vanished. Sorted. */
|
|
25
|
+
readonly dropped: readonly string[];
|
|
26
|
+
/** Count of paths pruned by the ignore layers (`.aexignore` + defaults). */
|
|
27
|
+
readonly ignoredCount: number;
|
|
28
|
+
}
|
|
29
|
+
export declare function readDirectoryWithFidelity(rootDir: string, ignore?: IgnoreOptions): Promise<DirectoryBundle>;
|
package/dist/node-fs.js
CHANGED
|
@@ -1,44 +1,19 @@
|
|
|
1
|
-
import { readFile
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
* Walk a local directory and load every regular file into an in-memory
|
|
5
|
-
* `SkillFiles` map. Symlinks and non-regular files are skipped (a
|
|
6
|
-
* symlink that points outside the root would still be skipped because
|
|
7
|
-
* we use `lstat` semantics). Paths are normalised to forward-slash
|
|
8
|
-
* relative form so they can flow into `bundleSkillFiles` directly.
|
|
9
|
-
*
|
|
10
|
-
* Bun/Node filesystem runtimes only. Browser callers should use
|
|
11
|
-
* `bundleSkillFiles` with a pre-built files map instead.
|
|
12
|
-
*/
|
|
13
|
-
export async function readDirectoryAsFiles(rootDir) {
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { walkDirectory } from "./node-walk.js";
|
|
3
|
+
export async function readDirectoryWithFidelity(rootDir, ignore) {
|
|
14
4
|
if (typeof rootDir !== "string" || !rootDir) {
|
|
15
|
-
throw new Error("
|
|
16
|
-
}
|
|
17
|
-
const rootStat = await stat(rootDir);
|
|
18
|
-
if (!rootStat.isDirectory()) {
|
|
19
|
-
throw new Error(`readDirectoryAsFiles: ${rootDir} is not a directory`);
|
|
5
|
+
throw new Error("readDirectoryWithFidelity: rootDir is required");
|
|
20
6
|
}
|
|
7
|
+
const walk = await walkDirectory(rootDir, ignore);
|
|
21
8
|
const files = {};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
async function walk(rootDir, currentDir, out) {
|
|
26
|
-
const entries = await readdir(currentDir, { withFileTypes: true });
|
|
27
|
-
for (const dirent of entries) {
|
|
28
|
-
const full = join(currentDir, dirent.name);
|
|
29
|
-
if (dirent.isSymbolicLink()) {
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
if (dirent.isDirectory()) {
|
|
33
|
-
await walk(rootDir, full, out);
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
if (!dirent.isFile()) {
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
const rel = relative(rootDir, full);
|
|
40
|
-
const posixPath = sep === "/" ? rel : rel.split(sep).join(posix.sep);
|
|
41
|
-
out[posixPath] = await readFile(full);
|
|
9
|
+
for (const entry of walk.entries) {
|
|
10
|
+
files[entry.rel] = new Uint8Array(await readFile(entry.absPath));
|
|
42
11
|
}
|
|
12
|
+
return {
|
|
13
|
+
files,
|
|
14
|
+
meta: { exec: walk.exec, symlinks: walk.symlinks },
|
|
15
|
+
dropped: walk.dropped,
|
|
16
|
+
ignoredCount: walk.ignoredCount
|
|
17
|
+
};
|
|
43
18
|
}
|
|
44
19
|
//# sourceMappingURL=node-fs.js.map
|
package/dist/node-fs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-fs.js","sourceRoot":"","sources":["../src/node-fs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"node-fs.js","sourceRoot":"","sources":["../src/node-fs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAsB,MAAM,gBAAgB,CAAC;AA6BnE,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,OAAe,EAAE,MAAsB;IACrF,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,OAAO,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAClD,MAAM,KAAK,GAA+B,EAAE,CAAC;IAC7C,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,UAAU,CAAC,MAAM,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACnE,CAAC;IACD,OAAO;QACL,KAAK;QACL,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE;QAClD,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,YAAY,EAAE,IAAI,CAAC,YAAY;KAChC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node/Bun-only directory walk with fidelity capture + `.aexignore` filtering.
|
|
3
|
+
*
|
|
4
|
+
* Shared by `File.fromPath` (customer files) and `readDirectoryWithFidelity`
|
|
5
|
+
* (skills/tools). Captures, in ONE deterministic walk:
|
|
6
|
+
* - regular files (bytes),
|
|
7
|
+
* - executable bits (`mode & 0o111` → normalised 0o755 bucket, listed in `exec`),
|
|
8
|
+
* - symlinks (raw `readlink` target, verbatim — the SDK captures faithfully; the
|
|
9
|
+
* container restore decides whether a target may be recreated),
|
|
10
|
+
* - dropped non-regular files (FIFO / socket / char / block device) — never
|
|
11
|
+
* silently vanished, surfaced in `dropped`.
|
|
12
|
+
*
|
|
13
|
+
* Ignore semantics are gitignore-compatible via the `ignore` package: always-on
|
|
14
|
+
* built-in {@link DEFAULT_IGNORES} (`.git/`, `node_modules/`, …), `.gitignore`
|
|
15
|
+
* honored only when opted in, root `.aexignore` on by default and highest
|
|
16
|
+
* precedence, plus programmatic `extraPatterns`. The ignored SET is a pure
|
|
17
|
+
* function of the layered patterns + the sorted path list, so the resulting
|
|
18
|
+
* bundle is deterministic. An ignored directory is pruned wholesale (never
|
|
19
|
+
* descended) — `node_modules` is never walked.
|
|
20
|
+
*
|
|
21
|
+
* Node-only: imports `node:fs` + `ignore`. Browser callers pass pre-built maps to
|
|
22
|
+
* the bundlers and never reach this module.
|
|
23
|
+
*/
|
|
24
|
+
import { type BundleSymlink } from "./_contracts/index.js";
|
|
25
|
+
/** Caller-facing ignore controls, threaded from `File.fromPath` / `Tool.fromPath` / skill factories. */
|
|
26
|
+
export interface IgnoreOptions {
|
|
27
|
+
/** Apply the always-on built-in {@link DEFAULT_IGNORES}. Default true. */
|
|
28
|
+
readonly useDefaults?: boolean;
|
|
29
|
+
/** Also honor the root `.gitignore`. Default false (least-surprise: no silent data loss). */
|
|
30
|
+
readonly useGitignore?: boolean;
|
|
31
|
+
/** Honor the root `.aexignore`. Default true. */
|
|
32
|
+
readonly useAexignore?: boolean;
|
|
33
|
+
/** Extra patterns appended LAST (highest precedence). */
|
|
34
|
+
readonly extraPatterns?: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Always-on ignore defaults (unless `useDefaults:false`): VCS metadata, dependency
|
|
38
|
+
* caches, editor/OS cruft, plus the two aex control files (`.aexignore` and the
|
|
39
|
+
* reserved sidecar). `.gitignore` itself is real repo content and is NOT excluded.
|
|
40
|
+
*/
|
|
41
|
+
export declare const DEFAULT_IGNORES: readonly string[];
|
|
42
|
+
export interface WalkedEntry {
|
|
43
|
+
/** Forward-slash bundle-relative path. */
|
|
44
|
+
readonly rel: string;
|
|
45
|
+
/** Absolute on-disk path (for lazy reads on the streaming path). */
|
|
46
|
+
readonly absPath: string;
|
|
47
|
+
/** Raw byte size from `stat` (drives the small-vs-streaming path decision). */
|
|
48
|
+
readonly size: number;
|
|
49
|
+
}
|
|
50
|
+
export interface WalkResult {
|
|
51
|
+
/** Regular-file descriptors (bytes NOT yet read), globally sorted by `rel`. */
|
|
52
|
+
readonly entries: WalkedEntry[];
|
|
53
|
+
/** Bundle-relative paths that restore executable (0o755). Sorted. */
|
|
54
|
+
readonly exec: string[];
|
|
55
|
+
/** Captured symlinks (raw target). Sorted by path. */
|
|
56
|
+
readonly symlinks: BundleSymlink[];
|
|
57
|
+
/** Non-regular files skipped (FIFO/socket/device), for a non-silent summary. Sorted. */
|
|
58
|
+
readonly dropped: string[];
|
|
59
|
+
/** Count of files/dirs excluded by the ignore layers (surfaced, not silent). */
|
|
60
|
+
readonly ignoredCount: number;
|
|
61
|
+
/** Sum of `entries[i].size` — the total raw input size. */
|
|
62
|
+
readonly totalSize: number;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Walk `rootDir`, capturing files + fidelity metadata + applying the ignore
|
|
66
|
+
* layers. Deterministic: each directory level is read then processed in sorted
|
|
67
|
+
* order, and the returned metadata arrays are sorted.
|
|
68
|
+
*/
|
|
69
|
+
export declare function walkDirectory(rootDir: string, options?: IgnoreOptions): Promise<WalkResult>;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node/Bun-only directory walk with fidelity capture + `.aexignore` filtering.
|
|
3
|
+
*
|
|
4
|
+
* Shared by `File.fromPath` (customer files) and `readDirectoryWithFidelity`
|
|
5
|
+
* (skills/tools). Captures, in ONE deterministic walk:
|
|
6
|
+
* - regular files (bytes),
|
|
7
|
+
* - executable bits (`mode & 0o111` → normalised 0o755 bucket, listed in `exec`),
|
|
8
|
+
* - symlinks (raw `readlink` target, verbatim — the SDK captures faithfully; the
|
|
9
|
+
* container restore decides whether a target may be recreated),
|
|
10
|
+
* - dropped non-regular files (FIFO / socket / char / block device) — never
|
|
11
|
+
* silently vanished, surfaced in `dropped`.
|
|
12
|
+
*
|
|
13
|
+
* Ignore semantics are gitignore-compatible via the `ignore` package: always-on
|
|
14
|
+
* built-in {@link DEFAULT_IGNORES} (`.git/`, `node_modules/`, …), `.gitignore`
|
|
15
|
+
* honored only when opted in, root `.aexignore` on by default and highest
|
|
16
|
+
* precedence, plus programmatic `extraPatterns`. The ignored SET is a pure
|
|
17
|
+
* function of the layered patterns + the sorted path list, so the resulting
|
|
18
|
+
* bundle is deterministic. An ignored directory is pruned wholesale (never
|
|
19
|
+
* descended) — `node_modules` is never walked.
|
|
20
|
+
*
|
|
21
|
+
* Node-only: imports `node:fs` + `ignore`. Browser callers pass pre-built maps to
|
|
22
|
+
* the bundlers and never reach this module.
|
|
23
|
+
*/
|
|
24
|
+
import { readFile, readdir, readlink, stat } from "node:fs/promises";
|
|
25
|
+
import { join, posix, relative, sep } from "node:path";
|
|
26
|
+
import ignore from "ignore";
|
|
27
|
+
import { MAX_SYMLINK_TARGET_LENGTH, RESERVED_META_ENTRY } from "./_contracts/index.js";
|
|
28
|
+
/**
|
|
29
|
+
* Always-on ignore defaults (unless `useDefaults:false`): VCS metadata, dependency
|
|
30
|
+
* caches, editor/OS cruft, plus the two aex control files (`.aexignore` and the
|
|
31
|
+
* reserved sidecar). `.gitignore` itself is real repo content and is NOT excluded.
|
|
32
|
+
*/
|
|
33
|
+
export const DEFAULT_IGNORES = [
|
|
34
|
+
".git/",
|
|
35
|
+
".hg/",
|
|
36
|
+
".svn/",
|
|
37
|
+
"node_modules/",
|
|
38
|
+
"__pycache__/",
|
|
39
|
+
"*.pyc",
|
|
40
|
+
"*.pyo",
|
|
41
|
+
".DS_Store",
|
|
42
|
+
"Thumbs.db"
|
|
43
|
+
];
|
|
44
|
+
/** aex control files always excluded from bundle content (regardless of `useDefaults`). */
|
|
45
|
+
const CONTROL_IGNORES = [".aexignore", RESERVED_META_ENTRY];
|
|
46
|
+
/** Read a root-level ignore control file's patterns (CRLF-normalised), or [] when absent. */
|
|
47
|
+
async function readIgnoreFile(rootDir, name) {
|
|
48
|
+
try {
|
|
49
|
+
const raw = await readFile(join(rootDir, name), "utf8");
|
|
50
|
+
return raw.replace(/\r\n/g, "\n").split("\n");
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return [];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** Build the layered ignore matcher (last layer wins, git semantics). */
|
|
57
|
+
async function buildIgnore(rootDir, options) {
|
|
58
|
+
const ig = ignore();
|
|
59
|
+
if (options?.useDefaults !== false)
|
|
60
|
+
ig.add([...DEFAULT_IGNORES]);
|
|
61
|
+
ig.add([...CONTROL_IGNORES]);
|
|
62
|
+
if (options?.useGitignore === true)
|
|
63
|
+
ig.add(await readIgnoreFile(rootDir, ".gitignore"));
|
|
64
|
+
if (options?.useAexignore !== false)
|
|
65
|
+
ig.add(await readIgnoreFile(rootDir, ".aexignore"));
|
|
66
|
+
if (options?.extraPatterns && options.extraPatterns.length > 0)
|
|
67
|
+
ig.add([...options.extraPatterns]);
|
|
68
|
+
return ig;
|
|
69
|
+
}
|
|
70
|
+
function toPosixRel(rootDir, full) {
|
|
71
|
+
const rel = relative(rootDir, full);
|
|
72
|
+
return sep === "/" ? rel : rel.split(sep).join(posix.sep);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Walk `rootDir`, capturing files + fidelity metadata + applying the ignore
|
|
76
|
+
* layers. Deterministic: each directory level is read then processed in sorted
|
|
77
|
+
* order, and the returned metadata arrays are sorted.
|
|
78
|
+
*/
|
|
79
|
+
export async function walkDirectory(rootDir, options) {
|
|
80
|
+
const ig = await buildIgnore(rootDir, options);
|
|
81
|
+
const entries = [];
|
|
82
|
+
const exec = [];
|
|
83
|
+
const symlinks = [];
|
|
84
|
+
const dropped = [];
|
|
85
|
+
let ignoredCount = 0;
|
|
86
|
+
let totalSize = 0;
|
|
87
|
+
const visit = async (currentDir) => {
|
|
88
|
+
const dirents = await readdir(currentDir, { withFileTypes: true });
|
|
89
|
+
// Sort each level for a deterministic ignored-set + walk order.
|
|
90
|
+
dirents.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
|
|
91
|
+
for (const dirent of dirents) {
|
|
92
|
+
const full = join(currentDir, dirent.name);
|
|
93
|
+
const rel = toPosixRel(rootDir, full);
|
|
94
|
+
if (dirent.isSymbolicLink()) {
|
|
95
|
+
if (ig.ignores(rel)) {
|
|
96
|
+
ignoredCount += 1;
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const target = await readlink(full);
|
|
100
|
+
if (target.includes("\0")) {
|
|
101
|
+
throw new Error(`File.fromPath: symlink ${JSON.stringify(rel)} target contains a NUL byte`);
|
|
102
|
+
}
|
|
103
|
+
if (target.length > MAX_SYMLINK_TARGET_LENGTH) {
|
|
104
|
+
throw new Error(`File.fromPath: symlink ${JSON.stringify(rel)} target exceeds ${MAX_SYMLINK_TARGET_LENGTH} bytes`);
|
|
105
|
+
}
|
|
106
|
+
symlinks.push({ path: rel, target });
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (dirent.isDirectory()) {
|
|
110
|
+
// Directory pruning (git-correct + fast): an ignored dir is never descended.
|
|
111
|
+
if (ig.ignores(`${rel}/`)) {
|
|
112
|
+
ignoredCount += 1;
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
await visit(full);
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (!dirent.isFile()) {
|
|
119
|
+
// FIFO / socket / char / block device — skipped, never silently vanished.
|
|
120
|
+
dropped.push(rel);
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
if (ig.ignores(rel)) {
|
|
124
|
+
ignoredCount += 1;
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
const st = await stat(full);
|
|
128
|
+
entries.push({ rel, absPath: full, size: st.size });
|
|
129
|
+
totalSize += st.size;
|
|
130
|
+
if ((st.mode & 0o111) !== 0)
|
|
131
|
+
exec.push(rel);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
await visit(rootDir);
|
|
135
|
+
// Global lexicographic order (per-level sort is NOT globally sorted across the
|
|
136
|
+
// tree, e.g. `a.txt` vs `a/b.txt`), matching the canonical zip entry order.
|
|
137
|
+
entries.sort((a, b) => byString(a.rel, b.rel));
|
|
138
|
+
exec.sort(byString);
|
|
139
|
+
symlinks.sort((a, b) => byString(a.path, b.path));
|
|
140
|
+
dropped.sort(byString);
|
|
141
|
+
return { entries, exec, symlinks, dropped, ignoredCount, totalSize };
|
|
142
|
+
}
|
|
143
|
+
function byString(a, b) {
|
|
144
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=node-walk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-walk.js","sourceRoot":"","sources":["../src/node-walk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAsB,MAAM,kBAAkB,CAAC;AAgBtG;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAsB;IAChD,OAAO;IACP,MAAM;IACN,OAAO;IACP,eAAe;IACf,cAAc;IACd,OAAO;IAC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) an upstream {@link ProviderFault}. All other exhausted retries
|
|
20
20
|
* fall through to the transport's usual `AexApiError` / network rejection.
|
|
21
21
|
*/
|
|
22
|
-
import {
|
|
22
|
+
import { AexRateLimitError as AexRateLimitErrorBase, isRateLimited, type FetchLike } from "./_contracts/index.js";
|
|
23
|
+
export { isRateLimited };
|
|
23
24
|
/**
|
|
24
25
|
* HTTP statuses that are transient and worth retrying. The billable submits
|
|
25
26
|
* carry an idempotency key, so re-issuing them is safe. Everything not in this
|
|
@@ -104,16 +105,14 @@ export interface ProviderFault {
|
|
|
104
105
|
/** True when a {@link ProviderFault} represents a "back off and retry" signal. */
|
|
105
106
|
export declare function isThrottleFault(fault: ProviderFault): boolean;
|
|
106
107
|
/**
|
|
107
|
-
* Structured throttle error. Extends {@link
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* `attempts`, `source`, and `providerFault`.
|
|
111
|
-
*
|
|
112
|
-
* available, redacted, on `.body`).
|
|
108
|
+
* Structured throttle error. Extends the contracts {@link AexRateLimitErrorBase}
|
|
109
|
+
* (the SINGLE rate-limit class the wire→exception factory also throws, so
|
|
110
|
+
* `isRateLimited` recognises BOTH — no split-brain) and enriches it with the
|
|
111
|
+
* retry-layer detail: `attempts`, `source`, and an upstream `providerFault`.
|
|
112
|
+
* `retryAfterMs` is inherited. The `message` is a fixed, non-leaky summary — it
|
|
113
|
+
* never echoes the raw error body (which is still available, redacted, on `.body`).
|
|
113
114
|
*/
|
|
114
|
-
export declare class AexRateLimitError extends
|
|
115
|
-
/** Milliseconds the server/provider asked us to wait, when known. */
|
|
116
|
-
readonly retryAfterMs?: number;
|
|
115
|
+
export declare class AexRateLimitError extends AexRateLimitErrorBase {
|
|
117
116
|
/** How many attempts were made before giving up. */
|
|
118
117
|
readonly attempts: number;
|
|
119
118
|
/** Whether the throttle came from the aex API plane or the upstream provider. */
|
|
@@ -130,8 +129,6 @@ export declare class AexRateLimitError extends AexApiError {
|
|
|
130
129
|
readonly message?: string;
|
|
131
130
|
});
|
|
132
131
|
}
|
|
133
|
-
/** Type guard for {@link AexRateLimitError}. */
|
|
134
|
-
export declare function isRateLimited(err: unknown): err is AexRateLimitError;
|
|
135
132
|
/**
|
|
136
133
|
* Best-effort parse of an unknown value into a {@link ProviderFault}. Tolerant
|
|
137
134
|
* of two shapes so the SDK consumes the runtime fault the moment it starts
|
|
@@ -159,4 +156,3 @@ export interface RetryDeps {
|
|
|
159
156
|
* an exhausted rate-limit/overloaded status, throws {@link AexRateLimitError}.
|
|
160
157
|
*/
|
|
161
158
|
export declare function withRetry(fetchImpl: FetchLike, retry: RetryOptions | false | undefined, deps?: RetryDeps): FetchLike;
|
|
162
|
-
export {};
|