@mmmbuto/nexuscrew 0.9.57 → 0.9.59
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/CHANGELOG.md +20 -0
- package/README.md +32 -8
- package/frontend/dist/assets/index-CZFJnks_.js +169 -0
- package/frontend/dist/index.html +1 -1
- package/frontend/dist/version.json +1 -1
- package/lib/fleet/managed.js +57 -0
- package/lib/nodes/access-presets.js +1 -0
- package/lib/nodes/ask-slot-verifier.js +72 -0
- package/lib/nodes/commands.js +7 -3
- package/lib/nodes/reverse-slot-proof.js +19 -7
- package/lib/nodes/store.js +54 -6
- package/lib/notify/ask-answer-service.js +23 -11
- package/lib/notify/ask-receipts.js +1 -0
- package/lib/notify/ask-relay.js +261 -74
- package/lib/notify/asks.js +117 -9
- package/lib/notify/event-feed-asks-routes.js +79 -19
- package/lib/notify/event-feed-client.js +130 -50
- package/lib/notify/event-feed-producers.js +1 -0
- package/lib/notify/imported-dismissals.js +106 -0
- package/lib/notify/routes.js +39 -20
- package/lib/proxy/federation.js +112 -12
- package/lib/proxy/resource-acl.js +1 -0
- package/lib/server.js +161 -23
- package/lib/tmux/actions.js +14 -11
- package/package.json +1 -1
- package/frontend/dist/assets/index-CAgxp3qK.js +0 -169
package/lib/tmux/actions.js
CHANGED
|
@@ -118,8 +118,10 @@ function execTmux(execFileImpl, tmuxBin, args, timeout = 5000) {
|
|
|
118
118
|
// risolto prima del paste e verificato di nuovo prima dell'Enter, evitando
|
|
119
119
|
// prefix match e il riuso del solo nome sessione.
|
|
120
120
|
async function submitToSession(tmuxBin, session, text, opts = {}) {
|
|
121
|
+
let pasteAttempted = false;
|
|
122
|
+
const failed = reason => ({ submitted: false, outcome: pasteAttempted ? 'delivery-unknown' : 'failed-pre-paste', reason });
|
|
121
123
|
if (!isValidSession(session) || !submitTextOk(text)) {
|
|
122
|
-
return
|
|
124
|
+
return failed('input non valido');
|
|
123
125
|
}
|
|
124
126
|
const execFileImpl = opts.execFileImpl || execFile;
|
|
125
127
|
const fsImpl = opts.fsImpl || fs;
|
|
@@ -128,7 +130,7 @@ async function submitToSession(tmuxBin, session, text, opts = {}) {
|
|
|
128
130
|
? opts.delay : (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
129
131
|
const codexComposer = /^(?:codex|codex-vl)(?:\.|$)/.test(String(opts.engine || ''));
|
|
130
132
|
const nonce = (opts.nonce || crypto.randomBytes(8).toString('hex')).replace(/[^a-f0-9]/g, '').slice(0, 32);
|
|
131
|
-
if (!nonce) return
|
|
133
|
+
if (!nonce) return failed('invio non disponibile');
|
|
132
134
|
const buffer = `ncmsg-${nonce}`;
|
|
133
135
|
const tmp = path.join(tmpRoot, `.nexuscrew-message-${nonce}.txt`);
|
|
134
136
|
let loaded = false;
|
|
@@ -139,14 +141,15 @@ async function submitToSession(tmuxBin, session, text, opts = {}) {
|
|
|
139
141
|
['display-message', '-p', '-t', `=${session}:`, '#{pane_id}']);
|
|
140
142
|
const paneId = pane.stdout.trim();
|
|
141
143
|
if (!pane.ok || !/^%[0-9]+$/.test(paneId)) {
|
|
142
|
-
return
|
|
144
|
+
return failed('sessione non raggiungibile');
|
|
143
145
|
}
|
|
144
146
|
const load = await execTmux(execFileImpl, tmuxBin, ['load-buffer', '-b', buffer, tmp]);
|
|
145
|
-
if (!load.ok) return
|
|
147
|
+
if (!load.ok) return failed('buffer non disponibile');
|
|
146
148
|
loaded = true;
|
|
149
|
+
pasteAttempted = true;
|
|
147
150
|
const paste = await execTmux(execFileImpl, tmuxBin,
|
|
148
151
|
['paste-buffer', '-p', '-t', paneId, '-b', buffer]);
|
|
149
|
-
if (!paste.ok) return
|
|
152
|
+
if (!paste.ok) return failed('consegna non riuscita');
|
|
150
153
|
const paneAlive = async () => {
|
|
151
154
|
const verify = await execTmux(execFileImpl, tmuxBin,
|
|
152
155
|
['display-message', '-p', '-t', paneId, '#{session_name}\t#{pane_dead}\t#{pane_id}']);
|
|
@@ -190,20 +193,20 @@ async function submitToSession(tmuxBin, session, text, opts = {}) {
|
|
|
190
193
|
// messaggio lungo conviene verificare che la cella si sia mossa.
|
|
191
194
|
const attesaBase = codexComposer ? 400 : 150;
|
|
192
195
|
await delay(attesaBase + Math.floor(text.length / 500) * 150);
|
|
193
|
-
if (!(await paneAlive())) return
|
|
196
|
+
if (!(await paneAlive())) return failed('sessione terminata durante la consegna');
|
|
194
197
|
if (codexComposer) {
|
|
195
198
|
const flush = await execTmux(execFileImpl, tmuxBin, ['send-keys', '-t', paneId, 'C-e']);
|
|
196
|
-
if (!flush.ok) return
|
|
199
|
+
if (!flush.ok) return failed('testo consegnato ma flush composer non riuscito');
|
|
197
200
|
await delay(300);
|
|
198
|
-
if (!(await paneAlive())) return
|
|
201
|
+
if (!(await paneAlive())) return failed('sessione terminata durante la consegna');
|
|
199
202
|
}
|
|
200
203
|
const enter = await execTmux(execFileImpl, tmuxBin, ['send-keys', '-t', paneId, 'Enter']);
|
|
201
|
-
if (!enter.ok) return
|
|
202
|
-
return { submitted: true, reason: codexComposer
|
|
204
|
+
if (!enter.ok) return failed('testo consegnato ma invio non riuscito');
|
|
205
|
+
return { submitted: true, outcome: 'submitted', reason: codexComposer
|
|
203
206
|
? 'bracketed paste + burst flush + Enter separati'
|
|
204
207
|
: 'bracketed paste + Enter separato' };
|
|
205
208
|
} catch (_) {
|
|
206
|
-
return
|
|
209
|
+
return failed('consegna non riuscita');
|
|
207
210
|
} finally {
|
|
208
211
|
if (loaded) await execTmux(execFileImpl, tmuxBin, ['delete-buffer', '-b', buffer]);
|
|
209
212
|
try { fsImpl.unlinkSync(tmp); } catch (_) { /* cleanup best-effort */ }
|