@xanots/sdk 0.0.9 → 0.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 +17 -0
- package/README.md +28 -21
- package/dist/.build-fingerprint +1 -1
- package/dist/{agent-file-refresh-4W37DGXS.js → agent-file-refresh-QNKN5RYD.js} +3 -3
- package/dist/bin.js +8 -7
- package/dist/{branch-commands-PBQ36L4A.js → branch-commands-2BLOC2GR.js} +13 -11
- package/dist/{capture-7PO6SGB4.js → capture-4WVJY4DQ.js} +2 -2
- package/dist/{chunk-ZOYMZZ3S.js → chunk-3INK4Y4E.js} +1 -1
- package/dist/{chunk-NDZFBZHC.js → chunk-3UABJA4X.js} +1 -1
- package/dist/{chunk-7OXFMCTX.js → chunk-5R73LFWK.js} +3 -3
- package/dist/{chunk-OW2QZEWL.js → chunk-5YCQ2QHH.js} +2 -2
- package/dist/{chunk-5YQOIFT4.js → chunk-75Z74TA7.js} +2 -2
- package/dist/{chunk-QTNO2WD6.js → chunk-7ZYW652H.js} +1 -1
- package/dist/{chunk-K3YSQDXJ.js → chunk-ACCBOMCB.js} +91 -74
- package/dist/{chunk-4PTSTDIG.js → chunk-AIZKXUNP.js} +2 -2
- package/dist/{chunk-P5C2YKAM.js → chunk-ANUDXFEX.js} +18 -27
- package/dist/chunk-CTD5ZCV6.js +28 -0
- package/dist/{chunk-5HCDZ2XN.js → chunk-DBFU47BJ.js} +2 -2
- package/dist/{chunk-OKNSR7MT.js → chunk-DIA7CT7J.js} +129 -150
- package/dist/{chunk-JQLR64UC.js → chunk-F6CYJ7TN.js} +21 -6
- package/dist/{chunk-BKDJN76G.js → chunk-FE5I6S6N.js} +1 -1
- package/dist/{chunk-L6TPHWAU.js → chunk-I7DQDJAM.js} +30 -48
- package/dist/{chunk-QIWBCS7N.js → chunk-JGCWTCA7.js} +2 -2
- package/dist/{chunk-MDXR5E5Q.js → chunk-K5IOND4K.js} +2 -2
- package/dist/{chunk-4PE4ZAB7.js → chunk-KA6G2L7U.js} +5 -5
- package/dist/{chunk-QONOJO45.js → chunk-LBYWGMOA.js} +1 -1
- package/dist/{chunk-ZZLPTHT5.js → chunk-P6TAVLOX.js} +2 -2
- package/dist/{chunk-3QW5NFZJ.js → chunk-QKM4U5UK.js} +3 -3
- package/dist/{chunk-T4XPCJRF.js → chunk-TCFIPDB3.js} +1 -1
- package/dist/{chunk-UDL46O35.js → chunk-VKSOTZK3.js} +2 -2
- package/dist/{chunk-6DHBYBTO.js → chunk-VNQM3V2C.js} +1 -2
- package/dist/{chunk-KSV7VOEX.js → chunk-W24FJHPD.js} +3 -3
- package/dist/chunk-WGPXT2G2.js +22 -0
- package/dist/{chunk-6AAT2AYQ.js → chunk-WP4OZZV4.js} +2 -2
- package/dist/{chunk-MU3O43L2.js → chunk-YBC3IKMF.js} +2 -2
- package/dist/{chunk-6Z5CNWFC.js → chunk-YYFXVYPX.js} +37 -6
- package/dist/chunk-ZQ2PKR6R.js +40 -0
- package/dist/cli.d.ts +57 -31
- package/dist/cli.js +6 -5
- package/dist/codegen-command-GB3H2KQ7.js +46 -0
- package/dist/{completion-A6BZ3XGU.js → completion-WF46272M.js} +2 -2
- package/dist/{config-NL33PN4D.js → config-476F3PT5.js} +1 -1
- package/dist/{deploy-command-5TTI4TUP.js → deploy-command-QTIVA22A.js} +67 -99
- package/dist/{ephemeral-command-7TK52YQM.js → ephemeral-command-U4AQ3TXX.js} +25 -28
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/{init-command-OVFFW4QS.js → init-command-MAXULNAD.js} +13 -10
- package/dist/{onboard-command-EHOHKQQU.js → init-web-3JNFG6GI.js} +10 -10
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +27 -36
- package/dist/{live-diff-QK4KC2FJ.js → live-diff-IXKBVG4K.js} +3 -3
- package/dist/{lock-commands-ET7NIOLH.js → lock-commands-DQ7CUMIV.js} +20 -19
- package/dist/{login-command-DFCURZLC.js → login-command-Z6CHTA57.js} +7 -7
- package/dist/{logout-command-WXVZQCAV.js → logout-command-ER6IKAYJ.js} +2 -2
- package/dist/{loop-7SAIGRCZ.js → loop-D5NPL4VH.js} +3 -3
- package/dist/{marketplace-command-BCOAAN2I.js → marketplace-command-P4IPLJ6J.js} +6 -6
- package/dist/{meta-client-57ZWVHST.js → meta-client-K2J4XH64.js} +6 -6
- package/dist/node.d.ts +2 -2
- package/dist/node.js +9 -8
- package/dist/{validate-command-SK5FPCV7.js → preflight-command-GZ2GE5RN.js} +17 -16
- package/dist/{profile-command-QJAAUZIV.js → profile-command-LJSBDV2L.js} +5 -5
- package/dist/{release-command-4EXVLYV2.js → release-command-YUBTNHVX.js} +36 -33
- package/dist/{routes-manifest-SP3ZXLMR.js → routes-manifest-PWZHDOI5.js} +2 -2
- package/dist/scaffold.js +2 -2
- package/dist/{static-host-D6KS7X45.js → static-host-3WMV7IZO.js} +1 -1
- package/dist/status-command-AL47VG7H.js +162 -0
- package/dist/{store-CUCBSYLj.d.ts → store-BG1UPZ3Z.d.ts} +5 -5
- package/dist/{test-command-2F5LKMI6.js → test-command-YAZLKLGQ.js} +45 -28
- package/dist/{upgrade-command-QL523I62.js → upgrade-command-FB5QJ363.js} +13 -12
- package/dist/{workspace-K72NP7SX.js → workspace-2COHDBM3.js} +1 -1
- package/dist/{workspace-command-HYA6JEKK.js → workspace-command-43P42FBP.js} +31 -32
- package/dist/{workspace-export-AJMGN3CQ.js → workspace-export-DURY5WYL.js} +2 -2
- package/guides/README.md +2 -2
- package/guides/cli.md +17 -19
- package/guides/codegen.md +21 -5
- package/guides/coverage.md +1 -1
- package/guides/deploying.md +31 -34
- package/guides/environment.md +4 -4
- package/guides/object-kinds.md +3 -3
- package/guides/project-structure.md +1 -1
- package/guides/scaffold.md +25 -2
- package/guides/typed-frontend.md +1 -1
- package/llms/kinds-agent-mcp.md +1 -1
- package/llms/kinds-core.md +1 -1
- package/llms/kinds-realtime.md +1 -1
- package/llms/lock.md +5 -5
- package/llms/tests.md +1 -1
- package/llms-full.txt +25 -34
- package/llms.txt +16 -25
- package/manifest.json +95 -426
- package/package.json +1 -1
- package/dist/chunk-3EYUR3TX.js +0 -100
- package/dist/chunk-JQJPFUZI.js +0 -118
- package/dist/chunk-YNZFIY4J.js +0 -78
- package/dist/codegen-command-YSCSCVT5.js +0 -43
- package/dist/env-target-4T7AT347.js +0 -16
- package/dist/sandbox-details-command-EDO56IY3.js +0 -18
- package/dist/sandbox-export-command-MO6DEZ7Z.js +0 -24
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getEphemeral,
|
|
3
|
+
isExpired
|
|
4
|
+
} from "./chunk-VNQM3V2C.js";
|
|
5
|
+
import {
|
|
6
|
+
isMachineOutput,
|
|
7
|
+
writeJson
|
|
8
|
+
} from "./chunk-NUQCEOKA.js";
|
|
9
|
+
import {
|
|
10
|
+
getEnvironment,
|
|
11
|
+
readEphemeralState
|
|
12
|
+
} from "./chunk-K5IOND4K.js";
|
|
13
|
+
import {
|
|
14
|
+
getAccessToken
|
|
15
|
+
} from "./chunk-QKM4U5UK.js";
|
|
16
|
+
import "./chunk-FE5I6S6N.js";
|
|
17
|
+
import {
|
|
18
|
+
fetchOrExplain,
|
|
19
|
+
httpFailure
|
|
20
|
+
} from "./chunk-3IGNIP6R.js";
|
|
21
|
+
import "./chunk-GNPVYOPB.js";
|
|
22
|
+
import {
|
|
23
|
+
formatExpiration,
|
|
24
|
+
formatFields,
|
|
25
|
+
stdoutStyle
|
|
26
|
+
} from "./chunk-EZG76F7R.js";
|
|
27
|
+
|
|
28
|
+
// src/emit/status-command.ts
|
|
29
|
+
var TIMEOUT_MS = 3e4;
|
|
30
|
+
function asString(v) {
|
|
31
|
+
return typeof v === "string" && v !== "" ? v : void 0;
|
|
32
|
+
}
|
|
33
|
+
async function getJson(url, auth, action) {
|
|
34
|
+
const res = await fetchOrExplain(
|
|
35
|
+
url,
|
|
36
|
+
{
|
|
37
|
+
headers: { accept: "application/json", Authorization: `Bearer ${auth.access_token}` },
|
|
38
|
+
signal: AbortSignal.timeout(TIMEOUT_MS)
|
|
39
|
+
},
|
|
40
|
+
action,
|
|
41
|
+
TIMEOUT_MS
|
|
42
|
+
);
|
|
43
|
+
const text = await res.text();
|
|
44
|
+
if (!res.ok) throw new Error(httpFailure(action, res, text));
|
|
45
|
+
try {
|
|
46
|
+
return JSON.parse(text);
|
|
47
|
+
} catch {
|
|
48
|
+
throw new Error(`${action}: could not parse the response as JSON:
|
|
49
|
+
${text.slice(0, 200)}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async function readWorkspace(auth) {
|
|
53
|
+
const list = await getJson(`${auth.instance}/api:meta/workspace`, auth, "workspace list");
|
|
54
|
+
const all = Array.isArray(list) ? list : [];
|
|
55
|
+
const match = all.find((w) => w.id === auth.workspaceId);
|
|
56
|
+
if (match === void 0) {
|
|
57
|
+
return {
|
|
58
|
+
id: auth.workspaceId,
|
|
59
|
+
name: null,
|
|
60
|
+
credential: auth.credentialType,
|
|
61
|
+
note: `this credential cannot see workspace ${auth.workspaceId} \u2014 run \`xanots workspace details\` for the ids that would work`
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
id: auth.workspaceId,
|
|
66
|
+
name: asString(match.name) ?? null,
|
|
67
|
+
credential: auth.credentialType
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
async function readEnvironment(auth, cwd) {
|
|
71
|
+
const tracked = getEnvironment(readEphemeralState(cwd), auth.workspaceId);
|
|
72
|
+
if (tracked === void 0) return null;
|
|
73
|
+
const summary = await getEphemeral(auth, { parentWorkspaceId: auth.workspaceId, name: tracked.name });
|
|
74
|
+
if (summary === null) {
|
|
75
|
+
return {
|
|
76
|
+
name: tracked.name,
|
|
77
|
+
display: tracked.display,
|
|
78
|
+
url: tracked.url,
|
|
79
|
+
state: null,
|
|
80
|
+
expiresAt: tracked.expires_at,
|
|
81
|
+
alive: false
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
name: summary.name,
|
|
86
|
+
display: summary.display,
|
|
87
|
+
url: summary.url,
|
|
88
|
+
state: summary.state ?? null,
|
|
89
|
+
expiresAt: summary.expiresAt,
|
|
90
|
+
alive: !isExpired(summary.expiresAt)
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
async function readStatus(args, cwd = process.cwd()) {
|
|
94
|
+
let auth;
|
|
95
|
+
try {
|
|
96
|
+
auth = await getAccessToken(args);
|
|
97
|
+
} catch {
|
|
98
|
+
return { signedIn: false, instance: null, user: null, workspace: null, environment: null };
|
|
99
|
+
}
|
|
100
|
+
const me = await getJson(`${auth.instance}/api:meta/auth/me`, auth, "whoami");
|
|
101
|
+
return {
|
|
102
|
+
signedIn: true,
|
|
103
|
+
instance: auth.instance,
|
|
104
|
+
user: {
|
|
105
|
+
id: typeof me.id === "number" ? me.id : void 0,
|
|
106
|
+
name: asString(me.name),
|
|
107
|
+
email: asString(me.email)
|
|
108
|
+
},
|
|
109
|
+
workspace: await readWorkspace(auth),
|
|
110
|
+
environment: await readEnvironment(auth, cwd)
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function prettyStatus(status) {
|
|
114
|
+
const s = stdoutStyle();
|
|
115
|
+
if (!status.signedIn) {
|
|
116
|
+
return `
|
|
117
|
+
${formatFields([
|
|
118
|
+
["Signed in", `${s.bold("no")} ${s.dim("\xB7 run `xanots login`")}`]
|
|
119
|
+
])}`;
|
|
120
|
+
}
|
|
121
|
+
const who = [status.user?.name, status.user?.email && `<${status.user.email}>`].filter(Boolean).join(" ");
|
|
122
|
+
const rows = [
|
|
123
|
+
["Signed in", who !== "" ? who : s.dim("(unknown user)")],
|
|
124
|
+
["Instance", s.bold(s.cyan(status.instance ?? ""))]
|
|
125
|
+
];
|
|
126
|
+
const ws = status.workspace;
|
|
127
|
+
if (ws !== null) {
|
|
128
|
+
rows.push([
|
|
129
|
+
"Workspace",
|
|
130
|
+
`${ws.id}${ws.name === null ? "" : ` \xB7 ${ws.name}`} ${s.dim(`\xB7 ${ws.credential}`)}`
|
|
131
|
+
]);
|
|
132
|
+
if (ws.note !== void 0) rows.push(["", s.dim(ws.note)]);
|
|
133
|
+
}
|
|
134
|
+
const env = status.environment;
|
|
135
|
+
if (env === null) {
|
|
136
|
+
rows.push(["Environment", s.dim("none yet \xB7 run `xanots deploy`")]);
|
|
137
|
+
} else if (!env.alive) {
|
|
138
|
+
rows.push([
|
|
139
|
+
"Environment",
|
|
140
|
+
`${env.name} ${s.dim("\xB7 gone or expired \xB7 run `xanots deploy` for a fresh one")}`
|
|
141
|
+
]);
|
|
142
|
+
} else {
|
|
143
|
+
const state = env.state === null ? "" : ` ${s.dim(`\xB7 ${env.state}`)}`;
|
|
144
|
+
rows.push(["Environment", `${env.name}${state} ${s.dim(`\xB7 expires ${formatExpiration(env.expiresAt)}`)}`]);
|
|
145
|
+
if (env.url !== void 0) rows.push(["URL", s.bold(s.cyan(env.url))]);
|
|
146
|
+
}
|
|
147
|
+
return `
|
|
148
|
+
${formatFields(rows)}`;
|
|
149
|
+
}
|
|
150
|
+
async function runStatusCommand(args) {
|
|
151
|
+
const status = await readStatus(args);
|
|
152
|
+
if (isMachineOutput(args)) {
|
|
153
|
+
writeJson(status);
|
|
154
|
+
} else {
|
|
155
|
+
process.stdout.write(prettyStatus(status));
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
export {
|
|
159
|
+
readStatus,
|
|
160
|
+
runStatusCommand
|
|
161
|
+
};
|
|
162
|
+
//# sourceMappingURL=status-command-AL47VG7H.js.map
|
|
@@ -5051,7 +5051,7 @@ type RealtimeServerHandle = RealtimeServerDef & {
|
|
|
5051
5051
|
* IN A BROWSER BUNDLE, prefer the generated manifest: importing this def for
|
|
5052
5052
|
* its `getUrl()` pulls the SDK runtime in with it (the same ~289 kB floor a
|
|
5053
5053
|
* query def costs — the factory CALLS that build the def run at module load).
|
|
5054
|
-
* `xanots
|
|
5054
|
+
* `xanots routes <entry> --emit xano/routes.gen.ts` writes the identical
|
|
5055
5055
|
* address, tenant lift included, as `socketUrl("<server>", baseUrl)` in a file
|
|
5056
5056
|
* that imports nothing.
|
|
5057
5057
|
*
|
|
@@ -5353,7 +5353,7 @@ type RealtimeChannelHandle<I extends Record<string, InputDescriptor> = Record<st
|
|
|
5353
5353
|
* channel).
|
|
5354
5354
|
*
|
|
5355
5355
|
* IN A BROWSER BUNDLE, prefer the generated manifest's `channelPath()`
|
|
5356
|
-
* (`xanots
|
|
5356
|
+
* (`xanots routes <entry> --emit`): identical output and the same
|
|
5357
5357
|
* compile-time param checking, in a file that imports no SDK runtime.
|
|
5358
5358
|
*/
|
|
5359
5359
|
getChannel: IsStaticPath<N> extends true ? (params?: Record<string, never>) => string : (params: PathParamValues<N>) => string;
|
|
@@ -7332,10 +7332,10 @@ interface ManifestCliFlag {
|
|
|
7332
7332
|
* `src/emit/commands.ts` — the same table that renders `--help` and generates the
|
|
7333
7333
|
* shell completions.
|
|
7334
7334
|
*
|
|
7335
|
-
* It used to be hand-maintained here, and it drifted: `init` and `
|
|
7335
|
+
* It used to be hand-maintained here, and it drifted: `init` and `preflight` were
|
|
7336
7336
|
* missing outright, `deploy` was short six flags, and the `--static` description
|
|
7337
|
-
* claimed the frontend
|
|
7338
|
-
*
|
|
7337
|
+
* claimed the frontend lands on the parent workspace, which it does not.
|
|
7338
|
+
* Deriving it makes that class of drift unrepresentable, which
|
|
7339
7339
|
* matters more now that `llms.txt` no longer documents the CLI — this array and
|
|
7340
7340
|
* `--help` are the only two surfaces, and they are now one source.
|
|
7341
7341
|
*/
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
resolveMetaTarget
|
|
3
|
-
} from "./chunk-YNZFIY4J.js";
|
|
4
|
-
import "./chunk-MDXR5E5Q.js";
|
|
5
|
-
import "./chunk-3EYUR3TX.js";
|
|
6
|
-
import "./chunk-NDZFBZHC.js";
|
|
7
|
-
import {
|
|
8
|
-
getAccessToken
|
|
9
|
-
} from "./chunk-3QW5NFZJ.js";
|
|
10
|
-
import "./chunk-BKDJN76G.js";
|
|
11
1
|
import {
|
|
12
2
|
isMachineOutput,
|
|
13
3
|
writeJson
|
|
14
4
|
} from "./chunk-NUQCEOKA.js";
|
|
5
|
+
import {
|
|
6
|
+
resolveMetaTarget
|
|
7
|
+
} from "./chunk-ZQ2PKR6R.js";
|
|
8
|
+
import "./chunk-K5IOND4K.js";
|
|
9
|
+
import {
|
|
10
|
+
getAccessToken
|
|
11
|
+
} from "./chunk-QKM4U5UK.js";
|
|
12
|
+
import "./chunk-FE5I6S6N.js";
|
|
15
13
|
import {
|
|
16
14
|
fetchOrExplain,
|
|
17
15
|
httpFailure,
|
|
18
16
|
serverMessage
|
|
19
17
|
} from "./chunk-3IGNIP6R.js";
|
|
20
18
|
import {
|
|
19
|
+
parseEnvSelector,
|
|
20
|
+
unknownEnv
|
|
21
|
+
} from "./chunk-CTD5ZCV6.js";
|
|
22
|
+
import {
|
|
23
|
+
UsageError,
|
|
21
24
|
unknownSubcommand
|
|
22
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-F6CYJ7TN.js";
|
|
23
26
|
import "./chunk-GNPVYOPB.js";
|
|
24
27
|
import {
|
|
25
28
|
blank,
|
|
@@ -29,7 +32,7 @@ import {
|
|
|
29
32
|
success,
|
|
30
33
|
warn
|
|
31
34
|
} from "./chunk-EZG76F7R.js";
|
|
32
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-DIA7CT7J.js";
|
|
33
36
|
|
|
34
37
|
// src/deploy/tests.ts
|
|
35
38
|
var TIMEOUT_MS = 12e4;
|
|
@@ -189,7 +192,7 @@ async function runTest(auth, target, handle) {
|
|
|
189
192
|
|
|
190
193
|
// src/emit/test-command.ts
|
|
191
194
|
var EXIT_TESTS_FAILED = 5;
|
|
192
|
-
var
|
|
195
|
+
var DEFAULT_ENV = { kind: "ephemeral" };
|
|
193
196
|
async function mapWithConcurrency(items, limit, work) {
|
|
194
197
|
const results = new Array(items.length);
|
|
195
198
|
let next = 0;
|
|
@@ -250,10 +253,22 @@ function report(args, dest, env, outcomes) {
|
|
|
250
253
|
}
|
|
251
254
|
if (summary.failed > 0) process.exitCode = EXIT_TESTS_FAILED;
|
|
252
255
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
256
|
+
function assertNoName(args) {
|
|
257
|
+
if (args.name === void 0) return;
|
|
258
|
+
throw new UsageError(
|
|
259
|
+
`\`xanots test\` takes no \`--name\` \u2014 name the environment inside \`--env\` instead: \`--env ephemeral:${args.name}\`.`,
|
|
260
|
+
{ helpFor: { command: "test", subcommand: args.subcommand } }
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
function selectEnv(args) {
|
|
264
|
+
if (args.env === void 0) return DEFAULT_ENV;
|
|
265
|
+
return parseEnvSelector(args.env) ?? (() => {
|
|
266
|
+
throw unknownEnv("--env", args.env, { command: "test", subcommand: args.subcommand });
|
|
267
|
+
})();
|
|
268
|
+
}
|
|
269
|
+
async function resolveTarget(selector, auth) {
|
|
270
|
+
const target = await resolveMetaTarget(auth, selector);
|
|
271
|
+
return { dest: selector.kind, env: target.env ?? null, target };
|
|
257
272
|
}
|
|
258
273
|
async function collect(auth, target, kind) {
|
|
259
274
|
return listTests(auth, target, {
|
|
@@ -264,8 +279,8 @@ async function collect(auth, target, kind) {
|
|
|
264
279
|
function nameWidth(handles) {
|
|
265
280
|
return Math.max(0, ...handles.map((h) => h.name.length));
|
|
266
281
|
}
|
|
267
|
-
async function runList(args, auth) {
|
|
268
|
-
const { dest, env, target } = await resolveTarget(
|
|
282
|
+
async function runList(args, auth, selector) {
|
|
283
|
+
const { dest, env, target } = await resolveTarget(selector, auth);
|
|
269
284
|
const handles = await collect(auth, target, args.kind);
|
|
270
285
|
if (isMachineOutput(args)) {
|
|
271
286
|
writeJson({
|
|
@@ -300,13 +315,13 @@ function match(handles, needle) {
|
|
|
300
315
|
if (qualified.length > 0) return qualified;
|
|
301
316
|
return handles.filter((h) => h.name === needle);
|
|
302
317
|
}
|
|
303
|
-
async function runOne(args, auth, name) {
|
|
304
|
-
const { dest, env, target } = await resolveTarget(
|
|
318
|
+
async function runOne(args, auth, selector, name) {
|
|
319
|
+
const { dest, env, target } = await resolveTarget(selector, auth);
|
|
305
320
|
const handles = await collect(auth, target, args.kind);
|
|
306
321
|
const found = match(handles, name);
|
|
307
322
|
if (found.length === 0) {
|
|
308
323
|
throw new Error(
|
|
309
|
-
`No test named "${name}" in ${target.label}. Run \`xanots test list${args.
|
|
324
|
+
`No test named "${name}" in ${target.label}. Run \`xanots test list${args.env ? ` --env ${args.env}` : ""}\` to see what is there.`
|
|
310
325
|
);
|
|
311
326
|
}
|
|
312
327
|
if (found.length > 1) {
|
|
@@ -348,8 +363,8 @@ async function runSuite(auth, target, opts) {
|
|
|
348
363
|
return outcome;
|
|
349
364
|
});
|
|
350
365
|
}
|
|
351
|
-
async function runAll(args, auth) {
|
|
352
|
-
const { dest, env, target } = await resolveTarget(
|
|
366
|
+
async function runAll(args, auth, selector) {
|
|
367
|
+
const { dest, env, target } = await resolveTarget(selector, auth);
|
|
353
368
|
const outcomes = await runSuite(auth, target, {
|
|
354
369
|
kind: args.kind,
|
|
355
370
|
concurrency: args.concurrency,
|
|
@@ -358,19 +373,21 @@ async function runAll(args, auth) {
|
|
|
358
373
|
report(args, dest, env, outcomes);
|
|
359
374
|
}
|
|
360
375
|
async function runTestCommand(args) {
|
|
376
|
+
assertNoName(args);
|
|
377
|
+
const selector = selectEnv(args);
|
|
361
378
|
const auth = await getAccessToken(args);
|
|
362
379
|
switch (args.subcommand) {
|
|
363
380
|
case "list":
|
|
364
|
-
return runList(args, auth);
|
|
381
|
+
return runList(args, auth, selector);
|
|
365
382
|
case "run": {
|
|
366
383
|
const name = args.positionals[0];
|
|
367
384
|
if (name === void 0 || name === "") {
|
|
368
385
|
throw new Error('`xanots test run` needs a test name: `xanots test run "<name>"`.');
|
|
369
386
|
}
|
|
370
|
-
return runOne(args, auth, name);
|
|
387
|
+
return runOne(args, auth, selector, name);
|
|
371
388
|
}
|
|
372
389
|
case "run-all":
|
|
373
|
-
return runAll(args, auth);
|
|
390
|
+
return runAll(args, auth, selector);
|
|
374
391
|
default:
|
|
375
392
|
throw unknownSubcommand("test", args.subcommand);
|
|
376
393
|
}
|
|
@@ -380,4 +397,4 @@ export {
|
|
|
380
397
|
runSuite,
|
|
381
398
|
runTestCommand
|
|
382
399
|
};
|
|
383
|
-
//# sourceMappingURL=test-command-
|
|
400
|
+
//# sourceMappingURL=test-command-YAZLKLGQ.js.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assertProjectDir
|
|
3
3
|
} from "./chunk-ERQZFWIW.js";
|
|
4
|
+
import {
|
|
5
|
+
refreshAgentFiles
|
|
6
|
+
} from "./chunk-JGCWTCA7.js";
|
|
4
7
|
import {
|
|
5
8
|
isMachineOutput,
|
|
6
9
|
writeJson
|
|
7
10
|
} from "./chunk-NUQCEOKA.js";
|
|
8
|
-
import
|
|
9
|
-
refreshAgentFiles
|
|
10
|
-
} from "./chunk-QIWBCS7N.js";
|
|
11
|
-
import "./chunk-4PE4ZAB7.js";
|
|
11
|
+
import "./chunk-KA6G2L7U.js";
|
|
12
12
|
import {
|
|
13
13
|
runNpm
|
|
14
14
|
} from "./chunk-ZSYZTGJH.js";
|
|
15
15
|
import {
|
|
16
16
|
sdkDep
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ANUDXFEX.js";
|
|
18
18
|
import "./chunk-Q77KNEUL.js";
|
|
19
19
|
import {
|
|
20
20
|
checkForUpgrade,
|
|
@@ -22,10 +22,11 @@ import {
|
|
|
22
22
|
registryUrl,
|
|
23
23
|
suppressUpdateNotice,
|
|
24
24
|
upgradeCommand
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-5YCQ2QHH.js";
|
|
26
|
+
import "./chunk-ACCBOMCB.js";
|
|
27
|
+
import "./chunk-CTD5ZCV6.js";
|
|
28
28
|
import "./chunk-OYMR5AMJ.js";
|
|
29
|
+
import "./chunk-F6CYJ7TN.js";
|
|
29
30
|
import "./chunk-GNPVYOPB.js";
|
|
30
31
|
import {
|
|
31
32
|
blank,
|
|
@@ -35,9 +36,9 @@ import {
|
|
|
35
36
|
success,
|
|
36
37
|
warn
|
|
37
38
|
} from "./chunk-EZG76F7R.js";
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-VKSOTZK3.js";
|
|
40
|
+
import "./chunk-DIA7CT7J.js";
|
|
41
|
+
import "./chunk-LBYWGMOA.js";
|
|
41
42
|
import "./chunk-WHOJWOSV.js";
|
|
42
43
|
import "./chunk-5XZ744TS.js";
|
|
43
44
|
import "./chunk-7JDT4PBU.js";
|
|
@@ -174,4 +175,4 @@ function messageOf(err) {
|
|
|
174
175
|
export {
|
|
175
176
|
runUpgradeCommand
|
|
176
177
|
};
|
|
177
|
-
//# sourceMappingURL=upgrade-command-
|
|
178
|
+
//# sourceMappingURL=upgrade-command-FB5QJ363.js.map
|
|
@@ -1,48 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
fetchWorkspaceBundle,
|
|
3
|
-
runCodegenCommand
|
|
4
|
-
} from "./chunk-L6TPHWAU.js";
|
|
5
|
-
import "./chunk-ZOYMZZ3S.js";
|
|
6
1
|
import {
|
|
7
2
|
resolveOutputTarget
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-3EYUR3TX.js";
|
|
3
|
+
} from "./chunk-WGPXT2G2.js";
|
|
10
4
|
import {
|
|
11
5
|
printMicroserviceSection,
|
|
12
6
|
readMicroservices
|
|
13
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3UABJA4X.js";
|
|
8
|
+
import {
|
|
9
|
+
isMachineOutput,
|
|
10
|
+
writeJson
|
|
11
|
+
} from "./chunk-NUQCEOKA.js";
|
|
12
|
+
import {
|
|
13
|
+
fetchWorkspaceBundle
|
|
14
|
+
} from "./chunk-I7DQDJAM.js";
|
|
15
|
+
import "./chunk-3INK4Y4E.js";
|
|
16
|
+
import "./chunk-ZQ2PKR6R.js";
|
|
17
|
+
import "./chunk-K5IOND4K.js";
|
|
14
18
|
import {
|
|
15
19
|
ENV_WORKSPACE,
|
|
16
20
|
getAccessToken
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-QKM4U5UK.js";
|
|
22
|
+
import "./chunk-FE5I6S6N.js";
|
|
23
|
+
import "./chunk-7ZYW652H.js";
|
|
20
24
|
import "./chunk-ZUTSMMAG.js";
|
|
21
25
|
import "./chunk-X4DVXBFY.js";
|
|
22
|
-
import "./chunk-6Z5CNWFC.js";
|
|
23
|
-
import {
|
|
24
|
-
isMachineOutput,
|
|
25
|
-
writeJson
|
|
26
|
-
} from "./chunk-NUQCEOKA.js";
|
|
27
|
-
import "./chunk-4PE4ZAB7.js";
|
|
28
|
-
import "./chunk-ZSYZTGJH.js";
|
|
29
26
|
import {
|
|
30
27
|
fetchOrExplain,
|
|
31
28
|
httpFailure
|
|
32
29
|
} from "./chunk-3IGNIP6R.js";
|
|
33
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-YYFXVYPX.js";
|
|
31
|
+
import "./chunk-KA6G2L7U.js";
|
|
32
|
+
import "./chunk-ZSYZTGJH.js";
|
|
33
|
+
import "./chunk-75Z74TA7.js";
|
|
34
34
|
import "./chunk-LU7TRWMC.js";
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-YBC3IKMF.js";
|
|
36
|
+
import "./chunk-ANUDXFEX.js";
|
|
37
37
|
import "./chunk-Q77KNEUL.js";
|
|
38
38
|
import "./chunk-4BXJGVZ3.js";
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-P6TAVLOX.js";
|
|
40
|
+
import "./chunk-ACCBOMCB.js";
|
|
41
|
+
import "./chunk-CTD5ZCV6.js";
|
|
42
|
+
import "./chunk-OYMR5AMJ.js";
|
|
41
43
|
import {
|
|
42
44
|
removedSubcommand,
|
|
43
45
|
unknownSubcommand
|
|
44
|
-
} from "./chunk-
|
|
45
|
-
import "./chunk-OYMR5AMJ.js";
|
|
46
|
+
} from "./chunk-F6CYJ7TN.js";
|
|
46
47
|
import "./chunk-GNPVYOPB.js";
|
|
47
48
|
import {
|
|
48
49
|
formatFields,
|
|
@@ -50,9 +51,9 @@ import {
|
|
|
50
51
|
step,
|
|
51
52
|
success
|
|
52
53
|
} from "./chunk-EZG76F7R.js";
|
|
53
|
-
import "./chunk-
|
|
54
|
-
import "./chunk-
|
|
55
|
-
import "./chunk-
|
|
54
|
+
import "./chunk-VKSOTZK3.js";
|
|
55
|
+
import "./chunk-DIA7CT7J.js";
|
|
56
|
+
import "./chunk-LBYWGMOA.js";
|
|
56
57
|
import "./chunk-WHOJWOSV.js";
|
|
57
58
|
import "./chunk-5XZ744TS.js";
|
|
58
59
|
import "./chunk-7JDT4PBU.js";
|
|
@@ -67,10 +68,8 @@ async function runWorkspaceCommand(args) {
|
|
|
67
68
|
return runDetails(args);
|
|
68
69
|
case "export":
|
|
69
70
|
return runExport(args);
|
|
70
|
-
case "codegen":
|
|
71
|
-
return runCodegenCommand(args, { kind: "workspace" });
|
|
72
71
|
case "branch": {
|
|
73
|
-
const { runBranchCommand } = await import("./branch-commands-
|
|
72
|
+
const { runBranchCommand } = await import("./branch-commands-2BLOC2GR.js");
|
|
74
73
|
return runBranchCommand(args);
|
|
75
74
|
}
|
|
76
75
|
case "deploy":
|
|
@@ -160,4 +159,4 @@ async function runExport(args) {
|
|
|
160
159
|
export {
|
|
161
160
|
runWorkspaceCommand
|
|
162
161
|
};
|
|
163
|
-
//# sourceMappingURL=workspace-command-
|
|
162
|
+
//# sourceMappingURL=workspace-command-43P42FBP.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
exportWorkspaceBundle
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7ZYW652H.js";
|
|
4
4
|
import "./chunk-ZUTSMMAG.js";
|
|
5
5
|
import "./chunk-X4DVXBFY.js";
|
|
6
6
|
import "./chunk-3IGNIP6R.js";
|
|
7
7
|
export {
|
|
8
8
|
exportWorkspaceBundle
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=workspace-export-
|
|
10
|
+
//# sourceMappingURL=workspace-export-DURY5WYL.js.map
|
package/guides/README.md
CHANGED
|
@@ -11,10 +11,10 @@ typed, so your editor's autocomplete is usually the faster lookup — tab-comple
|
|
|
11
11
|
| [Object kinds](object-kinds.md) | Every authorable kind, and splitting a workspace across microservices |
|
|
12
12
|
| [Authoring reference](authoring.md) | Tables and fields, statements, values, inputs, middleware, request history |
|
|
13
13
|
| [CLI](cli.md) | Every command, shell completion, and what failures look like |
|
|
14
|
-
| [Signing in & deploying](deploying.md) | Auth, ephemerals, `--static`, releasing to production, `xanots
|
|
14
|
+
| [Signing in & deploying](deploying.md) | Auth, ephemerals, `--static`, releasing to production, `xanots preflight` |
|
|
15
15
|
| [Environment & identity](environment.md) | Every environment variable, and how `xano.lock` pins identity |
|
|
16
16
|
| [The typed frontend surface](typed-frontend.md) | Path resolution, input/response inference, bundle cost, the route manifest |
|
|
17
|
-
| [Pulling an existing workspace](codegen.md) | What `xanots
|
|
17
|
+
| [Pulling an existing workspace](codegen.md) | What `xanots init --from` writes, how faithful it is, and how to read its report |
|
|
18
18
|
| [Coverage & agent grounding](coverage.md) | What's covered, what's out of scope, and the files agents read |
|
|
19
19
|
|
|
20
20
|
## The agent-facing surface
|
package/guides/cli.md
CHANGED
|
@@ -24,14 +24,13 @@ xanots export ./xano/index.ts --lock # opt into xano.lock (created beside
|
|
|
24
24
|
xanots export ./xano/index.ts --frozen-lock # CI guard: fail if the export would change the lock
|
|
25
25
|
xanots lock rename --entry=xano/index.ts table users members # move a lock entry after renaming in code
|
|
26
26
|
xanots lock prune ./xano/index.ts --yes # drop lock entries nothing exports anymore
|
|
27
|
-
xanots lock prune --
|
|
28
|
-
xanots lock
|
|
27
|
+
xanots lock prune --identity-only --entry=xano/index.ts --yes dbo:notes # …or drop named keys without running the workspace
|
|
28
|
+
xanots lock import live-export.json --entry=xano/index.ts --yes # seed the lock from a live engine export
|
|
29
29
|
|
|
30
30
|
xanots login # OAuth sign-in (once) — pick the instance + workspace at consent
|
|
31
31
|
xanots login --paste # …when the browser can't reach this machine's 127.0.0.1 (remote shell, container, Codespace)
|
|
32
32
|
xanots workspace details # which instance/workspace am I bound to, and via which credential?
|
|
33
33
|
xanots deploy ./xano/index.ts # compile + import into a live ephemeral (the dev loop) → URL
|
|
34
|
-
xanots deploy ./xano/index.ts --dest sandbox # …or your throwaway singleton sandbox
|
|
35
34
|
xanots deploy ./xano/index.ts --static ./frontend/dist # also deploy a static frontend (onto the ephemeral)
|
|
36
35
|
xanots deploy ./xano/index.ts --static ./frontend/dist --static-env PK=pk_live_1 # + extra public config
|
|
37
36
|
xanots deploy --bundle ws.json # deploy an already-exported bundle
|
|
@@ -43,33 +42,32 @@ xanots ephemeral impersonate <tenant> # open it in the builder (--guest = r
|
|
|
43
42
|
xanots release ./xano/index.ts --dry-run # preview what promoting to your main workspace would change
|
|
44
43
|
xanots release ./xano/index.ts # promote: add + update, never delete, never touch table data
|
|
45
44
|
xanots release ./xano/index.ts --prune # …also delete objects this project released and no longer defines (needs xano.lock)
|
|
46
|
-
xanots
|
|
47
|
-
xanots
|
|
48
|
-
xanots
|
|
49
|
-
xanots sandbox details # print the sandbox base URL + tenant details (pretty on a TTY, JSON when piped)
|
|
45
|
+
xanots ephemeral export <tenant> # export a DEPLOYED ephemeral as a JSON bundle → ./<tenant>.json
|
|
46
|
+
xanots ephemeral export <tenant> --format multidoc --name backend # …or as XanoScript → backend.xs
|
|
47
|
+
xanots ephemeral export <tenant> --format multidoc --path - # …stream the multidoc to stdout (deploy first)
|
|
50
48
|
|
|
51
49
|
xanots workspace details # which workspace your token is scoped to (instance, id, name, guid)
|
|
52
50
|
xanots workspace export --path ws.json # your REAL workspace as a JSON bundle (`--path -` streams to stdout)
|
|
53
|
-
xanots
|
|
54
|
-
xanots
|
|
55
|
-
xanots
|
|
56
|
-
xanots codegen ws.json my-app # …or from a bundle already on disk (offline, no auth)
|
|
51
|
+
xanots init my-app --from workspace # …or as a runnable project (the pull direction)
|
|
52
|
+
xanots init my-app --from ephemeral:<tenant> # same, from an ephemeral (the env is named inside the flag)
|
|
53
|
+
xanots init my-app --from ./ws.json # …or from a bundle already on disk (offline, no auth)
|
|
57
54
|
|
|
58
|
-
xanots
|
|
59
|
-
xanots whoami #
|
|
55
|
+
xanots status # who am I, which workspace, and the env this project last deployed to
|
|
56
|
+
xanots whoami # print the scoped user + instance base URL (pretty on a TTY, JSON when piped)
|
|
57
|
+
xanots profile me # alias for `whoami`
|
|
60
58
|
xanots logout # revoke the refresh token + clear the shared cache (--local for the project one)
|
|
61
59
|
xanots version # print the installed @xanots/sdk version
|
|
62
60
|
xanots upgrade --check # is a newer @xanots/sdk published? exits 7 if so, 0 if current
|
|
63
61
|
xanots upgrade # install it (-g or -D, matching how this CLI is installed)
|
|
64
62
|
xanots help # grouped command reference (also the no-arg default)
|
|
65
63
|
xanots <command> --help # that command's usage, subcommands, and flags (`xanots deploy --help`)
|
|
66
|
-
xanots <noun> <verb> --help # scoped to one verb (`xanots workspace
|
|
64
|
+
xanots <noun> <verb> --help # scoped to one verb (`xanots workspace export --help`)
|
|
67
65
|
xanots <command> --json # force JSON on stdout (otherwise: whenever stdout isn't a terminal)
|
|
68
66
|
xanots completion zsh # shell completion script (also bash, fish) — see below
|
|
69
67
|
|
|
70
|
-
xanots
|
|
71
|
-
xanots
|
|
72
|
-
xanots
|
|
68
|
+
xanots preflight ./xano/index.ts # import into a live instance, diff each object back (needs auth + a throwaway tenant)
|
|
69
|
+
xanots preflight ./xano/index.ts --runtime # also run each deployed function on the engine
|
|
70
|
+
xanots preflight ./xano/index.ts --capture # write the fetched JSON as fixture candidates
|
|
73
71
|
```
|
|
74
72
|
|
|
75
73
|
## Bundle key names vs. the names everything else uses
|
|
@@ -97,7 +95,7 @@ correctly looks *missing* if you go looking for `payload.table`. And `agent` and
|
|
|
97
95
|
both land in `payload.toolset`, while the kind actually named `toolset` lands in
|
|
98
96
|
`payload.tool`; matching on the word alone will pick the wrong array.
|
|
99
97
|
|
|
100
|
-
This is also the format `xanots lock
|
|
98
|
+
This is also the format `xanots lock import` reads, so both directions are user-facing.
|
|
101
99
|
|
|
102
100
|
|
|
103
101
|
**Build warnings, and `--strict`.** `export`/`deploy` print a `xanots:` warning for the
|
|
@@ -113,7 +111,7 @@ The programmatic equivalents are `emitBundle(app, { strict: true })` and
|
|
|
113
111
|
## Shell completion
|
|
114
112
|
|
|
115
113
|
`xanots completion <bash|zsh|fish>` prints a completion script covering every command, verb, flag,
|
|
116
|
-
and closed value set (`--
|
|
114
|
+
and closed value set (`--env ephemeral|workspace`, `--format json|multidoc`, `--ai claude|codex|cursor|none`).
|
|
117
115
|
It is generated from the CLI's own command table, so it never drifts from what the CLI accepts — but it
|
|
118
116
|
is baked at generation time, so re-run it after upgrading.
|
|
119
117
|
|