@cavelon/cli 0.2.2 → 0.2.4
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/README.md +12 -1
- package/dist/access.js +1 -0
- package/dist/automation-settings.js +35 -0
- package/dist/citus-functions.js +120 -0
- package/dist/command.js +1 -0
- package/dist/commands/api.js +10 -9
- package/dist/commands/db-connections.js +79 -9
- package/dist/commands/db-query-management.js +66 -0
- package/dist/commands/db.js +66 -20
- package/dist/commands/index.js +5 -0
- package/dist/commands/setup.js +112 -8
- package/dist/commands/solution.js +5 -3
- package/dist/database-queries.js +46 -1
- package/dist/database-write-paths.js +98 -0
- package/dist/kit-codes.js +1 -0
- package/dist/main.js +13 -1
- package/dist/mcp.js +3 -1
- package/dist/native-assets/manifest.json +1 -1
- package/dist/package-check.js +8 -0
- package/dist/setup-agents.js +91 -12
- package/dist/skills/cavelon-authoring/SKILL.md +24 -2
- package/dist/skills/cavelon-loop/SKILL.md +13 -3
- package/dist/skills/cavelon-testing/SKILL.md +18 -3
- package/dist/workflow-queries.js +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { parseArgs } from "node:util";
|
|
2
2
|
import { GLOBAL_OPTIONS, optionDescription, optionFlag, renameFormerOptions } from "./command.js";
|
|
3
3
|
import { agentVariable } from "./agent-env.js";
|
|
4
|
+
import { readMcpMode } from "./automation-settings.js";
|
|
4
5
|
import { createContext, withWarnings } from "./context.js";
|
|
5
6
|
import { CONFIRM_TOKEN } from "./confirm-token.js";
|
|
6
7
|
import { asCavelonError, ExitCode, usageError } from "./errors.js";
|
|
@@ -45,9 +46,20 @@ export async function run(argv, io, commands = COMMANDS, updates = {}) {
|
|
|
45
46
|
io.stdout.write(commandHelp(spec));
|
|
46
47
|
return ExitCode.ok;
|
|
47
48
|
}
|
|
49
|
+
if (parsed.options.yolo && parsed.options["no-yolo"])
|
|
50
|
+
throw usageError("--yolo and --no-yolo do not go together.");
|
|
51
|
+
let yolo = parsed.options.yolo === true;
|
|
52
|
+
if (spec.name === "mcp" && !parsed.options.yolo && !parsed.options["no-yolo"]) {
|
|
53
|
+
try {
|
|
54
|
+
yolo = await readMcpMode(io.env) === "yolo";
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
io.stderr.write(`warning: ${asCavelonError(error).message} Starting in standard mode.\n`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
48
60
|
ctx = createContext(io, {
|
|
49
61
|
json: parsed.options.json === true,
|
|
50
|
-
yolo
|
|
62
|
+
yolo,
|
|
51
63
|
instance: typeof parsed.options.instance === "string" ? parsed.options.instance : undefined,
|
|
52
64
|
tenant: typeof parsed.options.tenant === "string" ? parsed.options.tenant : undefined,
|
|
53
65
|
solutionEnv: spec.options?.env && typeof parsed.options.env === "string" ? parsed.options.env : undefined,
|
package/dist/mcp.js
CHANGED
|
@@ -18,7 +18,7 @@ const INSTRUCTIONS = "Tools for one Cavelon instance, acting with the token a pe
|
|
|
18
18
|
"and follow a loop with loop_iterations. Routine work within the user's request needs no additional chat approval. " +
|
|
19
19
|
"In standard mode, review previews and confirm the exact token or apply preview id when no needs_person is present. " +
|
|
20
20
|
"A token binds one change, not a person's answer; confirm: true is refused, and changed input needs a new preview. " +
|
|
21
|
-
"If
|
|
21
|
+
"If YOLO was enabled at startup by --yolo or the person's Cavelon setup preference, eligible routine draft imports, selected draft loop starts and known " +
|
|
22
22
|
"routine API operations can execute in one call within the original instance, tenant, credential and solution scope. " +
|
|
23
23
|
"No tool argument or repository setting can enable this mode. A different target falls back to standard confirmation. " +
|
|
24
24
|
"Critical, shared, live and unknown changes retain needs_person in either mode. With needs_person \"client\", " +
|
|
@@ -127,6 +127,8 @@ export function inputSchema(spec, commands = []) {
|
|
|
127
127
|
export function notForThisCredential(spec, access) {
|
|
128
128
|
if (!access)
|
|
129
129
|
return undefined;
|
|
130
|
+
if (spec.operationsAreAlternatives && spec.operations?.some(operation => operationAccess(access, operation).allowed !== false))
|
|
131
|
+
return undefined;
|
|
130
132
|
for (const operation of spec.operations ?? []) {
|
|
131
133
|
const refused = operationAccess(access, operation);
|
|
132
134
|
if (refused.allowed !== false)
|
package/dist/package-check.js
CHANGED
|
@@ -5,6 +5,7 @@ import { locate, schemaSections, tenantWideSections } from "./package-files.js";
|
|
|
5
5
|
import { MANIFEST_SECTION, PERSONA_SECTION, sectionFields } from "./package-format.js";
|
|
6
6
|
import { kitErrorEntry } from "./kit-codes.js";
|
|
7
7
|
import { checkWorkflowQueries } from "./workflow-queries.js";
|
|
8
|
+
import { checkWritePaths } from "./database-write-paths.js";
|
|
8
9
|
import { cavelonCommand, fill, folderCommand } from "./printed.js";
|
|
9
10
|
import { branches, checkModels, checkReferences, checkUnknownFields, closest, DUPLICATE_CODE, FIELD_UNKNOWN_CODE, MODEL_UNKNOWN_CODE, REFERENCE_MISSING_CODE, REFERENCE_UNKNOWN_CODE, KNOWLEDGE_TOOL_KEYS, } from "./package-references.js";
|
|
10
11
|
export const SCHEMA_CODE = "package_schema_invalid";
|
|
@@ -33,6 +34,12 @@ const ASSERTION_UNCHECKED_CODE = "test_assertion_unchecked";
|
|
|
33
34
|
const TESTING_DOCS = "/docs/concepts/regression-testing";
|
|
34
35
|
const DATABASE_DOCS = "/docs/administration/database-connectors";
|
|
35
36
|
export const KIT_CODES = [
|
|
37
|
+
{
|
|
38
|
+
code: "private_target_refused", area: "database_connector",
|
|
39
|
+
message: "The instance refused a platform operator's private database target.",
|
|
40
|
+
hint: "Read detail.reason: invalid_range means an invalid CIDR; too_wide means a range above the allowed size; contains_local_interface means the range includes the instance's own interface; platform_network or platform_service means it reaches platform infrastructure; overlaps_another_tenant means another tenant owns an overlapping range. A Platform Owner reviews the range in the Admin in Platform mode. A tenant token never adds or removes these targets.",
|
|
41
|
+
docs: DATABASE_DOCS,
|
|
42
|
+
},
|
|
36
43
|
{
|
|
37
44
|
code: SCHEMA_CODE,
|
|
38
45
|
area: "package",
|
|
@@ -342,6 +349,7 @@ export function checkPackage(disk, options) {
|
|
|
342
349
|
findings.push(...checkTenantWide(disk, options.schema, options.solution));
|
|
343
350
|
findings.push(...checkQueryTools(disk, options.schema, options.queryBaseline, options.queryConnections));
|
|
344
351
|
findings.push(...checkWorkflowQueries(disk, options.schema, options.inventory, options.queryBaseline));
|
|
352
|
+
findings.push(...checkWritePaths(disk, options.schema, options.catalog, options.queryBaseline));
|
|
345
353
|
noteTenantWide(findings, options.schema, options.solution);
|
|
346
354
|
for (const finding of findings) {
|
|
347
355
|
const entry = findingEntry(options.catalog, finding.code);
|
package/dist/setup-agents.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { promises as fs } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { bundledSkills, generatedCopy, INSTALLED_MCP_COMMAND, mcpCommand } from "./agents.js";
|
|
4
|
-
import { readJsonFile, readTextFile, writeFileAtomic } from "./fsutil.js";
|
|
4
|
+
import { readJsonFile, readTextFile, withoutBom, writeFileAtomic } from "./fsutil.js";
|
|
5
5
|
import { findProgram } from "./git.js";
|
|
6
6
|
import { isGenerated, removeBlock, removeJsonEntry, upsertBlock, upsertJsonEntry } from "./markers.js";
|
|
7
7
|
import { cacheDir, homeDir } from "./paths.js";
|
|
@@ -195,6 +195,8 @@ function pluginCommands(kind) {
|
|
|
195
195
|
return {
|
|
196
196
|
marketplaceAdd: [],
|
|
197
197
|
marketplaceRemove: [],
|
|
198
|
+
marketplaceUpdate: [],
|
|
199
|
+
update: ["extensions", "update", GEMINI_EXTENSION],
|
|
198
200
|
install: ["extensions", "install", GEMINI_SOURCE, "--ref", `v${KIT_VERSION}`, "--consent"],
|
|
199
201
|
uninstall: ["extensions", "uninstall", GEMINI_EXTENSION],
|
|
200
202
|
};
|
|
@@ -202,11 +204,79 @@ function pluginCommands(kind) {
|
|
|
202
204
|
return {
|
|
203
205
|
marketplaceAdd: ["plugin", "marketplace", "add", MARKETPLACE_SOURCE],
|
|
204
206
|
marketplaceRemove: ["plugin", "marketplace", "remove", MARKETPLACE],
|
|
207
|
+
marketplaceUpdate: ["plugin", "marketplace", kind === "claude" ? "update" : "upgrade", MARKETPLACE],
|
|
208
|
+
update: kind === "claude" ? ["plugin", "update", PLUGIN_ID, "--scope", "user"] : ["plugin", "add", PLUGIN_ID],
|
|
205
209
|
install: kind === "claude" ? ["plugin", "install", PLUGIN_ID, "--scope", "user"] : ["plugin", "add", PLUGIN_ID],
|
|
206
210
|
uninstall: kind === "claude" ? ["plugin", "uninstall", PLUGIN_ID, "--scope", "user"] : ["plugin", "remove", PLUGIN_ID],
|
|
207
211
|
};
|
|
208
212
|
}
|
|
209
|
-
|
|
213
|
+
async function updateGemini(program, env) {
|
|
214
|
+
const directory = path.join(geminiHome(env), "extensions", GEMINI_EXTENSION);
|
|
215
|
+
const file = path.join(directory, ".gemini-extension-install.json");
|
|
216
|
+
const stat = await fs.lstat(file);
|
|
217
|
+
if (!stat.isFile() || stat.isSymbolicLink())
|
|
218
|
+
throw new Error(`Cannot update ${file}: expected regular extension install metadata.`);
|
|
219
|
+
const metadata = JSON.parse(withoutBom(await fs.readFile(file, "utf8")));
|
|
220
|
+
if (!["git", "github-release"].includes(String(metadata.type)) || ![GEMINI_SOURCE, `${GEMINI_SOURCE}.git`].includes(String(metadata.source))) {
|
|
221
|
+
throw new Error("The Cavelon extension has a custom or local source; update it through that source, or install the published Cavelon extension first.");
|
|
222
|
+
}
|
|
223
|
+
const manifest = await readJsonFile(path.join(directory, "gemini-extension.json"));
|
|
224
|
+
if (manifest?.version === KIT_VERSION)
|
|
225
|
+
return { code: 0, stdout: "Already at this release.", stderr: "" };
|
|
226
|
+
if (manifest?.settings !== undefined)
|
|
227
|
+
throw new Error("This extension declares custom settings; update it in Gemini before using the published Cavelon extension.");
|
|
228
|
+
const enablement = path.join(path.dirname(directory), "extension-enablement.json");
|
|
229
|
+
const readEnablement = async () => {
|
|
230
|
+
const text = await readTextFile(enablement);
|
|
231
|
+
if (text === undefined)
|
|
232
|
+
return { text, value: {} };
|
|
233
|
+
const stat = await fs.lstat(enablement);
|
|
234
|
+
if (!stat.isFile() || stat.isSymbolicLink())
|
|
235
|
+
throw new Error("Expected a regular Gemini enablement file.");
|
|
236
|
+
const value = JSON.parse(withoutBom(text));
|
|
237
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
238
|
+
throw new Error("Unrecognized Gemini enablement settings.");
|
|
239
|
+
return { text, value: value };
|
|
240
|
+
};
|
|
241
|
+
const original = await readEnablement();
|
|
242
|
+
const cwd = await geminiFolder("gemini", env);
|
|
243
|
+
const backup = await fs.mkdtemp(path.join(cwd, "cavelon-update-"));
|
|
244
|
+
await fs.chmod(backup, 0o700).catch(() => undefined);
|
|
245
|
+
await fs.cp(directory, path.join(backup, "extension"), { recursive: true });
|
|
246
|
+
const commands = pluginCommands("gemini");
|
|
247
|
+
let removed = false;
|
|
248
|
+
let success = false;
|
|
249
|
+
try {
|
|
250
|
+
const uninstall = await runProgram(program, commands.uninstall, { env, timeoutMs: RUN_TIMEOUT_MS, cwd });
|
|
251
|
+
if (uninstall.code !== 0)
|
|
252
|
+
return { ...uninstall, error: `Gemini could not replace the old extension. Backup: ${backup}` };
|
|
253
|
+
removed = true;
|
|
254
|
+
const result = await runProgram(program, commands.install, { env, timeoutMs: RUN_TIMEOUT_MS, cwd });
|
|
255
|
+
const installed = await readJsonFile(path.join(directory, "gemini-extension.json"));
|
|
256
|
+
success = result.code === 0 && installed?.version === KIT_VERSION;
|
|
257
|
+
if (!success)
|
|
258
|
+
return { ...result, code: result.code || 1, error: `Gemini did not install Cavelon ${KIT_VERSION}. Previous files are backed up at ${backup}; retry cavelon setup --update --agents gemini in your terminal.` };
|
|
259
|
+
return result;
|
|
260
|
+
}
|
|
261
|
+
finally {
|
|
262
|
+
if (removed && !success) {
|
|
263
|
+
await fs.rm(directory, { recursive: true, force: true });
|
|
264
|
+
await fs.cp(path.join(backup, "extension"), directory, { recursive: true });
|
|
265
|
+
}
|
|
266
|
+
const current = await readEnablement();
|
|
267
|
+
if (Object.hasOwn(original.value, GEMINI_EXTENSION))
|
|
268
|
+
current.value[GEMINI_EXTENSION] = original.value[GEMINI_EXTENSION];
|
|
269
|
+
else
|
|
270
|
+
delete current.value[GEMINI_EXTENSION];
|
|
271
|
+
if (original.text === undefined && !Object.keys(current.value).length)
|
|
272
|
+
await fs.rm(enablement, { force: true });
|
|
273
|
+
else
|
|
274
|
+
await writeKeepingMode(enablement, JSON.stringify(current.value, null, 2) + "\n");
|
|
275
|
+
if (success)
|
|
276
|
+
await fs.rm(backup, { recursive: true, force: true });
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
export async function planAgent(agent, found, env, command, skills, platform = process.platform, record, update = false) {
|
|
210
280
|
const usePlugin = Boolean(agent.plugin && found.program);
|
|
211
281
|
const state = usePlugin ? await pluginState(agent.plugin, found.program, env) : undefined;
|
|
212
282
|
const plan = { agent, found, method: usePlugin ? "plugin" : "files", changes: [] };
|
|
@@ -222,11 +292,16 @@ export async function planAgent(agent, found, env, command, skills, platform = p
|
|
|
222
292
|
if (!state.marketplace && commands.marketplaceAdd.length) {
|
|
223
293
|
plan.changes.push({ kind: "marketplace", summary: "add the Cavelon plugin marketplace", target: display(program, commands.marketplaceAdd), outcome: "planned" });
|
|
224
294
|
}
|
|
295
|
+
if (update && state.marketplace && commands.marketplaceUpdate.length)
|
|
296
|
+
plan.changes.push({ kind: "marketplace", summary: "refresh the Cavelon plugin marketplace", target: display(program, commands.marketplaceUpdate), outcome: "planned", refresh: true });
|
|
297
|
+
const refresh = update && state.installed && state.enabled;
|
|
225
298
|
plan.changes.push({
|
|
226
299
|
kind: "plugin",
|
|
227
|
-
summary:
|
|
228
|
-
target: display(program, commands.install),
|
|
229
|
-
outcome: state.installed ? "unchanged" : "planned",
|
|
300
|
+
summary: `${refresh ? "update" : "install"} the Cavelon ${kind === "gemini" ? "extension" : "plugin"} (skills and tools)`,
|
|
301
|
+
target: refresh && kind === "gemini" ? `${display(program, commands.uninstall)}; ${display(program, commands.install)}` : display(program, refresh ? commands.update : commands.install),
|
|
302
|
+
outcome: state.installed && !refresh ? "unchanged" : "planned",
|
|
303
|
+
...(refresh ? { refresh: true } : {}),
|
|
304
|
+
...(refresh && kind === "gemini" ? { reason: `replace the published extension at v${KIT_VERSION} through Gemini; preserve enablement and back up the previous files` } : {}),
|
|
230
305
|
...(state.installed && !state.enabled ? { reason: `it is installed but turned off; turn it on in ${agent.label}` } : {}),
|
|
231
306
|
});
|
|
232
307
|
}
|
|
@@ -364,10 +439,12 @@ export async function applyPlan(plan, env, command, skills, record) {
|
|
|
364
439
|
if (change.kind === "marketplace" || change.kind === "plugin") {
|
|
365
440
|
const kind = plan.agent.plugin;
|
|
366
441
|
const commands = pluginCommands(kind);
|
|
367
|
-
const args = change.kind === "marketplace" ? commands.marketplaceAdd : commands.install;
|
|
368
|
-
const result =
|
|
442
|
+
const args = change.kind === "marketplace" ? (change.refresh ? commands.marketplaceUpdate : commands.marketplaceAdd) : (change.refresh ? commands.update : commands.install);
|
|
443
|
+
const result = kind === "gemini" && change.refresh
|
|
444
|
+
? await updateGemini(plan.found.program, env)
|
|
445
|
+
: await runProgram(plan.found.program, args, { env, timeoutMs: RUN_TIMEOUT_MS, cwd: await geminiFolder(kind, env) });
|
|
369
446
|
if (result.code !== 0) {
|
|
370
|
-
if (kind === "gemini") {
|
|
447
|
+
if (kind === "gemini" && !change.refresh) {
|
|
371
448
|
const reason = result.error ?? (lastLine(`${result.stdout}\n${result.stderr}`) || `exit ${result.code}`);
|
|
372
449
|
done.push({ ...change, outcome: "skipped", reason: `${reason}; the tools server and skills go into Gemini CLI's files instead` });
|
|
373
450
|
done.push(await mcpChange(plan.agent.mcp, command, true, record));
|
|
@@ -377,10 +454,12 @@ export async function applyPlan(plan, env, command, skills, record) {
|
|
|
377
454
|
done.push({ ...change, outcome: "failed", reason: result.error ?? (firstLine(result.stderr || result.stdout) || `exit ${result.code}`) });
|
|
378
455
|
break;
|
|
379
456
|
}
|
|
380
|
-
if (change.
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
457
|
+
if (!change.refresh) {
|
|
458
|
+
if (change.kind === "marketplace")
|
|
459
|
+
record.marketplace_added = true;
|
|
460
|
+
else
|
|
461
|
+
record.plugin_installed = true;
|
|
462
|
+
}
|
|
384
463
|
done.push({ ...change, outcome: "done" });
|
|
385
464
|
if (kind === "gemini" && change.kind === "plugin")
|
|
386
465
|
done.push(...(await removeFiles(plan.agent, record, skills, new Set())));
|
|
@@ -328,6 +328,22 @@ schema has them: `cavelon validate` reports an unknown section):
|
|
|
328
328
|
|
|
329
329
|
## Database query tools
|
|
330
330
|
|
|
331
|
+
Before applying edited SQL, run `cavelon db test-run <slug> --draft --value
|
|
332
|
+
<name>=<value>`: it validates package/ and tests the unsaved query without
|
|
333
|
+
saving it. Draft tests need `database_connectors.manage` with the Owner's PAT
|
|
334
|
+
or the Admin, never an API key. Saved query delete, enable, disable and rename
|
|
335
|
+
use `cavelon db queries <action>`; preview first and obtain the person's yes,
|
|
336
|
+
then pull so the package follows. YOLO does not approve those changes.
|
|
337
|
+
|
|
338
|
+
Connection settings stay outside packages. The CLI accepts public SSH tunnel,
|
|
339
|
+
Kerberos and listener-redirect settings, but passwords, SSH private keys,
|
|
340
|
+
keytabs, any CA change and weaker TLS stay with a person in the Admin.
|
|
341
|
+
`db instance` publishes runnable and Kerberos dialects, SSH support and the
|
|
342
|
+
tenant's admitted private targets; never infer support from a dialect name.
|
|
343
|
+
Db2 requires verified TLS and the instance's explicit offer. PostgreSQL
|
|
344
|
+
compatible engines use `postgresql`, MySQL compatible engines use `mysql`;
|
|
345
|
+
TiDB is refused. `validate` warns on Citus administrative function calls.
|
|
346
|
+
|
|
331
347
|
A database query tool lets an agent answer from a customer's live database. A
|
|
332
348
|
saved query of explicit `kind: read` or `kind: write` is one tool (`tool_type: database_query` in
|
|
333
349
|
`package/tools.yaml`); the model only calls it and fills the parameters it is
|
|
@@ -552,8 +568,14 @@ graph_edges:
|
|
|
552
568
|
in such a run.
|
|
553
569
|
- **Write confirmation and budget.** Every direct Tool Call node refuses a
|
|
554
570
|
write with `requires_confirmation: true` (`confirmation_unavailable`),
|
|
555
|
-
because it cannot wait for the person's click; `validate` warns.
|
|
556
|
-
|
|
571
|
+
because it cannot wait for the person's click; `validate` warns. Without
|
|
572
|
+
query confirmation, use a schedule, a webhook whose secret header is checked,
|
|
573
|
+
or Run now. On an outsider-started path, only a direct Tool Call after the
|
|
574
|
+
latest approved Approval decision with no later agent stage may write;
|
|
575
|
+
a later rejection revokes it. An agent cannot use that exception. Other
|
|
576
|
+
paths answer `write_needs_confirmation`; keep confirmation on for chat.
|
|
577
|
+
`validate` warns about statically visible unsafe paths; it cannot attest
|
|
578
|
+
an actual runtime decision. The shared workflow cap
|
|
557
579
|
counts the query's saved `max_calls` across a workflow run's Tool Call
|
|
558
580
|
nodes, Agent stages, `for_each` iterations and concurrent branches, and
|
|
559
581
|
persists on resume. The next call is refused with `tool_call_limit_reached`
|
|
@@ -105,11 +105,17 @@ use it when you parse the result.
|
|
|
105
105
|
URL if you do not know it.
|
|
106
106
|
|
|
107
107
|
- **Connect a database, leaving the password with a person.** A database query tool
|
|
108
|
-
|
|
108
|
+
can be edited and tested before apply with `db test-run <slug> --draft`;
|
|
109
|
+
validate, test the unsaved query, then preview apply and obtain the person's
|
|
110
|
+
approval. Draft tests need the Owner's PAT with `database_connectors.manage`.
|
|
111
|
+
SSH keys, Kerberos keytabs, CA changes and weaker TLS are Admin steps too.
|
|
112
|
+
The query needs a connection of the name and dialect its package names, tested
|
|
109
113
|
successfully, in every tenant it is applied to. A personal access token
|
|
110
114
|
holding `database_connectors.manage` (the tenant Owner, legacy Admin, or a
|
|
111
115
|
superadmin in Tenant mode) may run `cavelon db connections create|update|delete`
|
|
112
|
-
|
|
116
|
+
using public settings. A person changes the CA or weakens TLS in the Admin;
|
|
117
|
+
`db connections ca` retains public-file uploads only on older instances
|
|
118
|
+
that do not publish the restriction.
|
|
113
119
|
Create sends no password and prints the Admin step from `needs_a_person`;
|
|
114
120
|
a person enters it in Settings › Security & access › Databases. Never take
|
|
115
121
|
a password as an argument, environment value, stdin, file or tool input.
|
|
@@ -377,7 +383,11 @@ show the person the preview again and let them confirm it (in the client's
|
|
|
377
383
|
dialog or their own terminal), never retry on your own.
|
|
378
384
|
|
|
379
385
|
**YOLO is explicitly enabled by the person.** A CLI invocation may start with
|
|
380
|
-
`cavelon --yolo …`, or
|
|
386
|
+
`cavelon --yolo …`, or enable MCP YOLO through the installer or their personal
|
|
387
|
+
`cavelon setup --mcp-mode yolo --yes` setting and restart the coding agent.
|
|
388
|
+
An MCP launch may also use `cavelon mcp --yolo`; `--no-yolo` overrides a saved
|
|
389
|
+
preference for that process. Never change this personal preference yourself.
|
|
390
|
+
Eligible
|
|
381
391
|
routine work then previews and executes internally; do not add a question
|
|
382
392
|
of your own. It is not a tool argument or repository setting, and you must
|
|
383
393
|
not enable it to work around a refusal. Its allowance is bound to the
|
|
@@ -135,6 +135,14 @@ The case's own reason (which knowledge base, which value) is in the output of
|
|
|
135
135
|
|
|
136
136
|
## Database query tools
|
|
137
137
|
|
|
138
|
+
Test edited package SQL before apply with `cavelon db test-run <slug> --draft
|
|
139
|
+
--value <name>=<value>` (MCP `db_test_run` with `draft: true`). It runs local
|
|
140
|
+
validation, resolves the connection in this tenant and saves no query.
|
|
141
|
+
It needs the Owner's PAT with `database_connectors.manage` or the Admin;
|
|
142
|
+
an API key is refused. Use `db instance` and the connection test's published
|
|
143
|
+
SSH, engine, private-target and redirect evidence to check the actual setup.
|
|
144
|
+
Passwords, keytabs, SSH keys and CA/TLS decisions stay in the Admin.
|
|
145
|
+
|
|
138
146
|
Test a solution with database query tools against a test database, never the
|
|
139
147
|
customer's live one: the test tenant (`--env test`) has a connection of the
|
|
140
148
|
same name pointing at a test database with known rows, set up by a person in
|
|
@@ -202,9 +210,16 @@ the Admin. Then:
|
|
|
202
210
|
checks the database before any repetition. Query-definition approval and
|
|
203
211
|
`requires_confirmation` before executing a chat write are separate.
|
|
204
212
|
- A direct workflow Tool Call write with confirmation enabled answers
|
|
205
|
-
`confirmation_unavailable`.
|
|
206
|
-
|
|
207
|
-
|
|
213
|
+
`confirmation_unavailable`. Keep confirmation on for chat. A query without
|
|
214
|
+
it writes only from a schedule, a webhook with a checked secret header, or
|
|
215
|
+
Run now, or from a direct Tool Call after the latest approved Approval
|
|
216
|
+
decision with no later agent stage. A later rejection revokes approval;
|
|
217
|
+
an agent never uses that exception. Test rejected, bypass and intervening-agent
|
|
218
|
+
paths for `write_needs_confirmation` and zero writes. Operator test surfaces
|
|
219
|
+
(Playground/voice, suites, debug runs and dashboard/PAT chat) always dry-run
|
|
220
|
+
writes; check `surface`, rollback and commit evidence, never infer it from
|
|
221
|
+
missing fields. Retain model-only arguments and trigger identity checks.
|
|
222
|
+
The shared `max_calls` budget counts across direct nodes,
|
|
208
223
|
Agent stages, `for_each`, concurrent branches and resume; expect
|
|
209
224
|
`tool_call_limit_reached` on the next call and `refused` run evidence.
|
|
210
225
|
A direct node fails with that code; an Agent receives the tool's refusal.
|
package/dist/workflow-queries.js
CHANGED
|
@@ -153,7 +153,7 @@ export function checkWorkflowQueries(disk, schema, inventory, baseline) {
|
|
|
153
153
|
continue;
|
|
154
154
|
const confirmation = object(object(querySchema(schema)?.properties)?.requires_confirmation);
|
|
155
155
|
if (schemaKnowsWrites(schema) && query.kind === "write" && confirmation && (query.requires_confirmation ?? confirmation.default) === true) {
|
|
156
|
-
findings.push({ code: "confirmation_unavailable", severity: "warning", ...locate(disk, at), message: `Tool Call node "${String(node.slug ?? index)}" calls write query "${slug}" with requires_confirmation: the node cannot wait for a person's click, so the instance refuses it with confirmation_unavailable.`, hint: "
|
|
156
|
+
findings.push({ code: "confirmation_unavailable", severity: "warning", ...locate(disk, at), message: `Tool Call node "${String(node.slug ?? index)}" calls write query "${slug}" with requires_confirmation: the node cannot wait for a person's click, so the instance refuses it with confirmation_unavailable.`, hint: "Keep confirmation on for an agent's chat use. For a direct Tool Call, put an Approval node immediately before it with no intervening agent stage, or start the run from a schedule, a webhook with a checked secret header, or Run now; only those intended paths may use a query without confirmation." });
|
|
157
157
|
}
|
|
158
158
|
const parameters = rows(query.parameters);
|
|
159
159
|
const model = new Set(parameters.filter((parameter) => (parameter.source ?? source) === source).map((parameter) => parameter.name));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cavelon/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "The cavelon binary: CLI and local MCP server for building Cavelon solutions with a coding agent.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/goodguys-gmbh/cavelon-dev-kit",
|