@intentset/cli 0.6.1 → 0.7.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/README.md +35 -0
- package/dist/agents.d.ts.map +1 -1
- package/dist/agents.js +18 -10
- package/dist/agents.js.map +1 -1
- package/dist/commands/evidence-stale.d.ts +19 -0
- package/dist/commands/evidence-stale.d.ts.map +1 -0
- package/dist/commands/evidence-stale.js +118 -0
- package/dist/commands/evidence-stale.js.map +1 -0
- package/dist/commands/evidence.d.ts +7 -0
- package/dist/commands/evidence.d.ts.map +1 -1
- package/dist/commands/evidence.js +27 -9
- package/dist/commands/evidence.js.map +1 -1
- package/dist/commands/graph.js +1 -1
- package/dist/commands/guide.d.ts +5 -0
- package/dist/commands/guide.d.ts.map +1 -0
- package/dist/commands/guide.js +16 -0
- package/dist/commands/guide.js.map +1 -0
- package/dist/commands/init.d.ts +6 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +11 -3
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/migrate.d.ts +23 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +125 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/git.d.ts +13 -0
- package/dist/git.d.ts.map +1 -1
- package/dist/git.js +26 -0
- package/dist/git.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +146 -44
- package/dist/main.js.map +1 -1
- package/dist/reports.d.ts.map +1 -1
- package/dist/reports.js +26 -3
- package/dist/reports.js.map +1 -1
- package/dist/session.d.ts +8 -2
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +18 -1
- package/dist/session.js.map +1 -1
- package/dist/subject.d.ts +16 -0
- package/dist/subject.d.ts.map +1 -0
- package/dist/subject.js +46 -0
- package/dist/subject.js.map +1 -0
- package/package.json +18 -10
- package/src/agents.ts +18 -10
- package/src/commands/evidence-stale.ts +151 -0
- package/src/commands/evidence.ts +39 -9
- package/src/commands/graph.ts +1 -1
- package/src/commands/guide.ts +17 -0
- package/src/commands/init.ts +12 -3
- package/src/commands/migrate.ts +136 -0
- package/src/git.ts +25 -0
- package/src/index.ts +3 -1
- package/src/main.ts +150 -44
- package/src/reports.ts +27 -3
- package/src/session.ts +26 -1
- package/src/subject.ts +63 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `intentset migrate --to 0.2` (Core §1): moves the records the model reads from the specifications' `0.1` to `0.2`
|
|
3
|
+
* by rewriting two values in each record's frontmatter, `intentset.spec` and `intentset.profile`, which Core §4
|
|
4
|
+
* requires to agree with it. It reads the same records every other command reads (the files the configured scope
|
|
5
|
+
* matches), changes those two lines and nothing else, byte for byte, and keeps the quoting each line used. A tree
|
|
6
|
+
* with uncommitted changes to tracked files is refused unless `--allow-dirty` says otherwise, so the rewrite is a
|
|
7
|
+
* diff of its own that git can undo. Other files (`.intentset/agents.md`, which carries an example record) are not
|
|
8
|
+
* records and are left to their author.
|
|
9
|
+
*/
|
|
10
|
+
import { writeFileSync } from "node:fs";
|
|
11
|
+
import { join } from "node:path";
|
|
12
|
+
import { sortDiagnostics } from "@intentset/core";
|
|
13
|
+
import { trackedChanges } from "../git.js";
|
|
14
|
+
import { formatDiagnostic } from "../output.js";
|
|
15
|
+
import { CONFIG_PATH, findRoot, loadRepository } from "../repository.js";
|
|
16
|
+
/** The specification versions this command moves between. */
|
|
17
|
+
export const MIGRATE_FROM = "0.1";
|
|
18
|
+
export const MIGRATE_TO = "0.2";
|
|
19
|
+
/** A message when the options cannot be run, before anything is read; null when they can. */
|
|
20
|
+
export function migrateUsageProblem(options) {
|
|
21
|
+
if (options.to === undefined)
|
|
22
|
+
return `--to is required: the only target is ${MIGRATE_TO}, from ${MIGRATE_FROM}`;
|
|
23
|
+
if (options.to !== MIGRATE_TO) {
|
|
24
|
+
return `--to ${options.to}: the only target is ${MIGRATE_TO}, which moves records written for ${MIGRATE_FROM}`;
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
const SPEC_LINE = /^(\s+spec:\s*)(['"]?)(\d+\.\d+)\2(\s*(?:#.*)?)$/;
|
|
29
|
+
const PROFILE_LINE = /^(\s+profile:\s*)(['"]?)intentset\/([a-z0-9-]+)\/(\d+\.\d+)\2(\s*(?:#.*)?)$/;
|
|
30
|
+
/**
|
|
31
|
+
* The record's text moved from `from` to `to`, or null when it declares another value. Only lines inside the
|
|
32
|
+
* `intentset:` mapping of the frontmatter, and only `spec` and `profile`, are rewritten; line endings are kept.
|
|
33
|
+
*/
|
|
34
|
+
export function migrateText(source, frontmatter, from, to) {
|
|
35
|
+
const lines = source.split("\n");
|
|
36
|
+
const first = frontmatter.line - 1;
|
|
37
|
+
const last = first + frontmatter.text.split("\n").length;
|
|
38
|
+
let inIntentset = false;
|
|
39
|
+
let childIndent = null;
|
|
40
|
+
let specSeen = false;
|
|
41
|
+
const edits = new Map();
|
|
42
|
+
for (let i = first; i < last && i < lines.length; i++) {
|
|
43
|
+
const raw = lines[i];
|
|
44
|
+
const line = raw.endsWith("\r") ? raw.slice(0, -1) : raw;
|
|
45
|
+
const eol = raw.endsWith("\r") ? "\r" : "";
|
|
46
|
+
if (/^\S/.test(line)) {
|
|
47
|
+
inIntentset = /^intentset:\s*(#.*)?$/.test(line);
|
|
48
|
+
childIndent = null;
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
if (!inIntentset || line.trim() === "")
|
|
52
|
+
continue;
|
|
53
|
+
const indent = line.length - line.trimStart().length;
|
|
54
|
+
childIndent ??= indent;
|
|
55
|
+
if (indent !== childIndent)
|
|
56
|
+
continue;
|
|
57
|
+
const spec = SPEC_LINE.exec(line);
|
|
58
|
+
if (spec !== null) {
|
|
59
|
+
if (spec[3] !== from)
|
|
60
|
+
return null;
|
|
61
|
+
specSeen = true;
|
|
62
|
+
edits.set(i, `${spec[1]}${spec[2]}${to}${spec[2]}${spec[4]}${eol}`);
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
const profile = PROFILE_LINE.exec(line);
|
|
66
|
+
if (profile !== null && profile[4] === from) {
|
|
67
|
+
edits.set(i, `${profile[1]}${profile[2]}intentset/${profile[3]}/${to}${profile[2]}${profile[5]}${eol}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (!specSeen)
|
|
71
|
+
return null;
|
|
72
|
+
for (const [i, text] of edits)
|
|
73
|
+
lines[i] = text;
|
|
74
|
+
return lines.join("\n");
|
|
75
|
+
}
|
|
76
|
+
export function migrateCommand(options, io) {
|
|
77
|
+
const root = findRoot(io.cwd, options.root);
|
|
78
|
+
if (root === null) {
|
|
79
|
+
const where = options.root === undefined ? "this directory or any above it" : options.root;
|
|
80
|
+
io.stderr(`intentset migrate: no ${CONFIG_PATH} in ${where}.\n`);
|
|
81
|
+
return 2;
|
|
82
|
+
}
|
|
83
|
+
if (options.allowDirty !== true) {
|
|
84
|
+
const changes = trackedChanges(root);
|
|
85
|
+
if (changes === null) {
|
|
86
|
+
io.stderr("intentset migrate: this is not a git work tree, so the rewrite could not be undone; pass --allow-dirty to migrate anyway.\n");
|
|
87
|
+
return 2;
|
|
88
|
+
}
|
|
89
|
+
if (changes.length > 0) {
|
|
90
|
+
io.stderr(`intentset migrate: ${changes.length} tracked file${changes.length === 1 ? " has" : "s have"} uncommitted changes. ` +
|
|
91
|
+
"Commit or stash them so the rewrite is a diff on its own, or pass --allow-dirty.\n");
|
|
92
|
+
return 2;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const repo = loadRepository(root, options.carrier);
|
|
96
|
+
if (!repo.configOk) {
|
|
97
|
+
io.stderr("intentset migrate: the configuration has errors, so the scope is unknown.\n");
|
|
98
|
+
for (const d of sortDiagnostics(repo.diagnostics))
|
|
99
|
+
io.stderr(formatDiagnostic(d));
|
|
100
|
+
return 2;
|
|
101
|
+
}
|
|
102
|
+
let moved = 0;
|
|
103
|
+
let current = 0;
|
|
104
|
+
let other = 0;
|
|
105
|
+
for (const input of repo.inputs) {
|
|
106
|
+
if (input.frontmatter === null)
|
|
107
|
+
continue;
|
|
108
|
+
const text = migrateText(input.source, input.frontmatter, MIGRATE_FROM, MIGRATE_TO);
|
|
109
|
+
if (text === null) {
|
|
110
|
+
if (/^\s+spec:\s*['"]?0\.2['"]?\s*(#.*)?$/m.test(input.frontmatter.text))
|
|
111
|
+
current++;
|
|
112
|
+
else
|
|
113
|
+
other++;
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
if (text === input.source)
|
|
117
|
+
continue;
|
|
118
|
+
writeFileSync(join(root, input.path), text);
|
|
119
|
+
moved++;
|
|
120
|
+
}
|
|
121
|
+
io.stdout(`intentset migrate: moved ${moved} record${moved === 1 ? "" : "s"} from ${MIGRATE_FROM} to ${MIGRATE_TO}` +
|
|
122
|
+
`${current > 0 ? `; ${current} already ${MIGRATE_TO}` : ""}${other > 0 ? `; ${other} declare neither (left as they are)` : ""}.\n`);
|
|
123
|
+
return 0;
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=migrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/commands/migrate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAW,MAAM,cAAc,CAAC;AACzD,OAAO,EAAoB,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE3F,6D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,MAAM,CACP,4BAA4B,KAAK,UAAU,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,SAAS,YAAY,OAAO,UAAU,EAAE;QACvG,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,YAAY,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,qCAAqC,CAAC,CAAC,CAAC,EAAE,KAAK,CACrI,CAAC;IACF,OAAO,CAAC,CAAC;AACX,CAAC"}
|
package/dist/git.d.ts
CHANGED
|
@@ -30,4 +30,17 @@ export declare function changedFiles(root: string, base: Base | null): Omit<Chan
|
|
|
30
30
|
export declare const UNCHANGED_TRAILER = "Intentset-Unchanged";
|
|
31
31
|
/** The slice IDs named in an Intentset-Unchanged trailer of any commit after the base, sorted. */
|
|
32
32
|
export declare function acknowledgedSlices(root: string, base: Base | null): string[];
|
|
33
|
+
/**
|
|
34
|
+
* The files that differ between `commit` and the working tree (tracked changes, staged or not, and untracked files
|
|
35
|
+
* .gitignore does not exclude), sorted, as paths relative to the CLI's root; or null when `commit` is not an ancestor of
|
|
36
|
+
* HEAD or git cannot say. One `git diff --name-only`, so the evidence report can list what changed outside every
|
|
37
|
+
* subject (Core §8) without computing anything per file.
|
|
38
|
+
*/
|
|
39
|
+
export declare function changedSince(root: string, commit: string): string[] | null;
|
|
40
|
+
/**
|
|
41
|
+
* The tracked files that differ from HEAD, staged or not, as `git status` lists them; an empty list for a clean
|
|
42
|
+
* tree, and null when this is not a git work tree or git cannot say. Untracked files are not counted: a command that
|
|
43
|
+
* rewrites tracked files asks only that its rewrite be a diff on its own.
|
|
44
|
+
*/
|
|
45
|
+
export declare function trackedChanges(root: string): string[] | null;
|
|
33
46
|
//# sourceMappingURL=git.d.ts.map
|
package/dist/git.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AA2BA,MAAM,WAAW,IAAI;IACnB,mGAAmG;IACnG,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,gDAAgD;IAChD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,kHAAkH;IAClH,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,uCAAuC;AACvC,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGtE;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,CAczG;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAAC,CAWvG;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,wBAAwB,CAAC;AAEvD,kGAAkG;AAClG,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,EAAE,CAK5E"}
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AA2BA,MAAM,WAAW,IAAI;IACnB,mGAAmG;IACnG,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,gDAAgD;IAChD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,kHAAkH;IAClH,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,uCAAuC;AACvC,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGtE;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,CAczG;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAAC,CAWvG;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,wBAAwB,CAAC;AAEvD,kGAAkG;AAClG,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,EAAE,CAK5E;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAM1E;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAI5D"}
|
package/dist/git.js
CHANGED
|
@@ -75,4 +75,30 @@ export function acknowledgedSlices(root, base) {
|
|
|
75
75
|
return [];
|
|
76
76
|
return [...new Set(out.split(/[\s,]+/).filter((id) => id !== ""))].sort(compareStrings);
|
|
77
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* The files that differ between `commit` and the working tree (tracked changes, staged or not, and untracked files
|
|
80
|
+
* .gitignore does not exclude), sorted, as paths relative to the CLI's root; or null when `commit` is not an ancestor of
|
|
81
|
+
* HEAD or git cannot say. One `git diff --name-only`, so the evidence report can list what changed outside every
|
|
82
|
+
* subject (Core §8) without computing anything per file.
|
|
83
|
+
*/
|
|
84
|
+
export function changedSince(root, commit) {
|
|
85
|
+
if (git(root, ["merge-base", "--is-ancestor", commit, "HEAD"]) === null)
|
|
86
|
+
return null;
|
|
87
|
+
const diff = git(root, ["diff", "--relative", "--name-only", "-z", commit]);
|
|
88
|
+
if (diff === null)
|
|
89
|
+
return null;
|
|
90
|
+
const untracked = paths(git(root, ["ls-files", "-z", "--others", "--exclude-standard"]));
|
|
91
|
+
return [...new Set([...paths(diff), ...untracked])].sort(compareStrings);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The tracked files that differ from HEAD, staged or not, as `git status` lists them; an empty list for a clean
|
|
95
|
+
* tree, and null when this is not a git work tree or git cannot say. Untracked files are not counted: a command that
|
|
96
|
+
* rewrites tracked files asks only that its rewrite be a diff on its own.
|
|
97
|
+
*/
|
|
98
|
+
export function trackedChanges(root) {
|
|
99
|
+
const out = git(root, ["status", "--porcelain", "--untracked-files=no", "-z"]);
|
|
100
|
+
if (out === null)
|
|
101
|
+
return null;
|
|
102
|
+
return out.split("\0").filter((entry) => entry !== "");
|
|
103
|
+
}
|
|
78
104
|
//# sourceMappingURL=git.js.map
|
package/dist/git.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,SAAS,GAAG,CAAC,IAAY,EAAE,IAAc;IACvC,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,KAAK,EAAE,CAAC,qBAAqB,EAAE,GAAG,IAAI,CAAC,EAAE;YAC3D,GAAG,EAAE,IAAI;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GAIG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,MAAM,GAAG,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,sBAAsB,EAAE,IAAI,CAAC,CAAC,CAAC;IAC/E,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC9B,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;AACzD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @intentset/cli as a library: `main` for running the command in-process,
|
|
3
|
-
*
|
|
3
|
+
* the agent guide `init` writes (intentset.org serves it from the same
|
|
4
|
+
* generator), and the repository loader and pattern matcher it is built on.
|
|
4
5
|
*/
|
|
5
6
|
export { main, USAGE } from "./main.ts";
|
|
7
|
+
export { AGENT_GUIDE_PATH, AGENT_POINTERS, agentGuide, type PackageManager } from "./agents.ts";
|
|
6
8
|
export type { Io } from "./output.ts";
|
|
7
9
|
export { matchAny, matchGlob } from "./glob.ts";
|
|
8
10
|
export { CONFIG_PATH, enumerate, findRoot, loadRepository, readCommit, type Repository } from "./repository.ts";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAChG,YAAY,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @intentset/cli as a library: `main` for running the command in-process,
|
|
3
|
-
*
|
|
3
|
+
* the agent guide `init` writes (intentset.org serves it from the same
|
|
4
|
+
* generator), and the repository loader and pattern matcher it is built on.
|
|
4
5
|
*/
|
|
5
6
|
export { main, USAGE } from "./main.js";
|
|
7
|
+
export { AGENT_GUIDE_PATH, AGENT_POINTERS, agentGuide } from "./agents.js";
|
|
6
8
|
export { matchAny, matchGlob } from "./glob.js";
|
|
7
9
|
export { CONFIG_PATH, enumerate, findRoot, loadRepository, readCommit } from "./repository.js";
|
|
8
10
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,UAAU,EAAuB,MAAM,aAAa,CAAC;AAEhG,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAmB,MAAM,iBAAiB,CAAC"}
|
package/dist/main.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Io } from "./output.ts";
|
|
2
2
|
export type { Io } from "./output.ts";
|
|
3
|
-
export declare const USAGE = "usage: intentset <command> [options]\n\ncommands\n init [--repository <name>] [--example] [--agents]\n create .intentset/config.yaml, an empty .intentset/registries.yaml
|
|
3
|
+
export declare const USAGE = "usage: intentset <command> [options]\n\ncommands\n init [--repository <name>] [--example] [--agents]\n create .intentset/config.yaml, an empty .intentset/registries.yaml\n and .intentset/agents.md, the guide that tells coding agents how to\n keep the model current; --example adds the scheduling example under\n product/scheduling/; --agents writes only the guide, for a\n repository already initialized. Never overwrites a file.\n guide print that guide for this repository, for the scope its config\n names, without writing anything\n validate every check the level asks for; exit 1 when any diagnostic is an\n error\n graph [--format json] [--include-bodies] [--release <product>:<label>] [--out <file>]\n [--generated-at <time>] [--report evidence|knowledge|impact|ownership|all]...\n [--include-restricted]\n print the intentset/export/0.4 envelope, or write it to --out;\n each --report adds a section (ownership needs L2, evidence L3; all\n is every one the level reads). Restricted artifacts are withheld\n and counted unless --include-restricted\n architecture check [--mode migration|strict] [--baseline <file>] [--write-baseline <file>]\n ownership, claims, imports, layers and regions (default level L2)\n evidence import --from vitest|playwright|node-tap <report> --out <file> --product <ID>\n --release <label>\n [--environment <text>] [--started-at <time>] [--finished-at <time>] [--uri-base <uri>]\n [--tool-version <v>]\n turn a test report into run records bound to this commit and graph\n evidence stale [--release <product>:<label>] [--check] [--binding <subject|commit>]\n [--format list|json|playwright|vitest|node-test]\n what needs a run: the automated verifications whose evidence is\n not a current pass, as a table, as JSON, or as the arguments that\n make a test runner run only those tests; never writes; --check\n exits 1 when any needs a run\n impact <ID> what depends on an artifact: direct, candidates, review context,\n ancestors\n context <ID|path> [--include-restricted]\n the bounded engineering context of an artifact, with paths and\n bodies; given a file a slice claims, the context of that slice\n review [--base <ref>] [--fail-on-drift]\n the local review report: checks, coverage, the impact of what\n changed, and each slice whose code changed while its records did\n not; --fail-on-drift exits 1 for any such slice no commit\n acknowledged with an Intentset-Unchanged trailer\n publish --visibility <v> --audience <a> --product <ID> --release <r> --role <r> --edition <e>\n [--flag <f>]... [--authorized-internal] [--authorized-restricted] --out <dir> [--html]\n [--published-at <time>]\n reviewed knowledge for one audience and release, as Markset with\n provenance\n serve [--port <n>] [--host <address>] [--out <dir>]\n the Atlas, the internal review pages, on http://127.0.0.1:3000/\n (rebuilt when a file changes), or written to --out; runs at L2, or\n L3 with run records\n migrate --to 0.2 [--allow-dirty]\n move the records the model reads from specifications 0.1 to 0.2:\n rewrites intentset.spec and intentset.profile in each record's\n frontmatter and nothing else, and says how many. Refuses a tree\n with uncommitted changes to tracked files unless --allow-dirty\n mcp --mode engineering [--include-restricted]\n mcp --mode customer --visibility <public|customer> --audience <a> --product <ID>\n --release <r> --role <r> --edition <e> [--flag <f>]...\n the read-only MCP server on stdio: the engineering graph, or one\n publication made in memory as publish makes it, and nothing else\n\noptions\n --root <dir> repository root (default: the nearest directory at or above this\n one holding .intentset/config.yaml)\n --json machine-readable output, keys in canonical order\n --carrier <markset|plain> how documents are read (default markset)\n --level <L1..L4> conformance level; each includes those below it (default L1):\n L2 adds architecture, L3 evidence, L4 publication readiness\n --evidence <file> L3 and above: run records to read, repeatable (default: every\n *.json in .intentset/evidence/, which holds local output and is not\n committed)\n --product <ID> --release <label>\n L3 and above: the exact scope evidence is assessed for (default:\n every scope)\n --binding <subject|commit>\n L3 and above, and evidence import: how run evidence is judged\n current, overriding evidence.binding in the configuration (default:\n subject where slices claim files, else commit). Subject keeps a\n record current while what it checked is unchanged; commit only at\n the commit it ran at\n --mode <migration|strict> --baseline <file>\n L2 and above: whether a baseline of known violations applies, and\n which (for mcp, --mode names the server's mode instead)\n -h, --help show this help\n --version print \"intentset <version>\", the checker version a report names\n\nexit codes: 0 no errors, 1 validation errors (or, with review --fail-on-drift,\n unacknowledged drift), 2 invocation or tool failure";
|
|
4
4
|
export declare function main(argv: string[], io: Io): Promise<number>;
|
|
5
5
|
//# sourceMappingURL=main.d.ts.map
|
package/dist/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,KAAK,EAAE,EAAQ,MAAM,aAAa,CAAC;AAI5C,YAAY,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEtC,eAAO,MAAM,KAAK,w1MAyF8C,CAAC;AAgGjE,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAyRlE"}
|