@intentic/constants 1.337.0 → 1.339.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/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/allow.d.mts +1 -0
- package/src/allow.mjs +31 -13
package/dist/index.d.ts
CHANGED
|
@@ -5,12 +5,14 @@ export * from "./turn-preamble.js";
|
|
|
5
5
|
export declare const WORKSPACE_ROOT = "/work";
|
|
6
6
|
export declare const HISTORY_ROOT = "/history";
|
|
7
7
|
export declare const STATE_DIR = ".intentic";
|
|
8
|
+
export declare const DERIVED_SHADOWS_DIR = ".intentic/local/cache/derived";
|
|
9
|
+
export declare const SHADOWED_DOCUMENT_EXTENSIONS: readonly string[];
|
|
8
10
|
export declare const REFERENCE_DIR = "refs";
|
|
9
11
|
export declare const PUBLIC_DIR = "public";
|
|
10
12
|
export declare const MEMORY_FILE = "AGENTS.md";
|
|
11
13
|
export declare const FIELD_NOTES_FILE = ".intentic/config/field-notes.toon";
|
|
12
14
|
export declare const HOST_STATE_ROOT = "/opt/intentic";
|
|
13
|
-
export declare const LEGAL_VERSION = "2026-10-
|
|
15
|
+
export declare const LEGAL_VERSION = "2026-10-15";
|
|
14
16
|
export declare const LEGAL_CONTACT_EMAIL = "contact@intentic.dev";
|
|
15
17
|
export declare const LEGAL_ENTITY_NAME = "Artur Kurowski, trading as radarsu";
|
|
16
18
|
export declare const LEGAL_ENTITY_COUNTRY = "Poland";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AAOnC,eAAO,MAAM,cAAc,UA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AO,MAAM,wBAAwB,0FAAqC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,12 +5,28 @@ export * from "./turn-preamble.js";
|
|
|
5
5
|
export const WORKSPACE_ROOT = "/work";
|
|
6
6
|
export const HISTORY_ROOT = "/history";
|
|
7
7
|
export const STATE_DIR = ".intentic";
|
|
8
|
+
export const DERIVED_SHADOWS_DIR = `${STATE_DIR}/local/cache/derived`;
|
|
9
|
+
export const SHADOWED_DOCUMENT_EXTENSIONS = [
|
|
10
|
+
".docx",
|
|
11
|
+
".epub",
|
|
12
|
+
".odg",
|
|
13
|
+
".odp",
|
|
14
|
+
".ods",
|
|
15
|
+
".odt",
|
|
16
|
+
".otp",
|
|
17
|
+
".ots",
|
|
18
|
+
".ott",
|
|
19
|
+
".pdf",
|
|
20
|
+
".pptx",
|
|
21
|
+
".rtf",
|
|
22
|
+
".xlsx",
|
|
23
|
+
];
|
|
8
24
|
export const REFERENCE_DIR = "refs";
|
|
9
25
|
export const PUBLIC_DIR = "public";
|
|
10
26
|
export const MEMORY_FILE = "AGENTS.md";
|
|
11
27
|
export const FIELD_NOTES_FILE = ".intentic/config/field-notes.toon";
|
|
12
28
|
export const HOST_STATE_ROOT = "/opt/intentic";
|
|
13
|
-
export const LEGAL_VERSION = "2026-10-
|
|
29
|
+
export const LEGAL_VERSION = "2026-10-15";
|
|
14
30
|
export const LEGAL_CONTACT_EMAIL = "contact@intentic.dev";
|
|
15
31
|
export const LEGAL_ENTITY_NAME = "Artur Kurowski, trading as radarsu";
|
|
16
32
|
export const LEGAL_ENTITY_COUNTRY = "Poland";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AAOnC,MAAM,CAAC,MAAM,cAAc,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EAAE;IACxD,OAAO,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE;IACjD,UAAU,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE;IAGzD,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;IACrC,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;CACkB,CAAC;AAKpE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAkB,EAAU,EAAE,CAAC,GAAG,oBAAoB,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAGtH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,GAAkB,EAAU,EAAE,CAAC,GAAG,mBAAmB,IAAI,eAAe,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAIvH,cAAc,gBAAgB,CAAC;AAI/B,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC;AAChC,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;AAGjC,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC;AAG/B,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC;AAIpC,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC;AAGhC,MAAM,CAAC,MAAM,gBAAgB,GAAG,0EAA0E,CAAC;AAG3G,MAAM,CAAC,MAAM,wBAAwB,GAAG,gBAAgB,gBAAgB,EAAE,CAAC"}
|
package/package.json
CHANGED
package/src/allow.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Types for allow.mjs: the site pragma and commit trailer that excuse a check's finding.
|
|
2
2
|
export function pragmaReason(text: string, check: string): string | undefined;
|
|
3
|
+
export function allowingLine(lines: readonly string[], line: number, check: string): number | undefined;
|
|
3
4
|
export function allowedAt(lines: readonly string[], line: number, check: string): boolean;
|
|
4
5
|
export interface AllowTrailer {
|
|
5
6
|
readonly check: string;
|
package/src/allow.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// THE TWO WAYS TO SAY A CHECK'S FINDING IS RIGHT HERE, read the same way by every check and suite that honours them.
|
|
2
2
|
//
|
|
3
3
|
// - A SITE PRAGMA, `// allow(<check>): <reason>`, for one place in the code: on the flagged line, or anywhere in the
|
|
4
|
-
// comment block directly above it.
|
|
5
|
-
// takes it away, which a list of names kept somewhere else cannot do.
|
|
4
|
+
// comment block directly above it. Markup spells it `<!-- allow(<check>): <reason> -->`. It lives on the declaration
|
|
5
|
+
// it excuses, so a rename carries it and a deletion takes it away, which a list of names kept somewhere else cannot do.
|
|
6
6
|
// - A COMMIT TRAILER, `Allow: <check> — <reason>`, for a change: what the range adds to that check is accepted, with the
|
|
7
7
|
// reason in the history. `—`, `–`, `-` or `:` may separate the two.
|
|
8
8
|
//
|
|
@@ -10,32 +10,50 @@
|
|
|
10
10
|
|
|
11
11
|
const escape = (text) => text.replace(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`);
|
|
12
12
|
|
|
13
|
-
// Comment openers the pragma may follow: a line comment, a block comment or one of its continuation lines
|
|
14
|
-
|
|
13
|
+
// Comment openers the pragma may follow: a line comment, a block comment or one of its continuation lines, markup's, or
|
|
14
|
+
// JSX's `{/*`.
|
|
15
|
+
const COMMENT_LINE = /^\s*(?:\/\/|\/\*|\*|<!--|\{\/\*)/;
|
|
16
|
+
// The last line of a markup comment that began on an earlier one.
|
|
17
|
+
const MARKUP_TAIL = /^(?!.*<!--).*-->\s*$/;
|
|
18
|
+
|
|
19
|
+
// A pragma's comment opener, and the closer its comment may end with, which is never its reason.
|
|
20
|
+
const OPENER = String.raw`(?:\/\/|\/\*|\*|<!--)`;
|
|
21
|
+
const CLOSER = String.raw`(?:\*\/\}?|-->)`;
|
|
15
22
|
|
|
16
23
|
/** The reason a pragma for `check` in `text` gives, or undefined when `text` holds none with a reason. */
|
|
17
24
|
export const pragmaReason = (text, check) => {
|
|
18
|
-
const found = new RegExp(String.raw
|
|
25
|
+
const found = new RegExp(String.raw`${OPENER}\s*allow\(${escape(check)}\):\s*(?!${CLOSER})(\S[^\n]*?)\s*${CLOSER}?\s*$`, "m").exec(text);
|
|
19
26
|
return found?.[1];
|
|
20
27
|
};
|
|
21
28
|
|
|
22
29
|
/**
|
|
23
|
-
*
|
|
24
|
-
* that ends on the line above it.
|
|
30
|
+
* The 1-based line of the pragma for `check` that excuses the site on 1-based `line` of `lines`: the line itself, or one
|
|
31
|
+
* in the comment block that ends on the line above it. Undefined when none does.
|
|
25
32
|
*/
|
|
26
|
-
export const
|
|
33
|
+
export const allowingLine = (lines, line, check) => {
|
|
27
34
|
const says = (text) => pragmaReason(text, check) !== undefined;
|
|
28
35
|
if (says(lines[line - 1] ?? "")) {
|
|
29
|
-
return
|
|
36
|
+
return line;
|
|
30
37
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
// Inside a markup comment read upwards from its tail, every line is comment until the one that opens it.
|
|
39
|
+
let inMarkup = false;
|
|
40
|
+
for (let at = line - 2; at >= 0; at--) {
|
|
41
|
+
const text = lines[at];
|
|
42
|
+
const tail = MARKUP_TAIL.test(text);
|
|
43
|
+
if (!inMarkup && !tail && !COMMENT_LINE.test(text)) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
if (says(text)) {
|
|
47
|
+
return at + 1;
|
|
34
48
|
}
|
|
49
|
+
inMarkup = tail || (inMarkup && !text.includes("<!--"));
|
|
35
50
|
}
|
|
36
|
-
return
|
|
51
|
+
return undefined;
|
|
37
52
|
};
|
|
38
53
|
|
|
54
|
+
/** Whether the site on 1-based `line` of `lines` carries a pragma for `check` (`allowingLine`). */
|
|
55
|
+
export const allowedAt = (lines, line, check) => allowingLine(lines, line, check) !== undefined;
|
|
56
|
+
|
|
39
57
|
const TRAILER = /^Allow:[ \t]*([\w./-]+?)[ \t]*(?:—|–|:|-{1,2})[ \t]*(\S.*?)[ \t]*$/gm;
|
|
40
58
|
|
|
41
59
|
/** Every `Allow: <check> — <reason>` line in a commit message or a trailer listing, in order. */
|