decisionnode 0.2.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.
- package/LICENSE +21 -0
- package/README.md +80 -0
- package/dist/ai/gemini.d.ts +15 -0
- package/dist/ai/gemini.js +56 -0
- package/dist/ai/rag.d.ts +79 -0
- package/dist/ai/rag.js +268 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1724 -0
- package/dist/cloud.d.ts +177 -0
- package/dist/cloud.js +631 -0
- package/dist/env.d.ts +47 -0
- package/dist/env.js +139 -0
- package/dist/history.d.ts +34 -0
- package/dist/history.js +159 -0
- package/dist/maintenance.d.ts +7 -0
- package/dist/maintenance.js +49 -0
- package/dist/marketplace.d.ts +46 -0
- package/dist/marketplace.js +300 -0
- package/dist/mcp/server.d.ts +2 -0
- package/dist/mcp/server.js +621 -0
- package/dist/setup.d.ts +6 -0
- package/dist/setup.js +132 -0
- package/dist/store.d.ts +126 -0
- package/dist/store.js +555 -0
- package/dist/types.d.ts +60 -0
- package/dist/types.js +9 -0
- package/package.json +57 -0
package/dist/cloud.d.ts
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
interface CloudConfig {
|
|
2
|
+
access_token?: string;
|
|
3
|
+
refresh_token?: string;
|
|
4
|
+
token_expires_at?: number;
|
|
5
|
+
anon_key?: string;
|
|
6
|
+
user_id?: string;
|
|
7
|
+
username?: string;
|
|
8
|
+
email?: string;
|
|
9
|
+
subscription_tier?: 'free' | 'pro';
|
|
10
|
+
subscription_expires_at?: string;
|
|
11
|
+
last_sync?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Load cloud configuration from disk
|
|
15
|
+
* Automatically refreshes token if expired
|
|
16
|
+
*/
|
|
17
|
+
export declare function loadCloudConfig(): Promise<CloudConfig>;
|
|
18
|
+
/**
|
|
19
|
+
* Save cloud configuration to disk
|
|
20
|
+
*/
|
|
21
|
+
export declare function saveCloudConfig(config: CloudConfig): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Check if user is authenticated with cloud
|
|
24
|
+
*/
|
|
25
|
+
export declare function isCloudAuthenticated(): Promise<boolean>;
|
|
26
|
+
/**
|
|
27
|
+
* Check if user has Pro subscription
|
|
28
|
+
*/
|
|
29
|
+
export declare function isProSubscriber(): Promise<boolean>;
|
|
30
|
+
/**
|
|
31
|
+
* Get cloud embedding for a query (Pro only)
|
|
32
|
+
* Falls back to null if not available
|
|
33
|
+
*/
|
|
34
|
+
export declare function getCloudEmbedding(text: string, projectName?: string): Promise<number[] | null>;
|
|
35
|
+
/**
|
|
36
|
+
* Sync decisions to cloud (Pro only)
|
|
37
|
+
*/
|
|
38
|
+
export declare function syncDecisionsToCloud(projectName: string, decisions: any[]): Promise<{
|
|
39
|
+
success: boolean;
|
|
40
|
+
synced: string[];
|
|
41
|
+
failed: string[];
|
|
42
|
+
errors?: Record<string, string>;
|
|
43
|
+
embedded: number;
|
|
44
|
+
} | null>;
|
|
45
|
+
/**
|
|
46
|
+
* Get cloud sync status - which decisions are synced
|
|
47
|
+
*/
|
|
48
|
+
export declare function getCloudSyncStatus(projectName: string): Promise<{
|
|
49
|
+
synced: string[];
|
|
50
|
+
total_in_cloud: number;
|
|
51
|
+
} | null>;
|
|
52
|
+
/**
|
|
53
|
+
* Login to cloud service
|
|
54
|
+
* Opens browser for authentication, waits for callback
|
|
55
|
+
*/
|
|
56
|
+
export declare function loginToCloud(): Promise<boolean>;
|
|
57
|
+
/**
|
|
58
|
+
* Logout from cloud service
|
|
59
|
+
*/
|
|
60
|
+
export declare function logoutFromCloud(): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Get cloud status with detailed info
|
|
63
|
+
*/
|
|
64
|
+
export declare function getCloudStatus(): Promise<{
|
|
65
|
+
authenticated: boolean;
|
|
66
|
+
isPro: boolean;
|
|
67
|
+
userId?: string;
|
|
68
|
+
username?: string;
|
|
69
|
+
email?: string;
|
|
70
|
+
expiresAt?: string;
|
|
71
|
+
lastSync?: string;
|
|
72
|
+
}>;
|
|
73
|
+
/**
|
|
74
|
+
* Refresh user profile from cloud (updates subscription status)
|
|
75
|
+
*/
|
|
76
|
+
export declare function refreshCloudProfile(): Promise<boolean>;
|
|
77
|
+
/**
|
|
78
|
+
* Delete a decision from cloud (Pro only)
|
|
79
|
+
*/
|
|
80
|
+
export declare function deleteDecisionFromCloud(decisionId: string): Promise<boolean>;
|
|
81
|
+
/**
|
|
82
|
+
* Pull decisions from cloud (Pro only)
|
|
83
|
+
*/
|
|
84
|
+
export declare function pullDecisionsFromCloud(projectName: string): Promise<any[] | null>;
|
|
85
|
+
/**
|
|
86
|
+
* Cloud decision structure (from Supabase)
|
|
87
|
+
*/
|
|
88
|
+
export interface CloudDecision {
|
|
89
|
+
id: string;
|
|
90
|
+
user_id: string;
|
|
91
|
+
project_name: string;
|
|
92
|
+
decision_id: string;
|
|
93
|
+
scope: string;
|
|
94
|
+
decision: string;
|
|
95
|
+
rationale: string | null;
|
|
96
|
+
constraints: string[] | null;
|
|
97
|
+
status: string;
|
|
98
|
+
synced_at: string;
|
|
99
|
+
updated_at: string;
|
|
100
|
+
embedding?: number[];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Sync conflict between local and cloud versions
|
|
104
|
+
*/
|
|
105
|
+
export interface SyncConflict {
|
|
106
|
+
decisionId: string;
|
|
107
|
+
scope: string;
|
|
108
|
+
localDecision: string;
|
|
109
|
+
cloudDecision: string;
|
|
110
|
+
localUpdatedAt: string;
|
|
111
|
+
cloudUpdatedAt: string;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Sync metadata for a single decision
|
|
115
|
+
*/
|
|
116
|
+
interface DecisionSyncMeta {
|
|
117
|
+
syncedAt: string;
|
|
118
|
+
cloudUpdatedAt?: string;
|
|
119
|
+
localUpdatedAt?: string;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Sync metadata file structure
|
|
123
|
+
*/
|
|
124
|
+
interface SyncMetadata {
|
|
125
|
+
lastSyncAt: string;
|
|
126
|
+
decisions: Record<string, DecisionSyncMeta>;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Load sync metadata from disk
|
|
130
|
+
*/
|
|
131
|
+
export declare function loadSyncMetadata(projectRoot: string): Promise<SyncMetadata>;
|
|
132
|
+
/**
|
|
133
|
+
* Save sync metadata to disk
|
|
134
|
+
*/
|
|
135
|
+
export declare function saveSyncMetadata(projectRoot: string, metadata: SyncMetadata): Promise<void>;
|
|
136
|
+
/**
|
|
137
|
+
* Get auto-sync setting
|
|
138
|
+
*/
|
|
139
|
+
export declare function getAutoSyncEnabled(): Promise<boolean>;
|
|
140
|
+
/**
|
|
141
|
+
* Set auto-sync setting
|
|
142
|
+
*/
|
|
143
|
+
export declare function setAutoSyncEnabled(enabled: boolean): Promise<void>;
|
|
144
|
+
/**
|
|
145
|
+
* Detect conflicts between local and cloud decisions
|
|
146
|
+
* Returns decisions that need to be pushed, pulled, or have conflicts
|
|
147
|
+
*/
|
|
148
|
+
export declare function detectConflicts(projectRoot: string, localDecisions: Array<{
|
|
149
|
+
id: string;
|
|
150
|
+
decision: string;
|
|
151
|
+
updatedAt?: string;
|
|
152
|
+
scope: string;
|
|
153
|
+
}>, cloudDecisions: CloudDecision[]): Promise<{
|
|
154
|
+
toPush: string[];
|
|
155
|
+
toPull: CloudDecision[];
|
|
156
|
+
conflicts: SyncConflict[];
|
|
157
|
+
}>;
|
|
158
|
+
/**
|
|
159
|
+
* Save incoming changes from fetch command
|
|
160
|
+
*/
|
|
161
|
+
export declare function saveIncomingChanges(projectRoot: string, changes: {
|
|
162
|
+
toPull: CloudDecision[];
|
|
163
|
+
conflicts: SyncConflict[];
|
|
164
|
+
}): Promise<void>;
|
|
165
|
+
/**
|
|
166
|
+
* Remove specific decisions from incoming changes list (after sync)
|
|
167
|
+
*/
|
|
168
|
+
export declare function removeIncomingChanges(projectRoot: string, syncedIds: string[]): Promise<void>;
|
|
169
|
+
/**
|
|
170
|
+
* Resolve a conflict by choosing local or cloud version
|
|
171
|
+
*/
|
|
172
|
+
export declare function resolveConflict(projectRoot: string, decisionId: string, resolution: 'local' | 'cloud', cloudDecision?: CloudDecision): Promise<boolean>;
|
|
173
|
+
/**
|
|
174
|
+
* Update sync metadata after successful sync
|
|
175
|
+
*/
|
|
176
|
+
export declare function updateSyncMetadata(projectRoot: string, syncedIds: string[], cloudDecisions: CloudDecision[]): Promise<void>;
|
|
177
|
+
export {};
|