@event4u/agent-config 9.27.0 → 9.28.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/AGENTS.md +12 -11
- package/CHANGELOG.md +99 -0
- package/README.md +1 -1
- package/dist/agent-src/commands/analyze/conformance.md +24 -0
- package/dist/agent-src/contexts/execution/orchestration-telemetry.md +10 -3
- package/dist/agent-src/rules/artifact-engagement-recording.md +4 -1
- package/dist/agent-src/rules/autonomous-execution.md +1 -1
- package/dist/agent-src/rules/brand-source-of-truth.md +33 -6
- package/dist/agent-src/rules/context-hygiene.md +3 -1
- package/dist/agent-src/rules/council-availability.md +93 -0
- package/dist/agent-src/rules/cross-source-consistency.md +3 -0
- package/dist/agent-src/rules/delegation-policy.md +29 -5
- package/dist/agent-src/rules/design-fidelity.md +3 -0
- package/dist/agent-src/rules/evaluator-independence.md +2 -1
- package/dist/agent-src/rules/external-code-graph-interop.md +2 -1
- package/dist/agent-src/rules/finance-safety-floor.md +1 -1
- package/dist/agent-src/rules/git-history-discipline.md +1 -1
- package/dist/agent-src/rules/history-discipline.md +3 -1
- package/dist/agent-src/rules/legal-safety-floor.md +1 -1
- package/dist/agent-src/rules/no-pr-progress-comments.md +3 -1
- package/dist/agent-src/rules/onboarding-gate.md +3 -1
- package/dist/agent-src/rules/roadmap-ci-steps-policy.md +4 -1
- package/dist/agent-src/rules/role-mode-adherence.md +1 -1
- package/dist/agent-src/rules/scale-discipline.md +3 -1
- package/dist/agent-src/rules/self-repair-loop.md +103 -0
- package/dist/agent-src/rules/session-canary.md +2 -1
- package/dist/agent-src/rules/strategy-safety-floor.md +1 -1
- package/dist/agent-src/rules/token-budget-discipline.md +3 -1
- package/dist/agent-src/rules/tool-safety.md +5 -1
- package/dist/agent-src/skills/adversarial-review/SKILL.md +1 -1
- package/dist/agent-src/skills/analysis-autonomous-mode/SKILL.md +1 -1
- package/dist/agent-src/skills/performance-analysis/SKILL.md +1 -1
- package/dist/agent-src/skills/persona-improvement/SKILL.md +1 -1
- package/dist/agent-src/skills/project-analyzer/SKILL.md +1 -1
- package/dist/agent-src/skills/security-audit/SKILL.md +1 -1
- package/dist/agent-src/skills/sequential-thinking/SKILL.md +1 -1
- package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +1 -1
- package/dist/agent-src/skills/universal-project-analysis/SKILL.md +1 -1
- package/dist/agent-src/templates/AGENTS.md +6 -10
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/cli/registry.js +7 -0
- package/dist/cli/registry.js.map +1 -1
- package/dist/cli-delegate/chunk-22GCIJ2O.js +270 -0
- package/dist/cli-delegate/{chunk-BCPIOAGV.js → chunk-2BE5I2MN.js} +8 -8
- package/dist/cli-delegate/{chunk-AIIUU73N.js → chunk-7OMQCH4V.js} +1 -1
- package/dist/cli-delegate/{chunk-HJ6DAJHR.js → chunk-GB2FSUEE.js} +57 -7
- package/dist/cli-delegate/{chunk-WR6GTRHJ.js → chunk-JXARCGVN.js} +3 -3
- package/dist/cli-delegate/{chunk-3KJIMFTB.js → chunk-PQSAQKHW.js} +466 -304
- package/dist/cli-delegate/chunk-REKCMYOU.js +2991 -0
- package/dist/cli-delegate/cmd_analyze_session.js +1 -1
- package/dist/cli-delegate/cmd_brand_status.js +134 -0
- package/dist/cli-delegate/cmd_conformance.js +7 -7
- package/dist/cli-delegate/cmd_converge.js +3 -3
- package/dist/cli-delegate/cmd_doctor.js +4 -4
- package/dist/cli-delegate/cmd_explain.js +80 -330
- package/dist/cli-delegate/cmd_export.js +5 -5
- package/dist/cli-delegate/cmd_fleet.js +3 -3
- package/dist/cli-delegate/cmd_handoff.js +2 -2
- package/dist/cli-delegate/cmd_mcp_available.js +433 -0
- package/dist/cli-delegate/cmd_migrate.js +3 -3
- package/dist/cli-delegate/cmd_packs_active.js +153 -0
- package/dist/cli-delegate/cmd_preflight.js +1 -1
- package/dist/cli-delegate/cmd_prune.js +5 -5
- package/dist/cli-delegate/cmd_route_audit.js +8 -8
- package/dist/cli-delegate/cmd_route_explain.js +4 -4
- package/dist/cli-delegate/cmd_settings_get.js +272 -0
- package/dist/cli-delegate/cmd_settings_migrate.js +5 -5
- package/dist/cli-delegate/cmd_settings_set.js +7 -2967
- package/dist/cli-delegate/cmd_sync.js +5 -5
- package/dist/cli-delegate/cmd_uninstall.js +5 -5
- package/dist/cli-delegate/cmd_update.js +4 -4
- package/dist/cli-delegate/cmd_upgrade.js +4 -4
- package/dist/cli-delegate/cmd_validate.js +5 -5
- package/dist/cli-delegate/cmd_versions.js +4 -4
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +100 -40
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +3 -3
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +7 -5
- package/dist/discovery/trust-report.md +11 -11
- package/dist/discovery/workspaces.json +6 -4
- package/dist/hooks/dispatch.js +9004 -6132
- package/dist/install/install.mjs +697 -507
- package/dist/mcp/registry-manifest.json +3 -3
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +127 -20
- package/dist/router.json +1 -1
- package/dist/scripts/_lib/agent_settings.js +80 -15
- package/dist/scripts/_lib/agent_settings.js.map +1 -1
- package/docs/contracts/settings-classes.md +29 -8
- package/docs/guidelines/agent-infra/memory-access.md +14 -3
- package/package.json +1 -1
- package/src/agent-src/templates/AGENTS.md +6 -10
- package/src/config/budgets.yml +29 -0
- package/src/config/evaluator-budgets.json +4 -4
- package/src/config/gate-coverage.yml +26 -0
- package/src/scripts/_cli/cmd_brand_status.ts +174 -0
- package/src/scripts/_cli/cmd_mcp_available.ts +266 -0
- package/src/scripts/_cli/cmd_packs_active.ts +225 -0
- package/src/scripts/_cli/cmd_settings_get.ts +324 -0
- package/src/scripts/_dispatch.bash +57 -0
- package/src/scripts/_lib/agent_settings.ts +82 -16
- package/src/scripts/_lib/carrier_divergence.ts +135 -0
- package/src/scripts/_lib/host_capability.ts +84 -1
- package/src/scripts/_lib/prompt_shape.ts +88 -0
- package/src/scripts/_lib/review_skipped_record.ts +102 -0
- package/src/scripts/_lib/rule_layer_overlap.ts +254 -0
- package/src/scripts/_lib/self_repair.ts +342 -0
- package/src/scripts/_lib/self_repair_store.ts +100 -0
- package/src/scripts/_lib/transcript_entry.ts +80 -0
- package/src/scripts/check_branch_freshness.ts +255 -0
- package/src/scripts/check_council_config_location.ts +125 -1
- package/src/scripts/check_standing_rule_delivery.ts +314 -0
- package/src/scripts/config/profiles.ts +13 -3
- package/src/scripts/conformance_scan.ts +272 -24
- package/src/scripts/council_availability_hook.ts +188 -0
- package/src/scripts/council_cli.ts +126 -7
- package/src/scripts/hook_manifest.yaml +107 -26
- package/src/scripts/hooks/block_no_verify.ts +39 -2
- package/src/scripts/hooks/block_unauthorized_git.ts +156 -7
- package/src/scripts/hooks/concern_registry.ts +10 -0
- package/src/scripts/hooks/delegation_nudge_hook.ts +450 -0
- package/src/scripts/hooks/end_review_nudge_hook.ts +726 -0
- package/src/scripts/hooks/orchestration_record_hook.ts +342 -0
- package/src/scripts/install.ts +151 -0
- package/src/scripts/language_mirror_hook.ts +30 -37
- package/src/scripts/measure_scope_dedup.ts +19 -13
- package/src/scripts/onboarding_gate_hook.ts +40 -1
- package/src/scripts/orchestration_record.ts +4 -1
- package/src/scripts/preamble_byte_census.ts +9 -20
- package/src/scripts/report_carrier_divergence.ts +364 -0
- package/src/scripts/report_skill_activation.ts +257 -0
- package/src/scripts/report_skill_obligation_violations.ts +579 -0
- package/src/scripts/routing_doctor.ts +77 -6
- package/src/scripts/self_repair_cli.ts +240 -0
- package/src/scripts/self_repair_hook.ts +241 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env tsx
|
|
2
2
|
import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
match_prompt
|
|
5
|
-
} from "./chunk-LF2KKJ4Q.js";
|
|
6
|
-
import {
|
|
7
|
-
resolvePackageRoot
|
|
8
|
-
} from "./chunk-MCJYCQPF.js";
|
|
9
3
|
import {
|
|
10
4
|
read_entries
|
|
11
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7OMQCH4V.js";
|
|
12
6
|
import "./chunk-3EWYC3YK.js";
|
|
7
|
+
import {
|
|
8
|
+
match_prompt
|
|
9
|
+
} from "./chunk-LF2KKJ4Q.js";
|
|
13
10
|
import {
|
|
14
11
|
load_agent_settings
|
|
15
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GB2FSUEE.js";
|
|
16
13
|
import "./chunk-NDJLNC6Q.js";
|
|
17
14
|
import "./chunk-OY53J6II.js";
|
|
15
|
+
import {
|
|
16
|
+
resolvePackageRoot
|
|
17
|
+
} from "./chunk-MCJYCQPF.js";
|
|
18
18
|
import "./chunk-J55WI3RR.js";
|
|
19
19
|
|
|
20
20
|
// src/scripts/_cli/cmd_route_audit.ts
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
_asRuleList,
|
|
5
5
|
match_prompt
|
|
6
6
|
} from "./chunk-LF2KKJ4Q.js";
|
|
7
|
-
import {
|
|
8
|
-
resolvePackageRoot
|
|
9
|
-
} from "./chunk-MCJYCQPF.js";
|
|
10
7
|
import {
|
|
11
8
|
load_agent_settings
|
|
12
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-GB2FSUEE.js";
|
|
13
10
|
import "./chunk-NDJLNC6Q.js";
|
|
11
|
+
import {
|
|
12
|
+
resolvePackageRoot
|
|
13
|
+
} from "./chunk-MCJYCQPF.js";
|
|
14
14
|
import "./chunk-J55WI3RR.js";
|
|
15
15
|
|
|
16
16
|
// src/scripts/_cli/cmd_route_explain.ts
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
buildSettingsClassIndex,
|
|
4
|
+
classOfPath,
|
|
5
|
+
getSettingsLeaf,
|
|
6
|
+
load,
|
|
7
|
+
parseSettingsClassRows
|
|
8
|
+
} from "./chunk-REKCMYOU.js";
|
|
9
|
+
import {
|
|
10
|
+
MERGEABLE_KEYS,
|
|
11
|
+
USER_GLOBAL_FILENAME,
|
|
12
|
+
iter_setting_overrides,
|
|
13
|
+
load_agent_settings
|
|
14
|
+
} from "./chunk-GB2FSUEE.js";
|
|
15
|
+
import {
|
|
16
|
+
resolve_with_fallback,
|
|
17
|
+
write_target
|
|
18
|
+
} from "./chunk-NDJLNC6Q.js";
|
|
19
|
+
import {
|
|
20
|
+
resolvePackageRoot
|
|
21
|
+
} from "./chunk-MCJYCQPF.js";
|
|
22
|
+
import "./chunk-J55WI3RR.js";
|
|
23
|
+
|
|
24
|
+
// src/scripts/_cli/cmd_settings_get.ts
|
|
25
|
+
import * as fs from "node:fs";
|
|
26
|
+
import * as path from "node:path";
|
|
27
|
+
import process from "node:process";
|
|
28
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
29
|
+
|
|
30
|
+
// src/shared/settingsCarveOut.ts
|
|
31
|
+
var SETTINGS_CARVE_OUT = [
|
|
32
|
+
{
|
|
33
|
+
key: "projection.mode",
|
|
34
|
+
reader: "src/scripts/install.ts:3409 _resolve_scoped_projection",
|
|
35
|
+
absentResolvesTo: "legacy-all",
|
|
36
|
+
reason: "The template fallback applies only when NO global settings file exists. Once a file exists, an absent key means legacy-all by documented contract, so an existing install is never silently narrowed on upgrade."
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
key: "projection.rule_workspaces",
|
|
40
|
+
reader: "src/install/rule_scope.ts:96 ruleScopeFromSettings",
|
|
41
|
+
absentResolvesTo: "null \u2014 LEGACY_ALL, i.e. every rule ships including maintainer-only ones",
|
|
42
|
+
reason: "Same upgrade contract as projection.mode, and the failure is louder: an absent list widens the projection instead of narrowing it."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: "subagents.auto",
|
|
46
|
+
reader: "src/scripts/routing_doctor.ts:206",
|
|
47
|
+
absentResolvesTo: "ask",
|
|
48
|
+
reason: "The reader falls back to `ask` while the template ships `on`. Carved out rather than fixed at the reader because the doctor reports what the RESOLVED configuration is; changing its fallback would make the report disagree with what the other readers actually do."
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
key: "discipline_profile",
|
|
52
|
+
reader: "work_engine/_lib/agent_settings.ts:1263",
|
|
53
|
+
absentResolvesTo: "essential, unconditionally",
|
|
54
|
+
reason: "The template ships `auto`, which resolves to `off` on any measured-null model, any non-Claude host, and any host exposing no model id. Absent skips that resolution entirely and loads the essential tier everywhere."
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
key: "chat_history.frequency",
|
|
58
|
+
reader: "src/scripts/chat_history.ts:1140",
|
|
59
|
+
absentResolvesTo: "per_phase",
|
|
60
|
+
reason: "Canonical substitution is `per_turn`. Absent gives coarser capture than the shipped default \u2014 an audit-thinning change, which the class contract's own test 8 (what can the attacker HIDE) names as the severe direction."
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
key: "profile.id",
|
|
64
|
+
reader: "src/scripts/config/profiles.ts:221 resolve_profile",
|
|
65
|
+
absentResolvesTo: "the id `developer`, but a DEGRADED profile \u2014 packs: [], personas: [], hints: []",
|
|
66
|
+
reason: "Exactly the projection.mode shape: the template default is honoured only when no settings file exists. With a file present the id resolves but its profile body does not load, so the install silently loses every pack and persona."
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
key: "quality.local_auto_run",
|
|
70
|
+
reader: "src/scripts/lint_roadmap_ci_steps.ts:106",
|
|
71
|
+
absentResolvesTo: "true \u2014 which DISABLES the CI-step gate",
|
|
72
|
+
reason: "Inverted polarity, and the most dangerous row in the set: the template ships `false`, which ARMS the gate. Omitting the key would disarm a quality gate for every fresh install while the reference page says it is on."
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
key: "onboarding.onboarded",
|
|
76
|
+
reader: "src/scripts/onboarding_gate_hook.ts:99",
|
|
77
|
+
absentResolvesTo: "gate skipped, as if onboarding had already completed",
|
|
78
|
+
reason: "Absent behaves like `onboarded: true`, not like the template default `false`. Omitting it would skip the onboarding gate on precisely the fresh installs the gate exists for."
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
key: "chat_history.enabled",
|
|
82
|
+
reader: "src/scripts/chat_history.ts:1025 _read_chat_history_enabled",
|
|
83
|
+
absentResolvesTo: "false",
|
|
84
|
+
reason: "The reader falls back to false while the template ships true. This one is privacy-shaped: fixing the reader would start recording history for every install whose file lacks the key. Writing it explicitly keeps the decision visible in the file the user can read."
|
|
85
|
+
}
|
|
86
|
+
];
|
|
87
|
+
|
|
88
|
+
// src/scripts/_cli/cmd_settings_get.ts
|
|
89
|
+
var PACKAGE_ROOT = resolvePackageRoot(import.meta.url);
|
|
90
|
+
var CONTRACT_RELATIVE = "docs/contracts/settings-classes.md";
|
|
91
|
+
var TEMPLATE_RELATIVE = path.join("src", "config", "agent-settings.template.yml");
|
|
92
|
+
var SECRET_KEY_RE = /(^|\.)(secrets?)(\.|$)|(^|\.)[a-z0-9_]*(api_key|token|password|passwd|secret|credential|private_key|encryption_key)$/i;
|
|
93
|
+
function isSecretKey(key) {
|
|
94
|
+
return SECRET_KEY_RE.test(key);
|
|
95
|
+
}
|
|
96
|
+
function displayValue(key, value) {
|
|
97
|
+
if (value === void 0 || value === null) return value;
|
|
98
|
+
return isSecretKey(key) ? "\xABredacted \u2014 credential-shaped key\xBB" : value;
|
|
99
|
+
}
|
|
100
|
+
function layersFor(key, cwd) {
|
|
101
|
+
const layers = [];
|
|
102
|
+
for (const [dotted, value, file] of iter_setting_overrides({ cwd })) {
|
|
103
|
+
if (dotted === key) layers.push({ value, file });
|
|
104
|
+
}
|
|
105
|
+
return layers;
|
|
106
|
+
}
|
|
107
|
+
function templateDefault(packageRoot, key) {
|
|
108
|
+
let parsed;
|
|
109
|
+
try {
|
|
110
|
+
parsed = load(fs.readFileSync(path.join(packageRoot, TEMPLATE_RELATIVE), "utf-8"));
|
|
111
|
+
} catch {
|
|
112
|
+
return void 0;
|
|
113
|
+
}
|
|
114
|
+
return getSettingsLeaf(parsed, key);
|
|
115
|
+
}
|
|
116
|
+
function carveOutFor(key) {
|
|
117
|
+
return SETTINGS_CARVE_OUT.find((c) => c.key === key);
|
|
118
|
+
}
|
|
119
|
+
function userGlobalDrop(key) {
|
|
120
|
+
const file = resolve_with_fallback(USER_GLOBAL_FILENAME) ?? write_target(USER_GLOBAL_FILENAME);
|
|
121
|
+
if (MERGEABLE_KEYS.includes(key)) return { dropped: false, file };
|
|
122
|
+
let raw;
|
|
123
|
+
try {
|
|
124
|
+
raw = load(fs.readFileSync(file, "utf-8"));
|
|
125
|
+
} catch {
|
|
126
|
+
return { dropped: false, file };
|
|
127
|
+
}
|
|
128
|
+
return { dropped: getSettingsLeaf(raw, key) !== void 0, file };
|
|
129
|
+
}
|
|
130
|
+
function _classFor(packageRoot, key) {
|
|
131
|
+
let text;
|
|
132
|
+
try {
|
|
133
|
+
text = fs.readFileSync(path.join(packageRoot, CONTRACT_RELATIVE), "utf-8");
|
|
134
|
+
} catch {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
return classOfPath(buildSettingsClassIndex(parseSettingsClassRows(text)), key) ?? null;
|
|
138
|
+
}
|
|
139
|
+
function runSettingsGet(opts) {
|
|
140
|
+
const out = [];
|
|
141
|
+
const err = [];
|
|
142
|
+
const merged = load_agent_settings({ cwd: opts.cwd });
|
|
143
|
+
const effective = getSettingsLeaf(merged, opts.key);
|
|
144
|
+
const layers = layersFor(opts.key, opts.cwd);
|
|
145
|
+
const winning = layers.length > 0 ? layers[layers.length - 1] : null;
|
|
146
|
+
const cls = _classFor(opts.packageRoot, opts.key);
|
|
147
|
+
const fallback = templateDefault(opts.packageRoot, opts.key);
|
|
148
|
+
const carveOut = carveOutFor(opts.key);
|
|
149
|
+
const drop = userGlobalDrop(opts.key);
|
|
150
|
+
if (opts.json) {
|
|
151
|
+
out.push(
|
|
152
|
+
JSON.stringify(
|
|
153
|
+
{
|
|
154
|
+
key: opts.key,
|
|
155
|
+
value: displayValue(opts.key, effective) ?? null,
|
|
156
|
+
redacted: isSecretKey(opts.key),
|
|
157
|
+
set: winning !== null,
|
|
158
|
+
source: winning?.file ?? null,
|
|
159
|
+
layers: layers.map((l) => ({ value: displayValue(opts.key, l.value), file: l.file })),
|
|
160
|
+
class: cls,
|
|
161
|
+
template_default: fallback ?? null,
|
|
162
|
+
absent_is_not_default: carveOut ? { resolves_to: carveOut.absentResolvesTo, reader: carveOut.reader } : null,
|
|
163
|
+
user_global_dropped: drop.dropped ? drop.file : null
|
|
164
|
+
},
|
|
165
|
+
null,
|
|
166
|
+
2
|
|
167
|
+
)
|
|
168
|
+
);
|
|
169
|
+
return { code: 0, out, err };
|
|
170
|
+
}
|
|
171
|
+
if (winning !== null) {
|
|
172
|
+
out.push(`${opts.key} = ${JSON.stringify(displayValue(opts.key, effective))}`);
|
|
173
|
+
out.push(` source ${winning.file}`);
|
|
174
|
+
} else {
|
|
175
|
+
out.push(`${opts.key} \u2014 not set in any settings file`);
|
|
176
|
+
out.push(
|
|
177
|
+
` default ${fallback === void 0 ? "(none in the template)" : JSON.stringify(displayValue(opts.key, fallback))}`
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
out.push(` class ${cls ?? "(unclassified \u2014 no row in the class contract)"}`);
|
|
181
|
+
if (layers.length > 1) {
|
|
182
|
+
out.push(" layers (cascade order, last wins)");
|
|
183
|
+
for (const layer of layers) {
|
|
184
|
+
out.push(` ${JSON.stringify(displayValue(opts.key, layer.value))} \u2190 ${layer.file}`);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
if (winning === null && carveOut !== void 0) {
|
|
188
|
+
out.push(
|
|
189
|
+
"",
|
|
190
|
+
"\u26A0\uFE0F Absent is NOT the template default for this key.",
|
|
191
|
+
` A reader resolves the absent key to: ${carveOut.absentResolvesTo}`,
|
|
192
|
+
` Reader: ${carveOut.reader}`,
|
|
193
|
+
' So "not set" and "set to the default" behave differently here.'
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
if (drop.dropped) {
|
|
197
|
+
out.push(
|
|
198
|
+
"",
|
|
199
|
+
"\u26A0\uFE0F This key IS present in your user-global file and is being discarded.",
|
|
200
|
+
` File: ${drop.file}`,
|
|
201
|
+
" Only the keys on the MERGEABLE_KEYS whitelist cascade from user-global into",
|
|
202
|
+
" a project; everything else is filtered out silently by load_agent_settings.",
|
|
203
|
+
" Set it in the project settings file, or the value has no effect anywhere."
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
return { code: 0, out, err };
|
|
207
|
+
}
|
|
208
|
+
function parseArgv(argv) {
|
|
209
|
+
const positional = [];
|
|
210
|
+
let json = false;
|
|
211
|
+
for (const a of argv) {
|
|
212
|
+
if (a === "--json") {
|
|
213
|
+
json = true;
|
|
214
|
+
} else if (a === "-h" || a === "--help") {
|
|
215
|
+
return { ok: false, message: "usage: agent-config settings:get <key> [--json]" };
|
|
216
|
+
} else if (a.startsWith("--")) {
|
|
217
|
+
return { ok: false, message: `unknown flag: ${a}` };
|
|
218
|
+
} else {
|
|
219
|
+
positional.push(a);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if (positional.length !== 1) {
|
|
223
|
+
return { ok: false, message: "usage: agent-config settings:get <key> [--json]" };
|
|
224
|
+
}
|
|
225
|
+
return { ok: true, key: positional[0], json };
|
|
226
|
+
}
|
|
227
|
+
function main(argv = process.argv.slice(2)) {
|
|
228
|
+
const parsed = parseArgv(argv);
|
|
229
|
+
if (!parsed.ok) {
|
|
230
|
+
process.stderr.write(`${parsed.message ?? "usage error"}
|
|
231
|
+
`);
|
|
232
|
+
return 2;
|
|
233
|
+
}
|
|
234
|
+
const result = runSettingsGet({
|
|
235
|
+
key: parsed.key,
|
|
236
|
+
cwd: process.cwd(),
|
|
237
|
+
packageRoot: PACKAGE_ROOT,
|
|
238
|
+
json: parsed.json === true
|
|
239
|
+
});
|
|
240
|
+
for (const line of result.out) process.stdout.write(`${line}
|
|
241
|
+
`);
|
|
242
|
+
for (const line of result.err) process.stderr.write(`${line}
|
|
243
|
+
`);
|
|
244
|
+
return result.code;
|
|
245
|
+
}
|
|
246
|
+
function _isCliEntry() {
|
|
247
|
+
if (process.argv[1] === void 0) return false;
|
|
248
|
+
const argvUrl = pathToFileURL(path.resolve(process.argv[1])).href;
|
|
249
|
+
if (import.meta.url === argvUrl) return true;
|
|
250
|
+
try {
|
|
251
|
+
return fs.realpathSync(fileURLToPath(import.meta.url)) === fs.realpathSync(path.resolve(process.argv[1]));
|
|
252
|
+
} catch {
|
|
253
|
+
return false;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
if (_isCliEntry()) {
|
|
257
|
+
process.exitCode = main();
|
|
258
|
+
}
|
|
259
|
+
export {
|
|
260
|
+
CONTRACT_RELATIVE,
|
|
261
|
+
PACKAGE_ROOT,
|
|
262
|
+
TEMPLATE_RELATIVE,
|
|
263
|
+
carveOutFor,
|
|
264
|
+
displayValue,
|
|
265
|
+
isSecretKey,
|
|
266
|
+
layersFor,
|
|
267
|
+
main,
|
|
268
|
+
parseArgv,
|
|
269
|
+
runSettingsGet,
|
|
270
|
+
templateDefault,
|
|
271
|
+
userGlobalDrop
|
|
272
|
+
};
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
GLOBAL_AGENT_SETTINGS_PATH,
|
|
4
4
|
GLOBAL_USER_SETTINGS_PATH,
|
|
5
5
|
SETTINGS_FILE
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PQSAQKHW.js";
|
|
7
7
|
import "./chunk-DVRS2KVR.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-JXARCGVN.js";
|
|
9
9
|
import "./chunk-BKO2AZ7Z.js";
|
|
10
10
|
import "./chunk-63WSP6YZ.js";
|
|
11
11
|
import "./chunk-GRRPEPRN.js";
|
|
12
12
|
import "./chunk-NXFWFAYV.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-MCJYCQPF.js";
|
|
15
|
-
import "./chunk-HJ6DAJHR.js";
|
|
13
|
+
import "./chunk-GB2FSUEE.js";
|
|
16
14
|
import "./chunk-NDJLNC6Q.js";
|
|
15
|
+
import "./chunk-523HCFYO.js";
|
|
17
16
|
import "./chunk-OY53J6II.js";
|
|
17
|
+
import "./chunk-MCJYCQPF.js";
|
|
18
18
|
import "./chunk-J55WI3RR.js";
|
|
19
19
|
|
|
20
20
|
// src/scripts/_cli/cmd_settings_migrate.ts
|