dextunnel 0.1.0

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 (76) hide show
  1. package/LICENSE +211 -0
  2. package/README.md +112 -0
  3. package/SECURITY.md +27 -0
  4. package/SUPPORT.md +43 -0
  5. package/package.json +44 -0
  6. package/public/client-shared.js +1831 -0
  7. package/public/favicon.svg +11 -0
  8. package/public/host.html +29 -0
  9. package/public/host.js +2079 -0
  10. package/public/index.html +28 -0
  11. package/public/index.js +98 -0
  12. package/public/live-bridge-lifecycle.js +258 -0
  13. package/public/live-bridge-retry-state.js +61 -0
  14. package/public/live-selection-intent.js +79 -0
  15. package/public/remote-operator-state.js +316 -0
  16. package/public/remote.html +167 -0
  17. package/public/remote.js +3967 -0
  18. package/public/styles.css +2793 -0
  19. package/public/surface-view-state.js +89 -0
  20. package/public/voice-dictation.js +45 -0
  21. package/src/bin/desktop-rehydration-smoke.mjs +111 -0
  22. package/src/bin/dextunnel.mjs +41 -0
  23. package/src/bin/doctor.mjs +48 -0
  24. package/src/bin/launch-attest.mjs +39 -0
  25. package/src/bin/launch-status.mjs +49 -0
  26. package/src/bin/mobile-link-proxy.mjs +221 -0
  27. package/src/bin/mobile-proof.mjs +164 -0
  28. package/src/bin/mobile-transport-smoke.mjs +200 -0
  29. package/src/bin/probe-codex-app-server-write.mjs +36 -0
  30. package/src/bin/probe-codex-app-server.mjs +30 -0
  31. package/src/lib/agent-room-context.mjs +54 -0
  32. package/src/lib/agent-room-runtime.mjs +355 -0
  33. package/src/lib/agent-room-service.mjs +335 -0
  34. package/src/lib/agent-room-state.mjs +406 -0
  35. package/src/lib/agent-room-store.mjs +71 -0
  36. package/src/lib/agent-room-text.mjs +48 -0
  37. package/src/lib/app-server-contract.mjs +66 -0
  38. package/src/lib/app-server-runtime.mjs +60 -0
  39. package/src/lib/attachment-service.mjs +119 -0
  40. package/src/lib/bridge-api-handler.mjs +719 -0
  41. package/src/lib/bridge-runtime-lifecycle.mjs +51 -0
  42. package/src/lib/bridge-status-builder.mjs +60 -0
  43. package/src/lib/codex-app-server-client.mjs +1511 -0
  44. package/src/lib/companion-state.mjs +453 -0
  45. package/src/lib/control-lease-service.mjs +180 -0
  46. package/src/lib/debug-harness-service.mjs +173 -0
  47. package/src/lib/desktop-integration.mjs +146 -0
  48. package/src/lib/desktop-rehydration-smoke.mjs +269 -0
  49. package/src/lib/dextunnel-cli.mjs +122 -0
  50. package/src/lib/discovery-docs.mjs +1321 -0
  51. package/src/lib/fake-codex-app-server-bridge.mjs +340 -0
  52. package/src/lib/install-preflight.mjs +373 -0
  53. package/src/lib/interaction-resolution-service.mjs +185 -0
  54. package/src/lib/interaction-state.mjs +360 -0
  55. package/src/lib/launch-release-bar.mjs +158 -0
  56. package/src/lib/live-control-state.mjs +107 -0
  57. package/src/lib/live-payload-builder.mjs +298 -0
  58. package/src/lib/live-selection-transition-state.mjs +49 -0
  59. package/src/lib/live-transcript-state.mjs +549 -0
  60. package/src/lib/mobile-network-profile.mjs +39 -0
  61. package/src/lib/mock-codex-adapter.mjs +62 -0
  62. package/src/lib/operator-diagnostics.mjs +82 -0
  63. package/src/lib/repo-changes-service.mjs +527 -0
  64. package/src/lib/runtime-config.mjs +106 -0
  65. package/src/lib/selection-state-service.mjs +214 -0
  66. package/src/lib/session-store.mjs +355 -0
  67. package/src/lib/shared-room-state.mjs +473 -0
  68. package/src/lib/shared-selection-state.mjs +40 -0
  69. package/src/lib/sse-hub.mjs +35 -0
  70. package/src/lib/static-surface-service.mjs +71 -0
  71. package/src/lib/surface-access.mjs +189 -0
  72. package/src/lib/surface-presence-service.mjs +118 -0
  73. package/src/lib/surface-request-guard.mjs +52 -0
  74. package/src/lib/thread-sync-state.mjs +536 -0
  75. package/src/lib/watcher-lifecycle.mjs +287 -0
  76. package/src/server.mjs +1446 -0
package/LICENSE ADDED
@@ -0,0 +1,211 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License.
67
+
68
+ Subject to the terms and conditions of this License, each Contributor
69
+ hereby grants to You a perpetual, worldwide, non-exclusive,
70
+ no-charge, royalty-free, irrevocable copyright license to reproduce,
71
+ prepare Derivative Works of, publicly display, publicly perform,
72
+ sublicense, and distribute the Work and such Derivative Works in
73
+ Source or Object form.
74
+
75
+ 3. Grant of Patent License.
76
+
77
+ Subject to the terms and conditions of this License, each Contributor
78
+ hereby grants to You a perpetual, worldwide, non-exclusive,
79
+ no-charge, royalty-free, irrevocable (except as stated in this section)
80
+ patent license to make, have made, use, offer to sell, sell, import,
81
+ and otherwise transfer the Work, where such license applies only to
82
+ those patent claims licensable by such Contributor that are necessarily
83
+ infringed by their Contribution(s) alone or by combination of their
84
+ Contribution(s) with the Work to which such Contribution(s) was
85
+ submitted. If You institute patent litigation against any entity
86
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
87
+ the Work or a Contribution incorporated within the Work constitutes
88
+ direct or contributory patent infringement, then any patent licenses
89
+ granted to You under this License for that Work shall terminate as of
90
+ the date such litigation is filed.
91
+
92
+ 4. Redistribution.
93
+
94
+ You may reproduce and distribute copies of the Work or Derivative Works
95
+ thereof in any medium, with or without modifications, and in Source or
96
+ Object form, provided that You meet the following conditions:
97
+
98
+ (a) You must give any other recipients of the Work or
99
+ Derivative Works a copy of this License; and
100
+
101
+ (b) You must cause any modified files to carry prominent notices
102
+ stating that You changed the files; and
103
+
104
+ (c) You must retain, in the Source form of any Derivative Works
105
+ that You distribute, all copyright, patent, trademark, and
106
+ attribution notices from the Source form of the Work,
107
+ excluding those notices that do not pertain to any part of
108
+ the Derivative Works; and
109
+
110
+ (d) If the Work includes a "NOTICE" text file as part of its
111
+ distribution, then any Derivative Works that You distribute must
112
+ include a readable copy of the attribution notices contained
113
+ within such NOTICE file, excluding those notices that do not
114
+ pertain to any part of the Derivative Works, in at least one
115
+ of the following places: within a NOTICE text file distributed
116
+ as part of the Derivative Works; within the Source form or
117
+ documentation, if provided along with the Derivative Works; or,
118
+ within a display generated by the Derivative Works, if and
119
+ wherever such third-party notices normally appear. The contents
120
+ of the NOTICE file are for informational purposes only and
121
+ do not modify the License. You may add Your own attribution
122
+ notices within Derivative Works that You distribute, alongside
123
+ or as an addendum to the NOTICE text from the Work, provided
124
+ that such additional attribution notices cannot be construed
125
+ as modifying the License.
126
+
127
+ You may add Your own copyright statement to Your modifications and
128
+ may provide additional or different license terms and conditions
129
+ for use, reproduction, or distribution of Your modifications, or
130
+ for any such Derivative Works as a whole, provided Your use,
131
+ reproduction, and distribution of the Work otherwise complies with
132
+ the conditions stated in this License.
133
+
134
+ 5. Submission of Contributions.
135
+
136
+ Unless You explicitly state otherwise, any Contribution intentionally
137
+ submitted for inclusion in the Work by You to the Licensor shall be
138
+ under the terms and conditions of this License, without any additional
139
+ terms or conditions. Notwithstanding the above, nothing herein shall
140
+ supersede or modify the terms of any separate license agreement you may
141
+ have executed with Licensor regarding such Contributions.
142
+
143
+ 6. Trademarks.
144
+
145
+ This License does not grant permission to use the trade names,
146
+ trademarks, service marks, or product names of the Licensor,
147
+ except as required for reasonable and customary use in describing the
148
+ origin of the Work and reproducing the content of the NOTICE file.
149
+
150
+ 7. Disclaimer of Warranty.
151
+
152
+ Unless required by applicable law or agreed to in writing, Licensor
153
+ provides the Work (and each Contributor provides its Contributions) on an
154
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
155
+ express or implied, including, without limitation, any warranties or
156
+ conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
157
+ PARTICULAR PURPOSE. You are solely responsible for determining the
158
+ appropriateness of using or redistributing the Work and assume any
159
+ risks associated with Your exercise of permissions under this License.
160
+
161
+ 8. Limitation of Liability.
162
+
163
+ In no event and under no legal theory, whether in tort (including
164
+ negligence), contract, or otherwise, unless required by applicable law
165
+ (such as deliberate and grossly negligent acts) or agreed to in writing,
166
+ shall any Contributor be liable to You for damages, including any
167
+ direct, indirect, special, incidental, or consequential damages of any
168
+ character arising as a result of this License or out of the use or
169
+ inability to use the Work (including but not limited to damages for loss
170
+ of goodwill, work stoppage, computer failure or malfunction, or any and
171
+ all other commercial damages or losses), even if such Contributor
172
+ has been advised of the possibility of such damages.
173
+
174
+ 9. Accepting Warranty or Additional Liability.
175
+
176
+ While redistributing the Work or Derivative Works thereof, You may choose
177
+ to offer, and charge a fee for, acceptance of support, warranty,
178
+ indemnity, or other liability obligations and/or rights consistent with
179
+ this License. However, in accepting such obligations, You may act only
180
+ on Your own behalf and on Your sole responsibility, not on behalf
181
+ of any other Contributor, and only if You agree to indemnify,
182
+ defend, and hold each Contributor harmless for any liability
183
+ incurred by, or claims asserted against, such Contributor by reason
184
+ of your accepting any such warranty or additional liability.
185
+
186
+ END OF TERMS AND CONDITIONS
187
+
188
+ APPENDIX: How to apply the Apache License to your work.
189
+
190
+ To apply the Apache License to your work, attach the following
191
+ boilerplate notice, with the fields enclosed by brackets "[]"
192
+ replaced with your own identifying information. (Don't include
193
+ the brackets!) The text should be enclosed in the appropriate
194
+ comment syntax for the file format. We also recommend that a
195
+ file or class name and description of purpose be included on the
196
+ same "printed page" as the copyright notice for easier
197
+ identification within third-party archives.
198
+
199
+ Copyright [yyyy] [name of copyright owner]
200
+
201
+ Licensed under the Apache License, Version 2.0 (the "License");
202
+ you may not use this file except in compliance with the License.
203
+ You may obtain a copy of the License at
204
+
205
+ http://www.apache.org/licenses/LICENSE-2.0
206
+
207
+ Unless required by applicable law or agreed to in writing, software
208
+ distributed under the License is distributed on an "AS IS" BASIS,
209
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
210
+ See the License for the specific language governing permissions and
211
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,112 @@
1
+ # Dextunnel
2
+
3
+ It's like VibeTunnel, but for the Codex app.
4
+
5
+ Dextunnel lets you keep a real Codex session moving from your phone. Read the thread, reply, queue messages, and clear approvals without doing SSH or remote desktop on a tiny screen.
6
+
7
+ Recommended on Mac: `DextunnelHost` + Tailscale.
8
+ If you want the advanced manual path, run from source or install the CLI package.
9
+ Native iPhone and iPad app coming soon.
10
+
11
+ ## Screenshots
12
+
13
+ | Reply | Approvals | Updates |
14
+ | --- | --- | --- |
15
+ | ![Dextunnel reply view](docs/dextunnel-reply.png) | ![Dextunnel approval view](docs/dextunnel-approval.png) | ![Dextunnel updates view](docs/dextunnel-updates.png) |
16
+
17
+ ## Mac
18
+
19
+ This is the main path.
20
+
21
+ 1. Install Tailscale on the Mac.
22
+ 2. Open Tailscale, sign in, and turn it on.
23
+ 3. Launch `DextunnelHost`.
24
+ 4. Open the Tailscale URL the app shows.
25
+
26
+ That's it.
27
+
28
+ `DextunnelHost` keeps the bridge on `127.0.0.1` and handles `tailscale serve` for you.
29
+ macOS may ask for local network access on first launch because the app checks and configures Tailscale for you.
30
+ The Dextunnel bridge itself still stays on `127.0.0.1`.
31
+
32
+ Why Tailscale:
33
+
34
+ - it has a free personal tier
35
+ - it keeps the Mac setup dead simple
36
+ - it keeps the bridge local-first
37
+ - no weird port-forwarding nonsense
38
+
39
+ Setup links:
40
+
41
+ - Tailscale download: [tailscale.com/download](https://tailscale.com/download)
42
+ - Tailscale getting started: [tailscale.com/kb/1017/install](https://tailscale.com/kb/1017/install)
43
+ - Mac host notes: [docs/ops/apple-host-options.md](docs/ops/apple-host-options.md)
44
+
45
+ ## Advanced Manual Path
46
+
47
+ If you want full manual control:
48
+
49
+ Run from this repo:
50
+
51
+ ```bash
52
+ npm start
53
+ npm run doctor
54
+ ```
55
+
56
+ Or install the packaged CLI:
57
+
58
+ ```bash
59
+ npm install -g dextunnel
60
+ dextunnel serve
61
+ dextunnel doctor
62
+ ```
63
+
64
+ Then open [http://127.0.0.1:4317/](http://127.0.0.1:4317/).
65
+
66
+ Use `npm run start:network` only if you intentionally want a manual LAN or broader-network listener.
67
+
68
+ ## Today
69
+
70
+ - browse real Codex threads through `app-server`
71
+ - reply and queue from the remote
72
+ - approvals and user input
73
+ - shared room and thread selection between the Mac host and the remote
74
+
75
+ ## Rough Edges
76
+
77
+ - desktop Codex visibility is not live yet; quit and reopen Codex when you need it to rehydrate remote-written turns
78
+ - this is still beta software
79
+ - this is for a trusted local machine plus your own devices, not a public multi-user service
80
+
81
+ ## Dev
82
+
83
+ App name: `DextunnelHost.app`
84
+
85
+ ```bash
86
+ cd native/apple
87
+ xcodegen generate
88
+ swift test
89
+ xcodebuild -project DextunnelAppleApps.xcodeproj -scheme DextunnelMenuBarHostApp -configuration Debug -destination 'platform=macOS' CODE_SIGNING_ALLOWED=NO build
90
+ ```
91
+
92
+ ## Validate
93
+
94
+ ```bash
95
+ npm run doctor
96
+ npm run release:check
97
+ ```
98
+
99
+ `release:check` runs the Node suite, the native Swift suite, and refreshes the automated launch attestation.
100
+
101
+ ## Docs
102
+
103
+ - Mac host release: [docs/ops/apple-menubar-release.md](docs/ops/apple-menubar-release.md)
104
+ - npm publish: [docs/ops/npm-publish.md](docs/ops/npm-publish.md)
105
+ - Docs map: [docs/index.md](docs/index.md)
106
+ - Contributing: [CONTRIBUTING.md](CONTRIBUTING.md)
107
+ - Security: [SECURITY.md](SECURITY.md)
108
+ - Support: [SUPPORT.md](SUPPORT.md)
109
+
110
+ ## License
111
+
112
+ Dextunnel is licensed under [Apache-2.0](LICENSE).
package/SECURITY.md ADDED
@@ -0,0 +1,27 @@
1
+ # Security Policy
2
+
3
+ Dextunnel is a local-first beta. Please report suspected security issues privately.
4
+
5
+ ## Supported Versions
6
+
7
+ | Surface | Status |
8
+ | --- | --- |
9
+ | Latest `main` branch | Supported |
10
+ | Latest notarized macOS menu bar host release | Supported |
11
+ | Older commits, tags, and ad hoc local builds | Not supported |
12
+
13
+ ## Report A Vulnerability
14
+
15
+ Please do not open a public GitHub issue for a security-sensitive bug.
16
+
17
+ Preferred reporting path:
18
+
19
+ 1. Use GitHub private vulnerability reporting or a draft security advisory if it is enabled for this repo.
20
+ 2. If that is not available, contact the maintainer through an existing private channel and include:
21
+ - the affected commit, branch, or released app build
22
+ - a short impact summary
23
+ - reproduction steps
24
+ - whether the issue requires local machine access, Tailscale access, or remote surface control
25
+ - logs, screenshots, or proof-of-concept details if they help
26
+
27
+ We will acknowledge good-faith reports as soon as practical and work with you on coordinated disclosure.
package/SUPPORT.md ADDED
@@ -0,0 +1,43 @@
1
+ # Support
2
+
3
+ Dextunnel is a local-first beta for people already running Codex sessions.
4
+
5
+ ## Where To Ask For Help
6
+
7
+ - Bug reports: GitHub Issues
8
+ - Feature requests: GitHub Issues
9
+ - Security-sensitive reports: `SECURITY.md`
10
+ - Setup and operator docs: `README.md` and `docs/index.md`
11
+
12
+ ## Before You Open An Issue
13
+
14
+ Please include the basics that make a bug report actionable:
15
+
16
+ 1. The Dextunnel surface you are using:
17
+ - web remote
18
+ - macOS menu bar host
19
+ - both
20
+ 2. Your environment:
21
+ - macOS version
22
+ - browser
23
+ - whether Tailscale is installed and connected
24
+ 3. The exact commands you ran, if relevant
25
+ 4. What you expected to happen
26
+ 5. What actually happened
27
+ 6. Screenshots or logs when they help
28
+
29
+ Useful local checks:
30
+
31
+ ```bash
32
+ npm run doctor
33
+ npm test
34
+ npm run test:native
35
+ ```
36
+
37
+ If the issue involves a real Codex session, say whether it affects:
38
+
39
+ - transcript loading
40
+ - remote posting
41
+ - approvals or tool input
42
+ - desktop rehydration
43
+ - the app-managed Tailscale host path
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "dextunnel",
3
+ "version": "0.1.0",
4
+ "description": "Transcript-first mobile companion for Codex.",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
7
+ "bin": {
8
+ "dextunnel": "./src/bin/dextunnel.mjs"
9
+ },
10
+ "files": [
11
+ "public",
12
+ "src",
13
+ "LICENSE",
14
+ "README.md",
15
+ "SECURITY.md",
16
+ "SUPPORT.md"
17
+ ],
18
+ "engines": {
19
+ "node": ">=24"
20
+ },
21
+ "scripts": {
22
+ "doctor": "node src/bin/doctor.mjs",
23
+ "native:host:archive": "cd native/apple && ./scripts/release-menubar-host.sh archive",
24
+ "native:host:export": "cd native/apple && ./scripts/release-menubar-host.sh export",
25
+ "native:host:notarize": "cd native/apple && ./scripts/release-menubar-host.sh notarize",
26
+ "native:host:release": "cd native/apple && ./scripts/release-menubar-host.sh release",
27
+ "start": "node src/bin/dextunnel.mjs serve",
28
+ "start:network": "node src/bin/dextunnel.mjs serve --network",
29
+ "dev": "node --watch src/server.mjs",
30
+ "launch:attest-manual": "node src/bin/launch-attest.mjs manual-pass",
31
+ "launch:check": "npm test && node src/bin/launch-attest.mjs automated-pass && node src/bin/launch-status.mjs",
32
+ "launch:clear": "node src/bin/launch-attest.mjs clear",
33
+ "launch:status": "node src/bin/launch-status.mjs",
34
+ "release:check": "npm run doctor && npm test && npm run test:native && node src/bin/launch-attest.mjs automated-pass && node src/bin/launch-status.mjs",
35
+ "smoke:desktop-rehydration": "node src/bin/desktop-rehydration-smoke.mjs",
36
+ "smoke:mobile-proof": "node src/bin/mobile-proof.mjs",
37
+ "smoke:transport": "node src/bin/mobile-transport-smoke.mjs",
38
+ "smoke:native-bridge": "cd native/apple && swift run DextunnelNativeBridgeSmoke",
39
+ "test:native": "cd native/apple && swift test",
40
+ "test": "node --test",
41
+ "probe:app-server": "node src/bin/probe-codex-app-server.mjs",
42
+ "probe:app-server-write": "node src/bin/probe-codex-app-server-write.mjs"
43
+ }
44
+ }