@xano/sdk 1.0.8 → 1.0.10
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 +24 -0
- package/README.md +85 -86
- package/dist/.build-fingerprint +1 -1
- package/dist/{agent-file-refresh-QJO3MT6Q.js → agent-file-refresh-VOGTQ3JE.js} +6 -6
- package/dist/{agent-skill-command-GBR4KUUG.js → agent-skill-command-LDT5JXIO.js} +16 -16
- package/dist/{backend-dir-PFUIPCV3.js → backend-dir-UNUO7TNL.js} +5 -5
- package/dist/bin.js +16 -16
- package/dist/{branch-commands-CR3SAHMV.js → branch-commands-IJ7SK5AM.js} +3 -3
- package/dist/{chunk-QRKBFXIB.js → chunk-2ND7WS3E.js} +2 -2
- package/dist/{chunk-CRE7P7P2.js → chunk-3IFRZXHN.js} +2 -2
- package/dist/{chunk-Y5ET37NN.js → chunk-3TTR4BHW.js} +2 -2
- package/dist/{chunk-K75BFHQQ.js → chunk-3TWQDGQY.js} +2 -2
- package/dist/{chunk-ZT2B22VQ.js → chunk-436AOVZS.js} +2 -2
- package/dist/{chunk-ZJCHS7FM.js → chunk-45A3AF2B.js} +54 -54
- package/dist/{chunk-XYTVP4WI.js → chunk-5DLDRUCQ.js} +3 -3
- package/dist/{chunk-NFZUXS7D.js → chunk-6BIOLAJ4.js} +5 -5
- package/dist/{chunk-S3WN6GGO.js → chunk-6NXIRULE.js} +12 -12
- package/dist/{chunk-W2BVP27L.js → chunk-77IFWJ53.js} +2 -2
- package/dist/{chunk-ZQ5WZWHF.js → chunk-BYYVOX2P.js} +17 -17
- package/dist/{chunk-BRANWM4U.js → chunk-C2SAVXAB.js} +2 -2
- package/dist/{chunk-QE2GNFMP.js → chunk-CTKBGPM6.js} +3 -3
- package/dist/{chunk-77GV772V.js → chunk-DHU3EGGF.js} +2 -2
- package/dist/{chunk-DER2CVNC.js → chunk-DSD2NNTX.js} +2 -2
- package/dist/{chunk-V7KMIEMF.js → chunk-DW47JVXI.js} +18 -18
- package/dist/{chunk-FHQYXGAY.js → chunk-ECGRCTVI.js} +2 -2
- package/dist/{chunk-FN7E6XGD.js → chunk-FDZ2ANSS.js} +2 -2
- package/dist/{chunk-UU7EEREQ.js → chunk-FZGK4VM5.js} +2 -2
- package/dist/{chunk-UKJFCEMI.js → chunk-GDAWYDHY.js} +4 -4
- package/dist/{chunk-2HZDWZM2.js → chunk-HDKSHL4Z.js} +1 -1
- package/dist/{chunk-33KELF2X.js → chunk-HMFEWTI7.js} +39 -39
- package/dist/{chunk-7UWUEUVJ.js → chunk-HU6D6PYT.js} +2 -2
- package/dist/{chunk-JG642U5D.js → chunk-IIAF7VKN.js} +2 -2
- package/dist/{chunk-AS4G2MIE.js → chunk-IW6E3LES.js} +2 -2
- package/dist/{chunk-5GIOCDUM.js → chunk-IZI3SYXH.js} +3 -3
- package/dist/{chunk-S3STXOAO.js → chunk-JE7BL5IF.js} +7 -7
- package/dist/{chunk-HKLBDSML.js → chunk-JSPFDMTV.js} +5 -5
- package/dist/{chunk-S2F7KVUL.js → chunk-KA3JN4SH.js} +2 -2
- package/dist/{chunk-P5W6DBV6.js → chunk-KCCZGDQG.js} +3 -3
- package/dist/{chunk-PAS5HOG3.js → chunk-KSGITXNE.js} +2 -2
- package/dist/{chunk-C2I4GC36.js → chunk-NIANORYB.js} +2 -2
- package/dist/{chunk-YG7S3N7P.js → chunk-PPI647YF.js} +20 -20
- package/dist/{chunk-F5RPNTN7.js → chunk-T3ZVNOJC.js} +1 -1
- package/dist/{chunk-WEQFI55W.js → chunk-THGELNPV.js} +4 -4
- package/dist/{chunk-U7XNJ33Q.js → chunk-TWBENPZR.js} +13 -13
- package/dist/{chunk-RYMGK2K5.js → chunk-U4JD5NMP.js} +2 -2
- package/dist/{chunk-JJGK7XGC.js → chunk-V5RXO5AK.js} +2 -2
- package/dist/{chunk-M3RLLT4O.js → chunk-XUSL2Z5C.js} +3 -3
- package/dist/{chunk-JPRZ4ZGU.js → chunk-Z52FKP34.js} +6 -6
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +15 -15
- package/dist/{codegen-command-4YXDJSLU.js → codegen-command-A7M5JLLY.js} +22 -22
- package/dist/{deploy-command-FIDS56ZC.js → deploy-command-RP7Q4XBE.js} +19 -19
- package/dist/{deploy-source-FPNNNNOW.js → deploy-source-ITSAHJW7.js} +8 -8
- package/dist/{dev-env-sync-RBJ2U3HG.js → dev-env-sync-SN6TL22O.js} +16 -16
- package/dist/{emit-8lcNcRrd.d.ts → emit-D-a6JznN.d.ts} +10 -4
- package/dist/{env-example-refresh-6UTTMDOI.js → env-example-refresh-USAGYVJ2.js} +23 -23
- package/dist/{env-pull-command-P5MATITQ.js → env-pull-command-6KEESNVU.js} +14 -14
- package/dist/{env-target-F75YF25S.js → env-target-HOGLLJN5.js} +2 -2
- package/dist/{env-var-command-H3GHROVB.js → env-var-command-VOAINMHX.js} +14 -14
- package/dist/{ephemeral-command-NH2XW3YK.js → ephemeral-command-I7VPCBVQ.js} +15 -15
- package/dist/{generate-command-IANKN6WV.js → generate-command-G7EJ7GW4.js} +26 -26
- package/dist/{gitignore-FT2LVOMI.js → gitignore-WFZ2BTMS.js} +7 -7
- package/dist/{impersonate-command-7B67ICPL.js → impersonate-command-ZJDK7ZYO.js} +10 -10
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/{init-command-QOA4TJI2.js → init-command-CTWDNYAZ.js} +18 -18
- package/dist/{init-modules-KEEJ4HAF.js → init-modules-FJITJ6IB.js} +2 -2
- package/dist/internal.d.ts +4 -4
- package/dist/internal.js +27 -9
- package/dist/{keep-data-merge-BIBW4QR4.js → keep-data-merge-KLNLVBYK.js} +4 -4
- package/dist/{lambda-config-reconcile-47X5C2E4.js → lambda-config-reconcile-FXPDH2U5.js} +3 -3
- package/dist/{landing-record-DO3PM7QP.js → landing-record-ZB4OJQF2.js} +6 -6
- package/dist/{local-engine-choice-2UF7S5QZ.js → local-engine-choice-FO7LABXX.js} +9 -9
- package/dist/{local-engine-command-WGMMZRQL.js → local-engine-command-LI7HUH5Y.js} +10 -10
- package/dist/{local-engine-mcp-command-RMVUH4FL.js → local-engine-mcp-command-EVYRLPE7.js} +10 -10
- package/dist/{lock-commands-5NMQWBGH.js → lock-commands-I4RARW5F.js} +16 -16
- package/dist/{login-command-GLLFZWHT.js → login-command-MJT5CCXL.js} +10 -10
- package/dist/{logout-command-NCMKMJWF.js → logout-command-GSQ2R3XL.js} +3 -3
- package/dist/{marketplace-command-Y3RRUEWL.js → marketplace-command-GK4F5ZZ2.js} +14 -14
- package/dist/{meta-client-Y7N6WDS2.js → meta-client-2A7LYGUQ.js} +2 -2
- package/dist/node.d.ts +4 -4
- package/dist/node.js +18 -18
- package/dist/{operation-outcome-4BFISK2R.js → operation-outcome-UK5ALWRE.js} +4 -4
- package/dist/{output-target-MFANTVGZ.js → output-target-GFPSLLEJ.js} +8 -8
- package/dist/{preflight-command-Q6XOKRM6.js → preflight-command-LP5D6UOD.js} +21 -21
- package/dist/{profile-command-XPQIXFWN.js → profile-command-R7XLNTY6.js} +11 -11
- package/dist/{promote-command-DN64QK7O.js → promote-command-TEVVCM77.js} +29 -29
- package/dist/{publish-command-SLE46MQX.js → publish-command-WTVINN5E.js} +19 -19
- package/dist/{pull-command-UVK3IOXM.js → pull-command-KFHHW2BA.js} +24 -24
- package/dist/{release-command-MKNESNGB.js → release-command-QUKHOKIY.js} +21 -21
- package/dist/{release-ns-command-HLR46IKP.js → release-ns-command-T4R3VODA.js} +34 -34
- package/dist/{routes-manifest-file-UHVVL2YB.js → routes-manifest-file-QFPNFJMZ.js} +2 -2
- package/dist/scaffold.js +2 -2
- package/dist/{secrets-file-HST7BMQC.js → secrets-file-J4KFYNFP.js} +6 -6
- package/dist/{secrets-fill-command-FQJ4QFBP.js → secrets-fill-command-YIU6ESFN.js} +18 -18
- package/dist/{source-resolve-LNRUITLS.js → source-resolve-WHXNMVJT.js} +3 -3
- package/dist/{status-command-S5CBG2SW.js → status-command-DIDOS3JC.js} +13 -13
- package/dist/{store-CuD1k4kV.d.ts → store-xUySg-KR.d.ts} +1 -1
- package/dist/{sync-contributions-O5ZRM2JN.js → sync-contributions-VAGROOWY.js} +2 -2
- package/dist/{tables-command-7KI2KZOS.js → tables-command-UJLYYMME.js} +11 -11
- package/dist/{tenant-command-MQTLNETR.js → tenant-command-NGKJD3AX.js} +35 -35
- package/dist/{test-command-NLYMAAPD.js → test-command-JOPQCHJA.js} +11 -11
- package/dist/{token-3IPTVEEW.js → token-NJ5XPGGM.js} +2 -2
- package/dist/{toolchain-modules-K46KYJ4G.js → toolchain-modules-4KS3SSJW.js} +2 -2
- package/dist/{tracked-backend-FQFXTTYZ.js → tracked-backend-3U4T6ZA7.js} +10 -10
- package/dist/{update-check-FHRRUDEC.js → update-check-5KCA4TE6.js} +17 -17
- package/dist/{upgrade-command-WNBPKUXN.js → upgrade-command-MNP6G752.js} +20 -20
- package/dist/{whoami-command-DPGDK35H.js → whoami-command-E5CSF3E6.js} +4 -4
- package/dist/{workspace-2GMONZ2A.js → workspace-WZMBLK4P.js} +2 -2
- package/dist/{workspace-binding-PAUOIK3V.js → workspace-binding-JT4EK4HU.js} +3 -3
- package/dist/{workspace-command-KEKL27Y4.js → workspace-command-Z7BUA6A5.js} +30 -30
- package/dist/{workspace-env-GGEZVZDY.js → workspace-env-KFWW2G7G.js} +6 -6
- package/dist/{xanosdk-import-HYHABD5U.js → xanosdk-import-FUS3ZGGQ.js} +2 -2
- package/dist/{xanosdk-project-2T56DRYS.js → xanosdk-project-NM2J5YFK.js} +6 -6
- package/guides/cli.md +8 -7
- package/guides/deploying.md +11 -8
- package/llms/kinds-agent-mcp.md +3 -2
- package/llms/object-kinds.md +14 -0
- package/llms-full.txt +25 -9
- package/llms.txt +8 -7
- package/manifest.json +1 -1
- package/package.json +2 -2
- package/skills/xano-backend/SKILL.md +2 -2
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
} from "./chunk-R4NOZBOY.js";
|
|
5
5
|
import {
|
|
6
6
|
fetchWorkspaceBundle
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-BYYVOX2P.js";
|
|
8
|
+
import "./chunk-DW47JVXI.js";
|
|
9
|
+
import "./chunk-KSGITXNE.js";
|
|
10
10
|
import "./chunk-QTMXJQZN.js";
|
|
11
11
|
import "./chunk-O376UAZS.js";
|
|
12
12
|
import "./chunk-6YOH2L3G.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-5DLDRUCQ.js";
|
|
14
14
|
import {
|
|
15
15
|
confirm
|
|
16
16
|
} from "./chunk-HQPL34O6.js";
|
|
@@ -29,38 +29,38 @@ import {
|
|
|
29
29
|
reachableWorkspaces,
|
|
30
30
|
refuseUnreachableWorkspace,
|
|
31
31
|
unreachableWorkspaceMessage
|
|
32
|
-
} from "./chunk-
|
|
33
|
-
import "./chunk-
|
|
32
|
+
} from "./chunk-ECGRCTVI.js";
|
|
33
|
+
import "./chunk-3TWQDGQY.js";
|
|
34
34
|
import "./chunk-OBJ7FQDX.js";
|
|
35
35
|
import "./chunk-2TFRR6JV.js";
|
|
36
36
|
import {
|
|
37
37
|
resolveOutputTarget,
|
|
38
38
|
secretsPhrase,
|
|
39
39
|
writeExportFile
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-IW6E3LES.js";
|
|
41
41
|
import {
|
|
42
42
|
secretsCarriedBy
|
|
43
43
|
} from "./chunk-I53OTC3O.js";
|
|
44
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-IIAF7VKN.js";
|
|
45
45
|
import {
|
|
46
46
|
assertBundleFile,
|
|
47
47
|
assertBundleInput,
|
|
48
48
|
assertEntryFile,
|
|
49
49
|
assertValueFiles,
|
|
50
50
|
loadBundleText
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-45A3AF2B.js";
|
|
52
52
|
import "./chunk-XQO4A4Q4.js";
|
|
53
|
-
import "./chunk-
|
|
54
|
-
import "./chunk-
|
|
53
|
+
import "./chunk-XUSL2Z5C.js";
|
|
54
|
+
import "./chunk-JE7BL5IF.js";
|
|
55
55
|
import "./chunk-PBK257CI.js";
|
|
56
|
-
import "./chunk-
|
|
56
|
+
import "./chunk-HU6D6PYT.js";
|
|
57
57
|
import "./chunk-7JKNWDYN.js";
|
|
58
|
-
import "./chunk-
|
|
58
|
+
import "./chunk-NIANORYB.js";
|
|
59
59
|
import "./chunk-VJTTTIIB.js";
|
|
60
60
|
import {
|
|
61
61
|
getAccessToken
|
|
62
|
-
} from "./chunk-
|
|
63
|
-
import "./chunk-
|
|
62
|
+
} from "./chunk-CTKBGPM6.js";
|
|
63
|
+
import "./chunk-2ND7WS3E.js";
|
|
64
64
|
import "./chunk-5Y5HWQ2P.js";
|
|
65
65
|
import "./chunk-F3IA3YWI.js";
|
|
66
66
|
import "./chunk-LCOCRJ4K.js";
|
|
@@ -69,9 +69,9 @@ import "./chunk-YE7MHW45.js";
|
|
|
69
69
|
import "./chunk-2MNLRIOX.js";
|
|
70
70
|
import "./chunk-PFW7WFAT.js";
|
|
71
71
|
import "./chunk-CJDPSCMX.js";
|
|
72
|
-
import "./chunk-
|
|
72
|
+
import "./chunk-GDAWYDHY.js";
|
|
73
73
|
import "./chunk-VD7YTLWL.js";
|
|
74
|
-
import "./chunk-
|
|
74
|
+
import "./chunk-FZGK4VM5.js";
|
|
75
75
|
import "./chunk-S42TFTM5.js";
|
|
76
76
|
import "./chunk-ZYJP6BOO.js";
|
|
77
77
|
import "./chunk-QO6BVGS5.js";
|
|
@@ -86,9 +86,9 @@ import {
|
|
|
86
86
|
} from "./chunk-6S263KTM.js";
|
|
87
87
|
import "./chunk-IB6SKACE.js";
|
|
88
88
|
import "./chunk-EUUUMY7J.js";
|
|
89
|
-
import "./chunk-
|
|
90
|
-
import "./chunk-
|
|
91
|
-
import "./chunk-
|
|
89
|
+
import "./chunk-77IFWJ53.js";
|
|
90
|
+
import "./chunk-JSPFDMTV.js";
|
|
91
|
+
import "./chunk-U4JD5NMP.js";
|
|
92
92
|
import "./chunk-B3NH5UBI.js";
|
|
93
93
|
import "./chunk-ZFDZKNGG.js";
|
|
94
94
|
import "./chunk-FWD7AL6N.js";
|
|
@@ -118,8 +118,8 @@ import {
|
|
|
118
118
|
} from "./chunk-4GPIOIAC.js";
|
|
119
119
|
import "./chunk-EKTIGGFO.js";
|
|
120
120
|
import "./chunk-E763QI3G.js";
|
|
121
|
-
import "./chunk-
|
|
122
|
-
import "./chunk-
|
|
121
|
+
import "./chunk-C2SAVXAB.js";
|
|
122
|
+
import "./chunk-IZI3SYXH.js";
|
|
123
123
|
import "./chunk-LJM5CIY4.js";
|
|
124
124
|
import "./chunk-7THDHQ4R.js";
|
|
125
125
|
import "./chunk-3YW23UFH.js";
|
|
@@ -144,7 +144,7 @@ import {
|
|
|
144
144
|
writeJson,
|
|
145
145
|
writeTargetPayload
|
|
146
146
|
} from "./chunk-C6KBZH7M.js";
|
|
147
|
-
import "./chunk-
|
|
147
|
+
import "./chunk-T3ZVNOJC.js";
|
|
148
148
|
import "./chunk-OHTHG3LL.js";
|
|
149
149
|
import "./chunk-6JAEMMZ7.js";
|
|
150
150
|
import "./chunk-6ZFJEJXZ.js";
|
|
@@ -203,7 +203,7 @@ async function runWorkspaceCommand(args) {
|
|
|
203
203
|
case "reset-tables":
|
|
204
204
|
return runResetTables(args);
|
|
205
205
|
case "branch": {
|
|
206
|
-
const { runBranchCommand } = await import("./branch-commands-
|
|
206
|
+
const { runBranchCommand } = await import("./branch-commands-IJ7SK5AM.js");
|
|
207
207
|
return runBranchCommand(args);
|
|
208
208
|
}
|
|
209
209
|
default:
|
|
@@ -232,7 +232,7 @@ async function runDetails(args) {
|
|
|
232
232
|
const auth = await getAccessToken(args);
|
|
233
233
|
const workspaceId = auth.workspaceId;
|
|
234
234
|
const all = await fetchWorkspaces(auth).catch(async (err) => {
|
|
235
|
-
const { unansweredRead } = await import("./source-resolve-
|
|
235
|
+
const { unansweredRead } = await import("./source-resolve-WHXNMVJT.js");
|
|
236
236
|
throw unansweredRead(err, "read the workspace list", "workspace");
|
|
237
237
|
});
|
|
238
238
|
const match = all.find((w) => w.id === workspaceId);
|
|
@@ -292,7 +292,7 @@ async function runExport(args) {
|
|
|
292
292
|
var EXIT_DIFF_MISMATCH = 2;
|
|
293
293
|
async function runDiff(args) {
|
|
294
294
|
if (args.file === void 0 && args.bundle === void 0) {
|
|
295
|
-
const { resolveProjectEntry } = await import("./deploy-source-
|
|
295
|
+
const { resolveProjectEntry } = await import("./deploy-source-ITSAHJW7.js");
|
|
296
296
|
const entry = resolveProjectEntry(process.cwd());
|
|
297
297
|
if (entry !== void 0) args = { ...args, file: entry };
|
|
298
298
|
}
|
|
@@ -305,11 +305,11 @@ async function runDiff(args) {
|
|
|
305
305
|
try {
|
|
306
306
|
live = await fetchWorkspaceBundle(auth, args.branch);
|
|
307
307
|
} catch (err) {
|
|
308
|
-
const { unansweredRead } = await import("./source-resolve-
|
|
308
|
+
const { unansweredRead } = await import("./source-resolve-WHXNMVJT.js");
|
|
309
309
|
throw unansweredRead(err, "read the workspace to compare", "workspace");
|
|
310
310
|
}
|
|
311
311
|
const { SETTINGS_LABEL } = await import("./live-diff-CGTGOH3S.js");
|
|
312
|
-
const { codePinnedCanonicals, releaseCanonicalLock } = await import("./release-command-
|
|
312
|
+
const { codePinnedCanonicals, releaseCanonicalLock } = await import("./release-command-QUKHOKIY.js");
|
|
313
313
|
const pinned = codePinnedCanonicals(local.bundle, releaseCanonicalLock(args), args.file !== void 0);
|
|
314
314
|
const listed = await listBranches(auth, { baseUrl: auth.instance, workspaceId: auth.workspaceId }).catch(
|
|
315
315
|
() => void 0
|
|
@@ -317,7 +317,7 @@ async function runDiff(args) {
|
|
|
317
317
|
const liveLabel = listed?.find((b) => b.live)?.label;
|
|
318
318
|
const comparedLabel = args.branch ?? liveLabel;
|
|
319
319
|
const comparedIsLive = args.branch === void 0 ? true : liveLabel === void 0 ? null : args.branch === liveLabel;
|
|
320
|
-
const { landingLockPath } = await import("./landing-record-
|
|
320
|
+
const { landingLockPath } = await import("./landing-record-ZB4OJQF2.js");
|
|
321
321
|
const { readSyncBaseline, storedBranchLabel } = await import("./sync-record-U65BCPSP.js");
|
|
322
322
|
const { directedComparison } = await import("./sync-baseline-3CDL4PKT.js");
|
|
323
323
|
const syncLabel = storedBranchLabel(listed, args.branch);
|
|
@@ -560,4 +560,4 @@ export {
|
|
|
560
560
|
EXIT_DIFF_MISMATCH,
|
|
561
561
|
runWorkspaceCommand
|
|
562
562
|
};
|
|
563
|
-
//# sourceMappingURL=workspace-command-
|
|
563
|
+
//# sourceMappingURL=workspace-command-Z7BUA6A5.js.map
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
renderWorkspaceEnvFile,
|
|
15
15
|
valueProblem,
|
|
16
16
|
workspaceEnvPathIn
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-XUSL2Z5C.js";
|
|
18
|
+
import "./chunk-77IFWJ53.js";
|
|
19
|
+
import "./chunk-JSPFDMTV.js";
|
|
20
|
+
import "./chunk-U4JD5NMP.js";
|
|
21
21
|
import "./chunk-B3NH5UBI.js";
|
|
22
22
|
import "./chunk-ZFDZKNGG.js";
|
|
23
23
|
import "./chunk-FWD7AL6N.js";
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
} from "./chunk-HU7F56VF.js";
|
|
35
35
|
import "./chunk-MF4W6FHU.js";
|
|
36
36
|
import "./chunk-X2NL4KUO.js";
|
|
37
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-IZI3SYXH.js";
|
|
38
38
|
import "./chunk-LJM5CIY4.js";
|
|
39
39
|
import "./chunk-C6KBZH7M.js";
|
|
40
40
|
import {
|
|
@@ -68,4 +68,4 @@ export {
|
|
|
68
68
|
valueProblem,
|
|
69
69
|
workspaceEnvPathIn
|
|
70
70
|
};
|
|
71
|
-
//# sourceMappingURL=workspace-env-
|
|
71
|
+
//# sourceMappingURL=workspace-env-KFWW2G7G.js.map
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
resetXanoSdkImportDetection,
|
|
14
14
|
withDefaultBranchPointer,
|
|
15
15
|
xanosdkImport
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-FDZ2ANSS.js";
|
|
17
17
|
import "./chunk-3DRXWLJ5.js";
|
|
18
18
|
import "./chunk-X4DVXBFY.js";
|
|
19
19
|
import "./chunk-VJTTTIIB.js";
|
|
@@ -53,4 +53,4 @@ export {
|
|
|
53
53
|
withDefaultBranchPointer,
|
|
54
54
|
xanosdkImport
|
|
55
55
|
};
|
|
56
|
-
//# sourceMappingURL=xanosdk-import-
|
|
56
|
+
//# sourceMappingURL=xanosdk-import-FUS3ZGGQ.js.map
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
enterProjectRoot,
|
|
4
4
|
isProjectDir,
|
|
5
5
|
projectDirFrom
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NIANORYB.js";
|
|
7
7
|
import "./chunk-EUUUMY7J.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-77IFWJ53.js";
|
|
9
|
+
import "./chunk-JSPFDMTV.js";
|
|
10
|
+
import "./chunk-U4JD5NMP.js";
|
|
11
11
|
import "./chunk-B3NH5UBI.js";
|
|
12
12
|
import "./chunk-ZFDZKNGG.js";
|
|
13
13
|
import "./chunk-FWD7AL6N.js";
|
|
@@ -23,7 +23,7 @@ import "./chunk-LLNZGEFK.js";
|
|
|
23
23
|
import "./chunk-HU7F56VF.js";
|
|
24
24
|
import "./chunk-MF4W6FHU.js";
|
|
25
25
|
import "./chunk-X2NL4KUO.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-IZI3SYXH.js";
|
|
27
27
|
import "./chunk-LJM5CIY4.js";
|
|
28
28
|
import "./chunk-C6KBZH7M.js";
|
|
29
29
|
import "./chunk-YEH5OIPF.js";
|
|
@@ -39,4 +39,4 @@ export {
|
|
|
39
39
|
isProjectDir,
|
|
40
40
|
projectDirFrom
|
|
41
41
|
};
|
|
42
|
-
//# sourceMappingURL=xanosdk-project-
|
|
42
|
+
//# sourceMappingURL=xanosdk-project-NM2J5YFK.js.map
|
package/guides/cli.md
CHANGED
|
@@ -83,7 +83,7 @@ xanosdk test run-all --kind unit # only one family (unit|workflow; de
|
|
|
83
83
|
xanosdk test run-all --concurrency 4 # run 4 at once (default: 1); tests share the backend's database, so only when yours don't share state
|
|
84
84
|
xanosdk impersonate # open what this project last deployed to in the builder (--guest = read-only; --url-only prints the URL; the URL is a session — treat it as a credential)
|
|
85
85
|
xanosdk impersonate ephemeral:<tenant> # …or name one: local[:<name>] or tenant:<name> (open your workspace from the Xano dashboard)
|
|
86
|
-
xanosdk deploy ./xano/index.ts --test
|
|
86
|
+
xanosdk deploy ./xano/index.ts --ephemeral --test # THE RELEASE FLOW, step 1: stand it up on an ephemeral and run its tests (a bare deploy goes to the Xano Engine, which release create cannot cut from)
|
|
87
87
|
xanosdk release create v1 # …2: cut a release from the ephemeral this project last deployed to (after a local deploy: --from ephemeral)
|
|
88
88
|
xanosdk release create v1 --from ephemeral:e4f2-9ab1 --description "what shipped" # …from a named source
|
|
89
89
|
xanosdk release create v1 --from workspace --branch staging # …or from a branch of your workspace (default: what it serves)
|
|
@@ -180,14 +180,15 @@ workspace or a tenant, so a bare command cannot reach something real unasked. Wi
|
|
|
180
180
|
it falls back to the ephemeral recorded under your current credential, then to the engine
|
|
181
181
|
recorded for this directory, and otherwise refuses naming the flag, `xanosdk deploy` and
|
|
182
182
|
`xanosdk deploy --local`.
|
|
183
|
-
`deploy` is the exception: bare, it compiles the project and stands it up on
|
|
184
|
-
unless `--
|
|
185
|
-
reading it. `generate` and `init --from` need a backend named.
|
|
183
|
+
`deploy` is the exception: bare, it compiles the project and stands it up on the Xano Engine
|
|
184
|
+
on this machine unless `--ephemeral` or `--to` says otherwise, so it writes that record rather
|
|
185
|
+
than reading it. `generate` and `init --from` need a backend named.
|
|
186
186
|
|
|
187
187
|
A command that cannot serve a backend refuses it, whether you typed it or it came from the
|
|
188
|
-
record, with the reason and the spellings it does take: `
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
record, with the reason and the spellings it does take: `release create` refuses a Xano Engine
|
|
189
|
+
(the cut runs on the instance — pass `--from ephemeral`). `publish` is not one of them: it
|
|
190
|
+
reaches a Xano Engine (`publish --to local`, or bare after a local deploy) and puts the build on
|
|
191
|
+
the engine's own static host. A write to your workspace or a tenant confirms first,
|
|
191
192
|
or needs `--yes` off a terminal; an ephemeral or Xano Engine never asks.
|
|
192
193
|
|
|
193
194
|
## Bundle key names vs. the names everything else uses
|
package/guides/deploying.md
CHANGED
|
@@ -175,7 +175,8 @@ what ran, then `xanosdk promote <release>` lands it there as a new branch, leavi
|
|
|
175
175
|
untouched until you say otherwise.
|
|
176
176
|
|
|
177
177
|
**Static host** — `deploy --static <dir>` archives a directory and deploys it to a
|
|
178
|
-
static host after the backend import. The frontend lands **on the
|
|
178
|
+
static host after the backend import. The frontend lands **on the environment the backend just
|
|
179
|
+
went to** — the ephemeral itself, or the Xano Engine (see *A frontend on the Xano Engine, and server rendering*) — so the
|
|
179
180
|
backend and the frontend live in one environment. The CLI uploads the archive to
|
|
180
181
|
`/api:meta/workspace/{id}/static_host/default/build` with your ordinary bearer. That route
|
|
181
182
|
auto-creates the `default` host (and only that one: a `--static-host` naming a host the target
|
|
@@ -294,7 +295,7 @@ as three environment variables** — the `type: "token"` record above, with no f
|
|
|
294
295
|
XANO_INSTANCE_URL=https://your-instance.xano.io \
|
|
295
296
|
XANO_WORKSPACE_ID=3 \
|
|
296
297
|
XANO_META_TOKEN=your-meta-api-token \
|
|
297
|
-
npx xanosdk deploy ./xano/index.ts
|
|
298
|
+
npx xanosdk deploy ./xano/index.ts --ephemeral
|
|
298
299
|
```
|
|
299
300
|
|
|
300
301
|
Nothing is read from or written to disk, and nothing rotates, so the same three secrets keep
|
|
@@ -610,8 +611,10 @@ with `--to` (`--seed`, `--prune`, `--dry-run`, …) stay refused alongside it.
|
|
|
610
611
|
|
|
611
612
|
### Deploying locally
|
|
612
613
|
|
|
613
|
-
`xanosdk deploy
|
|
614
|
-
|
|
614
|
+
A bare `xanosdk deploy` deploys to an engine running on this machine — no network round-trip
|
|
615
|
+
per deploy. `--local` is that default spelled out, needed only to name an engine:
|
|
616
|
+
`--local=<version|url|path>` runs that one instead of the pinned version. It needs nothing
|
|
617
|
+
configured:
|
|
615
618
|
|
|
616
619
|
- **The first run** resolves the latest published engine for this machine's platform,
|
|
617
620
|
downloads it, checks it against the sha256 its release recorded, and **pins** that version in
|
|
@@ -1019,7 +1022,7 @@ instead, so stdout is never empty. Branch on `code`, not on the message:
|
|
|
1019
1022
|
|
|
1020
1023
|
A piped stdout gets the document too, without `--json`, so a script reading the pipe never gets
|
|
1021
1024
|
an empty stdout. The exception is a command whose stdout is the data itself (`export` to stdout,
|
|
1022
|
-
`
|
|
1025
|
+
`completion`, `--help`): a failure appended to it would corrupt it, so those write one
|
|
1023
1026
|
only under `--json`. A piped `release` or `promote` write prints its operation result (above)
|
|
1024
1027
|
either way.
|
|
1025
1028
|
|
|
@@ -1127,7 +1130,7 @@ or on a second destination, nothing for a tenant to be pointed at, and no record
|
|
|
1127
1130
|
build *was* beyond the commit you built it from. Prefer the release flow for anything you may
|
|
1128
1131
|
need to repeat.
|
|
1129
1132
|
|
|
1130
|
-
The flags that describe the
|
|
1133
|
+
The flags that describe the environment a plain deploy replaces — `--name`, `--expires-hours`,
|
|
1131
1134
|
`--reset`, `--keep-data`, `--test` (with `--kind`/`--concurrency`), `--no-dev-env`,
|
|
1132
1135
|
`--require-microservices`, `--open` — are refused beside `--to`, before sign-in. `--static`
|
|
1133
1136
|
publishes beside the merge, but not under `--dry-run`; `--skip-liveness` needs `--static` there.
|
|
@@ -1617,10 +1620,10 @@ and `XANO_META_TOKEN`, [above](#signing-in--deploying-in-depth) — no browser,
|
|
|
1617
1620
|
nothing that rotates:
|
|
1618
1621
|
|
|
1619
1622
|
```bash
|
|
1620
|
-
XANO_INSTANCE_URL=… XANO_WORKSPACE_ID=… XANO_META_TOKEN=… npx xanosdk deploy ./xano/index.ts
|
|
1623
|
+
XANO_INSTANCE_URL=… XANO_WORKSPACE_ID=… XANO_META_TOKEN=… npx xanosdk deploy ./xano/index.ts --ephemeral
|
|
1621
1624
|
```
|
|
1622
1625
|
|
|
1623
1626
|
> ⚠️ A deploy without `--keep-data` is a full replace of the target environment, including
|
|
1624
|
-
> its table records, before importing. The blast radius is your own disposable ephemeral — but anything
|
|
1627
|
+
> its table records, before importing. The blast radius is your own Xano Engine or disposable ephemeral — but anything
|
|
1625
1628
|
> you only ever created by hand in it (or any data it accumulated) is gone. That's exactly
|
|
1626
1629
|
> why a real workspace or tenant is reached only by naming it, with `deploy --to`.
|
package/llms/kinds-agent-mcp.md
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
# Agent and MCP def shapes
|
|
2
2
|
|
|
3
|
-
> Read when
|
|
3
|
+
> Read when building an MCP server (tools, prompts, resources) or an `agent()`.
|
|
4
4
|
|
|
5
|
+
- An MCP server serves THREE primitives, and each reaches the client differently: a `tool()` is an action the MODEL calls (it may write); a `resource()` is read-only context the client APPLICATION lists and attaches by `uri` (reference docs, a schema, one record through a `{variable}` template); a `prompt()` is a message template with arguments the USER picks by name. Context a session opens with is a `resource()`; a workflow a user starts by name is a `prompt()`; data the model must fetch on its own mid-task stays a `tool()`, since a client shows the model only the resources attached to the conversation. Register each kind (`registerTools`/`registerPrompts`/`registerResources`) and list it on the server.
|
|
5
6
|
- `mcpServer({ name, guid?, description?, instructions?, docs?, enabled?, canonical?, spec?, tags?, history?, tools?, prompts?, resources?, oauth?, llm?, output? })` — an MCP toolset. `llm?`/`output?` are the same blocks `agent()` takes and are usually absent: an MCP server and an agent are ONE stored object distinguished by `type`. Returns a handle with `getPath()`/`getUrl(baseUrl)` for the Streamable-HTTP endpoint — `getUrl` is NOT idempotent, a `baseUrl` already carrying an `/x2/mcp/<…>/stream` path THROWS, so resolve ONCE from the instance base URL. Fires on an ephemeral. A TENANT rides AFTER the prefix (`/x2/mcp/tenant/<tenant>/<canonical>/<token>/stream`), not as a base-URL segment: `getUrl` LIFTS a `/tenant/<name>` out of the base and re-places it there, so `getUrl(window.XANO_HOST)` is correct as-is; concatenating them by hand builds an unregistered route that 404s. Pass `{ tenant }` when the base URL cannot name it (a tenant on its own domain).
|
|
6
7
|
- `tools?`: a `ToolsetToolEntry[]`. Pass the `tool()` HANDLES directly (`tools: [saveNote]`); use the `{ tool, enabled?, auth?, type?, resourceUri?, toolMeta? }` wrapper when an entry needs more. `type: "resource"` (+ a required `resourceUri`) is the LEGACY way to publish a tool as an MCP resource — author a `resource()` and list it in `resources` instead; `toolMeta` is extra metadata on a tool entry. The two payload fields are per-type and supplying the other one is refused, because the engine stores it against neither. `auth` names an auth **table** (a `table({ auth: true })` handle or its name) — per-tool, and the only gate there is. ⚠ It is also what gives the tool a CALLER, on an `agent()` exactly as on an MCP server. `auth()` inside a tool whose entry names no table does NOT return null: the call answers a normal result carrying `{"code":"ERROR_FATAL","message":""}`, so the model reads a successful tool result and reports success while nothing is written. A caller token does not rescue it — the ENTRY supplies identity. Spell it `{ tool: saveNote, auth: users }`; `export()` warns. An entry naming no tool THROWS at export; a deliberate raw `id: 0` warns and carries through.
|
|
7
8
|
- `prompts?` / `resources?`: `prompt()` / `resource()` HANDLES (or names), or a `{ prompt, enabled?, auth? }` / `{ resource, enabled?, auth? }` wrapper. `auth` names the auth table and is what gives the stack a caller: a prompt/resource reading `auth()` behind an entry with none answers every `prompts/get` / `resources/read` with `-32603 "Access Denied"` (`export()` warns `toolset.primitive-reads-auth-ungated`). Listing one target twice THROWS; two resources with one `uri` on one server fail `export()` (`mcp.resource-uri-duplicate`). MCP-server only — `agent()` takes tools only.
|
|
8
9
|
- `history?` is the server tier for its tools, prompts AND resources alike; an object's own `history` wins. The workspace tier (`workspaceConfig({ history })`) has `prompt` and `resource` keys, both default on.
|
|
9
10
|
- `oauth?`: per-server sign-in; omit and nothing changes. Union on `mode`; `authTable` (REQUIRED, auth `table()` handle or name) is whose row the signed-in user is — `auth()` on the whole server, `t.auth` in its trigger. Hosted (the platform is the authorization server): `{ mode: "hosted", authTable, loginUrl }` — clients are sent to `loginUrl` (YOUR page, which is also the consent screen) with `mcp_request`; show `s.mcp.oauth.request`, sign the user in, then your endpoint calls `s.mcp.oauth.complete` with their `decision` and the page redirects to the URL it binds. External (your IdP issues tokens): `{ mode: "external", authTable, issuer, column, audience?, audienceAck?, claim?, claimAck?, preset?, allowedClientIds? }` — token `claim` (default `sub`) matched against `column`; `preset` is `auth0|clerk|workos|entra|okta|cognito|generic`. `loginUrl`/`issuer`/`audience` take `env("NAME")` (resolved per environment).
|
|
10
11
|
- `export()` FAILS: hosted without `loginUrl` (`mcp.oauth-hosted-incomplete`); external without `issuer`/`column` (`mcp.oauth-external-incomplete`); `preset: "clerk"` without `allowedClientIds` (`mcp.oauth-preset-client-ids`); `claim` other than `sub`/`oid`/`email` without `claimAck` (`mcp.oauth-claim-unacked` — users can edit it at most providers). Unknown `mode`/`preset` THROWS; so do the dropped `consent`/`branding`/`trustedClients`.
|
|
11
|
-
- `prompt({ name, guid?, description?, docs?, title?, icons?, tags?, history?, input?, stack?, response?, responseShape?, middleware? })` — an MCP prompt; takes `registerPrompts`. `input` is the prompt's arguments (each field's `description`/`required`/enum `values` reach the client; enum values also answer completion requests). `response`: a text value is ONE user message; a list of `{ role: "user" | "assistant", content }` is sent in order: `s.set_var("m", obj({ list: [obj({ role: c.text("user"), content: ref("body") })] }))`, `response: ref("m.list")`. Without `response` or a top-level `s.return`, `prompts/get` fails.
|
|
12
|
+
- `prompt({ name, guid?, description?, docs?, title?, icons?, tags?, history?, input?, stack?, response?, responseShape?, middleware? })` — an MCP prompt; takes `registerPrompts`. `input` is the prompt's arguments (each field's `description`/`required`/enum `values` reach the client; enum values also answer completion requests). `response`: a text value is ONE user message; a list of `{ role: "user" | "assistant", content }` is sent in order, `content` a string or an MCP content block: `s.set_var("m", obj({ list: [obj({ role: c.text("user"), content: ref("body") })] }))`, `response: ref("m.list")`. Without `response` or a top-level `s.return`, `prompts/get` fails.
|
|
12
13
|
- `resource({ name, uri, guid?, description?, docs?, mimeType?, title?, icons?, annotations?, tags?, history?, input?, stack?, response?, responseShape?, middleware? })` — an MCP resource; takes `registerResources`. Clients address it by `uri`, never `name`.
|
|
13
14
|
- `uri`: a literal (`"docs://readme"`, no `input`) or an RFC 6570 LEVEL-1 template (`"orders://{region}/{order_id}"`). It must start with a scheme; each `{variable}` is letters/digits/`_`, one per brace pair, never two adjacent. `input` must be EXACTLY the template's variables, each a single `text`/`int`/`decimal`/`bool`/`enum`/`email`/`uuid` — anything else THROWS. A value that does not convert is refused before the stack runs.
|
|
14
15
|
- `response`: a string is returned as text; non-UTF-8 content (a file, binary) as a base64 blob. `mimeType?` omitted → derived from what the stack returns.
|
package/llms/object-kinds.md
CHANGED
|
@@ -4,6 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
Author with the factory, register on the Xano instance, lands under the payload key. Each line ends with a one-liner on what the primitive is.
|
|
6
6
|
|
|
7
|
+
### Choosing a kind
|
|
8
|
+
|
|
9
|
+
Choose by who or what starts the work. Each rule names the kind that fits and the one it gets mistaken for.
|
|
10
|
+
|
|
11
|
+
- **Logic other code calls** → `defineFunction`, run with `s.function.run`. A `query` is the only kind an HTTP client reaches by verb + path; a `tool` is what an `agent()` or an MCP client calls. Logic serving two callers (an endpoint AND a tool) lives in one function both call.
|
|
12
|
+
- **Work on a timer** → `task` (cron or interval). **Work a request starts but does not wait for** → `s.function.run({ fn, runtime: { mode: "async-shared" } })`, which binds a job id, not the result (collect with `s.await`). **Work that follows a row change** → `tableTrigger`: it fires on every insert/update/delete of the table, whichever stack writes it, so the same side effect placed in one endpoint's stack misses every other write path.
|
|
13
|
+
- **The same steps before or after many objects** (an auth check, a rate limit, logging) → `middleware`, attached per host (`middleware: { pre, post }` on a query, function, task, tool or API group) or to every host of a kind with `workspaceConfig({ middleware: { query, function, task, tool } })` — not a function call repeated at the top of each stack.
|
|
14
|
+
- **Related rows on returned rows** → an `addon` attached to the read through its `addon: [{ addon, as, input }]` option (`db.query`/`get`/`add`/`edit`/`patch`), merged onto each row under `as` and typed in `InferResponse` — not a second read plus a loop that stitches rows together.
|
|
15
|
+
- **AI.** An LLM running inside the backend → `agent()`, started from a stack with `s.ai.agent.run`; it has no public endpoint. An external AI client (Claude, Cursor, any MCP client) calling the backend → `mcpServer()`. Standing instructions for Xano's own builder AI → `knowledge()`; an `agent()` run never reads it. The actions either one calls → `tool()`. What an MCP server serves besides tools (`prompt()`, `resource()`) and when each fits: `llms/kinds-agent-mcp.md`.
|
|
16
|
+
- **Pushing to connected clients** → `realtimeServer` → `realtimeChannel` → `realtimeMessage` (the handler for a frame a client sends — the realtime analogue of a query). A server-side push from any stack is `s.realtime.publish`; a client polling a `query` is the substitute this replaces.
|
|
17
|
+
- **Code the typed surface cannot express** → a lambda (`s.lambda`, `fl.lambda`) for a short JavaScript body, LAST, after native filters and expressions (`llms/lambda.md`); a `microservice` for a long-running container or another language; `s.api.request` for a service that already has an HTTP API.
|
|
18
|
+
- **Tests** → `tests` on a `query`/`defineFunction`/`middleware` for that one object's input → output; a `workflowTest` for a flow across objects (`s.function.call`, `s.api.call`, `s.task.call`) asserted with `s.expect.*`.
|
|
19
|
+
- **Reacting to the platform** → `errorTrigger` (an error signature first seen, regressing, or marked fixed) and `workspaceTrigger` (branch new/merge/live). What one connection to an MCP server, agent, realtime server or channel may see or do → that object's connection trigger.
|
|
20
|
+
|
|
7
21
|
⚠ Composing a workspace from independently-authored modules: `register*` takes its defs however they arrive, but `modules.flatMap((m) => m.tables)` does NOT typecheck. `Array.prototype.flatMap` binds its element type to the FIRST element, so every later module's tables are checked against that one table's schema — the error compares two unrelated column names and mentions neither `flatMap` nor the cause. `.concat()` collapses the same way. Two spellings work: pass an array LITERAL (`registerTables([...a.tables, ...b.tables])` — spreads are fine, TypeScript infers the union across every element at once), or annotate the module array with the wide aliases `AnyTableDef` / `AnyQueryDef` / `AnyFunctionDef` / `AnyAddonDef`, exported for exactly the four def types whose generics can collapse this way. Widening the array costs nothing: the typing you need lives on the `table()`/`query()` handle you hold and pass to `s.db.*`, and is never read back off the registered array.
|
|
8
22
|
|
|
9
23
|
- function: `defineFunction` → `Xano.registerFunctions` → payload `function` — Reusable server-side logic (a custom function) callable from any stack via `s.function.run`.
|
package/llms-full.txt
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
# xanosdk v1.0.
|
|
1
|
+
# xanosdk v1.0.10
|
|
2
2
|
|
|
3
3
|
> TypeScript SDK that compiles a typed Xano workspace into the importable packageExport JSON bundle.
|
|
4
4
|
|
|
5
|
-
Xano is
|
|
6
|
-
database, HTTP
|
|
7
|
-
agents
|
|
8
|
-
TypeScript — typed def objects registered on a
|
|
9
|
-
|
|
5
|
+
Xano is one platform to build, run and govern AI-built software: one WORKSPACE
|
|
6
|
+
serves a managed PostgreSQL database, HTTP APIs, background tasks, realtime
|
|
7
|
+
websocket channels, AI agents, MCP servers, file storage and redis. This SDK
|
|
8
|
+
authors it in TypeScript — typed def objects registered on a
|
|
9
|
+
`workspace(name)` — compiled to one importable bundle by `xanosdk export
|
|
10
|
+
./xano/index.ts`, shipped live by `xanosdk deploy`.
|
|
10
11
|
|
|
11
12
|
Def modules execute at BUILD time only: `s.*` factories return data, and the engine
|
|
12
13
|
runs the compiled stack per request — statements in order, a statement's `as:`
|
|
@@ -43,7 +44,7 @@ plain file read resolves them at the version you have.
|
|
|
43
44
|
- [Toolchain modules](llms/toolchain.md): Read when `package.json` has a `"xanosdk"` block or you run `xanosdk marketplace`.
|
|
44
45
|
- [Error index](llms/errors.md): Read when a request, test, build, or pull fails with a message you did not write — the string, its cause, and where the fix is.
|
|
45
46
|
- [Saved unit tests, assertions, and mocks](llms/tests.md): Read when authoring a `workflowTest()` stack, when a query/function/middleware carries `tests`, when a statement needs a `mock`, or when running a deployed environment's tests.
|
|
46
|
-
- [Agent and MCP def shapes](llms/kinds-agent-mcp.md): Read when
|
|
47
|
+
- [Agent and MCP def shapes](llms/kinds-agent-mcp.md): Read when building an MCP server (tools, prompts, resources) or an `agent()`.
|
|
47
48
|
- [Knowledge def shape](llms/kinds-knowledge.md): Read when the workspace defines a `knowledge()` item for its AI agents.
|
|
48
49
|
- [Realtime def shapes](llms/kinds-realtime.md): Read when the workspace defines a `realtimeServer()`, `realtimeChannel()`, or `realtimeMessage()` handler.
|
|
49
50
|
- [Triggers](llms/triggers.md): Read when authoring any trigger. A trigger's `stack` is a callback rather than the plain array every other kind takes, so the shape does not carry over.
|
|
@@ -498,6 +499,20 @@ Control flow & blocks (each nests a sub-stack; block specials name it `body`):
|
|
|
498
499
|
|
|
499
500
|
Author with the factory, register on the Xano instance, lands under the payload key. Each line ends with a one-liner on what the primitive is.
|
|
500
501
|
|
|
502
|
+
### Choosing a kind
|
|
503
|
+
|
|
504
|
+
Choose by who or what starts the work. Each rule names the kind that fits and the one it gets mistaken for.
|
|
505
|
+
|
|
506
|
+
- **Logic other code calls** → `defineFunction`, run with `s.function.run`. A `query` is the only kind an HTTP client reaches by verb + path; a `tool` is what an `agent()` or an MCP client calls. Logic serving two callers (an endpoint AND a tool) lives in one function both call.
|
|
507
|
+
- **Work on a timer** → `task` (cron or interval). **Work a request starts but does not wait for** → `s.function.run({ fn, runtime: { mode: "async-shared" } })`, which binds a job id, not the result (collect with `s.await`). **Work that follows a row change** → `tableTrigger`: it fires on every insert/update/delete of the table, whichever stack writes it, so the same side effect placed in one endpoint's stack misses every other write path.
|
|
508
|
+
- **The same steps before or after many objects** (an auth check, a rate limit, logging) → `middleware`, attached per host (`middleware: { pre, post }` on a query, function, task, tool or API group) or to every host of a kind with `workspaceConfig({ middleware: { query, function, task, tool } })` — not a function call repeated at the top of each stack.
|
|
509
|
+
- **Related rows on returned rows** → an `addon` attached to the read through its `addon: [{ addon, as, input }]` option (`db.query`/`get`/`add`/`edit`/`patch`), merged onto each row under `as` and typed in `InferResponse` — not a second read plus a loop that stitches rows together.
|
|
510
|
+
- **AI.** An LLM running inside the backend → `agent()`, started from a stack with `s.ai.agent.run`; it has no public endpoint. An external AI client (Claude, Cursor, any MCP client) calling the backend → `mcpServer()`. Standing instructions for Xano's own builder AI → `knowledge()`; an `agent()` run never reads it. The actions either one calls → `tool()`. What an MCP server serves besides tools (`prompt()`, `resource()`) and when each fits: `llms/kinds-agent-mcp.md`.
|
|
511
|
+
- **Pushing to connected clients** → `realtimeServer` → `realtimeChannel` → `realtimeMessage` (the handler for a frame a client sends — the realtime analogue of a query). A server-side push from any stack is `s.realtime.publish`; a client polling a `query` is the substitute this replaces.
|
|
512
|
+
- **Code the typed surface cannot express** → a lambda (`s.lambda`, `fl.lambda`) for a short JavaScript body, LAST, after native filters and expressions (`llms/lambda.md`); a `microservice` for a long-running container or another language; `s.api.request` for a service that already has an HTTP API.
|
|
513
|
+
- **Tests** → `tests` on a `query`/`defineFunction`/`middleware` for that one object's input → output; a `workflowTest` for a flow across objects (`s.function.call`, `s.api.call`, `s.task.call`) asserted with `s.expect.*`.
|
|
514
|
+
- **Reacting to the platform** → `errorTrigger` (an error signature first seen, regressing, or marked fixed) and `workspaceTrigger` (branch new/merge/live). What one connection to an MCP server, agent, realtime server or channel may see or do → that object's connection trigger.
|
|
515
|
+
|
|
501
516
|
⚠ Composing a workspace from independently-authored modules: `register*` takes its defs however they arrive, but `modules.flatMap((m) => m.tables)` does NOT typecheck. `Array.prototype.flatMap` binds its element type to the FIRST element, so every later module's tables are checked against that one table's schema — the error compares two unrelated column names and mentions neither `flatMap` nor the cause. `.concat()` collapses the same way. Two spellings work: pass an array LITERAL (`registerTables([...a.tables, ...b.tables])` — spreads are fine, TypeScript infers the union across every element at once), or annotate the module array with the wide aliases `AnyTableDef` / `AnyQueryDef` / `AnyFunctionDef` / `AnyAddonDef`, exported for exactly the four def types whose generics can collapse this way. Widening the array costs nothing: the typing you need lives on the `table()`/`query()` handle you hold and pass to `s.db.*`, and is never read back off the registered array.
|
|
502
517
|
|
|
503
518
|
- function: `defineFunction` → `Xano.registerFunctions` → payload `function` — Reusable server-side logic (a custom function) callable from any stack via `s.function.run`.
|
|
@@ -849,15 +864,16 @@ The run is isolated in ways that make a correct test fail for reasons the failur
|
|
|
849
864
|
|
|
850
865
|
# Agent and MCP def shapes
|
|
851
866
|
|
|
852
|
-
> Read when
|
|
867
|
+
> Read when building an MCP server (tools, prompts, resources) or an `agent()`.
|
|
853
868
|
|
|
869
|
+
- An MCP server serves THREE primitives, and each reaches the client differently: a `tool()` is an action the MODEL calls (it may write); a `resource()` is read-only context the client APPLICATION lists and attaches by `uri` (reference docs, a schema, one record through a `{variable}` template); a `prompt()` is a message template with arguments the USER picks by name. Context a session opens with is a `resource()`; a workflow a user starts by name is a `prompt()`; data the model must fetch on its own mid-task stays a `tool()`, since a client shows the model only the resources attached to the conversation. Register each kind (`registerTools`/`registerPrompts`/`registerResources`) and list it on the server.
|
|
854
870
|
- `mcpServer({ name, guid?, description?, instructions?, docs?, enabled?, canonical?, spec?, tags?, history?, tools?, prompts?, resources?, oauth?, llm?, output? })` — an MCP toolset. `llm?`/`output?` are the same blocks `agent()` takes and are usually absent: an MCP server and an agent are ONE stored object distinguished by `type`. Returns a handle with `getPath()`/`getUrl(baseUrl)` for the Streamable-HTTP endpoint — `getUrl` is NOT idempotent, a `baseUrl` already carrying an `/x2/mcp/<…>/stream` path THROWS, so resolve ONCE from the instance base URL. Fires on an ephemeral. A TENANT rides AFTER the prefix (`/x2/mcp/tenant/<tenant>/<canonical>/<token>/stream`), not as a base-URL segment: `getUrl` LIFTS a `/tenant/<name>` out of the base and re-places it there, so `getUrl(window.XANO_HOST)` is correct as-is; concatenating them by hand builds an unregistered route that 404s. Pass `{ tenant }` when the base URL cannot name it (a tenant on its own domain).
|
|
855
871
|
- `tools?`: a `ToolsetToolEntry[]`. Pass the `tool()` HANDLES directly (`tools: [saveNote]`); use the `{ tool, enabled?, auth?, type?, resourceUri?, toolMeta? }` wrapper when an entry needs more. `type: "resource"` (+ a required `resourceUri`) is the LEGACY way to publish a tool as an MCP resource — author a `resource()` and list it in `resources` instead; `toolMeta` is extra metadata on a tool entry. The two payload fields are per-type and supplying the other one is refused, because the engine stores it against neither. `auth` names an auth **table** (a `table({ auth: true })` handle or its name) — per-tool, and the only gate there is. ⚠ It is also what gives the tool a CALLER, on an `agent()` exactly as on an MCP server. `auth()` inside a tool whose entry names no table does NOT return null: the call answers a normal result carrying `{"code":"ERROR_FATAL","message":""}`, so the model reads a successful tool result and reports success while nothing is written. A caller token does not rescue it — the ENTRY supplies identity. Spell it `{ tool: saveNote, auth: users }`; `export()` warns. An entry naming no tool THROWS at export; a deliberate raw `id: 0` warns and carries through.
|
|
856
872
|
- `prompts?` / `resources?`: `prompt()` / `resource()` HANDLES (or names), or a `{ prompt, enabled?, auth? }` / `{ resource, enabled?, auth? }` wrapper. `auth` names the auth table and is what gives the stack a caller: a prompt/resource reading `auth()` behind an entry with none answers every `prompts/get` / `resources/read` with `-32603 "Access Denied"` (`export()` warns `toolset.primitive-reads-auth-ungated`). Listing one target twice THROWS; two resources with one `uri` on one server fail `export()` (`mcp.resource-uri-duplicate`). MCP-server only — `agent()` takes tools only.
|
|
857
873
|
- `history?` is the server tier for its tools, prompts AND resources alike; an object's own `history` wins. The workspace tier (`workspaceConfig({ history })`) has `prompt` and `resource` keys, both default on.
|
|
858
874
|
- `oauth?`: per-server sign-in; omit and nothing changes. Union on `mode`; `authTable` (REQUIRED, auth `table()` handle or name) is whose row the signed-in user is — `auth()` on the whole server, `t.auth` in its trigger. Hosted (the platform is the authorization server): `{ mode: "hosted", authTable, loginUrl }` — clients are sent to `loginUrl` (YOUR page, which is also the consent screen) with `mcp_request`; show `s.mcp.oauth.request`, sign the user in, then your endpoint calls `s.mcp.oauth.complete` with their `decision` and the page redirects to the URL it binds. External (your IdP issues tokens): `{ mode: "external", authTable, issuer, column, audience?, audienceAck?, claim?, claimAck?, preset?, allowedClientIds? }` — token `claim` (default `sub`) matched against `column`; `preset` is `auth0|clerk|workos|entra|okta|cognito|generic`. `loginUrl`/`issuer`/`audience` take `env("NAME")` (resolved per environment).
|
|
859
875
|
- `export()` FAILS: hosted without `loginUrl` (`mcp.oauth-hosted-incomplete`); external without `issuer`/`column` (`mcp.oauth-external-incomplete`); `preset: "clerk"` without `allowedClientIds` (`mcp.oauth-preset-client-ids`); `claim` other than `sub`/`oid`/`email` without `claimAck` (`mcp.oauth-claim-unacked` — users can edit it at most providers). Unknown `mode`/`preset` THROWS; so do the dropped `consent`/`branding`/`trustedClients`.
|
|
860
|
-
- `prompt({ name, guid?, description?, docs?, title?, icons?, tags?, history?, input?, stack?, response?, responseShape?, middleware? })` — an MCP prompt; takes `registerPrompts`. `input` is the prompt's arguments (each field's `description`/`required`/enum `values` reach the client; enum values also answer completion requests). `response`: a text value is ONE user message; a list of `{ role: "user" | "assistant", content }` is sent in order: `s.set_var("m", obj({ list: [obj({ role: c.text("user"), content: ref("body") })] }))`, `response: ref("m.list")`. Without `response` or a top-level `s.return`, `prompts/get` fails.
|
|
876
|
+
- `prompt({ name, guid?, description?, docs?, title?, icons?, tags?, history?, input?, stack?, response?, responseShape?, middleware? })` — an MCP prompt; takes `registerPrompts`. `input` is the prompt's arguments (each field's `description`/`required`/enum `values` reach the client; enum values also answer completion requests). `response`: a text value is ONE user message; a list of `{ role: "user" | "assistant", content }` is sent in order, `content` a string or an MCP content block: `s.set_var("m", obj({ list: [obj({ role: c.text("user"), content: ref("body") })] }))`, `response: ref("m.list")`. Without `response` or a top-level `s.return`, `prompts/get` fails.
|
|
861
877
|
- `resource({ name, uri, guid?, description?, docs?, mimeType?, title?, icons?, annotations?, tags?, history?, input?, stack?, response?, responseShape?, middleware? })` — an MCP resource; takes `registerResources`. Clients address it by `uri`, never `name`.
|
|
862
878
|
- `uri`: a literal (`"docs://readme"`, no `input`) or an RFC 6570 LEVEL-1 template (`"orders://{region}/{order_id}"`). It must start with a scheme; each `{variable}` is letters/digits/`_`, one per brace pair, never two adjacent. `input` must be EXACTLY the template's variables, each a single `text`/`int`/`decimal`/`bool`/`enum`/`email`/`uuid` — anything else THROWS. A value that does not convert is refused before the stack runs.
|
|
863
879
|
- `response`: a string is returned as text; non-UTF-8 content (a file, binary) as a base64 blob. `mimeType?` omitted → derived from what the stack returns.
|
package/llms.txt
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
# xanosdk v1.0.
|
|
1
|
+
# xanosdk v1.0.10
|
|
2
2
|
|
|
3
3
|
> TypeScript SDK that compiles a typed Xano workspace into the importable packageExport JSON bundle.
|
|
4
4
|
|
|
5
|
-
Xano is
|
|
6
|
-
database, HTTP
|
|
7
|
-
agents
|
|
8
|
-
TypeScript — typed def objects registered on a
|
|
9
|
-
|
|
5
|
+
Xano is one platform to build, run and govern AI-built software: one WORKSPACE
|
|
6
|
+
serves a managed PostgreSQL database, HTTP APIs, background tasks, realtime
|
|
7
|
+
websocket channels, AI agents, MCP servers, file storage and redis. This SDK
|
|
8
|
+
authors it in TypeScript — typed def objects registered on a
|
|
9
|
+
`workspace(name)` — compiled to one importable bundle by `xanosdk export
|
|
10
|
+
./xano/index.ts`, shipped live by `xanosdk deploy`.
|
|
10
11
|
|
|
11
12
|
Def modules execute at BUILD time only: `s.*` factories return data, and the engine
|
|
12
13
|
runs the compiled stack per request — statements in order, a statement's `as:`
|
|
@@ -43,7 +44,7 @@ plain file read resolves them at the version you have.
|
|
|
43
44
|
- [Toolchain modules](llms/toolchain.md): Read when `package.json` has a `"xanosdk"` block or you run `xanosdk marketplace`.
|
|
44
45
|
- [Error index](llms/errors.md): Read when a request, test, build, or pull fails with a message you did not write — the string, its cause, and where the fix is.
|
|
45
46
|
- [Saved unit tests, assertions, and mocks](llms/tests.md): Read when authoring a `workflowTest()` stack, when a query/function/middleware carries `tests`, when a statement needs a `mock`, or when running a deployed environment's tests.
|
|
46
|
-
- [Agent and MCP def shapes](llms/kinds-agent-mcp.md): Read when
|
|
47
|
+
- [Agent and MCP def shapes](llms/kinds-agent-mcp.md): Read when building an MCP server (tools, prompts, resources) or an `agent()`.
|
|
47
48
|
- [Knowledge def shape](llms/kinds-knowledge.md): Read when the workspace defines a `knowledge()` item for its AI agents.
|
|
48
49
|
- [Realtime def shapes](llms/kinds-realtime.md): Read when the workspace defines a `realtimeServer()`, `realtimeChannel()`, or `realtimeMessage()` handler.
|
|
49
50
|
- [Triggers](llms/triggers.md): Read when authoring any trigger. A trigger's `stack` is a callback rather than the plain array every other kind takes, so the shape does not carry over.
|
package/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xano/sdk",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.10",
|
|
4
|
+
"description": "The official TypeScript SDK for Xano, one platform to build, run and govern AI-built software. Your coding agent writes the backend in TypeScript, you run it on the Xano Engine on your machine, then deploy it to Xano.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xanosdk",
|
|
7
7
|
"xano",
|
|
@@ -14,8 +14,8 @@ description: >-
|
|
|
14
14
|
FastAPI) unless the user asks for Xano.
|
|
15
15
|
license: MIT
|
|
16
16
|
metadata:
|
|
17
|
-
xanosdk-version: "1.0.
|
|
18
|
-
xanosdk-digest: "sha256:
|
|
17
|
+
xanosdk-version: "1.0.10"
|
|
18
|
+
xanosdk-digest: "sha256:9bd1fa955f2ee4b8f922e884435efaa2ed209c741f1578b2d3181ebff2bc5fd2"
|
|
19
19
|
---
|
|
20
20
|
|
|
21
21
|
# Xano backend
|