@open-artifacts/bus 0.260.0 → 0.262.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.
package/assets/oa-bus.ts CHANGED
@@ -11,7 +11,7 @@ import { StringDecoder } from "node:string_decoder";
11
11
  type Json = Record<string, unknown>;
12
12
 
13
13
  /** The IPC marker (CONTRACT.md): the package version, stamped by the CLI's bundler. */
14
- const CLIENT_VERSION = "0.260.0";
14
+ const CLIENT_VERSION = "0.262.0";
15
15
 
16
16
  type Frame = Json & { type: string; id: string };
17
17
  type Ctx = {
@@ -27929,7 +27929,7 @@ var base2 = { v: external_exports.literal(V), id: external_exports.string().min(
27929
27929
  var late = { late: external_exports.array(external_exports.string().min(1)).optional() };
27930
27930
  var isWellFormed2 = (s) => s.isWellFormed();
27931
27931
  var WELL_FORMED = { message: "text is not well-formed unicode" };
27932
- var CLIENT_VERSION = true ? "0.260.0" : "0.0.0";
27932
+ var CLIENT_VERSION = true ? "0.262.0" : "0.0.0";
27933
27933
  var clientVersion = {
27934
27934
  client_version: external_exports.string().min(1).max(64).optional()
27935
27935
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oa-bus",
3
- "version": "0.260.0",
3
+ "version": "0.262.0",
4
4
  "type": "module",
5
5
  "openclaw": {
6
6
  "extensions": [
package/dist/index.js CHANGED
@@ -23690,7 +23690,7 @@ var init_frames = __esm({
23690
23690
  late = { late: external_exports.array(external_exports.string().min(1)).optional() };
23691
23691
  isWellFormed2 = (s) => s.isWellFormed();
23692
23692
  WELL_FORMED = { message: "text is not well-formed unicode" };
23693
- CLIENT_VERSION = true ? "0.260.0" : "0.0.0";
23693
+ CLIENT_VERSION = true ? "0.262.0" : "0.0.0";
23694
23694
  clientVersion = {
23695
23695
  client_version: external_exports.string().min(1).max(64).optional()
23696
23696
  };
@@ -64612,15 +64612,16 @@ var skillFolder = (text3) => {
64612
64612
  const name = m?.[1] ? /^name:\s*"?([^"\n]+)"?\s*$/m.exec(m[1])?.[1] : void 0;
64613
64613
  return name && /^[a-z0-9][a-z0-9-]{0,62}$/.test(name) ? name : void 0;
64614
64614
  };
64615
+ var codexBlockBody = (text3) => {
64616
+ const lines = text3.replace(/\r\n/g, "\n").split("\n");
64617
+ const start = lineIndex(lines, CODEX_BEGIN);
64618
+ if (start === -1) return void 0;
64619
+ const end = lineIndex(lines, CODEX_END, start + 1);
64620
+ return end === -1 ? void 0 : lines.slice(start + 1, end).join("\n");
64621
+ };
64615
64622
  var skillVersion = (text3) => {
64616
64623
  const t = text3.replace(/\r\n/g, "\n");
64617
- let src = t;
64618
- const lines = t.split("\n");
64619
- const start = lineIndex(lines, CODEX_BEGIN);
64620
- if (start !== -1) {
64621
- const end = lineIndex(lines, CODEX_END, start + 1);
64622
- if (end !== -1) src = lines.slice(start + 1, end).join("\n");
64623
- }
64624
+ const src = codexBlockBody(t) ?? t;
64624
64625
  const fm = /^---\n([\s\S]*?)\n---(?:\n|$)/.exec(src);
64625
64626
  if (!fm?.[1]) return void 0;
64626
64627
  const m = /^\s*version:\s*(.+?)\s*$/m.exec(fm[1]);
@@ -64842,12 +64843,17 @@ var installCodex = (deps2, folder, text3, written, notes) => {
64842
64843
  return;
64843
64844
  }
64844
64845
  written.push(filePath);
64845
- try {
64846
- dropCodexBlock(agentsPath, notes);
64847
- } catch (e) {
64848
- notes.push(
64849
- `Could not update ${agentsPath}: ${e instanceof Error ? e.message : String(e)}`
64850
- );
64846
+ const blockBody = codexBlockBody(before);
64847
+ const blockFolder = blockBody === void 0 ? void 0 : skillFolder(`${blockBody}
64848
+ `);
64849
+ if (blockFolder === void 0 || blockFolder === folder) {
64850
+ try {
64851
+ dropCodexBlock(agentsPath, notes);
64852
+ } catch (e) {
64853
+ notes.push(
64854
+ `Could not update ${agentsPath}: ${e instanceof Error ? e.message : String(e)}`
64855
+ );
64856
+ }
64851
64857
  }
64852
64858
  return;
64853
64859
  }
@@ -65012,12 +65018,14 @@ var codexSkillState = (deps2) => {
65012
65018
  const out = {
65013
65019
  shared: codexSkillsShared(deps2)
65014
65020
  };
65021
+ let fileFolder;
65015
65022
  try {
65016
65023
  const dir = join37(dirname17(skillDir(deps2, "codex")), "skills");
65017
65024
  for (const entry of readdirSync11(dir)) {
65018
65025
  const file2 = join37(dir, entry, "SKILL.md");
65019
65026
  if (ourSkillFile(file2, entry)) {
65020
65027
  out.file = file2;
65028
+ fileFolder = entry;
65021
65029
  break;
65022
65030
  }
65023
65031
  }
@@ -65025,14 +65033,34 @@ var codexSkillState = (deps2) => {
65025
65033
  }
65026
65034
  try {
65027
65035
  const agents = skillDir(deps2, "codex");
65028
- if (withoutCodexBlock(readFileSync30(agents, "utf8")) !== void 0)
65036
+ const text3 = readFileSync30(agents, "utf8");
65037
+ if (withoutCodexBlock(text3) !== void 0) {
65029
65038
  out.block = agents;
65039
+ const body = codexBlockBody(text3);
65040
+ const blockFolder = body === void 0 ? void 0 : skillFolder(`${body}
65041
+ `);
65042
+ if (fileFolder && blockFolder && blockFolder !== fileFolder)
65043
+ out.separate = true;
65044
+ }
65030
65045
  } catch {
65031
65046
  }
65032
65047
  return out;
65033
65048
  };
65034
65049
  var savedSkill = (deps2, h, folder) => {
65035
65050
  if (h === "codex") {
65051
+ if (folder) {
65052
+ const file2 = codexSkillFile(deps2, folder);
65053
+ if (ourSkillFile(targetOf(file2), folder)) return file2;
65054
+ const agents = skillDir(deps2, "codex");
65055
+ try {
65056
+ const body = codexBlockBody(readFileSync30(agents, "utf8"));
65057
+ if (body !== void 0 && skillFolder(`${body}
65058
+ `) === folder)
65059
+ return agents;
65060
+ } catch {
65061
+ }
65062
+ return void 0;
65063
+ }
65036
65064
  const st = codexSkillState(deps2);
65037
65065
  return st.file ?? st.block;
65038
65066
  }
@@ -67441,7 +67469,7 @@ var noService = {
67441
67469
  remove: async () => ({}),
67442
67470
  cli: () => ["oa-bus"]
67443
67471
  };
67444
- var VERSION = true ? "0.260.0" : JSON.parse(
67472
+ var VERSION = true ? "0.262.0" : JSON.parse(
67445
67473
  readFileSync37(new URL("../package.json", import.meta.url), "utf8")
67446
67474
  ).version;
67447
67475
  var which = (cmd) => {
@@ -71375,7 +71403,7 @@ function codexChecks(ctx, out) {
71375
71403
  const skill2 = codexSkillState({ home: ctx.userHome, env: ctx.env });
71376
71404
  if (skill2.file && skill2.block && skill2.shared)
71377
71405
  out.warn(c.codexSkillSharedTwice());
71378
- else if (skill2.file && skill2.block)
71406
+ else if (skill2.file && skill2.block && !skill2.separate)
71379
71407
  out.warn(
71380
71408
  c.codexSkillTwice(tilde(ctx, skill2.file), tilde(ctx, skill2.block))
71381
71409
  );
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@open-artifacts/bus",
3
3
  "type": "module",
4
- "version": "0.260.0",
4
+ "version": "0.262.0",
5
5
  "description": "The Open Artifacts bus: your AI agents reach each other across machines.",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -29,6 +29,6 @@
29
29
  "typecheck": "tsc --noEmit"
30
30
  },
31
31
  "oaBus": {
32
- "commit": "cd8c4d499447b2af38d1ce7ba79f3fff14c921c6"
32
+ "commit": "49b7eed94ed13603f48c4b37650bf396db3dd6b1"
33
33
  }
34
34
  }