@mrck-labs/vanaheim-shared 0.1.1

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 ADDED
@@ -0,0 +1,56 @@
1
+ # @mrck-labs/vanaheim-shared
2
+
3
+ Shared types, constants, and utilities for Vanaheim apps.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @mrck-labs/vanaheim-shared
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### Main Export
14
+
15
+ ```typescript
16
+ import /* your exports */ "@mrck-labs/vanaheim-shared";
17
+ ```
18
+
19
+ ### Subpath Exports
20
+
21
+ ```typescript
22
+ // Types only
23
+ import /* types */ "@mrck-labs/vanaheim-shared/types";
24
+
25
+ // Utils only
26
+ import /* utils */ "@mrck-labs/vanaheim-shared/utils";
27
+ ```
28
+
29
+ ## Development
30
+
31
+ ```bash
32
+ # Install dependencies
33
+ npm install
34
+
35
+ # Build
36
+ npm run build
37
+
38
+ # Watch mode
39
+ npm run dev
40
+
41
+ # Type check
42
+ npm run typecheck
43
+
44
+ # Clean build artifacts
45
+ npm run clean
46
+ ```
47
+
48
+ ## Release
49
+
50
+ This package uses [changesets](https://github.com/changesets/changesets) for version management and releases.
51
+
52
+ See [RELEASE_GUIDE.md](./RELEASE_GUIDE.md) for detailed release instructions.
53
+
54
+ ## License
55
+
56
+ MIT
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Shared Constants
3
+ *
4
+ * Common constants used across Vanaheim apps.
5
+ */
6
+ declare const CURRENCIES: readonly ["CHF", "USD", "EUR", "PLN"];
7
+ type Currency = (typeof CURRENCIES)[number];
8
+ declare const CURRENCY_SYMBOLS: Record<Currency, string>;
9
+ declare const CURRENCY_NAMES: Record<Currency, string>;
10
+ declare const FREQUENCIES: readonly ["monthly", "yearly", "6-monthly", "weekly", "one-time"];
11
+ type Frequency = (typeof FREQUENCIES)[number];
12
+ declare const FREQUENCY_LABELS: Record<Frequency, string>;
13
+ declare const FREQUENCY_MULTIPLIERS: Record<Frequency, number>;
14
+ declare const DEFAULT_FOCUS_DURATIONS: readonly [15, 25, 30, 45, 60, 90];
15
+ type FocusDuration = (typeof DEFAULT_FOCUS_DURATIONS)[number];
16
+ declare const FOCUS_STATUS: readonly ["active", "completed", "abandoned"];
17
+ type FocusStatus = (typeof FOCUS_STATUS)[number];
18
+ declare const LINEAR_PRIORITIES: readonly [0, 1, 2, 3, 4];
19
+ type LinearPriorityValue = (typeof LINEAR_PRIORITIES)[number];
20
+ declare const LINEAR_PRIORITY_COLORS: Record<LinearPriorityValue, string>;
21
+ declare const CLOUD_AGENT_STATUSES: readonly ["CREATING", "RUNNING", "FINISHED", "FAILED", "CANCELLED"];
22
+ declare const CLOUD_AGENT_STATUS_EMOJI: Record<string, string>;
23
+ declare const CLOUD_AGENT_STATUS_COLORS: Record<string, string>;
24
+ declare const API_URLS: {
25
+ readonly CURSOR_CLOUD: "https://api.cursor.com";
26
+ readonly LINEAR_GRAPHQL: "https://api.linear.app/graphql";
27
+ };
28
+ declare const SETTING_KEYS: {
29
+ readonly AI_MODEL: "ai_model";
30
+ readonly AI_REASONING_ENABLED: "ai_reasoning_enabled";
31
+ readonly OPENAI_API_KEY: "openai_api_key";
32
+ readonly ANTHROPIC_API_KEY: "anthropic_api_key";
33
+ readonly CURSOR_API_KEY: "cursor_api_key";
34
+ readonly LINEAR_API_KEY: "linear_api_key";
35
+ readonly GOOGLE_CLIENT_ID: "google_client_id";
36
+ readonly GOOGLE_CLIENT_SECRET: "google_client_secret";
37
+ readonly GOOGLE_CALENDAR_TOKENS: "google_calendar_tokens";
38
+ readonly SELECTED_CALENDAR_IDS: "selected_calendar_ids";
39
+ };
40
+ type SettingKey = (typeof SETTING_KEYS)[keyof typeof SETTING_KEYS];
41
+
42
+ export { API_URLS, CLOUD_AGENT_STATUSES, CLOUD_AGENT_STATUS_COLORS, CLOUD_AGENT_STATUS_EMOJI, CURRENCIES, CURRENCY_NAMES, CURRENCY_SYMBOLS, type Currency, DEFAULT_FOCUS_DURATIONS, FOCUS_STATUS, FREQUENCIES, FREQUENCY_LABELS, FREQUENCY_MULTIPLIERS, type FocusDuration, type FocusStatus, type Frequency, LINEAR_PRIORITIES, LINEAR_PRIORITY_COLORS, type LinearPriorityValue, SETTING_KEYS, type SettingKey };
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Shared Constants
3
+ *
4
+ * Common constants used across Vanaheim apps.
5
+ */
6
+ declare const CURRENCIES: readonly ["CHF", "USD", "EUR", "PLN"];
7
+ type Currency = (typeof CURRENCIES)[number];
8
+ declare const CURRENCY_SYMBOLS: Record<Currency, string>;
9
+ declare const CURRENCY_NAMES: Record<Currency, string>;
10
+ declare const FREQUENCIES: readonly ["monthly", "yearly", "6-monthly", "weekly", "one-time"];
11
+ type Frequency = (typeof FREQUENCIES)[number];
12
+ declare const FREQUENCY_LABELS: Record<Frequency, string>;
13
+ declare const FREQUENCY_MULTIPLIERS: Record<Frequency, number>;
14
+ declare const DEFAULT_FOCUS_DURATIONS: readonly [15, 25, 30, 45, 60, 90];
15
+ type FocusDuration = (typeof DEFAULT_FOCUS_DURATIONS)[number];
16
+ declare const FOCUS_STATUS: readonly ["active", "completed", "abandoned"];
17
+ type FocusStatus = (typeof FOCUS_STATUS)[number];
18
+ declare const LINEAR_PRIORITIES: readonly [0, 1, 2, 3, 4];
19
+ type LinearPriorityValue = (typeof LINEAR_PRIORITIES)[number];
20
+ declare const LINEAR_PRIORITY_COLORS: Record<LinearPriorityValue, string>;
21
+ declare const CLOUD_AGENT_STATUSES: readonly ["CREATING", "RUNNING", "FINISHED", "FAILED", "CANCELLED"];
22
+ declare const CLOUD_AGENT_STATUS_EMOJI: Record<string, string>;
23
+ declare const CLOUD_AGENT_STATUS_COLORS: Record<string, string>;
24
+ declare const API_URLS: {
25
+ readonly CURSOR_CLOUD: "https://api.cursor.com";
26
+ readonly LINEAR_GRAPHQL: "https://api.linear.app/graphql";
27
+ };
28
+ declare const SETTING_KEYS: {
29
+ readonly AI_MODEL: "ai_model";
30
+ readonly AI_REASONING_ENABLED: "ai_reasoning_enabled";
31
+ readonly OPENAI_API_KEY: "openai_api_key";
32
+ readonly ANTHROPIC_API_KEY: "anthropic_api_key";
33
+ readonly CURSOR_API_KEY: "cursor_api_key";
34
+ readonly LINEAR_API_KEY: "linear_api_key";
35
+ readonly GOOGLE_CLIENT_ID: "google_client_id";
36
+ readonly GOOGLE_CLIENT_SECRET: "google_client_secret";
37
+ readonly GOOGLE_CALENDAR_TOKENS: "google_calendar_tokens";
38
+ readonly SELECTED_CALENDAR_IDS: "selected_calendar_ids";
39
+ };
40
+ type SettingKey = (typeof SETTING_KEYS)[keyof typeof SETTING_KEYS];
41
+
42
+ export { API_URLS, CLOUD_AGENT_STATUSES, CLOUD_AGENT_STATUS_COLORS, CLOUD_AGENT_STATUS_EMOJI, CURRENCIES, CURRENCY_NAMES, CURRENCY_SYMBOLS, type Currency, DEFAULT_FOCUS_DURATIONS, FOCUS_STATUS, FREQUENCIES, FREQUENCY_LABELS, FREQUENCY_MULTIPLIERS, type FocusDuration, type FocusStatus, type Frequency, LINEAR_PRIORITIES, LINEAR_PRIORITY_COLORS, type LinearPriorityValue, SETTING_KEYS, type SettingKey };
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/constants/index.ts
21
+ var constants_exports = {};
22
+ __export(constants_exports, {
23
+ API_URLS: () => API_URLS,
24
+ CLOUD_AGENT_STATUSES: () => CLOUD_AGENT_STATUSES,
25
+ CLOUD_AGENT_STATUS_COLORS: () => CLOUD_AGENT_STATUS_COLORS,
26
+ CLOUD_AGENT_STATUS_EMOJI: () => CLOUD_AGENT_STATUS_EMOJI,
27
+ CURRENCIES: () => CURRENCIES,
28
+ CURRENCY_NAMES: () => CURRENCY_NAMES,
29
+ CURRENCY_SYMBOLS: () => CURRENCY_SYMBOLS,
30
+ DEFAULT_FOCUS_DURATIONS: () => DEFAULT_FOCUS_DURATIONS,
31
+ FOCUS_STATUS: () => FOCUS_STATUS,
32
+ FREQUENCIES: () => FREQUENCIES,
33
+ FREQUENCY_LABELS: () => FREQUENCY_LABELS,
34
+ FREQUENCY_MULTIPLIERS: () => FREQUENCY_MULTIPLIERS,
35
+ LINEAR_PRIORITIES: () => LINEAR_PRIORITIES,
36
+ LINEAR_PRIORITY_COLORS: () => LINEAR_PRIORITY_COLORS,
37
+ SETTING_KEYS: () => SETTING_KEYS
38
+ });
39
+ module.exports = __toCommonJS(constants_exports);
40
+ var CURRENCIES = ["CHF", "USD", "EUR", "PLN"];
41
+ var CURRENCY_SYMBOLS = {
42
+ CHF: "CHF",
43
+ USD: "$",
44
+ EUR: "\u20AC",
45
+ PLN: "z\u0142"
46
+ };
47
+ var CURRENCY_NAMES = {
48
+ CHF: "Swiss Franc",
49
+ USD: "US Dollar",
50
+ EUR: "Euro",
51
+ PLN: "Polish Z\u0142oty"
52
+ };
53
+ var FREQUENCIES = [
54
+ "monthly",
55
+ "yearly",
56
+ "6-monthly",
57
+ "weekly",
58
+ "one-time"
59
+ ];
60
+ var FREQUENCY_LABELS = {
61
+ monthly: "Monthly",
62
+ yearly: "Yearly",
63
+ "6-monthly": "Every 6 Months",
64
+ weekly: "Weekly",
65
+ "one-time": "One Time"
66
+ };
67
+ var FREQUENCY_MULTIPLIERS = {
68
+ monthly: 12,
69
+ yearly: 1,
70
+ "6-monthly": 2,
71
+ weekly: 52,
72
+ "one-time": 1
73
+ };
74
+ var DEFAULT_FOCUS_DURATIONS = [15, 25, 30, 45, 60, 90];
75
+ var FOCUS_STATUS = ["active", "completed", "abandoned"];
76
+ var LINEAR_PRIORITIES = [0, 1, 2, 3, 4];
77
+ var LINEAR_PRIORITY_COLORS = {
78
+ 0: "#6b7280",
79
+ // No priority - gray
80
+ 1: "#ef4444",
81
+ // Urgent - red
82
+ 2: "#f97316",
83
+ // High - orange
84
+ 3: "#eab308",
85
+ // Medium - yellow
86
+ 4: "#3b82f6"
87
+ // Low - blue
88
+ };
89
+ var CLOUD_AGENT_STATUSES = [
90
+ "CREATING",
91
+ "RUNNING",
92
+ "FINISHED",
93
+ "FAILED",
94
+ "CANCELLED"
95
+ ];
96
+ var CLOUD_AGENT_STATUS_EMOJI = {
97
+ CREATING: "\u{1F528}",
98
+ RUNNING: "\u23F3",
99
+ FINISHED: "\u2705",
100
+ FAILED: "\u274C",
101
+ CANCELLED: "\u{1F6AB}"
102
+ };
103
+ var CLOUD_AGENT_STATUS_COLORS = {
104
+ CREATING: "#3b82f6",
105
+ RUNNING: "#3b82f6",
106
+ FINISHED: "#10b981",
107
+ FAILED: "#ef4444",
108
+ CANCELLED: "#6b7280"
109
+ };
110
+ var API_URLS = {
111
+ CURSOR_CLOUD: "https://api.cursor.com",
112
+ LINEAR_GRAPHQL: "https://api.linear.app/graphql"
113
+ };
114
+ var SETTING_KEYS = {
115
+ // AI
116
+ AI_MODEL: "ai_model",
117
+ AI_REASONING_ENABLED: "ai_reasoning_enabled",
118
+ // API Keys
119
+ OPENAI_API_KEY: "openai_api_key",
120
+ ANTHROPIC_API_KEY: "anthropic_api_key",
121
+ CURSOR_API_KEY: "cursor_api_key",
122
+ LINEAR_API_KEY: "linear_api_key",
123
+ // Google
124
+ GOOGLE_CLIENT_ID: "google_client_id",
125
+ GOOGLE_CLIENT_SECRET: "google_client_secret",
126
+ GOOGLE_CALENDAR_TOKENS: "google_calendar_tokens",
127
+ SELECTED_CALENDAR_IDS: "selected_calendar_ids"
128
+ };
129
+ // Annotate the CommonJS export names for ESM import in node:
130
+ 0 && (module.exports = {
131
+ API_URLS,
132
+ CLOUD_AGENT_STATUSES,
133
+ CLOUD_AGENT_STATUS_COLORS,
134
+ CLOUD_AGENT_STATUS_EMOJI,
135
+ CURRENCIES,
136
+ CURRENCY_NAMES,
137
+ CURRENCY_SYMBOLS,
138
+ DEFAULT_FOCUS_DURATIONS,
139
+ FOCUS_STATUS,
140
+ FREQUENCIES,
141
+ FREQUENCY_LABELS,
142
+ FREQUENCY_MULTIPLIERS,
143
+ LINEAR_PRIORITIES,
144
+ LINEAR_PRIORITY_COLORS,
145
+ SETTING_KEYS
146
+ });
147
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/constants/index.ts"],"sourcesContent":["/**\n * Shared Constants\n *\n * Common constants used across Vanaheim apps.\n */\n\n// ============================================================================\n// Currency\n// ============================================================================\n\nexport const CURRENCIES = ['CHF', 'USD', 'EUR', 'PLN'] as const\nexport type Currency = (typeof CURRENCIES)[number]\n\nexport const CURRENCY_SYMBOLS: Record<Currency, string> = {\n CHF: 'CHF',\n USD: '$',\n EUR: '€',\n PLN: 'zł',\n}\n\nexport const CURRENCY_NAMES: Record<Currency, string> = {\n CHF: 'Swiss Franc',\n USD: 'US Dollar',\n EUR: 'Euro',\n PLN: 'Polish Złoty',\n}\n\n// ============================================================================\n// Frequency\n// ============================================================================\n\nexport const FREQUENCIES = [\n 'monthly',\n 'yearly',\n '6-monthly',\n 'weekly',\n 'one-time',\n] as const\nexport type Frequency = (typeof FREQUENCIES)[number]\n\nexport const FREQUENCY_LABELS: Record<Frequency, string> = {\n monthly: 'Monthly',\n yearly: 'Yearly',\n '6-monthly': 'Every 6 Months',\n weekly: 'Weekly',\n 'one-time': 'One Time',\n}\n\nexport const FREQUENCY_MULTIPLIERS: Record<Frequency, number> = {\n monthly: 12,\n yearly: 1,\n '6-monthly': 2,\n weekly: 52,\n 'one-time': 1,\n}\n\n// ============================================================================\n// Focus\n// ============================================================================\n\nexport const DEFAULT_FOCUS_DURATIONS = [15, 25, 30, 45, 60, 90] as const\nexport type FocusDuration = (typeof DEFAULT_FOCUS_DURATIONS)[number]\n\nexport const FOCUS_STATUS = ['active', 'completed', 'abandoned'] as const\nexport type FocusStatus = (typeof FOCUS_STATUS)[number]\n\n// ============================================================================\n// Linear\n// ============================================================================\n\nexport const LINEAR_PRIORITIES = [0, 1, 2, 3, 4] as const\nexport type LinearPriorityValue = (typeof LINEAR_PRIORITIES)[number]\n\nexport const LINEAR_PRIORITY_COLORS: Record<LinearPriorityValue, string> = {\n 0: '#6b7280', // No priority - gray\n 1: '#ef4444', // Urgent - red\n 2: '#f97316', // High - orange\n 3: '#eab308', // Medium - yellow\n 4: '#3b82f6', // Low - blue\n}\n\n// ============================================================================\n// Cloud Agents\n// ============================================================================\n\nexport const CLOUD_AGENT_STATUSES = [\n 'CREATING',\n 'RUNNING',\n 'FINISHED',\n 'FAILED',\n 'CANCELLED',\n] as const\n\nexport const CLOUD_AGENT_STATUS_EMOJI: Record<string, string> = {\n CREATING: '🔨',\n RUNNING: '⏳',\n FINISHED: '✅',\n FAILED: '❌',\n CANCELLED: '🚫',\n}\n\nexport const CLOUD_AGENT_STATUS_COLORS: Record<string, string> = {\n CREATING: '#3b82f6',\n RUNNING: '#3b82f6',\n FINISHED: '#10b981',\n FAILED: '#ef4444',\n CANCELLED: '#6b7280',\n}\n\n// ============================================================================\n// API URLs\n// ============================================================================\n\nexport const API_URLS = {\n CURSOR_CLOUD: 'https://api.cursor.com',\n LINEAR_GRAPHQL: 'https://api.linear.app/graphql',\n} as const\n\n// ============================================================================\n// Settings Keys\n// ============================================================================\n\nexport const SETTING_KEYS = {\n // AI\n AI_MODEL: 'ai_model',\n AI_REASONING_ENABLED: 'ai_reasoning_enabled',\n\n // API Keys\n OPENAI_API_KEY: 'openai_api_key',\n ANTHROPIC_API_KEY: 'anthropic_api_key',\n CURSOR_API_KEY: 'cursor_api_key',\n LINEAR_API_KEY: 'linear_api_key',\n\n // Google\n GOOGLE_CLIENT_ID: 'google_client_id',\n GOOGLE_CLIENT_SECRET: 'google_client_secret',\n GOOGLE_CALENDAR_TOKENS: 'google_calendar_tokens',\n SELECTED_CALENDAR_IDS: 'selected_calendar_ids',\n} as const\n\nexport type SettingKey = (typeof SETTING_KEYS)[keyof typeof SETTING_KEYS]\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,IAAM,aAAa,CAAC,OAAO,OAAO,OAAO,KAAK;AAG9C,IAAM,mBAA6C;AAAA,EACxD,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAEO,IAAM,iBAA2C;AAAA,EACtD,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAMO,IAAM,cAAc;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,IAAM,mBAA8C;AAAA,EACzD,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,YAAY;AACd;AAEO,IAAM,wBAAmD;AAAA,EAC9D,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,YAAY;AACd;AAMO,IAAM,0BAA0B,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE;AAGvD,IAAM,eAAe,CAAC,UAAU,aAAa,WAAW;AAOxD,IAAM,oBAAoB,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;AAGxC,IAAM,yBAA8D;AAAA,EACzE,GAAG;AAAA;AAAA,EACH,GAAG;AAAA;AAAA,EACH,GAAG;AAAA;AAAA,EACH,GAAG;AAAA;AAAA,EACH,GAAG;AAAA;AACL;AAMO,IAAM,uBAAuB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,2BAAmD;AAAA,EAC9D,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,WAAW;AACb;AAEO,IAAM,4BAAoD;AAAA,EAC/D,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,WAAW;AACb;AAMO,IAAM,WAAW;AAAA,EACtB,cAAc;AAAA,EACd,gBAAgB;AAClB;AAMO,IAAM,eAAe;AAAA;AAAA,EAE1B,UAAU;AAAA,EACV,sBAAsB;AAAA;AAAA,EAGtB,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA;AAAA,EAGhB,kBAAkB;AAAA,EAClB,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EACxB,uBAAuB;AACzB;","names":[]}
@@ -0,0 +1,108 @@
1
+ // src/constants/index.ts
2
+ var CURRENCIES = ["CHF", "USD", "EUR", "PLN"];
3
+ var CURRENCY_SYMBOLS = {
4
+ CHF: "CHF",
5
+ USD: "$",
6
+ EUR: "\u20AC",
7
+ PLN: "z\u0142"
8
+ };
9
+ var CURRENCY_NAMES = {
10
+ CHF: "Swiss Franc",
11
+ USD: "US Dollar",
12
+ EUR: "Euro",
13
+ PLN: "Polish Z\u0142oty"
14
+ };
15
+ var FREQUENCIES = [
16
+ "monthly",
17
+ "yearly",
18
+ "6-monthly",
19
+ "weekly",
20
+ "one-time"
21
+ ];
22
+ var FREQUENCY_LABELS = {
23
+ monthly: "Monthly",
24
+ yearly: "Yearly",
25
+ "6-monthly": "Every 6 Months",
26
+ weekly: "Weekly",
27
+ "one-time": "One Time"
28
+ };
29
+ var FREQUENCY_MULTIPLIERS = {
30
+ monthly: 12,
31
+ yearly: 1,
32
+ "6-monthly": 2,
33
+ weekly: 52,
34
+ "one-time": 1
35
+ };
36
+ var DEFAULT_FOCUS_DURATIONS = [15, 25, 30, 45, 60, 90];
37
+ var FOCUS_STATUS = ["active", "completed", "abandoned"];
38
+ var LINEAR_PRIORITIES = [0, 1, 2, 3, 4];
39
+ var LINEAR_PRIORITY_COLORS = {
40
+ 0: "#6b7280",
41
+ // No priority - gray
42
+ 1: "#ef4444",
43
+ // Urgent - red
44
+ 2: "#f97316",
45
+ // High - orange
46
+ 3: "#eab308",
47
+ // Medium - yellow
48
+ 4: "#3b82f6"
49
+ // Low - blue
50
+ };
51
+ var CLOUD_AGENT_STATUSES = [
52
+ "CREATING",
53
+ "RUNNING",
54
+ "FINISHED",
55
+ "FAILED",
56
+ "CANCELLED"
57
+ ];
58
+ var CLOUD_AGENT_STATUS_EMOJI = {
59
+ CREATING: "\u{1F528}",
60
+ RUNNING: "\u23F3",
61
+ FINISHED: "\u2705",
62
+ FAILED: "\u274C",
63
+ CANCELLED: "\u{1F6AB}"
64
+ };
65
+ var CLOUD_AGENT_STATUS_COLORS = {
66
+ CREATING: "#3b82f6",
67
+ RUNNING: "#3b82f6",
68
+ FINISHED: "#10b981",
69
+ FAILED: "#ef4444",
70
+ CANCELLED: "#6b7280"
71
+ };
72
+ var API_URLS = {
73
+ CURSOR_CLOUD: "https://api.cursor.com",
74
+ LINEAR_GRAPHQL: "https://api.linear.app/graphql"
75
+ };
76
+ var SETTING_KEYS = {
77
+ // AI
78
+ AI_MODEL: "ai_model",
79
+ AI_REASONING_ENABLED: "ai_reasoning_enabled",
80
+ // API Keys
81
+ OPENAI_API_KEY: "openai_api_key",
82
+ ANTHROPIC_API_KEY: "anthropic_api_key",
83
+ CURSOR_API_KEY: "cursor_api_key",
84
+ LINEAR_API_KEY: "linear_api_key",
85
+ // Google
86
+ GOOGLE_CLIENT_ID: "google_client_id",
87
+ GOOGLE_CLIENT_SECRET: "google_client_secret",
88
+ GOOGLE_CALENDAR_TOKENS: "google_calendar_tokens",
89
+ SELECTED_CALENDAR_IDS: "selected_calendar_ids"
90
+ };
91
+ export {
92
+ API_URLS,
93
+ CLOUD_AGENT_STATUSES,
94
+ CLOUD_AGENT_STATUS_COLORS,
95
+ CLOUD_AGENT_STATUS_EMOJI,
96
+ CURRENCIES,
97
+ CURRENCY_NAMES,
98
+ CURRENCY_SYMBOLS,
99
+ DEFAULT_FOCUS_DURATIONS,
100
+ FOCUS_STATUS,
101
+ FREQUENCIES,
102
+ FREQUENCY_LABELS,
103
+ FREQUENCY_MULTIPLIERS,
104
+ LINEAR_PRIORITIES,
105
+ LINEAR_PRIORITY_COLORS,
106
+ SETTING_KEYS
107
+ };
108
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/constants/index.ts"],"sourcesContent":["/**\n * Shared Constants\n *\n * Common constants used across Vanaheim apps.\n */\n\n// ============================================================================\n// Currency\n// ============================================================================\n\nexport const CURRENCIES = ['CHF', 'USD', 'EUR', 'PLN'] as const\nexport type Currency = (typeof CURRENCIES)[number]\n\nexport const CURRENCY_SYMBOLS: Record<Currency, string> = {\n CHF: 'CHF',\n USD: '$',\n EUR: '€',\n PLN: 'zł',\n}\n\nexport const CURRENCY_NAMES: Record<Currency, string> = {\n CHF: 'Swiss Franc',\n USD: 'US Dollar',\n EUR: 'Euro',\n PLN: 'Polish Złoty',\n}\n\n// ============================================================================\n// Frequency\n// ============================================================================\n\nexport const FREQUENCIES = [\n 'monthly',\n 'yearly',\n '6-monthly',\n 'weekly',\n 'one-time',\n] as const\nexport type Frequency = (typeof FREQUENCIES)[number]\n\nexport const FREQUENCY_LABELS: Record<Frequency, string> = {\n monthly: 'Monthly',\n yearly: 'Yearly',\n '6-monthly': 'Every 6 Months',\n weekly: 'Weekly',\n 'one-time': 'One Time',\n}\n\nexport const FREQUENCY_MULTIPLIERS: Record<Frequency, number> = {\n monthly: 12,\n yearly: 1,\n '6-monthly': 2,\n weekly: 52,\n 'one-time': 1,\n}\n\n// ============================================================================\n// Focus\n// ============================================================================\n\nexport const DEFAULT_FOCUS_DURATIONS = [15, 25, 30, 45, 60, 90] as const\nexport type FocusDuration = (typeof DEFAULT_FOCUS_DURATIONS)[number]\n\nexport const FOCUS_STATUS = ['active', 'completed', 'abandoned'] as const\nexport type FocusStatus = (typeof FOCUS_STATUS)[number]\n\n// ============================================================================\n// Linear\n// ============================================================================\n\nexport const LINEAR_PRIORITIES = [0, 1, 2, 3, 4] as const\nexport type LinearPriorityValue = (typeof LINEAR_PRIORITIES)[number]\n\nexport const LINEAR_PRIORITY_COLORS: Record<LinearPriorityValue, string> = {\n 0: '#6b7280', // No priority - gray\n 1: '#ef4444', // Urgent - red\n 2: '#f97316', // High - orange\n 3: '#eab308', // Medium - yellow\n 4: '#3b82f6', // Low - blue\n}\n\n// ============================================================================\n// Cloud Agents\n// ============================================================================\n\nexport const CLOUD_AGENT_STATUSES = [\n 'CREATING',\n 'RUNNING',\n 'FINISHED',\n 'FAILED',\n 'CANCELLED',\n] as const\n\nexport const CLOUD_AGENT_STATUS_EMOJI: Record<string, string> = {\n CREATING: '🔨',\n RUNNING: '⏳',\n FINISHED: '✅',\n FAILED: '❌',\n CANCELLED: '🚫',\n}\n\nexport const CLOUD_AGENT_STATUS_COLORS: Record<string, string> = {\n CREATING: '#3b82f6',\n RUNNING: '#3b82f6',\n FINISHED: '#10b981',\n FAILED: '#ef4444',\n CANCELLED: '#6b7280',\n}\n\n// ============================================================================\n// API URLs\n// ============================================================================\n\nexport const API_URLS = {\n CURSOR_CLOUD: 'https://api.cursor.com',\n LINEAR_GRAPHQL: 'https://api.linear.app/graphql',\n} as const\n\n// ============================================================================\n// Settings Keys\n// ============================================================================\n\nexport const SETTING_KEYS = {\n // AI\n AI_MODEL: 'ai_model',\n AI_REASONING_ENABLED: 'ai_reasoning_enabled',\n\n // API Keys\n OPENAI_API_KEY: 'openai_api_key',\n ANTHROPIC_API_KEY: 'anthropic_api_key',\n CURSOR_API_KEY: 'cursor_api_key',\n LINEAR_API_KEY: 'linear_api_key',\n\n // Google\n GOOGLE_CLIENT_ID: 'google_client_id',\n GOOGLE_CLIENT_SECRET: 'google_client_secret',\n GOOGLE_CALENDAR_TOKENS: 'google_calendar_tokens',\n SELECTED_CALENDAR_IDS: 'selected_calendar_ids',\n} as const\n\nexport type SettingKey = (typeof SETTING_KEYS)[keyof typeof SETTING_KEYS]\n\n"],"mappings":";AAUO,IAAM,aAAa,CAAC,OAAO,OAAO,OAAO,KAAK;AAG9C,IAAM,mBAA6C;AAAA,EACxD,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAEO,IAAM,iBAA2C;AAAA,EACtD,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAMO,IAAM,cAAc;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,IAAM,mBAA8C;AAAA,EACzD,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,YAAY;AACd;AAEO,IAAM,wBAAmD;AAAA,EAC9D,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,YAAY;AACd;AAMO,IAAM,0BAA0B,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE;AAGvD,IAAM,eAAe,CAAC,UAAU,aAAa,WAAW;AAOxD,IAAM,oBAAoB,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;AAGxC,IAAM,yBAA8D;AAAA,EACzE,GAAG;AAAA;AAAA,EACH,GAAG;AAAA;AAAA,EACH,GAAG;AAAA;AAAA,EACH,GAAG;AAAA;AAAA,EACH,GAAG;AAAA;AACL;AAMO,IAAM,uBAAuB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,2BAAmD;AAAA,EAC9D,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,WAAW;AACb;AAEO,IAAM,4BAAoD;AAAA,EAC/D,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,WAAW;AACb;AAMO,IAAM,WAAW;AAAA,EACtB,cAAc;AAAA,EACd,gBAAgB;AAClB;AAMO,IAAM,eAAe;AAAA;AAAA,EAE1B,UAAU;AAAA,EACV,sBAAsB;AAAA;AAAA,EAGtB,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA;AAAA,EAGhB,kBAAkB;AAAA,EAClB,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EACxB,uBAAuB;AACzB;","names":[]}
@@ -0,0 +1,240 @@
1
+ /**
2
+ * Database Types for Vanaheim
3
+ *
4
+ * Shared type definitions matching the Supabase PostgreSQL schema.
5
+ * Used by both desktop and mobile apps.
6
+ */
7
+ interface ExpenseCategory {
8
+ id: string;
9
+ userId: string;
10
+ name: string;
11
+ icon: string;
12
+ color: string;
13
+ sortOrder: number;
14
+ isDefault: boolean;
15
+ createdAt: string;
16
+ updatedAt: string;
17
+ }
18
+ interface NewExpenseCategory {
19
+ name: string;
20
+ icon: string;
21
+ color: string;
22
+ sortOrder?: number;
23
+ isDefault?: boolean;
24
+ }
25
+ interface Expense {
26
+ id: string;
27
+ userId: string;
28
+ name: string;
29
+ amount: number;
30
+ currency: string;
31
+ frequency: string;
32
+ categoryId: string;
33
+ nextDueDate: string;
34
+ notes: string | null;
35
+ isShared: boolean;
36
+ sharePercentage: number;
37
+ isActive: boolean;
38
+ createdAt: string;
39
+ updatedAt: string;
40
+ category?: ExpenseCategory;
41
+ }
42
+ interface NewExpense {
43
+ name: string;
44
+ amount: number;
45
+ currency: string;
46
+ frequency: string;
47
+ categoryId: string;
48
+ nextDueDate: string;
49
+ notes?: string | null;
50
+ isShared?: boolean;
51
+ sharePercentage?: number;
52
+ isActive?: boolean;
53
+ }
54
+ interface IncomeCategory {
55
+ id: string;
56
+ userId: string;
57
+ name: string;
58
+ icon: string;
59
+ color: string;
60
+ sortOrder: number;
61
+ isDefault: boolean;
62
+ createdAt: string;
63
+ updatedAt: string;
64
+ }
65
+ interface NewIncomeCategory {
66
+ name: string;
67
+ icon: string;
68
+ color: string;
69
+ sortOrder?: number;
70
+ isDefault?: boolean;
71
+ }
72
+ interface Income {
73
+ id: string;
74
+ userId: string;
75
+ name: string;
76
+ amount: number;
77
+ currency: string;
78
+ frequency: string;
79
+ categoryId: string;
80
+ nextPayDate: string;
81
+ notes: string | null;
82
+ isActive: boolean;
83
+ createdAt: string;
84
+ updatedAt: string;
85
+ category?: IncomeCategory;
86
+ }
87
+ interface NewIncome {
88
+ name: string;
89
+ amount: number;
90
+ currency: string;
91
+ frequency: string;
92
+ categoryId: string;
93
+ nextPayDate: string;
94
+ notes?: string | null;
95
+ isActive?: boolean;
96
+ }
97
+ interface FocusCategory {
98
+ id: string;
99
+ userId: string;
100
+ name: string;
101
+ color: string;
102
+ sortOrder: number;
103
+ isDefault: boolean;
104
+ createdAt: string;
105
+ updatedAt: string;
106
+ }
107
+ interface NewFocusCategory {
108
+ name: string;
109
+ color: string;
110
+ sortOrder?: number;
111
+ isDefault?: boolean;
112
+ }
113
+ type FocusSessionStatus = 'active' | 'completed' | 'abandoned';
114
+ interface FocusSession {
115
+ id: string;
116
+ userId: string;
117
+ title: string;
118
+ categoryId: string | null;
119
+ targetMinutes: number;
120
+ actualSeconds: number;
121
+ status: FocusSessionStatus;
122
+ startedAt: string;
123
+ completedAt: string | null;
124
+ createdAt: string;
125
+ updatedAt: string;
126
+ category?: FocusCategory;
127
+ }
128
+ interface NewFocusSession {
129
+ title: string;
130
+ categoryId?: string | null;
131
+ targetMinutes: number;
132
+ actualSeconds?: number;
133
+ status?: FocusSessionStatus;
134
+ startedAt?: string;
135
+ completedAt?: string | null;
136
+ }
137
+ interface FocusSessionFilters {
138
+ categoryId?: string;
139
+ status?: FocusSessionStatus;
140
+ startedAfter?: string;
141
+ startedBefore?: string;
142
+ }
143
+ type ChatMessageRole = 'user' | 'assistant' | 'system';
144
+ interface ChatConversation {
145
+ id: string;
146
+ userId: string;
147
+ title: string;
148
+ createdAt: string;
149
+ updatedAt: string;
150
+ }
151
+ interface NewChatConversation {
152
+ title: string;
153
+ }
154
+ interface ChatMessage {
155
+ id: string;
156
+ conversationId: string;
157
+ role: ChatMessageRole;
158
+ content: string;
159
+ metadata: string | null;
160
+ createdAt: string;
161
+ }
162
+ interface NewChatMessage {
163
+ conversationId: string;
164
+ role: ChatMessageRole;
165
+ content: string;
166
+ metadata?: string | null;
167
+ }
168
+ interface EFLink {
169
+ id: string;
170
+ userId: string;
171
+ name: string;
172
+ url: string;
173
+ icon: string | null;
174
+ sortOrder: number;
175
+ createdAt: string;
176
+ updatedAt: string;
177
+ }
178
+ interface NewEFLink {
179
+ name: string;
180
+ url: string;
181
+ icon?: string | null;
182
+ sortOrder?: number;
183
+ }
184
+ type LieuDayType = 'earned' | 'used';
185
+ interface LieuDay {
186
+ id: string;
187
+ userId: string;
188
+ type: LieuDayType;
189
+ date: string;
190
+ reason: string | null;
191
+ createdAt: string;
192
+ updatedAt: string;
193
+ }
194
+ interface NewLieuDay {
195
+ type: LieuDayType;
196
+ date: string;
197
+ reason?: string | null;
198
+ }
199
+ type BankConnectionStatus = 'pending' | 'linked' | 'expired' | 'error';
200
+ type TransactionType = 'debit' | 'credit';
201
+ interface BankConnection {
202
+ id: string;
203
+ userId: string;
204
+ provider: string;
205
+ institutionId: string;
206
+ institutionName: string;
207
+ requisitionId: string;
208
+ accountId: string | null;
209
+ status: BankConnectionStatus;
210
+ lastSynced: string | null;
211
+ createdAt: string;
212
+ updatedAt: string;
213
+ }
214
+ interface BankTransaction {
215
+ id: string;
216
+ connectionId: string | null;
217
+ externalId: string;
218
+ amount: number;
219
+ currency: string;
220
+ description: string | null;
221
+ merchantName: string | null;
222
+ bookingDate: string;
223
+ valueDate: string | null;
224
+ transactionType: TransactionType | null;
225
+ createdAt: string;
226
+ }
227
+ interface Setting {
228
+ id: string;
229
+ userId: string;
230
+ key: string;
231
+ value: string;
232
+ updatedAt: string;
233
+ }
234
+ interface ExchangeRate {
235
+ currency: string;
236
+ rateToCHF: number;
237
+ updatedAt: string;
238
+ }
239
+
240
+ export type { BankConnectionStatus as B, ChatMessageRole as C, ExpenseCategory as E, FocusCategory as F, IncomeCategory as I, LieuDayType as L, NewExpenseCategory as N, Setting as S, TransactionType as T, Expense as a, NewExpense as b, NewIncomeCategory as c, Income as d, NewIncome as e, NewFocusCategory as f, FocusSessionStatus as g, FocusSession as h, NewFocusSession as i, FocusSessionFilters as j, ChatConversation as k, NewChatConversation as l, ChatMessage as m, NewChatMessage as n, EFLink as o, NewEFLink as p, LieuDay as q, NewLieuDay as r, BankConnection as s, BankTransaction as t, ExchangeRate as u };