wherdr 1.3.2 → 1.3.4
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{AgentView.C4YOwvZG.css → AgentView.DzFWBd2A.css} +1 -1
- package/.output/public/_nuxt/{Cd8j9O5w.js → BEJHMUrj.js} +1 -1
- package/.output/public/_nuxt/BOtcEDnA.js +1 -0
- package/.output/public/_nuxt/BUaYhQ2r.js +6 -0
- package/.output/public/_nuxt/{yzABg5xl.js → Bpoxvzh6.js} +1 -1
- package/.output/public/_nuxt/C25ROUa9.js +3 -0
- package/.output/public/_nuxt/CDWjMk9C.js +2 -0
- package/.output/public/_nuxt/CJKsMzIp.js +1 -0
- package/.output/public/_nuxt/CJNhn9sA.js +36 -0
- package/.output/public/_nuxt/COCvtdHN.js +89 -0
- package/.output/public/_nuxt/{Ci8N4mWR.js → CXJnLmWv.js} +1 -1
- package/.output/public/_nuxt/Cl45J6_Q.js +1 -0
- package/.output/public/_nuxt/CndPDbMI.js +2 -0
- package/.output/public/_nuxt/Ctbx58Um.js +23 -0
- package/.output/public/_nuxt/{8ksjcuDu.js → DMLmW6JM.js} +49 -56
- package/.output/public/_nuxt/Dl1PHLOB.js +1 -0
- package/.output/public/_nuxt/Nhex3_iH.js +1 -0
- package/.output/public/_nuxt/OpWX45i7.js +89 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/4994f3a4-4126-4f57-a9e5-c7ebb25850bc.json +1 -0
- package/.output/public/_nuxt/dTj21DMs.js +1 -0
- package/.output/public/_nuxt/entry.BohTWE-n.css +2 -0
- package/.output/public/_nuxt/kwSoIiM7.js +1 -0
- package/.output/public/_nuxt/mkEwYka4.js +1 -0
- package/.output/public/_nuxt/pdf.min.t82Z80JU.mjs +28 -0
- package/.output/public/_nuxt/pdf.worker.min.wgc6bjNh.mjs +28 -0
- package/.output/public/_nuxt/w7Rm7unj.js +1 -0
- package/.output/public/sw.js +1 -1
- package/.output/server/chunks/_/branding.mjs +1 -1
- package/.output/server/chunks/_/filePaths.mjs +25 -0
- package/.output/server/chunks/_/files.mjs +217 -0
- package/.output/server/chunks/_/machineOrder.mjs +1 -1
- package/.output/server/chunks/_/onboarding.mjs +1 -1
- package/.output/server/chunks/_/package.mjs +5 -2
- package/.output/server/chunks/_/pluginPolicy.mjs +93 -0
- package/.output/server/chunks/_/plugins.mjs +9 -96
- package/.output/server/chunks/_/projectBoard.mjs +124 -36
- package/.output/server/chunks/_/projectDocs.mjs +106 -0
- package/.output/server/chunks/_/projectInbox.mjs +135 -0
- package/.output/server/chunks/_/projectThreads.mjs +46 -0
- package/.output/server/chunks/_/projectThreads2.mjs +61 -0
- package/.output/server/chunks/_/projectsActions.mjs +1 -1
- package/.output/server/chunks/_/projectsPlugin.mjs +24 -50
- package/.output/server/chunks/_/projectsPlugin2.mjs +57 -0
- package/.output/server/chunks/_/restart.mjs +2 -312
- package/.output/server/chunks/_/reveal.mjs +2 -24
- package/.output/server/chunks/_/selfupdate.mjs +3 -2
- package/.output/server/chunks/_/settingstabs.mjs +36 -0
- package/.output/server/chunks/_/updates.mjs +51 -10
- package/.output/server/chunks/_/worktrees.mjs +1 -1
- package/.output/server/chunks/_/ws.mjs +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +1718 -417
- package/.output/server/chunks/raw/bump-homebrew.mjs +1 -1
- package/.output/server/chunks/raw/herdr-plugin.mjs +1 -1
- package/.output/server/chunks/raw/release-ready.mjs +5 -0
- package/.output/server/chunks/routes/api/_..._.mjs +1 -1
- package/.output/server/chunks/routes/api/agents.post.mjs +1 -1
- package/.output/server/chunks/routes/api/ask-tab.post.mjs +1 -1
- package/.output/server/chunks/routes/api/attach.post.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/disable.post.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/lock-all.post.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/lock.post.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/login/options.post.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/login/verify.post.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/max-session.post.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/register/options.post.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/register/verify.post.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/status.get.mjs +1 -1
- package/.output/server/chunks/routes/api/board.get.mjs +148 -0
- package/.output/server/chunks/routes/api/changes.get.mjs +2 -2
- package/.output/server/chunks/routes/api/chat/image.get.mjs +2 -2
- package/.output/server/chunks/routes/api/chat.get.mjs +26 -6
- package/.output/server/chunks/routes/api/choose.post.mjs +40 -14
- package/.output/server/chunks/routes/api/claude-statusline.post.mjs +2 -2
- package/.output/server/chunks/routes/api/close/status.get.mjs +2 -2
- package/.output/server/chunks/routes/api/close.post.mjs +1 -1
- package/.output/server/chunks/routes/api/codex-update.post.mjs +2 -2
- package/.output/server/chunks/routes/api/commands.get.mjs +4 -3
- package/.output/server/chunks/routes/api/config.get.mjs +3 -2
- package/.output/server/chunks/routes/api/dirs.get.mjs +2 -2
- package/.output/server/chunks/routes/api/dismiss-stopped.post.mjs +43 -0
- package/.output/server/chunks/routes/api/dismiss.post.mjs +2 -2
- package/.output/server/chunks/routes/api/effort.post.mjs +2 -2
- package/.output/server/chunks/routes/api/efforts.get.mjs +2 -2
- package/.output/server/chunks/routes/api/file.post.mjs +2 -2
- package/.output/server/chunks/routes/api/files/download.get.mjs +60 -0
- package/.output/server/chunks/routes/api/files/read.get.mjs +45 -0
- package/.output/server/chunks/routes/api/files.get.mjs +44 -0
- package/.output/server/chunks/routes/api/gitroot.get.mjs +2 -2
- package/.output/server/chunks/routes/api/health.get.mjs +1 -1
- package/.output/server/chunks/routes/api/index.get.mjs +2 -1
- package/.output/server/chunks/routes/api/input.post.mjs +32 -5
- package/.output/server/chunks/routes/api/interrupt.post.mjs +2 -2
- package/.output/server/chunks/routes/api/isgit.get.mjs +2 -2
- package/.output/server/chunks/routes/api/machine/awake.get.mjs +2 -2
- package/.output/server/chunks/routes/api/machine/awake.post.mjs +2 -2
- package/.output/server/chunks/routes/api/machine/order.get.mjs +1 -1
- package/.output/server/chunks/routes/api/machine/order.post.mjs +1 -1
- package/.output/server/chunks/routes/api/machine/rename.post.mjs +2 -2
- package/.output/server/chunks/routes/api/menu.post.mjs +5 -2
- package/.output/server/chunks/routes/api/model.post.mjs +2 -2
- package/.output/server/chunks/routes/api/models.get.mjs +2 -2
- package/.output/server/chunks/routes/api/nav.post.mjs +36 -22
- package/.output/server/chunks/routes/api/onboarding.get.mjs +1 -1
- package/.output/server/chunks/routes/api/onboarding.post.mjs +1 -1
- package/.output/server/chunks/routes/api/phone.get.mjs +2 -2
- package/.output/server/chunks/routes/api/phone.post.mjs +2 -2
- package/.output/server/chunks/routes/api/plugins/actions.get.mjs +4 -1
- package/.output/server/chunks/routes/api/plugins/invoke.post.mjs +4 -1
- package/.output/server/chunks/routes/api/plugins/profiles.get.mjs +4 -1
- package/.output/server/chunks/routes/api/plugins/projects.get.mjs +4 -3
- package/.output/server/chunks/routes/api/plugins/projects.post.mjs +4 -3
- package/.output/server/chunks/routes/api/plugins/thread-limits.get.mjs +2 -2
- package/.output/server/chunks/routes/api/plugins/thread-limits.post.mjs +2 -2
- package/.output/server/chunks/routes/api/project/inbox.get.mjs +44 -0
- package/.output/server/chunks/routes/api/project/inbox.post.mjs +44 -0
- package/.output/server/chunks/routes/api/project/memory.get.mjs +43 -0
- package/.output/server/chunks/routes/api/project/report.get.mjs +3 -2
- package/.output/server/chunks/routes/api/project/routines.get.mjs +44 -0
- package/.output/server/chunks/routes/api/project/settings.get.mjs +42 -0
- package/.output/server/chunks/routes/api/project/thread.get.mjs +45 -0
- package/.output/server/chunks/routes/api/project/thread.post.mjs +47 -0
- package/.output/server/chunks/routes/api/prompt.post.mjs +21 -3
- package/.output/server/chunks/routes/api/push/quiet.post.mjs +2 -2
- package/.output/server/chunks/routes/api/push/subscribe.post.mjs +2 -2
- package/.output/server/chunks/routes/api/push/test.post.mjs +2 -2
- package/.output/server/chunks/routes/api/push/unsubscribe.post.mjs +2 -2
- package/.output/server/chunks/routes/api/quotas.get.mjs +2 -2
- package/.output/server/chunks/routes/api/rename.post.mjs +1 -1
- package/.output/server/chunks/routes/api/requeue.post.mjs +2 -2
- package/.output/server/chunks/routes/api/restart.get.mjs +1 -1
- package/.output/server/chunks/routes/api/restart.post.mjs +1 -1
- package/.output/server/chunks/routes/api/reveal.post.mjs +2 -1
- package/.output/server/chunks/routes/api/screen-key.post.mjs +14 -11
- package/.output/server/chunks/routes/api/screen.get.mjs +6 -37
- package/.output/server/chunks/routes/api/search.get.mjs +2 -2
- package/.output/server/chunks/routes/api/seen.post.mjs +2 -2
- package/.output/server/chunks/routes/api/sessions.get.mjs +2 -2
- package/.output/server/chunks/routes/api/sessions.post.mjs +2 -2
- package/.output/server/chunks/routes/api/settings-tab.post.mjs +89 -0
- package/.output/server/chunks/routes/api/space.post.mjs +14 -14
- package/.output/server/chunks/routes/api/state.get.mjs +2 -2
- package/.output/server/chunks/routes/api/unqueue.post.mjs +2 -2
- package/.output/server/chunks/routes/api/update/status.get.mjs +1 -1
- package/.output/server/chunks/routes/api/update.get.mjs +2 -2
- package/.output/server/chunks/routes/api/update.post.mjs +2 -2
- package/.output/server/chunks/routes/api/upload.post.mjs +2 -2
- package/.output/server/chunks/routes/api/worktrees/remove.post.mjs +1 -1
- package/.output/server/chunks/routes/api/worktrees.get.mjs +1 -1
- package/.output/server/chunks/routes/favicon.ico.get.mjs +1 -1
- package/.output/server/chunks/routes/icons/_name_.get.mjs +2 -2
- package/.output/server/chunks/routes/renderer.mjs +3 -3
- package/.output/server/chunks/routes/uploads/_...name_.get.mjs +2 -2
- package/.output/server/chunks/routes/ws/_..._.mjs +2 -2
- package/.output/server/chunks/routes/ws/events.mjs +2 -2
- package/.output/server/chunks/routes/ws/term.mjs +2 -2
- package/.output/server/chunks/virtual/precomputed.mjs +1 -1
- package/.output/server/index.mjs +2 -2
- package/.output/server/package.json +1 -1
- package/README.md +368 -40
- package/bin/install-docker-skill.sh +20 -0
- package/bin/lib/commands.mjs +5 -1
- package/bin/lib/core.mjs +1 -0
- package/bin/lib/install-skill.sh +100 -0
- package/bin/lib/skill.mjs +16 -0
- package/bin/lib/updater.mjs +65 -12
- package/bin/lib/verify-release.mjs +20 -0
- package/package.json +5 -2
- package/skills/wherdr/SKILL.md +186 -0
- package/.output/public/_nuxt/B7QP1TFs.js +0 -23
- package/.output/public/_nuxt/BDNMzG2s.js +0 -1
- package/.output/public/_nuxt/BOpBIziZ.js +0 -6
- package/.output/public/_nuxt/BWXdFfeg.js +0 -17
- package/.output/public/_nuxt/COFCNFpG.js +0 -83
- package/.output/public/_nuxt/CWwyK2XK.js +0 -2
- package/.output/public/_nuxt/CXG-cOdh.js +0 -1
- package/.output/public/_nuxt/CkZ8t6uB.js +0 -1
- package/.output/public/_nuxt/D4Yz4rat.js +0 -65
- package/.output/public/_nuxt/D7sxNXx1.js +0 -1
- package/.output/public/_nuxt/DViwOclv.js +0 -1
- package/.output/public/_nuxt/DoD7Qb5P.js +0 -30
- package/.output/public/_nuxt/DyBZDSCV.js +0 -2
- package/.output/public/_nuxt/SiL1FJ5s.js +0 -3
- package/.output/public/_nuxt/bLP7Jj-b.js +0 -1
- package/.output/public/_nuxt/builds/meta/7afbf062-5369-4002-b20d-7a582ff6e0f1.json +0 -1
- package/.output/public/_nuxt/entry.Crt1r4l3.css +0 -2
- package/.output/server/chunks/routes/ws/mirror.mjs +0 -161
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { a as defineApi, f as findPane, i as getQuery, H as HerdrError } from '../../../nitro/nitro.mjs';
|
|
2
|
+
import { a as readRoutines } from '../../../_/projectInbox.mjs';
|
|
3
|
+
import 'node:http';
|
|
4
|
+
import 'node:https';
|
|
5
|
+
import 'node:crypto';
|
|
6
|
+
import 'stream';
|
|
7
|
+
import 'events';
|
|
8
|
+
import 'http';
|
|
9
|
+
import 'crypto';
|
|
10
|
+
import 'buffer';
|
|
11
|
+
import 'zlib';
|
|
12
|
+
import 'https';
|
|
13
|
+
import 'net';
|
|
14
|
+
import 'tls';
|
|
15
|
+
import 'url';
|
|
16
|
+
import 'node:events';
|
|
17
|
+
import 'node:buffer';
|
|
18
|
+
import 'node:fs';
|
|
19
|
+
import 'node:path';
|
|
20
|
+
import 'web-push';
|
|
21
|
+
import 'node:os';
|
|
22
|
+
import 'node:child_process';
|
|
23
|
+
import 'node:net';
|
|
24
|
+
import 'node:fs/promises';
|
|
25
|
+
import 'node:readline';
|
|
26
|
+
import 'node:dns';
|
|
27
|
+
import 'node:util';
|
|
28
|
+
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
29
|
+
import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
|
|
30
|
+
import '@simplewebauthn/server';
|
|
31
|
+
import 'node:url';
|
|
32
|
+
import '../../../_/projectThreads.mjs';
|
|
33
|
+
import '../../../_/projectBoard.mjs';
|
|
34
|
+
import '../../../_/projectsPlugin.mjs';
|
|
35
|
+
import '../../../_/pluginPolicy.mjs';
|
|
36
|
+
|
|
37
|
+
const routines_get = defineApi(async (event) => {
|
|
38
|
+
const p = findPane(String(getQuery(event).pane || ""));
|
|
39
|
+
if (!p) throw new HerdrError("bad_pane", "Pane not found");
|
|
40
|
+
return readRoutines(p);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export { routines_get as default };
|
|
44
|
+
//# sourceMappingURL=routines.get.mjs.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { a as defineApi, f as findPane, i as getQuery, H as HerdrError } from '../../../nitro/nitro.mjs';
|
|
2
|
+
import { b as readProjectSettings } from '../../../_/projectDocs.mjs';
|
|
3
|
+
import 'node:http';
|
|
4
|
+
import 'node:https';
|
|
5
|
+
import 'node:crypto';
|
|
6
|
+
import 'stream';
|
|
7
|
+
import 'events';
|
|
8
|
+
import 'http';
|
|
9
|
+
import 'crypto';
|
|
10
|
+
import 'buffer';
|
|
11
|
+
import 'zlib';
|
|
12
|
+
import 'https';
|
|
13
|
+
import 'net';
|
|
14
|
+
import 'tls';
|
|
15
|
+
import 'url';
|
|
16
|
+
import 'node:events';
|
|
17
|
+
import 'node:buffer';
|
|
18
|
+
import 'node:fs';
|
|
19
|
+
import 'node:path';
|
|
20
|
+
import 'web-push';
|
|
21
|
+
import 'node:os';
|
|
22
|
+
import 'node:child_process';
|
|
23
|
+
import 'node:net';
|
|
24
|
+
import 'node:fs/promises';
|
|
25
|
+
import 'node:readline';
|
|
26
|
+
import 'node:dns';
|
|
27
|
+
import 'node:util';
|
|
28
|
+
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
29
|
+
import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
|
|
30
|
+
import '@simplewebauthn/server';
|
|
31
|
+
import 'node:url';
|
|
32
|
+
import '../../../_/projectBoard.mjs';
|
|
33
|
+
import '../../../_/projectsPlugin.mjs';
|
|
34
|
+
|
|
35
|
+
const settings_get = defineApi(async (event) => {
|
|
36
|
+
const p = findPane(String(getQuery(event).pane || ""));
|
|
37
|
+
if (!p) throw new HerdrError("bad_pane", "Pane not found");
|
|
38
|
+
return readProjectSettings(p);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export { settings_get as default };
|
|
42
|
+
//# sourceMappingURL=settings.get.mjs.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { a as defineApi, i as getQuery, f as findPane, H as HerdrError } from '../../../nitro/nitro.mjs';
|
|
2
|
+
import { r as readThreadDetail } from '../../../_/projectThreads2.mjs';
|
|
3
|
+
import 'node:http';
|
|
4
|
+
import 'node:https';
|
|
5
|
+
import 'node:crypto';
|
|
6
|
+
import 'stream';
|
|
7
|
+
import 'events';
|
|
8
|
+
import 'http';
|
|
9
|
+
import 'crypto';
|
|
10
|
+
import 'buffer';
|
|
11
|
+
import 'zlib';
|
|
12
|
+
import 'https';
|
|
13
|
+
import 'net';
|
|
14
|
+
import 'tls';
|
|
15
|
+
import 'url';
|
|
16
|
+
import 'node:events';
|
|
17
|
+
import 'node:buffer';
|
|
18
|
+
import 'node:fs';
|
|
19
|
+
import 'node:path';
|
|
20
|
+
import 'web-push';
|
|
21
|
+
import 'node:os';
|
|
22
|
+
import 'node:child_process';
|
|
23
|
+
import 'node:net';
|
|
24
|
+
import 'node:fs/promises';
|
|
25
|
+
import 'node:readline';
|
|
26
|
+
import 'node:dns';
|
|
27
|
+
import 'node:util';
|
|
28
|
+
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
29
|
+
import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
|
|
30
|
+
import '@simplewebauthn/server';
|
|
31
|
+
import 'node:url';
|
|
32
|
+
import '../../../_/projectThreads.mjs';
|
|
33
|
+
import '../../../_/projectBoard.mjs';
|
|
34
|
+
import '../../../_/projectsPlugin.mjs';
|
|
35
|
+
import '../../../_/pluginPolicy.mjs';
|
|
36
|
+
|
|
37
|
+
const thread_get = defineApi(async (event) => {
|
|
38
|
+
const q = getQuery(event);
|
|
39
|
+
const p = findPane(String(q.pane || ""));
|
|
40
|
+
if (!p) throw new HerdrError("bad_pane", "Pane not found");
|
|
41
|
+
return readThreadDetail(p, q.id);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export { thread_get as default };
|
|
45
|
+
//# sourceMappingURL=thread.get.mjs.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { a as defineApi, f as findPane, H as HerdrError } from '../../../nitro/nitro.mjs';
|
|
2
|
+
import { w as withoutContainerTicker } from '../../../_/plugins.mjs';
|
|
3
|
+
import { a as runThreadAction } from '../../../_/projectThreads2.mjs';
|
|
4
|
+
import 'node:http';
|
|
5
|
+
import 'node:https';
|
|
6
|
+
import 'node:crypto';
|
|
7
|
+
import 'stream';
|
|
8
|
+
import 'events';
|
|
9
|
+
import 'http';
|
|
10
|
+
import 'crypto';
|
|
11
|
+
import 'buffer';
|
|
12
|
+
import 'zlib';
|
|
13
|
+
import 'https';
|
|
14
|
+
import 'net';
|
|
15
|
+
import 'tls';
|
|
16
|
+
import 'url';
|
|
17
|
+
import 'node:events';
|
|
18
|
+
import 'node:buffer';
|
|
19
|
+
import 'node:fs';
|
|
20
|
+
import 'node:path';
|
|
21
|
+
import 'web-push';
|
|
22
|
+
import 'node:os';
|
|
23
|
+
import 'node:child_process';
|
|
24
|
+
import 'node:net';
|
|
25
|
+
import 'node:fs/promises';
|
|
26
|
+
import 'node:readline';
|
|
27
|
+
import 'node:dns';
|
|
28
|
+
import 'node:util';
|
|
29
|
+
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
30
|
+
import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
|
|
31
|
+
import '@simplewebauthn/server';
|
|
32
|
+
import 'node:url';
|
|
33
|
+
import '../../../_/projectBoard.mjs';
|
|
34
|
+
import '../../../_/projectsPlugin.mjs';
|
|
35
|
+
import '../../../_/projectsPlugin2.mjs';
|
|
36
|
+
import '../../../_/pluginPolicy.mjs';
|
|
37
|
+
import '../../../_/projectsActions.mjs';
|
|
38
|
+
import '../../../_/projectThreads.mjs';
|
|
39
|
+
|
|
40
|
+
const thread_post = defineApi(async (_event, body) => {
|
|
41
|
+
const p = findPane(String(body.pane_id || ""));
|
|
42
|
+
if (!p) throw new HerdrError("bad_pane", "Pane not found");
|
|
43
|
+
return runThreadAction(p, body.id, body.action, (t, run) => withoutContainerTicker(t.m, run));
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export { thread_post as default };
|
|
47
|
+
//# sourceMappingURL=thread.post.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineApi, P as PANE_RE, H as HerdrError,
|
|
1
|
+
import { a as defineApi, P as PANE_RE, H as HerdrError, b9 as closeTrailingMention, aJ as isSlashCommand, ba as keepPastes, Z as restarting, aK as addQueued, p as poll, X as withPaneLock, f as findPane, aC as closePanel, ag as log, bb as hasHeld, bc as INPUT_STATES, h as herdr, bd as inputVisible, be as shouldHold, bf as sendPrompt, bg as agentPrompt, bh as isBusyError, bi as HOLD_AGENTS, bj as pendingPrompts, e as watchScreen } from '../../nitro/nitro.mjs';
|
|
2
2
|
import 'node:http';
|
|
3
3
|
import 'node:https';
|
|
4
4
|
import 'node:crypto';
|
|
@@ -20,8 +20,8 @@ import 'web-push';
|
|
|
20
20
|
import 'node:os';
|
|
21
21
|
import 'node:child_process';
|
|
22
22
|
import 'node:net';
|
|
23
|
-
import 'node:readline';
|
|
24
23
|
import 'node:fs/promises';
|
|
24
|
+
import 'node:readline';
|
|
25
25
|
import 'node:dns';
|
|
26
26
|
import 'node:util';
|
|
27
27
|
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
@@ -34,7 +34,25 @@ const prompt_post = defineApi(async (event, b) => {
|
|
|
34
34
|
const text = closeTrailingMention(String(b.text || ""));
|
|
35
35
|
if (!text.trim()) throw new HerdrError("empty", "Empty message");
|
|
36
36
|
const id = typeof b.client_id === "string" ? b.client_id : void 0;
|
|
37
|
-
if (
|
|
37
|
+
if (!isSlashCommand(text)) keepPastes(text, b.pastes);
|
|
38
|
+
if (restarting(b.pane_id) && !isSlashCommand(text)) {
|
|
39
|
+
const q2 = addQueued(b.pane_id, text, { held: true, id });
|
|
40
|
+
setTimeout(poll, 50);
|
|
41
|
+
return { ok: true, queued: q2 };
|
|
42
|
+
}
|
|
43
|
+
const held = await withPaneLock(b.pane_id, async () => {
|
|
44
|
+
const now = findPane(b.pane_id);
|
|
45
|
+
if (!(now == null ? void 0 : now.stopped) && !(now == null ? void 0 : now.leaving)) return null;
|
|
46
|
+
if (isSlashCommand(text)) throw new HerdrError("stale", now.stopped ? "Restart Codex before sending a command." : "Codex just stopped. Try again in a few seconds.");
|
|
47
|
+
const q2 = addQueued(b.pane_id, text, { held: true, id });
|
|
48
|
+
setTimeout(poll, 50);
|
|
49
|
+
return q2;
|
|
50
|
+
});
|
|
51
|
+
if (held) return { ok: true, queued: held };
|
|
52
|
+
if (await withPaneLock(b.pane_id, () => {
|
|
53
|
+
var _a;
|
|
54
|
+
return ((_a = findPane(b.pane_id)) == null ? void 0 : _a.stopped) ? Promise.resolve(false) : closePanel(b.pane_id).catch(() => false);
|
|
55
|
+
})) log(`panel closed before sending on ${b.pane_id}`);
|
|
38
56
|
const p = findPane(b.pane_id);
|
|
39
57
|
if (p && p.agent && restarting(p.id) && !isSlashCommand(text)) {
|
|
40
58
|
const q2 = addQueued(b.pane_id, text, { held: true, id });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineApi,
|
|
1
|
+
import { a as defineApi, bk as parseQuiet, H as HerdrError, bl as writeGlobalQuiet, ao as readSubs, bm as writeSubs, ag as log, bn as quietActive, bo as readGlobalQuiet } from '../../../nitro/nitro.mjs';
|
|
2
2
|
import 'node:http';
|
|
3
3
|
import 'node:https';
|
|
4
4
|
import 'node:crypto';
|
|
@@ -20,8 +20,8 @@ import 'web-push';
|
|
|
20
20
|
import 'node:os';
|
|
21
21
|
import 'node:child_process';
|
|
22
22
|
import 'node:net';
|
|
23
|
-
import 'node:readline';
|
|
24
23
|
import 'node:fs/promises';
|
|
24
|
+
import 'node:readline';
|
|
25
25
|
import 'node:dns';
|
|
26
26
|
import 'node:util';
|
|
27
27
|
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineApi,
|
|
1
|
+
import { a as defineApi, aq as pushReady, H as HerdrError, bp as validPushSubscription, ao as readSubs, bq as replaceSubscription, bn as quietActive, bm as writeSubs, ag as log } from '../../../nitro/nitro.mjs';
|
|
2
2
|
import 'node:http';
|
|
3
3
|
import 'node:https';
|
|
4
4
|
import 'node:crypto';
|
|
@@ -20,8 +20,8 @@ import 'web-push';
|
|
|
20
20
|
import 'node:os';
|
|
21
21
|
import 'node:child_process';
|
|
22
22
|
import 'node:net';
|
|
23
|
-
import 'node:readline';
|
|
24
23
|
import 'node:fs/promises';
|
|
24
|
+
import 'node:readline';
|
|
25
25
|
import 'node:dns';
|
|
26
26
|
import 'node:util';
|
|
27
27
|
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineApi,
|
|
1
|
+
import { a as defineApi, br as pushSend } from '../../../nitro/nitro.mjs';
|
|
2
2
|
import 'node:http';
|
|
3
3
|
import 'node:https';
|
|
4
4
|
import 'node:crypto';
|
|
@@ -20,8 +20,8 @@ import 'web-push';
|
|
|
20
20
|
import 'node:os';
|
|
21
21
|
import 'node:child_process';
|
|
22
22
|
import 'node:net';
|
|
23
|
-
import 'node:readline';
|
|
24
23
|
import 'node:fs/promises';
|
|
24
|
+
import 'node:readline';
|
|
25
25
|
import 'node:dns';
|
|
26
26
|
import 'node:util';
|
|
27
27
|
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineApi,
|
|
1
|
+
import { a as defineApi, ao as readSubs, bm as writeSubs } from '../../../nitro/nitro.mjs';
|
|
2
2
|
import 'node:http';
|
|
3
3
|
import 'node:https';
|
|
4
4
|
import 'node:crypto';
|
|
@@ -20,8 +20,8 @@ import 'web-push';
|
|
|
20
20
|
import 'node:os';
|
|
21
21
|
import 'node:child_process';
|
|
22
22
|
import 'node:net';
|
|
23
|
-
import 'node:readline';
|
|
24
23
|
import 'node:fs/promises';
|
|
24
|
+
import 'node:readline';
|
|
25
25
|
import 'node:dns';
|
|
26
26
|
import 'node:util';
|
|
27
27
|
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineApi,
|
|
1
|
+
import { a as defineApi, bs as readQuotas } from '../../nitro/nitro.mjs';
|
|
2
2
|
import 'node:http';
|
|
3
3
|
import 'node:https';
|
|
4
4
|
import 'node:crypto';
|
|
@@ -20,8 +20,8 @@ import 'web-push';
|
|
|
20
20
|
import 'node:os';
|
|
21
21
|
import 'node:child_process';
|
|
22
22
|
import 'node:net';
|
|
23
|
-
import 'node:readline';
|
|
24
23
|
import 'node:fs/promises';
|
|
24
|
+
import 'node:readline';
|
|
25
25
|
import 'node:dns';
|
|
26
26
|
import 'node:util';
|
|
27
27
|
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
@@ -20,8 +20,8 @@ import 'web-push';
|
|
|
20
20
|
import 'node:os';
|
|
21
21
|
import 'node:child_process';
|
|
22
22
|
import 'node:net';
|
|
23
|
-
import 'node:readline';
|
|
24
23
|
import 'node:fs/promises';
|
|
24
|
+
import 'node:readline';
|
|
25
25
|
import 'node:dns';
|
|
26
26
|
import 'node:util';
|
|
27
27
|
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineApi, P as PANE_RE, H as HerdrError,
|
|
1
|
+
import { a as defineApi, P as PANE_RE, H as HerdrError, bt as retryQueued } from '../../nitro/nitro.mjs';
|
|
2
2
|
import 'node:http';
|
|
3
3
|
import 'node:https';
|
|
4
4
|
import 'node:crypto';
|
|
@@ -20,8 +20,8 @@ import 'web-push';
|
|
|
20
20
|
import 'node:os';
|
|
21
21
|
import 'node:child_process';
|
|
22
22
|
import 'node:net';
|
|
23
|
-
import 'node:readline';
|
|
24
23
|
import 'node:fs/promises';
|
|
24
|
+
import 'node:readline';
|
|
25
25
|
import 'node:dns';
|
|
26
26
|
import 'node:util';
|
|
27
27
|
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
@@ -21,8 +21,8 @@ import 'web-push';
|
|
|
21
21
|
import 'node:os';
|
|
22
22
|
import 'node:child_process';
|
|
23
23
|
import 'node:net';
|
|
24
|
-
import 'node:readline';
|
|
25
24
|
import 'node:fs/promises';
|
|
25
|
+
import 'node:readline';
|
|
26
26
|
import 'node:dns';
|
|
27
27
|
import 'node:util';
|
|
28
28
|
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
@@ -21,8 +21,8 @@ import 'web-push';
|
|
|
21
21
|
import 'node:os';
|
|
22
22
|
import 'node:child_process';
|
|
23
23
|
import 'node:net';
|
|
24
|
-
import 'node:readline';
|
|
25
24
|
import 'node:fs/promises';
|
|
25
|
+
import 'node:readline';
|
|
26
26
|
import 'node:dns';
|
|
27
27
|
import 'node:util';
|
|
28
28
|
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
@@ -21,14 +21,15 @@ import 'web-push';
|
|
|
21
21
|
import 'node:os';
|
|
22
22
|
import 'node:child_process';
|
|
23
23
|
import 'node:net';
|
|
24
|
-
import 'node:readline';
|
|
25
24
|
import 'node:fs/promises';
|
|
25
|
+
import 'node:readline';
|
|
26
26
|
import 'node:dns';
|
|
27
27
|
import 'node:util';
|
|
28
28
|
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
29
29
|
import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
|
|
30
30
|
import '@simplewebauthn/server';
|
|
31
31
|
import 'node:url';
|
|
32
|
+
import '../../_/filePaths.mjs';
|
|
32
33
|
|
|
33
34
|
const reveal_post = defineApi((event, b) => revealPath(b));
|
|
34
35
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineApi, P as PANE_RE, H as HerdrError, h as herdr,
|
|
1
|
+
import { a as defineApi, P as PANE_RE, H as HerdrError, h as herdr, bu as parseWaitScreen, V as parseChoices, bv as waitIdentity, g as choicesCache, p as poll } from '../../nitro/nitro.mjs';
|
|
2
2
|
import 'node:http';
|
|
3
3
|
import 'node:https';
|
|
4
4
|
import 'node:crypto';
|
|
@@ -20,8 +20,8 @@ import 'web-push';
|
|
|
20
20
|
import 'node:os';
|
|
21
21
|
import 'node:child_process';
|
|
22
22
|
import 'node:net';
|
|
23
|
-
import 'node:readline';
|
|
24
23
|
import 'node:fs/promises';
|
|
24
|
+
import 'node:readline';
|
|
25
25
|
import 'node:dns';
|
|
26
26
|
import 'node:util';
|
|
27
27
|
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
@@ -31,15 +31,18 @@ import 'node:url';
|
|
|
31
31
|
|
|
32
32
|
const screenKey_post = defineApi(async (event, b) => {
|
|
33
33
|
if (!PANE_RE.test(b.pane_id || "")) throw new HerdrError("bad_pane", "Invalid pane");
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
try {
|
|
35
|
+
const r = await herdr("pane.read", { pane_id: b.pane_id, source: "detection" }, 4e3);
|
|
36
|
+
const text = r.read && r.read.text;
|
|
37
|
+
const screen = parseWaitScreen(text, { choices: Boolean(parseChoices(text, { strict: true })) });
|
|
38
|
+
const a = screen && screen.actions.find((x) => x.key === b.key && x.label === b.label);
|
|
39
|
+
if (!a || !b.identity || !screen || waitIdentity(screen) !== b.identity) throw new HerdrError("stale", "The screen has changed \u2014 check the current screen.");
|
|
40
|
+
await herdr("pane.send_input", { pane_id: b.pane_id, keys: [a.key] });
|
|
41
|
+
return { ok: true };
|
|
42
|
+
} finally {
|
|
43
|
+
choicesCache.delete(b.pane_id);
|
|
44
|
+
setTimeout(poll, 0);
|
|
45
|
+
}
|
|
43
46
|
});
|
|
44
47
|
|
|
45
48
|
export { screenKey_post as default };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { a as defineApi, i as getQuery, P as PANE_RE, H as HerdrError, h as herdr,
|
|
1
|
+
import { a as defineApi, i as getQuery, P as PANE_RE, H as HerdrError, h as herdr, bw as settingsTabs, bx as tabsOfRow, f as findPane, by as classifyScreen, bu as parseWaitScreen, bz as parseMenu, b as screenChoices } from '../../nitro/nitro.mjs';
|
|
2
|
+
import { a as activeTab } from '../../_/settingstabs.mjs';
|
|
2
3
|
import 'node:http';
|
|
3
4
|
import 'node:https';
|
|
4
5
|
import 'node:crypto';
|
|
@@ -20,8 +21,8 @@ import 'web-push';
|
|
|
20
21
|
import 'node:os';
|
|
21
22
|
import 'node:child_process';
|
|
22
23
|
import 'node:net';
|
|
23
|
-
import 'node:readline';
|
|
24
24
|
import 'node:fs/promises';
|
|
25
|
+
import 'node:readline';
|
|
25
26
|
import 'node:dns';
|
|
26
27
|
import 'node:util';
|
|
27
28
|
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
@@ -29,40 +30,6 @@ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
|
|
|
29
30
|
import '@simplewebauthn/server';
|
|
30
31
|
import 'node:url';
|
|
31
32
|
|
|
32
|
-
const SGR = /\x1b\[([\d;]*)m/g;
|
|
33
|
-
function highlight(params, state) {
|
|
34
|
-
const codes = params === "" ? [0] : params.split(";").map(Number);
|
|
35
|
-
for (let i = 0; i < codes.length; i++) {
|
|
36
|
-
const c = codes[i];
|
|
37
|
-
if (c === 38 || c === 48 || c === 58) {
|
|
38
|
-
if (c === 48) state.bg = true;
|
|
39
|
-
i += codes[i + 1] === 5 ? 2 : codes[i + 1] === 2 ? 4 : 0;
|
|
40
|
-
} else if (c === 0) {
|
|
41
|
-
state.bg = false;
|
|
42
|
-
state.inverse = false;
|
|
43
|
-
} else if (c === 7) state.inverse = true;
|
|
44
|
-
else if (c === 27) state.inverse = false;
|
|
45
|
-
else if (c === 49) state.bg = false;
|
|
46
|
-
else if (c >= 40 && c <= 47) state.bg = true;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function activeTab(line) {
|
|
50
|
-
const state = { bg: false, inverse: false };
|
|
51
|
-
let last = 0;
|
|
52
|
-
const words = [];
|
|
53
|
-
const push = (s) => {
|
|
54
|
-
for (const w of s.split(/\s+/)) if (w) words.push({ text: w, bg: state.bg || state.inverse });
|
|
55
|
-
};
|
|
56
|
-
for (const m of line.matchAll(SGR)) {
|
|
57
|
-
push(line.slice(last, m.index));
|
|
58
|
-
highlight(m[1], state);
|
|
59
|
-
last = m.index + m[0].length;
|
|
60
|
-
}
|
|
61
|
-
push(line.slice(last));
|
|
62
|
-
const hit = words.find((w) => w.bg && w.text !== "Settings");
|
|
63
|
-
return hit ? hit.text.replace(/[^\w]/g, "") : null;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
33
|
const screen_get = defineApi(async (event) => {
|
|
67
34
|
const pane = String(getQuery(event).pane || "");
|
|
68
35
|
if (!PANE_RE.test(pane)) throw new HerdrError("bad_pane", "Invalid pane");
|
|
@@ -76,7 +43,9 @@ const screen_get = defineApi(async (event) => {
|
|
|
76
43
|
const hit = line ? activeTab(line) : null;
|
|
77
44
|
tab = hit && tabs.includes(hit) ? hit : null;
|
|
78
45
|
}
|
|
79
|
-
|
|
46
|
+
const p = findPane(pane);
|
|
47
|
+
const interaction = classifyScreen({ text, agent: p == null ? void 0 : p.agent, status: p == null ? void 0 : p.status, choices: screenChoices(text, p == null ? void 0 : p.agent), settings: Boolean(tabs), menu: parseMenu(text), screen: parseWaitScreen(text) });
|
|
48
|
+
return { text, tabs, tab, interaction };
|
|
80
49
|
});
|
|
81
50
|
|
|
82
51
|
export { screen_get as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineApi, i as getQuery,
|
|
1
|
+
import { a as defineApi, i as getQuery, m as getState, bA as hasTranscript, F as machineOfPane, bB as SEARCH_DEADLINE_MS, bC as SEARCH_MAX_RESULTS, bD as spaceTitle } from '../../nitro/nitro.mjs';
|
|
2
2
|
import 'node:http';
|
|
3
3
|
import 'node:https';
|
|
4
4
|
import 'node:crypto';
|
|
@@ -20,8 +20,8 @@ import 'web-push';
|
|
|
20
20
|
import 'node:os';
|
|
21
21
|
import 'node:child_process';
|
|
22
22
|
import 'node:net';
|
|
23
|
-
import 'node:readline';
|
|
24
23
|
import 'node:fs/promises';
|
|
24
|
+
import 'node:readline';
|
|
25
25
|
import 'node:dns';
|
|
26
26
|
import 'node:util';
|
|
27
27
|
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineApi, P as PANE_RE, H as HerdrError,
|
|
1
|
+
import { a as defineApi, P as PANE_RE, H as HerdrError, bE as markSeen } from '../../nitro/nitro.mjs';
|
|
2
2
|
import 'node:http';
|
|
3
3
|
import 'node:https';
|
|
4
4
|
import 'node:crypto';
|
|
@@ -20,8 +20,8 @@ import 'web-push';
|
|
|
20
20
|
import 'node:os';
|
|
21
21
|
import 'node:child_process';
|
|
22
22
|
import 'node:net';
|
|
23
|
-
import 'node:readline';
|
|
24
23
|
import 'node:fs/promises';
|
|
24
|
+
import 'node:readline';
|
|
25
25
|
import 'node:dns';
|
|
26
26
|
import 'node:util';
|
|
27
27
|
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineApi, i as getQuery,
|
|
1
|
+
import { a as defineApi, i as getQuery, bF as listSessions } from '../../nitro/nitro.mjs';
|
|
2
2
|
import 'node:http';
|
|
3
3
|
import 'node:https';
|
|
4
4
|
import 'node:crypto';
|
|
@@ -20,8 +20,8 @@ import 'web-push';
|
|
|
20
20
|
import 'node:os';
|
|
21
21
|
import 'node:child_process';
|
|
22
22
|
import 'node:net';
|
|
23
|
-
import 'node:readline';
|
|
24
23
|
import 'node:fs/promises';
|
|
24
|
+
import 'node:readline';
|
|
25
25
|
import 'node:dns';
|
|
26
26
|
import 'node:util';
|
|
27
27
|
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineApi, H as HerdrError,
|
|
1
|
+
import { a as defineApi, H as HerdrError, bG as openSession } from '../../nitro/nitro.mjs';
|
|
2
2
|
import 'node:http';
|
|
3
3
|
import 'node:https';
|
|
4
4
|
import 'node:crypto';
|
|
@@ -20,8 +20,8 @@ import 'web-push';
|
|
|
20
20
|
import 'node:os';
|
|
21
21
|
import 'node:child_process';
|
|
22
22
|
import 'node:net';
|
|
23
|
-
import 'node:readline';
|
|
24
23
|
import 'node:fs/promises';
|
|
24
|
+
import 'node:readline';
|
|
25
25
|
import 'node:dns';
|
|
26
26
|
import 'node:util';
|
|
27
27
|
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { a as defineApi, P as PANE_RE, H as HerdrError, f as findPane, h as herdr, bw as settingsTabs, bx as tabsOfRow, bH as settingsFocus, a4 as sleep, g as choicesCache } from '../../nitro/nitro.mjs';
|
|
2
|
+
import { a as activeTab } from '../../_/settingstabs.mjs';
|
|
3
|
+
import 'node:http';
|
|
4
|
+
import 'node:https';
|
|
5
|
+
import 'node:crypto';
|
|
6
|
+
import 'stream';
|
|
7
|
+
import 'events';
|
|
8
|
+
import 'http';
|
|
9
|
+
import 'crypto';
|
|
10
|
+
import 'buffer';
|
|
11
|
+
import 'zlib';
|
|
12
|
+
import 'https';
|
|
13
|
+
import 'net';
|
|
14
|
+
import 'tls';
|
|
15
|
+
import 'url';
|
|
16
|
+
import 'node:events';
|
|
17
|
+
import 'node:buffer';
|
|
18
|
+
import 'node:fs';
|
|
19
|
+
import 'node:path';
|
|
20
|
+
import 'web-push';
|
|
21
|
+
import 'node:os';
|
|
22
|
+
import 'node:child_process';
|
|
23
|
+
import 'node:net';
|
|
24
|
+
import 'node:fs/promises';
|
|
25
|
+
import 'node:readline';
|
|
26
|
+
import 'node:dns';
|
|
27
|
+
import 'node:util';
|
|
28
|
+
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
29
|
+
import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
|
|
30
|
+
import '@simplewebauthn/server';
|
|
31
|
+
import 'node:url';
|
|
32
|
+
|
|
33
|
+
const switching = /* @__PURE__ */ new Set();
|
|
34
|
+
const settingsTab_post = defineApi(async (_event, b) => {
|
|
35
|
+
var _a;
|
|
36
|
+
const pane = String(b.pane_id || "");
|
|
37
|
+
const target = String(b.target || "");
|
|
38
|
+
if (!PANE_RE.test(pane)) throw new HerdrError("bad_pane", "Invalid pane");
|
|
39
|
+
if (((_a = findPane(pane)) == null ? void 0 : _a.agent) !== "claude") throw new HerdrError("stale", "Settings are no longer open.");
|
|
40
|
+
if (switching.has(pane)) throw new HerdrError("busy", "Settings tab change already in progress.");
|
|
41
|
+
const read = async () => {
|
|
42
|
+
var _a2;
|
|
43
|
+
const r = await herdr("pane.read", { pane_id: pane, source: "visible", format: "ansi" }, 4e3);
|
|
44
|
+
const ansi = String(((_a2 = r.read) == null ? void 0 : _a2.text) || "");
|
|
45
|
+
const text = ansi.replace(/\x1b\[[\d;]*m|\r/g, "");
|
|
46
|
+
const tabs = settingsTabs(text);
|
|
47
|
+
const row = ansi.split("\n").find((l) => tabsOfRow(l.replace(/\x1b\[[\d;]*m|\r/g, "")));
|
|
48
|
+
const tab = row && activeTab(row);
|
|
49
|
+
if (!tabs || !tab || !tabs.includes(tab) || !tabs.includes(target)) throw new HerdrError("stale", "Settings have changed.");
|
|
50
|
+
return { text, tabs, tab, ansi };
|
|
51
|
+
};
|
|
52
|
+
switching.add(pane);
|
|
53
|
+
try {
|
|
54
|
+
let screen = await read();
|
|
55
|
+
for (let step = 0; screen.tab !== target; step++) {
|
|
56
|
+
if (step >= screen.tabs.length) throw new HerdrError("stale", "Could not switch settings tabs. Open the terminal and try again.");
|
|
57
|
+
for (let up = 0; screen.tab === "Config" && settingsFocus(screen.text) !== "tabs"; up++) {
|
|
58
|
+
if (up >= 100 || settingsFocus(screen.text) === null) throw new HerdrError("stale", "Use the terminal to focus the settings tabs.");
|
|
59
|
+
const before = screen;
|
|
60
|
+
await herdr("pane.send_input", { pane_id: pane, keys: ["up"] });
|
|
61
|
+
for (let attempt = 0; attempt < 15; attempt++) {
|
|
62
|
+
await sleep(100);
|
|
63
|
+
screen = await read();
|
|
64
|
+
if (screen.ansi !== before.ansi) break;
|
|
65
|
+
}
|
|
66
|
+
if (screen.tab !== before.tab) throw new HerdrError("stale", "Settings have changed.");
|
|
67
|
+
if (screen.ansi === before.ansi) throw new HerdrError("stale", "Use the terminal to focus the settings tabs.");
|
|
68
|
+
}
|
|
69
|
+
if (screen.tab === target) break;
|
|
70
|
+
const direction = screen.tabs.indexOf(target) > screen.tabs.indexOf(screen.tab) ? 1 : -1;
|
|
71
|
+
const next = screen.tabs[screen.tabs.indexOf(screen.tab) + direction];
|
|
72
|
+
const previous = screen.tab;
|
|
73
|
+
await herdr("pane.send_input", { pane_id: pane, keys: [direction > 0 ? "right" : "left"] });
|
|
74
|
+
for (let attempt = 0; attempt < 15; attempt++) {
|
|
75
|
+
await sleep(100);
|
|
76
|
+
screen = await read();
|
|
77
|
+
if (screen.tab !== previous) break;
|
|
78
|
+
}
|
|
79
|
+
if (screen.tab !== next) throw new HerdrError("stale", "Could not switch settings tabs. Open the terminal and try again.");
|
|
80
|
+
}
|
|
81
|
+
return { ok: true, tab: screen.tab };
|
|
82
|
+
} finally {
|
|
83
|
+
choicesCache.delete(pane);
|
|
84
|
+
switching.delete(pane);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
export { settingsTab_post as default };
|
|
89
|
+
//# sourceMappingURL=settings-tab.post.mjs.map
|