@openparser/lineage 1.0.2

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 (67) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/LICENSE +201 -0
  3. package/README.md +211 -0
  4. package/dist/activity.d.ts +74 -0
  5. package/dist/activity.d.ts.map +1 -0
  6. package/dist/approval.d.ts +24 -0
  7. package/dist/approval.d.ts.map +1 -0
  8. package/dist/builder.d.ts +48 -0
  9. package/dist/builder.d.ts.map +1 -0
  10. package/dist/common.d.ts +34 -0
  11. package/dist/common.d.ts.map +1 -0
  12. package/dist/confidence.d.ts +61 -0
  13. package/dist/confidence.d.ts.map +1 -0
  14. package/dist/derivation.d.ts +163 -0
  15. package/dist/derivation.d.ts.map +1 -0
  16. package/dist/document.d.ts +412 -0
  17. package/dist/document.d.ts.map +1 -0
  18. package/dist/entity.d.ts +126 -0
  19. package/dist/entity.d.ts.map +1 -0
  20. package/dist/fields.d.ts +76 -0
  21. package/dist/fields.d.ts.map +1 -0
  22. package/dist/index.d.ts +21 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +870 -0
  25. package/dist/labels.d.ts +11 -0
  26. package/dist/labels.d.ts.map +1 -0
  27. package/dist/profile/grounding.d.ts +34 -0
  28. package/dist/profile/grounding.d.ts.map +1 -0
  29. package/dist/profile/index.d.ts +14 -0
  30. package/dist/profile/index.d.ts.map +1 -0
  31. package/dist/profile/index.js +1298 -0
  32. package/dist/profile/labels.d.ts +10 -0
  33. package/dist/profile/labels.d.ts.map +1 -0
  34. package/dist/profile/recognition.d.ts +70 -0
  35. package/dist/profile/recognition.d.ts.map +1 -0
  36. package/dist/profile/transform-validation.d.ts +250 -0
  37. package/dist/profile/transform-validation.d.ts.map +1 -0
  38. package/dist/prov.d.ts +40 -0
  39. package/dist/prov.d.ts.map +1 -0
  40. package/dist/relation.d.ts +27 -0
  41. package/dist/relation.d.ts.map +1 -0
  42. package/dist/traverse.d.ts +12 -0
  43. package/dist/traverse.d.ts.map +1 -0
  44. package/dist/validate.d.ts +14 -0
  45. package/dist/validate.d.ts.map +1 -0
  46. package/lineage.schema.json +625 -0
  47. package/package.json +71 -0
  48. package/src/activity.ts +65 -0
  49. package/src/approval.ts +28 -0
  50. package/src/builder.ts +129 -0
  51. package/src/common.ts +58 -0
  52. package/src/confidence.ts +72 -0
  53. package/src/derivation.ts +81 -0
  54. package/src/document.ts +82 -0
  55. package/src/entity.ts +87 -0
  56. package/src/fields.ts +163 -0
  57. package/src/index.ts +123 -0
  58. package/src/labels.ts +13 -0
  59. package/src/profile/grounding.ts +74 -0
  60. package/src/profile/index.ts +67 -0
  61. package/src/profile/labels.ts +28 -0
  62. package/src/profile/recognition.ts +149 -0
  63. package/src/profile/transform-validation.ts +1379 -0
  64. package/src/prov.ts +205 -0
  65. package/src/relation.ts +32 -0
  66. package/src/traverse.ts +91 -0
  67. package/src/validate.ts +221 -0
@@ -0,0 +1,48 @@
1
+ import type { Activity, Agent } from './activity.js';
2
+ import type { ConfidenceAssertion } from './confidence.js';
3
+ import { type Derivation, type DerivationInput, type Transformation } from './derivation.js';
4
+ import type { LineageDocument } from './document.js';
5
+ import type { Entity } from './entity.js';
6
+ import type { Relation } from './relation.js';
7
+ type EntityInput = Entity;
8
+ type ActivityInput = Activity;
9
+ type AgentInput = Agent;
10
+ /**
11
+ * Ergonomic builder for `lineage@1` documents. Validates on {@link build}.
12
+ */
13
+ export declare class LineageBuilder {
14
+ private id?;
15
+ private profiles?;
16
+ private readonly entities;
17
+ private readonly activities;
18
+ private readonly agents;
19
+ private readonly derivations;
20
+ private relations?;
21
+ private outputs;
22
+ private attributes?;
23
+ withId(id: string): this;
24
+ withProfiles(...profiles: string[]): this;
25
+ withAttributes(attributes: NonNullable<LineageDocument['attributes']>): this;
26
+ entity(id: string, entity: EntityInput): this;
27
+ activity(id: string, activity: ActivityInput): this;
28
+ agent(id: string, agent: AgentInput): this;
29
+ /**
30
+ * Record that `activityId` produced `outputId` from `inputs`.
31
+ */
32
+ derive(args: {
33
+ /** Optional, as in the wire format: the output already identifies it. */
34
+ id?: string;
35
+ output: string;
36
+ activity: string;
37
+ inputs?: Array<DerivationInput | string>;
38
+ transformation?: Transformation;
39
+ confidence?: ConfidenceAssertion;
40
+ attributes?: Derivation['attributes'];
41
+ }): this;
42
+ relation(relation: Relation): this;
43
+ withOutputs(...entityIds: string[]): this;
44
+ /** Assemble and strictly validate the document. */
45
+ build(): LineageDocument;
46
+ }
47
+ export {};
48
+ //# sourceMappingURL=builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAElD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EACL,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,KAAK,WAAW,GAAG,MAAM,CAAC;AAC1B,KAAK,aAAa,GAAG,QAAQ,CAAC;AAC9B,KAAK,UAAU,GAAG,KAAK,CAAC;AAExB;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,EAAE,CAAC,CAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,CAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkC;IAC3D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoC;IAC/D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiC;IACxD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAoB;IAChD,OAAO,CAAC,SAAS,CAAC,CAAa;IAC/B,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,UAAU,CAAC,CAAgC;IAEnD,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAKxB,YAAY,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI;IAKzC,cAAc,CAAC,UAAU,EAAE,WAAW,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,GAAG,IAAI;IAK5E,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI;IAQ7C,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI;IAQnD,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI;IAQ1C;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE;QACX,yEAAyE;QACzE,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,KAAK,CAAC,eAAe,GAAG,MAAM,CAAC,CAAC;QACzC,cAAc,CAAC,EAAE,cAAc,CAAC;QAChC,UAAU,CAAC,EAAE,mBAAmB,CAAC;QACjC,UAAU,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;KACvC,GAAG,IAAI;IAoBR,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAKlC,WAAW,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI;IAKzC,mDAAmD;IACnD,KAAK,IAAI,eAAe;CAczB"}
@@ -0,0 +1,34 @@
1
+ import { z } from 'zod';
2
+ /** Non-empty identifier used as a map key or cross-reference. */
3
+ export declare const LineageIdSchema: z.ZodString;
4
+ export type LineageId = z.infer<typeof LineageIdSchema>;
5
+ /** JSON-safe attribute bags and free-form parameter objects. */
6
+ export declare const JsonValueSchema: z.ZodJSONSchema;
7
+ export type JsonValue = z.infer<typeof JsonValueSchema>;
8
+ export declare const AttributesSchema: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
9
+ export type Attributes = z.infer<typeof AttributesSchema>;
10
+ /**
11
+ * Structural equality for JSON values: whether two values say the same thing.
12
+ * Object key order is not part of what a JSON value says, so it is normalised
13
+ * away rather than compared.
14
+ */
15
+ export declare function jsonValuesEqual(left: JsonValue, right: JsonValue): boolean;
16
+ /**
17
+ * RFC 6901 JSON Pointer. The empty string addresses the whole document.
18
+ * JSONPath is useful for queries, but pointers give lineage entities one
19
+ * unambiguous location.
20
+ */
21
+ export declare const JsonPointerSchema: z.ZodString;
22
+ export type JsonPointer = z.infer<typeof JsonPointerSchema>;
23
+ /** Wire format tag for this package. */
24
+ export declare const LINEAGE_FORMAT: "lineage@1";
25
+ export declare const LineageFormatSchema: z.ZodLiteral<"lineage@1">;
26
+ export type LineageFormat = z.infer<typeof LineageFormatSchema>;
27
+ /**
28
+ * RFC 3339 timestamp string. Offset is required (`Z` or `±HH:mm`). Calendar
29
+ * dates that are not real days are rejected rather than rolled over.
30
+ * Start/end ordering is enforced at the document graph level.
31
+ */
32
+ export declare const TimestampSchema: z.ZodISODateTime;
33
+ export type Timestamp = z.infer<typeof TimestampSchema>;
34
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,iEAAiE;AACjE,eAAO,MAAM,eAAe,aAAoC,CAAC;AACjE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,gEAAgE;AAChE,eAAO,MAAM,eAAe,iBAAW,CAAC;AACxC,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,gBAAgB,2CAA+C,CAAC;AAC7E,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAK1E;AAYD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,aAGgD,CAAC;AAC/E,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,wCAAwC;AACxC,eAAO,MAAM,cAAc,EAAG,WAAoB,CAAC;AACnD,eAAO,MAAM,mBAAmB,2BAA4B,CAAC;AAC7D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,eAAe,kBAA2C,CAAC;AACxE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
@@ -0,0 +1,61 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Explicit numeric scale for a confidence score.
4
+ *
5
+ * Scores are not forced into 0..1 so original provider scales remain
6
+ * representable without lossy normalization.
7
+ */
8
+ export declare const ConfidenceScaleSchema: z.ZodObject<{
9
+ min: z.ZodNumber;
10
+ max: z.ZodNumber;
11
+ }, z.core.$strict>;
12
+ export type ConfidenceScale = z.infer<typeof ConfidenceScaleSchema>;
13
+ export declare const CONFIDENCE_KINDS: readonly ["reported", "derived", "assessed"];
14
+ export declare const ConfidenceKindSchema: z.ZodEnum<{
15
+ reported: "reported";
16
+ derived: "derived";
17
+ assessed: "assessed";
18
+ }>;
19
+ export type ConfidenceKind = z.infer<typeof ConfidenceKindSchema>;
20
+ export declare const ConfidenceSourceSchema: z.ZodObject<{
21
+ type: z.ZodEnum<{
22
+ agent: "agent";
23
+ entity: "entity";
24
+ activity: "activity";
25
+ }>;
26
+ id: z.ZodString;
27
+ }, z.core.$strict>;
28
+ export type ConfidenceSource = z.infer<typeof ConfidenceSourceSchema>;
29
+ /**
30
+ * Generic confidence assertion attached to entities, derivations, or other
31
+ * statements. `score` must lie within `scale`; comparison across uncalibrated
32
+ * assertions is not implied.
33
+ */
34
+ export declare const ConfidenceAssertionSchema: z.ZodObject<{
35
+ score: z.ZodNumber;
36
+ scale: z.ZodObject<{
37
+ min: z.ZodNumber;
38
+ max: z.ZodNumber;
39
+ }, z.core.$strict>;
40
+ kind: z.ZodEnum<{
41
+ reported: "reported";
42
+ derived: "derived";
43
+ assessed: "assessed";
44
+ }>;
45
+ scope: z.ZodString;
46
+ granularity: z.ZodOptional<z.ZodString>;
47
+ calibrated: z.ZodDefault<z.ZodBoolean>;
48
+ sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
49
+ type: z.ZodEnum<{
50
+ agent: "agent";
51
+ entity: "entity";
52
+ activity: "activity";
53
+ }>;
54
+ id: z.ZodString;
55
+ }, z.core.$strict>>>;
56
+ method: z.ZodOptional<z.ZodString>;
57
+ sampleCount: z.ZodOptional<z.ZodNumber>;
58
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
59
+ }, z.core.$strict>;
60
+ export type ConfidenceAssertion = z.infer<typeof ConfidenceAssertionSchema>;
61
+ //# sourceMappingURL=confidence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confidence.d.ts","sourceRoot":"","sources":["../src/confidence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;;;kBAc9B,CAAC;AACL,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,gBAAgB,8CAA+C,CAAC;AAC7E,eAAO,MAAM,oBAAoB;;;;EAA2B,CAAC;AAC7D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,sBAAsB;;;;;;;kBAKxB,CAAC;AACZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;kBA2BlC,CAAC;AACL,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,163 @@
1
+ import { z } from 'zod';
2
+ export declare const DERIVATION_EFFECTS: readonly ["direct", "indirect"];
3
+ export declare const MAX_DERIVATION_INPUTS = 1024;
4
+ export declare const DerivationEffectSchema: z.ZodEnum<{
5
+ direct: "direct";
6
+ indirect: "indirect";
7
+ }>;
8
+ export type DerivationEffect = z.infer<typeof DerivationEffectSchema>;
9
+ /**
10
+ * An input entity reference on a derivation, with optional role and whether
11
+ * the influence on the output is direct or indirect (PROV: Revision /
12
+ * Quotation / PrimarySource style distinctions are profile-level; here we
13
+ * keep the general direct/indirect effect flag).
14
+ *
15
+ * `confidence` measures this input's contribution to this one output, which is
16
+ * not the same statement as the input entity's own confidence. A shared source
17
+ * region is read once but cited by several outputs, and each output may draw on
18
+ * a different, differently legible part of it — so how well one output was
19
+ * recognized in that region belongs on the edge, not on the region.
20
+ */
21
+ export declare const DerivationInputSchema: z.ZodObject<{
22
+ entity: z.ZodString;
23
+ role: z.ZodOptional<z.ZodString>;
24
+ effect: z.ZodDefault<z.ZodEnum<{
25
+ direct: "direct";
26
+ indirect: "indirect";
27
+ }>>;
28
+ confidence: z.ZodOptional<z.ZodObject<{
29
+ score: z.ZodNumber;
30
+ scale: z.ZodObject<{
31
+ min: z.ZodNumber;
32
+ max: z.ZodNumber;
33
+ }, z.core.$strict>;
34
+ kind: z.ZodEnum<{
35
+ reported: "reported";
36
+ derived: "derived";
37
+ assessed: "assessed";
38
+ }>;
39
+ scope: z.ZodString;
40
+ granularity: z.ZodOptional<z.ZodString>;
41
+ calibrated: z.ZodDefault<z.ZodBoolean>;
42
+ sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
43
+ type: z.ZodEnum<{
44
+ agent: "agent";
45
+ entity: "entity";
46
+ activity: "activity";
47
+ }>;
48
+ id: z.ZodString;
49
+ }, z.core.$strict>>>;
50
+ method: z.ZodOptional<z.ZodString>;
51
+ sampleCount: z.ZodOptional<z.ZodNumber>;
52
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
53
+ }, z.core.$strict>>;
54
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
55
+ }, z.core.$strict>;
56
+ export type DerivationInput = z.infer<typeof DerivationInputSchema>;
57
+ /**
58
+ * Optional descriptor of how inputs were transformed into the output.
59
+ *
60
+ * `type` is an open string. OpenLineage's column-lineage vocabulary —
61
+ * `identity`, `transformation`, `aggregation`, `join`, `group_by`, `filter`,
62
+ * `sort`, `window`, `conditional` — reads well here, and profiles may use their
63
+ * own namespaced values instead.
64
+ */
65
+ export declare const TransformationSchema: z.ZodObject<{
66
+ type: z.ZodOptional<z.ZodString>;
67
+ description: z.ZodOptional<z.ZodString>;
68
+ expression: z.ZodOptional<z.ZodString>;
69
+ masking: z.ZodOptional<z.ZodBoolean>;
70
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
71
+ }, z.core.$strict>;
72
+ export type Transformation = z.infer<typeof TransformationSchema>;
73
+ /**
74
+ * Output-centric derivation: one activity produced exactly one output entity
75
+ * from zero or more typed inputs. A derived entity has at most one producer
76
+ * derivation in a document (enforced by graph validation).
77
+ *
78
+ * `output` already identifies the derivation uniquely, so `id` is optional and
79
+ * normally omitted — use {@link derivationId} to resolve one. Producers with
80
+ * their own stable identifiers may still set it.
81
+ */
82
+ export declare const DerivationSchema: z.ZodObject<{
83
+ id: z.ZodOptional<z.ZodString>;
84
+ output: z.ZodString;
85
+ activity: z.ZodString;
86
+ inputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
87
+ entity: z.ZodString;
88
+ role: z.ZodOptional<z.ZodString>;
89
+ effect: z.ZodDefault<z.ZodEnum<{
90
+ direct: "direct";
91
+ indirect: "indirect";
92
+ }>>;
93
+ confidence: z.ZodOptional<z.ZodObject<{
94
+ score: z.ZodNumber;
95
+ scale: z.ZodObject<{
96
+ min: z.ZodNumber;
97
+ max: z.ZodNumber;
98
+ }, z.core.$strict>;
99
+ kind: z.ZodEnum<{
100
+ reported: "reported";
101
+ derived: "derived";
102
+ assessed: "assessed";
103
+ }>;
104
+ scope: z.ZodString;
105
+ granularity: z.ZodOptional<z.ZodString>;
106
+ calibrated: z.ZodDefault<z.ZodBoolean>;
107
+ sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
108
+ type: z.ZodEnum<{
109
+ agent: "agent";
110
+ entity: "entity";
111
+ activity: "activity";
112
+ }>;
113
+ id: z.ZodString;
114
+ }, z.core.$strict>>>;
115
+ method: z.ZodOptional<z.ZodString>;
116
+ sampleCount: z.ZodOptional<z.ZodNumber>;
117
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
118
+ }, z.core.$strict>>;
119
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
120
+ }, z.core.$strict>>>;
121
+ transformation: z.ZodOptional<z.ZodObject<{
122
+ type: z.ZodOptional<z.ZodString>;
123
+ description: z.ZodOptional<z.ZodString>;
124
+ expression: z.ZodOptional<z.ZodString>;
125
+ masking: z.ZodOptional<z.ZodBoolean>;
126
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
127
+ }, z.core.$strict>>;
128
+ confidence: z.ZodOptional<z.ZodObject<{
129
+ score: z.ZodNumber;
130
+ scale: z.ZodObject<{
131
+ min: z.ZodNumber;
132
+ max: z.ZodNumber;
133
+ }, z.core.$strict>;
134
+ kind: z.ZodEnum<{
135
+ reported: "reported";
136
+ derived: "derived";
137
+ assessed: "assessed";
138
+ }>;
139
+ scope: z.ZodString;
140
+ granularity: z.ZodOptional<z.ZodString>;
141
+ calibrated: z.ZodDefault<z.ZodBoolean>;
142
+ sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
143
+ type: z.ZodEnum<{
144
+ agent: "agent";
145
+ entity: "entity";
146
+ activity: "activity";
147
+ }>;
148
+ id: z.ZodString;
149
+ }, z.core.$strict>>>;
150
+ method: z.ZodOptional<z.ZodString>;
151
+ sampleCount: z.ZodOptional<z.ZodNumber>;
152
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
153
+ }, z.core.$strict>>;
154
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
155
+ }, z.core.$strict>;
156
+ export type Derivation = z.infer<typeof DerivationSchema>;
157
+ /**
158
+ * Stable identifier for a derivation: its explicit `id` when the producer set
159
+ * one, otherwise `derivation:<output>`. Because one derivation produces one
160
+ * output, that fallback is unique within a document.
161
+ */
162
+ export declare function derivationId(derivation: Pick<Derivation, 'id' | 'output'>): string;
163
+ //# sourceMappingURL=derivation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"derivation.d.ts","sourceRoot":"","sources":["../src/derivation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,kBAAkB,iCAAkC,CAAC;AAClE,eAAO,MAAM,qBAAqB,OAAQ,CAAC;AAC3C,eAAO,MAAM,sBAAsB;;;EAA6B,CAAC;AACjE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAQvB,CAAC;AACZ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB;;;;;;kBAQtB,CAAC;AACZ,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAUlB,CAAC;AACZ,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,QAAQ,CAAC,GAAG,MAAM,CAElF"}