@semiont/core 0.5.3 → 0.5.4

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.
Files changed (89) hide show
  1. package/dist/annotation-assembly.d.ts +54 -0
  2. package/dist/annotation-assembly.d.ts.map +1 -0
  3. package/dist/annotation-types.d.ts +30 -0
  4. package/dist/annotation-types.d.ts.map +1 -0
  5. package/dist/annotation-utils.d.ts +43 -0
  6. package/dist/annotation-utils.d.ts.map +1 -0
  7. package/dist/auth-types.d.ts +8 -0
  8. package/dist/auth-types.d.ts.map +1 -0
  9. package/dist/branded-types.d.ts +70 -0
  10. package/dist/branded-types.d.ts.map +1 -0
  11. package/dist/bridged-channels.d.ts +18 -0
  12. package/dist/bridged-channels.d.ts.map +1 -0
  13. package/dist/bus-log.d.ts +25 -0
  14. package/dist/bus-log.d.ts.map +1 -0
  15. package/dist/bus-protocol.d.ts +510 -0
  16. package/dist/bus-protocol.d.ts.map +1 -0
  17. package/dist/{config.types-oPv3Ajk-.d.ts → config/config.types.d.ts} +25 -23
  18. package/dist/config/config.types.d.ts.map +1 -0
  19. package/dist/config/configuration-error.d.ts +17 -0
  20. package/dist/config/configuration-error.d.ts.map +1 -0
  21. package/dist/config/environment-validator.d.ts +28 -0
  22. package/dist/config/environment-validator.d.ts.map +1 -0
  23. package/dist/config/node-config-loader.d.ts +4 -74
  24. package/dist/config/node-config-loader.d.ts.map +1 -0
  25. package/dist/config/platform-types.d.ts +26 -0
  26. package/dist/config/platform-types.d.ts.map +1 -0
  27. package/dist/config/toml-loader.d.ts +59 -0
  28. package/dist/config/toml-loader.d.ts.map +1 -0
  29. package/dist/did-utils.d.ts +76 -0
  30. package/dist/did-utils.d.ts.map +1 -0
  31. package/dist/errors.d.ts +48 -0
  32. package/dist/errors.d.ts.map +1 -0
  33. package/dist/event-base.d.ts +70 -0
  34. package/dist/event-base.d.ts.map +1 -0
  35. package/dist/event-bus.d.ts +141 -0
  36. package/dist/event-bus.d.ts.map +1 -0
  37. package/dist/event-utils.d.ts +43 -0
  38. package/dist/event-utils.d.ts.map +1 -0
  39. package/dist/fuzzy-anchor.d.ts +81 -0
  40. package/dist/fuzzy-anchor.d.ts.map +1 -0
  41. package/dist/graph.d.ts +44 -0
  42. package/dist/graph.d.ts.map +1 -0
  43. package/dist/id-generation.d.ts +8 -0
  44. package/dist/id-generation.d.ts.map +1 -0
  45. package/dist/identifiers.d.ts +24 -0
  46. package/dist/identifiers.d.ts.map +1 -0
  47. package/dist/index.d.ts +59 -6022
  48. package/dist/index.d.ts.map +1 -0
  49. package/dist/index.js +41 -19
  50. package/dist/index.js.map +1 -1
  51. package/dist/locales.d.ts +31 -0
  52. package/dist/locales.d.ts.map +1 -0
  53. package/dist/logger.d.ts +56 -0
  54. package/dist/logger.d.ts.map +1 -0
  55. package/dist/mime-utils.d.ts +38 -0
  56. package/dist/mime-utils.d.ts.map +1 -0
  57. package/dist/operators/burst-buffer.d.ts +61 -0
  58. package/dist/operators/burst-buffer.d.ts.map +1 -0
  59. package/dist/payload-types.d.ts +16 -0
  60. package/dist/payload-types.d.ts.map +1 -0
  61. package/dist/persisted-events.d.ts +76 -0
  62. package/dist/persisted-events.d.ts.map +1 -0
  63. package/dist/project.d.ts +69 -0
  64. package/dist/project.d.ts.map +1 -0
  65. package/dist/resource-types.d.ts +15 -0
  66. package/dist/resource-types.d.ts.map +1 -0
  67. package/dist/resource-utils.d.ts +97 -0
  68. package/dist/resource-utils.d.ts.map +1 -0
  69. package/dist/serialize-per-key.d.ts +51 -0
  70. package/dist/serialize-per-key.d.ts.map +1 -0
  71. package/dist/svg-utils.d.ts +44 -0
  72. package/dist/svg-utils.d.ts.map +1 -0
  73. package/dist/tag-schemas.d.ts +27 -0
  74. package/dist/tag-schemas.d.ts.map +1 -0
  75. package/dist/text-context.d.ts +85 -0
  76. package/dist/text-context.d.ts.map +1 -0
  77. package/dist/text-encoding.d.ts +34 -0
  78. package/dist/text-encoding.d.ts.map +1 -0
  79. package/dist/transport.d.ts +274 -0
  80. package/dist/transport.d.ts.map +1 -0
  81. package/dist/type-guards.d.ts +44 -0
  82. package/dist/type-guards.d.ts.map +1 -0
  83. package/dist/types.d.ts +3517 -0
  84. package/dist/types.d.ts.map +1 -0
  85. package/dist/validation.d.ts +57 -0
  86. package/dist/validation.d.ts.map +1 -0
  87. package/dist/web-annotation-utils.d.ts +154 -0
  88. package/dist/web-annotation-utils.d.ts.map +1 -0
  89. package/package.json +3 -3
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Annotation Assembly
3
+ *
4
+ * Pure functions for building W3C Annotations and applying body operations.
5
+ * No EventBus, no persistence — just data transformation.
6
+ */
7
+ import type { components } from './types';
8
+ import type { Selector } from './payload-types';
9
+ import type { Annotation } from './annotation-types';
10
+ type Agent = components['schemas']['Agent'];
11
+ type AnnotationBody = components['schemas']['AnnotationBody'];
12
+ type CreateAnnotationRequest = components['schemas']['CreateAnnotationRequest'];
13
+ type UpdateAnnotationBodyRequest = components['schemas']['UpdateAnnotationBodyRequest'];
14
+ type TextPositionSelector = components['schemas']['TextPositionSelector'];
15
+ type SvgSelector = components['schemas']['SvgSelector'];
16
+ type FragmentSelector = components['schemas']['FragmentSelector'];
17
+ export interface AssembledAnnotation {
18
+ annotation: Annotation;
19
+ bodyArray: AnnotationBody[];
20
+ }
21
+ /**
22
+ * Get TextPositionSelector from a selector (single or array)
23
+ */
24
+ export declare function getTextPositionSelector(selector: Selector | Selector[] | undefined): TextPositionSelector | null;
25
+ /**
26
+ * Get SvgSelector from a selector (single or array)
27
+ */
28
+ export declare function getSvgSelector(selector: Selector | Selector[] | undefined): SvgSelector | null;
29
+ /**
30
+ * Get FragmentSelector from a selector (single or array)
31
+ */
32
+ export declare function getFragmentSelector(selector: Selector | Selector[] | undefined): FragmentSelector | null;
33
+ /**
34
+ * Validate SVG markup for W3C compliance
35
+ *
36
+ * @returns null if valid, error message if invalid
37
+ */
38
+ export declare function validateSvgMarkup(svg: string): string | null;
39
+ /**
40
+ * Build a complete W3C Annotation from a CreateAnnotationRequest.
41
+ *
42
+ * Generates a bare annotation ID (no URL prefix). URIs are constructed
43
+ * at the API boundary when returning responses to clients.
44
+ *
45
+ * Throws on invalid input (missing selector, missing motivation, invalid SVG).
46
+ */
47
+ export declare function assembleAnnotation(request: CreateAnnotationRequest, creator: Agent): AssembledAnnotation;
48
+ /**
49
+ * Apply body operations (add/remove/replace) to an annotation's body array.
50
+ * Returns a new array — does not mutate the input.
51
+ */
52
+ export declare function applyBodyOperations(body: Annotation['body'], operations: UpdateAnnotationBodyRequest['operations']): AnnotationBody[];
53
+ export {};
54
+ //# sourceMappingURL=annotation-assembly.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotation-assembly.d.ts","sourceRoot":"","sources":["../src/annotation-assembly.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD,KAAK,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC;AAC5C,KAAK,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,gBAAgB,CAAC,CAAC;AAC9D,KAAK,uBAAuB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,yBAAyB,CAAC,CAAC;AAChF,KAAK,2BAA2B,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,6BAA6B,CAAC,CAAC;AACxF,KAAK,oBAAoB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,sBAAsB,CAAC,CAAC;AAC1E,KAAK,WAAW,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,CAAC;AACxD,KAAK,gBAAgB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;AAElE,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,EAAE,cAAc,EAAE,CAAC;CAC7B;AAMD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,EAAE,GAAG,SAAS,GAAG,oBAAoB,GAAG,IAAI,CAMhH;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,EAAE,GAAG,SAAS,GAAG,WAAW,GAAG,IAAI,CAM9F;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,EAAE,GAAG,SAAS,GAAG,gBAAgB,GAAG,IAAI,CAMxG;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAmB5D;AAMD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,KAAK,GACb,mBAAmB,CAwCrB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,EACxB,UAAU,EAAE,2BAA2B,CAAC,YAAY,CAAC,GACpD,cAAc,EAAE,CA6BlB"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Annotation types
3
+ */
4
+ import type { components } from './types';
5
+ import type { AnnotationId } from './identifiers';
6
+ type RawAnnotation = components['schemas']['Annotation'];
7
+ /**
8
+ * Domain-level Annotation type. Same shape as the OpenAPI-generated
9
+ * `components['schemas']['Annotation']`, but with a branded `AnnotationId`
10
+ * for the `id` field. Use this import everywhere the codebase refers to
11
+ * "an annotation"; the raw OpenAPI type is only used inside
12
+ * `@semiont/api-client` at the HTTP boundary.
13
+ *
14
+ * Implemented by intersection (not `Omit`) to be robust against generator
15
+ * drift — if the OpenAPI schema gets `additionalProperties: true` added,
16
+ * `Omit` on the resulting intersection type silently drops named fields.
17
+ */
18
+ export type Annotation = RawAnnotation & {
19
+ id: AnnotationId;
20
+ };
21
+ export type AnnotationCategory = 'highlight' | 'reference';
22
+ export interface CreateAnnotationInternal {
23
+ id: AnnotationId;
24
+ motivation: Annotation['motivation'];
25
+ target: Annotation['target'];
26
+ body?: Annotation['body'];
27
+ creator: components['schemas']['Agent'];
28
+ }
29
+ export {};
30
+ //# sourceMappingURL=annotation-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotation-types.d.ts","sourceRoot":"","sources":["../src/annotation-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,KAAK,aAAa,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC;AAEzD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG;IAAE,EAAE,EAAE,YAAY,CAAA;CAAE,CAAC;AAE9D,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,WAAW,CAAC;AAE3D,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,YAAY,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IACrC,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAK7B,IAAI,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IAC1B,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC;CACzC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Annotation body utilities
3
+ *
4
+ * These are the matcher primitives used by the `mark:body-updated` event
5
+ * replay path (ViewMaterializer and GraphDBConsumer) to apply add/remove/
6
+ * replace operations against an annotation body.
7
+ */
8
+ import type { components } from './types';
9
+ import type { Annotation } from './annotation-types';
10
+ type BodyPurpose = components['schemas']['BodyPurpose'];
11
+ /**
12
+ * Identity of a body item for matching purposes.
13
+ *
14
+ * Identity is `type + source` for SpecificResource and `type + value` for
15
+ * TextualBody. `purpose` is OPTIONAL: if the caller provides it, it's
16
+ * included in the match (used to disambiguate same-source bodies under
17
+ * different purposes, per the W3C Web Annotation model). If the caller
18
+ * omits it, the matcher ignores purpose and matches on identity alone.
19
+ *
20
+ * Callers SHOULD provide `purpose` when they know it (e.g., the bind flow
21
+ * always unlinks a `purpose: 'linking'` body) so that future multi-purpose
22
+ * annotations continue to disambiguate correctly. Leaving `purpose`
23
+ * unspecified matches whichever purpose comes first in the body — which is
24
+ * fine today because Semiont annotations currently have at most one body
25
+ * item per (type, source/value) pair.
26
+ */
27
+ export type BodyItemIdentity = {
28
+ type: 'SpecificResource';
29
+ source: string;
30
+ purpose?: BodyPurpose;
31
+ } | {
32
+ type: 'TextualBody';
33
+ value: string;
34
+ purpose?: BodyPurpose;
35
+ };
36
+ /**
37
+ * Find a body item by identity. Returns the index of the first match, or -1.
38
+ *
39
+ * See `BodyItemIdentity` for matching semantics.
40
+ */
41
+ export declare function findBodyItem(body: Annotation['body'], identity: BodyItemIdentity): number;
42
+ export {};
43
+ //# sourceMappingURL=annotation-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotation-utils.d.ts","sourceRoot":"","sources":["../src/annotation-utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,KAAK,WAAW,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,CAAC;AAExD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,WAAW,CAAA;CAAE,GACnE;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC;AAElE;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,EACxB,QAAQ,EAAE,gBAAgB,GACzB,MAAM,CAwCR"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Auth types
3
+ */
4
+ export interface GoogleAuthRequest {
5
+ credential: string;
6
+ termsAccepted: boolean;
7
+ }
8
+ //# sourceMappingURL=auth-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-types.d.ts","sourceRoot":"","sources":["../src/auth-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;CACxB"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Branded string types for compile-time type safety
3
+ *
4
+ * These types are zero-cost at runtime but prevent mixing
5
+ * different string types at compile time.
6
+ */
7
+ import type { components } from './types';
8
+ export type Motivation = components['schemas']['Motivation'];
9
+ export type ContentFormat = components['schemas']['ContentFormat'];
10
+ export type Email = string & {
11
+ readonly __brand: 'Email';
12
+ };
13
+ export type AuthCode = string & {
14
+ readonly __brand: 'AuthCode';
15
+ };
16
+ export type GoogleCredential = string & {
17
+ readonly __brand: 'GoogleCredential';
18
+ };
19
+ export type AccessToken = string & {
20
+ readonly __brand: 'AccessToken';
21
+ };
22
+ export type RefreshToken = string & {
23
+ readonly __brand: 'RefreshToken';
24
+ };
25
+ export type MCPToken = string & {
26
+ readonly __brand: 'MCPToken';
27
+ };
28
+ export type CloneToken = string & {
29
+ readonly __brand: 'CloneToken';
30
+ };
31
+ export type JobId = string & {
32
+ readonly __brand: 'JobId';
33
+ };
34
+ export type UserDID = string & {
35
+ readonly __brand: 'UserDID';
36
+ };
37
+ export type EntityType = string & {
38
+ readonly __brand: 'EntityType';
39
+ };
40
+ export type SearchQuery = string & {
41
+ readonly __brand: 'SearchQuery';
42
+ };
43
+ export type BaseUrl = string & {
44
+ readonly __brand: 'BaseUrl';
45
+ };
46
+ export declare function email(value: string): Email;
47
+ export declare function authCode(value: string): AuthCode;
48
+ export declare function googleCredential(value: string): GoogleCredential;
49
+ export declare function accessToken(value: string): AccessToken;
50
+ export declare function refreshToken(value: string): RefreshToken;
51
+ export declare function mcpToken(value: string): MCPToken;
52
+ export declare function cloneToken(value: string): CloneToken;
53
+ export declare function jobId(value: string): JobId;
54
+ export declare function userDID(value: string): UserDID;
55
+ export declare function entityType(value: string): EntityType;
56
+ export declare function searchQuery(value: string): SearchQuery;
57
+ export declare function baseUrl(value: string): BaseUrl;
58
+ export type ResourceUri = string & {
59
+ readonly __brand: 'ResourceUri';
60
+ };
61
+ export type AnnotationUri = string & {
62
+ readonly __brand: 'AnnotationUri';
63
+ };
64
+ export type ResourceAnnotationUri = string & {
65
+ readonly __brand: 'ResourceAnnotationUri';
66
+ };
67
+ export declare function resourceUri(uri: string): ResourceUri;
68
+ export declare function annotationUri(uri: string): AnnotationUri;
69
+ export declare function resourceAnnotationUri(uri: string): ResourceAnnotationUri;
70
+ //# sourceMappingURL=branded-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branded-types.d.ts","sourceRoot":"","sources":["../src/branded-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAM1C,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC;AAC7D,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,eAAe,CAAC,CAAC;AAMnE,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;A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via `bridgeInto`. Transport-neutral: every concrete
6
+ * `ITransport` shares the same set; HTTP delivers them via SSE,
7
+ * in-process transports forward them directly from the local actor bus.
8
+ *
9
+ * Note: this is the *fan-in* set — channels for events the transport
10
+ * receives and pushes onto the client's bus. It is not the same as the
11
+ * channels the client emits (which is open-ended).
12
+ *
13
+ * Resource-scoped channels (joined/left via `subscribeToResource`) are
14
+ * tracked separately by transports that care about scope (HTTP).
15
+ */
16
+ export declare const BRIDGED_CHANNELS: readonly ["browse:resources-result", "browse:resources-failed", "browse:resource-result", "browse:resource-failed", "browse:annotations-result", "browse:annotations-failed", "browse:annotation-result", "browse:annotation-failed", "browse:annotation-history-result", "browse:annotation-history-failed", "browse:events-result", "browse:events-failed", "browse:referenced-by-result", "browse:referenced-by-failed", "browse:entity-types-result", "browse:entity-types-failed", "browse:tag-schemas-result", "browse:tag-schemas-failed", "browse:directory-result", "browse:directory-failed", "browse:annotation-context-result", "browse:annotation-context-failed", "mark:delete-ok", "mark:delete-failed", "mark:create-ok", "mark:create-failed", "match:search-results", "match:search-failed", "gather:complete", "gather:failed", "gather:annotation-progress", "gather:annotation-finished", "gather:summary-result", "gather:summary-failed", "bind:body-updated", "bind:body-update-failed", "job:report-progress", "job:complete", "job:fail", "job:status-result", "job:status-failed", "job:created", "job:create-failed", "job:claimed", "job:claim-failed", "yield:create-ok", "yield:create-failed", "yield:update-ok", "yield:update-failed", "yield:clone-token-generated", "yield:clone-token-failed", "yield:clone-resource-result", "yield:clone-resource-failed", "yield:clone-created", "yield:clone-create-failed", "frame:entity-type-added", "frame:tag-schema-added", "beckon:focus", "beckon:sparkle", "bus:resume-gap"];
17
+ export type BridgedChannel = typeof BRIDGED_CHANNELS[number];
18
+ //# sourceMappingURL=bridged-channels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridged-channels.d.ts","sourceRoot":"","sources":["../src/bridged-channels.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,g+CAgCnB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Bus logging — runtime-toggleable cross-wire visibility.
3
+ *
4
+ * One line per event that crosses a process boundary, in a grep-able
5
+ * format that's symmetric across frontend and backend:
6
+ *
7
+ * [bus EMIT] <channel> [scope=X] [cid=<first8>] <payload>
8
+ * [bus RECV] <channel> [scope=X] [cid=<first8>] <payload>
9
+ * [bus SSE] <channel> [scope=X] [cid=<first8>] <payload>
10
+ *
11
+ * Tier 1 of `.plans/OBSERVABILITY.md`. Forward-compatible with Tier 2:
12
+ * the `cid` printed here is exactly the prefix of the W3C trace-id we
13
+ * adopt later.
14
+ *
15
+ * Cost when disabled: one property read per call, zero allocations.
16
+ *
17
+ * Enable:
18
+ * - Browser: `window.__SEMIONT_BUS_LOG__ = true` (DevTools or e2e init)
19
+ * - Node: `SEMIONT_BUS_LOG=1` in the process env (read at module load)
20
+ */
21
+ export type BusOp = 'EMIT' | 'RECV' | 'SSE' | 'PUT' | 'GET';
22
+ export declare function busLogEnabled(): boolean;
23
+ export declare function setBusLogTraceIdProvider(fn: (() => string | undefined) | undefined): void;
24
+ export declare function busLog(op: BusOp, channel: string, payload: unknown, scope?: string): void;
25
+ //# sourceMappingURL=bus-log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bus-log.d.ts","sourceRoot":"","sources":["../src/bus-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAE5D,wBAAgB,aAAa,IAAI,OAAO,CAIvC;AAgBD,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,GAAG,IAAI,CAEzF;AAED,wBAAgB,MAAM,CACpB,EAAE,EAAE,KAAK,EACT,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,EAChB,KAAK,CAAC,EAAE,MAAM,GACb,IAAI,CAeN"}