@event4u/agent-config 10.3.0 → 10.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/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +78 -0
- package/README.md +1 -1
- package/dist/agent-src/commands/analyze.md +2 -1
- package/dist/agent-src/commands/design-system/capture.md +44 -0
- package/dist/agent-src/commands/design-system/generate.md +53 -0
- package/dist/agent-src/commands/design-system/import.md +63 -0
- package/dist/agent-src/commands/design-system.md +66 -0
- package/dist/agent-src/skills/design-system-capture/SKILL.md +9 -0
- package/dist/agent-src/skills/design-system-capture/references/design-system-json.md +70 -0
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/design.ts +4 -1
- package/dist/cli-delegate/chunk-RLN73PR5.js +157 -0
- package/dist/cli-delegate/{chunk-I5EAFRII.js → chunk-ZPSXJTLI.js} +2 -154
- package/dist/cli-delegate/cmd_conformance.js +671 -213
- package/dist/cli-delegate/cmd_handoff.js +8 -6
- package/dist/cli-delegate/cmd_session_recycle.js +5 -3
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +116 -11
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +3 -3
- package/dist/discovery/dormancy-report.md +1 -1
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +9 -5
- package/dist/discovery/trust-report.md +2 -2
- package/dist/discovery/workspaces.json +8 -4
- package/dist/hooks/dispatch.js +940 -387
- package/dist/mcp/registry-manifest.json +2 -2
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +1102 -592
- package/package.json +1 -1
- package/src/agent-src/templates/scripts/work_engine/directives/ui/design.ts +4 -1
- package/src/config/gate-coverage.yml +23 -2
- package/src/config/gate-violation-baselines.json +2 -2
- package/src/scripts/_lib/design_system_import.ts +987 -0
- package/src/scripts/design_system_import.ts +264 -0
- package/src/scripts/hook_manifest.yaml +71 -2
- package/src/scripts/hooks/concern_registry.ts +4 -0
- package/src/scripts/hooks/dispatch_hook.ts +10 -0
- package/src/scripts/hooks/host_semantics.ts +2 -0
- package/src/scripts/hooks/spawn_guard_shadow_hook.ts +212 -0
- package/src/scripts/hooks/subagent_ledger_hook.ts +723 -0
- package/src/scripts/hooks/turn_end_gate_hook.ts +39 -2
- package/src/scripts/lint_hook_manifest.ts +2 -0
- package/src/scripts/lint_rule_skill_pack_reach.ts +194 -13
- package/tests/fixtures/hooks/subagent_start.json +7 -0
- package/tests/fixtures/hooks/subagent_stop.json +8 -0
|
@@ -1,150 +1,4 @@
|
|
|
1
1
|
import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
git_common_dir
|
|
4
|
-
} from "./chunk-PZWRPRWP.js";
|
|
5
|
-
|
|
6
|
-
// src/scripts/_lib/envelope_grounding.ts
|
|
7
|
-
import { execFileSync } from "node:child_process";
|
|
8
|
-
import * as fs from "node:fs";
|
|
9
|
-
import * as path from "node:path";
|
|
10
|
-
|
|
11
|
-
// src/scripts/_lib/git_env.ts
|
|
12
|
-
var GIT_DISCOVERY_VARS = [
|
|
13
|
-
"GIT_DIR",
|
|
14
|
-
"GIT_WORK_TREE",
|
|
15
|
-
"GIT_INDEX_FILE",
|
|
16
|
-
"GIT_OBJECT_DIRECTORY",
|
|
17
|
-
"GIT_ALTERNATE_OBJECT_DIRECTORIES",
|
|
18
|
-
"GIT_COMMON_DIR",
|
|
19
|
-
"GIT_NAMESPACE",
|
|
20
|
-
"GIT_PREFIX"
|
|
21
|
-
];
|
|
22
|
-
function gitEnv(base = process.env) {
|
|
23
|
-
const env = { ...base };
|
|
24
|
-
for (const key of GIT_DISCOVERY_VARS) {
|
|
25
|
-
delete env[key];
|
|
26
|
-
}
|
|
27
|
-
return env;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// src/scripts/_lib/envelope_grounding.ts
|
|
31
|
-
var MAX_FIELD_CHARS = 200;
|
|
32
|
-
var MAX_PATHS = 40;
|
|
33
|
-
function git(root, args) {
|
|
34
|
-
try {
|
|
35
|
-
return execFileSync("git", args, {
|
|
36
|
-
cwd: root,
|
|
37
|
-
env: gitEnv(),
|
|
38
|
-
encoding: "utf-8",
|
|
39
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
40
|
-
}).trim();
|
|
41
|
-
} catch {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
function canonicalizeRepoIdentity(raw) {
|
|
46
|
-
let s = raw.trim();
|
|
47
|
-
s = s.replace(/^[a-z][a-z0-9+.-]*:\/\//i, "");
|
|
48
|
-
s = s.replace(/^[^/@]+@/, "");
|
|
49
|
-
s = s.replace(/^([^/:]+):(?!\/)/, "$1/");
|
|
50
|
-
s = s.replace(/\/+$/, "");
|
|
51
|
-
s = s.replace(/\.git$/i, "");
|
|
52
|
-
const slash = s.indexOf("/");
|
|
53
|
-
if (slash > 0) {
|
|
54
|
-
s = s.slice(0, slash).toLowerCase() + s.slice(slash);
|
|
55
|
-
} else {
|
|
56
|
-
s = s.toLowerCase();
|
|
57
|
-
}
|
|
58
|
-
return s;
|
|
59
|
-
}
|
|
60
|
-
function collectRepoAnchor(root) {
|
|
61
|
-
const remote = git(root, ["config", "--get", "remote.origin.url"]);
|
|
62
|
-
let identity = null;
|
|
63
|
-
if (remote) {
|
|
64
|
-
identity = canonicalizeRepoIdentity(remote);
|
|
65
|
-
} else {
|
|
66
|
-
const common = git_common_dir(root);
|
|
67
|
-
if (common !== null) {
|
|
68
|
-
try {
|
|
69
|
-
identity = fs.realpathSync(common);
|
|
70
|
-
} catch {
|
|
71
|
-
identity = common;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return {
|
|
76
|
-
repo_identity: identity ? identity.slice(0, MAX_FIELD_CHARS) : null,
|
|
77
|
-
branch: git(root, ["rev-parse", "--abbrev-ref", "HEAD"]),
|
|
78
|
-
head: git(root, ["rev-parse", "HEAD"])
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
var VERIFY_STATE_REL = path.join("agents", "runtime", "state", "verify-before-complete.json");
|
|
82
|
-
function readLastVerify(root) {
|
|
83
|
-
try {
|
|
84
|
-
const raw = fs.readFileSync(path.join(root, VERIFY_STATE_REL), "utf-8");
|
|
85
|
-
const state = JSON.parse(raw);
|
|
86
|
-
const lv = state["last_verification"];
|
|
87
|
-
if (typeof lv !== "object" || lv === null || Array.isArray(lv)) return null;
|
|
88
|
-
const rec = lv;
|
|
89
|
-
const command = typeof rec["command"] === "string" ? rec["command"] : null;
|
|
90
|
-
if (!command) return null;
|
|
91
|
-
const at = typeof rec["at"] === "string" ? rec["at"] : "unknown time";
|
|
92
|
-
return `${command} @ ${at} (no exit status is recorded anywhere)`.slice(0, MAX_FIELD_CHARS);
|
|
93
|
-
} catch {
|
|
94
|
-
return null;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
function collectGrounding(root) {
|
|
98
|
-
const anchor = collectRepoAnchor(root);
|
|
99
|
-
const porcelain = git(root, ["status", "--porcelain"]);
|
|
100
|
-
if (porcelain === null) {
|
|
101
|
-
return { ...anchor, uncommitted_paths: [], status_summary: null, last_verify: readLastVerify(root) };
|
|
102
|
-
}
|
|
103
|
-
const lines = porcelain.split("\n").filter((l) => l.trim().length > 0);
|
|
104
|
-
const paths = lines.map((l) => l.slice(3).trim()).filter((p) => p.length > 0 && p.length <= MAX_FIELD_CHARS).slice(0, MAX_PATHS);
|
|
105
|
-
return {
|
|
106
|
-
...anchor,
|
|
107
|
-
uncommitted_paths: paths,
|
|
108
|
-
status_summary: lines.length === 0 ? "clean working tree" : `${lines.length} uncommitted path(s)${lines.length > MAX_PATHS ? `, first ${MAX_PATHS} listed` : ""}`,
|
|
109
|
-
last_verify: readLastVerify(root)
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
function describeDrift(envelope, actual) {
|
|
113
|
-
if (typeof envelope !== "object" || envelope === null || Array.isArray(envelope)) return [];
|
|
114
|
-
const e = envelope;
|
|
115
|
-
const drift = [];
|
|
116
|
-
const recordedIdentity = typeof e["repo_identity"] === "string" ? e["repo_identity"] : null;
|
|
117
|
-
if (recordedIdentity && actual.repo_identity && recordedIdentity !== actual.repo_identity) {
|
|
118
|
-
drift.push(
|
|
119
|
-
`IDENTITY DRIFT: this envelope was written in "${recordedIdentity}", you are in "${actual.repo_identity}". Re-verify every path before acting \u2014 same branch name does not mean same working tree.`
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
const recordedBranch = typeof e["branch"] === "string" ? e["branch"] : null;
|
|
123
|
-
if (recordedBranch && actual.branch && recordedBranch !== actual.branch) {
|
|
124
|
-
drift.push(
|
|
125
|
-
`BRANCH DRIFT: envelope written on "${recordedBranch}", checkout is on "${actual.branch}".`
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
const recordedHead = typeof e["head"] === "string" ? e["head"] : null;
|
|
129
|
-
if (recordedHead && actual.head && recordedHead !== actual.head) {
|
|
130
|
-
drift.push(
|
|
131
|
-
`COMMIT DRIFT: envelope written at ${recordedHead.slice(0, 12)}, HEAD is now ${actual.head.slice(0, 12)} \u2014 re-read anything the envelope quotes.`
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
return drift;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// src/scripts/_lib/recycle_envelope_paths.ts
|
|
138
|
-
import * as path2 from "node:path";
|
|
139
|
-
var RECYCLE_ENVELOPE_REL = path2.join("agents", "runtime", "state", "recycle-envelope.json");
|
|
140
|
-
var RECYCLE_CONSUMED_REL = path2.join(
|
|
141
|
-
"agents",
|
|
142
|
-
"runtime",
|
|
143
|
-
"state",
|
|
144
|
-
"recycle-envelope.consumed.json"
|
|
145
|
-
);
|
|
146
|
-
var RECYCLE_MAX_AGE_HOURS = 48;
|
|
147
|
-
var RECYCLE_ENVELOPE_MAX_BYTES = 6144;
|
|
148
2
|
|
|
149
3
|
// src/scripts/_lib/secret_detector.ts
|
|
150
4
|
var ENTROPY_MIN_TOKEN_LENGTH = 20;
|
|
@@ -602,16 +456,10 @@ function validateAssumption(input, label = "assumption") {
|
|
|
602
456
|
}
|
|
603
457
|
|
|
604
458
|
export {
|
|
605
|
-
collectRepoAnchor,
|
|
606
|
-
collectGrounding,
|
|
607
|
-
describeDrift,
|
|
608
|
-
RECYCLE_ENVELOPE_REL,
|
|
609
|
-
RECYCLE_CONSUMED_REL,
|
|
610
|
-
RECYCLE_MAX_AGE_HOURS,
|
|
611
|
-
RECYCLE_ENVELOPE_MAX_BYTES,
|
|
612
459
|
CAPSULE_SCHEMA_VERSION,
|
|
613
460
|
scanEnvelopeDirectives,
|
|
614
461
|
wrapAsPriorSessionData,
|
|
615
462
|
hasBoundaryMarker,
|
|
616
|
-
validateRecycleEnvelope
|
|
463
|
+
validateRecycleEnvelope,
|
|
464
|
+
validateAssumption
|
|
617
465
|
};
|