@blue-labs/document-processor 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/engine/channel-runner.d.ts +3 -6
  2. package/dist/engine/channel-runner.d.ts.map +1 -1
  3. package/dist/engine/composite-channel-validation.d.ts +14 -0
  4. package/dist/engine/composite-channel-validation.d.ts.map +1 -0
  5. package/dist/engine/contract-bundle.d.ts +7 -15
  6. package/dist/engine/contract-bundle.d.ts.map +1 -1
  7. package/dist/engine/contract-loader.d.ts +2 -1
  8. package/dist/engine/contract-loader.d.ts.map +1 -1
  9. package/dist/engine/processor-engine.d.ts.map +1 -1
  10. package/dist/index.js +1206 -907
  11. package/dist/model/channels/composite-timeline-channel.d.ts +47 -0
  12. package/dist/model/channels/composite-timeline-channel.d.ts.map +1 -0
  13. package/dist/model/channels/index.d.ts +1 -0
  14. package/dist/model/channels/index.d.ts.map +1 -1
  15. package/dist/model/types.d.ts +2 -2
  16. package/dist/model/types.d.ts.map +1 -1
  17. package/dist/registry/contract-processor-registry-builder.d.ts.map +1 -1
  18. package/dist/registry/processors/composite-timeline-channel-processor.d.ts +81 -0
  19. package/dist/registry/processors/composite-timeline-channel-processor.d.ts.map +1 -0
  20. package/dist/registry/types.d.ts +26 -0
  21. package/dist/registry/types.d.ts.map +1 -1
  22. package/dist/test-support/blue.d.ts.map +1 -1
  23. package/dist/types/channel-contract-entry.d.ts +7 -0
  24. package/dist/types/channel-contract-entry.d.ts.map +1 -0
  25. package/dist/types/handler-contract-entry.d.ts +7 -0
  26. package/dist/types/handler-contract-entry.d.ts.map +1 -0
  27. package/dist/types/marker-contract-entry.d.ts +7 -0
  28. package/dist/types/marker-contract-entry.d.ts.map +1 -0
  29. package/package.json +3 -3
@@ -0,0 +1,47 @@
1
+ import { z } from 'zod';
2
+ export declare const compositeTimelineChannelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
3
+ description: z.ZodOptional<z.ZodString>;
4
+ name: z.ZodOptional<z.ZodString>;
5
+ order: z.ZodOptional<z.ZodNumber>;
6
+ }, {
7
+ description: z.ZodOptional<z.ZodString>;
8
+ event: z.ZodOptional<z.ZodType<import('@blue-labs/language').BlueNode, z.ZodTypeDef, import('@blue-labs/language').BlueNode>>;
9
+ name: z.ZodOptional<z.ZodString>;
10
+ }>, {
11
+ channels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
12
+ description: z.ZodOptional<z.ZodString>;
13
+ name: z.ZodOptional<z.ZodString>;
14
+ }>, z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
15
+ description: z.ZodOptional<z.ZodString>;
16
+ name: z.ZodOptional<z.ZodString>;
17
+ order: z.ZodOptional<z.ZodNumber>;
18
+ }, {
19
+ description: z.ZodOptional<z.ZodString>;
20
+ event: z.ZodOptional<z.ZodType<import('@blue-labs/language').BlueNode, z.ZodTypeDef, import('@blue-labs/language').BlueNode>>;
21
+ name: z.ZodOptional<z.ZodString>;
22
+ }>, {
23
+ description: z.ZodOptional<z.ZodString>;
24
+ name: z.ZodOptional<z.ZodString>;
25
+ order: z.ZodOptional<z.ZodNumber>;
26
+ }>, {
27
+ path: z.ZodOptional<z.ZodString>;
28
+ definition: z.ZodOptional<z.ZodType<import('@blue-labs/language').BlueNode, z.ZodTypeDef, import('@blue-labs/language').BlueNode>>;
29
+ }>>, "strip", z.ZodTypeAny, {
30
+ event?: import('@blue-labs/language').BlueNode | undefined;
31
+ name?: string | undefined;
32
+ path?: string | undefined;
33
+ description?: string | undefined;
34
+ order?: number | undefined;
35
+ definition?: import('@blue-labs/language').BlueNode | undefined;
36
+ channels?: string[] | undefined;
37
+ }, {
38
+ event?: import('@blue-labs/language').BlueNode | undefined;
39
+ name?: string | undefined;
40
+ path?: string | undefined;
41
+ description?: string | undefined;
42
+ order?: number | undefined;
43
+ definition?: import('@blue-labs/language').BlueNode | undefined;
44
+ channels?: string[] | undefined;
45
+ }>;
46
+ export type CompositeTimelineChannel = z.infer<typeof compositeTimelineChannelSchema>;
47
+ //# sourceMappingURL=composite-timeline-channel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composite-timeline-channel.d.ts","sourceRoot":"","sources":["../../../src/model/channels/composite-timeline-channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EACkC,CAAC;AAE9E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAC"}
@@ -4,4 +4,5 @@ export * from './lifecycle-channel.js';
4
4
  export * from './triggered-event-channel.js';
5
5
  export * from './timeline-channel.js';
6
6
  export * from './myos-timeline-channel.js';
7
+ export * from './composite-timeline-channel.js';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/model/channels/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/model/channels/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC"}
@@ -2,12 +2,12 @@ import { ChannelContractBase } from './shared/channel-contract-base.js';
2
2
  import { HandlerContractBase } from './shared/handler-contract-base.js';
3
3
  import { MarkerContractBase } from './shared/marker-contract-base.js';
4
4
  import { ChannelEventCheckpoint, InitializationMarker, ProcessEmbeddedMarker, ProcessingTerminatedMarker, DocumentAnchorsMarker, DocumentLinksMarker, MyOSParticipantsOrchestrationMarker, MyOSSessionInteractionMarker, MyOSWorkerAgencyMarker } from './markers/index.js';
5
- import { DocumentUpdateChannel, EmbeddedNodeChannel, LifecycleChannel, TriggeredEventChannel, TimelineChannel, MyOSTimelineChannel } from './channels/index.js';
5
+ import { DocumentUpdateChannel, EmbeddedNodeChannel, LifecycleChannel, TriggeredEventChannel, TimelineChannel, MyOSTimelineChannel, CompositeTimelineChannel } from './channels/index.js';
6
6
  import { SequentialWorkflow } from './handlers/index.js';
7
7
  export type GenericHandlerContract = HandlerContractBase & Record<string, unknown>;
8
8
  export type GenericMarkerContract = MarkerContractBase & Record<string, unknown>;
9
9
  export type GenericChannelContract = ChannelContractBase & Record<string, unknown>;
10
10
  export type MarkerContract = ProcessEmbeddedMarker | InitializationMarker | ProcessingTerminatedMarker | ChannelEventCheckpoint | DocumentAnchorsMarker | DocumentLinksMarker | MyOSParticipantsOrchestrationMarker | MyOSSessionInteractionMarker | MyOSWorkerAgencyMarker | GenericMarkerContract;
11
- export type ChannelContract = DocumentUpdateChannel | EmbeddedNodeChannel | LifecycleChannel | TriggeredEventChannel | TimelineChannel | MyOSTimelineChannel | GenericChannelContract;
11
+ export type ChannelContract = DocumentUpdateChannel | EmbeddedNodeChannel | LifecycleChannel | TriggeredEventChannel | TimelineChannel | MyOSTimelineChannel | CompositeTimelineChannel | GenericChannelContract;
12
12
  export type HandlerContract = SequentialWorkflow | GenericHandlerContract;
13
13
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/model/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAA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E,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,KAAK,EACV,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,mBAAmB,EACnB,mCAAmC,EACnC,4BAA4B,EAC5B,sBAAsB,EACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,GACtD,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE1B,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,GACpD,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE1B,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,GACtD,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE1B,MAAM,MAAM,cAAc,GACtB,qBAAqB,GACrB,oBAAoB,GACpB,0BAA0B,GAC1B,sBAAsB,GACtB,qBAAqB,GACrB,mBAAmB,GACnB,mCAAmC,GACnC,4BAA4B,GAC5B,sBAAsB,GACtB,qBAAqB,CAAC;AAE1B,MAAM,MAAM,eAAe,GACvB,qBAAqB,GACrB,mBAAmB,GACnB,gBAAgB,GAChB,qBAAqB,GACrB,eAAe,GACf,mBAAmB,GACnB,wBAAwB,GACxB,sBAAsB,CAAC;AAE3B,MAAM,MAAM,eAAe,GAAG,kBAAkB,GAAG,sBAAsB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"contract-processor-registry-builder.d.ts","sourceRoot":"","sources":["../../src/registry/contract-processor-registry-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAM7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD,qBAAa,gCAAgC;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAA7C,OAAO;IAEP,MAAM,CAAC,MAAM,IAAI,gCAAgC;IAMjD,gBAAgB,IAAI,gCAAgC;IASpD,QAAQ,CAAC,SAAS,EAAE,oBAAoB,GAAG,gCAAgC;IAK3E,KAAK,IAAI,yBAAyB;CAGnC"}
1
+ {"version":3,"file":"contract-processor-registry-builder.d.ts","sourceRoot":"","sources":["../../src/registry/contract-processor-registry-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAO7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD,qBAAa,gCAAgC;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAA7C,OAAO;IAEP,MAAM,CAAC,MAAM,IAAI,gCAAgC;IAMjD,gBAAgB,IAAI,gCAAgC;IAUpD,QAAQ,CAAC,SAAS,EAAE,oBAAoB,GAAG,gCAAgC;IAK3E,KAAK,IAAI,yBAAyB;CAGnC"}
@@ -0,0 +1,81 @@
1
+ import { BlueNode } from '@blue-labs/language';
2
+ import { CompositeTimelineChannel } from '../../model/index.js';
3
+ import { ChannelEvaluationContext, ChannelMatch, ChannelProcessor } from '../types.js';
4
+ /**
5
+ * Compose a checkpoint key that namespaces a child channel under its composite.
6
+ */
7
+ export declare function compositeCheckpointKey(compositeKey: string, childKey: string): string;
8
+ export declare class CompositeTimelineChannelProcessor implements ChannelProcessor<CompositeTimelineChannel> {
9
+ readonly kind: "channel";
10
+ readonly blueIds: readonly ["HsNatiPt2YvmkWQoqtfrFCbdp75ZUBLBUkWeq84WTfnr"];
11
+ readonly schema: import('zod').ZodObject<import("zod").objectUtil.extendShape<import("zod").objectUtil.extendShape<import("zod").objectUtil.extendShape<{
12
+ description: import('zod').ZodOptional<import('zod').ZodString>;
13
+ name: import('zod').ZodOptional<import('zod').ZodString>;
14
+ order: import('zod').ZodOptional<import('zod').ZodNumber>;
15
+ }, {
16
+ description: import('zod').ZodOptional<import('zod').ZodString>;
17
+ event: import('zod').ZodOptional<import('zod').ZodType<import('@blue-labs/language').BlueNode, import('zod').ZodTypeDef, import('@blue-labs/language').BlueNode>>;
18
+ name: import('zod').ZodOptional<import('zod').ZodString>;
19
+ }>, {
20
+ channels: import('zod').ZodOptional<import('zod').ZodArray<import('zod').ZodString, "many">>;
21
+ description: import('zod').ZodOptional<import('zod').ZodString>;
22
+ name: import('zod').ZodOptional<import('zod').ZodString>;
23
+ }>, import("zod").objectUtil.extendShape<import("zod").objectUtil.extendShape<import("zod").objectUtil.extendShape<{
24
+ description: import('zod').ZodOptional<import('zod').ZodString>;
25
+ name: import('zod').ZodOptional<import('zod').ZodString>;
26
+ order: import('zod').ZodOptional<import('zod').ZodNumber>;
27
+ }, {
28
+ description: import('zod').ZodOptional<import('zod').ZodString>;
29
+ event: import('zod').ZodOptional<import('zod').ZodType<import('@blue-labs/language').BlueNode, import('zod').ZodTypeDef, import('@blue-labs/language').BlueNode>>;
30
+ name: import('zod').ZodOptional<import('zod').ZodString>;
31
+ }>, {
32
+ description: import('zod').ZodOptional<import('zod').ZodString>;
33
+ name: import('zod').ZodOptional<import('zod').ZodString>;
34
+ order: import('zod').ZodOptional<import('zod').ZodNumber>;
35
+ }>, {
36
+ path: import('zod').ZodOptional<import('zod').ZodString>;
37
+ definition: import('zod').ZodOptional<import('zod').ZodType<BlueNode, import('zod').ZodTypeDef, BlueNode>>;
38
+ }>>, "strip", import('zod').ZodTypeAny, {
39
+ event?: BlueNode | undefined;
40
+ name?: string | undefined;
41
+ path?: string | undefined;
42
+ description?: string | undefined;
43
+ order?: number | undefined;
44
+ definition?: BlueNode | undefined;
45
+ channels?: string[] | undefined;
46
+ }, {
47
+ event?: BlueNode | undefined;
48
+ name?: string | undefined;
49
+ path?: string | undefined;
50
+ description?: string | undefined;
51
+ order?: number | undefined;
52
+ definition?: BlueNode | undefined;
53
+ channels?: string[] | undefined;
54
+ }>;
55
+ /**
56
+ * Fallback match hook that delegates to {@link evaluate} for consistent behavior.
57
+ */
58
+ matches(contract: CompositeTimelineChannel, context: ChannelEvaluationContext): boolean | Promise<boolean>;
59
+ /**
60
+ * Resolve child channels and return a delivery per matching child, enriching
61
+ * each delivered event with the source channel key.
62
+ */
63
+ evaluate(contract: CompositeTimelineChannel, context: ChannelEvaluationContext): Promise<ChannelMatch>;
64
+ /**
65
+ * Determine recency by checking whether any child delivery should process.
66
+ */
67
+ isNewerEvent(contract: CompositeTimelineChannel, context: ChannelEvaluationContext, lastEvent: BlueNode): Promise<boolean>;
68
+ /**
69
+ * Attach the source child channel key to event metadata for handler logic.
70
+ */
71
+ private enrichEvent;
72
+ /**
73
+ * Apply child-level recency rules using the composite-scoped checkpoint entry.
74
+ */
75
+ private shouldProcessChild;
76
+ /**
77
+ * Resolve the checkpoint marker for the current scope, if present.
78
+ */
79
+ private resolveCheckpoint;
80
+ }
81
+ //# sourceMappingURL=composite-timeline-channel-processor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composite-timeline-channel-processor.d.ts","sourceRoot":"","sources":["../../../src/registry/processors/composite-timeline-channel-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG/C,OAAO,EAEL,KAAK,wBAAwB,EAI9B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EACV,wBAAwB,EACxB,YAAY,EACZ,gBAAgB,EAEjB,MAAM,aAAa,CAAC;AAIrB;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,GACf,MAAM,CAER;AAYD,qBAAa,iCAAkC,YAAW,gBAAgB,CAAC,wBAAwB,CAAC;IAClG,QAAQ,CAAC,IAAI,EAAG,SAAS,CAAU;IACnC,QAAQ,CAAC,OAAO,4DAEL;IACX,QAAQ,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAkC;IAEjD;;OAEG;IACH,OAAO,CACL,QAAQ,EAAE,wBAAwB,EAClC,OAAO,EAAE,wBAAwB,GAChC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAI7B;;;OAGG;IACG,QAAQ,CACZ,QAAQ,EAAE,wBAAwB,EAClC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,YAAY,CAAC;IA6FxB;;OAEG;IACG,YAAY,CAChB,QAAQ,EAAE,wBAAwB,EAClC,OAAO,EAAE,wBAAwB,EACjC,SAAS,EAAE,QAAQ,GAClB,OAAO,CAAC,OAAO,CAAC;IAUnB;;OAEG;IACH,OAAO,CAAC,WAAW;IAYnB;;OAEG;YACW,kBAAkB;IA0BhC;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAS1B"}
@@ -3,6 +3,7 @@ import { BlueNode, Blue } from '@blue-labs/language';
3
3
  import { ScopeContractsIndex } from '../types/scope-contracts.js';
4
4
  import { JsonPatch } from '../model/shared/json-patch.js';
5
5
  import { MarkerContract } from '../model/index.js';
6
+ import { ChannelContractEntry } from '../types/channel-contract-entry.js';
6
7
  import { GasMeter } from '../runtime/gas-meter.js';
7
8
  export type ContractProcessorKind = 'handler' | 'channel' | 'marker';
8
9
  export interface ContractProcessor<TContract> {
@@ -53,6 +54,26 @@ export interface ChannelEvaluationContext {
53
54
  * Key assigned to the contract within the scope's contract map.
54
55
  */
55
56
  readonly bindingKey: string;
57
+ /**
58
+ * Optional resolver for channel contracts within the same scope.
59
+ */
60
+ readonly resolveChannel?: (key: string) => ChannelContractEntry | null;
61
+ /**
62
+ * Optional lookup for channel processors by BlueId.
63
+ */
64
+ readonly channelProcessorFor?: (blueId: string) => ChannelProcessor<unknown> | null;
65
+ }
66
+ export interface ChannelDelivery {
67
+ readonly eventNode: BlueNode;
68
+ readonly eventId?: string | null;
69
+ readonly checkpointKey?: string | null;
70
+ readonly shouldProcess?: boolean;
71
+ }
72
+ export interface ChannelMatch {
73
+ readonly matches: boolean;
74
+ readonly eventId?: string | null;
75
+ readonly eventNode?: BlueNode | null;
76
+ readonly deliveries?: readonly ChannelDelivery[];
56
77
  }
57
78
  export interface ChannelProcessor<TContract> extends ContractProcessor<TContract> {
58
79
  readonly kind: 'channel';
@@ -63,6 +84,11 @@ export interface ChannelProcessor<TContract> extends ContractProcessor<TContract
63
84
  * checkpoint signatures and storage from the original external event.
64
85
  */
65
86
  channelize?(contract: TContract, context: ChannelEvaluationContext): BlueNode | null | undefined;
87
+ /**
88
+ * Optional: Provide custom evaluation details, including multi-delivery
89
+ * channel matches.
90
+ */
91
+ evaluate?(contract: TContract, context: ChannelEvaluationContext): ChannelMatch | Promise<ChannelMatch>;
66
92
  /**
67
93
  * Optional: Determine whether an event should be processed relative to the
68
94
  * last checkpointed event for this channel.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/registry/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAErE,MAAM,WAAW,iBAAiB,CAAC,SAAS;IAC1C,QAAQ,CAAC,IAAI,EAAE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,CACP,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE,wBAAwB,GAChC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACxC;;;OAGG;IACH,YAAY,CAAC,CACX,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE,wBAAwB,EACjC,SAAS,EAAE,QAAQ,GAClB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,eAAe,CAC9B,SAAS,CACT,SAAQ,iBAAiB,CAAC,SAAS,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;CACzB;AAED,MAAM,MAAM,oBAAoB,GAC5B,gBAAgB,CAAC,OAAO,CAAC,GACzB,gBAAgB,CAAC,OAAO,CAAC,GACzB,eAAe,CAAC,OAAO,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"blue.d.ts","sourceRoot":"","sources":["../../src/test-support/blue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AAoEvD,wBAAgB,UAAU,IAAI,IAAI,CAIjC;AAED,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;CAAc,CAAC"}
1
+ {"version":3,"file":"blue.d.ts","sourceRoot":"","sources":["../../src/test-support/blue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AAqEvD,wBAAgB,UAAU,IAAI,IAAI,CAKjC;AAED,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;CAAc,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { ChannelContract } from '../model/index.js';
2
+ export interface ChannelContractEntry {
3
+ readonly key: string;
4
+ readonly contract: ChannelContract;
5
+ readonly blueId: string;
6
+ }
7
+ //# sourceMappingURL=channel-contract-entry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel-contract-entry.d.ts","sourceRoot":"","sources":["../../src/types/channel-contract-entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB"}
@@ -0,0 +1,7 @@
1
+ import { HandlerContract } from '../model/index.js';
2
+ export interface HandlerContractEntry {
3
+ readonly key: string;
4
+ readonly contract: HandlerContract;
5
+ readonly blueId: string;
6
+ }
7
+ //# sourceMappingURL=handler-contract-entry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler-contract-entry.d.ts","sourceRoot":"","sources":["../../src/types/handler-contract-entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB"}
@@ -0,0 +1,7 @@
1
+ import { MarkerContract } from '../model/index.js';
2
+ export interface MarkerContractEntry {
3
+ readonly key: string;
4
+ readonly contract: MarkerContract;
5
+ readonly blueId: string;
6
+ }
7
+ //# sourceMappingURL=marker-contract-entry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marker-contract-entry.d.ts","sourceRoot":"","sources":["../../src/types/marker-contract-entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blue-labs/document-processor",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -19,8 +19,8 @@
19
19
  "!dist/package.json"
20
20
  ],
21
21
  "dependencies": {
22
- "@blue-labs/language": "3.1.0",
23
- "@blue-labs/shared-utils": "3.1.0",
22
+ "@blue-labs/language": "3.2.0",
23
+ "@blue-labs/shared-utils": "3.2.0",
24
24
  "@blue-quickjs/abi-manifest": "0.2.4",
25
25
  "@blue-quickjs/dv": "0.2.4",
26
26
  "@blue-quickjs/quickjs-runtime": "0.2.4",