Commit Graph

35 Commits

Author SHA1 Message Date
h z
b270649f21 Merge pull request 'dev/2026-04-08' (#1) from dev/2026-04-08 into main
Reviewed-on: #1
2026-04-13 09:34:01 +00:00
8b26919790 fix: globalThis 2026-04-10 21:58:59 +01:00
4adb187331 fix: migrate startup guard and shared state to globalThis
Module-level _clientStarted / ruleRegistry / onAuthenticatedCallbacks
reset on hot-reload (new VM context), causing a second runtime to start
and the exposed __yonexusClient API to point at orphaned objects.

- Replace let _clientStarted with _G["_yonexusClientStarted"]
- Store ruleRegistry and onAuthenticatedCallbacks under globalThis keys,
  initialising only when absent (survives hot-reload)
- Store runtime under _G["_yonexusClientRuntime"]; sendRule / submitPairingCode
  closures read it from globalThis instead of capturing a module-local ref
- Re-write __yonexusClient every register() call so closures stay current,
  but skip runtime.start() when the globalThis flag is already set

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 20:41:27 +01:00
8824e768fb feat: wire rule registry and authenticated callback into client runtime
- Add ruleRegistry and onAuthenticated options to YonexusClientRuntime
- Dispatch non-builtin messages to rule registry
- Fire onAuthenticated callback on auth_success
- Reload persisted state on reconnect so externally-written secrets are picked up
- Re-send hello on auth_failed("not_paired") when client has a valid secret
- Always enter waiting_pair_confirm after pair_request regardless of notification status
- Expose __yonexusClient on globalThis for cross-plugin communication
- Wire onStateChange in transport creation (previously missing, prevented connection)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 20:14:57 +01:00
nav
57b53fc122 Fix strict TypeScript checks for client 2026-04-09 04:38:03 +00:00
nav
7cdda2e335 test(client): cover pairing restart resume flow 2026-04-09 04:06:06 +00:00
nav
b10ebc541e test: cover client reconnect failures 2026-04-09 03:33:09 +00:00
nav
9fd9b50842 test: cover first-run pair bootstrap 2026-04-09 03:02:36 +00:00
nav
5fbbdd199c test: cover client restart auth recovery 2026-04-09 02:04:06 +00:00
nav
93e09875ec test: cover corrupted client state 2026-04-09 01:32:49 +00:00
nav
65c1f92cc1 test: cover client runtime flow 2026-04-09 00:42:32 +00:00
nav
df14022c9a test(client): add auth and heartbeat coverage 2026-04-09 00:36:37 +00:00
nav
824019168e test: add client unit test coverage 2026-04-09 00:03:38 +00:00
nav
4322604f78 docs: flesh out client readme 2026-04-08 23:32:33 +00:00
nav
ddeed9a7b7 Harden client reconnect and protocol guards 2026-04-08 23:03:54 +00:00
nav
07c2438fb8 feat: add client rule registry 2026-04-08 22:39:49 +00:00
nav
58818e11d1 Implement heartbeat send and re-pair trust reset 2026-04-08 22:35:02 +00:00
nav
5ca6ec0952 feat: add client auth request flow 2026-04-08 22:04:44 +00:00
nav
cec59784de feat: handle client pairing messages 2026-04-08 21:38:43 +00:00
nav
fc226b1f18 feat(client): add keypair generation 2026-04-08 21:34:38 +00:00
nav
fb39a17dbb Add client runtime and hello handshake 2026-04-08 21:13:16 +00:00
nav
bc3e931979 Add client WebSocket transport 2026-04-08 21:05:12 +00:00
nav
2148027a41 feat(client): add local trust material state store 2026-04-08 20:33:25 +00:00
nav
1d751b7c55 feat: add client config validation 2026-04-08 20:03:28 +00:00
nav
c2bdb2efb6 feat: scaffold yonexus client plugin 2026-04-08 19:33:32 +00:00
nav
5234358cac create initial project skeleton 2026-04-01 18:11:04 +00:00
nav
4350446b5a add development conventions 2026-04-01 01:58:16 +00:00
nav
aff3b0a39b add implementation task breakdown 2026-04-01 01:56:30 +00:00
nav
4b897121ff add manifest and install plan 2026-04-01 01:53:20 +00:00
nav
98a7383f0b add scaffold plan 2026-04-01 01:38:34 +00:00
nav
f0a5336cc7 add project structure document 2026-04-01 01:36:05 +00:00
nav
183f2eea6d note protocol submodule in plan 2026-04-01 01:21:33 +00:00
nav
fd187e1b61 add Yonexus.Protocol as submodule 2026-04-01 01:19:57 +00:00
root
c5330bb9f9 add project plan 2026-04-01 01:08:12 +00:00
nav
2c5f4c6002 init repository 2026-04-01 00:52:50 +00:00