@camox/cli 0.14.2 → 0.16.0
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/dist/{api-QINint5w.mjs → api-Bgstxixw.mjs} +16 -4
- package/dist/api-DoFRj7vC.mjs +3 -0
- package/dist/index.mjs +617 -53
- package/package.json +10 -10
- package/{template → templates/default}/package.json +2 -3
- package/{template → templates/default}/vite.config.ts +10 -4
- package/dist/api-CB7vjDU7.mjs +0 -3
- package/template/.vite-hooks/pre-commit +0 -1
- package/template/node_modules/.bin/camox +0 -21
- package/template/node_modules/.bin/intent +0 -21
- package/template/node_modules/.bin/nitro +0 -21
- package/template/node_modules/.bin/oxfmt +0 -21
- package/template/node_modules/.bin/oxlint +0 -21
- package/template/node_modules/.bin/shadcn +0 -21
- package/template/node_modules/.bin/tsgo +0 -21
- package/template/node_modules/.bin/vp +0 -21
- /package/{template → templates/default}/.env.example +0 -0
- /package/{template → templates/default}/components.json +0 -0
- /package/{template → templates/default}/src/camox/blocks/faq.tsx +0 -0
- /package/{template → templates/default}/src/camox/blocks/footer.tsx +0 -0
- /package/{template → templates/default}/src/camox/blocks/hero.tsx +0 -0
- /package/{template → templates/default}/src/camox/blocks/navbar.tsx +0 -0
- /package/{template → templates/default}/src/camox/blocks/statistics.tsx +0 -0
- /package/{template → templates/default}/src/camox/blocks/testimonial.tsx +0 -0
- /package/{template → templates/default}/src/camox/layouts/default.tsx +0 -0
- /package/{template → templates/default}/src/client.tsx +0 -0
- /package/{template → templates/default}/src/components/ui/accordion.tsx +0 -0
- /package/{template → templates/default}/src/components/ui/button.tsx +0 -0
- /package/{template → templates/default}/src/lib/utils.ts +0 -0
- /package/{template → templates/default}/src/router.tsx +0 -0
- /package/{template → templates/default}/src/routes/__root.tsx +0 -0
- /package/{template → templates/default}/src/routes/sitemap[.]xml.ts +0 -0
- /package/{template → templates/default}/src/styles.css +0 -0
- /package/{template → templates/default}/tsconfig.json +0 -0
|
@@ -9,10 +9,12 @@ function authHeaders(token) {
|
|
|
9
9
|
"Content-Type": "application/json"
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
function createRpcClient(token) {
|
|
12
|
+
function createRpcClient(token, apiUrl = CAMOX_API_URL, environmentName) {
|
|
13
|
+
const headers = { Authorization: `Bearer ${token}` };
|
|
14
|
+
if (environmentName) headers["x-environment-name"] = environmentName;
|
|
13
15
|
return createORPCClient(new RPCLink({
|
|
14
|
-
url: `${
|
|
15
|
-
headers
|
|
16
|
+
url: `${apiUrl}/rpc`,
|
|
17
|
+
headers
|
|
16
18
|
}));
|
|
17
19
|
}
|
|
18
20
|
async function verifySession(token) {
|
|
@@ -62,5 +64,15 @@ async function createProject(token, name, slug, organizationId) {
|
|
|
62
64
|
organizationId
|
|
63
65
|
});
|
|
64
66
|
}
|
|
67
|
+
async function getProjectBySlug(token, slug, apiUrl) {
|
|
68
|
+
return createRpcClient(token, apiUrl).projects.getBySlug({ slug });
|
|
69
|
+
}
|
|
70
|
+
async function callTool(params) {
|
|
71
|
+
return await createRpcClient(params.token, params.apiUrl, params.environmentName).agent.callTool({
|
|
72
|
+
projectId: params.projectId,
|
|
73
|
+
name: params.name,
|
|
74
|
+
arguments: params.args
|
|
75
|
+
});
|
|
76
|
+
}
|
|
65
77
|
//#endregion
|
|
66
|
-
export {
|
|
78
|
+
export { getProjectBySlug as a, verifySession as c, createProject as i, checkSlugAvailability as n, listOrganizations as o, createOrganization as r, setActiveOrganization as s, callTool as t };
|
package/dist/index.mjs
CHANGED
|
@@ -1,31 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as
|
|
2
|
+
import { a as getProjectBySlug, i as createProject, n as checkSlugAvailability, o as listOrganizations, r as createOrganization, s as setActiveOrganization, t as callTool } from "./api-Bgstxixw.mjs";
|
|
3
3
|
import { object, or } from "@optique/core/constructs";
|
|
4
4
|
import { message } from "@optique/core/message";
|
|
5
5
|
import { defineProgram } from "@optique/core/program";
|
|
6
|
-
import {
|
|
6
|
+
import { runSync } from "@optique/run";
|
|
7
|
+
import { multiple, optional } from "@optique/core/modifiers";
|
|
8
|
+
import { command, constant, option } from "@optique/core/primitives";
|
|
9
|
+
import { choice, integer, string } from "@optique/core/valueparser";
|
|
7
10
|
import { execSync, spawn, spawnSync } from "node:child_process";
|
|
8
11
|
import fs from "node:fs";
|
|
12
|
+
import http from "node:http";
|
|
13
|
+
import os from "node:os";
|
|
9
14
|
import path from "node:path";
|
|
10
|
-
import { fileURLToPath } from "node:url";
|
|
11
15
|
import * as p from "@clack/prompts";
|
|
12
16
|
import { log } from "@clack/prompts";
|
|
13
|
-
import {
|
|
17
|
+
import { ZodError, z } from "zod";
|
|
18
|
+
import { fileURLToPath } from "node:url";
|
|
14
19
|
import slugify from "slugify";
|
|
15
|
-
import http from "node:http";
|
|
16
|
-
import os from "node:os";
|
|
17
|
-
//#region \0rolldown/runtime.js
|
|
18
|
-
var __defProp = Object.defineProperty;
|
|
19
|
-
var __exportAll = (all, no_symbols) => {
|
|
20
|
-
let target = {};
|
|
21
|
-
for (var name in all) __defProp(target, name, {
|
|
22
|
-
get: all[name],
|
|
23
|
-
enumerable: true
|
|
24
|
-
});
|
|
25
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
26
|
-
return target;
|
|
27
|
-
};
|
|
28
|
-
//#endregion
|
|
29
20
|
//#region src/lib/auth.ts
|
|
30
21
|
const CAMOX_URL = process.env.CAMOX_URL || "https://camox.ai";
|
|
31
22
|
const CAMOX_API_URL = process.env.CAMOX_API_URL || "https://api.camox.ai";
|
|
@@ -47,7 +38,15 @@ function writeAllTokens(tokens) {
|
|
|
47
38
|
fs.writeFileSync(AUTH_FILE, JSON.stringify(tokens, null, 2), { mode: 384 });
|
|
48
39
|
}
|
|
49
40
|
function readAuthToken() {
|
|
50
|
-
|
|
41
|
+
return readAuthTokenForUrl(CAMOX_URL);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Look up a stored token by an explicit auth URL. Used by the tool dispatch
|
|
45
|
+
* path, which sources the URL from the vite plugin sidecar rather than env
|
|
46
|
+
* vars so the right credential is selected per project.
|
|
47
|
+
*/
|
|
48
|
+
function readAuthTokenForUrl(authenticationUrl) {
|
|
49
|
+
const entry = readAllTokens()[normalizeUrl(authenticationUrl)];
|
|
51
50
|
if (entry?.token && entry?.name) return entry;
|
|
52
51
|
return null;
|
|
53
52
|
}
|
|
@@ -174,7 +173,7 @@ async function authenticateUser() {
|
|
|
174
173
|
async function getOrAuthenticate() {
|
|
175
174
|
const stored = readAuthToken();
|
|
176
175
|
if (stored) {
|
|
177
|
-
const { verifySession } = await import("./api-
|
|
176
|
+
const { verifySession } = await import("./api-DoFRj7vC.mjs");
|
|
178
177
|
if (await verifySession(stored.token)) {
|
|
179
178
|
p.log.info(`Authenticated as ${stored.name}`);
|
|
180
179
|
return stored;
|
|
@@ -185,6 +184,365 @@ async function getOrAuthenticate() {
|
|
|
185
184
|
return authenticateUser();
|
|
186
185
|
}
|
|
187
186
|
//#endregion
|
|
187
|
+
//#region src/lib/output.ts
|
|
188
|
+
function isJsonMode(mode) {
|
|
189
|
+
if (mode === "json") return true;
|
|
190
|
+
return !process.stdout.isTTY;
|
|
191
|
+
}
|
|
192
|
+
function printResult(value, mode) {
|
|
193
|
+
const indent = isJsonMode(mode) ? 0 : 2;
|
|
194
|
+
process.stdout.write(`${JSON.stringify(value, null, indent)}\n`);
|
|
195
|
+
}
|
|
196
|
+
function printError(err) {
|
|
197
|
+
process.stderr.write(`${JSON.stringify(err)}\n`);
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Parse a JSON flag value, surfacing a structured CLI error if the input
|
|
201
|
+
* isn't valid JSON. Block `content` and `settings` arrive this way.
|
|
202
|
+
*/
|
|
203
|
+
function parseJsonFlag(name, raw) {
|
|
204
|
+
try {
|
|
205
|
+
return JSON.parse(raw);
|
|
206
|
+
} catch (e) {
|
|
207
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
208
|
+
throw Object.assign(/* @__PURE__ */ new Error(`Invalid JSON for ${name}: ${message}`), { __cliError: {
|
|
209
|
+
code: "INVALID_JSON",
|
|
210
|
+
message: `Invalid JSON for ${name}`,
|
|
211
|
+
details: message
|
|
212
|
+
} });
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
function asCliError(err) {
|
|
216
|
+
if (err && typeof err === "object" && "__cliError" in err) return err.__cliError;
|
|
217
|
+
if (err instanceof Error) return {
|
|
218
|
+
code: "INTERNAL_ERROR",
|
|
219
|
+
message: err.message
|
|
220
|
+
};
|
|
221
|
+
return {
|
|
222
|
+
code: "INTERNAL_ERROR",
|
|
223
|
+
message: String(err)
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
//#endregion
|
|
227
|
+
//#region src/lib/runtime.ts
|
|
228
|
+
/**
|
|
229
|
+
* Subset of the camox vite plugin's options that the CLI needs at dispatch
|
|
230
|
+
* time. Written by the plugin to `node_modules/.camox/runtime.json` on every
|
|
231
|
+
* `configResolved` (dev + build), so it always reflects what vite actually
|
|
232
|
+
* loaded — including `_internal.apiUrl` overrides.
|
|
233
|
+
*
|
|
234
|
+
* Schema is the source of truth; the TS type is derived from it via
|
|
235
|
+
* `z.infer` so the two never drift.
|
|
236
|
+
*/
|
|
237
|
+
const runtimeSchema = z.object({
|
|
238
|
+
projectSlug: z.string().min(1),
|
|
239
|
+
apiUrl: z.string().url(),
|
|
240
|
+
authenticationUrl: z.string().url(),
|
|
241
|
+
environmentName: z.string().min(1)
|
|
242
|
+
});
|
|
243
|
+
const SIDECAR = path.join("node_modules", ".camox", "runtime.json");
|
|
244
|
+
var RuntimeNotFoundError = class extends Error {
|
|
245
|
+
cwd;
|
|
246
|
+
constructor(cwd) {
|
|
247
|
+
super(`No camox runtime found. Looked for "${SIDECAR}" walking up from ${cwd}. The camox vite plugin writes this file on dev/build — start your project's dev server (or run a build) once before invoking camox.`);
|
|
248
|
+
this.cwd = cwd;
|
|
249
|
+
this.name = "RuntimeNotFoundError";
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
var RuntimeMalformedError = class extends Error {
|
|
253
|
+
constructor(file, reason) {
|
|
254
|
+
super(`Camox runtime sidecar at ${file} is malformed (${reason}). Re-run your project's dev server to regenerate it.`);
|
|
255
|
+
this.name = "RuntimeMalformedError";
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
/**
|
|
259
|
+
* Walk up from cwd looking for the sidecar. Validates against `runtimeSchema`
|
|
260
|
+
* and throws `RuntimeNotFoundError` / `RuntimeMalformedError` with messages
|
|
261
|
+
* that tell the user how to fix it.
|
|
262
|
+
*/
|
|
263
|
+
function loadRuntime(cwd = process.cwd()) {
|
|
264
|
+
let dir = cwd;
|
|
265
|
+
while (true) {
|
|
266
|
+
const candidate = path.join(dir, SIDECAR);
|
|
267
|
+
if (fs.existsSync(candidate)) {
|
|
268
|
+
let raw;
|
|
269
|
+
try {
|
|
270
|
+
raw = JSON.parse(fs.readFileSync(candidate, "utf-8"));
|
|
271
|
+
} catch (e) {
|
|
272
|
+
throw new RuntimeMalformedError(candidate, e instanceof Error ? e.message : String(e));
|
|
273
|
+
}
|
|
274
|
+
try {
|
|
275
|
+
return runtimeSchema.parse(raw);
|
|
276
|
+
} catch (e) {
|
|
277
|
+
if (e instanceof ZodError) throw new RuntimeMalformedError(candidate, e.issues.map((i) => `${i.path.join(".") || "<root>"}: ${i.message}`).join("; "));
|
|
278
|
+
throw e;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
const parent = path.dirname(dir);
|
|
282
|
+
if (parent === dir) throw new RuntimeNotFoundError(cwd);
|
|
283
|
+
dir = parent;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
//#endregion
|
|
287
|
+
//#region src/lib/dispatch.ts
|
|
288
|
+
/**
|
|
289
|
+
* Strip undefined fields. Optique returns `undefined` for absent optional
|
|
290
|
+
* flags, but the tool's Zod input often distinguishes `key: undefined` from
|
|
291
|
+
* the key being absent. Send only the keys the user actually passed.
|
|
292
|
+
*/
|
|
293
|
+
function compact(input) {
|
|
294
|
+
const out = {};
|
|
295
|
+
for (const [k, v] of Object.entries(input)) if (v !== void 0) out[k] = v;
|
|
296
|
+
return out;
|
|
297
|
+
}
|
|
298
|
+
function fail(err, code) {
|
|
299
|
+
printError(err);
|
|
300
|
+
process.exit(code);
|
|
301
|
+
}
|
|
302
|
+
async function resolveProjectId(token, slug, apiUrl) {
|
|
303
|
+
try {
|
|
304
|
+
return (await getProjectBySlug(token, slug, apiUrl)).id;
|
|
305
|
+
} catch (err) {
|
|
306
|
+
return fail({
|
|
307
|
+
code: "PROJECT_LOOKUP_FAILED",
|
|
308
|
+
message: `Could not load project "${slug}".`,
|
|
309
|
+
details: err instanceof Error ? err.message : String(err)
|
|
310
|
+
}, 2);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
async function callRemote(params) {
|
|
314
|
+
try {
|
|
315
|
+
return await callTool(params);
|
|
316
|
+
} catch (err) {
|
|
317
|
+
return fail(asCliError(err), 1);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Resolve auth + project, call the registered tool via `agent.callTool`,
|
|
322
|
+
* and render the result. Exit codes: 0 on success, 1 on tool error, 2 on
|
|
323
|
+
* auth/project resolution failure.
|
|
324
|
+
*
|
|
325
|
+
* Project, apiUrl, and authenticationUrl all come from the vite plugin's
|
|
326
|
+
* `node_modules/.camox/runtime.json` sidecar — that's the single source of
|
|
327
|
+
* truth. `--project <slug>` and `CAMOX_PROJECT` may override the slug.
|
|
328
|
+
*/
|
|
329
|
+
async function dispatch(opts) {
|
|
330
|
+
let runtime;
|
|
331
|
+
try {
|
|
332
|
+
runtime = loadRuntime();
|
|
333
|
+
} catch (err) {
|
|
334
|
+
if (err instanceof RuntimeNotFoundError || err instanceof RuntimeMalformedError) return fail({
|
|
335
|
+
code: "RUNTIME_NOT_FOUND",
|
|
336
|
+
message: err.message
|
|
337
|
+
}, 2);
|
|
338
|
+
throw err;
|
|
339
|
+
}
|
|
340
|
+
const slug = opts.projectFlag?.trim() || process.env.CAMOX_PROJECT?.trim() || runtime.projectSlug;
|
|
341
|
+
const token = readAuthTokenForUrl(runtime.authenticationUrl);
|
|
342
|
+
if (!token) return fail({
|
|
343
|
+
code: "NOT_AUTHENTICATED",
|
|
344
|
+
message: `No stored credentials for ${runtime.authenticationUrl}. Run \`camox login\` against this backend first.`
|
|
345
|
+
}, 2);
|
|
346
|
+
const environmentName = opts.production ? "production" : runtime.environmentName;
|
|
347
|
+
const projectId = await resolveProjectId(token.token, slug, runtime.apiUrl);
|
|
348
|
+
const response = await callRemote({
|
|
349
|
+
token: token.token,
|
|
350
|
+
apiUrl: runtime.apiUrl,
|
|
351
|
+
environmentName,
|
|
352
|
+
projectId,
|
|
353
|
+
name: opts.toolName,
|
|
354
|
+
args: compact(opts.args)
|
|
355
|
+
});
|
|
356
|
+
if (!response.ok) {
|
|
357
|
+
printError(response.error);
|
|
358
|
+
process.exit(1);
|
|
359
|
+
}
|
|
360
|
+
printResult(response.result, opts.outputMode);
|
|
361
|
+
process.exit(0);
|
|
362
|
+
}
|
|
363
|
+
//#endregion
|
|
364
|
+
//#region src/commands/blocks.ts
|
|
365
|
+
const projectFlag$2 = optional(option("--project", string({ metavar: "SLUG" })));
|
|
366
|
+
const jsonFlag$2 = option("--json");
|
|
367
|
+
const productionFlag$2 = option("--production");
|
|
368
|
+
const parser$6 = command("blocks", or(command("types", object({
|
|
369
|
+
command: constant("blocks.types"),
|
|
370
|
+
project: projectFlag$2,
|
|
371
|
+
production: productionFlag$2,
|
|
372
|
+
json: jsonFlag$2
|
|
373
|
+
})), command("describe", object({
|
|
374
|
+
command: constant("blocks.describe"),
|
|
375
|
+
type: multiple(option("--type", string({ metavar: "TYPE" })), { min: 1 }),
|
|
376
|
+
project: projectFlag$2,
|
|
377
|
+
production: productionFlag$2,
|
|
378
|
+
json: jsonFlag$2
|
|
379
|
+
})), command("create", object({
|
|
380
|
+
command: constant("blocks.create"),
|
|
381
|
+
pageId: option("--page-id", integer({ metavar: "ID" })),
|
|
382
|
+
type: option("--type", string({ metavar: "TYPE" })),
|
|
383
|
+
content: option("--content", string({ metavar: "JSON" })),
|
|
384
|
+
settings: optional(option("--settings", string({ metavar: "JSON" }))),
|
|
385
|
+
position: optional(option("--position", choice(["first", "last"], { metavar: "WHERE" }))),
|
|
386
|
+
afterId: optional(option("--after-id", integer({ metavar: "ID" }))),
|
|
387
|
+
beforeId: optional(option("--before-id", integer({ metavar: "ID" }))),
|
|
388
|
+
afterPosition: optional(option("--after-position", string({ metavar: "POS" }))),
|
|
389
|
+
beforePosition: optional(option("--before-position", string({ metavar: "POS" }))),
|
|
390
|
+
project: projectFlag$2,
|
|
391
|
+
production: productionFlag$2,
|
|
392
|
+
json: jsonFlag$2
|
|
393
|
+
})), command("edit", object({
|
|
394
|
+
command: constant("blocks.edit"),
|
|
395
|
+
id: option("--id", integer({ metavar: "ID" })),
|
|
396
|
+
content: optional(option("--content", string({ metavar: "JSON" }))),
|
|
397
|
+
settings: optional(option("--settings", string({ metavar: "JSON" }))),
|
|
398
|
+
project: projectFlag$2,
|
|
399
|
+
production: productionFlag$2,
|
|
400
|
+
json: jsonFlag$2
|
|
401
|
+
})), command("move", object({
|
|
402
|
+
command: constant("blocks.move"),
|
|
403
|
+
id: option("--id", integer({ metavar: "ID" })),
|
|
404
|
+
position: optional(option("--position", choice(["first", "last"], { metavar: "WHERE" }))),
|
|
405
|
+
afterId: optional(option("--after-id", integer({ metavar: "ID" }))),
|
|
406
|
+
beforeId: optional(option("--before-id", integer({ metavar: "ID" }))),
|
|
407
|
+
afterPosition: optional(option("--after-position", string({ metavar: "POS" }))),
|
|
408
|
+
beforePosition: optional(option("--before-position", string({ metavar: "POS" }))),
|
|
409
|
+
project: projectFlag$2,
|
|
410
|
+
production: productionFlag$2,
|
|
411
|
+
json: jsonFlag$2
|
|
412
|
+
})), command("delete", object({
|
|
413
|
+
command: constant("blocks.delete"),
|
|
414
|
+
id: option("--id", integer({ metavar: "ID" })),
|
|
415
|
+
project: projectFlag$2,
|
|
416
|
+
production: productionFlag$2,
|
|
417
|
+
json: jsonFlag$2
|
|
418
|
+
}))));
|
|
419
|
+
const POSITIONING_FLAGS = [
|
|
420
|
+
["position", "--position"],
|
|
421
|
+
["afterId", "--after-id"],
|
|
422
|
+
["beforeId", "--before-id"],
|
|
423
|
+
["afterPosition", "--after-position"],
|
|
424
|
+
["beforePosition", "--before-position"]
|
|
425
|
+
];
|
|
426
|
+
/**
|
|
427
|
+
* Both `create` and `move` accept multiple positioning inputs, but only one is
|
|
428
|
+
* meaningful per call. The server will reject conflicts, but we surface the
|
|
429
|
+
* mistake earlier (and with friendlier wording) by checking on the client.
|
|
430
|
+
*/
|
|
431
|
+
function collectPositioningArgs(args) {
|
|
432
|
+
const used = [];
|
|
433
|
+
const toolArgs = {};
|
|
434
|
+
for (const [key, flag] of POSITIONING_FLAGS) {
|
|
435
|
+
const value = args[key];
|
|
436
|
+
if (value === void 0) continue;
|
|
437
|
+
used.push(flag);
|
|
438
|
+
Object.assign(toolArgs, { [key]: value });
|
|
439
|
+
}
|
|
440
|
+
return {
|
|
441
|
+
used,
|
|
442
|
+
toolArgs
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
async function handler$6(args) {
|
|
446
|
+
const outputMode = args.json ? "json" : "auto";
|
|
447
|
+
const projectFlag = args.project;
|
|
448
|
+
const production = args.production;
|
|
449
|
+
try {
|
|
450
|
+
switch (args.command) {
|
|
451
|
+
case "blocks.types": return dispatch({
|
|
452
|
+
toolName: "listBlockTypes",
|
|
453
|
+
args: {},
|
|
454
|
+
projectFlag,
|
|
455
|
+
production,
|
|
456
|
+
outputMode
|
|
457
|
+
});
|
|
458
|
+
case "blocks.describe": return dispatch({
|
|
459
|
+
toolName: "describeBlockTypes",
|
|
460
|
+
args: { types: [...args.type] },
|
|
461
|
+
projectFlag,
|
|
462
|
+
production,
|
|
463
|
+
outputMode
|
|
464
|
+
});
|
|
465
|
+
case "blocks.create": {
|
|
466
|
+
const content = parseJsonFlag("--content", args.content);
|
|
467
|
+
const settings = args.settings !== void 0 ? parseJsonFlag("--settings", args.settings) : void 0;
|
|
468
|
+
const { used, toolArgs } = collectPositioningArgs(args);
|
|
469
|
+
if (used.length > 1) {
|
|
470
|
+
printError({
|
|
471
|
+
code: "INVALID_ARGS",
|
|
472
|
+
message: `Pass at most one positioning flag — got: ${used.join(", ")}.`
|
|
473
|
+
});
|
|
474
|
+
process.exit(2);
|
|
475
|
+
}
|
|
476
|
+
return dispatch({
|
|
477
|
+
toolName: "createBlock",
|
|
478
|
+
args: {
|
|
479
|
+
pageId: args.pageId,
|
|
480
|
+
type: args.type,
|
|
481
|
+
content,
|
|
482
|
+
settings,
|
|
483
|
+
...toolArgs
|
|
484
|
+
},
|
|
485
|
+
projectFlag,
|
|
486
|
+
production,
|
|
487
|
+
outputMode
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
case "blocks.edit": {
|
|
491
|
+
const content = args.content !== void 0 ? parseJsonFlag("--content", args.content) : void 0;
|
|
492
|
+
const settings = args.settings !== void 0 ? parseJsonFlag("--settings", args.settings) : void 0;
|
|
493
|
+
return dispatch({
|
|
494
|
+
toolName: "editBlock",
|
|
495
|
+
args: {
|
|
496
|
+
id: args.id,
|
|
497
|
+
content,
|
|
498
|
+
settings
|
|
499
|
+
},
|
|
500
|
+
projectFlag,
|
|
501
|
+
production,
|
|
502
|
+
outputMode
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
case "blocks.move": {
|
|
506
|
+
const { used, toolArgs } = collectPositioningArgs(args);
|
|
507
|
+
if (used.length === 0) {
|
|
508
|
+
printError({
|
|
509
|
+
code: "INVALID_ARGS",
|
|
510
|
+
message: "Pass a positioning flag — one of --position, --after-id, --before-id, --after-position, --before-position. Use `--position last` to move a block to the end of the page."
|
|
511
|
+
});
|
|
512
|
+
process.exit(2);
|
|
513
|
+
}
|
|
514
|
+
if (used.length > 1) {
|
|
515
|
+
printError({
|
|
516
|
+
code: "INVALID_ARGS",
|
|
517
|
+
message: `Pass at most one positioning flag — got: ${used.join(", ")}.`
|
|
518
|
+
});
|
|
519
|
+
process.exit(2);
|
|
520
|
+
}
|
|
521
|
+
return dispatch({
|
|
522
|
+
toolName: "moveBlock",
|
|
523
|
+
args: {
|
|
524
|
+
id: args.id,
|
|
525
|
+
...toolArgs
|
|
526
|
+
},
|
|
527
|
+
projectFlag,
|
|
528
|
+
production,
|
|
529
|
+
outputMode
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
case "blocks.delete": return dispatch({
|
|
533
|
+
toolName: "deleteBlock",
|
|
534
|
+
args: { id: args.id },
|
|
535
|
+
projectFlag,
|
|
536
|
+
production,
|
|
537
|
+
outputMode
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
} catch (err) {
|
|
541
|
+
printError(asCliError(err));
|
|
542
|
+
process.exit(1);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
//#endregion
|
|
188
546
|
//#region src/lib/utils.ts
|
|
189
547
|
const pmCommands = {
|
|
190
548
|
pnpm: {
|
|
@@ -209,7 +567,7 @@ function copyDir(src, dest, replacements) {
|
|
|
209
567
|
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
|
210
568
|
const srcPath = path.join(src, entry.name);
|
|
211
569
|
const destPath = path.join(dest, entry.name);
|
|
212
|
-
if (
|
|
570
|
+
if (fs.statSync(srcPath).isDirectory()) {
|
|
213
571
|
copyDir(srcPath, destPath, replacements);
|
|
214
572
|
continue;
|
|
215
573
|
}
|
|
@@ -220,13 +578,8 @@ function copyDir(src, dest, replacements) {
|
|
|
220
578
|
}
|
|
221
579
|
//#endregion
|
|
222
580
|
//#region src/commands/init.ts
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
init: () => init,
|
|
226
|
-
parser: () => parser$2
|
|
227
|
-
});
|
|
228
|
-
const parser$2 = command("init", object({ command: constant("init") }));
|
|
229
|
-
const handler$2 = init;
|
|
581
|
+
const parser$5 = command("init", object({ command: constant("init") }));
|
|
582
|
+
const handler$5 = init;
|
|
230
583
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
231
584
|
const ownPkg = JSON.parse(fs.readFileSync(path.resolve(__dirname, "..", "package.json"), "utf-8"));
|
|
232
585
|
function onCancel() {
|
|
@@ -359,10 +712,12 @@ async function init() {
|
|
|
359
712
|
const pm = selected;
|
|
360
713
|
const s = p.spinner();
|
|
361
714
|
s.start("Scaffolding project...");
|
|
362
|
-
copyDir(path.resolve(__dirname, "..", "
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
});
|
|
715
|
+
copyDir(path.resolve(__dirname, "..", "templates", "default"), targetDir, { "{{projectName}}": name });
|
|
716
|
+
const viteConfigPath = path.join(targetDir, "vite.config.ts");
|
|
717
|
+
let viteConfig = fs.readFileSync(viteConfigPath, "utf-8");
|
|
718
|
+
viteConfig = viteConfig.replace(/"[^"]*"(,?)[ \t]*\/\/[ \t]*camox-cli:replace-slug.*$/gm, `"${project.slug}"$1`);
|
|
719
|
+
viteConfig = viteConfig.replace(/^[ \t]*\/\/[ \t]*camox-cli:dev-only-start[ \t]*\r?\n[\s\S]*?^[ \t]*\/\/[ \t]*camox-cli:dev-only-end[ \t]*\r?\n/gm, "");
|
|
720
|
+
fs.writeFileSync(viteConfigPath, viteConfig);
|
|
366
721
|
const pkgPath = path.join(targetDir, "package.json");
|
|
367
722
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
368
723
|
pkg.name = project.slug;
|
|
@@ -434,14 +789,34 @@ src/routeTree.gen.ts
|
|
|
434
789
|
});
|
|
435
790
|
}
|
|
436
791
|
//#endregion
|
|
792
|
+
//#region src/commands/layouts.ts
|
|
793
|
+
const projectFlag$1 = optional(option("--project", string({ metavar: "SLUG" })));
|
|
794
|
+
const jsonFlag$1 = option("--json");
|
|
795
|
+
const productionFlag$1 = option("--production");
|
|
796
|
+
const parser$4 = command("layouts", or(command("list", object({
|
|
797
|
+
command: constant("layouts.list"),
|
|
798
|
+
project: projectFlag$1,
|
|
799
|
+
production: productionFlag$1,
|
|
800
|
+
json: jsonFlag$1
|
|
801
|
+
}))));
|
|
802
|
+
async function handler$4(args) {
|
|
803
|
+
const outputMode = args.json ? "json" : "auto";
|
|
804
|
+
const projectFlag = args.project;
|
|
805
|
+
const production = args.production;
|
|
806
|
+
switch (args.command) {
|
|
807
|
+
case "layouts.list": return dispatch({
|
|
808
|
+
toolName: "listLayouts",
|
|
809
|
+
args: {},
|
|
810
|
+
projectFlag,
|
|
811
|
+
production,
|
|
812
|
+
outputMode
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
//#endregion
|
|
437
817
|
//#region src/commands/login.ts
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
login: () => login,
|
|
441
|
-
parser: () => parser$1
|
|
442
|
-
});
|
|
443
|
-
const parser$1 = command("login", object({ command: constant("login") }));
|
|
444
|
-
const handler$1 = login;
|
|
818
|
+
const parser$3 = command("login", object({ command: constant("login") }));
|
|
819
|
+
const handler$3 = login;
|
|
445
820
|
async function login() {
|
|
446
821
|
p.intro("camox login");
|
|
447
822
|
try {
|
|
@@ -455,13 +830,8 @@ async function login() {
|
|
|
455
830
|
}
|
|
456
831
|
//#endregion
|
|
457
832
|
//#region src/commands/logout.ts
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
logout: () => logout,
|
|
461
|
-
parser: () => parser
|
|
462
|
-
});
|
|
463
|
-
const parser = command("logout", object({ command: constant("logout") }));
|
|
464
|
-
const handler = logout;
|
|
833
|
+
const parser$2 = command("logout", object({ command: constant("logout") }));
|
|
834
|
+
const handler$2 = logout;
|
|
465
835
|
function logout() {
|
|
466
836
|
p.intro("camox logout");
|
|
467
837
|
const token = readAuthToken();
|
|
@@ -473,17 +843,211 @@ function logout() {
|
|
|
473
843
|
p.log.success(`Logged out from ${token.name}.`);
|
|
474
844
|
}
|
|
475
845
|
//#endregion
|
|
846
|
+
//#region src/commands/pages.ts
|
|
847
|
+
const projectFlag = optional(option("--project", string({ metavar: "SLUG" })));
|
|
848
|
+
const jsonFlag = option("--json");
|
|
849
|
+
const productionFlag = option("--production");
|
|
850
|
+
const parser$1 = command("pages", or(command("list", object({
|
|
851
|
+
command: constant("pages.list"),
|
|
852
|
+
project: projectFlag,
|
|
853
|
+
production: productionFlag,
|
|
854
|
+
json: jsonFlag
|
|
855
|
+
})), command("get", object({
|
|
856
|
+
command: constant("pages.get"),
|
|
857
|
+
id: optional(option("--id", integer({ metavar: "ID" }))),
|
|
858
|
+
path: optional(option("--path", string({ metavar: "PATH" }))),
|
|
859
|
+
project: projectFlag,
|
|
860
|
+
production: productionFlag,
|
|
861
|
+
json: jsonFlag
|
|
862
|
+
})), command("create", object({
|
|
863
|
+
command: constant("pages.create"),
|
|
864
|
+
pathSegment: option("--path-segment", string({ metavar: "SEGMENT" })),
|
|
865
|
+
layoutId: option("--layout-id", integer({ metavar: "ID" })),
|
|
866
|
+
parentPageId: optional(option("--parent-page-id", integer({ metavar: "ID" }))),
|
|
867
|
+
contentDescription: optional(option("--content-description", string({ metavar: "TEXT" }))),
|
|
868
|
+
project: projectFlag,
|
|
869
|
+
production: productionFlag,
|
|
870
|
+
json: jsonFlag
|
|
871
|
+
})), command("update", object({
|
|
872
|
+
command: constant("pages.update"),
|
|
873
|
+
id: option("--id", integer({ metavar: "ID" })),
|
|
874
|
+
pathSegment: optional(option("--path-segment", string({ metavar: "SEGMENT" }))),
|
|
875
|
+
parentPageId: optional(option("--parent-page-id", integer({ metavar: "ID" }))),
|
|
876
|
+
project: projectFlag,
|
|
877
|
+
production: productionFlag,
|
|
878
|
+
json: jsonFlag
|
|
879
|
+
})), command("set-layout", object({
|
|
880
|
+
command: constant("pages.set-layout"),
|
|
881
|
+
id: option("--id", integer({ metavar: "ID" })),
|
|
882
|
+
layoutId: option("--layout-id", integer({ metavar: "ID" })),
|
|
883
|
+
project: projectFlag,
|
|
884
|
+
production: productionFlag,
|
|
885
|
+
json: jsonFlag
|
|
886
|
+
})), command("delete", object({
|
|
887
|
+
command: constant("pages.delete"),
|
|
888
|
+
id: option("--id", integer({ metavar: "ID" })),
|
|
889
|
+
project: projectFlag,
|
|
890
|
+
production: productionFlag,
|
|
891
|
+
json: jsonFlag
|
|
892
|
+
}))));
|
|
893
|
+
async function handler$1(args) {
|
|
894
|
+
const outputMode = args.json ? "json" : "auto";
|
|
895
|
+
const projectFlag = args.project;
|
|
896
|
+
const production = args.production;
|
|
897
|
+
switch (args.command) {
|
|
898
|
+
case "pages.list": return dispatch({
|
|
899
|
+
toolName: "listPages",
|
|
900
|
+
args: {},
|
|
901
|
+
projectFlag,
|
|
902
|
+
production,
|
|
903
|
+
outputMode
|
|
904
|
+
});
|
|
905
|
+
case "pages.get":
|
|
906
|
+
if (args.id == null === (args.path == null)) {
|
|
907
|
+
printError({
|
|
908
|
+
code: "INVALID_ARGS",
|
|
909
|
+
message: "Pass exactly one of --id or --path."
|
|
910
|
+
});
|
|
911
|
+
process.exit(2);
|
|
912
|
+
}
|
|
913
|
+
return dispatch({
|
|
914
|
+
toolName: "getPage",
|
|
915
|
+
args: args.id != null ? { id: args.id } : { path: args.path },
|
|
916
|
+
projectFlag,
|
|
917
|
+
production,
|
|
918
|
+
outputMode
|
|
919
|
+
});
|
|
920
|
+
case "pages.create": return dispatch({
|
|
921
|
+
toolName: "createPage",
|
|
922
|
+
args: {
|
|
923
|
+
pathSegment: args.pathSegment,
|
|
924
|
+
layoutId: args.layoutId,
|
|
925
|
+
parentPageId: args.parentPageId,
|
|
926
|
+
contentDescription: args.contentDescription
|
|
927
|
+
},
|
|
928
|
+
projectFlag,
|
|
929
|
+
production,
|
|
930
|
+
outputMode
|
|
931
|
+
});
|
|
932
|
+
case "pages.update": return dispatch({
|
|
933
|
+
toolName: "updatePage",
|
|
934
|
+
args: {
|
|
935
|
+
id: args.id,
|
|
936
|
+
pathSegment: args.pathSegment,
|
|
937
|
+
parentPageId: args.parentPageId
|
|
938
|
+
},
|
|
939
|
+
projectFlag,
|
|
940
|
+
production,
|
|
941
|
+
outputMode
|
|
942
|
+
});
|
|
943
|
+
case "pages.set-layout": return dispatch({
|
|
944
|
+
toolName: "setPageLayout",
|
|
945
|
+
args: {
|
|
946
|
+
id: args.id,
|
|
947
|
+
layoutId: args.layoutId
|
|
948
|
+
},
|
|
949
|
+
projectFlag,
|
|
950
|
+
production,
|
|
951
|
+
outputMode
|
|
952
|
+
});
|
|
953
|
+
case "pages.delete": return dispatch({
|
|
954
|
+
toolName: "deletePage",
|
|
955
|
+
args: { id: args.id },
|
|
956
|
+
projectFlag,
|
|
957
|
+
production,
|
|
958
|
+
outputMode
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
//#endregion
|
|
963
|
+
//#region src/commands/status.ts
|
|
964
|
+
const parser = command("status", object({
|
|
965
|
+
command: constant("status"),
|
|
966
|
+
production: option("--production"),
|
|
967
|
+
json: option("--json")
|
|
968
|
+
}));
|
|
969
|
+
async function handler(args) {
|
|
970
|
+
let runtime;
|
|
971
|
+
try {
|
|
972
|
+
runtime = loadRuntime();
|
|
973
|
+
} catch (err) {
|
|
974
|
+
if (err instanceof RuntimeNotFoundError || err instanceof RuntimeMalformedError) {
|
|
975
|
+
printError({
|
|
976
|
+
code: "RUNTIME_NOT_FOUND",
|
|
977
|
+
message: err.message
|
|
978
|
+
});
|
|
979
|
+
process.exit(2);
|
|
980
|
+
}
|
|
981
|
+
throw err;
|
|
982
|
+
}
|
|
983
|
+
const environmentName = args.production ? "production" : runtime.environmentName;
|
|
984
|
+
const token = readAuthTokenForUrl(runtime.authenticationUrl);
|
|
985
|
+
const status = {
|
|
986
|
+
projectSlug: runtime.projectSlug,
|
|
987
|
+
environmentName,
|
|
988
|
+
apiUrl: runtime.apiUrl,
|
|
989
|
+
authenticationUrl: runtime.authenticationUrl,
|
|
990
|
+
authenticated: token !== null,
|
|
991
|
+
user: token ? {
|
|
992
|
+
name: token.name,
|
|
993
|
+
email: token.email
|
|
994
|
+
} : null
|
|
995
|
+
};
|
|
996
|
+
if (args.json || !process.stdout.isTTY) {
|
|
997
|
+
process.stdout.write(`${JSON.stringify(status, null, process.stdout.isTTY ? 2 : 0)}\n`);
|
|
998
|
+
process.exit(0);
|
|
999
|
+
}
|
|
1000
|
+
const lines = [
|
|
1001
|
+
`project: ${status.projectSlug}`,
|
|
1002
|
+
`environment: ${status.environmentName}`,
|
|
1003
|
+
`api: ${status.apiUrl}`,
|
|
1004
|
+
`auth: ${status.authenticationUrl}`,
|
|
1005
|
+
status.user ? `signed in: ${status.user.name} <${status.user.email}>` : `signed in: (no token for ${status.authenticationUrl} — run \`camox login\`)`
|
|
1006
|
+
];
|
|
1007
|
+
process.stdout.write(`${lines.join("\n")}\n`);
|
|
1008
|
+
process.exit(0);
|
|
1009
|
+
}
|
|
1010
|
+
//#endregion
|
|
476
1011
|
//#region src/index.ts
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
login: login_exports,
|
|
480
|
-
logout: logout_exports
|
|
481
|
-
}[run(defineProgram({
|
|
482
|
-
parser: or(parser$2, parser$1, parser),
|
|
1012
|
+
const result = runSync(defineProgram({
|
|
1013
|
+
parser: or(parser$5, parser$3, parser$2, parser, parser$1, parser$6, parser$4),
|
|
483
1014
|
metadata: {
|
|
484
1015
|
name: "camox",
|
|
485
1016
|
brief: message`Camox CLI`
|
|
486
1017
|
}
|
|
487
|
-
}), { help: "both" })
|
|
1018
|
+
}), { help: "both" });
|
|
1019
|
+
switch (result.command) {
|
|
1020
|
+
case "init":
|
|
1021
|
+
await handler$5();
|
|
1022
|
+
break;
|
|
1023
|
+
case "login":
|
|
1024
|
+
await handler$3();
|
|
1025
|
+
break;
|
|
1026
|
+
case "logout":
|
|
1027
|
+
handler$2();
|
|
1028
|
+
break;
|
|
1029
|
+
case "status":
|
|
1030
|
+
await handler(result);
|
|
1031
|
+
break;
|
|
1032
|
+
case "pages.list":
|
|
1033
|
+
case "pages.get":
|
|
1034
|
+
case "pages.create":
|
|
1035
|
+
case "pages.update":
|
|
1036
|
+
case "pages.set-layout":
|
|
1037
|
+
case "pages.delete":
|
|
1038
|
+
await handler$1(result);
|
|
1039
|
+
break;
|
|
1040
|
+
case "blocks.types":
|
|
1041
|
+
case "blocks.describe":
|
|
1042
|
+
case "blocks.create":
|
|
1043
|
+
case "blocks.edit":
|
|
1044
|
+
case "blocks.move":
|
|
1045
|
+
case "blocks.delete":
|
|
1046
|
+
await handler$6(result);
|
|
1047
|
+
break;
|
|
1048
|
+
case "layouts.list":
|
|
1049
|
+
await handler$4(result);
|
|
1050
|
+
break;
|
|
1051
|
+
}
|
|
488
1052
|
//#endregion
|
|
489
1053
|
export {};
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camox/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"bin": {
|
|
5
5
|
"camox": "./dist/index.mjs"
|
|
6
6
|
},
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
|
-
"
|
|
9
|
+
"templates"
|
|
10
10
|
],
|
|
11
11
|
"type": "module",
|
|
12
12
|
"main": "./dist/index.mjs",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"@optique/run": "*",
|
|
20
20
|
"@orpc/client": "^1.13.14",
|
|
21
21
|
"@orpc/server": "^1.13.14",
|
|
22
|
-
"slugify": "^1.6.9"
|
|
22
|
+
"slugify": "^1.6.9",
|
|
23
|
+
"zod": "^4.3.6"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
26
|
"@types/node": "^24.12.2",
|
|
26
27
|
"@typescript/native-preview": "7.0.0-dev.20260412.1",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"@camox/api-contract": "0.14.2"
|
|
28
|
+
"vite-plus": "latest",
|
|
29
|
+
"@camox/api-contract": "0.16.0"
|
|
30
30
|
},
|
|
31
31
|
"nx": {
|
|
32
32
|
"tags": [
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
]
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
|
-
"build": "
|
|
38
|
-
"dev": "
|
|
39
|
-
"lint": "
|
|
40
|
-
"check": "tsgo --noEmit &&
|
|
37
|
+
"build": "node scripts/sync-templates.mjs && vp pack",
|
|
38
|
+
"dev": "node scripts/sync-templates.mjs --watch --build",
|
|
39
|
+
"lint": "vp lint",
|
|
40
|
+
"check": "tsgo --noEmit && vp lint --fix"
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "@camox/template",
|
|
2
|
+
"name": "@camox/template-default",
|
|
3
3
|
"version": "0.0.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
"build": "vp build",
|
|
10
10
|
"serve": "vp preview",
|
|
11
11
|
"lint": "vp lint",
|
|
12
|
-
"check": "vp check"
|
|
13
|
-
"prepare": "vp config"
|
|
12
|
+
"check": "vp check"
|
|
14
13
|
},
|
|
15
14
|
"dependencies": {
|
|
16
15
|
"@base-ui/react": "^1.4.0",
|
|
@@ -9,14 +9,20 @@ import { defineConfig, loadEnv } from "vite-plus";
|
|
|
9
9
|
const env = loadEnv(process.env.NODE_ENV!, process.cwd(), "CAMOX_");
|
|
10
10
|
|
|
11
11
|
export default defineConfig({
|
|
12
|
-
staged: {
|
|
13
|
-
"*": "vp check --fix"
|
|
14
|
-
},
|
|
15
12
|
resolve: { tsconfigPaths: true },
|
|
16
13
|
plugins: [
|
|
17
14
|
tailwindcss(),
|
|
18
15
|
nitro(),
|
|
19
|
-
camox({
|
|
16
|
+
camox({
|
|
17
|
+
projectSlug: "camox-template-default-01", // camox-cli:replace-slug
|
|
18
|
+
syncSecret: env.CAMOX_SYNC_SECRET,
|
|
19
|
+
// camox-cli:dev-only-start
|
|
20
|
+
_internal: {
|
|
21
|
+
authenticationUrl: "http://localhost:3274",
|
|
22
|
+
apiUrl: "http://localhost:8787",
|
|
23
|
+
},
|
|
24
|
+
// camox-cli:dev-only-end
|
|
25
|
+
}),
|
|
20
26
|
tanstackStart(),
|
|
21
27
|
react(),
|
|
22
28
|
babelPlugin({ presets: [reactCompilerPreset()] }),
|
package/dist/api-CB7vjDU7.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
vp staged
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/camox/camox/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/camox/camox/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../camox/bin/camox.mjs" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../camox/bin/camox.mjs" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/camox/camox/node_modules/.pnpm/@tanstack+router-plugin@1.167.18_@tanstack+react-router@1.168.18_react-dom@19.2.5_react_f2f9ae7a1065a6f93975c3fa53defc29/node_modules/@tanstack/router-plugin/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/@tanstack+router-plugin@1.167.18_@tanstack+react-router@1.168.18_react-dom@19.2.5_react_f2f9ae7a1065a6f93975c3fa53defc29/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/camox/camox/node_modules/.pnpm/@tanstack+router-plugin@1.167.18_@tanstack+react-router@1.168.18_react-dom@19.2.5_react_f2f9ae7a1065a6f93975c3fa53defc29/node_modules/@tanstack/router-plugin/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/@tanstack+router-plugin@1.167.18_@tanstack+react-router@1.168.18_react-dom@19.2.5_react_f2f9ae7a1065a6f93975c3fa53defc29/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../@tanstack/router-plugin/bin/intent.js" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../@tanstack/router-plugin/bin/intent.js" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/camox/camox/node_modules/.pnpm/nitro@3.0.260311-beta_@libsql+client@0.17.2_better-sqlite3@12.8.0_dotenv@17.4.2_drizzle_5fa6c7540198165a12d0aaffa3900f1f/node_modules/nitro/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/nitro@3.0.260311-beta_@libsql+client@0.17.2_better-sqlite3@12.8.0_dotenv@17.4.2_drizzle_5fa6c7540198165a12d0aaffa3900f1f/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/camox/camox/node_modules/.pnpm/nitro@3.0.260311-beta_@libsql+client@0.17.2_better-sqlite3@12.8.0_dotenv@17.4.2_drizzle_5fa6c7540198165a12d0aaffa3900f1f/node_modules/nitro/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/nitro@3.0.260311-beta_@libsql+client@0.17.2_better-sqlite3@12.8.0_dotenv@17.4.2_drizzle_5fa6c7540198165a12d0aaffa3900f1f/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../nitro/dist/cli/index.mjs" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../nitro/dist/cli/index.mjs" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/camox/camox/node_modules/.pnpm/vite-plus@0.1.19_@opentelemetry+api@1.9.0_@types+node@24.12.2_esbuild@0.27.4_jiti@2.6.1_33f3463065f7b1de4fbe98a97ee72736/node_modules/vite-plus/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/vite-plus@0.1.19_@opentelemetry+api@1.9.0_@types+node@24.12.2_esbuild@0.27.4_jiti@2.6.1_33f3463065f7b1de4fbe98a97ee72736/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/camox/camox/node_modules/.pnpm/vite-plus@0.1.19_@opentelemetry+api@1.9.0_@types+node@24.12.2_esbuild@0.27.4_jiti@2.6.1_33f3463065f7b1de4fbe98a97ee72736/node_modules/vite-plus/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/vite-plus@0.1.19_@opentelemetry+api@1.9.0_@types+node@24.12.2_esbuild@0.27.4_jiti@2.6.1_33f3463065f7b1de4fbe98a97ee72736/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../vite-plus/bin/oxfmt" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../vite-plus/bin/oxfmt" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/camox/camox/node_modules/.pnpm/vite-plus@0.1.19_@opentelemetry+api@1.9.0_@types+node@24.12.2_esbuild@0.27.4_jiti@2.6.1_33f3463065f7b1de4fbe98a97ee72736/node_modules/vite-plus/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/vite-plus@0.1.19_@opentelemetry+api@1.9.0_@types+node@24.12.2_esbuild@0.27.4_jiti@2.6.1_33f3463065f7b1de4fbe98a97ee72736/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/camox/camox/node_modules/.pnpm/vite-plus@0.1.19_@opentelemetry+api@1.9.0_@types+node@24.12.2_esbuild@0.27.4_jiti@2.6.1_33f3463065f7b1de4fbe98a97ee72736/node_modules/vite-plus/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/vite-plus@0.1.19_@opentelemetry+api@1.9.0_@types+node@24.12.2_esbuild@0.27.4_jiti@2.6.1_33f3463065f7b1de4fbe98a97ee72736/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../vite-plus/bin/oxlint" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../vite-plus/bin/oxlint" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/camox/camox/node_modules/.pnpm/shadcn@4.3.1_@types+node@24.12.2_typescript@5.9.2/node_modules/shadcn/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/shadcn@4.3.1_@types+node@24.12.2_typescript@5.9.2/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/camox/camox/node_modules/.pnpm/shadcn@4.3.1_@types+node@24.12.2_typescript@5.9.2/node_modules/shadcn/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/shadcn@4.3.1_@types+node@24.12.2_typescript@5.9.2/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../shadcn/dist/index.js" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../shadcn/dist/index.js" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/camox/camox/node_modules/.pnpm/@typescript+native-preview@7.0.0-dev.20260412.1/node_modules/@typescript/native-preview/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/@typescript+native-preview@7.0.0-dev.20260412.1/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/camox/camox/node_modules/.pnpm/@typescript+native-preview@7.0.0-dev.20260412.1/node_modules/@typescript/native-preview/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/@typescript+native-preview@7.0.0-dev.20260412.1/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../@typescript/native-preview/bin/tsgo.js" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../@typescript/native-preview/bin/tsgo.js" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/camox/camox/node_modules/.pnpm/vite-plus@0.1.19_@opentelemetry+api@1.9.0_@types+node@24.12.2_esbuild@0.27.4_jiti@2.6.1_33f3463065f7b1de4fbe98a97ee72736/node_modules/vite-plus/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/vite-plus@0.1.19_@opentelemetry+api@1.9.0_@types+node@24.12.2_esbuild@0.27.4_jiti@2.6.1_33f3463065f7b1de4fbe98a97ee72736/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/camox/camox/node_modules/.pnpm/vite-plus@0.1.19_@opentelemetry+api@1.9.0_@types+node@24.12.2_esbuild@0.27.4_jiti@2.6.1_33f3463065f7b1de4fbe98a97ee72736/node_modules/vite-plus/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/vite-plus@0.1.19_@opentelemetry+api@1.9.0_@types+node@24.12.2_esbuild@0.27.4_jiti@2.6.1_33f3463065f7b1de4fbe98a97ee72736/node_modules:/home/runner/work/camox/camox/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../vite-plus/bin/vp" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../vite-plus/bin/vp" "$@"
|
|
21
|
-
fi
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|