cohvu 2.21.1 → 3.0.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.
Files changed (102) hide show
  1. package/README.md +37 -0
  2. package/cli.js +15501 -0
  3. package/package.json +15 -26
  4. package/dist/__tests__/instruction-file.unit.test.d.ts +0 -1
  5. package/dist/__tests__/instruction-file.unit.test.js +0 -296
  6. package/dist/__tests__/instruction-file.unit.test.js.map +0 -1
  7. package/dist/__tests__/teardown.unit.test.d.ts +0 -1
  8. package/dist/__tests__/teardown.unit.test.js +0 -196
  9. package/dist/__tests__/teardown.unit.test.js.map +0 -1
  10. package/dist/api.d.ts +0 -292
  11. package/dist/api.js +0 -337
  12. package/dist/api.js.map +0 -1
  13. package/dist/auth.d.ts +0 -4
  14. package/dist/auth.js +0 -96
  15. package/dist/auth.js.map +0 -1
  16. package/dist/constants.d.ts +0 -2
  17. package/dist/constants.js +0 -10
  18. package/dist/constants.js.map +0 -1
  19. package/dist/index.d.ts +0 -2
  20. package/dist/index.js +0 -259
  21. package/dist/index.js.map +0 -1
  22. package/dist/instructions.d.ts +0 -33
  23. package/dist/instructions.js +0 -238
  24. package/dist/instructions.js.map +0 -1
  25. package/dist/log.d.ts +0 -6
  26. package/dist/log.js +0 -51
  27. package/dist/log.js.map +0 -1
  28. package/dist/pause.d.ts +0 -3
  29. package/dist/pause.js +0 -24
  30. package/dist/pause.js.map +0 -1
  31. package/dist/platforms.d.ts +0 -22
  32. package/dist/platforms.js +0 -79
  33. package/dist/platforms.js.map +0 -1
  34. package/dist/postinstall.d.ts +0 -2
  35. package/dist/postinstall.js +0 -11
  36. package/dist/postinstall.js.map +0 -1
  37. package/dist/proxy.d.ts +0 -1
  38. package/dist/proxy.js +0 -371
  39. package/dist/proxy.js.map +0 -1
  40. package/dist/setup.d.ts +0 -15
  41. package/dist/setup.js +0 -295
  42. package/dist/setup.js.map +0 -1
  43. package/dist/teardown.d.ts +0 -15
  44. package/dist/teardown.js +0 -235
  45. package/dist/teardown.js.map +0 -1
  46. package/dist/tui/App.d.ts +0 -1
  47. package/dist/tui/App.js +0 -2245
  48. package/dist/tui/App.js.map +0 -1
  49. package/dist/tui/components/Banner.d.ts +0 -4
  50. package/dist/tui/components/Banner.js +0 -71
  51. package/dist/tui/components/Banner.js.map +0 -1
  52. package/dist/tui/components/Divider.d.ts +0 -1
  53. package/dist/tui/components/Divider.js +0 -8
  54. package/dist/tui/components/Divider.js.map +0 -1
  55. package/dist/tui/components/Footer.d.ts +0 -4
  56. package/dist/tui/components/Footer.js +0 -214
  57. package/dist/tui/components/Footer.js.map +0 -1
  58. package/dist/tui/components/Header.d.ts +0 -4
  59. package/dist/tui/components/Header.js +0 -126
  60. package/dist/tui/components/Header.js.map +0 -1
  61. package/dist/tui/components/LockCard.d.ts +0 -17
  62. package/dist/tui/components/LockCard.js +0 -37
  63. package/dist/tui/components/LockCard.js.map +0 -1
  64. package/dist/tui/components/Modal.d.ts +0 -5
  65. package/dist/tui/components/Modal.js +0 -195
  66. package/dist/tui/components/Modal.js.map +0 -1
  67. package/dist/tui/components/TabBar.d.ts +0 -4
  68. package/dist/tui/components/TabBar.js +0 -17
  69. package/dist/tui/components/TabBar.js.map +0 -1
  70. package/dist/tui/components/Toast.d.ts +0 -4
  71. package/dist/tui/components/Toast.js +0 -9
  72. package/dist/tui/components/Toast.js.map +0 -1
  73. package/dist/tui/index.d.ts +0 -1
  74. package/dist/tui/index.js +0 -20
  75. package/dist/tui/index.js.map +0 -1
  76. package/dist/tui/platform-detect.d.ts +0 -2
  77. package/dist/tui/platform-detect.js +0 -79
  78. package/dist/tui/platform-detect.js.map +0 -1
  79. package/dist/tui/state.d.ts +0 -414
  80. package/dist/tui/state.js +0 -397
  81. package/dist/tui/state.js.map +0 -1
  82. package/dist/tui/tabs/BillingTab.d.ts +0 -5
  83. package/dist/tui/tabs/BillingTab.js +0 -72
  84. package/dist/tui/tabs/BillingTab.js.map +0 -1
  85. package/dist/tui/tabs/KeysTab.d.ts +0 -5
  86. package/dist/tui/tabs/KeysTab.js +0 -87
  87. package/dist/tui/tabs/KeysTab.js.map +0 -1
  88. package/dist/tui/tabs/KnowledgeTab.d.ts +0 -5
  89. package/dist/tui/tabs/KnowledgeTab.js +0 -143
  90. package/dist/tui/tabs/KnowledgeTab.js.map +0 -1
  91. package/dist/tui/tabs/ProjectTab.d.ts +0 -5
  92. package/dist/tui/tabs/ProjectTab.js +0 -34
  93. package/dist/tui/tabs/ProjectTab.js.map +0 -1
  94. package/dist/tui/tabs/TeamTab.d.ts +0 -5
  95. package/dist/tui/tabs/TeamTab.js +0 -57
  96. package/dist/tui/tabs/TeamTab.js.map +0 -1
  97. package/dist/tui/tabs/YouTab.d.ts +0 -5
  98. package/dist/tui/tabs/YouTab.js +0 -25
  99. package/dist/tui/tabs/YouTab.js.map +0 -1
  100. package/dist/tui/utils.d.ts +0 -6
  101. package/dist/tui/utils.js +0 -58
  102. package/dist/tui/utils.js.map +0 -1
@@ -1,79 +0,0 @@
1
- // Platform status detection for the You tab.
2
- // Two states: configured or not-detected.
3
- import { existsSync, readFileSync } from "fs";
4
- import { join } from "path";
5
- import { homedir, platform } from "os";
6
- function vscodeUserDir() {
7
- if (platform() === "darwin") {
8
- return join("Library", "Application Support", "Code", "User");
9
- }
10
- return join(".config", "Code", "User");
11
- }
12
- const PLATFORMS = [
13
- {
14
- name: 'claude code',
15
- detectPath: '.claude',
16
- configPath: '.claude.json',
17
- configFormat: 'json',
18
- rootKey: 'mcpServers',
19
- },
20
- {
21
- name: 'cursor',
22
- detectPath: '.cursor',
23
- configPath: join('.cursor', 'mcp.json'),
24
- configFormat: 'json',
25
- rootKey: 'mcpServers',
26
- },
27
- {
28
- name: 'windsurf',
29
- detectPath: join('.codeium', 'windsurf'),
30
- configPath: join('.codeium', 'windsurf', 'mcp_config.json'),
31
- configFormat: 'json',
32
- rootKey: 'mcpServers',
33
- },
34
- {
35
- name: 'cline',
36
- detectPath: join(vscodeUserDir(), 'globalStorage', 'saoudrizwan.claude-dev'),
37
- configPath: join(vscodeUserDir(), 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'),
38
- configFormat: 'json',
39
- rootKey: 'mcpServers',
40
- },
41
- {
42
- name: 'codex',
43
- detectPath: '.codex',
44
- configPath: join('.codex', 'config.toml'),
45
- configFormat: 'toml',
46
- rootKey: 'mcp_servers',
47
- },
48
- ];
49
- export function detectPlatformStatuses() {
50
- const home = homedir();
51
- const results = [];
52
- for (const p of PLATFORMS) {
53
- const detectFull = join(home, p.detectPath);
54
- if (!existsSync(detectFull)) {
55
- results.push({ name: p.name, state: 'not-detected' });
56
- continue;
57
- }
58
- const configFull = join(home, p.configPath);
59
- const configured = isConfigured(configFull, p.configFormat, p.rootKey);
60
- results.push({ name: p.name, state: configured ? 'configured' : 'not-detected' });
61
- }
62
- return results;
63
- }
64
- function isConfigured(configPath, format, rootKey) {
65
- if (!existsSync(configPath))
66
- return false;
67
- try {
68
- const content = readFileSync(configPath, 'utf8');
69
- if (format === 'json') {
70
- const parsed = JSON.parse(content);
71
- return !!parsed?.[rootKey]?.cohvu;
72
- }
73
- return content.includes('[mcp_servers.cohvu]');
74
- }
75
- catch {
76
- return false;
77
- }
78
- }
79
- //# sourceMappingURL=platform-detect.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform-detect.js","sourceRoot":"","sources":["../../src/tui/platform-detect.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,0CAA0C;AAE1C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAGvC,SAAS,aAAa;IACpB,IAAI,QAAQ,EAAE,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAC,SAAS,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM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, PendingApproval, Notification, ApiKeySummary, KeyAction, TeamOverview } from "../api.js";
2
- export declare const ALL_KEY_ACTIONS: readonly KeyAction[];
3
- export interface WizardProjectScope {
4
- project_id: string;
5
- actions: Set<KeyAction>;
6
- }
7
- /** A project in the flat navigation list — knows its ownership context.
8
- * `locked` carries the personal-project downgrade lock; team projects derive
9
- * their lock from the team's subscription status instead. */
10
- export interface FlatProject {
11
- project_id: string;
12
- slug: string;
13
- name: string;
14
- created_at: string;
15
- locked: boolean;
16
- owner: {
17
- kind: 'personal';
18
- } | {
19
- kind: 'team';
20
- teamId: string;
21
- teamName: string;
22
- teamSlug: string;
23
- };
24
- }
25
- /** Team as stored in state (mirroring MeResponse shape). */
26
- export type TeamInfo = MeResponse['teams'][0];
27
- export type Tab = 'knowledge' | 'team' | 'billing' | 'project' | 'keys' | 'you';
28
- export type KnowledgeMode = 'browse' | 'search' | 'remove' | 'detail';
29
- export type Modal = null | {
30
- kind: 'confirm-remove';
31
- contributionId: string;
32
- preview: string;
33
- } | {
34
- kind: 'confirm-remove-all';
35
- slug: string;
36
- contributionCount: number;
37
- input: string;
38
- } | {
39
- kind: 'confirm-delete';
40
- slug: string;
41
- contributionCount: number;
42
- input: string;
43
- } | {
44
- kind: 'confirm-clear';
45
- slug: string;
46
- contributionCount: number;
47
- input: string;
48
- } | {
49
- kind: 'confirm-remove-member';
50
- email: string;
51
- userId: string;
52
- } | {
53
- kind: 'confirm-leave';
54
- } | {
55
- kind: 'confirm-logout';
56
- } | {
57
- kind: 'rename';
58
- input: string;
59
- } | {
60
- kind: 'create-project';
61
- input: string;
62
- teamId: string | null;
63
- } | {
64
- kind: 'create-team';
65
- input: string;
66
- } | {
67
- kind: 'create-team-project';
68
- teamId: string;
69
- teamName: string;
70
- input: string;
71
- } | {
72
- kind: 'select-owner';
73
- selected: number;
74
- } | {
75
- kind: 'invite';
76
- selected: number;
77
- } | {
78
- kind: 'invite-link';
79
- role: string;
80
- url: string;
81
- } | {
82
- kind: 'configure-sso';
83
- step: number;
84
- issuer: string;
85
- clientId: string;
86
- clientSecret: string;
87
- domains: string;
88
- defaultRole: number;
89
- requireSso: boolean;
90
- } | {
91
- kind: 'confirm-delete-team';
92
- slug: string;
93
- teamName: string;
94
- input: string;
95
- } | {
96
- kind: 'confirm-rename-team';
97
- input: string;
98
- } | {
99
- kind: 'manage-sso';
100
- } | {
101
- kind: 'switch-project';
102
- selected: number;
103
- } | {
104
- kind: 'edit-role';
105
- targetEmail: string;
106
- targetUserId: string;
107
- currentRole: string;
108
- selected: number;
109
- } | {
110
- kind: 'initiate-consensus';
111
- action: string;
112
- description: string;
113
- targetUserId?: string;
114
- } | {
115
- kind: 'approve-action';
116
- approvalId: string;
117
- description: string;
118
- initiator: string;
119
- expiresIn: string;
120
- } | {
121
- kind: 'confirm-regen-link';
122
- role: string;
123
- } | {
124
- kind: 'create-integration-key';
125
- step: 'name' | 'agent' | 'projects' | 'permissions' | 'scope' | 'limits' | 'confirm';
126
- input: string;
127
- agentName: string;
128
- projectSelectedIdx: number;
129
- selectedProjectIds: Set<string>;
130
- projectScopes: Map<string, Set<KeyAction>>;
131
- permProjectIdx: number;
132
- permActionIdx: number;
133
- globalScope: 'own' | 'all';
134
- limitsField: 'expiry' | 'ops';
135
- expiresInDays: string;
136
- opsLimit: string;
137
- } | {
138
- kind: 'key-created';
139
- keyId: string;
140
- keyValue: string;
141
- keyName: string;
142
- kind2: 'session' | 'integration';
143
- } | {
144
- kind: 'confirm-revoke-key';
145
- keyId: string;
146
- keyName: string;
147
- } | {
148
- kind: 'confirm-account-delete';
149
- email: string;
150
- input: string;
151
- } | {
152
- kind: 'account-delete-blocked';
153
- teams: Array<{
154
- team_id: string;
155
- team_name: string;
156
- other_member_count: number;
157
- }>;
158
- } | {
159
- kind: 'account-delete-scheduled';
160
- scheduledAt: string;
161
- } | {
162
- kind: 'confirm-cancel-account-deletion';
163
- };
164
- export interface PlatformStatus {
165
- name: string;
166
- state: 'configured' | 'not-detected';
167
- }
168
- export interface AppState {
169
- user: MeResponse['user'] | null;
170
- projects: FlatProject[];
171
- activeProjectId: string | null;
172
- userRole: 'admin' | 'member' | 'viewer';
173
- teams: TeamInfo[];
174
- individualSubscription: MeResponse['individual_subscription'];
175
- usage: UsageInfo | null;
176
- tab: Tab;
177
- knowledgeMode: KnowledgeMode;
178
- contributions: ContributionItem[];
179
- contributionTotal: number;
180
- projectStats: {
181
- contributions: number;
182
- contributors: number;
183
- lastActivity: string | null;
184
- } | null;
185
- detailContributionId: string | null;
186
- contributionScroll: number;
187
- contributionSelected: number;
188
- contributionLoading: boolean;
189
- contributionHasMore: boolean;
190
- searchQuery: string;
191
- searchResults: ContributionItem[] | null;
192
- searching: boolean;
193
- removeSelected: Set<string>;
194
- removeConfirming: boolean;
195
- liveDotId: string | null;
196
- liveDotExpiry: number;
197
- members: MemberItem[];
198
- inviteLinks: InviteLink[];
199
- teamSelected: number;
200
- inlineError: string | null;
201
- billing: BillingInfo | null;
202
- platforms: PlatformStatus[];
203
- paused: boolean;
204
- modal: Modal;
205
- firstLogin: boolean;
206
- joinedProjectName: string | null;
207
- ssoConfig: {
208
- issuer: string;
209
- allowed_domains: string[];
210
- default_role: string;
211
- require_sso: boolean;
212
- enabled: boolean;
213
- } | null;
214
- requireConsensus: boolean;
215
- pendingApprovals: PendingApproval[];
216
- notifications: Notification[];
217
- copiedFeedback: boolean;
218
- toast: {
219
- message: string;
220
- type: 'success' | 'error' | 'info';
221
- expiresAt: number;
222
- } | null;
223
- operationPending: string | null;
224
- showHelp: boolean;
225
- error: string | null;
226
- offline: boolean;
227
- sseConnected: boolean;
228
- sseEverConnected: boolean;
229
- apiKeys: ApiKeySummary[];
230
- apiKeysLoading: boolean;
231
- apiKeysSelected: number;
232
- teamOverview: TeamOverview | null;
233
- }
234
- export declare const TABS: Tab[];
235
- export declare function initialState(): AppState;
236
- export type Action = {
237
- type: 'SET_USER_DATA';
238
- me: MeResponse;
239
- } | {
240
- type: 'SWITCH_TAB';
241
- tab: Tab;
242
- } | {
243
- type: 'NEXT_TAB';
244
- } | {
245
- type: 'SCROLL_UP';
246
- } | {
247
- type: 'SCROLL_DOWN';
248
- } | {
249
- type: 'ENTER_SEARCH';
250
- } | {
251
- type: 'EXIT_SEARCH';
252
- } | {
253
- type: 'SEARCH_INPUT';
254
- char: string;
255
- } | {
256
- type: 'SEARCH_BACKSPACE';
257
- } | {
258
- type: 'ENTER_REMOVE';
259
- } | {
260
- type: 'EXIT_REMOVE';
261
- } | {
262
- type: 'TOGGLE_REMOVE';
263
- contributionId: string;
264
- } | {
265
- type: 'SET_CONTRIBUTIONS';
266
- contributions: ContributionItem[];
267
- total: number;
268
- append?: boolean;
269
- } | {
270
- type: 'SET_SEARCH_RESULTS';
271
- results: ContributionItem[];
272
- } | {
273
- type: 'ADD_CONTRIBUTION';
274
- contribution: ContributionItem;
275
- } | {
276
- type: 'REMOVE_CONTRIBUTION';
277
- id: string;
278
- } | {
279
- type: 'SET_MEMBERS';
280
- members: MemberItem[];
281
- } | {
282
- type: 'SET_BILLING';
283
- billing: BillingInfo;
284
- } | {
285
- type: 'SET_PLATFORMS';
286
- platforms: PlatformStatus[];
287
- } | {
288
- type: 'OPEN_MODAL';
289
- modal: NonNullable<Modal>;
290
- } | {
291
- type: 'CLOSE_MODAL';
292
- } | {
293
- type: 'MODAL_INPUT';
294
- char: string;
295
- } | {
296
- type: 'MODAL_BACKSPACE';
297
- } | {
298
- type: 'SET_COPIED_FEEDBACK';
299
- active: boolean;
300
- } | {
301
- type: 'SET_ERROR';
302
- error: string | null;
303
- } | {
304
- type: 'SET_OFFLINE';
305
- offline: boolean;
306
- } | {
307
- type: 'SET_SSE_CONNECTED';
308
- connected: boolean;
309
- } | {
310
- type: 'SET_LIVE_DOT';
311
- contributionId: string;
312
- } | {
313
- type: 'CLEAR_LIVE_DOT';
314
- } | {
315
- type: 'SET_LOADING';
316
- loading: boolean;
317
- } | {
318
- type: 'SET_SEARCHING';
319
- searching: boolean;
320
- } | {
321
- type: 'SET_INVITE_LINKS';
322
- links: InviteLink[];
323
- } | {
324
- type: 'SET_PENDING_APPROVALS';
325
- approvals: PendingApproval[];
326
- } | {
327
- type: 'SET_NOTIFICATIONS';
328
- notifications: Notification[];
329
- } | {
330
- type: 'SET_USER_ROLE';
331
- role: 'admin' | 'member' | 'viewer';
332
- } | {
333
- type: 'SET_TEAM_SELECTED';
334
- index: number;
335
- } | {
336
- type: 'SET_INLINE_ERROR';
337
- message: string | null;
338
- } | {
339
- type: 'SET_TOAST';
340
- toast: AppState['toast'];
341
- } | {
342
- type: 'SET_OPERATION';
343
- operation: string | null;
344
- } | {
345
- type: 'SET_REMOVE_CONFIRMING';
346
- confirming: boolean;
347
- } | {
348
- type: 'UPDATE_CONTRIBUTION';
349
- contribution: ContributionItem;
350
- } | {
351
- type: 'SET_FIRST_LOGIN';
352
- firstLogin: boolean;
353
- } | {
354
- type: 'SET_SSO_CONFIG';
355
- config: AppState['ssoConfig'];
356
- } | {
357
- type: 'SET_REQUIRE_CONSENSUS';
358
- value: boolean;
359
- } | {
360
- type: 'SET_PAUSED';
361
- paused: boolean;
362
- } | {
363
- type: 'SET_PROJECT_STATS';
364
- stats: AppState['projectStats'];
365
- } | {
366
- type: 'SET_DETAIL_CONTRIBUTION';
367
- contributionId: string | null;
368
- } | {
369
- type: 'SET_SHOW_HELP';
370
- show: boolean;
371
- } | {
372
- type: 'DISMISS_NOTIFICATION_BANNERS';
373
- } | {
374
- type: 'SET_JOINED_PROJECT';
375
- name: string | null;
376
- } | {
377
- type: 'SET_API_KEYS';
378
- keys: ApiKeySummary[];
379
- } | {
380
- type: 'SET_API_KEYS_LOADING';
381
- loading: boolean;
382
- } | {
383
- type: 'SET_API_KEYS_SELECTED';
384
- index: number;
385
- } | {
386
- type: 'REMOVE_API_KEY';
387
- id: string;
388
- } | {
389
- type: 'SET_USAGE';
390
- ops_used: number;
391
- ops_limit: number;
392
- } | {
393
- type: 'SET_TEAM_OVERVIEW';
394
- overview: TeamOverview | null;
395
- };
396
- export declare function reduce(state: AppState, action: Action): AppState;
397
- /** True when the active project belongs to a team whose subscription has been canceled. */
398
- export declare function isTeamLocked(state: AppState): boolean;
399
- /** Stable identifier for a project's billing entity — used by the silo rule
400
- * on integration key creation. Two projects share an entity iff this string
401
- * matches. Personal projects are keyed to the user; team projects to the
402
- * team. Cross-entity scopes on a single key aren't allowed. */
403
- export declare function projectEntityKey(project: FlatProject, userId: string | null): string;
404
- /** When the integration-key wizard has at least one project selected, every
405
- * subsequent pick must share that same billing entity. Hide the non-matching
406
- * projects from the picker so the user can't even attempt a cross-entity
407
- * scope the server would reject anyway. */
408
- export declare function filterToSameEntity(projects: FlatProject[], selectedIds: Set<string>, userId: string | null): FlatProject[];
409
- export declare function getActiveProject(state: AppState): FlatProject | null;
410
- /** Get the team info for the active project, or null if personal. */
411
- export declare function getActiveTeam(state: AppState): TeamInfo | null;
412
- /** True when the active project is locked — either a personal project
413
- * locked_by_downgrade, or a team project whose team sub is canceled. */
414
- export declare function isActiveProjectLocked(state: AppState): boolean;