episoda 0.2.3 → 0.2.7

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 (113) hide show
  1. package/dist/index.d.ts +0 -7
  2. package/dist/index.js +3736 -80
  3. package/dist/index.js.map +1 -1
  4. package/package.json +5 -3
  5. package/dist/commands/auth.d.ts +0 -22
  6. package/dist/commands/auth.d.ts.map +0 -1
  7. package/dist/commands/auth.js +0 -384
  8. package/dist/commands/auth.js.map +0 -1
  9. package/dist/commands/dev.d.ts +0 -20
  10. package/dist/commands/dev.d.ts.map +0 -1
  11. package/dist/commands/dev.js +0 -305
  12. package/dist/commands/dev.js.map +0 -1
  13. package/dist/commands/status.d.ts +0 -9
  14. package/dist/commands/status.d.ts.map +0 -1
  15. package/dist/commands/status.js +0 -75
  16. package/dist/commands/status.js.map +0 -1
  17. package/dist/commands/stop.d.ts +0 -17
  18. package/dist/commands/stop.d.ts.map +0 -1
  19. package/dist/commands/stop.js +0 -81
  20. package/dist/commands/stop.js.map +0 -1
  21. package/dist/core/auth.d.ts +0 -26
  22. package/dist/core/auth.d.ts.map +0 -1
  23. package/dist/core/auth.js +0 -113
  24. package/dist/core/auth.js.map +0 -1
  25. package/dist/core/command-protocol.d.ts +0 -262
  26. package/dist/core/command-protocol.d.ts.map +0 -1
  27. package/dist/core/command-protocol.js +0 -13
  28. package/dist/core/command-protocol.js.map +0 -1
  29. package/dist/core/connection-manager.d.ts +0 -58
  30. package/dist/core/connection-manager.d.ts.map +0 -1
  31. package/dist/core/connection-manager.js +0 -215
  32. package/dist/core/connection-manager.js.map +0 -1
  33. package/dist/core/errors.d.ts +0 -18
  34. package/dist/core/errors.d.ts.map +0 -1
  35. package/dist/core/errors.js +0 -55
  36. package/dist/core/errors.js.map +0 -1
  37. package/dist/core/git-executor.d.ts +0 -157
  38. package/dist/core/git-executor.d.ts.map +0 -1
  39. package/dist/core/git-executor.js +0 -1605
  40. package/dist/core/git-executor.js.map +0 -1
  41. package/dist/core/git-parser.d.ts +0 -40
  42. package/dist/core/git-parser.d.ts.map +0 -1
  43. package/dist/core/git-parser.js +0 -194
  44. package/dist/core/git-parser.js.map +0 -1
  45. package/dist/core/git-validator.d.ts +0 -42
  46. package/dist/core/git-validator.d.ts.map +0 -1
  47. package/dist/core/git-validator.js +0 -102
  48. package/dist/core/git-validator.js.map +0 -1
  49. package/dist/core/index.d.ts +0 -17
  50. package/dist/core/index.d.ts.map +0 -1
  51. package/dist/core/index.js +0 -41
  52. package/dist/core/index.js.map +0 -1
  53. package/dist/core/version.d.ts +0 -9
  54. package/dist/core/version.d.ts.map +0 -1
  55. package/dist/core/version.js +0 -19
  56. package/dist/core/version.js.map +0 -1
  57. package/dist/core/websocket-client.d.ts +0 -122
  58. package/dist/core/websocket-client.d.ts.map +0 -1
  59. package/dist/core/websocket-client.js +0 -438
  60. package/dist/core/websocket-client.js.map +0 -1
  61. package/dist/daemon/daemon-manager.d.ts +0 -71
  62. package/dist/daemon/daemon-manager.d.ts.map +0 -1
  63. package/dist/daemon/daemon-manager.js +0 -289
  64. package/dist/daemon/daemon-manager.js.map +0 -1
  65. package/dist/daemon/daemon-process.d.ts +0 -13
  66. package/dist/daemon/daemon-process.d.ts.map +0 -1
  67. package/dist/daemon/daemon-process.js +0 -624
  68. package/dist/daemon/daemon-process.js.map +0 -1
  69. package/dist/daemon/identity-server.d.ts +0 -51
  70. package/dist/daemon/identity-server.d.ts.map +0 -1
  71. package/dist/daemon/identity-server.js +0 -158
  72. package/dist/daemon/identity-server.js.map +0 -1
  73. package/dist/daemon/machine-id.d.ts +0 -36
  74. package/dist/daemon/machine-id.d.ts.map +0 -1
  75. package/dist/daemon/machine-id.js +0 -195
  76. package/dist/daemon/machine-id.js.map +0 -1
  77. package/dist/daemon/project-tracker.d.ts +0 -92
  78. package/dist/daemon/project-tracker.d.ts.map +0 -1
  79. package/dist/daemon/project-tracker.js +0 -259
  80. package/dist/daemon/project-tracker.js.map +0 -1
  81. package/dist/dev-wrapper.d.ts +0 -88
  82. package/dist/dev-wrapper.d.ts.map +0 -1
  83. package/dist/dev-wrapper.js +0 -288
  84. package/dist/dev-wrapper.js.map +0 -1
  85. package/dist/framework-detector.d.ts +0 -29
  86. package/dist/framework-detector.d.ts.map +0 -1
  87. package/dist/framework-detector.js +0 -276
  88. package/dist/framework-detector.js.map +0 -1
  89. package/dist/git-helpers/git-credential-helper.d.ts +0 -29
  90. package/dist/git-helpers/git-credential-helper.d.ts.map +0 -1
  91. package/dist/git-helpers/git-credential-helper.js +0 -349
  92. package/dist/git-helpers/git-credential-helper.js.map +0 -1
  93. package/dist/index.d.ts.map +0 -1
  94. package/dist/ipc/ipc-client.d.ts +0 -95
  95. package/dist/ipc/ipc-client.d.ts.map +0 -1
  96. package/dist/ipc/ipc-client.js +0 -204
  97. package/dist/ipc/ipc-client.js.map +0 -1
  98. package/dist/ipc/ipc-server.d.ts +0 -55
  99. package/dist/ipc/ipc-server.d.ts.map +0 -1
  100. package/dist/ipc/ipc-server.js +0 -177
  101. package/dist/ipc/ipc-server.js.map +0 -1
  102. package/dist/output.d.ts +0 -48
  103. package/dist/output.d.ts.map +0 -1
  104. package/dist/output.js +0 -129
  105. package/dist/output.js.map +0 -1
  106. package/dist/utils/port-check.d.ts +0 -15
  107. package/dist/utils/port-check.d.ts.map +0 -1
  108. package/dist/utils/port-check.js +0 -79
  109. package/dist/utils/port-check.js.map +0 -1
  110. package/dist/utils/update-checker.d.ts +0 -23
  111. package/dist/utils/update-checker.d.ts.map +0 -1
  112. package/dist/utils/update-checker.js +0 -95
  113. package/dist/utils/update-checker.js.map +0 -1
@@ -1,51 +0,0 @@
1
- /**
2
- * Identity Server (EP803)
3
- *
4
- * A minimal HTTP server that runs on localhost:3002 to provide
5
- * machine identity information to browser clients.
6
- *
7
- * This solves the multi-device identity problem where broadcast-based
8
- * identity detection could incorrectly assign a different device's
9
- * machineId to the browser.
10
- *
11
- * Security:
12
- * - Binds ONLY to 127.0.0.1 (localhost)
13
- * - No external network access
14
- * - Read-only endpoint (GET only)
15
- */
16
- /** Default port for identity server */
17
- export declare const IDENTITY_SERVER_PORT = 3002;
18
- /** Response from /identity endpoint */
19
- export interface IdentityResponse {
20
- machineId: string;
21
- hostname: string;
22
- platform: string;
23
- arch: string;
24
- connected: boolean;
25
- }
26
- /**
27
- * Identity HTTP Server
28
- *
29
- * Exposes a single endpoint:
30
- * GET /identity - Returns machine identity information
31
- */
32
- export declare class IdentityServer {
33
- private server;
34
- private machineId;
35
- private isConnected;
36
- constructor(machineId: string);
37
- /**
38
- * Update connection status
39
- * Called when WebSocket connection state changes
40
- */
41
- setConnected(connected: boolean): void;
42
- /**
43
- * Start the identity server on localhost:3002
44
- */
45
- start(): Promise<void>;
46
- /**
47
- * Stop the identity server
48
- */
49
- stop(): Promise<void>;
50
- }
51
- //# sourceMappingURL=identity-server.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"identity-server.d.ts","sourceRoot":"","sources":["../../src/daemon/identity-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,uCAAuC;AACvC,eAAO,MAAM,oBAAoB,OAAO,CAAA;AAExC,uCAAuC;AACvC,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;CACnB;AAED;;;;;GAKG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAA2B;IACzC,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,WAAW,CAAiB;gBAExB,SAAS,EAAE,MAAM;IAI7B;;;OAGG;IACH,YAAY,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI;IAItC;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAqE5B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAa5B"}
@@ -1,158 +0,0 @@
1
- "use strict";
2
- /**
3
- * Identity Server (EP803)
4
- *
5
- * A minimal HTTP server that runs on localhost:3002 to provide
6
- * machine identity information to browser clients.
7
- *
8
- * This solves the multi-device identity problem where broadcast-based
9
- * identity detection could incorrectly assign a different device's
10
- * machineId to the browser.
11
- *
12
- * Security:
13
- * - Binds ONLY to 127.0.0.1 (localhost)
14
- * - No external network access
15
- * - Read-only endpoint (GET only)
16
- */
17
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- var desc = Object.getOwnPropertyDescriptor(m, k);
20
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
- desc = { enumerable: true, get: function() { return m[k]; } };
22
- }
23
- Object.defineProperty(o, k2, desc);
24
- }) : (function(o, m, k, k2) {
25
- if (k2 === undefined) k2 = k;
26
- o[k2] = m[k];
27
- }));
28
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
29
- Object.defineProperty(o, "default", { enumerable: true, value: v });
30
- }) : function(o, v) {
31
- o["default"] = v;
32
- });
33
- var __importStar = (this && this.__importStar) || (function () {
34
- var ownKeys = function(o) {
35
- ownKeys = Object.getOwnPropertyNames || function (o) {
36
- var ar = [];
37
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
38
- return ar;
39
- };
40
- return ownKeys(o);
41
- };
42
- return function (mod) {
43
- if (mod && mod.__esModule) return mod;
44
- var result = {};
45
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
46
- __setModuleDefault(result, mod);
47
- return result;
48
- };
49
- })();
50
- Object.defineProperty(exports, "__esModule", { value: true });
51
- exports.IdentityServer = exports.IDENTITY_SERVER_PORT = void 0;
52
- const http = __importStar(require("http"));
53
- const os = __importStar(require("os"));
54
- /** Default port for identity server */
55
- exports.IDENTITY_SERVER_PORT = 3002;
56
- /**
57
- * Identity HTTP Server
58
- *
59
- * Exposes a single endpoint:
60
- * GET /identity - Returns machine identity information
61
- */
62
- class IdentityServer {
63
- constructor(machineId) {
64
- this.server = null;
65
- this.isConnected = false;
66
- this.machineId = machineId;
67
- }
68
- /**
69
- * Update connection status
70
- * Called when WebSocket connection state changes
71
- */
72
- setConnected(connected) {
73
- this.isConnected = connected;
74
- }
75
- /**
76
- * Start the identity server on localhost:3002
77
- */
78
- async start() {
79
- return new Promise((resolve, reject) => {
80
- this.server = http.createServer((req, res) => {
81
- // CORS headers for browser access
82
- res.setHeader('Access-Control-Allow-Origin', '*');
83
- res.setHeader('Access-Control-Allow-Methods', 'GET, OPTIONS');
84
- res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
85
- // Handle preflight
86
- if (req.method === 'OPTIONS') {
87
- res.writeHead(204);
88
- res.end();
89
- return;
90
- }
91
- // Only allow GET requests
92
- if (req.method !== 'GET') {
93
- res.writeHead(405, { 'Content-Type': 'application/json' });
94
- res.end(JSON.stringify({ error: 'Method not allowed' }));
95
- return;
96
- }
97
- // Route handling
98
- const url = new URL(req.url || '/', `http://${req.headers.host}`);
99
- if (url.pathname === '/identity') {
100
- const response = {
101
- machineId: this.machineId,
102
- hostname: os.hostname(),
103
- platform: os.platform(),
104
- arch: os.arch(),
105
- connected: this.isConnected,
106
- };
107
- res.writeHead(200, { 'Content-Type': 'application/json' });
108
- res.end(JSON.stringify(response));
109
- return;
110
- }
111
- // Health check endpoint
112
- if (url.pathname === '/health') {
113
- res.writeHead(200, { 'Content-Type': 'application/json' });
114
- res.end(JSON.stringify({ status: 'ok', machineId: this.machineId }));
115
- return;
116
- }
117
- // 404 for unknown routes
118
- res.writeHead(404, { 'Content-Type': 'application/json' });
119
- res.end(JSON.stringify({ error: 'Not found' }));
120
- });
121
- // Bind to localhost only for security
122
- this.server.listen(exports.IDENTITY_SERVER_PORT, '127.0.0.1', () => {
123
- console.log(`[IdentityServer] Started on http://127.0.0.1:${exports.IDENTITY_SERVER_PORT}`);
124
- resolve();
125
- });
126
- this.server.on('error', (err) => {
127
- if (err.code === 'EADDRINUSE') {
128
- // Port already in use - likely another daemon instance
129
- console.warn(`[IdentityServer] Port ${exports.IDENTITY_SERVER_PORT} already in use, skipping`);
130
- resolve(); // Don't fail - another instance may be running
131
- }
132
- else {
133
- console.error('[IdentityServer] Failed to start:', err.message);
134
- reject(err);
135
- }
136
- });
137
- });
138
- }
139
- /**
140
- * Stop the identity server
141
- */
142
- async stop() {
143
- return new Promise((resolve) => {
144
- if (this.server) {
145
- this.server.close(() => {
146
- console.log('[IdentityServer] Stopped');
147
- this.server = null;
148
- resolve();
149
- });
150
- }
151
- else {
152
- resolve();
153
- }
154
- });
155
- }
156
- }
157
- exports.IdentityServer = IdentityServer;
158
- //# sourceMappingURL=identity-server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"identity-server.js","sourceRoot":"","sources":["../../src/daemon/identity-server.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA4B;AAC5B,uCAAwB;AAExB,uCAAuC;AAC1B,QAAA,oBAAoB,GAAG,IAAI,CAAA;AAWxC;;;;;GAKG;AACH,MAAa,cAAc;IAKzB,YAAY,SAAiB;QAJrB,WAAM,GAAuB,IAAI,CAAA;QAEjC,gBAAW,GAAY,KAAK,CAAA;QAGlC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IAED;;;OAGG;IACH,YAAY,CAAC,SAAkB;QAC7B,IAAI,CAAC,WAAW,GAAG,SAAS,CAAA;IAC9B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK;QACT,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,EAAE,GAAG,EAA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,CAAA;oBAC/D,MAAM,CAAC,GAAG,CAAC,CAAA;gBACb,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC7B,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAChB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE;oBACrB,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;oBACvC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAA;oBAClB,OAAO,EAAE,CAAA;gBACX,CAAC,CAAC,CAAA;YACJ,CAAC;iBAAM,CAAC;gBACN,OAAO,EAAE,CAAA;YACX,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AAzGD,wCAyGC"}
@@ -1,36 +0,0 @@
1
- /**
2
- * Machine ID generation and management
3
- *
4
- * Generates a stable machine identifier used for multi-machine connection tracking.
5
- * Format: {hostname}-{hardware-uuid-prefix}
6
- * Example: "Alans-MacBook-Pro-a3f2b1c4"
7
- *
8
- * EP731: Uses hardware UUID instead of random UUID to prevent duplicate device
9
- * registrations when ~/.episoda syncs between devices via iCloud/Dropbox.
10
- *
11
- * Properties:
12
- * - Stable across daemon restarts
13
- * - Unique per PHYSICAL machine (uses hardware UUID)
14
- * - Human-readable (includes hostname)
15
- * - Survives OS reboots
16
- * - Cannot sync between devices (hardware-based)
17
- */
18
- /**
19
- * Get or generate machine ID
20
- *
21
- * Reads from config directory's machine-id if exists, otherwise generates new one
22
- * and saves it for future use.
23
- *
24
- * @returns Machine ID string
25
- */
26
- export declare function getMachineId(): Promise<string>;
27
- /**
28
- * Reset machine ID (force regeneration)
29
- *
30
- * Deletes the stored machine ID file, forcing a new ID to be generated
31
- * on next getMachineId() call.
32
- *
33
- * Use case: Developer explicitly wants to change their machine identity
34
- */
35
- export declare function resetMachineId(): void;
36
- //# sourceMappingURL=machine-id.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"machine-id.d.ts","sourceRoot":"","sources":["../../src/daemon/machine-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AASH;;;;;;;GAOG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CA+BpD;AAkFD;;;;;;;GAOG;AACH,wBAAgB,cAAc,IAAI,IAAI,CASrC"}
@@ -1,195 +0,0 @@
1
- "use strict";
2
- /**
3
- * Machine ID generation and management
4
- *
5
- * Generates a stable machine identifier used for multi-machine connection tracking.
6
- * Format: {hostname}-{hardware-uuid-prefix}
7
- * Example: "Alans-MacBook-Pro-a3f2b1c4"
8
- *
9
- * EP731: Uses hardware UUID instead of random UUID to prevent duplicate device
10
- * registrations when ~/.episoda syncs between devices via iCloud/Dropbox.
11
- *
12
- * Properties:
13
- * - Stable across daemon restarts
14
- * - Unique per PHYSICAL machine (uses hardware UUID)
15
- * - Human-readable (includes hostname)
16
- * - Survives OS reboots
17
- * - Cannot sync between devices (hardware-based)
18
- */
19
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
20
- if (k2 === undefined) k2 = k;
21
- var desc = Object.getOwnPropertyDescriptor(m, k);
22
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
23
- desc = { enumerable: true, get: function() { return m[k]; } };
24
- }
25
- Object.defineProperty(o, k2, desc);
26
- }) : (function(o, m, k, k2) {
27
- if (k2 === undefined) k2 = k;
28
- o[k2] = m[k];
29
- }));
30
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
31
- Object.defineProperty(o, "default", { enumerable: true, value: v });
32
- }) : function(o, v) {
33
- o["default"] = v;
34
- });
35
- var __importStar = (this && this.__importStar) || (function () {
36
- var ownKeys = function(o) {
37
- ownKeys = Object.getOwnPropertyNames || function (o) {
38
- var ar = [];
39
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
40
- return ar;
41
- };
42
- return ownKeys(o);
43
- };
44
- return function (mod) {
45
- if (mod && mod.__esModule) return mod;
46
- var result = {};
47
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
48
- __setModuleDefault(result, mod);
49
- return result;
50
- };
51
- })();
52
- Object.defineProperty(exports, "__esModule", { value: true });
53
- exports.getMachineId = getMachineId;
54
- exports.resetMachineId = resetMachineId;
55
- const os = __importStar(require("os"));
56
- const fs = __importStar(require("fs"));
57
- const path = __importStar(require("path"));
58
- const crypto = __importStar(require("crypto"));
59
- const child_process_1 = require("child_process");
60
- const core_1 = require("../core");
61
- /**
62
- * Get or generate machine ID
63
- *
64
- * Reads from config directory's machine-id if exists, otherwise generates new one
65
- * and saves it for future use.
66
- *
67
- * @returns Machine ID string
68
- */
69
- async function getMachineId() {
70
- const machineIdPath = path.join((0, core_1.getConfigDir)(), 'machine-id');
71
- // Try to read existing machine ID
72
- try {
73
- if (fs.existsSync(machineIdPath)) {
74
- const machineId = fs.readFileSync(machineIdPath, 'utf-8').trim();
75
- if (machineId) {
76
- return machineId;
77
- }
78
- }
79
- }
80
- catch (error) {
81
- // File doesn't exist or can't be read, generate new one
82
- }
83
- // Generate new machine ID
84
- const machineId = generateMachineId();
85
- // Save to file
86
- try {
87
- const dir = path.dirname(machineIdPath);
88
- if (!fs.existsSync(dir)) {
89
- fs.mkdirSync(dir, { recursive: true });
90
- }
91
- fs.writeFileSync(machineIdPath, machineId, 'utf-8');
92
- }
93
- catch (error) {
94
- console.error('Warning: Could not save machine ID to disk:', error);
95
- // Continue anyway - machine ID will be regenerated next time
96
- }
97
- return machineId;
98
- }
99
- /**
100
- * EP731: Get hardware UUID for the current machine
101
- *
102
- * Uses platform-specific methods to get a hardware identifier that is:
103
- * - Unique per physical machine
104
- * - Stable across reboots
105
- * - Cannot sync between devices
106
- *
107
- * Falls back to random UUID if hardware UUID cannot be obtained.
108
- *
109
- * @returns Hardware UUID string
110
- */
111
- function getHardwareUUID() {
112
- try {
113
- if (process.platform === 'darwin') {
114
- // macOS: Get IOPlatformUUID from ioreg
115
- const output = (0, child_process_1.execSync)('ioreg -d2 -c IOPlatformExpertDevice | awk -F\\" \'/IOPlatformUUID/{print $(NF-1)}\'', { encoding: 'utf-8', timeout: 5000 }).trim();
116
- if (output && output.length > 0) {
117
- return output;
118
- }
119
- }
120
- else if (process.platform === 'linux') {
121
- // Linux: Read /etc/machine-id
122
- if (fs.existsSync('/etc/machine-id')) {
123
- const machineId = fs.readFileSync('/etc/machine-id', 'utf-8').trim();
124
- if (machineId && machineId.length > 0) {
125
- return machineId;
126
- }
127
- }
128
- // Fallback: Try /var/lib/dbus/machine-id
129
- if (fs.existsSync('/var/lib/dbus/machine-id')) {
130
- const dbusId = fs.readFileSync('/var/lib/dbus/machine-id', 'utf-8').trim();
131
- if (dbusId && dbusId.length > 0) {
132
- return dbusId;
133
- }
134
- }
135
- }
136
- else if (process.platform === 'win32') {
137
- // Windows: Get UUID from wmic
138
- const output = (0, child_process_1.execSync)('wmic csproduct get uuid', {
139
- encoding: 'utf-8',
140
- timeout: 5000
141
- });
142
- const lines = output.trim().split('\n');
143
- if (lines.length >= 2) {
144
- const uuid = lines[1].trim();
145
- if (uuid && uuid.length > 0 && uuid !== 'UUID') {
146
- return uuid;
147
- }
148
- }
149
- }
150
- }
151
- catch (error) {
152
- // Hardware UUID retrieval failed, will fall back to random
153
- console.warn('Could not get hardware UUID, using random fallback:', error);
154
- }
155
- // Fallback: Generate random UUID
156
- return crypto.randomUUID();
157
- }
158
- /**
159
- * Generate a new machine ID
160
- *
161
- * EP731: Uses hardware UUID instead of random UUID to ensure uniqueness
162
- * per physical machine, even if ~/.episoda syncs between devices.
163
- *
164
- * Format: {hostname}-{8-char-hardware-uuid}
165
- * Example: "Alans-MacBook-Pro-a3f2b1c4"
166
- *
167
- * @returns Generated machine ID
168
- */
169
- function generateMachineId() {
170
- const hostname = os.hostname();
171
- const hwUUID = getHardwareUUID();
172
- // Take first 8 chars of hardware UUID (or hash it if it's a long UUID)
173
- const shortId = hwUUID.replace(/-/g, '').slice(0, 8).toLowerCase();
174
- return `${hostname}-${shortId}`;
175
- }
176
- /**
177
- * Reset machine ID (force regeneration)
178
- *
179
- * Deletes the stored machine ID file, forcing a new ID to be generated
180
- * on next getMachineId() call.
181
- *
182
- * Use case: Developer explicitly wants to change their machine identity
183
- */
184
- function resetMachineId() {
185
- const machineIdPath = path.join((0, core_1.getConfigDir)(), 'machine-id');
186
- try {
187
- if (fs.existsSync(machineIdPath)) {
188
- fs.unlinkSync(machineIdPath);
189
- }
190
- }
191
- catch (error) {
192
- throw new Error(`Failed to reset machine ID: ${error}`);
193
- }
194
- }
195
- //# sourceMappingURL=machine-id.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"machine-id.js","sourceRoot":"","sources":["../../src/daemon/machine-id.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBH,oCA+BC;AA0FD,wCASC;AAjJD,uCAAwB;AACxB,uCAAwB;AACxB,2CAA4B;AAC5B,+CAAgC;AAChC,iDAAwC;AACxC,kCAAsC;AAEtC;;;;;;;GAOG;AACI,KAAK,UAAU,YAAY;IAChC,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,IAAA,mBAAY,GAAE,EAAE,YAAY,CAAC,CAAA;IAE7D,kCAAkC;IAClC,IAAI,CAAC;QACH,IAAI,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;YACjC,MAAM,SAAS,GAAG,EAAE,CAAC,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAA;YAChE,IAAI,SAAS,EAAE,CAAC;gBACd,OAAO,SAAS,CAAA;YAClB,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,E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AC,QAAQ,EAAE,CAAA;IAC9B,MAAM,MAAM,GAAG,eAAe,EAAE,CAAA;IAChC,uEAAuE;IACvE,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;IAClE,OAAO,GAAG,QAAQ,IAAI,OAAO,EAAE,CAAA;AACjC,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,cAAc;IAC5B,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,IAAA,mBAAY,GAAE,EAAE,YAAY,CAAC,CAAA;IAC7D,IAAI,CAAC;QACH,IAAI,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;YACjC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;QAC9B,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,+BAA+B,KAAK,EAAE,CAAC,CAAA;IACzD,CAAC;AACH,CAAC"}
@@ -1,92 +0,0 @@
1
- /**
2
- * Project tracking for daemon
3
- *
4
- * Manages ~/.episoda/projects.json which tracks all projects
5
- * the daemon is monitoring.
6
- *
7
- * Format:
8
- * {
9
- * "projects": [
10
- * {
11
- * "id": "proj_abc123",
12
- * "path": "/Users/alan/Dev/my-project",
13
- * "name": "my-project",
14
- * "added_at": "2025-01-18T10:30:00.000Z",
15
- * "last_active": "2025-01-18T12:45:00.000Z"
16
- * }
17
- * ]
18
- * }
19
- */
20
- export interface TrackedProject {
21
- id: string;
22
- path: string;
23
- name: string;
24
- added_at: string;
25
- last_active: string;
26
- }
27
- /**
28
- * Add or update a project
29
- *
30
- * EP593: Now enforces one entry per projectId to prevent duplicate connections.
31
- * When adding a project:
32
- * - If same path exists, update last_active
33
- * - If same projectId exists with different path, REPLACE the old entry
34
- * (user wants git operations in the new directory)
35
- * - Otherwise, add new project
36
- *
37
- * @param projectId Supabase project ID
38
- * @param projectPath Absolute path to project
39
- * @returns The tracked project
40
- */
41
- export declare function addProject(projectId: string, projectPath: string): TrackedProject;
42
- /**
43
- * Remove a project
44
- *
45
- * @param projectPath Absolute path to project
46
- * @returns true if removed, false if not found
47
- */
48
- export declare function removeProject(projectPath: string): boolean;
49
- /**
50
- * Get a project by path
51
- *
52
- * @param projectPath Absolute path to project
53
- * @returns Project if found, null otherwise
54
- */
55
- export declare function getProject(projectPath: string): TrackedProject | null;
56
- /**
57
- * Get a project by ID
58
- *
59
- * @param projectId Supabase project ID
60
- * @returns Project if found, null otherwise
61
- */
62
- export declare function getProjectById(projectId: string): TrackedProject | null;
63
- /**
64
- * Get all tracked projects
65
- *
66
- * @returns Array of tracked projects
67
- */
68
- export declare function getAllProjects(): TrackedProject[];
69
- /**
70
- * Update last active timestamp for a project
71
- *
72
- * @param projectPath Absolute path to project
73
- */
74
- export declare function touchProject(projectPath: string): void;
75
- /**
76
- * Clean up stale projects
77
- *
78
- * Removes projects that:
79
- * - Haven't been active in N days
80
- * - Directory no longer exists
81
- *
82
- * @param maxAgeDays Maximum age in days (default: 30)
83
- * @returns Number of projects removed
84
- */
85
- export declare function cleanupStaleProjects(maxAgeDays?: number): number;
86
- /**
87
- * Clear all projects
88
- *
89
- * USE WITH CAUTION - removes all tracked projects
90
- */
91
- export declare function clearAllProjects(): void;
92
- //# sourceMappingURL=project-tracker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"project-tracker.d.ts","sourceRoot":"","sources":["../../src/daemon/project-tracker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;CACpB;AA6DD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,cAAc,CAyCjF;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAY1D;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAGrE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAGvE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,cAAc,EAAE,CAGjD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAQtD;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,GAAE,MAAW,GAAG,MAAM,CA2BpE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC"}