@semiont/core 0.5.29 → 0.5.31
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/dist/{chunk-45YGPHDK.js → chunk-LAKUQM2K.js} +3 -3
- package/dist/{chunk-45YGPHDK.js.map → chunk-LAKUQM2K.js.map} +1 -1
- package/dist/{chunk-VBMXNYPL.js → chunk-UGI6IOOX.js} +5 -4
- package/dist/chunk-UGI6IOOX.js.map +1 -0
- package/dist/{chunk-MM4HBHMM.js → chunk-W6N56PWO.js} +7 -3
- package/dist/chunk-W6N56PWO.js.map +1 -0
- package/dist/config/node-config-loader.js +2 -2
- package/dist/config/node-config-loader.js.map +1 -1
- package/dist/index.d.ts +279 -74
- package/dist/index.js +65 -22
- package/dist/index.js.map +1 -1
- package/dist/openapi.d.ts +18 -3
- package/dist/openapi.js +4119 -3016
- package/dist/openapi.js.map +1 -1
- package/dist/testing/axioms.js +2 -2
- package/dist/testing.js +2 -2
- package/package.json +2 -2
- package/dist/chunk-MM4HBHMM.js.map +0 -1
- package/dist/chunk-VBMXNYPL.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1538,7 +1538,12 @@ interface components {
|
|
|
1538
1538
|
body?: components["schemas"]["AnnotationBody"] | components["schemas"]["AnnotationBody"][];
|
|
1539
1539
|
/** @description Web Annotation creator — the entity that initiated the annotation. For human-driven work this is a Person; for autonomous-agent work this is a Software peer. */
|
|
1540
1540
|
creator?: components["schemas"]["Agent"];
|
|
1541
|
-
|
|
1541
|
+
/**
|
|
1542
|
+
* Format: date-time
|
|
1543
|
+
* @description When the annotation was MADE — the authoring moment, carried from the event that created it. Not when a projection happened to write it: a store that rebuilds from the log must preserve this value, never restamp it.
|
|
1544
|
+
*/
|
|
1545
|
+
created: string;
|
|
1546
|
+
/** Format: date-time */
|
|
1542
1547
|
modified?: string;
|
|
1543
1548
|
/** @description Web Annotation generator — the SoftwareAgent that produced the annotation, when software was involved. Absent for purely manual annotations. Single object is the common case; array supports pipelines that combine multiple software peers. */
|
|
1544
1549
|
generator?: components["schemas"]["Agent"] | components["schemas"]["Agent"][];
|
|
@@ -1588,7 +1593,7 @@ interface components {
|
|
|
1588
1593
|
domain: string;
|
|
1589
1594
|
isAdmin: boolean;
|
|
1590
1595
|
};
|
|
1591
|
-
/** @description Short-lived access token
|
|
1596
|
+
/** @description Short-lived access token. Use as Authorization: Bearer header on API calls. The TTL is deliberately NOT restated here — docs/system/administration/AUTHENTICATION.md holds the one table of token lifetimes, and a second copy is how this description came to claim an hour for a ten-minute token. A client must refresh from the refresh token rather than assume any particular window. */
|
|
1592
1597
|
token: string;
|
|
1593
1598
|
/** @description Long-lived refresh token (30 days). Exchange via POST /api/tokens/refresh for a fresh access token. */
|
|
1594
1599
|
refreshToken: string;
|
|
@@ -1846,15 +1851,36 @@ interface components {
|
|
|
1846
1851
|
correlationId: string;
|
|
1847
1852
|
resourceId: string;
|
|
1848
1853
|
};
|
|
1849
|
-
/** @description A resource's
|
|
1854
|
+
/** @description A resource's coordinate map, a stored decline, or a named reason there is none (SMELTER-OWNS-OCR P1). Never null: absence used to be a bare null covering four different facts — barrier expired, settled-skipped, no content identity, fold disposed — two of which a caller should retry and two of which it should not. */
|
|
1850
1855
|
BrowseAnchoredTextResult: {
|
|
1851
1856
|
correlationId: string;
|
|
1852
|
-
response:
|
|
1857
|
+
response: components["schemas"]["AnchoredTextAnswer"];
|
|
1853
1858
|
};
|
|
1854
|
-
/**
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1859
|
+
/**
|
|
1860
|
+
* @description What a reader gets when it asks for a resource's coordinate map: the map, a stored decline, or a named absence.
|
|
1861
|
+
*
|
|
1862
|
+
* Distinct from `ExtractionOutcome` on purpose. That type is what the STORE holds and what an extractor RETURNS — neither of which can ever be 'not yet'. This is the read answer, which can, so widening ExtractionOutcome itself would have put an impossible state into the store's own type.
|
|
1863
|
+
*
|
|
1864
|
+
* Flat, one discriminant: every member carries `kind`, rather than nesting an outcome inside a status envelope and giving the wire two `kind` fields at different depths.
|
|
1865
|
+
*/
|
|
1866
|
+
AnchoredTextAnswer: components["schemas"]["ExtractedText"] | components["schemas"]["ExtractionDeclined"] | components["schemas"]["AnchoredTextAbsent"];
|
|
1867
|
+
/**
|
|
1868
|
+
* @description There is no coordinate map to serve, and WHY — the distinction a bare null could not carry (SMELTER-OWNS-OCR P1).
|
|
1869
|
+
*
|
|
1870
|
+
* One member covers all three absences because none carries a payload; `kind` alone is the fact. Retryability is legible from the name, deliberately: a caller must not need a lookup table to decide whether to come back.
|
|
1871
|
+
*/
|
|
1872
|
+
AnchoredTextAbsent: {
|
|
1873
|
+
/**
|
|
1874
|
+
* @description Discriminant, sharing the `kind` field with the ExtractedText/ExtractionDeclined members so the whole answer is one flat union (D6).
|
|
1875
|
+
*
|
|
1876
|
+
* `not-yet` — the Smelter has not settled this content generation: the settle barrier expired, the progress fold was disposed, or it settled indexed and the artifact is missing (the reconcile planner's third drift class, which heals). RETRY.
|
|
1877
|
+
*
|
|
1878
|
+
* `no-map` — the Smelter settled this resource as skipped: its media type derives no geometry, so a map will never exist. TERMINAL.
|
|
1879
|
+
*
|
|
1880
|
+
* `unknown` — no content identity to look up: the resource is not in the view store, or its primary representation carries no checksum. TERMINAL. (enum property replaced by openapi-typescript)
|
|
1881
|
+
* @enum {string}
|
|
1882
|
+
*/
|
|
1883
|
+
kind: "not-yet" | "no-map" | "unknown";
|
|
1858
1884
|
};
|
|
1859
1885
|
/** @description Request to browse a single resource */
|
|
1860
1886
|
BrowseResourceRequest: {
|
|
@@ -1909,6 +1935,8 @@ interface components {
|
|
|
1909
1935
|
};
|
|
1910
1936
|
/** @description Optional resource scope for broadcast channels (e.g. resourceId). Publishers only — clients must never set this. */
|
|
1911
1937
|
scope?: string;
|
|
1938
|
+
/** @description Routing address for this request's reply (CORRELATED-REPLY-ROUTING D1/D2): the emit doubles as a claim on the correlationId, and delivery matches BOTH this and the emitting principal. Top-level, not inside `payload` — a wire concern like `scope`, so it never enters a channel's domain type. Optional in the schema because a plain broadcast needs no return address; the route requires it when the channel is a registered request channel and the payload carries a correlationId. */
|
|
1939
|
+
clientId?: string;
|
|
1912
1940
|
};
|
|
1913
1941
|
/** @description Subscription matrix for the bus SSE stream (MULTI-RESOURCE-SCOPE). `global` channels are delivered unscoped; each `scoped` entry subscribes the connection to one resource scope's channels, optionally resuming replay from that scope's last-seen persisted event id. At least one global channel or one scoped entry is required. */
|
|
1914
1942
|
BusSubscribeRequest: {
|
|
@@ -1925,6 +1953,8 @@ interface components {
|
|
|
1925
1953
|
/** @description This scope's last-seen persisted event id (`p-<scope>-<seq>`). The server replays this scope's persisted events after it before joining the live tail, and emits a scoped `bus:resume-gap` when it cannot cover the gap (unparseable or mismatched id, retention exceeded, or query error). */
|
|
1926
1954
|
lastEventId?: string;
|
|
1927
1955
|
}[];
|
|
1956
|
+
/** @description Routing address for correlated replies (CORRELATED-REPLY-ROUTING D1): a UUID minted once per bus-client lifetime — per actor, NOT per connection, so it survives a make-before-break reconnect and both overlap connections share it. Required: a subscriber without one could never receive a correlated frame, and that must fail loudly here rather than silently at delivery. Not authentication — the JWT stays that; this is an unguessable routing address, never echoed into any payload or broadcast frame. */
|
|
1957
|
+
clientId: string;
|
|
1928
1958
|
};
|
|
1929
1959
|
CloneResourceWithTokenResponse: {
|
|
1930
1960
|
/** @description Generated clone token */
|
|
@@ -2239,6 +2269,8 @@ interface components {
|
|
|
2239
2269
|
};
|
|
2240
2270
|
/** @description Progress payload emitted on the gather:annotation-progress SSE channel during LLM context gathering. */
|
|
2241
2271
|
GatherProgress: {
|
|
2272
|
+
/** @description The request this progress belongs to (CORRELATED-REPLY-ROUTING D3). Required: `CORRELATED_CHANNELS` derives every operation's progress channel into the delivery filter, so a frame without it cannot be matched to a claim and is silently dropped. */
|
|
2273
|
+
correlationId: string;
|
|
2242
2274
|
message?: string;
|
|
2243
2275
|
percentage?: number;
|
|
2244
2276
|
};
|
|
@@ -2497,12 +2529,29 @@ interface components {
|
|
|
2497
2529
|
assessmentsFound: number;
|
|
2498
2530
|
assessmentsCreated: number;
|
|
2499
2531
|
};
|
|
2500
|
-
/** @description Request to cancel a job */
|
|
2532
|
+
/** @description Request to cancel a job. Target one running or pending job by `jobId` (JOB-RESTART-SAFETY P4), or a whole category of pending jobs by `jobType`. A `jobId`-targeted request that names a RUNNING job is honoured cooperatively by the owning worker, which stops at its next unit boundary and emits JobCancelCommand — the queue is never made to yank a running job out from under a live worker. */
|
|
2501
2533
|
JobCancelRequest: {
|
|
2502
2534
|
/** @description Correlation id for request/reply matching, set by the SDK's busRequest so the confirmed-write ack/failure routes back. Absent for the local cancelRequest UI signal. */
|
|
2503
2535
|
correlationId?: string;
|
|
2504
|
-
/** @
|
|
2505
|
-
|
|
2536
|
+
/** @description Cancel this one job. A pending job is cancelled immediately by the gateway; a running job is cancelled cooperatively by its worker. Takes precedence over jobType. */
|
|
2537
|
+
jobId?: string;
|
|
2538
|
+
/**
|
|
2539
|
+
* @description Cancel all PENDING jobs in this category — the bulk UI signal. Ignored when jobId is present.
|
|
2540
|
+
* @enum {string}
|
|
2541
|
+
*/
|
|
2542
|
+
jobType?: "annotation" | "generation";
|
|
2543
|
+
};
|
|
2544
|
+
/** @description A worker's confirmation that it has cooperatively stopped a running job at a unit boundary (JOB-RESTART-SAFETY P4) — the queue moves the job to cancelled/. Distinct from JobCancelRequest (the client→worker REQUEST to stop): this is the worker announcing it did, so the running job is never yanked to cancelled/ out from under a live worker (the roach-motel race). */
|
|
2545
|
+
JobCancelCommand: {
|
|
2546
|
+
/** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
|
|
2547
|
+
_userId?: string;
|
|
2548
|
+
resourceId: string;
|
|
2549
|
+
jobId: string;
|
|
2550
|
+
jobType: components["schemas"]["JobType"];
|
|
2551
|
+
/** @description Annotation this job is attached to, when applicable. Lets the UI route cancellation feedback to a specific annotation. */
|
|
2552
|
+
annotationId?: string;
|
|
2553
|
+
/** @description Entity-type units whose annotations were fully emitted before cancellation. Recorded on the cancelled job's metadata so the work already done stays visible. */
|
|
2554
|
+
completedUnits?: string[];
|
|
2506
2555
|
};
|
|
2507
2556
|
/** @description Command to claim a pending job (atomic CAS: pending → running) */
|
|
2508
2557
|
JobClaimCommand: {
|
|
@@ -2577,6 +2626,23 @@ interface components {
|
|
|
2577
2626
|
/** @description Annotation this job is attached to, when applicable. Lets the UI route failure feedback (error toast, revert state) to a specific annotation. */
|
|
2578
2627
|
annotationId?: string;
|
|
2579
2628
|
error: string;
|
|
2629
|
+
/** @description Entity-type units whose annotations were fully emitted before this failure (checkpointed resume). The queue records them on the retried job's metadata; a retried claim skips them so completed work is neither redone nor duplicated. */
|
|
2630
|
+
completedUnits?: string[];
|
|
2631
|
+
/**
|
|
2632
|
+
* @description Worker-side classification of the failure, made where the error is still typed. 'deterministic' — the same request cannot succeed on a second attempt — skips the retry budget; absent or 'transient' retries as before. Only KNOWN-deterministic failures carry the class.
|
|
2633
|
+
* @enum {string}
|
|
2634
|
+
*/
|
|
2635
|
+
failureClass?: "transient" | "deterministic";
|
|
2636
|
+
/** @description Whether the queue will re-queue this job for another attempt. Computed by the worker from the SAME predicate the queue applies at failJob (one decision site, `willRetryAfter` in @semiont/jobs) using the retry budget carried on the claimed record. FALSE (or absent) means this failure is TERMINAL: a client's job-watch stream ends here. TRUE means the work continues on a fresh attempt — the failure is an event, not the end, and a stream that terminated on it would report a recovering run as a failed one (JOB-RESTART-SAFETY P5). */
|
|
2637
|
+
willRetry?: boolean;
|
|
2638
|
+
};
|
|
2639
|
+
/** @description Command to persist a running job's completed-unit checkpoint AT unit completion (JOB-RESTART-SAFETY P2). Distinct from JobFailCommand's checkpoint, which lands only on a clean failure: a worker that dies (crash/OOM/kill) never emits job:fail, so this durable, unthrottled write is what lets the janitor's stale-running recovery resume a dead worker's job rather than redo its finished units. */
|
|
2640
|
+
JobCheckpointCommand: {
|
|
2641
|
+
/** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
|
|
2642
|
+
_userId?: string;
|
|
2643
|
+
jobId: string;
|
|
2644
|
+
/** @description Entity-type units whose annotations have been fully emitted so far. Unioned into the running job's metadata checkpoint; a retry after recovery skips them. */
|
|
2645
|
+
completedUnits: string[];
|
|
2580
2646
|
};
|
|
2581
2647
|
/** @description Result of a job that completed without doing its work because the resource could not be read. Distinct from a failure: nothing went wrong, there was simply no text to work with — an encrypted or damaged PDF, a scan whose text could not be recognized, or a document that yielded nothing. The reasons are the extraction vocabulary the Smelter reports on `smelt:settled`, MINUS `no-extractor`: a media type that can never yield text (a zip, an image) is a bad request rather than a decline, so a worker asked to detect over one throws and the job reports `job:fail`. Everything here is a resource-specific outcome — the same media type would have succeeded on a different document. */
|
|
2582
2648
|
JobDeclinedResult: {
|
|
@@ -2661,6 +2727,8 @@ interface components {
|
|
|
2661
2727
|
value: string;
|
|
2662
2728
|
/** @description Annotations found for it. */
|
|
2663
2729
|
foundCount: number;
|
|
2730
|
+
/** @description Annotations actually persisted for it — post-dedupe and post-durability-acknowledgement, so it counts what the event log holds, not what the model proposed. Beside foundCount this is the per-unit yield the sizing work is judged by. Present on flows whose units persist as they complete (reference-annotation); the tagging flow reports the same fact as byCategory on its result, because its annotations are built after the per-category loop. */
|
|
2731
|
+
persistedCount?: number;
|
|
2664
2732
|
}[];
|
|
2665
2733
|
/** @description Echoed job parameters for display in the progress UI. `label` is a CODE, not a sentence — the client owns the wording, same rule as the progress message. `value` is the user's own input (an entity-type list, their instructions) and is deliberately NOT translated: it is their words, not ours. */
|
|
2666
2734
|
requestParams?: {
|
|
@@ -2939,6 +3007,29 @@ interface components {
|
|
|
2939
3007
|
annotationId: string;
|
|
2940
3008
|
};
|
|
2941
3009
|
};
|
|
3010
|
+
/** @description Bus command to persist a detection unit's annotations as one acknowledged batch (JOB-RESTART-SAFETY P6). Unlike mark:create, which is fire-and-forget and resolves when the bus accepts it, this command is answered only after every annotation is in the event log — so a worker can gate unit completion on durability rather than on emission. The batch is the unit: a partial commit is reported as a failure, and the worker retries the whole unit, which is safe because annotation ids are deterministic (P3). */
|
|
3011
|
+
MarkCommitCommand: {
|
|
3012
|
+
/** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
|
|
3013
|
+
_userId?: string;
|
|
3014
|
+
/** @description Correlation id set by busRequest so the mark:commit-ok / mark:commit-failed reply routes back to the awaiting worker. */
|
|
3015
|
+
correlationId: string;
|
|
3016
|
+
/** @description Resource every annotation in this batch targets. */
|
|
3017
|
+
resourceId: string;
|
|
3018
|
+
/** @description The unit's annotations, already built with deterministic ids. Re-committing an identical batch is a no-op rather than a duplicate. */
|
|
3019
|
+
annotations: components["schemas"]["Annotation"][];
|
|
3020
|
+
};
|
|
3021
|
+
/** @description Durability acknowledgement for a mark:commit batch: every annotation named by the command is in the event log at the moment this is emitted. */
|
|
3022
|
+
MarkCommitOk: {
|
|
3023
|
+
/** @description Correlation id echoed from the mark:commit command so busRequest can match the reply. */
|
|
3024
|
+
correlationId: string;
|
|
3025
|
+
/** @description What the commit persisted. */
|
|
3026
|
+
response: {
|
|
3027
|
+
/** @description Annotations this commit appended to the event log. Equals the batch size on success — a retry re-appends what already landed rather than counting it out, because the annotation fold is idempotent by id and the log is append-only. Not a dedupe count. */
|
|
3028
|
+
persisted: number;
|
|
3029
|
+
/** @description Ids the batch covers, whether appended now or already present. */
|
|
3030
|
+
annotationIds: string[];
|
|
3031
|
+
};
|
|
3032
|
+
};
|
|
2942
3033
|
/** @description Raw annotation creation intent — bus handler assembles the W3C annotation */
|
|
2943
3034
|
MarkCreateRequest: {
|
|
2944
3035
|
correlationId: string;
|
|
@@ -3747,6 +3838,7 @@ interface CreateAnnotationInternal {
|
|
|
3747
3838
|
target: Annotation['target'];
|
|
3748
3839
|
body?: Annotation['body'];
|
|
3749
3840
|
creator: components['schemas']['Agent'];
|
|
3841
|
+
created: Annotation['created'];
|
|
3750
3842
|
}
|
|
3751
3843
|
|
|
3752
3844
|
/**
|
|
@@ -4049,6 +4141,16 @@ type EventMap = {
|
|
|
4049
4141
|
'mark:update-entity-types': components['schemas']['MarkUpdateEntityTypesCommand'];
|
|
4050
4142
|
'mark:create-ok': components['schemas']['MarkCreateOk'];
|
|
4051
4143
|
'mark:create-failed': components['schemas']['CommandError'];
|
|
4144
|
+
/**
|
|
4145
|
+
* Persist a detection unit's annotations as ONE acknowledged batch
|
|
4146
|
+
* (JOB-RESTART-SAFETY P6). Answered only after every annotation is in
|
|
4147
|
+
* the event log, so a worker can gate unit completion on durability
|
|
4148
|
+
* instead of on emission — which is what makes an Archivist outage a
|
|
4149
|
+
* delay rather than silent data loss.
|
|
4150
|
+
*/
|
|
4151
|
+
'mark:commit': components['schemas']['MarkCommitCommand'];
|
|
4152
|
+
'mark:commit-ok': components['schemas']['MarkCommitOk'];
|
|
4153
|
+
'mark:commit-failed': components['schemas']['CommandError'];
|
|
4052
4154
|
'mark:delete-ok': components['schemas']['MarkDeleteOk'];
|
|
4053
4155
|
'mark:delete-failed': components['schemas']['CommandError'];
|
|
4054
4156
|
'mark:archive-ok': {
|
|
@@ -4142,21 +4244,10 @@ type EventMap = {
|
|
|
4142
4244
|
correlationId: string;
|
|
4143
4245
|
} & components['schemas']['CommandError'];
|
|
4144
4246
|
'browse:anchored-text-requested': components['schemas']['BrowseAnchoredTextRequest'];
|
|
4145
|
-
'browse:anchored-text-result':
|
|
4146
|
-
correlationId: string;
|
|
4147
|
-
response: components['schemas']['ExtractionOutcome'] | null;
|
|
4148
|
-
};
|
|
4247
|
+
'browse:anchored-text-result': components['schemas']['BrowseAnchoredTextResult'];
|
|
4149
4248
|
'browse:anchored-text-failed': {
|
|
4150
4249
|
correlationId: string;
|
|
4151
4250
|
} & components['schemas']['CommandError'];
|
|
4152
|
-
'browse:anchored-text-by-checksum-requested': components['schemas']['BrowseAnchoredTextByChecksumRequest'];
|
|
4153
|
-
'browse:anchored-text-by-checksum-result': {
|
|
4154
|
-
correlationId: string;
|
|
4155
|
-
response: components['schemas']['ExtractionOutcome'] | null;
|
|
4156
|
-
};
|
|
4157
|
-
'browse:anchored-text-by-checksum-failed': {
|
|
4158
|
-
correlationId: string;
|
|
4159
|
-
} & components['schemas']['CommandError'];
|
|
4160
4251
|
'browse:resources-requested': components['schemas']['BrowseResourcesRequest'];
|
|
4161
4252
|
'browse:resources-result': {
|
|
4162
4253
|
correlationId: string;
|
|
@@ -4262,8 +4353,10 @@ type EventMap = {
|
|
|
4262
4353
|
'job:report-progress': components['schemas']['JobReportProgressCommand'];
|
|
4263
4354
|
'job:complete': components['schemas']['JobCompleteCommand'];
|
|
4264
4355
|
'job:fail': components['schemas']['JobFailCommand'];
|
|
4356
|
+
'job:checkpoint': components['schemas']['JobCheckpointCommand'];
|
|
4265
4357
|
'job:queued': components['schemas']['JobQueuedEvent'];
|
|
4266
4358
|
'job:cancel-requested': components['schemas']['JobCancelRequest'];
|
|
4359
|
+
'job:cancel': components['schemas']['JobCancelCommand'];
|
|
4267
4360
|
'job:status-requested': components['schemas']['JobStatusRequest'];
|
|
4268
4361
|
'job:create': components['schemas']['JobCreateCommand'];
|
|
4269
4362
|
'job:claim': components['schemas']['JobClaimCommand'];
|
|
@@ -4463,6 +4556,9 @@ declare const CHANNEL_SCHEMAS: {
|
|
|
4463
4556
|
readonly 'frame:add-tag-schema': "FrameAddTagSchemaCommand";
|
|
4464
4557
|
readonly 'mark:create-ok': "MarkCreateOk";
|
|
4465
4558
|
readonly 'mark:create-failed': "CommandError";
|
|
4559
|
+
readonly 'mark:commit': "MarkCommitCommand";
|
|
4560
|
+
readonly 'mark:commit-ok': "MarkCommitOk";
|
|
4561
|
+
readonly 'mark:commit-failed': "CommandError";
|
|
4466
4562
|
readonly 'mark:delete-ok': "MarkDeleteOk";
|
|
4467
4563
|
readonly 'mark:delete-failed': "CommandError";
|
|
4468
4564
|
readonly 'mark:archive-ok': null;
|
|
@@ -4512,9 +4608,6 @@ declare const CHANNEL_SCHEMAS: {
|
|
|
4512
4608
|
readonly 'browse:anchored-text-requested': "BrowseAnchoredTextRequest";
|
|
4513
4609
|
readonly 'browse:anchored-text-result': "BrowseAnchoredTextResult";
|
|
4514
4610
|
readonly 'browse:anchored-text-failed': null;
|
|
4515
|
-
readonly 'browse:anchored-text-by-checksum-requested': "BrowseAnchoredTextByChecksumRequest";
|
|
4516
|
-
readonly 'browse:anchored-text-by-checksum-result': "BrowseAnchoredTextResult";
|
|
4517
|
-
readonly 'browse:anchored-text-by-checksum-failed': null;
|
|
4518
4611
|
readonly 'browse:resources-requested': "BrowseResourcesRequest";
|
|
4519
4612
|
readonly 'browse:resources-result': "BrowseResourcesResult";
|
|
4520
4613
|
readonly 'browse:resources-failed': null;
|
|
@@ -4571,8 +4664,10 @@ declare const CHANNEL_SCHEMAS: {
|
|
|
4571
4664
|
readonly 'job:report-progress': "JobReportProgressCommand";
|
|
4572
4665
|
readonly 'job:complete': "JobCompleteCommand";
|
|
4573
4666
|
readonly 'job:fail': "JobFailCommand";
|
|
4667
|
+
readonly 'job:checkpoint': "JobCheckpointCommand";
|
|
4574
4668
|
readonly 'job:queued': "JobQueuedEvent";
|
|
4575
4669
|
readonly 'job:cancel-requested': "JobCancelRequest";
|
|
4670
|
+
readonly 'job:cancel': "JobCancelCommand";
|
|
4576
4671
|
readonly 'job:status-requested': "JobStatusRequest";
|
|
4577
4672
|
readonly 'job:create': "JobCreateCommand";
|
|
4578
4673
|
readonly 'job:claim': "JobClaimCommand";
|
|
@@ -5363,6 +5458,15 @@ interface AnchoredText {
|
|
|
5363
5458
|
* the generated spec type so the wire shape has exactly one authority.
|
|
5364
5459
|
*/
|
|
5365
5460
|
type ExtractionOutcome = components['schemas']['ExtractionOutcome'];
|
|
5461
|
+
/**
|
|
5462
|
+
* What a READER gets when it asks for a resource's map: the map, a stored
|
|
5463
|
+
* decline, or a named absence (SMELTER-OWNS-OCR P1).
|
|
5464
|
+
*
|
|
5465
|
+
* Deliberately wider than `ExtractionOutcome`, which is what the store HOLDS and
|
|
5466
|
+
* what an extractor RETURNS — neither of which can ever be "not yet". Widening
|
|
5467
|
+
* that type instead would have put an impossible state into the store's own.
|
|
5468
|
+
*/
|
|
5469
|
+
type AnchoredTextAnswer = components['schemas']['AnchoredTextAnswer'];
|
|
5366
5470
|
/**
|
|
5367
5471
|
* One text run as pdf.js reports it, narrowed to the fields anchoring reads.
|
|
5368
5472
|
* Structural on purpose: core takes no dependency on pdfjs-dist, so each
|
|
@@ -5639,21 +5743,28 @@ declare class ConflictError extends SemiontError {
|
|
|
5639
5743
|
type Agent$1 = components['schemas']['Agent'];
|
|
5640
5744
|
type GetResourceResponse = components['schemas']['GetResourceResponse'];
|
|
5641
5745
|
/**
|
|
5642
|
-
*
|
|
5746
|
+
* Seven-state lifecycle for a transport's connection. Drives UI affordances
|
|
5643
5747
|
* (connecting spinners, reconnecting banners, etc.) and is observed via
|
|
5644
5748
|
* `ITransport.state$`.
|
|
5645
5749
|
*
|
|
5646
|
-
* initial
|
|
5647
|
-
*
|
|
5648
|
-
* connecting
|
|
5649
|
-
* open
|
|
5650
|
-
* reconnecting
|
|
5651
|
-
* degraded
|
|
5652
|
-
*
|
|
5653
|
-
*
|
|
5654
|
-
*
|
|
5655
|
-
|
|
5656
|
-
|
|
5750
|
+
* initial ─ pre-`start()`; never enters subscribers' streams
|
|
5751
|
+
* except as the first replayed value
|
|
5752
|
+
* connecting ─ in-flight initial open
|
|
5753
|
+
* open ─ healthy, delivering events
|
|
5754
|
+
* reconnecting ─ open → dropped, retrying; may be transient
|
|
5755
|
+
* degraded ─ has been reconnecting for > DEGRADED_THRESHOLD_MS;
|
|
5756
|
+
* UI banner threshold; distinguishes brief mount-
|
|
5757
|
+
* churn cycles from sustained disconnection
|
|
5758
|
+
* unauthenticated ─ not attempting: the credential is absent, or was
|
|
5759
|
+
* refused (401) and only a DIFFERENT one is worth
|
|
5760
|
+
* trying. No network activity; recovers on its own
|
|
5761
|
+
* when a usable credential appears (a re-login, a
|
|
5762
|
+
* session refresh). The refusal itself surfaces on
|
|
5763
|
+
* the transport's error stream (SSE-AUTH-RESILIENCE
|
|
5764
|
+
* D3/D6a — one state for both answers)
|
|
5765
|
+
* closed ─ stop()/dispose() called; terminal
|
|
5766
|
+
*/
|
|
5767
|
+
type ConnectionState = 'initial' | 'connecting' | 'open' | 'reconnecting' | 'degraded' | 'unauthenticated' | 'closed';
|
|
5657
5768
|
type AuthResponse = components['schemas']['AuthResponse'];
|
|
5658
5769
|
type TokenRefreshResponse = components['schemas']['TokenRefreshResponse'];
|
|
5659
5770
|
type AdminUserStatsResponse = components['schemas']['AdminUserStatsResponse'];
|
|
@@ -5927,10 +6038,6 @@ declare const BUS_OPERATIONS: {
|
|
|
5927
6038
|
readonly result: "browse:anchored-text-result";
|
|
5928
6039
|
readonly failure: "browse:anchored-text-failed";
|
|
5929
6040
|
};
|
|
5930
|
-
readonly 'browse:anchored-text-by-checksum-requested': {
|
|
5931
|
-
readonly result: "browse:anchored-text-by-checksum-result";
|
|
5932
|
-
readonly failure: "browse:anchored-text-by-checksum-failed";
|
|
5933
|
-
};
|
|
5934
6041
|
readonly 'browse:resources-requested': {
|
|
5935
6042
|
readonly result: "browse:resources-result";
|
|
5936
6043
|
readonly failure: "browse:resources-failed";
|
|
@@ -6016,6 +6123,10 @@ declare const BUS_OPERATIONS: {
|
|
|
6016
6123
|
readonly result: "mark:create-ok";
|
|
6017
6124
|
readonly failure: "mark:create-failed";
|
|
6018
6125
|
};
|
|
6126
|
+
readonly 'mark:commit': {
|
|
6127
|
+
readonly result: "mark:commit-ok";
|
|
6128
|
+
readonly failure: "mark:commit-failed";
|
|
6129
|
+
};
|
|
6019
6130
|
readonly 'mark:delete': {
|
|
6020
6131
|
readonly result: "mark:delete-ok";
|
|
6021
6132
|
readonly failure: "mark:delete-failed";
|
|
@@ -6100,7 +6211,7 @@ type BusOperationKey = keyof typeof BUS_OPERATIONS;
|
|
|
6100
6211
|
* and SSE infrastructure. A reply channel must NOT go here — declare its
|
|
6101
6212
|
* operation in `BUS_OPERATIONS` instead.
|
|
6102
6213
|
*/
|
|
6103
|
-
declare const BRIDGED_BROADCASTS: readonly ["job:report-progress", "job:complete", "job:fail", "frame:entity-type-added", "frame:tag-schema-added", "beckon:focus", "beckon:sparkle", "bus:resume-gap", "browse:resource-open", "browse:resource-viewed", "session:joined", "session:left", "browse:click"];
|
|
6214
|
+
declare const BRIDGED_BROADCASTS: readonly ["job:report-progress", "job:complete", "job:fail", "frame:entity-type-added", "frame:tag-schema-added", "yield:created", "yield:updated", "yield:cloned", "yield:moved", "beckon:focus", "beckon:sparkle", "bus:resume-gap", "browse:resource-open", "browse:resource-viewed", "session:joined", "session:left", "browse:click"];
|
|
6104
6215
|
type OpSpecs = (typeof BUS_OPERATIONS)[keyof typeof BUS_OPERATIONS];
|
|
6105
6216
|
type ProgressChannel<O> = O extends {
|
|
6106
6217
|
progress: infer P extends EventName;
|
|
@@ -6125,11 +6236,24 @@ type BridgedChannel = RegistryReply | (typeof BRIDGED_BROADCASTS)[number];
|
|
|
6125
6236
|
type BusReply<Op extends BusOperationKey> = EventMap[(typeof BUS_OPERATIONS)[Op]['result'] & EventName] extends {
|
|
6126
6237
|
response: infer R;
|
|
6127
6238
|
} ? R : void;
|
|
6128
|
-
type BusRequestErrorCode = 'bus.timeout' | 'bus.rejected' | 'bus.closed' | 'bus.bad-payload' | 'bus.unauthorized' | 'bus.forbidden' | 'bus.not-found';
|
|
6239
|
+
type BusRequestErrorCode = 'bus.timeout' | 'bus.rejected' | 'bus.closed' | 'bus.bad-payload' | 'bus.unauthorized' | 'bus.forbidden' | 'bus.not-found' | 'bus.unsubscribed';
|
|
6129
6240
|
declare class BusRequestError extends SemiontError {
|
|
6130
6241
|
code: BusRequestErrorCode;
|
|
6131
6242
|
constructor(message: string, code: BusRequestErrorCode, details?: Record<string, unknown>);
|
|
6132
6243
|
}
|
|
6244
|
+
/**
|
|
6245
|
+
* The reply channels — result, failure, and (for streaming operations)
|
|
6246
|
+
* progress — of every operation in `channels`, deduplicated. Entries that
|
|
6247
|
+
* are not operation request channels (broadcast signals, domain events)
|
|
6248
|
+
* contribute nothing.
|
|
6249
|
+
*
|
|
6250
|
+
* This is THE derivation for a narrowed-subscription transport profile
|
|
6251
|
+
* (`HttpTransportConfig.channels`: subscribe exactly the reply channels of
|
|
6252
|
+
* the operations a process awaits) and for a service's outbound reply pump
|
|
6253
|
+
* (forward exactly the replies of the operations it answers). Restating a
|
|
6254
|
+
* reply channel by hand was the recurring unbridged-reply bug class.
|
|
6255
|
+
*/
|
|
6256
|
+
declare function replyChannelsFor(channels: readonly string[]): EventName[];
|
|
6133
6257
|
/**
|
|
6134
6258
|
* Subset of ITransport that `busRequest` needs: a way to send a command and
|
|
6135
6259
|
* a way to observe channels. Generic enough that an in-process transport
|
|
@@ -6163,6 +6287,16 @@ interface BusRequestPrimitive {
|
|
|
6163
6287
|
* lose replies omits the surface and `busRequest` behaves as before.
|
|
6164
6288
|
*/
|
|
6165
6289
|
trackReply?(correlationId: string): () => void;
|
|
6290
|
+
/**
|
|
6291
|
+
* Whether this transport's receive path delivers `channel` — i.e. a reply
|
|
6292
|
+
* published there can actually reach this process. Wire transports whose
|
|
6293
|
+
* subscription set is configurable (a worker subscribing only the reply
|
|
6294
|
+
* channels it awaits) implement this so `busRequest` on a channel outside
|
|
6295
|
+
* the set fails fast with `bus.unsubscribed` instead of burning its
|
|
6296
|
+
* timeout on a reply that could never arrive. OPTIONAL: an in-process
|
|
6297
|
+
* transport delivers every channel and omits it.
|
|
6298
|
+
*/
|
|
6299
|
+
isSubscribed?(channel: string): boolean;
|
|
6166
6300
|
}
|
|
6167
6301
|
/**
|
|
6168
6302
|
* Request/reply over the bus, keyed by the operation's request channel.
|
|
@@ -6590,8 +6724,11 @@ declare function isValidEmail(email: string): boolean;
|
|
|
6590
6724
|
* - `render` — which viewer the UI mounts ('none' → metadata + download)
|
|
6591
6725
|
* - `anchoring` — which annotation model applies: character-offset text
|
|
6592
6726
|
* selectors vs spatial geometry (PDFs are spatial)
|
|
6593
|
-
* - `
|
|
6594
|
-
* embedding, never
|
|
6727
|
+
* - `textSource` — WHERE a type's text comes from: decoded from its own bytes,
|
|
6728
|
+
* or derived by reading them ('none' → skip embedding, never
|
|
6729
|
+
* mojibake). Named `extractText` until READ-VS-EXTRACT P3,
|
|
6730
|
+
* which called decoding an extraction — the conflation that
|
|
6731
|
+
* let a worker OCR PDFs for four months (#739)
|
|
6595
6732
|
* - `authorable` — offered in the compose editor's format dropdown
|
|
6596
6733
|
* - `uploadable` — big tent: true for every registry member
|
|
6597
6734
|
* - `generatable` — the generation worker can produce it as a yield artifact
|
|
@@ -6614,7 +6751,7 @@ declare function isValidEmail(email: string): boolean;
|
|
|
6614
6751
|
type SupportedMediaType = components['schemas']['SupportedMediaType'];
|
|
6615
6752
|
type RenderMode = 'text' | 'image' | 'pdf' | 'none';
|
|
6616
6753
|
type AnchoringModel = 'text-selector' | 'spatial' | 'none';
|
|
6617
|
-
type
|
|
6754
|
+
type TextSource = 'decode' | 'pdf-text-layer' | 'none';
|
|
6618
6755
|
interface MediaTypeCapabilities {
|
|
6619
6756
|
/** Canonical file extension, with leading dot. */
|
|
6620
6757
|
extension: `.${string}`;
|
|
@@ -6622,7 +6759,7 @@ interface MediaTypeCapabilities {
|
|
|
6622
6759
|
label: string;
|
|
6623
6760
|
render: RenderMode;
|
|
6624
6761
|
anchoring: AnchoringModel;
|
|
6625
|
-
|
|
6762
|
+
textSource: TextSource;
|
|
6626
6763
|
authorable: boolean;
|
|
6627
6764
|
uploadable: boolean;
|
|
6628
6765
|
/** Whether the generation worker can produce this type as a yield artifact.
|
|
@@ -6645,7 +6782,7 @@ declare const MEDIA_TYPES: {
|
|
|
6645
6782
|
label: string;
|
|
6646
6783
|
render: "text";
|
|
6647
6784
|
anchoring: "text-selector";
|
|
6648
|
-
|
|
6785
|
+
textSource: "decode";
|
|
6649
6786
|
authorable: true;
|
|
6650
6787
|
uploadable: true;
|
|
6651
6788
|
generatable: true;
|
|
@@ -6655,7 +6792,7 @@ declare const MEDIA_TYPES: {
|
|
|
6655
6792
|
label: string;
|
|
6656
6793
|
render: "text";
|
|
6657
6794
|
anchoring: "text-selector";
|
|
6658
|
-
|
|
6795
|
+
textSource: "decode";
|
|
6659
6796
|
authorable: true;
|
|
6660
6797
|
uploadable: true;
|
|
6661
6798
|
generatable: true;
|
|
@@ -6665,7 +6802,7 @@ declare const MEDIA_TYPES: {
|
|
|
6665
6802
|
label: string;
|
|
6666
6803
|
render: "text";
|
|
6667
6804
|
anchoring: "text-selector";
|
|
6668
|
-
|
|
6805
|
+
textSource: "decode";
|
|
6669
6806
|
authorable: true;
|
|
6670
6807
|
uploadable: true;
|
|
6671
6808
|
generatable: false;
|
|
@@ -6675,7 +6812,7 @@ declare const MEDIA_TYPES: {
|
|
|
6675
6812
|
label: string;
|
|
6676
6813
|
render: "text";
|
|
6677
6814
|
anchoring: "text-selector";
|
|
6678
|
-
|
|
6815
|
+
textSource: "decode";
|
|
6679
6816
|
authorable: false;
|
|
6680
6817
|
uploadable: true;
|
|
6681
6818
|
generatable: false;
|
|
@@ -6685,7 +6822,7 @@ declare const MEDIA_TYPES: {
|
|
|
6685
6822
|
label: string;
|
|
6686
6823
|
render: "image";
|
|
6687
6824
|
anchoring: "spatial";
|
|
6688
|
-
|
|
6825
|
+
textSource: "none";
|
|
6689
6826
|
authorable: false;
|
|
6690
6827
|
uploadable: true;
|
|
6691
6828
|
generatable: false;
|
|
@@ -6695,7 +6832,7 @@ declare const MEDIA_TYPES: {
|
|
|
6695
6832
|
label: string;
|
|
6696
6833
|
render: "image";
|
|
6697
6834
|
anchoring: "spatial";
|
|
6698
|
-
|
|
6835
|
+
textSource: "none";
|
|
6699
6836
|
authorable: false;
|
|
6700
6837
|
uploadable: true;
|
|
6701
6838
|
generatable: false;
|
|
@@ -6705,7 +6842,7 @@ declare const MEDIA_TYPES: {
|
|
|
6705
6842
|
label: string;
|
|
6706
6843
|
render: "pdf";
|
|
6707
6844
|
anchoring: "spatial";
|
|
6708
|
-
|
|
6845
|
+
textSource: "pdf-text-layer";
|
|
6709
6846
|
authorable: false;
|
|
6710
6847
|
uploadable: true;
|
|
6711
6848
|
generatable: true;
|
|
@@ -6803,29 +6940,56 @@ declare function extensionForMediaType(format: string): string;
|
|
|
6803
6940
|
*/
|
|
6804
6941
|
declare function mediaTypeForExtension(ext: string): SupportedMediaType | undefined;
|
|
6805
6942
|
/**
|
|
6806
|
-
*
|
|
6807
|
-
*
|
|
6808
|
-
*
|
|
6809
|
-
*
|
|
6943
|
+
* WHERE a format's text comes from. Registry rows answer directly; on a registry
|
|
6944
|
+
* miss, base types under text/* decode (RFC 2046 guarantees the text top-level
|
|
6945
|
+
* type is textual — imported unregistered text subtypes embed too), everything
|
|
6946
|
+
* else is 'none'.
|
|
6947
|
+
*
|
|
6948
|
+
* The three answers are different operations, not degrees of one: `decode` is a
|
|
6949
|
+
* pure charset-aware `Buffer → string` anyone holding bytes may run;
|
|
6950
|
+
* `pdf-text-layer` parses and, failing that, OCRs — expensive, not deterministic
|
|
6951
|
+
* across engine versions, and runnable only by the process that persists its
|
|
6952
|
+
* output. Calling both "extraction" is what this accessor was named for until
|
|
6953
|
+
* READ-VS-EXTRACT P3.
|
|
6954
|
+
*/
|
|
6955
|
+
declare function textSourceOf(format: string): TextSource;
|
|
6956
|
+
/**
|
|
6957
|
+
* WHETHER a type's extracted text carries geometry — page-positioned runs
|
|
6958
|
+
* rather than a bare string. Answers "should an anchored-text artifact exist
|
|
6959
|
+
* for this resource?" (PERSIST-ANCHORS P0, the third drift class) and "does
|
|
6960
|
+
* this type anchor spatially or by character offset?".
|
|
6961
|
+
*
|
|
6962
|
+
* Derived from `textSource`, not stored: until READ-VS-EXTRACT P1 this was a
|
|
6963
|
+
* `yieldsGeometry` boolean declared on each `TextExtractor` in
|
|
6964
|
+
* `@semiont/content` — a property of the STRATEGY, declared per-implementation,
|
|
6965
|
+
* in a different package from the strategy vocabulary. Two facts that must
|
|
6966
|
+
* agree, gated by nothing, and consumers asking about a media type had to
|
|
6967
|
+
* resolve an implementation to get an answer.
|
|
6968
|
+
*
|
|
6969
|
+
* Lenient like `textSourceOf`, not strict like `isAnnotatable`. An
|
|
6970
|
+
* unregistered `text/*` type decodes, and decoding yields no geometry — so
|
|
6971
|
+
* `false` here is a real answer rather than a refusal. Nothing downstream is a
|
|
6972
|
+
* durable write against a coordinate model, which is what makes `isAnnotatable`
|
|
6973
|
+
* strict.
|
|
6810
6974
|
*/
|
|
6811
|
-
declare function
|
|
6975
|
+
declare function yieldsGeometryOf(format: string): boolean;
|
|
6812
6976
|
/**
|
|
6813
6977
|
* WHETHER a type can carry annotations — `anchoring` remains the authority on
|
|
6814
6978
|
* HOW. Derived rather than stored: a parallel `annotatable` row field would be
|
|
6815
6979
|
* two facts that can disagree, with nothing to adjudicate
|
|
6816
6980
|
* `{ annotatable: true, anchoring: 'none' }`.
|
|
6817
6981
|
*
|
|
6818
|
-
* Strict on a registry miss, where `
|
|
6819
|
-
* asymmetry is deliberate.
|
|
6820
|
-
*
|
|
6982
|
+
* Strict on a registry miss, where `textSourceOf` above is lenient. The
|
|
6983
|
+
* asymmetry is deliberate. Reading the wrong bytes costs one bad vector, and
|
|
6984
|
+
* refusing to read costs a resource nobody can find, so the text source
|
|
6821
6985
|
* guesses; an annotation is a durable write against a coordinate model the
|
|
6822
6986
|
* system does not have for an unknown type, so it refuses.
|
|
6823
6987
|
*/
|
|
6824
6988
|
declare function isAnnotatable(format: string): boolean;
|
|
6825
6989
|
/** Types offered in the compose editor's format dropdown. */
|
|
6826
6990
|
declare const AUTHORABLE_MEDIA_TYPES: readonly SupportedMediaType[];
|
|
6827
|
-
/** Registry rows whose text the Smelter can
|
|
6828
|
-
* text/* fallback in `
|
|
6991
|
+
/** Registry rows whose text the Smelter can get at, by either route. Rows only —
|
|
6992
|
+
* the text/* fallback in `textSourceOf` isn't enumerable. */
|
|
6829
6993
|
declare const EMBEDDABLE_MEDIA_TYPES: readonly SupportedMediaType[];
|
|
6830
6994
|
/** Types the generation worker can produce as a yield artifact — the
|
|
6831
6995
|
* `outputMediaType` gate reads this, not a local table. */
|
|
@@ -6834,6 +6998,12 @@ declare const GENERATABLE_MEDIA_TYPES: readonly SupportedMediaType[];
|
|
|
6834
6998
|
/**
|
|
6835
6999
|
* Resource input/output types
|
|
6836
7000
|
*/
|
|
7001
|
+
|
|
7002
|
+
/**
|
|
7003
|
+
* What the byte door reports about bytes it just stored. A projection of the
|
|
7004
|
+
* specced Representation — drop a field there and this stops compiling.
|
|
7005
|
+
*/
|
|
7006
|
+
type StoredResource = Required<Pick<components['schemas']['Representation'], 'storageUri' | 'checksum' | 'byteSize' | 'created'>>;
|
|
6837
7007
|
interface UpdateResourceInput {
|
|
6838
7008
|
name?: string;
|
|
6839
7009
|
entityTypes?: string[];
|
|
@@ -7893,7 +8063,7 @@ declare function deriveViews(graph: KnowledgeGraph, mainResourceId: string, foca
|
|
|
7893
8063
|
interface RetryPolicy {
|
|
7894
8064
|
/** Total attempts, including the first one. */
|
|
7895
8065
|
attempts: number;
|
|
7896
|
-
/**
|
|
8066
|
+
/** Ceiling on the delay before the second attempt; doubles each retry. */
|
|
7897
8067
|
initialDelayMs: number;
|
|
7898
8068
|
/** Ceiling for the doubled delay. */
|
|
7899
8069
|
maxDelayMs: number;
|
|
@@ -7908,8 +8078,10 @@ interface RetryAttemptInfo {
|
|
|
7908
8078
|
error: unknown;
|
|
7909
8079
|
}
|
|
7910
8080
|
/**
|
|
7911
|
-
* Default policy for startup connections to the gateway: 8 attempts with
|
|
7912
|
-
*
|
|
8081
|
+
* Default policy for startup connections to the gateway: 8 attempts with delay
|
|
8082
|
+
* ceilings 1s, 2s, 4s, then capped at 8s — up to ~39s of patience before giving
|
|
8083
|
+
* up. "Up to", because the backoff is equal-jittered: each wait lands in
|
|
8084
|
+
* [cap/2, cap), so the worst case is that sum and the expected case is ~75% of it.
|
|
7913
8085
|
*/
|
|
7914
8086
|
declare const STARTUP_FETCH_RETRY: RetryPolicy;
|
|
7915
8087
|
/**
|
|
@@ -7921,10 +8093,43 @@ declare const STARTUP_FETCH_RETRY: RetryPolicy;
|
|
|
7921
8093
|
*/
|
|
7922
8094
|
declare function isTransientFetchError(error: unknown): boolean;
|
|
7923
8095
|
/**
|
|
7924
|
-
*
|
|
7925
|
-
*
|
|
7926
|
-
*
|
|
7927
|
-
*
|
|
8096
|
+
* An error that knows the HTTP status the server answered with.
|
|
8097
|
+
*
|
|
8098
|
+
* Structural rather than a class, because the class already exists:
|
|
8099
|
+
* http-transport's `APIError` carries `status` and cannot be named from here
|
|
8100
|
+
* without inverting the package dependency. This interface is the contract
|
|
8101
|
+
* between the thrower and `isRetryableRequestError`, stated once — a predicate
|
|
8102
|
+
* that recovered the status by parsing it back out of an error MESSAGE would be
|
|
8103
|
+
* a second statement of the same fact, in the fragile direction.
|
|
8104
|
+
*/
|
|
8105
|
+
interface HttpStatusError extends Error {
|
|
8106
|
+
readonly status: number;
|
|
8107
|
+
}
|
|
8108
|
+
/**
|
|
8109
|
+
* True for failures worth another attempt: the connection never landed
|
|
8110
|
+
* (`isTransientFetchError`), the server answered "not now"
|
|
8111
|
+
* (`RETRYABLE_STATUSES`), or our own deadline expired.
|
|
8112
|
+
*
|
|
8113
|
+
* The timeout case is the one that is easy to get wrong. `AbortSignal.timeout()`
|
|
8114
|
+
* rejects with a **DOMException named `TimeoutError`**, not a `TypeError` —
|
|
8115
|
+
* measured, not assumed — so `isTransientFetchError` cannot see it, and a
|
|
8116
|
+
* request that bounded itself was unretryable precisely when the bound fired.
|
|
8117
|
+
* Matched by `name` rather than `instanceof DOMException` because the constructor
|
|
8118
|
+
* is not guaranteed present in every runtime this package builds for, while the
|
|
8119
|
+
* name is part of the DOM spec.
|
|
8120
|
+
*
|
|
8121
|
+
* Auth and validation failures stay excluded, preserving `isTransientFetchError`'s
|
|
8122
|
+
* reasoning verbatim: a 401 means the gateway is UP and rejected us, and retrying
|
|
8123
|
+
* will not change its mind. A 429 differs — the gateway is up and *asking* us to
|
|
8124
|
+
* wait, so the same "it answered" fact points the other way.
|
|
8125
|
+
*/
|
|
8126
|
+
declare function isRetryableRequestError(error: unknown): boolean;
|
|
8127
|
+
/**
|
|
8128
|
+
* Run `fn`, retrying on errors `isRetryable` accepts, with equal-jitter
|
|
8129
|
+
* exponential backoff per `policy`. `onRetry` fires before each wait — the
|
|
8130
|
+
* caller's hook for logging the attempt, and it reports the actual jittered
|
|
8131
|
+
* delay. The final error (retryable budget exhausted, or the first
|
|
8132
|
+
* non-retryable one) is rethrown verbatim.
|
|
7928
8133
|
*/
|
|
7929
8134
|
declare function retryWithBackoff<T>(fn: () => Promise<T>, isRetryable: (error: unknown) => boolean, policy: RetryPolicy, onRetry?: (info: RetryAttemptInfo) => void): Promise<T>;
|
|
7930
8135
|
|
|
@@ -7994,5 +8199,5 @@ declare function getShardPath(key: string, numBuckets?: number): [string, string
|
|
|
7994
8199
|
*/
|
|
7995
8200
|
declare const DISCOVERY_URL_PATH = "/discovery/kbs.json";
|
|
7996
8201
|
|
|
7997
|
-
export { AUTHORABLE_MEDIA_TYPES, BRIDGED_CHANNELS, BUS_OPERATIONS, BusRequestError, CHANNEL_SCHEMAS, CONTEXT_FULL_WEIGHT, CONTEXT_PARTIAL_WEIGHT, ConfigurationError, ConflictError, DEFAULT_CHUNKING_CONFIG, DISCOVERY_URL_PATH, EMBEDDABLE_MEDIA_TYPES, EventBus, GENERATABLE_MEDIA_TYPES, JWTTokenSchema, LOCALES, MEDIA_TYPES, NotFoundError, PERSISTED_EVENT_TYPES, POSITION_WEIGHT_MAX, POSITION_WINDOW, RESOURCE_BROADCAST_TYPES, STARTUP_FETCH_RETRY, ScopedEventBus, ScriptError, SemiontError, UnauthorizedError, ValidationError, accessToken, agentToDid, anchorAnnotation, anchorRuns, annotationId, annotationUri, applyBodyOperations, assembleAnnotation, authCode, baseMediaType, baseUrl, buildContentCache, burstBuffer, busLog, busLogEnabled, busRequest, capabilitiesOf, chunkText, cloneFormat, cloneToken, createCircleSvg, createFragmentSelector, createPolygonSvg, createRectangleSvg, createTomlConfigLoader, decodeRepresentation, decodeWithCharset, deriveStorageUri, deriveViews, didToAgent, email, entityType, errField, estimateTokens, extensionForMediaType, extractBoundingBox, extractCharset, extractContext, findBestTextMatch, findBodyItem, findClaimSpan, folderOf, formatLocaleDisplay, generateUuid, getAllLocaleCodes, getAllPlatformTypes, getAnnotationExactText, getAnnotationUriFromEvent, getBodySource, getBodyType, getChecksum, getCommentText, getCreator, getDerivedFrom, getExactText, getFragmentSelector, getLanguage, getLocaleEnglishName, getLocaleInfo, getLocaleNativeName, getNodeEncoding, getPageFromFragment, getPrimaryMediaType, getPrimaryRepresentation, getPrimarySelector, getResourceEntityTypes, getResourceId, getShardPath, getStorageUri, getSvgSelector, getTargetSelector, getTargetSource, getTextPositionSelector, getTextQuoteSelector, googleCredential, hasTargetSelector, isAnnotatable, isAnnotationId, isArchived, isArray, isAssessment, isBodyResolved, isBoolean, isComment, isDefined, isDraft, isEventRelatedToAnnotation, isFunction, isGatheredContext, isGenerationJobParams, isHighlight, isNull, isNullish, isNumber, isObject, isReference, isResolvedReference, isResourceId, isStoredEvent, isString, isStubReference, isSupportedMediaType, isTag, isTextRun, isTransientFetchError, isUndefined, isValidEmail, isValidPlatformType, jobId, jumpConsistentHash, kbDid, loadTomlConfig, locate, mcpToken, mediaTypeForExtension, normalizeCoordinates, normalizeText, parseEnvironment, parseFragmentSelector, parseSvgSelector, proposeStoragePath, reconcileSelector, refreshToken, resourceAnnotationUri, resourceId, resourceUri, retryWithBackoff, scaleSvgToNative, searchQuery, serializePerKey, setBusLogTraceIdProvider, softwareToAgent, storageFileName,
|
|
7998
|
-
export type { AccessToken, AnchorConfidence, AnchorMethod, AnchorRect, AnchorSelectors, AnchorStrategy, AnchoredText, AnchoringModel, Annotation, AnnotationCategory, AnnotationId, AnnotationUri, AnthropicProviderConfig, AppConfig, ArchivistServiceConfig, AssembledAnnotation, AuthCode, BaseUrl, BodyItem, BodyItemIdentity, BodyOperation, BoundingBox, Brand, BridgedChannel, BurstBufferOptions, BusOp, BusOperationKey, BusOperationSpec, BusRequestErrorCode, BusRequestPrimitive, ChunkingConfig, CloneToken, CollaboratorEntry, ConnectionState, ContentCache, ContentFormat, CreateAnnotationInternal, DatabaseServiceConfig, DiscoveredKB, DiscoveryDocument, Email, EmbeddingServiceConfig, EmittableChannel, EntityType, EntityTypeStats, Environment, EnvironmentConfig, EventBase, EventInput, EventMap, EventMetadata, EventName, EventOfType, EventQuery, EventSignature, ExtractionOutcome, FragmentSelector, GatewayServiceConfig, GatheredContext, GenerationJobParams, GoogleAuthRequest, GoogleCredential, GraphConnection, GraphDatabaseType, GraphPath, GraphServiceConfig, GraphViews, HealthCheckResponse, IContentTransport, IGatewayOperations, ITransport, InferenceProvidersConfig, JobId, JobType, ListUsersResponse, LlmSelectorInput, LocaleInfo, Logger, MCPToken, MatchQuality, McpServiceConfig, MediaTypeCapabilities, Motivation, OllamaProviderConfig, PdfCoordinate, PdfTextItem, PdfTextRun, PersistedEvent, PersistedEventType, PlatformType, Point, PutBinaryOptions, PutBinaryProgress, PutBinaryRequest, ReconciledSelector, RefreshToken, RenderMode, RenderedAnchor, ResourceAnnotationUri, ResourceAnnotations, ResourceBroadcastType, ResourceDescriptor, ResourceFilter, ResourceId, ResourceUri, RetryAttemptInfo, RetryPolicy, SearchQuery, SelectionData, Selector, SemiontConfig, ServicePlatformConfig, ServicesConfig, SiteConfig, StateUnit, StatusResponse, StoredEvent, StoredEventLike, SupportedMediaType, SvgSelector, TagCategory, TagSchema,
|
|
8202
|
+
export { AUTHORABLE_MEDIA_TYPES, BRIDGED_CHANNELS, BUS_OPERATIONS, BusRequestError, CHANNEL_SCHEMAS, CONTEXT_FULL_WEIGHT, CONTEXT_PARTIAL_WEIGHT, ConfigurationError, ConflictError, DEFAULT_CHUNKING_CONFIG, DISCOVERY_URL_PATH, EMBEDDABLE_MEDIA_TYPES, EventBus, GENERATABLE_MEDIA_TYPES, JWTTokenSchema, LOCALES, MEDIA_TYPES, NotFoundError, PERSISTED_EVENT_TYPES, POSITION_WEIGHT_MAX, POSITION_WINDOW, RESOURCE_BROADCAST_TYPES, STARTUP_FETCH_RETRY, ScopedEventBus, ScriptError, SemiontError, UnauthorizedError, ValidationError, accessToken, agentToDid, anchorAnnotation, anchorRuns, annotationId, annotationUri, applyBodyOperations, assembleAnnotation, authCode, baseMediaType, baseUrl, buildContentCache, burstBuffer, busLog, busLogEnabled, busRequest, capabilitiesOf, chunkText, cloneFormat, cloneToken, createCircleSvg, createFragmentSelector, createPolygonSvg, createRectangleSvg, createTomlConfigLoader, decodeRepresentation, decodeWithCharset, deriveStorageUri, deriveViews, didToAgent, email, entityType, errField, estimateTokens, extensionForMediaType, extractBoundingBox, extractCharset, extractContext, findBestTextMatch, findBodyItem, findClaimSpan, folderOf, formatLocaleDisplay, generateUuid, getAllLocaleCodes, getAllPlatformTypes, getAnnotationExactText, getAnnotationUriFromEvent, getBodySource, getBodyType, getChecksum, getCommentText, getCreator, getDerivedFrom, getExactText, getFragmentSelector, getLanguage, getLocaleEnglishName, getLocaleInfo, getLocaleNativeName, getNodeEncoding, getPageFromFragment, getPrimaryMediaType, getPrimaryRepresentation, getPrimarySelector, getResourceEntityTypes, getResourceId, getShardPath, getStorageUri, getSvgSelector, getTargetSelector, getTargetSource, getTextPositionSelector, getTextQuoteSelector, googleCredential, hasTargetSelector, isAnnotatable, isAnnotationId, isArchived, isArray, isAssessment, isBodyResolved, isBoolean, isComment, isDefined, isDraft, isEventRelatedToAnnotation, isFunction, isGatheredContext, isGenerationJobParams, isHighlight, isNull, isNullish, isNumber, isObject, isReference, isResolvedReference, isResourceId, isRetryableRequestError, isStoredEvent, isString, isStubReference, isSupportedMediaType, isTag, isTextRun, isTransientFetchError, isUndefined, isValidEmail, isValidPlatformType, jobId, jumpConsistentHash, kbDid, loadTomlConfig, locate, mcpToken, mediaTypeForExtension, normalizeCoordinates, normalizeText, parseEnvironment, parseFragmentSelector, parseSvgSelector, proposeStoragePath, reconcileSelector, refreshToken, replyChannelsFor, resourceAnnotationUri, resourceId, resourceUri, retryWithBackoff, scaleSvgToNative, searchQuery, serializePerKey, setBusLogTraceIdProvider, softwareToAgent, storageFileName, textSourceOf, textUnder, userDID, userId, userToAgent, userToDid, uuidV4, validateData, validateEnvironment, validateSvgMarkup, verifyPosition, yieldsGeometryOf };
|
|
8203
|
+
export type { AccessToken, AnchorConfidence, AnchorMethod, AnchorRect, AnchorSelectors, AnchorStrategy, AnchoredText, AnchoredTextAnswer, AnchoringModel, Annotation, AnnotationCategory, AnnotationId, AnnotationUri, AnthropicProviderConfig, AppConfig, ArchivistServiceConfig, AssembledAnnotation, AuthCode, BaseUrl, BodyItem, BodyItemIdentity, BodyOperation, BoundingBox, Brand, BridgedChannel, BurstBufferOptions, BusOp, BusOperationKey, BusOperationSpec, BusRequestErrorCode, BusRequestPrimitive, ChunkingConfig, CloneToken, CollaboratorEntry, ConnectionState, ContentCache, ContentFormat, CreateAnnotationInternal, DatabaseServiceConfig, DiscoveredKB, DiscoveryDocument, Email, EmbeddingServiceConfig, EmittableChannel, EntityType, EntityTypeStats, Environment, EnvironmentConfig, EventBase, EventInput, EventMap, EventMetadata, EventName, EventOfType, EventQuery, EventSignature, ExtractionOutcome, FragmentSelector, GatewayServiceConfig, GatheredContext, GenerationJobParams, GoogleAuthRequest, GoogleCredential, GraphConnection, GraphDatabaseType, GraphPath, GraphServiceConfig, GraphViews, HealthCheckResponse, HttpStatusError, IContentTransport, IGatewayOperations, ITransport, InferenceProvidersConfig, JobId, JobType, ListUsersResponse, LlmSelectorInput, LocaleInfo, Logger, MCPToken, MatchQuality, McpServiceConfig, MediaTypeCapabilities, Motivation, OllamaProviderConfig, PdfCoordinate, PdfTextItem, PdfTextRun, PersistedEvent, PersistedEventType, PlatformType, Point, PutBinaryOptions, PutBinaryProgress, PutBinaryRequest, ReconciledSelector, RefreshToken, RenderMode, RenderedAnchor, ResourceAnnotationUri, ResourceAnnotations, ResourceBroadcastType, ResourceDescriptor, ResourceFilter, ResourceId, ResourceUri, RetryAttemptInfo, RetryPolicy, SearchQuery, SelectionData, Selector, SemiontConfig, ServicePlatformConfig, ServicesConfig, SiteConfig, StateUnit, StatusResponse, StoredEvent, StoredEventLike, StoredResource, SupportedMediaType, SvgSelector, TagCategory, TagSchema, TextPosition, TextPositionSelector, TextQuoteSelector, TextSource, ActorInferenceConfig as TomlActorInferenceConfig, TomlFileReader, InferenceConfig as TomlInferenceConfig, WorkerInferenceConfig as TomlWorkerInferenceConfig, TransportErrorCode, UpdateResourceInput, UpdateUserRequest, UpdateUserResponse, UserDID, UserId, UserResponse, ValidationFailure, ValidationResult, ValidationSuccess, VectorsServiceConfig, components, operations, paths };
|