jfl 0.7.2 → 0.8.1
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/commands/context-hub.d.ts.map +1 -1
- package/dist/commands/context-hub.js +26 -0
- package/dist/commands/context-hub.js.map +1 -1
- package/dist/commands/migrate-tenet.d.ts +25 -0
- package/dist/commands/migrate-tenet.d.ts.map +1 -0
- package/dist/commands/migrate-tenet.js +252 -0
- package/dist/commands/migrate-tenet.js.map +1 -0
- package/dist/commands/peter.d.ts.map +1 -1
- package/dist/commands/peter.js +47 -5
- package/dist/commands/peter.js.map +1 -1
- package/dist/commands/pi.d.ts +1 -0
- package/dist/commands/pi.d.ts.map +1 -1
- package/dist/commands/pi.js +5 -1
- package/dist/commands/pi.js.map +1 -1
- package/dist/commands/pivot.d.ts +28 -0
- package/dist/commands/pivot.d.ts.map +1 -0
- package/dist/commands/pivot.js +219 -0
- package/dist/commands/pivot.js.map +1 -0
- package/dist/commands/services-create.js +348 -0
- package/dist/commands/services-create.js.map +1 -1
- package/dist/dashboard-static/assets/index-BVrmW-ZI.js +154 -0
- package/dist/dashboard-static/assets/{index-CW8oWAdr.css → index-DtruPD44.css} +1 -1
- package/dist/dashboard-static/index.html +2 -2
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-generator.d.ts.map +1 -1
- package/dist/lib/agent-generator.js +15 -0
- package/dist/lib/agent-generator.js.map +1 -1
- package/dist/lib/counterfactual-engine.d.ts +136 -0
- package/dist/lib/counterfactual-engine.d.ts.map +1 -0
- package/dist/lib/counterfactual-engine.js +417 -0
- package/dist/lib/counterfactual-engine.js.map +1 -0
- package/dist/lib/dynamics-model.d.ts +107 -0
- package/dist/lib/dynamics-model.d.ts.map +1 -0
- package/dist/lib/dynamics-model.js +363 -0
- package/dist/lib/dynamics-model.js.map +1 -0
- package/dist/lib/eval-snapshot.d.ts.map +1 -1
- package/dist/lib/eval-snapshot.js +15 -4
- package/dist/lib/eval-snapshot.js.map +1 -1
- package/dist/lib/invariant-monitor.d.ts +50 -0
- package/dist/lib/invariant-monitor.d.ts.map +1 -0
- package/dist/lib/invariant-monitor.js +400 -0
- package/dist/lib/invariant-monitor.js.map +1 -0
- package/dist/lib/meta-orchestrator.d.ts +40 -3
- package/dist/lib/meta-orchestrator.d.ts.map +1 -1
- package/dist/lib/meta-orchestrator.js +181 -2
- package/dist/lib/meta-orchestrator.js.map +1 -1
- package/dist/lib/openclaw-sdk.d.ts +8 -0
- package/dist/lib/openclaw-sdk.d.ts.map +1 -1
- package/dist/lib/openclaw-sdk.js +11 -0
- package/dist/lib/openclaw-sdk.js.map +1 -1
- package/dist/lib/peter-parker-bridge.d.ts +37 -1
- package/dist/lib/peter-parker-bridge.d.ts.map +1 -1
- package/dist/lib/peter-parker-bridge.js +201 -1
- package/dist/lib/peter-parker-bridge.js.map +1 -1
- package/dist/lib/service-detector.d.ts +1 -1
- package/dist/lib/service-detector.d.ts.map +1 -1
- package/dist/lib/service-detector.js +26 -6
- package/dist/lib/service-detector.js.map +1 -1
- package/dist/lib/service-gtm.d.ts +1 -1
- package/dist/lib/service-gtm.d.ts.map +1 -1
- package/dist/lib/state-capture.d.ts +36 -0
- package/dist/lib/state-capture.d.ts.map +1 -0
- package/dist/lib/state-capture.js +541 -0
- package/dist/lib/state-capture.js.map +1 -0
- package/dist/lib/stratus-client.d.ts +78 -2
- package/dist/lib/stratus-client.d.ts.map +1 -1
- package/dist/lib/stratus-client.js +432 -1
- package/dist/lib/stratus-client.js.map +1 -1
- package/dist/lib/world-model-store.d.ts +172 -0
- package/dist/lib/world-model-store.d.ts.map +1 -0
- package/dist/lib/world-model-store.js +487 -0
- package/dist/lib/world-model-store.js.map +1 -0
- package/dist/types/world-model.d.ts +478 -0
- package/dist/types/world-model.d.ts.map +1 -0
- package/dist/types/world-model.js +80 -0
- package/dist/types/world-model.js.map +1 -0
- package/dist/utils/jfl-config.d.ts +5 -0
- package/dist/utils/jfl-config.d.ts.map +1 -1
- package/dist/utils/jfl-config.js +13 -1
- package/dist/utils/jfl-config.js.map +1 -1
- package/package.json +1 -1
- package/packages/pi/extensions/hud-tool.ts +2 -24
- package/packages/pi/extensions/index.ts +48 -25
- package/packages/pi/extensions/onboarding-v1.ts +455 -0
- package/packages/pi/extensions/onboarding-v2.ts +516 -0
- package/packages/pi/extensions/onboarding-v3.ts +675 -0
- package/packages/pi/extensions/pivot-tool.ts +59 -0
- package/packages/pi/extensions/session.ts +58 -0
- package/packages/pi/extensions/types.ts +2 -0
- package/packages/pi/skills/pivot/SKILL.md +91 -0
- package/template/.claude/settings.json +9 -0
- package/dist/dashboard-static/assets/index-Ck8f9dcM.js +0 -121
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JFL → Tenet Migration Command
|
|
3
|
+
*
|
|
4
|
+
* Migrates a project from JFL naming to Tenet naming:
|
|
5
|
+
* - .jfl/ → .tenet/ directory rename
|
|
6
|
+
* - Config file content updates (jfl → tenet references)
|
|
7
|
+
* - .mcp.json server name update
|
|
8
|
+
* - .claude/settings.json hook command updates
|
|
9
|
+
* - CLAUDE.md reference updates
|
|
10
|
+
* - .gitignore updates
|
|
11
|
+
* - scripts/session/*.sh updates
|
|
12
|
+
*
|
|
13
|
+
* Designed for gradual rollout — runs per-project, not globally.
|
|
14
|
+
* The CLI itself supports both .jfl/ and .tenet/ during transition.
|
|
15
|
+
*
|
|
16
|
+
* @purpose Per-project migration from JFL to Tenet naming
|
|
17
|
+
*/
|
|
18
|
+
interface MigrateOptions {
|
|
19
|
+
dryRun?: boolean;
|
|
20
|
+
force?: boolean;
|
|
21
|
+
rollback?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function migrateTenetCommand(options?: MigrateOptions): Promise<void>;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=migrate-tenet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-tenet.d.ts","sourceRoot":"","sources":["../../src/commands/migrate-tenet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AA+ED,wBAAsB,mBAAmB,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4KrF"}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JFL → Tenet Migration Command
|
|
3
|
+
*
|
|
4
|
+
* Migrates a project from JFL naming to Tenet naming:
|
|
5
|
+
* - .jfl/ → .tenet/ directory rename
|
|
6
|
+
* - Config file content updates (jfl → tenet references)
|
|
7
|
+
* - .mcp.json server name update
|
|
8
|
+
* - .claude/settings.json hook command updates
|
|
9
|
+
* - CLAUDE.md reference updates
|
|
10
|
+
* - .gitignore updates
|
|
11
|
+
* - scripts/session/*.sh updates
|
|
12
|
+
*
|
|
13
|
+
* Designed for gradual rollout — runs per-project, not globally.
|
|
14
|
+
* The CLI itself supports both .jfl/ and .tenet/ during transition.
|
|
15
|
+
*
|
|
16
|
+
* @purpose Per-project migration from JFL to Tenet naming
|
|
17
|
+
*/
|
|
18
|
+
import chalk from "chalk";
|
|
19
|
+
import ora from "ora";
|
|
20
|
+
import * as fs from "fs";
|
|
21
|
+
import * as path from "path";
|
|
22
|
+
const REPLACEMENTS = [
|
|
23
|
+
// Script/file names with jfl prefix (must come before generic jfl replacement)
|
|
24
|
+
[/jfl-doctor\.sh/g, "tenet-doctor.sh"],
|
|
25
|
+
[/jfl-eval\.yml/g, "tenet-eval.yml"],
|
|
26
|
+
[/jfl-review\.yml/g, "tenet-review.yml"],
|
|
27
|
+
[/jfl-context-hub-mcp/g, "tenet-context-hub-mcp"],
|
|
28
|
+
[/jfl-service-registry-mcp/g, "tenet-service-registry-mcp"],
|
|
29
|
+
[/jfl-context/g, "tenet-context"],
|
|
30
|
+
[/jfl-platform/g, "tenet-platform"],
|
|
31
|
+
[/jfl-template/g, "tenet-template"],
|
|
32
|
+
[/jfl-cli/g, "tenet-cli"],
|
|
33
|
+
[/jfl-ide/g, "tenet-ide"],
|
|
34
|
+
// Directory paths
|
|
35
|
+
[/\.jfl\//g, ".tenet/"],
|
|
36
|
+
[/\.jfl"/g, '.tenet"'],
|
|
37
|
+
[/\.jfl'/g, ".tenet'"],
|
|
38
|
+
[/\.jfl\b/g, ".tenet"],
|
|
39
|
+
// MCP tool names (in CLAUDE.md)
|
|
40
|
+
[/mcp__jfl-context__/g, "mcp__tenet-context__"],
|
|
41
|
+
// Environment variables
|
|
42
|
+
[/JFL_/g, "TENET_"],
|
|
43
|
+
// CLI command (standalone "jfl" word — not part of filenames)
|
|
44
|
+
[/\bjfl\b/g, "tenet"],
|
|
45
|
+
// Brand name
|
|
46
|
+
[/\bJFL\b/g, "TENET"],
|
|
47
|
+
];
|
|
48
|
+
// Files to update content in (relative to project root)
|
|
49
|
+
const FILES_TO_UPDATE = [
|
|
50
|
+
".mcp.json",
|
|
51
|
+
".gitignore",
|
|
52
|
+
"CLAUDE.md",
|
|
53
|
+
".claude/settings.json",
|
|
54
|
+
".claude/service-settings.json",
|
|
55
|
+
];
|
|
56
|
+
// Script directories to scan
|
|
57
|
+
const SCRIPT_DIRS = [
|
|
58
|
+
"scripts/session",
|
|
59
|
+
"scripts",
|
|
60
|
+
];
|
|
61
|
+
function replaceContent(content) {
|
|
62
|
+
let result = content;
|
|
63
|
+
for (const [pattern, replacement] of REPLACEMENTS) {
|
|
64
|
+
result = result.replace(pattern, replacement);
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
function updateFile(filePath, dryRun) {
|
|
69
|
+
try {
|
|
70
|
+
if (!fs.existsSync(filePath))
|
|
71
|
+
return { updated: false };
|
|
72
|
+
const content = fs.readFileSync(filePath, "utf-8");
|
|
73
|
+
const updated = replaceContent(content);
|
|
74
|
+
if (content === updated)
|
|
75
|
+
return { updated: false };
|
|
76
|
+
if (!dryRun) {
|
|
77
|
+
fs.writeFileSync(filePath, updated);
|
|
78
|
+
}
|
|
79
|
+
return { updated: true };
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
return { updated: false, error: err.message };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export async function migrateTenetCommand(options = {}) {
|
|
86
|
+
const cwd = process.cwd();
|
|
87
|
+
const dryRun = options.dryRun ?? false;
|
|
88
|
+
const rollback = options.rollback ?? false;
|
|
89
|
+
const srcDir = rollback ? ".tenet" : ".jfl";
|
|
90
|
+
const destDir = rollback ? ".jfl" : ".tenet";
|
|
91
|
+
const srcPath = path.join(cwd, srcDir);
|
|
92
|
+
const destPath = path.join(cwd, destDir);
|
|
93
|
+
console.log("");
|
|
94
|
+
console.log(chalk.hex("#FFD700")(rollback
|
|
95
|
+
? "━━━ Tenet → JFL Rollback ━━━"
|
|
96
|
+
: "━━━ JFL → Tenet Migration ━━━"));
|
|
97
|
+
console.log("");
|
|
98
|
+
if (!fs.existsSync(srcPath)) {
|
|
99
|
+
if (fs.existsSync(destPath)) {
|
|
100
|
+
console.log(chalk.green(`Already migrated — ${destDir}/ exists.`));
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
console.log(chalk.red(`No ${srcDir}/ directory found. Nothing to migrate.`));
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (fs.existsSync(destPath) && !options.force) {
|
|
107
|
+
console.log(chalk.yellow(`${destDir}/ already exists. Use --force to overwrite.`));
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const result = {
|
|
111
|
+
renamed: [],
|
|
112
|
+
updated: [],
|
|
113
|
+
skipped: [],
|
|
114
|
+
errors: [],
|
|
115
|
+
};
|
|
116
|
+
// Step 1: Rename directory
|
|
117
|
+
const dirSpinner = ora(`${dryRun ? "[dry-run] " : ""}Renaming ${srcDir}/ → ${destDir}/`).start();
|
|
118
|
+
try {
|
|
119
|
+
if (!dryRun) {
|
|
120
|
+
fs.renameSync(srcPath, destPath);
|
|
121
|
+
}
|
|
122
|
+
result.renamed.push(`${srcDir}/ → ${destDir}/`);
|
|
123
|
+
dirSpinner.succeed(`${srcDir}/ → ${destDir}/`);
|
|
124
|
+
}
|
|
125
|
+
catch (err) {
|
|
126
|
+
dirSpinner.fail(`Failed: ${err.message}`);
|
|
127
|
+
result.errors.push({ file: srcDir, error: err.message });
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
// Step 2: Update config files
|
|
131
|
+
for (const relPath of FILES_TO_UPDATE) {
|
|
132
|
+
const filePath = path.join(cwd, relPath);
|
|
133
|
+
const { updated, error } = updateFile(filePath, dryRun);
|
|
134
|
+
if (error) {
|
|
135
|
+
result.errors.push({ file: relPath, error });
|
|
136
|
+
}
|
|
137
|
+
else if (updated) {
|
|
138
|
+
result.updated.push(relPath);
|
|
139
|
+
console.log(chalk.gray(` ✓ ${relPath}`));
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
result.skipped.push(relPath);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// Step 3: Update scripts
|
|
146
|
+
for (const scriptDir of SCRIPT_DIRS) {
|
|
147
|
+
const fullDir = path.join(cwd, scriptDir);
|
|
148
|
+
if (!fs.existsSync(fullDir))
|
|
149
|
+
continue;
|
|
150
|
+
try {
|
|
151
|
+
const files = fs.readdirSync(fullDir).filter(f => f.endsWith(".sh"));
|
|
152
|
+
for (const file of files) {
|
|
153
|
+
const filePath = path.join(fullDir, file);
|
|
154
|
+
const { updated, error } = updateFile(filePath, dryRun);
|
|
155
|
+
if (error) {
|
|
156
|
+
result.errors.push({ file: `${scriptDir}/${file}`, error });
|
|
157
|
+
}
|
|
158
|
+
else if (updated) {
|
|
159
|
+
result.updated.push(`${scriptDir}/${file}`);
|
|
160
|
+
console.log(chalk.gray(` ✓ ${scriptDir}/${file}`));
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
// Rename jfl-doctor.sh → tenet-doctor.sh
|
|
164
|
+
const doctorOld = path.join(fullDir, rollback ? "tenet-doctor.sh" : "jfl-doctor.sh");
|
|
165
|
+
const doctorNew = path.join(fullDir, rollback ? "jfl-doctor.sh" : "tenet-doctor.sh");
|
|
166
|
+
if (fs.existsSync(doctorOld)) {
|
|
167
|
+
if (!dryRun)
|
|
168
|
+
fs.renameSync(doctorOld, doctorNew);
|
|
169
|
+
result.renamed.push(`${path.basename(doctorOld)} → ${path.basename(doctorNew)}`);
|
|
170
|
+
console.log(chalk.gray(` ✓ ${path.basename(doctorOld)} → ${path.basename(doctorNew)}`));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
catch { }
|
|
174
|
+
}
|
|
175
|
+
// Step 4: Update .claude/skills
|
|
176
|
+
const skillsDir = path.join(cwd, ".claude", "skills");
|
|
177
|
+
if (fs.existsSync(skillsDir)) {
|
|
178
|
+
try {
|
|
179
|
+
const skills = fs.readdirSync(skillsDir);
|
|
180
|
+
for (const skill of skills) {
|
|
181
|
+
const skillMd = path.join(skillsDir, skill, "SKILL.md");
|
|
182
|
+
const { updated, error } = updateFile(skillMd, dryRun);
|
|
183
|
+
if (error) {
|
|
184
|
+
result.errors.push({ file: `.claude/skills/${skill}/SKILL.md`, error });
|
|
185
|
+
}
|
|
186
|
+
else if (updated) {
|
|
187
|
+
result.updated.push(`.claude/skills/${skill}/SKILL.md`);
|
|
188
|
+
console.log(chalk.gray(` ✓ .claude/skills/${skill}/SKILL.md`));
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
catch { }
|
|
193
|
+
}
|
|
194
|
+
// Step 5: Update GitHub Actions workflows
|
|
195
|
+
const workflowsDir = path.join(cwd, ".github", "workflows");
|
|
196
|
+
if (fs.existsSync(workflowsDir)) {
|
|
197
|
+
try {
|
|
198
|
+
const workflows = fs.readdirSync(workflowsDir).filter(f => f.endsWith(".yml") || f.endsWith(".yaml"));
|
|
199
|
+
for (const wf of workflows) {
|
|
200
|
+
const wfPath = path.join(workflowsDir, wf);
|
|
201
|
+
const { updated, error } = updateFile(wfPath, dryRun);
|
|
202
|
+
if (updated) {
|
|
203
|
+
result.updated.push(`.github/workflows/${wf}`);
|
|
204
|
+
console.log(chalk.gray(` ✓ .github/workflows/${wf}`));
|
|
205
|
+
}
|
|
206
|
+
// Rename jfl-eval.yml → tenet-eval.yml etc
|
|
207
|
+
if (wf.startsWith(rollback ? "tenet-" : "jfl-")) {
|
|
208
|
+
const newName = rollback
|
|
209
|
+
? wf.replace("tenet-", "jfl-")
|
|
210
|
+
: wf.replace("jfl-", "tenet-");
|
|
211
|
+
if (!dryRun)
|
|
212
|
+
fs.renameSync(wfPath, path.join(workflowsDir, newName));
|
|
213
|
+
result.renamed.push(`${wf} → ${newName}`);
|
|
214
|
+
console.log(chalk.gray(` ✓ ${wf} → ${newName}`));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
catch { }
|
|
219
|
+
}
|
|
220
|
+
// Step 6: Update config.json inside the data dir
|
|
221
|
+
const configPath = path.join(cwd, destDir, "config.json");
|
|
222
|
+
if (fs.existsSync(configPath)) {
|
|
223
|
+
const { updated } = updateFile(configPath, dryRun);
|
|
224
|
+
if (updated) {
|
|
225
|
+
result.updated.push(`${destDir}/config.json`);
|
|
226
|
+
console.log(chalk.gray(` ✓ ${destDir}/config.json`));
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
// Summary
|
|
230
|
+
console.log("");
|
|
231
|
+
if (result.errors.length > 0) {
|
|
232
|
+
console.log(chalk.yellow(`⚠ ${result.errors.length} errors:`));
|
|
233
|
+
for (const e of result.errors) {
|
|
234
|
+
console.log(chalk.red(` ${e.file}: ${e.error}`));
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
console.log(chalk.green(`✓ ${result.renamed.length} renamed, ${result.updated.length} updated, ${result.skipped.length} skipped`));
|
|
238
|
+
if (dryRun) {
|
|
239
|
+
console.log(chalk.yellow("\nDry run — no changes made. Run without --dry-run to apply."));
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
console.log("");
|
|
243
|
+
console.log(chalk.hex("#00FF88")(rollback
|
|
244
|
+
? "Rollback complete. You're back on JFL."
|
|
245
|
+
: "Migration complete. You're on Tenet now."));
|
|
246
|
+
if (!rollback) {
|
|
247
|
+
console.log(chalk.gray(" Run: npm uninstall -g jfl && npm install -g tenet"));
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
console.log("");
|
|
251
|
+
}
|
|
252
|
+
//# sourceMappingURL=migrate-tenet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-tenet.js","sourceRoot":"","sources":["../../src/commands/migrate-tenet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAgB5B,MAAM,YAAY,GAA4B;IAC5C,+EAA+E;IAC/E,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IACtC,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IACpC,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IACxC,CAAC,sBAAsB,EAAE,uBAAuB,CAAC;IACjD,CAAC,2BAA2B,EAAE,4BAA4B,CAAC;IAC3D,CAAC,cAAc,EAAE,eAAe,CAAC;IACjC,CAAC,eAAe,EAAE,gBAAgB,CAAC;IACnC,CAAC,eAAe,EAAE,gBAAgB,CAAC;IACnC,CAAC,UAAU,EAAE,WAAW,CAAC;IACzB,CAAC,UAAU,EAAE,WAAW,CAAC;IAEzB,kBAAkB;IAClB,CAAC,UAAU,EAAE,SAAS,CAAC;IACvB,CAAC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AAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,QAAQ;YACvC,CAAC,CAAC,wCAAwC;YAC1C,CAAC,CAAC,0CAA0C,CAC7C,CAAC,CAAA;QACF,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,qDAAqD,CAAC,CAAC,CAAA;QAChF,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;AACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peter.d.ts","sourceRoot":"","sources":["../../src/commands/peter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"peter.d.ts","sourceRoot":"","sources":["../../src/commands/peter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAwsEH,wBAAsB,YAAY,CAChC,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,OAAO,CAAA;CAAO,iBA4JrK"}
|
package/dist/commands/peter.js
CHANGED
|
@@ -1572,6 +1572,27 @@ async function showMetrics(projectRoot) {
|
|
|
1572
1572
|
async function runDailyLoop(projectRoot) {
|
|
1573
1573
|
const { MetaOrchestrator } = await import("../lib/meta-orchestrator.js");
|
|
1574
1574
|
const { loadAllAgentConfigs } = await import("../lib/agent-config.js");
|
|
1575
|
+
// Prevent concurrent runs with lockfile
|
|
1576
|
+
const lockPath = path.join(projectRoot, ".jfl", "daily.lock");
|
|
1577
|
+
if (fs.existsSync(lockPath)) {
|
|
1578
|
+
const lockContent = fs.readFileSync(lockPath, "utf-8").trim();
|
|
1579
|
+
const lockTime = parseInt(lockContent, 10);
|
|
1580
|
+
const lockAge = Date.now() - lockTime;
|
|
1581
|
+
const MAX_LOCK_AGE = 2 * 60 * 60 * 1000; // 2 hours stale lock threshold
|
|
1582
|
+
if (lockAge < MAX_LOCK_AGE) {
|
|
1583
|
+
console.log(chalk.red(`\n Daily loop already running (locked ${Math.floor(lockAge / 60000)}m ago). Exiting.\n`));
|
|
1584
|
+
return;
|
|
1585
|
+
}
|
|
1586
|
+
console.log(chalk.yellow(`\n Stale lock found (${Math.floor(lockAge / 60000)}m old), breaking it.\n`));
|
|
1587
|
+
}
|
|
1588
|
+
fs.writeFileSync(lockPath, String(Date.now()));
|
|
1589
|
+
const releaseLock = () => { try {
|
|
1590
|
+
fs.unlinkSync(lockPath);
|
|
1591
|
+
}
|
|
1592
|
+
catch { } };
|
|
1593
|
+
process.on("exit", releaseLock);
|
|
1594
|
+
process.on("SIGTERM", () => { releaseLock(); process.exit(143); });
|
|
1595
|
+
process.on("SIGINT", () => { releaseLock(); process.exit(130); });
|
|
1575
1596
|
console.log(chalk.bold("\n Peter Parker - Daily RL Agent Loop\n"));
|
|
1576
1597
|
const orchestrator = new MetaOrchestrator(projectRoot);
|
|
1577
1598
|
const agents = orchestrator.getAgents();
|
|
@@ -1644,6 +1665,7 @@ async function runDailyLoop(projectRoot) {
|
|
|
1644
1665
|
}
|
|
1645
1666
|
// ── Layer 3: Strategic reasoning ──
|
|
1646
1667
|
console.log(chalk.cyan("\n Layer 3: Strategic reasoning...\n"));
|
|
1668
|
+
let strategicRunList = [];
|
|
1647
1669
|
try {
|
|
1648
1670
|
const { StratusClient } = await import("../lib/stratus-client.js");
|
|
1649
1671
|
const stratus = new StratusClient();
|
|
@@ -1677,6 +1699,9 @@ Be concise. Output a JSON object: { "run": ["agent1", "agent2"], "skip": ["agent
|
|
|
1677
1699
|
const jsonMatch = strategicText.match(/\{[\s\S]*\}/);
|
|
1678
1700
|
if (jsonMatch) {
|
|
1679
1701
|
const strategic = JSON.parse(jsonMatch[0]);
|
|
1702
|
+
if (Array.isArray(strategic.run)) {
|
|
1703
|
+
strategicRunList = strategic.run;
|
|
1704
|
+
}
|
|
1680
1705
|
if (strategic.reasoning) {
|
|
1681
1706
|
console.log(chalk.cyan(`\n Reasoning: ${strategic.reasoning}`));
|
|
1682
1707
|
}
|
|
@@ -1731,12 +1756,28 @@ Be concise. Output a JSON object: { "run": ["agent1", "agent2"], "skip": ["agent
|
|
|
1731
1756
|
console.log(chalk.gray(` EMA Reward: ${decision.emaReward.toFixed(4)}`));
|
|
1732
1757
|
}
|
|
1733
1758
|
console.log();
|
|
1734
|
-
// Run autoresearch for stale agents
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1759
|
+
// Run autoresearch for stale agents — filtered by strategic reasoning
|
|
1760
|
+
// Cap rounds for nightly: 5 rounds per agent keeps total runtime under 1 hour
|
|
1761
|
+
const NIGHTLY_ROUNDS_CAP = 5;
|
|
1762
|
+
// Only run stale agents that strategic reasoning approved (if available)
|
|
1763
|
+
const filteredStaleAgents = strategicRunList.length > 0
|
|
1764
|
+
? staleAgents.filter(a => strategicRunList.includes(a))
|
|
1765
|
+
: staleAgents;
|
|
1766
|
+
if (filteredStaleAgents.length > 0) {
|
|
1767
|
+
console.log(chalk.cyan(` Running autoresearch for ${filteredStaleAgents.length} stale agent(s) (${NIGHTLY_ROUNDS_CAP} rounds each)...\n`));
|
|
1768
|
+
if (staleAgents.length !== filteredStaleAgents.length) {
|
|
1769
|
+
const skipped = staleAgents.filter(a => !filteredStaleAgents.includes(a));
|
|
1770
|
+
console.log(chalk.gray(` Skipped by strategic reasoning: ${skipped.join(", ")}\n`));
|
|
1771
|
+
}
|
|
1772
|
+
for (const agentName of filteredStaleAgents) {
|
|
1738
1773
|
console.log(chalk.bold(`\n ── ${agentName} ${"─".repeat(45)}\n`));
|
|
1739
|
-
|
|
1774
|
+
try {
|
|
1775
|
+
await agentRun(projectRoot, agentName, NIGHTLY_ROUNDS_CAP);
|
|
1776
|
+
}
|
|
1777
|
+
catch (err) {
|
|
1778
|
+
console.log(chalk.red(` Agent ${agentName} failed: ${err.message}`));
|
|
1779
|
+
console.log(chalk.gray(" Continuing to next agent...\n"));
|
|
1780
|
+
}
|
|
1740
1781
|
}
|
|
1741
1782
|
}
|
|
1742
1783
|
// Post summary event
|
|
@@ -1748,6 +1789,7 @@ Be concise. Output a JSON object: { "run": ["agent1", "agent2"], "skip": ["agent
|
|
|
1748
1789
|
scheduled: decision.agent.name,
|
|
1749
1790
|
reason: decision.reason,
|
|
1750
1791
|
});
|
|
1792
|
+
releaseLock();
|
|
1751
1793
|
console.log(chalk.green("\n Daily loop complete.\n"));
|
|
1752
1794
|
}
|
|
1753
1795
|
async function agentSwarm(projectRoot, rounds) {
|