Skip to content

Commit c1cf734

Browse files
Neurocursoragent
andcommitted
Update blocks from portal-docs, fix Electron/scripts, refresh toolbox
- Pull latest portal-docs resources; regenerate selection-lists, generated_blocks, bf6portal_blocks.json (921 blocks) - Add 135 missing blocks to toolbox via fill_toolbox_gaps; fix category/type regex in update_blocks_db and fill_toolbox_gaps - Electron: fix PTY cwd on Windows (HOME/USERPROFILE/homedir), guard ptyProcess before stdout/stderr - Add tools/update_andy6170_unlimited_variables.py stub for npm run update:andy-vars - README: note Battlefield Portal Community and new-block support Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent df3e4d6 commit c1cf734

17 files changed

+5417
-399
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ Utilities live in `tools/` (used to generate/inspect blocks/toolboxes from Porta
126126

127127
- Block help/tooltips and Portal data are derived from **Portal Docs** by the Battlefield Portal Community:
128128
- [battlefield-portal-community/portal-docs](https://github.com/battlefield-portal-community/portal-docs)
129+
- The [Battlefield Portal Community](https://github.com/battlefield-portal-community) org hosts portal-docs (automated docs from [portal.battlefield.com](https://portal.battlefield.com)), PortalScriptingExamples, PortalSDK, and other tools. This editor uses portal-docs; new blocks added by the official Battlefield 6 Portal system are supported via placeholder block registration when importing templates—you can update `bf6portal_blocks.json` and regenerate blocks/toolbox to add first-class support for new block types.
129130

130131
## License
131132

bf6portal_blocks.json

Lines changed: 5222 additions & 338 deletions
Large diffs are not rendered by default.

electron-main.js

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,15 @@ function createWindow() {
127127

128128
// Initialize PTY (Sliding Neural Link)
129129
const shell = os.platform() === 'win32' ? 'powershell.exe' : 'bash';
130-
130+
const cwd = process.env.HOME || process.env.USERPROFILE || (typeof os.homedir === 'function' ? os.homedir() : undefined);
131+
131132
if (pty) {
132133
try {
133134
ptyProcess = pty.spawn(shell, [], {
134135
name: 'xterm-color',
135136
cols: 80,
136137
rows: 30,
137-
cwd: process.env.HOME,
138+
cwd: cwd,
138139
env: process.env
139140
});
140141
} catch (e) {
@@ -144,23 +145,30 @@ function createWindow() {
144145

145146
// Fallback if PTY failed or missing
146147
if (!ptyProcess) {
147-
ptyProcess = spawn(shell, [], {
148-
cwd: process.env.HOME,
149-
env: process.env,
150-
shell: true
151-
});
152-
ptyProcess.resize = () => {}; // Mock
148+
try {
149+
ptyProcess = spawn(shell, [], {
150+
cwd: cwd,
151+
env: process.env,
152+
shell: true
153+
});
154+
if (ptyProcess) ptyProcess.resize = () => {}; // Mock
155+
} catch (e) {
156+
console.warn('[BF6] Shell spawn fallback failed:', e);
157+
}
153158
}
154159

155-
// Data handling
156-
ptyProcess.stdout.on('data', (data) => {
157-
if (mainWindow) mainWindow.webContents.send('terminal-incoming', data);
158-
});
159-
160-
if (ptyProcess.stderr) {
161-
ptyProcess.stderr.on('data', (data) => {
162-
if (mainWindow) mainWindow.webContents.send('terminal-incoming', data);
163-
});
160+
// Data handling (only if we have a valid process)
161+
if (ptyProcess) {
162+
if (ptyProcess.stdout) {
163+
ptyProcess.stdout.on('data', (data) => {
164+
if (mainWindow) mainWindow.webContents.send('terminal-incoming', data);
165+
});
166+
}
167+
if (ptyProcess.stderr) {
168+
ptyProcess.stderr.on('data', (data) => {
169+
if (mainWindow) mainWindow.webContents.send('terminal-incoming', data);
170+
});
171+
}
164172
}
165173

166174
// IPC
@@ -197,15 +205,15 @@ function createWindow() {
197205
}
198206

199207
// Auto-start Gemini (Context: BF6 Portal)
200-
setTimeout(() => {
201-
const startCmd = 'gemini\r';
202-
// We could inject a system prompt here if Gemini CLI supports it via args
203-
// For now, we just launch it.
204-
if (ptyProcess) {
205-
if (ptyProcess.write) ptyProcess.write(startCmd);
206-
else if (ptyProcess.stdin) ptyProcess.stdin.write(startCmd);
207-
}
208-
}, 2000);
208+
if (ptyProcess) {
209+
setTimeout(() => {
210+
const startCmd = 'gemini\r';
211+
if (ptyProcess) {
212+
if (ptyProcess.write) ptyProcess.write(startCmd);
213+
else if (ptyProcess.stdin) ptyProcess.stdin.write(startCmd);
214+
}
215+
}, 2000);
216+
}
209217
}
210218

211219
app.on('ready', async () => {
-17.7 KB
Binary file not shown.
-23.1 KB
Binary file not shown.
-3.85 KB
Binary file not shown.
-2.2 KB
Binary file not shown.
-3.54 KB
Binary file not shown.
-3.52 KB
Binary file not shown.
-2.78 KB
Binary file not shown.

0 commit comments

Comments
 (0)