magic-spells 0.2.0 → 0.2.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.
|
@@ -560,13 +560,16 @@ function matchCommand(cmds, argv) {
|
|
|
560
560
|
}
|
|
561
561
|
return void 0;
|
|
562
562
|
}
|
|
563
|
+
function defOf(schema) {
|
|
564
|
+
return schema?.def;
|
|
565
|
+
}
|
|
563
566
|
function baseType(schema) {
|
|
564
567
|
let cur = schema;
|
|
565
568
|
let optional = false;
|
|
566
569
|
for (let guard = 0; guard < 12; guard++) {
|
|
567
|
-
const def = cur
|
|
568
|
-
const name = def?.
|
|
569
|
-
if ((name === "
|
|
570
|
+
const def = defOf(cur);
|
|
571
|
+
const name = def?.type;
|
|
572
|
+
if ((name === "optional" || name === "nullable" || name === "default") && def?.innerType) {
|
|
570
573
|
optional = true;
|
|
571
574
|
cur = def.innerType;
|
|
572
575
|
continue;
|
|
@@ -580,31 +583,27 @@ function describeFields(input) {
|
|
|
580
583
|
if (!shape) return [];
|
|
581
584
|
return Object.entries(shape).map(([key, raw]) => {
|
|
582
585
|
const { type, optional } = baseType(raw);
|
|
583
|
-
const def = type
|
|
586
|
+
const def = defOf(type);
|
|
584
587
|
let kind = "string";
|
|
585
588
|
let values;
|
|
586
|
-
switch (def?.
|
|
587
|
-
case "
|
|
589
|
+
switch (def?.type) {
|
|
590
|
+
case "boolean":
|
|
588
591
|
kind = "boolean";
|
|
589
592
|
break;
|
|
590
|
-
case "
|
|
593
|
+
case "number":
|
|
591
594
|
kind = "number";
|
|
592
595
|
break;
|
|
593
|
-
case "
|
|
594
|
-
const el = def.
|
|
595
|
-
|
|
596
|
-
kind = elName === "ZodObject" ? "json" : "string[]";
|
|
596
|
+
case "array": {
|
|
597
|
+
const el = def.element ? baseType(def.element).type : void 0;
|
|
598
|
+
kind = defOf(el)?.type === "object" ? "json" : "string[]";
|
|
597
599
|
break;
|
|
598
600
|
}
|
|
599
|
-
case "
|
|
600
|
-
kind = "enum";
|
|
601
|
-
if (Array.isArray(def.values)) values = def.values;
|
|
602
|
-
break;
|
|
603
|
-
case "ZodNativeEnum":
|
|
601
|
+
case "enum":
|
|
604
602
|
kind = "enum";
|
|
603
|
+
if (def.entries) values = Object.values(def.entries).map(String);
|
|
605
604
|
break;
|
|
606
|
-
case "
|
|
607
|
-
case "
|
|
605
|
+
case "object":
|
|
606
|
+
case "record":
|
|
608
607
|
kind = "json";
|
|
609
608
|
break;
|
|
610
609
|
}
|
package/dist/main.js
CHANGED
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
toMagicError,
|
|
52
52
|
usage,
|
|
53
53
|
waitForDevice
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-ZC4NCQBG.js";
|
|
55
55
|
|
|
56
56
|
// src/browser.ts
|
|
57
57
|
import { spawn } from "node:child_process";
|
|
@@ -974,7 +974,7 @@ var PRODUCTS = [
|
|
|
974
974
|
{
|
|
975
975
|
id: "pyramid",
|
|
976
976
|
title: "Pyramid \u2014 projects and tasks",
|
|
977
|
-
load: async () => (await import("./src-
|
|
977
|
+
load: async () => (await import("./src-56NZ53TG.js")).default
|
|
978
978
|
},
|
|
979
979
|
{
|
|
980
980
|
id: "sites",
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
operationsByName,
|
|
4
4
|
pyramidError,
|
|
5
5
|
toPyramidError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4Y3SKWF7.js";
|
|
7
7
|
import {
|
|
8
8
|
MagicError,
|
|
9
9
|
TtlCache,
|
|
10
10
|
readField,
|
|
11
11
|
readStr
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZC4NCQBG.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://api.pyramid.magicspells.io";
|
|
888
888
|
|
|
889
889
|
// ../pyramid/src/doctor.ts
|
|
890
|
-
var whoamiOp = async () => (await import("./operations-
|
|
890
|
+
var whoamiOp = async () => (await import("./operations-VJZEQHSW.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-
|
|
1052
|
+
load: async () => (await import("./operations-VJZEQHSW.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.2.
|
|
3
|
+
"version": "0.2.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",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
23
23
|
"undici": "^6.19.0",
|
|
24
|
-
"zod": "^
|
|
24
|
+
"zod": "^4.6.7"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"bundle": "node scripts/bundle.mjs",
|