@event4u/agent-config 17.3.0 → 17.4.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/.augment-plugin/marketplace.json +3 -3
- package/.augment-plugin/plugin.json +1 -1
- package/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +164 -342
- package/CREDITS.md +2 -2
- package/README.md +1 -1
- package/dist/agent-src/skills/code-intelligence/SKILL.md +3 -0
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/cli/registry.js +2 -2
- package/dist/cli-delegate/{chunk-DHSSP7V3.js → chunk-5AYJGUA3.js} +0 -2
- package/dist/cli-delegate/chunk-DIFZBP4G.js +1336 -0
- package/dist/cli-delegate/{chunk-MT2WOOCY.js → chunk-WY5ZZPGL.js} +2 -2
- package/dist/cli-delegate/{chunk-ORJPBER2.js → chunk-X6LZ7W5A.js} +73 -10
- package/dist/cli-delegate/cmd_conformance.js +175 -183
- package/dist/cli-delegate/cmd_doctor.js +5 -5
- package/dist/cli-delegate/cmd_doctor_neighbours.js +3 -3
- package/dist/cli-delegate/cmd_explain.js +1 -1
- package/dist/cli-delegate/cmd_handoff.js +2 -2
- package/dist/cli-delegate/cmd_memory_get.js +1 -1
- package/dist/cli-delegate/cmd_route_audit.js +1 -1
- package/dist/cli-delegate/cmd_session_recycle.js +2 -2
- package/dist/cli-delegate/cmd_update.js +24 -13
- package/dist/cli-delegate/cmd_upgrade.js +2 -2
- package/dist/cli-delegate/dist-25AZAHOP.js +3240 -0
- package/dist/cli-delegate/dist-P7MFPMF3.js +411 -0
- package/dist/cli-delegate/dist-XAS5ZLQB.js +6 -0
- package/dist/cli-delegate/{upgrade_unattended-VVL6JLSX.js → upgrade_unattended-QCWOKTUN.js} +178 -163
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +3 -3
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +1 -1
- package/dist/discovery/dormancy-report.md +1 -1
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +2 -2
- package/dist/discovery/trust-report.md +1 -1
- package/dist/discovery/workspaces.json +2 -2
- package/dist/hooks/code_graph_refresh.chunk.cjs +56 -27
- package/dist/hooks/code_graph_refresh.chunk.cjs.sha256 +1 -1
- package/dist/hooks/dispatch.js +982 -929
- package/dist/hooks/dispatch.sha256 +1 -1
- package/dist/hooks/egress_engine.chunk.cjs +56 -6
- package/dist/hooks/egress_engine.chunk.cjs.sha256 +1 -1
- package/dist/hooks/update_notice.chunk.cjs +914 -0
- package/dist/hooks/update_notice.chunk.cjs.sha256 +1 -0
- package/dist/mcp/registry-manifest.json +1 -1
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +71259 -66437
- package/dist/scripts/condense.js +9 -6
- package/package.json +4 -1
- package/src/config/evaluator-budgets.json +9 -8
- package/src/config/gate-violation-baselines.json +2 -2
- package/src/config/hook-bundle-budget.json +31 -6
- package/src/config/packed-binary-manifest.json +9 -0
- package/src/config/sigstore/npm_keys.json +50 -0
- package/src/config/sigstore/trust-material.json +9 -0
- package/src/config/sigstore/trusted_root.json +126 -0
- package/src/config/skill-body-budget.json +7 -1
- package/src/scripts/_cli/cmd_update.ts +48 -20
- package/src/scripts/_cli/cmd_upgrade.ts +7 -1
- package/src/scripts/_cli/upgrade_unattended.ts +90 -76
- package/src/scripts/_dispatch.bash +3 -2
- package/src/scripts/_lib/confusables.ts +0 -19
- package/src/scripts/_lib/egress_normalize.ts +53 -23
- package/src/scripts/_lib/egress_text.ts +5 -3
- package/src/scripts/_lib/egress_token.ts +7 -5
- package/src/scripts/_lib/gate_collector_experimental.ts +633 -0
- package/src/scripts/_lib/git_common_dir.ts +10 -0
- package/src/scripts/_lib/graph_feeder_record.ts +3 -2
- package/src/scripts/_lib/install_reach_checks.ts +32 -2
- package/src/scripts/_lib/lineage_backfill.ts +136 -0
- package/src/scripts/_lib/lineage_ledger.ts +211 -0
- package/src/scripts/_lib/lineage_map.ts +55 -0
- package/src/scripts/_lib/lineage_query.ts +140 -0
- package/src/scripts/_lib/lineage_seed.ts +116 -0
- package/src/scripts/_lib/lineage_watch.ts +249 -0
- package/src/scripts/_lib/link_crypto.ts +8 -4
- package/src/scripts/_lib/production_reach.ts +3 -3
- package/src/scripts/_lib/project_registry.ts +227 -0
- package/src/scripts/_lib/provenance_verify.ts +14 -242
- package/src/scripts/_lib/sigstore_provenance.ts +177 -0
- package/src/scripts/_lib/source_id.ts +48 -0
- package/src/scripts/_lib/source_shape.ts +4 -0
- package/src/scripts/_lib/unattended_gates.ts +6 -1
- package/src/scripts/advisories.ts +26 -10
- package/src/scripts/ai_council/council_egress.ts +5 -6
- package/src/scripts/bench_graph_feeder_latency.ts +10 -3
- package/src/scripts/check_dependency_floors.ts +7 -0
- package/src/scripts/check_egress_mutations.ts +1 -0
- package/src/scripts/code_graph/build.ts +67 -3
- package/src/scripts/code_graph/cli.ts +131 -28
- package/src/scripts/code_graph/conventions_default.ts +20 -1
- package/src/scripts/code_graph/detect.ts +5 -5
- package/src/scripts/code_graph/estate_cli.ts +135 -0
- package/src/scripts/code_graph/estate_index.ts +394 -0
- package/src/scripts/code_graph/estate_manifests.ts +223 -0
- package/src/scripts/code_graph/estate_map.ts +141 -0
- package/src/scripts/code_graph/extract.ts +4 -1
- package/src/scripts/code_graph/extract_more.ts +137 -2
- package/src/scripts/code_graph/graph_budget.ts +158 -0
- package/src/scripts/code_graph/graph_home.ts +80 -0
- package/src/scripts/code_graph/lineage_cli.ts +315 -0
- package/src/scripts/code_graph/map.ts +22 -13
- package/src/scripts/code_graph/map_model.ts +67 -12
- package/src/scripts/code_graph/map_verify.ts +68 -5
- package/src/scripts/code_graph/map_viewer/viewer.css +12 -0
- package/src/scripts/code_graph/map_viewer/viewer.js +45 -15
- package/src/scripts/code_graph/project_ref.ts +25 -0
- package/src/scripts/code_graph/projects_cli.ts +254 -0
- package/src/scripts/code_graph/providers/catalog.ts +14 -5
- package/src/scripts/code_graph/providers/django.ts +52 -9
- package/src/scripts/code_graph/providers/index.ts +2 -0
- package/src/scripts/code_graph/providers/rails.ts +204 -0
- package/src/scripts/code_graph/providers/spring.ts +38 -1
- package/src/scripts/code_graph/query.ts +9 -9
- package/src/scripts/code_graph/refresh_lock.ts +12 -8
- package/src/scripts/code_graph/repo_identity.ts +169 -0
- package/src/scripts/code_graph/sqlite_store.ts +22 -25
- package/src/scripts/code_graph/types.ts +6 -2
- package/src/scripts/condense.ts +6 -6
- package/src/scripts/hook_chunks.mjs +7 -0
- package/src/scripts/hook_manifest.json +1 -1
- package/src/scripts/hook_manifest.yaml +20 -17
- package/src/scripts/hooks/code_graph_refresh_hook.ts +10 -7
- package/src/scripts/hooks/dispatch_hook.ts +6 -7
- package/src/scripts/hooks/host_semantics.ts +72 -0
- package/src/scripts/hooks/lazy_concern.ts +4 -0
- package/src/scripts/hooks/user_notice.ts +105 -0
- package/src/scripts/lint_harvest_provenance.ts +137 -11
- package/src/scripts/mcp_server/consumer_tool_catalog.json +69 -15
- package/src/scripts/mcp_server/graph_tools.ts +161 -41
- package/src/scripts/network_sources.ts +24 -6
- package/src/scripts/schemas/provenance-mechanism.schema.json +46 -0
- package/src/scripts/update_notice_hook.ts +75 -7
- package/src/vendor/grammars/README.md +7 -6
- package/src/vendor/grammars/tree-sitter-ruby.wasm +0 -0
- /package/dist/cli-delegate/{chunk-FKYZOWVD.js → chunk-QBAFP67O.js} +0 -0
- /package/dist/cli-delegate/{chunk-BMGUGSY6.js → chunk-TQG6UMPC.js} +0 -0
|
@@ -49,25 +49,6 @@ export const CONFUSABLE_FOREIGN: ReadonlySet<number> = new Set([
|
|
|
49
49
|
0x03a1 /*Ρ→P*/, 0x03a4 /*Τ→T*/, 0x03a5 /*Υ→Y*/, 0x03a7 /*Χ→X*/, 0x0392 /*Β→B*/,
|
|
50
50
|
]);
|
|
51
51
|
|
|
52
|
-
/**
|
|
53
|
-
* The basic-Latin twin of each confusable foreign letter that has one, for a
|
|
54
|
-
* detector that folds a lookalike back before matching. Every key is in
|
|
55
|
-
* `CONFUSABLE_FOREIGN`, which a test holds.
|
|
56
|
-
*/
|
|
57
|
-
export const LATIN_TWIN: ReadonlyMap<number, string> = new Map([
|
|
58
|
-
[0x0430, 'a'], [0x0435, 'e'], [0x043e, 'o'], [0x0440, 'p'], [0x0441, 'c'],
|
|
59
|
-
[0x0443, 'y'], [0x0445, 'x'], [0x0455, 's'], [0x0456, 'i'], [0x0458, 'j'],
|
|
60
|
-
[0x04bb, 'h'], [0x0501, 'd'], [0x051b, 'q'],
|
|
61
|
-
[0x0410, 'A'], [0x0412, 'B'], [0x0415, 'E'], [0x041a, 'K'], [0x041c, 'M'],
|
|
62
|
-
[0x041d, 'H'], [0x041e, 'O'], [0x0420, 'P'], [0x0421, 'C'], [0x0422, 'T'],
|
|
63
|
-
[0x0423, 'Y'], [0x0425, 'X'], [0x0405, 'S'], [0x0406, 'I'], [0x0408, 'J'],
|
|
64
|
-
[0x03b1, 'a'], [0x03b5, 'e'], [0x03bf, 'o'], [0x03bd, 'v'], [0x03c1, 'p'],
|
|
65
|
-
[0x03c5, 'u'], [0x03c7, 'x'], [0x03ba, 'k'],
|
|
66
|
-
[0x0391, 'A'], [0x0392, 'B'], [0x0395, 'E'], [0x0396, 'Z'], [0x0397, 'H'],
|
|
67
|
-
[0x0399, 'I'], [0x039a, 'K'], [0x039c, 'M'], [0x039d, 'N'], [0x039f, 'O'],
|
|
68
|
-
[0x03a1, 'P'], [0x03a4, 'T'], [0x03a5, 'Y'], [0x03a7, 'X'],
|
|
69
|
-
]);
|
|
70
|
-
|
|
71
52
|
type ScriptName = 'latin' | 'cyrillic' | 'greek' | 'other';
|
|
72
53
|
|
|
73
54
|
function _script_of(ch: string): ScriptName {
|
|
@@ -8,9 +8,20 @@
|
|
|
8
8
|
* back to the original offsets, so a replacement removes the disguised bytes
|
|
9
9
|
* too. Pure: no I/O.
|
|
10
10
|
*/
|
|
11
|
-
import { LATIN_TWIN } from './confusables.js';
|
|
12
11
|
import { detect, EGRESS_RULES, type EgressRule, type EgressSpan } from './egress_rules.js';
|
|
13
12
|
|
|
13
|
+
// Aligned: the n-th code point of FOREIGN, three hex digits each, folds to the
|
|
14
|
+
// n-th letter of LATIN. Kept here, not in confusables.ts, so the engine chunk
|
|
15
|
+
// does not carry that module's script regexes.
|
|
16
|
+
const FOREIGN = '43043543e4404414434454554564584bb50151b41041241541a41c41d41e4204214224234254054064083b13b53bf3bd3c13c53c73ba39139239539639739939a39c39d39f3a13a43a53a7';
|
|
17
|
+
const LATIN = 'aeopcyxsijhdqABEKMHOPCTYXSIJaeovpuxkABEZHIKMNOPTYX';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The basic-Latin twin of each confusable foreign letter that has one. Every
|
|
21
|
+
* key is in `CONFUSABLE_FOREIGN` (confusables.ts), which a test holds.
|
|
22
|
+
*/
|
|
23
|
+
export const LATIN_TWIN: ReadonlyMap<number, string> = new Map([...LATIN].map((c, i) => [parseInt(FOREIGN.slice(i * 3, i * 3 + 3), 16), c]));
|
|
24
|
+
|
|
14
25
|
/**
|
|
15
26
|
* Invisible and bidirectional-control characters: soft hyphen, zero-width
|
|
16
27
|
* marks, bidi embeddings and isolates, word joiners, the BOM and the Tag block.
|
|
@@ -19,17 +30,15 @@ export const HIDDEN_UNICODE_RE = /[----\u{E0000}-\u
|
|
|
19
30
|
|
|
20
31
|
export interface Normalized {
|
|
21
32
|
readonly text: string;
|
|
22
|
-
/** For each UTF-16 unit of `text`, the original
|
|
23
|
-
readonly
|
|
24
|
-
readonly originEnd: readonly number[];
|
|
33
|
+
/** For each UTF-16 unit of `text`, the original offset of the character it came from. */
|
|
34
|
+
readonly origin: readonly number[];
|
|
25
35
|
readonly hidden: number;
|
|
26
36
|
readonly folded: number;
|
|
27
37
|
}
|
|
28
38
|
|
|
29
39
|
export function normalizeForDetection(text: string): Normalized {
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
const originEnd: number[] = [];
|
|
40
|
+
let out = '';
|
|
41
|
+
const origin: number[] = [];
|
|
33
42
|
let hidden = 0;
|
|
34
43
|
let folded = 0;
|
|
35
44
|
let at = 0;
|
|
@@ -38,30 +47,51 @@ export function normalizeForDetection(text: string): Normalized {
|
|
|
38
47
|
if (HIDDEN_UNICODE_RE.test(ch)) {
|
|
39
48
|
hidden += 1;
|
|
40
49
|
} else {
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
for (let k = 0; k < emit.length; k += 1)
|
|
45
|
-
originStart.push(at);
|
|
46
|
-
originEnd.push(at + ch.length);
|
|
47
|
-
}
|
|
48
|
-
out.push(emit);
|
|
50
|
+
const emit = LATIN_TWIN.get(ch.codePointAt(0) as number) ?? ch;
|
|
51
|
+
if (emit !== ch) folded += 1;
|
|
52
|
+
out += emit;
|
|
53
|
+
for (let k = 0; k < emit.length; k += 1) origin.push(at);
|
|
49
54
|
}
|
|
50
55
|
at += ch.length;
|
|
51
56
|
}
|
|
52
|
-
return { text: out
|
|
57
|
+
return { text: out, origin, hidden, folded };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface NormalizedDetection {
|
|
61
|
+
readonly spans: EgressSpan[];
|
|
62
|
+
/**
|
|
63
|
+
* An extent reader such as a rule's `through`, applied to the text the spans
|
|
64
|
+
* were found in, with its end in original offsets. A disguised END marker is
|
|
65
|
+
* then seen by the reader exactly as the disguised BEGIN was by the rule.
|
|
66
|
+
*/
|
|
67
|
+
end<S extends EgressSpan>(span: S, read: (text: string, span: S) => number | null): number | null;
|
|
53
68
|
}
|
|
54
69
|
|
|
55
70
|
/**
|
|
56
71
|
* `detect`, run on the normalised text with spans in original offsets. With no
|
|
57
72
|
* invisible or confusable character the result is `detect(text)` exactly.
|
|
58
73
|
*/
|
|
59
|
-
export function
|
|
74
|
+
export function detectWithExtent(text: string, rules: readonly EgressRule[] = EGRESS_RULES): NormalizedDetection {
|
|
60
75
|
const n = normalizeForDetection(text);
|
|
61
|
-
if (n.hidden === 0 && n.folded === 0) return detect(text, rules);
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
76
|
+
if (n.hidden === 0 && n.folded === 0) return { spans: detect(text, rules), end: (s, read) => read(text, s) };
|
|
77
|
+
const back = (i: number): number => {
|
|
78
|
+
const o = n.origin[i - 1] as number;
|
|
79
|
+
return o + ((text.codePointAt(o) as number) > 0xffff ? 2 : 1);
|
|
80
|
+
};
|
|
81
|
+
const fwd = (o: number): number => {
|
|
82
|
+
let i = 0;
|
|
83
|
+
while (i < n.origin.length && (n.origin[i] as number) < o) i += 1;
|
|
84
|
+
return i;
|
|
85
|
+
};
|
|
86
|
+
return {
|
|
87
|
+
spans: detect(n.text, rules).map((s) => ({ ...s, start: n.origin[s.start] as number, end: back(s.end) })),
|
|
88
|
+
end: (s, read) => {
|
|
89
|
+
const e = read(n.text, { ...s, start: fwd(s.start), end: fwd(s.end) });
|
|
90
|
+
return e === null ? null : back(e);
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function detectNormalized(text: string, rules: readonly EgressRule[] = EGRESS_RULES): EgressSpan[] {
|
|
96
|
+
return detectWithExtent(text, rules).spans;
|
|
67
97
|
}
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
// (`egress_engine.ts`, D9), so the stage keeps the field walk and the chunk
|
|
4
4
|
// keeps everything that reads a rule.
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { detectWithExtent } from './egress_normalize.js';
|
|
7
|
+
import { EGRESS_RULES, type EgressClass } from './egress_rules.js';
|
|
7
8
|
import { EgressRefusedError, replaceValues, type TokenScope } from './egress_token.js';
|
|
8
9
|
|
|
9
10
|
const RULE_BY_ID = new Map(EGRESS_RULES.map((r) => [r.rule, r]));
|
|
@@ -19,10 +20,11 @@ export interface TextTally {
|
|
|
19
20
|
export function tallyText(text: string): TextTally {
|
|
20
21
|
const found: Array<{ class: EgressClass; type: string }> = [];
|
|
21
22
|
const refused: string[] = [];
|
|
22
|
-
|
|
23
|
+
const at = detectWithExtent(text);
|
|
24
|
+
for (const span of at.spans) {
|
|
23
25
|
const policy = RULE_BY_ID.get(span.rule)?.replacement;
|
|
24
26
|
if (policy !== undefined && policy !== 'detection') {
|
|
25
|
-
const end =
|
|
27
|
+
const end = at.end(span, policy.through);
|
|
26
28
|
if (end === null || end < span.end) {
|
|
27
29
|
refused.push(span.rule);
|
|
28
30
|
continue;
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import { createHmac, randomBytes } from 'node:crypto';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { detectWithExtent, type NormalizedDetection } from './egress_normalize.js';
|
|
9
|
+
import { EGRESS_RULES, type EgressClass, type EgressSpan, replaceSpans } from './egress_rules.js';
|
|
9
10
|
|
|
10
11
|
export const TOKEN_FP_LENGTH = 6;
|
|
11
12
|
|
|
@@ -209,12 +210,12 @@ const RULE_BY_ID = new Map(EGRESS_RULES.map((r) => [r.rule, r]));
|
|
|
209
210
|
const CLASS_RANK: Readonly<Record<EgressClass, number>> = { credential: 1, identifier: 0 };
|
|
210
211
|
|
|
211
212
|
/** The bytes each detection obliges a replacement to remove; overlapping extents merge. */
|
|
212
|
-
function replacementSpans(
|
|
213
|
+
function replacementSpans(detected: readonly EgressSpan[], at: NormalizedDetection): EgressSpan[] {
|
|
213
214
|
const extents = detected.map((s) => {
|
|
214
215
|
const policy = RULE_BY_ID.get(s.rule)?.replacement;
|
|
215
216
|
if (policy === undefined) throw new EgressRefusedError(s.rule);
|
|
216
217
|
if (policy === 'detection') return s;
|
|
217
|
-
const end =
|
|
218
|
+
const end = at.end(s, policy.through);
|
|
218
219
|
if (end === null || end < s.end) throw new EgressRefusedError(s.rule);
|
|
219
220
|
return { ...s, end };
|
|
220
221
|
});
|
|
@@ -243,8 +244,9 @@ function replacementSpans(text: string, detected: readonly EgressSpan[]): Egress
|
|
|
243
244
|
*/
|
|
244
245
|
export function replaceValues(text: string, scope: TokenScope): string {
|
|
245
246
|
const owned = parseTokens(text).filter((t) => scope.owns(text.slice(t.start, t.end)));
|
|
246
|
-
const
|
|
247
|
-
const
|
|
247
|
+
const at = detectWithExtent(text);
|
|
248
|
+
const detected = at.spans.filter((s) => !owned.some((t) => t.start <= s.start && s.end <= t.end));
|
|
249
|
+
const spans = replacementSpans(detected, at);
|
|
248
250
|
// Mint in text order first: replaceSpans substitutes right to left, and minting
|
|
249
251
|
// inside its callback would number the last value 1.
|
|
250
252
|
const tokens = spans.map((s) => scope.mint(s.type, s.class, text.slice(s.start, s.end)));
|