@aperant/framework 0.8.6 → 0.8.7
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/CHANGELOG.md +29 -0
- package/dist/cli/install/manifest.d.mts +13 -0
- package/dist/cli/install/manifest.d.mts.map +1 -1
- package/dist/cli/install/manifest.mjs +5 -0
- package/dist/cli/install/manifest.mjs.map +1 -1
- package/dist/cli/install/pipeline.d.mts +15 -0
- package/dist/cli/install/pipeline.d.mts.map +1 -1
- package/dist/cli/install/pipeline.mjs +27 -0
- package/dist/cli/install/pipeline.mjs.map +1 -1
- package/dist/cli/install/transforms/codex.d.mts +1 -1
- package/dist/cli/install/transforms/codex.d.mts.map +1 -1
- package/dist/cli/install/transforms/codex.mjs +43 -2
- package/dist/cli/install/transforms/codex.mjs.map +1 -1
- package/dist/cli/install/version-header.d.mts.map +1 -1
- package/dist/cli/install/version-header.mjs +7 -1
- package/dist/cli/install/version-header.mjs.map +1 -1
- package/dist/plugin/.claude-plugin/plugin.json +1 -1
- package/package.json +1 -1
- package/src/cli/install/manifest.mjs +5 -0
- package/src/cli/install/pipeline.mjs +28 -0
- package/src/cli/install/transforms/codex.mjs +51 -2
- package/src/cli/install/version-header.mjs +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,35 @@
|
|
|
3
3
|
All notable changes to `@aperant/framework` are documented here. See
|
|
4
4
|
[`VERSIONING.md`](VERSIONING.md) for the per-tier contract.
|
|
5
5
|
|
|
6
|
+
## 0.8.7 — 2026-05-24 — Codex parity: drift false-positive fix + agent inlining
|
|
7
|
+
|
|
8
|
+
Brings the Codex runtime to parity with Claude Code on two fronts.
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Codex skills no longer perpetually flagged `missing_header`.** Codex
|
|
13
|
+
whitelists skill frontmatter to `{name, description}` (it rejects unknown
|
|
14
|
+
keys), which strips the `apt-skill-version` header the drift-checker looked
|
|
15
|
+
for — so every Codex skill showed as stale forever and `/apt:update` could
|
|
16
|
+
never clear it. The install pipeline now records `headerless: true` on
|
|
17
|
+
manifest entries whose post-transform content legitimately carries no version
|
|
18
|
+
header, and `inspectManifestFiles` skips the `missing_header` check for them
|
|
19
|
+
(`installedHash` remains the drift signal). Data-driven, so any future
|
|
20
|
+
header-stripping transform is covered. Pre-0.8.7 manifests (no `headerless`
|
|
21
|
+
field) keep the old behavior until re-install.
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- **Codex agent inlining.** Codex has no markdown agent-spawn surface, so a
|
|
26
|
+
skill declaring `spawns_agent: true` + `agent_name: X` previously left Codex
|
|
27
|
+
referencing an `agents/X.md` file that was never installed — the multi-agent
|
|
28
|
+
pipeline skills (plan/execute/verify/review/improve/create-docs) ran degraded
|
|
29
|
+
without the agent methodology. `codex.mjs` now inlines the referenced agent's
|
|
30
|
+
prompt into the skill body under a `## Inlined agent: X` header ("you ARE that
|
|
31
|
+
agent for this task"), so Codex carries the full methodology even without a
|
|
32
|
+
spawn primitive. The pipeline supplies agent bodies to transforms via a new
|
|
33
|
+
`agentContentByName` map on `TransformInput` (transforms stay pure — no I/O).
|
|
34
|
+
|
|
6
35
|
## 0.8.6 — 2026-05-24 — Outcome-first verify-proof contract + driver-sdk inline (recovery from 0.8.4 npm 404)
|
|
7
36
|
|
|
8
37
|
> **Migration window.** This release introduces a new `## User Outcomes`
|
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
* @property {string} installedHash
|
|
6
6
|
* @property {string} sourcePath
|
|
7
7
|
* @property {string} transformVersion
|
|
8
|
+
* @property {boolean} [headerless] true when the installed file legitimately
|
|
9
|
+
* carries no apt-skill-version/apt-hook-version header (e.g. Codex strips it).
|
|
10
|
+
* Drift detection skips the missing_header check for these — installedHash is
|
|
11
|
+
* the sole drift signal. Absent (undefined) on pre-0.8.6 manifests → treated
|
|
12
|
+
* as header-expected, preserving old behavior until re-install.
|
|
8
13
|
*/
|
|
9
14
|
/**
|
|
10
15
|
* @typedef {Object} Manifest
|
|
@@ -74,6 +79,14 @@ export type ManifestFileEntry = {
|
|
|
74
79
|
installedHash: string;
|
|
75
80
|
sourcePath: string;
|
|
76
81
|
transformVersion: string;
|
|
82
|
+
/**
|
|
83
|
+
* true when the installed file legitimately
|
|
84
|
+
* carries no apt-skill-version/apt-hook-version header (e.g. Codex strips it).
|
|
85
|
+
* Drift detection skips the missing_header check for these — installedHash is
|
|
86
|
+
* the sole drift signal. Absent (undefined) on pre-0.8.6 manifests → treated
|
|
87
|
+
* as header-expected, preserving old behavior until re-install.
|
|
88
|
+
*/
|
|
89
|
+
headerless?: boolean | undefined;
|
|
77
90
|
};
|
|
78
91
|
export type Manifest = {
|
|
79
92
|
version: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.mts","sourceRoot":"","sources":["../../../src/cli/install/manifest.mjs"],"names":[],"mappings":"AAkCA
|
|
1
|
+
{"version":3,"file":"manifest.d.mts","sourceRoot":"","sources":["../../../src/cli/install/manifest.mjs"],"names":[],"mappings":"AAkCA;;;;;;;;;;;;GAYG;AAEH;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,6BAHW,MAAM,GAAC,MAAM,GACX,MAAM,CAIlB;AAED;;;;;;GAMG;AACH,2DAHW;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE,GAC3C,QAAQ,CAUpB;AAED;;;;;;;GAOG;AACH,2CAJW,QAAQ,SACR,iBAAiB,GACf,QAAQ,CAKpB;AAED;;;;;;;GAOG;AACH,2CAHW,MAAM,YACN,QAAQ,QAIlB;AAED;;;;;;GAMG;AACH,0CAHW,MAAM,GACJ,QAAQ,GAAC,IAAI,CAezB;AAED;;;;;;GAMG;AACH,oCAHW,OAAO,GACL,MAAM,EAAE,CA2BpB;AApID,gCAAiC,wBAAwB,CAAA;AACzD,sCAAuC,CAAC,CAAA;;UAI1B,MAAM;gBACN,MAAM;mBACN,MAAM;gBACN,MAAM;sBACN,MAAM;;;;;;;;;;;aAUN,MAAM;kBACN,MAAM;aACN,MAAM;uBACN,MAAM;WACN,iBAAiB,EAAE"}
|
|
@@ -36,6 +36,11 @@ export const MANIFEST_SCHEMA_VERSION = 1;
|
|
|
36
36
|
* @property {string} installedHash
|
|
37
37
|
* @property {string} sourcePath
|
|
38
38
|
* @property {string} transformVersion
|
|
39
|
+
* @property {boolean} [headerless] true when the installed file legitimately
|
|
40
|
+
* carries no apt-skill-version/apt-hook-version header (e.g. Codex strips it).
|
|
41
|
+
* Drift detection skips the missing_header check for these — installedHash is
|
|
42
|
+
* the sole drift signal. Absent (undefined) on pre-0.8.6 manifests → treated
|
|
43
|
+
* as header-expected, preserving old behavior until re-install.
|
|
39
44
|
*/
|
|
40
45
|
/**
|
|
41
46
|
* @typedef {Object} Manifest
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.mjs","sourceRoot":"","sources":["../../../src/cli/install/manifest.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE1D,MAAM,CAAC,MAAM,iBAAiB,GAAG,wBAAwB,CAAA;AACzD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAA;AAExC
|
|
1
|
+
{"version":3,"file":"manifest.mjs","sourceRoot":"","sources":["../../../src/cli/install/manifest.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA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C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/B,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAA;QACpC,OAAO,MAAM,CAAA;IACd,CAAC;IACD,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;QAC1C,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;YACzC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAA;YAC3C,SAAQ;QACT,CAAC;QACD,MAAM,EAAE,GAAG,sCAAsC,CAAC,CAAC,CAAC,CAAC,CAAA;QACrD,KAAK,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,kBAAkB,CAAC,EAAE,CAAC;YAC3F,IAAI,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,QAAQ;gBAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAA;QACrF,CAAC;IACF,CAAC;IACD,OAAO,MAAM,CAAA;AACd,CAAC"}
|
|
@@ -17,6 +17,12 @@
|
|
|
17
17
|
* @property {string} canonicalRelPath
|
|
18
18
|
* @property {string} version
|
|
19
19
|
* @property {'skill'|'agent'|'hook-js'|'hook-sh'|'unknown'} fileType
|
|
20
|
+
* @property {Record<string, string>} [agentContentByName] canonical agent body
|
|
21
|
+
* keyed by agent name (basename sans `.md`, e.g. `apt-planner`). Lets a
|
|
22
|
+
* transform inline a referenced agent's prompt when the target runtime has
|
|
23
|
+
* no separate agent-spawn surface (Codex). The pipeline always supplies it
|
|
24
|
+
* (empty object when no agents discovered); optional here so unit tests can
|
|
25
|
+
* construct a TransformInput without it — transforms default it to `{}`.
|
|
20
26
|
*/
|
|
21
27
|
/**
|
|
22
28
|
* @typedef {(input: TransformInput) => TransformOutput[]} TransformFn
|
|
@@ -99,6 +105,15 @@ export type TransformInput = {
|
|
|
99
105
|
canonicalRelPath: string;
|
|
100
106
|
version: string;
|
|
101
107
|
fileType: "skill" | "agent" | "hook-js" | "hook-sh" | "unknown";
|
|
108
|
+
/**
|
|
109
|
+
* canonical agent body
|
|
110
|
+
* keyed by agent name (basename sans `.md`, e.g. `apt-planner`). Lets a
|
|
111
|
+
* transform inline a referenced agent's prompt when the target runtime has
|
|
112
|
+
* no separate agent-spawn surface (Codex). The pipeline always supplies it
|
|
113
|
+
* (empty object when no agents discovered); optional here so unit tests can
|
|
114
|
+
* construct a TransformInput without it — transforms default it to `{}`.
|
|
115
|
+
*/
|
|
116
|
+
agentContentByName?: Record<string, string> | undefined;
|
|
102
117
|
};
|
|
103
118
|
export type TransformFn = (input: TransformInput) => TransformOutput[];
|
|
104
119
|
//# sourceMappingURL=pipeline.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.mts","sourceRoot":"","sources":["../../../src/cli/install/pipeline.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pipeline.d.mts","sourceRoot":"","sources":["../../../src/cli/install/pipeline.mjs"],"names":[],"mappings":"AAiDA;;;;;;GAMG;AAEH;;;;GAIG;AAEH;;;;;;;;;;;;;GAaG;AAEH;;GAEG;AAEH;;;;;;;;GAQG;AACH,sDAHW,MAAM,GACJ,aAAa,EAAE,CAmE3B;AAED;;;;;;;;;;;;GAYG;AACH,uGARG;IAAqB,OAAO,EAApB,MAAM;IACY,SAAS,EAA3B,WAAW;IACE,aAAa,EAA1B,MAAM;IACO,SAAS,EAAtB,MAAM;IACO,OAAO,EAApB,MAAM;IACiB,cAAc;CAC7C,GAAU;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,OAAO,gBAAgB,EAAE,QAAQ,CAAA;CAAE,CAwGrI;AAED;;;;;;;;GAQG;AACH,mDAJW,MAAM,WACN,KAAK,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,WACnF,MAAM,QAehB;AAmBD,uCAAwE;;;;;mBAzQ1D,MAAM;;;;aACN,MAAM;cACN,OAAO,GAAC,OAAO,GAAC,SAAS,GAAC,SAAS,GAAC,SAAS;aAC7C,MAAM;;;;;;gBAKN,MAAM;aACN,MAAM;;;sBAKN,MAAM;mBACN,MAAM;sBACN,MAAM;aACN,MAAM;cACN,OAAO,GAAC,OAAO,GAAC,SAAS,GAAC,SAAS,GAAC,SAAS;;;;;;;;;;;0BAU9C,CAAC,KAAK,EAAE,cAAc,KAAK,eAAe,EAAE"}
|
|
@@ -16,6 +16,7 @@ import { atomicWriteText } from './atomic-text.mjs';
|
|
|
16
16
|
import { addManifestEntry, newManifest, sha256, writeManifest } from './manifest.mjs';
|
|
17
17
|
import { getRuntime } from './runtime-detect.mjs';
|
|
18
18
|
import { classifyFileType } from './transforms/_shared.mjs';
|
|
19
|
+
import { parseVersionHeader } from './version-header.mjs';
|
|
19
20
|
const TRANSFORM_VERSION = '1';
|
|
20
21
|
/**
|
|
21
22
|
* Defense-in-depth: assert a transform's output path is safely contained
|
|
@@ -61,6 +62,12 @@ function safeResolveWithin(installRoot, outputPath) {
|
|
|
61
62
|
* @property {string} canonicalRelPath
|
|
62
63
|
* @property {string} version
|
|
63
64
|
* @property {'skill'|'agent'|'hook-js'|'hook-sh'|'unknown'} fileType
|
|
65
|
+
* @property {Record<string, string>} [agentContentByName] canonical agent body
|
|
66
|
+
* keyed by agent name (basename sans `.md`, e.g. `apt-planner`). Lets a
|
|
67
|
+
* transform inline a referenced agent's prompt when the target runtime has
|
|
68
|
+
* no separate agent-spawn surface (Codex). The pipeline always supplies it
|
|
69
|
+
* (empty object when no agents discovered); optional here so unit tests can
|
|
70
|
+
* construct a TransformInput without it — transforms default it to `{}`.
|
|
64
71
|
*/
|
|
65
72
|
/**
|
|
66
73
|
* @typedef {(input: TransformInput) => TransformOutput[]} TransformFn
|
|
@@ -161,6 +168,19 @@ export function runInstall({ runtime, transform, canonicalRoot, targetDir, versi
|
|
|
161
168
|
const files = canonicalFiles ?? discoverCanonicalFiles(canonicalRoot);
|
|
162
169
|
const written = [];
|
|
163
170
|
const skipped = [];
|
|
171
|
+
// Map of agent name → canonical agent body, so a transform whose runtime
|
|
172
|
+
// has no separate agent-spawn surface (Codex) can inline a referenced
|
|
173
|
+
// agent's prompt. Keyed by basename sans `.md` (e.g. `apt-planner`). When
|
|
174
|
+
// the same name exists under both skills/ and agents/, last-wins — they are
|
|
175
|
+
// the same agent (see the de-dupe note below).
|
|
176
|
+
/** @type {Record<string, string>} */
|
|
177
|
+
const agentContentByName = {};
|
|
178
|
+
for (const f of files) {
|
|
179
|
+
if (f.fileType === 'agent') {
|
|
180
|
+
const name = f.relPath.replace(/^.*\//, '').replace(/\.md$/, '');
|
|
181
|
+
agentContentByName[name] = f.content;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
164
184
|
// De-dupe by output path — last-write-wins. Two canonical files can
|
|
165
185
|
// legitimately target the same output (e.g. skills/apt-planner.md and
|
|
166
186
|
// agents/apt-planner.md both producing agents/apt-planner.md). The
|
|
@@ -180,6 +200,7 @@ export function runInstall({ runtime, transform, canonicalRoot, targetDir, versi
|
|
|
180
200
|
canonicalRelPath: f.relPath,
|
|
181
201
|
version,
|
|
182
202
|
fileType: f.fileType,
|
|
203
|
+
agentContentByName,
|
|
183
204
|
});
|
|
184
205
|
}
|
|
185
206
|
catch (err) {
|
|
@@ -205,12 +226,18 @@ export function runInstall({ runtime, transform, canonicalRoot, targetDir, versi
|
|
|
205
226
|
}
|
|
206
227
|
atomicWriteText(absPath, out.content);
|
|
207
228
|
const installedHash = sha256(out.content);
|
|
229
|
+
// Record whether the installed file carries a version header. When a
|
|
230
|
+
// transform legitimately strips it (Codex frontmatter whitelist),
|
|
231
|
+
// drift detection must not flag it missing_header — installedHash is
|
|
232
|
+
// the drift signal. Only relevant for header-bearing file types.
|
|
233
|
+
const headerless = /\.(md|js|mjs|sh)$/.test(out.outputPath) && parseVersionHeader(out.content) === null;
|
|
208
234
|
entryByPath.set(out.outputPath, {
|
|
209
235
|
path: out.outputPath,
|
|
210
236
|
sourceHash,
|
|
211
237
|
installedHash,
|
|
212
238
|
sourcePath: `packages/framework/${f.relPath}`,
|
|
213
239
|
transformVersion: TRANSFORM_VERSION,
|
|
240
|
+
...(headerless ? { headerless: true } : {}),
|
|
214
241
|
});
|
|
215
242
|
if (!written.includes(out.outputPath))
|
|
216
243
|
written.push(out.outputPath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.mjs","sourceRoot":"","sources":["../../../src/cli/install/pipeline.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAC7D,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"pipeline.mjs","sourceRoot":"","sources":["../../../src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AC;QACJ,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAA;IAC5B,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAA;IACb,CAAC;AACF,CAAC;AAED,2EAA2E;AAC3E,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA"}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* @param {import('../pipeline.mjs').TransformInput} input
|
|
3
3
|
* @returns {import('../pipeline.mjs').TransformOutput[]}
|
|
4
4
|
*/
|
|
5
|
-
export function transform({ canonicalContent, canonicalRelPath, version, fileType }: import("../pipeline.mjs").TransformInput): import("../pipeline.mjs").TransformOutput[];
|
|
5
|
+
export function transform({ canonicalContent, canonicalRelPath, version, fileType, agentContentByName, }: import("../pipeline.mjs").TransformInput): import("../pipeline.mjs").TransformOutput[];
|
|
6
6
|
//# sourceMappingURL=codex.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex.d.mts","sourceRoot":"","sources":["../../../../src/cli/install/transforms/codex.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"codex.d.mts","sourceRoot":"","sources":["../../../../src/cli/install/transforms/codex.mjs"],"names":[],"mappings":"AAyCA;;;GAGG;AACH,0GAHW,OAAO,iBAAiB,EAAE,cAAc,GACtC,OAAO,iBAAiB,EAAE,eAAe,EAAE,CA6CvD"}
|
|
@@ -14,6 +14,13 @@
|
|
|
14
14
|
* against installRoot `.agents` to land at `.agents/skills/<folder>/SKILL.md`).
|
|
15
15
|
* Markdown agents are NOT a Codex surface (custom-agents are TOML
|
|
16
16
|
* under `.codex/agents/`); only skills are emitted.
|
|
17
|
+
* - agent inlining: Codex has no markdown agent-spawn surface, so a skill
|
|
18
|
+
* declaring `spawns_agent: true` + `agent_name: X` would, on Claude, spawn
|
|
19
|
+
* the X agent (whose prompt lives in agents/X.md). On Codex that file is
|
|
20
|
+
* never installed and the spawn directive is stripped by the whitelist —
|
|
21
|
+
* leaving the skill referencing a non-existent agent. To keep Codex at
|
|
22
|
+
* parity, the referenced agent's body is appended inline to the skill body
|
|
23
|
+
* so the model has the full methodology even without a spawn primitive.
|
|
17
24
|
*/
|
|
18
25
|
import { basename, dirname } from 'node:path';
|
|
19
26
|
import { parseFrontmatter, rewriteCommandRefs, serializeFrontmatter, substituteVersion, } from './_shared.mjs';
|
|
@@ -28,17 +35,27 @@ const KEEP = ['name', 'description'];
|
|
|
28
35
|
* @param {import('../pipeline.mjs').TransformInput} input
|
|
29
36
|
* @returns {import('../pipeline.mjs').TransformOutput[]}
|
|
30
37
|
*/
|
|
31
|
-
export function transform({ canonicalContent, canonicalRelPath, version, fileType }) {
|
|
38
|
+
export function transform({ canonicalContent, canonicalRelPath, version, fileType, agentContentByName = {}, }) {
|
|
32
39
|
const subbed = substituteVersion(canonicalContent, version);
|
|
33
40
|
const parsed = parseFrontmatter(subbed);
|
|
34
41
|
let payload;
|
|
35
42
|
if (parsed.hasFrontmatter && parsed.fm) {
|
|
43
|
+
// Read the spawn directive BEFORE the whitelist strips it. On Codex
|
|
44
|
+
// there's no agent-spawn surface, so we inline the agent body instead.
|
|
45
|
+
const spawnsAgent = parsed.fm.spawns_agent === true;
|
|
46
|
+
const agentName = typeof parsed.fm.agent_name === 'string' && parsed.fm.agent_name.length > 0
|
|
47
|
+
? parsed.fm.agent_name
|
|
48
|
+
: null;
|
|
36
49
|
// Whitelist filter: drop every frontmatter key NOT in KEEP.
|
|
37
50
|
for (const k of Object.keys(parsed.fm)) {
|
|
38
51
|
if (!KEEP.includes(k))
|
|
39
52
|
delete parsed.fm[k];
|
|
40
53
|
}
|
|
41
|
-
|
|
54
|
+
let body = parsed.body;
|
|
55
|
+
if (spawnsAgent && agentName && agentContentByName[agentName]) {
|
|
56
|
+
body = `${body}\n\n${inlineAgentSection(agentName, agentContentByName[agentName], version)}`;
|
|
57
|
+
}
|
|
58
|
+
const wrappedBody = `<codex_agent_role>\n${body}\n</codex_agent_role>\n`;
|
|
42
59
|
payload = serializeFrontmatter({ ...parsed, body: wrappedBody });
|
|
43
60
|
}
|
|
44
61
|
else {
|
|
@@ -56,4 +73,28 @@ export function transform({ canonicalContent, canonicalRelPath, version, fileTyp
|
|
|
56
73
|
// another dead surface. Drop the agent branch entirely.
|
|
57
74
|
return [];
|
|
58
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Build the inlined-agent section appended to a Codex skill body. Strips the
|
|
78
|
+
* agent file's own frontmatter (Codex skills carry a single frontmatter block)
|
|
79
|
+
* and version-substitutes the body. The fenced header makes it unambiguous to
|
|
80
|
+
* the model that this is the methodology it should execute directly — there is
|
|
81
|
+
* no separate agent to spawn on Codex.
|
|
82
|
+
*
|
|
83
|
+
* @param {string} agentName
|
|
84
|
+
* @param {string} agentContent raw canonical agent file (with frontmatter + {{APT_VERSION}})
|
|
85
|
+
* @param {string} version
|
|
86
|
+
* @returns {string}
|
|
87
|
+
*/
|
|
88
|
+
function inlineAgentSection(agentName, agentContent, version) {
|
|
89
|
+
const agentBody = parseFrontmatter(substituteVersion(agentContent, version)).body.trim();
|
|
90
|
+
return [
|
|
91
|
+
`## Inlined agent: ${agentName}`,
|
|
92
|
+
'',
|
|
93
|
+
`Codex has no separate agent-spawn surface. Where this skill says to spawn`,
|
|
94
|
+
`the \`${agentName}\` agent, execute the methodology below directly — you ARE`,
|
|
95
|
+
`that agent for this task.`,
|
|
96
|
+
'',
|
|
97
|
+
agentBody,
|
|
98
|
+
].join('\n');
|
|
99
|
+
}
|
|
59
100
|
//# sourceMappingURL=codex.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex.mjs","sourceRoot":"","sources":["../../../../src/cli/install/transforms/codex.mjs"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"codex.mjs","sourceRoot":"","sources":["../../../../src/cli/install/transforms/codex.mjs"],"names":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AAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-header.d.mts","sourceRoot":"","sources":["../../../src/cli/install/version-header.mjs"],"names":[],"mappings":"AAyBA;;;;;GAKG;AACH,4BAHW,MAAM,GAAC,MAAM,GACX,MAAM,CAIlB;AAED;;;;;;;GAOG;AACH,+CAJW,MAAM,aACN,MAAM,GACJ,MAAM,CAYlB;AAED;;;;;;;;;;;;;;GAcG;AACH,+CAPW,MAAM,eACN,MAAM,SACN;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,GAGxB,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"version-header.d.mts","sourceRoot":"","sources":["../../../src/cli/install/version-header.mjs"],"names":[],"mappings":"AAyBA;;;;;GAKG;AACH,4BAHW,MAAM,GAAC,MAAM,GACX,MAAM,CAIlB;AAED;;;;;;;GAOG;AACH,+CAJW,MAAM,aACN,MAAM,GACJ,MAAM,CAYlB;AAED;;;;;;;;;;;;;;GAcG;AACH,+CAPW,MAAM,eACN,MAAM,SACN;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,GAGxB,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,CAAC,CAgDjD;AAwBD;;;;;;;;;;;;;GAaG;AACH,wDAHW,MAAM,GACJ,MAAM,CAKlB;AAED;;;;;;;;;;GAUG;AACH,4CAHW,MAAM,GACJ,MAAM,GAAC,IAAI,CAqBvB;AAED;;;;;;;;;;;GAWG;AACH,8CAJW,MAAM,WACN,MAAM,GACJ,MAAM,CA4ClB;AAED;;;;;;;GAOG;AACH,4CAHW,MAAM,GACJ,MAAM,CAOlB;AAzID;;;;;;;;;;;;;;GAcG;AACH,4CAA6C,uBAAuB,CAAA"}
|
|
@@ -98,7 +98,13 @@ export function inspectManifestFiles(manifest, installRoot, opts = {}) {
|
|
|
98
98
|
continue;
|
|
99
99
|
}
|
|
100
100
|
const declared = parseVersionHeader(buf.toString('utf-8'));
|
|
101
|
-
|
|
101
|
+
// `headerless` entries are files whose runtime transform legitimately
|
|
102
|
+
// strips the apt-skill-version header (e.g. Codex whitelists frontmatter
|
|
103
|
+
// to {name, description} and rejects unknown keys). For those, the
|
|
104
|
+
// installedHash check above is the sole drift signal — requiring a header
|
|
105
|
+
// would false-positive every install. The flag is recorded at install
|
|
106
|
+
// time by the pipeline from the post-transform content.
|
|
107
|
+
if (declared === null && !entry.headerless && /\.(md|js|mjs|sh)$/.test(entry.path)) {
|
|
102
108
|
stale.push({ path: entry.path, reason: 'missing_header' });
|
|
103
109
|
continue;
|
|
104
110
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-header.mjs","sourceRoot":"","sources":["../../../src/cli/install/version-header.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEzD;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,GAAG;IACzB,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AACtD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,WAAW,EAAE,SAAS;IACvD,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,qCAAqC,SAAS,EAAE,CAAC,CAAA;IAClE,CAAC;IACD,MAAM,GAAG,GAAG,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ACD,IAAI,QAAQ,KAAK,CAAC,CAAC,EAAE,CAAC;QACrB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACzC,IAAI,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAClC,QAAQ,GAAG,CAAC,GAAG,CAAC,CAAA;gBAChB,MAAK;YACN,CAAC;QACF,CAAC;IACF,CAAC;IACD,IAAI,QAAQ,KAAK,CAAC,CAAC;QAAE,QAAQ,GAAG,CAAC,CAAA;IACjC,MAAM,KAAK,GAAG,CAAC,GAAG,OAAO,CAAC,CAAA;IAC1B,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,sBAAsB,OAAO,EAAE,CAAC,CAAA;IAC1D,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAC9B,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAChC,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC9C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAO;IACzC,OAAO,OAAO;SACZ,OAAO,CAAC,wCAAwC,EAAE,EAAE,CAAC;SACrD,OAAO,CAAC,2CAA2C,EAAE,EAAE,CAAC;SACxD,OAAO,CAAC,wCAAwC,EAAE,EAAE,CAAC,CAAA;AACxD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aperant",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.7",
|
|
4
4
|
"description": "AI coding framework — composable skills for planning, executing, verifying, and reviewing code with any LLM provider. Works as Claude Code commands, Codex tasks, or programmatically.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mikalsen AI",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aperant/framework",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.7",
|
|
4
4
|
"description": "AI coding framework — composable skills for planning, executing, verifying, and reviewing code with any LLM provider. Works as Claude Code commands, Codex tasks, or programmatically.",
|
|
5
5
|
"author": "Mikalsen AI <hello@mikalsen.ai>",
|
|
6
6
|
"type": "module",
|
|
@@ -39,6 +39,11 @@ export const MANIFEST_SCHEMA_VERSION = 1
|
|
|
39
39
|
* @property {string} installedHash
|
|
40
40
|
* @property {string} sourcePath
|
|
41
41
|
* @property {string} transformVersion
|
|
42
|
+
* @property {boolean} [headerless] true when the installed file legitimately
|
|
43
|
+
* carries no apt-skill-version/apt-hook-version header (e.g. Codex strips it).
|
|
44
|
+
* Drift detection skips the missing_header check for these — installedHash is
|
|
45
|
+
* the sole drift signal. Absent (undefined) on pre-0.8.6 manifests → treated
|
|
46
|
+
* as header-expected, preserving old behavior until re-install.
|
|
42
47
|
*/
|
|
43
48
|
|
|
44
49
|
/**
|
|
@@ -17,6 +17,7 @@ import { atomicWriteText } from './atomic-text.mjs'
|
|
|
17
17
|
import { addManifestEntry, newManifest, sha256, writeManifest } from './manifest.mjs'
|
|
18
18
|
import { getRuntime } from './runtime-detect.mjs'
|
|
19
19
|
import { classifyFileType } from './transforms/_shared.mjs'
|
|
20
|
+
import { parseVersionHeader } from './version-header.mjs'
|
|
20
21
|
|
|
21
22
|
const TRANSFORM_VERSION = '1'
|
|
22
23
|
|
|
@@ -67,6 +68,12 @@ function safeResolveWithin(installRoot, outputPath) {
|
|
|
67
68
|
* @property {string} canonicalRelPath
|
|
68
69
|
* @property {string} version
|
|
69
70
|
* @property {'skill'|'agent'|'hook-js'|'hook-sh'|'unknown'} fileType
|
|
71
|
+
* @property {Record<string, string>} [agentContentByName] canonical agent body
|
|
72
|
+
* keyed by agent name (basename sans `.md`, e.g. `apt-planner`). Lets a
|
|
73
|
+
* transform inline a referenced agent's prompt when the target runtime has
|
|
74
|
+
* no separate agent-spawn surface (Codex). The pipeline always supplies it
|
|
75
|
+
* (empty object when no agents discovered); optional here so unit tests can
|
|
76
|
+
* construct a TransformInput without it — transforms default it to `{}`.
|
|
70
77
|
*/
|
|
71
78
|
|
|
72
79
|
/**
|
|
@@ -180,6 +187,19 @@ export function runInstall({
|
|
|
180
187
|
const files = canonicalFiles ?? discoverCanonicalFiles(canonicalRoot)
|
|
181
188
|
const written = []
|
|
182
189
|
const skipped = []
|
|
190
|
+
// Map of agent name → canonical agent body, so a transform whose runtime
|
|
191
|
+
// has no separate agent-spawn surface (Codex) can inline a referenced
|
|
192
|
+
// agent's prompt. Keyed by basename sans `.md` (e.g. `apt-planner`). When
|
|
193
|
+
// the same name exists under both skills/ and agents/, last-wins — they are
|
|
194
|
+
// the same agent (see the de-dupe note below).
|
|
195
|
+
/** @type {Record<string, string>} */
|
|
196
|
+
const agentContentByName = {}
|
|
197
|
+
for (const f of files) {
|
|
198
|
+
if (f.fileType === 'agent') {
|
|
199
|
+
const name = f.relPath.replace(/^.*\//, '').replace(/\.md$/, '')
|
|
200
|
+
agentContentByName[name] = f.content
|
|
201
|
+
}
|
|
202
|
+
}
|
|
183
203
|
// De-dupe by output path — last-write-wins. Two canonical files can
|
|
184
204
|
// legitimately target the same output (e.g. skills/apt-planner.md and
|
|
185
205
|
// agents/apt-planner.md both producing agents/apt-planner.md). The
|
|
@@ -200,6 +220,7 @@ export function runInstall({
|
|
|
200
220
|
canonicalRelPath: f.relPath,
|
|
201
221
|
version,
|
|
202
222
|
fileType: f.fileType,
|
|
223
|
+
agentContentByName,
|
|
203
224
|
})
|
|
204
225
|
} catch (err) {
|
|
205
226
|
skipped.push(
|
|
@@ -225,12 +246,19 @@ export function runInstall({
|
|
|
225
246
|
}
|
|
226
247
|
atomicWriteText(absPath, out.content)
|
|
227
248
|
const installedHash = sha256(out.content)
|
|
249
|
+
// Record whether the installed file carries a version header. When a
|
|
250
|
+
// transform legitimately strips it (Codex frontmatter whitelist),
|
|
251
|
+
// drift detection must not flag it missing_header — installedHash is
|
|
252
|
+
// the drift signal. Only relevant for header-bearing file types.
|
|
253
|
+
const headerless =
|
|
254
|
+
/\.(md|js|mjs|sh)$/.test(out.outputPath) && parseVersionHeader(out.content) === null
|
|
228
255
|
entryByPath.set(out.outputPath, {
|
|
229
256
|
path: out.outputPath,
|
|
230
257
|
sourceHash,
|
|
231
258
|
installedHash,
|
|
232
259
|
sourcePath: `packages/framework/${f.relPath}`,
|
|
233
260
|
transformVersion: TRANSFORM_VERSION,
|
|
261
|
+
...(headerless ? { headerless: true } : {}),
|
|
234
262
|
})
|
|
235
263
|
if (!written.includes(out.outputPath)) written.push(out.outputPath)
|
|
236
264
|
}
|
|
@@ -14,6 +14,13 @@
|
|
|
14
14
|
* against installRoot `.agents` to land at `.agents/skills/<folder>/SKILL.md`).
|
|
15
15
|
* Markdown agents are NOT a Codex surface (custom-agents are TOML
|
|
16
16
|
* under `.codex/agents/`); only skills are emitted.
|
|
17
|
+
* - agent inlining: Codex has no markdown agent-spawn surface, so a skill
|
|
18
|
+
* declaring `spawns_agent: true` + `agent_name: X` would, on Claude, spawn
|
|
19
|
+
* the X agent (whose prompt lives in agents/X.md). On Codex that file is
|
|
20
|
+
* never installed and the spawn directive is stripped by the whitelist —
|
|
21
|
+
* leaving the skill referencing a non-existent agent. To keep Codex at
|
|
22
|
+
* parity, the referenced agent's body is appended inline to the skill body
|
|
23
|
+
* so the model has the full methodology even without a spawn primitive.
|
|
17
24
|
*/
|
|
18
25
|
|
|
19
26
|
import { basename, dirname } from 'node:path'
|
|
@@ -36,16 +43,33 @@ const KEEP = ['name', 'description']
|
|
|
36
43
|
* @param {import('../pipeline.mjs').TransformInput} input
|
|
37
44
|
* @returns {import('../pipeline.mjs').TransformOutput[]}
|
|
38
45
|
*/
|
|
39
|
-
export function transform({
|
|
46
|
+
export function transform({
|
|
47
|
+
canonicalContent,
|
|
48
|
+
canonicalRelPath,
|
|
49
|
+
version,
|
|
50
|
+
fileType,
|
|
51
|
+
agentContentByName = {},
|
|
52
|
+
}) {
|
|
40
53
|
const subbed = substituteVersion(canonicalContent, version)
|
|
41
54
|
const parsed = parseFrontmatter(subbed)
|
|
42
55
|
let payload
|
|
43
56
|
if (parsed.hasFrontmatter && parsed.fm) {
|
|
57
|
+
// Read the spawn directive BEFORE the whitelist strips it. On Codex
|
|
58
|
+
// there's no agent-spawn surface, so we inline the agent body instead.
|
|
59
|
+
const spawnsAgent = parsed.fm.spawns_agent === true
|
|
60
|
+
const agentName =
|
|
61
|
+
typeof parsed.fm.agent_name === 'string' && parsed.fm.agent_name.length > 0
|
|
62
|
+
? parsed.fm.agent_name
|
|
63
|
+
: null
|
|
44
64
|
// Whitelist filter: drop every frontmatter key NOT in KEEP.
|
|
45
65
|
for (const k of Object.keys(parsed.fm)) {
|
|
46
66
|
if (!KEEP.includes(k)) delete parsed.fm[k]
|
|
47
67
|
}
|
|
48
|
-
|
|
68
|
+
let body = parsed.body
|
|
69
|
+
if (spawnsAgent && agentName && agentContentByName[agentName]) {
|
|
70
|
+
body = `${body}\n\n${inlineAgentSection(agentName, agentContentByName[agentName], version)}`
|
|
71
|
+
}
|
|
72
|
+
const wrappedBody = `<codex_agent_role>\n${body}\n</codex_agent_role>\n`
|
|
49
73
|
payload = serializeFrontmatter({ ...parsed, body: wrappedBody })
|
|
50
74
|
} else {
|
|
51
75
|
payload = `<codex_agent_role>\n${subbed}\n</codex_agent_role>\n`
|
|
@@ -63,3 +87,28 @@ export function transform({ canonicalContent, canonicalRelPath, version, fileTyp
|
|
|
63
87
|
// another dead surface. Drop the agent branch entirely.
|
|
64
88
|
return []
|
|
65
89
|
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Build the inlined-agent section appended to a Codex skill body. Strips the
|
|
93
|
+
* agent file's own frontmatter (Codex skills carry a single frontmatter block)
|
|
94
|
+
* and version-substitutes the body. The fenced header makes it unambiguous to
|
|
95
|
+
* the model that this is the methodology it should execute directly — there is
|
|
96
|
+
* no separate agent to spawn on Codex.
|
|
97
|
+
*
|
|
98
|
+
* @param {string} agentName
|
|
99
|
+
* @param {string} agentContent raw canonical agent file (with frontmatter + {{APT_VERSION}})
|
|
100
|
+
* @param {string} version
|
|
101
|
+
* @returns {string}
|
|
102
|
+
*/
|
|
103
|
+
function inlineAgentSection(agentName, agentContent, version) {
|
|
104
|
+
const agentBody = parseFrontmatter(substituteVersion(agentContent, version)).body.trim()
|
|
105
|
+
return [
|
|
106
|
+
`## Inlined agent: ${agentName}`,
|
|
107
|
+
'',
|
|
108
|
+
`Codex has no separate agent-spawn surface. Where this skill says to spawn`,
|
|
109
|
+
`the \`${agentName}\` agent, execute the methodology below directly — you ARE`,
|
|
110
|
+
`that agent for this task.`,
|
|
111
|
+
'',
|
|
112
|
+
agentBody,
|
|
113
|
+
].join('\n')
|
|
114
|
+
}
|
|
@@ -99,7 +99,13 @@ export function inspectManifestFiles(manifest, installRoot, opts = {}) {
|
|
|
99
99
|
continue
|
|
100
100
|
}
|
|
101
101
|
const declared = parseVersionHeader(buf.toString('utf-8'))
|
|
102
|
-
|
|
102
|
+
// `headerless` entries are files whose runtime transform legitimately
|
|
103
|
+
// strips the apt-skill-version header (e.g. Codex whitelists frontmatter
|
|
104
|
+
// to {name, description} and rejects unknown keys). For those, the
|
|
105
|
+
// installedHash check above is the sole drift signal — requiring a header
|
|
106
|
+
// would false-positive every install. The flag is recorded at install
|
|
107
|
+
// time by the pipeline from the post-transform content.
|
|
108
|
+
if (declared === null && !entry.headerless && /\.(md|js|mjs|sh)$/.test(entry.path)) {
|
|
103
109
|
stale.push({ path: entry.path, reason: 'missing_header' })
|
|
104
110
|
continue
|
|
105
111
|
}
|