@dmsdc-ai/aigentry-telepty 0.1.22 → 0.1.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.
Files changed (2) hide show
  1. package/daemon.js +19 -11
  2. package/package.json +1 -1
package/daemon.js CHANGED
@@ -551,18 +551,26 @@ app.post('/api/sessions/:id/inject', (req, res) => {
551
551
  }
552
552
  }
553
553
 
554
- if (!writeToSession(prompt)) {
555
- return res.status(503).json({ error: 'Wrap process is not connected' });
556
- }
557
-
558
- // Send \r separately after 300ms delay — works for ALL CLIs
559
554
  let submitResult = null;
560
- if (!no_enter) {
561
- setTimeout(() => {
562
- const ok = writeToSession('\r');
563
- console.log(`[INJECT+SUBMIT] Split \\r for ${id}: ${ok ? 'success' : 'failed'}`);
564
- }, 300);
565
- submitResult = { deferred: true, strategy: 'split_cr' };
555
+ if (!no_enter && session.type === 'wrapped') {
556
+ // Wrapped sessions: send text+\r in single message to bypass allow bridge prompt-ready gate
557
+ if (!writeToSession(prompt + '\r')) {
558
+ return res.status(503).json({ error: 'Wrap process is not connected' });
559
+ }
560
+ submitResult = { strategy: 'combined_cr' };
561
+ console.log(`[INJECT+SUBMIT] Combined \\r for ${id}`);
562
+ } else {
563
+ if (!writeToSession(prompt)) {
564
+ return res.status(503).json({ error: 'Wrap process is not connected' });
565
+ }
566
+ // Spawned sessions: send \r separately after delay (proven split_cr strategy)
567
+ if (!no_enter) {
568
+ setTimeout(() => {
569
+ const ok = writeToSession('\r');
570
+ console.log(`[INJECT+SUBMIT] Split \\r for ${id}: ${ok ? 'success' : 'failed'}`);
571
+ }, 300);
572
+ submitResult = { deferred: true, strategy: 'split_cr' };
573
+ }
566
574
  }
567
575
 
568
576
  console.log(`[INJECT] Wrote to session ${id} (inject_id: ${inject_id})`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dmsdc-ai/aigentry-telepty",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
4
4
  "main": "daemon.js",
5
5
  "bin": {
6
6
  "aigentry-telepty": "install.js",