deepadata-edm-sdk 0.8.8 → 0.8.10
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/README.md +6 -0
- package/dist/assembler.d.ts +33 -4
- package/dist/assembler.d.ts.map +1 -1
- package/dist/assembler.js +146 -14
- package/dist/assembler.js.map +1 -1
- package/dist/conversation.d.ts +62 -0
- package/dist/conversation.d.ts.map +1 -0
- package/dist/conversation.js +96 -0
- package/dist/conversation.js.map +1 -0
- package/dist/extractors/generate-field-block.d.ts +44 -0
- package/dist/extractors/generate-field-block.d.ts.map +1 -0
- package/dist/extractors/generate-field-block.js +253 -0
- package/dist/extractors/generate-field-block.js.map +1 -0
- package/dist/extractors/kimi-extractor.d.ts +2 -2
- package/dist/extractors/kimi-extractor.d.ts.map +1 -1
- package/dist/extractors/kimi-extractor.js +21 -13
- package/dist/extractors/kimi-extractor.js.map +1 -1
- package/dist/extractors/llm-extractor.d.ts +24 -2
- package/dist/extractors/llm-extractor.d.ts.map +1 -1
- package/dist/extractors/llm-extractor.js +95 -56
- package/dist/extractors/llm-extractor.js.map +1 -1
- package/dist/extractors/openai-extractor.d.ts +2 -2
- package/dist/extractors/openai-extractor.d.ts.map +1 -1
- package/dist/extractors/openai-extractor.js +11 -6
- package/dist/extractors/openai-extractor.js.map +1 -1
- package/dist/extractors/output-sanitizer.d.ts +26 -0
- package/dist/extractors/output-sanitizer.d.ts.map +1 -0
- package/dist/extractors/output-sanitizer.js +129 -0
- package/dist/extractors/output-sanitizer.js.map +1 -0
- package/dist/extractors/profile-prompts.d.ts +2 -2
- package/dist/extractors/profile-prompts.d.ts.map +1 -1
- package/dist/extractors/profile-prompts.js +66 -41
- package/dist/extractors/profile-prompts.js.map +1 -1
- package/dist/extractors/stance-guard.d.ts +75 -0
- package/dist/extractors/stance-guard.d.ts.map +1 -0
- package/dist/extractors/stance-guard.js +171 -0
- package/dist/extractors/stance-guard.js.map +1 -0
- package/dist/index.d.ts +12 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/schema/edm-schema.d.ts +42 -26
- package/dist/schema/edm-schema.d.ts.map +1 -1
- package/dist/schema/edm-schema.js +18 -3
- package/dist/schema/edm-schema.js.map +1 -1
- package/dist/schema/types.d.ts +33 -1
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/schema/types.js +12 -1
- package/dist/schema/types.js.map +1 -1
- package/package.json +4 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-prompts.d.ts","sourceRoot":"","sources":["../../src/extractors/profile-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"profile-prompts.d.ts","sourceRoot":"","sources":["../../src/extractors/profile-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,owHAmDpC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,4oUA2GnC,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAW5D;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,CAgDhE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAClD,OAAO,EAAE,UAAU,GAClB,MAAM,CAuBR"}
|
|
@@ -25,20 +25,29 @@ Rules
|
|
|
25
25
|
- Emit lowercase for all string fields except proper names.
|
|
26
26
|
- Use canonical values where they fit. If no canonical value accurately represents the content, use the most accurate free-text term. Accuracy takes precedence over canonical conformance.
|
|
27
27
|
|
|
28
|
+
SUBJECT ANCHORING (critical)
|
|
29
|
+
- The SUBJECT is the person this artifact will belong to. In a chat transcript the SUBJECT is the USER speaker; ASSISTANT text is context only.
|
|
30
|
+
- Extract relative to the SUBJECT, not the passage. Do not invent emotional detail the subject never expressed.
|
|
31
|
+
|
|
32
|
+
EXPERIENTIAL STANCE (critical)
|
|
33
|
+
Classify whose experience the emotionally salient material is, in the top-level "experiential_stance" key: lived (subject's own experience) | witnessed (subject directly affected) | quoted_third_party (someone else's story quoted/pasted/retold) | assistant_generated (assistant-invented fiction or examples) | hypothetical (imagined scenarios, role-play). Pick ONE or null.
|
|
34
|
+
If the stance is quoted_third_party, assistant_generated, or hypothetical: do NOT encode that material into wound — it describes the SUBJECT. Return null instead.
|
|
35
|
+
|
|
28
36
|
ESSENTIAL PROFILE SCHEMA (extract these fields ONLY):
|
|
29
37
|
{
|
|
38
|
+
"experiential_stance": "", // STRICT ENUM: lived | witnessed | quoted_third_party | assistant_generated | hypothetical (pick ONE or null)
|
|
30
39
|
"core": {
|
|
31
|
-
"anchor": "",
|
|
32
|
-
"spark": "",
|
|
33
|
-
"wound": "",
|
|
34
|
-
"fuel": "",
|
|
35
|
-
"bridge": "",
|
|
36
|
-
"echo": ""
|
|
40
|
+
"anchor": "", // central theme (e.g., "dad's toolbox", "nana's traditions")
|
|
41
|
+
"spark": "", // what triggered the memory (e.g., "finding the cassette", "first snow")
|
|
42
|
+
"wound": "", // The specific vulnerability, loss, or pain present — NOT generic labels like 'loss' or 'grief' but what exactly was lost or why it hurts. Examples: 'unlived travel dream', 'war silence never spoken', 'father died before I knew him', 'shame of not fitting in'. If no wound is present, use null.
|
|
43
|
+
"fuel": "", // what energized the experience (e.g., "shared laughter", "curiosity")
|
|
44
|
+
"bridge": "", // connection between past and present (e.g., "replaying old tape", "returning to the porch")
|
|
45
|
+
"echo": "" // what still resonates (e.g., "her laugh", "smell of oil", "city lights on water")
|
|
37
46
|
},
|
|
38
47
|
"constellation": {
|
|
39
|
-
"emotion_primary": "",
|
|
40
|
-
"emotion_subtone": [],
|
|
41
|
-
"narrative_arc": ""
|
|
48
|
+
"emotion_primary": "", // CANONICAL: joy | sadness | fear | anger | wonder | peace | tenderness | reverence | pride | anxiety | gratitude | longing | hope | shame | disappointment | relief | frustration (free text accepted if none fits)
|
|
49
|
+
"emotion_subtone": [], // 2–4 short words (e.g., bittersweet, grateful) — free text array
|
|
50
|
+
"narrative_arc": "" // CANONICAL: overcoming | transformation | connection | reflection | closure | loss | confrontation (free text accepted if none fits)
|
|
42
51
|
}
|
|
43
52
|
}
|
|
44
53
|
|
|
@@ -75,51 +84,67 @@ Rules
|
|
|
75
84
|
- For array fields, use short tokens without punctuation; avoid duplicates.
|
|
76
85
|
- Use canonical values where they fit. If no canonical value accurately represents the content, use the most accurate free-text term. Accuracy takes precedence over canonical conformance.
|
|
77
86
|
|
|
87
|
+
SUBJECT ANCHORING (critical)
|
|
88
|
+
- The SUBJECT is the person this artifact will belong to. In a chat transcript the SUBJECT is the USER speaker; ASSISTANT text is context only, never a source of the subject's experience.
|
|
89
|
+
- Score every field relative to the SUBJECT, not the passage. emotional_weight measures what this content meant TO THE SUBJECT — not how vivid, dramatic, or emotionally rich the text itself is.
|
|
90
|
+
- Routine work content (debugging, drafting, planning, logistics) is 0.1–0.4 even when the subject expresses momentary relief or frustration. Reserve 0.7+ for events with personal stakes the subject states or plainly carries. Do not invent somatic or emotional detail the subject never expressed.
|
|
91
|
+
- transformational_pivot is true ONLY if the subject explicitly marks the experience as life-changing. Finishing a task, fixing a bug, or shipping a feature is not a transformational pivot.
|
|
92
|
+
|
|
93
|
+
EXPERIENTIAL STANCE (critical)
|
|
94
|
+
Classify whose experience the emotionally salient material is, in the top-level "experiential_stance" key:
|
|
95
|
+
- "lived" — the subject's own first-hand experience
|
|
96
|
+
- "witnessed" — events the subject personally witnessed or is directly affected by (a loved one's death, a family crisis)
|
|
97
|
+
- "quoted_third_party" — someone else's story the subject quoted, pasted, or retold without being a participant (an article, test data, a stranger's anecdote)
|
|
98
|
+
- "assistant_generated" — fiction, examples, or anecdotes produced by the assistant, not reported by the subject
|
|
99
|
+
- "hypothetical" — imagined scenarios, drafts about invented people, role-play
|
|
100
|
+
If the stance is quoted_third_party, assistant_generated, or hypothetical: do NOT encode that material into wound, identity_thread, expressed_insight, somatic_signature, transformational_pivot, or high emotional_weight — those fields describe the SUBJECT. Extract only what the content reveals about the subject themselves (e.g. why they engaged with it), or return null fields with low weight.
|
|
101
|
+
|
|
78
102
|
EXTENDED PROFILE SCHEMA:
|
|
79
103
|
{
|
|
104
|
+
"experiential_stance": "", // STRICT ENUM: lived | witnessed | quoted_third_party | assistant_generated | hypothetical (pick ONE or null)
|
|
80
105
|
"core": {
|
|
81
|
-
"anchor": "",
|
|
82
|
-
"spark": "",
|
|
83
|
-
"wound": "",
|
|
84
|
-
"fuel": "",
|
|
85
|
-
"bridge": "",
|
|
86
|
-
"echo": "",
|
|
87
|
-
"narrative": ""
|
|
106
|
+
"anchor": "", // central theme (e.g., "dad's toolbox", "nana's traditions")
|
|
107
|
+
"spark": "", // what triggered the memory (e.g., "finding the cassette", "first snow")
|
|
108
|
+
"wound": "", // The specific vulnerability, loss, or pain present — NOT generic labels like 'loss' or 'grief' but what exactly was lost or why it hurts. Examples: 'unlived travel dream', 'war silence never spoken', 'father died before I knew him', 'shame of not fitting in'. If no wound is present, use null.
|
|
109
|
+
"fuel": "", // what energized the experience (e.g., "shared laughter", "curiosity")
|
|
110
|
+
"bridge": "", // connection between past and present (e.g., "replaying old tape", "returning to the porch")
|
|
111
|
+
"echo": "", // what still resonates (e.g., "her laugh", "smell of oil", "city lights on water")
|
|
112
|
+
"narrative": "" // 3–5 sentences. REQUIRED: include ALL of the following — ≥1 concrete sensory detail (sight, sound, smell, texture), ≥1 temporal cue that anchors the memory in time, ≥1 symbolic callback that connects past to present. Write from the subject's perspective. Do not compress or summarise — give the memory space to breathe. Faithful and specific. Never generic.
|
|
88
113
|
},
|
|
89
114
|
"constellation": {
|
|
90
115
|
"emotion_primary": "", // CANONICAL: joy | sadness | fear | anger | wonder | peace | tenderness | reverence | pride | anxiety | gratitude | longing | hope | shame | disappointment | relief | frustration (free text accepted if none fits)
|
|
91
|
-
"emotion_subtone": [],
|
|
92
|
-
"higher_order_emotion": "",
|
|
93
|
-
"meta_emotional_state": "",
|
|
94
|
-
"interpersonal_affect": "",
|
|
116
|
+
"emotion_subtone": [], // 2–4 short words (e.g., bittersweet, grateful) — free text array
|
|
117
|
+
"higher_order_emotion": "", // free text: e.g., awe, forgiveness, pride, moral_elevation (or null)
|
|
118
|
+
"meta_emotional_state": "", // free text: e.g., acceptance, confusion, curiosity (or null)
|
|
119
|
+
"interpersonal_affect": "", // free text: e.g., warmth, openness, defensiveness (or null)
|
|
95
120
|
"narrative_arc": "", // CANONICAL: overcoming | transformation | connection | reflection | closure | loss | confrontation (free text accepted if none fits)
|
|
96
121
|
"relational_dynamics": "", // CANONICAL: 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 (free text accepted if none fits)
|
|
97
|
-
"temporal_context": "", // STRICT ENUM: childhood | early_adulthood | midlife | late_life | recent | future | timeless
|
|
98
|
-
"memory_type": "", // STRICT ENUM: legacy_artifact | fleeting_moment | milestone | reflection | formative_experience
|
|
99
|
-
"media_format": "", // STRICT ENUM: photo | video | audio | text | photo_with_story
|
|
100
|
-
"narrative_archetype": "", // STRICT ENUM: hero | caregiver | seeker | sage | lover | outlaw | innocent |
|
|
101
|
-
"symbolic_anchor": "",
|
|
102
|
-
"relational_perspective": "", // STRICT ENUM: self | partner | family | friends | community | humanity
|
|
103
|
-
"temporal_rhythm": "", // STRICT ENUM: still | sudden | rising | fading | recurring | spiraling | dragging | suspended | looping | cyclic
|
|
104
|
-
"identity_thread": "",
|
|
105
|
-
"expressed_insight": "",
|
|
106
|
-
"transformational_pivot": false,
|
|
107
|
-
"somatic_signature": "",
|
|
122
|
+
"temporal_context": "", // STRICT ENUM: childhood | early_adulthood | midlife | late_life | recent | future | timeless (pick ONE or null)
|
|
123
|
+
"memory_type": "", // STRICT ENUM: legacy_artifact | fleeting_moment | milestone | reflection | formative_experience (pick ONE or null)
|
|
124
|
+
"media_format": "", // STRICT ENUM: photo | video | audio | text | photo_with_story (pick ONE or null)
|
|
125
|
+
"narrative_archetype": "", // STRICT ENUM: hero | caregiver | seeker | sage | lover | outlaw | innocent | magician | creator | everyman | jester | ruler (pick ONE or null; lowercase)
|
|
126
|
+
"symbolic_anchor": "", // concrete object/place/ritual (or null)
|
|
127
|
+
"relational_perspective": "", // STRICT ENUM: self | partner | family | friends | community | humanity (pick ONE or null)
|
|
128
|
+
"temporal_rhythm": "", // STRICT ENUM: still | sudden | rising | fading | recurring | spiraling | dragging | suspended | looping | cyclic (pick ONE or null)
|
|
129
|
+
"identity_thread": "", // short sentence
|
|
130
|
+
"expressed_insight": "", // brief insight explicitly stated by subject (extracted, not inferred)
|
|
131
|
+
"transformational_pivot": false, // true if subject explicitly identifies this as life-changing
|
|
132
|
+
"somatic_signature": "", // bodily sensations explicitly described (e.g., "chest tightness", "warmth spreading") or null
|
|
108
133
|
"arc_type": "" // CANONICAL: betrayal | liberation | grief | discovery | resistance | bond | moral_awakening | transformation | reconciliation | reckoning | threshold | exile | gratitude | authenticity (free text accepted if none fits). gratitude = moments of thankfulness, appreciation, acknowledging blessing; authenticity = feeling fully oneself, self-alignment, identity congruence
|
|
109
134
|
},
|
|
110
135
|
"milky_way": {
|
|
111
|
-
"event_type": "",
|
|
112
|
-
"location_context": "",
|
|
113
|
-
"associated_people": [],
|
|
114
|
-
"visibility_context": "",
|
|
115
|
-
"tone_shift": ""
|
|
136
|
+
"event_type": "", // e.g., family gathering, farewell, birthday (or null)
|
|
137
|
+
"location_context": "", // place from text or image (or null)
|
|
138
|
+
"associated_people": [], // names or roles (proper case allowed)
|
|
139
|
+
"visibility_context": "", // STRICT ENUM: private | family_only | shared_publicly (pick ONE or null)
|
|
140
|
+
"tone_shift": "" // e.g., loss to gratitude (or null)
|
|
116
141
|
},
|
|
117
142
|
"gravity": {
|
|
118
|
-
"emotional_weight": 0.0,
|
|
119
|
-
"valence": "",
|
|
120
|
-
"tether_type": "",
|
|
121
|
-
"recurrence_pattern": "",
|
|
122
|
-
"strength_score": 0.0
|
|
143
|
+
"emotional_weight": 0.0, // 0.0–1.0 (felt intensity IN THE MOMENT). Calibration: 0.9+ life-altering irreversible moments; 0.7-0.9 significant personal events with strong emotional response; 0.4-0.7 meaningful but routine emotional experiences; 0.1-0.4 mild passing emotional content
|
|
144
|
+
"valence": "", // STRICT ENUM: positive | negative | mixed (pick ONE or null)
|
|
145
|
+
"tether_type": "", // CANONICAL: person | symbol | event | place | ritual | object | tradition | identity | self (free text accepted if none fits)
|
|
146
|
+
"recurrence_pattern": "", // CANONICAL: cyclical | isolated | chronic | emerging (free text accepted if none fits)
|
|
147
|
+
"strength_score": 0.0 // 0.0–1.0 (how BOUND/STUCK this memory is)
|
|
123
148
|
}
|
|
124
149
|
}
|
|
125
150
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-prompts.js","sourceRoot":"","sources":["../../src/extractors/profile-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG
|
|
1
|
+
{"version":3,"file":"profile-prompts.js","sourceRoot":"","sources":["../../src/extractors/profile-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDvC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;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C,OAA+C,CAAC;WAC1F,uBAAuB,CAAC,QAAQ,CAAC;IACtC,IAAI,SAAS,GAAG,CAAC,CAAC;IAElB,KAAK,MAAM,SAAS,IAAI,cAAc,EAAE,CAAC;QACvC,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,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"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Experiential-stance attribution guard
|
|
3
|
+
*
|
|
4
|
+
* The worst defect found in the 2026-06-10 archive-sample evidence run:
|
|
5
|
+
* extraction cannot tell whose story it is. An assistant-invented anecdote
|
|
6
|
+
* was encoded as the subject's own marital ritual; a pasted stranger's
|
|
7
|
+
* story became the subject's heaviest grief (weight 0.9). A provenance
|
|
8
|
+
* guard is a launch gate for the significance layer.
|
|
9
|
+
*
|
|
10
|
+
* Three layers of defence:
|
|
11
|
+
* 1. Prompt — extraction prompts require a top-level experiential_stance
|
|
12
|
+
* classification and forbid encoding non-lived material into subject
|
|
13
|
+
* significance fields.
|
|
14
|
+
* 2. Deterministic guard (this module) — if the model still returns a
|
|
15
|
+
* non-subject stance with populated significance fields, those fields
|
|
16
|
+
* are cleared and weights floored. Free; always on.
|
|
17
|
+
* 3. Optional classifier pass — a cheap second LLM call that re-derives
|
|
18
|
+
* stance from the source material and overrides the extraction's claim
|
|
19
|
+
* when the classifier is MORE conservative. Triggered for high-weight
|
|
20
|
+
* conversation extractions (the exact regime where the defect bit).
|
|
21
|
+
*
|
|
22
|
+
* experiential_stance is proposed for EDM v0.9 (see deepadata-com
|
|
23
|
+
* planning/proposals/2026-06-12-experiential-stance-v0.9.md). Until the
|
|
24
|
+
* spec lands it travels in the extraction result + telemetry notes, never
|
|
25
|
+
* in the sealed artifact body, so artifacts stay v0.8.0-conformant.
|
|
26
|
+
*/
|
|
27
|
+
import type OpenAI from "openai";
|
|
28
|
+
import type Anthropic from "@anthropic-ai/sdk";
|
|
29
|
+
import type { ExperientialStance } from "../schema/types.js";
|
|
30
|
+
export interface StanceGuardResult {
|
|
31
|
+
/** Final stance after guard (and classifier, when run) */
|
|
32
|
+
stance: ExperientialStance | null;
|
|
33
|
+
/** Stance claimed by the extraction model, before any override */
|
|
34
|
+
claimedStance: ExperientialStance | null;
|
|
35
|
+
/** True when subject significance fields were cleared/floored */
|
|
36
|
+
demoted: boolean;
|
|
37
|
+
/** Field paths cleared or floored by the guard */
|
|
38
|
+
fieldsCleared: string[];
|
|
39
|
+
/** Set when the classifier pass ran and disagreed with the claim */
|
|
40
|
+
classifierOverride: ExperientialStance | null;
|
|
41
|
+
}
|
|
42
|
+
export declare function isNonSubjectStance(stance: ExperientialStance | null): boolean;
|
|
43
|
+
/** Read and remove the top-level experiential_stance key from extracted fields */
|
|
44
|
+
export declare function takeStance(extracted: Record<string, unknown>): ExperientialStance | null;
|
|
45
|
+
/**
|
|
46
|
+
* Deterministic demotion: clear subject-significance fields when the
|
|
47
|
+
* emotionally salient material is not the subject's own experience.
|
|
48
|
+
* Mutates `extracted` in place; returns the list of fields touched.
|
|
49
|
+
*
|
|
50
|
+
* Kept fields (anchor, spark, narrative, milky_way) still describe the
|
|
51
|
+
* content; the cleared set is exactly the fields that assert something
|
|
52
|
+
* about the SUBJECT's inner life.
|
|
53
|
+
*/
|
|
54
|
+
export declare function applyStanceGuard(extracted: Record<string, unknown>, stance: ExperientialStance | null): string[];
|
|
55
|
+
export interface StanceClassifierInput {
|
|
56
|
+
/** The original (unframed) source text given to extraction */
|
|
57
|
+
sourceText: string;
|
|
58
|
+
/** The extracted narrative or field summary under suspicion */
|
|
59
|
+
extractedSummary: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Classify stance with an OpenAI-compatible client (Kimi/OpenAI).
|
|
63
|
+
* max_tokens leaves headroom for thinking models that spend output
|
|
64
|
+
* tokens on reasoning before the one-word answer.
|
|
65
|
+
*/
|
|
66
|
+
export declare function classifyStanceOpenAI(client: OpenAI, model: string, input: StanceClassifierInput): Promise<ExperientialStance | null>;
|
|
67
|
+
/** Classify stance with an Anthropic client */
|
|
68
|
+
export declare function classifyStanceAnthropic(client: Anthropic, model: string, input: StanceClassifierInput): Promise<ExperientialStance | null>;
|
|
69
|
+
/**
|
|
70
|
+
* Resolve a disagreement between the extraction's claimed stance and the
|
|
71
|
+
* classifier's verdict: the more conservative (less subject-attributing)
|
|
72
|
+
* stance wins. Returns the stance to adopt.
|
|
73
|
+
*/
|
|
74
|
+
export declare function resolveStance(claimed: ExperientialStance | null, classified: ExperientialStance | null): ExperientialStance | null;
|
|
75
|
+
//# sourceMappingURL=stance-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stance-guard.d.ts","sourceRoot":"","sources":["../../src/extractors/stance-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK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B,GAAG,IAAI,CAAC,CASpC;AAWD;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,kBAAkB,GAAG,IAAI,EAClC,UAAU,EAAE,kBAAkB,GAAG,IAAI,GACpC,kBAAkB,GAAG,IAAI,CAI3B"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Experiential-stance attribution guard
|
|
3
|
+
*
|
|
4
|
+
* The worst defect found in the 2026-06-10 archive-sample evidence run:
|
|
5
|
+
* extraction cannot tell whose story it is. An assistant-invented anecdote
|
|
6
|
+
* was encoded as the subject's own marital ritual; a pasted stranger's
|
|
7
|
+
* story became the subject's heaviest grief (weight 0.9). A provenance
|
|
8
|
+
* guard is a launch gate for the significance layer.
|
|
9
|
+
*
|
|
10
|
+
* Three layers of defence:
|
|
11
|
+
* 1. Prompt — extraction prompts require a top-level experiential_stance
|
|
12
|
+
* classification and forbid encoding non-lived material into subject
|
|
13
|
+
* significance fields.
|
|
14
|
+
* 2. Deterministic guard (this module) — if the model still returns a
|
|
15
|
+
* non-subject stance with populated significance fields, those fields
|
|
16
|
+
* are cleared and weights floored. Free; always on.
|
|
17
|
+
* 3. Optional classifier pass — a cheap second LLM call that re-derives
|
|
18
|
+
* stance from the source material and overrides the extraction's claim
|
|
19
|
+
* when the classifier is MORE conservative. Triggered for high-weight
|
|
20
|
+
* conversation extractions (the exact regime where the defect bit).
|
|
21
|
+
*
|
|
22
|
+
* experiential_stance is proposed for EDM v0.9 (see deepadata-com
|
|
23
|
+
* planning/proposals/2026-06-12-experiential-stance-v0.9.md). Until the
|
|
24
|
+
* spec lands it travels in the extraction result + telemetry notes, never
|
|
25
|
+
* in the sealed artifact body, so artifacts stay v0.8.0-conformant.
|
|
26
|
+
*/
|
|
27
|
+
import { EXPERIENTIAL_STANCE } from "../schema/types.js";
|
|
28
|
+
/** Stances whose material must not populate subject significance fields */
|
|
29
|
+
const NON_SUBJECT_STANCES = new Set([
|
|
30
|
+
"quoted_third_party",
|
|
31
|
+
"assistant_generated",
|
|
32
|
+
"hypothetical",
|
|
33
|
+
]);
|
|
34
|
+
export function isNonSubjectStance(stance) {
|
|
35
|
+
return stance !== null && NON_SUBJECT_STANCES.has(stance);
|
|
36
|
+
}
|
|
37
|
+
function parseStance(value) {
|
|
38
|
+
if (typeof value !== "string")
|
|
39
|
+
return null;
|
|
40
|
+
const normalized = value.trim().toLowerCase().replace(/[\s-]+/g, "_");
|
|
41
|
+
return EXPERIENTIAL_STANCE.includes(normalized) ? normalized : null;
|
|
42
|
+
}
|
|
43
|
+
/** Read and remove the top-level experiential_stance key from extracted fields */
|
|
44
|
+
export function takeStance(extracted) {
|
|
45
|
+
const stance = parseStance(extracted["experiential_stance"]);
|
|
46
|
+
delete extracted["experiential_stance"];
|
|
47
|
+
return stance;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Deterministic demotion: clear subject-significance fields when the
|
|
51
|
+
* emotionally salient material is not the subject's own experience.
|
|
52
|
+
* Mutates `extracted` in place; returns the list of fields touched.
|
|
53
|
+
*
|
|
54
|
+
* Kept fields (anchor, spark, narrative, milky_way) still describe the
|
|
55
|
+
* content; the cleared set is exactly the fields that assert something
|
|
56
|
+
* about the SUBJECT's inner life.
|
|
57
|
+
*/
|
|
58
|
+
export function applyStanceGuard(extracted, stance) {
|
|
59
|
+
if (!isNonSubjectStance(stance))
|
|
60
|
+
return [];
|
|
61
|
+
const cleared = [];
|
|
62
|
+
const clearString = (domain, field) => {
|
|
63
|
+
const d = extracted[domain];
|
|
64
|
+
if (d && d[field] != null) {
|
|
65
|
+
d[field] = null;
|
|
66
|
+
cleared.push(`${domain}.${field}`);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
clearString("core", "wound");
|
|
70
|
+
clearString("constellation", "identity_thread");
|
|
71
|
+
clearString("constellation", "expressed_insight");
|
|
72
|
+
clearString("constellation", "somatic_signature");
|
|
73
|
+
const constellation = extracted["constellation"];
|
|
74
|
+
if (constellation && constellation["transformational_pivot"] === true) {
|
|
75
|
+
constellation["transformational_pivot"] = false;
|
|
76
|
+
cleared.push("constellation.transformational_pivot");
|
|
77
|
+
}
|
|
78
|
+
const gravity = extracted["gravity"];
|
|
79
|
+
if (gravity) {
|
|
80
|
+
for (const field of ["emotional_weight", "strength_score"]) {
|
|
81
|
+
const v = gravity[field];
|
|
82
|
+
if (typeof v === "number" && v > 0.2) {
|
|
83
|
+
gravity[field] = 0.2;
|
|
84
|
+
cleared.push(`gravity.${field}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// Impulse fields assert the subject's motivational state — for material
|
|
89
|
+
// the subject didn't live, they describe the story's narrator instead.
|
|
90
|
+
const impulse = extracted["impulse"];
|
|
91
|
+
if (impulse) {
|
|
92
|
+
for (const [field, value] of Object.entries(impulse)) {
|
|
93
|
+
if (value != null) {
|
|
94
|
+
impulse[field] = null;
|
|
95
|
+
cleared.push(`impulse.${field}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return cleared;
|
|
100
|
+
}
|
|
101
|
+
// =============================================================================
|
|
102
|
+
// Classifier pass
|
|
103
|
+
// =============================================================================
|
|
104
|
+
const STANCE_CLASSIFIER_PROMPT = `You classify the experiential stance of source material relative to a SUBJECT. In chat transcripts the SUBJECT is the USER speaker; the ASSISTANT is an AI.
|
|
105
|
+
|
|
106
|
+
Given source material and a summary that was extracted from it, decide whose experience the emotionally significant material is:
|
|
107
|
+
- "lived" — the subject's own first-hand experience
|
|
108
|
+
- "witnessed" — events the subject personally witnessed or is directly affected by (a loved one's death, a family crisis)
|
|
109
|
+
- "quoted_third_party" — someone else's story that the subject quoted, pasted, or retold without being a participant (an article, test data, a stranger's anecdote)
|
|
110
|
+
- "assistant_generated" — fiction, examples, or anecdotes produced by the AI assistant rather than reported by the subject
|
|
111
|
+
- "hypothetical" — imagined scenarios, drafts about invented people, role-play
|
|
112
|
+
|
|
113
|
+
Watch for: the subject pasting text for a task (translation, classification, summarising) — that content is quoted_third_party even if emotionally intense. An anecdote that first appears in an ASSISTANT message is assistant_generated unless the subject confirms it happened.
|
|
114
|
+
|
|
115
|
+
Answer with EXACTLY one word: lived, witnessed, quoted_third_party, assistant_generated, or hypothetical.`;
|
|
116
|
+
/** How much source material the classifier sees (head slice) */
|
|
117
|
+
const CLASSIFIER_SOURCE_CHARS = 12_000;
|
|
118
|
+
function buildClassifierUserContent(input) {
|
|
119
|
+
return (`SOURCE MATERIAL (may be truncated):\n${input.sourceText.slice(0, CLASSIFIER_SOURCE_CHARS)}\n\n` +
|
|
120
|
+
`EXTRACTED SUMMARY:\n${input.extractedSummary}\n\n` +
|
|
121
|
+
`Whose experience is the emotionally significant material? One word.`);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Classify stance with an OpenAI-compatible client (Kimi/OpenAI).
|
|
125
|
+
* max_tokens leaves headroom for thinking models that spend output
|
|
126
|
+
* tokens on reasoning before the one-word answer.
|
|
127
|
+
*/
|
|
128
|
+
export async function classifyStanceOpenAI(client, model, input) {
|
|
129
|
+
const response = await client.chat.completions.create({
|
|
130
|
+
model,
|
|
131
|
+
max_tokens: 1024,
|
|
132
|
+
// No explicit temperature: kimi-k2.5 rejects any value other than 1.
|
|
133
|
+
messages: [
|
|
134
|
+
{ role: "system", content: STANCE_CLASSIFIER_PROMPT },
|
|
135
|
+
{ role: "user", content: buildClassifierUserContent(input) },
|
|
136
|
+
],
|
|
137
|
+
});
|
|
138
|
+
return parseStance(response.choices[0]?.message?.content?.trim().split(/\s+/).pop());
|
|
139
|
+
}
|
|
140
|
+
/** Classify stance with an Anthropic client */
|
|
141
|
+
export async function classifyStanceAnthropic(client, model, input) {
|
|
142
|
+
const response = await client.messages.create({
|
|
143
|
+
model,
|
|
144
|
+
max_tokens: 64,
|
|
145
|
+
system: STANCE_CLASSIFIER_PROMPT,
|
|
146
|
+
messages: [{ role: "user", content: buildClassifierUserContent(input) }],
|
|
147
|
+
});
|
|
148
|
+
const block = response.content.find((b) => b.type === "text");
|
|
149
|
+
return parseStance(block && block.type === "text" ? block.text.trim().split(/\s+/).pop() : null);
|
|
150
|
+
}
|
|
151
|
+
/** Conservatism order — higher index wins a disagreement */
|
|
152
|
+
const CONSERVATISM = {
|
|
153
|
+
lived: 0,
|
|
154
|
+
witnessed: 1,
|
|
155
|
+
hypothetical: 2,
|
|
156
|
+
quoted_third_party: 3,
|
|
157
|
+
assistant_generated: 4,
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Resolve a disagreement between the extraction's claimed stance and the
|
|
161
|
+
* classifier's verdict: the more conservative (less subject-attributing)
|
|
162
|
+
* stance wins. Returns the stance to adopt.
|
|
163
|
+
*/
|
|
164
|
+
export function resolveStance(claimed, classified) {
|
|
165
|
+
if (classified === null)
|
|
166
|
+
return claimed;
|
|
167
|
+
if (claimed === null)
|
|
168
|
+
return classified;
|
|
169
|
+
return CONSERVATISM[classified] > CONSERVATISM[claimed] ? classified : claimed;
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=stance-guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stance-guard.js","sourceRoot":"","sources":["../../src/extractors/stance-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAKH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,2EAA2E;AAC3E,MAAM,mBAAmB,GAAoC,IAAI,GAAG,CAAC;IACnE,oBAAoB;IACpB,qBAAqB;IACrB,cAAc;CACf,CAAC,CAAC;AAeH,MAAM,UAAU,kBAAkB,CAAC,MAAiC;IAClE,OAAO,MAAM,KAAK,IAAI,IAAI,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC5D,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IA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C9D,OAAO,WAAW,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACnG,CAAC;AAED,4DAA4D;AAC5D,MAAM,YAAY,GAAuC;IACvD,KAAK,EAAE,CAAC;IACR,SAAS,EAAE,CAAC;IACZ,YAAY,EAAE,CAAC;IACf,kBAAkB,EAAE,CAAC;IACrB,mBAAmB,EAAE,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC3B,OAAkC,EAClC,UAAqC;IAErC,IAAI,UAAU,KAAK,IAAI;QAAE,OAAO,OAAO,CAAC;IACxC,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,UAAU,CAAC;IACxC,OAAO,YAAY,CAAC,UAAU,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC;AACjF,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -24,18 +24,26 @@
|
|
|
24
24
|
* const validation = validateProfileConformance(artifact);
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
|
-
export { extractFromContent, extractFromContentWithClient, assembleArtifact, createEmptyArtifact, ESSENTIAL_PROFILE_FIELDS, EXTENDED_PROFILE_FIELDS, FULL_PROFILE_FIELDS, getProfileFields, getProfileDomains, filterByProfile, } from "./assembler.js";
|
|
27
|
+
export { extractFromContent, extractFromContentWithClient, extractFromConversation, assembleArtifact, createEmptyArtifact, ESSENTIAL_PROFILE_FIELDS, EXTENDED_PROFILE_FIELDS, FULL_PROFILE_FIELDS, getProfileFields, getProfileDomains, filterByProfile, } from "./assembler.js";
|
|
28
|
+
export type { ConversationExtractionOptions, ConversationChunkArtifact, } from "./assembler.js";
|
|
29
|
+
export { flattenConversation, frameTranscript, chunkConversation, DEFAULT_CHUNK_MAX_CHARS, } from "./conversation.js";
|
|
30
|
+
export type { ConversationMessage, ConversationChunk, ChunkConversationOptions, } from "./conversation.js";
|
|
31
|
+
export { applyStanceGuard, takeStance, isNonSubjectStance, resolveStance, classifyStanceOpenAI, classifyStanceAnthropic, } from "./extractors/stance-guard.js";
|
|
32
|
+
export type { StanceGuardResult, StanceClassifierInput } from "./extractors/stance-guard.js";
|
|
33
|
+
export { sanitizeLlmOutput, formatSanitationNotes, } from "./extractors/output-sanitizer.js";
|
|
34
|
+
export type { SanitationNote } from "./extractors/output-sanitizer.js";
|
|
28
35
|
export { createStatelessArtifact, isStateless, validateStateless, } from "./stateless.js";
|
|
29
36
|
export { validateEDM, validateEDMStrict, validateEDMWithProfile, validateProfileConformance, validateDomain, validateCompleteness, } from "./validator.js";
|
|
30
|
-
export { extractWithLlm, createAnthropicClient, EXTRACTION_SYSTEM_PROMPT, calculateConfidence, } from "./extractors/llm-extractor.js";
|
|
31
|
-
export type { LlmExtractionResult, LlmEssentialExtracted, LlmExtendedExtracted, } from "./extractors/llm-extractor.js";
|
|
37
|
+
export { extractWithLlm, createAnthropicClient, EXTRACTION_SYSTEM_PROMPT, calculateConfidence, defaultMaxTokens, DEFAULT_MAX_TOKENS, THINKING_MODEL_MAX_TOKENS, } from "./extractors/llm-extractor.js";
|
|
38
|
+
export type { LlmExtractionResult, LlmEssentialExtracted, LlmExtendedExtracted, ExtractorCallOptions, } from "./extractors/llm-extractor.js";
|
|
32
39
|
export { extractWithOpenAI, createOpenAIClient } from "./extractors/openai-extractor.js";
|
|
33
40
|
export { extractWithKimi, createKimiClient, getKimiModelId } from "./extractors/kimi-extractor.js";
|
|
34
41
|
export { analyzeImage, mergeImageContext } from "./extractors/image-analyzer.js";
|
|
35
42
|
export { createMeta, createGovernance, createTelemetry, createSystem, createCrosswalks, detectSourceType, } from "./extractors/domain-extractors.js";
|
|
36
43
|
export { MetaSchema, CoreSchema, ConstellationSchema, MilkyWaySchema, GravitySchema, ImpulseSchema, GovernanceSchema, TelemetrySchema, SystemSchema, CrosswalksSchema, EdmArtifactSchema, LlmExtractedFieldsSchema, LlmEssentialFieldsSchema, LlmExtendedFieldsSchema, ConstellationEssentialSchema, GravityExtendedSchema, RetentionPolicySchema, SubjectRightsSchema, KAnonymitySchema, EmbeddingRefSchema, IndicesSchema, } from "./schema/edm-schema.js";
|
|
37
44
|
export type { Meta, Core, Constellation, MilkyWay, Gravity, Impulse, Governance, Telemetry, System, Crosswalks, RetentionPolicy, SubjectRights, KAnonymity, EmbeddingRef, Indices, EdmArtifact, LlmExtractedFields, EdmProfile, PartnerProfileId, ExtractionInput, ExtractionMetadata, ExtractionOptions, ValidationResult, ValidationError, } from "./schema/types.js";
|
|
38
|
-
export { EMOTION_PRIMARY, NARRATIVE_ARC, RELATIONAL_DYNAMICS, TEMPORAL_CONTEXT, MEMORY_TYPE, NARRATIVE_ARCHETYPE, DRIVE_STATE, MOTIVATIONAL_ORIENTATION, } from "./schema/types.js";
|
|
45
|
+
export { EMOTION_PRIMARY, NARRATIVE_ARC, RELATIONAL_DYNAMICS, TEMPORAL_CONTEXT, MEMORY_TYPE, NARRATIVE_ARCHETYPE, DRIVE_STATE, MOTIVATIONAL_ORIENTATION, EXPERIENTIAL_STANCE, } from "./schema/types.js";
|
|
46
|
+
export type { ExperientialStance } from "./schema/types.js";
|
|
39
47
|
export type { StatelessValidation } from "./stateless.js";
|
|
40
48
|
export type { CompletenessResult, DomainName, ProfileConformanceResult, ProfileConformanceError, } from "./validator.js";
|
|
41
49
|
export type { ActivateResult, FeedbackOptions, ActivateReasonResult, ActivateReasonOptions, ActivateReasonSource, } from "./schema/types.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAKH,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC5B,gBAAgB,EAChB,mBAAmB,EAEnB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EACL,uBAAuB,EACvB,WAAW,EACX,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,sBAAsB,EACtB,0BAA0B,EAC1B,cAAc,EACd,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAKH,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC5B,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EAEnB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACV,6BAA6B,EAC7B,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AAEtC,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAE7F,OAAO,EACL,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,kCAAkC,CAA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
package/dist/index.js
CHANGED
|
@@ -27,10 +27,19 @@
|
|
|
27
27
|
// =============================================================================
|
|
28
28
|
// Core Extraction API
|
|
29
29
|
// =============================================================================
|
|
30
|
-
export { extractFromContent, extractFromContentWithClient, assembleArtifact, createEmptyArtifact,
|
|
30
|
+
export { extractFromContent, extractFromContentWithClient, extractFromConversation, assembleArtifact, createEmptyArtifact,
|
|
31
31
|
// Profile field definitions
|
|
32
32
|
ESSENTIAL_PROFILE_FIELDS, EXTENDED_PROFILE_FIELDS, FULL_PROFILE_FIELDS, getProfileFields, getProfileDomains, filterByProfile, } from "./assembler.js";
|
|
33
33
|
// =============================================================================
|
|
34
|
+
// Conversation Input (transcript framing + per_session chunking)
|
|
35
|
+
// =============================================================================
|
|
36
|
+
export { flattenConversation, frameTranscript, chunkConversation, DEFAULT_CHUNK_MAX_CHARS, } from "./conversation.js";
|
|
37
|
+
// =============================================================================
|
|
38
|
+
// Attribution Guard (experiential stance)
|
|
39
|
+
// =============================================================================
|
|
40
|
+
export { applyStanceGuard, takeStance, isNonSubjectStance, resolveStance, classifyStanceOpenAI, classifyStanceAnthropic, } from "./extractors/stance-guard.js";
|
|
41
|
+
export { sanitizeLlmOutput, formatSanitationNotes, } from "./extractors/output-sanitizer.js";
|
|
42
|
+
// =============================================================================
|
|
34
43
|
// Stateless Mode
|
|
35
44
|
// =============================================================================
|
|
36
45
|
export { createStatelessArtifact, isStateless, validateStateless, } from "./stateless.js";
|
|
@@ -41,7 +50,7 @@ export { validateEDM, validateEDMStrict, validateEDMWithProfile, validateProfile
|
|
|
41
50
|
// =============================================================================
|
|
42
51
|
// LLM Integration
|
|
43
52
|
// =============================================================================
|
|
44
|
-
export { extractWithLlm, createAnthropicClient, EXTRACTION_SYSTEM_PROMPT, calculateConfidence, } from "./extractors/llm-extractor.js";
|
|
53
|
+
export { extractWithLlm, createAnthropicClient, EXTRACTION_SYSTEM_PROMPT, calculateConfidence, defaultMaxTokens, DEFAULT_MAX_TOKENS, THINKING_MODEL_MAX_TOKENS, } from "./extractors/llm-extractor.js";
|
|
45
54
|
export { extractWithOpenAI, createOpenAIClient } from "./extractors/openai-extractor.js";
|
|
46
55
|
export { extractWithKimi, createKimiClient, getKimiModelId } from "./extractors/kimi-extractor.js";
|
|
47
56
|
export { analyzeImage, mergeImageContext } from "./extractors/image-analyzer.js";
|
|
@@ -62,7 +71,7 @@ LlmEssentialFieldsSchema, LlmExtendedFieldsSchema, ConstellationEssentialSchema,
|
|
|
62
71
|
// Nested Schemas
|
|
63
72
|
RetentionPolicySchema, SubjectRightsSchema, KAnonymitySchema, EmbeddingRefSchema, IndicesSchema, } from "./schema/edm-schema.js";
|
|
64
73
|
// Enum constants
|
|
65
|
-
export { EMOTION_PRIMARY, NARRATIVE_ARC, RELATIONAL_DYNAMICS, TEMPORAL_CONTEXT, MEMORY_TYPE, NARRATIVE_ARCHETYPE, DRIVE_STATE, MOTIVATIONAL_ORIENTATION, } from "./schema/types.js";
|
|
74
|
+
export { EMOTION_PRIMARY, NARRATIVE_ARC, RELATIONAL_DYNAMICS, TEMPORAL_CONTEXT, MEMORY_TYPE, NARRATIVE_ARCHETYPE, DRIVE_STATE, MOTIVATIONAL_ORIENTATION, EXPERIENTIAL_STANCE, } from "./schema/types.js";
|
|
66
75
|
export async function activate(query, options = {}) {
|
|
67
76
|
const apiKey = options.apiKey ?? process.env.DEEPADATA_API_KEY;
|
|
68
77
|
if (!apiKey) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,gFAAgF;AAChF,sBAAsB;AACtB,gFAAgF;AAChF,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC5B,gBAAgB,EAChB,mBAAmB;AACnB,4BAA4B;AAC5B,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,GAChB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,gFAAgF;AAChF,sBAAsB;AACtB,gFAAgF;AAChF,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC5B,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB;AACnB,4BAA4B;AAC5B,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAOxB,gFAAgF;AAChF,iEAAiE;AACjE,gFAAgF;AAChF,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAQ3B,gFAAgF;AAChF,0CAA0C;AAC1C,gFAAgF;AAChF,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AAItC,OAAO,EACL,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,kCAAkC,CAAC;AAI1C,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,sBAAsB,EACtB,0BAA0B,EAC1B,cAAc,EACd,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAExB,gFAAgF;AAChF,kBAAkB;AAClB,gFAAgF;AAChF,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,+BAA+B,CAA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