deepadata-edm-sdk 0.6.0-alpha

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 (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +240 -0
  3. package/dist/assembler.d.ts +37 -0
  4. package/dist/assembler.d.ts.map +1 -0
  5. package/dist/assembler.js +204 -0
  6. package/dist/assembler.js.map +1 -0
  7. package/dist/extractors/domain-extractors.d.ts +8 -0
  8. package/dist/extractors/domain-extractors.d.ts.map +1 -0
  9. package/dist/extractors/domain-extractors.js +173 -0
  10. package/dist/extractors/domain-extractors.js.map +1 -0
  11. package/dist/extractors/image-analyzer.d.ts +38 -0
  12. package/dist/extractors/image-analyzer.d.ts.map +1 -0
  13. package/dist/extractors/image-analyzer.js +101 -0
  14. package/dist/extractors/image-analyzer.js.map +1 -0
  15. package/dist/extractors/kimi-extractor.d.ts +22 -0
  16. package/dist/extractors/kimi-extractor.d.ts.map +1 -0
  17. package/dist/extractors/kimi-extractor.js +137 -0
  18. package/dist/extractors/kimi-extractor.js.map +1 -0
  19. package/dist/extractors/llm-extractor.d.ts +43 -0
  20. package/dist/extractors/llm-extractor.d.ts.map +1 -0
  21. package/dist/extractors/llm-extractor.js +295 -0
  22. package/dist/extractors/llm-extractor.js.map +1 -0
  23. package/dist/extractors/openai-extractor.d.ts +17 -0
  24. package/dist/extractors/openai-extractor.d.ts.map +1 -0
  25. package/dist/extractors/openai-extractor.js +97 -0
  26. package/dist/extractors/openai-extractor.js.map +1 -0
  27. package/dist/extractors/profile-prompts.d.ts +32 -0
  28. package/dist/extractors/profile-prompts.d.ts.map +1 -0
  29. package/dist/extractors/profile-prompts.js +283 -0
  30. package/dist/extractors/profile-prompts.js.map +1 -0
  31. package/dist/index.d.ts +38 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +59 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/schema/edm-schema.d.ts +1645 -0
  36. package/dist/schema/edm-schema.d.ts.map +1 -0
  37. package/dist/schema/edm-schema.js +345 -0
  38. package/dist/schema/edm-schema.js.map +1 -0
  39. package/dist/schema/types.d.ts +94 -0
  40. package/dist/schema/types.d.ts.map +1 -0
  41. package/dist/schema/types.js +79 -0
  42. package/dist/schema/types.js.map +1 -0
  43. package/dist/stateless.d.ts +28 -0
  44. package/dist/stateless.d.ts.map +1 -0
  45. package/dist/stateless.js +100 -0
  46. package/dist/stateless.js.map +1 -0
  47. package/dist/validator.d.ts +24 -0
  48. package/dist/validator.d.ts.map +1 -0
  49. package/dist/validator.js +154 -0
  50. package/dist/validator.js.map +1 -0
  51. package/package.json +59 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 deepadata
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,240 @@
1
+ # deepadata-edm-sdk
2
+
3
+ SDK for assembling EDM v0.6.0 artifacts from user content. LLM-assisted extraction with interpretation constraints (not inference). Supports text + image input, profile-aware extraction, stateless mode, and integrates with deepadata-ddna-tools for sealing.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install deepadata-edm-sdk
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```typescript
14
+ import { extractFromContent, createStatelessArtifact, validateEDM } from 'deepadata-edm-sdk';
15
+
16
+ // Set your Anthropic API key
17
+ process.env.ANTHROPIC_API_KEY = 'your-api-key';
18
+
19
+ // Extract EDM artifact from content
20
+ const artifact = await extractFromContent({
21
+ content: {
22
+ text: "Looking at this old photograph brings back so many memories of summer afternoons at grandmother's house...",
23
+ },
24
+ metadata: {
25
+ subjectId: "vp-01HZ3GKWP7XTJY9QN4RD",
26
+ jurisdiction: "GDPR",
27
+ consentBasis: "consent",
28
+ },
29
+ });
30
+
31
+ // Validate the artifact
32
+ const validation = validateEDM(artifact);
33
+ if (!validation.valid) {
34
+ console.error('Validation errors:', validation.errors);
35
+ }
36
+
37
+ // For session use: create privacy-preserving stateless version
38
+ const stateless = createStatelessArtifact(artifact);
39
+
40
+ // The artifact is now ready for sealing with ddna-tools
41
+ console.log(JSON.stringify(artifact, null, 2));
42
+ ```
43
+
44
+ ## Features
45
+
46
+ - **LLM-Assisted Extraction**: Uses Claude, OpenAI, or Kimi to extract emotional data from text and images
47
+ - **EDM v0.6.0 Compliant**: Full support for all 10 EDM domains
48
+ - **Profile Support**: Core (~20 fields), Extended (~45 fields), or Full (all fields)
49
+ - **Text + Image Fusion**: Combines text narrative with image context
50
+ - **Stateless Mode**: Privacy-preserving mode for session use
51
+ - **Schema Validation**: Comprehensive Zod-based validation
52
+ - **Crosswalk Mapping**: Automatic mapping to Plutchik and HMD taxonomies
53
+
54
+ ## Profiles
55
+
56
+ EDM v0.6.0 introduces profile-aware extraction. Choose the profile that matches your use case:
57
+
58
+ | Profile | Fields | Use Case |
59
+ |---------|--------|----------|
60
+ | **core** | ~20 | Memory platforms, agent frameworks, AI assistants |
61
+ | **extended** | ~45 | Journaling apps, companion AI, workplace wellness |
62
+ | **full** | 96 | Therapy tools, clinical applications, research |
63
+
64
+ ```typescript
65
+ // Core profile - minimal extraction
66
+ const artifact = await extractFromContent({
67
+ content: { text: "..." },
68
+ metadata: { consentBasis: "consent" },
69
+ profile: "core",
70
+ });
71
+
72
+ // Extended profile - balanced extraction
73
+ const artifact = await extractFromContent({
74
+ content: { text: "..." },
75
+ metadata: { consentBasis: "consent" },
76
+ profile: "extended",
77
+ });
78
+
79
+ // Full profile - all fields (default)
80
+ const artifact = await extractFromContent({
81
+ content: { text: "..." },
82
+ metadata: { consentBasis: "consent" },
83
+ profile: "full",
84
+ });
85
+ ```
86
+
87
+ See [examples/](examples/) for complete profile artifacts.
88
+
89
+ ## API Reference
90
+
91
+ ### Extraction
92
+
93
+ #### `extractFromContent(options)`
94
+
95
+ Extract a complete EDM artifact from content.
96
+
97
+ ```typescript
98
+ const artifact = await extractFromContent({
99
+ content: {
100
+ text: "User's narrative...",
101
+ image: "base64-encoded-image", // optional
102
+ imageMediaType: "image/jpeg", // optional
103
+ },
104
+ metadata: {
105
+ subjectId: "vp-01HZ3GKWP7XTJY9QN4RD", // optional, null in stateless
106
+ jurisdiction: "GDPR", // optional
107
+ consentBasis: "consent", // required
108
+ locale: "en-us", // optional
109
+ visibility: "private", // optional
110
+ piiTier: "moderate", // optional
111
+ tags: ["family", "memory"], // optional
112
+ },
113
+ model: "claude-sonnet-4-20250514", // optional
114
+ provider: "anthropic", // optional: "anthropic" | "openai" | "kimi"
115
+ profile: "full", // optional: "core" | "extended" | "full"
116
+ });
117
+ ```
118
+
119
+ #### `extractFromContentWithClient(client, options)`
120
+
121
+ Same as above but with a provided Anthropic client.
122
+
123
+ ### Stateless Mode
124
+
125
+ #### `createStatelessArtifact(artifact)`
126
+
127
+ Create a privacy-preserving version for session use.
128
+
129
+ ```typescript
130
+ const stateless = createStatelessArtifact(artifact);
131
+ // - owner_user_id: null
132
+ // - associated_people: []
133
+ // - location_context: null
134
+ // - recall_triggers: []
135
+ // - retrieval_keys: []
136
+ // - exportability: "restricted"
137
+ ```
138
+
139
+ #### `isStateless(artifact)`
140
+
141
+ Check if an artifact is in stateless mode.
142
+
143
+ #### `validateStateless(artifact)`
144
+
145
+ Validate stateless compliance with detailed violations.
146
+
147
+ ### Validation
148
+
149
+ #### `validateEDM(artifact)`
150
+
151
+ Validate against the complete EDM v0.4.0 schema.
152
+
153
+ ```typescript
154
+ const result = validateEDM(artifact);
155
+ // { valid: boolean, errors: ValidationError[] }
156
+ ```
157
+
158
+ #### `validateDomain(domain, data)`
159
+
160
+ Validate a specific domain.
161
+
162
+ ```typescript
163
+ const result = validateDomain("constellation", artifact.constellation);
164
+ ```
165
+
166
+ #### `validateCompleteness(artifact)`
167
+
168
+ Check field population and completeness.
169
+
170
+ ```typescript
171
+ const result = validateCompleteness(artifact);
172
+ // { complete: boolean, missingFields: string[], populationRate: number }
173
+ ```
174
+
175
+ ### Helpers
176
+
177
+ #### `createEmptyArtifact()`
178
+
179
+ Create an empty artifact structure for manual population.
180
+
181
+ #### `createAnthropicClient(apiKey?)`
182
+
183
+ Create an Anthropic client (uses `ANTHROPIC_API_KEY` env var if not provided).
184
+
185
+ ## EDM v0.4.0 Domains
186
+
187
+ The SDK supports all 10 EDM domains:
188
+
189
+ | Domain | Description | Extraction |
190
+ |--------|-------------|------------|
191
+ | **meta** | Identity, provenance, consent | From metadata |
192
+ | **core** | Anchor, spark, wound, fuel, bridge, echo, narrative | LLM |
193
+ | **constellation** | Emotional classification, archetypes | LLM |
194
+ | **milky_way** | Contextual grounding (people, place, event) | LLM |
195
+ | **gravity** | Salience, weight, retrieval keys | LLM |
196
+ | **impulse** | Motivational state, drive, coping | LLM |
197
+ | **governance** | Jurisdiction, retention, rights | From metadata |
198
+ | **telemetry** | Extraction confidence, model ID | Auto-populated |
199
+ | **system** | Embeddings, indices (downstream) | Empty |
200
+ | **crosswalks** | External taxonomy mappings | Auto-mapped |
201
+
202
+ ## Integration with ddna-tools
203
+
204
+ After extraction, seal the artifact for portability:
205
+
206
+ ```typescript
207
+ import { seal } from 'deepadata-ddna-tools';
208
+
209
+ const envelope = await seal(artifact, privateKey, did);
210
+ // Result: signed .ddna envelope
211
+ ```
212
+
213
+ ## Interpretation Boundary
214
+
215
+ This SDK performs **extraction, not inference**. The LLM extracts what is explicitly stated or clearly implied in the source content. It does not:
216
+
217
+ - Infer psychological states beyond stated emotions
218
+ - Diagnose conditions or suggest treatments
219
+ - Make predictions about future behavior
220
+ - Generate content not grounded in the input
221
+
222
+ See [docs/EXTRACTION_VS_INFERENCE.md](docs/EXTRACTION_VS_INFERENCE.md) for details.
223
+
224
+ ## EU AI Act Compliance
225
+
226
+ This SDK is designed for compliance with the EU AI Act. Emotional data extraction with interpretation constraints is considered lower risk than emotion inference systems. See [docs/EU_AI_ACT_COMPLIANCE.md](docs/EU_AI_ACT_COMPLIANCE.md).
227
+
228
+ ## Schema Version
229
+
230
+ This SDK implements EDM v0.6.0. Key changes from v0.5:
231
+
232
+ - Added `meta.profile` field for conformance level declaration
233
+ - Profile-aware extraction with tailored system prompts
234
+ - Profile-aware confidence scoring
235
+ - Three conformance profiles: core (~20 fields), extended (~45 fields), full (96 fields)
236
+ - Added Kimi K2 extractor support via MoonshotAI API
237
+
238
+ ## License
239
+
240
+ MIT
@@ -0,0 +1,37 @@
1
+ /**
2
+ * EDM Artifact Assembler v0.6.0
3
+ * Combines LLM-extracted fields with metadata to create complete artifacts
4
+ * Supports profile-aware extraction (core/extended/full)
5
+ */
6
+ import Anthropic from "@anthropic-ai/sdk";
7
+ import type { EdmArtifact, ExtractionOptions, LlmExtractedFields, EdmProfile } from "./schema/types.js";
8
+ /**
9
+ * Extract a complete EDM artifact from content
10
+ *
11
+ * @param options - Extraction options including profile
12
+ * @returns Complete EDM artifact
13
+ */
14
+ export declare function extractFromContent(options: ExtractionOptions): Promise<EdmArtifact>;
15
+ /**
16
+ * Extract from content with a provided Anthropic client
17
+ */
18
+ export declare function extractFromContentWithClient(client: Anthropic, options: ExtractionOptions): Promise<EdmArtifact>;
19
+ interface AssemblyContext {
20
+ confidence: number;
21
+ model: string;
22
+ profile: EdmProfile;
23
+ provider?: 'anthropic' | 'openai' | 'kimi';
24
+ notes: string | null;
25
+ hasText: boolean;
26
+ hasImage: boolean;
27
+ }
28
+ /**
29
+ * Assemble a complete EDM artifact from extracted fields and metadata
30
+ */
31
+ export declare function assembleArtifact(extracted: LlmExtractedFields, metadata: ExtractionOptions["metadata"], context: AssemblyContext): EdmArtifact;
32
+ /**
33
+ * Create an empty EDM artifact structure (for manual population)
34
+ */
35
+ export declare function createEmptyArtifact(): EdmArtifact;
36
+ export {};
37
+ //# sourceMappingURL=assembler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assembler.d.ts","sourceRoot":"","sources":["../src/assembler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAaxG;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC,CAyBzF;AAED;;GAEG;AACH,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,WAAW,CAAC,CAgBtB;AAED,UAAU,eAAe;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,UAAU,CAAC;IACpB,QAAQ,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,kBAAkB,EAC7B,QAAQ,EAAE,iBAAiB,CAAC,UAAU,CAAC,EACvC,OAAO,EAAE,eAAe,GACvB,WAAW,CAeb;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,WAAW,CA+HjD"}
@@ -0,0 +1,204 @@
1
+ import { extractWithLlm, createAnthropicClient } from "./extractors/llm-extractor.js";
2
+ import { extractWithOpenAI, createOpenAIClient } from "./extractors/openai-extractor.js";
3
+ import { extractWithKimi, createKimiClient, getKimiModelId } from "./extractors/kimi-extractor.js";
4
+ import { createMeta, createGovernance, createTelemetry, createSystem, createCrosswalks, detectSourceType, } from "./extractors/domain-extractors.js";
5
+ /**
6
+ * Extract a complete EDM artifact from content
7
+ *
8
+ * @param options - Extraction options including profile
9
+ * @returns Complete EDM artifact
10
+ */
11
+ export async function extractFromContent(options) {
12
+ const { content, metadata, model, provider = "kimi", temperature, profile = "full" } = options;
13
+ let llmResult;
14
+ if (provider === "openai") {
15
+ const client = createOpenAIClient();
16
+ llmResult = await extractWithOpenAI(client, content, model, temperature, profile);
17
+ }
18
+ else if (provider === "kimi") {
19
+ const client = createKimiClient();
20
+ llmResult = await extractWithKimi(client, content, model ?? getKimiModelId(), profile);
21
+ }
22
+ else {
23
+ const client = createAnthropicClient();
24
+ llmResult = await extractWithLlm(client, content, model, profile);
25
+ }
26
+ // Assemble complete artifact with profile
27
+ return assembleArtifact(llmResult.extracted, metadata, {
28
+ confidence: llmResult.confidence,
29
+ model: llmResult.model,
30
+ profile: llmResult.profile,
31
+ provider,
32
+ notes: llmResult.notes,
33
+ hasText: !!content.text,
34
+ hasImage: !!content.image,
35
+ });
36
+ }
37
+ /**
38
+ * Extract from content with a provided Anthropic client
39
+ */
40
+ export async function extractFromContentWithClient(client, options) {
41
+ const { content, metadata, model, profile = "full" } = options;
42
+ // Extract with LLM
43
+ const llmResult = await extractWithLlm(client, content, model, profile);
44
+ // Assemble complete artifact (always Anthropic when using provided client)
45
+ return assembleArtifact(llmResult.extracted, metadata, {
46
+ confidence: llmResult.confidence,
47
+ model: llmResult.model,
48
+ profile: llmResult.profile,
49
+ provider: 'anthropic',
50
+ notes: llmResult.notes,
51
+ hasText: !!content.text,
52
+ hasImage: !!content.image,
53
+ });
54
+ }
55
+ /**
56
+ * Assemble a complete EDM artifact from extracted fields and metadata
57
+ */
58
+ export function assembleArtifact(extracted, metadata, context) {
59
+ const sourceType = detectSourceType(context.hasText, context.hasImage);
60
+ return {
61
+ meta: createMeta(metadata, sourceType, context.profile),
62
+ core: extracted.core,
63
+ constellation: extracted.constellation,
64
+ milky_way: extracted.milky_way,
65
+ gravity: extracted.gravity,
66
+ impulse: extracted.impulse,
67
+ governance: createGovernance(metadata),
68
+ telemetry: createTelemetry(context.confidence, context.model, context.notes, context.provider),
69
+ system: createSystem(),
70
+ crosswalks: createCrosswalks(extracted),
71
+ };
72
+ }
73
+ /**
74
+ * Create an empty EDM artifact structure (for manual population)
75
+ */
76
+ export function createEmptyArtifact() {
77
+ return {
78
+ meta: {
79
+ id: null,
80
+ version: "0.5.0",
81
+ created_at: new Date().toISOString(),
82
+ updated_at: null,
83
+ locale: null,
84
+ owner_user_id: null,
85
+ parent_id: null,
86
+ visibility: "private",
87
+ pii_tier: "none",
88
+ source_type: "text",
89
+ source_context: null,
90
+ consent_basis: "none",
91
+ consent_scope: null,
92
+ consent_revoked_at: null,
93
+ tags: [],
94
+ },
95
+ core: {
96
+ anchor: null,
97
+ spark: null,
98
+ wound: null,
99
+ fuel: null,
100
+ bridge: null,
101
+ echo: null,
102
+ narrative: null,
103
+ },
104
+ constellation: {
105
+ emotion_primary: null,
106
+ emotion_subtone: [],
107
+ higher_order_emotion: null,
108
+ meta_emotional_state: null,
109
+ interpersonal_affect: null,
110
+ narrative_arc: null,
111
+ relational_dynamics: null,
112
+ temporal_context: null,
113
+ memory_type: null,
114
+ media_format: null,
115
+ narrative_archetype: null,
116
+ symbolic_anchor: null,
117
+ relational_perspective: null,
118
+ temporal_rhythm: null,
119
+ identity_thread: null,
120
+ expressed_insight: null,
121
+ transformational_pivot: false,
122
+ somatic_signature: null,
123
+ },
124
+ milky_way: {
125
+ event_type: null,
126
+ location_context: null,
127
+ associated_people: [],
128
+ visibility_context: null,
129
+ tone_shift: null,
130
+ },
131
+ gravity: {
132
+ emotional_weight: 0,
133
+ emotional_density: null,
134
+ valence: null,
135
+ viscosity: null,
136
+ gravity_type: null,
137
+ tether_type: null,
138
+ recall_triggers: [],
139
+ retrieval_keys: [],
140
+ nearby_themes: [],
141
+ legacy_embed: false,
142
+ recurrence_pattern: null,
143
+ strength_score: 0,
144
+ temporal_decay: null,
145
+ resilience_markers: null,
146
+ adaptation_trajectory: null,
147
+ },
148
+ impulse: {
149
+ primary_energy: null,
150
+ drive_state: null,
151
+ motivational_orientation: null,
152
+ temporal_focus: null,
153
+ directionality: null,
154
+ social_visibility: null,
155
+ urgency: null,
156
+ risk_posture: null,
157
+ agency_level: null,
158
+ regulation_state: null,
159
+ attachment_style: null,
160
+ coping_style: null,
161
+ },
162
+ governance: {
163
+ jurisdiction: null,
164
+ retention_policy: null,
165
+ subject_rights: {
166
+ portable: true,
167
+ erasable: true,
168
+ explainable: false,
169
+ },
170
+ exportability: "allowed",
171
+ k_anonymity: null,
172
+ policy_labels: ["none"],
173
+ masking_rules: [],
174
+ },
175
+ telemetry: {
176
+ entry_confidence: 0,
177
+ extraction_model: null,
178
+ extraction_provider: null,
179
+ extraction_notes: null,
180
+ alignment_delta: null,
181
+ },
182
+ system: {
183
+ embeddings: [],
184
+ indices: {
185
+ waypoint_ids: [],
186
+ sector_weights: {
187
+ episodic: 0,
188
+ semantic: 0,
189
+ procedural: 0,
190
+ emotional: 0,
191
+ reflective: 0,
192
+ },
193
+ },
194
+ },
195
+ crosswalks: {
196
+ plutchik_primary: null,
197
+ geneva_emotion_wheel: null,
198
+ DSM5_specifiers: null,
199
+ HMD_v2_memory_type: null,
200
+ ISO_27557_labels: null,
201
+ },
202
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AAE,IAAI;YACtB,gBAAgB,EAAE,IAAI;YACtB,YAAY,EAAE,IAAI;SACnB;QACD,UAAU,EAAE;YACV,YAAY,EAAE,IAAI;YAClB,gBAAgB,EAAE,IAAI;YACtB,cAAc,EAAE;gBACd,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,KAAK;aACnB;YACD,aAAa,EAAE,SAAS;YACxB,WAAW,EAAE,IAAI;YACjB,aAAa,EAAE,CAAC,MAAM,CAAC;YACvB,aAAa,EAAE,EAAE;SAClB;QACD,SAAS,EAAE;YACT,gBAAgB,EAAE,CAAC;YACnB,gBAAgB,EAAE,IAAI;YACtB,mBAAmB,EAAE,IAAI;YACzB,gBAAgB,EAAE,IAAI;YACtB,eAAe,EAAE,IAAI;SACtB;QACD,MAAM,EAAE;YACN,UAAU,EAAE,EAAE;YACd,OAAO,EAAE;gBACP,YAAY,EAAE,EAAE;gBAChB,cAAc,EAAE;oBACd,QAAQ,EAAE,CAAC;oBACX,QAAQ,EAAE,CAAC;oBACX,UAAU,EAAE,CAAC;oBACb,SAAS,EAAE,CAAC;oBACZ,UAAU,EAAE,CAAC;iBACd;aACF;SACF;QACD,UAAU,EAAE;YACV,gBAAgB,EAAE,IAAI;YACtB,oBAAoB,EAAE,IAAI;YAC1B,eAAe,EAAE,IAAI;YACrB,kBAAkB,EAAE,IAAI;YACxB,gBAAgB,EAAE,IAAI;SACvB;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { Meta, Governance, Telemetry, System, Crosswalks, ExtractionMetadata, LlmExtractedFields, EdmProfile } from "../schema/types.js";
2
+ export declare function createMeta(metadata: ExtractionMetadata, sourceType: Meta["source_type"], profile?: EdmProfile): Meta;
3
+ export declare function createGovernance(metadata: ExtractionMetadata): Governance;
4
+ export declare function createTelemetry(confidence: number, model: string, notes: string | null, provider?: 'anthropic' | 'openai' | 'kimi' | null): Telemetry;
5
+ export declare function createSystem(): System;
6
+ export declare function createCrosswalks(extracted: LlmExtractedFields): Crosswalks;
7
+ export declare function detectSourceType(hasText: boolean, hasImage: boolean): Meta["source_type"];
8
+ //# sourceMappingURL=domain-extractors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain-extractors.d.ts","sourceRoot":"","sources":["../../src/extractors/domain-extractors.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,IAAI,EACJ,UAAU,EACV,SAAS,EACT,MAAM,EACN,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACX,MAAM,oBAAoB,CAAC;AAK5B,wBAAgB,UAAU,CACxB,QAAQ,EAAE,kBAAkB,EAC5B,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,EAC/B,OAAO,GAAE,UAAmB,GAC3B,IAAI,CAmBN;AAKD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,UAAU,CAoBzE;AAuDD,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,QAAQ,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,IAAI,GAChD,SAAS,CAQX;AAKD,wBAAgB,YAAY,IAAI,MAAM,CAgBrC;AAKD,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,kBAAkB,GAAG,UAAU,CAmC1E;AAKD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,CAQzF"}