@cavelon/cli 0.2.9 → 0.2.11

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.
@@ -26,7 +26,7 @@ import { harnessNotFoundError, listHarnesses, lookupHarness, SLUG, slugFromName
26
26
  import { isUuid, lookupTenantId, requireInstance, requireToken, tenantRequiredError } from "../session.js";
27
27
  import { cavelonCommand, fill, folderCommand } from "../printed.js";
28
28
  import { chooseTenant, listsTenants, noTenantError, tenantOpenError, tenantRef, tenantTitle } from "../tenant-choice.js";
29
- import { createHarness } from "./tenants.js";
29
+ import { createHarness, NEW_HARNESS_AUTHORING_HINT } from "./tenants.js";
30
30
  import { schemaFor, setProjectKey } from "./solution.js";
31
31
  const HOOK_LINES = (prefix) => [
32
32
  "# Check the Cavelon package before each commit (`cavelon init --hook`).",
@@ -704,7 +704,7 @@ async function runInit(ctx, input) {
704
704
  else if (!(await hasPackageFiles(root, project.layout.package))) {
705
705
  const choices = chosenHarness?.choices ?? [];
706
706
  if (chosenHarness?.created || chosenHarness?.missing) {
707
- next.unshift(`Bring the draft into package/ (its manifest): ${folderCommand("pull")}`, `Write the package files in package/, then: ${folderCommand("validate")}`, `Preview it on the instance: ${folderCommand("apply", "--env", "test")}`);
707
+ next.unshift(`Bring the draft into package/ (its manifest): ${folderCommand("pull")}`, `Write the package files in package/, then: ${folderCommand("validate")}`, NEW_HARNESS_AUTHORING_HINT, `Preview it on the instance: ${folderCommand("apply", "--env", "test")}`);
708
708
  }
709
709
  else if (harness)
710
710
  next.unshift(`Bring the solution into package/: ${folderCommand("pull")}`);
@@ -391,6 +391,7 @@ export async function createHarness(ctx, body, idempotencyKey) {
391
391
  await checkHarnessCapacity(ctx, body.slug);
392
392
  return callStable(ctx, "POST", "/api/v1/harnesses", "creating solutions", { body, headers: idempotency(idempotencyKey) });
393
393
  }
394
+ export const NEW_HARNESS_AUTHORING_HINT = "For a new chat/trigger solution, add a connected chat_start with config.demo_message or trigger_start with config.trigger_slug and config.demo_payload in package/registry_entities.yaml. Match demo data to the trigger's schema; keep Masterloop iteration entrypoints under their own rules. See the cavelon-authoring skill.";
394
395
  export const harnessNew = {
395
396
  name: "harness new",
396
397
  summary: "Create an empty draft solution (harness).",
@@ -411,12 +412,12 @@ export const harnessNew = {
411
412
  body.description = description;
412
413
  const harness = await createHarness(ctx, body, stringOption(input, "idempotency-key"));
413
414
  return {
414
- data: harness,
415
+ data: { ...harness, next: [NEW_HARNESS_AUTHORING_HINT] },
415
416
  text: keyValues([
416
417
  ["created", `${harness.name} (${harness.slug})`],
417
418
  ["id", harness.id],
418
419
  ["status", harness.status],
419
- ]),
420
+ ]) + `\n\nNext: ${NEW_HARNESS_AUTHORING_HINT}`,
420
421
  };
421
422
  },
422
423
  };
@@ -277,7 +277,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
277
277
 
278
278
  ---
279
279
 
280
- typebox 1.3.36
280
+ typebox 1.4.2
281
281
  TypeBox
282
282
 
283
283
  The MIT License (MIT)
@@ -342,7 +342,7 @@ THIS SOFTWARE.
342
342
 
343
343
  ---
344
344
 
345
- zod 4.6.5
345
+ zod 4.6.7
346
346
  MIT License
347
347
 
348
348
  Copyright (c) 2025 Colin McDonnell
@@ -15686,6 +15686,7 @@ __export(util_exports, {
15686
15686
  required: () => required,
15687
15687
  safeExtend: () => safeExtend,
15688
15688
  shallowClone: () => shallowClone,
15689
+ sizeCaps: () => sizeCaps,
15689
15690
  slugify: () => slugify,
15690
15691
  stringifyPrimitive: () => stringifyPrimitive,
15691
15692
  toZod: () => toZod,
@@ -16205,6 +16206,18 @@ function prefixIssues(path4, issues) {
16205
16206
  function unwrapMessage(message) {
16206
16207
  return typeof message === "string" ? message : message?.message;
16207
16208
  }
16209
+ function sizeCaps(defChecks) {
16210
+ const caps = [];
16211
+ for (const ch of defChecks ?? []) {
16212
+ const d = ch._zod.def;
16213
+ if (!/_(length|size)$|_equals$/.test(d.check))
16214
+ break;
16215
+ const max = d.maximum ?? d.length ?? d.size;
16216
+ if (max >= 0)
16217
+ caps.push([max, ch]);
16218
+ }
16219
+ return caps;
16220
+ }
16208
16221
  function attachSchema(issues, start, inst) {
16209
16222
  var _a3;
16210
16223
  for (let i = start; i < issues.length; i++) {
@@ -17625,7 +17638,7 @@ ${content.join("\n")}
17625
17638
  var version = {
17626
17639
  major: 4,
17627
17640
  minor: 6,
17628
- patch: 5
17641
+ patch: 7
17629
17642
  };
17630
17643
 
17631
17644
  // node_modules/zod/v4/core/schemas.js
@@ -18381,6 +18394,31 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
18381
18394
  return payload;
18382
18395
  };
18383
18396
  });
18397
+ function capSize(inst, size) {
18398
+ const caps = sizeCaps(inst._zod.def.checks);
18399
+ if (!caps.length)
18400
+ return;
18401
+ const cap = Math.min(...caps.map((c) => c[0]));
18402
+ const parse5 = inst._zod.parse;
18403
+ inst._zod.parse = (payload, ctx) => {
18404
+ const n = size(payload.value);
18405
+ if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
18406
+ for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
18407
+ if (n > max && ch._zod.def.when(payload)) {
18408
+ const start = payload.issues.length;
18409
+ ch._zod.check(payload);
18410
+ payload.issues[start].continue = false;
18411
+ attachSchema(payload.issues, start, inst);
18412
+ return payload;
18413
+ }
18414
+ }
18415
+ }
18416
+ return parse5(payload, ctx);
18417
+ };
18418
+ }
18419
+ var arraySize = (input2) => Array.isArray(input2) ? input2.length : -1;
18420
+ var mapSize = (input2) => input2 instanceof Map ? input2.size : -1;
18421
+ var setSize = (input2) => input2 instanceof Set ? input2.size : -1;
18384
18422
  function handleArrayResult(result, final, index) {
18385
18423
  if (result.issues.length) {
18386
18424
  final.issues.push(...prefixIssues(index, result.issues));
@@ -18424,6 +18462,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
18424
18462
  }
18425
18463
  return payload;
18426
18464
  };
18465
+ capSize(inst, arraySize);
18427
18466
  });
18428
18467
  function handlePropertyResult(result, final, key, input2, optin, optout) {
18429
18468
  const isPresent = key in input2;
@@ -19380,6 +19419,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
19380
19419
  return Promise.all(proms).then(() => payload);
19381
19420
  return payload;
19382
19421
  };
19422
+ capSize(inst, mapSize);
19383
19423
  });
19384
19424
  function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
19385
19425
  if (keyResult.issues.length) {
@@ -19446,6 +19486,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
19446
19486
  return Promise.all(proms).then(() => payload);
19447
19487
  return payload;
19448
19488
  };
19489
+ capSize(inst, setSize);
19449
19490
  });
19450
19491
  function handleSetResult(result, final) {
19451
19492
  if (result.issues.length) {
@@ -28976,9 +29017,15 @@ function generateNullableCheck(doc, ctx, schema, accessor, buildsValue = true) {
28976
29017
  doc.write(`}`);
28977
29018
  return outputVar;
28978
29019
  }
29020
+ function generateSizeGate(doc, schema, size) {
29021
+ for (const [max, check2] of sizeCaps(schema._zod.def.checks)) {
29022
+ doc.write(`if (${size} > ${numericOperand(max, check2._zod.def.check)}) return INVALID;`);
29023
+ }
29024
+ }
28979
29025
  function generateArrayCheck(doc, ctx, schema, accessor, buildsValue = true) {
28980
29026
  const def = schema._zod.def;
28981
29027
  doc.write(`if (!Array.isArray(${accessor})) return INVALID;`);
29028
+ generateSizeGate(doc, schema, `${accessor}.length`);
28982
29029
  const outputVar = buildsValue ? newVar(ctx) : null;
28983
29030
  const iVar = newVar(ctx);
28984
29031
  const elemVar = newVar(ctx);
@@ -29378,6 +29425,7 @@ function literalPropertyKey(ctx, key) {
29378
29425
  function generateMapCheck(doc, ctx, schema, accessor) {
29379
29426
  const def = schema._zod.def;
29380
29427
  doc.write(`if (!(${accessor} instanceof Map)) return INVALID;`);
29428
+ generateSizeGate(doc, schema, `${accessor}.size`);
29381
29429
  const outputVar = newVar(ctx);
29382
29430
  const kVar = newVar(ctx);
29383
29431
  const valVar = newVar(ctx);
@@ -29394,6 +29442,7 @@ function generateMapCheck(doc, ctx, schema, accessor) {
29394
29442
  function generateSetCheck(doc, ctx, schema, accessor) {
29395
29443
  const def = schema._zod.def;
29396
29444
  doc.write(`if (!(${accessor} instanceof Set)) return INVALID;`);
29445
+ generateSizeGate(doc, schema, `${accessor}.size`);
29397
29446
  const outputVar = newVar(ctx);
29398
29447
  const valVar = newVar(ctx);
29399
29448
  doc.write(`const ${outputVar} = new Set();`);
@@ -15106,6 +15106,7 @@ __export(util_exports, {
15106
15106
  required: () => required,
15107
15107
  safeExtend: () => safeExtend,
15108
15108
  shallowClone: () => shallowClone,
15109
+ sizeCaps: () => sizeCaps,
15109
15110
  slugify: () => slugify,
15110
15111
  stringifyPrimitive: () => stringifyPrimitive,
15111
15112
  toZod: () => toZod,
@@ -15625,6 +15626,18 @@ function prefixIssues(path4, issues) {
15625
15626
  function unwrapMessage(message) {
15626
15627
  return typeof message === "string" ? message : message?.message;
15627
15628
  }
15629
+ function sizeCaps(defChecks) {
15630
+ const caps = [];
15631
+ for (const ch of defChecks ?? []) {
15632
+ const d = ch._zod.def;
15633
+ if (!/_(length|size)$|_equals$/.test(d.check))
15634
+ break;
15635
+ const max = d.maximum ?? d.length ?? d.size;
15636
+ if (max >= 0)
15637
+ caps.push([max, ch]);
15638
+ }
15639
+ return caps;
15640
+ }
15628
15641
  function attachSchema(issues, start, inst) {
15629
15642
  var _a3;
15630
15643
  for (let i = start; i < issues.length; i++) {
@@ -16684,7 +16697,7 @@ ${content.join("\n")}
16684
16697
  var version = {
16685
16698
  major: 4,
16686
16699
  minor: 6,
16687
- patch: 5
16700
+ patch: 7
16688
16701
  };
16689
16702
 
16690
16703
  // node_modules/zod/v4/core/schemas.js
@@ -17258,6 +17271,29 @@ var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
17258
17271
  return payload;
17259
17272
  };
17260
17273
  });
17274
+ function capSize(inst, size) {
17275
+ const caps = sizeCaps(inst._zod.def.checks);
17276
+ if (!caps.length)
17277
+ return;
17278
+ const cap = Math.min(...caps.map((c) => c[0]));
17279
+ const parse5 = inst._zod.parse;
17280
+ inst._zod.parse = (payload, ctx) => {
17281
+ const n = size(payload.value);
17282
+ if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
17283
+ for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
17284
+ if (n > max && ch._zod.def.when(payload)) {
17285
+ const start = payload.issues.length;
17286
+ ch._zod.check(payload);
17287
+ payload.issues[start].continue = false;
17288
+ attachSchema(payload.issues, start, inst);
17289
+ return payload;
17290
+ }
17291
+ }
17292
+ }
17293
+ return parse5(payload, ctx);
17294
+ };
17295
+ }
17296
+ var arraySize = (input) => Array.isArray(input) ? input.length : -1;
17261
17297
  function handleArrayResult(result, final, index) {
17262
17298
  if (result.issues.length) {
17263
17299
  final.issues.push(...prefixIssues(index, result.issues));
@@ -17301,6 +17337,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
17301
17337
  }
17302
17338
  return payload;
17303
17339
  };
17340
+ capSize(inst, arraySize);
17304
17341
  });
17305
17342
  function handlePropertyResult(result, final, key, input, optin, optout) {
17306
17343
  const isPresent = key in input;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "format": 1,
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "entries": {
5
5
  "omp": [
6
6
  "omp-extension.mjs"
@@ -25,13 +25,13 @@
25
25
  },
26
26
  {
27
27
  "path": "kilo-server.mjs",
28
- "size": 1494321,
29
- "sha256": "d17dee519e66697ae62a55d8d2e8d4ac411c682b947cedd235e6bc52a688d06e"
28
+ "size": 1496038,
29
+ "sha256": "d6db56aea20cce2da0b262227b6079b45655109f82ea7ae61851aff6876514ce"
30
30
  },
31
31
  {
32
32
  "path": "kilo-tui.mjs",
33
- "size": 940457,
34
- "sha256": "6dce9d0bc29e9a46bb40f98c914a13d5238a9e12e52c842aaa975bcca8e2ce75"
33
+ "size": 941608,
34
+ "sha256": "21f4d44e1517c29282835b461357e3f20dabc9b834e74d47022e4051407ab0a1"
35
35
  },
36
36
  {
37
37
  "path": "LICENSE",
@@ -45,28 +45,28 @@
45
45
  },
46
46
  {
47
47
  "path": "omp-extension.mjs",
48
- "size": 1148227,
49
- "sha256": "99f8e790e70fe7a72cd1affde628ea0e52fd0642db8a0084bf2791ce803e4410"
48
+ "size": 1146200,
49
+ "sha256": "900767ee9a235c4f32aa4ebb748a617d12dbc4b0d1d4838f454e93ceb183771f"
50
50
  },
51
51
  {
52
52
  "path": "opencode-server.mjs",
53
- "size": 1493309,
54
- "sha256": "4829901f1c5bbe0d96156297cd11cc8cfa08f44d1a3110743e6c9316ec3fe09a"
53
+ "size": 1495026,
54
+ "sha256": "a39a014328c1627070303be6b930f3a5dbb61c3fabbf6a898a9e8f54be31a4f6"
55
55
  },
56
56
  {
57
57
  "path": "opencode-tui.mjs",
58
- "size": 940363,
59
- "sha256": "ffc26d95060ec653b81789022496a90a1eb25bac23075a5f05025fa1ba97e038"
58
+ "size": 941514,
59
+ "sha256": "4b4a75a8c46e3178213c6181359b5c89a634ec9795581ee34aee8b51a6b886b4"
60
60
  },
61
61
  {
62
62
  "path": "pi-extension.mjs",
63
- "size": 1148135,
64
- "sha256": "a45ae3ea3a8de1edb7399ddecac8544d986a73b93a55605685569d6afd711bee"
63
+ "size": 1146108,
64
+ "sha256": "ae85ceedf4cca3a0a08dbd78bc108944295f826836a025ff634d3db6ca907dd3"
65
65
  },
66
66
  {
67
67
  "path": "THIRD-PARTY-NOTICES",
68
- "size": 18303,
69
- "sha256": "f12be1a7c8faec83012f2f31ad0d20d1d92cab7d419582c5adb2f71721f6b04e"
68
+ "size": 18302,
69
+ "sha256": "6548bb7b7fd6b0a92fb287b45c5addf1886f1daebb59714e16833e8041aeb28c"
70
70
  },
71
71
  {
72
72
  "path": "TYPEBOX-LICENSE",