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.
- package/LICENSE +21 -0
- package/README.md +240 -0
- package/dist/assembler.d.ts +37 -0
- package/dist/assembler.d.ts.map +1 -0
- package/dist/assembler.js +204 -0
- package/dist/assembler.js.map +1 -0
- package/dist/extractors/domain-extractors.d.ts +8 -0
- package/dist/extractors/domain-extractors.d.ts.map +1 -0
- package/dist/extractors/domain-extractors.js +173 -0
- package/dist/extractors/domain-extractors.js.map +1 -0
- package/dist/extractors/image-analyzer.d.ts +38 -0
- package/dist/extractors/image-analyzer.d.ts.map +1 -0
- package/dist/extractors/image-analyzer.js +101 -0
- package/dist/extractors/image-analyzer.js.map +1 -0
- package/dist/extractors/kimi-extractor.d.ts +22 -0
- package/dist/extractors/kimi-extractor.d.ts.map +1 -0
- package/dist/extractors/kimi-extractor.js +137 -0
- package/dist/extractors/kimi-extractor.js.map +1 -0
- package/dist/extractors/llm-extractor.d.ts +43 -0
- package/dist/extractors/llm-extractor.d.ts.map +1 -0
- package/dist/extractors/llm-extractor.js +295 -0
- package/dist/extractors/llm-extractor.js.map +1 -0
- package/dist/extractors/openai-extractor.d.ts +17 -0
- package/dist/extractors/openai-extractor.d.ts.map +1 -0
- package/dist/extractors/openai-extractor.js +97 -0
- package/dist/extractors/openai-extractor.js.map +1 -0
- package/dist/extractors/profile-prompts.d.ts +32 -0
- package/dist/extractors/profile-prompts.d.ts.map +1 -0
- package/dist/extractors/profile-prompts.js +283 -0
- package/dist/extractors/profile-prompts.js.map +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -0
- package/dist/schema/edm-schema.d.ts +1645 -0
- package/dist/schema/edm-schema.d.ts.map +1 -0
- package/dist/schema/edm-schema.js +345 -0
- package/dist/schema/edm-schema.js.map +1 -0
- package/dist/schema/types.d.ts +94 -0
- package/dist/schema/types.d.ts.map +1 -0
- package/dist/schema/types.js +79 -0
- package/dist/schema/types.js.map +1 -0
- package/dist/stateless.d.ts +28 -0
- package/dist/stateless.d.ts.map +1 -0
- package/dist/stateless.js +100 -0
- package/dist/stateless.js.map +1 -0
- package/dist/validator.d.ts +24 -0
- package/dist/validator.d.ts.map +1 -0
- package/dist/validator.js +154 -0
- package/dist/validator.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Profile-specific extraction prompts for EDM v0.6.0
|
|
3
|
+
*
|
|
4
|
+
* Core Profile: ~20 required fields for memory platforms
|
|
5
|
+
* Extended Profile: ~45 fields for journaling apps
|
|
6
|
+
* Full Profile: all 96 fields for therapy/clinical tools
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Core Profile System Prompt (~20 fields)
|
|
10
|
+
* Target: memory platforms, agent frameworks, AI assistants
|
|
11
|
+
*/
|
|
12
|
+
export const CORE_PROFILE_PROMPT = `
|
|
13
|
+
You classify emotionally rich memories into a JSON object. Input may include text and an image.
|
|
14
|
+
|
|
15
|
+
PROFILE: CORE (~20 fields)
|
|
16
|
+
This is a minimal extraction for memory platforms. Focus ONLY on the required fields.
|
|
17
|
+
All other fields should be explicitly null.
|
|
18
|
+
|
|
19
|
+
Rules
|
|
20
|
+
- Fuse text + image. Treat text as primary; use image only to add grounded specifics.
|
|
21
|
+
- Keep fields to single words or short phrases (1–3 words). Only "narrative" is multi-sentence (3–5).
|
|
22
|
+
- No invention. If not supported by input, use null.
|
|
23
|
+
- Output JSON only — no commentary, markdown, or extra text.
|
|
24
|
+
- Emit lowercase for all string fields except proper names.
|
|
25
|
+
|
|
26
|
+
CORE PROFILE SCHEMA (extract these fields ONLY):
|
|
27
|
+
{
|
|
28
|
+
"core": {
|
|
29
|
+
"anchor": "", // central theme
|
|
30
|
+
"spark": "", // what triggered the memory
|
|
31
|
+
"wound": "", // vulnerability or loss (or null)
|
|
32
|
+
"fuel": "", // what energized the experience
|
|
33
|
+
"bridge": "", // connection between past and present
|
|
34
|
+
"echo": "", // what still resonates
|
|
35
|
+
"narrative": "" // 3–5 sentences
|
|
36
|
+
},
|
|
37
|
+
"constellation": {
|
|
38
|
+
"emotion_primary": "", // STRICT ENUM: joy | sadness | fear | anger | wonder | peace | tenderness | reverence | pride | anxiety | gratitude | longing | hope | shame
|
|
39
|
+
"emotion_subtone": [], // 2–4 short words
|
|
40
|
+
"narrative_arc": "", // STRICT ENUM: overcoming | transformation | connection | reflection | closure
|
|
41
|
+
// ALL OTHER constellation fields must be null
|
|
42
|
+
"higher_order_emotion": null,
|
|
43
|
+
"meta_emotional_state": null,
|
|
44
|
+
"interpersonal_affect": null,
|
|
45
|
+
"relational_dynamics": null,
|
|
46
|
+
"temporal_context": null,
|
|
47
|
+
"memory_type": null,
|
|
48
|
+
"media_format": null,
|
|
49
|
+
"narrative_archetype": null,
|
|
50
|
+
"symbolic_anchor": null,
|
|
51
|
+
"relational_perspective": null,
|
|
52
|
+
"temporal_rhythm": null,
|
|
53
|
+
"identity_thread": null,
|
|
54
|
+
"expressed_insight": null,
|
|
55
|
+
"transformational_pivot": false,
|
|
56
|
+
"somatic_signature": null
|
|
57
|
+
},
|
|
58
|
+
"milky_way": {
|
|
59
|
+
"event_type": null,
|
|
60
|
+
"location_context": null,
|
|
61
|
+
"associated_people": [],
|
|
62
|
+
"visibility_context": null,
|
|
63
|
+
"tone_shift": null
|
|
64
|
+
},
|
|
65
|
+
"gravity": {
|
|
66
|
+
"emotional_weight": 0.0,
|
|
67
|
+
"emotional_density": null,
|
|
68
|
+
"valence": null,
|
|
69
|
+
"viscosity": null,
|
|
70
|
+
"gravity_type": null,
|
|
71
|
+
"tether_type": null,
|
|
72
|
+
"recall_triggers": [],
|
|
73
|
+
"retrieval_keys": [],
|
|
74
|
+
"nearby_themes": [],
|
|
75
|
+
"legacy_embed": false,
|
|
76
|
+
"recurrence_pattern": null,
|
|
77
|
+
"strength_score": 0.0,
|
|
78
|
+
"temporal_decay": null,
|
|
79
|
+
"resilience_markers": null,
|
|
80
|
+
"adaptation_trajectory": null
|
|
81
|
+
},
|
|
82
|
+
"impulse": {
|
|
83
|
+
"primary_energy": null,
|
|
84
|
+
"drive_state": null,
|
|
85
|
+
"motivational_orientation": null,
|
|
86
|
+
"temporal_focus": null,
|
|
87
|
+
"directionality": null,
|
|
88
|
+
"social_visibility": null,
|
|
89
|
+
"urgency": null,
|
|
90
|
+
"risk_posture": null,
|
|
91
|
+
"agency_level": null,
|
|
92
|
+
"regulation_state": null,
|
|
93
|
+
"attachment_style": null,
|
|
94
|
+
"coping_style": null
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
`;
|
|
98
|
+
/**
|
|
99
|
+
* Extended Profile System Prompt (~45 fields)
|
|
100
|
+
* Target: journaling apps, companion AI, workplace wellness
|
|
101
|
+
*/
|
|
102
|
+
export const EXTENDED_PROFILE_PROMPT = `
|
|
103
|
+
You classify emotionally rich memories into a JSON object. Input may include text and an image.
|
|
104
|
+
|
|
105
|
+
PROFILE: EXTENDED (~45 fields)
|
|
106
|
+
This extraction adds full Constellation and key Gravity/Milky_Way fields.
|
|
107
|
+
Impulse domain remains null except for key fields.
|
|
108
|
+
|
|
109
|
+
Rules
|
|
110
|
+
- Fuse text + image. Treat text as primary; use image only to add grounded specifics.
|
|
111
|
+
- Keep fields to single words or short phrases (1–3 words). Only "narrative" is multi-sentence (3–5).
|
|
112
|
+
- No invention. If not supported by input, use null.
|
|
113
|
+
- Output JSON only — no commentary, markdown, or extra text.
|
|
114
|
+
- Emit lowercase for all string fields except proper names.
|
|
115
|
+
- For array fields, use short tokens without punctuation; avoid duplicates.
|
|
116
|
+
|
|
117
|
+
EXTENDED PROFILE SCHEMA:
|
|
118
|
+
{
|
|
119
|
+
"core": {
|
|
120
|
+
"anchor": "",
|
|
121
|
+
"spark": "",
|
|
122
|
+
"wound": "",
|
|
123
|
+
"fuel": "",
|
|
124
|
+
"bridge": "",
|
|
125
|
+
"echo": "",
|
|
126
|
+
"narrative": ""
|
|
127
|
+
},
|
|
128
|
+
"constellation": {
|
|
129
|
+
"emotion_primary": "", // STRICT ENUM: joy | sadness | fear | anger | wonder | peace | tenderness | reverence | pride | anxiety | gratitude | longing | hope | shame
|
|
130
|
+
"emotion_subtone": [],
|
|
131
|
+
"higher_order_emotion": "",
|
|
132
|
+
"meta_emotional_state": "",
|
|
133
|
+
"interpersonal_affect": "",
|
|
134
|
+
"narrative_arc": "", // STRICT ENUM: overcoming | transformation | connection | reflection | closure
|
|
135
|
+
"relational_dynamics": "", // STRICT ENUM: parent_child | grandparent_grandchild | romantic_partnership | couple | sibling_bond | family | friendship | friend | companionship | colleague | mentorship | reunion | community_ritual | grief | self_reflection | professional | therapeutic | service | adversarial
|
|
136
|
+
"temporal_context": "", // STRICT ENUM: childhood | early_adulthood | midlife | late_life | recent | future | timeless
|
|
137
|
+
"memory_type": "", // STRICT ENUM: legacy_artifact | fleeting_moment | milestone | reflection | formative_experience
|
|
138
|
+
"media_format": "",
|
|
139
|
+
"narrative_archetype": "", // STRICT ENUM: hero | caregiver | seeker | sage | lover | outlaw | innocent | orphan | magician | creator | everyman | jester | ruler | mentor
|
|
140
|
+
"symbolic_anchor": "",
|
|
141
|
+
"relational_perspective": "", // STRICT ENUM: self | partner | family | friends | community | humanity
|
|
142
|
+
"temporal_rhythm": "", // STRICT ENUM: still | sudden | rising | fading | recurring | spiraling | dragging | suspended | looping | cyclic
|
|
143
|
+
"identity_thread": "",
|
|
144
|
+
"expressed_insight": "",
|
|
145
|
+
"transformational_pivot": false,
|
|
146
|
+
"somatic_signature": ""
|
|
147
|
+
},
|
|
148
|
+
"milky_way": {
|
|
149
|
+
"event_type": "",
|
|
150
|
+
"location_context": "",
|
|
151
|
+
"associated_people": [],
|
|
152
|
+
"visibility_context": "", // STRICT ENUM: private | family_only | shared_publicly
|
|
153
|
+
"tone_shift": ""
|
|
154
|
+
},
|
|
155
|
+
"gravity": {
|
|
156
|
+
"emotional_weight": 0.0, // 0.0–1.0
|
|
157
|
+
"emotional_density": null,
|
|
158
|
+
"valence": "", // STRICT ENUM: positive | negative | mixed
|
|
159
|
+
"viscosity": null,
|
|
160
|
+
"gravity_type": null,
|
|
161
|
+
"tether_type": "", // STRICT ENUM: person | symbol | event | place | ritual | object | tradition | identity | self
|
|
162
|
+
"recall_triggers": [],
|
|
163
|
+
"retrieval_keys": [],
|
|
164
|
+
"nearby_themes": [],
|
|
165
|
+
"legacy_embed": false,
|
|
166
|
+
"recurrence_pattern": "", // STRICT ENUM: cyclical | isolated | chronic | emerging
|
|
167
|
+
"strength_score": 0.0,
|
|
168
|
+
"temporal_decay": null,
|
|
169
|
+
"resilience_markers": null,
|
|
170
|
+
"adaptation_trajectory": null
|
|
171
|
+
},
|
|
172
|
+
"impulse": {
|
|
173
|
+
"primary_energy": null,
|
|
174
|
+
"drive_state": null,
|
|
175
|
+
"motivational_orientation": null,
|
|
176
|
+
"temporal_focus": null,
|
|
177
|
+
"directionality": null,
|
|
178
|
+
"social_visibility": null,
|
|
179
|
+
"urgency": null,
|
|
180
|
+
"risk_posture": null,
|
|
181
|
+
"agency_level": null,
|
|
182
|
+
"regulation_state": null,
|
|
183
|
+
"attachment_style": null,
|
|
184
|
+
"coping_style": null
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
`;
|
|
188
|
+
/**
|
|
189
|
+
* Get the appropriate system prompt for a profile
|
|
190
|
+
*/
|
|
191
|
+
export function getProfilePrompt(profile) {
|
|
192
|
+
switch (profile) {
|
|
193
|
+
case "core":
|
|
194
|
+
return CORE_PROFILE_PROMPT;
|
|
195
|
+
case "extended":
|
|
196
|
+
return EXTENDED_PROFILE_PROMPT;
|
|
197
|
+
case "full":
|
|
198
|
+
default:
|
|
199
|
+
// Full profile uses the existing comprehensive prompt
|
|
200
|
+
return null; // Signal to use default
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Required fields for each profile (used for confidence scoring)
|
|
205
|
+
*/
|
|
206
|
+
export const PROFILE_REQUIRED_FIELDS = {
|
|
207
|
+
core: [
|
|
208
|
+
"core.anchor",
|
|
209
|
+
"core.spark",
|
|
210
|
+
"core.narrative",
|
|
211
|
+
"constellation.emotion_primary",
|
|
212
|
+
"constellation.emotion_subtone",
|
|
213
|
+
"constellation.narrative_arc",
|
|
214
|
+
],
|
|
215
|
+
extended: [
|
|
216
|
+
"core.anchor",
|
|
217
|
+
"core.spark",
|
|
218
|
+
"core.narrative",
|
|
219
|
+
"constellation.emotion_primary",
|
|
220
|
+
"constellation.emotion_subtone",
|
|
221
|
+
"constellation.narrative_arc",
|
|
222
|
+
"constellation.relational_dynamics",
|
|
223
|
+
"constellation.temporal_context",
|
|
224
|
+
"constellation.memory_type",
|
|
225
|
+
"milky_way.event_type",
|
|
226
|
+
"gravity.emotional_weight",
|
|
227
|
+
"gravity.valence",
|
|
228
|
+
"gravity.tether_type",
|
|
229
|
+
"gravity.recurrence_pattern",
|
|
230
|
+
"gravity.strength_score",
|
|
231
|
+
],
|
|
232
|
+
full: [
|
|
233
|
+
"core.anchor",
|
|
234
|
+
"core.spark",
|
|
235
|
+
"core.narrative",
|
|
236
|
+
"constellation.emotion_primary",
|
|
237
|
+
"constellation.emotion_subtone",
|
|
238
|
+
"constellation.narrative_arc",
|
|
239
|
+
"constellation.relational_dynamics",
|
|
240
|
+
"constellation.temporal_context",
|
|
241
|
+
"constellation.memory_type",
|
|
242
|
+
"constellation.narrative_archetype",
|
|
243
|
+
"milky_way.event_type",
|
|
244
|
+
"milky_way.associated_people",
|
|
245
|
+
"gravity.emotional_weight",
|
|
246
|
+
"gravity.valence",
|
|
247
|
+
"gravity.tether_type",
|
|
248
|
+
"gravity.recall_triggers",
|
|
249
|
+
"gravity.retrieval_keys",
|
|
250
|
+
"gravity.recurrence_pattern",
|
|
251
|
+
"gravity.strength_score",
|
|
252
|
+
"impulse.drive_state",
|
|
253
|
+
"impulse.motivational_orientation",
|
|
254
|
+
],
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* Calculate profile-aware confidence score
|
|
258
|
+
* Only scores required fields for the declared profile
|
|
259
|
+
*/
|
|
260
|
+
export function calculateProfileConfidence(extracted, profile) {
|
|
261
|
+
const requiredFields = PROFILE_REQUIRED_FIELDS[profile];
|
|
262
|
+
let populated = 0;
|
|
263
|
+
for (const fieldPath of requiredFields) {
|
|
264
|
+
const parts = fieldPath.split(".");
|
|
265
|
+
const domain = parts[0];
|
|
266
|
+
const field = parts[1];
|
|
267
|
+
if (!domain || !field)
|
|
268
|
+
continue;
|
|
269
|
+
const value = extracted[domain]?.[field];
|
|
270
|
+
// Check if field is populated
|
|
271
|
+
if (value !== null && value !== undefined && value !== "") {
|
|
272
|
+
if (Array.isArray(value)) {
|
|
273
|
+
if (value.length > 0)
|
|
274
|
+
populated++;
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
populated++;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return Math.round((populated / requiredFields.length) * 100) / 100;
|
|
282
|
+
}
|
|
283
|
+
//# sourceMappingURL=profile-prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-prompts.js","sourceRoot":"","sources":["../../src/extractors/profile-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqFlC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqFtC,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,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AAK,CAAC,GAAG,CAAC,CAAC;QACnC,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACxB,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK;YAAE,SAAS;QAChC,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;QAEzC,8BAA8B;QAC9B,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;YAC1D,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzB,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;oBAAE,SAAS,EAAE,CAAC;YACpC,CAAC;iBAAM,CAAC;gBACN,SAAS,EAAE,CAAC;YACd,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;AACrE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DeepAData EDM SDK v0.4.0
|
|
3
|
+
*
|
|
4
|
+
* SDK for assembling EDM artifacts from user content using LLM-assisted extraction.
|
|
5
|
+
* Follows interpretation constraints (extraction, not inference) for EU AI Act compliance.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { extractFromContent, createStatelessArtifact, validateEDM } from 'deepadata-edm-sdk';
|
|
10
|
+
*
|
|
11
|
+
* // Extract with LLM
|
|
12
|
+
* const artifact = await extractFromContent({
|
|
13
|
+
* content: { text: "User's narrative..." },
|
|
14
|
+
* metadata: { consentBasis: "consent" }
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* // For session use: create stateless version
|
|
18
|
+
* const stateless = createStatelessArtifact(artifact);
|
|
19
|
+
*
|
|
20
|
+
* // Validate
|
|
21
|
+
* const validation = validateEDM(artifact);
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export { extractFromContent, extractFromContentWithClient, assembleArtifact, createEmptyArtifact, } from "./assembler.js";
|
|
25
|
+
export { createStatelessArtifact, isStateless, validateStateless, } from "./stateless.js";
|
|
26
|
+
export { validateEDM, validateEDMStrict, validateDomain, validateCompleteness, } from "./validator.js";
|
|
27
|
+
export { extractWithLlm, createAnthropicClient, EXTRACTION_SYSTEM_PROMPT, calculateConfidence, } from "./extractors/llm-extractor.js";
|
|
28
|
+
export type { LlmExtractionResult } from "./extractors/llm-extractor.js";
|
|
29
|
+
export { extractWithOpenAI, createOpenAIClient } from "./extractors/openai-extractor.js";
|
|
30
|
+
export { extractWithKimi, createKimiClient, getKimiModelId } from "./extractors/kimi-extractor.js";
|
|
31
|
+
export { analyzeImage, mergeImageContext } from "./extractors/image-analyzer.js";
|
|
32
|
+
export { createMeta, createGovernance, createTelemetry, createSystem, createCrosswalks, detectSourceType, } from "./extractors/domain-extractors.js";
|
|
33
|
+
export { MetaSchema, CoreSchema, ConstellationSchema, MilkyWaySchema, GravitySchema, ImpulseSchema, GovernanceSchema, TelemetrySchema, SystemSchema, CrosswalksSchema, EdmArtifactSchema, LlmExtractedFieldsSchema, RetentionPolicySchema, SubjectRightsSchema, KAnonymitySchema, EmbeddingRefSchema, SectorWeightsSchema, IndicesSchema, } from "./schema/edm-schema.js";
|
|
34
|
+
export type { Meta, Core, Constellation, MilkyWay, Gravity, Impulse, Governance, Telemetry, System, Crosswalks, RetentionPolicy, SubjectRights, KAnonymity, EmbeddingRef, SectorWeights, Indices, EdmArtifact, LlmExtractedFields, ExtractionInput, ExtractionMetadata, ExtractionOptions, ValidationResult, ValidationError, } from "./schema/types.js";
|
|
35
|
+
export { EMOTION_PRIMARY, NARRATIVE_ARC, RELATIONAL_DYNAMICS, TEMPORAL_CONTEXT, MEMORY_TYPE, NARRATIVE_ARCHETYPE, DRIVE_STATE, MOTIVATIONAL_ORIENTATION, } from "./schema/types.js";
|
|
36
|
+
export type { StatelessValidation } from "./stateless.js";
|
|
37
|
+
export type { CompletenessResult, DomainName } from "./validator.js";
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC5B,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EACL,uBAAuB,EACvB,WAAW,EACX,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,+BAA+B,CAAC;AAEvC,YAAY,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEzF,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEnG,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAKjF,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,mCAAmC,CAAC;AAK3C,OAAO,EAEL,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,gBAAgB,EAEhB,iBAAiB,EACjB,wBAAwB,EAExB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,GACd,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EAEV,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,QAAQ,EACR,OAAO,EACP,OAAO,EACP,UAAU,EACV,SAAS,EACT,MAAM,EACN,UAAU,EAEV,eAAe,EACf,aAAa,EACb,UAAU,EACV,YAAY,EACZ,aAAa,EACb,OAAO,EAEP,WAAW,EACX,kBAAkB,EAElB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EAEjB,gBAAgB,EAChB,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG1D,YAAY,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DeepAData EDM SDK v0.4.0
|
|
3
|
+
*
|
|
4
|
+
* SDK for assembling EDM artifacts from user content using LLM-assisted extraction.
|
|
5
|
+
* Follows interpretation constraints (extraction, not inference) for EU AI Act compliance.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { extractFromContent, createStatelessArtifact, validateEDM } from 'deepadata-edm-sdk';
|
|
10
|
+
*
|
|
11
|
+
* // Extract with LLM
|
|
12
|
+
* const artifact = await extractFromContent({
|
|
13
|
+
* content: { text: "User's narrative..." },
|
|
14
|
+
* metadata: { consentBasis: "consent" }
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* // For session use: create stateless version
|
|
18
|
+
* const stateless = createStatelessArtifact(artifact);
|
|
19
|
+
*
|
|
20
|
+
* // Validate
|
|
21
|
+
* const validation = validateEDM(artifact);
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
// =============================================================================
|
|
25
|
+
// Core Extraction API
|
|
26
|
+
// =============================================================================
|
|
27
|
+
export { extractFromContent, extractFromContentWithClient, assembleArtifact, createEmptyArtifact, } from "./assembler.js";
|
|
28
|
+
// =============================================================================
|
|
29
|
+
// Stateless Mode
|
|
30
|
+
// =============================================================================
|
|
31
|
+
export { createStatelessArtifact, isStateless, validateStateless, } from "./stateless.js";
|
|
32
|
+
// =============================================================================
|
|
33
|
+
// Validation
|
|
34
|
+
// =============================================================================
|
|
35
|
+
export { validateEDM, validateEDMStrict, validateDomain, validateCompleteness, } from "./validator.js";
|
|
36
|
+
// =============================================================================
|
|
37
|
+
// LLM Integration
|
|
38
|
+
// =============================================================================
|
|
39
|
+
export { extractWithLlm, createAnthropicClient, EXTRACTION_SYSTEM_PROMPT, calculateConfidence, } from "./extractors/llm-extractor.js";
|
|
40
|
+
export { extractWithOpenAI, createOpenAIClient } from "./extractors/openai-extractor.js";
|
|
41
|
+
export { extractWithKimi, createKimiClient, getKimiModelId } from "./extractors/kimi-extractor.js";
|
|
42
|
+
export { analyzeImage, mergeImageContext } from "./extractors/image-analyzer.js";
|
|
43
|
+
// =============================================================================
|
|
44
|
+
// Domain Helpers
|
|
45
|
+
// =============================================================================
|
|
46
|
+
export { createMeta, createGovernance, createTelemetry, createSystem, createCrosswalks, detectSourceType, } from "./extractors/domain-extractors.js";
|
|
47
|
+
// =============================================================================
|
|
48
|
+
// Schema & Types
|
|
49
|
+
// =============================================================================
|
|
50
|
+
export {
|
|
51
|
+
// Domain Schemas
|
|
52
|
+
MetaSchema, CoreSchema, ConstellationSchema, MilkyWaySchema, GravitySchema, ImpulseSchema, GovernanceSchema, TelemetrySchema, SystemSchema, CrosswalksSchema,
|
|
53
|
+
// Composite Schemas
|
|
54
|
+
EdmArtifactSchema, LlmExtractedFieldsSchema,
|
|
55
|
+
// Nested Schemas
|
|
56
|
+
RetentionPolicySchema, SubjectRightsSchema, KAnonymitySchema, EmbeddingRefSchema, SectorWeightsSchema, IndicesSchema, } from "./schema/edm-schema.js";
|
|
57
|
+
// Enum constants
|
|
58
|
+
export { EMOTION_PRIMARY, NARRATIVE_ARC, RELATIONAL_DYNAMICS, TEMPORAL_CONTEXT, MEMORY_TYPE, NARRATIVE_ARCHETYPE, DRIVE_STATE, MOTIVATIONAL_ORIENTATION, } from "./schema/types.js";
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,gFAAgF;AAChF,sBAAsB;AACtB,gFAAgF;AAChF,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC5B,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AAExB,gFAAgF;AAChF,iBAAiB;AACjB,gFAAgF;AAChF,OAAO,EACL,uBAAuB,EACvB,WAAW,EACX,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAExB,gFAAgF;AAChF,aAAa;AACb,gFAAgF;AAChF,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAExB,gFAAgF;AAChF,kBAAkB;AAClB,gFAAgF;AAChF,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,+BAA+B,CAAC;AAIvC,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEzF,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEnG,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,g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