@open-agent-toolkit/cli 0.2.66 → 0.2.67
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/assets/bundle-metadata.json +1 -1
- package/assets/docs/cli-utilities/configuration.md +14 -1
- package/assets/docs/cli-utilities/project-log.md +63 -4
- package/assets/docs/contributing/code.md +8 -4
- package/assets/docs/contributing/skills.md +29 -17
- package/assets/docs/docs-tooling/commands.md +3 -1
- package/assets/docs/provider-sync/manifest-and-drift.md +2 -18
- package/assets/docs/workflows/projects/lifecycle.md +17 -0
- package/assets/docs/workflows/projects/picking-up-projects.md +18 -0
- package/assets/docs/workflows/skills/repo-improve.md +7 -3
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/create-agnostic-skill/SKILL.md +19 -37
- package/assets/skills/create-agnostic-skill/references/docs/skills-guide.md +58 -15
- package/assets/skills/create-agnostic-skill/references/skill-template.md +17 -15
- package/assets/skills/oat-agent-instructions-apply/SKILL.md +1 -1
- package/assets/skills/oat-agent-instructions-apply/references/instruction-file-templates/glob-scoped-rule.md +1 -4
- package/assets/skills/oat-doctor/SKILL.md +1 -4
- package/assets/skills/oat-project-autonomous/references/gate-inventory.md +1 -1
- package/assets/skills/oat-project-complete/SKILL.md +158 -30
- package/assets/skills/oat-project-complete/scripts/finalize-synced-archive.mjs +26 -7
- package/assets/skills/oat-project-complete/scripts/validate-durable-archive-receipt.mjs +183 -0
- package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +1 -1
- package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +1 -1
- package/assets/skills/oat-project-lite/references/docs/autonomy-contract.md +1 -1
- package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +1 -1
- package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +1 -1
- package/assets/skills/oat-project-retro/SKILL.md +1 -1
- package/assets/skills/oat-project-retro/references/apply-procedure.md +11 -0
- package/assets/skills/oat-project-review-provide/SKILL.md +4 -4
- package/assets/skills/oat-project-summary/SKILL.md +24 -2
- package/assets/skills/oat-repo-improve/SKILL.md +9 -2
- package/assets/skills/oat-repo-improve/references/plan-template.md +4 -6
- package/assets/skills/oat-repo-knowledge-index/SKILL.md +11 -9
- package/assets/skills/oat-wave-execute/SKILL.md +20 -6
- package/assets/skills/oat-wave-program/SKILL.md +9 -4
- package/dist/commands/config/index.d.ts +2 -1
- package/dist/commands/config/index.d.ts.map +1 -1
- package/dist/commands/config/index.js +133 -38
- package/dist/commands/docs/index-generate/index.d.ts.map +1 -1
- package/dist/commands/docs/index-generate/index.js +68 -12
- package/dist/commands/docs/init/index.d.ts +11 -0
- package/dist/commands/docs/init/index.d.ts.map +1 -1
- package/dist/commands/docs/init/index.js +19 -1
- package/dist/commands/gate/index.d.ts.map +1 -1
- package/dist/commands/gate/index.js +10 -2
- package/dist/commands/instructions/instructions.utils.d.ts.map +1 -1
- package/dist/commands/instructions/instructions.utils.js +42 -9
- package/dist/commands/internal/validate-skill-version-bumps.d.ts.map +1 -1
- package/dist/commands/internal/validate-skill-version-bumps.js +5 -5
- package/dist/commands/project/dispatch-ceiling/index.d.ts.map +1 -1
- package/dist/commands/project/dispatch-ceiling/index.js +32 -18
- package/dist/commands/project/log/append.d.ts +48 -0
- package/dist/commands/project/log/append.d.ts.map +1 -1
- package/dist/commands/project/log/append.js +207 -30
- package/dist/commands/project/log/check.d.ts +87 -1
- package/dist/commands/project/log/check.d.ts.map +1 -1
- package/dist/commands/project/log/check.js +139 -5
- package/dist/commands/project/log/grammar.d.ts +165 -0
- package/dist/commands/project/log/grammar.d.ts.map +1 -1
- package/dist/commands/project/log/grammar.js +219 -1
- package/dist/commands/project/log/rollup.d.ts +16 -1
- package/dist/commands/project/log/rollup.d.ts.map +1 -1
- package/dist/commands/project/log/rollup.js +22 -2
- package/dist/commands/project/log/synthesize.d.ts +16 -0
- package/dist/commands/project/log/synthesize.d.ts.map +1 -1
- package/dist/commands/project/log/synthesize.js +85 -9
- package/dist/commands/status/index.d.ts.map +1 -1
- package/dist/commands/status/index.js +24 -2
- package/dist/commands/sync/apply.d.ts.map +1 -1
- package/dist/commands/sync/apply.js +6 -4
- package/dist/config/dispatch-matrix.d.ts.map +1 -1
- package/dist/config/dispatch-matrix.js +13 -5
- package/dist/config/oat-config.d.ts +15 -0
- package/dist/config/oat-config.d.ts.map +1 -1
- package/dist/config/oat-config.js +61 -7
- package/dist/config/own-keys.d.ts +22 -0
- package/dist/config/own-keys.d.ts.map +1 -0
- package/dist/config/own-keys.js +32 -0
- package/dist/config/resolve.d.ts +11 -0
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +35 -11
- package/dist/config/sync-config.d.ts.map +1 -1
- package/dist/config/sync-config.js +16 -0
- package/dist/drift/detector.d.ts.map +1 -1
- package/dist/drift/detector.js +52 -1
- package/dist/drift/skill-view-diagnostic.d.ts.map +1 -1
- package/dist/drift/skill-view-diagnostic.js +2 -23
- package/dist/engine/compute-plan.d.ts.map +1 -1
- package/dist/engine/compute-plan.js +22 -72
- package/dist/engine/managed-copy-hash.d.ts +69 -0
- package/dist/engine/managed-copy-hash.d.ts.map +1 -0
- package/dist/engine/managed-copy-hash.js +175 -0
- package/dist/fs/assets.d.ts +11 -0
- package/dist/fs/assets.d.ts.map +1 -1
- package/dist/fs/assets.js +1 -1
- package/dist/manifest/hash.d.ts +110 -0
- package/dist/manifest/hash.d.ts.map +1 -1
- package/dist/manifest/hash.js +111 -13
- package/dist/providers/ceiling/registry.d.ts.map +1 -1
- package/dist/providers/ceiling/registry.js +6 -1
- package/dist/providers/identity/dispatch-report.d.ts.map +1 -1
- package/dist/providers/identity/dispatch-report.js +4 -1
- package/dist/release/public-package-contract.d.ts.map +1 -1
- package/dist/release/public-package-contract.js +21 -0
- package/dist/validation/skills.d.ts.map +1 -1
- package/dist/validation/skills.js +305 -40
- package/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
1
2
|
import { buildCommandContext, } from '../../../app/command-context.js';
|
|
2
3
|
import { formatAgentsMdGuidanceResult, formatAgentsMdMutationFailure, upsertAgentsMdSection, } from '../../shared/agents-md.js';
|
|
3
4
|
import { confirmAction, inputWithDefault, selectWithAbort, } from '../../shared/shared.prompts.js';
|
|
@@ -90,14 +91,31 @@ const FRAMEWORK_LABELS = {
|
|
|
90
91
|
fumadocs: 'Fumadocs (Next.js + MDX)',
|
|
91
92
|
mkdocs: 'MkDocs (Python)',
|
|
92
93
|
};
|
|
94
|
+
/**
|
|
95
|
+
* The AGENTS.md `## Documentation` section for a freshly scaffolded app.
|
|
96
|
+
*
|
|
97
|
+
* Each bullet names the file that owns one role, matching what
|
|
98
|
+
* `buildDocumentationConfig` seeds into `documentation.*`. A Fumadocs app has
|
|
99
|
+
* two index files -- the authored source page under `docs/` and the app-root
|
|
100
|
+
* manifest `oat docs generate-index` writes -- and `documentation.index` names
|
|
101
|
+
* the second, so a single "Index file" bullet pointing at the first documented
|
|
102
|
+
* a file the config does not name. MkDocs has no generated manifest: its
|
|
103
|
+
* `documentation.index` is the nav YAML the Config bullet already names.
|
|
104
|
+
*/
|
|
93
105
|
export function buildDocsSectionBody(options) {
|
|
94
106
|
const lines = [
|
|
95
107
|
'## Documentation',
|
|
96
108
|
'',
|
|
97
109
|
`- **Docs root:** \`${options.targetDir}\``,
|
|
98
110
|
`- **Framework:** ${FRAMEWORK_LABELS[options.framework]}`,
|
|
99
|
-
`- **
|
|
111
|
+
`- **Docs source index:** \`${options.targetDir}/docs/index.md\``,
|
|
100
112
|
];
|
|
113
|
+
if (options.framework === 'fumadocs') {
|
|
114
|
+
// Derived exactly like the `documentation.index` seed in `./scaffold`, so
|
|
115
|
+
// the printed path and the recorded path cannot drift apart.
|
|
116
|
+
lines.push(`- **Generated index:** \`${join(options.targetDir, 'index.md')}\` — ` +
|
|
117
|
+
'regenerated by `oat docs generate-index`; do not hand-edit.');
|
|
118
|
+
}
|
|
101
119
|
if (options.framework === 'mkdocs') {
|
|
102
120
|
lines.push(`- **Config:** \`${options.targetDir}/mkdocs.yml\``);
|
|
103
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/gate/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gBAAgB,EAKhB,KAAK,qBAAqB,EAE3B,MAAM,8BAA8B,CAAC;AAYtC,OAAO,EAWL,KAAK,UAAU,EAIf,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,UAAU,EAEhB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/gate/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gBAAgB,EAKhB,KAAK,qBAAqB,EAE3B,MAAM,8BAA8B,CAAC;AAYtC,OAAO,EAWL,KAAK,UAAU,EAIf,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,UAAU,EAEhB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAOL,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AAWzB,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EAExB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EACL,uBAAuB,EAExB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EAEzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACtB,M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AC;QAChB,MAAM,EAAE,WAAW,CAAC;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAs2CD,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,EAC9C,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,kBAAkB,EACzB,gBAAgB,CAAC,EAAE,oBAAoB,GACtC,kBAAkB,GAAG,IAAI,CAS3B;AA+xFD,wBAAgB,iBAAiB,CAC/B,SAAS,GAAE,OAAO,CAAC,uBAAuB,CAAM,GAC/C,OAAO,CAsOT"}
|
|
@@ -9,6 +9,7 @@ import { getFrontmatterBlock, parseFrontmatterScalarFields, parseGeneratedTime,
|
|
|
9
9
|
import { readGlobalOptions } from '../shared/shared.utils.js';
|
|
10
10
|
import { parseJsonConfig } from '../../config/json.js';
|
|
11
11
|
import { BUILTIN_EXEC_TARGETS, MAX_GATE_TIMEOUT_MS, MIN_GATE_TIMEOUT_MS, isValidGateTimeoutMs, readOatConfig, readOatLocalConfig, readUserConfig, writeOatConfig, writeOatLocalConfig, writeUserConfig, } from '../../config/oat-config.js';
|
|
12
|
+
import { getOwnKey } from '../../config/own-keys.js';
|
|
12
13
|
import { resolveEffectiveConfig, resolveExecTargetViews, resolveExecTargets, resolveGate, resolveGateWithSource, } from '../../config/resolve.js';
|
|
13
14
|
import { dirExists, fileExists } from '../../fs/io.js';
|
|
14
15
|
import { normalizeToPosixPath, resolveProjectRoot, validateRealPathWithinScope, } from '../../fs/paths.js';
|
|
@@ -634,7 +635,11 @@ function unsetSkillGate(config, skillName) {
|
|
|
634
635
|
}
|
|
635
636
|
function setExecTarget(config, targetId, target) {
|
|
636
637
|
return updateWorkflowGates(config, (gates) => {
|
|
637
|
-
|
|
638
|
+
// `targetId` comes from `oat gate target set <id>`. Without the own-key
|
|
639
|
+
// guard, an id of `__proto__` reads `Object.prototype`, which is truthy,
|
|
640
|
+
// so this takes the merge branch and silently omits the `priority: 0`
|
|
641
|
+
// default the create branch applies.
|
|
642
|
+
const existing = getOwnKey(gates.execTargets ?? {}, targetId);
|
|
638
643
|
const value = target === null
|
|
639
644
|
? target
|
|
640
645
|
: existing === null || existing === undefined
|
|
@@ -1034,7 +1039,10 @@ async function selectAvailableExecTarget(registry, currentRuntime, avoid, produc
|
|
|
1034
1039
|
async function resolveSelectedExecTarget(targets, options, producerIdentity, context, dependencies) {
|
|
1035
1040
|
const explicitTarget = options.target?.trim();
|
|
1036
1041
|
if (explicitTarget) {
|
|
1037
|
-
|
|
1042
|
+
// `--target <id>` is a free-form user string. Without the own-key read an
|
|
1043
|
+
// id of `__proto__` or `constructor` returns a truthy inherited member and
|
|
1044
|
+
// slips past the unknown-target rejection below.
|
|
1045
|
+
const target = getOwnKey(targets, explicitTarget);
|
|
1038
1046
|
if (!target) {
|
|
1039
1047
|
throw new Error(`Unknown exec target "${explicitTarget}".`);
|
|
1040
1048
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.utils.d.ts","sourceRoot":"","sources":["../../../src/commands/instructions/instructions.utils.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,4BAA4B,EAC5B,uBAAuB,EACvB,4BAA4B,EAE5B,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,uBAAuB,iBAAiB,CAAC;AACtD,eAAO,MAAM,iCAAiC,EAAE,uBACrC,CAAC;AAcZ,UAAU,4BAA4B;IACpC,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,OAAO,EAAE,uBAAuB,EAAE,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAClC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAiCD,wBAAgB,8BAA8B,CAC5C,QAAQ,CAAC,EAAE,uBAAuB,GACjC,uBAAuB,CAEzB;AA2ED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,GAAE,SAAS,MAAM,EAAO,GACpC,MAAM,EAAE,CAyBV;
|
|
1
|
+
{"version":3,"file":"instructions.utils.d.ts","sourceRoot":"","sources":["../../../src/commands/instructions/instructions.utils.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,4BAA4B,EAC5B,uBAAuB,EACvB,4BAA4B,EAE5B,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,uBAAuB,iBAAiB,CAAC;AACtD,eAAO,MAAM,iCAAiC,EAAE,uBACrC,CAAC;AAcZ,UAAU,4BAA4B;IACpC,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,OAAO,EAAE,uBAAuB,EAAE,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAClC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAiCD,wBAAgB,8BAA8B,CAC5C,QAAQ,CAAC,EAAE,uBAAuB,GACjC,uBAAuB,CAEzB;AA2ED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,GAAE,SAAS,MAAM,EAAO,GACpC,MAAM,EAAE,CAyBV;AA0FD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,iCAAiC,CACrD,QAAQ,EAAE,MAAM,EAChB,SAAS,GAAE,OAAO,CAAC,4BAA4B,CAAM,GACpD,OAAO,CAAC,4BAA4B,CAAC,CAgGvC;AAgID,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,uBAA4B,EACrC,SAAS,GAAE,OAAO,CAAC,4BAA4B,CAAM,GACpD,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAkO7B;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,gBAAgB,EAAE,EAC3B,OAAO,EAAE,uBAAuB,EAAE,GACjC,mBAAmB,CAoBrB;AAgBD,wBAAgB,wBAAwB,CAAC,EACvC,IAAI,EACJ,OAAO,EACP,OAAO,EACP,aAAa,EACb,sBAAsB,EACtB,iBAAiB,GAClB,EAAE,4BAA4B,GAAG,uBAAuB,CAgCxD;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,uBAAuB,EAChC,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,CAmCR"}
|
|
@@ -142,7 +142,7 @@ export function normalizeExcludedPaths(excludedPaths = []) {
|
|
|
142
142
|
const UNEXCLUDABLE_PATHS = new Set([...ROOT_EXCLUDED_DIRECTORY_CARVE_INS].map(([directory, carveIn]) => `${directory}/${carveIn}`));
|
|
143
143
|
/**
|
|
144
144
|
* Whether `relativePath` names a real directory whose on-disk spelling matches
|
|
145
|
-
* exactly.
|
|
145
|
+
* exactly, and when it does not, where it actually leads.
|
|
146
146
|
*
|
|
147
147
|
* The case check is the point. On a case-insensitive filesystem (APFS, NTFS) a
|
|
148
148
|
* plain existence test accepts `Apps/Docsapp/docs` for a directory really named
|
|
@@ -150,24 +150,44 @@ const UNEXCLUDABLE_PATHS = new Set([...ROOT_EXCLUDED_DIRECTORY_CARVE_INS].map(([
|
|
|
150
150
|
* which always yields the true on-disk case. The exclusion would then be
|
|
151
151
|
* reported as applied while matching nothing — issue #238 recurring silently on
|
|
152
152
|
* the default developer platform. Resolving through `realpath` and comparing
|
|
153
|
-
* the result to the requested spelling catches that, and
|
|
154
|
-
*
|
|
153
|
+
* the result to the requested spelling catches that, and reports a path that
|
|
154
|
+
* does not exist at all as `absent`.
|
|
155
155
|
*
|
|
156
156
|
* `repoRoot` is realpath'd too, so a symlinked checkout (`/tmp` on macOS) does
|
|
157
157
|
* not make every entry look like a mismatch.
|
|
158
|
+
*
|
|
159
|
+
* `caseOnly` is derived from the resolved path rather than from the platform: a
|
|
160
|
+
* case-insensitive host is not the only way to land on a differing spelling,
|
|
161
|
+
* and a platform check would attach the case-sensitivity hint to symlinks,
|
|
162
|
+
* where it is false.
|
|
158
163
|
*/
|
|
159
|
-
async function
|
|
164
|
+
async function probeExclusionDirectory(dependencies, repoRoot, relativePath) {
|
|
160
165
|
try {
|
|
161
166
|
const realRoot = await dependencies.realpath(repoRoot);
|
|
162
167
|
const candidate = join(realRoot, relativePath);
|
|
163
168
|
if (!(await directoryExists(dependencies, candidate))) {
|
|
164
|
-
return
|
|
169
|
+
return { kind: 'absent' };
|
|
165
170
|
}
|
|
166
171
|
const realCandidate = await dependencies.realpath(candidate);
|
|
167
|
-
|
|
172
|
+
const resolved = toPosixPath(relative(realRoot, realCandidate));
|
|
173
|
+
if (resolved === relativePath) {
|
|
174
|
+
return { kind: 'exact' };
|
|
175
|
+
}
|
|
176
|
+
// A target outside the repository reads as a plain absolute path; a `../`
|
|
177
|
+
// chain relative to a root the operator never typed would be worse than no
|
|
178
|
+
// target at all. An empty `resolved` means the entry landed on the
|
|
179
|
+
// repository root itself, which is equally unhelpful as a relative path.
|
|
180
|
+
const resolvedInsideRepository = resolved.length > 0 && resolved !== '..' && !resolved.startsWith('../');
|
|
181
|
+
return {
|
|
182
|
+
kind: 'resolved-elsewhere',
|
|
183
|
+
resolvedPath: resolvedInsideRepository
|
|
184
|
+
? resolved
|
|
185
|
+
: toPosixPath(realCandidate),
|
|
186
|
+
caseOnly: resolved.toLowerCase() === relativePath.toLowerCase(),
|
|
187
|
+
};
|
|
168
188
|
}
|
|
169
189
|
catch {
|
|
170
|
-
return
|
|
190
|
+
return { kind: 'absent' };
|
|
171
191
|
}
|
|
172
192
|
}
|
|
173
193
|
/**
|
|
@@ -244,11 +264,24 @@ export async function resolveInstructionPointerExcludes(repoRoot, overrides = {}
|
|
|
244
264
|
warnings.push(`${source} entry ${JSON.stringify(normalizedPath)} has no effect: ${normalizedPath} is always scanned.`);
|
|
245
265
|
continue;
|
|
246
266
|
}
|
|
247
|
-
|
|
267
|
+
const probe = await probeExclusionDirectory(dependencies, repoRoot, normalizedPath);
|
|
268
|
+
if (probe.kind === 'exact') {
|
|
269
|
+
effective.push(normalizedPath);
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
if (probe.kind === 'absent') {
|
|
248
273
|
warnings.push(`${source} entry ${JSON.stringify(normalizedPath)} matches no directory in this repository (matching is case-sensitive), so it excludes nothing.`);
|
|
249
274
|
continue;
|
|
250
275
|
}
|
|
251
|
-
|
|
276
|
+
// Stated, not left implied by elimination, and without a catch-all
|
|
277
|
+
// `default` that would silently absorb a future variant: this annotation
|
|
278
|
+
// stops compiling the moment `ExclusionDirectoryProbe` grows a variant with
|
|
279
|
+
// no branch above — including one that happens to carry the same fields and
|
|
280
|
+
// would otherwise inherit a message written for a different situation.
|
|
281
|
+
const resolvedElsewhere = probe;
|
|
282
|
+
warnings.push(resolvedElsewhere.caseOnly
|
|
283
|
+
? `${source} entry ${JSON.stringify(normalizedPath)} matches no directory in this repository (matching is case-sensitive; the directory on disk is ${JSON.stringify(resolvedElsewhere.resolvedPath)}), so it excludes nothing.`
|
|
284
|
+
: `${source} entry ${JSON.stringify(normalizedPath)} resolves to ${JSON.stringify(resolvedElsewhere.resolvedPath)}, not to itself, so the scan never matches it and it excludes nothing. Point the entry at the resolved directory, or remove the symlink.`);
|
|
252
285
|
}
|
|
253
286
|
return { configured, effective, warnings };
|
|
254
287
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-skill-version-bumps.d.ts","sourceRoot":"","sources":["../../../src/commands/internal/validate-skill-version-bumps.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,uCAAuC,EAC5C,KAAK,sCAAsC,EAC5C,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,UAAU,qCAAqC;IAC7C,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,cAAc,CAAC;IAChE,gCAAgC,EAAE,CAChC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,uCAAuC,KAC7C,OAAO,CAAC,sCAAsC,CAAC,CAAC;CACtD;
|
|
1
|
+
{"version":3,"file":"validate-skill-version-bumps.d.ts","sourceRoot":"","sources":["../../../src/commands/internal/validate-skill-version-bumps.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,uCAAuC,EAC5C,KAAK,sCAAsC,EAC5C,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,UAAU,qCAAqC;IAC7C,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,cAAc,CAAC;IAChE,gCAAgC,EAAE,CAChC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,uCAAuC,KAC7C,OAAO,CAAC,sCAAsC,CAAC,CAAC;CACtD;AAgFD,wBAAgB,sCAAsC,CACpD,SAAS,GAAE,OAAO,CAAC,qCAAqC,CAAM,GAC7D,OAAO,CAyBT"}
|
|
@@ -16,7 +16,7 @@ function reportFindings(context, baseRef, result) {
|
|
|
16
16
|
});
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
context.logger.error('Canonical skill version validation failed:\n');
|
|
19
|
+
context.logger.error('Canonical skill and agent role version validation failed:\n');
|
|
20
20
|
for (const finding of result.findings) {
|
|
21
21
|
context.logger.error(`- ${finding.file}: ${finding.message}`);
|
|
22
22
|
}
|
|
@@ -40,10 +40,10 @@ async function runValidateSkillVersionBumps(context, options, dependencies) {
|
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
42
42
|
if (result.validatedSkillCount === 0) {
|
|
43
|
-
context.logger.info(`OK: 0 canonical skills changed relative to ${options.baseRef} - nothing to validate`);
|
|
43
|
+
context.logger.info(`OK: 0 canonical skills or agent roles changed relative to ${options.baseRef} - nothing to validate`);
|
|
44
44
|
}
|
|
45
45
|
else {
|
|
46
|
-
context.logger.info(`OK: validated ${result.validatedSkillCount} changed canonical skill version bump checks against ${options.baseRef}`);
|
|
46
|
+
context.logger.info(`OK: validated ${result.validatedSkillCount} changed canonical skill and agent role version bump checks against ${options.baseRef}`);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
process.exitCode = 0;
|
|
@@ -65,8 +65,8 @@ export function createValidateSkillVersionBumpsCommand(overrides = {}) {
|
|
|
65
65
|
...overrides,
|
|
66
66
|
};
|
|
67
67
|
return new Command('validate-skill-version-bumps')
|
|
68
|
-
.description('Validate that changed canonical skills bump version relative to a git base ref')
|
|
69
|
-
.requiredOption('--base-ref <ref>', 'Git ref used as the comparison base for changed canonical skills')
|
|
68
|
+
.description('Validate that changed canonical skills and agent roles bump version relative to a git base ref')
|
|
69
|
+
.requiredOption('--base-ref <ref>', 'Git ref used as the comparison base for changed canonical skills and agent roles')
|
|
70
70
|
.action(async (options, command) => {
|
|
71
71
|
const context = dependencies.buildCommandContext(readGlobalOptions(command));
|
|
72
72
|
await runValidateSkillVersionBumps(context, options, dependencies);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/dispatch-ceiling/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAkB9B,OAAO,EAUL,KAAK,uBAAuB,EAY7B,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/dispatch-ceiling/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAkB9B,OAAO,EAUL,KAAK,uBAAuB,EAY7B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,iBAAiB,CAAC;AA6BzB,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAiC5C,UAAU,2BAA2B;IACnC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,cAAc,CAAC;IAChE,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,sBAAsB,EAAE,CACtB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,GAAG,EAAE,MAAM,CAAC,UAAU,KACnB,OAAO,CAAC,cAAc,CAAC,CAAC;IAC7B,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAC7E,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/C,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC;CAC/B;AAkyFD,wBAAgB,mCAAmC,CACjD,SAAS,GAAE,OAAO,CAAC,2BAA2B,CAAM,GACnD,OAAO,CA0GT"}
|
|
@@ -8,6 +8,7 @@ import { normalizeDispatchMatrix } from '../../../config/dispatch-matrix.js';
|
|
|
8
8
|
import { effectiveTerminalReviewerTarget, formatDispatchNotices, terminalReviewerNoticeForTarget, } from '../../../config/dispatch-notices.js';
|
|
9
9
|
import { getDispatchPolicyChoices, managedDispatchPolicyValueList, renderDispatchPolicyChoicesMarkdown, } from '../../../config/dispatch-policy-options.js';
|
|
10
10
|
import { resolveActiveProject, VALID_CLAUDE_DISPATCH_CEILINGS, VALID_CODEX_DISPATCH_CEILINGS, VALID_DISPATCH_MATRIX_TIERS, VALID_MANAGED_DISPATCH_POLICIES, isWorkflowDispatchCandidateLadder, isWorkflowDispatchFallbackRoute, toWorkflowDispatchCandidateLadder, validateDispatchRouteTarget, } from '../../../config/oat-config.js';
|
|
11
|
+
import { getOwnKey, setOwnKey } from '../../../config/own-keys.js';
|
|
11
12
|
import { resolveEffectiveConfig, } from '../../../config/resolve.js';
|
|
12
13
|
import { resolveProjectRoot } from '../../../fs/paths.js';
|
|
13
14
|
import TOML from '@iarna/toml';
|
|
@@ -141,13 +142,17 @@ function isProjectMatrixRecord(value) {
|
|
|
141
142
|
}
|
|
142
143
|
function toProjectMatrixCompatibility(rawMatrix, matrix) {
|
|
143
144
|
const compatibility = {};
|
|
145
|
+
// The normalized matrix now keeps a provider named `__proto__` as an own
|
|
146
|
+
// key, so `Object.entries` yields it here: assignment would drop a scalar
|
|
147
|
+
// entry and install a tier map as this output's prototype.
|
|
144
148
|
for (const [provider, providerValue] of Object.entries(matrix)) {
|
|
145
149
|
if (typeof providerValue === 'string') {
|
|
146
|
-
compatibility
|
|
150
|
+
setOwnKey(compatibility, provider, providerValue);
|
|
147
151
|
continue;
|
|
148
152
|
}
|
|
149
|
-
const
|
|
150
|
-
|
|
153
|
+
const rawProviderValue = getOwnKey(rawMatrix, provider);
|
|
154
|
+
const rawProvider = isProjectMatrixRecord(rawProviderValue)
|
|
155
|
+
? rawProviderValue
|
|
151
156
|
: {};
|
|
152
157
|
const tiers = {};
|
|
153
158
|
for (const [tier, cell] of Object.entries(providerValue)) {
|
|
@@ -167,7 +172,7 @@ function toProjectMatrixCompatibility(rawMatrix, matrix) {
|
|
|
167
172
|
}
|
|
168
173
|
tiers[matrixTier] = cell;
|
|
169
174
|
}
|
|
170
|
-
compatibility
|
|
175
|
+
setOwnKey(compatibility, provider, tiers);
|
|
171
176
|
}
|
|
172
177
|
return compatibility;
|
|
173
178
|
}
|
|
@@ -346,7 +351,7 @@ function resolveProviderMatrixCell(provider, tier, resolvedConfig, projectMatrix
|
|
|
346
351
|
{ source: 'project-state', providers: projectMatrix },
|
|
347
352
|
];
|
|
348
353
|
for (const layer of layers) {
|
|
349
|
-
const resolved = resolveProviderCellFromValue(provider, layer.providers
|
|
354
|
+
const resolved = resolveProviderCellFromValue(provider, layer.providers ? getOwnKey(layer.providers, provider) : undefined, tier, layer.source, escalationLevel);
|
|
350
355
|
if (resolved) {
|
|
351
356
|
selected = resolved;
|
|
352
357
|
}
|
|
@@ -371,7 +376,9 @@ function resolveProviderMatrixCellDefinition(provider, tier, resolvedConfig, pro
|
|
|
371
376
|
{ source: 'project-state', providers: projectMatrix },
|
|
372
377
|
];
|
|
373
378
|
for (const layer of layers) {
|
|
374
|
-
const providerValue = layer.providers
|
|
379
|
+
const providerValue = layer.providers
|
|
380
|
+
? getOwnKey(layer.providers, provider)
|
|
381
|
+
: undefined;
|
|
375
382
|
if (typeof providerValue === 'string') {
|
|
376
383
|
selected = null;
|
|
377
384
|
continue;
|
|
@@ -1305,17 +1312,20 @@ function mergeEffectiveDispatchMatrix(resolvedConfig) {
|
|
|
1305
1312
|
resolvedConfig.local.workflow?.dispatchCeiling?.providers,
|
|
1306
1313
|
];
|
|
1307
1314
|
for (const providers of layers) {
|
|
1315
|
+
// Provider names come from user config, which now preserves a key named
|
|
1316
|
+
// `__proto__` as an own key, so `Object.entries` yields it here. Plain
|
|
1317
|
+
// member access would reinstall it as this map's prototype and lose it.
|
|
1308
1318
|
for (const [provider, value] of Object.entries(providers ?? {})) {
|
|
1309
|
-
const previous = merged
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
+
const previous = getOwnKey(merged, provider);
|
|
1320
|
+
const mergedValue = typeof value === 'object' &&
|
|
1321
|
+
value !== null &&
|
|
1322
|
+
!Array.isArray(value) &&
|
|
1323
|
+
typeof previous === 'object' &&
|
|
1324
|
+
previous !== null &&
|
|
1325
|
+
!Array.isArray(previous)
|
|
1326
|
+
? { ...previous, ...value }
|
|
1327
|
+
: value;
|
|
1328
|
+
setOwnKey(merged, provider, mergedValue);
|
|
1319
1329
|
}
|
|
1320
1330
|
}
|
|
1321
1331
|
return merged;
|
|
@@ -1648,7 +1658,9 @@ function writeHumanResolution(context, resolution) {
|
|
|
1648
1658
|
context.logger.info(`${label} dispatch policy: ${policyLabel(resolution.policy)}`);
|
|
1649
1659
|
context.logger.info(`Resolved cap: ${resolution.value ?? 'none'}`);
|
|
1650
1660
|
context.logger.info(`Source: ${sourceLabel(resolution.source)}`);
|
|
1651
|
-
|
|
1661
|
+
// `resolution.provider` is an open string union carrying a user-supplied
|
|
1662
|
+
// `--provider` value, so an unowned prototype name must read as absent.
|
|
1663
|
+
const providerResolution = getOwnKey(resolution.providers, resolution.provider);
|
|
1652
1664
|
if (providerResolution) {
|
|
1653
1665
|
context.logger.info(`Mode: ${providerResolution.mode} (${providerResolution.mechanism})`);
|
|
1654
1666
|
context.logger.info(`Selection: ${providerResolution.selection.selectionMode}`);
|
|
@@ -1760,7 +1772,9 @@ function buildResolutionReport(resolution, options) {
|
|
|
1760
1772
|
}
|
|
1761
1773
|
const action = options.reportAction;
|
|
1762
1774
|
const role = reportRole(action);
|
|
1763
|
-
|
|
1775
|
+
// `resolution.provider` is an open string union carrying a user-supplied
|
|
1776
|
+
// `--provider` value, so an unowned prototype name must read as absent.
|
|
1777
|
+
const providerResolution = getOwnKey(resolution.providers, resolution.provider);
|
|
1764
1778
|
if (!providerResolution) {
|
|
1765
1779
|
throw new Error(`Dispatch report resolution is missing provider data for "${resolution.provider}".`);
|
|
1766
1780
|
}
|
|
@@ -2,6 +2,7 @@ import { type CommandContext, type GlobalOptions } from '../../../app/command-co
|
|
|
2
2
|
import { type ActiveProjectResolution } from '../../../config/oat-config.js';
|
|
3
3
|
import { type ResolvedConfig } from '../../../config/resolve.js';
|
|
4
4
|
import { Command } from 'commander';
|
|
5
|
+
import { type ProjectLogSeal } from './check.js';
|
|
5
6
|
export declare const PROJECT_LOG_FILENAME = "project-log.md";
|
|
6
7
|
/**
|
|
7
8
|
* Directory, relative to a project, that holds gate partial-finalization
|
|
@@ -34,6 +35,25 @@ export interface ProjectLogLockDependencies {
|
|
|
34
35
|
now: () => number;
|
|
35
36
|
}
|
|
36
37
|
export declare function projectLogLockPath(logPath: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* Runs `mutate` with the log's advisory lock held, releasing it on every path.
|
|
40
|
+
*
|
|
41
|
+
* `required` is for mutations that rewrite the file. Running one of those
|
|
42
|
+
* without the lock is exactly the read/modify/write race this exists to close,
|
|
43
|
+
* so an unavailable lock refuses rather than proceeding: a loud, retryable
|
|
44
|
+
* failure that the caller reports is strictly better than a silent clobber of
|
|
45
|
+
* another writer's entry, and the recovery command replays the append safely.
|
|
46
|
+
*
|
|
47
|
+
* `best-effort` is for work that cannot lose an entry — committing does not
|
|
48
|
+
* rewrite the log — where holding the lock only keeps this process from racing
|
|
49
|
+
* its own sibling into `.git/index.lock`.
|
|
50
|
+
*
|
|
51
|
+
* Exported so `synthesize` enters the same critical section rather than a
|
|
52
|
+
* second one of its own: its whole-file rewrite races an overlapping append
|
|
53
|
+
* exactly as two appends race each other, and two locks would serialize
|
|
54
|
+
* neither.
|
|
55
|
+
*/
|
|
56
|
+
export declare function withProjectLogLock<T>(logPath: string, overrides: Partial<ProjectLogLockDependencies>, policy: 'required' | 'best-effort', mutate: () => Promise<T>): Promise<T>;
|
|
37
57
|
export type GitLockFailureClass = 'transient-index-lock' | 'persistent-index-lock' | 'other';
|
|
38
58
|
export type ProjectLogCommitOutcome = 'committed' | 'already-committed' | 'nothing-to-commit' | 'not-a-repo' | 'blocked-by-index-lock' | 'entry-missing-after-commit' | 'commit-unverified' | 'failed';
|
|
39
59
|
export interface ProjectLogCommitResult {
|
|
@@ -186,11 +206,39 @@ export interface AppendProjectLogInput {
|
|
|
186
206
|
versionNote?: string;
|
|
187
207
|
idempotencyKey?: string;
|
|
188
208
|
}
|
|
209
|
+
/**
|
|
210
|
+
* Raised when an append that is not the completion seal targets a sealed log.
|
|
211
|
+
*
|
|
212
|
+
* This is a throw rather than a fourth `ProjectLogAppendResult` variant because
|
|
213
|
+
* every in-tree caller of `appendProjectLog` runs *before* the seal: the gate's
|
|
214
|
+
* partial-finalization receipt narrows the result's `status` into its own
|
|
215
|
+
* `'appended' | 'already-appended'` field, so widening the union would force a
|
|
216
|
+
* change on a caller that can never legitimately reach this state. Throwing
|
|
217
|
+
* refuses that caller too — the command layer maps this to
|
|
218
|
+
* `status: 'sealed'` with a non-zero exit, and any other caller fails loudly
|
|
219
|
+
* instead of silently appending past the seal.
|
|
220
|
+
*/
|
|
221
|
+
export declare class ProjectLogSealedError extends Error {
|
|
222
|
+
readonly logPath: string;
|
|
223
|
+
readonly seal: ProjectLogSeal;
|
|
224
|
+
/**
|
|
225
|
+
* `action` names the refused mutation so `synthesize`, which rewrites rather
|
|
226
|
+
* than appends, reports what it actually declined. It defaults to `append`,
|
|
227
|
+
* which is the wording every existing caller and its pinned control expect.
|
|
228
|
+
*/
|
|
229
|
+
constructor(logPath: string, seal: ProjectLogSeal, action?: string);
|
|
230
|
+
}
|
|
189
231
|
export type ProjectLogAppendResult = {
|
|
190
232
|
status: 'appended';
|
|
191
233
|
logPath: string;
|
|
192
234
|
heading: string;
|
|
193
235
|
created: boolean;
|
|
236
|
+
/**
|
|
237
|
+
* Present and true when the accepted `--body` carried CRLF and was stored
|
|
238
|
+
* as LF. The command reports it rather than normalizing silently, because
|
|
239
|
+
* the bytes on disk then differ from the bytes the caller passed.
|
|
240
|
+
*/
|
|
241
|
+
normalizedLineEndings?: true;
|
|
194
242
|
} | {
|
|
195
243
|
status: 'already-appended';
|
|
196
244
|
logPath: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"append.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/log/append.ts"],"names":[],"mappings":"AA8BA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAI9E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"append.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/log/append.ts"],"names":[],"mappings":"AA8BA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAI9E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,SAAS,CAAC;AAqBjB,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AAGrD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,kBAAkB,CAAC;AAErD;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAC7C,eAAO,MAAM,kCAAkC,EAAE,SAAS,MAAM,EAAe,CAAC;AAuBhF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,OAAQ,CAAC;AAC9C,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAC3C,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAEhD,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,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