convex 1.34.0 → 1.34.1
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 +12 -0
- package/dist/browser.bundle.js +6 -9
- package/dist/browser.bundle.js.map +2 -2
- package/dist/cjs/browser/sync/authentication_manager.js +4 -1
- package/dist/cjs/browser/sync/authentication_manager.js.map +2 -2
- package/dist/cjs/browser/sync/web_socket_manager.js +1 -7
- package/dist/cjs/browser/sync/web_socket_manager.js.map +2 -2
- package/dist/cjs/cli/aiFiles.js +15 -14
- package/dist/cjs/cli/aiFiles.js.map +2 -2
- package/dist/cjs/cli/configure.js +15 -10
- package/dist/cjs/cli/configure.js.map +2 -2
- package/dist/cjs/cli/lib/aiFiles/agentsmd.js +69 -0
- package/dist/cjs/cli/lib/aiFiles/agentsmd.js.map +7 -0
- package/dist/cjs/cli/lib/aiFiles/claudemd.js +69 -0
- package/dist/cjs/cli/lib/aiFiles/claudemd.js.map +7 -0
- package/dist/cjs/cli/lib/{ai → aiFiles}/config.js +73 -46
- package/dist/cjs/cli/lib/aiFiles/config.js.map +7 -0
- package/dist/cjs/cli/lib/aiFiles/cursorrules.js +48 -0
- package/dist/cjs/cli/lib/aiFiles/cursorrules.js.map +7 -0
- package/dist/cjs/cli/lib/aiFiles/guidelinesmd.js +51 -0
- package/dist/cjs/cli/lib/aiFiles/guidelinesmd.js.map +7 -0
- package/dist/cjs/cli/lib/aiFiles/index.js +231 -0
- package/dist/cjs/cli/lib/aiFiles/index.js.map +7 -0
- package/dist/cjs/cli/lib/aiFiles/paths.js.map +7 -0
- package/dist/cjs/cli/lib/aiFiles/skills.js +180 -0
- package/dist/cjs/cli/lib/aiFiles/skills.js.map +7 -0
- package/dist/cjs/cli/lib/aiFiles/status.js +195 -0
- package/dist/cjs/cli/lib/aiFiles/status.js.map +7 -0
- package/dist/cjs/cli/lib/aiFiles/utils.js +111 -0
- package/dist/cjs/cli/lib/aiFiles/utils.js.map +7 -0
- package/dist/cjs/cli/lib/command.js +6 -1
- package/dist/cjs/cli/lib/command.js.map +2 -2
- package/dist/cjs/cli/lib/config.js +3 -4
- package/dist/cjs/cli/lib/config.js.map +2 -2
- package/dist/cjs/cli/lib/localDeployment/anonymous.js +2 -2
- package/dist/cjs/cli/lib/localDeployment/anonymous.js.map +2 -2
- package/dist/cjs/cli/lib/updates.js +8 -8
- package/dist/cjs/cli/lib/updates.js.map +2 -2
- package/dist/cjs/cli/lib/versionApi.js +7 -4
- package/dist/cjs/cli/lib/versionApi.js.map +2 -2
- package/dist/cjs/cli/lib/workos/workos.js +4 -6
- package/dist/cjs/cli/lib/workos/workos.js.map +2 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs-types/browser/sync/authentication_manager.d.ts.map +1 -1
- package/dist/cjs-types/browser/sync/web_socket_manager.d.ts.map +1 -1
- package/dist/cjs-types/cli/aiFiles.d.ts.map +1 -1
- package/dist/cjs-types/cli/configure.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/aiFiles/agentsmd.d.ts +19 -0
- package/dist/cjs-types/cli/lib/aiFiles/agentsmd.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/aiFiles/agentsmd.test.d.ts +2 -0
- package/dist/cjs-types/cli/lib/aiFiles/agentsmd.test.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/aiFiles/claudemd.d.ts +19 -0
- package/dist/cjs-types/cli/lib/aiFiles/claudemd.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/aiFiles/claudemd.test.d.ts +2 -0
- package/dist/cjs-types/cli/lib/aiFiles/claudemd.test.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/aiFiles/config.d.ts +46 -0
- package/dist/cjs-types/cli/lib/aiFiles/config.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/aiFiles/config.test.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/aiFiles/cursorrules.d.ts +10 -0
- package/dist/cjs-types/cli/lib/aiFiles/cursorrules.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/aiFiles/guidelinesmd.d.ts +12 -0
- package/dist/cjs-types/cli/lib/aiFiles/guidelinesmd.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/aiFiles/guidelinesmd.test.d.ts +2 -0
- package/dist/cjs-types/cli/lib/aiFiles/guidelinesmd.test.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/aiFiles/index.d.ts +40 -0
- package/dist/cjs-types/cli/lib/aiFiles/index.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/aiFiles/index.test.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/aiFiles/integration.test.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/{ai → aiFiles}/paths.d.ts +4 -0
- package/dist/cjs-types/cli/lib/aiFiles/paths.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/aiFiles/prompt.test.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/aiFiles/skills.d.ts +18 -0
- package/dist/cjs-types/cli/lib/aiFiles/skills.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/aiFiles/status.d.ts +3 -0
- package/dist/cjs-types/cli/lib/aiFiles/status.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/aiFiles/utils.d.ts +46 -0
- package/dist/cjs-types/cli/lib/aiFiles/utils.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/config.d.ts +1 -0
- package/dist/cjs-types/cli/lib/config.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/versionApi.d.ts +7 -1
- package/dist/cjs-types/cli/lib/versionApi.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/workos/workos.d.ts.map +1 -1
- package/dist/cjs-types/index.d.ts +1 -1
- package/dist/cli.bundle.cjs +1605 -1548
- package/dist/cli.bundle.cjs.map +4 -4
- package/dist/esm/browser/sync/authentication_manager.js +4 -1
- package/dist/esm/browser/sync/authentication_manager.js.map +2 -2
- package/dist/esm/browser/sync/web_socket_manager.js +1 -7
- package/dist/esm/browser/sync/web_socket_manager.js.map +2 -2
- package/dist/esm/cli/aiFiles.js +17 -17
- package/dist/esm/cli/aiFiles.js.map +2 -2
- package/dist/esm/cli/configure.js +15 -10
- package/dist/esm/cli/configure.js.map +2 -2
- package/dist/esm/cli/lib/aiFiles/agentsmd.js +52 -0
- package/dist/esm/cli/lib/aiFiles/agentsmd.js.map +7 -0
- package/dist/esm/cli/lib/aiFiles/claudemd.js +52 -0
- package/dist/esm/cli/lib/aiFiles/claudemd.js.map +7 -0
- package/dist/esm/cli/lib/{ai → aiFiles}/config.js +71 -45
- package/dist/esm/cli/lib/aiFiles/config.js.map +7 -0
- package/dist/esm/cli/lib/aiFiles/cursorrules.js +16 -0
- package/dist/esm/cli/lib/aiFiles/cursorrules.js.map +7 -0
- package/dist/esm/cli/lib/aiFiles/guidelinesmd.js +28 -0
- package/dist/esm/cli/lib/aiFiles/guidelinesmd.js.map +7 -0
- package/dist/esm/cli/lib/aiFiles/index.js +210 -0
- package/dist/esm/cli/lib/aiFiles/index.js.map +7 -0
- package/dist/esm/cli/lib/aiFiles/paths.js.map +7 -0
- package/dist/esm/cli/lib/aiFiles/skills.js +147 -0
- package/dist/esm/cli/lib/aiFiles/skills.js.map +7 -0
- package/dist/esm/cli/lib/aiFiles/status.js +175 -0
- package/dist/esm/cli/lib/aiFiles/status.js.map +7 -0
- package/dist/esm/cli/lib/aiFiles/utils.js +82 -0
- package/dist/esm/cli/lib/aiFiles/utils.js.map +7 -0
- package/dist/esm/cli/lib/command.js +6 -1
- package/dist/esm/cli/lib/command.js.map +2 -2
- package/dist/esm/cli/lib/config.js +3 -4
- package/dist/esm/cli/lib/config.js.map +2 -2
- package/dist/esm/cli/lib/localDeployment/anonymous.js +2 -2
- package/dist/esm/cli/lib/localDeployment/anonymous.js.map +2 -2
- package/dist/esm/cli/lib/updates.js +8 -8
- package/dist/esm/cli/lib/updates.js.map +2 -2
- package/dist/esm/cli/lib/versionApi.js +7 -4
- package/dist/esm/cli/lib/versionApi.js.map +2 -2
- package/dist/esm/cli/lib/workos/workos.js +4 -6
- package/dist/esm/cli/lib/workos/workos.js.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm-types/browser/sync/authentication_manager.d.ts.map +1 -1
- package/dist/esm-types/browser/sync/web_socket_manager.d.ts.map +1 -1
- package/dist/esm-types/cli/aiFiles.d.ts.map +1 -1
- package/dist/esm-types/cli/configure.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/aiFiles/agentsmd.d.ts +19 -0
- package/dist/esm-types/cli/lib/aiFiles/agentsmd.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/aiFiles/agentsmd.test.d.ts +2 -0
- package/dist/esm-types/cli/lib/aiFiles/agentsmd.test.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/aiFiles/claudemd.d.ts +19 -0
- package/dist/esm-types/cli/lib/aiFiles/claudemd.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/aiFiles/claudemd.test.d.ts +2 -0
- package/dist/esm-types/cli/lib/aiFiles/claudemd.test.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/aiFiles/config.d.ts +46 -0
- package/dist/esm-types/cli/lib/aiFiles/config.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/aiFiles/config.test.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/aiFiles/cursorrules.d.ts +10 -0
- package/dist/esm-types/cli/lib/aiFiles/cursorrules.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/aiFiles/guidelinesmd.d.ts +12 -0
- package/dist/esm-types/cli/lib/aiFiles/guidelinesmd.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/aiFiles/guidelinesmd.test.d.ts +2 -0
- package/dist/esm-types/cli/lib/aiFiles/guidelinesmd.test.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/aiFiles/index.d.ts +40 -0
- package/dist/esm-types/cli/lib/aiFiles/index.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/aiFiles/index.test.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/aiFiles/integration.test.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/{ai → aiFiles}/paths.d.ts +4 -0
- package/dist/esm-types/cli/lib/aiFiles/paths.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/aiFiles/prompt.test.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/aiFiles/skills.d.ts +18 -0
- package/dist/esm-types/cli/lib/aiFiles/skills.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/aiFiles/status.d.ts +3 -0
- package/dist/esm-types/cli/lib/aiFiles/status.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/aiFiles/utils.d.ts +46 -0
- package/dist/esm-types/cli/lib/aiFiles/utils.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/config.d.ts +1 -0
- package/dist/esm-types/cli/lib/config.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/versionApi.d.ts +7 -1
- package/dist/esm-types/cli/lib/versionApi.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/workos/workos.d.ts.map +1 -1
- package/dist/esm-types/index.d.ts +1 -1
- package/dist/react.bundle.js +6 -9
- package/dist/react.bundle.js.map +2 -2
- package/package.json +1 -1
- package/schemas/convex.schema.json +7 -1
- package/src/browser/sync/authentication_manager.ts +9 -4
- package/src/browser/sync/client_node.test.ts +125 -0
- package/src/browser/sync/web_socket_manager.ts +1 -7
- package/src/cli/aiFiles.ts +20 -27
- package/src/cli/configure.ts +17 -11
- package/src/cli/deploymentSelection.test.ts +56 -2
- package/src/cli/lib/{ai → aiFiles}/MANUAL_TESTING.md +6 -2
- package/src/cli/lib/aiFiles/agentsmd.test.ts +133 -0
- package/src/cli/lib/aiFiles/agentsmd.ts +77 -0
- package/src/cli/lib/aiFiles/claudemd.test.ts +92 -0
- package/src/cli/lib/aiFiles/claudemd.ts +77 -0
- package/src/cli/lib/{ai → aiFiles}/config.test.ts +181 -59
- package/src/cli/lib/{ai → aiFiles}/config.ts +92 -63
- package/src/cli/lib/aiFiles/cursorrules.ts +25 -0
- package/src/cli/lib/aiFiles/guidelinesmd.test.ts +40 -0
- package/src/cli/lib/aiFiles/guidelinesmd.ts +41 -0
- package/src/cli/lib/{ai → aiFiles}/index.test.ts +200 -339
- package/src/cli/lib/aiFiles/index.ts +303 -0
- package/src/cli/lib/{ai → aiFiles}/integration.test.ts +117 -147
- package/src/cli/lib/{ai → aiFiles}/paths.ts +5 -0
- package/src/cli/lib/{ai → aiFiles}/prompt.test.ts +78 -30
- package/src/cli/lib/aiFiles/skills.ts +213 -0
- package/src/cli/lib/aiFiles/status.ts +240 -0
- package/src/cli/lib/aiFiles/utils.ts +163 -0
- package/src/cli/lib/command.ts +6 -1
- package/src/cli/lib/config.test.ts +1 -1
- package/src/cli/lib/config.ts +6 -5
- package/src/cli/lib/localDeployment/anonymous.ts +2 -2
- package/src/cli/lib/updates.test.ts +40 -30
- package/src/cli/lib/updates.ts +8 -8
- package/src/cli/lib/versionApi.test.ts +13 -10
- package/src/cli/lib/versionApi.ts +13 -5
- package/src/cli/lib/workos/workos.ts +4 -5
- package/src/index.ts +1 -1
- package/src/values/.claude/settings.local.json +10 -0
- package/dist/cjs/cli/lib/ai/config.js.map +0 -7
- package/dist/cjs/cli/lib/ai/index.js +0 -704
- package/dist/cjs/cli/lib/ai/index.js.map +0 -7
- package/dist/cjs/cli/lib/ai/paths.js.map +0 -7
- package/dist/cjs-types/cli/lib/ai/config.d.ts +0 -50
- package/dist/cjs-types/cli/lib/ai/config.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/ai/config.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/ai/index.d.ts +0 -56
- package/dist/cjs-types/cli/lib/ai/index.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/ai/index.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/ai/integration.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/ai/paths.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/ai/prompt.test.d.ts.map +0 -1
- package/dist/esm/cli/lib/ai/config.js.map +0 -7
- package/dist/esm/cli/lib/ai/index.js +0 -684
- package/dist/esm/cli/lib/ai/index.js.map +0 -7
- package/dist/esm/cli/lib/ai/paths.js.map +0 -7
- package/dist/esm-types/cli/lib/ai/config.d.ts +0 -50
- package/dist/esm-types/cli/lib/ai/config.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/ai/config.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/ai/index.d.ts +0 -56
- package/dist/esm-types/cli/lib/ai/index.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/ai/index.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/ai/integration.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/ai/paths.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/ai/prompt.test.d.ts.map +0 -1
- package/src/cli/lib/ai/index.ts +0 -1006
- /package/dist/cjs/cli/lib/{ai → aiFiles}/paths.js +0 -0
- /package/dist/cjs-types/cli/lib/{ai → aiFiles}/config.test.d.ts +0 -0
- /package/dist/cjs-types/cli/lib/{ai → aiFiles}/index.test.d.ts +0 -0
- /package/dist/cjs-types/cli/lib/{ai → aiFiles}/integration.test.d.ts +0 -0
- /package/dist/cjs-types/cli/lib/{ai → aiFiles}/prompt.test.d.ts +0 -0
- /package/dist/esm/cli/lib/{ai → aiFiles}/paths.js +0 -0
- /package/dist/esm-types/cli/lib/{ai → aiFiles}/config.test.d.ts +0 -0
- /package/dist/esm-types/cli/lib/{ai → aiFiles}/index.test.d.ts +0 -0
- /package/dist/esm-types/cli/lib/{ai → aiFiles}/integration.test.d.ts +0 -0
- /package/dist/esm-types/cli/lib/{ai → aiFiles}/prompt.test.d.ts +0 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var status_exports = {};
|
|
30
|
+
__export(status_exports, {
|
|
31
|
+
statusAiFiles: () => statusAiFiles
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(status_exports);
|
|
34
|
+
var import_path = __toESM(require("path"), 1);
|
|
35
|
+
var import_chalk = require("chalk");
|
|
36
|
+
var import_log = require("../../../bundler/log.js");
|
|
37
|
+
var import_agentsmd = require("../../codegen_templates/agentsmd.js");
|
|
38
|
+
var import_claudemd = require("../../codegen_templates/claudemd.js");
|
|
39
|
+
var import_versionApi = require("../versionApi.js");
|
|
40
|
+
var import_hash = require("../utils/hash.js");
|
|
41
|
+
var import_paths = require("./paths.js");
|
|
42
|
+
var import_config = require("./config.js");
|
|
43
|
+
var import_utils = require("./utils.js");
|
|
44
|
+
function logGuidelinesStatus({
|
|
45
|
+
guidelinesFile,
|
|
46
|
+
guidelinesRelPath,
|
|
47
|
+
config,
|
|
48
|
+
canonicalGuidelinesHash,
|
|
49
|
+
networkAvailable
|
|
50
|
+
}) {
|
|
51
|
+
if (guidelinesFile === null) {
|
|
52
|
+
(0, import_log.logMessage)(
|
|
53
|
+
` ${import_chalk.chalkStderr.yellow("\u26A0")} ${guidelinesRelPath}: not on disk \u2014 run ${import_chalk.chalkStderr.bold("npx convex ai-files install")} to reinstall`
|
|
54
|
+
);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const isLocallyModified = config.guidelinesHash !== null && (0, import_hash.hashSha256)(guidelinesFile) !== config.guidelinesHash;
|
|
58
|
+
if (isLocallyModified) {
|
|
59
|
+
(0, import_log.logMessage)(
|
|
60
|
+
` ${import_chalk.chalkStderr.yellow("\u26A0")} ${guidelinesRelPath}: installed, modified locally (changes will be overwritten on next update)`
|
|
61
|
+
);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const isOutOfDate = networkAvailable && canonicalGuidelinesHash !== null && config.guidelinesHash !== null && config.guidelinesHash !== canonicalGuidelinesHash;
|
|
65
|
+
if (isOutOfDate) {
|
|
66
|
+
(0, import_log.logMessage)(
|
|
67
|
+
` ${import_chalk.chalkStderr.yellow("\u26A0")} ${guidelinesRelPath}: installed, out of date \u2014 run ${import_chalk.chalkStderr.bold("npx convex ai-files update")}`
|
|
68
|
+
);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
(0, import_log.logMessage)(
|
|
72
|
+
` ${import_chalk.chalkStderr.green("\u2714")} ${guidelinesRelPath}: installed${networkAvailable ? ", up to date" : ""}`
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
function logAgentsMdStatus({
|
|
76
|
+
agentsContent,
|
|
77
|
+
config,
|
|
78
|
+
convexDirName
|
|
79
|
+
}) {
|
|
80
|
+
const hasSection = agentsContent !== null && agentsContent.includes(import_agentsmd.AGENTS_MD_START_MARKER) && agentsContent.includes(import_agentsmd.AGENTS_MD_END_MARKER);
|
|
81
|
+
if (!hasSection) {
|
|
82
|
+
(0, import_log.logMessage)(
|
|
83
|
+
` ${import_chalk.chalkStderr.yellow("\u26A0")} AGENTS.md: Convex section missing \u2014 run ${import_chalk.chalkStderr.bold("npx convex ai-files install")} to reinstall`
|
|
84
|
+
);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const currentHash = (0, import_hash.hashSha256)((0, import_agentsmd.agentsMdConvexSection)(convexDirName));
|
|
88
|
+
if (config.agentsMdSectionHash !== null && config.agentsMdSectionHash !== currentHash) {
|
|
89
|
+
(0, import_log.logMessage)(
|
|
90
|
+
` ${import_chalk.chalkStderr.yellow("\u26A0")} AGENTS.md: Convex section out of date \u2014 run ${import_chalk.chalkStderr.bold("npx convex ai-files update")}`
|
|
91
|
+
);
|
|
92
|
+
} else {
|
|
93
|
+
(0, import_log.logMessage)(
|
|
94
|
+
` ${import_chalk.chalkStderr.green("\u2714")} AGENTS.md: Convex section present, up to date`
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function logClaudeMdStatus({
|
|
99
|
+
claudeContent,
|
|
100
|
+
config,
|
|
101
|
+
convexDirName
|
|
102
|
+
}) {
|
|
103
|
+
const hasSection = claudeContent !== null && claudeContent.includes(import_claudemd.CLAUDE_MD_START_MARKER) && claudeContent.includes(import_claudemd.CLAUDE_MD_END_MARKER);
|
|
104
|
+
if (!hasSection) {
|
|
105
|
+
if (claudeContent === null) {
|
|
106
|
+
(0, import_log.logMessage)(
|
|
107
|
+
` ${import_chalk.chalkStderr.yellow("\u26A0")} CLAUDE.md: missing - run ${import_chalk.chalkStderr.bold("npx convex ai-files install")} to create it`
|
|
108
|
+
);
|
|
109
|
+
} else {
|
|
110
|
+
(0, import_log.logMessage)(
|
|
111
|
+
` ${import_chalk.chalkStderr.yellow("\u26A0")} CLAUDE.md: no Convex section present - run ${import_chalk.chalkStderr.bold("npx convex ai-files update")} to add it`
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const currentHash = (0, import_hash.hashSha256)((0, import_claudemd.claudeMdConvexSection)(convexDirName));
|
|
117
|
+
if (config.claudeMdHash !== null && config.claudeMdHash !== currentHash) {
|
|
118
|
+
(0, import_log.logMessage)(
|
|
119
|
+
` ${import_chalk.chalkStderr.yellow("\u26A0")} CLAUDE.md: Convex section out of date - run ${import_chalk.chalkStderr.bold("npx convex ai-files update")}`
|
|
120
|
+
);
|
|
121
|
+
} else {
|
|
122
|
+
(0, import_log.logMessage)(
|
|
123
|
+
` ${import_chalk.chalkStderr.green("\u2714")} CLAUDE.md: Convex section present, up to date`
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function logSkillsStatus({
|
|
128
|
+
config,
|
|
129
|
+
canonicalAgentSkillsSha,
|
|
130
|
+
networkAvailable
|
|
131
|
+
}) {
|
|
132
|
+
if (config.installedSkillNames.length === 0) {
|
|
133
|
+
(0, import_log.logMessage)(
|
|
134
|
+
` ${import_chalk.chalkStderr.yellow("\u26A0")} Agent skills: not installed \u2014 run ${import_chalk.chalkStderr.bold("npx convex ai-files install")} to install`
|
|
135
|
+
);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const skillsList = config.installedSkillNames.join(", ");
|
|
139
|
+
const isStale = networkAvailable && canonicalAgentSkillsSha !== null && config.agentSkillsSha !== null && config.agentSkillsSha !== canonicalAgentSkillsSha;
|
|
140
|
+
if (isStale) {
|
|
141
|
+
(0, import_log.logMessage)(
|
|
142
|
+
` ${import_chalk.chalkStderr.yellow("\u26A0")} Agent skills: ${skillsList} \u2014 out of date, run ${import_chalk.chalkStderr.bold("npx convex ai-files update")}`
|
|
143
|
+
);
|
|
144
|
+
} else {
|
|
145
|
+
(0, import_log.logMessage)(
|
|
146
|
+
` ${import_chalk.chalkStderr.green("\u2714")} Agent skills: ${skillsList}${networkAvailable ? " (up to date)" : ""}`
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
async function statusAiFiles({
|
|
151
|
+
projectDir,
|
|
152
|
+
convexDir
|
|
153
|
+
}) {
|
|
154
|
+
const convexDirName = import_path.default.relative(projectDir, convexDir);
|
|
155
|
+
const guidelinesRelPath = import_path.default.relative(
|
|
156
|
+
projectDir,
|
|
157
|
+
(0, import_paths.guidelinesPathForConvexDir)(convexDir)
|
|
158
|
+
);
|
|
159
|
+
const config = await (0, import_config.readAiConfig)({ projectDir, convexDir });
|
|
160
|
+
if (config === null) {
|
|
161
|
+
(0, import_log.logMessage)(`Convex AI files: ${import_chalk.chalkStderr.yellow("not installed")}`);
|
|
162
|
+
(0, import_log.logMessage)(
|
|
163
|
+
` Run ${import_chalk.chalkStderr.bold("npx convex ai-files install")} to get started, or ${import_chalk.chalkStderr.bold("npx convex ai-files disable")} to opt out.`
|
|
164
|
+
);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
if (!config.enabled) {
|
|
168
|
+
(0, import_log.logMessage)(`Convex AI files: ${import_chalk.chalkStderr.yellow("disabled")}`);
|
|
169
|
+
(0, import_log.logMessage)(
|
|
170
|
+
` Run ${import_chalk.chalkStderr.bold("npx convex ai-files enable")} to re-enable.`
|
|
171
|
+
);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
(0, import_log.logMessage)(`Convex AI files: ${import_chalk.chalkStderr.green("enabled")}`);
|
|
175
|
+
const [versionData, guidelinesFile, agentsContent, claudeContent] = await Promise.all([
|
|
176
|
+
(0, import_versionApi.getVersion)(),
|
|
177
|
+
(0, import_utils.readFileSafe)((0, import_paths.guidelinesPathForConvexDir)(convexDir)),
|
|
178
|
+
(0, import_utils.readFileSafe)((0, import_paths.agentsMdPath)(projectDir)),
|
|
179
|
+
(0, import_utils.readFileSafe)((0, import_paths.claudeMdPath)(projectDir))
|
|
180
|
+
]);
|
|
181
|
+
const networkAvailable = versionData.kind === "ok";
|
|
182
|
+
const canonicalGuidelinesHash = networkAvailable ? versionData.data.guidelinesHash : null;
|
|
183
|
+
const canonicalAgentSkillsSha = networkAvailable ? versionData.data.agentSkillsSha : null;
|
|
184
|
+
logGuidelinesStatus({
|
|
185
|
+
guidelinesFile,
|
|
186
|
+
guidelinesRelPath,
|
|
187
|
+
config,
|
|
188
|
+
canonicalGuidelinesHash,
|
|
189
|
+
networkAvailable
|
|
190
|
+
});
|
|
191
|
+
logAgentsMdStatus({ agentsContent, config, convexDirName });
|
|
192
|
+
logClaudeMdStatus({ claudeContent, config, convexDirName });
|
|
193
|
+
logSkillsStatus({ config, canonicalAgentSkillsSha, networkAvailable });
|
|
194
|
+
}
|
|
195
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/cli/lib/aiFiles/status.ts"],
|
|
4
|
+
"sourcesContent": ["import path from \"path\";\nimport { chalkStderr } from \"chalk\";\nimport { logMessage } from \"../../../bundler/log.js\";\nimport {\n AGENTS_MD_START_MARKER,\n AGENTS_MD_END_MARKER,\n agentsMdConvexSection,\n} from \"../../codegen_templates/agentsmd.js\";\nimport {\n CLAUDE_MD_START_MARKER,\n CLAUDE_MD_END_MARKER,\n claudeMdConvexSection,\n} from \"../../codegen_templates/claudemd.js\";\nimport { getVersion } from \"../versionApi.js\";\nimport { hashSha256 } from \"../utils/hash.js\";\nimport {\n type AiFilesPaths,\n agentsMdPath,\n claudeMdPath,\n guidelinesPathForConvexDir,\n} from \"./paths.js\";\nimport { type AiFilesConfig, readAiConfig } from \"./config.js\";\nimport { readFileSafe } from \"./utils.js\";\n\nfunction logGuidelinesStatus({\n guidelinesFile,\n guidelinesRelPath,\n config,\n canonicalGuidelinesHash,\n networkAvailable,\n}: {\n guidelinesFile: string | null;\n guidelinesRelPath: string;\n config: AiFilesConfig;\n canonicalGuidelinesHash: string | null;\n networkAvailable: boolean;\n}): void {\n if (guidelinesFile === null) {\n logMessage(\n ` ${chalkStderr.yellow(\"\u26A0\")} ${guidelinesRelPath}: not on disk \u2014 run ${chalkStderr.bold(\"npx convex ai-files install\")} to reinstall`,\n );\n return;\n }\n\n const isLocallyModified =\n config.guidelinesHash !== null &&\n hashSha256(guidelinesFile) !== config.guidelinesHash;\n\n if (isLocallyModified) {\n logMessage(\n ` ${chalkStderr.yellow(\"\u26A0\")} ${guidelinesRelPath}: installed, modified locally (changes will be overwritten on next update)`,\n );\n return;\n }\n\n const isOutOfDate =\n networkAvailable &&\n canonicalGuidelinesHash !== null &&\n config.guidelinesHash !== null &&\n config.guidelinesHash !== canonicalGuidelinesHash;\n\n if (isOutOfDate) {\n logMessage(\n ` ${chalkStderr.yellow(\"\u26A0\")} ${guidelinesRelPath}: installed, out of date \u2014 run ${chalkStderr.bold(\"npx convex ai-files update\")}`,\n );\n return;\n }\n\n logMessage(\n ` ${chalkStderr.green(\"\u2714\")} ${guidelinesRelPath}: installed${networkAvailable ? \", up to date\" : \"\"}`,\n );\n}\n\nfunction logAgentsMdStatus({\n agentsContent,\n config,\n convexDirName,\n}: {\n agentsContent: string | null;\n config: AiFilesConfig;\n convexDirName: string;\n}): void {\n const hasSection =\n agentsContent !== null &&\n agentsContent.includes(AGENTS_MD_START_MARKER) &&\n agentsContent.includes(AGENTS_MD_END_MARKER);\n\n if (!hasSection) {\n logMessage(\n ` ${chalkStderr.yellow(\"\u26A0\")} AGENTS.md: Convex section missing \u2014 run ${chalkStderr.bold(\"npx convex ai-files install\")} to reinstall`,\n );\n return;\n }\n\n const currentHash = hashSha256(agentsMdConvexSection(convexDirName));\n if (\n config.agentsMdSectionHash !== null &&\n config.agentsMdSectionHash !== currentHash\n ) {\n logMessage(\n ` ${chalkStderr.yellow(\"\u26A0\")} AGENTS.md: Convex section out of date \u2014 run ${chalkStderr.bold(\"npx convex ai-files update\")}`,\n );\n } else {\n logMessage(\n ` ${chalkStderr.green(\"\u2714\")} AGENTS.md: Convex section present, up to date`,\n );\n }\n}\n\nfunction logClaudeMdStatus({\n claudeContent,\n config,\n convexDirName,\n}: {\n claudeContent: string | null;\n config: AiFilesConfig;\n convexDirName: string;\n}): void {\n const hasSection =\n claudeContent !== null &&\n claudeContent.includes(CLAUDE_MD_START_MARKER) &&\n claudeContent.includes(CLAUDE_MD_END_MARKER);\n\n if (!hasSection) {\n if (claudeContent === null) {\n logMessage(\n ` ${chalkStderr.yellow(\"\u26A0\")} CLAUDE.md: missing - run ${chalkStderr.bold(\"npx convex ai-files install\")} to create it`,\n );\n } else {\n logMessage(\n ` ${chalkStderr.yellow(\"\u26A0\")} CLAUDE.md: no Convex section present - run ${chalkStderr.bold(\"npx convex ai-files update\")} to add it`,\n );\n }\n return;\n }\n\n const currentHash = hashSha256(claudeMdConvexSection(convexDirName));\n if (config.claudeMdHash !== null && config.claudeMdHash !== currentHash) {\n logMessage(\n ` ${chalkStderr.yellow(\"\u26A0\")} CLAUDE.md: Convex section out of date - run ${chalkStderr.bold(\"npx convex ai-files update\")}`,\n );\n } else {\n logMessage(\n ` ${chalkStderr.green(\"\u2714\")} CLAUDE.md: Convex section present, up to date`,\n );\n }\n}\n\nfunction logSkillsStatus({\n config,\n canonicalAgentSkillsSha,\n networkAvailable,\n}: {\n config: AiFilesConfig;\n canonicalAgentSkillsSha: string | null;\n networkAvailable: boolean;\n}): void {\n if (config.installedSkillNames.length === 0) {\n logMessage(\n ` ${chalkStderr.yellow(\"\u26A0\")} Agent skills: not installed \u2014 run ${chalkStderr.bold(\"npx convex ai-files install\")} to install`,\n );\n return;\n }\n\n const skillsList = config.installedSkillNames.join(\", \");\n const isStale =\n networkAvailable &&\n canonicalAgentSkillsSha !== null &&\n config.agentSkillsSha !== null &&\n config.agentSkillsSha !== canonicalAgentSkillsSha;\n\n if (isStale) {\n logMessage(\n ` ${chalkStderr.yellow(\"\u26A0\")} Agent skills: ${skillsList} \u2014 out of date, run ${chalkStderr.bold(\"npx convex ai-files update\")}`,\n );\n } else {\n logMessage(\n ` ${chalkStderr.green(\"\u2714\")} Agent skills: ${skillsList}${networkAvailable ? \" (up to date)\" : \"\"}`,\n );\n }\n}\n\nexport async function statusAiFiles({\n projectDir,\n convexDir,\n}: AiFilesPaths): Promise<void> {\n const convexDirName = path.relative(projectDir, convexDir);\n const guidelinesRelPath = path.relative(\n projectDir,\n guidelinesPathForConvexDir(convexDir),\n );\n\n const config = await readAiConfig({ projectDir, convexDir });\n\n if (config === null) {\n logMessage(`Convex AI files: ${chalkStderr.yellow(\"not installed\")}`);\n logMessage(\n ` Run ${chalkStderr.bold(\"npx convex ai-files install\")} to get started, ` +\n `or ${chalkStderr.bold(\"npx convex ai-files disable\")} to opt out.`,\n );\n return;\n }\n\n if (!config.enabled) {\n logMessage(`Convex AI files: ${chalkStderr.yellow(\"disabled\")}`);\n logMessage(\n ` Run ${chalkStderr.bold(\"npx convex ai-files enable\")} to re-enable.`,\n );\n return;\n }\n\n logMessage(`Convex AI files: ${chalkStderr.green(\"enabled\")}`);\n\n const [versionData, guidelinesFile, agentsContent, claudeContent] =\n await Promise.all([\n getVersion(),\n readFileSafe(guidelinesPathForConvexDir(convexDir)),\n readFileSafe(agentsMdPath(projectDir)),\n readFileSafe(claudeMdPath(projectDir)),\n ]);\n\n const networkAvailable = versionData.kind === \"ok\";\n const canonicalGuidelinesHash = networkAvailable\n ? versionData.data.guidelinesHash\n : null;\n const canonicalAgentSkillsSha = networkAvailable\n ? versionData.data.agentSkillsSha\n : null;\n\n logGuidelinesStatus({\n guidelinesFile,\n guidelinesRelPath,\n config,\n canonicalGuidelinesHash,\n networkAvailable,\n });\n logAgentsMdStatus({ agentsContent, config, convexDirName });\n logClaudeMdStatus({ claudeContent, config, convexDirName });\n logSkillsStatus({ config, canonicalAgentSkillsSha, networkAvailable });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,mBAA4B;AAC5B,iBAA2B;AAC3B,sBAIO;AACP,sBAIO;AACP,wBAA2B;AAC3B,kBAA2B;AAC3B,mBAKO;AACP,oBAAiD;AACjD,mBAA6B;AAE7B,SAAS,oBAAoB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAMS;AACP,MAAI,mBAAmB,MAAM;AAC3B;AAAA,MACE,KAAK,yBAAY,OAAO,QAAG,CAAC,IAAI,iBAAiB,4BAAuB,yBAAY,KAAK,6BAA6B,CAAC;AAAA,IACzH;AACA;AAAA,EACF;AAEA,QAAM,oBACJ,OAAO,mBAAmB,YAC1B,wBAAW,cAAc,MAAM,OAAO;AAExC,MAAI,mBAAmB;AACrB;AAAA,MACE,KAAK,yBAAY,OAAO,QAAG,CAAC,IAAI,iBAAiB;AAAA,IACnD;AACA;AAAA,EACF;AAEA,QAAM,cACJ,oBACA,4BAA4B,QAC5B,OAAO,mBAAmB,QAC1B,OAAO,mBAAmB;AAE5B,MAAI,aAAa;AACf;AAAA,MACE,KAAK,yBAAY,OAAO,QAAG,CAAC,IAAI,iBAAiB,uCAAkC,yBAAY,KAAK,4BAA4B,CAAC;AAAA,IACnI;AACA;AAAA,EACF;AAEA;AAAA,IACE,KAAK,yBAAY,MAAM,QAAG,CAAC,IAAI,iBAAiB,cAAc,mBAAmB,iBAAiB,EAAE;AAAA,EACtG;AACF;AAEA,SAAS,kBAAkB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AACF,GAIS;AACP,QAAM,aACJ,kBAAkB,QAClB,cAAc,SAAS,sCAAsB,KAC7C,cAAc,SAAS,oCAAoB;AAE7C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IAAI;AAAA,QAChB,8BAAW;AAAA,QACX,+BAAa,yCAA2B,SAAS,CAAC;AAAA,QAClD,+BAAa,2BAAa,UAAU,CAAC;AAAA,QACrC,+BAAa,2BAAa,UAAU,CAAC;AAAA,EACvC,CAAC;AAEH,QAAM,mBAAmB,YAAY,SAAS;AAC9C,QAAM,0BAA0B,mBAC5B,YAAY,KAAK,iBACjB;AACJ,QAAM,0BAA0B,mBAC5B,YAAY,KAAK,iBACjB;AAEJ,sBAAoB;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,oBAAkB,EAAE,eAAe,QAAQ,cAAc,CAAC;AAC1D,oBAAkB,EAAE,eAAe,QAAQ,cAAc,CAAC;AAC1D,kBAAgB,EAAE,QAAQ,yBAAyB,iBAAiB,CAAC;AACvE;",
|
|
6
|
+
"names": ["path"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var utils_exports = {};
|
|
20
|
+
__export(utils_exports, {
|
|
21
|
+
hasManagedSection: () => hasManagedSection,
|
|
22
|
+
iife: () => iife,
|
|
23
|
+
injectManagedSection: () => injectManagedSection,
|
|
24
|
+
isInInteractiveTerminal: () => isInInteractiveTerminal,
|
|
25
|
+
readFileSafe: () => readFileSafe,
|
|
26
|
+
removeMarkdownSection: () => removeMarkdownSection,
|
|
27
|
+
safelyDeleteFile: () => safelyDeleteFile,
|
|
28
|
+
stripManagedSection: () => stripManagedSection
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(utils_exports);
|
|
31
|
+
var import_fs = require("fs");
|
|
32
|
+
var import_chalk = require("chalk");
|
|
33
|
+
var import_log = require("../../../bundler/log.js");
|
|
34
|
+
var import_hash = require("../utils/hash.js");
|
|
35
|
+
function isInInteractiveTerminal() {
|
|
36
|
+
return process.stdin.isTTY === true;
|
|
37
|
+
}
|
|
38
|
+
async function readFileSafe(filePath) {
|
|
39
|
+
try {
|
|
40
|
+
return await import_fs.promises.readFile(filePath, "utf8");
|
|
41
|
+
} catch {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async function safelyDeleteFile(filePath) {
|
|
46
|
+
try {
|
|
47
|
+
await import_fs.promises.unlink(filePath);
|
|
48
|
+
return true;
|
|
49
|
+
} catch {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const iife = (fn) => fn();
|
|
54
|
+
async function injectManagedSection(opts) {
|
|
55
|
+
const { filePath, startMarker, endMarker, section } = opts;
|
|
56
|
+
const existing = await readFileSafe(filePath) ?? "";
|
|
57
|
+
const startIdx = existing.indexOf(startMarker);
|
|
58
|
+
const endIdx = existing.indexOf(endMarker);
|
|
59
|
+
const updated = iife(() => {
|
|
60
|
+
if (startIdx !== -1 && endIdx !== -1)
|
|
61
|
+
return existing.slice(0, startIdx) + section + existing.slice(endIdx + endMarker.length);
|
|
62
|
+
if (existing.length > 0)
|
|
63
|
+
return existing.trimEnd() + "\n\n" + section + "\n";
|
|
64
|
+
return section + "\n";
|
|
65
|
+
});
|
|
66
|
+
const didWrite = updated !== existing;
|
|
67
|
+
if (didWrite) await import_fs.promises.writeFile(filePath, updated, "utf8");
|
|
68
|
+
return { sectionHash: (0, import_hash.hashSha256)(section), didWrite };
|
|
69
|
+
}
|
|
70
|
+
async function stripManagedSection(opts) {
|
|
71
|
+
const { filePath, startMarker, endMarker } = opts;
|
|
72
|
+
const content = await readFileSafe(filePath);
|
|
73
|
+
if (content === null) return "none";
|
|
74
|
+
const startIdx = content.indexOf(startMarker);
|
|
75
|
+
const endIdx = content.indexOf(endMarker);
|
|
76
|
+
if (startIdx === -1 || endIdx === -1) {
|
|
77
|
+
return "none";
|
|
78
|
+
}
|
|
79
|
+
const before = content.slice(0, startIdx).trimEnd();
|
|
80
|
+
const after = content.slice(endIdx + endMarker.length).trimStart();
|
|
81
|
+
const updated = [before, after].filter(Boolean).join("\n\n");
|
|
82
|
+
if (!updated.trim()) {
|
|
83
|
+
await safelyDeleteFile(filePath);
|
|
84
|
+
return "file";
|
|
85
|
+
}
|
|
86
|
+
await import_fs.promises.writeFile(filePath, updated + "\n", "utf8");
|
|
87
|
+
return "section";
|
|
88
|
+
}
|
|
89
|
+
async function removeMarkdownSection({
|
|
90
|
+
projectDir,
|
|
91
|
+
strip,
|
|
92
|
+
fileName
|
|
93
|
+
}) {
|
|
94
|
+
const result = await strip(projectDir);
|
|
95
|
+
if (result === "section") {
|
|
96
|
+
(0, import_log.logMessage)(
|
|
97
|
+
`${import_chalk.chalkStderr.green("\u2714")} Removed Convex section from ${fileName}.`
|
|
98
|
+
);
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
if (result === "file") {
|
|
102
|
+
(0, import_log.logMessage)(`${import_chalk.chalkStderr.green("\u2714")} Deleted ${fileName}.`);
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
async function hasManagedSection(opts) {
|
|
108
|
+
const content = await readFileSafe(opts.filePath);
|
|
109
|
+
return content !== null && content.includes(opts.startMarker) && content.includes(opts.endMarker);
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/cli/lib/aiFiles/utils.ts"],
|
|
4
|
+
"sourcesContent": ["// eslint-disable-next-line no-restricted-imports\nimport { promises as fs } from \"fs\";\nimport { chalkStderr } from \"chalk\";\nimport { logMessage } from \"../../../bundler/log.js\";\nimport { hashSha256 } from \"../utils/hash.js\";\n\nexport function isInInteractiveTerminal(): boolean {\n return process.stdin.isTTY === true;\n}\n\nexport async function readFileSafe(filePath: string): Promise<string | null> {\n try {\n return await fs.readFile(filePath, \"utf8\");\n } catch {\n return null;\n }\n}\n\n/**\n * Attempt to delete a file. Returns `true` if the file was deleted,\n * `false` if it didn't exist or the deletion failed.\n */\nexport async function safelyDeleteFile(filePath: string): Promise<boolean> {\n try {\n await fs.unlink(filePath);\n return true;\n } catch {\n return false;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Generic managed-section helpers\n//\n// Several files (AGENTS.md, CLAUDE.md) contain a Convex-managed section\n// delimited by start/end markers. These helpers provide the common logic\n// for injecting, stripping, and detecting those sections.\n// ---------------------------------------------------------------------------\n\nexport type ManagedSectionTarget = {\n filePath: string;\n startMarker: string;\n endMarker: string;\n};\n\nexport type InjectResult = {\n sectionHash: string;\n didWrite: boolean;\n};\n\nexport const iife = <T>(fn: () => T): T => fn();\n\n/**\n * Inject a managed section into a file. If the file already contains the\n * markers, the section between them is replaced. Otherwise the section is\n * appended (or the file is created). Only writes when content actually\n * changes.\n */\nexport async function injectManagedSection(\n opts: ManagedSectionTarget & { section: string },\n): Promise<InjectResult> {\n const { filePath, startMarker, endMarker, section } = opts;\n\n const existing = (await readFileSafe(filePath)) ?? \"\";\n\n const startIdx = existing.indexOf(startMarker);\n const endIdx = existing.indexOf(endMarker);\n\n const updated = iife(() => {\n if (startIdx !== -1 && endIdx !== -1)\n return (\n existing.slice(0, startIdx) +\n section +\n existing.slice(endIdx + endMarker.length)\n );\n if (existing.length > 0)\n return existing.trimEnd() + \"\\n\\n\" + section + \"\\n\";\n\n return section + \"\\n\";\n });\n\n const didWrite = updated !== existing;\n if (didWrite) await fs.writeFile(filePath, updated, \"utf8\");\n\n return { sectionHash: hashSha256(section), didWrite };\n}\n\nexport type StripResult = \"none\" | \"section\" | \"file\";\n\n/**\n * Remove the managed section (between start/end markers) from a file.\n * If the file is empty after removal, it is deleted.\n *\n * Returns `\"none\"` if the file doesn't exist or has no markers,\n * `\"section\"` if the section was stripped, or `\"file\"` if the entire\n * file was deleted.\n */\nexport async function stripManagedSection(\n opts: ManagedSectionTarget,\n): Promise<StripResult> {\n const { filePath, startMarker, endMarker } = opts;\n\n const content = await readFileSafe(filePath);\n if (content === null) return \"none\";\n\n const startIdx = content.indexOf(startMarker);\n const endIdx = content.indexOf(endMarker);\n if (startIdx === -1 || endIdx === -1) {\n return \"none\";\n }\n\n const before = content.slice(0, startIdx).trimEnd();\n const after = content.slice(endIdx + endMarker.length).trimStart();\n const updated = [before, after].filter(Boolean).join(\"\\n\\n\");\n\n if (!updated.trim()) {\n await safelyDeleteFile(filePath);\n return \"file\";\n }\n\n await fs.writeFile(filePath, updated + \"\\n\", \"utf8\");\n return \"section\";\n}\n\nexport async function removeMarkdownSection({\n projectDir,\n strip,\n fileName,\n}: {\n projectDir: string;\n strip: (dir: string) => Promise<StripResult>;\n fileName: string;\n}): Promise<boolean> {\n const result = await strip(projectDir);\n\n if (result === \"section\") {\n logMessage(\n `${chalkStderr.green(\"\u2714\")} Removed Convex section from ${fileName}.`,\n );\n return true;\n }\n\n if (result === \"file\") {\n logMessage(`${chalkStderr.green(\"\u2714\")} Deleted ${fileName}.`);\n return true;\n }\n\n return false;\n}\n\n/**\n * Check whether a file contains a managed section (both markers present).\n */\nexport async function hasManagedSection(\n opts: ManagedSectionTarget,\n): Promise<boolean> {\n const content = await readFileSafe(opts.filePath);\n return (\n content !== null &&\n content.includes(opts.startMarker) &&\n content.includes(opts.endMarker)\n );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,gBAA+B;AAC/B,mBAA4B;AAC5B,iBAA2B;AAC3B,kBAA2B;AAEpB,SAAS,0BAAmC;AACjD,SAAO,QAAQ,MAAM,UAAU;AACjC;AAEA,eAAsB,aAAa,UAA0C;AAC3E,MAAI;AACF,WAAO,MAAM,UAAAA,SAAG,SAAS,UAAU,MAAM;AAAA,EAC3C,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAMA,eAAsB,iBAAiB,UAAoC;AACzE,MAAI;AACF,UAAM,UAAAA,SAAG,OAAO,QAAQ;AACxB,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAqBO,MAAM,OAAO,CAAI,OAAmB,GAAG;AAQ9C,eAAsB,qBACpB,MACuB;AACvB,QAAM,EAAE,UAAU,aAAa,WAAW,QAAQ,IAAI;AAEtD,QAAM,WAAY,MAAM,aAAa,QAAQ,KAAM;AAEnD,QAAM,WAAW,SAAS,QAAQ,WAAW;AAC7C,QAAM,SAAS,SAAS,QAAQ,SAAS;AAEzC,QAAM,UAAU,KAAK,MAAM;AACzB,QAAI,aAAa,MAAM,WAAW;AAChC,aACE,SAAS,MAAM,GAAG,QAAQ,IAC1B,UACA,SAAS,MAAM,SAAS,UAAU,MAAM;AAE5C,QAAI,SAAS,SAAS;AACpB,aAAO,SAAS,QAAQ,IAAI,SAAS,UAAU;AAEjD,WAAO,UAAU;AAAA,EACnB,CAAC;AAED,QAAM,WAAW,YAAY;AAC7B,MAAI,SAAU,OAAM,UAAAA,SAAG,UAAU,UAAU,SAAS,MAAM;AAE1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|
+
}
|
|
@@ -122,7 +122,12 @@ import_extra_typings.Command.prototype.addDeployOptions = function() {
|
|
|
122
122
|
return this.option("-v, --verbose", "Show full listing of changes").option(
|
|
123
123
|
"--dry-run",
|
|
124
124
|
"Print out the generated configuration without deploying to your Convex deployment"
|
|
125
|
-
).
|
|
125
|
+
).addOption(
|
|
126
|
+
new import_extra_typings.Option(
|
|
127
|
+
"-y, --yes",
|
|
128
|
+
"Skip confirmation prompt when running interactively. Warning: this deploys to PRODUCTION. To deploy to your current dev environment, run npx convex dev --once"
|
|
129
|
+
).hideHelp()
|
|
130
|
+
).addOption(
|
|
126
131
|
new import_extra_typings.Option(
|
|
127
132
|
"--typecheck <mode>",
|
|
128
133
|
`Whether to check TypeScript files with \`tsc --noEmit\` before deploying.`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/lib/command.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command, Option, OptionValues } from \"@commander-js/extra-typings\";\nimport { OneoffCtx } from \"../../bundler/context.js\";\nimport { LogMode } from \"./logs.js\";\nimport {\n CONVEX_DEPLOYMENT_ENV_VAR_NAME,\n CONVEX_SELF_HOSTED_ADMIN_KEY_VAR_NAME,\n CONVEX_SELF_HOSTED_URL_VAR_NAME,\n parseInteger,\n parsePositiveInteger,\n} from \"./utils/utils.js\";\n\ndeclare module \"@commander-js/extra-typings\" {\n interface Command<Args extends any[] = [], Opts extends OptionValues = {}> {\n /**\n * For a command that talks to the configured dev deployment by default,\n * add flags for talking to prod, preview, or other deployment in the same\n * project.\n *\n * These flags are added to the end of `command` (ordering matters for `--help`\n * output). `action` should look like \"Import data into\" because it is prefixed\n * onto help strings.\n *\n * The options can be passed to `deploymentSelectionFromOptions`.\n *\n * NOTE: This method only exists at runtime if this file is imported.\n * To help avoid this bug, this method takes in an `ActionDescription` which\n * can only be constructed via `actionDescription` from this file.\n *\n * @param action - The action description\n * @param options - Optional settings\n * @param options.showUrlHelp - If true, show the --url option in help output\n */\n addDeploymentSelectionOptions(\n action: ActionDescription,\n options?: { showUrlHelp?: boolean },\n ): Command<\n Args,\n Opts & {\n envFile?: string;\n url?: string;\n adminKey?: string;\n prod?: boolean;\n previewName?: string;\n deploymentName?: string;\n deployment?: string;\n }\n >;\n\n /**\n * Adds options for the `deploy` command.\n */\n addDeployOptions(): Command<\n Args,\n Opts & {\n verbose?: boolean;\n dryRun?: boolean;\n yes?: boolean;\n typecheck: \"enable\" | \"try\" | \"disable\";\n typecheckComponents: boolean;\n codegen: \"enable\" | \"disable\";\n cmd?: string;\n cmdUrlEnvVarName?: string;\n debugBundlePath?: string;\n debug?: boolean;\n writePushRequest?: string;\n liveComponentSources?: boolean;\n }\n >;\n\n /**\n * Adds options for `self-host` subcommands.\n */\n addSelfHostOptions(): Command<\n Args,\n Opts & {\n url?: string;\n adminKey?: string;\n env?: string;\n }\n >;\n\n /**\n * Adds options and arguments for the `run` command.\n */\n addRunOptions(): Command<\n [...Args, string, string | undefined],\n Opts & {\n watch?: boolean;\n push?: boolean;\n identity?: string;\n typecheck: \"enable\" | \"try\" | \"disable\";\n typecheckComponents: boolean;\n codegen: \"enable\" | \"disable\";\n component?: string;\n liveComponentSources?: boolean;\n }\n >;\n\n /**\n * Adds options for the `import` command.\n */\n addImportOptions(): Command<\n [...Args, string],\n Opts & {\n table?: string;\n format?: \"csv\" | \"jsonLines\" | \"jsonArray\" | \"zip\";\n replace?: boolean;\n append?: boolean;\n replaceAll?: boolean;\n yes?: boolean;\n component?: string;\n }\n >;\n\n /**\n * Adds options for the `export` command.\n */\n addExportOptions(): Command<\n Args,\n Opts & {\n path: string;\n includeFileStorage?: boolean;\n }\n >;\n\n /**\n * Adds options for the `data` command.\n */\n addDataOptions(): Command<\n [...Args, string | undefined],\n Opts & {\n limit: number;\n order: \"asc\" | \"desc\";\n component?: string;\n format?: \"json\" | \"jsonArray\" | \"jsonLines\" | \"jsonl\" | \"pretty\";\n }\n >;\n\n /**\n * Adds options for the `logs` command.\n */\n addLogsOptions(): Command<\n Args,\n Opts & {\n history: number;\n success: boolean;\n jsonl: boolean;\n }\n >;\n\n /**\n * Adds options for the `network-test` command.\n */\n addNetworkTestOptions(): Command<\n Args,\n Opts & {\n timeout?: string;\n ipFamily?: string;\n speedTest?: boolean;\n }\n >;\n }\n}\n\nCommand.prototype.addDeploymentSelectionOptions = function (\n action: ActionDescription,\n options?: { showUrlHelp?: boolean },\n) {\n const urlOption = new Option(\n \"--url <url>\",\n options?.showUrlHelp\n ? action + \" the deployment at the given URL.\"\n : undefined,\n ).conflicts([\n \"--prod\",\n \"--preview-name\",\n \"--deployment-name\",\n \"--deployment\",\n ]);\n if (!options?.showUrlHelp) {\n urlOption.hideHelp();\n }\n return this.addOption(urlOption)\n .addOption(new Option(\"--admin-key <adminKey>\").hideHelp())\n .addOption(\n new Option(\n \"--prod\",\n action + \" this project's default production deployment.\",\n ).conflicts([\n \"--preview-name\",\n \"--deployment-name\",\n \"--url\",\n \"--deployment\",\n ]),\n )\n .addOption(\n new Option(\n \"--preview-name <previewName>\",\n action + \" the preview deployment with the given name.\",\n )\n .conflicts([\"--prod\", \"--deployment-name\", \"--url\", \"--deployment\"])\n .hideHelp(),\n )\n .addOption(\n new Option(\n \"--deployment-name <deploymentName>\",\n action + \" the specified deployment.\",\n )\n .conflicts([\"--prod\", \"--preview-name\", \"--url\", \"--deployment\"])\n .hideHelp(),\n )\n .addOption(\n new Option(\n \"--deployment <deployment>\",\n action +\n \" the specified deployment. Accepts a deployment name (e.g. joyful-capybara-123), ref (e.g. dev/james), 'dev' (for your personal dev deployment), 'prod' (for your project\u2019s default production deployment). You can also select deployments in other projects with 'project-slug:ref' or 'team-slug:project-slug:ref'.\",\n )\n .conflicts([\"--prod\", \"--preview-name\", \"--deployment-name\", \"--url\"])\n .hideHelp(), // TODO(nicolas) Make this public\n )\n .addOption(\n new Option(\n \"--env-file <envFile>\",\n `Path to a custom file of environment variables, for choosing the \\\ndeployment, e.g. ${CONVEX_DEPLOYMENT_ENV_VAR_NAME} or ${CONVEX_SELF_HOSTED_URL_VAR_NAME}. \\\nSame format as .env.local or .env files, and overrides them.`,\n ).hideHelp(),\n ) as any;\n};\n\ndeclare const tag: unique symbol;\ntype ActionDescription = string & { readonly [tag]: \"noop\" };\nexport function actionDescription(action: string): ActionDescription {\n return action as any;\n}\n\nexport async function normalizeDevOptions(\n ctx: OneoffCtx,\n cmdOptions: {\n verbose?: boolean;\n typecheck: \"enable\" | \"try\" | \"disable\";\n typecheckComponents?: boolean;\n codegen: \"enable\" | \"disable\";\n once?: boolean;\n untilSuccess: boolean;\n run?: string | undefined;\n runSh?: string;\n runComponent?: string;\n tailLogs?: string | true;\n traceEvents: boolean;\n debugBundlePath?: string | undefined;\n debugNodeApis?: boolean;\n liveComponentSources?: boolean;\n pushAllModules?: boolean;\n while?: string;\n },\n): Promise<{\n verbose: boolean;\n typecheck: \"enable\" | \"try\" | \"disable\";\n typecheckComponents: boolean;\n codegen: boolean;\n once: boolean;\n untilSuccess: boolean;\n run?:\n | { kind: \"function\"; name: string; component?: string | undefined }\n | { kind: \"shell\"; command: string }\n | undefined;\n tailLogs: LogMode;\n traceEvents: boolean;\n debugBundlePath?: string | undefined;\n debugNodeApis: boolean;\n liveComponentSources: boolean;\n pushAllModules: boolean;\n}> {\n if (cmdOptions.runComponent && !cmdOptions.run) {\n return await ctx.crash({\n exitCode: 1,\n errorType: \"fatal\",\n printedMessage: \"Can't specify `--run-component` option without `--run`\",\n });\n }\n\n if (cmdOptions.debugBundlePath !== undefined && !cmdOptions.once) {\n return await ctx.crash({\n exitCode: 1,\n errorType: \"fatal\",\n printedMessage: \"`--debug-bundle-path` can only be used with `--once`.\",\n });\n }\n if (cmdOptions.debugNodeApis && !cmdOptions.once) {\n return await ctx.crash({\n exitCode: 1,\n errorType: \"fatal\",\n printedMessage: \"`--debug-node-apis` can only be used with `--once`.\",\n });\n }\n\n return {\n verbose: !!cmdOptions.verbose,\n typecheck: cmdOptions.typecheck,\n typecheckComponents: !!cmdOptions.typecheckComponents,\n codegen: cmdOptions.codegen === \"enable\",\n once: !!cmdOptions.once,\n untilSuccess: cmdOptions.untilSuccess,\n run:\n cmdOptions.run !== undefined\n ? {\n kind: \"function\",\n name: cmdOptions.run,\n component: cmdOptions.runComponent,\n }\n : cmdOptions.runSh !== undefined\n ? {\n kind: \"shell\",\n command: cmdOptions.runSh,\n }\n : undefined,\n tailLogs:\n typeof cmdOptions.tailLogs === \"string\"\n ? (cmdOptions.tailLogs as LogMode)\n : \"pause-on-deploy\",\n traceEvents: cmdOptions.traceEvents,\n debugBundlePath: cmdOptions.debugBundlePath,\n debugNodeApis: !!cmdOptions.debugNodeApis,\n liveComponentSources: !!cmdOptions.liveComponentSources,\n pushAllModules: !!cmdOptions.pushAllModules,\n };\n}\n\nCommand.prototype.addDeployOptions = function () {\n return this.option(\"-v, --verbose\", \"Show full listing of changes\")\n .option(\n \"--dry-run\",\n \"Print out the generated configuration without deploying to your Convex deployment\",\n )\n .option(\"-y, --yes\", \"Skip confirmation prompt when running locally\")\n .addOption(\n new Option(\n \"--typecheck <mode>\",\n `Whether to check TypeScript files with \\`tsc --noEmit\\` before deploying.`,\n )\n .choices([\"enable\", \"try\", \"disable\"] as const)\n .default(\"try\" as const),\n )\n .option(\n \"--typecheck-components\",\n \"Check TypeScript files within component implementations with `tsc --noEmit`.\",\n false,\n )\n .addOption(\n new Option(\n \"--codegen <mode>\",\n \"Whether to regenerate code in `convex/_generated/` before pushing.\",\n )\n .choices([\"enable\", \"disable\"] as const)\n .default(\"enable\" as const),\n )\n .addOption(\n new Option(\n \"--cmd <command>\",\n \"Command to run as part of deploying your app (e.g. `vite build`). This command can depend on the environment variables specified in `--cmd-url-env-var-name` being set.\",\n ),\n )\n .addOption(\n new Option(\n \"--cmd-url-env-var-name <name>\",\n \"Environment variable name to set Convex deployment URL (e.g. `VITE_CONVEX_URL`) when using `--cmd`\",\n ),\n )\n .addOption(new Option(\"--debug-bundle-path <path>\").hideHelp())\n .addOption(new Option(\"--debug\").hideHelp())\n .addOption(new Option(\"--write-push-request <writePushRequest>\").hideHelp())\n .addOption(new Option(\"--live-component-sources\").hideHelp())\n .addOption(\n new Option(\n \"--push-all-modules\",\n \"Push all modules without checking for unchanged module hashes from the server\",\n )\n .default(false)\n .hideHelp(),\n );\n};\n\nCommand.prototype.addSelfHostOptions = function () {\n return this.option(\n \"--admin-key <adminKey>\",\n `An admin key for the deployment. Can alternatively be set as \\`${CONVEX_SELF_HOSTED_ADMIN_KEY_VAR_NAME}\\` environment variable.`,\n )\n .option(\n \"--url <url>\",\n `The url of the deployment. Can alternatively be set as \\`${CONVEX_SELF_HOSTED_URL_VAR_NAME}\\` environment variable.`,\n )\n .option(\n \"--env <env>\",\n `Path to a custom file of environment variables, containing \\`${CONVEX_SELF_HOSTED_URL_VAR_NAME}\\` and \\`${CONVEX_SELF_HOSTED_ADMIN_KEY_VAR_NAME}\\`.`,\n );\n};\n\nCommand.prototype.addRunOptions = function () {\n return (\n this.argument(\n \"functionName\",\n \"identifier of the function to run, like `listMessages` or `dir/file:myFunction`\",\n )\n .argument(\n \"[args]\",\n \"JSON-formatted arguments object to pass to the function.\",\n )\n .option(\n \"-w, --watch\",\n \"Watch a query, printing its result if the underlying data changes. Given function must be a query.\",\n )\n .option(\"--push\", \"Push code to deployment before running the function.\")\n .addOption(\n new Option(\n \"--identity <identity>\",\n 'JSON-formatted UserIdentity object, e.g. \\'{ name: \"John\", address: \"0x123\" }\\'',\n ),\n )\n // For backwards compatibility we still support --no-push which is a noop\n .addOption(new Option(\"--no-push\").hideHelp())\n // Options for the deploy that --push does\n .addOption(\n new Option(\n \"--typecheck <mode>\",\n `Whether to check TypeScript files with \\`tsc --noEmit\\`.`,\n )\n .choices([\"enable\", \"try\", \"disable\"] as const)\n .default(\"try\" as const),\n )\n .option(\n \"--typecheck-components\",\n \"Check TypeScript files within component implementations with `tsc --noEmit`.\",\n false,\n )\n .addOption(\n new Option(\n \"--codegen <mode>\",\n \"Regenerate code in `convex/_generated/`\",\n )\n .choices([\"enable\", \"disable\"] as const)\n .default(\"enable\" as const),\n )\n .addOption(\n new Option(\n \"--component <path>\",\n \"Path to the component in the component tree defined in convex.config.ts.\",\n ),\n )\n .addOption(new Option(\"--live-component-sources\").hideHelp())\n );\n};\n\nCommand.prototype.addImportOptions = function () {\n return this.argument(\"<path>\", \"Path to the input file\")\n .addOption(\n new Option(\n \"--table <table>\",\n \"Destination table name. Required if format is csv, jsonLines, or jsonArray. Not supported if format is zip.\",\n ),\n )\n .addOption(\n new Option(\n \"--replace\",\n \"Replace all existing data in any of the imported tables\",\n )\n .conflicts(\"--append\")\n .conflicts(\"--replace-all\"),\n )\n .addOption(\n new Option(\"--append\", \"Append imported data to any existing tables\")\n .conflicts(\"--replace-all\")\n .conflicts(\"--replace\"),\n )\n .addOption(\n new Option(\n \"--replace-all\",\n \"Replace all existing data in the deployment with the imported tables,\\n\" +\n \" deleting tables that don't appear in the import file or the schema,\\n\" +\n \" and clearing tables that appear in the schema but not in the import file\",\n )\n .conflicts(\"--append\")\n .conflicts(\"--replace\"),\n )\n .option(\n \"-y, --yes\",\n \"Skip confirmation prompt when import leads to deleting existing documents\",\n )\n .addOption(\n new Option(\n \"--format <format>\",\n \"Input file format. This flag is only required if the filename is missing an extension.\\n\" +\n \"- CSV files must have a header, and each row's entries are interpreted either as a (floating point) number or a string.\\n\" +\n \"- JSON files must be an array of JSON objects.\\n\" +\n \"- JSONLines files must have a JSON object per line.\\n\" +\n \"- ZIP files must have one directory per table, containing <table>/documents.jsonl. Snapshot exports from the Convex dashboard have this format.\",\n ).choices([\"csv\", \"jsonLines\", \"jsonArray\", \"zip\"]),\n )\n .addOption(\n new Option(\n \"--component <path>\",\n \"Path to the component in the component tree defined in convex.config.ts.\",\n ),\n );\n};\n\nCommand.prototype.addExportOptions = function () {\n return this.requiredOption(\n \"--path <zipFilePath>\",\n \"Exports data into a ZIP file at this path, which may be a directory or unoccupied .zip path\",\n ).addOption(\n new Option(\n \"--include-file-storage\",\n \"Includes stored files (https://dashboard.convex.dev/deployment/files) in a _storage folder within the ZIP file\",\n ),\n );\n};\n\nCommand.prototype.addDataOptions = function () {\n return this.addOption(\n new Option(\n \"--limit <n>\",\n \"List only the `n` the most recently created documents.\",\n )\n .default(100)\n .argParser(parsePositiveInteger),\n )\n .addOption(\n new Option(\n \"--order <choice>\",\n \"Order the documents by their `_creationTime`.\",\n )\n .choices([\"asc\", \"desc\"])\n .default(\"desc\"),\n )\n .addOption(\n new Option(\n \"--component <path>\",\n \"Path to the component in the component tree defined in convex.config.ts.\",\n ),\n )\n .addOption(\n new Option(\n \"--format <format>\",\n \"Format to print the data in. This flag is only required if the filename is missing an extension.\\n\" +\n \"- jsonArray (aka json): print the data as a JSON array of objects.\\n\" +\n \"- jsonLines (aka jsonl): print the data as a JSON object per line.\\n\" +\n \"- pretty: print the data in a human-readable format.\",\n ).choices([\"jsonArray\", \"json\", \"jsonLines\", \"jsonl\", \"pretty\"]),\n )\n .argument(\"[table]\", \"If specified, list documents in this table.\");\n};\n\nCommand.prototype.addLogsOptions = function () {\n return this.option(\n \"--history [n]\",\n \"Show `n` most recent logs. Defaults to showing all available logs.\",\n parseInteger,\n )\n .option(\n \"--success\",\n \"Print a log line for every successful function execution\",\n false,\n )\n .option(\"--jsonl\", \"Output raw log events as JSONL\", false);\n};\n\nCommand.prototype.addNetworkTestOptions = function () {\n return this.addOption(\n new Option(\n \"--timeout <timeout>\",\n \"Timeout in seconds for the network test (default: 30).\",\n ),\n )\n .addOption(\n new Option(\n \"--ip-family <ipFamily>\",\n \"IP family to use (ipv4, ipv6, or auto)\",\n ),\n )\n .addOption(\n new Option(\n \"--speed-test\",\n \"Perform a large echo test to measure network speed.\",\n ),\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8C;AAG9C,mBAMO;AA2JP,6BA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,MAAI,WAAW,oBAAoB,UAAa,CAAC,WAAW,MAAM;AAChE,WAAO,MAAM,IAAI,MAAM;AAAA,MACrB,UAAU;AAAA,MACV,WAAW;AAAA,MACX,gBAAgB;AAAA,IAClB,CAAC;AAAA,EACH;AACA,MAAI,WAAW,iBAAiB,CAAC,WAAW,MAAM;AAChD,WAAO,MAAM,IAAI,MAAM;AAAA,MACrB,UAAU;AAAA,MACV,WAAW;AAAA,MACX,gBAAgB;AAAA,IAClB,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL,SAAS,CAAC,CAAC,WAAW;AAAA,IACtB,WAAW,WAAW;AAAA,IACtB,qBAAqB,CAAC,CAAC,WAAW;AAAA,IAClC,SAAS,WAAW,YAAY;AAAA,IAChC,MAAM,CAAC,CAAC,WAAW;AAAA,IACnB,cAAc,WAAW;AAAA,IACzB,KACE,WAAW,QAAQ,SACf;AAAA,MACE,MAAM;AAAA,MACN,MAAM,WAAW;AAAA,MACjB,WAAW,WAAW;AAAA,IACxB,IACA,WAAW,UAAU,SACnB;AAAA,MACE,MAAM;AAAA,MACN,SAAS,WAAW;AAAA,IACtB,IACA;AAAA,IACR,UACE,OAAO,WAAW,aAAa,WAC1B,WAAW,WACZ;AAAA,IACN,aAAa,WAAW;AAAA,IACxB,iBAAiB,WAAW;AAAA,IAC5B,eAAe,CAAC,CAAC,WAAW;AAAA,IAC5B,sBAAsB,CAAC,CAAC,WAAW;AAAA,IACnC,gBAAgB,CAAC,CAAC,WAAW;AAAA,EAC/B;AACF;AAEA,6BAAQ,UAAU,mBAAmB,WAAY;AAC/C,SAAO,KAAK,OAAO,iBAAiB,8BAA8B,EAC/D;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,
|
|
4
|
+
"sourcesContent": ["import { Command, Option, OptionValues } from \"@commander-js/extra-typings\";\nimport { OneoffCtx } from \"../../bundler/context.js\";\nimport { LogMode } from \"./logs.js\";\nimport {\n CONVEX_DEPLOYMENT_ENV_VAR_NAME,\n CONVEX_SELF_HOSTED_ADMIN_KEY_VAR_NAME,\n CONVEX_SELF_HOSTED_URL_VAR_NAME,\n parseInteger,\n parsePositiveInteger,\n} from \"./utils/utils.js\";\n\ndeclare module \"@commander-js/extra-typings\" {\n interface Command<Args extends any[] = [], Opts extends OptionValues = {}> {\n /**\n * For a command that talks to the configured dev deployment by default,\n * add flags for talking to prod, preview, or other deployment in the same\n * project.\n *\n * These flags are added to the end of `command` (ordering matters for `--help`\n * output). `action` should look like \"Import data into\" because it is prefixed\n * onto help strings.\n *\n * The options can be passed to `deploymentSelectionFromOptions`.\n *\n * NOTE: This method only exists at runtime if this file is imported.\n * To help avoid this bug, this method takes in an `ActionDescription` which\n * can only be constructed via `actionDescription` from this file.\n *\n * @param action - The action description\n * @param options - Optional settings\n * @param options.showUrlHelp - If true, show the --url option in help output\n */\n addDeploymentSelectionOptions(\n action: ActionDescription,\n options?: { showUrlHelp?: boolean },\n ): Command<\n Args,\n Opts & {\n envFile?: string;\n url?: string;\n adminKey?: string;\n prod?: boolean;\n previewName?: string;\n deploymentName?: string;\n deployment?: string;\n }\n >;\n\n /**\n * Adds options for the `deploy` command.\n */\n addDeployOptions(): Command<\n Args,\n Opts & {\n verbose?: boolean;\n dryRun?: boolean;\n yes?: boolean;\n typecheck: \"enable\" | \"try\" | \"disable\";\n typecheckComponents: boolean;\n codegen: \"enable\" | \"disable\";\n cmd?: string;\n cmdUrlEnvVarName?: string;\n debugBundlePath?: string;\n debug?: boolean;\n writePushRequest?: string;\n liveComponentSources?: boolean;\n }\n >;\n\n /**\n * Adds options for `self-host` subcommands.\n */\n addSelfHostOptions(): Command<\n Args,\n Opts & {\n url?: string;\n adminKey?: string;\n env?: string;\n }\n >;\n\n /**\n * Adds options and arguments for the `run` command.\n */\n addRunOptions(): Command<\n [...Args, string, string | undefined],\n Opts & {\n watch?: boolean;\n push?: boolean;\n identity?: string;\n typecheck: \"enable\" | \"try\" | \"disable\";\n typecheckComponents: boolean;\n codegen: \"enable\" | \"disable\";\n component?: string;\n liveComponentSources?: boolean;\n }\n >;\n\n /**\n * Adds options for the `import` command.\n */\n addImportOptions(): Command<\n [...Args, string],\n Opts & {\n table?: string;\n format?: \"csv\" | \"jsonLines\" | \"jsonArray\" | \"zip\";\n replace?: boolean;\n append?: boolean;\n replaceAll?: boolean;\n yes?: boolean;\n component?: string;\n }\n >;\n\n /**\n * Adds options for the `export` command.\n */\n addExportOptions(): Command<\n Args,\n Opts & {\n path: string;\n includeFileStorage?: boolean;\n }\n >;\n\n /**\n * Adds options for the `data` command.\n */\n addDataOptions(): Command<\n [...Args, string | undefined],\n Opts & {\n limit: number;\n order: \"asc\" | \"desc\";\n component?: string;\n format?: \"json\" | \"jsonArray\" | \"jsonLines\" | \"jsonl\" | \"pretty\";\n }\n >;\n\n /**\n * Adds options for the `logs` command.\n */\n addLogsOptions(): Command<\n Args,\n Opts & {\n history: number;\n success: boolean;\n jsonl: boolean;\n }\n >;\n\n /**\n * Adds options for the `network-test` command.\n */\n addNetworkTestOptions(): Command<\n Args,\n Opts & {\n timeout?: string;\n ipFamily?: string;\n speedTest?: boolean;\n }\n >;\n }\n}\n\nCommand.prototype.addDeploymentSelectionOptions = function (\n action: ActionDescription,\n options?: { showUrlHelp?: boolean },\n) {\n const urlOption = new Option(\n \"--url <url>\",\n options?.showUrlHelp\n ? action + \" the deployment at the given URL.\"\n : undefined,\n ).conflicts([\n \"--prod\",\n \"--preview-name\",\n \"--deployment-name\",\n \"--deployment\",\n ]);\n if (!options?.showUrlHelp) {\n urlOption.hideHelp();\n }\n return this.addOption(urlOption)\n .addOption(new Option(\"--admin-key <adminKey>\").hideHelp())\n .addOption(\n new Option(\n \"--prod\",\n action + \" this project's default production deployment.\",\n ).conflicts([\n \"--preview-name\",\n \"--deployment-name\",\n \"--url\",\n \"--deployment\",\n ]),\n )\n .addOption(\n new Option(\n \"--preview-name <previewName>\",\n action + \" the preview deployment with the given name.\",\n )\n .conflicts([\"--prod\", \"--deployment-name\", \"--url\", \"--deployment\"])\n .hideHelp(),\n )\n .addOption(\n new Option(\n \"--deployment-name <deploymentName>\",\n action + \" the specified deployment.\",\n )\n .conflicts([\"--prod\", \"--preview-name\", \"--url\", \"--deployment\"])\n .hideHelp(),\n )\n .addOption(\n new Option(\n \"--deployment <deployment>\",\n action +\n \" the specified deployment. Accepts a deployment name (e.g. joyful-capybara-123), ref (e.g. dev/james), 'dev' (for your personal dev deployment), 'prod' (for your project\u2019s default production deployment). You can also select deployments in other projects with 'project-slug:ref' or 'team-slug:project-slug:ref'.\",\n )\n .conflicts([\"--prod\", \"--preview-name\", \"--deployment-name\", \"--url\"])\n .hideHelp(), // TODO(nicolas) Make this public\n )\n .addOption(\n new Option(\n \"--env-file <envFile>\",\n `Path to a custom file of environment variables, for choosing the \\\ndeployment, e.g. ${CONVEX_DEPLOYMENT_ENV_VAR_NAME} or ${CONVEX_SELF_HOSTED_URL_VAR_NAME}. \\\nSame format as .env.local or .env files, and overrides them.`,\n ).hideHelp(),\n ) as any;\n};\n\ndeclare const tag: unique symbol;\ntype ActionDescription = string & { readonly [tag]: \"noop\" };\nexport function actionDescription(action: string): ActionDescription {\n return action as any;\n}\n\nexport async function normalizeDevOptions(\n ctx: OneoffCtx,\n cmdOptions: {\n verbose?: boolean;\n typecheck: \"enable\" | \"try\" | \"disable\";\n typecheckComponents?: boolean;\n codegen: \"enable\" | \"disable\";\n once?: boolean;\n untilSuccess: boolean;\n run?: string | undefined;\n runSh?: string;\n runComponent?: string;\n tailLogs?: string | true;\n traceEvents: boolean;\n debugBundlePath?: string | undefined;\n debugNodeApis?: boolean;\n liveComponentSources?: boolean;\n pushAllModules?: boolean;\n while?: string;\n },\n): Promise<{\n verbose: boolean;\n typecheck: \"enable\" | \"try\" | \"disable\";\n typecheckComponents: boolean;\n codegen: boolean;\n once: boolean;\n untilSuccess: boolean;\n run?:\n | { kind: \"function\"; name: string; component?: string | undefined }\n | { kind: \"shell\"; command: string }\n | undefined;\n tailLogs: LogMode;\n traceEvents: boolean;\n debugBundlePath?: string | undefined;\n debugNodeApis: boolean;\n liveComponentSources: boolean;\n pushAllModules: boolean;\n}> {\n if (cmdOptions.runComponent && !cmdOptions.run) {\n return await ctx.crash({\n exitCode: 1,\n errorType: \"fatal\",\n printedMessage: \"Can't specify `--run-component` option without `--run`\",\n });\n }\n\n if (cmdOptions.debugBundlePath !== undefined && !cmdOptions.once) {\n return await ctx.crash({\n exitCode: 1,\n errorType: \"fatal\",\n printedMessage: \"`--debug-bundle-path` can only be used with `--once`.\",\n });\n }\n if (cmdOptions.debugNodeApis && !cmdOptions.once) {\n return await ctx.crash({\n exitCode: 1,\n errorType: \"fatal\",\n printedMessage: \"`--debug-node-apis` can only be used with `--once`.\",\n });\n }\n\n return {\n verbose: !!cmdOptions.verbose,\n typecheck: cmdOptions.typecheck,\n typecheckComponents: !!cmdOptions.typecheckComponents,\n codegen: cmdOptions.codegen === \"enable\",\n once: !!cmdOptions.once,\n untilSuccess: cmdOptions.untilSuccess,\n run:\n cmdOptions.run !== undefined\n ? {\n kind: \"function\",\n name: cmdOptions.run,\n component: cmdOptions.runComponent,\n }\n : cmdOptions.runSh !== undefined\n ? {\n kind: \"shell\",\n command: cmdOptions.runSh,\n }\n : undefined,\n tailLogs:\n typeof cmdOptions.tailLogs === \"string\"\n ? (cmdOptions.tailLogs as LogMode)\n : \"pause-on-deploy\",\n traceEvents: cmdOptions.traceEvents,\n debugBundlePath: cmdOptions.debugBundlePath,\n debugNodeApis: !!cmdOptions.debugNodeApis,\n liveComponentSources: !!cmdOptions.liveComponentSources,\n pushAllModules: !!cmdOptions.pushAllModules,\n };\n}\n\nCommand.prototype.addDeployOptions = function () {\n return this.option(\"-v, --verbose\", \"Show full listing of changes\")\n .option(\n \"--dry-run\",\n \"Print out the generated configuration without deploying to your Convex deployment\",\n )\n .addOption(\n new Option(\n \"-y, --yes\",\n \"Skip confirmation prompt when running interactively. Warning: this deploys to PRODUCTION. To deploy to your current dev environment, run npx convex dev --once\",\n ).hideHelp(),\n )\n .addOption(\n new Option(\n \"--typecheck <mode>\",\n `Whether to check TypeScript files with \\`tsc --noEmit\\` before deploying.`,\n )\n .choices([\"enable\", \"try\", \"disable\"] as const)\n .default(\"try\" as const),\n )\n .option(\n \"--typecheck-components\",\n \"Check TypeScript files within component implementations with `tsc --noEmit`.\",\n false,\n )\n .addOption(\n new Option(\n \"--codegen <mode>\",\n \"Whether to regenerate code in `convex/_generated/` before pushing.\",\n )\n .choices([\"enable\", \"disable\"] as const)\n .default(\"enable\" as const),\n )\n .addOption(\n new Option(\n \"--cmd <command>\",\n \"Command to run as part of deploying your app (e.g. `vite build`). This command can depend on the environment variables specified in `--cmd-url-env-var-name` being set.\",\n ),\n )\n .addOption(\n new Option(\n \"--cmd-url-env-var-name <name>\",\n \"Environment variable name to set Convex deployment URL (e.g. `VITE_CONVEX_URL`) when using `--cmd`\",\n ),\n )\n .addOption(new Option(\"--debug-bundle-path <path>\").hideHelp())\n .addOption(new Option(\"--debug\").hideHelp())\n .addOption(new Option(\"--write-push-request <writePushRequest>\").hideHelp())\n .addOption(new Option(\"--live-component-sources\").hideHelp())\n .addOption(\n new Option(\n \"--push-all-modules\",\n \"Push all modules without checking for unchanged module hashes from the server\",\n )\n .default(false)\n .hideHelp(),\n );\n};\n\nCommand.prototype.addSelfHostOptions = function () {\n return this.option(\n \"--admin-key <adminKey>\",\n `An admin key for the deployment. Can alternatively be set as \\`${CONVEX_SELF_HOSTED_ADMIN_KEY_VAR_NAME}\\` environment variable.`,\n )\n .option(\n \"--url <url>\",\n `The url of the deployment. Can alternatively be set as \\`${CONVEX_SELF_HOSTED_URL_VAR_NAME}\\` environment variable.`,\n )\n .option(\n \"--env <env>\",\n `Path to a custom file of environment variables, containing \\`${CONVEX_SELF_HOSTED_URL_VAR_NAME}\\` and \\`${CONVEX_SELF_HOSTED_ADMIN_KEY_VAR_NAME}\\`.`,\n );\n};\n\nCommand.prototype.addRunOptions = function () {\n return (\n this.argument(\n \"functionName\",\n \"identifier of the function to run, like `listMessages` or `dir/file:myFunction`\",\n )\n .argument(\n \"[args]\",\n \"JSON-formatted arguments object to pass to the function.\",\n )\n .option(\n \"-w, --watch\",\n \"Watch a query, printing its result if the underlying data changes. Given function must be a query.\",\n )\n .option(\"--push\", \"Push code to deployment before running the function.\")\n .addOption(\n new Option(\n \"--identity <identity>\",\n 'JSON-formatted UserIdentity object, e.g. \\'{ name: \"John\", address: \"0x123\" }\\'',\n ),\n )\n // For backwards compatibility we still support --no-push which is a noop\n .addOption(new Option(\"--no-push\").hideHelp())\n // Options for the deploy that --push does\n .addOption(\n new Option(\n \"--typecheck <mode>\",\n `Whether to check TypeScript files with \\`tsc --noEmit\\`.`,\n )\n .choices([\"enable\", \"try\", \"disable\"] as const)\n .default(\"try\" as const),\n )\n .option(\n \"--typecheck-components\",\n \"Check TypeScript files within component implementations with `tsc --noEmit`.\",\n false,\n )\n .addOption(\n new Option(\n \"--codegen <mode>\",\n \"Regenerate code in `convex/_generated/`\",\n )\n .choices([\"enable\", \"disable\"] as const)\n .default(\"enable\" as const),\n )\n .addOption(\n new Option(\n \"--component <path>\",\n \"Path to the component in the component tree defined in convex.config.ts.\",\n ),\n )\n .addOption(new Option(\"--live-component-sources\").hideHelp())\n );\n};\n\nCommand.prototype.addImportOptions = function () {\n return this.argument(\"<path>\", \"Path to the input file\")\n .addOption(\n new Option(\n \"--table <table>\",\n \"Destination table name. Required if format is csv, jsonLines, or jsonArray. Not supported if format is zip.\",\n ),\n )\n .addOption(\n new Option(\n \"--replace\",\n \"Replace all existing data in any of the imported tables\",\n )\n .conflicts(\"--append\")\n .conflicts(\"--replace-all\"),\n )\n .addOption(\n new Option(\"--append\", \"Append imported data to any existing tables\")\n .conflicts(\"--replace-all\")\n .conflicts(\"--replace\"),\n )\n .addOption(\n new Option(\n \"--replace-all\",\n \"Replace all existing data in the deployment with the imported tables,\\n\" +\n \" deleting tables that don't appear in the import file or the schema,\\n\" +\n \" and clearing tables that appear in the schema but not in the import file\",\n )\n .conflicts(\"--append\")\n .conflicts(\"--replace\"),\n )\n .option(\n \"-y, --yes\",\n \"Skip confirmation prompt when import leads to deleting existing documents\",\n )\n .addOption(\n new Option(\n \"--format <format>\",\n \"Input file format. This flag is only required if the filename is missing an extension.\\n\" +\n \"- CSV files must have a header, and each row's entries are interpreted either as a (floating point) number or a string.\\n\" +\n \"- JSON files must be an array of JSON objects.\\n\" +\n \"- JSONLines files must have a JSON object per line.\\n\" +\n \"- ZIP files must have one directory per table, containing <table>/documents.jsonl. Snapshot exports from the Convex dashboard have this format.\",\n ).choices([\"csv\", \"jsonLines\", \"jsonArray\", \"zip\"]),\n )\n .addOption(\n new Option(\n \"--component <path>\",\n \"Path to the component in the component tree defined in convex.config.ts.\",\n ),\n );\n};\n\nCommand.prototype.addExportOptions = function () {\n return this.requiredOption(\n \"--path <zipFilePath>\",\n \"Exports data into a ZIP file at this path, which may be a directory or unoccupied .zip path\",\n ).addOption(\n new Option(\n \"--include-file-storage\",\n \"Includes stored files (https://dashboard.convex.dev/deployment/files) in a _storage folder within the ZIP file\",\n ),\n );\n};\n\nCommand.prototype.addDataOptions = function () {\n return this.addOption(\n new Option(\n \"--limit <n>\",\n \"List only the `n` the most recently created documents.\",\n )\n .default(100)\n .argParser(parsePositiveInteger),\n )\n .addOption(\n new Option(\n \"--order <choice>\",\n \"Order the documents by their `_creationTime`.\",\n )\n .choices([\"asc\", \"desc\"])\n .default(\"desc\"),\n )\n .addOption(\n new Option(\n \"--component <path>\",\n \"Path to the component in the component tree defined in convex.config.ts.\",\n ),\n )\n .addOption(\n new Option(\n \"--format <format>\",\n \"Format to print the data in. This flag is only required if the filename is missing an extension.\\n\" +\n \"- jsonArray (aka json): print the data as a JSON array of objects.\\n\" +\n \"- jsonLines (aka jsonl): print the data as a JSON object per line.\\n\" +\n \"- pretty: print the data in a human-readable format.\",\n ).choices([\"jsonArray\", \"json\", \"jsonLines\", \"jsonl\", \"pretty\"]),\n )\n .argument(\"[table]\", \"If specified, list documents in this table.\");\n};\n\nCommand.prototype.addLogsOptions = function () {\n return this.option(\n \"--history [n]\",\n \"Show `n` most recent logs. Defaults to showing all available logs.\",\n parseInteger,\n )\n .option(\n \"--success\",\n \"Print a log line for every successful function execution\",\n false,\n )\n .option(\"--jsonl\", \"Output raw log events as JSONL\", false);\n};\n\nCommand.prototype.addNetworkTestOptions = function () {\n return this.addOption(\n new Option(\n \"--timeout <timeout>\",\n \"Timeout in seconds for the network test (default: 30).\",\n ),\n )\n .addOption(\n new Option(\n \"--ip-family <ipFamily>\",\n \"IP family to use (ipv4, ipv6, or auto)\",\n ),\n )\n .addOption(\n new Option(\n \"--speed-test\",\n \"Perform a large echo test to measure network speed.\",\n ),\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8C;AAG9C,mBAMO;AA2JP,6BAAQ,UAAU,gCAAgC,SAChD,QACA,SACA;AACA,QAAM,YAAY,IAAI;AAAA,IACpB;AAAA,IACA,SAAS,cACL,SAAS,sCACT;AAAA,EACN,EAAE,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,MAAI,CAAC,SAAS,aAAa;AACzB,cAAU,SAAS;AAAA,EACrB;AACA,SAAO,KAAK,UAAU,SAAS,EAC5B,UAAU,IAAI,4BAAO,wBAAwB,EAAE,SAAS,CAAC,EACzD;AAAA,IACC,IAAI;AAAA,MACF;AAAA,MACA,SAAS;AAAA,IACX,EAAE,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH,EACC;AAAA,IACC,IAAI;AAAA,MACF;AAAA,MACA,SAAS;AAAA,IACX,EACG,UAAU,CAAC,UAAU,qBAAqB,SAAS,cAAc,CAAC,EAClE,SAAS;AAAA,EACd,EACC;AAAA,IACC,IAAI;AAAA,MACF;AAAA,MACA,SAAS;AAAA,IACX,EACG,UAAU,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AAY;AACpD,SAAO,KAAK;AAAA,IACV,IAAI;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAAA,EACF,EACG;AAAA,IACC,IAAI;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAAA,EACF,EACC;AAAA,IACC,IAAI;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -166,7 +166,8 @@ const BundlerSchema = import_zod.z.object({
|
|
|
166
166
|
)
|
|
167
167
|
});
|
|
168
168
|
const AiFilesSchema = import_zod.z.object({
|
|
169
|
-
|
|
169
|
+
enabled: import_zod.z.boolean().optional(),
|
|
170
|
+
disableStalenessMessage: import_zod.z.boolean().optional()
|
|
170
171
|
});
|
|
171
172
|
const refineToObject = (schema) => schema.refine((val) => val !== null && !Array.isArray(val), {
|
|
172
173
|
message: "Expected `convex.json` to contain an object"
|
|
@@ -346,9 +347,7 @@ async function readProjectConfig(ctx) {
|
|
|
346
347
|
staticApi: false,
|
|
347
348
|
staticDataModel: false
|
|
348
349
|
},
|
|
349
|
-
aiFiles: {
|
|
350
|
-
disableStalenessMessage: false
|
|
351
|
-
}
|
|
350
|
+
aiFiles: {}
|
|
352
351
|
},
|
|
353
352
|
configPath: configName()
|
|
354
353
|
};
|