@cluesmith/codev 3.0.0-rc.6 → 3.0.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/agent-farm/commands/architect.js +1 -1
- package/dist/agent-farm/commands/architect.js.map +1 -1
- package/dist/agent-farm/commands/send.d.ts +4 -1
- package/dist/agent-farm/commands/send.d.ts.map +1 -1
- package/dist/agent-farm/commands/send.js +5 -2
- package/dist/agent-farm/commands/send.js.map +1 -1
- package/dist/agent-farm/commands/spawn-worktree.d.ts.map +1 -1
- package/dist/agent-farm/commands/spawn-worktree.js +26 -10
- package/dist/agent-farm/commands/spawn-worktree.js.map +1 -1
- package/dist/agent-farm/servers/overview.d.ts.map +1 -1
- package/dist/agent-farm/servers/overview.js +8 -0
- package/dist/agent-farm/servers/overview.js.map +1 -1
- package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-instances.js +12 -10
- package/dist/agent-farm/servers/tower-instances.js.map +1 -1
- package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-terminals.js +17 -18
- package/dist/agent-farm/servers/tower-terminals.js.map +1 -1
- package/dist/agent-farm/servers/tower-utils.js +1 -1
- package/dist/agent-farm/servers/tower-utils.js.map +1 -1
- package/dist/agent-farm/utils/config.d.ts.map +1 -1
- package/dist/agent-farm/utils/config.js +18 -17
- package/dist/agent-farm/utils/config.js.map +1 -1
- package/dist/agent-farm/utils/roles.d.ts +11 -4
- package/dist/agent-farm/utils/roles.d.ts.map +1 -1
- package/dist/agent-farm/utils/roles.js +21 -6
- package/dist/agent-farm/utils/roles.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +21 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/adopt.d.ts.map +1 -1
- package/dist/commands/adopt.js +14 -43
- package/dist/commands/adopt.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +12 -42
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/porch/config.d.ts +6 -9
- package/dist/commands/porch/config.d.ts.map +1 -1
- package/dist/commands/porch/config.js +12 -37
- package/dist/commands/porch/config.js.map +1 -1
- package/dist/commands/porch/index.d.ts.map +1 -1
- package/dist/commands/porch/index.js +57 -21
- package/dist/commands/porch/index.js.map +1 -1
- package/dist/commands/porch/next.d.ts.map +1 -1
- package/dist/commands/porch/next.js +70 -8
- package/dist/commands/porch/next.js.map +1 -1
- package/dist/commands/porch/prompts.d.ts.map +1 -1
- package/dist/commands/porch/prompts.js +13 -29
- package/dist/commands/porch/prompts.js.map +1 -1
- package/dist/commands/porch/protocol.d.ts +4 -3
- package/dist/commands/porch/protocol.d.ts.map +1 -1
- package/dist/commands/porch/protocol.js +21 -21
- package/dist/commands/porch/protocol.js.map +1 -1
- package/dist/commands/porch/types.d.ts +2 -2
- package/dist/commands/porch/types.d.ts.map +1 -1
- package/dist/commands/sync.d.ts +26 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +207 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/update.d.ts +15 -2
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +159 -202
- package/dist/commands/update.js.map +1 -1
- package/dist/lib/config.d.ts +82 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +158 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/forge.d.ts +6 -6
- package/dist/lib/forge.d.ts.map +1 -1
- package/dist/lib/forge.js +7 -15
- package/dist/lib/forge.js.map +1 -1
- package/dist/lib/github.d.ts +1 -1
- package/dist/lib/github.js +2 -2
- package/dist/lib/github.js.map +1 -1
- package/dist/lib/skeleton.d.ts +15 -5
- package/dist/lib/skeleton.d.ts.map +1 -1
- package/dist/lib/skeleton.js +82 -7
- package/dist/lib/skeleton.js.map +1 -1
- package/dist/lib/team-github.js +1 -1
- package/dist/lib/team-github.js.map +1 -1
- package/package.json +1 -1
- package/scripts/forge/gitea/repo-archive.sh +11 -0
- package/scripts/forge/github/repo-archive.sh +10 -0
- package/scripts/forge/gitlab/repo-archive.sh +12 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* codev sync - Fetch and cache remote framework sources.
|
|
3
|
+
*
|
|
4
|
+
* When a remote framework source is configured in .codev/config.json,
|
|
5
|
+
* this command fetches it and caches it locally for runtime resolution.
|
|
6
|
+
*
|
|
7
|
+
* Cache location: ~/.codev/cache/framework/<source-hash>/<ref>/
|
|
8
|
+
*/
|
|
9
|
+
import * as fs from 'node:fs';
|
|
10
|
+
import * as path from 'node:path';
|
|
11
|
+
import { createHash } from 'node:crypto';
|
|
12
|
+
import { homedir } from 'node:os';
|
|
13
|
+
import { execSync } from 'node:child_process';
|
|
14
|
+
import chalk from 'chalk';
|
|
15
|
+
import { loadConfig } from '../lib/config.js';
|
|
16
|
+
import { executeForgeCommand } from '../lib/forge.js';
|
|
17
|
+
/**
|
|
18
|
+
* Get the cache directory for a given source and ref.
|
|
19
|
+
*/
|
|
20
|
+
export function getCacheDir(source, ref) {
|
|
21
|
+
const sourceHash = createHash('sha256').update(source).digest('hex').slice(0, 12);
|
|
22
|
+
const refPart = ref || 'default';
|
|
23
|
+
return path.join(homedir(), '.codev', 'cache', 'framework', sourceHash, refPart);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Check if a ref is immutable (tag-like or SHA-like).
|
|
27
|
+
* Tags: v1.2.3, v1.0, release-2026
|
|
28
|
+
* SHAs: 40-char hex strings
|
|
29
|
+
*/
|
|
30
|
+
function isImmutableRef(ref) {
|
|
31
|
+
// SHA-like (40 hex chars)
|
|
32
|
+
if (/^[0-9a-f]{40}$/i.test(ref))
|
|
33
|
+
return true;
|
|
34
|
+
// Semver-like tags (v1.0, v1.2.3, 1.0.0, etc.)
|
|
35
|
+
if (/^v?\d+(\.\d+)+/.test(ref))
|
|
36
|
+
return true;
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Parse source string to extract owner/repo and optional subpath.
|
|
41
|
+
* Handles both shorthand and full URL formats.
|
|
42
|
+
*
|
|
43
|
+
* Examples:
|
|
44
|
+
* "myorg/repo" → { repo: "myorg/repo", subpath: null }
|
|
45
|
+
* "myorg/repo/team-a" → { repo: "myorg/repo", subpath: "team-a" }
|
|
46
|
+
* "https://gitlab.example.com/team/protocols" → { repo: "https://gitlab.example.com/team/protocols", subpath: null }
|
|
47
|
+
*/
|
|
48
|
+
function parseSource(source) {
|
|
49
|
+
// Full URLs: treat the entire string as the repo identifier
|
|
50
|
+
if (source.startsWith('http://') || source.startsWith('https://') || source.startsWith('git@')) {
|
|
51
|
+
return { repo: source, subpath: null };
|
|
52
|
+
}
|
|
53
|
+
// Shorthand: owner/repo or owner/repo/subpath
|
|
54
|
+
const parts = source.split('/');
|
|
55
|
+
if (parts.length <= 2) {
|
|
56
|
+
return { repo: source, subpath: null };
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
repo: `${parts[0]}/${parts[1]}`,
|
|
60
|
+
subpath: parts.slice(2).join('/'),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Fetch framework from a forge source.
|
|
65
|
+
*/
|
|
66
|
+
async function fetchFromForge(source, ref, outputDir, workspaceRoot) {
|
|
67
|
+
const { repo, subpath } = parseSource(source);
|
|
68
|
+
// Use a temp directory for extraction, then move to final location
|
|
69
|
+
const tmpDir = `${outputDir}.tmp-${Date.now()}`;
|
|
70
|
+
try {
|
|
71
|
+
await executeForgeCommand('repo-archive', {
|
|
72
|
+
CODEV_REPO: repo,
|
|
73
|
+
CODEV_REF: ref || '',
|
|
74
|
+
CODEV_OUTPUT_DIR: tmpDir,
|
|
75
|
+
}, { cwd: workspaceRoot });
|
|
76
|
+
// If subpath specified, extract only that subdirectory
|
|
77
|
+
if (subpath) {
|
|
78
|
+
const subDir = path.join(tmpDir, subpath);
|
|
79
|
+
if (!fs.existsSync(subDir)) {
|
|
80
|
+
throw new Error(`Subpath "${subpath}" not found in repository "${repo}"`);
|
|
81
|
+
}
|
|
82
|
+
fs.mkdirSync(path.dirname(outputDir), { recursive: true });
|
|
83
|
+
fs.renameSync(subDir, outputDir);
|
|
84
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
// Atomic move
|
|
88
|
+
fs.mkdirSync(path.dirname(outputDir), { recursive: true });
|
|
89
|
+
fs.renameSync(tmpDir, outputDir);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
// Clean up temp dir on failure
|
|
94
|
+
if (fs.existsSync(tmpDir)) {
|
|
95
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
96
|
+
}
|
|
97
|
+
throw err;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Fetch framework from a custom command.
|
|
102
|
+
*/
|
|
103
|
+
function fetchFromCommand(command, ref, outputDir) {
|
|
104
|
+
// Use temp dir + atomic rename to prevent corrupted cache on failure
|
|
105
|
+
const tmpDir = `${outputDir}.tmp-${Date.now()}`;
|
|
106
|
+
fs.mkdirSync(tmpDir, { recursive: true });
|
|
107
|
+
try {
|
|
108
|
+
const env = {
|
|
109
|
+
...process.env,
|
|
110
|
+
CODEV_OUTPUT_DIR: tmpDir,
|
|
111
|
+
CODEV_REF: ref || '',
|
|
112
|
+
};
|
|
113
|
+
execSync(command, {
|
|
114
|
+
env: env,
|
|
115
|
+
stdio: 'inherit',
|
|
116
|
+
});
|
|
117
|
+
// Atomic move to final location
|
|
118
|
+
fs.mkdirSync(path.dirname(outputDir), { recursive: true });
|
|
119
|
+
fs.renameSync(tmpDir, outputDir);
|
|
120
|
+
}
|
|
121
|
+
catch (err) {
|
|
122
|
+
// Clean up temp dir on failure — no partial cache
|
|
123
|
+
if (fs.existsSync(tmpDir)) {
|
|
124
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
125
|
+
}
|
|
126
|
+
throw err;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Run codev sync — fetch and cache remote framework.
|
|
131
|
+
*/
|
|
132
|
+
export async function sync(options = {}) {
|
|
133
|
+
const { force = false, status: showStatus = false } = options;
|
|
134
|
+
const workspaceRoot = process.cwd();
|
|
135
|
+
const config = loadConfig(workspaceRoot);
|
|
136
|
+
const framework = config.framework;
|
|
137
|
+
if (!framework?.source || framework.source === 'local') {
|
|
138
|
+
console.log('No remote framework source configured. Nothing to sync.');
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
const source = framework.source;
|
|
142
|
+
const ref = framework.ref;
|
|
143
|
+
const type = framework.type || 'forge';
|
|
144
|
+
const cacheDir = getCacheDir(source, ref);
|
|
145
|
+
// --status: show cache state
|
|
146
|
+
if (showStatus) {
|
|
147
|
+
console.log(chalk.bold('Framework cache status'));
|
|
148
|
+
console.log('');
|
|
149
|
+
console.log(` Source: ${source}`);
|
|
150
|
+
console.log(` Type: ${type}`);
|
|
151
|
+
console.log(` Ref: ${ref || '(default branch)'}`);
|
|
152
|
+
console.log(` Cache: ${cacheDir}`);
|
|
153
|
+
if (fs.existsSync(cacheDir)) {
|
|
154
|
+
const stat = fs.statSync(cacheDir);
|
|
155
|
+
console.log(` Status: ${chalk.green('cached')}`);
|
|
156
|
+
console.log(` Last fetched: ${stat.mtime.toISOString()}`);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
console.log(` Status: ${chalk.yellow('not cached')}`);
|
|
160
|
+
}
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
// Check cache
|
|
164
|
+
if (fs.existsSync(cacheDir) && !force) {
|
|
165
|
+
if (ref && isImmutableRef(ref)) {
|
|
166
|
+
console.log(chalk.dim(`Framework cached (immutable ref: ${ref}). Use --force to re-fetch.`));
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
// Branch or no ref — re-fetch
|
|
170
|
+
console.log(chalk.dim(`Re-fetching framework (branch ref or unspecified)...`));
|
|
171
|
+
fs.rmSync(cacheDir, { recursive: true, force: true });
|
|
172
|
+
}
|
|
173
|
+
if (force && fs.existsSync(cacheDir)) {
|
|
174
|
+
fs.rmSync(cacheDir, { recursive: true, force: true });
|
|
175
|
+
}
|
|
176
|
+
console.log(`Fetching framework from ${source}${ref ? ` @ ${ref}` : ''}...`);
|
|
177
|
+
if (type === 'command') {
|
|
178
|
+
const command = framework.command || source;
|
|
179
|
+
fetchFromCommand(command, ref, cacheDir);
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
await fetchFromForge(source, ref, cacheDir, workspaceRoot);
|
|
183
|
+
}
|
|
184
|
+
console.log(chalk.green('Framework cached successfully.'));
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Get the framework cache directory if it exists.
|
|
188
|
+
* Returns null if no remote source is configured or cache doesn't exist.
|
|
189
|
+
*/
|
|
190
|
+
export function getFrameworkCacheDir(workspaceRoot) {
|
|
191
|
+
try {
|
|
192
|
+
const config = loadConfig(workspaceRoot);
|
|
193
|
+
const framework = config.framework;
|
|
194
|
+
if (!framework?.source || framework.source === 'local') {
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
const cacheDir = getCacheDir(framework.source, framework.ref);
|
|
198
|
+
if (fs.existsSync(cacheDir)) {
|
|
199
|
+
return cacheDir;
|
|
200
|
+
}
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
catch {
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
//# sourceMappingURL=sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9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C,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5B,OAAO,QAAQ,CAAC;QAClB,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* codev update -
|
|
2
|
+
* codev update - Migrate config and refresh Claude-specific files.
|
|
3
|
+
*
|
|
4
|
+
* Two responsibilities:
|
|
5
|
+
* A. One-time migration (runs once, skipped on subsequent runs):
|
|
6
|
+
* 1. Move af-config.json → .codev/config.json
|
|
7
|
+
* 2. Clean unmodified skeleton files (using .update-hashes.json)
|
|
8
|
+
* 3. Preserve user-modified files as local overrides
|
|
9
|
+
* 4. Remove .update-hashes.json
|
|
10
|
+
*
|
|
11
|
+
* B. Claude-specific file refresh (runs every time):
|
|
12
|
+
* 1. Update CLAUDE.md, AGENTS.md, .claude/skills/ from package
|
|
3
13
|
*/
|
|
4
14
|
export interface UpdateOptions {
|
|
5
15
|
dryRun?: boolean;
|
|
@@ -17,10 +27,13 @@ export interface UpdateResult {
|
|
|
17
27
|
conflicts: ConflictEntry[];
|
|
18
28
|
newFiles: string[];
|
|
19
29
|
rootConflicts: ConflictEntry[];
|
|
30
|
+
migrated?: boolean;
|
|
31
|
+
cleanedFiles?: string[];
|
|
32
|
+
preservedFiles?: string[];
|
|
20
33
|
error?: string;
|
|
21
34
|
}
|
|
22
35
|
/**
|
|
23
|
-
* Update codev
|
|
36
|
+
* Update codev — migrate config and refresh Claude-specific files.
|
|
24
37
|
*/
|
|
25
38
|
export declare function update(options?: UpdateOptions): Promise<UpdateResult>;
|
|
26
39
|
//# sourceMappingURL=update.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAcH,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,EAAE,aAAa,EAAE,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAyGD;;GAEG;AACH,wBAAsB,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,YAAY,CAAC,CAwJ/E"}
|