@semiont/core 0.5.11 → 0.5.13
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/index.d.ts +149 -14
- package/dist/index.js +44 -3
- package/dist/index.js.map +1 -1
- package/dist/testing.d.ts +106 -6
- package/dist/testing.js +3 -0
- package/dist/testing.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -3343,6 +3343,15 @@ interface components {
|
|
|
3343
3343
|
domain: string;
|
|
3344
3344
|
tags: components["schemas"]["TagCategory"][];
|
|
3345
3345
|
};
|
|
3346
|
+
/** @description Bus command to rebuild the graph projection from the event log — the whole graph when resourceId is absent, one resource when present. Served by the Weaver; replaces direct rebuild access, which does not survive the Weaver's container split. */
|
|
3347
|
+
WeaveRebuildCommand: {
|
|
3348
|
+
/** @description Correlation id for request/reply matching, set by busRequest so the ok/failed reply routes back. */
|
|
3349
|
+
correlationId?: string;
|
|
3350
|
+
/** @description When present, rebuild only this resource; otherwise clear and rebuild the entire graph. */
|
|
3351
|
+
resourceId?: string;
|
|
3352
|
+
/** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
|
|
3353
|
+
_userId?: string;
|
|
3354
|
+
};
|
|
3346
3355
|
/** @description Bus command to create a cloned resource from a clone token. */
|
|
3347
3356
|
YieldCloneCreateCommand: {
|
|
3348
3357
|
correlationId: string;
|
|
@@ -3785,6 +3794,22 @@ type BindUpdateBodyCommand = components['schemas']['BindUpdateBodyCommand'] & {
|
|
|
3785
3794
|
* - Commands/reads/results/UI: OpenAPI schema refs — plain strings
|
|
3786
3795
|
* - void: UI-only signals with no payload
|
|
3787
3796
|
*/
|
|
3797
|
+
/**
|
|
3798
|
+
* Viewport-space rectangle of a clicked annotation element — runtime-only
|
|
3799
|
+
* view geometry riding UI events (never wire vocabulary; deliberately not in
|
|
3800
|
+
* the OpenAPI schemas). Structurally satisfied by a DOM `DOMRect`, spelled
|
|
3801
|
+
* out here because this package compiles without the DOM lib.
|
|
3802
|
+
*/
|
|
3803
|
+
interface AnchorRect {
|
|
3804
|
+
x: number;
|
|
3805
|
+
y: number;
|
|
3806
|
+
width: number;
|
|
3807
|
+
height: number;
|
|
3808
|
+
top: number;
|
|
3809
|
+
right: number;
|
|
3810
|
+
bottom: number;
|
|
3811
|
+
left: number;
|
|
3812
|
+
}
|
|
3788
3813
|
type EventMap = {
|
|
3789
3814
|
'yield:created': StoredEvent<EventOfType<'yield:created'>>;
|
|
3790
3815
|
'yield:cloned': StoredEvent<EventOfType<'yield:cloned'>>;
|
|
@@ -3906,22 +3931,46 @@ type EventMap = {
|
|
|
3906
3931
|
} & components['schemas']['CommandError'];
|
|
3907
3932
|
'gather:annotation-progress': components['schemas']['GatherProgress'];
|
|
3908
3933
|
'browse:resource-requested': components['schemas']['BrowseResourceRequest'];
|
|
3909
|
-
'browse:resource-result':
|
|
3934
|
+
'browse:resource-result': {
|
|
3935
|
+
correlationId: string;
|
|
3936
|
+
response: Omit<components['schemas']['GetResourceResponse'], 'resource' | 'annotations' | 'entityReferences'> & {
|
|
3937
|
+
resource: ResourceDescriptor;
|
|
3938
|
+
annotations: Annotation[];
|
|
3939
|
+
entityReferences: Annotation[];
|
|
3940
|
+
};
|
|
3941
|
+
};
|
|
3910
3942
|
'browse:resource-failed': {
|
|
3911
3943
|
correlationId: string;
|
|
3912
3944
|
} & components['schemas']['CommandError'];
|
|
3913
3945
|
'browse:resources-requested': components['schemas']['BrowseResourcesRequest'];
|
|
3914
|
-
'browse:resources-result':
|
|
3946
|
+
'browse:resources-result': {
|
|
3947
|
+
correlationId: string;
|
|
3948
|
+
response: Omit<components['schemas']['ListResourcesResponse'], 'resources'> & {
|
|
3949
|
+
resources: ResourceDescriptor[];
|
|
3950
|
+
};
|
|
3951
|
+
};
|
|
3915
3952
|
'browse:resources-failed': {
|
|
3916
3953
|
correlationId: string;
|
|
3917
3954
|
} & components['schemas']['CommandError'];
|
|
3918
3955
|
'browse:annotations-requested': components['schemas']['BrowseAnnotationsRequest'];
|
|
3919
|
-
'browse:annotations-result':
|
|
3956
|
+
'browse:annotations-result': {
|
|
3957
|
+
correlationId: string;
|
|
3958
|
+
response: Omit<components['schemas']['GetAnnotationsResponse'], 'annotations'> & {
|
|
3959
|
+
annotations: Annotation[];
|
|
3960
|
+
};
|
|
3961
|
+
};
|
|
3920
3962
|
'browse:annotations-failed': {
|
|
3921
3963
|
correlationId: string;
|
|
3922
3964
|
} & components['schemas']['CommandError'];
|
|
3923
3965
|
'browse:annotation-requested': components['schemas']['BrowseAnnotationRequest'];
|
|
3924
|
-
'browse:annotation-result':
|
|
3966
|
+
'browse:annotation-result': {
|
|
3967
|
+
correlationId: string;
|
|
3968
|
+
response: Omit<components['schemas']['GetAnnotationResponse'], 'annotation' | 'resource' | 'resolvedResource'> & {
|
|
3969
|
+
annotation: Annotation;
|
|
3970
|
+
resource: ResourceDescriptor | null;
|
|
3971
|
+
resolvedResource: ResourceDescriptor | null;
|
|
3972
|
+
};
|
|
3973
|
+
};
|
|
3925
3974
|
'browse:annotation-failed': {
|
|
3926
3975
|
correlationId: string;
|
|
3927
3976
|
} & components['schemas']['CommandError'];
|
|
@@ -3969,11 +4018,15 @@ type EventMap = {
|
|
|
3969
4018
|
correlationId: string;
|
|
3970
4019
|
path: string;
|
|
3971
4020
|
} & components['schemas']['CommandError'];
|
|
3972
|
-
'browse:click': components['schemas']['BrowseClickEvent']
|
|
4021
|
+
'browse:click': components['schemas']['BrowseClickEvent'] & {
|
|
4022
|
+
anchorRect?: AnchorRect;
|
|
4023
|
+
};
|
|
3973
4024
|
'browse:reference-navigate': components['schemas']['BrowseReferenceNavigateEvent'];
|
|
3974
4025
|
'browse:entity-type-clicked': components['schemas']['BrowseEntityTypeClickedEvent'];
|
|
3975
4026
|
'panel:toggle': components['schemas']['BrowsePanelToggleEvent'];
|
|
3976
|
-
'panel:open': components['schemas']['BrowsePanelOpenEvent']
|
|
4027
|
+
'panel:open': components['schemas']['BrowsePanelOpenEvent'] & {
|
|
4028
|
+
anchorRect?: AnchorRect;
|
|
4029
|
+
};
|
|
3977
4030
|
'panel:close': void;
|
|
3978
4031
|
'shell:sidebar-toggle': void;
|
|
3979
4032
|
'tabs:close': components['schemas']['BrowseResourceCloseEvent'];
|
|
@@ -4021,6 +4074,31 @@ type EventMap = {
|
|
|
4021
4074
|
};
|
|
4022
4075
|
};
|
|
4023
4076
|
'job:cancel-failed': components['schemas']['CommandError'];
|
|
4077
|
+
/**
|
|
4078
|
+
* Emitted by the Weaver after applying an event (or a batch's last event)
|
|
4079
|
+
* for a resource to the graph. `sequenceNumber` is the resource-stream
|
|
4080
|
+
* sequence of the last applied event. Folded by `WeaveProgress`
|
|
4081
|
+
* (make-meaning) into the backend-local applied map that the
|
|
4082
|
+
* `whenApplied` barrier awaits. In-process signal today; crosses the
|
|
4083
|
+
* bus gateway after WEAVER-ISOLATION.
|
|
4084
|
+
*/
|
|
4085
|
+
'weave:applied': {
|
|
4086
|
+
resourceId: string;
|
|
4087
|
+
sequenceNumber: number;
|
|
4088
|
+
};
|
|
4089
|
+
'smelt:settled': {
|
|
4090
|
+
resourceId: string;
|
|
4091
|
+
contentChecksum: string;
|
|
4092
|
+
outcome: 'indexed' | 'skipped';
|
|
4093
|
+
};
|
|
4094
|
+
'weave:rebuild': components['schemas']['WeaveRebuildCommand'];
|
|
4095
|
+
'weave:rebuild-ok': {
|
|
4096
|
+
correlationId?: string;
|
|
4097
|
+
};
|
|
4098
|
+
'weave:rebuild-failed': {
|
|
4099
|
+
correlationId?: string;
|
|
4100
|
+
message: string;
|
|
4101
|
+
};
|
|
4024
4102
|
'settings:theme-changed': components['schemas']['SettingsThemeChangedEvent'];
|
|
4025
4103
|
'settings:line-numbers-toggled': void;
|
|
4026
4104
|
'settings:locale-changed': components['schemas']['SettingsLocaleChangedEvent'];
|
|
@@ -4231,11 +4309,11 @@ declare const CHANNEL_SCHEMAS: {
|
|
|
4231
4309
|
readonly 'browse:directory-requested': "BrowseDirectoryRequest";
|
|
4232
4310
|
readonly 'browse:directory-result': "BrowseDirectoryResult";
|
|
4233
4311
|
readonly 'browse:directory-failed': null;
|
|
4234
|
-
readonly 'browse:click':
|
|
4312
|
+
readonly 'browse:click': null;
|
|
4235
4313
|
readonly 'browse:reference-navigate': "BrowseReferenceNavigateEvent";
|
|
4236
4314
|
readonly 'browse:entity-type-clicked': "BrowseEntityTypeClickedEvent";
|
|
4237
4315
|
readonly 'panel:toggle': "BrowsePanelToggleEvent";
|
|
4238
|
-
readonly 'panel:open':
|
|
4316
|
+
readonly 'panel:open': null;
|
|
4239
4317
|
readonly 'panel:close': null;
|
|
4240
4318
|
readonly 'shell:sidebar-toggle': null;
|
|
4241
4319
|
readonly 'tabs:close': "BrowseResourceCloseEvent";
|
|
@@ -4271,6 +4349,11 @@ declare const CHANNEL_SCHEMAS: {
|
|
|
4271
4349
|
readonly 'settings:line-numbers-toggled': null;
|
|
4272
4350
|
readonly 'settings:locale-changed': "SettingsLocaleChangedEvent";
|
|
4273
4351
|
readonly 'settings:hover-delay-changed': "SettingsHoverDelayChangedEvent";
|
|
4352
|
+
readonly 'weave:applied': null;
|
|
4353
|
+
readonly 'smelt:settled': null;
|
|
4354
|
+
readonly 'weave:rebuild': "WeaveRebuildCommand";
|
|
4355
|
+
readonly 'weave:rebuild-ok': null;
|
|
4356
|
+
readonly 'weave:rebuild-failed': null;
|
|
4274
4357
|
readonly 'stream-connected': null;
|
|
4275
4358
|
readonly 'replay-window-exceeded': null;
|
|
4276
4359
|
readonly 'bus:resume-gap': null;
|
|
@@ -4503,8 +4586,7 @@ declare class ScopedEventBus {
|
|
|
4503
4586
|
* idleTimeoutMs — How long after the last flush before returning to passthrough.
|
|
4504
4587
|
* 200ms is a good default. Must be >= burstWindowMs.
|
|
4505
4588
|
*
|
|
4506
|
-
* See:
|
|
4507
|
-
* See: packages/graph/docs/ARCHITECTURE.md for graph consumer context.
|
|
4589
|
+
* See: packages/graph/docs/ARCHITECTURE.md for Weaver context.
|
|
4508
4590
|
*/
|
|
4509
4591
|
|
|
4510
4592
|
interface BurstBufferOptions {
|
|
@@ -4588,7 +4670,7 @@ declare function burstBuffer<T>(options: BurstBufferOptions): OperatorFunction<T
|
|
|
4588
4670
|
*
|
|
4589
4671
|
* Use RxJS `groupBy(keyFn) + concatMap(...)` when the work arrives as an
|
|
4590
4672
|
* **event stream** that a component subscribes to once at startup. This
|
|
4591
|
-
* is how `Smelter`, `
|
|
4673
|
+
* is how `Smelter`, `Weaver`, and `Gatherer` serialize their own
|
|
4592
4674
|
* per-resource work — see their implementations in `packages/make-meaning`.
|
|
4593
4675
|
*
|
|
4594
4676
|
* Both patterns solve the same logical problem ("serialize work per key").
|
|
@@ -4681,7 +4763,7 @@ declare function busLog(op: BusOp, channel: string, payload: unknown, scope?: st
|
|
|
4681
4763
|
* Annotation body utilities
|
|
4682
4764
|
*
|
|
4683
4765
|
* These are the matcher primitives used by the `mark:body-updated` event
|
|
4684
|
-
* replay path (ViewMaterializer and
|
|
4766
|
+
* replay path (ViewMaterializer and Weaver) to apply add/remove/
|
|
4685
4767
|
* replace operations against an annotation body.
|
|
4686
4768
|
*/
|
|
4687
4769
|
|
|
@@ -5497,6 +5579,10 @@ declare const BUS_OPERATIONS: {
|
|
|
5497
5579
|
readonly result: "match:search-results";
|
|
5498
5580
|
readonly failure: "match:search-failed";
|
|
5499
5581
|
};
|
|
5582
|
+
readonly 'weave:rebuild': {
|
|
5583
|
+
readonly result: "weave:rebuild-ok";
|
|
5584
|
+
readonly failure: "weave:rebuild-failed";
|
|
5585
|
+
};
|
|
5500
5586
|
readonly 'yield:create': {
|
|
5501
5587
|
readonly result: "yield:create-ok";
|
|
5502
5588
|
readonly failure: "yield:create-failed";
|
|
@@ -7132,5 +7218,54 @@ interface GraphViews {
|
|
|
7132
7218
|
}
|
|
7133
7219
|
declare function deriveViews(graph: KnowledgeGraph, mainResourceId: string, focalAnnotationId?: string): GraphViews;
|
|
7134
7220
|
|
|
7135
|
-
|
|
7136
|
-
|
|
7221
|
+
/**
|
|
7222
|
+
* Bounded retry with exponential backoff.
|
|
7223
|
+
*
|
|
7224
|
+
* Exists for startup-critical network calls in long-running peers (worker,
|
|
7225
|
+
* smelter, weaver): each authenticates against the KS the moment its
|
|
7226
|
+
* container starts, and the backend may not be reachable for a few seconds
|
|
7227
|
+
* (backend restart, container-network warm-up). Orchestration runs these
|
|
7228
|
+
* processes with `--rm` and no restart policy, so a process that dies on
|
|
7229
|
+
* the first `TypeError: fetch failed` is dead for good — the retry window
|
|
7230
|
+
* here is the only recovery it gets.
|
|
7231
|
+
*/
|
|
7232
|
+
interface RetryPolicy {
|
|
7233
|
+
/** Total attempts, including the first one. */
|
|
7234
|
+
attempts: number;
|
|
7235
|
+
/** Delay before the second attempt; doubles each retry. */
|
|
7236
|
+
initialDelayMs: number;
|
|
7237
|
+
/** Ceiling for the doubled delay. */
|
|
7238
|
+
maxDelayMs: number;
|
|
7239
|
+
}
|
|
7240
|
+
interface RetryAttemptInfo {
|
|
7241
|
+
/** 1-based number of the attempt that just failed. */
|
|
7242
|
+
attempt: number;
|
|
7243
|
+
/** Total attempt budget from the policy. */
|
|
7244
|
+
attempts: number;
|
|
7245
|
+
/** How long we wait before the next attempt. */
|
|
7246
|
+
delayMs: number;
|
|
7247
|
+
error: unknown;
|
|
7248
|
+
}
|
|
7249
|
+
/**
|
|
7250
|
+
* Default policy for startup connections to the backend: 8 attempts with
|
|
7251
|
+
* delays 1s, 2s, 4s, then capped at 8s — ~39s of patience before giving up.
|
|
7252
|
+
*/
|
|
7253
|
+
declare const STARTUP_FETCH_RETRY: RetryPolicy;
|
|
7254
|
+
/**
|
|
7255
|
+
* True for the errors `fetch` throws when the connection itself fails —
|
|
7256
|
+
* undici's `TypeError: fetch failed` (ECONNREFUSED, ENOTFOUND, reset,
|
|
7257
|
+
* timeout — the socket error rides in `cause`). Deliberately false for
|
|
7258
|
+
* HTTP-level failures (a 401 means the backend is UP and rejected us;
|
|
7259
|
+
* retrying won't change its mind) and for programming errors.
|
|
7260
|
+
*/
|
|
7261
|
+
declare function isTransientFetchError(error: unknown): boolean;
|
|
7262
|
+
/**
|
|
7263
|
+
* Run `fn`, retrying on errors `isRetryable` accepts, with exponential
|
|
7264
|
+
* backoff per `policy`. `onRetry` fires before each wait — the caller's
|
|
7265
|
+
* hook for logging the attempt. The final error (retryable budget
|
|
7266
|
+
* exhausted, or the first non-retryable one) is rethrown verbatim.
|
|
7267
|
+
*/
|
|
7268
|
+
declare function retryWithBackoff<T>(fn: () => Promise<T>, isRetryable: (error: unknown) => boolean, policy: RetryPolicy, onRetry?: (info: RetryAttemptInfo) => void): Promise<T>;
|
|
7269
|
+
|
|
7270
|
+
export { AUTHORABLE_MEDIA_TYPES, BRIDGED_CHANNELS, BusRequestError, CHANNEL_SCHEMAS, CONTEXT_FULL_WEIGHT, CONTEXT_PARTIAL_WEIGHT, ConfigurationError, ConflictError, EMBEDDABLE_MEDIA_TYPES, EventBus, 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, annotationId, annotationUri, applyBodyOperations, assembleAnnotation, authCode, baseMediaType, baseUrl, buildContentCache, burstBuffer, busLog, busLogEnabled, busRequest, capabilitiesOf, cloneToken, createCircleSvg, createFragmentSelector, createPolygonSvg, createRectangleSvg, createTomlConfigLoader, decodeRepresentation, decodeWithCharset, deriveViews, didToAgent, email, entityType, errField, extensionForMediaType, extractBoundingBox, extractCharset, extractContext, findBestTextMatch, findBodyItem, 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, getStorageUri, getSvgSelector, getTargetSelector, getTargetSource, getTextPositionSelector, getTextQuoteSelector, googleCredential, hasTargetSelector, isAnnotationId, isArchived, isArray, isAssessment, isBodyResolved, isBoolean, isComment, isDefined, isDraft, isEventRelatedToAnnotation, isFunction, isHighlight, isNull, isNullish, isNumber, isObject, isReference, isResolvedReference, isResourceId, isStoredEvent, isString, isStubReference, isSupportedMediaType, isTag, isTransientFetchError, isUndefined, isValidEmail, isValidPlatformType, jobId, loadTomlConfig, mcpToken, mediaTypeForExtension, normalizeCoordinates, normalizeText, parseEnvironment, parseFragmentSelector, parseSvgSelector, reconcileSelector, refreshToken, resourceAnnotationUri, resourceId, resourceUri, retryWithBackoff, scaleSvgToNative, searchQuery, serializePerKey, setBusLogTraceIdProvider, softwareToAgent, textExtractionOf, userDID, userId, userToAgent, userToDid, validateData, validateEnvironment, validateSvgMarkup, verifyPosition };
|
|
7271
|
+
export type { AccessToken, AnchorConfidence, AnchorMethod, AnchorRect, AnchorSelectors, AnchorStrategy, AnchoringModel, Annotation, AnnotationCategory, AnnotationId, AnnotationUri, AnthropicProviderConfig, AppConfig, AssembledAnnotation, AuthCode, BackendDownload, BackendServiceConfig, BaseUrl, BodyItem, BodyItemIdentity, BodyOperation, BoundingBox, Brand, BridgedChannel, BurstBufferOptions, BusOp, BusRequestErrorCode, BusRequestPrimitive, CloneToken, CollaboratorEntry, ConnectionState, ContentCache, ContentFormat, CreateAnnotationInternal, DatabaseServiceConfig, Email, EmbeddingServiceConfig, EmittableChannel, EntityType, EntityTypeStats, Environment, EnvironmentConfig, EventBase, EventInput, EventMap, EventMetadata, EventName, EventOfType, EventQuery, EventSignature, FragmentSelector, FrontendServiceConfig, GatheredContext, GoogleAuthRequest, GoogleCredential, GraphConnection, GraphDatabaseType, GraphPath, GraphServiceConfig, GraphViews, HealthCheckResponse, IBackendOperations, IContentTransport, ITransport, InferenceProvidersConfig, JobId, JobType, ListUsersResponse, LlmSelectorInput, LocaleInfo, Logger, MCPToken, MatchQuality, McpServiceConfig, MediaTypeCapabilities, Motivation, OllamaProviderConfig, PdfCoordinate, PersistedEvent, PersistedEventType, PlatformType, Point, ProgressCallback, ProgressEvent, 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, TextExtraction, TextPosition, TextPositionSelector, TextQuoteSelector, ActorInferenceConfig as TomlActorInferenceConfig, TomlFileReader, InferenceConfig as TomlInferenceConfig, WorkerInferenceConfig as TomlWorkerInferenceConfig, TransportErrorCode, UpdateResourceInput, UpdateUserRequest, UpdateUserResponse, UserDID, UserId, UserResponse, ValidationFailure, ValidationResult, ValidationSuccess, VectorsServiceConfig, components, operations, paths };
|
package/dist/index.js
CHANGED
|
@@ -265,12 +265,14 @@ var CHANNEL_SCHEMAS = {
|
|
|
265
265
|
"browse:directory-result": "BrowseDirectoryResult",
|
|
266
266
|
"browse:directory-failed": null,
|
|
267
267
|
// { correlationId; path } & CommandError
|
|
268
|
-
"browse:click":
|
|
268
|
+
"browse:click": null,
|
|
269
|
+
// includes runtime `anchorRect?: AnchorRect`
|
|
269
270
|
"browse:reference-navigate": "BrowseReferenceNavigateEvent",
|
|
270
271
|
"browse:entity-type-clicked": "BrowseEntityTypeClickedEvent",
|
|
271
272
|
// ── SHELL (app-scoped UI events, fire on SemiontBrowser bus) ────
|
|
272
273
|
"panel:toggle": "BrowsePanelToggleEvent",
|
|
273
|
-
"panel:open":
|
|
274
|
+
"panel:open": null,
|
|
275
|
+
// includes runtime `anchorRect?: AnchorRect`
|
|
274
276
|
"panel:close": null,
|
|
275
277
|
// void
|
|
276
278
|
"shell:sidebar-toggle": null,
|
|
@@ -316,6 +318,16 @@ var CHANNEL_SCHEMAS = {
|
|
|
316
318
|
// void
|
|
317
319
|
"settings:locale-changed": "SettingsLocaleChangedEvent",
|
|
318
320
|
"settings:hover-delay-changed": "SettingsHoverDelayChangedEvent",
|
|
321
|
+
// ── WEAVE FLOW ──────────────────────────────────────────────────
|
|
322
|
+
"weave:applied": null,
|
|
323
|
+
// { resourceId; sequenceNumber }
|
|
324
|
+
"smelt:settled": null,
|
|
325
|
+
// { resourceId; contentChecksum; outcome }
|
|
326
|
+
"weave:rebuild": "WeaveRebuildCommand",
|
|
327
|
+
"weave:rebuild-ok": null,
|
|
328
|
+
// { correlationId }
|
|
329
|
+
"weave:rebuild-failed": null,
|
|
330
|
+
// { correlationId; message }
|
|
319
331
|
// ── SSE infrastructure ──────────────────────────────────────────
|
|
320
332
|
"stream-connected": null,
|
|
321
333
|
// Record<string, never>
|
|
@@ -394,6 +406,9 @@ var BUS_OPERATIONS = {
|
|
|
394
406
|
// ── MATCH ───────────────────────────────────────────────────────
|
|
395
407
|
// take-1 dressed as an Observable in the SDK; no progress channel
|
|
396
408
|
"match:search-requested": { result: "match:search-results", failure: "match:search-failed" },
|
|
409
|
+
// ── WEAVE ───────────────────────────────────────────────────────
|
|
410
|
+
// Graph-projection rebuild, served by the Weaver (WEAVER-ISOLATION D3)
|
|
411
|
+
"weave:rebuild": { result: "weave:rebuild-ok", failure: "weave:rebuild-failed" },
|
|
397
412
|
// ── YIELD ───────────────────────────────────────────────────────
|
|
398
413
|
// live in-process (resource-operations.ts emits + awaits via race()); the
|
|
399
414
|
// client also .on()-subscribes -ok for cache invalidation
|
|
@@ -2408,6 +2423,32 @@ function deriveViews(graph, mainResourceId, focalAnnotationId) {
|
|
|
2408
2423
|
};
|
|
2409
2424
|
}
|
|
2410
2425
|
|
|
2411
|
-
|
|
2426
|
+
// src/retry.ts
|
|
2427
|
+
var STARTUP_FETCH_RETRY = {
|
|
2428
|
+
attempts: 8,
|
|
2429
|
+
initialDelayMs: 1e3,
|
|
2430
|
+
maxDelayMs: 8e3
|
|
2431
|
+
};
|
|
2432
|
+
function isTransientFetchError(error) {
|
|
2433
|
+
if (!(error instanceof TypeError)) return false;
|
|
2434
|
+
if (error.message === "fetch failed") return true;
|
|
2435
|
+
const code = error.cause?.code;
|
|
2436
|
+
return typeof code === "string" && code.length > 0;
|
|
2437
|
+
}
|
|
2438
|
+
async function retryWithBackoff(fn, isRetryable, policy, onRetry) {
|
|
2439
|
+
let delayMs = policy.initialDelayMs;
|
|
2440
|
+
for (let attempt = 1; ; attempt++) {
|
|
2441
|
+
try {
|
|
2442
|
+
return await fn();
|
|
2443
|
+
} catch (error) {
|
|
2444
|
+
if (attempt >= policy.attempts || !isRetryable(error)) throw error;
|
|
2445
|
+
onRetry?.({ attempt, attempts: policy.attempts, delayMs, error });
|
|
2446
|
+
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
2447
|
+
delayMs = Math.min(delayMs * 2, policy.maxDelayMs);
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2452
|
+
export { AUTHORABLE_MEDIA_TYPES, BRIDGED_CHANNELS, BusRequestError, CHANNEL_SCHEMAS, CONTEXT_FULL_WEIGHT, CONTEXT_PARTIAL_WEIGHT, ConfigurationError, ConflictError, EMBEDDABLE_MEDIA_TYPES, EventBus, 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, annotationId, annotationUri, applyBodyOperations, assembleAnnotation, authCode, baseMediaType, baseUrl, buildContentCache, burstBuffer, busLog, busLogEnabled, busRequest, capabilitiesOf, cloneToken, createCircleSvg, createFragmentSelector, createPolygonSvg, createRectangleSvg, createTomlConfigLoader, decodeRepresentation, decodeWithCharset, deriveViews, didToAgent, email, entityType, errField, extensionForMediaType, extractBoundingBox, extractCharset, extractContext, findBestTextMatch, findBodyItem, 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, getStorageUri, getSvgSelector, getTargetSelector, getTargetSource, getTextPositionSelector, getTextQuoteSelector, googleCredential, hasTargetSelector, isAnnotationId, isArchived, isArray, isAssessment, isBodyResolved, isBoolean, isComment, isDefined, isDraft, isEventRelatedToAnnotation, isFunction, isHighlight, isNull, isNullish, isNumber, isObject, isReference, isResolvedReference, isResourceId, isStoredEvent, isString, isStubReference, isSupportedMediaType, isTag, isTransientFetchError, isUndefined, isValidEmail, isValidPlatformType, jobId, loadTomlConfig, mcpToken, mediaTypeForExtension, normalizeCoordinates, normalizeText, parseEnvironment, parseFragmentSelector, parseSvgSelector, reconcileSelector, refreshToken, resourceAnnotationUri, resourceId, resourceUri, retryWithBackoff, scaleSvgToNative, searchQuery, serializePerKey, setBusLogTraceIdProvider, softwareToAgent, textExtractionOf, userDID, userId, userToAgent, userToDid, validateData, validateEnvironment, validateSvgMarkup, verifyPosition };
|
|
2412
2453
|
//# sourceMappingURL=index.js.map
|
|
2413
2454
|
//# sourceMappingURL=index.js.map
|