aontu 0.66.0 → 0.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/allow.js +2 -2
- package/dist/allow.js.map +1 -1
- package/dist/aontu.d.ts +1 -1
- package/dist/aontu.js +1 -1
- package/dist/cli.d.ts +2 -1
- package/dist/cli.js +126 -23
- package/dist/cli.js.map +1 -1
- package/dist/hints.js +2 -1
- package/dist/hints.js.map +1 -1
- package/dist/lang.js +6 -3
- package/dist/lang.js.map +1 -1
- package/dist/lsp.d.ts +1 -1
- package/dist/mcp-server.js +1 -1
- package/dist/mcp-server.js.map +1 -1
- package/dist/mcp.js +1 -1
- package/dist/mcp.js.map +1 -1
- package/dist/query.d.ts +1 -1
- package/dist/query.js +7 -9
- package/dist/query.js.map +1 -1
- package/dist/vet.d.ts +1 -0
- package/dist/vet.js +39 -9
- package/dist/vet.js.map +1 -1
- package/dist/view.js +2 -4
- package/dist/view.js.map +1 -1
- package/package.json +2 -2
- package/src/allow.ts +3 -3
- package/src/aontu.ts +1 -1
- package/src/cli.ts +140 -24
- package/src/hints.ts +2 -1
- package/src/lang.ts +7 -3
- package/src/mcp-server.ts +1 -1
- package/src/mcp.ts +1 -1
- package/src/query.ts +8 -13
- package/src/tsconfig.json +2 -1
- package/src/vet.ts +47 -9
- package/src/view.ts +3 -7
- package/dist/tsconfig.tsbuildinfo +0 -1
package/README.md
CHANGED
|
@@ -75,8 +75,11 @@ the same thing in a Node agent harness and a Go gateway.
|
|
|
75
75
|
## Documentation
|
|
76
76
|
|
|
77
77
|
- [Documentation home](https://github.com/aontu-lang/aontu/blob/main/docs/index.md)
|
|
78
|
-
- [
|
|
78
|
+
- [Tutorials](https://github.com/aontu-lang/aontu/blob/main/docs/tutorial.md)
|
|
79
79
|
- [Language reference](https://github.com/aontu-lang/aontu/blob/main/docs/reference-language.md)
|
|
80
|
+
- [Generation reference](https://github.com/aontu-lang/aontu/blob/main/docs/reference-generation.md)
|
|
81
|
+
- [Functions reference](https://github.com/aontu-lang/aontu/blob/main/docs/reference-functions.md)
|
|
82
|
+
- [Error reference](https://github.com/aontu-lang/aontu/blob/main/docs/reference-errors.md)
|
|
80
83
|
- [API and CLI reference](https://github.com/aontu-lang/aontu/blob/main/docs/reference-api.md)
|
|
81
84
|
- [Agent skill](https://github.com/aontu-lang/aontu/blob/main/docs/skill/SKILL.md)
|
|
82
85
|
|
package/dist/allow.js
CHANGED
|
@@ -44,7 +44,7 @@ function readEntries(list, by, ctx) {
|
|
|
44
44
|
const text = true === el.isString ? el.peg : el.gen(ctx);
|
|
45
45
|
if (before < ctx.err.length) {
|
|
46
46
|
const err = ctx.err[before];
|
|
47
|
-
return { entries, finding:
|
|
47
|
+
return { entries, finding: (0, vet_1.engineFinding)(err, ctx, `${by}.${i}`) };
|
|
48
48
|
}
|
|
49
49
|
entries.push({ parts: (0, query_1.pathParts)(text), text, by: `${by}.${i}` });
|
|
50
50
|
}
|
|
@@ -99,7 +99,7 @@ function allow(src, role, paths, opts) {
|
|
|
99
99
|
}
|
|
100
100
|
const root = aontu.unify(new ConjunctVal_1.ConjunctVal({ peg: [model, shape] }, ctx), undefined, ctx);
|
|
101
101
|
if (0 < ctx.err.length || true === root.isNil) {
|
|
102
|
-
return errorReport(role, (0, query_1.evalFailure)(ctx));
|
|
102
|
+
return errorReport(role, (0, query_1.evalFailure)(ctx, root));
|
|
103
103
|
}
|
|
104
104
|
const roles = (0, vet_1.anchorAt)(root, at);
|
|
105
105
|
const atRole = `${at}.${role}`;
|
package/dist/allow.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allow.js","sourceRoot":"","sources":["../src/allow.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;;AAGpD,mCAA+B;AAC/B,mDAA+C;AAC/C,+
|
|
1
|
+
{"version":3,"file":"allow.js","sourceRoot":"","sources":["../src/allow.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;;AA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,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,MAAM,QAAQ,EAAE,GAAG,CAAC,CAAA;IAClE,IAAI,IAAI,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QAC3B,OAAO,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;IAC1C,CAAC;IACD,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,MAAM,OAAO,EAAE,GAAG,CAAC,CAAA;IAChE,IAAI,IAAI,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QAC3B,OAAO,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;IAC1C,CAAC;IAED,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;IAE7E,mEAAmE;IACnE,2DAA2D;IAC3D,qBAAqB;IACrB,MAAM,OAAO,GAAG,CAAC,GAAG,SAAS,CAAC,MAAM,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;IAEzE,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QACxC,IAAI;QACJ,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,EAAE;KACb,CAAA;AACH,CAAC"}
|
package/dist/aontu.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ import { loadProfile } from './profile';
|
|
|
23
23
|
import { desugarTemplate, resugarTemplate, markerFor } from './template';
|
|
24
24
|
import { format, unifiedDiff } from './format';
|
|
25
25
|
export type { LintFinding, FormatReport, FormatOptions } from './format';
|
|
26
|
-
declare const VERSION = "0.
|
|
26
|
+
declare const VERSION = "0.67.0";
|
|
27
27
|
declare class Aontu {
|
|
28
28
|
opts: AontuOptions;
|
|
29
29
|
lang: Lang;
|
package/dist/aontu.js
CHANGED
|
@@ -58,7 +58,7 @@ Object.defineProperty(exports, "markerFor", { enumerable: true, get: function ()
|
|
|
58
58
|
const format_1 = require("./format");
|
|
59
59
|
Object.defineProperty(exports, "format", { enumerable: true, get: function () { return format_1.format; } });
|
|
60
60
|
Object.defineProperty(exports, "unifiedDiff", { enumerable: true, get: function () { return format_1.unifiedDiff; } });
|
|
61
|
-
const VERSION = '0.
|
|
61
|
+
const VERSION = '0.67.0';
|
|
62
62
|
exports.VERSION = VERSION;
|
|
63
63
|
function genQuiet(val, aontu) {
|
|
64
64
|
return val.gen(aontu.ctx({ collect: true }));
|
package/dist/cli.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ declare function runPackageVerb(verb: string, argv: string[], servers: Servers):
|
|
|
49
49
|
declare function runModel(argv: string[]): number;
|
|
50
50
|
declare function runRelations(argv: string[]): number;
|
|
51
51
|
declare function runTrace(argv: string[]): number;
|
|
52
|
+
declare function renderSkipped(folder: string, since: number): string[];
|
|
52
53
|
declare function runRender(argv: string[]): Promise<number>;
|
|
53
54
|
declare function runReaches(argv: string[]): number;
|
|
54
55
|
declare function runView(argv: string[]): number;
|
|
@@ -81,4 +82,4 @@ declare const KNOWN_VERBS: string[];
|
|
|
81
82
|
declare function looksLikeVerb(arg: string): boolean;
|
|
82
83
|
declare function nearestVerb(word: string, verbs: string[]): string;
|
|
83
84
|
declare function main(argv: string[], servers?: Servers): void;
|
|
84
|
-
export { evalSource, main, runVet, runSubsume, runBreaking, runTrim, runRelations, runReaches, runView, runJsonSchema, runTemplate, runTrace, runRender, runPkg, runModel, runPackageVerb, pkgToolOptions, serveUntilInterrupted, runHash, runGet, runHelp, runExplain, runInit, nearestVerb, looksLikeVerb, KNOWN_VERBS, runWhy, renderWhyText, runSet, runAllow, runAgentsMd, runFmt, watchChange, watchSignature, vetWaiter, deprecatedAt, };
|
|
85
|
+
export { evalSource, main, runVet, runSubsume, runBreaking, runTrim, runRelations, runReaches, runView, runJsonSchema, runTemplate, runTrace, runRender, renderSkipped, runPkg, runModel, runPackageVerb, pkgToolOptions, serveUntilInterrupted, runHash, runGet, runHelp, runExplain, runInit, nearestVerb, looksLikeVerb, KNOWN_VERBS, runWhy, renderWhyText, runSet, runAllow, runAgentsMd, runFmt, watchChange, watchSignature, vetWaiter, deprecatedAt, };
|
package/dist/cli.js
CHANGED
|
@@ -16,6 +16,7 @@ exports.runJsonSchema = runJsonSchema;
|
|
|
16
16
|
exports.runTemplate = runTemplate;
|
|
17
17
|
exports.runTrace = runTrace;
|
|
18
18
|
exports.runRender = runRender;
|
|
19
|
+
exports.renderSkipped = renderSkipped;
|
|
19
20
|
exports.runPkg = runPkg;
|
|
20
21
|
exports.runModel = runModel;
|
|
21
22
|
exports.runPackageVerb = runPackageVerb;
|
|
@@ -144,22 +145,30 @@ query between a document and its own earlier versions.
|
|
|
144
145
|
|
|
145
146
|
Options:
|
|
146
147
|
-c, --canon Print the canonical form instead of generated JSON
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
(the bare command's, as --jsonl is; model get has
|
|
149
|
+
its own)
|
|
150
|
+
--format <f> text (default) or json, on every verb that answers a
|
|
151
|
+
report. The json form is one object opening with an
|
|
152
|
+
aontu block; the bare command's carries findings, ok
|
|
153
|
+
and out
|
|
150
154
|
-h, --help Show this help and exit (the verbs and their flags);
|
|
151
155
|
aontu help is the LANGUAGE, and lists its own topics
|
|
152
156
|
--jsonl REPL: answer every command as one JSON line
|
|
153
157
|
-v, --version Print the version and exit
|
|
154
|
-
--trust <t> Include capability: system
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
+
--trust <t> Include capability: system, none, or root[:dir] to
|
|
159
|
+
confine @"..." below a directory. A bare root means
|
|
160
|
+
the entry root: the document's own directory, or the
|
|
161
|
+
project's for the package verbs. Every verb takes it
|
|
162
|
+
but help, explain, init and lsp, which read no
|
|
163
|
+
document, and mcp, which is the npm build's server
|
|
164
|
+
and confines with --root. Unset, a run behaves as
|
|
165
|
+
system, and the bare command warns once for an
|
|
166
|
+
include that leaves the entry root
|
|
158
167
|
--include-root <dir> Shorthand for --trust root:<dir>
|
|
159
|
-
--text-ext <e> Read these extensions as text too, comma-separated
|
|
160
|
-
|
|
168
|
+
--text-ext <e> Read these extensions as text too, comma-separated,
|
|
169
|
+
with or without dots (md,sql). .txt needs no flag; a
|
|
161
170
|
named format keeps its meaning, and .js stays
|
|
162
|
-
refused.
|
|
171
|
+
refused. The verbs that take --trust take it too
|
|
163
172
|
|
|
164
173
|
Package verbs (a module is imported; a package is published):
|
|
165
174
|
sync Make the project correct: resolve by minimum version
|
|
@@ -653,7 +662,7 @@ function takeTrust(argv, io = PROCESS_IO) {
|
|
|
653
662
|
}
|
|
654
663
|
else if ('--include-root' === arg) {
|
|
655
664
|
const dir = argv[++i];
|
|
656
|
-
if (null == dir) {
|
|
665
|
+
if (null == dir || '' === dir) {
|
|
657
666
|
io.err('aontu: --include-root needs a directory\n');
|
|
658
667
|
return undefined;
|
|
659
668
|
}
|
|
@@ -2292,20 +2301,38 @@ function pkgNetText(verb, report) {
|
|
|
2292
2301
|
}
|
|
2293
2302
|
const MODEL_HELP = 'aontu model get|why|set ... (try --help)';
|
|
2294
2303
|
// One document, interrogated or edited (ADR-039 part 5).
|
|
2304
|
+
// Where the subcommand is, past any global flag that precedes it.
|
|
2305
|
+
// `takeTrust` strips those anywhere in a tail, so the subcommand has
|
|
2306
|
+
// to be found past a flag AND past its value: in `--text-ext get` the
|
|
2307
|
+
// `get` is the extension list, not the subcommand.
|
|
2308
|
+
const MODEL_SUBS = ['get', 'why', 'set'];
|
|
2309
|
+
const GLOBAL_VALUED = ['--trust', '--include-root', '--text-ext'];
|
|
2310
|
+
function modelSubAt(argv) {
|
|
2311
|
+
for (let i = 0; i < argv.length; i++) {
|
|
2312
|
+
if (GLOBAL_VALUED.includes(argv[i])) {
|
|
2313
|
+
i++;
|
|
2314
|
+
continue;
|
|
2315
|
+
}
|
|
2316
|
+
return MODEL_SUBS.includes(argv[i]) ? i : -1;
|
|
2317
|
+
}
|
|
2318
|
+
return -1;
|
|
2319
|
+
}
|
|
2295
2320
|
function runModel(argv) {
|
|
2296
2321
|
const sub = argv[0];
|
|
2297
2322
|
if ('-h' === sub || '--help' === sub) {
|
|
2298
2323
|
process.stdout.write(HELP);
|
|
2299
2324
|
return 0;
|
|
2300
2325
|
}
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2326
|
+
const at = modelSubAt(argv);
|
|
2327
|
+
if (0 <= at) {
|
|
2328
|
+
const tail = argv.slice(0, at).concat(argv.slice(at + 1));
|
|
2329
|
+
if ('get' === argv[at]) {
|
|
2330
|
+
return runGet(tail);
|
|
2331
|
+
}
|
|
2332
|
+
if ('why' === argv[at]) {
|
|
2333
|
+
return runWhy(tail);
|
|
2334
|
+
}
|
|
2335
|
+
return runSet(tail);
|
|
2309
2336
|
}
|
|
2310
2337
|
process.stderr.write(`aontu: model needs get, why or set\n${MODEL_HELP}\n`);
|
|
2311
2338
|
return 2;
|
|
@@ -2488,6 +2515,62 @@ function generatorRuntime() {
|
|
|
2488
2515
|
function isDirectory(path) {
|
|
2489
2516
|
return true === (0, node_fs_1.statSync)(path, { throwIfNoEntry: false })?.isDirectory();
|
|
2490
2517
|
}
|
|
2518
|
+
// A `File` the write path skips, RENAMED rather than removed: dropping
|
|
2519
|
+
// the node would take its children's claims with it and hide drift the
|
|
2520
|
+
// write path does make. The skip is the File's own save alone, so what
|
|
2521
|
+
// separates the runs is its output path, composed by the runtime rather
|
|
2522
|
+
// than here.
|
|
2523
|
+
const EXCLUDED_NAME = '.aontu-check-excluded-';
|
|
2524
|
+
// `exclude` as the runtime reads it: `true`, or a string or list member
|
|
2525
|
+
// equal to the node's COMPONENT path, the chain of `name` props above
|
|
2526
|
+
// it, which a Project's `folder` is not part of. The Go runtime honours
|
|
2527
|
+
// the boolean alone, so the ports' `--check` answers differ for the
|
|
2528
|
+
// path forms (test/spec/divergent.tsv).
|
|
2529
|
+
function excludedFile(exclude, at) {
|
|
2530
|
+
if (true === exclude) {
|
|
2531
|
+
return true;
|
|
2532
|
+
}
|
|
2533
|
+
const path = at.join('/');
|
|
2534
|
+
if ('string' === typeof exclude) {
|
|
2535
|
+
return exclude === path;
|
|
2536
|
+
}
|
|
2537
|
+
return Array.isArray(exclude) && exclude.includes(path);
|
|
2538
|
+
}
|
|
2539
|
+
function renameExcluded(node, at, cut) {
|
|
2540
|
+
if (Array.isArray(node)) {
|
|
2541
|
+
return node.map((child) => renameExcluded(child, at, cut));
|
|
2542
|
+
}
|
|
2543
|
+
// A hand-written tree carries nodes with no `props` and nodes with
|
|
2544
|
+
// no `children`, and neither needs an arm of its own.
|
|
2545
|
+
const props = node.props ?? {};
|
|
2546
|
+
const below = 'string' === typeof props.name ? at.concat(props.name) : at;
|
|
2547
|
+
if ('File' === node.cmp && excludedFile(props.exclude, below)) {
|
|
2548
|
+
cut.push(1);
|
|
2549
|
+
return { ...node, props: { ...props, name: EXCLUDED_NAME + cut.length } };
|
|
2550
|
+
}
|
|
2551
|
+
if (!Array.isArray(node.children)) {
|
|
2552
|
+
return node;
|
|
2553
|
+
}
|
|
2554
|
+
return { ...node, children: renameExcluded(node.children, below, cut) };
|
|
2555
|
+
}
|
|
2556
|
+
// A file the runtime declined to touch, its copy on disk carrying the
|
|
2557
|
+
// protect marker, is in none of the lists it answers with: they hold
|
|
2558
|
+
// what was DONE to a file, and nothing was. The run's own record names
|
|
2559
|
+
// it. `since` drops what earlier runs left.
|
|
2560
|
+
function renderSkipped(folder, since) {
|
|
2561
|
+
const at = (0, node_path_1.join)(folder, '.jostraca', 'jostraca.meta.log');
|
|
2562
|
+
let meta;
|
|
2563
|
+
try {
|
|
2564
|
+
meta = JSON.parse((0, node_fs_1.readFileSync)(at, 'utf8'));
|
|
2565
|
+
}
|
|
2566
|
+
catch (err) {
|
|
2567
|
+
return [];
|
|
2568
|
+
}
|
|
2569
|
+
return Object.entries(meta?.files ?? {})
|
|
2570
|
+
.filter(([_, f]) => 'skip' === f?.action && since <= f?.when)
|
|
2571
|
+
.map(([path]) => path)
|
|
2572
|
+
.sort(keyorder_1.cmpCodePoint);
|
|
2573
|
+
}
|
|
2491
2574
|
async function runRender(argv) {
|
|
2492
2575
|
const trusted = takeTrust(argv);
|
|
2493
2576
|
if (null == trusted) {
|
|
@@ -2630,7 +2713,20 @@ async function runRender(argv) {
|
|
|
2630
2713
|
try {
|
|
2631
2714
|
if (check) {
|
|
2632
2715
|
const res = await runtime.check({ folder }, root);
|
|
2633
|
-
|
|
2716
|
+
let drift = res.drift.map((d) => ({ kind: d.kind, path: d.path }));
|
|
2717
|
+
// `--check` answers "would `render` change anything", so a file
|
|
2718
|
+
// the write path leaves alone is not held to the generator's
|
|
2719
|
+
// bytes. The skip is gated on the target BEING there -- `render`
|
|
2720
|
+
// writes an absent one -- so drift at a path with nothing at it
|
|
2721
|
+
// survives, which is the `missing` a deleted file reports.
|
|
2722
|
+
const cut = [];
|
|
2723
|
+
const renamed = renameExcluded(tree, [], cut);
|
|
2724
|
+
if (0 < cut.length) {
|
|
2725
|
+
const kept = new Set((await Jostraca().check({ folder }, cmpTree(renamed, { raw: true }))).checked);
|
|
2726
|
+
const skipped = new Set(res.checked.filter((p) => !kept.has(p)));
|
|
2727
|
+
drift = drift.filter((d) => !skipped.has(d.path) ||
|
|
2728
|
+
!(0, node_fs_1.existsSync)((0, node_path_1.join)(folder, d.path)));
|
|
2729
|
+
}
|
|
2634
2730
|
if ('json' === format) {
|
|
2635
2731
|
process.stdout.write((0, aontu_1.exactJSON)({
|
|
2636
2732
|
aontu: { version: version(), verb: 'render' },
|
|
@@ -2646,14 +2742,21 @@ async function runRender(argv) {
|
|
|
2646
2742
|
}
|
|
2647
2743
|
return 0 === drift.length ? 0 : 1;
|
|
2648
2744
|
}
|
|
2745
|
+
const since = Date.now();
|
|
2649
2746
|
const res = await runtime.generate({ folder }, root);
|
|
2747
|
+
const skipped = renderSkipped(folder, since);
|
|
2650
2748
|
if ('json' === format) {
|
|
2651
2749
|
process.stdout.write((0, aontu_1.exactJSON)({
|
|
2652
2750
|
aontu: { version: version(), verb: 'render' },
|
|
2653
2751
|
verdict: 'ok',
|
|
2654
|
-
files: res.files,
|
|
2752
|
+
files: { ...res.files, skipped },
|
|
2655
2753
|
}, 2) + '\n');
|
|
2656
2754
|
}
|
|
2755
|
+
else {
|
|
2756
|
+
for (const path of skipped) {
|
|
2757
|
+
process.stdout.write(`skipped: ${path}\n`);
|
|
2758
|
+
}
|
|
2759
|
+
}
|
|
2657
2760
|
return 0;
|
|
2658
2761
|
}
|
|
2659
2762
|
catch (err) {
|
|
@@ -3387,7 +3490,7 @@ function runHash(argv) {
|
|
|
3387
3490
|
const v = aontu.unify(src, { path: files[0] }, ctx);
|
|
3388
3491
|
if (0 < ctx.err.length || true === v?.isNil) {
|
|
3389
3492
|
process.stderr.write(`aontu: ${files[0]} does not evaluate on its own; nothing to hash\n` +
|
|
3390
|
-
renderFinding((0, query_1.evalFailure)(ctx)) + '\n');
|
|
3493
|
+
renderFinding((0, query_1.evalFailure)(ctx, v)) + '\n');
|
|
3391
3494
|
return 4;
|
|
3392
3495
|
}
|
|
3393
3496
|
const text = 'json' === format
|
|
@@ -4584,7 +4687,7 @@ function main(argv, servers = SERVERS) {
|
|
|
4584
4687
|
}
|
|
4585
4688
|
else if ('--include-root' === arg) {
|
|
4586
4689
|
const dir = args[++i];
|
|
4587
|
-
if (null == dir) {
|
|
4690
|
+
if (null == dir || '' === dir) {
|
|
4588
4691
|
process.stderr.write('aontu: --include-root needs a directory\n');
|
|
4589
4692
|
return finish(2);
|
|
4590
4693
|
}
|