@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
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
registerKind,
|
|
36
36
|
tableColumns,
|
|
37
37
|
withFilters
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-YUPQOLFX.js";
|
|
39
39
|
import {
|
|
40
40
|
assertPathParamInputs,
|
|
41
41
|
fillPathParams,
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
deriveGuid,
|
|
52
52
|
realtimeChannelSeedName,
|
|
53
53
|
resolveRef
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-YUBJLB6G.js";
|
|
55
55
|
|
|
56
56
|
// src/statements/set-var.ts
|
|
57
57
|
var SET_VAR = "mvp:set_var";
|
|
@@ -3721,4 +3721,4 @@ export {
|
|
|
3721
3721
|
workspaceKind,
|
|
3722
3722
|
workspaceConfig
|
|
3723
3723
|
};
|
|
3724
|
-
//# sourceMappingURL=chunk-
|
|
3724
|
+
//# sourceMappingURL=chunk-CYJ7R3AD.js.map
|
|
@@ -5,9 +5,7 @@ import {
|
|
|
5
5
|
presetFilePath,
|
|
6
6
|
renderPreset,
|
|
7
7
|
upsertManagedBlock
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-47WDWMBJ.js";
|
|
10
|
-
import "./chunk-6DHJVLYP.js";
|
|
8
|
+
} from "./chunk-7SISR3CS.js";
|
|
11
9
|
import {
|
|
12
10
|
warn
|
|
13
11
|
} from "./chunk-EZG76F7R.js";
|
|
@@ -50,7 +48,7 @@ function appNameFor(projectDir) {
|
|
|
50
48
|
}
|
|
51
49
|
function refreshAgentFiles(opts) {
|
|
52
50
|
const env = opts.env ?? process.env;
|
|
53
|
-
if (isCI(env) || !codingAgentDetected(env)) return [];
|
|
51
|
+
if (opts.explicit !== true && (isCI(env) || !codingAgentDetected(env))) return [];
|
|
54
52
|
const mode = opts.mode ?? guidanceModeFor(opts.projectDir);
|
|
55
53
|
const appName = opts.appName ?? appNameFor(opts.projectDir);
|
|
56
54
|
const managed = [];
|
|
@@ -87,10 +85,11 @@ function refreshAgentFiles(opts) {
|
|
|
87
85
|
}
|
|
88
86
|
return refreshed;
|
|
89
87
|
}
|
|
88
|
+
|
|
90
89
|
export {
|
|
91
|
-
CI_ENV_VARS,
|
|
92
90
|
codingAgentDetected,
|
|
91
|
+
CI_ENV_VARS,
|
|
93
92
|
isCI,
|
|
94
93
|
refreshAgentFiles
|
|
95
94
|
};
|
|
96
|
-
//# sourceMappingURL=
|
|
95
|
+
//# sourceMappingURL=chunk-D6OGU2AI.js.map
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
unknownFlag,
|
|
10
10
|
unknownHelpTopic,
|
|
11
11
|
unknownSubcommand
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KGNJM4LN.js";
|
|
13
13
|
import {
|
|
14
14
|
readLockFile,
|
|
15
15
|
writeLockFile
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-MFIHIS6B.js";
|
|
17
17
|
import {
|
|
18
18
|
detail,
|
|
19
19
|
info,
|
|
@@ -24,15 +24,17 @@ import {
|
|
|
24
24
|
Xano,
|
|
25
25
|
assertSeedIds,
|
|
26
26
|
coerceSeedRowValues
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-BPEEGJJA.js";
|
|
28
28
|
import {
|
|
29
29
|
getCommand,
|
|
30
30
|
getSubcommand,
|
|
31
31
|
isCommand,
|
|
32
32
|
suggest
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-YYSJAAJM.js";
|
|
34
34
|
import {
|
|
35
35
|
FILTER_NAMES,
|
|
36
|
+
KNOWLEDGE_DIR,
|
|
37
|
+
KNOWLEDGE_FILE,
|
|
36
38
|
SEED_FILE,
|
|
37
39
|
buildContentEnvelope,
|
|
38
40
|
emit,
|
|
@@ -42,7 +44,7 @@ import {
|
|
|
42
44
|
pathSegment,
|
|
43
45
|
serializeBundle,
|
|
44
46
|
tableColumns
|
|
45
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-YUPQOLFX.js";
|
|
46
48
|
import {
|
|
47
49
|
WORKSPACE_KEY,
|
|
48
50
|
createLockContext,
|
|
@@ -54,12 +56,12 @@ import {
|
|
|
54
56
|
seedLockOverrides,
|
|
55
57
|
serializeLock,
|
|
56
58
|
validateLockModel
|
|
57
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-YUBJLB6G.js";
|
|
58
60
|
|
|
59
61
|
// src/emit/cli.ts
|
|
60
|
-
import { pathToFileURL as
|
|
61
|
-
import { existsSync, readdirSync, readFileSync as
|
|
62
|
-
import { basename, dirname, join, relative, resolve } from "path";
|
|
62
|
+
import { pathToFileURL as pathToFileURL3, fileURLToPath as fileURLToPath3 } from "url";
|
|
63
|
+
import { existsSync, readdirSync as readdirSync2, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
64
|
+
import { basename, dirname, join as join2, relative as relative2, resolve } from "path";
|
|
63
65
|
import { createRequire } from "module";
|
|
64
66
|
|
|
65
67
|
// src/workspace/seed.ts
|
|
@@ -250,6 +252,84 @@ function findUnresolvableFilters(bundle) {
|
|
|
250
252
|
return findings;
|
|
251
253
|
}
|
|
252
254
|
|
|
255
|
+
// src/workspace/knowledge.ts
|
|
256
|
+
import { readFileSync as readFileSync2, readdirSync, statSync } from "fs";
|
|
257
|
+
import { fileURLToPath as fileURLToPath2, pathToFileURL as pathToFileURL2 } from "url";
|
|
258
|
+
import { join, relative, sep } from "path";
|
|
259
|
+
var MAX_KNOWLEDGE_FILE_BYTES = 1024 * 1024;
|
|
260
|
+
function resolveMarker(ref) {
|
|
261
|
+
const base = /^[a-z][a-z0-9+.-]*:/i.test(ref.base) ? ref.base : pathToFileURL2(ref.base).href;
|
|
262
|
+
return fileURLToPath2(new URL(ref.path, base));
|
|
263
|
+
}
|
|
264
|
+
function collectRefFiles(dir, itemName) {
|
|
265
|
+
const out = [];
|
|
266
|
+
const walk = (cur) => {
|
|
267
|
+
for (const entry of readdirSync(cur, { withFileTypes: true })) {
|
|
268
|
+
const full = join(cur, entry.name);
|
|
269
|
+
if (entry.isDirectory()) {
|
|
270
|
+
walk(full);
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
if (!entry.isFile()) continue;
|
|
274
|
+
const content = readFileSync2(full, "utf8");
|
|
275
|
+
const size = Buffer.byteLength(content, "utf8");
|
|
276
|
+
const rel = relative(dir, full).split(sep).join("/");
|
|
277
|
+
if (size > MAX_KNOWLEDGE_FILE_BYTES) {
|
|
278
|
+
throw new Error(
|
|
279
|
+
`knowledge "${itemName}": reference file "${rel}" is ${size} bytes, over the ${MAX_KNOWLEDGE_FILE_BYTES}-byte limit the engine accepts. Split it, or move the bulk of it somewhere the agent fetches at run time.`
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
out.push({ path: rel, content, size });
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
walk(dir);
|
|
286
|
+
out.sort((a, b) => a.path < b.path ? -1 : a.path > b.path ? 1 : 0);
|
|
287
|
+
return out;
|
|
288
|
+
}
|
|
289
|
+
function resolveKnowledge(defs) {
|
|
290
|
+
const resolved = [];
|
|
291
|
+
for (const def of defs) {
|
|
292
|
+
const bodyRef = def.body[KNOWLEDGE_FILE];
|
|
293
|
+
const where = `knowledgeFile("${bodyRef.path}")`;
|
|
294
|
+
let content;
|
|
295
|
+
try {
|
|
296
|
+
const abs = resolveMarker(bodyRef);
|
|
297
|
+
if (statSync(abs).isDirectory()) {
|
|
298
|
+
throw new Error(
|
|
299
|
+
`knowledge "${def.name}": ${where} points at a DIRECTORY. A body is one markdown file; use \`refs: knowledgeDir(...)\` for a folder of reference files.`
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
content = readFileSync2(abs, "utf8");
|
|
303
|
+
} catch (err) {
|
|
304
|
+
if (err instanceof Error && /points at a DIRECTORY/.test(err.message)) throw err;
|
|
305
|
+
throw new Error(
|
|
306
|
+
`knowledge "${def.name}": cannot read ${where} \u2014 ${err.message}. The path resolves relative to the module that declares the item (its \`import.meta.url\`).`
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
let files = [];
|
|
310
|
+
if (def.refs !== void 0) {
|
|
311
|
+
const refsRef = def.refs[KNOWLEDGE_DIR];
|
|
312
|
+
const refsWhere = `knowledgeDir("${refsRef.path}")`;
|
|
313
|
+
const abs = resolveMarker(refsRef);
|
|
314
|
+
try {
|
|
315
|
+
if (!statSync(abs).isDirectory()) {
|
|
316
|
+
throw new Error(
|
|
317
|
+
`knowledge "${def.name}": ${refsWhere} is not a directory. Reference files are a FOLDER the agent searches; a single file belongs in the body.`
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
} catch (err) {
|
|
321
|
+
if (err instanceof Error && /is not a directory/.test(err.message)) throw err;
|
|
322
|
+
throw new Error(
|
|
323
|
+
`knowledge "${def.name}": cannot read ${refsWhere} \u2014 ${err.message}.`
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
files = collectRefFiles(abs, def.name);
|
|
327
|
+
}
|
|
328
|
+
resolved.push({ name: def.name, content, files });
|
|
329
|
+
}
|
|
330
|
+
return resolved;
|
|
331
|
+
}
|
|
332
|
+
|
|
253
333
|
// src/emit/cli.ts
|
|
254
334
|
function parsePort(raw) {
|
|
255
335
|
const n = Number(raw);
|
|
@@ -300,6 +380,7 @@ function parseArgs(argv) {
|
|
|
300
380
|
let frozenLock = false;
|
|
301
381
|
let strict = false;
|
|
302
382
|
let yes = false;
|
|
383
|
+
let check = false;
|
|
303
384
|
let bundle;
|
|
304
385
|
let reset = false;
|
|
305
386
|
let dest;
|
|
@@ -328,6 +409,7 @@ function parseArgs(argv) {
|
|
|
328
409
|
let path;
|
|
329
410
|
let name;
|
|
330
411
|
const ai = [];
|
|
412
|
+
const marketplace = [];
|
|
331
413
|
let framework;
|
|
332
414
|
let theme;
|
|
333
415
|
let radius;
|
|
@@ -376,6 +458,8 @@ function parseArgs(argv) {
|
|
|
376
458
|
strict = true;
|
|
377
459
|
} else if (arg === "--yes" || arg === "-y") {
|
|
378
460
|
yes = true;
|
|
461
|
+
} else if (arg === "--check") {
|
|
462
|
+
check = true;
|
|
379
463
|
} else if (arg === "--bundle") {
|
|
380
464
|
bundle = rest[++i];
|
|
381
465
|
} else if (arg.startsWith("--bundle=")) {
|
|
@@ -505,6 +589,12 @@ function parseArgs(argv) {
|
|
|
505
589
|
icons = rest[++i];
|
|
506
590
|
} else if (arg.startsWith("--icons=")) {
|
|
507
591
|
icons = arg.slice("--icons=".length);
|
|
592
|
+
} else if (arg === "--marketplace" || arg.startsWith("--marketplace=")) {
|
|
593
|
+
const raw = arg === "--marketplace" ? rest[++i] : arg.slice("--marketplace=".length);
|
|
594
|
+
for (const p of (raw ?? "").split(",")) {
|
|
595
|
+
const pkg = p.trim();
|
|
596
|
+
if (pkg !== "") marketplace.push(pkg);
|
|
597
|
+
}
|
|
508
598
|
} else if (arg === "--ai" || arg.startsWith("--ai=")) {
|
|
509
599
|
const raw = arg === "--ai" ? rest[++i] : arg.slice("--ai=".length);
|
|
510
600
|
for (const p of (raw ?? "").split(",")) {
|
|
@@ -581,6 +671,7 @@ function parseArgs(argv) {
|
|
|
581
671
|
frozenLock,
|
|
582
672
|
strict,
|
|
583
673
|
yes,
|
|
674
|
+
check,
|
|
584
675
|
bundle,
|
|
585
676
|
reset,
|
|
586
677
|
dest,
|
|
@@ -609,6 +700,7 @@ function parseArgs(argv) {
|
|
|
609
700
|
path,
|
|
610
701
|
name,
|
|
611
702
|
ai,
|
|
703
|
+
marketplace,
|
|
612
704
|
force,
|
|
613
705
|
noInstall,
|
|
614
706
|
framework,
|
|
@@ -673,9 +765,9 @@ function parseExpiresHours(raw) {
|
|
|
673
765
|
}
|
|
674
766
|
async function importTsxApi(file) {
|
|
675
767
|
try {
|
|
676
|
-
const requireFromEntry = createRequire(
|
|
768
|
+
const requireFromEntry = createRequire(pathToFileURL3(resolve(file)));
|
|
677
769
|
const apiPath = requireFromEntry.resolve("tsx/esm/api");
|
|
678
|
-
return await import(
|
|
770
|
+
return await import(pathToFileURL3(apiPath).href);
|
|
679
771
|
} catch {
|
|
680
772
|
return await import("tsx/esm/api");
|
|
681
773
|
}
|
|
@@ -693,10 +785,10 @@ function entryIsCommonJs(file) {
|
|
|
693
785
|
if (/\.cts$/.test(path)) return true;
|
|
694
786
|
let dir = dirname(path);
|
|
695
787
|
for (; ; ) {
|
|
696
|
-
const manifest =
|
|
788
|
+
const manifest = join2(dir, "package.json");
|
|
697
789
|
if (existsSync(manifest)) {
|
|
698
790
|
try {
|
|
699
|
-
const pkg = JSON.parse(
|
|
791
|
+
const pkg = JSON.parse(readFileSync3(manifest, "utf8"));
|
|
700
792
|
return pkg.type !== "module";
|
|
701
793
|
} catch {
|
|
702
794
|
return false;
|
|
@@ -715,7 +807,7 @@ function commonJsEntryError(file, cause) {
|
|
|
715
807
|
}
|
|
716
808
|
function suggestSiblingFile(path) {
|
|
717
809
|
try {
|
|
718
|
-
return suggest(basename(path),
|
|
810
|
+
return suggest(basename(path), readdirSync2(dirname(path)));
|
|
719
811
|
} catch {
|
|
720
812
|
return void 0;
|
|
721
813
|
}
|
|
@@ -727,7 +819,7 @@ async function loadDefault(file) {
|
|
|
727
819
|
suggestion: suggestSiblingFile(path)
|
|
728
820
|
});
|
|
729
821
|
}
|
|
730
|
-
const url =
|
|
822
|
+
const url = pathToFileURL3(path).href;
|
|
731
823
|
const isTypeScript = /\.[mc]?ts$/.test(file);
|
|
732
824
|
if (isTypeScript) {
|
|
733
825
|
if (entryIsCommonJs(file)) throw commonJsEntryError(file);
|
|
@@ -761,12 +853,12 @@ async function loadDefault(file) {
|
|
|
761
853
|
}
|
|
762
854
|
}
|
|
763
855
|
function readVersion() {
|
|
764
|
-
let dir = dirname(
|
|
856
|
+
let dir = dirname(fileURLToPath3(import.meta.url));
|
|
765
857
|
for (let i = 0; i < 6; i++) {
|
|
766
|
-
const p =
|
|
858
|
+
const p = join2(dir, "package.json");
|
|
767
859
|
if (existsSync(p)) {
|
|
768
860
|
try {
|
|
769
|
-
const pkg = JSON.parse(
|
|
861
|
+
const pkg = JSON.parse(readFileSync3(p, "utf8"));
|
|
770
862
|
if (pkg.name === "@xanots/sdk" && typeof pkg.version === "string") return pkg.version;
|
|
771
863
|
} catch {
|
|
772
864
|
}
|
|
@@ -791,9 +883,9 @@ function warnOrphans(orphans, dropped, cededCanonicals, previous, observed) {
|
|
|
791
883
|
);
|
|
792
884
|
continue;
|
|
793
885
|
}
|
|
794
|
-
const
|
|
795
|
-
const payloadKey = key.slice(0,
|
|
796
|
-
const name = key.slice(
|
|
886
|
+
const sep2 = key.indexOf(":");
|
|
887
|
+
const payloadKey = key.slice(0, sep2);
|
|
888
|
+
const name = key.slice(sep2 + 1);
|
|
797
889
|
const newcomers = Object.keys(observed).filter((k) => k.startsWith(`${payloadKey}:`) && !(k in previous.objects)).map((k) => k.slice(payloadKey.length + 1));
|
|
798
890
|
const hint = newcomers.length > 0 ? ` (new ${payloadKey} names this export: ${newcomers.join(", ")})` : "";
|
|
799
891
|
warn(
|
|
@@ -814,6 +906,10 @@ function warnOrphans(orphans, dropped, cededCanonicals, previous, observed) {
|
|
|
814
906
|
}
|
|
815
907
|
}
|
|
816
908
|
async function run(argv) {
|
|
909
|
+
if (argv[0] === "onboard") {
|
|
910
|
+
const { runOnboardCommand } = await import("./onboard-command-EHOHKQQU.js");
|
|
911
|
+
return runOnboardCommand(argv.slice(1));
|
|
912
|
+
}
|
|
817
913
|
const helpRequest = resolveHelpRequest(argv);
|
|
818
914
|
if (helpRequest) {
|
|
819
915
|
if (helpRequest.unknownTopic !== void 0) throw unknownHelpTopic(helpRequest.unknownTopic);
|
|
@@ -832,11 +928,11 @@ async function run(argv) {
|
|
|
832
928
|
return;
|
|
833
929
|
}
|
|
834
930
|
if (command === "init") {
|
|
835
|
-
const { runInitCommand } = await import("./init-command-
|
|
931
|
+
const { runInitCommand } = await import("./init-command-GJUPWTKA.js");
|
|
836
932
|
return runInitCommand(args);
|
|
837
933
|
}
|
|
838
934
|
if (command === "completion") {
|
|
839
|
-
const { isCompletionShell, runCompletionCommand, COMPLETION_SHELLS } = await import("./completion-
|
|
935
|
+
const { isCompletionShell, runCompletionCommand, COMPLETION_SHELLS } = await import("./completion-4GYN752B.js");
|
|
840
936
|
const shell = args.positionals[0];
|
|
841
937
|
if (shell === void 0 || !isCompletionShell(shell)) {
|
|
842
938
|
throw new UsageError(
|
|
@@ -846,28 +942,32 @@ async function run(argv) {
|
|
|
846
942
|
}
|
|
847
943
|
return runCompletionCommand(shell);
|
|
848
944
|
}
|
|
945
|
+
if (command === "upgrade") {
|
|
946
|
+
const { runUpgradeCommand } = await import("./upgrade-command-CKJ4BS2P.js");
|
|
947
|
+
return runUpgradeCommand(args);
|
|
948
|
+
}
|
|
849
949
|
if (command === "lock") {
|
|
850
|
-
const { runLockCommand } = await import("./lock-commands-
|
|
950
|
+
const { runLockCommand } = await import("./lock-commands-7IH7RSSP.js");
|
|
851
951
|
return runLockCommand(args);
|
|
852
952
|
}
|
|
853
953
|
if (command === "login") {
|
|
854
|
-
const { runLoginCommand } = await import("./login-command-
|
|
954
|
+
const { runLoginCommand } = await import("./login-command-QM5SBBI2.js");
|
|
855
955
|
return runLoginCommand(args);
|
|
856
956
|
}
|
|
857
957
|
if (command === "logout") {
|
|
858
|
-
const { runLogoutCommand } = await import("./logout-command-
|
|
958
|
+
const { runLogoutCommand } = await import("./logout-command-THPASOHM.js");
|
|
859
959
|
return runLogoutCommand(args);
|
|
860
960
|
}
|
|
861
961
|
if (command === "deploy") {
|
|
862
|
-
const { runDeployCommand } = await import("./deploy-command-
|
|
962
|
+
const { runDeployCommand } = await import("./deploy-command-M2S4HHLC.js");
|
|
863
963
|
return runDeployCommand(args);
|
|
864
964
|
}
|
|
865
965
|
if (command === "ephemeral") {
|
|
866
|
-
const { runEphemeralCommand } = await import("./ephemeral-command-
|
|
966
|
+
const { runEphemeralCommand } = await import("./ephemeral-command-6WJW7LP6.js");
|
|
867
967
|
return runEphemeralCommand(args);
|
|
868
968
|
}
|
|
869
969
|
if (command === "release") {
|
|
870
|
-
const { runReleaseCommand } = await import("./release-command-
|
|
970
|
+
const { runReleaseCommand } = await import("./release-command-M4CVNTWL.js");
|
|
871
971
|
return runReleaseCommand(args);
|
|
872
972
|
}
|
|
873
973
|
if (command === "sandbox") {
|
|
@@ -875,47 +975,47 @@ async function run(argv) {
|
|
|
875
975
|
throw removedSubcommand("sandbox", "deploy");
|
|
876
976
|
}
|
|
877
977
|
if (args.subcommand === "details") {
|
|
878
|
-
const { runSandboxDetailsCommand } = await import("./sandbox-details-command-
|
|
978
|
+
const { runSandboxDetailsCommand } = await import("./sandbox-details-command-BRII3QHG.js");
|
|
879
979
|
return runSandboxDetailsCommand(args);
|
|
880
980
|
}
|
|
881
981
|
if (args.subcommand === "export") {
|
|
882
|
-
const { runSandboxExportCommand } = await import("./sandbox-export-command-
|
|
982
|
+
const { runSandboxExportCommand } = await import("./sandbox-export-command-PCZ5FL4U.js");
|
|
883
983
|
return runSandboxExportCommand(args);
|
|
884
984
|
}
|
|
885
985
|
if (args.subcommand === "codegen") {
|
|
886
|
-
const { runCodegenCommand } = await import("./codegen-command-
|
|
986
|
+
const { runCodegenCommand } = await import("./codegen-command-Z7WQMOJ7.js");
|
|
887
987
|
return runCodegenCommand(args, { kind: "sandbox" });
|
|
888
988
|
}
|
|
889
989
|
throw unknownSubcommand("sandbox", args.subcommand);
|
|
890
990
|
}
|
|
891
991
|
if (command === "test") {
|
|
892
|
-
const { runTestCommand } = await import("./test-command-
|
|
992
|
+
const { runTestCommand } = await import("./test-command-U4G5Y3UM.js");
|
|
893
993
|
return runTestCommand(args);
|
|
894
994
|
}
|
|
895
995
|
if (command === "workspace") {
|
|
896
|
-
const { runWorkspaceCommand } = await import("./workspace-command-
|
|
996
|
+
const { runWorkspaceCommand } = await import("./workspace-command-RALSEJSW.js");
|
|
897
997
|
return runWorkspaceCommand(args);
|
|
898
998
|
}
|
|
899
999
|
if (command === "codegen") {
|
|
900
|
-
const { runCodegenCommand } = await import("./codegen-command-
|
|
1000
|
+
const { runCodegenCommand } = await import("./codegen-command-Z7WQMOJ7.js");
|
|
901
1001
|
return runCodegenCommand(args, { kind: "file" });
|
|
902
1002
|
}
|
|
903
1003
|
if (command === "profile") {
|
|
904
1004
|
if (args.subcommand !== "me") {
|
|
905
1005
|
throw unknownSubcommand("profile", args.subcommand);
|
|
906
1006
|
}
|
|
907
|
-
const { runProfileCommand } = await import("./profile-command-
|
|
1007
|
+
const { runProfileCommand } = await import("./profile-command-EUWPVWED.js");
|
|
908
1008
|
return runProfileCommand(args);
|
|
909
1009
|
}
|
|
910
1010
|
if (command === "whoami") {
|
|
911
|
-
const { runProfileCommand } = await import("./profile-command-
|
|
1011
|
+
const { runProfileCommand } = await import("./profile-command-EUWPVWED.js");
|
|
912
1012
|
return runProfileCommand(args);
|
|
913
1013
|
}
|
|
914
1014
|
if (command === "marketplace") {
|
|
915
1015
|
if (!["list", "search", "details", "install"].includes(args.subcommand ?? "")) {
|
|
916
1016
|
throw unknownSubcommand("marketplace", args.subcommand);
|
|
917
1017
|
}
|
|
918
|
-
const marketplace = await import("./marketplace-command-
|
|
1018
|
+
const marketplace = await import("./marketplace-command-463DT7O7.js");
|
|
919
1019
|
if (args.subcommand === "list") return marketplace.runMarketplaceListCommand(args);
|
|
920
1020
|
if (args.subcommand === "search") return marketplace.runMarketplaceSearchCommand(args);
|
|
921
1021
|
if (args.subcommand === "details") return marketplace.runMarketplaceDetailsCommand(args);
|
|
@@ -925,7 +1025,7 @@ async function run(argv) {
|
|
|
925
1025
|
throw unknownCommand("push");
|
|
926
1026
|
}
|
|
927
1027
|
if (command === "validate") {
|
|
928
|
-
const { runValidateCommand } = await import("./validate-command-
|
|
1028
|
+
const { runValidateCommand } = await import("./validate-command-S5N37JRP.js");
|
|
929
1029
|
return runValidateCommand(args);
|
|
930
1030
|
}
|
|
931
1031
|
if (command !== "compile" && command !== "export" && command !== "paths" && command !== "routes") {
|
|
@@ -957,7 +1057,7 @@ async function run(argv) {
|
|
|
957
1057
|
}
|
|
958
1058
|
async function refreshAgentGuidance() {
|
|
959
1059
|
try {
|
|
960
|
-
const { refreshAgentFiles } = await import("./agent-file-refresh-
|
|
1060
|
+
const { refreshAgentFiles } = await import("./agent-file-refresh-IJ7GN2FJ.js");
|
|
961
1061
|
const refreshed = refreshAgentFiles({
|
|
962
1062
|
projectDir: process.cwd(),
|
|
963
1063
|
sdkVersion: readVersion()
|
|
@@ -970,7 +1070,7 @@ async function refreshAgentGuidance() {
|
|
|
970
1070
|
}
|
|
971
1071
|
}
|
|
972
1072
|
function resolveLockPath(args, file) {
|
|
973
|
-
return args.lockPath !== void 0 ? resolve(args.lockPath) :
|
|
1073
|
+
return args.lockPath !== void 0 ? resolve(args.lockPath) : join2(dirname(resolve(file)), "xano.lock");
|
|
974
1074
|
}
|
|
975
1075
|
function describeDefaultExport(def) {
|
|
976
1076
|
if (def === void 0) return "no default export";
|
|
@@ -1082,7 +1182,7 @@ async function runPaths(args) {
|
|
|
1082
1182
|
const channelCount = channelRows.length === 1 ? "1 channel" : `${channelRows.length} channels`;
|
|
1083
1183
|
const count = describableServers.length > 0 ? `${routeCount}, ${channelCount}` : routeCount;
|
|
1084
1184
|
if (args.strict) {
|
|
1085
|
-
const current = existsSync(args.emit) ?
|
|
1185
|
+
const current = existsSync(args.emit) ? readFileSync3(args.emit, "utf8") : void 0;
|
|
1086
1186
|
if (current !== source) {
|
|
1087
1187
|
throw new Error(
|
|
1088
1188
|
`--strict: ${args.emit} is ${current === void 0 ? "missing" : "out of date"}. Run \`xanots paths <entry> --emit ${args.emit}\` and commit the result \u2014 a stale route manifest keeps compiling while the endpoints have moved.`
|
|
@@ -1134,7 +1234,12 @@ async function compileBundle(args, opts = {}) {
|
|
|
1134
1234
|
if (!Xano.isXano(def)) {
|
|
1135
1235
|
throw new Error(`Module "${file}" must default-export a Xano registry for \`export\`.`);
|
|
1136
1236
|
}
|
|
1137
|
-
const
|
|
1237
|
+
const resolvedKnowledge = resolveKnowledge(def.knowledge());
|
|
1238
|
+
const bundle = def.export({
|
|
1239
|
+
...lockCtx ? { lock: lockCtx } : {},
|
|
1240
|
+
strict: args.strict,
|
|
1241
|
+
knowledge: resolvedKnowledge
|
|
1242
|
+
});
|
|
1138
1243
|
if (lockCtx) {
|
|
1139
1244
|
const { lock: merged, orphans, dropped, cededCanonicals } = mergeObserved(
|
|
1140
1245
|
lockCtx.lock,
|
|
@@ -1148,7 +1253,7 @@ async function compileBundle(args, opts = {}) {
|
|
|
1148
1253
|
);
|
|
1149
1254
|
}
|
|
1150
1255
|
writeLockFile(lockPath, merged);
|
|
1151
|
-
if (!lockExists) info(`Wrote ${
|
|
1256
|
+
if (!lockExists) info(`Wrote ${relative2(process.cwd(), lockPath) || lockPath} (commit this).`);
|
|
1152
1257
|
warnOrphans(orphans, dropped, cededCanonicals, lockCtx.lock, lockCtx.observed);
|
|
1153
1258
|
}
|
|
1154
1259
|
checkFilterNames(bundle, args.strict);
|
|
@@ -1185,4 +1290,4 @@ export {
|
|
|
1185
1290
|
exportBundleJson,
|
|
1186
1291
|
compileBundle
|
|
1187
1292
|
};
|
|
1188
|
-
//# sourceMappingURL=chunk-
|
|
1293
|
+
//# sourceMappingURL=chunk-DUC3PXDG.js.map
|