sessioncast-cli 2.0.2 → 2.0.3

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 (45) hide show
  1. package/dist/agent/runner.js +23 -0
  2. package/dist/agent/session-handler.d.ts +1 -2
  3. package/dist/agent/session-handler.js +34 -79
  4. package/dist/agent/tmux-executor.d.ts +3 -33
  5. package/dist/agent/tmux-executor.js +3 -50
  6. package/dist/agent/tmux.d.ts +2 -6
  7. package/dist/agent/tmux.js +2 -9
  8. package/dist/agent/types.d.ts +0 -10
  9. package/dist/agent/websocket.d.ts +2 -21
  10. package/dist/agent/websocket.js +10 -46
  11. package/dist/commands/agent.js +3 -0
  12. package/dist/index.js +14 -0
  13. package/dist/sentry.d.ts +4 -0
  14. package/dist/sentry.js +87 -0
  15. package/package.json +2 -1
  16. package/dist/autopilot/index.d.ts +0 -94
  17. package/dist/autopilot/index.js +0 -322
  18. package/dist/autopilot/mission-analyzer.d.ts +0 -27
  19. package/dist/autopilot/mission-analyzer.js +0 -232
  20. package/dist/autopilot/project-detector.d.ts +0 -12
  21. package/dist/autopilot/project-detector.js +0 -326
  22. package/dist/autopilot/source-scanner.d.ts +0 -26
  23. package/dist/autopilot/source-scanner.js +0 -285
  24. package/dist/autopilot/speckit-generator.d.ts +0 -60
  25. package/dist/autopilot/speckit-generator.js +0 -511
  26. package/dist/autopilot/types.d.ts +0 -110
  27. package/dist/autopilot/types.js +0 -6
  28. package/dist/autopilot/workflow-generator.d.ts +0 -33
  29. package/dist/autopilot/workflow-generator.js +0 -278
  30. package/dist/commands/autopilot.d.ts +0 -30
  31. package/dist/commands/autopilot.js +0 -262
  32. package/dist/commands/project.d.ts +0 -33
  33. package/dist/commands/project.js +0 -350
  34. package/dist/project/executor.d.ts +0 -73
  35. package/dist/project/executor.js +0 -437
  36. package/dist/project/index.d.ts +0 -4
  37. package/dist/project/index.js +0 -20
  38. package/dist/project/manager.d.ts +0 -66
  39. package/dist/project/manager.js +0 -290
  40. package/dist/project/relay-client.d.ts +0 -37
  41. package/dist/project/relay-client.js +0 -204
  42. package/dist/project/types.d.ts +0 -48
  43. package/dist/project/types.js +0 -3
  44. package/dist/utils/fileUtils.d.ts +0 -28
  45. package/dist/utils/fileUtils.js +0 -159
@@ -1,285 +0,0 @@
1
- "use strict";
2
- /**
3
- * SourceScanner - Scan and collect relevant source files for context
4
- */
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || (function () {
22
- var ownKeys = function(o) {
23
- ownKeys = Object.getOwnPropertyNames || function (o) {
24
- var ar = [];
25
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
- return ar;
27
- };
28
- return ownKeys(o);
29
- };
30
- return function (mod) {
31
- if (mod && mod.__esModule) return mod;
32
- var result = {};
33
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
- __setModuleDefault(result, mod);
35
- return result;
36
- };
37
- })();
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.scanSources = scanSources;
40
- exports.readSourceContent = readSourceContent;
41
- exports.getSourcesSummary = getSourcesSummary;
42
- exports.getKeyFilesContent = getKeyFilesContent;
43
- const fs = __importStar(require("fs"));
44
- const path = __importStar(require("path"));
45
- const DEFAULT_OPTIONS = {
46
- maxFiles: 50,
47
- maxFileSize: 100 * 1024, // 100KB
48
- includeTests: false
49
- };
50
- // File extensions by project type
51
- const LANGUAGE_EXTENSIONS = {
52
- kotlin: ['.kt', '.kts'],
53
- java: ['.java'],
54
- swift: ['.swift'],
55
- typescript: ['.ts', '.tsx'],
56
- javascript: ['.js', '.jsx'],
57
- python: ['.py'],
58
- go: ['.go'],
59
- rust: ['.rs']
60
- };
61
- // Config file patterns
62
- const CONFIG_PATTERNS = [
63
- 'package.json',
64
- 'tsconfig.json',
65
- 'build.gradle',
66
- 'build.gradle.kts',
67
- 'settings.gradle',
68
- 'settings.gradle.kts',
69
- 'pom.xml',
70
- 'Cargo.toml',
71
- 'go.mod',
72
- 'pyproject.toml',
73
- 'requirements.txt',
74
- 'Podfile',
75
- '.env.example',
76
- 'docker-compose.yml',
77
- 'Dockerfile'
78
- ];
79
- // Directories to skip
80
- const SKIP_DIRS = new Set([
81
- 'node_modules',
82
- '.git',
83
- '.gradle',
84
- 'build',
85
- 'dist',
86
- '__pycache__',
87
- '.idea',
88
- '.vscode',
89
- 'target',
90
- '.next',
91
- 'venv',
92
- 'env',
93
- '.pytest_cache',
94
- 'coverage',
95
- '.nyc_output',
96
- 'Pods',
97
- '.build',
98
- 'DerivedData'
99
- ]);
100
- // Test patterns
101
- const TEST_PATTERNS = [
102
- /\.test\.[jt]sx?$/,
103
- /\.spec\.[jt]sx?$/,
104
- /_test\.go$/,
105
- /test_.*\.py$/,
106
- /.*_test\.py$/,
107
- /Test\.java$/,
108
- /Test\.kt$/,
109
- /Tests\.swift$/
110
- ];
111
- /**
112
- * Scan directory for source files
113
- */
114
- async function scanSources(dir, projectType, options = {}) {
115
- const opts = { ...DEFAULT_OPTIONS, ...options };
116
- const sources = [];
117
- const mainLanguage = getMainLanguage(projectType);
118
- const extensions = getExtensionsForProject(projectType);
119
- await walkDir(dir, dir, sources, extensions, opts);
120
- // Sort by importance: config files first, then by size (smaller = more likely to be important)
121
- sources.sort((a, b) => {
122
- if (a.type === 'config' && b.type !== 'config')
123
- return -1;
124
- if (a.type !== 'config' && b.type === 'config')
125
- return 1;
126
- return a.size - b.size;
127
- });
128
- // Limit number of files
129
- return sources.slice(0, opts.maxFiles);
130
- }
131
- /**
132
- * Get main language for project type
133
- */
134
- function getMainLanguage(projectType) {
135
- const languageMap = {
136
- android: 'kotlin',
137
- ios: 'swift',
138
- react: 'typescript',
139
- next: 'typescript',
140
- vue: 'typescript',
141
- node: 'javascript',
142
- python: 'python',
143
- spring: 'java',
144
- go: 'go',
145
- rust: 'rust',
146
- unknown: 'javascript'
147
- };
148
- return languageMap[projectType];
149
- }
150
- /**
151
- * Get file extensions for project type
152
- */
153
- function getExtensionsForProject(projectType) {
154
- const mainLang = getMainLanguage(projectType);
155
- const extensions = [...(LANGUAGE_EXTENSIONS[mainLang] || [])];
156
- // Add related extensions
157
- if (projectType === 'android') {
158
- extensions.push(...LANGUAGE_EXTENSIONS.java, '.xml');
159
- }
160
- if (['react', 'next', 'vue', 'node'].includes(projectType)) {
161
- extensions.push(...LANGUAGE_EXTENSIONS.javascript);
162
- }
163
- return extensions;
164
- }
165
- /**
166
- * Recursively walk directory
167
- */
168
- async function walkDir(rootDir, currentDir, sources, extensions, options) {
169
- try {
170
- const entries = fs.readdirSync(currentDir, { withFileTypes: true });
171
- for (const entry of entries) {
172
- const fullPath = path.join(currentDir, entry.name);
173
- const relativePath = path.relative(rootDir, fullPath);
174
- if (entry.isDirectory()) {
175
- if (!SKIP_DIRS.has(entry.name)) {
176
- await walkDir(rootDir, fullPath, sources, extensions, options);
177
- }
178
- }
179
- else if (entry.isFile()) {
180
- const ext = path.extname(entry.name);
181
- const isConfig = CONFIG_PATTERNS.includes(entry.name);
182
- const isSource = extensions.includes(ext);
183
- const isTest = TEST_PATTERNS.some(p => p.test(entry.name));
184
- // Skip tests unless explicitly included
185
- if (isTest && !options.includeTests)
186
- continue;
187
- if (isConfig || isSource) {
188
- try {
189
- const stats = fs.statSync(fullPath);
190
- // Skip files that are too large
191
- if (stats.size > (options.maxFileSize || DEFAULT_OPTIONS.maxFileSize)) {
192
- continue;
193
- }
194
- sources.push({
195
- path: fullPath,
196
- relativePath,
197
- type: getFileType(entry.name, isConfig, isTest),
198
- language: getLanguageFromExtension(ext),
199
- size: stats.size
200
- });
201
- }
202
- catch {
203
- // Skip files we can't stat
204
- }
205
- }
206
- }
207
- }
208
- }
209
- catch {
210
- // Ignore directory read errors
211
- }
212
- }
213
- /**
214
- * Determine file type
215
- */
216
- function getFileType(filename, isConfig, isTest) {
217
- if (isConfig)
218
- return 'config';
219
- if (isTest)
220
- return 'test';
221
- if (filename.endsWith('.md') || filename.endsWith('.txt'))
222
- return 'doc';
223
- return 'code';
224
- }
225
- /**
226
- * Get language from file extension
227
- */
228
- function getLanguageFromExtension(ext) {
229
- for (const [lang, exts] of Object.entries(LANGUAGE_EXTENSIONS)) {
230
- if (exts.includes(ext))
231
- return lang;
232
- }
233
- return undefined;
234
- }
235
- /**
236
- * Read source file content (for LLM context)
237
- */
238
- function readSourceContent(source) {
239
- try {
240
- return fs.readFileSync(source.path, 'utf-8');
241
- }
242
- catch {
243
- return null;
244
- }
245
- }
246
- /**
247
- * Get condensed context for LLM (file list with sizes)
248
- */
249
- function getSourcesSummary(sources) {
250
- const lines = ['Scanned source files:'];
251
- const byType = new Map();
252
- for (const source of sources) {
253
- const list = byType.get(source.type) || [];
254
- list.push(source);
255
- byType.set(source.type, list);
256
- }
257
- for (const [type, files] of byType) {
258
- lines.push(`\n[${type.toUpperCase()}]`);
259
- for (const file of files) {
260
- const sizeKB = (file.size / 1024).toFixed(1);
261
- lines.push(` ${file.relativePath} (${sizeKB}KB)`);
262
- }
263
- }
264
- return lines.join('\n');
265
- }
266
- /**
267
- * Get key files content for deep analysis
268
- */
269
- function getKeyFilesContent(sources, maxTotalSize = 50000) {
270
- const content = [];
271
- let totalSize = 0;
272
- // Prioritize config files
273
- const configFiles = sources.filter(s => s.type === 'config');
274
- const codeFiles = sources.filter(s => s.type === 'code');
275
- for (const source of [...configFiles, ...codeFiles]) {
276
- if (totalSize >= maxTotalSize)
277
- break;
278
- const fileContent = readSourceContent(source);
279
- if (fileContent && totalSize + fileContent.length <= maxTotalSize) {
280
- content.push(`\n--- ${source.relativePath} ---\n${fileContent}`);
281
- totalSize += fileContent.length;
282
- }
283
- }
284
- return content.join('\n');
285
- }
@@ -1,60 +0,0 @@
1
- /**
2
- * Speckit Generator - Convert AutoPilot workflow to Speckit format
3
- *
4
- * Speckit is a structured markdown format for development plans:
5
- * - plan.md: Technical context, goals, architecture decisions
6
- * - tasks.md: Step-by-step task list with T-x.y IDs, dependencies, validation
7
- *
8
- * Reference: https://github.com/devload/claude-planflow-skills
9
- */
10
- import { AutoPilotContext, ProjectType } from './types';
11
- /**
12
- * Speckit output structure
13
- */
14
- export interface SpeckitOutput {
15
- featureName: string;
16
- planMd: string;
17
- tasksMd: string;
18
- outputDir: string;
19
- }
20
- /**
21
- * Task in Speckit format
22
- */
23
- export interface SpeckitTask {
24
- id: string;
25
- phase: number;
26
- sequence: number;
27
- title: string;
28
- description: string;
29
- files: string[];
30
- dependencies: string[];
31
- validation: string;
32
- parallel: boolean;
33
- }
34
- /**
35
- * Phase grouping
36
- */
37
- export interface SpeckitPhase {
38
- number: number;
39
- name: string;
40
- tasks: SpeckitTask[];
41
- }
42
- /**
43
- * Generate Speckit files from AutoPilot context
44
- */
45
- export declare function generateSpeckit(context: AutoPilotContext): SpeckitOutput;
46
- /**
47
- * Save Speckit files to disk
48
- */
49
- export declare function saveSpeckit(speckit: SpeckitOutput): {
50
- planPath: string;
51
- tasksPath: string;
52
- };
53
- /**
54
- * Quick Speckit generation from just a prompt (without full analysis)
55
- */
56
- export declare function generateQuickSpeckit(prompt: string, context: {
57
- projectType: ProjectType;
58
- projectName: string;
59
- workingDir: string;
60
- }): SpeckitOutput;