sanjang 0.3.0 → 0.3.2

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 (66) hide show
  1. package/dist/bin/sanjang.d.ts +1 -0
  2. package/dist/bin/sanjang.js +138 -0
  3. package/dist/lib/config.d.ts +19 -0
  4. package/dist/lib/config.js +318 -0
  5. package/dist/lib/engine/cache.d.ts +7 -0
  6. package/dist/lib/engine/cache.js +183 -0
  7. package/dist/lib/engine/config-hotfix.d.ts +7 -0
  8. package/dist/lib/engine/config-hotfix.js +129 -0
  9. package/dist/lib/engine/conflict.d.ts +12 -0
  10. package/dist/lib/engine/conflict.js +32 -0
  11. package/dist/lib/engine/diagnostics.d.ts +15 -0
  12. package/dist/lib/engine/diagnostics.js +58 -0
  13. package/dist/lib/engine/naming.d.ts +10 -0
  14. package/dist/lib/engine/naming.js +83 -0
  15. package/dist/lib/engine/ports.d.ts +9 -0
  16. package/dist/lib/engine/ports.js +55 -0
  17. package/dist/lib/engine/pr.d.ts +27 -0
  18. package/dist/lib/engine/pr.js +54 -0
  19. package/dist/lib/engine/process.d.ts +15 -0
  20. package/dist/lib/engine/process.js +250 -0
  21. package/dist/lib/engine/self-heal.d.ts +12 -0
  22. package/dist/lib/engine/self-heal.js +98 -0
  23. package/dist/lib/engine/smart-init.d.ts +7 -0
  24. package/dist/lib/engine/smart-init.js +138 -0
  25. package/dist/lib/engine/smart-pr.d.ts +19 -0
  26. package/dist/lib/engine/smart-pr.js +105 -0
  27. package/dist/lib/engine/snapshot.d.ts +10 -0
  28. package/dist/lib/engine/snapshot.js +35 -0
  29. package/dist/lib/engine/state.d.ts +7 -0
  30. package/dist/lib/engine/state.js +53 -0
  31. package/dist/lib/engine/suggest.d.ts +21 -0
  32. package/dist/lib/engine/suggest.js +121 -0
  33. package/dist/lib/engine/warp.d.ts +23 -0
  34. package/dist/lib/engine/warp.js +32 -0
  35. package/dist/lib/engine/watcher.d.ts +11 -0
  36. package/dist/lib/engine/watcher.js +43 -0
  37. package/dist/lib/engine/worktree.d.ts +13 -0
  38. package/dist/lib/engine/worktree.js +91 -0
  39. package/dist/lib/server.d.ts +20 -0
  40. package/dist/lib/server.js +1399 -0
  41. package/dist/lib/types.d.ts +109 -0
  42. package/dist/lib/types.js +2 -0
  43. package/package.json +5 -5
  44. package/bin/__tests__/sanjang.test.ts +0 -42
  45. package/bin/sanjang.js +0 -17
  46. package/bin/sanjang.ts +0 -144
  47. package/lib/config.ts +0 -337
  48. package/lib/engine/cache.ts +0 -218
  49. package/lib/engine/config-hotfix.ts +0 -161
  50. package/lib/engine/conflict.ts +0 -33
  51. package/lib/engine/diagnostics.ts +0 -81
  52. package/lib/engine/naming.ts +0 -93
  53. package/lib/engine/ports.ts +0 -61
  54. package/lib/engine/pr.ts +0 -71
  55. package/lib/engine/process.ts +0 -283
  56. package/lib/engine/self-heal.ts +0 -130
  57. package/lib/engine/smart-init.ts +0 -136
  58. package/lib/engine/smart-pr.ts +0 -130
  59. package/lib/engine/snapshot.ts +0 -45
  60. package/lib/engine/state.ts +0 -60
  61. package/lib/engine/suggest.ts +0 -169
  62. package/lib/engine/warp.ts +0 -47
  63. package/lib/engine/watcher.ts +0 -40
  64. package/lib/engine/worktree.ts +0 -100
  65. package/lib/server.ts +0 -1560
  66. package/lib/types.ts +0 -130
package/lib/types.ts DELETED
@@ -1,130 +0,0 @@
1
- // Central type definitions for Sanjang
2
-
3
- export interface Camp {
4
- name: string;
5
- branch: string;
6
- slot: number;
7
- fePort: number;
8
- bePort: number;
9
- url?: string;
10
- status: "stopped" | "starting" | "starting-frontend" | "running" | "setting-up" | "error";
11
- description?: string;
12
- baseCommit?: string;
13
- parentBranch?: string;
14
- }
15
-
16
- export interface DevConfig {
17
- command: string;
18
- port: number;
19
- portFlag: string | null;
20
- cwd: string;
21
- env: Record<string, string>;
22
- }
23
-
24
- export interface BackendConfig {
25
- command: string;
26
- port: number;
27
- healthCheck?: string;
28
- cwd?: string;
29
- env?: Record<string, string>;
30
- }
31
-
32
- export interface PortRange {
33
- base: number;
34
- slots: number;
35
- }
36
-
37
- export interface PortsConfig {
38
- fe: PortRange;
39
- be: PortRange;
40
- }
41
-
42
- export interface SanjangConfig {
43
- dev: DevConfig;
44
- setup: string | null;
45
- copyFiles: string[];
46
- backend: BackendConfig | null;
47
- ports: PortsConfig;
48
- _autoDetected?: boolean;
49
- }
50
-
51
- export interface PortAllocation {
52
- slot: number;
53
- fePort: number;
54
- bePort: number;
55
- }
56
-
57
- export interface PortStatus extends PortAllocation {
58
- feBusy: boolean;
59
- beBusy: boolean;
60
- }
61
-
62
- export interface CacheValidation {
63
- valid: boolean;
64
- reason?: string;
65
- }
66
-
67
- export interface CacheBuildResult {
68
- success: boolean;
69
- error?: string;
70
- duration: number;
71
- }
72
-
73
- export interface CacheApplyResult {
74
- applied: boolean;
75
- reason?: string;
76
- duration?: number;
77
- count?: number;
78
- }
79
-
80
- export interface LockfileInfo {
81
- path: string;
82
- name: string;
83
- }
84
-
85
- export interface DetectedProject {
86
- framework: string;
87
- dev: DevConfig;
88
- setup: string | null;
89
- copyFiles: string[];
90
- _note?: string;
91
- }
92
-
93
- export interface DetectedApp {
94
- dir: string;
95
- framework: string;
96
- detected: DetectedProject;
97
- }
98
-
99
- export interface GenerateConfigResult {
100
- created: boolean;
101
- framework?: string;
102
- configPath?: string;
103
- message: string;
104
- }
105
-
106
- export interface SnapshotInfo {
107
- name: string;
108
- date: string;
109
- message: string;
110
- }
111
-
112
- export interface DiagnosticsResult {
113
- status: string;
114
- checks: DiagnosticsCheck[];
115
- }
116
-
117
- export interface DiagnosticsCheck {
118
- name: string;
119
- ok: boolean;
120
- message: string;
121
- }
122
-
123
- export type BroadcastMessage = {
124
- type: string;
125
- name?: string;
126
- source?: string;
127
- data?: unknown;
128
- };
129
-
130
- export type EventCallback = (event: BroadcastMessage) => void;