@proletariat/cli 0.3.87 → 0.3.88

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 (96) hide show
  1. package/dist/commands/init.d.ts +6 -1
  2. package/dist/commands/init.js +44 -89
  3. package/dist/commands/init.js.map +1 -1
  4. package/dist/commands/new.d.ts +30 -2
  5. package/dist/commands/new.js +141 -9
  6. package/dist/commands/new.js.map +1 -1
  7. package/dist/hooks/init.js +3 -6
  8. package/dist/hooks/init.js.map +1 -1
  9. package/dist/lib/asana/config.d.ts +1 -1
  10. package/dist/lib/asana/config.js +18 -30
  11. package/dist/lib/asana/config.js.map +1 -1
  12. package/dist/lib/asana/mapper.d.ts +4 -3
  13. package/dist/lib/asana/mapper.js +17 -10
  14. package/dist/lib/asana/mapper.js.map +1 -1
  15. package/dist/lib/database/agents.d.ts +73 -0
  16. package/dist/lib/database/agents.js +341 -0
  17. package/dist/lib/database/agents.js.map +1 -0
  18. package/dist/lib/database/driver.d.ts +115 -0
  19. package/dist/lib/database/driver.js +109 -0
  20. package/dist/lib/database/driver.js.map +1 -0
  21. package/dist/lib/database/index.d.ts +25 -287
  22. package/dist/lib/database/index.js +35 -1067
  23. package/dist/lib/database/index.js.map +1 -1
  24. package/dist/lib/database/media.d.ts +53 -0
  25. package/dist/lib/database/media.js +118 -0
  26. package/dist/lib/database/media.js.map +1 -0
  27. package/dist/lib/database/pmo-bootstrap.d.ts +30 -0
  28. package/dist/lib/database/pmo-bootstrap.js +105 -0
  29. package/dist/lib/database/pmo-bootstrap.js.map +1 -0
  30. package/dist/lib/database/repositories.d.ts +26 -0
  31. package/dist/lib/database/repositories.js +56 -0
  32. package/dist/lib/database/repositories.js.map +1 -0
  33. package/dist/lib/database/settings-store.d.ts +60 -0
  34. package/dist/lib/database/settings-store.js +87 -0
  35. package/dist/lib/database/settings-store.js.map +1 -0
  36. package/dist/lib/database/themes.d.ts +59 -0
  37. package/dist/lib/database/themes.js +212 -0
  38. package/dist/lib/database/themes.js.map +1 -0
  39. package/dist/lib/database/workspace.d.ts +46 -0
  40. package/dist/lib/database/workspace.js +158 -0
  41. package/dist/lib/database/workspace.js.map +1 -0
  42. package/dist/lib/database/worktrees.d.ts +33 -0
  43. package/dist/lib/database/worktrees.js +60 -0
  44. package/dist/lib/database/worktrees.js.map +1 -0
  45. package/dist/lib/execution/config.d.ts +1 -1
  46. package/dist/lib/execution/config.js +7 -17
  47. package/dist/lib/execution/config.js.map +1 -1
  48. package/dist/lib/execution/spawner.d.ts +1 -1
  49. package/dist/lib/execution/storage.d.ts +4 -3
  50. package/dist/lib/execution/storage.js +11 -4
  51. package/dist/lib/execution/storage.js.map +1 -1
  52. package/dist/lib/external-issues/mapping-store.d.ts +4 -3
  53. package/dist/lib/external-issues/mapping-store.js +21 -13
  54. package/dist/lib/external-issues/mapping-store.js.map +1 -1
  55. package/dist/lib/external-issues/outbound-sync.d.ts +1 -1
  56. package/dist/lib/jira/config.d.ts +1 -6
  57. package/dist/lib/jira/config.js +16 -33
  58. package/dist/lib/jira/config.js.map +1 -1
  59. package/dist/lib/linear/config.d.ts +1 -1
  60. package/dist/lib/linear/config.js +16 -38
  61. package/dist/lib/linear/config.js.map +1 -1
  62. package/dist/lib/linear/mapper.d.ts +4 -3
  63. package/dist/lib/linear/mapper.js +20 -13
  64. package/dist/lib/linear/mapper.js.map +1 -1
  65. package/dist/lib/monday/config.d.ts +1 -1
  66. package/dist/lib/monday/config.js +16 -32
  67. package/dist/lib/monday/config.js.map +1 -1
  68. package/dist/lib/monday/mapper.d.ts +4 -3
  69. package/dist/lib/monday/mapper.js +19 -12
  70. package/dist/lib/monday/mapper.js.map +1 -1
  71. package/dist/lib/onboarding/wizard.d.ts +2 -2
  72. package/dist/lib/onboarding/wizard.js +32 -24
  73. package/dist/lib/onboarding/wizard.js.map +1 -1
  74. package/dist/lib/pmo/diet.d.ts +1 -1
  75. package/dist/lib/pmo/storage/index.d.ts +8 -0
  76. package/dist/lib/pmo/storage/index.js +13 -1
  77. package/dist/lib/pmo/storage/index.js.map +1 -1
  78. package/dist/lib/pmo/storage/types.d.ts +4 -1
  79. package/dist/lib/shortcut/config.d.ts +1 -7
  80. package/dist/lib/shortcut/config.js +13 -32
  81. package/dist/lib/shortcut/config.js.map +1 -1
  82. package/dist/lib/trello/config.d.ts +1 -26
  83. package/dist/lib/trello/config.js +23 -64
  84. package/dist/lib/trello/config.js.map +1 -1
  85. package/dist/lib/trello/mapper.d.ts +4 -3
  86. package/dist/lib/trello/mapper.js +17 -10
  87. package/dist/lib/trello/mapper.js.map +1 -1
  88. package/dist/lib/work-lifecycle/post-execution.d.ts +1 -1
  89. package/dist/lib/work-source/config.d.ts +1 -1
  90. package/dist/lib/work-source/config.js +14 -24
  91. package/dist/lib/work-source/config.js.map +1 -1
  92. package/dist/lib/work-source/provider-sources.d.ts +1 -1
  93. package/dist/lib/work-source/provider-sources.js +8 -20
  94. package/dist/lib/work-source/provider-sources.js.map +1 -1
  95. package/oclif.manifest.json +1461 -1412
  96. package/package.json +1 -1
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Database Driver Abstraction Layer
3
+ *
4
+ * Defines a driver-agnostic interface for SQLite database access.
5
+ * This allows swapping the underlying implementation (better-sqlite3, sql.js, etc.)
6
+ * without changing consumer code.
7
+ *
8
+ * All database access in the codebase should go through this interface
9
+ * rather than importing better-sqlite3 directly.
10
+ */
11
+ import Database from 'better-sqlite3';
12
+ // =============================================================================
13
+ // BetterSqlite3 Driver Implementation
14
+ // =============================================================================
15
+ /**
16
+ * DatabaseDriver implementation backed by better-sqlite3.
17
+ *
18
+ * This is the primary driver used in production. It wraps a better-sqlite3
19
+ * Database instance behind the DatabaseDriver interface.
20
+ */
21
+ export class BetterSqlite3Driver {
22
+ db;
23
+ constructor(db) {
24
+ this.db = db;
25
+ }
26
+ prepare(sql) {
27
+ const stmt = this.db.prepare(sql);
28
+ return {
29
+ run: (...params) => {
30
+ const result = stmt.run(...params);
31
+ return { changes: result.changes, lastInsertRowid: result.lastInsertRowid };
32
+ },
33
+ get: (...params) => {
34
+ return stmt.get(...params);
35
+ },
36
+ all: (...params) => {
37
+ return stmt.all(...params);
38
+ },
39
+ };
40
+ }
41
+ exec(sql) {
42
+ this.db.exec(sql);
43
+ }
44
+ pragma(source, options) {
45
+ return this.db.pragma(source, options);
46
+ }
47
+ transaction(fn) {
48
+ return this.db.transaction(fn);
49
+ }
50
+ close() {
51
+ this.db.close();
52
+ }
53
+ get open() {
54
+ return this.db.open;
55
+ }
56
+ /**
57
+ * Access the underlying better-sqlite3 Database instance.
58
+ * @internal Use for Drizzle ORM interop only.
59
+ */
60
+ get raw() {
61
+ return this.db;
62
+ }
63
+ }
64
+ // =============================================================================
65
+ // Factory Functions
66
+ // =============================================================================
67
+ /**
68
+ * Create a DatabaseDriver from an existing better-sqlite3 Database instance.
69
+ * Useful when migrating existing code that already has a Database object.
70
+ */
71
+ export function wrapDatabase(db) {
72
+ return new BetterSqlite3Driver(db);
73
+ }
74
+ /**
75
+ * Create a DatabaseDriver by opening a new better-sqlite3 connection.
76
+ * Configures standard pragmas (foreign keys, busy timeout).
77
+ */
78
+ export function openDriver(dbPath, options) {
79
+ const db = new Database(dbPath);
80
+ if (options?.foreignKeys !== false) {
81
+ db.pragma('foreign_keys = ON');
82
+ }
83
+ if (options?.busyTimeout !== undefined) {
84
+ db.pragma(`busy_timeout = ${options.busyTimeout}`);
85
+ }
86
+ else {
87
+ db.pragma('busy_timeout = 5000');
88
+ }
89
+ return new BetterSqlite3Driver(db);
90
+ }
91
+ /**
92
+ * Extract the raw better-sqlite3 Database from a driver.
93
+ * Throws if the driver is not a BetterSqlite3Driver.
94
+ *
95
+ * Use this for interop with code that still requires the raw connection
96
+ * (e.g., Drizzle ORM, legacy code being migrated).
97
+ */
98
+ export function getRawDatabase(driver) {
99
+ if (driver instanceof BetterSqlite3Driver) {
100
+ return driver.raw;
101
+ }
102
+ // For other driver implementations, check the raw property
103
+ const raw = driver.raw;
104
+ if (raw && typeof raw === 'object' && 'prepare' in raw) {
105
+ return raw;
106
+ }
107
+ throw new Error('Cannot extract raw database from this driver implementation');
108
+ }
109
+ //# sourceMappingURL=driver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"driver.js","sourceRoot":"","sources":["../../../src/lib/database/driver.ts"],"names":[],"mappings":"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"}
@@ -1,289 +1,27 @@
1
- import Database from 'better-sqlite3';
2
- export { CREATE_TABLES_SQL } from './workspace-schema.js';
3
- export interface WorkspaceConfig {
4
- id: number;
5
- type: 'hq' | 'workspace';
6
- workspace_name: string;
7
- has_pmo: boolean;
8
- active_theme_id: string | null;
9
- created_at: string;
10
- }
11
- export interface Repository {
12
- name: string;
13
- path: string;
14
- type: 'main' | 'dependency';
15
- source_url?: string;
16
- action?: 'clone' | 'move' | 'link';
17
- added_at: string;
18
- }
19
- export type AgentType = 'persistent' | 'ephemeral';
20
- export type AgentStatus = 'active' | 'cleaned';
21
- export type MountMode = 'worktree' | 'clone';
22
- export interface Agent {
23
- name: string;
24
- type: AgentType;
25
- status: AgentStatus;
26
- base_name: string | null;
27
- theme_id: string | null;
28
- worktree_path: string | null;
29
- mount_mode: MountMode;
30
- created_at: string;
31
- cleaned_at: string | null;
32
- }
33
- export interface AgentTheme {
34
- id: string;
35
- name: string;
36
- display_name: string;
37
- description: string | null;
38
- builtin: boolean;
39
- created_at: string;
40
- }
41
- export interface AgentThemeName {
42
- theme_id: string;
43
- name: string;
44
- }
45
- export interface AgentWorktree {
46
- agent_name: string;
47
- repo_name: string;
48
- worktree_path: string;
49
- branch: string;
50
- created_at: string;
51
- last_commit_hash?: string;
52
- commits_ahead: number;
53
- is_clean: boolean;
54
- last_checked?: string;
55
- }
56
- /**
57
- * Get the database path for a workspace
58
- */
59
- export declare function getDatabasePath(workspacePath: string): string;
60
- /**
61
- * Get the config path for a workspace
62
- */
63
- export declare function getConfigPath(workspacePath: string): string;
64
- /**
65
- * Open workspace database connection
66
- */
67
- export declare function openWorkspaceDatabase(workspacePath: string): Database.Database;
68
- /**
69
- * Create and initialize workspace database
70
- */
71
- export declare function createWorkspaceDatabase(workspacePath: string, type: 'hq' | 'workspace', workspaceName: string, hasPMO?: boolean): Database.Database;
72
- /**
73
- * Get workspace configuration
74
- */
75
- export declare function getWorkspaceConfig(workspacePath: string): WorkspaceConfig | null;
76
- /**
77
- * Get the active theme for a workspace
78
- * Auto-detects theme from existing agents if not explicitly set
79
- */
80
- export declare function getActiveTheme(workspacePath: string): AgentTheme | null;
81
- /**
82
- * Set the active theme for a workspace
83
- */
84
- export declare function setActiveTheme(workspacePath: string, themeId: string | null): void;
85
- /**
86
- * Add repositories to database
87
- */
88
- export declare function addRepositoriesToDatabase(workspacePath: string, repos: {
89
- name: string;
90
- path: string;
91
- source_url?: string;
92
- action?: 'clone' | 'move' | 'link';
93
- }[]): void;
94
- /**
95
- * Add agents to database (case-insensitive uniqueness)
96
- */
97
- export declare function addAgentsToDatabase(workspacePath: string, agentNames: string[], themeId?: string, mountMode?: MountMode): void;
98
- /**
99
- * Add an ephemeral agent to the database.
100
- * Throws on name collision — use tryAddEphemeralAgentToDatabase for
101
- * concurrency-safe insertion with conflict detection.
102
- */
103
- export declare function addEphemeralAgentToDatabase(workspacePath: string, agentName: string, baseName: string, themeId?: string, mountMode?: MountMode): Agent;
104
- /**
105
- * Try to add an ephemeral agent to the database.
106
- * Returns the Agent on success, or null if the name already exists
107
- * (SQLITE_CONSTRAINT_PRIMARYKEY). This is concurrency-safe: parallel
108
- * processes that generate the same name will not crash — the loser
109
- * simply gets null and can retry with a different name.
110
- */
111
- export declare function tryAddEphemeralAgentToDatabase(workspacePath: string, agentName: string, baseName: string, themeId?: string, mountMode?: MountMode): Agent | null;
112
- /**
113
- * Get all ephemeral agent names from the database
114
- */
115
- export declare function getEphemeralAgentNames(workspacePath: string): Set<string>;
116
- /**
117
- * Remove an ephemeral agent from the database
118
- */
119
- export declare function removeEphemeralAgent(workspacePath: string, agentName: string): void;
120
- /**
121
- * Get all agents in workspace
122
- */
123
- export declare function getWorkspaceAgents(workspacePath: string, includeCleanedUp?: boolean): Agent[];
124
- /**
125
- * Get an agent by directory path.
126
- * Looks up agent where the given absolute path is inside the agent's worktree.
127
- * Returns null if no matching agent found.
128
- */
129
- export declare function getAgentByPath(workspacePath: string, absolutePath: string): Agent | null;
130
- /**
131
- * Mark an agent as cleaned up (keeps the record for history)
132
- */
133
- export declare function markAgentCleaned(workspacePath: string, agentName: string): void;
134
- /**
135
- * Sync agents in database with what exists on disk.
136
- * Marks agents as 'cleaned' if their directory no longer exists.
137
- * Returns list of agents that were cleaned up.
138
- */
139
- export declare function syncAgentsWithDisk(workspacePath: string): string[];
140
- export interface DiscoverResult {
141
- discovered: {
142
- name: string;
143
- type: AgentType;
144
- path: string;
145
- }[];
146
- cleaned: string[];
147
- }
148
- /**
149
- * Discover agents on disk that aren't in the database and register them.
150
- * Also cleans up agents in DB whose directories no longer exist.
151
- * Returns both discovered and cleaned agents.
152
- */
153
- export declare function discoverAgentsOnDisk(workspacePath: string): DiscoverResult;
154
- /**
155
- * Get all repositories in workspace
156
- */
157
- export declare function getWorkspaceRepositories(workspacePath: string): Repository[];
158
1
  /**
159
- * Get worktrees for a specific agent
2
+ * Database Module - Re-export Facade
3
+ *
4
+ * This module re-exports all database operations from domain-specific modules.
5
+ * Consumers should import from this index for backward compatibility.
6
+ *
7
+ * Domain modules:
8
+ * - workspace.ts - Database lifecycle (open, create, config)
9
+ * - agents.ts - Agent CRUD operations
10
+ * - repositories.ts - Repository operations
11
+ * - themes.ts - Agent naming theme operations
12
+ * - worktrees.ts - Agent worktree queries
13
+ * - media.ts - Media item operations
14
+ * - pmo-bootstrap.ts - PMO initialization/teardown
15
+ * - driver.ts - DatabaseDriver abstraction layer
16
+ * - settings-store.ts - Workspace settings key-value store
160
17
  */
161
- export declare function getAgentWorktrees(workspacePath: string, agentName: string): AgentWorktree[];
162
- /**
163
- * Find agent worktrees matching a branch pattern (case-insensitive LIKE).
164
- */
165
- export declare function findWorktreesByBranch(workspacePath: string, branchPattern: string): AgentWorktree[];
166
- /**
167
- * Get agent worktrees for a specific repository.
168
- */
169
- export declare function getWorktreesForRepo(workspacePath: string, repoName: string): Array<{
170
- agent_name: string;
171
- is_clean: number;
172
- commits_ahead: number;
173
- branch: string;
174
- }>;
175
- /**
176
- * Upsert a workspace setting (key-value pair).
177
- */
178
- export declare function upsertWorkspaceSetting(db: Database.Database, key: string, value: string): void;
179
- /**
180
- * Remove agents from database
181
- */
182
- export declare function removeAgentsFromDatabase(workspacePath: string, agentNames: string[]): void;
183
- /**
184
- * Check if PMO tables exist and get basic stats.
185
- * Used by pmo init to detect existing PMO before storage layer is available.
186
- * Raw SQL: uses sqlite_master introspection (pre-migration bootstrap).
187
- */
188
- export declare function checkPMOExists(dbPath: string): {
189
- exists: boolean;
190
- projectCount: number;
191
- ticketCount: number;
192
- };
193
- /**
194
- * Get a PMO setting from the pmo_settings table.
195
- * Used for bootstrapping queries before storage layer is available.
196
- * Raw SQL: pre-migration bootstrap query.
197
- */
198
- export declare function getPMOSetting(dbPath: string, key: string): string | null;
199
- /**
200
- * Drop PMO tables from the database.
201
- * Used during PMO reinitialization.
202
- * Raw SQL: DDL operations (DROP TABLE) are not supported by Drizzle.
203
- */
204
- export declare function dropPMOTables(dbPath: string, tables: string[]): void;
205
- /**
206
- * Get all themes
207
- */
208
- export declare function getThemes(workspacePath: string): AgentTheme[];
209
- /**
210
- * Get a theme by ID
211
- */
212
- export declare function getTheme(workspacePath: string, themeId: string): AgentTheme | null;
213
- /**
214
- * Create a new theme
215
- */
216
- export declare function createTheme(workspacePath: string, theme: {
217
- id: string;
218
- name: string;
219
- displayName: string;
220
- description?: string;
221
- builtin?: boolean;
222
- }): AgentTheme;
223
- /**
224
- * Delete a theme (cannot delete builtin themes)
225
- */
226
- export declare function deleteTheme(workspacePath: string, themeId: string): boolean;
227
- /**
228
- * Get names for a theme
229
- */
230
- export declare function getThemeNames(workspacePath: string, themeId: string): AgentThemeName[];
231
- /**
232
- * Get available names for a theme.
233
- * A name is available if:
234
- * 1. No staff agent exists in the database with that name (case-insensitive), OR
235
- * 2. The agent exists but its worktree directory is missing (manually deleted)
236
- */
237
- export declare function getAvailableThemeNames(workspacePath: string, themeId: string): string[];
238
- /**
239
- * Add names to a theme (case-insensitive uniqueness)
240
- */
241
- export declare function addThemeNames(workspacePath: string, themeId: string, names: string[]): void;
242
- export interface MediaItem {
243
- name: string;
244
- path: string;
245
- source_path: string | null;
246
- media_type: 'video' | 'audio';
247
- duration_seconds: number | null;
248
- resolution: string | null;
249
- frame_count: number;
250
- has_transcript: boolean;
251
- frame_interval: number;
252
- status: 'pending' | 'processing' | 'ready' | 'error';
253
- error_message: string | null;
254
- added_at: string;
255
- processed_at: string | null;
256
- }
257
- /**
258
- * Add a media item to the database
259
- */
260
- export declare function addMediaItemToDatabase(workspacePath: string, item: {
261
- name: string;
262
- path: string;
263
- source_path?: string;
264
- media_type: 'video' | 'audio';
265
- frame_interval?: number;
266
- }): void;
267
- /**
268
- * Update media item after preprocessing
269
- */
270
- export declare function updateMediaItemStatus(workspacePath: string, name: string, updates: {
271
- status: 'pending' | 'processing' | 'ready' | 'error';
272
- duration_seconds?: number;
273
- resolution?: string;
274
- frame_count?: number;
275
- has_transcript?: boolean;
276
- error_message?: string;
277
- }): void;
278
- /**
279
- * Get all media items in workspace
280
- */
281
- export declare function getWorkspaceMediaItems(workspacePath: string): MediaItem[];
282
- /**
283
- * Get a single media item by name
284
- */
285
- export declare function getMediaItem(workspacePath: string, name: string): MediaItem | null;
286
- /**
287
- * Remove a media item from the database
288
- */
289
- export declare function removeMediaItemFromDatabase(workspacePath: string, name: string): void;
18
+ export { CREATE_TABLES_SQL } from './workspace-schema.js';
19
+ export { type WorkspaceConfig, withDrizzle, getDatabasePath, getConfigPath, openWorkspaceDatabase, openWorkspaceDriver, createWorkspaceDatabase, getWorkspaceConfig, } from './workspace.js';
20
+ export { type AgentType, type AgentStatus, type MountMode, type Agent, type DiscoverResult, addAgentsToDatabase, addEphemeralAgentToDatabase, tryAddEphemeralAgentToDatabase, getEphemeralAgentNames, removeEphemeralAgent, getWorkspaceAgents, getAgentByPath, markAgentCleaned, syncAgentsWithDisk, discoverAgentsOnDisk, removeAgentsFromDatabase, } from './agents.js';
21
+ export { type Repository, addRepositoriesToDatabase, getWorkspaceRepositories, } from './repositories.js';
22
+ export { type AgentTheme, type AgentThemeName, getActiveTheme, setActiveTheme, getThemes, getTheme, createTheme, deleteTheme, getThemeNames, getAvailableThemeNames, addThemeNames, } from './themes.js';
23
+ export { type AgentWorktree, getAgentWorktrees, findWorktreesByBranch, getWorktreesForRepo, } from './worktrees.js';
24
+ export { type MediaItem, addMediaItemToDatabase, updateMediaItemStatus, getWorkspaceMediaItems, getMediaItem, removeMediaItemFromDatabase, } from './media.js';
25
+ export { checkPMOExists, getPMOSetting, dropPMOTables, upsertWorkspaceSetting, } from './pmo-bootstrap.js';
26
+ export { type DatabaseDriver, type PreparedStatement, type RunResult, BetterSqlite3Driver, wrapDatabase, openDriver, getRawDatabase, } from './driver.js';
27
+ export { SettingsStore, createSettingsStore, } from './settings-store.js';