@sudocode-ai/cli 0.1.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 (41) hide show
  1. package/README.md +330 -0
  2. package/dist/cli/feedback-commands.d.ts +53 -0
  3. package/dist/cli/init-commands.d.ts +22 -0
  4. package/dist/cli/issue-commands.d.ts +45 -0
  5. package/dist/cli/query-commands.d.ts +18 -0
  6. package/dist/cli/reference-commands.d.ts +22 -0
  7. package/dist/cli/relationship-commands.d.ts +14 -0
  8. package/dist/cli/server-commands.d.ts +17 -0
  9. package/dist/cli/spec-commands.d.ts +38 -0
  10. package/dist/cli/status-commands.d.ts +17 -0
  11. package/dist/cli/sync-commands.d.ts +24 -0
  12. package/dist/cli/update-commands.d.ts +12 -0
  13. package/dist/cli.d.ts +6 -0
  14. package/dist/cli.js +196 -0
  15. package/dist/db.d.ts +21 -0
  16. package/dist/export.d.ts +79 -0
  17. package/dist/filename-generator.d.ts +30 -0
  18. package/dist/id-generator.d.ts +26 -0
  19. package/dist/import.d.ts +118 -0
  20. package/dist/index.d.ts +13 -0
  21. package/dist/index.js +189 -0
  22. package/dist/jsonl.d.ts +69 -0
  23. package/dist/markdown.d.ts +146 -0
  24. package/dist/migrations.d.ts +23 -0
  25. package/dist/operations/events.d.ts +53 -0
  26. package/dist/operations/feedback-anchors.d.ts +92 -0
  27. package/dist/operations/feedback.d.ts +76 -0
  28. package/dist/operations/index.d.ts +10 -0
  29. package/dist/operations/issues.d.ts +82 -0
  30. package/dist/operations/references.d.ts +34 -0
  31. package/dist/operations/relationships.d.ts +57 -0
  32. package/dist/operations/specs.d.ts +64 -0
  33. package/dist/operations/tags.d.ts +42 -0
  34. package/dist/operations/transactions.d.ts +41 -0
  35. package/dist/sync.d.ts +47 -0
  36. package/dist/test-schema.d.ts +5 -0
  37. package/dist/types.d.ts +7 -0
  38. package/dist/update-checker.d.ts +24 -0
  39. package/dist/version.d.ts +12 -0
  40. package/dist/watcher.d.ts +63 -0
  41. package/package.json +68 -0
@@ -0,0 +1,63 @@
1
+ /**
2
+ * File watcher for automatic synchronization
3
+ * Watches .sudocode directory for changes and triggers sync operations
4
+ */
5
+ import type Database from "better-sqlite3";
6
+ export interface WatcherOptions {
7
+ /**
8
+ * Database instance
9
+ */
10
+ db: Database.Database;
11
+ /**
12
+ * Base directory to watch (e.g., .sudocode)
13
+ */
14
+ baseDir: string;
15
+ /**
16
+ * Debounce delay in milliseconds (default: 2000)
17
+ */
18
+ debounceDelay?: number;
19
+ /**
20
+ * Callback for logging events
21
+ */
22
+ onLog?: (message: string) => void;
23
+ /**
24
+ * Callback for errors
25
+ */
26
+ onError?: (error: Error) => void;
27
+ /**
28
+ * Whether to ignore initial files (default: true)
29
+ * Set to false for testing to detect files created before watcher starts
30
+ */
31
+ ignoreInitial?: boolean;
32
+ /**
33
+ * Enable reverse sync (JSONL → Markdown) when JSONL files change (default: false)
34
+ * When enabled, changes to JSONL files will update both the database and markdown files
35
+ */
36
+ syncJSONLToMarkdown?: boolean;
37
+ }
38
+ export interface WatcherControl {
39
+ /**
40
+ * Stop watching files
41
+ */
42
+ stop: () => Promise<void>;
43
+ /**
44
+ * Get watcher statistics
45
+ */
46
+ getStats: () => WatcherStats;
47
+ }
48
+ export interface WatcherStats {
49
+ filesWatched: number;
50
+ changesPending: number;
51
+ changesProcessed: number;
52
+ errors: number;
53
+ }
54
+ /**
55
+ * Start watching files for changes
56
+ * Returns a control object to stop the watcher
57
+ */
58
+ export declare function startWatcher(options: WatcherOptions): WatcherControl;
59
+ /**
60
+ * Wait for termination signal and stop watcher gracefully
61
+ */
62
+ export declare function setupGracefulShutdown(control: WatcherControl): void;
63
+ //# sourceMappingURL=watcher.d.ts.map
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@sudocode-ai/cli",
3
+ "version": "0.1.0",
4
+ "description": "Git-native spec and issue management CLI for AI-assisted software development",
5
+ "main": "dist/index.js",
6
+ "type": "module",
7
+ "bin": {
8
+ "sudocode": "dist/cli.js",
9
+ "sdc": "dist/cli.js"
10
+ },
11
+ "scripts": {
12
+ "build": "node build.js",
13
+ "build:dev": "tsc",
14
+ "dev": "tsc --watch",
15
+ "test": "vitest",
16
+ "test:schema": "tsc && node dist/test-schema.js",
17
+ "clean": "rm -rf dist"
18
+ },
19
+ "keywords": [
20
+ "sudocode",
21
+ "cli",
22
+ "specs",
23
+ "issues",
24
+ "ai-assisted-development",
25
+ "git-native",
26
+ "project-management"
27
+ ],
28
+ "author": "sudocode AI",
29
+ "license": "Apache-2.0",
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "git+https://github.com/sudocode-ai/sudocode.git",
33
+ "directory": "cli"
34
+ },
35
+ "homepage": "https://sudocode.ai",
36
+ "bugs": {
37
+ "url": "https://github.com/sudocode-ai/sudocode/issues"
38
+ },
39
+ "publishConfig": {
40
+ "access": "public"
41
+ },
42
+ "engines": {
43
+ "node": ">=18.0.0"
44
+ },
45
+ "dependencies": {
46
+ "@sudocode-ai/types": "^0.1.0",
47
+ "better-sqlite3": "^11.8.1",
48
+ "chalk": "^5.6.2",
49
+ "chokidar": "^4.0.3",
50
+ "cli-table3": "^0.6.5",
51
+ "commander": "^14.0.1",
52
+ "gray-matter": "^4.0.3",
53
+ "vite": "7.1.12"
54
+ },
55
+ "devDependencies": {
56
+ "@types/better-sqlite3": "^7.6.8",
57
+ "@types/chokidar": "^1.7.5",
58
+ "@types/node": "^20.10.6",
59
+ "esbuild": "^0.24.2",
60
+ "typescript": "^5.3.3",
61
+ "vitest": "^3.2.4"
62
+ },
63
+ "files": [
64
+ "dist/**/*.js",
65
+ "dist/**/*.d.ts",
66
+ "!dist/**/*.map"
67
+ ]
68
+ }