chart2txt 0.7.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,239 @@
1
+ /**
2
+ * humandesign2txt
3
+ * Converts Human Design chart data to human-readable text for LLM consumption.
4
+ */
5
+ export interface PlanetPosition {
6
+ name: string;
7
+ longitude: number;
8
+ speed: number;
9
+ }
10
+ export interface CalculationResult {
11
+ planets: PlanetPosition[];
12
+ ascendant: number;
13
+ midheaven: number;
14
+ houseCusps: number[];
15
+ date: string;
16
+ time: string;
17
+ location: {
18
+ latitude: number;
19
+ longitude: number;
20
+ };
21
+ timezone?: string;
22
+ }
23
+ export interface HumanDesignApiResponse {
24
+ personality: CalculationResult;
25
+ design: CalculationResult;
26
+ metadata: {
27
+ designUtcDateTime: string;
28
+ solarArcDegrees: number;
29
+ personalitySunLongitude: number;
30
+ designSunLongitude: number;
31
+ };
32
+ }
33
+ export interface Activation {
34
+ planet: string;
35
+ gate: number;
36
+ line: number;
37
+ }
38
+ export interface Channel {
39
+ gates: [number, number];
40
+ name: string;
41
+ centers: [string, string];
42
+ }
43
+ export interface HumanDesignChart {
44
+ name: string;
45
+ location: string;
46
+ date: string;
47
+ time: string;
48
+ type: string;
49
+ strategy: string;
50
+ authority: string;
51
+ definition: string;
52
+ definitionIslands: string[][];
53
+ profile: string;
54
+ profileName: string;
55
+ incarnationCross: string;
56
+ definedCenters: string[];
57
+ undefinedCenters: string[];
58
+ openCenters: string[];
59
+ activeChannels: Channel[];
60
+ hangingGates: Array<{
61
+ gate: number;
62
+ center: string;
63
+ }>;
64
+ allGates: Map<number, {
65
+ center: string;
66
+ sources: string[];
67
+ }>;
68
+ personalityActivations: Activation[];
69
+ designActivations: Activation[];
70
+ }
71
+ /**
72
+ * The 64 gates in I Ching wheel order (starting from 0° Aries after 58° adjustment)
73
+ */
74
+ export declare const GATES: number[];
75
+ /**
76
+ * Gate names (I Ching / Human Design names)
77
+ */
78
+ export declare const GATE_NAMES: Record<number, string>;
79
+ /**
80
+ * Which center each gate belongs to
81
+ */
82
+ export declare const GATE_CENTERS: Record<number, string>;
83
+ /**
84
+ * All 36 channels with their gate pairs, names, and connected centers
85
+ */
86
+ export declare const CHANNELS: Channel[];
87
+ /**
88
+ * Profile names by line combination
89
+ */
90
+ export declare const PROFILE_NAMES: Record<string, string>;
91
+ /**
92
+ * Incarnation Cross names by Sun gate (simplified - Right Angle crosses)
93
+ * Format: { gateNumber: "Cross Name" }
94
+ */
95
+ export declare const INCARNATION_CROSSES: Record<number, string>;
96
+ /**
97
+ * Strategy by Type
98
+ */
99
+ export declare const STRATEGY_BY_TYPE: Record<string, string>;
100
+ /**
101
+ * All 9 centers
102
+ */
103
+ export declare const ALL_CENTERS: string[];
104
+ /**
105
+ * Convert a planetary longitude to gate and line
106
+ */
107
+ export declare function longitudeToGateLine(longitude: number): {
108
+ gate: number;
109
+ line: number;
110
+ };
111
+ /**
112
+ * Get the opposite gate (180° across the wheel)
113
+ */
114
+ export declare function oppositeGate(gate: number): number;
115
+ /**
116
+ * Calculate all activations from planetary positions
117
+ */
118
+ export declare function calculateActivations(planets: PlanetPosition[]): Activation[];
119
+ /**
120
+ * Get all unique gates from activations, tracking their sources
121
+ */
122
+ export declare function getAllGates(personalityActivations: Activation[], designActivations: Activation[]): Map<number, {
123
+ center: string;
124
+ sources: string[];
125
+ }>;
126
+ /**
127
+ * Determine which channels are active (both gates present)
128
+ */
129
+ export declare function getActiveChannels(allGates: Map<number, {
130
+ center: string;
131
+ sources: string[];
132
+ }>): Channel[];
133
+ /**
134
+ * Determine center status: Defined, Undefined, or Open
135
+ */
136
+ export declare function getCenterStatus(activeChannels: Channel[], allGates: Map<number, {
137
+ center: string;
138
+ sources: string[];
139
+ }>): {
140
+ defined: string[];
141
+ undefined: string[];
142
+ open: string[];
143
+ };
144
+ /**
145
+ * Calculate Human Design Type
146
+ */
147
+ export declare function calculateType(definedCenters: string[], activeChannels: Channel[]): string;
148
+ /**
149
+ * Calculate Inner Authority
150
+ */
151
+ export declare function calculateAuthority(definedCenters: string[], activeChannels: Channel[]): string;
152
+ /**
153
+ * Calculate Definition type (how centers are connected)
154
+ */
155
+ export declare function calculateDefinition(activeChannels: Channel[], definedCenters: string[]): string;
156
+ /**
157
+ * Get definition islands - groups of connected defined centers
158
+ */
159
+ export declare function getDefinitionIslands(activeChannels: Channel[], definedCenters: string[]): string[][];
160
+ /**
161
+ * Get hanging gates - gates that are not part of a complete channel
162
+ */
163
+ export declare function getHangingGates(allGates: Map<number, {
164
+ center: string;
165
+ sources: string[];
166
+ }>, activeChannels: Channel[]): Array<{
167
+ gate: number;
168
+ center: string;
169
+ }>;
170
+ /**
171
+ * Calculate Profile from personality and design sun lines
172
+ */
173
+ export declare function calculateProfile(personalitySunLine: number, designSunLine: number): string;
174
+ /**
175
+ * Get Incarnation Cross
176
+ */
177
+ export declare function getIncarnationCross(personalitySunGate: number, personalityEarthGate: number, designSunGate: number, designEarthGate: number, personalitySunLine: number, designSunLine: number): string;
178
+ export interface HumanDesign2TxtOptions {
179
+ name?: string;
180
+ location?: string;
181
+ }
182
+ /**
183
+ * Main entry point: Convert Human Design API response to formatted text
184
+ */
185
+ export declare function humandesign2txt(apiResponse: HumanDesignApiResponse, options?: HumanDesign2TxtOptions): string;
186
+ export interface ChannelConnection {
187
+ channel: Channel;
188
+ type: 'electromagnetic' | 'companionship' | 'dominance' | 'compromise';
189
+ person1Gates: number[];
190
+ person2Gates: number[];
191
+ description: string;
192
+ }
193
+ export interface GateConnection {
194
+ gate: number;
195
+ gateName: string;
196
+ center: string;
197
+ type: 'shared' | 'unique_person1' | 'unique_person2';
198
+ }
199
+ export interface HumanDesignPartnership {
200
+ person1: HumanDesignChart;
201
+ person2: HumanDesignChart;
202
+ electromagneticChannels: ChannelConnection[];
203
+ companionshipChannels: ChannelConnection[];
204
+ dominanceChannels: ChannelConnection[];
205
+ compromiseChannels: ChannelConnection[];
206
+ compositeDefinedCenters: string[];
207
+ compositeUndefinedCenters: string[];
208
+ compositeOpenCenters: string[];
209
+ compositeChannels: Channel[];
210
+ compositeType: string;
211
+ compositeStrategy: string;
212
+ compositeDefinition: string;
213
+ compositeDefinitionIslands: string[][];
214
+ channelsPerson1Only: Channel[];
215
+ channelsPerson2Only: Channel[];
216
+ channelsOnlyTogether: Channel[];
217
+ sharedGates: GateConnection[];
218
+ uniqueGatesPerson1: GateConnection[];
219
+ uniqueGatesPerson2: GateConnection[];
220
+ }
221
+ /**
222
+ * Analyze the relationship between two Human Design charts
223
+ */
224
+ export declare function analyzePartnership(chart1: HumanDesignChart, chart2: HumanDesignChart): HumanDesignPartnership;
225
+ /**
226
+ * Build a HumanDesignChart object from API response
227
+ */
228
+ export declare function buildChart(apiResponse: HumanDesignApiResponse, options?: HumanDesign2TxtOptions): HumanDesignChart;
229
+ export interface HumanDesignPartnership2TxtOptions {
230
+ person1Name?: string;
231
+ person1Location?: string;
232
+ person2Name?: string;
233
+ person2Location?: string;
234
+ }
235
+ /**
236
+ * Main entry point for partnership analysis: Convert two Human Design API responses to formatted text
237
+ */
238
+ export declare function humandesignPartnership2txt(apiResponse1: HumanDesignApiResponse, apiResponse2: HumanDesignApiResponse, options?: HumanDesignPartnership2TxtOptions): string;
239
+ export default humandesign2txt;