@pixelbyte-software/pixcode 1.53.12 → 1.53.14
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/assets/{index-kP_gZ-wL.js → index-CV_x2mrI.js} +173 -173
- package/dist/index.html +1 -1
- package/dist-server/server/index.js +51 -5
- package/dist-server/server/index.js.map +1 -1
- package/dist-server/server/routes/auth.js +41 -1
- package/dist-server/server/routes/auth.js.map +1 -1
- package/dist-server/server/routes/git.js +60 -3
- package/dist-server/server/routes/git.js.map +1 -1
- package/dist-server/server/routes/network.js +17 -1
- package/dist-server/server/routes/network.js.map +1 -1
- package/dist-server/server/services/external-access.js +45 -21
- package/dist-server/server/services/external-access.js.map +1 -1
- package/dist-server/server/services/qr-login.js +115 -0
- package/dist-server/server/services/qr-login.js.map +1 -0
- package/dist-server/server/services/telegram/bot.js +18 -1
- package/dist-server/server/services/telegram/bot.js.map +1 -1
- package/dist-server/server/services/telegram/control-center.js +225 -9
- package/dist-server/server/services/telegram/control-center.js.map +1 -1
- package/dist-server/server/services/telegram/translations.js +22 -2
- package/dist-server/server/services/telegram/translations.js.map +1 -1
- package/package.json +1 -1
- package/server/index.js +59 -5
- package/server/routes/auth.js +47 -1
- package/server/routes/git.js +70 -3
- package/server/routes/network.js +18 -1
- package/server/services/external-access.js +49 -21
- package/server/services/qr-login.js +126 -0
- package/server/services/telegram/bot.js +15 -0
- package/server/services/telegram/control-center.js +241 -9
- package/server/services/telegram/translations.js +22 -2
package/dist/index.html
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
|
|
36
36
|
<!-- Prevent zoom on iOS -->
|
|
37
37
|
<meta name="format-detection" content="telephone=no" />
|
|
38
|
-
<script type="module" crossorigin src="/assets/index-
|
|
38
|
+
<script type="module" crossorigin src="/assets/index-CV_x2mrI.js"></script>
|
|
39
39
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-DB6V5Fl1.js">
|
|
40
40
|
<link rel="modulepreload" crossorigin href="/assets/vendor-codemirror-CIYNS698.js">
|
|
41
41
|
<link rel="modulepreload" crossorigin href="/assets/vendor-xterm-C7tpxJl7.js">
|
|
@@ -120,7 +120,7 @@ import { adapterRegistry, ClaudeCodeA2AAdapter, CodexA2AAdapter, CursorA2AAdapte
|
|
|
120
120
|
import networkRoutes from './routes/network.js';
|
|
121
121
|
import telegramRoutes from './routes/telegram.js';
|
|
122
122
|
import { restoreRequestedTunnel } from './services/external-access.js';
|
|
123
|
-
import { restoreBotFromConfig } from './services/telegram/bot.js';
|
|
123
|
+
import { notifyTelegramTerminalAttached, restoreBotFromConfig } from './services/telegram/bot.js';
|
|
124
124
|
import { ensurePortOpen } from './utils/port-access.js';
|
|
125
125
|
import { applyAllStoredCredentialsToEnv, } from './services/provider-credentials.js';
|
|
126
126
|
import { primeCliBinPath } from './services/install-jobs.js';
|
|
@@ -1106,6 +1106,7 @@ function appendPtySessionBuffer(session, data) {
|
|
|
1106
1106
|
value = value.slice(-PTY_SESSION_BUFFER_MAX_BYTES);
|
|
1107
1107
|
valueBytes = Buffer.byteLength(value, 'utf8');
|
|
1108
1108
|
}
|
|
1109
|
+
session.totalOutputBytes = (session.totalOutputBytes || 0) + valueBytes;
|
|
1109
1110
|
session.buffer.push(value);
|
|
1110
1111
|
session.bufferBytes = (session.bufferBytes || 0) + valueBytes;
|
|
1111
1112
|
while (session.buffer.length > 0 && session.bufferBytes > PTY_SESSION_BUFFER_MAX_BYTES) {
|
|
@@ -1115,6 +1116,27 @@ function appendPtySessionBuffer(session, data) {
|
|
|
1115
1116
|
if (session.bufferBytes < 0)
|
|
1116
1117
|
session.bufferBytes = 0;
|
|
1117
1118
|
}
|
|
1119
|
+
function readPtySessionBufferedOutput(session, { maxChars = 12000, sinceCursor = null } = {}) {
|
|
1120
|
+
const rawBuffer = (session?.buffer || []).join('');
|
|
1121
|
+
const bufferBytes = session?.bufferBytes || Buffer.byteLength(rawBuffer, 'utf8');
|
|
1122
|
+
const outputCursor = session?.totalOutputBytes || bufferBytes;
|
|
1123
|
+
const bufferStartCursor = Math.max(0, outputCursor - bufferBytes);
|
|
1124
|
+
let rawOutput = rawBuffer;
|
|
1125
|
+
if (Number.isFinite(sinceCursor)) {
|
|
1126
|
+
const skipBytes = Math.max(0, sinceCursor - bufferStartCursor);
|
|
1127
|
+
if (skipBytes > 0) {
|
|
1128
|
+
rawOutput = Buffer.from(rawBuffer, 'utf8').slice(skipBytes).toString('utf8');
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
if (rawOutput.length > maxChars) {
|
|
1132
|
+
rawOutput = rawOutput.slice(-maxChars);
|
|
1133
|
+
}
|
|
1134
|
+
return {
|
|
1135
|
+
rawOutput,
|
|
1136
|
+
outputCursor,
|
|
1137
|
+
bufferStartCursor,
|
|
1138
|
+
};
|
|
1139
|
+
}
|
|
1118
1140
|
function normalizeTerminalStartupInput(input) {
|
|
1119
1141
|
return `\x15${String(input || '').replace(/(?:\r\n|\r|\n)+$/u, '')}\r`;
|
|
1120
1142
|
}
|
|
@@ -1439,6 +1461,8 @@ app.get('/api/shell/sessions/provider-output', authenticateToken, requireProject
|
|
|
1439
1461
|
const tabId = readPtyTarget(req.query.tabId);
|
|
1440
1462
|
const sessionId = readPtyTarget(req.query.sessionId);
|
|
1441
1463
|
const maxChars = Math.min(20000, Math.max(1000, Number.parseInt(String(req.query.maxChars || '12000'), 10) || 12000));
|
|
1464
|
+
const sinceCursorRaw = Number.parseInt(String(req.query.sinceCursor ?? ''), 10);
|
|
1465
|
+
const sinceCursor = Number.isFinite(sinceCursorRaw) ? Math.max(0, sinceCursorRaw) : null;
|
|
1442
1466
|
if (!SHELL_CLI_PROVIDERS.has(provider)) {
|
|
1443
1467
|
return res.status(400).json({ error: 'Unsupported provider' });
|
|
1444
1468
|
}
|
|
@@ -1452,6 +1476,8 @@ app.get('/api/shell/sessions/provider-output', authenticateToken, requireProject
|
|
|
1452
1476
|
tabId,
|
|
1453
1477
|
sessionId,
|
|
1454
1478
|
output: '',
|
|
1479
|
+
outputCursor: 0,
|
|
1480
|
+
bufferStartCursor: 0,
|
|
1455
1481
|
message: 'Multiple provider terminal sessions match this target. Pick a specific tab.',
|
|
1456
1482
|
});
|
|
1457
1483
|
}
|
|
@@ -1462,13 +1488,16 @@ app.get('/api/shell/sessions/provider-output', authenticateToken, requireProject
|
|
|
1462
1488
|
tabId,
|
|
1463
1489
|
sessionId,
|
|
1464
1490
|
output: '',
|
|
1491
|
+
outputCursor: 0,
|
|
1492
|
+
bufferStartCursor: 0,
|
|
1465
1493
|
message: 'No active provider terminal session found for this project.',
|
|
1466
1494
|
});
|
|
1467
1495
|
}
|
|
1468
1496
|
const matchedSession = match.session;
|
|
1469
|
-
const rawOutput = matchedSession
|
|
1497
|
+
const { rawOutput, outputCursor, bufferStartCursor, } = readPtySessionBufferedOutput(matchedSession, { maxChars, sinceCursor });
|
|
1470
1498
|
const output = stripAnsiSequences(rawOutput);
|
|
1471
|
-
const
|
|
1499
|
+
const fullOutput = readSessionOutputForState(matchedSession);
|
|
1500
|
+
const terminalState = resolveProviderTerminalState(matchedSession, provider, fullOutput);
|
|
1472
1501
|
res.json({
|
|
1473
1502
|
active: true,
|
|
1474
1503
|
provider,
|
|
@@ -1479,6 +1508,9 @@ app.get('/api/shell/sessions/provider-output', authenticateToken, requireProject
|
|
|
1479
1508
|
matchStatus: match.status,
|
|
1480
1509
|
...terminalState,
|
|
1481
1510
|
output,
|
|
1511
|
+
outputCursor,
|
|
1512
|
+
bufferStartCursor,
|
|
1513
|
+
sinceCursor,
|
|
1482
1514
|
});
|
|
1483
1515
|
});
|
|
1484
1516
|
app.post('/api/shell/sessions/provider-input', authenticateToken, requireProjectPathAccess('useShell'), (req, res) => {
|
|
@@ -1526,6 +1558,7 @@ app.post('/api/shell/sessions/provider-input', authenticateToken, requireProject
|
|
|
1526
1558
|
}
|
|
1527
1559
|
const matchedSession = match.session;
|
|
1528
1560
|
const data = submit ? normalizeTerminalStartupInput(input) : input;
|
|
1561
|
+
const outputCursorBefore = matchedSession.totalOutputBytes || matchedSession.bufferBytes || 0;
|
|
1529
1562
|
try {
|
|
1530
1563
|
writeTerminalInputChunks(matchedSession.pty, data);
|
|
1531
1564
|
matchedSession.updatedAt = Date.now();
|
|
@@ -1539,6 +1572,8 @@ app.post('/api/shell/sessions/provider-input', authenticateToken, requireProject
|
|
|
1539
1572
|
submitted: submit,
|
|
1540
1573
|
bytes: Buffer.byteLength(data),
|
|
1541
1574
|
matchStatus: match.status,
|
|
1575
|
+
outputCursorBefore,
|
|
1576
|
+
outputCursorAfter: matchedSession.totalOutputBytes || matchedSession.bufferBytes || 0,
|
|
1542
1577
|
});
|
|
1543
1578
|
}
|
|
1544
1579
|
catch (error) {
|
|
@@ -1566,7 +1601,7 @@ function requireVerifiedTelegramLink(req, res) {
|
|
|
1566
1601
|
}
|
|
1567
1602
|
// Bind the paired Telegram chat to an already running provider terminal tab.
|
|
1568
1603
|
// This route lives next to the PTY registry so it can verify the target is live.
|
|
1569
|
-
app.post('/api/telegram/active-terminal', authenticateToken, requireProjectPathAccess('useShell'), (req, res) => {
|
|
1604
|
+
app.post('/api/telegram/active-terminal', authenticateToken, requireProjectPathAccess('useShell'), async (req, res) => {
|
|
1570
1605
|
try {
|
|
1571
1606
|
const link = requireVerifiedTelegramLink(req, res);
|
|
1572
1607
|
if (!link)
|
|
@@ -1622,7 +1657,17 @@ app.post('/api/telegram/active-terminal', authenticateToken, requireProjectPathA
|
|
|
1622
1657
|
selectedProjectName: projectName,
|
|
1623
1658
|
selectedProjectPath: resolvedMatchedProjectPath,
|
|
1624
1659
|
});
|
|
1625
|
-
|
|
1660
|
+
notifyTelegramTerminalAttached({
|
|
1661
|
+
userId: req.user.id,
|
|
1662
|
+
terminal: control.activeTerminal,
|
|
1663
|
+
}).then((telegramNotice) => {
|
|
1664
|
+
if (telegramNotice?.ok === false) {
|
|
1665
|
+
console.warn('[telegram] terminal attach notice not delivered:', telegramNotice.reason);
|
|
1666
|
+
}
|
|
1667
|
+
}).catch((error) => {
|
|
1668
|
+
console.warn('[telegram] terminal attach notice failed:', error?.message || error);
|
|
1669
|
+
});
|
|
1670
|
+
res.json({ success: true, activeTerminal: control.activeTerminal, control, matchStatus: match.status, telegramNotice: { queued: true } });
|
|
1626
1671
|
}
|
|
1627
1672
|
catch (error) {
|
|
1628
1673
|
console.error('telegram/active-terminal failed:', error);
|
|
@@ -3824,6 +3869,7 @@ function handleShellConnection(ws, request) {
|
|
|
3824
3869
|
ws: ws,
|
|
3825
3870
|
buffer: [],
|
|
3826
3871
|
bufferBytes: 0,
|
|
3872
|
+
totalOutputBytes: 0,
|
|
3827
3873
|
droppedOutputBytes: 0,
|
|
3828
3874
|
timeoutId: null,
|
|
3829
3875
|
userId: ownerUserId,
|