@agent-facets/adapter-claude-code 0.4.1 → 0.4.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.
Files changed (2) hide show
  1. package/dist/index.mjs +25 -1
  2. package/package.json +1 -8
package/dist/index.mjs CHANGED
@@ -469,6 +469,11 @@ var require_anchors = /* @__PURE__ */ __commonJSMin(((exports) => {
469
469
  prevAnchors.add(anchor);
470
470
  return anchor;
471
471
  },
472
+ /**
473
+ * With circular references, the source node is only resolved after all
474
+ * of its child nodes are. This is why anchors are set only after all of
475
+ * the nodes have been created.
476
+ */
472
477
  setAnchors: () => {
473
478
  for (const source of aliasObjects) {
474
479
  const ref = sourceObjects.get(source);
@@ -2221,6 +2226,14 @@ var require_binary = /* @__PURE__ */ __commonJSMin(((exports) => {
2221
2226
  identify: (value) => value instanceof Uint8Array,
2222
2227
  default: false,
2223
2228
  tag: "tag:yaml.org,2002:binary",
2229
+ /**
2230
+ * Returns a Buffer in node and an Uint8Array in browsers
2231
+ *
2232
+ * To use the resulting buffer as an image, you'll want to do something like:
2233
+ *
2234
+ * const blob = new Blob([buffer], { type: 'image/jpeg' })
2235
+ * document.querySelector('#photo').src = URL.createObjectURL(blob)
2236
+ */
2224
2237
  resolve(src, onError) {
2225
2238
  if (typeof node_buffer.Buffer === "function") return node_buffer.Buffer.from(src, "base64");
2226
2239
  else if (typeof atob === "function") {
@@ -6642,6 +6655,17 @@ const FRONT_MATTER_RE = /^---\n([\s\S]*?)\n---\n?([\s\S]*)$/;
6642
6655
  * Assemble a full file string from optional front-matter metadata + body.
6643
6656
  * When `body` already contains a front-matter block, the two are merged
6644
6657
  * (`metadata` wins on key collision) so external keys on the body survive.
6658
+ *
6659
+ * The output is exactly `---\n<yaml>\n---\n<body>` — no separator newline
6660
+ * between the closing fence and the body. This is the inverse of
6661
+ * `splitAssetContent`'s regex (which consumes one `\n` after `---`), so
6662
+ * `assemble → write → read → split` is byte-stable.
6663
+ *
6664
+ * Earlier versions inserted a cosmetic blank line between the fence and
6665
+ * the body; that asymmetry caused materialize's skip-if-identical check
6666
+ * to see phantom drift on every re-install (`# body` going in, `\n# body`
6667
+ * coming out). Tests in this file's "round-trip" describe block enforce
6668
+ * the inverse contract explicitly.
6645
6669
  */
6646
6670
  function assembleAssetContent(body, metadata) {
6647
6671
  const existing = splitAssetContent(body);
@@ -6651,7 +6675,7 @@ function assembleAssetContent(body, metadata) {
6651
6675
  };
6652
6676
  const bodyOnly = existing.content;
6653
6677
  if (Object.keys(merged).length === 0) return bodyOnly;
6654
- return `---\n${(0, import_dist.stringify)(merged).trimEnd()}\n---\n${bodyOnly.length === 0 || bodyOnly.startsWith("\n") ? "" : "\n"}${bodyOnly}`;
6678
+ return `---\n${(0, import_dist.stringify)(merged).trimEnd()}\n---\n${bodyOnly}`;
6655
6679
  }
6656
6680
  /**
6657
6681
  * Parse a file string into its body + parsed front-matter metadata. Returns
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "https://github.com/agent-facets/facets",
6
6
  "directory": "packages/adapters/claude-code"
7
7
  },
8
- "version": "0.4.1",
8
+ "version": "0.4.4",
9
9
  "type": "module",
10
10
  "files": [
11
11
  "dist"
@@ -23,13 +23,6 @@
23
23
  "types": "tsc --noEmit",
24
24
  "test": "bun test"
25
25
  },
26
- "devDependencies": {
27
- "@agent-facets/adapter": "0.4.1",
28
- "@types/bun": "1.3.11",
29
- "arktype": "2.2.0",
30
- "tsdown": "^0.21.9",
31
- "typescript": "^6.0.3"
32
- },
33
26
  "publishConfig": {
34
27
  "access": "public",
35
28
  "provenance": false,