magic-spells 0.3.0 → 0.3.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.
@@ -307,6 +307,16 @@ function createFileStore(path, warn) {
307
307
  }
308
308
  };
309
309
  }
310
+ function decodeHexOutput(v) {
311
+ if (v.length % 2 !== 0 || !/^[0-9a-f]+$/.test(v)) return v;
312
+ const buf = Buffer.from(v, "hex");
313
+ if (buf.toString("hex") !== v) return v;
314
+ try {
315
+ return new TextDecoder("utf-8", { fatal: true }).decode(buf);
316
+ } catch {
317
+ return v;
318
+ }
319
+ }
310
320
  function createMacStore(exec, file) {
311
321
  const fromKeychain = (item) => {
312
322
  try {
@@ -318,7 +328,7 @@ function createMacStore(exec, file) {
318
328
  item,
319
329
  "-w"
320
330
  ]).trim();
321
- return v.length > 0 ? v : null;
331
+ return v.length > 0 ? decodeHexOutput(v) : null;
322
332
  } catch {
323
333
  return null;
324
334
  }
@@ -4,7 +4,7 @@ import {
4
4
  readStr,
5
5
  rec,
6
6
  toMagicError
7
- } from "./chunk-DVHFBLQP.js";
7
+ } from "./chunk-BJ2UK7WA.js";
8
8
 
9
9
  // ../pyramid/src/operations/index.ts
10
10
  import { z } from "zod";
package/dist/main.js CHANGED
@@ -61,7 +61,7 @@ import {
61
61
  usage,
62
62
  waitForDevice,
63
63
  writeUpdateCheck
64
- } from "./chunk-DVHFBLQP.js";
64
+ } from "./chunk-BJ2UK7WA.js";
65
65
 
66
66
  // src/browser.ts
67
67
  import { spawn } from "node:child_process";
@@ -1111,7 +1111,7 @@ var PRODUCTS = [
1111
1111
  {
1112
1112
  id: "pyramid",
1113
1113
  title: "Pyramid \u2014 projects and tasks",
1114
- load: async () => (await import("./src-PD2ETWZD.js")).default
1114
+ load: async () => (await import("./src-QBB4E5KU.js")).default
1115
1115
  },
1116
1116
  {
1117
1117
  id: "sites",
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  operations,
3
3
  operationsByName
4
- } from "./chunk-M2ECPY3Q.js";
5
- import "./chunk-DVHFBLQP.js";
4
+ } from "./chunk-E3VCJGAM.js";
5
+ import "./chunk-BJ2UK7WA.js";
6
6
  export {
7
7
  operations,
8
8
  operationsByName
@@ -3,13 +3,13 @@ import {
3
3
  operationsByName,
4
4
  pyramidError,
5
5
  toPyramidError
6
- } from "./chunk-M2ECPY3Q.js";
6
+ } from "./chunk-E3VCJGAM.js";
7
7
  import {
8
8
  MagicError,
9
9
  TtlCache,
10
10
  readField,
11
11
  readStr
12
- } from "./chunk-DVHFBLQP.js";
12
+ } from "./chunk-BJ2UK7WA.js";
13
13
 
14
14
  // ../pyramid/src/cache/resolver.ts
15
15
  var TTL_MS = 6e4;
@@ -887,7 +887,7 @@ var PYRAMID_CREDENTIAL = {
887
887
  var DEFAULT_API_URL = "https://pyramid.magicspells.io";
888
888
 
889
889
  // ../pyramid/src/doctor.ts
890
- var whoamiOp = async () => (await import("./operations-V5BL44TP.js")).operationsByName.get("pyramid.whoami");
890
+ var whoamiOp = async () => (await import("./operations-H6MRMD2G.js")).operationsByName.get("pyramid.whoami");
891
891
  var doctorChecks = [
892
892
  {
893
893
  name: "pyramid auth",
@@ -1049,7 +1049,7 @@ var pyramid = {
1049
1049
  // `magic login` mints workspace keys here from the Account grant (API-PYRAMID-CLI-SESSIONS).
1050
1050
  sessions: { path: "/v1/cli/sessions" },
1051
1051
  // The operations graph loads only when a Pyramid command runs.
1052
- load: async () => (await import("./operations-V5BL44TP.js")).operations,
1052
+ load: async () => (await import("./operations-H6MRMD2G.js")).operations,
1053
1053
  client(session, config) {
1054
1054
  const api = new PyramidClient({
1055
1055
  apiKey: session.key,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magic-spells",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Magic CLI — one command line and MCP server for Magic Spells' hosted services.",
5
5
  "license": "MIT",
6
6
  "type": "module",