opencharm 0.8.3 → 0.8.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/dist/main.mjs CHANGED
@@ -997,7 +997,7 @@ function sendAdmin(socketPath, request) {
997
997
  }
998
998
  //#endregion
999
999
  //#region package.json
1000
- var version = "0.8.3";
1000
+ var version = "0.8.4";
1001
1001
  function channelToCube(value) {
1002
1002
  if (value < 48) return 0;
1003
1003
  if (value < 115) return 1;
@@ -5055,7 +5055,7 @@ function formatIdentity(unit, version, commit) {
5055
5055
  let cached;
5056
5056
  function identity() {
5057
5057
  if (cached) return cached;
5058
- const commit = "7a2a18a";
5058
+ const commit = "721b820";
5059
5059
  cached = {
5060
5060
  version: `cli@${version}`,
5061
5061
  commit,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencharm",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "description": "An open-source body for the AI agent you already run: a face, a voice, one key. Claude Code, Codex, Gemini CLI, Hermes, OpenClaw or any ACP or OpenAI-compatible agent; on a small board, your Mac's notch or the browser.",
5
5
  "type": "module",
6
6
  "bin": {
Binary file
package/sim/sim.js CHANGED
@@ -175,9 +175,13 @@ addEventListener("online", () => ws?.close());
175
175
 
176
176
  async function connect() {
177
177
  if (!wifiOn) return;
178
- // A host page may hold a connection back: the desktop app checks its own charmd's address first.
179
- if (window.charmMayConnect && !(await window.charmMayConnect(baseUrl)))
178
+ // A host page may say where to connect, or "not yet" (null: asked again shortly): the desktop app's
179
+ // own charmd gets its port only as it starts, and may move when it restarts.
180
+ const url = window.charmConnectTo ? await window.charmConnectTo() : baseUrl;
181
+ if (!url) {
182
+ setTimeout(connect, 500);
180
183
  return;
184
+ }
181
185
  const token = M.UTF8ToString(M._sim_token());
182
186
  // The token rides as a WebSocket subprotocol: browsers can't set Authorization, and a token must
183
187
  // never go in a URL (proxies and logs keep URLs).
@@ -185,7 +189,7 @@ async function connect() {
185
189
  ? ["opencharm", `opencharm.token.${token}`]
186
190
  : ["opencharm"];
187
191
  statusEl.textContent = "CONNECTING";
188
- ws = new WebSocket(baseUrl, protocols);
192
+ ws = new WebSocket(url, protocols);
189
193
  ws.binaryType = "arraybuffer";
190
194
  ws.onopen = () => {
191
195
  trace.connected = true;