@cavelon/cli 0.2.10 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/attached-documents.js +121 -0
- package/dist/commands/chat.js +172 -14
- package/dist/commands/engagement.js +153 -0
- package/dist/commands/index.js +2 -0
- package/dist/commands/init.js +2 -2
- package/dist/commands/publication.js +3 -2
- package/dist/commands/solution.js +104 -10
- package/dist/commands/tenants.js +3 -2
- package/dist/commands/work.js +34 -5
- package/dist/engagement.js +117 -0
- package/dist/kit-codes.js +2 -0
- package/dist/managed-fields.js +212 -0
- package/dist/native-assets/THIRD-PARTY-NOTICES +2 -2
- package/dist/native-assets/kilo-server.mjs +65 -8
- package/dist/native-assets/kilo-tui.mjs +53 -8
- package/dist/native-assets/manifest.json +15 -15
- package/dist/native-assets/omp-extension.mjs +224 -288
- package/dist/native-assets/opencode-server.mjs +65 -8
- package/dist/native-assets/opencode-tui.mjs +53 -8
- package/dist/native-assets/pi-extension.mjs +224 -288
- package/dist/package-check.js +65 -5
- package/dist/package-format.js +10 -1
- package/dist/project.js +34 -0
- package/dist/setup-agents.js +1 -0
- package/dist/skills/cavelon-authoring/SKILL.md +51 -0
- package/dist/skills/cavelon-authoring/references/canvas-entrypoints.md +83 -0
- package/dist/skills/cavelon-long-running/SKILL.md +6 -0
- package/dist/skills/cavelon-loop/SKILL.md +8 -1
- package/dist/skills/cavelon-testing/SKILL.md +53 -1
- package/package.json +3 -3
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { locate } from "./package-files.js";
|
|
2
|
+
import { branches } from "./package-references.js";
|
|
3
|
+
export const UNMANAGED_SET_CODE = "unmanaged_field_set";
|
|
4
|
+
export const MANAGED_SETTING_UNKNOWN_CODE = "managed_setting_unknown";
|
|
5
|
+
export const MANAGED_KINDS_LEFT_OUT_CODE = "managed_kinds_left_out";
|
|
6
|
+
export const MANAGED_KINDS_UNSUPPORTED_CODE = "managed_kinds_unsupported";
|
|
7
|
+
export const NO_MANAGED_FIELDS = { unmanaged: [], kinds: {} };
|
|
8
|
+
const asObject = (v) => (v && typeof v === "object" && !Array.isArray(v) ? v : undefined);
|
|
9
|
+
export function pointerKeys(pointer) {
|
|
10
|
+
return pointer
|
|
11
|
+
.split("/")
|
|
12
|
+
.slice(1)
|
|
13
|
+
.map((k) => k.replace(/~1/g, "/").replace(/~0/g, "~"));
|
|
14
|
+
}
|
|
15
|
+
export function validManagedPointer(pointer) {
|
|
16
|
+
if (!pointer.startsWith("/"))
|
|
17
|
+
return false;
|
|
18
|
+
const keys = pointerKeys(pointer);
|
|
19
|
+
return keys.length >= 2 && keys.every((k) => k.length > 0);
|
|
20
|
+
}
|
|
21
|
+
export function hasManagedFields(managed) {
|
|
22
|
+
return Boolean(managed && (managed.unmanaged.length || Object.keys(managed.kinds).length));
|
|
23
|
+
}
|
|
24
|
+
function parentOf(value, keys) {
|
|
25
|
+
let at = asObject(value);
|
|
26
|
+
for (const key of keys.slice(0, -1)) {
|
|
27
|
+
at = asObject(at?.[key]);
|
|
28
|
+
if (!at)
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
return at;
|
|
32
|
+
}
|
|
33
|
+
function fieldSchema(schema, keys) {
|
|
34
|
+
let node = schema.properties?.[keys[0]];
|
|
35
|
+
for (const key of keys.slice(1)) {
|
|
36
|
+
const holder = branches(schema, node).find((b) => asObject(b.properties)?.[key] !== undefined);
|
|
37
|
+
node = holder ? asObject(holder.properties)[key] : undefined;
|
|
38
|
+
if (node === undefined)
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
return asObject(node);
|
|
42
|
+
}
|
|
43
|
+
function siblingFields(schema, keys) {
|
|
44
|
+
if (keys.length < 2)
|
|
45
|
+
return undefined;
|
|
46
|
+
const holder = keys.length === 2 ? schema.properties?.[keys[0]] : fieldSchema(schema, keys.slice(0, -1));
|
|
47
|
+
const object = branches(schema, holder).find((b) => asObject(b.properties)?.[keys[keys.length - 1]] !== undefined);
|
|
48
|
+
return asObject(object?.properties);
|
|
49
|
+
}
|
|
50
|
+
export function kindedList(schema, pointer) {
|
|
51
|
+
const keys = pointerKeys(pointer);
|
|
52
|
+
const field = fieldSchema(schema, keys);
|
|
53
|
+
if (!field)
|
|
54
|
+
return undefined;
|
|
55
|
+
const items = branches(schema, field).map((b) => b.items).find((i) => i !== undefined);
|
|
56
|
+
if (items === undefined)
|
|
57
|
+
return undefined;
|
|
58
|
+
const itemNode = asObject(items) ?? {};
|
|
59
|
+
const declared = asObject(itemNode.discriminator)?.propertyName;
|
|
60
|
+
const shapes = branches(schema, items).filter((b) => asObject(b.properties));
|
|
61
|
+
const constants = (name) => shapes.map((s) => asObject(asObject(s.properties)[name])).map((p) => (p && "const" in p ? p.const : undefined));
|
|
62
|
+
let discriminator = typeof declared === "string" ? declared : undefined;
|
|
63
|
+
if (!discriminator && shapes.length) {
|
|
64
|
+
discriminator = Object.keys(asObject(shapes[0].properties)).find((name) => constants(name).every((c) => typeof c === "string"));
|
|
65
|
+
}
|
|
66
|
+
const siblings = siblingFields(schema, keys);
|
|
67
|
+
const kindsName = `${keys[keys.length - 1]}_kinds`;
|
|
68
|
+
const kindsNode = siblings?.[kindsName];
|
|
69
|
+
const fromKinds = kindsNode
|
|
70
|
+
? branches(schema, kindsNode)
|
|
71
|
+
.map((b) => asObject(b.items))
|
|
72
|
+
.flatMap((i) => (i && Array.isArray(i.enum) ? i.enum : []))
|
|
73
|
+
.filter((k) => typeof k === "string")
|
|
74
|
+
: [];
|
|
75
|
+
const fromShapes = discriminator ? constants(discriminator).filter((c) => typeof c === "string") : [];
|
|
76
|
+
const known = fromKinds.length ? fromKinds : fromShapes;
|
|
77
|
+
return { ...(discriminator ? { discriminator } : {}), ...(kindsNode ? { kindsField: kindsName } : {}), ...(known.length ? { known } : {}) };
|
|
78
|
+
}
|
|
79
|
+
const kindOf = (entry, discriminator) => asObject(entry)?.[discriminator];
|
|
80
|
+
const label = (entry) => {
|
|
81
|
+
const id = asObject(entry)?.id;
|
|
82
|
+
return typeof id === "string" ? id : "?";
|
|
83
|
+
};
|
|
84
|
+
export function packageToSend(pkg, managed, schema) {
|
|
85
|
+
const out = structuredClone(pkg);
|
|
86
|
+
const result = { package: out, left_out: [], kinds: [] };
|
|
87
|
+
for (const pointer of managed.unmanaged) {
|
|
88
|
+
const keys = pointerKeys(pointer);
|
|
89
|
+
const parent = parentOf(out, keys);
|
|
90
|
+
const last = keys[keys.length - 1];
|
|
91
|
+
if (parent && last in parent) {
|
|
92
|
+
delete parent[last];
|
|
93
|
+
result.left_out.push(pointer);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
for (const [pointer, kinds] of Object.entries(managed.kinds)) {
|
|
97
|
+
if (managed.unmanaged.includes(pointer))
|
|
98
|
+
continue;
|
|
99
|
+
const keys = pointerKeys(pointer);
|
|
100
|
+
const parent = parentOf(out, keys);
|
|
101
|
+
const last = keys[keys.length - 1];
|
|
102
|
+
const list = parent?.[last];
|
|
103
|
+
if (!parent || !Array.isArray(list))
|
|
104
|
+
continue;
|
|
105
|
+
const shape = schema ? kindedList(schema, pointer) : undefined;
|
|
106
|
+
if (!shape?.kindsField || !shape.discriminator) {
|
|
107
|
+
delete parent[last];
|
|
108
|
+
result.left_out.push(pointer);
|
|
109
|
+
result.kinds.push({
|
|
110
|
+
pointer,
|
|
111
|
+
kinds,
|
|
112
|
+
sent: false,
|
|
113
|
+
other_kinds_left_out: [],
|
|
114
|
+
reason: shape ? `this instance does not take ${last}_kinds, so an import would replace the whole list` : "this instance's package schema has no list here",
|
|
115
|
+
});
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
const discriminator = shape.discriminator;
|
|
119
|
+
const other = list.filter((entry) => !kinds.includes(String(kindOf(entry, discriminator))));
|
|
120
|
+
parent[last] = list.filter((entry) => kinds.includes(String(kindOf(entry, discriminator))));
|
|
121
|
+
parent[shape.kindsField] = [...kinds];
|
|
122
|
+
result.kinds.push({ pointer, kinds, sent: true, other_kinds_left_out: other.map(label) });
|
|
123
|
+
}
|
|
124
|
+
return result;
|
|
125
|
+
}
|
|
126
|
+
export function packageToWrite(pkg, managed, schema) {
|
|
127
|
+
if (!hasManagedFields(managed))
|
|
128
|
+
return pkg;
|
|
129
|
+
const out = structuredClone(pkg);
|
|
130
|
+
for (const pointer of managed.unmanaged) {
|
|
131
|
+
const keys = pointerKeys(pointer);
|
|
132
|
+
const parent = parentOf(out, keys);
|
|
133
|
+
if (parent)
|
|
134
|
+
delete parent[keys[keys.length - 1]];
|
|
135
|
+
}
|
|
136
|
+
for (const [pointer, kinds] of Object.entries(managed.kinds)) {
|
|
137
|
+
if (managed.unmanaged.includes(pointer))
|
|
138
|
+
continue;
|
|
139
|
+
const keys = pointerKeys(pointer);
|
|
140
|
+
const parent = parentOf(out, keys);
|
|
141
|
+
const last = keys[keys.length - 1];
|
|
142
|
+
const shape = schema ? kindedList(schema, pointer) : undefined;
|
|
143
|
+
if (!parent || !shape)
|
|
144
|
+
continue;
|
|
145
|
+
if (!shape.kindsField || !shape.discriminator) {
|
|
146
|
+
delete parent[last];
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
const discriminator = shape.discriminator;
|
|
150
|
+
const list = parent[last];
|
|
151
|
+
if (Array.isArray(list))
|
|
152
|
+
parent[last] = list.filter((entry) => kinds.includes(String(kindOf(entry, discriminator))));
|
|
153
|
+
delete parent[shape.kindsField];
|
|
154
|
+
}
|
|
155
|
+
return out;
|
|
156
|
+
}
|
|
157
|
+
export function checkManagedFields(disk, managed, schema) {
|
|
158
|
+
if (!hasManagedFields(managed))
|
|
159
|
+
return [];
|
|
160
|
+
const findings = [];
|
|
161
|
+
const unknown = (pointer, why) => findings.push({ code: MANAGED_SETTING_UNKNOWN_CODE, severity: "warning", file: "cavelon.yaml", path: pointer, message: `cavelon.yaml names ${pointer}, ${why}.` });
|
|
162
|
+
for (const pointer of managed.unmanaged) {
|
|
163
|
+
const keys = pointerKeys(pointer);
|
|
164
|
+
if (!fieldSchema(schema, keys))
|
|
165
|
+
unknown(pointer, "which is no field of this instance's package schema (a field inside a list cannot be named)");
|
|
166
|
+
const parent = parentOf(disk.package, keys);
|
|
167
|
+
if (parent && keys[keys.length - 1] in parent) {
|
|
168
|
+
findings.push({
|
|
169
|
+
code: UNMANAGED_SET_CODE,
|
|
170
|
+
severity: "warning",
|
|
171
|
+
...locate(disk, pointer),
|
|
172
|
+
message: `cavelon.yaml lists ${pointer} as unmanaged, and the package sets it: apply leaves it out, so the instance keeps its own value.`,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
for (const [pointer, kinds] of Object.entries(managed.kinds)) {
|
|
177
|
+
const shape = kindedList(schema, pointer);
|
|
178
|
+
if (!shape) {
|
|
179
|
+
unknown(pointer, "which is no list of this instance's package schema");
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
const strange = shape.known ? kinds.filter((k) => !shape.known.includes(k)) : [];
|
|
183
|
+
if (strange.length)
|
|
184
|
+
unknown(pointer, `with the kind${strange.length === 1 ? "" : "s"} ${strange.join(", ")}, which this instance does not know (it knows ${shape.known.join(", ")})`);
|
|
185
|
+
const keys = pointerKeys(pointer);
|
|
186
|
+
const list = parentOf(disk.package, keys)?.[keys[keys.length - 1]];
|
|
187
|
+
if (!Array.isArray(list))
|
|
188
|
+
continue;
|
|
189
|
+
if (!shape.kindsField || !shape.discriminator) {
|
|
190
|
+
findings.push({
|
|
191
|
+
code: MANAGED_KINDS_UNSUPPORTED_CODE,
|
|
192
|
+
severity: "warning",
|
|
193
|
+
...locate(disk, pointer),
|
|
194
|
+
message: `This instance does not take ${keys[keys.length - 1]}_kinds, so an import of ${pointer} would replace all of the solution's entries, of every kind: apply leaves ${pointer} out.`,
|
|
195
|
+
});
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
const discriminator = shape.discriminator;
|
|
199
|
+
list.forEach((entry, i) => {
|
|
200
|
+
const kind = kindOf(entry, discriminator);
|
|
201
|
+
if (typeof kind === "string" && !kinds.includes(kind)) {
|
|
202
|
+
findings.push({
|
|
203
|
+
code: MANAGED_KINDS_LEFT_OUT_CODE,
|
|
204
|
+
severity: "warning",
|
|
205
|
+
...locate(disk, `${pointer}/${i}`),
|
|
206
|
+
message: `"${label(entry)}" is of kind ${kind}, which cavelon.yaml's managed_kinds does not list for ${pointer} (${kinds.join(", ")}): apply leaves it out, and the instance keeps its own entries of that kind.`,
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
return findings;
|
|
212
|
+
}
|
|
@@ -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.
|
|
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.
|
|
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:
|
|
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();`);
|
|
@@ -30892,10 +30941,10 @@ function foldIntersection(json2) {
|
|
|
30892
30941
|
if (Object.keys(union2).length !== 1)
|
|
30893
30942
|
return;
|
|
30894
30943
|
const rest = allOf.filter((m) => m !== union2);
|
|
30895
|
-
const
|
|
30896
|
-
if (
|
|
30944
|
+
const branches2 = union2[keyword].map((branch) => foldObjects([...rest, branch]));
|
|
30945
|
+
if (branches2.some((b) => !b))
|
|
30897
30946
|
return;
|
|
30898
|
-
folded = { [keyword]:
|
|
30947
|
+
folded = { [keyword]: branches2 };
|
|
30899
30948
|
}
|
|
30900
30949
|
if (!folded)
|
|
30901
30950
|
return;
|
|
@@ -31607,11 +31656,11 @@ function stringifyKeyNames(bySchema, json2, visited) {
|
|
|
31607
31656
|
return inlined === def ? json2 : inlined;
|
|
31608
31657
|
}
|
|
31609
31658
|
for (const keyword of ["anyOf", "oneOf"]) {
|
|
31610
|
-
const
|
|
31611
|
-
if (!Array.isArray(
|
|
31659
|
+
const branches2 = json2[keyword];
|
|
31660
|
+
if (!Array.isArray(branches2))
|
|
31612
31661
|
continue;
|
|
31613
|
-
const mapped =
|
|
31614
|
-
if (mapped.some((branch, i) => branch !==
|
|
31662
|
+
const mapped = branches2.map((branch) => stringifyKeyNames(bySchema, branch, visited));
|
|
31663
|
+
if (mapped.some((branch, i) => branch !== branches2[i]))
|
|
31615
31664
|
json2 = { ...json2, [keyword]: mapped };
|
|
31616
31665
|
}
|
|
31617
31666
|
const types = Array.isArray(json2.type) ? json2.type : [json2.type];
|
|
@@ -38538,6 +38587,14 @@ var current2 = new AsyncLocalStorage();
|
|
|
38538
38587
|
var PREVIEW_TOKEN_NAME = "confirm_token of its preview";
|
|
38539
38588
|
var PREVIEW_TOKEN = `<${PREVIEW_TOKEN_NAME}>`;
|
|
38540
38589
|
|
|
38590
|
+
// src/local-state.ts
|
|
38591
|
+
var PREVIEW_MAX_AGE_MS = 24 * 60 * 60 * 1e3;
|
|
38592
|
+
|
|
38593
|
+
// src/package-references.ts
|
|
38594
|
+
var SEARCH_TOOL_KEYS = /* @__PURE__ */ new Set(["search_documents", "search_knowledge_base", "search_kb"]);
|
|
38595
|
+
var KNOWLEDGE_TOOL_KEYS = /* @__PURE__ */ new Set([...SEARCH_TOOL_KEYS, "list_documents", "list_kb_docs"]);
|
|
38596
|
+
var DOCUMENT_TOOL_KEYS = /* @__PURE__ */ new Set([...KNOWLEDGE_TOOL_KEYS, "read_document", "save_document"]);
|
|
38597
|
+
|
|
38541
38598
|
// src/paths.ts
|
|
38542
38599
|
function homeDir(env) {
|
|
38543
38600
|
return env.HOME || env.USERPROFILE || os.homedir();
|
|
@@ -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:
|
|
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;
|
|
@@ -19599,10 +19636,10 @@ function foldIntersection(json) {
|
|
|
19599
19636
|
if (Object.keys(union2).length !== 1)
|
|
19600
19637
|
return;
|
|
19601
19638
|
const rest = allOf.filter((m) => m !== union2);
|
|
19602
|
-
const
|
|
19603
|
-
if (
|
|
19639
|
+
const branches2 = union2[keyword].map((branch) => foldObjects([...rest, branch]));
|
|
19640
|
+
if (branches2.some((b) => !b))
|
|
19604
19641
|
return;
|
|
19605
|
-
folded = { [keyword]:
|
|
19642
|
+
folded = { [keyword]: branches2 };
|
|
19606
19643
|
}
|
|
19607
19644
|
if (!folded)
|
|
19608
19645
|
return;
|
|
@@ -20191,11 +20228,11 @@ function stringifyKeyNames(bySchema, json, visited) {
|
|
|
20191
20228
|
return inlined === def ? json : inlined;
|
|
20192
20229
|
}
|
|
20193
20230
|
for (const keyword of ["anyOf", "oneOf"]) {
|
|
20194
|
-
const
|
|
20195
|
-
if (!Array.isArray(
|
|
20231
|
+
const branches2 = json[keyword];
|
|
20232
|
+
if (!Array.isArray(branches2))
|
|
20196
20233
|
continue;
|
|
20197
|
-
const mapped =
|
|
20198
|
-
if (mapped.some((branch, i) => branch !==
|
|
20234
|
+
const mapped = branches2.map((branch) => stringifyKeyNames(bySchema, branch, visited));
|
|
20235
|
+
if (mapped.some((branch, i) => branch !== branches2[i]))
|
|
20199
20236
|
json = { ...json, [keyword]: mapped };
|
|
20200
20237
|
}
|
|
20201
20238
|
const types = Array.isArray(json.type) ? json.type : [json.type];
|
|
@@ -25241,6 +25278,14 @@ var current2 = new AsyncLocalStorage();
|
|
|
25241
25278
|
var PREVIEW_TOKEN_NAME = "confirm_token of its preview";
|
|
25242
25279
|
var PREVIEW_TOKEN = `<${PREVIEW_TOKEN_NAME}>`;
|
|
25243
25280
|
|
|
25281
|
+
// src/local-state.ts
|
|
25282
|
+
var PREVIEW_MAX_AGE_MS = 24 * 60 * 60 * 1e3;
|
|
25283
|
+
|
|
25284
|
+
// src/package-references.ts
|
|
25285
|
+
var SEARCH_TOOL_KEYS = /* @__PURE__ */ new Set(["search_documents", "search_knowledge_base", "search_kb"]);
|
|
25286
|
+
var KNOWLEDGE_TOOL_KEYS = /* @__PURE__ */ new Set([...SEARCH_TOOL_KEYS, "list_documents", "list_kb_docs"]);
|
|
25287
|
+
var DOCUMENT_TOOL_KEYS = /* @__PURE__ */ new Set([...KNOWLEDGE_TOOL_KEYS, "read_document", "save_document"]);
|
|
25288
|
+
|
|
25244
25289
|
// src/paths.ts
|
|
25245
25290
|
function homeDir(env) {
|
|
25246
25291
|
return env.HOME || env.USERPROFILE || os.homedir();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": 1,
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
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":
|
|
29
|
-
"sha256": "
|
|
28
|
+
"size": 1496469,
|
|
29
|
+
"sha256": "95da367564676b7ba91aaca916646a44a4961ff3f70e3146d6f4336b60fd0cc2"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"path": "kilo-tui.mjs",
|
|
33
|
-
"size":
|
|
34
|
-
"sha256": "
|
|
33
|
+
"size": 942039,
|
|
34
|
+
"sha256": "04350845fb33cf18e3427c237e1a93a93edef653492ae45dd12abc7c3c7ac316"
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
"path": "LICENSE",
|
|
@@ -45,28 +45,28 @@
|
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
"path": "omp-extension.mjs",
|
|
48
|
-
"size":
|
|
49
|
-
"sha256": "
|
|
48
|
+
"size": 1146631,
|
|
49
|
+
"sha256": "9cbf90d1ca7be16e3125645b84bdc3da9c5d68105d8ac097e98dc04d13bfa577"
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
"path": "opencode-server.mjs",
|
|
53
|
-
"size":
|
|
54
|
-
"sha256": "
|
|
53
|
+
"size": 1495457,
|
|
54
|
+
"sha256": "d8db9272c893f90d4829ccfd292a023a1ae44dd04c305f0175a37e0a44788e43"
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
"path": "opencode-tui.mjs",
|
|
58
|
-
"size":
|
|
59
|
-
"sha256": "
|
|
58
|
+
"size": 941945,
|
|
59
|
+
"sha256": "5ab9edb04a894d77c50e09ca388bfac97a88a0be08cde5982a0a8f1234e65c3a"
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
"path": "pi-extension.mjs",
|
|
63
|
-
"size":
|
|
64
|
-
"sha256": "
|
|
63
|
+
"size": 1146539,
|
|
64
|
+
"sha256": "0586cc60d914c5f9fd089e76389b4be601f2c0cf7d4d2729e728e35a8552f097"
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
"path": "THIRD-PARTY-NOTICES",
|
|
68
|
-
"size":
|
|
69
|
-
"sha256": "
|
|
68
|
+
"size": 18302,
|
|
69
|
+
"sha256": "6548bb7b7fd6b0a92fb287b45c5addf1886f1daebb59714e16833e8041aeb28c"
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
"path": "TYPEBOX-LICENSE",
|