@hamp10/agentforge 0.2.21 → 0.2.23
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/bin/agentforge.js +909 -115
- package/package.json +2 -1
- package/scripts/check-task-semantics.js +911 -0
- package/scripts/postinstall.js +20 -5
- package/src/OllamaAgent.js +1178 -246
- package/src/OpenClawCLI.js +5897 -748
- package/src/browser.js +392 -0
- package/src/default-task-guides.js +95 -0
- package/src/resolveOpenclaw.js +38 -7
- package/src/selfUpdate.js +31 -3
- package/src/supervisor.js +88 -20
- package/src/taskSemantics.js +141 -0
- package/src/worker.js +4257 -230
- package/templates/agent/AGENTFORGE.md +151 -53
- package/templates/hooks/agentforge-platform/handler.js +322 -0
- package/src/HampAgentCLI.js +0 -125
- package/src/hampagent/browser.js +0 -321
- package/src/hampagent/runner.js +0 -277
- package/src/hampagent/sessions.js +0 -62
- package/src/hampagent/tools.js +0 -298
package/scripts/postinstall.js
CHANGED
|
@@ -1,15 +1,30 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Runs automatically after `npm install -g @hamp10/agentforge`.
|
|
3
3
|
// Ensures the npm global bin directory is on PATH so users can just type:
|
|
4
|
-
// agentforge
|
|
4
|
+
// agentforge setup
|
|
5
5
|
// Works on macOS, Linux (including Raspberry Pi).
|
|
6
6
|
|
|
7
7
|
import { existsSync, readFileSync, appendFileSync } from 'fs';
|
|
8
8
|
import { homedir } from 'os';
|
|
9
9
|
import path from 'path';
|
|
10
|
+
import { execFileSync } from 'child_process';
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
function npmPrefix() {
|
|
13
|
+
if (process.env.npm_config_prefix) return process.env.npm_config_prefix;
|
|
14
|
+
try {
|
|
15
|
+
return execFileSync('npm', ['config', 'get', 'prefix'], {
|
|
16
|
+
encoding: 'utf8',
|
|
17
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
18
|
+
}).trim();
|
|
19
|
+
} catch {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const prefix = npmPrefix();
|
|
25
|
+
const binDir = prefix
|
|
26
|
+
? (process.platform === 'win32' ? prefix : path.join(prefix, 'bin'))
|
|
27
|
+
: path.dirname(process.execPath);
|
|
13
28
|
|
|
14
29
|
// If already on PATH, nothing to do.
|
|
15
30
|
const pathDirs = (process.env.PATH || '').split(path.delimiter).map(d => d.replace(/\/$/, ''));
|
|
@@ -49,7 +64,7 @@ try {
|
|
|
49
64
|
console.log('');
|
|
50
65
|
console.log(`✅ AgentForge: added to PATH in ${profileFile}`);
|
|
51
66
|
console.log(` Open a new terminal (or run: source ${profileFile})`);
|
|
52
|
-
console.log(' Then type: agentforge
|
|
67
|
+
console.log(' Then type: agentforge setup');
|
|
53
68
|
console.log('');
|
|
54
69
|
} catch (err) {
|
|
55
70
|
// Non-fatal — just tell the user what to add manually.
|
|
@@ -57,6 +72,6 @@ try {
|
|
|
57
72
|
console.log(`⚠️ AgentForge: could not update ${profileFile} automatically.`);
|
|
58
73
|
console.log(' Add this line to your shell profile manually:');
|
|
59
74
|
console.log(` export PATH="${binDir}:$PATH"`);
|
|
60
|
-
console.log(' Then open a new terminal and type: agentforge
|
|
75
|
+
console.log(' Then open a new terminal and type: agentforge setup');
|
|
61
76
|
console.log('');
|
|
62
77
|
}
|