@ghl-ai/aw 0.1.39-beta.17 → 0.1.39-beta.18
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/integrate.mjs +30 -1
- package/package.json +1 -1
package/integrate.mjs
CHANGED
|
@@ -114,12 +114,41 @@ function shouldResetHomeInstructionFile(content, file) {
|
|
|
114
114
|
return legacyMarkers.some(marker => content.includes(marker));
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
function stripLegacyRepoInstructionContent(content, file) {
|
|
118
|
+
const legacyMarkers = file === 'CLAUDE.md'
|
|
119
|
+
? [
|
|
120
|
+
'# CLAUDE.md — ',
|
|
121
|
+
'## Routing Rule (ABSOLUTE)',
|
|
122
|
+
'This supplements the root `AGENTS.md` with Codex-specific guidance.',
|
|
123
|
+
'<!-- BEGIN ECC -->',
|
|
124
|
+
]
|
|
125
|
+
: [
|
|
126
|
+
'# AGENTS.md — ',
|
|
127
|
+
'# ECC for Codex CLI',
|
|
128
|
+
'# AW SDLC Repo Instructions',
|
|
129
|
+
'Use the repo-local AW SDLC files as the source of truth for routing and stage behavior.',
|
|
130
|
+
'## Agent System',
|
|
131
|
+
'<!-- BEGIN ECC -->',
|
|
132
|
+
];
|
|
133
|
+
|
|
134
|
+
const startIndexes = legacyMarkers
|
|
135
|
+
.map(marker => content.indexOf(marker))
|
|
136
|
+
.filter(idx => idx !== -1);
|
|
137
|
+
|
|
138
|
+
if (startIndexes.length === 0) return content;
|
|
139
|
+
|
|
140
|
+
const startIdx = Math.min(...startIndexes);
|
|
141
|
+
const preserved = content.slice(0, startIdx).trimEnd();
|
|
142
|
+
return preserved ? `${preserved}\n` : '';
|
|
143
|
+
}
|
|
144
|
+
|
|
117
145
|
function applyManagedInstructionSections(content, file, rulesSections = {}, options = {}) {
|
|
118
146
|
const rulesHeader = file === 'CLAUDE.md' ? CLAUDE_RULES_HEADER : AGENTS_RULES_HEADER;
|
|
119
147
|
const rulesSection = file === 'CLAUDE.md' ? rulesSections.claudeSection : rulesSections.agentsSection;
|
|
120
148
|
const includeBridge = options.includeBridge !== false;
|
|
121
149
|
|
|
122
|
-
let next =
|
|
150
|
+
let next = stripLegacyRepoInstructionContent(content, file);
|
|
151
|
+
next = stripManagedBlock(next, AW_ROUTER_BRIDGE_START_MARKER, AW_ROUTER_BRIDGE_END_MARKER);
|
|
123
152
|
next = stripManagedSection(next, AW_ROUTER_BRIDGE_HEADER, [rulesHeader]);
|
|
124
153
|
next = stripManagedSection(next, rulesHeader);
|
|
125
154
|
next = next.trimEnd();
|