@event4u/agent-config 9.10.0 → 9.11.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 +59 -0
- package/README.md +12 -15
- package/agents/templates/.ai-council.yml.example +481 -0
- package/agents/templates/.ai-video.xml.example +247 -0
- package/dist/agent-src/rules/design-fidelity.md +1 -1
- package/dist/agent-src/skills/existing-ui-audit/SKILL.md +15 -2
- package/dist/agent-src/skills/fe-design/SKILL.md +10 -0
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +30 -30
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/design.ts +88 -33
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +20 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/review.ts +20 -1
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +179 -0
- package/dist/agent-src/templates/scripts/work_engine/stack/detect.ts +155 -4
- package/dist/agent-src/templates/scripts/work_engine/state.ts +21 -4
- package/dist/cli/initRouting.js +74 -11
- package/dist/cli/initRouting.js.map +1 -1
- package/dist/cli/main.js +14 -3
- package/dist/cli/main.js.map +1 -1
- package/dist/cli-delegate/chunk-4SV3XGFA.js +6910 -0
- package/dist/cli-delegate/chunk-736JCWLM.js +1104 -0
- package/dist/cli-delegate/chunk-7DSAMZFU.js +356 -0
- package/dist/cli-delegate/chunk-7HQ52DHU.js +74 -0
- package/dist/cli-delegate/chunk-BJGXZNPM.js +266 -0
- package/dist/cli-delegate/chunk-FTAISGDQ.js +117 -0
- package/dist/cli-delegate/chunk-GME3Q44L.js +82 -0
- package/dist/cli-delegate/chunk-GRRPEPRN.js +336 -0
- package/dist/cli-delegate/chunk-HJ6DAJHR.js +502 -0
- package/dist/cli-delegate/chunk-IR7P7JWA.js +872 -0
- package/dist/cli-delegate/chunk-J55WI3RR.js +47 -0
- package/dist/cli-delegate/chunk-MCJYCQPF.js +35 -0
- package/dist/cli-delegate/chunk-NDJLNC6Q.js +169 -0
- package/dist/cli-delegate/chunk-OMIVVCG2.js +26 -0
- package/dist/cli-delegate/chunk-OY53J6II.js +7336 -0
- package/dist/cli-delegate/chunk-RDGRHAAB.js +259 -0
- package/dist/cli-delegate/chunk-TFG57JJM.js +1969 -0
- package/dist/cli-delegate/chunk-XX6TOPD7.js +715 -0
- package/dist/cli-delegate/chunk-YMFO6FDN.js +10603 -0
- package/dist/cli-delegate/cmd_analyze_session.js +294 -0
- package/dist/cli-delegate/cmd_conformance.js +646 -0
- package/dist/cli-delegate/cmd_converge.js +326 -0
- package/dist/cli-delegate/cmd_doctor.js +144 -0
- package/dist/cli-delegate/cmd_explain.js +2508 -0
- package/dist/cli-delegate/cmd_export.js +296 -0
- package/dist/cli-delegate/cmd_fleet.js +332 -0
- package/dist/cli-delegate/cmd_memory_get.js +3878 -0
- package/dist/cli-delegate/cmd_migrate.js +11 -0
- package/dist/cli-delegate/cmd_preflight.js +270 -0
- package/dist/cli-delegate/cmd_prune.js +444 -0
- package/dist/cli-delegate/cmd_refresh.js +28 -0
- package/dist/cli-delegate/cmd_settings_check.js +574 -0
- package/dist/cli-delegate/cmd_settings_migrate.js +223 -0
- package/dist/cli-delegate/cmd_sync.js +264 -0
- package/dist/cli-delegate/cmd_uninstall.js +656 -0
- package/dist/cli-delegate/cmd_update.js +425 -0
- package/dist/cli-delegate/cmd_upgrade.js +444 -0
- package/dist/cli-delegate/cmd_validate.js +305 -0
- package/dist/cli-delegate/cmd_versions.js +370 -0
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +14 -7
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +2 -2
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +12 -7
- package/dist/discovery/trust-report.md +1 -1
- package/dist/discovery/workspaces.json +4 -3
- package/dist/install/emit_host_rules_cli.js +2 -1
- package/dist/install/emit_host_rules_cli.js.map +1 -1
- package/dist/install/install.mjs +410 -378
- package/dist/install/rule_scope.js +5 -1
- package/dist/install/rule_scope.js.map +1 -1
- package/dist/install/toolDetection.js +40 -12
- package/dist/install/toolDetection.js.map +1 -1
- package/dist/install/wizard-plan.js +2 -2
- package/dist/install/wizard-plan.js.map +1 -1
- package/dist/mcp/registry-manifest.json +1 -1
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +1614 -765
- package/dist/router.json +1 -1
- package/package.json +4 -2
- package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +30 -30
- package/src/agent-src/templates/scripts/work_engine/directives/ui/design.ts +88 -33
- package/src/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +20 -0
- package/src/agent-src/templates/scripts/work_engine/directives/ui/review.ts +20 -1
- package/src/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +179 -0
- package/src/agent-src/templates/scripts/work_engine/stack/detect.ts +155 -4
- package/src/agent-src/templates/scripts/work_engine/state.ts +21 -4
- package/src/config/discovery/packs.yml +7 -0
- package/src/config/evaluator-budgets.json +1 -1
- package/src/config/pack-size-budget.json +27 -0
- package/src/install/emit_host_rules_cli.ts +2 -1
- package/src/install/rule_scope.ts +5 -1
- package/src/install/toolDetection.ts +39 -8
- package/src/install/wizard-plan.ts +2 -2
- package/src/scripts/_cli/cmd_conformance.ts +2 -1
- package/src/scripts/_cli/cmd_converge.ts +2 -1
- package/src/scripts/_cli/cmd_doctor.ts +214 -13
- package/src/scripts/_cli/cmd_export.ts +2 -1
- package/src/scripts/_cli/cmd_fleet.ts +2 -1
- package/src/scripts/_cli/cmd_migrate.ts +2 -1
- package/src/scripts/_cli/cmd_preflight.ts +2 -1
- package/src/scripts/_cli/cmd_refresh.ts +2 -1
- package/src/scripts/_cli/cmd_update.ts +2 -1
- package/src/scripts/_cli/cmd_upgrade.ts +2 -1
- package/src/scripts/_cli/cmd_versions.ts +2 -1
- package/src/scripts/_cli/detection_report.ts +480 -0
- package/src/scripts/_dispatch.bash +52 -14
- package/src/scripts/_lib/changelog_eras.ts +103 -9
- package/src/scripts/_lib/environment_detector.ts +441 -0
- package/src/scripts/_lib/package_root.ts +72 -0
- package/src/scripts/ai_council/config.ts +15 -7
- package/src/scripts/ai_council/modes.ts +68 -2
- package/src/scripts/ai_council/transport_resolver.ts +331 -0
- package/src/scripts/check_bundle_path_leakage.ts +10 -4
- package/src/scripts/check_dependency_floors.ts +153 -0
- package/src/scripts/check_pack_size.ts +188 -0
- package/src/scripts/council_cli.ts +6 -2
- package/src/scripts/evaluator_umbrella.sh +34 -1
- package/src/scripts/lint_eval_fixture_citations.ts +113 -0
- package/src/scripts/lint_ui_stack_bundles.ts +170 -0
package/dist/install/install.mjs
CHANGED
|
@@ -117,17 +117,17 @@ var require_visit = __commonJS({
|
|
|
117
117
|
visit.BREAK = BREAK;
|
|
118
118
|
visit.SKIP = SKIP;
|
|
119
119
|
visit.REMOVE = REMOVE;
|
|
120
|
-
function visit_(key, node, visitor,
|
|
121
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
120
|
+
function visit_(key, node, visitor, path14) {
|
|
121
|
+
const ctrl = callVisitor(key, node, visitor, path14);
|
|
122
122
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
123
|
-
replaceNode(key,
|
|
124
|
-
return visit_(key, ctrl, visitor,
|
|
123
|
+
replaceNode(key, path14, ctrl);
|
|
124
|
+
return visit_(key, ctrl, visitor, path14);
|
|
125
125
|
}
|
|
126
126
|
if (typeof ctrl !== "symbol") {
|
|
127
127
|
if (identity.isCollection(node)) {
|
|
128
|
-
|
|
128
|
+
path14 = Object.freeze(path14.concat(node));
|
|
129
129
|
for (let i = 0; i < node.items.length; ++i) {
|
|
130
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
130
|
+
const ci = visit_(i, node.items[i], visitor, path14);
|
|
131
131
|
if (typeof ci === "number")
|
|
132
132
|
i = ci - 1;
|
|
133
133
|
else if (ci === BREAK)
|
|
@@ -138,13 +138,13 @@ var require_visit = __commonJS({
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
} else if (identity.isPair(node)) {
|
|
141
|
-
|
|
142
|
-
const ck = visit_("key", node.key, visitor,
|
|
141
|
+
path14 = Object.freeze(path14.concat(node));
|
|
142
|
+
const ck = visit_("key", node.key, visitor, path14);
|
|
143
143
|
if (ck === BREAK)
|
|
144
144
|
return BREAK;
|
|
145
145
|
else if (ck === REMOVE)
|
|
146
146
|
node.key = null;
|
|
147
|
-
const cv = visit_("value", node.value, visitor,
|
|
147
|
+
const cv = visit_("value", node.value, visitor, path14);
|
|
148
148
|
if (cv === BREAK)
|
|
149
149
|
return BREAK;
|
|
150
150
|
else if (cv === REMOVE)
|
|
@@ -165,17 +165,17 @@ var require_visit = __commonJS({
|
|
|
165
165
|
visitAsync.BREAK = BREAK;
|
|
166
166
|
visitAsync.SKIP = SKIP;
|
|
167
167
|
visitAsync.REMOVE = REMOVE;
|
|
168
|
-
async function visitAsync_(key, node, visitor,
|
|
169
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
168
|
+
async function visitAsync_(key, node, visitor, path14) {
|
|
169
|
+
const ctrl = await callVisitor(key, node, visitor, path14);
|
|
170
170
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
171
|
-
replaceNode(key,
|
|
172
|
-
return visitAsync_(key, ctrl, visitor,
|
|
171
|
+
replaceNode(key, path14, ctrl);
|
|
172
|
+
return visitAsync_(key, ctrl, visitor, path14);
|
|
173
173
|
}
|
|
174
174
|
if (typeof ctrl !== "symbol") {
|
|
175
175
|
if (identity.isCollection(node)) {
|
|
176
|
-
|
|
176
|
+
path14 = Object.freeze(path14.concat(node));
|
|
177
177
|
for (let i = 0; i < node.items.length; ++i) {
|
|
178
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
178
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path14);
|
|
179
179
|
if (typeof ci === "number")
|
|
180
180
|
i = ci - 1;
|
|
181
181
|
else if (ci === BREAK)
|
|
@@ -186,13 +186,13 @@ var require_visit = __commonJS({
|
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
} else if (identity.isPair(node)) {
|
|
189
|
-
|
|
190
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
189
|
+
path14 = Object.freeze(path14.concat(node));
|
|
190
|
+
const ck = await visitAsync_("key", node.key, visitor, path14);
|
|
191
191
|
if (ck === BREAK)
|
|
192
192
|
return BREAK;
|
|
193
193
|
else if (ck === REMOVE)
|
|
194
194
|
node.key = null;
|
|
195
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
195
|
+
const cv = await visitAsync_("value", node.value, visitor, path14);
|
|
196
196
|
if (cv === BREAK)
|
|
197
197
|
return BREAK;
|
|
198
198
|
else if (cv === REMOVE)
|
|
@@ -219,23 +219,23 @@ var require_visit = __commonJS({
|
|
|
219
219
|
}
|
|
220
220
|
return visitor;
|
|
221
221
|
}
|
|
222
|
-
function callVisitor(key, node, visitor,
|
|
222
|
+
function callVisitor(key, node, visitor, path14) {
|
|
223
223
|
if (typeof visitor === "function")
|
|
224
|
-
return visitor(key, node,
|
|
224
|
+
return visitor(key, node, path14);
|
|
225
225
|
if (identity.isMap(node))
|
|
226
|
-
return visitor.Map?.(key, node,
|
|
226
|
+
return visitor.Map?.(key, node, path14);
|
|
227
227
|
if (identity.isSeq(node))
|
|
228
|
-
return visitor.Seq?.(key, node,
|
|
228
|
+
return visitor.Seq?.(key, node, path14);
|
|
229
229
|
if (identity.isPair(node))
|
|
230
|
-
return visitor.Pair?.(key, node,
|
|
230
|
+
return visitor.Pair?.(key, node, path14);
|
|
231
231
|
if (identity.isScalar(node))
|
|
232
|
-
return visitor.Scalar?.(key, node,
|
|
232
|
+
return visitor.Scalar?.(key, node, path14);
|
|
233
233
|
if (identity.isAlias(node))
|
|
234
|
-
return visitor.Alias?.(key, node,
|
|
234
|
+
return visitor.Alias?.(key, node, path14);
|
|
235
235
|
return void 0;
|
|
236
236
|
}
|
|
237
|
-
function replaceNode(key,
|
|
238
|
-
const parent =
|
|
237
|
+
function replaceNode(key, path14, node) {
|
|
238
|
+
const parent = path14[path14.length - 1];
|
|
239
239
|
if (identity.isCollection(parent)) {
|
|
240
240
|
parent.items[key] = node;
|
|
241
241
|
} else if (identity.isPair(parent)) {
|
|
@@ -845,10 +845,10 @@ var require_Collection = __commonJS({
|
|
|
845
845
|
var createNode = require_createNode();
|
|
846
846
|
var identity = require_identity();
|
|
847
847
|
var Node = require_Node();
|
|
848
|
-
function collectionFromPath(schema,
|
|
848
|
+
function collectionFromPath(schema, path14, value) {
|
|
849
849
|
let v = value;
|
|
850
|
-
for (let i =
|
|
851
|
-
const k =
|
|
850
|
+
for (let i = path14.length - 1; i >= 0; --i) {
|
|
851
|
+
const k = path14[i];
|
|
852
852
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
853
853
|
const a = [];
|
|
854
854
|
a[k] = v;
|
|
@@ -867,7 +867,7 @@ var require_Collection = __commonJS({
|
|
|
867
867
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
868
868
|
});
|
|
869
869
|
}
|
|
870
|
-
var isEmptyPath = (
|
|
870
|
+
var isEmptyPath = (path14) => path14 == null || typeof path14 === "object" && !!path14[Symbol.iterator]().next().done;
|
|
871
871
|
var Collection = class extends Node.NodeBase {
|
|
872
872
|
constructor(type, schema) {
|
|
873
873
|
super(type);
|
|
@@ -897,11 +897,11 @@ var require_Collection = __commonJS({
|
|
|
897
897
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
898
898
|
* that already exists in the map.
|
|
899
899
|
*/
|
|
900
|
-
addIn(
|
|
901
|
-
if (isEmptyPath(
|
|
900
|
+
addIn(path14, value) {
|
|
901
|
+
if (isEmptyPath(path14))
|
|
902
902
|
this.add(value);
|
|
903
903
|
else {
|
|
904
|
-
const [key, ...rest] =
|
|
904
|
+
const [key, ...rest] = path14;
|
|
905
905
|
const node = this.get(key, true);
|
|
906
906
|
if (identity.isCollection(node))
|
|
907
907
|
node.addIn(rest, value);
|
|
@@ -915,8 +915,8 @@ var require_Collection = __commonJS({
|
|
|
915
915
|
* Removes a value from the collection.
|
|
916
916
|
* @returns `true` if the item was found and removed.
|
|
917
917
|
*/
|
|
918
|
-
deleteIn(
|
|
919
|
-
const [key, ...rest] =
|
|
918
|
+
deleteIn(path14) {
|
|
919
|
+
const [key, ...rest] = path14;
|
|
920
920
|
if (rest.length === 0)
|
|
921
921
|
return this.delete(key);
|
|
922
922
|
const node = this.get(key, true);
|
|
@@ -930,8 +930,8 @@ var require_Collection = __commonJS({
|
|
|
930
930
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
931
931
|
* `true` (collections are always returned intact).
|
|
932
932
|
*/
|
|
933
|
-
getIn(
|
|
934
|
-
const [key, ...rest] =
|
|
933
|
+
getIn(path14, keepScalar) {
|
|
934
|
+
const [key, ...rest] = path14;
|
|
935
935
|
const node = this.get(key, true);
|
|
936
936
|
if (rest.length === 0)
|
|
937
937
|
return !keepScalar && identity.isScalar(node) ? node.value : node;
|
|
@@ -949,8 +949,8 @@ var require_Collection = __commonJS({
|
|
|
949
949
|
/**
|
|
950
950
|
* Checks if the collection includes a value with the key `key`.
|
|
951
951
|
*/
|
|
952
|
-
hasIn(
|
|
953
|
-
const [key, ...rest] =
|
|
952
|
+
hasIn(path14) {
|
|
953
|
+
const [key, ...rest] = path14;
|
|
954
954
|
if (rest.length === 0)
|
|
955
955
|
return this.has(key);
|
|
956
956
|
const node = this.get(key, true);
|
|
@@ -960,8 +960,8 @@ var require_Collection = __commonJS({
|
|
|
960
960
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
961
961
|
* boolean to add/remove the item from the set.
|
|
962
962
|
*/
|
|
963
|
-
setIn(
|
|
964
|
-
const [key, ...rest] =
|
|
963
|
+
setIn(path14, value) {
|
|
964
|
+
const [key, ...rest] = path14;
|
|
965
965
|
if (rest.length === 0) {
|
|
966
966
|
this.set(key, value);
|
|
967
967
|
} else {
|
|
@@ -3476,9 +3476,9 @@ var require_Document = __commonJS({
|
|
|
3476
3476
|
this.contents.add(value);
|
|
3477
3477
|
}
|
|
3478
3478
|
/** Adds a value to the document. */
|
|
3479
|
-
addIn(
|
|
3479
|
+
addIn(path14, value) {
|
|
3480
3480
|
if (assertCollection(this.contents))
|
|
3481
|
-
this.contents.addIn(
|
|
3481
|
+
this.contents.addIn(path14, value);
|
|
3482
3482
|
}
|
|
3483
3483
|
/**
|
|
3484
3484
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -3553,14 +3553,14 @@ var require_Document = __commonJS({
|
|
|
3553
3553
|
* Removes a value from the document.
|
|
3554
3554
|
* @returns `true` if the item was found and removed.
|
|
3555
3555
|
*/
|
|
3556
|
-
deleteIn(
|
|
3557
|
-
if (Collection.isEmptyPath(
|
|
3556
|
+
deleteIn(path14) {
|
|
3557
|
+
if (Collection.isEmptyPath(path14)) {
|
|
3558
3558
|
if (this.contents == null)
|
|
3559
3559
|
return false;
|
|
3560
3560
|
this.contents = null;
|
|
3561
3561
|
return true;
|
|
3562
3562
|
}
|
|
3563
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
3563
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path14) : false;
|
|
3564
3564
|
}
|
|
3565
3565
|
/**
|
|
3566
3566
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -3575,10 +3575,10 @@ var require_Document = __commonJS({
|
|
|
3575
3575
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
3576
3576
|
* `true` (collections are always returned intact).
|
|
3577
3577
|
*/
|
|
3578
|
-
getIn(
|
|
3579
|
-
if (Collection.isEmptyPath(
|
|
3578
|
+
getIn(path14, keepScalar) {
|
|
3579
|
+
if (Collection.isEmptyPath(path14))
|
|
3580
3580
|
return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
3581
|
-
return identity.isCollection(this.contents) ? this.contents.getIn(
|
|
3581
|
+
return identity.isCollection(this.contents) ? this.contents.getIn(path14, keepScalar) : void 0;
|
|
3582
3582
|
}
|
|
3583
3583
|
/**
|
|
3584
3584
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -3589,10 +3589,10 @@ var require_Document = __commonJS({
|
|
|
3589
3589
|
/**
|
|
3590
3590
|
* Checks if the document includes a value at `path`.
|
|
3591
3591
|
*/
|
|
3592
|
-
hasIn(
|
|
3593
|
-
if (Collection.isEmptyPath(
|
|
3592
|
+
hasIn(path14) {
|
|
3593
|
+
if (Collection.isEmptyPath(path14))
|
|
3594
3594
|
return this.contents !== void 0;
|
|
3595
|
-
return identity.isCollection(this.contents) ? this.contents.hasIn(
|
|
3595
|
+
return identity.isCollection(this.contents) ? this.contents.hasIn(path14) : false;
|
|
3596
3596
|
}
|
|
3597
3597
|
/**
|
|
3598
3598
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -3609,13 +3609,13 @@ var require_Document = __commonJS({
|
|
|
3609
3609
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
3610
3610
|
* boolean to add/remove the item from the set.
|
|
3611
3611
|
*/
|
|
3612
|
-
setIn(
|
|
3613
|
-
if (Collection.isEmptyPath(
|
|
3612
|
+
setIn(path14, value) {
|
|
3613
|
+
if (Collection.isEmptyPath(path14)) {
|
|
3614
3614
|
this.contents = value;
|
|
3615
3615
|
} else if (this.contents == null) {
|
|
3616
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
3616
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path14), value);
|
|
3617
3617
|
} else if (assertCollection(this.contents)) {
|
|
3618
|
-
this.contents.setIn(
|
|
3618
|
+
this.contents.setIn(path14, value);
|
|
3619
3619
|
}
|
|
3620
3620
|
}
|
|
3621
3621
|
/**
|
|
@@ -5575,9 +5575,9 @@ var require_cst_visit = __commonJS({
|
|
|
5575
5575
|
visit.BREAK = BREAK;
|
|
5576
5576
|
visit.SKIP = SKIP;
|
|
5577
5577
|
visit.REMOVE = REMOVE;
|
|
5578
|
-
visit.itemAtPath = (cst,
|
|
5578
|
+
visit.itemAtPath = (cst, path14) => {
|
|
5579
5579
|
let item = cst;
|
|
5580
|
-
for (const [field, index] of
|
|
5580
|
+
for (const [field, index] of path14) {
|
|
5581
5581
|
const tok = item?.[field];
|
|
5582
5582
|
if (tok && "items" in tok) {
|
|
5583
5583
|
item = tok.items[index];
|
|
@@ -5586,23 +5586,23 @@ var require_cst_visit = __commonJS({
|
|
|
5586
5586
|
}
|
|
5587
5587
|
return item;
|
|
5588
5588
|
};
|
|
5589
|
-
visit.parentCollection = (cst,
|
|
5590
|
-
const parent = visit.itemAtPath(cst,
|
|
5591
|
-
const field =
|
|
5589
|
+
visit.parentCollection = (cst, path14) => {
|
|
5590
|
+
const parent = visit.itemAtPath(cst, path14.slice(0, -1));
|
|
5591
|
+
const field = path14[path14.length - 1][0];
|
|
5592
5592
|
const coll = parent?.[field];
|
|
5593
5593
|
if (coll && "items" in coll)
|
|
5594
5594
|
return coll;
|
|
5595
5595
|
throw new Error("Parent collection not found");
|
|
5596
5596
|
};
|
|
5597
|
-
function _visit(
|
|
5598
|
-
let ctrl = visitor(item,
|
|
5597
|
+
function _visit(path14, item, visitor) {
|
|
5598
|
+
let ctrl = visitor(item, path14);
|
|
5599
5599
|
if (typeof ctrl === "symbol")
|
|
5600
5600
|
return ctrl;
|
|
5601
5601
|
for (const field of ["key", "value"]) {
|
|
5602
5602
|
const token = item[field];
|
|
5603
5603
|
if (token && "items" in token) {
|
|
5604
5604
|
for (let i = 0; i < token.items.length; ++i) {
|
|
5605
|
-
const ci = _visit(Object.freeze(
|
|
5605
|
+
const ci = _visit(Object.freeze(path14.concat([[field, i]])), token.items[i], visitor);
|
|
5606
5606
|
if (typeof ci === "number")
|
|
5607
5607
|
i = ci - 1;
|
|
5608
5608
|
else if (ci === BREAK)
|
|
@@ -5613,10 +5613,10 @@ var require_cst_visit = __commonJS({
|
|
|
5613
5613
|
}
|
|
5614
5614
|
}
|
|
5615
5615
|
if (typeof ctrl === "function" && field === "key")
|
|
5616
|
-
ctrl = ctrl(item,
|
|
5616
|
+
ctrl = ctrl(item, path14);
|
|
5617
5617
|
}
|
|
5618
5618
|
}
|
|
5619
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
5619
|
+
return typeof ctrl === "function" ? ctrl(item, path14) : ctrl;
|
|
5620
5620
|
}
|
|
5621
5621
|
exports.visit = visit;
|
|
5622
5622
|
}
|
|
@@ -6918,14 +6918,14 @@ var require_parser = __commonJS({
|
|
|
6918
6918
|
case "scalar":
|
|
6919
6919
|
case "single-quoted-scalar":
|
|
6920
6920
|
case "double-quoted-scalar": {
|
|
6921
|
-
const
|
|
6921
|
+
const fs16 = this.flowScalar(this.type);
|
|
6922
6922
|
if (atNextItem || it.value) {
|
|
6923
|
-
map.items.push({ start, key:
|
|
6923
|
+
map.items.push({ start, key: fs16, sep: [] });
|
|
6924
6924
|
this.onKeyLine = true;
|
|
6925
6925
|
} else if (it.sep) {
|
|
6926
|
-
this.stack.push(
|
|
6926
|
+
this.stack.push(fs16);
|
|
6927
6927
|
} else {
|
|
6928
|
-
Object.assign(it, { key:
|
|
6928
|
+
Object.assign(it, { key: fs16, sep: [] });
|
|
6929
6929
|
this.onKeyLine = true;
|
|
6930
6930
|
}
|
|
6931
6931
|
return;
|
|
@@ -7053,13 +7053,13 @@ var require_parser = __commonJS({
|
|
|
7053
7053
|
case "scalar":
|
|
7054
7054
|
case "single-quoted-scalar":
|
|
7055
7055
|
case "double-quoted-scalar": {
|
|
7056
|
-
const
|
|
7056
|
+
const fs16 = this.flowScalar(this.type);
|
|
7057
7057
|
if (!it || it.value)
|
|
7058
|
-
fc.items.push({ start: [], key:
|
|
7058
|
+
fc.items.push({ start: [], key: fs16, sep: [] });
|
|
7059
7059
|
else if (it.sep)
|
|
7060
|
-
this.stack.push(
|
|
7060
|
+
this.stack.push(fs16);
|
|
7061
7061
|
else
|
|
7062
|
-
Object.assign(it, { key:
|
|
7062
|
+
Object.assign(it, { key: fs16, sep: [] });
|
|
7063
7063
|
return;
|
|
7064
7064
|
}
|
|
7065
7065
|
case "flow-map-end":
|
|
@@ -7370,11 +7370,11 @@ var require_dist = __commonJS({
|
|
|
7370
7370
|
// src/scripts/install.ts
|
|
7371
7371
|
import { spawn, spawnSync as spawnSync2 } from "node:child_process";
|
|
7372
7372
|
import * as crypto3 from "node:crypto";
|
|
7373
|
-
import * as
|
|
7373
|
+
import * as fs15 from "node:fs";
|
|
7374
7374
|
import * as os7 from "node:os";
|
|
7375
|
-
import * as
|
|
7375
|
+
import * as path13 from "node:path";
|
|
7376
7376
|
import process3 from "node:process";
|
|
7377
|
-
import { fileURLToPath as
|
|
7377
|
+
import { fileURLToPath as fileURLToPath4, pathToFileURL as pathToFileURL2 } from "node:url";
|
|
7378
7378
|
|
|
7379
7379
|
// src/scripts/_lib/json_pointers.ts
|
|
7380
7380
|
import { createHash } from "node:crypto";
|
|
@@ -7872,8 +7872,8 @@ function lockfile_write_path(env) {
|
|
|
7872
7872
|
}
|
|
7873
7873
|
return write_target("installed.lock", { env: env ?? null });
|
|
7874
7874
|
}
|
|
7875
|
-
function read_lockfile(
|
|
7876
|
-
const target =
|
|
7875
|
+
function read_lockfile(path14) {
|
|
7876
|
+
const target = path14 ?? lockfile_path();
|
|
7877
7877
|
let text;
|
|
7878
7878
|
try {
|
|
7879
7879
|
text = fs2.readFileSync(target, { encoding: "utf-8" });
|
|
@@ -8741,18 +8741,18 @@ function manifest_path(project_root, env) {
|
|
|
8741
8741
|
var _TOP_KEY_RE = /^([A-Za-z_][A-Za-z0-9_]*)\s*:\s*"?([^"\n]*?)"?\s*$/;
|
|
8742
8742
|
var _LIST_DASH_RE = /^\s*-\s*(.+?)\s*$/;
|
|
8743
8743
|
var _INDENT_KEY_RE = /^\s+([A-Za-z_][A-Za-z0-9_]*)\s*:\s*"?([^"\n]*?)"?\s*$/;
|
|
8744
|
-
function read_manifest(
|
|
8744
|
+
function read_manifest(path14) {
|
|
8745
8745
|
let text;
|
|
8746
8746
|
try {
|
|
8747
|
-
text = require_read_text(
|
|
8747
|
+
text = require_read_text(path14);
|
|
8748
8748
|
} catch {
|
|
8749
8749
|
return null;
|
|
8750
8750
|
}
|
|
8751
8751
|
const data = _parse_manual(text);
|
|
8752
8752
|
return _normalise_v2_shape(data);
|
|
8753
8753
|
}
|
|
8754
|
-
function require_read_text(
|
|
8755
|
-
return fs6.readFileSync(
|
|
8754
|
+
function require_read_text(path14) {
|
|
8755
|
+
return fs6.readFileSync(path14, { encoding: "utf-8" });
|
|
8756
8756
|
}
|
|
8757
8757
|
function _normalise_v2_shape(data) {
|
|
8758
8758
|
if (data["tools"] === void 0 || data["tools"] === null) {
|
|
@@ -8933,9 +8933,9 @@ function stable_sort(items, key) {
|
|
|
8933
8933
|
return a.index - b.index;
|
|
8934
8934
|
}).map((entry) => entry.item);
|
|
8935
8935
|
}
|
|
8936
|
-
function write_manifest(
|
|
8936
|
+
function write_manifest(path14, version, tools, options = {}) {
|
|
8937
8937
|
const rendered = _render2(version, tools, { deploy_roots: options.deploy_roots ?? null });
|
|
8938
|
-
return write_atomic(
|
|
8938
|
+
return write_atomic(path14, rendered);
|
|
8939
8939
|
}
|
|
8940
8940
|
var ScopeMismatchError = class extends Error {
|
|
8941
8941
|
name_;
|
|
@@ -10529,8 +10529,8 @@ function getErrorMap() {
|
|
|
10529
10529
|
|
|
10530
10530
|
// node_modules/zod/v3/helpers/parseUtil.js
|
|
10531
10531
|
var makeIssue = (params) => {
|
|
10532
|
-
const { data, path:
|
|
10533
|
-
const fullPath = [...
|
|
10532
|
+
const { data, path: path14, errorMaps, issueData } = params;
|
|
10533
|
+
const fullPath = [...path14, ...issueData.path || []];
|
|
10534
10534
|
const fullIssue = {
|
|
10535
10535
|
...issueData,
|
|
10536
10536
|
path: fullPath
|
|
@@ -10646,11 +10646,11 @@ var errorUtil;
|
|
|
10646
10646
|
|
|
10647
10647
|
// node_modules/zod/v3/types.js
|
|
10648
10648
|
var ParseInputLazyPath = class {
|
|
10649
|
-
constructor(parent, value,
|
|
10649
|
+
constructor(parent, value, path14, key) {
|
|
10650
10650
|
this._cachedPath = [];
|
|
10651
10651
|
this.parent = parent;
|
|
10652
10652
|
this.data = value;
|
|
10653
|
-
this._path =
|
|
10653
|
+
this._path = path14;
|
|
10654
10654
|
this._key = key;
|
|
10655
10655
|
}
|
|
10656
10656
|
get path() {
|
|
@@ -16008,10 +16008,42 @@ function render_native_model_md(text, tier) {
|
|
|
16008
16008
|
|
|
16009
16009
|
// src/scripts/_cli/cmd_migrate.ts
|
|
16010
16010
|
import { spawnSync } from "node:child_process";
|
|
16011
|
+
import * as fs14 from "node:fs";
|
|
16012
|
+
import * as path12 from "node:path";
|
|
16013
|
+
import process2 from "node:process";
|
|
16014
|
+
import { fileURLToPath as fileURLToPath3, pathToFileURL } from "node:url";
|
|
16015
|
+
|
|
16016
|
+
// src/scripts/_lib/package_root.ts
|
|
16011
16017
|
import * as fs13 from "node:fs";
|
|
16012
16018
|
import * as path11 from "node:path";
|
|
16013
|
-
import
|
|
16014
|
-
|
|
16019
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
16020
|
+
var PACKAGE_NAME = "@event4u/agent-config";
|
|
16021
|
+
var MAX_ASCENT = 16;
|
|
16022
|
+
function resolvePackageRoot(fromUrlOrPath, legacyHops = 3) {
|
|
16023
|
+
const start = fromUrlOrPath.startsWith("file:") ? fileURLToPath2(fromUrlOrPath) : fromUrlOrPath;
|
|
16024
|
+
const startDir = path11.dirname(start);
|
|
16025
|
+
let dir = startDir;
|
|
16026
|
+
for (let i = 0; i < MAX_ASCENT; i++) {
|
|
16027
|
+
const manifest = path11.join(dir, "package.json");
|
|
16028
|
+
if (fs13.existsSync(manifest)) {
|
|
16029
|
+
try {
|
|
16030
|
+
const parsed = JSON.parse(fs13.readFileSync(manifest, "utf8"));
|
|
16031
|
+
if (parsed.name === PACKAGE_NAME) {
|
|
16032
|
+
return dir;
|
|
16033
|
+
}
|
|
16034
|
+
} catch {
|
|
16035
|
+
}
|
|
16036
|
+
}
|
|
16037
|
+
const parent = path11.dirname(dir);
|
|
16038
|
+
if (parent === dir) {
|
|
16039
|
+
break;
|
|
16040
|
+
}
|
|
16041
|
+
dir = parent;
|
|
16042
|
+
}
|
|
16043
|
+
return path11.resolve(startDir, ...Array.from({ length: legacyHops }, () => ".."));
|
|
16044
|
+
}
|
|
16045
|
+
|
|
16046
|
+
// src/scripts/_cli/cmd_migrate.ts
|
|
16015
16047
|
var PACKAGE_NAME_NPM = "@event4u/agent-config";
|
|
16016
16048
|
var PACKAGE_NAME_COMPOSER = "event4u/agent-config";
|
|
16017
16049
|
var LEGACY_DIRS = ["vendor", "node_modules"];
|
|
@@ -16029,7 +16061,7 @@ var LEGACY_SETTINGS_FILES = [".agent-settings.yml", ".agent-user.yml"];
|
|
|
16029
16061
|
var LEGACY_STATE_FILENAME = ".implement-ticket-state.json";
|
|
16030
16062
|
var LEGACY_STATE_V1_FILENAME = ".work-state.json";
|
|
16031
16063
|
var LEGACY_AGENT_CONFIG_SHELL = "agent-config";
|
|
16032
|
-
var _HERE_DIR =
|
|
16064
|
+
var _HERE_DIR = path12.dirname(fileURLToPath3(import.meta.url));
|
|
16033
16065
|
var ArgparseExit = class extends Error {
|
|
16034
16066
|
code;
|
|
16035
16067
|
constructor(code) {
|
|
@@ -16128,38 +16160,38 @@ function _jsonDumpsIndentAscii(value, indent) {
|
|
|
16128
16160
|
}
|
|
16129
16161
|
function _isFile2(p) {
|
|
16130
16162
|
try {
|
|
16131
|
-
return
|
|
16163
|
+
return fs14.statSync(p).isFile();
|
|
16132
16164
|
} catch {
|
|
16133
16165
|
return false;
|
|
16134
16166
|
}
|
|
16135
16167
|
}
|
|
16136
16168
|
function _isDir2(p) {
|
|
16137
16169
|
try {
|
|
16138
|
-
return
|
|
16170
|
+
return fs14.statSync(p).isDirectory();
|
|
16139
16171
|
} catch {
|
|
16140
16172
|
return false;
|
|
16141
16173
|
}
|
|
16142
16174
|
}
|
|
16143
16175
|
function _isSymlink(p) {
|
|
16144
16176
|
try {
|
|
16145
|
-
return
|
|
16177
|
+
return fs14.lstatSync(p).isSymbolicLink();
|
|
16146
16178
|
} catch {
|
|
16147
16179
|
return false;
|
|
16148
16180
|
}
|
|
16149
16181
|
}
|
|
16150
16182
|
function _exists2(p) {
|
|
16151
16183
|
try {
|
|
16152
|
-
|
|
16184
|
+
fs14.lstatSync(p);
|
|
16153
16185
|
return true;
|
|
16154
16186
|
} catch {
|
|
16155
16187
|
return false;
|
|
16156
16188
|
}
|
|
16157
16189
|
}
|
|
16158
16190
|
function _readText(p) {
|
|
16159
|
-
return
|
|
16191
|
+
return fs14.readFileSync(p, { encoding: "utf-8" });
|
|
16160
16192
|
}
|
|
16161
16193
|
function _writeText(p, text) {
|
|
16162
|
-
|
|
16194
|
+
fs14.writeFileSync(p, text, { encoding: "utf-8" });
|
|
16163
16195
|
}
|
|
16164
16196
|
function _jsonLoadFile(p) {
|
|
16165
16197
|
return JSON.parse(_readText(p));
|
|
@@ -16215,7 +16247,7 @@ function _classify_symlink(link) {
|
|
|
16215
16247
|
}
|
|
16216
16248
|
let target;
|
|
16217
16249
|
try {
|
|
16218
|
-
target =
|
|
16250
|
+
target = fs14.readlinkSync(link);
|
|
16219
16251
|
} catch {
|
|
16220
16252
|
return null;
|
|
16221
16253
|
}
|
|
@@ -16226,16 +16258,16 @@ function _classify_symlink(link) {
|
|
|
16226
16258
|
return "user";
|
|
16227
16259
|
}
|
|
16228
16260
|
function _detect_legacy_state(project) {
|
|
16229
|
-
return _isFile2(
|
|
16261
|
+
return _isFile2(path12.join(project, LEGACY_STATE_FILENAME));
|
|
16230
16262
|
}
|
|
16231
16263
|
function _detect_legacy_settings(project) {
|
|
16232
16264
|
const found = [];
|
|
16233
16265
|
for (const name of LEGACY_SETTINGS_FILES) {
|
|
16234
|
-
const flat =
|
|
16266
|
+
const flat = path12.join(project, name);
|
|
16235
16267
|
if (_isFile2(flat)) {
|
|
16236
16268
|
found.push(flat);
|
|
16237
16269
|
}
|
|
16238
|
-
const typed =
|
|
16270
|
+
const typed = path12.join(project, "settings", name);
|
|
16239
16271
|
if (_isFile2(typed)) {
|
|
16240
16272
|
found.push(typed);
|
|
16241
16273
|
}
|
|
@@ -16243,25 +16275,25 @@ function _detect_legacy_settings(project) {
|
|
|
16243
16275
|
return found;
|
|
16244
16276
|
}
|
|
16245
16277
|
function _detect_empty_shell(project) {
|
|
16246
|
-
const shell =
|
|
16278
|
+
const shell = path12.join(project, LEGACY_AGENT_CONFIG_SHELL);
|
|
16247
16279
|
if (!_isDir2(shell) || _isSymlink(shell)) {
|
|
16248
16280
|
return false;
|
|
16249
16281
|
}
|
|
16250
16282
|
try {
|
|
16251
|
-
return
|
|
16283
|
+
return fs14.readdirSync(shell).length === 0;
|
|
16252
16284
|
} catch {
|
|
16253
16285
|
return false;
|
|
16254
16286
|
}
|
|
16255
16287
|
}
|
|
16256
16288
|
function _detect_already_migrated(project) {
|
|
16257
|
-
if (_detect_npm(
|
|
16289
|
+
if (_detect_npm(path12.join(project, "package.json"))) {
|
|
16258
16290
|
return false;
|
|
16259
16291
|
}
|
|
16260
|
-
if (_detect_composer(
|
|
16292
|
+
if (_detect_composer(path12.join(project, "composer.json"))) {
|
|
16261
16293
|
return false;
|
|
16262
16294
|
}
|
|
16263
16295
|
for (const name of MANAGED_SYMLINKS) {
|
|
16264
|
-
if (_classify_symlink(
|
|
16296
|
+
if (_classify_symlink(path12.join(project, name)) === "legacy") {
|
|
16265
16297
|
return false;
|
|
16266
16298
|
}
|
|
16267
16299
|
}
|
|
@@ -16332,11 +16364,11 @@ function _purge_legacy_symlinks(project) {
|
|
|
16332
16364
|
const removed = [];
|
|
16333
16365
|
const preserved = [];
|
|
16334
16366
|
for (const name of MANAGED_SYMLINKS) {
|
|
16335
|
-
const link =
|
|
16367
|
+
const link = path12.join(project, name);
|
|
16336
16368
|
const kind = _classify_symlink(link);
|
|
16337
16369
|
if (kind === "legacy") {
|
|
16338
16370
|
try {
|
|
16339
|
-
|
|
16371
|
+
fs14.unlinkSync(link);
|
|
16340
16372
|
removed.push(name);
|
|
16341
16373
|
} catch {
|
|
16342
16374
|
preserved.push(name);
|
|
@@ -16348,14 +16380,14 @@ function _purge_legacy_symlinks(project) {
|
|
|
16348
16380
|
return [removed, preserved];
|
|
16349
16381
|
}
|
|
16350
16382
|
function _migrate_state_file(project) {
|
|
16351
|
-
const source =
|
|
16383
|
+
const source = path12.join(project, LEGACY_STATE_FILENAME);
|
|
16352
16384
|
if (!_isFile2(source)) {
|
|
16353
16385
|
return null;
|
|
16354
16386
|
}
|
|
16355
|
-
const target =
|
|
16387
|
+
const target = path12.join(project, LEGACY_STATE_V1_FILENAME);
|
|
16356
16388
|
if (_exists2(target)) {
|
|
16357
16389
|
try {
|
|
16358
|
-
|
|
16390
|
+
fs14.unlinkSync(source);
|
|
16359
16391
|
return `removed stale ${LEGACY_STATE_FILENAME} (v1 already present)`;
|
|
16360
16392
|
} catch {
|
|
16361
16393
|
return null;
|
|
@@ -16369,8 +16401,8 @@ function _migrate_state_file(project) {
|
|
|
16369
16401
|
return `migrated ${LEGACY_STATE_FILENAME} \u2192 ${LEGACY_STATE_V1_FILENAME}`;
|
|
16370
16402
|
}
|
|
16371
16403
|
function _load_state_migrator() {
|
|
16372
|
-
const pkg_root =
|
|
16373
|
-
const rel =
|
|
16404
|
+
const pkg_root = resolvePackageRoot(import.meta.url);
|
|
16405
|
+
const rel = path12.join(
|
|
16374
16406
|
"agent-src",
|
|
16375
16407
|
"templates",
|
|
16376
16408
|
"scripts",
|
|
@@ -16378,8 +16410,8 @@ function _load_state_migrator() {
|
|
|
16378
16410
|
"migration",
|
|
16379
16411
|
"v0_to_v1.ts"
|
|
16380
16412
|
);
|
|
16381
|
-
const driver = [
|
|
16382
|
-
(p) =>
|
|
16413
|
+
const driver = [path12.join(pkg_root, "dist", rel), path12.join(pkg_root, "src", rel)].find(
|
|
16414
|
+
(p) => fs14.existsSync(p)
|
|
16383
16415
|
) ?? null;
|
|
16384
16416
|
if (driver === null) {
|
|
16385
16417
|
return null;
|
|
@@ -16387,12 +16419,12 @@ function _load_state_migrator() {
|
|
|
16387
16419
|
const binName = process2.platform === "win32" ? "tsx.cmd" : "tsx";
|
|
16388
16420
|
let tsxBin = null;
|
|
16389
16421
|
for (let dir = pkg_root; ; ) {
|
|
16390
|
-
const cand =
|
|
16391
|
-
if (
|
|
16422
|
+
const cand = path12.join(dir, "node_modules", ".bin", binName);
|
|
16423
|
+
if (fs14.existsSync(cand)) {
|
|
16392
16424
|
tsxBin = cand;
|
|
16393
16425
|
break;
|
|
16394
16426
|
}
|
|
16395
|
-
const parent =
|
|
16427
|
+
const parent = path12.dirname(dir);
|
|
16396
16428
|
if (parent === dir) break;
|
|
16397
16429
|
dir = parent;
|
|
16398
16430
|
}
|
|
@@ -16419,17 +16451,17 @@ function _delete_legacy_settings(project) {
|
|
|
16419
16451
|
const removed = [];
|
|
16420
16452
|
for (const p of _detect_legacy_settings(project)) {
|
|
16421
16453
|
try {
|
|
16422
|
-
|
|
16423
|
-
removed.push(
|
|
16454
|
+
fs14.unlinkSync(p);
|
|
16455
|
+
removed.push(path12.relative(project, p));
|
|
16424
16456
|
} catch {
|
|
16425
16457
|
continue;
|
|
16426
16458
|
}
|
|
16427
16459
|
}
|
|
16428
|
-
const settings_dir =
|
|
16460
|
+
const settings_dir = path12.join(project, "settings");
|
|
16429
16461
|
if (_isDir2(settings_dir) && !_isSymlink(settings_dir)) {
|
|
16430
16462
|
try {
|
|
16431
|
-
if (
|
|
16432
|
-
|
|
16463
|
+
if (fs14.readdirSync(settings_dir).length === 0) {
|
|
16464
|
+
fs14.rmdirSync(settings_dir);
|
|
16433
16465
|
removed.push("settings/");
|
|
16434
16466
|
}
|
|
16435
16467
|
} catch {
|
|
@@ -16438,12 +16470,12 @@ function _delete_legacy_settings(project) {
|
|
|
16438
16470
|
return removed;
|
|
16439
16471
|
}
|
|
16440
16472
|
function _remove_empty_shell(project) {
|
|
16441
|
-
const shell =
|
|
16473
|
+
const shell = path12.join(project, LEGACY_AGENT_CONFIG_SHELL);
|
|
16442
16474
|
if (!_detect_empty_shell(project)) {
|
|
16443
16475
|
return false;
|
|
16444
16476
|
}
|
|
16445
16477
|
try {
|
|
16446
|
-
|
|
16478
|
+
fs14.rmdirSync(shell);
|
|
16447
16479
|
} catch {
|
|
16448
16480
|
return false;
|
|
16449
16481
|
}
|
|
@@ -16453,7 +16485,7 @@ function _reEscape(s) {
|
|
|
16453
16485
|
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
16454
16486
|
}
|
|
16455
16487
|
function _update_gitignore(project) {
|
|
16456
|
-
const gitignore =
|
|
16488
|
+
const gitignore = path12.join(project, ".gitignore");
|
|
16457
16489
|
const block = `${GITIGNORE_BLOCK_START}
|
|
16458
16490
|
${GITIGNORE_NEW_BODY}${GITIGNORE_BLOCK_END}
|
|
16459
16491
|
`;
|
|
@@ -16484,16 +16516,16 @@ ${GITIGNORE_NEW_BODY}${GITIGNORE_BLOCK_END}
|
|
|
16484
16516
|
}
|
|
16485
16517
|
function _build_plan(project) {
|
|
16486
16518
|
return {
|
|
16487
|
-
npm: _detect_npm(
|
|
16488
|
-
composer: _detect_composer(
|
|
16519
|
+
npm: _detect_npm(path12.join(project, "package.json")),
|
|
16520
|
+
composer: _detect_composer(path12.join(project, "composer.json")),
|
|
16489
16521
|
symlinks_legacy: MANAGED_SYMLINKS.filter(
|
|
16490
|
-
(name) => _classify_symlink(
|
|
16522
|
+
(name) => _classify_symlink(path12.join(project, name)) === "legacy"
|
|
16491
16523
|
),
|
|
16492
16524
|
symlinks_user: MANAGED_SYMLINKS.filter(
|
|
16493
|
-
(name) => _classify_symlink(
|
|
16525
|
+
(name) => _classify_symlink(path12.join(project, name)) === "user"
|
|
16494
16526
|
),
|
|
16495
|
-
state_file: _isFile2(
|
|
16496
|
-
settings_files: _detect_legacy_settings(project).map((p) =>
|
|
16527
|
+
state_file: _isFile2(path12.join(project, LEGACY_STATE_FILENAME)),
|
|
16528
|
+
settings_files: _detect_legacy_settings(project).map((p) => path12.relative(project, p)),
|
|
16497
16529
|
empty_shell: _detect_empty_shell(project)
|
|
16498
16530
|
};
|
|
16499
16531
|
}
|
|
@@ -16557,10 +16589,10 @@ function _warn_on_major_mismatch(from_major, plan, out) {
|
|
|
16557
16589
|
}
|
|
16558
16590
|
function _apply(project, out, err) {
|
|
16559
16591
|
const summary = [];
|
|
16560
|
-
if (_strip_npm_entry(
|
|
16592
|
+
if (_strip_npm_entry(path12.join(project, "package.json"))) {
|
|
16561
16593
|
summary.push(`removed ${PACKAGE_NAME_NPM} from package.json`);
|
|
16562
16594
|
}
|
|
16563
|
-
if (_strip_composer_entry(
|
|
16595
|
+
if (_strip_composer_entry(path12.join(project, "composer.json"))) {
|
|
16564
16596
|
summary.push(`removed ${PACKAGE_NAME_COMPOSER} from composer.json`);
|
|
16565
16597
|
}
|
|
16566
16598
|
const [removed_links, preserved_links] = _purge_legacy_symlinks(project);
|
|
@@ -16681,18 +16713,18 @@ function main(argv = null, options = {}) {
|
|
|
16681
16713
|
return _apply(project, out, err);
|
|
16682
16714
|
}
|
|
16683
16715
|
var _bundled = true;
|
|
16684
|
-
var _HERE =
|
|
16716
|
+
var _HERE = fileURLToPath3(import.meta.url);
|
|
16685
16717
|
function _isCliEntry() {
|
|
16686
16718
|
if (process2.argv[1] === void 0) {
|
|
16687
16719
|
return false;
|
|
16688
16720
|
}
|
|
16689
|
-
const argvUrl = pathToFileURL(
|
|
16721
|
+
const argvUrl = pathToFileURL(path12.resolve(process2.argv[1])).href;
|
|
16690
16722
|
if (import.meta.url === argvUrl) {
|
|
16691
16723
|
return true;
|
|
16692
16724
|
}
|
|
16693
16725
|
try {
|
|
16694
|
-
const here =
|
|
16695
|
-
const argv =
|
|
16726
|
+
const here = fs14.realpathSync(fileURLToPath3(import.meta.url));
|
|
16727
|
+
const argv = fs14.realpathSync(path12.resolve(process2.argv[1]));
|
|
16696
16728
|
return here === argv;
|
|
16697
16729
|
} catch {
|
|
16698
16730
|
return false;
|
|
@@ -16711,7 +16743,7 @@ if (!_bundled && (_isCliEntry() || process2.argv[1] === _HERE)) {
|
|
|
16711
16743
|
}
|
|
16712
16744
|
|
|
16713
16745
|
// src/scripts/install.ts
|
|
16714
|
-
var _HERE2 =
|
|
16746
|
+
var _HERE2 = fileURLToPath4(import.meta.url);
|
|
16715
16747
|
var SystemExitError = class extends Error {
|
|
16716
16748
|
constructor(code) {
|
|
16717
16749
|
super(`system-exit-${code}`);
|
|
@@ -16729,34 +16761,34 @@ var ArgparseExit2 = class extends Error {
|
|
|
16729
16761
|
function expanduser6(p) {
|
|
16730
16762
|
if (p === "~") return os7.homedir();
|
|
16731
16763
|
if (p.startsWith("~/") || p.startsWith("~\\")) {
|
|
16732
|
-
return
|
|
16764
|
+
return path13.join(os7.homedir(), p.slice(2));
|
|
16733
16765
|
}
|
|
16734
16766
|
return p;
|
|
16735
16767
|
}
|
|
16736
16768
|
function resolvePath(p) {
|
|
16737
16769
|
try {
|
|
16738
|
-
return
|
|
16770
|
+
return fs15.realpathSync(path13.resolve(p));
|
|
16739
16771
|
} catch {
|
|
16740
|
-
return
|
|
16772
|
+
return path13.resolve(p);
|
|
16741
16773
|
}
|
|
16742
16774
|
}
|
|
16743
16775
|
function isFile(p) {
|
|
16744
16776
|
try {
|
|
16745
|
-
return
|
|
16777
|
+
return fs15.statSync(p).isFile();
|
|
16746
16778
|
} catch {
|
|
16747
16779
|
return false;
|
|
16748
16780
|
}
|
|
16749
16781
|
}
|
|
16750
16782
|
function isDir(p) {
|
|
16751
16783
|
try {
|
|
16752
|
-
return
|
|
16784
|
+
return fs15.statSync(p).isDirectory();
|
|
16753
16785
|
} catch {
|
|
16754
16786
|
return false;
|
|
16755
16787
|
}
|
|
16756
16788
|
}
|
|
16757
16789
|
function pathExists(p) {
|
|
16758
16790
|
try {
|
|
16759
|
-
|
|
16791
|
+
fs15.statSync(p);
|
|
16760
16792
|
return true;
|
|
16761
16793
|
} catch {
|
|
16762
16794
|
return false;
|
|
@@ -16764,24 +16796,24 @@ function pathExists(p) {
|
|
|
16764
16796
|
}
|
|
16765
16797
|
function isSymlink(p) {
|
|
16766
16798
|
try {
|
|
16767
|
-
return
|
|
16799
|
+
return fs15.lstatSync(p).isSymbolicLink();
|
|
16768
16800
|
} catch {
|
|
16769
16801
|
return false;
|
|
16770
16802
|
}
|
|
16771
16803
|
}
|
|
16772
16804
|
function readText(p) {
|
|
16773
|
-
return
|
|
16805
|
+
return fs15.readFileSync(p, "utf-8");
|
|
16774
16806
|
}
|
|
16775
16807
|
function writeText(p, content) {
|
|
16776
|
-
|
|
16808
|
+
fs15.writeFileSync(p, content, "utf-8");
|
|
16777
16809
|
}
|
|
16778
16810
|
function mkdirp(p) {
|
|
16779
|
-
|
|
16811
|
+
fs15.mkdirSync(p, { recursive: true });
|
|
16780
16812
|
}
|
|
16781
16813
|
function sortedGlobStems(directory, suffix) {
|
|
16782
16814
|
let entries;
|
|
16783
16815
|
try {
|
|
16784
|
-
entries =
|
|
16816
|
+
entries = fs15.readdirSync(directory);
|
|
16785
16817
|
} catch {
|
|
16786
16818
|
return [];
|
|
16787
16819
|
}
|
|
@@ -16801,7 +16833,7 @@ function sortedGlobStems(directory, suffix) {
|
|
|
16801
16833
|
function countZips(directory) {
|
|
16802
16834
|
if (!isDir(directory)) return 0;
|
|
16803
16835
|
let n = 0;
|
|
16804
|
-
for (const name of
|
|
16836
|
+
for (const name of fs15.readdirSync(directory)) {
|
|
16805
16837
|
if (name.endsWith(".zip")) n += 1;
|
|
16806
16838
|
}
|
|
16807
16839
|
return n;
|
|
@@ -16809,35 +16841,35 @@ function countZips(directory) {
|
|
|
16809
16841
|
function sha256OfFile(p) {
|
|
16810
16842
|
let data;
|
|
16811
16843
|
try {
|
|
16812
|
-
data =
|
|
16844
|
+
data = fs15.readFileSync(p);
|
|
16813
16845
|
} catch {
|
|
16814
16846
|
return null;
|
|
16815
16847
|
}
|
|
16816
16848
|
return crypto3.createHash("sha256").update(data).digest("hex");
|
|
16817
16849
|
}
|
|
16818
16850
|
function atomicWrite0644(target, body, prefix) {
|
|
16819
|
-
const dir =
|
|
16820
|
-
const tmpName =
|
|
16851
|
+
const dir = path13.dirname(target);
|
|
16852
|
+
const tmpName = path13.join(
|
|
16821
16853
|
dir,
|
|
16822
16854
|
`${prefix}${process3.pid}.${crypto3.randomBytes(6).toString("hex")}.yml.tmp`
|
|
16823
16855
|
);
|
|
16824
16856
|
let fd = null;
|
|
16825
16857
|
try {
|
|
16826
|
-
fd =
|
|
16827
|
-
|
|
16828
|
-
|
|
16858
|
+
fd = fs15.openSync(tmpName, "wx", 420);
|
|
16859
|
+
fs15.writeFileSync(fd, body, "utf-8");
|
|
16860
|
+
fs15.closeSync(fd);
|
|
16829
16861
|
fd = null;
|
|
16830
|
-
|
|
16831
|
-
|
|
16862
|
+
fs15.chmodSync(tmpName, 420);
|
|
16863
|
+
fs15.renameSync(tmpName, target);
|
|
16832
16864
|
} catch (err) {
|
|
16833
16865
|
if (fd !== null) {
|
|
16834
16866
|
try {
|
|
16835
|
-
|
|
16867
|
+
fs15.closeSync(fd);
|
|
16836
16868
|
} catch {
|
|
16837
16869
|
}
|
|
16838
16870
|
}
|
|
16839
16871
|
try {
|
|
16840
|
-
|
|
16872
|
+
fs15.unlinkSync(tmpName);
|
|
16841
16873
|
} catch {
|
|
16842
16874
|
}
|
|
16843
16875
|
throw err;
|
|
@@ -16961,12 +16993,12 @@ var LEGACY_SETTINGS_FILE = ".agent-settings";
|
|
|
16961
16993
|
var LEGACY_BACKUP_FILE = ".agent-settings.backup.key-value";
|
|
16962
16994
|
var SETTINGS_SUBDIR = ["agents", "settings"];
|
|
16963
16995
|
function _canonical_settings_target(project_root) {
|
|
16964
|
-
return
|
|
16996
|
+
return path13.join(project_root, ...SETTINGS_SUBDIR, SETTINGS_FILE);
|
|
16965
16997
|
}
|
|
16966
16998
|
function _resolve_settings_read(project_root) {
|
|
16967
16999
|
const canonical = _canonical_settings_target(project_root);
|
|
16968
17000
|
if (pathExists(canonical)) return canonical;
|
|
16969
|
-
const legacy =
|
|
17001
|
+
const legacy = path13.join(project_root, SETTINGS_FILE);
|
|
16970
17002
|
if (pathExists(legacy)) return legacy;
|
|
16971
17003
|
return canonical;
|
|
16972
17004
|
}
|
|
@@ -17030,9 +17062,9 @@ function fail(msg) {
|
|
|
17030
17062
|
throw new SystemExitError(1);
|
|
17031
17063
|
}
|
|
17032
17064
|
function detect_package_root(project_root) {
|
|
17033
|
-
const npm_path =
|
|
17065
|
+
const npm_path = path13.join(project_root, "node_modules", "@event4u", "agent-config");
|
|
17034
17066
|
if (isDir(npm_path)) return resolvePath(npm_path);
|
|
17035
|
-
if (pathExists(
|
|
17067
|
+
if (pathExists(path13.join(project_root, "src", "config", "profiles", "minimal.ini"))) {
|
|
17036
17068
|
return project_root;
|
|
17037
17069
|
}
|
|
17038
17070
|
fail(
|
|
@@ -17040,12 +17072,12 @@ function detect_package_root(project_root) {
|
|
|
17040
17072
|
);
|
|
17041
17073
|
}
|
|
17042
17074
|
function detect_package_type(package_root) {
|
|
17043
|
-
if (package_root.split(
|
|
17075
|
+
if (package_root.split(path13.sep).includes("node_modules")) return "npm";
|
|
17044
17076
|
return "local";
|
|
17045
17077
|
}
|
|
17046
17078
|
function detect_package_type_for_project(project_root, package_root) {
|
|
17047
17079
|
const npm_path = resolvePath(
|
|
17048
|
-
|
|
17080
|
+
path13.join(project_root, "node_modules", "@event4u", "agent-config")
|
|
17049
17081
|
);
|
|
17050
17082
|
const package_resolved = resolvePath(package_root);
|
|
17051
17083
|
if (package_resolved === npm_path) return "npm";
|
|
@@ -17065,7 +17097,7 @@ function ensure_directory(p) {
|
|
|
17065
17097
|
mkdirp(p);
|
|
17066
17098
|
}
|
|
17067
17099
|
function write_file(p, content) {
|
|
17068
|
-
ensure_directory(
|
|
17100
|
+
ensure_directory(path13.dirname(p));
|
|
17069
17101
|
writeText(p, content);
|
|
17070
17102
|
}
|
|
17071
17103
|
function read_json_file(p) {
|
|
@@ -17236,7 +17268,7 @@ function _append_unknown_legacy(rendered, legacy_values, unknown_keys) {
|
|
|
17236
17268
|
return rendered + "\n" + suffix;
|
|
17237
17269
|
}
|
|
17238
17270
|
function _migrate_legacy_if_present(project_root, template_body) {
|
|
17239
|
-
const legacy_target =
|
|
17271
|
+
const legacy_target = path13.join(project_root, LEGACY_SETTINGS_FILE);
|
|
17240
17272
|
if (!isFile(legacy_target)) return null;
|
|
17241
17273
|
const legacy_text = readText(legacy_target);
|
|
17242
17274
|
const [values, unknown] = _parse_legacy_settings(legacy_text);
|
|
@@ -17251,9 +17283,9 @@ function _migrate_legacy_if_present(project_root, template_body) {
|
|
|
17251
17283
|
}
|
|
17252
17284
|
}
|
|
17253
17285
|
rendered = _append_unknown_legacy(rendered, values, unknown);
|
|
17254
|
-
const backup_target =
|
|
17286
|
+
const backup_target = path13.join(project_root, LEGACY_BACKUP_FILE);
|
|
17255
17287
|
writeText(backup_target, legacy_text);
|
|
17256
|
-
|
|
17288
|
+
fs15.unlinkSync(legacy_target);
|
|
17257
17289
|
info(`Migrated legacy ${LEGACY_SETTINGS_FILE} \u2192 ${SETTINGS_FILE}`);
|
|
17258
17290
|
info(`Backup saved to ${LEGACY_BACKUP_FILE}`);
|
|
17259
17291
|
if (unknown.length > 0) {
|
|
@@ -17288,7 +17320,7 @@ function _render_template(template, profile_values) {
|
|
|
17288
17320
|
return body;
|
|
17289
17321
|
}
|
|
17290
17322
|
function _load_valid_user_types(package_root) {
|
|
17291
|
-
const directory =
|
|
17323
|
+
const directory = path13.join(package_root, USER_TYPES_DIR);
|
|
17292
17324
|
if (!isDir(directory)) return [];
|
|
17293
17325
|
return sortedGlobStems(directory, ".yml");
|
|
17294
17326
|
}
|
|
@@ -17345,8 +17377,8 @@ function splitlinesKeepends(text) {
|
|
|
17345
17377
|
}
|
|
17346
17378
|
function ensure_agent_settings(project_root, package_root, profile, force, user_type = "", packs = null) {
|
|
17347
17379
|
const target = _canonical_settings_target(project_root);
|
|
17348
|
-
const profile_source =
|
|
17349
|
-
const template_source =
|
|
17380
|
+
const profile_source = path13.join(package_root, "src", "config", "profiles", `${profile}.ini`);
|
|
17381
|
+
const template_source = path13.join(package_root, "src", "config", "agent-settings.template.yml");
|
|
17350
17382
|
if (!pathExists(profile_source)) fail(`Missing profile preset: ${profile_source}`);
|
|
17351
17383
|
if (!pathExists(template_source)) fail(`Missing settings template: ${template_source}`);
|
|
17352
17384
|
const template = readText(template_source);
|
|
@@ -17360,21 +17392,21 @@ function ensure_agent_settings(project_root, package_root, profile, force, user_
|
|
|
17360
17392
|
if (profile_values["rule_loading_tier"] !== profile) {
|
|
17361
17393
|
const got = "rule_loading_tier" in profile_values ? `'${profile_values["rule_loading_tier"]}'` : "None";
|
|
17362
17394
|
fail(
|
|
17363
|
-
`Profile preset ${
|
|
17395
|
+
`Profile preset ${path13.basename(profile_source)} has rule_loading_tier=${got} but --profile=${profile}`
|
|
17364
17396
|
);
|
|
17365
17397
|
}
|
|
17366
17398
|
profile_values["user_type"] = _validate_user_type(package_root, user_type);
|
|
17367
17399
|
let template_body = _render_template(template, profile_values);
|
|
17368
17400
|
template_body = _inject_packs(template_body, packs ?? []);
|
|
17369
|
-
const legacy_root =
|
|
17401
|
+
const legacy_root = path13.join(project_root, SETTINGS_FILE);
|
|
17370
17402
|
if (isFile(legacy_root) && !pathExists(target)) {
|
|
17371
|
-
mkdirp(
|
|
17403
|
+
mkdirp(path13.dirname(target));
|
|
17372
17404
|
writeText(target, readText(legacy_root));
|
|
17373
|
-
|
|
17405
|
+
fs15.unlinkSync(legacy_root);
|
|
17374
17406
|
success(`Migrated ${SETTINGS_FILE} \u2192 agents/settings/${SETTINGS_FILE} (ADR-038)`);
|
|
17375
17407
|
return;
|
|
17376
17408
|
}
|
|
17377
|
-
const legacy_target =
|
|
17409
|
+
const legacy_target = path13.join(project_root, LEGACY_SETTINGS_FILE);
|
|
17378
17410
|
if (isFile(legacy_target) && pathExists(target)) {
|
|
17379
17411
|
warn(
|
|
17380
17412
|
`Both ${SETTINGS_FILE} and legacy ${LEGACY_SETTINGS_FILE} exist. Skipping migration to avoid overwriting ${SETTINGS_FILE}. Delete one of them manually and re-run.`
|
|
@@ -17391,7 +17423,7 @@ function ensure_agent_settings(project_root, package_root, profile, force, user_
|
|
|
17391
17423
|
skip(`${SETTINGS_FILE} already exists`);
|
|
17392
17424
|
return;
|
|
17393
17425
|
}
|
|
17394
|
-
mkdirp(
|
|
17426
|
+
mkdirp(path13.dirname(target));
|
|
17395
17427
|
write_file(target, template_body);
|
|
17396
17428
|
const user_type_value = profile_values["user_type"] ?? "";
|
|
17397
17429
|
const suffix = user_type_value ? `, user_type=${user_type_value}` : "";
|
|
@@ -17404,7 +17436,7 @@ function ensure_vscode_bridge(project_root, package_type, force) {
|
|
|
17404
17436
|
const plugin_path = plugin_paths[package_type] ?? "./plugin/agent-config";
|
|
17405
17437
|
const bridge = { "chat.pluginLocations": { [plugin_path]: true } };
|
|
17406
17438
|
merge_json_file(
|
|
17407
|
-
|
|
17439
|
+
path13.join(project_root, ".vscode", "settings.json"),
|
|
17408
17440
|
bridge,
|
|
17409
17441
|
force,
|
|
17410
17442
|
".vscode/settings.json"
|
|
@@ -17413,14 +17445,14 @@ function ensure_vscode_bridge(project_root, package_type, force) {
|
|
|
17413
17445
|
function ensure_augment_bridge(project_root, force) {
|
|
17414
17446
|
const bridge = { enabledPlugins: { "agent-config@event4u": true } };
|
|
17415
17447
|
return merge_json_file(
|
|
17416
|
-
|
|
17448
|
+
path13.join(project_root, ".augment", "settings.json"),
|
|
17417
17449
|
bridge,
|
|
17418
17450
|
force,
|
|
17419
17451
|
".augment/settings.json"
|
|
17420
17452
|
);
|
|
17421
17453
|
}
|
|
17422
|
-
var AUGMENT_USER_DIR =
|
|
17423
|
-
var AUGMENT_USER_HOOKS_DIR =
|
|
17454
|
+
var AUGMENT_USER_DIR = path13.join(os7.homedir(), ".augment");
|
|
17455
|
+
var AUGMENT_USER_HOOKS_DIR = path13.join(AUGMENT_USER_DIR, "hooks");
|
|
17424
17456
|
var AUGMENT_DISPATCHER_TRAMPOLINE = "augment-dispatcher.sh";
|
|
17425
17457
|
var AUGMENT_LEGACY_TRAMPOLINES = [
|
|
17426
17458
|
"augment-chat-history.sh",
|
|
@@ -17436,29 +17468,29 @@ var AUGMENT_DISPATCHER_BINDINGS = [
|
|
|
17436
17468
|
["post_tool_use", "PostToolUse"]
|
|
17437
17469
|
];
|
|
17438
17470
|
function _deploy_augment_trampoline(package_root, name, force) {
|
|
17439
|
-
const src =
|
|
17471
|
+
const src = path13.join(package_root, "scripts", "hooks", name);
|
|
17440
17472
|
if (!pathExists(src)) {
|
|
17441
17473
|
skip(`augment trampoline missing in package: ${src}`);
|
|
17442
17474
|
return null;
|
|
17443
17475
|
}
|
|
17444
17476
|
mkdirp(AUGMENT_USER_HOOKS_DIR);
|
|
17445
|
-
const dst =
|
|
17477
|
+
const dst = path13.join(AUGMENT_USER_HOOKS_DIR, name);
|
|
17446
17478
|
const src_text = readText(src);
|
|
17447
17479
|
if (pathExists(dst) && readText(dst) === src_text && !force) {
|
|
17448
17480
|
skip(`~/.augment/hooks/${name} already up to date`);
|
|
17449
17481
|
} else {
|
|
17450
17482
|
writeText(dst, src_text);
|
|
17451
|
-
|
|
17483
|
+
fs15.chmodSync(dst, 493);
|
|
17452
17484
|
success(`~/.augment/hooks/${name} installed`);
|
|
17453
17485
|
}
|
|
17454
17486
|
return dst;
|
|
17455
17487
|
}
|
|
17456
17488
|
function _remove_legacy_augment_trampolines() {
|
|
17457
17489
|
for (const name of AUGMENT_LEGACY_TRAMPOLINES) {
|
|
17458
|
-
const legacy =
|
|
17490
|
+
const legacy = path13.join(AUGMENT_USER_HOOKS_DIR, name);
|
|
17459
17491
|
try {
|
|
17460
17492
|
if (isFile(legacy)) {
|
|
17461
|
-
|
|
17493
|
+
fs15.unlinkSync(legacy);
|
|
17462
17494
|
skip(`removed legacy ~/.augment/hooks/${name}`);
|
|
17463
17495
|
}
|
|
17464
17496
|
} catch {
|
|
@@ -17477,7 +17509,7 @@ function ensure_augment_user_hooks(package_root, force) {
|
|
|
17477
17509
|
}
|
|
17478
17510
|
const settings_patch = { hooks: per_event };
|
|
17479
17511
|
return merge_json_file(
|
|
17480
|
-
|
|
17512
|
+
path13.join(AUGMENT_USER_DIR, "settings.json"),
|
|
17481
17513
|
settings_patch,
|
|
17482
17514
|
force,
|
|
17483
17515
|
"~/.augment/settings.json"
|
|
@@ -17502,7 +17534,7 @@ function _heal_legacy_claude_plugin_ids(p) {
|
|
|
17502
17534
|
return removed;
|
|
17503
17535
|
}
|
|
17504
17536
|
function ensure_claude_bridge(project_root, force) {
|
|
17505
|
-
const target =
|
|
17537
|
+
const target = path13.join(project_root, ".claude", "settings.json");
|
|
17506
17538
|
const healed = _heal_legacy_claude_plugin_ids(target);
|
|
17507
17539
|
for (const pid of healed) {
|
|
17508
17540
|
success(`.claude/settings.json: removed stale plugin id \`${pid}\``);
|
|
@@ -17527,29 +17559,29 @@ function ensure_cursor_bridge(project_root, force) {
|
|
|
17527
17559
|
}
|
|
17528
17560
|
const bridge = { version: 1, hooks };
|
|
17529
17561
|
return merge_json_file(
|
|
17530
|
-
|
|
17562
|
+
path13.join(project_root, ".cursor", "hooks.json"),
|
|
17531
17563
|
bridge,
|
|
17532
17564
|
force,
|
|
17533
17565
|
".cursor/hooks.json"
|
|
17534
17566
|
);
|
|
17535
17567
|
}
|
|
17536
|
-
var CURSOR_USER_DIR =
|
|
17537
|
-
var CURSOR_USER_HOOKS_DIR =
|
|
17568
|
+
var CURSOR_USER_DIR = path13.join(os7.homedir(), ".cursor");
|
|
17569
|
+
var CURSOR_USER_HOOKS_DIR = path13.join(CURSOR_USER_DIR, "hooks");
|
|
17538
17570
|
var CURSOR_DISPATCHER_TRAMPOLINE = "cursor-dispatcher.sh";
|
|
17539
17571
|
function ensure_cursor_user_hooks(package_root, force) {
|
|
17540
|
-
const src =
|
|
17572
|
+
const src = path13.join(package_root, "scripts", "hooks", CURSOR_DISPATCHER_TRAMPOLINE);
|
|
17541
17573
|
if (!pathExists(src)) {
|
|
17542
17574
|
skip(`cursor trampoline missing in package: ${src}`);
|
|
17543
17575
|
return [];
|
|
17544
17576
|
}
|
|
17545
17577
|
mkdirp(CURSOR_USER_HOOKS_DIR);
|
|
17546
|
-
const dst =
|
|
17578
|
+
const dst = path13.join(CURSOR_USER_HOOKS_DIR, CURSOR_DISPATCHER_TRAMPOLINE);
|
|
17547
17579
|
const src_text = readText(src);
|
|
17548
17580
|
if (pathExists(dst) && readText(dst) === src_text && !force) {
|
|
17549
17581
|
skip(`~/.cursor/hooks/${CURSOR_DISPATCHER_TRAMPOLINE} already up to date`);
|
|
17550
17582
|
} else {
|
|
17551
17583
|
writeText(dst, src_text);
|
|
17552
|
-
|
|
17584
|
+
fs15.chmodSync(dst, 493);
|
|
17553
17585
|
success(`~/.cursor/hooks/${CURSOR_DISPATCHER_TRAMPOLINE} installed`);
|
|
17554
17586
|
}
|
|
17555
17587
|
const hooks = {};
|
|
@@ -17558,7 +17590,7 @@ function ensure_cursor_user_hooks(package_root, force) {
|
|
|
17558
17590
|
}
|
|
17559
17591
|
const settings_patch = { version: 1, hooks };
|
|
17560
17592
|
return merge_json_file(
|
|
17561
|
-
|
|
17593
|
+
path13.join(CURSOR_USER_DIR, "hooks.json"),
|
|
17562
17594
|
settings_patch,
|
|
17563
17595
|
force,
|
|
17564
17596
|
"~/.cursor/hooks.json"
|
|
@@ -17601,12 +17633,12 @@ exit 0
|
|
|
17601
17633
|
`;
|
|
17602
17634
|
}
|
|
17603
17635
|
function ensure_cline_bridge(project_root, force) {
|
|
17604
|
-
const hooks_dir =
|
|
17636
|
+
const hooks_dir = path13.join(project_root, ".clinerules", "hooks");
|
|
17605
17637
|
mkdirp(hooks_dir);
|
|
17606
17638
|
const workspace_quoted = shlexQuote(resolvePath(project_root));
|
|
17607
17639
|
let written = 0;
|
|
17608
17640
|
for (const [ac_event, native_event] of CLINE_DISPATCHER_BINDINGS) {
|
|
17609
|
-
const target =
|
|
17641
|
+
const target = path13.join(hooks_dir, native_event);
|
|
17610
17642
|
const body = clineProjectHookBody(native_event, ac_event, workspace_quoted);
|
|
17611
17643
|
if (pathExists(target) && readText(target) === body && !force) {
|
|
17612
17644
|
continue;
|
|
@@ -17616,7 +17648,7 @@ function ensure_cline_bridge(project_root, force) {
|
|
|
17616
17648
|
continue;
|
|
17617
17649
|
}
|
|
17618
17650
|
writeText(target, body);
|
|
17619
|
-
|
|
17651
|
+
fs15.chmodSync(target, 493);
|
|
17620
17652
|
written += 1;
|
|
17621
17653
|
}
|
|
17622
17654
|
if (written) {
|
|
@@ -17625,27 +17657,27 @@ function ensure_cline_bridge(project_root, force) {
|
|
|
17625
17657
|
skip(".clinerules/hooks/ already up to date");
|
|
17626
17658
|
}
|
|
17627
17659
|
}
|
|
17628
|
-
var CLINE_USER_DIR =
|
|
17660
|
+
var CLINE_USER_DIR = path13.join(os7.homedir(), "Documents", "Cline", "Hooks");
|
|
17629
17661
|
var CLINE_DISPATCHER_TRAMPOLINE = "cline-dispatcher.sh";
|
|
17630
17662
|
function ensure_cline_user_hooks(package_root, force) {
|
|
17631
|
-
const src =
|
|
17663
|
+
const src = path13.join(package_root, "scripts", "hooks", CLINE_DISPATCHER_TRAMPOLINE);
|
|
17632
17664
|
if (!pathExists(src)) {
|
|
17633
17665
|
skip(`cline trampoline missing in package: ${src}`);
|
|
17634
17666
|
return;
|
|
17635
17667
|
}
|
|
17636
17668
|
mkdirp(CLINE_USER_DIR);
|
|
17637
|
-
const trampoline =
|
|
17669
|
+
const trampoline = path13.join(CLINE_USER_DIR, CLINE_DISPATCHER_TRAMPOLINE);
|
|
17638
17670
|
const src_text = readText(src);
|
|
17639
17671
|
if (pathExists(trampoline) && readText(trampoline) === src_text && !force) {
|
|
17640
17672
|
skip(`~/Documents/Cline/Hooks/${CLINE_DISPATCHER_TRAMPOLINE} already up to date`);
|
|
17641
17673
|
} else {
|
|
17642
17674
|
writeText(trampoline, src_text);
|
|
17643
|
-
|
|
17675
|
+
fs15.chmodSync(trampoline, 493);
|
|
17644
17676
|
success(`~/Documents/Cline/Hooks/${CLINE_DISPATCHER_TRAMPOLINE} installed`);
|
|
17645
17677
|
}
|
|
17646
17678
|
const trampoline_quoted = shlexQuote(trampoline);
|
|
17647
17679
|
for (const [ac_event, native_event] of CLINE_DISPATCHER_BINDINGS) {
|
|
17648
|
-
const wrapper =
|
|
17680
|
+
const wrapper = path13.join(CLINE_USER_DIR, native_event);
|
|
17649
17681
|
const body = `#!/usr/bin/env bash
|
|
17650
17682
|
# Generated by event4u/agent-config install.py \u2014 DO NOT EDIT.
|
|
17651
17683
|
# User-scope Cline hook for ${native_event} \u2192 agent-config ${ac_event}.
|
|
@@ -17655,7 +17687,7 @@ exec ${trampoline_quoted} ${ac_event} ${native_event}
|
|
|
17655
17687
|
continue;
|
|
17656
17688
|
}
|
|
17657
17689
|
writeText(wrapper, body);
|
|
17658
|
-
|
|
17690
|
+
fs15.chmodSync(wrapper, 493);
|
|
17659
17691
|
}
|
|
17660
17692
|
}
|
|
17661
17693
|
var WINDSURF_DISPATCHER_BINDINGS = [
|
|
@@ -17676,29 +17708,29 @@ function ensure_windsurf_bridge(project_root, force) {
|
|
|
17676
17708
|
}
|
|
17677
17709
|
const bridge = { hooks };
|
|
17678
17710
|
return merge_json_file(
|
|
17679
|
-
|
|
17711
|
+
path13.join(project_root, ".windsurf", "hooks.json"),
|
|
17680
17712
|
bridge,
|
|
17681
17713
|
force,
|
|
17682
17714
|
".windsurf/hooks.json"
|
|
17683
17715
|
);
|
|
17684
17716
|
}
|
|
17685
|
-
var WINDSURF_USER_DIR =
|
|
17686
|
-
var WINDSURF_USER_HOOKS_DIR =
|
|
17717
|
+
var WINDSURF_USER_DIR = path13.join(os7.homedir(), ".codeium", "windsurf");
|
|
17718
|
+
var WINDSURF_USER_HOOKS_DIR = path13.join(WINDSURF_USER_DIR, "hooks");
|
|
17687
17719
|
var WINDSURF_DISPATCHER_TRAMPOLINE = "windsurf-dispatcher.sh";
|
|
17688
17720
|
function ensure_windsurf_user_hooks(package_root, force) {
|
|
17689
|
-
const src =
|
|
17721
|
+
const src = path13.join(package_root, "scripts", "hooks", WINDSURF_DISPATCHER_TRAMPOLINE);
|
|
17690
17722
|
if (!pathExists(src)) {
|
|
17691
17723
|
skip(`windsurf trampoline missing in package: ${src}`);
|
|
17692
17724
|
return [];
|
|
17693
17725
|
}
|
|
17694
17726
|
mkdirp(WINDSURF_USER_HOOKS_DIR);
|
|
17695
|
-
const dst =
|
|
17727
|
+
const dst = path13.join(WINDSURF_USER_HOOKS_DIR, WINDSURF_DISPATCHER_TRAMPOLINE);
|
|
17696
17728
|
const src_text = readText(src);
|
|
17697
17729
|
if (pathExists(dst) && readText(dst) === src_text && !force) {
|
|
17698
17730
|
skip(`~/.codeium/windsurf/hooks/${WINDSURF_DISPATCHER_TRAMPOLINE} already up to date`);
|
|
17699
17731
|
} else {
|
|
17700
17732
|
writeText(dst, src_text);
|
|
17701
|
-
|
|
17733
|
+
fs15.chmodSync(dst, 493);
|
|
17702
17734
|
success(`~/.codeium/windsurf/hooks/${WINDSURF_DISPATCHER_TRAMPOLINE} installed`);
|
|
17703
17735
|
}
|
|
17704
17736
|
const hooks = {};
|
|
@@ -17710,7 +17742,7 @@ function ensure_windsurf_user_hooks(package_root, force) {
|
|
|
17710
17742
|
}
|
|
17711
17743
|
const settings_patch = { hooks };
|
|
17712
17744
|
return merge_json_file(
|
|
17713
|
-
|
|
17745
|
+
path13.join(WINDSURF_USER_DIR, "hooks.json"),
|
|
17714
17746
|
settings_patch,
|
|
17715
17747
|
force,
|
|
17716
17748
|
"~/.codeium/windsurf/hooks.json"
|
|
@@ -17739,43 +17771,43 @@ function _gemini_hooks_dict(command_factory) {
|
|
|
17739
17771
|
function ensure_gemini_bridge(project_root, force) {
|
|
17740
17772
|
const bridge = { hooks: _gemini_hooks_dict(_gemini_dispatch_command) };
|
|
17741
17773
|
return merge_json_file(
|
|
17742
|
-
|
|
17774
|
+
path13.join(project_root, ".gemini", "settings.json"),
|
|
17743
17775
|
bridge,
|
|
17744
17776
|
force,
|
|
17745
17777
|
".gemini/settings.json"
|
|
17746
17778
|
);
|
|
17747
17779
|
}
|
|
17748
|
-
var GEMINI_USER_DIR =
|
|
17749
|
-
var GEMINI_USER_HOOKS_DIR =
|
|
17780
|
+
var GEMINI_USER_DIR = path13.join(os7.homedir(), ".gemini");
|
|
17781
|
+
var GEMINI_USER_HOOKS_DIR = path13.join(GEMINI_USER_DIR, "hooks");
|
|
17750
17782
|
var GEMINI_DISPATCHER_TRAMPOLINE = "gemini-dispatcher.sh";
|
|
17751
17783
|
function ensure_gemini_user_hooks(package_root, force) {
|
|
17752
|
-
const src =
|
|
17784
|
+
const src = path13.join(package_root, "scripts", "hooks", GEMINI_DISPATCHER_TRAMPOLINE);
|
|
17753
17785
|
if (!pathExists(src)) {
|
|
17754
17786
|
skip(`gemini trampoline missing in package: ${src}`);
|
|
17755
17787
|
return [];
|
|
17756
17788
|
}
|
|
17757
17789
|
mkdirp(GEMINI_USER_HOOKS_DIR);
|
|
17758
|
-
const dst =
|
|
17790
|
+
const dst = path13.join(GEMINI_USER_HOOKS_DIR, GEMINI_DISPATCHER_TRAMPOLINE);
|
|
17759
17791
|
const src_text = readText(src);
|
|
17760
17792
|
if (pathExists(dst) && readText(dst) === src_text && !force) {
|
|
17761
17793
|
skip(`~/.gemini/hooks/${GEMINI_DISPATCHER_TRAMPOLINE} already up to date`);
|
|
17762
17794
|
} else {
|
|
17763
17795
|
writeText(dst, src_text);
|
|
17764
|
-
|
|
17796
|
+
fs15.chmodSync(dst, 493);
|
|
17765
17797
|
success(`~/.gemini/hooks/${GEMINI_DISPATCHER_TRAMPOLINE} installed`);
|
|
17766
17798
|
}
|
|
17767
17799
|
const settings_patch = {
|
|
17768
17800
|
hooks: _gemini_hooks_dict((ac_event, native) => `${dst} ${ac_event} ${native}`)
|
|
17769
17801
|
};
|
|
17770
17802
|
return merge_json_file(
|
|
17771
|
-
|
|
17803
|
+
path13.join(GEMINI_USER_DIR, "settings.json"),
|
|
17772
17804
|
settings_patch,
|
|
17773
17805
|
force,
|
|
17774
17806
|
"~/.gemini/settings.json"
|
|
17775
17807
|
);
|
|
17776
17808
|
}
|
|
17777
17809
|
function ensure_copilot_bridge(project_root, force) {
|
|
17778
|
-
const target =
|
|
17810
|
+
const target = path13.join(project_root, ".github", "plugin", "marketplace.json");
|
|
17779
17811
|
const bridge = {
|
|
17780
17812
|
marketplace: {
|
|
17781
17813
|
name: "event4u-agent-marketplace",
|
|
@@ -17818,7 +17850,7 @@ See \`docs/setup/per-ide/roocode.md\` for the full activation guide.
|
|
|
17818
17850
|
Run \`./agent-config --help\` for available commands.
|
|
17819
17851
|
`;
|
|
17820
17852
|
function ensure_roocode_bridge(project_root, force) {
|
|
17821
|
-
const target =
|
|
17853
|
+
const target = path13.join(project_root, ".roo", "rules", "agent-config.md");
|
|
17822
17854
|
if (pathExists(target) && !force) {
|
|
17823
17855
|
skip(".roo/rules/agent-config.md already exists");
|
|
17824
17856
|
return;
|
|
@@ -17840,7 +17872,7 @@ To wire Claude Desktop to this project's rules, run:
|
|
|
17840
17872
|
Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
|
|
17841
17873
|
`;
|
|
17842
17874
|
function ensure_claude_desktop_bridge(project_root, force) {
|
|
17843
|
-
const target =
|
|
17875
|
+
const target = path13.join(project_root, ".claude-desktop", "agent-config.md");
|
|
17844
17876
|
if (pathExists(target) && !force) {
|
|
17845
17877
|
skip(".claude-desktop/agent-config.md already exists");
|
|
17846
17878
|
return;
|
|
@@ -17865,7 +17897,7 @@ Or pass \`--read .aider/agent-config.md\` on the command line.
|
|
|
17865
17897
|
Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
|
|
17866
17898
|
`;
|
|
17867
17899
|
function ensure_aider_bridge(project_root, force) {
|
|
17868
|
-
const target =
|
|
17900
|
+
const target = path13.join(project_root, ".aider", "agent-config.md");
|
|
17869
17901
|
if (pathExists(target) && !force) {
|
|
17870
17902
|
skip(".aider/agent-config.md already exists");
|
|
17871
17903
|
return;
|
|
@@ -17884,7 +17916,7 @@ developers where the rules and skills live.
|
|
|
17884
17916
|
Canonical rule and skill source: \`.augment/\` (see project \`AGENTS.md\`).
|
|
17885
17917
|
`;
|
|
17886
17918
|
function ensure_codex_bridge(project_root, force) {
|
|
17887
|
-
const target =
|
|
17919
|
+
const target = path13.join(project_root, ".codex", "agent-config.md");
|
|
17888
17920
|
if (pathExists(target) && !force) {
|
|
17889
17921
|
skip(".codex/agent-config.md already exists");
|
|
17890
17922
|
return;
|
|
@@ -17902,7 +17934,7 @@ rules per session. The canonical rule and skill source lives under
|
|
|
17902
17934
|
orientation).
|
|
17903
17935
|
`;
|
|
17904
17936
|
function ensure_continue_bridge(project_root, force) {
|
|
17905
|
-
const target =
|
|
17937
|
+
const target = path13.join(project_root, ".continue", "rules", "agent-config.md");
|
|
17906
17938
|
if (pathExists(target) && !force) {
|
|
17907
17939
|
skip(".continue/rules/agent-config.md already exists");
|
|
17908
17940
|
return;
|
|
@@ -17933,7 +17965,7 @@ orientation).
|
|
|
17933
17965
|
See \`docs/setup/per-ide/kilocode.md\` for the full activation guide.
|
|
17934
17966
|
`;
|
|
17935
17967
|
function ensure_kilocode_bridge(project_root, force) {
|
|
17936
|
-
const target =
|
|
17968
|
+
const target = path13.join(project_root, ".kilocode", "rules", "agent-config.md");
|
|
17937
17969
|
if (pathExists(target) && !force) {
|
|
17938
17970
|
skip(".kilocode/rules/agent-config.md already exists");
|
|
17939
17971
|
return;
|
|
@@ -17960,7 +17992,7 @@ canonical source (or symlink it):
|
|
|
17960
17992
|
Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
|
|
17961
17993
|
`;
|
|
17962
17994
|
function ensure_zed_bridge(project_root, force) {
|
|
17963
|
-
const target =
|
|
17995
|
+
const target = path13.join(project_root, ".zed", "agent-config.md");
|
|
17964
17996
|
if (pathExists(target) && !force) {
|
|
17965
17997
|
skip(".zed/agent-config.md already exists");
|
|
17966
17998
|
return;
|
|
@@ -17981,7 +18013,7 @@ rules into your JetBrains profile.
|
|
|
17981
18013
|
Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
|
|
17982
18014
|
`;
|
|
17983
18015
|
function ensure_jetbrains_bridge(project_root, force) {
|
|
17984
|
-
const target =
|
|
18016
|
+
const target = path13.join(project_root, ".jetbrains", "agent-config.md");
|
|
17985
18017
|
if (pathExists(target) && !force) {
|
|
17986
18018
|
skip(".jetbrains/agent-config.md already exists");
|
|
17987
18019
|
return;
|
|
@@ -18012,7 +18044,7 @@ session. The canonical rule and skill source lives under \`.augment/\`
|
|
|
18012
18044
|
See \`docs/setup/per-ide/kiro.md\` for the full activation guide.
|
|
18013
18045
|
`;
|
|
18014
18046
|
function ensure_kiro_bridge(project_root, force) {
|
|
18015
|
-
const target =
|
|
18047
|
+
const target = path13.join(project_root, ".kiro", "steering", "agent-config.md");
|
|
18016
18048
|
if (pathExists(target) && !force) {
|
|
18017
18049
|
skip(".kiro/steering/agent-config.md already exists");
|
|
18018
18050
|
return;
|
|
@@ -18038,35 +18070,35 @@ var SMOKE_BRIDGE_PATHS = {
|
|
|
18038
18070
|
};
|
|
18039
18071
|
function dirHasEntries(p) {
|
|
18040
18072
|
try {
|
|
18041
|
-
return
|
|
18073
|
+
return fs15.readdirSync(p).length > 0;
|
|
18042
18074
|
} catch {
|
|
18043
18075
|
return false;
|
|
18044
18076
|
}
|
|
18045
18077
|
}
|
|
18046
18078
|
function _resolve_tsx_invocation(scriptPath, scriptArgs) {
|
|
18047
18079
|
const binName = process3.platform === "win32" ? "tsx.cmd" : "tsx";
|
|
18048
|
-
let dir =
|
|
18080
|
+
let dir = path13.dirname(scriptPath);
|
|
18049
18081
|
for (; ; ) {
|
|
18050
|
-
const candidate =
|
|
18082
|
+
const candidate = path13.join(dir, "node_modules", ".bin", binName);
|
|
18051
18083
|
if (isFile(candidate)) {
|
|
18052
18084
|
return { command: candidate, args: [scriptPath, ...scriptArgs] };
|
|
18053
18085
|
}
|
|
18054
|
-
const parent =
|
|
18086
|
+
const parent = path13.dirname(dir);
|
|
18055
18087
|
if (parent === dir) break;
|
|
18056
18088
|
dir = parent;
|
|
18057
18089
|
}
|
|
18058
18090
|
return { command: "npx", args: ["tsx", scriptPath, ...scriptArgs] };
|
|
18059
18091
|
}
|
|
18060
18092
|
function _smoke_test_hooks(project_root, package_root) {
|
|
18061
|
-
const dispatcher =
|
|
18062
|
-
const manifest =
|
|
18093
|
+
const dispatcher = path13.join(package_root, "scripts", "hooks", "dispatch_hook.ts");
|
|
18094
|
+
const manifest = path13.join(package_root, "scripts", "hook_manifest.yaml");
|
|
18063
18095
|
if (!isFile(dispatcher) || !isFile(manifest)) return 0;
|
|
18064
18096
|
const failed = [];
|
|
18065
18097
|
const skipped = [];
|
|
18066
18098
|
const passed = [];
|
|
18067
18099
|
for (const [platform, native] of SMOKE_PROBE_EVENTS) {
|
|
18068
18100
|
const rel_bridge = SMOKE_BRIDGE_PATHS[platform] ?? "";
|
|
18069
|
-
const bridge_path = rel_bridge ?
|
|
18101
|
+
const bridge_path = rel_bridge ? path13.join(project_root, rel_bridge) : null;
|
|
18070
18102
|
const bridge_present = Boolean(
|
|
18071
18103
|
bridge_path && (isFile(bridge_path) || isDir(bridge_path) && dirHasEntries(bridge_path))
|
|
18072
18104
|
);
|
|
@@ -18266,9 +18298,9 @@ To remove this marker, delete this file.
|
|
|
18266
18298
|
`;
|
|
18267
18299
|
}
|
|
18268
18300
|
var _CLAUDE_DESKTOP_BUNDLES_SUBPATH = "claude-desktop/bundles";
|
|
18269
|
-
var GLOBAL_ROOT =
|
|
18270
|
-
var GLOBAL_USER_SETTINGS_PATH =
|
|
18271
|
-
var GLOBAL_AGENT_SETTINGS_PATH =
|
|
18301
|
+
var GLOBAL_ROOT = path13.join(os7.homedir(), ".event4u", "agent-config");
|
|
18302
|
+
var GLOBAL_USER_SETTINGS_PATH = path13.join(GLOBAL_ROOT, ".agent-user.yml");
|
|
18303
|
+
var GLOBAL_AGENT_SETTINGS_PATH = path13.join(GLOBAL_ROOT, ".agent-settings.yml");
|
|
18272
18304
|
function _bridge_marker(tool_id, scope) {
|
|
18273
18305
|
if (scope === "global") return USER_SCOPE_PATHS[tool_id] ?? "";
|
|
18274
18306
|
return PROJECT_BRIDGE_MARKERS[tool_id] ?? "";
|
|
@@ -18317,7 +18349,7 @@ function _load_yaml_doc(p) {
|
|
|
18317
18349
|
return _isPlainObject2(data) ? data : {};
|
|
18318
18350
|
}
|
|
18319
18351
|
function _load_default_settings(package_root) {
|
|
18320
|
-
const template_source =
|
|
18352
|
+
const template_source = path13.join(package_root, "src", "config", "agent-settings.template.yml");
|
|
18321
18353
|
if (!pathExists(template_source)) return {};
|
|
18322
18354
|
let text;
|
|
18323
18355
|
try {
|
|
@@ -18405,9 +18437,9 @@ function detect_scope(cwd) {
|
|
|
18405
18437
|
if (pathExists(_resolve_settings_read(cwd))) {
|
|
18406
18438
|
return ["project", `existing ${SETTINGS_FILE}`];
|
|
18407
18439
|
}
|
|
18408
|
-
const has_manifest = SCOPE_DETECT_MANIFESTS.find((m) => pathExists(
|
|
18409
|
-
const has_ai_dir = SCOPE_DETECT_AI_DIRS.find((d) => isDir(
|
|
18410
|
-
const has_ai_file = SCOPE_DETECT_AI_FILES.find((f) => pathExists(
|
|
18440
|
+
const has_manifest = SCOPE_DETECT_MANIFESTS.find((m) => pathExists(path13.join(cwd, m))) ?? null;
|
|
18441
|
+
const has_ai_dir = SCOPE_DETECT_AI_DIRS.find((d) => isDir(path13.join(cwd, d))) ?? null;
|
|
18442
|
+
const has_ai_file = SCOPE_DETECT_AI_FILES.find((f) => pathExists(path13.join(cwd, f))) ?? null;
|
|
18411
18443
|
if (has_manifest && (has_ai_dir || has_ai_file)) {
|
|
18412
18444
|
const marker = has_ai_dir || has_ai_file;
|
|
18413
18445
|
return ["prompt", `manifest (${has_manifest}) + AI-tool config (${marker})`];
|
|
@@ -18428,7 +18460,7 @@ function readLineSyncRaw(promptText) {
|
|
|
18428
18460
|
for (; ; ) {
|
|
18429
18461
|
let n;
|
|
18430
18462
|
try {
|
|
18431
|
-
n =
|
|
18463
|
+
n = fs15.readSync(0, buf, 0, 1, null);
|
|
18432
18464
|
} catch (err) {
|
|
18433
18465
|
const code = err.code;
|
|
18434
18466
|
if (code === "EAGAIN") {
|
|
@@ -18503,8 +18535,8 @@ function _files_by_tool_from_bridges(tools, project_root, scope) {
|
|
|
18503
18535
|
const marker = _bridge_marker(tool_id, scope);
|
|
18504
18536
|
if (!marker) continue;
|
|
18505
18537
|
let marker_path = marker;
|
|
18506
|
-
if (!
|
|
18507
|
-
marker_path =
|
|
18538
|
+
if (!path13.isAbsolute(marker_path)) {
|
|
18539
|
+
marker_path = path13.join(project_root, marker_path);
|
|
18508
18540
|
}
|
|
18509
18541
|
out[tool_id] = [_file_entry(marker_path, "bridge", false)];
|
|
18510
18542
|
}
|
|
@@ -18543,26 +18575,26 @@ function _update_installed_tools_manifest(project_root, tools, scope, force, fil
|
|
|
18543
18575
|
}
|
|
18544
18576
|
write_manifest(target, version, entries);
|
|
18545
18577
|
if (!state.QUIET) {
|
|
18546
|
-
const rel = isRelativeTo(target, project_root) ?
|
|
18578
|
+
const rel = isRelativeTo(target, project_root) ? path13.relative(project_root, target) : target;
|
|
18547
18579
|
info(`Manifest updated: ${rel}`);
|
|
18548
18580
|
}
|
|
18549
18581
|
return 0;
|
|
18550
18582
|
}
|
|
18551
18583
|
function isRelativeTo(child, parent) {
|
|
18552
|
-
const rel =
|
|
18553
|
-
return rel === "" || !rel.startsWith("..") && !
|
|
18584
|
+
const rel = path13.relative(parent, child);
|
|
18585
|
+
return rel === "" || !rel.startsWith("..") && !path13.isAbsolute(rel);
|
|
18554
18586
|
}
|
|
18555
18587
|
function _resolve_package_root_for_global() {
|
|
18556
18588
|
const here = resolvePath(_HERE2);
|
|
18557
|
-
const candidate =
|
|
18558
|
-
if (!pathExists(
|
|
18589
|
+
const candidate = path13.dirname(path13.dirname(path13.dirname(here)));
|
|
18590
|
+
if (!pathExists(path13.join(candidate, "src", "config", "profiles", "minimal.ini"))) {
|
|
18559
18591
|
fail(
|
|
18560
18592
|
`Could not locate agent-config package root from ${here}. Expected src/config/profiles/minimal.ini at the parent directory.`
|
|
18561
18593
|
);
|
|
18562
18594
|
}
|
|
18563
18595
|
return candidate;
|
|
18564
18596
|
}
|
|
18565
|
-
var CONSUMER_BRIDGE_MARKER_RELPATH =
|
|
18597
|
+
var CONSUMER_BRIDGE_MARKER_RELPATH = path13.join("agents", ".event4u-bridge.yml");
|
|
18566
18598
|
var MIGRATE_LEGACY_YAML_FILES = [".agent-settings.yml", ".agent-user.yml"];
|
|
18567
18599
|
var MIGRATE_LEGACY_TOOL_DIRS = [".augment", ".claude", ".cursor"];
|
|
18568
18600
|
var AGENT_CONFIG_PACKAGE_NAME = "@event4u/agent-config";
|
|
@@ -18570,7 +18602,7 @@ function _is_agent_config_source_repo(project_root) {
|
|
|
18570
18602
|
if (process3.env["AGENT_CONFIG_CONSUMER_MODE"] === "1") {
|
|
18571
18603
|
return [false, "consumer-mode-override"];
|
|
18572
18604
|
}
|
|
18573
|
-
const pkg_json =
|
|
18605
|
+
const pkg_json = path13.join(project_root, "package.json");
|
|
18574
18606
|
if (isFile(pkg_json)) {
|
|
18575
18607
|
let data = {};
|
|
18576
18608
|
try {
|
|
@@ -18582,18 +18614,18 @@ function _is_agent_config_source_repo(project_root) {
|
|
|
18582
18614
|
return [true, "package.json:name"];
|
|
18583
18615
|
}
|
|
18584
18616
|
}
|
|
18585
|
-
if (isDir(
|
|
18617
|
+
if (isDir(path13.join(project_root, ".agent-src.uncondensed"))) {
|
|
18586
18618
|
return [true, ".agent-src.uncondensed/"];
|
|
18587
18619
|
}
|
|
18588
|
-
const packages_dir =
|
|
18620
|
+
const packages_dir = path13.join(project_root, "packages");
|
|
18589
18621
|
if (isDir(packages_dir)) {
|
|
18590
|
-
for (const child of
|
|
18591
|
-
if (isDir(
|
|
18622
|
+
for (const child of fs15.readdirSync(packages_dir)) {
|
|
18623
|
+
if (isDir(path13.join(packages_dir, child, ".agent-src.uncondensed"))) {
|
|
18592
18624
|
return [true, `packages/${child}/.agent-src.uncondensed/`];
|
|
18593
18625
|
}
|
|
18594
18626
|
}
|
|
18595
18627
|
}
|
|
18596
|
-
const installer_self =
|
|
18628
|
+
const installer_self = path13.join(project_root, "scripts", "install.py");
|
|
18597
18629
|
try {
|
|
18598
18630
|
if (isFile(installer_self) && resolvePath(installer_self) === resolvePath(_HERE2)) {
|
|
18599
18631
|
return [true, "src/scripts/install.py (self)"];
|
|
@@ -18613,17 +18645,17 @@ function _detect_legacy_for_migration(project_root) {
|
|
|
18613
18645
|
}
|
|
18614
18646
|
return [];
|
|
18615
18647
|
}
|
|
18616
|
-
if (isFile(
|
|
18648
|
+
if (isFile(path13.join(project_root, INSTALL_MODE_MARKER_REL))) return [];
|
|
18617
18649
|
const found = [];
|
|
18618
18650
|
for (const name of MIGRATE_LEGACY_YAML_FILES) {
|
|
18619
|
-
if (isFile(
|
|
18651
|
+
if (isFile(path13.join(project_root, name))) {
|
|
18620
18652
|
found.push(name);
|
|
18621
|
-
} else if (isFile(
|
|
18653
|
+
} else if (isFile(path13.join(project_root, "settings", name))) {
|
|
18622
18654
|
found.push(`settings/${name}`);
|
|
18623
18655
|
}
|
|
18624
18656
|
}
|
|
18625
18657
|
for (const name of MIGRATE_LEGACY_TOOL_DIRS) {
|
|
18626
|
-
const p =
|
|
18658
|
+
const p = path13.join(project_root, name);
|
|
18627
18659
|
if (isDir(p) && !isSymlink(p)) {
|
|
18628
18660
|
found.push(`${name}/`);
|
|
18629
18661
|
}
|
|
@@ -18635,7 +18667,7 @@ function _prompt_migrate_to_global(project_root, artefacts) {
|
|
|
18635
18667
|
process3.stdout.write("\n");
|
|
18636
18668
|
warn("Legacy project-local artefacts detected \u2014 pre-ADR-020 layout:");
|
|
18637
18669
|
for (const rel of artefacts) {
|
|
18638
|
-
info(` ${
|
|
18670
|
+
info(` ${path13.join(project_root, rel)}`);
|
|
18639
18671
|
}
|
|
18640
18672
|
info("The unified `agent-config migrate` sweeps these in one pass.");
|
|
18641
18673
|
info("The wizard recreates fresh config afterwards.");
|
|
@@ -18666,20 +18698,20 @@ function _run_migrate_to_global(project_root) {
|
|
|
18666
18698
|
function _format_global_root_for_marker(global_root) {
|
|
18667
18699
|
const home = resolvePath(os7.homedir());
|
|
18668
18700
|
const resolved = resolvePath(global_root);
|
|
18669
|
-
const rel =
|
|
18670
|
-
if (rel === "" || rel.startsWith("..") ||
|
|
18701
|
+
const rel = path13.relative(home, resolved);
|
|
18702
|
+
if (rel === "" || rel.startsWith("..") || path13.isAbsolute(rel)) {
|
|
18671
18703
|
return global_root;
|
|
18672
18704
|
}
|
|
18673
|
-
return `~/${rel.split(
|
|
18705
|
+
return `~/${rel.split(path13.sep).join("/")}`;
|
|
18674
18706
|
}
|
|
18675
18707
|
function _remove_legacy_consumer_bridge_marker(project_root, env = null) {
|
|
18676
18708
|
const env_map = env ?? process3.env;
|
|
18677
18709
|
if (env_map["AGENT_CONFIG_DEV_MODE"] === "1") return null;
|
|
18678
|
-
if (isDir(
|
|
18679
|
-
const target =
|
|
18710
|
+
if (isDir(path13.join(project_root, ".agent-src.uncondensed"))) return null;
|
|
18711
|
+
const target = path13.join(project_root, CONSUMER_BRIDGE_MARKER_RELPATH);
|
|
18680
18712
|
if (!isFile(target)) return null;
|
|
18681
18713
|
try {
|
|
18682
|
-
|
|
18714
|
+
fs15.rmSync(target);
|
|
18683
18715
|
} catch {
|
|
18684
18716
|
return null;
|
|
18685
18717
|
}
|
|
@@ -18693,7 +18725,7 @@ var PROJECT_ANCHOR_TOOLS = {
|
|
|
18693
18725
|
function _write_per_tool_project_anchors(project_root, tools, env = null, now = null) {
|
|
18694
18726
|
const env_map = env ?? process3.env;
|
|
18695
18727
|
if (env_map["AGENT_CONFIG_DEV_MODE"] === "1") return [];
|
|
18696
|
-
if (isDir(
|
|
18728
|
+
if (isDir(path13.join(project_root, ".agent-src.uncondensed"))) return [];
|
|
18697
18729
|
const global_root_str = _format_global_root_for_marker(
|
|
18698
18730
|
event4u_root(env_map)
|
|
18699
18731
|
);
|
|
@@ -18702,8 +18734,8 @@ function _write_per_tool_project_anchors(project_root, tools, env = null, now =
|
|
|
18702
18734
|
for (const tool_id of Object.keys(PROJECT_ANCHOR_TOOLS).sort()) {
|
|
18703
18735
|
const rel_path = PROJECT_ANCHOR_TOOLS[tool_id];
|
|
18704
18736
|
if (!tools.has(tool_id)) continue;
|
|
18705
|
-
const target =
|
|
18706
|
-
mkdirp(
|
|
18737
|
+
const target = path13.join(project_root, rel_path);
|
|
18738
|
+
mkdirp(path13.dirname(target));
|
|
18707
18739
|
const body = `# event4u/agent-config \u2014 per-tool project anchor (auto-written).
|
|
18708
18740
|
# Spec: docs/contracts/consumer-bridge.md \xA7 Per-tool anchor strategy.
|
|
18709
18741
|
# Tool: ${tool_id}. Resolves the global install directly \u2014 no
|
|
@@ -18721,7 +18753,7 @@ installed_at: ${stamp}
|
|
|
18721
18753
|
}
|
|
18722
18754
|
var PACKAGE_TAG_ID = "event4u/agent-config";
|
|
18723
18755
|
function _inject_package_tag(target, source, package_root) {
|
|
18724
|
-
if (
|
|
18756
|
+
if (path13.extname(target) !== ".md") return;
|
|
18725
18757
|
let text;
|
|
18726
18758
|
try {
|
|
18727
18759
|
text = readText(target);
|
|
@@ -18749,8 +18781,8 @@ function _inject_package_tag(target, source, package_root) {
|
|
|
18749
18781
|
resolved_src = source;
|
|
18750
18782
|
}
|
|
18751
18783
|
if (package_root !== null) {
|
|
18752
|
-
const rel =
|
|
18753
|
-
if (rel !== "" && !rel.startsWith("..") && !
|
|
18784
|
+
const rel = path13.relative(resolvePath(package_root), resolved_src);
|
|
18785
|
+
if (rel !== "" && !rel.startsWith("..") && !path13.isAbsolute(rel)) {
|
|
18754
18786
|
source_value = rel;
|
|
18755
18787
|
} else {
|
|
18756
18788
|
source_value = resolved_src;
|
|
@@ -18787,10 +18819,10 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null)
|
|
|
18787
18819
|
const written_paths = [];
|
|
18788
18820
|
if (!pathExists(src)) return [0, 0, written_paths];
|
|
18789
18821
|
if (!isDir(src)) {
|
|
18790
|
-
mkdirp(
|
|
18822
|
+
mkdirp(path13.dirname(dest));
|
|
18791
18823
|
const decision = _resolve_file_conflict(dest, force);
|
|
18792
18824
|
if (decision === "skip") return [0, 1, written_paths];
|
|
18793
|
-
|
|
18825
|
+
fs15.copyFileSync(src, dest);
|
|
18794
18826
|
_inject_package_tag(dest, src, package_root);
|
|
18795
18827
|
written_paths.push(dest);
|
|
18796
18828
|
return [1, 0, written_paths];
|
|
@@ -18798,11 +18830,11 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null)
|
|
|
18798
18830
|
mkdirp(dest);
|
|
18799
18831
|
const walk = (node) => {
|
|
18800
18832
|
const acc = [];
|
|
18801
|
-
const names =
|
|
18833
|
+
const names = fs15.readdirSync(node).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
18802
18834
|
for (const name of names) {
|
|
18803
|
-
const entry =
|
|
18835
|
+
const entry = path13.join(node, name);
|
|
18804
18836
|
acc.push(entry);
|
|
18805
|
-
const lst =
|
|
18837
|
+
const lst = fs15.lstatSync(entry);
|
|
18806
18838
|
if (lst.isDirectory() && !lst.isSymbolicLink()) {
|
|
18807
18839
|
acc.push(...walk(entry));
|
|
18808
18840
|
}
|
|
@@ -18810,9 +18842,9 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null)
|
|
|
18810
18842
|
return acc;
|
|
18811
18843
|
};
|
|
18812
18844
|
for (const entry of walk(src)) {
|
|
18813
|
-
const rel =
|
|
18814
|
-
const target =
|
|
18815
|
-
const lst =
|
|
18845
|
+
const rel = path13.relative(src, entry);
|
|
18846
|
+
const target = path13.join(dest, rel);
|
|
18847
|
+
const lst = fs15.lstatSync(entry);
|
|
18816
18848
|
if (lst.isDirectory() && !lst.isSymbolicLink()) {
|
|
18817
18849
|
mkdirp(target);
|
|
18818
18850
|
continue;
|
|
@@ -18820,8 +18852,8 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null)
|
|
|
18820
18852
|
let resolvedIsDir = false;
|
|
18821
18853
|
let resolved = entry;
|
|
18822
18854
|
try {
|
|
18823
|
-
resolved =
|
|
18824
|
-
resolvedIsDir =
|
|
18855
|
+
resolved = fs15.realpathSync(entry);
|
|
18856
|
+
resolvedIsDir = fs15.statSync(entry).isDirectory();
|
|
18825
18857
|
} catch {
|
|
18826
18858
|
resolvedIsDir = false;
|
|
18827
18859
|
}
|
|
@@ -18843,8 +18875,8 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null)
|
|
|
18843
18875
|
skipped += 1;
|
|
18844
18876
|
continue;
|
|
18845
18877
|
}
|
|
18846
|
-
mkdirp(
|
|
18847
|
-
|
|
18878
|
+
mkdirp(path13.dirname(target));
|
|
18879
|
+
fs15.copyFileSync(resolved, target);
|
|
18848
18880
|
_inject_package_tag(target, resolved, package_root);
|
|
18849
18881
|
written += 1;
|
|
18850
18882
|
written_paths.push(target);
|
|
@@ -18856,7 +18888,7 @@ function _claude_desktop_bundles_dir() {
|
|
|
18856
18888
|
}
|
|
18857
18889
|
function _write_claude_desktop_marker(_force, lockfile_path2, bundles_dir, bundle_count) {
|
|
18858
18890
|
const anchor = expanduser6(USER_SCOPE_PATHS["claude-desktop"]);
|
|
18859
|
-
const target =
|
|
18891
|
+
const target = path13.join(anchor, "agent-config.md");
|
|
18860
18892
|
mkdirp(anchor);
|
|
18861
18893
|
const body = claudeDesktopMarkerBody(lockfile_path2, anchor, bundles_dir, bundle_count);
|
|
18862
18894
|
writeText(target, body);
|
|
@@ -18880,23 +18912,23 @@ function _apply_claude_flat_command_wrappers(anchor, package_root, current_files
|
|
|
18880
18912
|
const wrapped = [];
|
|
18881
18913
|
const collisions = [];
|
|
18882
18914
|
const reserved = [];
|
|
18883
|
-
const commands_dir =
|
|
18915
|
+
const commands_dir = path13.join(anchor, "commands");
|
|
18884
18916
|
let flat_entries = [];
|
|
18885
18917
|
try {
|
|
18886
|
-
flat_entries =
|
|
18918
|
+
flat_entries = fs15.readdirSync(commands_dir).filter((f) => f.endsWith(".md"));
|
|
18887
18919
|
} catch {
|
|
18888
18920
|
}
|
|
18889
18921
|
for (const fname of flat_entries.sort()) {
|
|
18890
18922
|
const slug = fname.slice(0, -".md".length);
|
|
18891
18923
|
if (!is_claude_builtin_name(slug)) continue;
|
|
18892
|
-
|
|
18924
|
+
fs15.rmSync(path13.join(commands_dir, fname), { force: true });
|
|
18893
18925
|
current_files.delete(`commands/${fname}`);
|
|
18894
18926
|
reserved.push(slug);
|
|
18895
18927
|
}
|
|
18896
18928
|
const eligible = new Set(_CLAUDE_FLAT_WRAPPER_EXTRA);
|
|
18897
18929
|
try {
|
|
18898
18930
|
const manifest = JSON.parse(
|
|
18899
|
-
|
|
18931
|
+
fs15.readFileSync(path13.join(package_root, "dist", "discovery", "discovery-manifest.json"), "utf8")
|
|
18900
18932
|
);
|
|
18901
18933
|
for (const a of manifest.artefacts ?? []) {
|
|
18902
18934
|
if (a.category !== "command" || typeof a.slug !== "string") continue;
|
|
@@ -18907,22 +18939,22 @@ function _apply_claude_flat_command_wrappers(anchor, package_root, current_files
|
|
|
18907
18939
|
}
|
|
18908
18940
|
for (const slug of [...eligible].sort()) {
|
|
18909
18941
|
const flat_rel = `commands/${slug}.md`;
|
|
18910
|
-
const flat_abs =
|
|
18911
|
-
if (!
|
|
18912
|
-
const skill_dir =
|
|
18913
|
-
if (
|
|
18942
|
+
const flat_abs = path13.join(anchor, "commands", `${slug}.md`);
|
|
18943
|
+
if (!fs15.existsSync(flat_abs)) continue;
|
|
18944
|
+
const skill_dir = path13.join(anchor, "skills", slug);
|
|
18945
|
+
if (fs15.existsSync(skill_dir)) {
|
|
18914
18946
|
collisions.push(slug);
|
|
18915
18947
|
continue;
|
|
18916
18948
|
}
|
|
18917
|
-
let body =
|
|
18949
|
+
let body = fs15.readFileSync(flat_abs, "utf8");
|
|
18918
18950
|
if (body.startsWith("---\n") && !/^name:/m.test(body.split("\n---")[0] ?? "")) {
|
|
18919
18951
|
body = body.replace("---\n", `---
|
|
18920
18952
|
name: ${slug}
|
|
18921
18953
|
`);
|
|
18922
18954
|
}
|
|
18923
|
-
|
|
18924
|
-
|
|
18925
|
-
|
|
18955
|
+
fs15.mkdirSync(skill_dir, { recursive: true });
|
|
18956
|
+
fs15.writeFileSync(path13.join(skill_dir, "SKILL.md"), body, "utf8");
|
|
18957
|
+
fs15.rmSync(flat_abs, { force: true });
|
|
18926
18958
|
current_files.delete(flat_rel);
|
|
18927
18959
|
current_files.add(`skills/${slug}/SKILL.md`);
|
|
18928
18960
|
wrapped.push(slug);
|
|
@@ -18953,8 +18985,8 @@ function _deploy_global_content(tools, force, package_root, lockfile_path2) {
|
|
|
18953
18985
|
const written_paths = [];
|
|
18954
18986
|
let current_files = /* @__PURE__ */ new Set();
|
|
18955
18987
|
for (const [src_rel, dest_sub] of plan) {
|
|
18956
|
-
const src =
|
|
18957
|
-
const dest = dest_sub ?
|
|
18988
|
+
const src = path13.join(package_root, src_rel);
|
|
18989
|
+
const dest = dest_sub ? path13.join(anchor, dest_sub) : anchor;
|
|
18958
18990
|
const [w, s, paths] = _copy_dir_dereferencing_symlinks(src, dest, force, package_root);
|
|
18959
18991
|
written_total += w;
|
|
18960
18992
|
skipped_total += s;
|
|
@@ -19017,10 +19049,10 @@ function _deploy_global_content(tools, force, package_root, lockfile_path2) {
|
|
|
19017
19049
|
results[tool_id] = [written_total, skipped_total, "deployed", written_paths];
|
|
19018
19050
|
if (tool_id === "claude-code") {
|
|
19019
19051
|
try {
|
|
19020
|
-
const manifest =
|
|
19052
|
+
const manifest = path13.join(package_root, "src", "scripts", "hook_manifest.yaml");
|
|
19021
19053
|
const matrix = build_claude_hook_matrix(manifest);
|
|
19022
19054
|
const res = ensure_managed_hooks(
|
|
19023
|
-
|
|
19055
|
+
path13.join(anchor, "settings.json"),
|
|
19024
19056
|
matrix
|
|
19025
19057
|
);
|
|
19026
19058
|
if (!state.QUIET) {
|
|
@@ -19056,7 +19088,7 @@ function _preview_global_reap(tools, package_root) {
|
|
|
19056
19088
|
const anchor = expanduser6(anchor_raw);
|
|
19057
19089
|
let current_files = /* @__PURE__ */ new Set();
|
|
19058
19090
|
for (const [src_rel, dest_sub] of plan) {
|
|
19059
|
-
const src =
|
|
19091
|
+
const src = path13.join(package_root, src_rel);
|
|
19060
19092
|
current_files = setUnion(
|
|
19061
19093
|
current_files,
|
|
19062
19094
|
expected_deploy_files(src, dest_sub ? dest_sub : "")
|
|
@@ -19086,14 +19118,14 @@ function _preview_global_reap(tools, package_root) {
|
|
|
19086
19118
|
function _verify_deploy_targets(anchor, plan) {
|
|
19087
19119
|
const missing = [];
|
|
19088
19120
|
for (const [, dest_sub] of plan) {
|
|
19089
|
-
const target = dest_sub ?
|
|
19121
|
+
const target = dest_sub ? path13.join(anchor, dest_sub) : anchor;
|
|
19090
19122
|
const label = dest_sub || ".";
|
|
19091
19123
|
if (!isDir(target)) {
|
|
19092
19124
|
missing.push(label);
|
|
19093
19125
|
continue;
|
|
19094
19126
|
}
|
|
19095
19127
|
try {
|
|
19096
|
-
const entries =
|
|
19128
|
+
const entries = fs15.readdirSync(target);
|
|
19097
19129
|
if (entries.length === 0) missing.push(label);
|
|
19098
19130
|
} catch {
|
|
19099
19131
|
missing.push(label);
|
|
@@ -19108,13 +19140,13 @@ function _prune_modules_by(deploy_results, is_pruned) {
|
|
|
19108
19140
|
const [written, skipped, status, paths] = deploy_results[tool_id];
|
|
19109
19141
|
const pruned_skill_dirs = /* @__PURE__ */ new Set();
|
|
19110
19142
|
for (const p of paths) {
|
|
19111
|
-
const parts = p.split(
|
|
19143
|
+
const parts = p.split(path13.sep);
|
|
19112
19144
|
if (parts.includes("skills")) {
|
|
19113
19145
|
const i = parts.indexOf("skills");
|
|
19114
19146
|
if (i + 1 < parts.length) {
|
|
19115
|
-
const skill_root = parts.slice(0, i + 2).join(
|
|
19147
|
+
const skill_root = parts.slice(0, i + 2).join(path13.sep);
|
|
19116
19148
|
if (!pruned_skill_dirs.has(skill_root)) {
|
|
19117
|
-
const skillmd =
|
|
19149
|
+
const skillmd = path13.join(skill_root, "SKILL.md");
|
|
19118
19150
|
if (pathExists(skillmd) && is_pruned(skillmd)) {
|
|
19119
19151
|
pruned_skill_dirs.add(skill_root);
|
|
19120
19152
|
}
|
|
@@ -19125,25 +19157,25 @@ function _prune_modules_by(deploy_results, is_pruned) {
|
|
|
19125
19157
|
const keep = [];
|
|
19126
19158
|
const delete_files = [];
|
|
19127
19159
|
for (const p of paths) {
|
|
19128
|
-
const parts = p.split(
|
|
19160
|
+
const parts = p.split(path13.sep);
|
|
19129
19161
|
let is_target = false;
|
|
19130
19162
|
if (parts.includes("skills")) {
|
|
19131
19163
|
const i = parts.indexOf("skills");
|
|
19132
|
-
if (i + 1 < parts.length && pruned_skill_dirs.has(parts.slice(0, i + 2).join(
|
|
19164
|
+
if (i + 1 < parts.length && pruned_skill_dirs.has(parts.slice(0, i + 2).join(path13.sep))) {
|
|
19133
19165
|
is_target = true;
|
|
19134
19166
|
}
|
|
19135
|
-
} else if (parts.includes("commands") &&
|
|
19167
|
+
} else if (parts.includes("commands") && path13.extname(p) === ".md" && is_pruned(p)) {
|
|
19136
19168
|
is_target = true;
|
|
19137
19169
|
}
|
|
19138
19170
|
(is_target ? delete_files : keep).push(p);
|
|
19139
19171
|
}
|
|
19140
19172
|
for (const d of pruned_skill_dirs) {
|
|
19141
|
-
|
|
19173
|
+
fs15.rmSync(d, { recursive: true, force: true });
|
|
19142
19174
|
}
|
|
19143
19175
|
for (const p of delete_files) {
|
|
19144
|
-
if (p.split(
|
|
19176
|
+
if (p.split(path13.sep).includes("commands") && pathExists(p)) {
|
|
19145
19177
|
try {
|
|
19146
|
-
|
|
19178
|
+
fs15.unlinkSync(p);
|
|
19147
19179
|
} catch {
|
|
19148
19180
|
}
|
|
19149
19181
|
}
|
|
@@ -19158,7 +19190,7 @@ function _prune_lab_modules(deploy_results, lab_ids) {
|
|
|
19158
19190
|
}
|
|
19159
19191
|
var SCOPED_ACTIVE_WORKSPACES = /* @__PURE__ */ new Set(["engineering", "agent-config-maintainer"]);
|
|
19160
19192
|
function _load_packs_registry(package_root) {
|
|
19161
|
-
const vocab_path =
|
|
19193
|
+
const vocab_path = path13.join(package_root, "src", "config", "discovery", "packs.yml");
|
|
19162
19194
|
const data = yamlSafeLoad(readText(vocab_path));
|
|
19163
19195
|
if (!Array.isArray(data)) {
|
|
19164
19196
|
throw new Error(`packs.yml did not parse to a list: ${vocab_path}`);
|
|
@@ -19207,9 +19239,9 @@ function _compute_active_pack_ids(packs, runtime_active_packs) {
|
|
|
19207
19239
|
}
|
|
19208
19240
|
function _resolve_global_settings_doc() {
|
|
19209
19241
|
const root = event4u_root();
|
|
19210
|
-
const canonical =
|
|
19242
|
+
const canonical = path13.join(root, "settings", SETTINGS_FILE);
|
|
19211
19243
|
if (pathExists(canonical)) return _load_yaml_doc(canonical);
|
|
19212
|
-
const legacy =
|
|
19244
|
+
const legacy = path13.join(root, SETTINGS_FILE);
|
|
19213
19245
|
if (pathExists(legacy)) return _load_yaml_doc(legacy);
|
|
19214
19246
|
return null;
|
|
19215
19247
|
}
|
|
@@ -19286,7 +19318,7 @@ function install_global(tools, force, project_root = null, core_only = false) {
|
|
|
19286
19318
|
info(` schema_version=1, agent_config_version=${installed_version}`);
|
|
19287
19319
|
info(` tools=${merged_tools.join(",")}`);
|
|
19288
19320
|
}
|
|
19289
|
-
if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(
|
|
19321
|
+
if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(path13.join(project_root, ".agent-src.uncondensed"))) {
|
|
19290
19322
|
const drift = collect_drift(project_root);
|
|
19291
19323
|
if (!state.QUIET) {
|
|
19292
19324
|
process3.stdout.write("\n");
|
|
@@ -19386,19 +19418,19 @@ function install_global(tools, force, project_root = null, core_only = false) {
|
|
|
19386
19418
|
}
|
|
19387
19419
|
}
|
|
19388
19420
|
}
|
|
19389
|
-
if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(
|
|
19421
|
+
if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(path13.join(project_root, ".agent-src.uncondensed"))) {
|
|
19390
19422
|
const files_by_tool = _files_by_tool_from_deploy(deploy_results);
|
|
19391
19423
|
const rc = _update_installed_tools_manifest(project_root, tools, "global", force, files_by_tool);
|
|
19392
19424
|
if (rc !== 0) return rc;
|
|
19393
19425
|
const removed_marker = _remove_legacy_consumer_bridge_marker(project_root);
|
|
19394
19426
|
if (removed_marker !== null && !state.QUIET) {
|
|
19395
|
-
const rel = isRelativeTo(removed_marker, project_root) ?
|
|
19427
|
+
const rel = isRelativeTo(removed_marker, project_root) ? path13.relative(project_root, removed_marker) : removed_marker;
|
|
19396
19428
|
info(`Removed legacy bridge marker: ${rel}`);
|
|
19397
19429
|
}
|
|
19398
19430
|
const anchor_paths = _write_per_tool_project_anchors(project_root, tools);
|
|
19399
19431
|
if (anchor_paths.length > 0 && !state.QUIET) {
|
|
19400
19432
|
for (const p of anchor_paths) {
|
|
19401
|
-
const rel = isRelativeTo(p, project_root) ?
|
|
19433
|
+
const rel = isRelativeTo(p, project_root) ? path13.relative(project_root, p) : p;
|
|
19402
19434
|
info(`Project anchor written: ${rel}`);
|
|
19403
19435
|
}
|
|
19404
19436
|
}
|
|
@@ -19415,8 +19447,8 @@ function install_global(tools, force, project_root = null, core_only = false) {
|
|
|
19415
19447
|
}
|
|
19416
19448
|
return 0;
|
|
19417
19449
|
}
|
|
19418
|
-
var SETTINGS_SURFACE_REL =
|
|
19419
|
-
var SETTINGS_DELTA_REL =
|
|
19450
|
+
var SETTINGS_SURFACE_REL = path13.join("state", "settings-surface.json");
|
|
19451
|
+
var SETTINGS_DELTA_REL = path13.join("state", "settings-delta.json");
|
|
19420
19452
|
function _current_settings_surface(version) {
|
|
19421
19453
|
const jsonSchema = zodToJsonSchema(settingsSchema, {
|
|
19422
19454
|
name: "AgentSettings",
|
|
@@ -19427,20 +19459,20 @@ function _current_settings_surface(version) {
|
|
|
19427
19459
|
}
|
|
19428
19460
|
function _write_settings_surface_snapshot(installed_version) {
|
|
19429
19461
|
const root = event4u_root();
|
|
19430
|
-
const surface_path =
|
|
19431
|
-
const delta_path =
|
|
19462
|
+
const surface_path = path13.join(root, SETTINGS_SURFACE_REL);
|
|
19463
|
+
const delta_path = path13.join(root, SETTINGS_DELTA_REL);
|
|
19432
19464
|
const next = _current_settings_surface(installed_version);
|
|
19433
19465
|
let previous = null;
|
|
19434
19466
|
try {
|
|
19435
|
-
const parsed = JSON.parse(
|
|
19467
|
+
const parsed = JSON.parse(fs15.readFileSync(surface_path, "utf8"));
|
|
19436
19468
|
if (parsed !== null && typeof parsed === "object" && parsed.entries !== void 0) previous = parsed;
|
|
19437
19469
|
} catch {
|
|
19438
19470
|
}
|
|
19439
19471
|
if (previous !== null && previous.version !== next.version) {
|
|
19440
19472
|
const delta = computeSurfaceDelta(previous, next);
|
|
19441
19473
|
if (delta.changes.length > 0) {
|
|
19442
|
-
|
|
19443
|
-
|
|
19474
|
+
fs15.mkdirSync(path13.dirname(delta_path), { recursive: true, mode: 448 });
|
|
19475
|
+
fs15.writeFileSync(delta_path, `${JSON.stringify(delta, null, 2)}
|
|
19444
19476
|
`, { mode: 384 });
|
|
19445
19477
|
if (!state.QUIET) {
|
|
19446
19478
|
const counts = {};
|
|
@@ -19452,8 +19484,8 @@ function _write_settings_surface_snapshot(installed_version) {
|
|
|
19452
19484
|
}
|
|
19453
19485
|
}
|
|
19454
19486
|
}
|
|
19455
|
-
|
|
19456
|
-
|
|
19487
|
+
fs15.mkdirSync(path13.dirname(surface_path), { recursive: true, mode: 448 });
|
|
19488
|
+
fs15.writeFileSync(surface_path, `${JSON.stringify(next, null, 2)}
|
|
19457
19489
|
`, { mode: 384 });
|
|
19458
19490
|
}
|
|
19459
19491
|
function arrayStrEqual(a, b) {
|
|
@@ -19665,13 +19697,13 @@ function _minimal_templates_root() {
|
|
|
19665
19697
|
const chain = [start];
|
|
19666
19698
|
let cur = start;
|
|
19667
19699
|
for (; ; ) {
|
|
19668
|
-
const parent =
|
|
19700
|
+
const parent = path13.dirname(cur);
|
|
19669
19701
|
if (parent === cur) break;
|
|
19670
19702
|
chain.push(parent);
|
|
19671
19703
|
cur = parent;
|
|
19672
19704
|
}
|
|
19673
19705
|
for (const ancestor of chain) {
|
|
19674
|
-
const candidate =
|
|
19706
|
+
const candidate = path13.join(ancestor, "src", "templates", "minimal");
|
|
19675
19707
|
if (isDir(candidate)) return candidate;
|
|
19676
19708
|
}
|
|
19677
19709
|
fail("Could not locate src/templates/minimal/ \u2014 package install is corrupt.");
|
|
@@ -19679,9 +19711,9 @@ function _minimal_templates_root() {
|
|
|
19679
19711
|
var INSTALL_MODE_MARKER_REL = "agents/.agent-state/install-mode.txt";
|
|
19680
19712
|
function _write_install_mode_marker(project_root, mode) {
|
|
19681
19713
|
if (mode !== "minimal" && mode !== "full") return;
|
|
19682
|
-
const marker =
|
|
19714
|
+
const marker = path13.join(project_root, INSTALL_MODE_MARKER_REL);
|
|
19683
19715
|
try {
|
|
19684
|
-
mkdirp(
|
|
19716
|
+
mkdirp(path13.dirname(marker));
|
|
19685
19717
|
writeText(marker, `${mode}
|
|
19686
19718
|
`);
|
|
19687
19719
|
} catch {
|
|
@@ -19690,7 +19722,7 @@ function _write_install_mode_marker(project_root, mode) {
|
|
|
19690
19722
|
function install_minimal(target_root_in, force, user_type = "") {
|
|
19691
19723
|
let target_root = resolvePath(target_root_in);
|
|
19692
19724
|
mkdirp(target_root);
|
|
19693
|
-
const parent =
|
|
19725
|
+
const parent = path13.dirname(target_root);
|
|
19694
19726
|
if (parent !== target_root) {
|
|
19695
19727
|
const existing = find_project_root_with_anchor(parent);
|
|
19696
19728
|
if (existing !== null && existing[0] !== target_root) {
|
|
@@ -19701,21 +19733,21 @@ function install_minimal(target_root_in, force, user_type = "") {
|
|
|
19701
19733
|
}
|
|
19702
19734
|
}
|
|
19703
19735
|
const templates = _minimal_templates_root();
|
|
19704
|
-
const settings_src =
|
|
19705
|
-
const overrides_gitkeep_src =
|
|
19706
|
-
const overrides_readme_src =
|
|
19736
|
+
const settings_src = path13.join(templates, SETTINGS_FILE);
|
|
19737
|
+
const overrides_gitkeep_src = path13.join(templates, "overrides-gitkeep");
|
|
19738
|
+
const overrides_readme_src = path13.join(templates, "agents-overrides-readme.md");
|
|
19707
19739
|
if (!isFile(settings_src)) fail(`Bundled minimal settings template missing under ${templates}`);
|
|
19708
19740
|
if (!isFile(overrides_gitkeep_src) || !isFile(overrides_readme_src)) {
|
|
19709
19741
|
fail(`Bundled overrides scaffold templates missing under ${templates}`);
|
|
19710
19742
|
}
|
|
19711
19743
|
info(`Minimal init \u2192 ${target_root}`);
|
|
19712
|
-
const overrides_root =
|
|
19744
|
+
const overrides_root = path13.join(target_root, "agents", "overrides");
|
|
19713
19745
|
mkdirp(overrides_root);
|
|
19714
19746
|
const gitkeep_body = readText(overrides_gitkeep_src);
|
|
19715
19747
|
for (const sub of ["rules", "skills", "commands"]) {
|
|
19716
|
-
const sub_dir =
|
|
19748
|
+
const sub_dir = path13.join(overrides_root, sub);
|
|
19717
19749
|
mkdirp(sub_dir);
|
|
19718
|
-
const gitkeep_dst =
|
|
19750
|
+
const gitkeep_dst = path13.join(sub_dir, ".gitkeep");
|
|
19719
19751
|
if (pathExists(gitkeep_dst) && !force) {
|
|
19720
19752
|
skip(`agents/overrides/${sub}/.gitkeep already exists (use --force to overwrite)`);
|
|
19721
19753
|
} else {
|
|
@@ -19723,7 +19755,7 @@ function install_minimal(target_root_in, force, user_type = "") {
|
|
|
19723
19755
|
success(`Wrote agents/overrides/${sub}/.gitkeep`);
|
|
19724
19756
|
}
|
|
19725
19757
|
}
|
|
19726
|
-
const readme_dst =
|
|
19758
|
+
const readme_dst = path13.join(overrides_root, "README.md");
|
|
19727
19759
|
if (pathExists(readme_dst) && !force) {
|
|
19728
19760
|
skip("agents/overrides/README.md already exists (use --force to overwrite)");
|
|
19729
19761
|
} else {
|
|
@@ -19741,14 +19773,14 @@ function install_minimal(target_root_in, force, user_type = "") {
|
|
|
19741
19773
|
personal:
|
|
19742
19774
|
user_type: ${user_type}
|
|
19743
19775
|
`;
|
|
19744
|
-
mkdirp(
|
|
19776
|
+
mkdirp(path13.dirname(settings_dst));
|
|
19745
19777
|
writeText(settings_dst, body);
|
|
19746
19778
|
success(`Wrote ${SETTINGS_FILE} (user_type=${user_type})`);
|
|
19747
19779
|
}
|
|
19748
19780
|
}
|
|
19749
19781
|
const removed_marker = _remove_legacy_consumer_bridge_marker(target_root);
|
|
19750
19782
|
if (removed_marker !== null) {
|
|
19751
|
-
const rel = isRelativeTo(removed_marker, target_root) ?
|
|
19783
|
+
const rel = isRelativeTo(removed_marker, target_root) ? path13.relative(target_root, removed_marker) : removed_marker;
|
|
19752
19784
|
success(`Removed legacy bridge marker: ${rel}`);
|
|
19753
19785
|
}
|
|
19754
19786
|
_write_install_mode_marker(target_root, "minimal");
|
|
@@ -19822,7 +19854,7 @@ function run_interactive_init(project_root, force) {
|
|
|
19822
19854
|
);
|
|
19823
19855
|
return 0;
|
|
19824
19856
|
}
|
|
19825
|
-
const target =
|
|
19857
|
+
const target = path13.join(project_root, _LOCAL_CONFIG_FILE);
|
|
19826
19858
|
if (pathExists(target) && !force) {
|
|
19827
19859
|
warn(
|
|
19828
19860
|
`${_LOCAL_CONFIG_FILE} already exists; re-run with --force to overwrite. Skipping interactive init.`
|
|
@@ -19849,7 +19881,7 @@ function run_interactive_init(project_root, force) {
|
|
|
19849
19881
|
warn(`Could not write ${target}: ${String(exc)}`);
|
|
19850
19882
|
return 1;
|
|
19851
19883
|
}
|
|
19852
|
-
success(`Wrote ${
|
|
19884
|
+
success(`Wrote ${path13.relative(project_root, target)} (${user_type} / ${stack} / ${verbosity})`);
|
|
19853
19885
|
return 0;
|
|
19854
19886
|
}
|
|
19855
19887
|
var _WIZARD_READY_RE = /^WIZARD_READY (http:\/\/(?:127\.0\.0\.1|localhost):\d+\/\S*)\r?$/;
|
|
@@ -19867,12 +19899,12 @@ function _wizard_should_launch(opts) {
|
|
|
19867
19899
|
return [true, ""];
|
|
19868
19900
|
}
|
|
19869
19901
|
function _wizard_cli_dist(_project_root) {
|
|
19870
|
-
const package_root =
|
|
19871
|
-
const cli =
|
|
19902
|
+
const package_root = path13.dirname(path13.dirname(path13.dirname(resolvePath(_HERE2))));
|
|
19903
|
+
const cli = path13.join(package_root, "dist", "cli", "agent-config.js");
|
|
19872
19904
|
return pathExists(cli) ? cli : null;
|
|
19873
19905
|
}
|
|
19874
19906
|
function _server_info_path() {
|
|
19875
|
-
return
|
|
19907
|
+
return path13.join(os7.homedir(), ".event4u", "agent-config", "local-server.json");
|
|
19876
19908
|
}
|
|
19877
19909
|
function _pid_is_agent_config(pid) {
|
|
19878
19910
|
let res;
|
|
@@ -19889,7 +19921,7 @@ function _pid_is_agent_config(pid) {
|
|
|
19889
19921
|
}
|
|
19890
19922
|
function unlinkMissingOk(p) {
|
|
19891
19923
|
try {
|
|
19892
|
-
|
|
19924
|
+
fs15.unlinkSync(p);
|
|
19893
19925
|
} catch {
|
|
19894
19926
|
}
|
|
19895
19927
|
}
|
|
@@ -19967,14 +19999,14 @@ function _wizard_spawn(project_root, pass_project_root = true) {
|
|
|
19967
19999
|
}
|
|
19968
20000
|
function _wizard_run_sync(cmd, env, cli) {
|
|
19969
20001
|
const total = _WIZARD_TIMEOUTS.reduce((a, b) => a + b, 0);
|
|
19970
|
-
const log_path =
|
|
20002
|
+
const log_path = path13.join(
|
|
19971
20003
|
os7.tmpdir(),
|
|
19972
20004
|
`agent-config-wizard-${process3.pid}-${Date.now()}.log`
|
|
19973
20005
|
);
|
|
19974
20006
|
let child;
|
|
19975
20007
|
let log_fd = null;
|
|
19976
20008
|
try {
|
|
19977
|
-
log_fd =
|
|
20009
|
+
log_fd = fs15.openSync(log_path, "w");
|
|
19978
20010
|
child = spawn(cmd[0], cmd.slice(1), {
|
|
19979
20011
|
env,
|
|
19980
20012
|
detached: true,
|
|
@@ -19992,7 +20024,7 @@ function _wizard_run_sync(cmd, env, cli) {
|
|
|
19992
20024
|
} finally {
|
|
19993
20025
|
if (log_fd !== null) {
|
|
19994
20026
|
try {
|
|
19995
|
-
|
|
20027
|
+
fs15.closeSync(log_fd);
|
|
19996
20028
|
} catch {
|
|
19997
20029
|
}
|
|
19998
20030
|
}
|
|
@@ -20242,8 +20274,8 @@ function main2(argv) {
|
|
|
20242
20274
|
const target_root = resolvePath(
|
|
20243
20275
|
opts.custom_path || opts.project || process3.env["PROJECT_ROOT"] || process3.cwd()
|
|
20244
20276
|
);
|
|
20245
|
-
const minimal_package_root =
|
|
20246
|
-
|
|
20277
|
+
const minimal_package_root = path13.dirname(
|
|
20278
|
+
path13.dirname(path13.dirname(_minimal_templates_root()))
|
|
20247
20279
|
);
|
|
20248
20280
|
const validated_user_type = _validate_user_type(minimal_package_root, opts.user_type);
|
|
20249
20281
|
return install_minimal(target_root, opts.force, validated_user_type);
|
|
@@ -20272,7 +20304,7 @@ function main2(argv) {
|
|
|
20272
20304
|
return rc2;
|
|
20273
20305
|
}
|
|
20274
20306
|
const project_root = custom_path || resolvePath(opts.project || process3.env["PROJECT_ROOT"] || process3.cwd());
|
|
20275
|
-
const is_first_run = !pathExists(
|
|
20307
|
+
const is_first_run = !pathExists(path13.join(project_root, SETTINGS_FILE));
|
|
20276
20308
|
const rc = _main_project_install(opts, project_root, parsed_tools, is_first_run);
|
|
20277
20309
|
if (rc === 0 && opts.interactive) {
|
|
20278
20310
|
run_interactive_init(project_root, opts.force);
|
|
@@ -20336,16 +20368,16 @@ function _team_setup_hint_line(project_root) {
|
|
|
20336
20368
|
return " \u2022 Claude Code team mode (optional cross-model review via the official codex plugin): run `agent-config doctor --check team` for setup status.";
|
|
20337
20369
|
}
|
|
20338
20370
|
function finalize_claude_model_tiers(project_root) {
|
|
20339
|
-
const claude_skills =
|
|
20340
|
-
const augment_skills =
|
|
20371
|
+
const claude_skills = path13.join(project_root, ".claude", "skills");
|
|
20372
|
+
const augment_skills = path13.join(project_root, ".augment", "skills");
|
|
20341
20373
|
if (!isDir(claude_skills) || !isDir(augment_skills)) return 0;
|
|
20342
20374
|
if (_read_consumer_auto_switch(project_root) !== "auto") return 0;
|
|
20343
20375
|
let rendered = 0;
|
|
20344
|
-
const entries =
|
|
20376
|
+
const entries = fs15.readdirSync(claude_skills).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
20345
20377
|
for (const name of entries) {
|
|
20346
|
-
const entry =
|
|
20347
|
-
const src_dir =
|
|
20348
|
-
const src_md =
|
|
20378
|
+
const entry = path13.join(claude_skills, name);
|
|
20379
|
+
const src_dir = path13.join(augment_skills, name);
|
|
20380
|
+
const src_md = path13.join(src_dir, "SKILL.md");
|
|
20349
20381
|
let tier;
|
|
20350
20382
|
try {
|
|
20351
20383
|
tier = read_model_tier(src_md);
|
|
@@ -20354,22 +20386,22 @@ function finalize_claude_model_tiers(project_root) {
|
|
|
20354
20386
|
}
|
|
20355
20387
|
if (tier === null || !(tier in TIER_TO_CLAUDE_MODEL) || !isDir(src_dir)) continue;
|
|
20356
20388
|
if (isSymlink(entry) || isFile(entry)) {
|
|
20357
|
-
|
|
20389
|
+
fs15.unlinkSync(entry);
|
|
20358
20390
|
} else if (isDir(entry)) {
|
|
20359
|
-
|
|
20391
|
+
fs15.rmSync(entry, { recursive: true, force: true });
|
|
20360
20392
|
}
|
|
20361
20393
|
mkdirp(entry);
|
|
20362
|
-
const srcFiles =
|
|
20394
|
+
const srcFiles = fs15.readdirSync(src_dir).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
20363
20395
|
for (const fname of srcFiles) {
|
|
20364
20396
|
if (fname === "SKILL.md") {
|
|
20365
20397
|
writeText(
|
|
20366
|
-
|
|
20398
|
+
path13.join(entry, "SKILL.md"),
|
|
20367
20399
|
render_native_model_md(readText(src_md), tier)
|
|
20368
20400
|
);
|
|
20369
20401
|
} else {
|
|
20370
|
-
|
|
20371
|
-
|
|
20372
|
-
|
|
20402
|
+
fs15.symlinkSync(
|
|
20403
|
+
path13.join("../../../.augment/skills", name, fname),
|
|
20404
|
+
path13.join(entry, fname)
|
|
20373
20405
|
);
|
|
20374
20406
|
}
|
|
20375
20407
|
}
|
|
@@ -20387,7 +20419,7 @@ function _main_project_install(opts, project_root, parsed_tools, is_first_run) {
|
|
|
20387
20419
|
let package_type;
|
|
20388
20420
|
if (opts.package) {
|
|
20389
20421
|
package_root = resolvePath(opts.package);
|
|
20390
|
-
if (!pathExists(
|
|
20422
|
+
if (!pathExists(path13.join(package_root, "src", "config", "profiles", "minimal.ini"))) {
|
|
20391
20423
|
fail(`Invalid --package path (missing src/config/profiles/minimal.ini): ${package_root}`);
|
|
20392
20424
|
}
|
|
20393
20425
|
package_type = detect_package_type_for_project(project_root, package_root);
|
|
@@ -20522,9 +20554,9 @@ function _main_project_install(opts, project_root, parsed_tools, is_first_run) {
|
|
|
20522
20554
|
function _resolvedArgv1() {
|
|
20523
20555
|
if (process3.argv[1] === void 0) return void 0;
|
|
20524
20556
|
try {
|
|
20525
|
-
return
|
|
20557
|
+
return fs15.realpathSync(path13.resolve(process3.argv[1]));
|
|
20526
20558
|
} catch {
|
|
20527
|
-
return
|
|
20559
|
+
return path13.resolve(process3.argv[1]);
|
|
20528
20560
|
}
|
|
20529
20561
|
}
|
|
20530
20562
|
var _argv1 = _resolvedArgv1();
|