@speclife/core 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.
- package/dist/adapters/claude-cli-adapter.d.ts +57 -0
- package/dist/adapters/claude-cli-adapter.d.ts.map +1 -0
- package/dist/adapters/claude-cli-adapter.js +161 -0
- package/dist/adapters/claude-cli-adapter.js.map +1 -0
- package/dist/adapters/claude-sdk-adapter.d.ts +49 -0
- package/dist/adapters/claude-sdk-adapter.d.ts.map +1 -0
- package/dist/adapters/claude-sdk-adapter.js +278 -0
- package/dist/adapters/claude-sdk-adapter.js.map +1 -0
- package/dist/adapters/cursor-adapter.d.ts +26 -0
- package/dist/adapters/cursor-adapter.d.ts.map +1 -0
- package/dist/adapters/cursor-adapter.js +54 -0
- package/dist/adapters/cursor-adapter.js.map +1 -0
- package/dist/adapters/environment-adapter.d.ts +153 -0
- package/dist/adapters/environment-adapter.d.ts.map +1 -0
- package/dist/adapters/environment-adapter.js +690 -0
- package/dist/adapters/environment-adapter.js.map +1 -0
- package/dist/adapters/git-adapter.d.ts +41 -0
- package/dist/adapters/git-adapter.d.ts.map +1 -0
- package/dist/adapters/git-adapter.js +95 -0
- package/dist/adapters/git-adapter.js.map +1 -0
- package/dist/adapters/github-adapter.d.ts +39 -0
- package/dist/adapters/github-adapter.d.ts.map +1 -0
- package/dist/adapters/github-adapter.js +129 -0
- package/dist/adapters/github-adapter.js.map +1 -0
- package/dist/adapters/index.d.ts +11 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +13 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/openspec-adapter.d.ts +36 -0
- package/dist/adapters/openspec-adapter.d.ts.map +1 -0
- package/dist/adapters/openspec-adapter.js +182 -0
- package/dist/adapters/openspec-adapter.js.map +1 -0
- package/dist/config.d.ts +60 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +112 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +105 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +28 -0
- package/dist/types.js.map +1 -0
- package/dist/workflows/implement.d.ts +28 -0
- package/dist/workflows/implement.d.ts.map +1 -0
- package/dist/workflows/implement.js +277 -0
- package/dist/workflows/implement.js.map +1 -0
- package/dist/workflows/index.d.ts +9 -0
- package/dist/workflows/index.d.ts.map +1 -0
- package/dist/workflows/index.js +9 -0
- package/dist/workflows/index.js.map +1 -0
- package/dist/workflows/init.d.ts +55 -0
- package/dist/workflows/init.d.ts.map +1 -0
- package/dist/workflows/init.js +195 -0
- package/dist/workflows/init.js.map +1 -0
- package/dist/workflows/merge.d.ts +40 -0
- package/dist/workflows/merge.d.ts.map +1 -0
- package/dist/workflows/merge.js +90 -0
- package/dist/workflows/merge.js.map +1 -0
- package/dist/workflows/status.d.ts +34 -0
- package/dist/workflows/status.d.ts.map +1 -0
- package/dist/workflows/status.js +53 -0
- package/dist/workflows/status.js.map +1 -0
- package/dist/workflows/submit.d.ts +44 -0
- package/dist/workflows/submit.d.ts.map +1 -0
- package/dist/workflows/submit.js +143 -0
- package/dist/workflows/submit.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment adapters for language-specific worktree setup
|
|
3
|
+
*
|
|
4
|
+
* These adapters handle dependency bootstrapping when creating worktrees,
|
|
5
|
+
* ensuring the worktree is ready to build without manual intervention.
|
|
6
|
+
*/
|
|
7
|
+
import { type ProgressCallback } from '../types.js';
|
|
8
|
+
/** Bootstrap strategy for environment setup */
|
|
9
|
+
export type BootstrapStrategy = 'symlink' | 'install' | 'none';
|
|
10
|
+
/** Result of environment detection */
|
|
11
|
+
export interface DetectionResult {
|
|
12
|
+
/** Environment name (e.g., 'nodejs', 'python') */
|
|
13
|
+
name: string;
|
|
14
|
+
/** Confidence level 0-1 */
|
|
15
|
+
confidence: number;
|
|
16
|
+
/** Detected package manager */
|
|
17
|
+
packageManager?: string;
|
|
18
|
+
/** Files that triggered detection */
|
|
19
|
+
markerFiles: string[];
|
|
20
|
+
}
|
|
21
|
+
/** Result of bootstrap operation */
|
|
22
|
+
export interface BootstrapResult {
|
|
23
|
+
/** Environment that was bootstrapped */
|
|
24
|
+
environment: string;
|
|
25
|
+
/** Strategy used */
|
|
26
|
+
strategy: BootstrapStrategy;
|
|
27
|
+
/** Whether bootstrap was successful */
|
|
28
|
+
success: boolean;
|
|
29
|
+
/** Human-readable message */
|
|
30
|
+
message: string;
|
|
31
|
+
/** Path that was set up (if applicable) */
|
|
32
|
+
path?: string;
|
|
33
|
+
/** Whether tsconfig was patched for monorepo support */
|
|
34
|
+
tsconfigPatched?: boolean;
|
|
35
|
+
/** Detected monorepo info */
|
|
36
|
+
monorepo?: MonorepoInfo;
|
|
37
|
+
}
|
|
38
|
+
/** Monorepo information */
|
|
39
|
+
export interface MonorepoInfo {
|
|
40
|
+
/** Whether this is a monorepo */
|
|
41
|
+
isMonorepo: boolean;
|
|
42
|
+
/** Type of monorepo setup */
|
|
43
|
+
type?: 'npm-workspaces' | 'yarn-workspaces' | 'pnpm-workspaces' | 'lerna';
|
|
44
|
+
/** Root package.json path */
|
|
45
|
+
rootPackageJson: string;
|
|
46
|
+
/** List of workspace package paths */
|
|
47
|
+
workspacePackages: WorkspacePackage[];
|
|
48
|
+
}
|
|
49
|
+
/** A workspace package in a monorepo */
|
|
50
|
+
export interface WorkspacePackage {
|
|
51
|
+
/** Package name (from package.json) */
|
|
52
|
+
name: string;
|
|
53
|
+
/** Relative path from project root */
|
|
54
|
+
path: string;
|
|
55
|
+
/** Absolute path */
|
|
56
|
+
absolutePath: string;
|
|
57
|
+
/** Entry point for TypeScript (src/index.ts or similar) */
|
|
58
|
+
entryPoint?: string;
|
|
59
|
+
}
|
|
60
|
+
/** Environment adapter interface */
|
|
61
|
+
export interface EnvironmentAdapter {
|
|
62
|
+
/** Unique identifier for this environment */
|
|
63
|
+
readonly name: string;
|
|
64
|
+
/** Human-readable display name */
|
|
65
|
+
readonly displayName: string;
|
|
66
|
+
/** Priority for detection (higher = checked first) */
|
|
67
|
+
readonly priority: number;
|
|
68
|
+
/**
|
|
69
|
+
* Detect if this environment is present in the project
|
|
70
|
+
* @param projectRoot - Path to the project root
|
|
71
|
+
* @returns Detection result or null if not detected
|
|
72
|
+
*/
|
|
73
|
+
detect(projectRoot: string): Promise<DetectionResult | null>;
|
|
74
|
+
/**
|
|
75
|
+
* Bootstrap the environment in a worktree
|
|
76
|
+
* @param worktreePath - Path to the worktree
|
|
77
|
+
* @param sourceRoot - Path to the source project root
|
|
78
|
+
* @param strategy - Bootstrap strategy to use
|
|
79
|
+
* @param onProgress - Progress callback
|
|
80
|
+
*/
|
|
81
|
+
bootstrap(worktreePath: string, sourceRoot: string, strategy: BootstrapStrategy, onProgress?: ProgressCallback): Promise<BootstrapResult>;
|
|
82
|
+
/**
|
|
83
|
+
* Clean up environment artifacts before worktree removal
|
|
84
|
+
* @param worktreePath - Path to the worktree
|
|
85
|
+
*/
|
|
86
|
+
cleanup(worktreePath: string): Promise<void>;
|
|
87
|
+
}
|
|
88
|
+
/** Registry of environment adapters */
|
|
89
|
+
export interface EnvironmentRegistry {
|
|
90
|
+
/** Register an adapter */
|
|
91
|
+
register(adapter: EnvironmentAdapter): void;
|
|
92
|
+
/** Get all registered adapters sorted by priority */
|
|
93
|
+
getAdapters(): EnvironmentAdapter[];
|
|
94
|
+
/** Get adapter by name */
|
|
95
|
+
getAdapter(name: string): EnvironmentAdapter | undefined;
|
|
96
|
+
/** Detect all environments in a project */
|
|
97
|
+
detectEnvironments(projectRoot: string): Promise<DetectionResult[]>;
|
|
98
|
+
/**
|
|
99
|
+
* Bootstrap all detected environments
|
|
100
|
+
* @param worktreePath - Path to the worktree
|
|
101
|
+
* @param sourceRoot - Path to the source project root
|
|
102
|
+
* @param strategy - Bootstrap strategy to use
|
|
103
|
+
* @param onProgress - Progress callback
|
|
104
|
+
*/
|
|
105
|
+
bootstrapAll(worktreePath: string, sourceRoot: string, strategy: BootstrapStrategy, onProgress?: ProgressCallback): Promise<BootstrapResult[]>;
|
|
106
|
+
/** Clean up all environments */
|
|
107
|
+
cleanupAll(worktreePath: string): Promise<void>;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Create an environment registry with optional initial adapters
|
|
111
|
+
*/
|
|
112
|
+
export declare function createEnvironmentRegistry(initialAdapters?: EnvironmentAdapter[]): EnvironmentRegistry;
|
|
113
|
+
/**
|
|
114
|
+
* Node.js environment adapter
|
|
115
|
+
* Detects: package.json, package-lock.json, yarn.lock, pnpm-lock.yaml
|
|
116
|
+
* Bootstraps: symlinks node_modules from source to worktree
|
|
117
|
+
*
|
|
118
|
+
* For monorepos: Detects workspace packages and auto-patches tsconfig.json
|
|
119
|
+
* with paths mappings to ensure TypeScript resolves to worktree source.
|
|
120
|
+
*/
|
|
121
|
+
export declare function createNodejsAdapter(): EnvironmentAdapter;
|
|
122
|
+
/**
|
|
123
|
+
* Python environment adapter
|
|
124
|
+
* Detects: requirements.txt, pyproject.toml, setup.py, Pipfile
|
|
125
|
+
* Bootstraps: symlinks .venv from source to worktree
|
|
126
|
+
*/
|
|
127
|
+
export declare function createPythonAdapter(): EnvironmentAdapter;
|
|
128
|
+
/**
|
|
129
|
+
* Go environment adapter
|
|
130
|
+
* Detects: go.mod
|
|
131
|
+
* Bootstraps: no-op (Go uses global module cache)
|
|
132
|
+
*/
|
|
133
|
+
export declare function createGoAdapter(): EnvironmentAdapter;
|
|
134
|
+
/**
|
|
135
|
+
* Rust environment adapter
|
|
136
|
+
* Detects: Cargo.toml
|
|
137
|
+
* Bootstraps: no-op (Rust uses global cargo cache)
|
|
138
|
+
*/
|
|
139
|
+
export declare function createRustAdapter(): EnvironmentAdapter;
|
|
140
|
+
/**
|
|
141
|
+
* Create the default environment registry with all built-in adapters
|
|
142
|
+
*/
|
|
143
|
+
export declare function createDefaultEnvironmentRegistry(): EnvironmentRegistry;
|
|
144
|
+
/**
|
|
145
|
+
* Detect if a project is a monorepo and identify workspace packages
|
|
146
|
+
*/
|
|
147
|
+
export declare function detectMonorepo(projectRoot: string): MonorepoInfo;
|
|
148
|
+
/**
|
|
149
|
+
* Patch tsconfig files in a worktree to add paths for local workspace packages
|
|
150
|
+
* This ensures TypeScript resolves to worktree source, not the symlinked main repo
|
|
151
|
+
*/
|
|
152
|
+
export declare function patchTsconfigForMonorepo(worktreePath: string, monorepo: MonorepoInfo, onProgress?: ProgressCallback): boolean;
|
|
153
|
+
//# sourceMappingURL=environment-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/environment-adapter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,+CAA+C;AAC/C,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAE/D,sCAAsC;AACtC,MAAM,WAAW,eAAe;IAC9B,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qCAAqC;IACrC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,oCAAoC;AACpC,MAAM,WAAW,eAAe;IAC9B,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB;IACpB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,uCAAuC;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,eAAe,CAAC,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