@axiomatic-labs/claudeflow 2.49.2 → 2.49.4
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/lib/install.js +33 -2
- package/package.json +1 -1
package/lib/install.js
CHANGED
|
@@ -18,7 +18,14 @@ const ui = require('./ui.js');
|
|
|
18
18
|
const CLAUDE_MARK = '<!-- claudeflow:begin -->';
|
|
19
19
|
const CLAUDE_END = '<!-- claudeflow:end -->';
|
|
20
20
|
const HOOK_TAG = 'scripts/claudeflow/hook_'; // identifies OUR hook entries in settings.json
|
|
21
|
-
|
|
21
|
+
// create-if-absent, never clobber. `test-context.json` ships NO default (it's filled at runtime by the
|
|
22
|
+
// orchestrator with the project's TEST auth) — listing it here just means an update never clobbers it.
|
|
23
|
+
const PER_PROJECT_CONFIGS = ['brand.json', 'risk-signals.json', 'test-context.json'];
|
|
24
|
+
|
|
25
|
+
// Paths appended to the project's .gitignore (add-if-absent). These hold TEST credentials / Playwright
|
|
26
|
+
// storage state — they must NEVER be committed. test-context.json is per-project runtime state; .auth/
|
|
27
|
+
// holds storageState files the orchestrator seeds for auth-gated functional verification.
|
|
28
|
+
const GITIGNORE_LINES = ['.claudeflow/test-context.json', '.claudeflow/.auth/'];
|
|
22
29
|
const SHARED_CONFIGS = ['playbook-map.json', 'agent-map.json']; // always refreshed (shared system)
|
|
23
30
|
|
|
24
31
|
function rmrf(p) { fs.rmSync(p, { recursive: true, force: true }); }
|
|
@@ -92,6 +99,26 @@ function mergeMcp(cwd, baseServers) {
|
|
|
92
99
|
return added;
|
|
93
100
|
}
|
|
94
101
|
|
|
102
|
+
// Append the claudeflow runtime-state paths to the project's .gitignore, ADD-IF-ABSENT. These hold TEST
|
|
103
|
+
// credentials / Playwright storage state and must never be committed. Create the file if missing; else
|
|
104
|
+
// append only the lines NOT already present as an EXACT line (a `Set.has()` on the trimmed existing lines —
|
|
105
|
+
// not a gitignore-semantics evaluation: a broader rule like `.claudeflow/` that would already cover these is
|
|
106
|
+
// NOT detected, so the exact line is still appended. That is harmless — a redundant, more-specific ignore —
|
|
107
|
+
// and keeps the check simple; we only avoid DUPLICATING the exact same line. Returns the count added.
|
|
108
|
+
function mergeGitignore(cwd, lines) {
|
|
109
|
+
if (!lines || !lines.length) return 0;
|
|
110
|
+
const gp = path.join(cwd, '.gitignore');
|
|
111
|
+
let cur = '';
|
|
112
|
+
if (fs.existsSync(gp)) { try { cur = fs.readFileSync(gp, 'utf8'); } catch { return 0; } }
|
|
113
|
+
const present = new Set(cur.split('\n').map(l => l.trim()).filter(Boolean));
|
|
114
|
+
const toAdd = lines.filter(l => !present.has(l));
|
|
115
|
+
if (!toAdd.length) return 0;
|
|
116
|
+
const header = '\n# claudeflow test-context — TEST credentials / auth storage state, NEVER commit\n';
|
|
117
|
+
const body = (cur && !cur.endsWith('\n') ? '\n' : '') + (cur ? header : header.trimStart()) + toAdd.join('\n') + '\n';
|
|
118
|
+
fs.writeFileSync(gp, cur + body);
|
|
119
|
+
return toAdd.length;
|
|
120
|
+
}
|
|
121
|
+
|
|
95
122
|
// UPSERT the claudeflow guidance block. The snippet is a self-contained `<!-- claudeflow:begin -->…<!-- end -->`
|
|
96
123
|
// region; everything OUTSIDE the markers is the user's own CLAUDE.md and is never touched. Behavior:
|
|
97
124
|
// • no CLAUDE.md → create it with the block
|
|
@@ -124,7 +151,7 @@ function syncClaudeMd(cwd, snippetPath) {
|
|
|
124
151
|
// Place + merge the framework from an extracted payload dir into a project. Pure filesystem, no network —
|
|
125
152
|
// so it is testable on a throwaway dir.
|
|
126
153
|
function installFromPayload(src, cwd) {
|
|
127
|
-
const out = { playbooks: 0, scripts: 0, skills: 0, agents: 0, mcp: 0, claudeMd: false, failed: [] };
|
|
154
|
+
const out = { playbooks: 0, scripts: 0, skills: 0, agents: 0, mcp: 0, gitignore: 0, claudeMd: false, failed: [] };
|
|
128
155
|
// Each placement step is ISOLATED: a failure in one (a copy error, a permission hiccup, a weird file in the
|
|
129
156
|
// user's tree) must NOT abort the rest — above all it must not skip the settings/env + CLAUDE.md config, the
|
|
130
157
|
// two steps a user most needs (the env block wires agent-teams + the autocompact window, etc.). Before this,
|
|
@@ -219,6 +246,9 @@ function installFromPayload(src, cwd) {
|
|
|
219
246
|
}
|
|
220
247
|
});
|
|
221
248
|
|
|
249
|
+
// 8) .gitignore — ensure the TEST-credential paths are ignored (add-if-absent; never commit creds).
|
|
250
|
+
step('gitignore', () => { out.gitignore = mergeGitignore(cwd, GITIGNORE_LINES); });
|
|
251
|
+
|
|
222
252
|
return out;
|
|
223
253
|
}
|
|
224
254
|
|
|
@@ -294,3 +324,4 @@ module.exports.installFromPayload = installFromPayload;
|
|
|
294
324
|
module.exports.mergeSettings = mergeSettings;
|
|
295
325
|
module.exports.syncClaudeMd = syncClaudeMd;
|
|
296
326
|
module.exports.mergeMcp = mergeMcp;
|
|
327
|
+
module.exports.mergeGitignore = mergeGitignore;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axiomatic-labs/claudeflow",
|
|
3
|
-
"version": "2.49.
|
|
3
|
+
"version": "2.49.4",
|
|
4
4
|
"description": "Claudeflow — AI-powered development toolkit for Claude Code. Skills, agents, hooks, and quality gates that ship production apps.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"claudeflow": "./bin/cli.js"
|