@xanots/sdk 0.0.3-beta.0 → 0.0.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.
- package/CHANGELOG.md +80 -0
- package/README.md +35 -2
- package/dist/agent-file-refresh-IJ7GN2FJ.js +17 -0
- package/dist/bin.js +12 -153
- package/dist/{capture-HUV5BNTC.js → capture-7PO6SGB4.js} +2 -2
- package/dist/{chunk-WRYT2PAX.js → chunk-7SISR3CS.js} +24 -36
- package/dist/{chunk-7DKX2SPN.js → chunk-ACQCK4DT.js} +4 -4
- package/dist/{chunk-XQ22GLYS.js → chunk-AJ7JQ4OU.js} +5 -5
- package/dist/{chunk-EWFHDJY5.js → chunk-ALNQCWAW.js} +2 -2
- package/dist/{chunk-55VHDNW5.js → chunk-BPEEGJJA.js} +108 -3
- package/dist/{chunk-U3G2UW65.js → chunk-CYJ7R3AD.js} +3 -3
- package/dist/{agent-file-refresh-J3KY54E5.js → chunk-D6OGU2AI.js} +5 -6
- package/dist/{chunk-VVXPK6SE.js → chunk-DUC3PXDG.js} +150 -45
- package/dist/{chunk-4HKZH6YK.js → chunk-EAIR6VUL.js} +235 -10
- package/dist/chunk-ERQZFWIW.js +22 -0
- package/dist/{chunk-TQUO2OXY.js → chunk-FN4OQT2J.js} +4 -4
- package/dist/{chunk-FY6LXRR6.js → chunk-KGNJM4LN.js} +2 -2
- package/dist/{chunk-HJPTWBLH.js → chunk-MFIHIS6B.js} +2 -2
- package/dist/{chunk-F6JCFRKO.js → chunk-PXXLBXOP.js} +2 -2
- package/dist/{chunk-YZ4GU6F5.js → chunk-QUUB7HYK.js} +5 -838
- package/dist/{chunk-HKAX756N.js → chunk-SWIXWJIY.js} +3 -3
- package/dist/{chunk-76QBEIGO.js → chunk-T4XPCJRF.js} +3 -2
- package/dist/chunk-T6N3VMMO.js +173 -0
- package/dist/{chunk-CBL57QBQ.js → chunk-VKD3EBKG.js} +112 -21
- package/dist/{chunk-MWLNBSTY.js → chunk-VWGJQTNA.js} +3 -3
- package/dist/chunk-WGDAOOXG.js +845 -0
- package/dist/{chunk-4YMD2OOZ.js → chunk-XHEXOES3.js} +1 -1
- package/dist/{chunk-4HT3BNZ7.js → chunk-YUBJLB6G.js} +10 -2
- package/dist/{chunk-5L4X5LS6.js → chunk-YUPQOLFX.js} +77 -2
- package/dist/{chunk-QO4I5OYF.js → chunk-YYSJAAJM.js} +36 -3
- package/dist/{chunk-P3TTMWUP.js → chunk-ZOYMZZ3S.js} +8 -1
- package/dist/chunk-ZSYZTGJH.js +81 -0
- package/dist/cli.d.ts +15 -0
- package/dist/cli.js +8 -8
- package/dist/{codegen-command-EXLKZ2ZI.js → codegen-command-Z7WQMOJ7.js} +21 -20
- package/dist/{completion-2PVZK6YX.js → completion-4GYN752B.js} +2 -2
- package/dist/{deploy-command-SXX6RJWM.js → deploy-command-M2S4HHLC.js} +26 -26
- package/dist/{env-target-3EGIPR4D.js → env-target-GSFCYHKZ.js} +6 -6
- package/dist/{ephemeral-command-OGOYP7D6.js → ephemeral-command-6WJW7LP6.js} +24 -24
- package/dist/index.d.ts +2 -2
- package/dist/index.js +13 -7
- package/dist/init-command-GJUPWTKA.js +30 -0
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +53 -7
- package/dist/{io-AMIKRLPC.js → io-7VIA5SON.js} +3 -3
- package/dist/{live-diff-RXSJCVJ7.js → live-diff-FP4SFNT4.js} +2 -2
- package/dist/{lock-3CVKALKT.js → lock-KXOJIGCG.js} +2 -2
- package/dist/{lock-commands-R22J54XV.js → lock-commands-7IH7RSSP.js} +9 -9
- package/dist/{login-command-ACJF6KWQ.js → login-command-QM5SBBI2.js} +2 -2
- package/dist/{logout-command-MX3MJS5U.js → logout-command-THPASOHM.js} +2 -2
- package/dist/{loop-SAWAOUFO.js → loop-7SAIGRCZ.js} +3 -3
- package/dist/{marketplace-command-XJIWL4YP.js → marketplace-command-463DT7O7.js} +11 -25
- package/dist/meta-client-OW5WKWW7.js +1 -1
- package/dist/node.d.ts +2 -2
- package/dist/node.js +18 -12
- package/dist/onboard-command-EHOHKQQU.js +36 -0
- package/dist/{profile-command-SWJ3SPKR.js → profile-command-EUWPVWED.js} +6 -6
- package/dist/{release-command-6PLMLGDK.js → release-command-M4CVNTWL.js} +25 -25
- package/dist/{sandbox-details-command-HJE5SPVG.js → sandbox-details-command-BRII3QHG.js} +5 -5
- package/dist/{sandbox-export-command-QCJY4GMV.js → sandbox-export-command-PCZ5FL4U.js} +8 -8
- package/dist/scaffold.js +4 -2
- package/dist/{store-g45zwB33.d.ts → store-BJONDJoZ.d.ts} +171 -2
- package/dist/{test-command-LLPXKT35.js → test-command-U4G5Y3UM.js} +10 -10
- package/dist/upgrade-command-CKJ4BS2P.js +177 -0
- package/dist/{validate-command-WAT3ZJT3.js → validate-command-S5N37JRP.js} +12 -12
- package/dist/{workspace-command-JKMI7RZ4.js → workspace-command-RALSEJSW.js} +28 -27
- package/dist/workspace-export-AJMGN3CQ.js +1 -1
- package/guides/README.md +30 -0
- package/guides/authoring.md +642 -0
- package/guides/cli.md +191 -0
- package/guides/codegen.md +83 -0
- package/guides/coverage.md +67 -0
- package/guides/deploying.md +340 -0
- package/guides/environment.md +132 -0
- package/guides/object-kinds.md +376 -0
- package/guides/project-structure.md +43 -0
- package/guides/scaffold.md +198 -0
- package/guides/typed-frontend.md +201 -0
- package/llms/kinds-agent-mcp.md +2 -1
- package/llms/kinds-knowledge.md +20 -0
- package/llms/object-kinds.md +1 -0
- package/llms-full.txt +27 -3
- package/llms.txt +3 -2
- package/manifest.json +30 -3
- package/package.json +5 -2
- package/dist/.build-fingerprint +0 -1
- package/dist/chunk-47WDWMBJ.js +0 -14
- package/dist/init-command-6DGXEVZD.js +0 -29
|
@@ -236,7 +236,15 @@ var REFERENCEABLE_KIND_PAYLOAD_KEYS = {
|
|
|
236
236
|
// only for kinds in `REFERENCEABLE_KINDS` — and the engine REFUSES to export a
|
|
237
237
|
// workflow test that has none ("Missing workflow test guid."), a failure that
|
|
238
238
|
// surfaces only against a live instance.
|
|
239
|
-
workflow_test: "workflow_test"
|
|
239
|
+
workflow_test: "workflow_test",
|
|
240
|
+
// Knowledge is listed here for IDENTITY, not for referencing — nothing in a
|
|
241
|
+
// stack resolves a knowledge item. Membership is what stamps its guid in
|
|
242
|
+
// `Xano#encodeOne` and what makes `knowledge:<name>` a valid lock key, and
|
|
243
|
+
// BOTH are load-bearing: the engine re-mints guids on every replace import
|
|
244
|
+
// while a merge import upserts BY guid, so without a locked identity the
|
|
245
|
+
// second `xanots release` inserts `<name>_01` beside the item it should have
|
|
246
|
+
// updated. Measured, not theorised.
|
|
247
|
+
knowledge: "knowledge"
|
|
240
248
|
};
|
|
241
249
|
var REFERENCEABLE_KINDS = new Set(Object.keys(REFERENCEABLE_KIND_PAYLOAD_KEYS));
|
|
242
250
|
var SEED_SEP = "|";
|
|
@@ -672,4 +680,4 @@ export {
|
|
|
672
680
|
adoptFromBundle,
|
|
673
681
|
mergeObserved
|
|
674
682
|
};
|
|
675
|
-
//# sourceMappingURL=chunk-
|
|
683
|
+
//# sourceMappingURL=chunk-YUBJLB6G.js.map
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
lockKey,
|
|
20
20
|
resolveRef,
|
|
21
21
|
sha1Bytes
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-YUBJLB6G.js";
|
|
23
23
|
|
|
24
24
|
// src/types/xdo.ts
|
|
25
25
|
var TAGS = [
|
|
@@ -3261,6 +3261,66 @@ function resolveAuthRef(hostLabel, host, auth2) {
|
|
|
3261
3261
|
return resolveRef("dbo", auth2);
|
|
3262
3262
|
}
|
|
3263
3263
|
|
|
3264
|
+
// src/kinds/knowledge.ts
|
|
3265
|
+
var KNOWLEDGE_FILE = /* @__PURE__ */ Symbol.for("xanots.knowledge.file");
|
|
3266
|
+
var KNOWLEDGE_DIR = /* @__PURE__ */ Symbol.for("xanots.knowledge.dir");
|
|
3267
|
+
function knowledgeFile(path, base) {
|
|
3268
|
+
return { [KNOWLEDGE_FILE]: { path, base: typeof base === "string" ? base : base.href } };
|
|
3269
|
+
}
|
|
3270
|
+
function knowledgeDir(path, base) {
|
|
3271
|
+
return { [KNOWLEDGE_DIR]: { path, base: typeof base === "string" ? base : base.href } };
|
|
3272
|
+
}
|
|
3273
|
+
function isKnowledgeFileSource(v2) {
|
|
3274
|
+
return typeof v2 === "object" && v2 !== null && KNOWLEDGE_FILE in v2;
|
|
3275
|
+
}
|
|
3276
|
+
function isKnowledgeDirSource(v2) {
|
|
3277
|
+
return typeof v2 === "object" && v2 !== null && KNOWLEDGE_DIR in v2;
|
|
3278
|
+
}
|
|
3279
|
+
function encodeKnowledge(def) {
|
|
3280
|
+
if (!def.name) {
|
|
3281
|
+
throw new Error("knowledge kind: `name` is required.");
|
|
3282
|
+
}
|
|
3283
|
+
if (!isKnowledgeFileSource(def.body)) {
|
|
3284
|
+
throw new Error(
|
|
3285
|
+
`knowledge "${def.name}": \`body\` must be a knowledgeFile("./x.md", import.meta.url) marker. A knowledge body is authored as a markdown FILE, not a string.`
|
|
3286
|
+
);
|
|
3287
|
+
}
|
|
3288
|
+
if (def.refs !== void 0 && !isKnowledgeDirSource(def.refs)) {
|
|
3289
|
+
throw new Error(
|
|
3290
|
+
`knowledge "${def.name}": \`refs\` must be a knowledgeDir("./dir", import.meta.url) marker.`
|
|
3291
|
+
);
|
|
3292
|
+
}
|
|
3293
|
+
return {
|
|
3294
|
+
name: def.name,
|
|
3295
|
+
description: def.description ?? "",
|
|
3296
|
+
// Bodies are read in the compile path; see the module header.
|
|
3297
|
+
content: "",
|
|
3298
|
+
// Not authorable: a user-scoped item is private to one UI user and is
|
|
3299
|
+
// excluded from branch clone and merge, so it has no meaning in source.
|
|
3300
|
+
scope: "workspace",
|
|
3301
|
+
mode: def.mode ?? "auto",
|
|
3302
|
+
knowledge_type: def.type ?? "skill",
|
|
3303
|
+
enabled: def.enabled ?? true,
|
|
3304
|
+
// Instance-owned state, gated on a permission this SDK does not model.
|
|
3305
|
+
locked: false,
|
|
3306
|
+
// Derived by the platform from the stored reference files — never authored.
|
|
3307
|
+
references: [],
|
|
3308
|
+
// Deferred: linked refs never reach an agent's prompt, and the bulk
|
|
3309
|
+
// transport does not carry them.
|
|
3310
|
+
linked_refs: [],
|
|
3311
|
+
tag: encodeTags(def.tags)
|
|
3312
|
+
};
|
|
3313
|
+
}
|
|
3314
|
+
function knowledge(def) {
|
|
3315
|
+
return def;
|
|
3316
|
+
}
|
|
3317
|
+
var knowledgeKind = {
|
|
3318
|
+
name: "knowledge",
|
|
3319
|
+
payloadKey: "knowledge",
|
|
3320
|
+
encode: encodeKnowledge
|
|
3321
|
+
};
|
|
3322
|
+
registerKind(knowledgeKind);
|
|
3323
|
+
|
|
3264
3324
|
// src/statements/lean-input.ts
|
|
3265
3325
|
function leanInput(name, v2) {
|
|
3266
3326
|
assertInputValue(name, v2);
|
|
@@ -3550,6 +3610,12 @@ var PAYLOAD_ARRAY_KEYS = [
|
|
|
3550
3610
|
"tool",
|
|
3551
3611
|
"toolset",
|
|
3552
3612
|
"app",
|
|
3613
|
+
// Prose an agent reads, not an object anything resolves — it references
|
|
3614
|
+
// nothing and nothing references it, so its position is arbitrary.
|
|
3615
|
+
"knowledge",
|
|
3616
|
+
// A knowledge item's reference files. A CHILD section, not a kind of its own:
|
|
3617
|
+
// each row names its parent by guid, so knowledge must precede it.
|
|
3618
|
+
"knowledge_file",
|
|
3553
3619
|
// Realtime, in dependency order: a channel resolves its server, and a message
|
|
3554
3620
|
// resolves both. They sit after `app` so every object they can reference
|
|
3555
3621
|
// (tables for auth, api groups) is already in place.
|
|
@@ -3968,6 +4034,15 @@ export {
|
|
|
3968
4034
|
clear,
|
|
3969
4035
|
stackReferencesAuth,
|
|
3970
4036
|
resolveAuthRef,
|
|
4037
|
+
KNOWLEDGE_FILE,
|
|
4038
|
+
KNOWLEDGE_DIR,
|
|
4039
|
+
knowledgeFile,
|
|
4040
|
+
knowledgeDir,
|
|
4041
|
+
isKnowledgeFileSource,
|
|
4042
|
+
isKnowledgeDirSource,
|
|
4043
|
+
encodeKnowledge,
|
|
4044
|
+
knowledge,
|
|
4045
|
+
knowledgeKind,
|
|
3971
4046
|
warnLiveDatasource,
|
|
3972
4047
|
encodeTests,
|
|
3973
4048
|
test,
|
|
@@ -3993,4 +4068,4 @@ export {
|
|
|
3993
4068
|
serializeBundle,
|
|
3994
4069
|
emitBundle
|
|
3995
4070
|
};
|
|
3996
|
-
//# sourceMappingURL=chunk-
|
|
4071
|
+
//# sourceMappingURL=chunk-YUPQOLFX.js.map
|
|
@@ -123,6 +123,14 @@ var FLAGS = {
|
|
|
123
123
|
summary: "AI instruction files to scaffold: claude, codex, cursor, none",
|
|
124
124
|
values: ["claude", "codex", "cursor", "none"]
|
|
125
125
|
},
|
|
126
|
+
marketplace: {
|
|
127
|
+
spec: "--marketplace <pkgs>",
|
|
128
|
+
summary: "Add-on packages to install and register, comma-separated"
|
|
129
|
+
},
|
|
130
|
+
check: {
|
|
131
|
+
spec: "--check",
|
|
132
|
+
summary: "Report whether an upgrade is available and exit 7, without installing it"
|
|
133
|
+
},
|
|
126
134
|
force: { spec: "--force", summary: "Scaffold into a non-empty directory (overwriting our own files)" },
|
|
127
135
|
"no-install": { spec: "--no-install", summary: "Skip the post-scaffold npm install" },
|
|
128
136
|
"dry-run": { spec: "--dry-run", summary: "Print what would change and exit without sending it" },
|
|
@@ -213,8 +221,26 @@ var COMMANDS = {
|
|
|
213
221
|
display: "init [dir]",
|
|
214
222
|
summary: "Scaffold a new XanoTS project",
|
|
215
223
|
args: [{ name: "dir", required: false, path: true }],
|
|
216
|
-
|
|
217
|
-
|
|
224
|
+
// `--marketplace` is init's alone, not SCAFFOLD's: `codegen` writes a
|
|
225
|
+
// project around a workspace that already exists, and adding add-ons to
|
|
226
|
+
// one is `marketplace install`, not a scaffold decision.
|
|
227
|
+
flags: [...SCAFFOLD, "marketplace"],
|
|
228
|
+
// One flag from each axis the command now has — look, theme, add-ons —
|
|
229
|
+
// rather than every flag it accepts.
|
|
230
|
+
example: "xanots init my-app --theme zinc-blue --ai claude --marketplace @xanots/auth"
|
|
231
|
+
},
|
|
232
|
+
onboard: {
|
|
233
|
+
group: "Author",
|
|
234
|
+
display: "onboard [dir]",
|
|
235
|
+
summary: "Pick a framework, theme and add-ons in a browser, then scaffold",
|
|
236
|
+
// Variadic, and deliberately flagless. This command does not PARSE its
|
|
237
|
+
// arguments — it forwards them to a package it launches (see
|
|
238
|
+
// onboard-command.ts), so the arity check must budget for a tail it cannot
|
|
239
|
+
// describe. Declaring the configurator's flags here would freeze them: a
|
|
240
|
+
// flag added there would be rejected here until the SDK released, which is
|
|
241
|
+
// the coupling launching-instead-of-depending exists to avoid.
|
|
242
|
+
args: [{ name: "dir", required: false, path: true, variadic: true }],
|
|
243
|
+
example: "xanots onboard my-app"
|
|
218
244
|
},
|
|
219
245
|
marketplace: {
|
|
220
246
|
group: "Author",
|
|
@@ -542,6 +568,13 @@ var COMMANDS = {
|
|
|
542
568
|
display: "version",
|
|
543
569
|
summary: "Print the CLI version"
|
|
544
570
|
},
|
|
571
|
+
upgrade: {
|
|
572
|
+
group: "Maintenance",
|
|
573
|
+
display: "upgrade",
|
|
574
|
+
summary: "Install the latest @xanots/sdk, or report an available upgrade with --check",
|
|
575
|
+
flags: ["check"],
|
|
576
|
+
example: "xanots upgrade --check"
|
|
577
|
+
},
|
|
545
578
|
help: {
|
|
546
579
|
group: "Maintenance",
|
|
547
580
|
display: "help",
|
|
@@ -637,4 +670,4 @@ export {
|
|
|
637
670
|
liveSubcommandNames,
|
|
638
671
|
suggest
|
|
639
672
|
};
|
|
640
|
-
//# sourceMappingURL=chunk-
|
|
673
|
+
//# sourceMappingURL=chunk-YYSJAAJM.js.map
|
|
@@ -17,6 +17,13 @@ var STRIP_KEYS = /* @__PURE__ */ new Set([
|
|
|
17
17
|
"workspace",
|
|
18
18
|
"branch",
|
|
19
19
|
"market_item",
|
|
20
|
+
// The CREATOR of a knowledge item (`{id: 0}` for anything an import created).
|
|
21
|
+
// Server-assigned provenance, in the same family as the already-stripped
|
|
22
|
+
// `workspace`/`branch` bindings: the SDK never authors it, and a workspace
|
|
23
|
+
// synced by two different people would otherwise diff on who touched it last.
|
|
24
|
+
// Verified to be a knowledge-only key — no encoder in this SDK emits `user`
|
|
25
|
+
// anywhere in a compiled payload.
|
|
26
|
+
"user",
|
|
20
27
|
// engine-stored source artifact (the raw XanoScript text), not authored data
|
|
21
28
|
"xanoscript",
|
|
22
29
|
// A workflow test's LAST RUN result — when it ran, how long it took, and the
|
|
@@ -969,4 +976,4 @@ export {
|
|
|
969
976
|
filledContext,
|
|
970
977
|
normalize
|
|
971
978
|
};
|
|
972
|
-
//# sourceMappingURL=chunk-
|
|
979
|
+
//# sourceMappingURL=chunk-ZOYMZZ3S.js.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// src/emit/npm.ts
|
|
2
|
+
import { spawnSync } from "child_process";
|
|
3
|
+
import { existsSync } from "fs";
|
|
4
|
+
import { dirname, join } from "path";
|
|
5
|
+
function findNpmCli(nodeExecPath = process.execPath) {
|
|
6
|
+
const bin = dirname(nodeExecPath);
|
|
7
|
+
const tail = ["node_modules", "npm", "bin", "npm-cli.js"];
|
|
8
|
+
const candidates = [join(bin, ...tail), join(bin, "..", "lib", ...tail)];
|
|
9
|
+
return candidates.find((c) => existsSync(c));
|
|
10
|
+
}
|
|
11
|
+
function npmCommand(platform, args, nodeExecPath = process.execPath, resolveNpmCli = findNpmCli) {
|
|
12
|
+
if (platform !== "win32") return { file: "npm", args, shell: false };
|
|
13
|
+
const cli = resolveNpmCli(nodeExecPath);
|
|
14
|
+
if (cli !== void 0) return { file: nodeExecPath, args: [cli, ...args], shell: false };
|
|
15
|
+
return { file: "npm.cmd", args: args.map(quoteForCmd), shell: true };
|
|
16
|
+
}
|
|
17
|
+
function quoteForCmd(arg) {
|
|
18
|
+
if (arg !== "" && !/[\s"&|<>^()%!]/.test(arg)) return arg;
|
|
19
|
+
const escaped = arg.replace(/(\\*)"/g, '$1$1""').replace(/(\\*)$/, "$1$1");
|
|
20
|
+
return `"${escaped}"`;
|
|
21
|
+
}
|
|
22
|
+
function runNpm(args, cwd, opts) {
|
|
23
|
+
const stdout = opts?.stdout === "stderr" ? 2 : "inherit";
|
|
24
|
+
const npm = npmCommand(process.platform, args);
|
|
25
|
+
const res = spawnSync(npm.file, [...npm.args], {
|
|
26
|
+
cwd,
|
|
27
|
+
stdio: ["inherit", stdout, "inherit"],
|
|
28
|
+
shell: npm.shell
|
|
29
|
+
});
|
|
30
|
+
return res.status ?? 1;
|
|
31
|
+
}
|
|
32
|
+
function runNpmCapturingStderr(args, cwd) {
|
|
33
|
+
const npm = npmCommand(process.platform, args);
|
|
34
|
+
const res = spawnSync(npm.file, [...npm.args], {
|
|
35
|
+
cwd,
|
|
36
|
+
stdio: ["inherit", "inherit", "pipe"],
|
|
37
|
+
encoding: "utf8",
|
|
38
|
+
shell: npm.shell
|
|
39
|
+
});
|
|
40
|
+
const stderr = res.stderr ?? "";
|
|
41
|
+
if (stderr !== "") process.stderr.write(stderr);
|
|
42
|
+
return { status: res.status ?? 1, stderr };
|
|
43
|
+
}
|
|
44
|
+
function npmViewVersion(pkg) {
|
|
45
|
+
const npm = npmCommand(process.platform, ["view", pkg, "version"]);
|
|
46
|
+
const res = spawnSync(npm.file, [...npm.args], {
|
|
47
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
48
|
+
encoding: "utf8",
|
|
49
|
+
shell: npm.shell
|
|
50
|
+
});
|
|
51
|
+
const stderr = (res.stderr ?? "").trim();
|
|
52
|
+
const version = (res.stdout ?? "").trim();
|
|
53
|
+
if ((res.status ?? 1) !== 0 || version === "") {
|
|
54
|
+
return { ok: false, stderr: stderr !== "" ? stderr : describeSpawnFailure(npm.file, res.error) };
|
|
55
|
+
}
|
|
56
|
+
return { ok: true, version };
|
|
57
|
+
}
|
|
58
|
+
function describeSpawnFailure(file, error) {
|
|
59
|
+
if (error === void 0) return "npm exited without reporting a version.";
|
|
60
|
+
return `Could not run ${file}: ${error.message}`;
|
|
61
|
+
}
|
|
62
|
+
function condenseNpmError(stderr) {
|
|
63
|
+
const kept = [];
|
|
64
|
+
for (const line of stderr.split("\n")) {
|
|
65
|
+
const body = line.replace(/^npm (?:error|ERR!)\s?/, "");
|
|
66
|
+
if (body.trim() === "") continue;
|
|
67
|
+
if (/^\s*at\s/.test(body)) continue;
|
|
68
|
+
if (/^\s{2,}\S+:\s/.test(body)) continue;
|
|
69
|
+
if (/^\s*[{}],?\s*$/.test(body)) continue;
|
|
70
|
+
kept.push(/\{\s*$/.test(body) ? line.replace(/\s*\{\s*$/, "") : line);
|
|
71
|
+
}
|
|
72
|
+
return kept.join("\n").trim();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export {
|
|
76
|
+
runNpm,
|
|
77
|
+
runNpmCapturingStderr,
|
|
78
|
+
npmViewVersion,
|
|
79
|
+
condenseNpmError
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=chunk-ZSYZTGJH.js.map
|
package/dist/cli.d.ts
CHANGED
|
@@ -62,6 +62,12 @@ interface ParsedArgs {
|
|
|
62
62
|
strict: boolean;
|
|
63
63
|
/** `--yes`/`-y`: confirm destructive lock maintenance non-interactively. */
|
|
64
64
|
yes: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* `upgrade --check`: report whether a newer `@xanots/sdk` is published and
|
|
67
|
+
* exit non-zero when one is, instead of installing it. The reporting half of
|
|
68
|
+
* a command whose default is to act.
|
|
69
|
+
*/
|
|
70
|
+
check: boolean;
|
|
65
71
|
/** `push --bundle <path>`: upload an already-exported bundle instead of a file entry. */
|
|
66
72
|
bundle: string | undefined;
|
|
67
73
|
/** `--reset`: accepted but redundant — every deploy is a full replace now. */
|
|
@@ -159,6 +165,15 @@ interface ParsedArgs {
|
|
|
159
165
|
* else write none. Validated in the init command, not at parse time.
|
|
160
166
|
*/
|
|
161
167
|
ai: string[];
|
|
168
|
+
/**
|
|
169
|
+
* `init` `--marketplace <pkg>` (repeatable, comma-separated): marketplace
|
|
170
|
+
* add-ons to install into the new project and register in `xano/index.ts`.
|
|
171
|
+
*
|
|
172
|
+
* One flag rather than a follow-up command so that the whole project is one
|
|
173
|
+
* reproducible line — which is the promise onboarding makes when it prints
|
|
174
|
+
* the command it ran. Validated in `init-modules.ts`, not at parse time.
|
|
175
|
+
*/
|
|
176
|
+
marketplace: string[];
|
|
162
177
|
/**
|
|
163
178
|
* `init`/`codegen` `--framework <id>`: which frontend to scaffold
|
|
164
179
|
* (`react`/`svelte`). Undefined = prompt in a TTY, else the default.
|
package/dist/cli.js
CHANGED
|
@@ -8,17 +8,17 @@ import {
|
|
|
8
8
|
resolveHelpRequest,
|
|
9
9
|
resolveLockPath,
|
|
10
10
|
run
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-EZG76F7R.js";
|
|
11
|
+
} from "./chunk-DUC3PXDG.js";
|
|
12
|
+
import "./chunk-KGNJM4LN.js";
|
|
13
|
+
import "./chunk-MFIHIS6B.js";
|
|
15
14
|
import "./chunk-GNPVYOPB.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-EZG76F7R.js";
|
|
16
|
+
import "./chunk-BPEEGJJA.js";
|
|
17
|
+
import "./chunk-YYSJAAJM.js";
|
|
18
|
+
import "./chunk-YUPQOLFX.js";
|
|
19
19
|
import "./chunk-WHOJWOSV.js";
|
|
20
20
|
import "./chunk-5XZ744TS.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-YUBJLB6G.js";
|
|
22
22
|
export {
|
|
23
23
|
compileBundle,
|
|
24
24
|
exportBundleJson,
|
|
@@ -4,34 +4,35 @@ import {
|
|
|
4
4
|
isMissingDependencyError,
|
|
5
5
|
runCodegenCommand,
|
|
6
6
|
verifyCrashEntry
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-QTNO2WD6.js";
|
|
10
|
-
import "./chunk-ZUTSMMAG.js";
|
|
11
|
-
import "./chunk-4HKZH6YK.js";
|
|
12
|
-
import "./chunk-WRYT2PAX.js";
|
|
13
|
-
import "./chunk-47WDWMBJ.js";
|
|
14
|
-
import "./chunk-3IGNIP6R.js";
|
|
7
|
+
} from "./chunk-VKD3EBKG.js";
|
|
8
|
+
import "./chunk-ZOYMZZ3S.js";
|
|
15
9
|
import "./chunk-C56BC2FY.js";
|
|
16
10
|
import "./chunk-7REDODS2.js";
|
|
11
|
+
import "./chunk-QTNO2WD6.js";
|
|
12
|
+
import "./chunk-ZUTSMMAG.js";
|
|
17
13
|
import "./chunk-X4DVXBFY.js";
|
|
18
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-EAIR6VUL.js";
|
|
15
|
+
import "./chunk-7SISR3CS.js";
|
|
16
|
+
import "./chunk-ZSYZTGJH.js";
|
|
17
|
+
import "./chunk-3IGNIP6R.js";
|
|
18
|
+
import "./chunk-PXXLBXOP.js";
|
|
19
19
|
import "./chunk-LU7TRWMC.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-WGDAOOXG.js";
|
|
21
|
+
import "./chunk-QUUB7HYK.js";
|
|
21
22
|
import "./chunk-6DHJVLYP.js";
|
|
22
23
|
import "./chunk-4BXJGVZ3.js";
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-EZG76F7R.js";
|
|
24
|
+
import "./chunk-CYJ7R3AD.js";
|
|
25
|
+
import "./chunk-DUC3PXDG.js";
|
|
26
|
+
import "./chunk-KGNJM4LN.js";
|
|
27
|
+
import "./chunk-MFIHIS6B.js";
|
|
28
28
|
import "./chunk-GNPVYOPB.js";
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-EZG76F7R.js";
|
|
30
|
+
import "./chunk-BPEEGJJA.js";
|
|
31
|
+
import "./chunk-YYSJAAJM.js";
|
|
32
|
+
import "./chunk-YUPQOLFX.js";
|
|
32
33
|
import "./chunk-WHOJWOSV.js";
|
|
33
34
|
import "./chunk-5XZ744TS.js";
|
|
34
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-YUBJLB6G.js";
|
|
35
36
|
export {
|
|
36
37
|
blameGeneratedFile,
|
|
37
38
|
fetchWorkspaceBundle,
|
|
@@ -39,4 +40,4 @@ export {
|
|
|
39
40
|
runCodegenCommand,
|
|
40
41
|
verifyCrashEntry
|
|
41
42
|
};
|
|
42
|
-
//# sourceMappingURL=codegen-command-
|
|
43
|
+
//# sourceMappingURL=codegen-command-Z7WQMOJ7.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getCommand,
|
|
6
6
|
liveCommandNames,
|
|
7
7
|
liveSubcommandNames
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YYSJAAJM.js";
|
|
9
9
|
|
|
10
10
|
// src/emit/completion.ts
|
|
11
11
|
var COMPLETION_SHELLS = ["bash", "zsh", "fish"];
|
|
@@ -295,4 +295,4 @@ export {
|
|
|
295
295
|
renderCompletion,
|
|
296
296
|
runCompletionCommand
|
|
297
297
|
};
|
|
298
|
-
//# sourceMappingURL=completion-
|
|
298
|
+
//# sourceMappingURL=completion-4GYN752B.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
assertBundleInput,
|
|
3
|
-
loadBundleText
|
|
4
|
-
} from "./chunk-HKAX756N.js";
|
|
5
1
|
import {
|
|
6
2
|
importWorkspaceArchive
|
|
7
3
|
} from "./chunk-5WGEURVI.js";
|
|
4
|
+
import {
|
|
5
|
+
assertBundleInput,
|
|
6
|
+
loadBundleText
|
|
7
|
+
} from "./chunk-SWIXWJIY.js";
|
|
8
8
|
import {
|
|
9
9
|
createEphemeral,
|
|
10
10
|
getEphemeral,
|
|
@@ -13,19 +13,27 @@ import {
|
|
|
13
13
|
tenantBaseUrl,
|
|
14
14
|
waitUntilReady
|
|
15
15
|
} from "./chunk-6DHBYBTO.js";
|
|
16
|
-
import {
|
|
17
|
-
encodeWorkspaceArchive
|
|
18
|
-
} from "./chunk-ZUTSMMAG.js";
|
|
19
16
|
import {
|
|
20
17
|
getEnvironment,
|
|
21
18
|
readEphemeralState,
|
|
22
19
|
setEnvironment
|
|
23
20
|
} from "./chunk-DGSF2Q5H.js";
|
|
21
|
+
import {
|
|
22
|
+
openBrowser
|
|
23
|
+
} from "./chunk-VTIL47DT.js";
|
|
24
24
|
import {
|
|
25
25
|
microserviceLine,
|
|
26
26
|
readyRatio,
|
|
27
27
|
waitForMicroservices
|
|
28
28
|
} from "./chunk-NDZFBZHC.js";
|
|
29
|
+
import {
|
|
30
|
+
getAccessToken
|
|
31
|
+
} from "./chunk-C56BC2FY.js";
|
|
32
|
+
import "./chunk-7REDODS2.js";
|
|
33
|
+
import {
|
|
34
|
+
encodeWorkspaceArchive
|
|
35
|
+
} from "./chunk-ZUTSMMAG.js";
|
|
36
|
+
import "./chunk-X4DVXBFY.js";
|
|
29
37
|
import {
|
|
30
38
|
isMachineOutput,
|
|
31
39
|
writeJson
|
|
@@ -34,19 +42,12 @@ import {
|
|
|
34
42
|
fetchOrExplain,
|
|
35
43
|
httpFailure
|
|
36
44
|
} from "./chunk-3IGNIP6R.js";
|
|
37
|
-
import
|
|
38
|
-
openBrowser
|
|
39
|
-
} from "./chunk-VTIL47DT.js";
|
|
40
|
-
import {
|
|
41
|
-
getAccessToken
|
|
42
|
-
} from "./chunk-C56BC2FY.js";
|
|
43
|
-
import "./chunk-7REDODS2.js";
|
|
44
|
-
import "./chunk-X4DVXBFY.js";
|
|
45
|
-
import "./chunk-VVXPK6SE.js";
|
|
45
|
+
import "./chunk-DUC3PXDG.js";
|
|
46
46
|
import {
|
|
47
47
|
assertWritableDest
|
|
48
|
-
} from "./chunk-
|
|
49
|
-
import "./chunk-
|
|
48
|
+
} from "./chunk-KGNJM4LN.js";
|
|
49
|
+
import "./chunk-MFIHIS6B.js";
|
|
50
|
+
import "./chunk-GNPVYOPB.js";
|
|
50
51
|
import {
|
|
51
52
|
blank,
|
|
52
53
|
detail,
|
|
@@ -61,13 +62,12 @@ import {
|
|
|
61
62
|
warn,
|
|
62
63
|
withSpinner
|
|
63
64
|
} from "./chunk-EZG76F7R.js";
|
|
64
|
-
import "./chunk-
|
|
65
|
-
import "./chunk-
|
|
66
|
-
import "./chunk-
|
|
67
|
-
import "./chunk-5L4X5LS6.js";
|
|
65
|
+
import "./chunk-BPEEGJJA.js";
|
|
66
|
+
import "./chunk-YYSJAAJM.js";
|
|
67
|
+
import "./chunk-YUPQOLFX.js";
|
|
68
68
|
import "./chunk-WHOJWOSV.js";
|
|
69
69
|
import "./chunk-5XZ744TS.js";
|
|
70
|
-
import "./chunk-
|
|
70
|
+
import "./chunk-YUBJLB6G.js";
|
|
71
71
|
|
|
72
72
|
// src/emit/deploy-command.ts
|
|
73
73
|
import { basename } from "path";
|
|
@@ -158,7 +158,7 @@ async function runDeployedTests(auth, dest, summary, args) {
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
async function runTestsOrThrow(auth, dest, summary, args) {
|
|
161
|
-
const { runSuite, EXIT_TESTS_FAILED } = await import("./test-command-
|
|
161
|
+
const { runSuite, EXIT_TESTS_FAILED } = await import("./test-command-U4G5Y3UM.js");
|
|
162
162
|
let target;
|
|
163
163
|
if (dest === "ephemeral") {
|
|
164
164
|
if (summary.url === void 0) {
|
|
@@ -168,7 +168,7 @@ async function runTestsOrThrow(auth, dest, summary, args) {
|
|
|
168
168
|
const name = summary.ephemeral?.name;
|
|
169
169
|
target = { base: summary.url, workspaceId: 1, label: name ? `ephemeral ${name}` : "the ephemeral", env: name };
|
|
170
170
|
} else {
|
|
171
|
-
const { resolveMetaTarget } = await import("./env-target-
|
|
171
|
+
const { resolveMetaTarget } = await import("./env-target-GSFCYHKZ.js");
|
|
172
172
|
target = await resolveMetaTarget(auth, { dest: "sandbox" });
|
|
173
173
|
}
|
|
174
174
|
const outcomes = await runSuite(auth, target, {
|
|
@@ -448,4 +448,4 @@ export {
|
|
|
448
448
|
runDeployedTests,
|
|
449
449
|
verifyMicroservices
|
|
450
450
|
};
|
|
451
|
-
//# sourceMappingURL=deploy-command-
|
|
451
|
+
//# sourceMappingURL=deploy-command-M2S4HHLC.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveMetaTarget
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VWGJQTNA.js";
|
|
4
4
|
import "./chunk-DGSF2Q5H.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-ACQCK4DT.js";
|
|
6
6
|
import "./chunk-NDZFBZHC.js";
|
|
7
|
-
import "./chunk-NUQCEOKA.js";
|
|
8
|
-
import "./chunk-3IGNIP6R.js";
|
|
9
7
|
import "./chunk-C56BC2FY.js";
|
|
10
8
|
import "./chunk-7REDODS2.js";
|
|
11
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-NUQCEOKA.js";
|
|
10
|
+
import "./chunk-3IGNIP6R.js";
|
|
12
11
|
import "./chunk-GNPVYOPB.js";
|
|
12
|
+
import "./chunk-EZG76F7R.js";
|
|
13
13
|
export {
|
|
14
14
|
resolveMetaTarget
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=env-target-
|
|
16
|
+
//# sourceMappingURL=env-target-GSFCYHKZ.js.map
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
confirm
|
|
3
|
-
} from "./chunk-EWFHDJY5.js";
|
|
4
1
|
import {
|
|
5
2
|
deleteEphemeral,
|
|
6
3
|
getEphemeral,
|
|
@@ -9,39 +6,43 @@ import {
|
|
|
9
6
|
listAllEphemeral,
|
|
10
7
|
listEphemeral
|
|
11
8
|
} from "./chunk-6DHBYBTO.js";
|
|
12
|
-
import {
|
|
13
|
-
resolveOutputTarget
|
|
14
|
-
} from "./chunk-XQ22GLYS.js";
|
|
15
|
-
import {
|
|
16
|
-
exportWorkspaceBundle
|
|
17
|
-
} from "./chunk-QTNO2WD6.js";
|
|
18
|
-
import "./chunk-ZUTSMMAG.js";
|
|
19
9
|
import {
|
|
20
10
|
clearEnvironment,
|
|
21
11
|
getEnvironment,
|
|
22
12
|
readEphemeralState
|
|
23
13
|
} from "./chunk-DGSF2Q5H.js";
|
|
24
|
-
import "./chunk-7DKX2SPN.js";
|
|
25
14
|
import {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} from "./chunk-NDZFBZHC.js";
|
|
29
|
-
import {
|
|
30
|
-
isMachineOutput,
|
|
31
|
-
writeJson
|
|
32
|
-
} from "./chunk-NUQCEOKA.js";
|
|
33
|
-
import "./chunk-3IGNIP6R.js";
|
|
15
|
+
confirm
|
|
16
|
+
} from "./chunk-ALNQCWAW.js";
|
|
34
17
|
import {
|
|
35
18
|
openBrowser
|
|
36
19
|
} from "./chunk-VTIL47DT.js";
|
|
20
|
+
import {
|
|
21
|
+
resolveOutputTarget
|
|
22
|
+
} from "./chunk-AJ7JQ4OU.js";
|
|
23
|
+
import "./chunk-ACQCK4DT.js";
|
|
24
|
+
import {
|
|
25
|
+
printMicroserviceSection,
|
|
26
|
+
readMicroservices
|
|
27
|
+
} from "./chunk-NDZFBZHC.js";
|
|
37
28
|
import {
|
|
38
29
|
getAccessToken
|
|
39
30
|
} from "./chunk-C56BC2FY.js";
|
|
40
31
|
import "./chunk-7REDODS2.js";
|
|
32
|
+
import {
|
|
33
|
+
exportWorkspaceBundle
|
|
34
|
+
} from "./chunk-QTNO2WD6.js";
|
|
35
|
+
import "./chunk-ZUTSMMAG.js";
|
|
41
36
|
import "./chunk-X4DVXBFY.js";
|
|
37
|
+
import {
|
|
38
|
+
isMachineOutput,
|
|
39
|
+
writeJson
|
|
40
|
+
} from "./chunk-NUQCEOKA.js";
|
|
41
|
+
import "./chunk-3IGNIP6R.js";
|
|
42
42
|
import {
|
|
43
43
|
unknownSubcommand
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-KGNJM4LN.js";
|
|
45
|
+
import "./chunk-GNPVYOPB.js";
|
|
45
46
|
import {
|
|
46
47
|
detail,
|
|
47
48
|
formatExpiration,
|
|
@@ -52,8 +53,7 @@ import {
|
|
|
52
53
|
success,
|
|
53
54
|
warn
|
|
54
55
|
} from "./chunk-EZG76F7R.js";
|
|
55
|
-
import "./chunk-
|
|
56
|
-
import "./chunk-QO4I5OYF.js";
|
|
56
|
+
import "./chunk-YYSJAAJM.js";
|
|
57
57
|
|
|
58
58
|
// src/emit/ephemeral-command.ts
|
|
59
59
|
import { writeFileSync } from "fs";
|
|
@@ -90,7 +90,7 @@ async function runEphemeralCommand(args) {
|
|
|
90
90
|
case "impersonate":
|
|
91
91
|
return runImpersonate(args);
|
|
92
92
|
case "codegen": {
|
|
93
|
-
const { runCodegenCommand } = await import("./codegen-command-
|
|
93
|
+
const { runCodegenCommand } = await import("./codegen-command-Z7WQMOJ7.js");
|
|
94
94
|
return runCodegenCommand(args, { kind: "ephemeral" });
|
|
95
95
|
}
|
|
96
96
|
default:
|
|
@@ -239,4 +239,4 @@ export {
|
|
|
239
239
|
resolveLive,
|
|
240
240
|
runEphemeralCommand
|
|
241
241
|
};
|
|
242
|
-
//# sourceMappingURL=ephemeral-command-
|
|
242
|
+
//# sourceMappingURL=ephemeral-command-6WJW7LP6.js.map
|