@xanots/sdk 0.0.3 → 0.0.5

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.
Files changed (93) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +38 -1
  3. package/dist/.build-fingerprint +1 -1
  4. package/dist/agent-file-refresh-IJ7GN2FJ.js +17 -0
  5. package/dist/bin.js +12 -153
  6. package/dist/{capture-HUV5BNTC.js → capture-7PO6SGB4.js} +2 -2
  7. package/dist/{chunk-CMZLPTGW.js → chunk-7SISR3CS.js} +2 -2
  8. package/dist/{chunk-XQ22GLYS.js → chunk-AAFBSOSD.js} +6 -6
  9. package/dist/{chunk-BT2CSEC5.js → chunk-APOR6TCV.js} +4 -4
  10. package/dist/{chunk-55VHDNW5.js → chunk-BPEEGJJA.js} +108 -3
  11. package/dist/{chunk-U3G2UW65.js → chunk-CYJ7R3AD.js} +3 -3
  12. package/dist/{agent-file-refresh-6M5M7T24.js → chunk-D6OGU2AI.js} +5 -6
  13. package/dist/chunk-ERQZFWIW.js +22 -0
  14. package/dist/{chunk-DYCLVQXW.js → chunk-F5T45NAM.js} +31 -2
  15. package/dist/{chunk-TQUO2OXY.js → chunk-FN4OQT2J.js} +4 -4
  16. package/dist/{chunk-6USV65XA.js → chunk-IVP6TS26.js} +2 -2
  17. package/dist/{chunk-HQ2CBRVI.js → chunk-KXCPZUUM.js} +10 -8
  18. package/dist/{chunk-7REDODS2.js → chunk-LLWK6H77.js} +20 -2
  19. package/dist/{chunk-HJPTWBLH.js → chunk-MFIHIS6B.js} +2 -2
  20. package/dist/{chunk-3NFUWXOC.js → chunk-MS3BRZAZ.js} +146 -45
  21. package/dist/{chunk-2V4YE6QC.js → chunk-OARSPAIE.js} +112 -21
  22. package/dist/{chunk-7DKX2SPN.js → chunk-OR43PDCW.js} +4 -4
  23. package/dist/chunk-PGBK64U5.js +59 -0
  24. package/dist/{chunk-F6JCFRKO.js → chunk-PXXLBXOP.js} +2 -2
  25. package/dist/{chunk-W2G2WPTB.js → chunk-QA5ICJ4M.js} +3 -3
  26. package/dist/{chunk-YZ4GU6F5.js → chunk-QUUB7HYK.js} +5 -838
  27. package/dist/{chunk-C56BC2FY.js → chunk-SG4UBJ47.js} +2 -2
  28. package/dist/{chunk-76QBEIGO.js → chunk-T4XPCJRF.js} +3 -2
  29. package/dist/{chunk-VTIL47DT.js → chunk-W5NOKYEG.js} +6 -2
  30. package/dist/chunk-WGDAOOXG.js +845 -0
  31. package/dist/{chunk-DGSF2Q5H.js → chunk-WJYB7DSI.js} +2 -2
  32. package/dist/{chunk-4YMD2OOZ.js → chunk-XHEXOES3.js} +1 -1
  33. package/dist/{chunk-4HT3BNZ7.js → chunk-YUBJLB6G.js} +10 -2
  34. package/dist/{chunk-5L4X5LS6.js → chunk-YUPQOLFX.js} +77 -2
  35. package/dist/chunk-ZGA5MUNC.js +173 -0
  36. package/dist/{chunk-P3TTMWUP.js → chunk-ZOYMZZ3S.js} +8 -1
  37. package/dist/chunk-ZSYZTGJH.js +81 -0
  38. package/dist/cli.d.ts +14 -1
  39. package/dist/cli.js +8 -8
  40. package/dist/codegen-command-BLOS3GR3.js +43 -0
  41. package/dist/{completion-BKAFCZBE.js → completion-GHP5RRLQ.js} +2 -2
  42. package/dist/{deploy-command-4R6BYC6G.js → deploy-command-XOH76USO.js} +27 -27
  43. package/dist/{env-target-XWS2ZZ2Y.js → env-target-POGJMD6Q.js} +7 -7
  44. package/dist/{ephemeral-command-JL4TPIRQ.js → ephemeral-command-46SL27GJ.js} +25 -25
  45. package/dist/index.d.ts +2 -2
  46. package/dist/index.js +13 -7
  47. package/dist/init-command-NCRPVFGE.js +30 -0
  48. package/dist/internal.d.ts +2 -2
  49. package/dist/internal.js +50 -5
  50. package/dist/{io-AMIKRLPC.js → io-7VIA5SON.js} +3 -3
  51. package/dist/{live-diff-RXSJCVJ7.js → live-diff-FP4SFNT4.js} +2 -2
  52. package/dist/{lock-3CVKALKT.js → lock-KXOJIGCG.js} +2 -2
  53. package/dist/{lock-commands-XOYS75YQ.js → lock-commands-6UONZW26.js} +9 -9
  54. package/dist/{login-command-ACJF6KWQ.js → login-command-SG7IWTHW.js} +140 -37
  55. package/dist/{logout-command-MX3MJS5U.js → logout-command-J2AG5NKC.js} +3 -3
  56. package/dist/{loop-SAWAOUFO.js → loop-7SAIGRCZ.js} +3 -3
  57. package/dist/{marketplace-command-UVV3XAOL.js → marketplace-command-NKTQ3VPS.js} +11 -25
  58. package/dist/meta-client-OW5WKWW7.js +1 -1
  59. package/dist/node.d.ts +2 -2
  60. package/dist/node.js +18 -12
  61. package/dist/onboard-command-EHOHKQQU.js +36 -0
  62. package/dist/{profile-command-SWJ3SPKR.js → profile-command-ZPC2DPFV.js} +6 -6
  63. package/dist/{release-command-HZUY2XZX.js → release-command-FKQ6E3TD.js} +25 -25
  64. package/dist/{sandbox-details-command-HJE5SPVG.js → sandbox-details-command-DMY2KGA2.js} +5 -5
  65. package/dist/{sandbox-export-command-QCJY4GMV.js → sandbox-export-command-R6QMEK3D.js} +8 -8
  66. package/dist/scaffold.js +4 -2
  67. package/dist/{store-g45zwB33.d.ts → store-BJONDJoZ.d.ts} +171 -2
  68. package/dist/{test-command-72Y5S22H.js → test-command-56IAEYHX.js} +11 -11
  69. package/dist/upgrade-command-M2DZ3ZPD.js +177 -0
  70. package/dist/{validate-command-KDGH537H.js → validate-command-CIBQJND7.js} +12 -12
  71. package/dist/{workspace-command-ICSI6PKO.js → workspace-command-HZS43PHJ.js} +28 -27
  72. package/dist/workspace-export-AJMGN3CQ.js +1 -1
  73. package/guides/README.md +30 -0
  74. package/guides/authoring.md +642 -0
  75. package/guides/cli.md +192 -0
  76. package/guides/codegen.md +83 -0
  77. package/guides/coverage.md +67 -0
  78. package/guides/deploying.md +358 -0
  79. package/guides/environment.md +132 -0
  80. package/guides/object-kinds.md +376 -0
  81. package/guides/project-structure.md +43 -0
  82. package/guides/scaffold.md +198 -0
  83. package/guides/typed-frontend.md +201 -0
  84. package/llms/kinds-knowledge.md +20 -0
  85. package/llms/object-kinds.md +1 -0
  86. package/llms-full.txt +25 -2
  87. package/llms.txt +3 -2
  88. package/manifest.json +31 -4
  89. package/package.json +5 -2
  90. package/dist/chunk-WUSKBXXD.js +0 -25
  91. package/dist/chunk-ZO3HJOCJ.js +0 -29
  92. package/dist/codegen-command-FIADGXRN.js +0 -42
  93. package/dist/init-command-LOK75W64.js +0 -29
@@ -1,10 +1,14 @@
1
1
  import {
2
+ loopbackRedirectUri,
2
3
  openBrowser,
3
4
  startCallbackServer
4
- } from "./chunk-VTIL47DT.js";
5
+ } from "./chunk-W5NOKYEG.js";
6
+ import {
7
+ promptLine
8
+ } from "./chunk-PGBK64U5.js";
5
9
  import {
6
10
  envMetaCredentialVarsSet
7
- } from "./chunk-C56BC2FY.js";
11
+ } from "./chunk-SG4UBJ47.js";
8
12
  import {
9
13
  CALLBACK_PATH,
10
14
  DEFAULT_PORT,
@@ -19,7 +23,11 @@ import {
19
23
  resolveAuthHost,
20
24
  resolveScope,
21
25
  writeCredential
22
- } from "./chunk-7REDODS2.js";
26
+ } from "./chunk-LLWK6H77.js";
27
+ import {
28
+ UsageError
29
+ } from "./chunk-IVP6TS26.js";
30
+ import "./chunk-GNPVYOPB.js";
23
31
  import {
24
32
  blank,
25
33
  detail,
@@ -29,24 +37,81 @@ import {
29
37
  success,
30
38
  warn
31
39
  } from "./chunk-EZG76F7R.js";
32
- import "./chunk-GNPVYOPB.js";
40
+ import "./chunk-F5T45NAM.js";
33
41
 
34
42
  // src/emit/login-command.ts
35
43
  import * as client from "openid-client";
44
+
45
+ // src/auth/paste.ts
46
+ var EXAMPLE = "Paste either the full URL from your browser's address bar (http://127.0.0.1:\u2026/oauth/callback?code=\u2026) or just the code=\u2026 value from it.";
47
+ function normalizePastedCallback(input, ctx) {
48
+ const trimmed = input.trim();
49
+ if (trimmed === "") throw new Error(`Nothing was pasted. ${EXAMPLE}`);
50
+ const params = extractParams(trimmed, ctx);
51
+ const error = params.get("error");
52
+ if (error) {
53
+ const description = params.get("error_description");
54
+ const authError = new Error(
55
+ `Authorization server returned error: ${error}${description ? ` (${description})` : ""}`
56
+ );
57
+ authError.error = error;
58
+ throw authError;
59
+ }
60
+ if (!params.get("code")) {
61
+ throw new Error(`That paste carries no \`code\` value. ${EXAMPLE}`);
62
+ }
63
+ if (!params.get("iss")) params.set("iss", ctx.issuer);
64
+ return `${ctx.redirectUri}?${params.toString()}`;
65
+ }
66
+ function extractParams(trimmed, ctx) {
67
+ const url = parseUrl(trimmed);
68
+ if (url) return url.searchParams;
69
+ const queryStart = trimmed.indexOf("?");
70
+ if (queryStart !== -1 && isRecognizedQuery(trimmed.slice(queryStart + 1))) {
71
+ return new URLSearchParams(trimmed.slice(queryStart + 1));
72
+ }
73
+ if (isRecognizedQuery(trimmed)) return new URLSearchParams(trimmed);
74
+ return new URLSearchParams({ code: trimmed, state: ctx.state, iss: ctx.issuer });
75
+ }
76
+ function isRecognizedQuery(value) {
77
+ return /(^|&)(code|error)=/.test(value);
78
+ }
79
+ function parseUrl(value) {
80
+ try {
81
+ const url = new URL(value);
82
+ return url.protocol === "http:" || url.protocol === "https:" ? url : void 0;
83
+ } catch {
84
+ return void 0;
85
+ }
86
+ }
87
+
88
+ // src/emit/login-command.ts
36
89
  async function runLoginCommand(args) {
37
90
  const authHost = resolveAuthHost(args);
38
91
  const scope = resolveScope(args);
39
92
  const port = args.port ?? DEFAULT_PORT;
40
93
  assertHttpsOrigin(authHost, "--origin");
94
+ if (args.paste && port === 0) {
95
+ throw new UsageError(
96
+ "`--port 0` asks for an ephemeral port, which --paste cannot use: nothing is bound, so the port is only part of the redirect URL's identity. Drop --port to use the default.",
97
+ { helpFor: { command: "login" } }
98
+ );
99
+ }
41
100
  if (!args.force && reportAlreadySignedIn(resolveAuthFilePath(args, "write"))) return;
101
+ if (args.paste && process.stdin.isTTY !== true) {
102
+ throw new UsageError(
103
+ "`--paste` reads the authorization code back from you, so it needs a terminal. For automation, use the XANO_REFRESH_TOKEN / XANO_CLIENT_ID environment credential instead.",
104
+ { helpFor: { command: "login" } }
105
+ );
106
+ }
42
107
  step(`Signing in to ${hostLabel(authHost)}`);
43
108
  let record;
44
109
  try {
45
- record = await attemptLogin({ authHost, scope, port });
110
+ record = await attemptLogin({ authHost, scope, port, paste: args.paste });
46
111
  } catch (err) {
47
112
  if (oauthErrorCode(err) !== "invalid_client") throw err;
48
113
  warn("The registered client was rejected \u2014 re-registering and retrying once.");
49
- record = await attemptLogin({ authHost, scope, port });
114
+ record = await attemptLogin({ authHost, scope, port, paste: args.paste, retry: true });
50
115
  }
51
116
  const authFilePath = resolveAuthFilePath(args, "write");
52
117
  writeCredential(authFilePath, record);
@@ -98,36 +163,7 @@ function reportAlreadySignedIn(authFilePath) {
98
163
  async function attemptLogin(p) {
99
164
  const verifier = client.randomPKCECodeVerifier();
100
165
  const state = client.randomState();
101
- let listener;
102
- try {
103
- listener = await startCallbackServer({ callbackPath: CALLBACK_PATH, expectedState: state, port: p.port });
104
- } catch (err) {
105
- const code = err.code;
106
- if (code === "EADDRINUSE") {
107
- throw new Error(`Loopback port ${p.port} is in use. Pass a free one with --port <n> and retry.`);
108
- }
109
- throw err;
110
- }
111
- const provider = new OpenIdProvider({ authHost: p.authHost, redirectUri: listener.redirectUri, scope: p.scope });
112
- let authorizeUrl;
113
- try {
114
- authorizeUrl = await provider.buildAuthUrl({ verifier, state });
115
- } catch (err) {
116
- listener.close();
117
- throw err;
118
- }
119
- detail("Opening your browser to authorize \u2014 waiting for you to finish\u2026");
120
- detail("If it doesn't open, paste this URL into your browser:");
121
- detail(authorizeUrl);
122
- openBrowser(authorizeUrl);
123
- let callbackUrl;
124
- try {
125
- ({ callbackUrl } = await listener.waitForCallback);
126
- } catch (err) {
127
- listener.close();
128
- if (oauthErrorCode(err) === "invalid_client") await provider.reset();
129
- throw err;
130
- }
166
+ const { callbackUrl, provider } = p.paste ? await acquireByPaste({ ...p, verifier, state }) : await acquireByLoopback({ ...p, verifier, state });
131
167
  let tokens;
132
168
  try {
133
169
  tokens = await provider.exchange(callbackUrl, { verifier, state });
@@ -161,7 +197,74 @@ async function attemptLogin(p) {
161
197
  client_id: provider.clientId()
162
198
  };
163
199
  }
200
+ var MAX_PASTE_ATTEMPTS = 3;
201
+ async function acquireByLoopback(p) {
202
+ let listener;
203
+ try {
204
+ listener = await startCallbackServer({ callbackPath: CALLBACK_PATH, expectedState: p.state, port: p.port });
205
+ } catch (err) {
206
+ const code = err.code;
207
+ if (code === "EADDRINUSE") {
208
+ throw new Error(`Loopback port ${p.port} is in use. Pass a free one with --port <n> and retry.`);
209
+ }
210
+ throw err;
211
+ }
212
+ const provider = new OpenIdProvider({ authHost: p.authHost, redirectUri: listener.redirectUri, scope: p.scope });
213
+ let authorizeUrl;
214
+ try {
215
+ authorizeUrl = await provider.buildAuthUrl({ verifier: p.verifier, state: p.state });
216
+ } catch (err) {
217
+ listener.close();
218
+ throw err;
219
+ }
220
+ detail("Opening your browser to authorize \u2014 waiting for you to finish\u2026");
221
+ detail("If it doesn't open, paste this URL into your browser:");
222
+ detail(authorizeUrl);
223
+ openBrowser(authorizeUrl);
224
+ try {
225
+ const { callbackUrl } = await listener.waitForCallback;
226
+ return { callbackUrl, provider };
227
+ } catch (err) {
228
+ listener.close();
229
+ if (oauthErrorCode(err) === "invalid_client") await provider.reset();
230
+ throw err;
231
+ }
232
+ }
233
+ async function acquireByPaste(p) {
234
+ const redirectUri = loopbackRedirectUri(p.port, CALLBACK_PATH);
235
+ const provider = new OpenIdProvider({ authHost: p.authHost, redirectUri, scope: p.scope });
236
+ const authorizeUrl = await provider.buildAuthUrl({ verifier: p.verifier, state: p.state });
237
+ blank();
238
+ if (p.retry) detail("Starting over with a freshly registered client \u2014 this is a NEW link and a NEW code.");
239
+ detail("Open this URL in any browser and finish signing in:");
240
+ detail(authorizeUrl);
241
+ blank();
242
+ detail(
243
+ `Your browser will then fail to load ${redirectUri} \u2014 that is expected, nothing is listening here. The address bar is what you want.`
244
+ );
245
+ openBrowser(authorizeUrl);
246
+ for (let attempt = 0; ; attempt++) {
247
+ const pasted = await promptLine("Paste that URL (or just the code from it):", {
248
+ noTtyHint: "--paste has to read the code from you, so it needs a terminal. For automation, use the XANO_REFRESH_TOKEN / XANO_CLIENT_ID environment credential instead.",
249
+ helpFor: { command: "login" }
250
+ });
251
+ try {
252
+ const callbackUrl = normalizePastedCallback(pasted, {
253
+ redirectUri,
254
+ state: p.state,
255
+ issuer: provider.issuer()
256
+ });
257
+ return { callbackUrl, provider };
258
+ } catch (err) {
259
+ if (oauthErrorCode(err) === "invalid_client") await provider.reset();
260
+ const unreadable = oauthErrorCode(err) === void 0;
261
+ if (!unreadable || attempt + 1 >= MAX_PASTE_ATTEMPTS) throw err;
262
+ warn(`${err instanceof Error ? err.message : String(err)}`);
263
+ detail("The link above is still valid \u2014 try pasting again.");
264
+ }
265
+ }
266
+ }
164
267
  export {
165
268
  runLoginCommand
166
269
  };
167
- //# sourceMappingURL=login-command-ACJF6KWQ.js.map
270
+ //# sourceMappingURL=login-command-SG7IWTHW.js.map
@@ -5,7 +5,8 @@ import {
5
5
  readCredential,
6
6
  resolveAuthFilePath,
7
7
  resolveScope
8
- } from "./chunk-7REDODS2.js";
8
+ } from "./chunk-LLWK6H77.js";
9
+ import "./chunk-GNPVYOPB.js";
9
10
  import {
10
11
  detail,
11
12
  hostLabel,
@@ -13,7 +14,6 @@ import {
13
14
  success,
14
15
  warn
15
16
  } from "./chunk-EZG76F7R.js";
16
- import "./chunk-GNPVYOPB.js";
17
17
 
18
18
  // src/emit/logout-command.ts
19
19
  async function runLogoutCommand(args) {
@@ -65,4 +65,4 @@ async function runLogoutCommand(args) {
65
65
  export {
66
66
  runLogoutCommand
67
67
  };
68
- //# sourceMappingURL=logout-command-MX3MJS5U.js.map
68
+ //# sourceMappingURL=logout-command-J2AG5NKC.js.map
@@ -3,10 +3,10 @@ import {
3
3
  indexByIdentity,
4
4
  kindIsRunnable,
5
5
  resolveMatch
6
- } from "./chunk-76QBEIGO.js";
6
+ } from "./chunk-T4XPCJRF.js";
7
7
  import {
8
8
  normalize
9
- } from "./chunk-P3TTMWUP.js";
9
+ } from "./chunk-ZOYMZZ3S.js";
10
10
 
11
11
  // src/validate/loop.ts
12
12
  async function runValidateLoop(client, bundleText) {
@@ -90,4 +90,4 @@ export {
90
90
  runValidateLoop,
91
91
  runnableFunctionNames
92
92
  };
93
- //# sourceMappingURL=loop-SAWAOUFO.js.map
93
+ //# sourceMappingURL=loop-7SAIGRCZ.js.map
@@ -1,10 +1,13 @@
1
+ import {
2
+ assertProjectDir
3
+ } from "./chunk-ERQZFWIW.js";
1
4
  import {
2
5
  isMachineOutput,
3
6
  writeJson
4
7
  } from "./chunk-NUQCEOKA.js";
5
8
  import {
6
9
  runNpm
7
- } from "./chunk-WUSKBXXD.js";
10
+ } from "./chunk-ZSYZTGJH.js";
8
11
  import {
9
12
  serverMessage
10
13
  } from "./chunk-3IGNIP6R.js";
@@ -12,7 +15,7 @@ import {
12
15
  UsageError,
13
16
  indentBlock,
14
17
  missingArgument
15
- } from "./chunk-6USV65XA.js";
18
+ } from "./chunk-IVP6TS26.js";
16
19
  import {
17
20
  blank,
18
21
  detail,
@@ -23,11 +26,7 @@ import {
23
26
  success,
24
27
  warn
25
28
  } from "./chunk-EZG76F7R.js";
26
- import "./chunk-DYCLVQXW.js";
27
-
28
- // src/emit/marketplace-command.ts
29
- import { existsSync, readFileSync } from "fs";
30
- import { join } from "path";
29
+ import "./chunk-F5T45NAM.js";
31
30
 
32
31
  // src/emit/marketplace-catalogue.ts
33
32
  var DEFAULT_BASE_URL = "https://xare-rvr8-mnnt.dev.xano.io";
@@ -188,22 +187,6 @@ async function fetchModule(pkg) {
188
187
  }
189
188
 
190
189
  // src/emit/marketplace-command.ts
191
- function assertProjectDir(dir) {
192
- const manifest = join(dir, "package.json");
193
- if (!existsSync(manifest)) {
194
- throw new Error(
195
- `No package.json in ${dir} \u2014 \`xanots marketplace install\` runs inside a XanoTS project.
196
- cd into your project first, or run \`xanots init\` to create one.`
197
- );
198
- }
199
- try {
200
- JSON.parse(readFileSync(manifest, "utf8"));
201
- } catch (err) {
202
- throw new Error(
203
- `${manifest} is not valid JSON, so npm cannot install into it \u2014 fix it and re-run. (${err instanceof Error ? err.message : String(err)})`
204
- );
205
- }
206
- }
207
190
  function resolvePackage(args, verb = "install") {
208
191
  const pkg = args.positionals[0];
209
192
  if (pkg === void 0 || pkg === "") {
@@ -221,7 +204,10 @@ async function runMarketplaceInstallCommand(args) {
221
204
  refusePromptFlag(args, "install");
222
205
  const pkg = resolvePackage(args);
223
206
  const dir = process.cwd();
224
- assertProjectDir(dir);
207
+ assertProjectDir(dir, {
208
+ what: "`xanots marketplace install` runs inside a XanoTS project",
209
+ remedy: "cd into your project first, or run `xanots init` to create one."
210
+ });
225
211
  step(`Installing ${style.bold(pkg)}`);
226
212
  const status = runNpm(["install", pkg], dir);
227
213
  if (status !== 0) {
@@ -376,4 +362,4 @@ export {
376
362
  runMarketplaceListCommand,
377
363
  runMarketplaceSearchCommand
378
364
  };
379
- //# sourceMappingURL=marketplace-command-UVV3XAOL.js.map
365
+ //# sourceMappingURL=marketplace-command-NKTQ3VPS.js.map
@@ -11,8 +11,8 @@ import {
11
11
  decodeWorkspaceArchive,
12
12
  encodeWorkspaceArchive
13
13
  } from "./chunk-ZUTSMMAG.js";
14
- import "./chunk-3IGNIP6R.js";
15
14
  import "./chunk-X4DVXBFY.js";
15
+ import "./chunk-3IGNIP6R.js";
16
16
 
17
17
  // src/validate/meta-client.ts
18
18
  var REQUEST_TIMEOUT_MS = 6e4;
package/dist/node.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { aT as LambdaOptions, aU as CaptureValue, aV as LambdaSurface, aW as CaptureRecord, aX as LambdaBindings, F as FunctionDef, aY as Xano, h as LockFile } from './store-g45zwB33.js';
2
- export { aZ as AddonDef, a_ as AddonXdo, A as AdoptChange, a as AdoptResult, a$ as AgentDef, b0 as AgentHandle, b1 as AgentOutput, b2 as AgentSettingsXdo, b3 as AgentXdo, b4 as AmbientBindings, b5 as AnthropicLlm, b6 as ApiGroupDef, b7 as ApiGroupXdo, b8 as AuthRef, b9 as Authored, B as Bundle, b as BundlePayload, c as BundleType, ba as Capturable, bb as ChannelConversationDef, bc as ChannelDeliveryDef, bd as ChannelDeliveryGuarantee, be as ChannelPublishDef, bf as ChannelPublishWho, bg as ChannelRateLimitDef, bh as ColumnDef, bi as Comparison, bj as ContainerEnv, bk as ContainerPort, bl as ContainerResources, bm as ContainerVolume, bn as CorsConfig, bo as CorsMode, bp as DatabaseActions, bq as DatabaseInputs, br as DbEval, bs as DbEvalFilter, bt as DbWhere, bu as ErrorInputs, bv as ExceptionPolicy, bw as FieldAccessor, bx as FieldRule, by as GoogleGenAiLlm, bz as HistoryInput, bA as HttpVerb, bB as IndexDef, bC as IndexLang, bD as IndexOp, bE as IndexType, bF as IndexXdo, bG as InferRow, bH as InputDescriptor, bI as InputOptions, bJ as IteratingBindings, bK as LAMBDA_BINDINGS, bL as LAMBDA_CODE_FILTERS, bM as LAMBDA_GLOBALS, bN as LAMBDA_MODULE_GLOBALS, bO as LAMBDA_STATEMENTS, bP as LambdaBody, bQ as LlmPrompt, bR as LlmProvider, bS as LlmSettings, f as LockEntry, g as LockExportContext, M as Manifest, i as ManifestField, j as ManifestKind, k as ManifestStatement, bT as ManifestValue, bU as McpPathOptions, bV as McpServerDef, bW as McpServerHandle, bX as McpServerXdo, l as MergeResult, bY as MessageDeliverTo, bZ as MicroserviceChart, b_ as MicroserviceConfig, b$ as MicroserviceContainer, c0 as MicroserviceDef, c1 as MicroserviceDeployment, c2 as MicroserviceIngress, c3 as MicroserviceRegistryAuth, c4 as MicroserviceVolume, c5 as MicroserviceXdo, c6 as MiddlewareAttach, c7 as MiddlewareAttachEntry, c8 as MiddlewareDef, c9 as MiddlewareXdo, O as ObjectKind, ca as OpenAiLlm, m as PayloadArrayKey, cb as QueryDef, cc as QueryFilterName, cd as QueryHandle, ce as QueryResponseType, cf as QueryXdo, cg as RealtimeActions, ch as RealtimeChannelActions, ci as RealtimeChannelDef, cj as RealtimeChannelHandle, ck as RealtimeChannelRef, cl as RealtimeChannelTriggerInputs, cm as RealtimeChannelXdo, cn as RealtimeClient, co as RealtimeInputs, cp as RealtimeMessageDef, cq as RealtimeMessageXdo, cr as RealtimeServerActions, cs as RealtimeServerDef, ct as RealtimeServerHandle, cu as RealtimeServerRef, cv as RealtimeServerTriggerInputs, cw as RealtimeServerXdo, cx as RealtimeUrlOptions, R as RenameResult, cy as ResultStrategy, cz as Route, cA as RowOf, cB as ScheduleDef, cC as SchemaCols, cD as SchemaDef, cE as SearchComparison, cF as SearchGroup, cG as SearchNode, cH as SearchOp, cI as SearchParamValue, cJ as SeedFileSource, cK as SeedRow, cL as SeedSource, cM as SortDir, cN as SortDirective, S as StatementSpec, cO as TableDef, cP as TableXdo, cQ as TaskDef, cR as TaskXdo, cS as ToolDef, cT as ToolXdo, cU as ToolsetBaseDef, cV as ToolsetBaseXdo, cW as ToolsetInputs, cX as ToolsetToolEntry, cY as ToolsetToolRef, cZ as TriggerDef, c_ as TriggerObjType, c$ as TriggerXdo, d0 as ViewDef, d1 as ViewXdo, d2 as WorkflowTestDef, d3 as WorkflowTestXdo, d4 as WorkspaceActions, d5 as WorkspaceConfigDef, d6 as WorkspaceConfigXdo, d7 as WorkspaceHistoryDef, d8 as WorkspaceHistoryXdo, d9 as WorkspaceInputs, da as WorkspaceMiddlewareDef, db as WorkspaceMiddlewareXdo, dc as XanoFreeLlm, dd as addon, de as agent, df as agentTrigger, dg as and, dh as apiGroup, di as assertLambdaBody, dj as bitwiseAnd, dk as bitwiseOr, dl as bitwiseXor, dm as cmp, dn as defineFunction, dp as emit, dq as emitBundle, dr as errorTrigger, ds as expr, dt as fl, du as input, dv as mathAdd, dw as mathDiv, dx as mathMul, dy as mathSub, dz as mcpServer, dA as mcpServerTrigger, dB as microservice, dC as middleware, dD as mixed, dE as objectEntries, dF as objectKeys, dG as objectValues, dH as or, dI as query, dJ as realtimeChannel, dK as realtimeChannelTrigger, dL as realtimeMessage, dM as realtimeServer, dN as realtimeServerTrigger, dO as realtimeTrigger, dP as resetLockOverrides, dQ as seedFile, dR as seedLockOverrides, dS as table, dT as tableTrigger, dU as task, dV as textAppend, dW as textPrepend, dX as toSearchParams, dY as tool, dZ as workflowTest, d_ as workspace, d$ as workspaceConfig, e0 as workspaceTrigger } from './store-g45zwB33.js';
1
+ import { aZ as LambdaOptions, a_ as CaptureValue, a$ as LambdaSurface, b0 as CaptureRecord, b1 as LambdaBindings, F as FunctionDef, b2 as Xano, i as LockFile } from './store-BJONDJoZ.js';
2
+ export { b3 as AddonDef, b4 as AddonXdo, A as AdoptChange, a as AdoptResult, b5 as AgentDef, b6 as AgentHandle, b7 as AgentOutput, b8 as AgentSettingsXdo, b9 as AgentXdo, ba as AmbientBindings, bb as AnthropicLlm, bc as ApiGroupDef, bd as ApiGroupXdo, be as AuthRef, bf as Authored, B as Bundle, b as BundlePayload, c as BundleType, bg as Capturable, bh as ChannelConversationDef, bi as ChannelDeliveryDef, bj as ChannelDeliveryGuarantee, bk as ChannelPublishDef, bl as ChannelPublishWho, bm as ChannelRateLimitDef, bn as ColumnDef, bo as Comparison, bp as ContainerEnv, bq as ContainerPort, br as ContainerResources, bs as ContainerVolume, bt as CorsConfig, bu as CorsMode, bv as DatabaseActions, bw as DatabaseInputs, bx as DbEval, by as DbEvalFilter, bz as DbWhere, bA as ErrorInputs, bB as ExceptionPolicy, bC as FieldAccessor, bD as FieldRule, bE as GoogleGenAiLlm, bF as HistoryInput, bG as HttpVerb, bH as IndexDef, bI as IndexLang, bJ as IndexOp, bK as IndexType, bL as IndexXdo, bM as InferRow, bN as InputDescriptor, bO as InputOptions, bP as IteratingBindings, bQ as KnowledgeDef, bR as KnowledgeDirSource, bS as KnowledgeFileSource, bT as KnowledgeMode, bU as KnowledgeType, bV as LAMBDA_BINDINGS, bW as LAMBDA_CODE_FILTERS, bX as LAMBDA_GLOBALS, bY as LAMBDA_MODULE_GLOBALS, bZ as LAMBDA_STATEMENTS, b_ as LambdaBody, b$ as LlmPrompt, c0 as LlmProvider, c1 as LlmSettings, g as LockEntry, h as LockExportContext, M as Manifest, j as ManifestField, k as ManifestKind, l as ManifestStatement, c2 as ManifestValue, c3 as McpPathOptions, c4 as McpServerDef, c5 as McpServerHandle, c6 as McpServerXdo, m as MergeResult, c7 as MessageDeliverTo, c8 as MicroserviceChart, c9 as MicroserviceConfig, ca as MicroserviceContainer, cb as MicroserviceDef, cc as MicroserviceDeployment, cd as MicroserviceIngress, ce as MicroserviceRegistryAuth, cf as MicroserviceVolume, cg as MicroserviceXdo, ch as MiddlewareAttach, ci as MiddlewareAttachEntry, cj as MiddlewareDef, ck as MiddlewareXdo, O as ObjectKind, cl as OpenAiLlm, n as PayloadArrayKey, cm as QueryDef, cn as QueryFilterName, co as QueryHandle, cp as QueryResponseType, cq as QueryXdo, cr as RealtimeActions, cs as RealtimeChannelActions, ct as RealtimeChannelDef, cu as RealtimeChannelHandle, cv as RealtimeChannelRef, cw as RealtimeChannelTriggerInputs, cx as RealtimeChannelXdo, cy as RealtimeClient, cz as RealtimeInputs, cA as RealtimeMessageDef, cB as RealtimeMessageXdo, cC as RealtimeServerActions, cD as RealtimeServerDef, cE as RealtimeServerHandle, cF as RealtimeServerRef, cG as RealtimeServerTriggerInputs, cH as RealtimeServerXdo, cI as RealtimeUrlOptions, R as RenameResult, cJ as ResultStrategy, cK as Route, cL as RowOf, cM as ScheduleDef, cN as SchemaCols, cO as SchemaDef, cP as SearchComparison, cQ as SearchGroup, cR as SearchNode, cS as SearchOp, cT as SearchParamValue, cU as SeedFileSource, cV as SeedRow, cW as SeedSource, cX as SortDir, cY as SortDirective, S as StatementSpec, cZ as TableDef, c_ as TableXdo, c$ as TaskDef, d0 as TaskXdo, d1 as ToolDef, d2 as ToolXdo, d3 as ToolsetBaseDef, d4 as ToolsetBaseXdo, d5 as ToolsetInputs, d6 as ToolsetToolEntry, d7 as ToolsetToolRef, d8 as TriggerDef, d9 as TriggerObjType, da as TriggerXdo, db as ViewDef, dc as ViewXdo, dd as WorkflowTestDef, de as WorkflowTestXdo, df as WorkspaceActions, dg as WorkspaceConfigDef, dh as WorkspaceConfigXdo, di as WorkspaceHistoryDef, dj as WorkspaceHistoryXdo, dk as WorkspaceInputs, dl as WorkspaceMiddlewareDef, dm as WorkspaceMiddlewareXdo, dn as XanoFreeLlm, dp as addon, dq as agent, dr as agentTrigger, ds as and, dt as apiGroup, du as assertLambdaBody, dv as bitwiseAnd, dw as bitwiseOr, dx as bitwiseXor, dy as cmp, dz as defineFunction, dA as emit, dB as emitBundle, dC as errorTrigger, dD as expr, dE as fl, dF as input, dG as knowledge, dH as knowledgeDir, dI as knowledgeFile, dJ as mathAdd, dK as mathDiv, dL as mathMul, dM as mathSub, dN as mcpServer, dO as mcpServerTrigger, dP as microservice, dQ as middleware, dR as mixed, dS as objectEntries, dT as objectKeys, dU as objectValues, dV as or, dW as query, dX as realtimeChannel, dY as realtimeChannelTrigger, dZ as realtimeMessage, d_ as realtimeServer, d$ as realtimeServerTrigger, e0 as realtimeTrigger, e1 as resetLockOverrides, e2 as seedFile, e3 as seedLockOverrides, e4 as table, e5 as tableTrigger, e6 as task, e7 as textAppend, e8 as textPrepend, e9 as toSearchParams, ea as tool, eb as workflowTest, ec as workspace, ed as workspaceConfig, ee as workspaceTrigger } from './store-BJONDJoZ.js';
3
3
  export { ActionCallArgs, AddonCallArgs, AddonSpec, AgentRunResult, AiAgentRunArgs, AnyAddonDef, AnyFunctionDef, AnyQueryDef, AnyTableDef, ApiCallArgs, ApplyFilter, ApplyFilters, ArrayMapArgs, CloudJobArgs, CloudJobAwaitArgs, CloudJobStatusArgs, CreateAuthTokenArgs, DbAddArgs, DbAddOrEditArgs, DbAggregate, DbAggregatePaging, DbBind, DbBulkAddArgs, DbBulkDeleteArgs, DbBulkWriteArgs, DbDelArgs, DbDirectQueryArgs, DbDistinct, DbEditArgs, DbExternal, DbExternalPermissions, DbExternalQueryArgs, DbField, DbGetArgs, DbHasArgs, DbJoin, DbPaging, DbPatchArgs, DbQueryArgs, DbResponseType, DbReturnType, DbSchemaArgs, DbTransactionArgs, DbTruncateArgs, ExpectToThrowArgs, ExternalSqlEngine, ForArgs, ForeachArgs, FunctionCallArgs, FunctionRunArgs, GetRawInputArgs, HeaderMap, HttpMethod, InferInput, InferResponse, IpLookupArgs, IpLookupResult, MiddlewareCallArgs, RealtimeEventArgs, StackTupleWidened, SwitchArgs, SwitchCaseArgs, TaskCallArgs, ToolCallArgs, TriggerCallArgs, TryCatchArgs, WhileArgs, WorkflowTestCallArgs, actionCall, actionPackageCall, addonCall, aiAgentRun, apiCall, arrayMap, arrayUnion, cloudJob, cloudJobAwait, cloudJobStatus, comment, compile, conditional, createAuthToken, dbAdd, dbAddOrEdit, dbBulkAdd, dbBulkDelete, dbBulkPatch, dbBulkUpdate, dbDel, dbDirectQuery, dbEdit, dbExternalQuery, dbGet, dbHas, dbPatch, dbQuery, dbSchema, dbTransaction, dbTruncate, debugLog, die, expectToThrow, fileUrl, forLoop, foreachBreak, foreachContinue, foreachLoop, foreachRemove, functionCall, functionRun, getRawInput, group, ignored, ipLookup, middlewareCall, postProcess, realtimeEvent, returnValue, s, setVar, switchCase, switchStatement, taskCall, toolCall, triggerCall, tryCatch, updateVar, whileLoop, workflowTestCall } from './index.js';
4
4
  import { V as Value } from './response-CVAE2kMj.js';
5
5
  export { B as BrandOpts, c as BrandValue, C as CacheXdo, f as CaughtField, h as ConditionalContext, j as ConditionalElifContext, D as DecimalMethod, E as EmailMethod, k as ExprGroup, l as ExprNode, m as ExprOperand, n as ExprStatement, o as FieldAccess, p as FieldDescriptor, q as FieldMap, s as FieldOpts, u as FieldStyleType, v as FieldXdo, w as FilterXdo, x as FilteredValue, y as FromFieldMap, F as FunctionXdo, H as HistoryXdo, I as InputXdo, z as IntMethod, L as ListBoundsXdo, M as MethodArg, A as MethodOpts, G as MethodSpec, J as MethodXdo, K as MockEntry, N as MockMap, O as MockXdo, P as ObjInput, Q as ObjMember, S as ObjValue, T as ObjectRef, U as PasswordMethod, W as PersistedFunctionRow, X as RefValue, Y as RegexValue, Z as ResponseDef, _ as ResultItemXdo, $ as RowFromFieldMap, a0 as StackItemXdo, a1 as Statement, a2 as StatementAnnotations, a3 as StatementInputXdo, a4 as StatementOptions, a5 as TAGS, a6 as TEST_EXPECT_TYPES, a7 as TableRefMethod, a8 as Tag, a9 as TaggedValue, aa as TestDef, ab as TestExpect, ac as TestExpectType, ad as TestXdo, ae as TextFormat, af as TextMethod, ag as TypeBrand, ah as ValueOf, ai as VectorMethod, aj as XanoFileRef, ak as XanoGeoPosition, al as XanoGeoValue, am as annotate, an as auth, ao as c, ap as caught, aq as col, ar as env, as as expect, at as f, au as filter, av as inp, aw as obj, ax as out, ay as ref, az as resp, aA as setting, aB as statements, aC as sys, aD as test, aE as toolset, aF as withFilters } from './response-CVAE2kMj.js';
package/dist/node.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  defineFunction,
3
3
  fileUrl
4
- } from "./chunk-4YMD2OOZ.js";
4
+ } from "./chunk-XHEXOES3.js";
5
5
  import {
6
6
  TEST_EXPECT_TYPES,
7
7
  expect
8
- } from "./chunk-F6JCFRKO.js";
8
+ } from "./chunk-PXXLBXOP.js";
9
9
  import {
10
10
  addon,
11
11
  agent,
@@ -17,7 +17,7 @@ import {
17
17
  task,
18
18
  tool,
19
19
  workflowTest
20
- } from "./chunk-TQUO2OXY.js";
20
+ } from "./chunk-FN4OQT2J.js";
21
21
  import {
22
22
  actionCall,
23
23
  actionPackageCall,
@@ -100,7 +100,7 @@ import {
100
100
  workflowTestCall,
101
101
  workspaceConfig,
102
102
  workspaceTrigger
103
- } from "./chunk-U3G2UW65.js";
103
+ } from "./chunk-CYJ7R3AD.js";
104
104
  import {
105
105
  exportBundleJson,
106
106
  loadDefault,
@@ -108,19 +108,19 @@ import {
108
108
  run,
109
109
  writeArtifact,
110
110
  writeBundle
111
- } from "./chunk-3NFUWXOC.js";
112
- import "./chunk-6USV65XA.js";
111
+ } from "./chunk-MS3BRZAZ.js";
112
+ import "./chunk-IVP6TS26.js";
113
113
  import {
114
114
  readLockFile,
115
115
  writeLockFile
116
- } from "./chunk-HJPTWBLH.js";
117
- import "./chunk-EZG76F7R.js";
116
+ } from "./chunk-MFIHIS6B.js";
118
117
  import "./chunk-GNPVYOPB.js";
118
+ import "./chunk-EZG76F7R.js";
119
119
  import {
120
120
  Xano,
121
121
  workspace
122
- } from "./chunk-55VHDNW5.js";
123
- import "./chunk-DYCLVQXW.js";
122
+ } from "./chunk-BPEEGJJA.js";
123
+ import "./chunk-F5T45NAM.js";
124
124
  import {
125
125
  LAMBDA_BINDINGS,
126
126
  LAMBDA_CODE_FILTERS,
@@ -146,6 +146,9 @@ import {
146
146
  fl,
147
147
  inp,
148
148
  input,
149
+ knowledge,
150
+ knowledgeDir,
151
+ knowledgeFile,
149
152
  lam,
150
153
  lambdaValue,
151
154
  maskNonCode,
@@ -164,7 +167,7 @@ import {
164
167
  toSearchParams,
165
168
  toolset,
166
169
  withFilters
167
- } from "./chunk-5L4X5LS6.js";
170
+ } from "./chunk-YUPQOLFX.js";
168
171
  import "./chunk-WHOJWOSV.js";
169
172
  import {
170
173
  annotate,
@@ -173,7 +176,7 @@ import {
173
176
  import {
174
177
  resetLockOverrides,
175
178
  seedLockOverrides
176
- } from "./chunk-4HT3BNZ7.js";
179
+ } from "./chunk-YUBJLB6G.js";
177
180
 
178
181
  // src/values/lambda-file.ts
179
182
  import { readFileSync } from "fs";
@@ -371,6 +374,9 @@ export {
371
374
  inp,
372
375
  input,
373
376
  ipLookup,
377
+ knowledge,
378
+ knowledgeDir,
379
+ knowledgeFile,
374
380
  lam2 as lam,
375
381
  loadDefault,
376
382
  mathAdd,
@@ -0,0 +1,36 @@
1
+ import {
2
+ condenseNpmError,
3
+ npmViewVersion,
4
+ runNpm
5
+ } from "./chunk-ZSYZTGJH.js";
6
+ import {
7
+ detail,
8
+ step
9
+ } from "./chunk-EZG76F7R.js";
10
+
11
+ // src/emit/onboard-command.ts
12
+ var ONBOARD_PACKAGE = "@xanots/onboard";
13
+ function runOnboardCommand(tail) {
14
+ const resolved = npmViewVersion(ONBOARD_PACKAGE);
15
+ if (!resolved.ok) {
16
+ throw new Error(
17
+ `Could not resolve ${ONBOARD_PACKAGE} from the npm registry.
18
+
19
+ ${condenseNpmError(resolved.stderr)}
20
+
21
+ The configurator is downloaded on demand, so this step needs the registry. \`xanots init\` takes the same choices as flags instead \u2014 and \`--no-install\` skips the dependency install, which is the only other thing that reaches out.`
22
+ );
23
+ }
24
+ step(`Launching ${ONBOARD_PACKAGE} ${resolved.version}`);
25
+ detail(`It brings its own @xanots/sdk, which may differ from this one.`);
26
+ const status = runNpm(
27
+ ["exec", "-y", `${ONBOARD_PACKAGE}@latest`, "--", ...tail],
28
+ process.cwd()
29
+ );
30
+ if (status !== 0) process.exitCode = status;
31
+ }
32
+ export {
33
+ ONBOARD_PACKAGE,
34
+ runOnboardCommand
35
+ };
36
+ //# sourceMappingURL=onboard-command-EHOHKQQU.js.map
@@ -1,3 +1,7 @@
1
+ import {
2
+ getAccessToken
3
+ } from "./chunk-SG4UBJ47.js";
4
+ import "./chunk-LLWK6H77.js";
1
5
  import {
2
6
  isMachineOutput,
3
7
  writeJson
@@ -6,15 +10,11 @@ import {
6
10
  fetchOrExplain,
7
11
  httpFailure
8
12
  } from "./chunk-3IGNIP6R.js";
9
- import {
10
- getAccessToken
11
- } from "./chunk-C56BC2FY.js";
12
- import "./chunk-7REDODS2.js";
13
+ import "./chunk-GNPVYOPB.js";
13
14
  import {
14
15
  formatFields,
15
16
  stdoutStyle
16
17
  } from "./chunk-EZG76F7R.js";
17
- import "./chunk-GNPVYOPB.js";
18
18
 
19
19
  // src/emit/profile-command.ts
20
20
  var PROFILE_TIMEOUT_MS = 3e4;
@@ -74,4 +74,4 @@ export {
74
74
  fetchProfile,
75
75
  runProfileCommand
76
76
  };
77
- //# sourceMappingURL=profile-command-SWJ3SPKR.js.map
77
+ //# sourceMappingURL=profile-command-ZPC2DPFV.js.map