context-foundry 2.5.4 → 3.0.8
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/README.md +25 -54
- package/bin/foundry +19 -0
- package/bin/foundry-native +0 -0
- package/install.js +185 -0
- package/package.json +27 -28
- package/Dockerfile +0 -17
- package/bin/cf.js +0 -153
- package/bin/cfd.js +0 -170
- package/cf.html +0 -6618
- package/docker-compose.yml +0 -30
- package/nginx.conf +0 -74
- package/scripts/postinstall.js +0 -147
package/docker-compose.yml
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
services:
|
|
2
|
-
dashboard:
|
|
3
|
-
build:
|
|
4
|
-
context: .
|
|
5
|
-
dockerfile: Dockerfile
|
|
6
|
-
container_name: cf-dashboard
|
|
7
|
-
restart: unless-stopped
|
|
8
|
-
ports:
|
|
9
|
-
- "8421:8421"
|
|
10
|
-
# On Mac, host.docker.internal works automatically
|
|
11
|
-
# On Linux, uncomment the extra_hosts line below:
|
|
12
|
-
# extra_hosts:
|
|
13
|
-
# - "host.docker.internal:host-gateway"
|
|
14
|
-
healthcheck:
|
|
15
|
-
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8421/"]
|
|
16
|
-
interval: 30s
|
|
17
|
-
timeout: 5s
|
|
18
|
-
retries: 3
|
|
19
|
-
|
|
20
|
-
# Usage:
|
|
21
|
-
# docker compose up -d # Start dashboard
|
|
22
|
-
# docker compose down # Stop dashboard
|
|
23
|
-
# docker compose logs -f # View logs
|
|
24
|
-
# docker compose restart # Restart dashboard
|
|
25
|
-
#
|
|
26
|
-
# The daemon must be running on the host:
|
|
27
|
-
# cfd start # Start daemon on host
|
|
28
|
-
# cfd status # Check daemon status
|
|
29
|
-
#
|
|
30
|
-
# Access dashboard at: http://localhost:8421/
|
package/nginx.conf
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
server {
|
|
2
|
-
listen 8421;
|
|
3
|
-
server_name localhost;
|
|
4
|
-
|
|
5
|
-
# Serve static dashboard files
|
|
6
|
-
location / {
|
|
7
|
-
root /usr/share/nginx/html;
|
|
8
|
-
index index.html;
|
|
9
|
-
try_files $uri $uri/ /index.html;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
# Proxy API requests to daemon on host
|
|
13
|
-
# Use host.docker.internal to reach host machine from container
|
|
14
|
-
location /status {
|
|
15
|
-
proxy_pass http://host.docker.internal:8420/status;
|
|
16
|
-
proxy_http_version 1.1;
|
|
17
|
-
proxy_set_header Host $host;
|
|
18
|
-
proxy_set_header X-Real-IP $remote_addr;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
location /events {
|
|
22
|
-
proxy_pass http://host.docker.internal:8420/events;
|
|
23
|
-
proxy_http_version 1.1;
|
|
24
|
-
proxy_set_header Connection '';
|
|
25
|
-
proxy_buffering off;
|
|
26
|
-
proxy_cache off;
|
|
27
|
-
chunked_transfer_encoding off;
|
|
28
|
-
# SSE specific settings
|
|
29
|
-
proxy_read_timeout 86400s;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
location /pending-approvals {
|
|
33
|
-
proxy_pass http://host.docker.internal:8420/pending-approvals;
|
|
34
|
-
proxy_http_version 1.1;
|
|
35
|
-
proxy_set_header Host $host;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
location /phase-prompts {
|
|
39
|
-
proxy_pass http://host.docker.internal:8420/phase-prompts;
|
|
40
|
-
proxy_http_version 1.1;
|
|
41
|
-
proxy_set_header Host $host;
|
|
42
|
-
proxy_set_header Content-Type $content_type;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
location /phase-acknowledge {
|
|
46
|
-
proxy_pass http://host.docker.internal:8420/phase-acknowledge;
|
|
47
|
-
proxy_http_version 1.1;
|
|
48
|
-
proxy_set_header Host $host;
|
|
49
|
-
proxy_set_header Content-Type application/json;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
location /phase-inject {
|
|
53
|
-
proxy_pass http://host.docker.internal:8420/phase-inject;
|
|
54
|
-
proxy_http_version 1.1;
|
|
55
|
-
proxy_set_header Host $host;
|
|
56
|
-
proxy_set_header Content-Type application/json;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
location /agent-activity {
|
|
60
|
-
proxy_pass http://host.docker.internal:8420/agent-activity;
|
|
61
|
-
proxy_http_version 1.1;
|
|
62
|
-
proxy_set_header Connection '';
|
|
63
|
-
proxy_buffering off;
|
|
64
|
-
proxy_cache off;
|
|
65
|
-
chunked_transfer_encoding off;
|
|
66
|
-
proxy_read_timeout 86400s;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
location /job/ {
|
|
70
|
-
proxy_pass http://host.docker.internal:8420/job/;
|
|
71
|
-
proxy_http_version 1.1;
|
|
72
|
-
proxy_set_header Host $host;
|
|
73
|
-
}
|
|
74
|
-
}
|
package/scripts/postinstall.js
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Post-install script for context-foundry npm package
|
|
5
|
-
*
|
|
6
|
-
* This script runs after `npm install` and ensures the Python
|
|
7
|
-
* package is installed via pip.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
const { spawnSync } = require('child_process');
|
|
11
|
-
|
|
12
|
-
// ANSI colors
|
|
13
|
-
const colors = {
|
|
14
|
-
red: '\x1b[31m',
|
|
15
|
-
green: '\x1b[32m',
|
|
16
|
-
yellow: '\x1b[33m',
|
|
17
|
-
cyan: '\x1b[36m',
|
|
18
|
-
dim: '\x1b[2m',
|
|
19
|
-
reset: '\x1b[0m',
|
|
20
|
-
bold: '\x1b[1m'
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
function log(msg, color = '') {
|
|
24
|
-
console.log(`${color}${msg}${colors.reset}`);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function error(msg) {
|
|
28
|
-
console.error(`${colors.red}${msg}${colors.reset}`);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Find Python 3.10+ executable
|
|
33
|
-
*/
|
|
34
|
-
function findPython() {
|
|
35
|
-
const pythonCommands = ['python3', 'python'];
|
|
36
|
-
|
|
37
|
-
for (const cmd of pythonCommands) {
|
|
38
|
-
try {
|
|
39
|
-
const result = spawnSync(cmd, ['--version'], {
|
|
40
|
-
encoding: 'utf-8',
|
|
41
|
-
timeout: 5000
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
if (result.status === 0) {
|
|
45
|
-
const version = result.stdout.trim() || result.stderr.trim();
|
|
46
|
-
const match = version.match(/Python (\d+)\.(\d+)/);
|
|
47
|
-
if (match) {
|
|
48
|
-
const major = parseInt(match[1], 10);
|
|
49
|
-
const minor = parseInt(match[2], 10);
|
|
50
|
-
if (major === 3 && minor >= 10) {
|
|
51
|
-
return { cmd, major, minor };
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
} catch (e) {
|
|
56
|
-
// Continue to next command
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Check if context-foundry Python package is already installed
|
|
64
|
-
*/
|
|
65
|
-
function checkInstalled(pythonCmd) {
|
|
66
|
-
const result = spawnSync(pythonCmd, ['-m', 'pip', 'show', 'context-foundry'], {
|
|
67
|
-
encoding: 'utf-8',
|
|
68
|
-
timeout: 10000
|
|
69
|
-
});
|
|
70
|
-
return result.status === 0;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Install the Python package
|
|
75
|
-
*/
|
|
76
|
-
function installPythonPackage(pythonCmd) {
|
|
77
|
-
log('\nInstalling context-foundry Python package...', colors.cyan);
|
|
78
|
-
|
|
79
|
-
const result = spawnSync(
|
|
80
|
-
pythonCmd,
|
|
81
|
-
['-m', 'pip', 'install', '--upgrade', 'context-foundry'],
|
|
82
|
-
{
|
|
83
|
-
stdio: 'inherit',
|
|
84
|
-
timeout: 300000 // 5 minutes
|
|
85
|
-
}
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
return result.status === 0;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function main() {
|
|
92
|
-
log(`\n${'='.repeat(50)}`, colors.dim);
|
|
93
|
-
log(`${colors.bold}Context Foundry${colors.reset} - Post-install setup`);
|
|
94
|
-
log(`${'='.repeat(50)}`, colors.dim);
|
|
95
|
-
|
|
96
|
-
// Step 1: Find Python
|
|
97
|
-
log('\nChecking Python installation...', colors.cyan);
|
|
98
|
-
const python = findPython();
|
|
99
|
-
|
|
100
|
-
if (!python) {
|
|
101
|
-
log(`\n${colors.yellow}Warning: Python 3.10+ not found.${colors.reset}`);
|
|
102
|
-
log(`\nThe npm package is installed, but you'll need Python to run it.`);
|
|
103
|
-
log(`\nInstall Python 3.10+ from:`);
|
|
104
|
-
log(` macOS: ${colors.cyan}brew install python@3.12${colors.reset}`);
|
|
105
|
-
log(` Ubuntu: ${colors.cyan}sudo apt install python3.12${colors.reset}`);
|
|
106
|
-
log(` Windows: ${colors.cyan}https://www.python.org/downloads/${colors.reset}`);
|
|
107
|
-
log(`\nThen run: ${colors.cyan}pip install context-foundry${colors.reset}\n`);
|
|
108
|
-
// Don't fail - the bin scripts will handle this at runtime
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
log(` Found ${colors.green}Python ${python.major}.${python.minor}${colors.reset} (${python.cmd})`);
|
|
113
|
-
|
|
114
|
-
// Step 2: Check if already installed
|
|
115
|
-
if (checkInstalled(python.cmd)) {
|
|
116
|
-
log(` ${colors.green}context-foundry already installed${colors.reset}`);
|
|
117
|
-
log(`\n${colors.green}Ready to use!${colors.reset} Run ${colors.cyan}cf${colors.reset} to get started.\n`);
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// Step 3: Install Python package
|
|
122
|
-
const installed = installPythonPackage(python.cmd);
|
|
123
|
-
|
|
124
|
-
if (installed) {
|
|
125
|
-
log(`\n${colors.green}Python package installed!${colors.reset}`);
|
|
126
|
-
|
|
127
|
-
// Run cf setup to configure Claude Code
|
|
128
|
-
log(`\nConfiguring Claude Code integration...`);
|
|
129
|
-
const setup = spawnSync('cf', ['setup'], {
|
|
130
|
-
stdio: 'inherit',
|
|
131
|
-
timeout: 30000
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
if (setup.status === 0) {
|
|
135
|
-
log(`\n${colors.green}Setup complete!${colors.reset}`);
|
|
136
|
-
} else {
|
|
137
|
-
log(`\n${colors.yellow}Note: Run 'cf setup' manually to configure Claude Code.${colors.reset}`);
|
|
138
|
-
}
|
|
139
|
-
} else {
|
|
140
|
-
error(`\nFailed to install Python package.`);
|
|
141
|
-
log(`\nTry installing manually:`);
|
|
142
|
-
log(` ${colors.cyan}pip install context-foundry${colors.reset}\n`);
|
|
143
|
-
// Don't fail npm install - user can fix this manually
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
main();
|