opencharm 0.14.0 → 0.14.1

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
@@ -1026,7 +1026,7 @@ function sendAdmin(socketPath, request) {
1026
1026
  }
1027
1027
  //#endregion
1028
1028
  //#region package.json
1029
- var version = "0.14.0";
1029
+ var version = "0.14.1";
1030
1030
  function channelToCube(value) {
1031
1031
  if (value < 48) return 0;
1032
1032
  if (value < 115) return 1;
@@ -5642,8 +5642,18 @@ function localHost() {
5642
5642
  } catch {
5643
5643
  label = "";
5644
5644
  }
5645
- if (!/^[A-Za-z0-9-]{1,63}$/.test(label)) label = hostname().split(".")[0] ?? "";
5646
- return `${label}.local`;
5645
+ if (/^[A-Za-z0-9-]{1,63}$/.test(label)) return {
5646
+ host: `${label}.local`,
5647
+ system: true
5648
+ };
5649
+ return {
5650
+ host: `${hostname().split(".")[0] ?? ""}.local`,
5651
+ system: false
5652
+ };
5653
+ }
5654
+ function leaveHostToSystem(service) {
5655
+ const records = service.records.bind(service);
5656
+ service.records = () => records().filter((record) => record.type !== "A" && record.type !== "AAAA");
5647
5657
  }
5648
5658
  const announceOnNetwork = (port) => {
5649
5659
  let warned = false;
@@ -5653,13 +5663,16 @@ const announceOnNetwork = (port) => {
5653
5663
  console.error(`charmd: mDNS: ${String(error)}`);
5654
5664
  });
5655
5665
  const computer = hostname().replace(/\.local$/, "");
5656
- bonjour.publish({
5666
+ const { host, system } = localHost();
5667
+ const service = bonjour.publish({
5657
5668
  name: `OpenCharm on ${computer}`,
5658
- host: localHost(),
5669
+ host,
5659
5670
  type: "opencharm",
5660
5671
  port,
5661
5672
  txt: { path: "/charm" }
5662
- }).on("error", (error) => {
5673
+ });
5674
+ if (system) leaveHostToSystem(service);
5675
+ service.on("error", (error) => {
5663
5676
  console.error(`charmd: couldn't announce itself on the network: ${String(error)}`);
5664
5677
  });
5665
5678
  return () => new Promise((resolve) => {
@@ -8191,7 +8204,7 @@ function formatIdentity(unit, version, commit) {
8191
8204
  let cached;
8192
8205
  function identity() {
8193
8206
  if (cached) return cached;
8194
- const commit = "d9abcc0";
8207
+ const commit = "8c79a0d";
8195
8208
  cached = {
8196
8209
  version: `cli@${version}`,
8197
8210
  commit,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencharm",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
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