@open-agent-toolkit/cli 0.2.63 → 0.2.65
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/tool-packs.md +83 -0
- package/assets/docs/contributing/skills.md +52 -7
- package/assets/docs/provider-sync/manifest-and-drift.md +105 -0
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/analyze/SKILL.md +2 -1
- package/assets/skills/authoring-docs/SKILL.md +2 -1
- package/assets/skills/compare/SKILL.md +2 -1
- package/assets/skills/create-agnostic-skill/SKILL.md +10 -7
- package/assets/skills/create-agnostic-skill/references/skill-template.md +9 -7
- package/assets/skills/deep-research/SKILL.md +2 -1
- package/assets/skills/explainer-kit/SKILL.md +2 -1
- package/assets/skills/oat-agent-instructions-analyze/SKILL.md +2 -1
- package/assets/skills/oat-agent-instructions-apply/SKILL.md +2 -1
- package/assets/skills/oat-brainstorm/SKILL.md +2 -1
- package/assets/skills/oat-cursor-cloud-projects/SKILL.md +2 -1
- package/assets/skills/oat-dispatch-subagents/SKILL.md +2 -1
- package/assets/skills/oat-docs/SKILL.md +2 -1
- package/assets/skills/oat-docs-analyze/SKILL.md +2 -1
- package/assets/skills/oat-docs-apply/SKILL.md +2 -1
- package/assets/skills/oat-docs-authoring/SKILL.md +2 -1
- package/assets/skills/oat-docs-bootstrap/SKILL.md +2 -1
- package/assets/skills/oat-doctor/SKILL.md +2 -1
- package/assets/skills/oat-explainer-kit/SKILL.md +2 -1
- package/assets/skills/oat-explainer-kit/scripts/check-core.mjs +322 -2
- package/assets/skills/oat-idea-ideate/SKILL.md +2 -1
- package/assets/skills/oat-idea-new/SKILL.md +2 -1
- package/assets/skills/oat-idea-scratchpad/SKILL.md +2 -1
- package/assets/skills/oat-idea-summarize/SKILL.md +2 -1
- package/assets/skills/oat-pjm-add-backlog-item/SKILL.md +2 -1
- package/assets/skills/oat-pjm-decision/SKILL.md +2 -1
- package/assets/skills/oat-pjm-review-backlog/SKILL.md +2 -1
- package/assets/skills/oat-pjm-update-repo-reference/SKILL.md +2 -1
- package/assets/skills/oat-project-autonomous/SKILL.md +2 -1
- package/assets/skills/oat-project-autonomous/references/gate-inventory.md +1 -0
- package/assets/skills/oat-project-capture/SKILL.md +2 -1
- package/assets/skills/oat-project-clear-active/SKILL.md +2 -1
- package/assets/skills/oat-project-complete/SKILL.md +2 -1
- package/assets/skills/oat-project-design/SKILL.md +2 -1
- package/assets/skills/oat-project-discover/SKILL.md +2 -1
- package/assets/skills/oat-project-dispatch-subagents/SKILL.md +2 -1
- package/assets/skills/oat-project-document/SKILL.md +2 -1
- package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +1 -0
- package/assets/skills/oat-project-implement/SKILL.md +2 -1
- package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +1 -0
- package/assets/skills/oat-project-import-plan/SKILL.md +2 -1
- package/assets/skills/oat-project-lite/SKILL.md +2 -1
- package/assets/skills/oat-project-lite/references/docs/autonomy-contract.md +1 -0
- package/assets/skills/oat-project-new/SKILL.md +2 -1
- package/assets/skills/oat-project-next/SKILL.md +2 -1
- package/assets/skills/oat-project-open/SKILL.md +2 -1
- package/assets/skills/oat-project-plan/SKILL.md +2 -1
- package/assets/skills/oat-project-plan-writing/SKILL.md +2 -1
- package/assets/skills/oat-project-pr-final/SKILL.md +282 -6
- package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +1 -0
- package/assets/skills/oat-project-pr-progress/SKILL.md +2 -1
- package/assets/skills/oat-project-progress/SKILL.md +2 -1
- package/assets/skills/oat-project-promote-spec-driven/SKILL.md +2 -1
- package/assets/skills/oat-project-quick-start/SKILL.md +2 -1
- package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +1 -0
- package/assets/skills/oat-project-reconcile/SKILL.md +2 -1
- package/assets/skills/oat-project-retro/SKILL.md +2 -1
- package/assets/skills/oat-project-retro-file/SKILL.md +2 -1
- package/assets/skills/oat-project-review-provide/SKILL.md +2 -1
- package/assets/skills/oat-project-review-provide-remote/SKILL.md +2 -1
- package/assets/skills/oat-project-review-receive/SKILL.md +2 -1
- package/assets/skills/oat-project-review-receive-remote/SKILL.md +2 -1
- package/assets/skills/oat-project-revise/SKILL.md +2 -1
- package/assets/skills/oat-project-spec/SKILL.md +2 -1
- package/assets/skills/oat-project-split/SKILL.md +2 -1
- package/assets/skills/oat-project-summary/SKILL.md +2 -1
- package/assets/skills/oat-repo-improve/SKILL.md +1 -1
- package/assets/skills/oat-repo-knowledge-index/SKILL.md +2 -1
- package/assets/skills/oat-repo-maintainability-review/SKILL.md +2 -1
- package/assets/skills/oat-review-provide/SKILL.md +2 -1
- package/assets/skills/oat-review-provide-remote/SKILL.md +2 -1
- package/assets/skills/oat-review-receive/SKILL.md +2 -1
- package/assets/skills/oat-review-receive-remote/SKILL.md +2 -1
- package/assets/skills/oat-wave-execute/SKILL.md +2 -1
- package/assets/skills/oat-wave-program/SKILL.md +2 -1
- package/assets/skills/oat-worktree-bootstrap/SKILL.md +2 -1
- package/assets/skills/oat-worktree-bootstrap-auto/SKILL.md +2 -1
- package/assets/skills/oat-wrap-up/SKILL.md +2 -1
- package/assets/skills/recon/SKILL.md +2 -1
- package/assets/skills/skeptic/SKILL.md +2 -1
- package/assets/skills/subagent-orchestration/SKILL.md +2 -1
- package/assets/skills/synthesize/SKILL.md +2 -1
- package/dist/agents/canonical/resolve.d.ts.map +1 -1
- package/dist/agents/canonical/resolve.js +25 -4
- package/dist/commands/doctor/index.d.ts +7 -0
- package/dist/commands/doctor/index.d.ts.map +1 -1
- package/dist/commands/doctor/index.js +10 -2
- package/dist/commands/init/tools/index.d.ts.map +1 -1
- package/dist/commands/init/tools/index.js +68 -36
- package/dist/commands/shared/frontmatter.d.ts +51 -0
- package/dist/commands/shared/frontmatter.d.ts.map +1 -1
- package/dist/commands/shared/frontmatter.js +118 -6
- package/dist/commands/status/index.d.ts.map +1 -1
- package/dist/commands/status/index.js +5 -3
- package/dist/commands/sync/index.d.ts +14 -0
- package/dist/commands/sync/index.d.ts.map +1 -1
- package/dist/commands/sync/index.js +21 -0
- package/dist/commands/tools/info/index.d.ts.map +1 -1
- package/dist/commands/tools/info/index.js +14 -1
- package/dist/commands/tools/info/info-tool.d.ts +12 -0
- package/dist/commands/tools/info/info-tool.d.ts.map +1 -1
- package/dist/commands/tools/info/info-tool.js +54 -6
- package/dist/commands/tools/info/skill-views.d.ts +86 -0
- package/dist/commands/tools/info/skill-views.d.ts.map +1 -0
- package/dist/commands/tools/info/skill-views.js +383 -0
- package/dist/commands/tools/install/index.d.ts.map +1 -1
- package/dist/commands/tools/install/index.js +3 -25
- package/dist/commands/tools/list/list-tools.d.ts +2 -0
- package/dist/commands/tools/list/list-tools.d.ts.map +1 -1
- package/dist/commands/tools/list/list-tools.js +23 -4
- package/dist/commands/tools/remove/index.d.ts.map +1 -1
- package/dist/commands/tools/remove/index.js +35 -42
- package/dist/commands/tools/remove/remove-tools.d.ts +3 -2
- package/dist/commands/tools/remove/remove-tools.d.ts.map +1 -1
- package/dist/commands/tools/remove/remove-tools.js +14 -4
- package/dist/commands/tools/shared/auto-sync.d.ts +12 -1
- package/dist/commands/tools/shared/auto-sync.d.ts.map +1 -1
- package/dist/commands/tools/shared/auto-sync.js +20 -4
- package/dist/commands/tools/shared/format-pack-inventory.d.ts +12 -1
- package/dist/commands/tools/shared/format-pack-inventory.d.ts.map +1 -1
- package/dist/commands/tools/shared/format-pack-inventory.js +48 -6
- package/dist/commands/tools/shared/in-process-sync.d.ts +11 -0
- package/dist/commands/tools/shared/in-process-sync.d.ts.map +1 -0
- package/dist/commands/tools/shared/in-process-sync.js +79 -0
- package/dist/commands/tools/shared/pack-evidence.d.ts +78 -2
- package/dist/commands/tools/shared/pack-evidence.d.ts.map +1 -1
- package/dist/commands/tools/shared/pack-evidence.js +96 -2
- package/dist/commands/tools/shared/pack-lifecycle-outcome.d.ts +11 -0
- package/dist/commands/tools/shared/pack-lifecycle-outcome.d.ts.map +1 -1
- package/dist/commands/tools/shared/pack-lifecycle-outcome.js +24 -3
- package/dist/commands/tools/shared/pack-provider-evidence.d.ts +73 -0
- package/dist/commands/tools/shared/pack-provider-evidence.d.ts.map +1 -0
- package/dist/commands/tools/shared/pack-provider-evidence.js +161 -0
- package/dist/commands/tools/shared/provider-context.d.ts +88 -0
- package/dist/commands/tools/shared/provider-context.d.ts.map +1 -0
- package/dist/commands/tools/shared/provider-context.js +77 -0
- package/dist/commands/tools/shared/provider-reachability.d.ts +93 -0
- package/dist/commands/tools/shared/provider-reachability.d.ts.map +1 -0
- package/dist/commands/tools/shared/provider-reachability.js +358 -0
- package/dist/commands/tools/shared/sync-evidence.d.ts +57 -0
- package/dist/commands/tools/shared/sync-evidence.d.ts.map +1 -0
- package/dist/commands/tools/shared/sync-evidence.js +147 -0
- package/dist/commands/tools/update/index.d.ts +0 -4
- package/dist/commands/tools/update/index.d.ts.map +1 -1
- package/dist/commands/tools/update/index.js +22 -40
- package/dist/commands/tools/update/update-tools.d.ts.map +1 -1
- package/dist/commands/tools/update/update-tools.js +23 -8
- package/dist/config/json.d.ts +36 -0
- package/dist/config/json.d.ts.map +1 -1
- package/dist/config/json.js +135 -3
- package/dist/drift/index.d.ts +2 -0
- package/dist/drift/index.d.ts.map +1 -1
- package/dist/drift/index.js +1 -0
- package/dist/drift/skill-view-diagnostic.d.ts +197 -0
- package/dist/drift/skill-view-diagnostic.d.ts.map +1 -0
- package/dist/drift/skill-view-diagnostic.js +343 -0
- package/dist/validation/skills.d.ts +1 -0
- package/dist/validation/skills.d.ts.map +1 -1
- package/dist/validation/skills.js +181 -19
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-tools.d.ts","sourceRoot":"","sources":["../../../../src/commands/tools/update/update-tools.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AACpF,OAAO,KAAK,EAAE,kBAAkB,E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KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,qBAAqB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC1E,yBAAyB,CAAC,EAAE,CAC1B,QAAQ,EAAE,MAAM,KACb,OAAO,CAAC,+BAA+B,CAAC,CAAC;IAC9C,mBAAmB,CAAC,EAAE,CACpB,KAAK,EAAE,wBAAwB,KAC5B,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAClC,cAAc,CAAC,EAAE,CACf,QAAQ,EAAE,SAAS,oBAAoB,EAAE,EACzC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,KAC3B,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;CACrC;AAqDD,wBAAsB,WAAW,CAC/B,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,aAAa,EAAE,EACvB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,OAAO,EACf,YAAY,EAAE,uBAAuB,GACpC,OAAO,CAAC,YAAY,CAAC,CAuQvB;AAwED,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAC/C,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,KAAK,EAAE,OAAO,GACb,oBAAoB,EAAE,CAsBxB"}
|
|
@@ -2,8 +2,10 @@ import { join } from 'node:path';
|
|
|
2
2
|
import { hasScopedPackRealizationEvidence, packScopeFactsFromInventory, projectPackEvidence, } from '../../tools/shared/pack-evidence.js';
|
|
3
3
|
import { inventoryScopedPack } from '../../tools/shared/pack-inventory.js';
|
|
4
4
|
import {} from '../../tools/shared/pack-lifecycle.js';
|
|
5
|
-
import { evaluatePackLifecycleOutcome, resolveAdditivePackScopeSelection, } from '../../tools/shared/pack-lifecycle-outcome.js';
|
|
5
|
+
import { evaluatePackLifecycleOutcome, notRunProviderSyncOutcome, resolveAdditivePackScopeSelection, } from '../../tools/shared/pack-lifecycle-outcome.js';
|
|
6
6
|
import { getPackDefinition } from '../../tools/shared/pack-manifest.js';
|
|
7
|
+
import { lifecycleProviderEvidence, withLifecycleProviderEvidence, } from '../../tools/shared/pack-provider-evidence.js';
|
|
8
|
+
import { resolveProviderScopeContexts } from '../../tools/shared/provider-context.js';
|
|
7
9
|
function getBundledPackAssets(pack, scope) {
|
|
8
10
|
const assets = getPackDefinition(pack).assets.filter(({ scopes, ownership }) => scopes.includes(scope) && ownership[scope] === 'managed');
|
|
9
11
|
return {
|
|
@@ -71,7 +73,7 @@ export async function updateTools(target, scopes, cwd, home, dryRun, dependencie
|
|
|
71
73
|
return result;
|
|
72
74
|
}
|
|
73
75
|
const lifecycle = await dependencies.reconcilePacks(requests, { dryRun });
|
|
74
|
-
result.lifecycle = updateLifecycleOutcomes(lifecycle);
|
|
76
|
+
result.lifecycle = await updateLifecycleOutcomes(lifecycle);
|
|
75
77
|
result.plans.push(...lifecycle.map(({ plan }) => plan));
|
|
76
78
|
for (const entry of lifecycle) {
|
|
77
79
|
const definition = getPackDefinition(entry.request.pack);
|
|
@@ -252,9 +254,14 @@ export async function updateTools(target, scopes, cwd, home, dryRun, dependencie
|
|
|
252
254
|
}
|
|
253
255
|
return result;
|
|
254
256
|
}
|
|
255
|
-
function updateLifecycleOutcomes(results) {
|
|
257
|
+
async function updateLifecycleOutcomes(results) {
|
|
256
258
|
const verifiable = results.filter(({ apply }) => apply === null || ('inventory' in apply && apply.inventory !== undefined));
|
|
257
259
|
const packs = [...new Set(verifiable.map(({ request }) => request.pack))];
|
|
260
|
+
// Every request carries the scope root it acted on, so the config-aware
|
|
261
|
+
// provider context is resolvable without re-deriving paths here.
|
|
262
|
+
const providerContexts = await resolveProviderScopeContexts({
|
|
263
|
+
scopeRoots: Object.fromEntries(verifiable.map(({ request }) => [request.scope, request.scopeRoot])),
|
|
264
|
+
});
|
|
258
265
|
return packs.map((pack) => {
|
|
259
266
|
const lifecycle = verifiable.filter(({ request }) => request.pack === pack);
|
|
260
267
|
const requestedScopes = lifecycle.map(({ request }) => request.scope);
|
|
@@ -273,13 +280,21 @@ function updateLifecycleOutcomes(results) {
|
|
|
273
280
|
.map(({ request }) => request.scope),
|
|
274
281
|
unknownScopes: [],
|
|
275
282
|
});
|
|
283
|
+
const providers = lifecycleProviderEvidence({
|
|
284
|
+
pack,
|
|
285
|
+
scopedInventories: finalScopes,
|
|
286
|
+
providerContexts,
|
|
287
|
+
scopes: selection.targetScopes,
|
|
288
|
+
});
|
|
289
|
+
const sync = notRunProviderSyncOutcome(providers, 'Auto-sync has not run for this operation');
|
|
290
|
+
const providerEvidence = withLifecycleProviderEvidence(finalEvidence, providers);
|
|
276
291
|
if (lifecycle.every(({ apply }) => apply === null)) {
|
|
277
292
|
return {
|
|
278
293
|
schemaVersion: 1,
|
|
279
294
|
selection,
|
|
280
295
|
canonical: { status: 'unchanged', results: lifecycle },
|
|
281
|
-
sync
|
|
282
|
-
finalEvidence,
|
|
296
|
+
sync,
|
|
297
|
+
finalEvidence: providerEvidence,
|
|
283
298
|
status: 'complete',
|
|
284
299
|
recovery: [],
|
|
285
300
|
};
|
|
@@ -287,8 +302,8 @@ function updateLifecycleOutcomes(results) {
|
|
|
287
302
|
return evaluatePackLifecycleOutcome({
|
|
288
303
|
selection,
|
|
289
304
|
lifecycle,
|
|
290
|
-
sync
|
|
291
|
-
finalEvidence,
|
|
305
|
+
sync,
|
|
306
|
+
finalEvidence: providerEvidence,
|
|
292
307
|
});
|
|
293
308
|
});
|
|
294
309
|
}
|
|
@@ -305,7 +320,7 @@ export function failedUpdateLifecycleOutcomes(target, scopes, error) {
|
|
|
305
320
|
targetScopes: scopes,
|
|
306
321
|
},
|
|
307
322
|
canonical: { status: 'failed', results: [] },
|
|
308
|
-
sync:
|
|
323
|
+
sync: notRunProviderSyncOutcome([], 'Canonical apply failed before auto-sync'),
|
|
309
324
|
finalEvidence: null,
|
|
310
325
|
status: 'failed',
|
|
311
326
|
recovery: [{ code: 'canonical-apply-failed', message }],
|
package/dist/config/json.d.ts
CHANGED
|
@@ -1,2 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse one OAT config document.
|
|
3
|
+
*
|
|
4
|
+
* This is the single parse chokepoint for every OAT config read, so the
|
|
5
|
+
* prototype question is decided here rather than in each consumer.
|
|
6
|
+
*
|
|
7
|
+
* `jsonc-parser`'s `parse` fills a plain object by assignment, and assignment
|
|
8
|
+
* to a member literally named `__proto__` reaches the legacy prototype setter.
|
|
9
|
+
* That loses the key as data *and* installs its value as the parsed object's
|
|
10
|
+
* prototype, after which normalization reads the injected members as though
|
|
11
|
+
* they had been configured: a config file holding only
|
|
12
|
+
* `{"__proto__":{"git":{"defaultBranch":"x"}}}` made `oat config get
|
|
13
|
+
* git.defaultBranch` answer `x`. So the tree API is used instead, and the tree
|
|
14
|
+
* is materialized here rather than by `getNodeValue`.
|
|
15
|
+
*
|
|
16
|
+
* Materialization defines every own key with `Object.defineProperty`, which
|
|
17
|
+
* stores `__proto__` as an ordinary own data property without ever invoking
|
|
18
|
+
* the prototype setter. The objects it builds are otherwise completely
|
|
19
|
+
* ordinary: they keep `Object.prototype`, so every consumer coercion — most
|
|
20
|
+
* importantly `String(value)` in the `projects.defaultScope` diagnostic at
|
|
21
|
+
* `config/oat-config.ts` — behaves byte-identically to the previous
|
|
22
|
+
* implementation, and the result round-trips through `JSON.stringify`
|
|
23
|
+
* unchanged. `getNodeValue` is deliberately not used: it returns
|
|
24
|
+
* null-prototype objects, which break those coercions, and it recurses, which
|
|
25
|
+
* roughly halved the accepted nesting depth and turned deep-but-valid
|
|
26
|
+
* documents into a `RangeError` instead of the contracted `SyntaxError`. The
|
|
27
|
+
* walk below uses an explicit stack for that reason, which restores parity
|
|
28
|
+
* with the previous implementation. Parity, not a guarantee: `parseTree` still
|
|
29
|
+
* recurses while scanning, so the hard limit is a stack depth that moves with
|
|
30
|
+
* the host and the JIT rather than a fixed number.
|
|
31
|
+
*
|
|
32
|
+
* The error contract is untouched: `parseTree` reports the same `ParseError`
|
|
33
|
+
* codes at the same offsets as `parse` for every input, so the set of
|
|
34
|
+
* documents that are rejected and the `SyntaxError` message are both
|
|
35
|
+
* byte-identical to the previous implementation.
|
|
36
|
+
*/
|
|
1
37
|
export declare function parseJsonConfig(raw: string, configPath: string): unknown;
|
|
2
38
|
//# sourceMappingURL=json.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/config/json.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/config/json.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAuBxE"}
|
package/dist/config/json.js
CHANGED
|
@@ -1,18 +1,150 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { parseTree, printParseErrorCode, } from 'jsonc-parser';
|
|
2
2
|
const JSON_CONFIG_PARSE_OPTIONS = {
|
|
3
3
|
allowTrailingComma: true,
|
|
4
4
|
disallowComments: true,
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* Parse one OAT config document.
|
|
8
|
+
*
|
|
9
|
+
* This is the single parse chokepoint for every OAT config read, so the
|
|
10
|
+
* prototype question is decided here rather than in each consumer.
|
|
11
|
+
*
|
|
12
|
+
* `jsonc-parser`'s `parse` fills a plain object by assignment, and assignment
|
|
13
|
+
* to a member literally named `__proto__` reaches the legacy prototype setter.
|
|
14
|
+
* That loses the key as data *and* installs its value as the parsed object's
|
|
15
|
+
* prototype, after which normalization reads the injected members as though
|
|
16
|
+
* they had been configured: a config file holding only
|
|
17
|
+
* `{"__proto__":{"git":{"defaultBranch":"x"}}}` made `oat config get
|
|
18
|
+
* git.defaultBranch` answer `x`. So the tree API is used instead, and the tree
|
|
19
|
+
* is materialized here rather than by `getNodeValue`.
|
|
20
|
+
*
|
|
21
|
+
* Materialization defines every own key with `Object.defineProperty`, which
|
|
22
|
+
* stores `__proto__` as an ordinary own data property without ever invoking
|
|
23
|
+
* the prototype setter. The objects it builds are otherwise completely
|
|
24
|
+
* ordinary: they keep `Object.prototype`, so every consumer coercion — most
|
|
25
|
+
* importantly `String(value)` in the `projects.defaultScope` diagnostic at
|
|
26
|
+
* `config/oat-config.ts` — behaves byte-identically to the previous
|
|
27
|
+
* implementation, and the result round-trips through `JSON.stringify`
|
|
28
|
+
* unchanged. `getNodeValue` is deliberately not used: it returns
|
|
29
|
+
* null-prototype objects, which break those coercions, and it recurses, which
|
|
30
|
+
* roughly halved the accepted nesting depth and turned deep-but-valid
|
|
31
|
+
* documents into a `RangeError` instead of the contracted `SyntaxError`. The
|
|
32
|
+
* walk below uses an explicit stack for that reason, which restores parity
|
|
33
|
+
* with the previous implementation. Parity, not a guarantee: `parseTree` still
|
|
34
|
+
* recurses while scanning, so the hard limit is a stack depth that moves with
|
|
35
|
+
* the host and the JIT rather than a fixed number.
|
|
36
|
+
*
|
|
37
|
+
* The error contract is untouched: `parseTree` reports the same `ParseError`
|
|
38
|
+
* codes at the same offsets as `parse` for every input, so the set of
|
|
39
|
+
* documents that are rejected and the `SyntaxError` message are both
|
|
40
|
+
* byte-identical to the previous implementation.
|
|
41
|
+
*/
|
|
6
42
|
export function parseJsonConfig(raw, configPath) {
|
|
7
43
|
const errors = [];
|
|
8
|
-
const
|
|
44
|
+
const root = parseTree(raw, errors, JSON_CONFIG_PARSE_OPTIONS);
|
|
9
45
|
if (errors.length > 0) {
|
|
10
46
|
const details = errors
|
|
11
47
|
.map((error) => formatParseError(raw, error))
|
|
12
48
|
.join('; ');
|
|
13
49
|
throw new SyntaxError(`Config at ${configPath} is not valid JSON: ${details}`);
|
|
14
50
|
}
|
|
15
|
-
|
|
51
|
+
// TypeScript narrowing after the rejection above: `parseTree` returns no root
|
|
52
|
+
// for any document that holds no value — empty or whitespace-only content,
|
|
53
|
+
// but also a stray `]` or comment-only content — and every one of those
|
|
54
|
+
// records a parse error and has already thrown. The branch keeps the walk
|
|
55
|
+
// total rather than describing a reachable case.
|
|
56
|
+
if (root === undefined) {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
return materializeTree(root);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Assignment that cannot be intercepted by an accessor on the prototype chain.
|
|
63
|
+
*
|
|
64
|
+
* `target[key] = value` would invoke the legacy `__proto__` setter; a data
|
|
65
|
+
* descriptor never does. The descriptor matches what a plain assignment would
|
|
66
|
+
* otherwise produce, so the property is indistinguishable from an ordinary
|
|
67
|
+
* one, and re-defining a repeated key overwrites in place exactly as
|
|
68
|
+
* assignment did.
|
|
69
|
+
*/
|
|
70
|
+
function defineOwnProperty(target, key, value) {
|
|
71
|
+
Object.defineProperty(target, key, {
|
|
72
|
+
value,
|
|
73
|
+
enumerable: true,
|
|
74
|
+
writable: true,
|
|
75
|
+
configurable: true,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Convert a parse tree into plain JavaScript values without recursion.
|
|
80
|
+
*
|
|
81
|
+
* Each frame carries the callback that attaches its finished value to the
|
|
82
|
+
* parent container, so containers are created on the way down and filled as
|
|
83
|
+
* their children pop. Nesting depth costs a heap array entry rather than a
|
|
84
|
+
* call frame, which is what keeps a deeply nested config from overflowing the
|
|
85
|
+
* stack.
|
|
86
|
+
*/
|
|
87
|
+
function materializeTree(root) {
|
|
88
|
+
let result;
|
|
89
|
+
const stack = [
|
|
90
|
+
{
|
|
91
|
+
node: root,
|
|
92
|
+
attach: (value) => {
|
|
93
|
+
result = value;
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
while (stack.length > 0) {
|
|
98
|
+
const frame = stack.pop();
|
|
99
|
+
if (frame === undefined) {
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
const { node } = frame;
|
|
103
|
+
if (node.type === 'array') {
|
|
104
|
+
const children = node.children ?? [];
|
|
105
|
+
const array = new Array(children.length);
|
|
106
|
+
frame.attach(array);
|
|
107
|
+
// Pushed in reverse so children pop in source order.
|
|
108
|
+
for (let index = children.length - 1; index >= 0; index -= 1) {
|
|
109
|
+
const child = children[index];
|
|
110
|
+
if (child === undefined) {
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
stack.push({
|
|
114
|
+
node: child,
|
|
115
|
+
attach: (value) => {
|
|
116
|
+
array[index] = value;
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
if (node.type === 'object') {
|
|
123
|
+
const object = {};
|
|
124
|
+
frame.attach(object);
|
|
125
|
+
const properties = node.children ?? [];
|
|
126
|
+
for (let index = properties.length - 1; index >= 0; index -= 1) {
|
|
127
|
+
const property = properties[index];
|
|
128
|
+
const keyNode = property?.children?.[0];
|
|
129
|
+
const valueNode = property?.children?.[1];
|
|
130
|
+
// A property with no value node is an incomplete document, which the
|
|
131
|
+
// error check has already rejected; skipping it matches `getNodeValue`.
|
|
132
|
+
if (keyNode === undefined || valueNode === undefined) {
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
const key = String(keyNode.value);
|
|
136
|
+
stack.push({
|
|
137
|
+
node: valueNode,
|
|
138
|
+
attach: (value) => {
|
|
139
|
+
defineOwnProperty(object, key, value);
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
frame.attach(node.value);
|
|
146
|
+
}
|
|
147
|
+
return result;
|
|
16
148
|
}
|
|
17
149
|
function formatParseError(raw, error) {
|
|
18
150
|
const location = offsetToLineColumn(raw, error.offset);
|
package/dist/drift/index.d.ts
CHANGED
|
@@ -3,5 +3,7 @@ export type { CopyTransform } from './detector.js';
|
|
|
3
3
|
export type { DriftReport, DriftState } from './drift.types.js';
|
|
4
4
|
export { filterKnownStrays } from './known-strays.js';
|
|
5
5
|
export type { FilterKnownStraysOptions, FilterKnownStraysResult, KnownStrayCandidate, KnownStraySources, } from './known-strays.js';
|
|
6
|
+
export { diagnoseSkillViews, resolveExpectedSkillProjections, } from './skill-view-diagnostic.js';
|
|
7
|
+
export type { ExpectedProjection, ProjectedSkillVersion, SkillViewClass, SkillViewDiagnosis, SkillViewDiagnostic, SkillViewObservation, } from './skill-view-diagnostic.js';
|
|
6
8
|
export { detectStrays } from './strays.js';
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/drift/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,YAAY,EACV,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/drift/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,YAAY,EACV,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,kBAAkB,EAClB,+BAA+B,GAChC,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/drift/index.js
CHANGED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import type { ManifestEntryV2 } from '../manifest/manifest.types.js';
|
|
2
|
+
import type { ProviderRegistration, ProviderScopeContext } from '../providers/shared/registry.js';
|
|
3
|
+
import type { ConcreteScope, ContentType } from '../shared/types.js';
|
|
4
|
+
import type { DriftReport, DriftState } from './drift.types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Resolution-time classification of one canonical skill against one provider
|
|
7
|
+
* view.
|
|
8
|
+
*
|
|
9
|
+
* This is a new field that sits *beside* the unchanged {@link DriftState}, not
|
|
10
|
+
* a replacement for it: `detectDrift` answers "does the tracked view still
|
|
11
|
+
* match?", which presupposes a manifest entry. The headline case this module
|
|
12
|
+
* exists for — a canonical skill nobody ever synced — has no manifest entry at
|
|
13
|
+
* all, so its provider and path identity come from the provider scope context
|
|
14
|
+
* and the adapter mappings instead.
|
|
15
|
+
*
|
|
16
|
+
* - `missing-additive`: active, supported, nothing tracked, nothing on disk at
|
|
17
|
+
* the expected path. The only true projection gap.
|
|
18
|
+
* - `removed`: tracked, but the provider file is gone.
|
|
19
|
+
* - `modified`: tracked, and the provider file diverged.
|
|
20
|
+
* - `in-sync`: the view matches the canonical skill (including a native-read
|
|
21
|
+
* provider, whose view *is* the canonical file).
|
|
22
|
+
* - `untracked`: something exists at the expected path with no manifest entry.
|
|
23
|
+
* Reported as such rather than as missing, because nothing is absent.
|
|
24
|
+
* - `unverified`: the view's state is unknown — either a manifest entry arrived
|
|
25
|
+
* with no drift observation, or reading this one view failed and the
|
|
26
|
+
* observation carries the redacted reason. Never `untracked`, which would
|
|
27
|
+
* contradict `tracked: true` on the same record.
|
|
28
|
+
* - `inactive`, `unsupported`, `excluded`: no projection is expected at all, so
|
|
29
|
+
* none of these ever carries a sync suggestion.
|
|
30
|
+
*
|
|
31
|
+
* Reachability today: `unsupported` needs a registered adapter with no `skill`
|
|
32
|
+
* mapping for the scope, and every shipped adapter maps skills in both scopes;
|
|
33
|
+
* `excluded` needs a canonical-path filter that the `oat tools info` wiring
|
|
34
|
+
* never passes. Both are defensive branches, covered by fixtures rather than by
|
|
35
|
+
* a live CLI path, and they exist so a future adapter or filter cannot be
|
|
36
|
+
* silently misreported as a projection gap. `unverified` is reachable: an
|
|
37
|
+
* unreadable provider path makes `detectDrift` throw, and that one view
|
|
38
|
+
* degrades to `unverified` with its reason.
|
|
39
|
+
*/
|
|
40
|
+
export type SkillViewClass = 'in-sync' | 'missing-additive' | 'removed' | 'modified' | 'untracked' | 'unverified' | 'inactive' | 'unsupported' | 'excluded';
|
|
41
|
+
/**
|
|
42
|
+
* Where a provider's view of one canonical skill is expected to live.
|
|
43
|
+
*
|
|
44
|
+
* Derived from the adapter's scope mappings, so it exists whether or not a
|
|
45
|
+
* manifest entry does. Deliberately carries no `strategy`: the concrete
|
|
46
|
+
* symlink/copy choice for an *untracked* projection is resolved by the sync
|
|
47
|
+
* engine from config at sync time (`resolveStrategy` in
|
|
48
|
+
* `engine/compute-plan.ts`), and re-deriving that precedence here could
|
|
49
|
+
* contradict it. A tracked projection carries its real strategy on the
|
|
50
|
+
* manifest entry, which is what the version-comparability rule needs.
|
|
51
|
+
*/
|
|
52
|
+
export interface ExpectedProjection {
|
|
53
|
+
provider: string;
|
|
54
|
+
/** Scope-relative path, matching the manifest's `providerPath` convention. */
|
|
55
|
+
providerPath: string;
|
|
56
|
+
contentKind: ContentType;
|
|
57
|
+
/**
|
|
58
|
+
* The provider reads canonical content in place (`nativeRead` mapping), so
|
|
59
|
+
* the "view" is the canonical file and there is nothing to project.
|
|
60
|
+
*/
|
|
61
|
+
nativeRead: boolean;
|
|
62
|
+
/** Set when a canonical-path filter keeps this skill out of the projection. */
|
|
63
|
+
excludedReason?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* How the projected view's own version declaration read.
|
|
67
|
+
*
|
|
68
|
+
* Carries the shared resolver's verdict rather than just a string: a
|
|
69
|
+
* `conflict`, `unusable`, or `malformed` declaration is a parse artifact, and
|
|
70
|
+
* a copy must never be reported as stale on that evidence.
|
|
71
|
+
*/
|
|
72
|
+
export interface ProjectedSkillVersion {
|
|
73
|
+
version: string | null;
|
|
74
|
+
state: 'resolved' | 'absent' | 'conflict' | 'unusable' | 'malformed';
|
|
75
|
+
conflict?: {
|
|
76
|
+
metadata: string;
|
|
77
|
+
topLevel: string;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/** One provider's observed reality for the expected projection. */
|
|
81
|
+
export interface SkillViewObservation {
|
|
82
|
+
projection: ExpectedProjection;
|
|
83
|
+
/** The manifest entry keyed by (canonicalPath, provider), when tracked. */
|
|
84
|
+
manifestEntry: ManifestEntryV2 | null;
|
|
85
|
+
/** `detectDrift` output; only available when a manifest entry exists. */
|
|
86
|
+
drift: DriftReport | null;
|
|
87
|
+
/** Whether anything exists at the expected provider path. */
|
|
88
|
+
viewPresent: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Set when reading *this* view failed, carrying the already-redacted reason.
|
|
91
|
+
*
|
|
92
|
+
* A per-view read failure — `detectDrift` throwing on an unreadable provider
|
|
93
|
+
* path, for instance — says nothing about the other providers in the same
|
|
94
|
+
* scope, so it degrades one row instead of the whole section.
|
|
95
|
+
*/
|
|
96
|
+
unavailableReason?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Version read from the provider copy, with the resolver's verdict. Only
|
|
99
|
+
* meaningful for `copy` entries.
|
|
100
|
+
*/
|
|
101
|
+
projectedVersion?: ProjectedSkillVersion;
|
|
102
|
+
}
|
|
103
|
+
export interface SkillViewDiagnostic {
|
|
104
|
+
skill: string;
|
|
105
|
+
scope: ConcreteScope;
|
|
106
|
+
provider: string;
|
|
107
|
+
viewClass: SkillViewClass;
|
|
108
|
+
/** Unchanged `DriftState`; `null` when no manifest entry allowed detection. */
|
|
109
|
+
driftState: DriftState | null;
|
|
110
|
+
/**
|
|
111
|
+
* Scope-relative path this row is about; `null` when no view is expected.
|
|
112
|
+
*
|
|
113
|
+
* When a manifest entry tracks the view at a path that is not the adapter's
|
|
114
|
+
* expected projection path, this is the *manifest's* path, because that is
|
|
115
|
+
* the path the drift verdict, the version, and the detail all describe. The
|
|
116
|
+
* expected path then travels separately in `expectedProviderPath`.
|
|
117
|
+
*/
|
|
118
|
+
providerPath: string | null;
|
|
119
|
+
/**
|
|
120
|
+
* The adapter's expected projection path, present only when the manifest
|
|
121
|
+
* tracks the view somewhere else.
|
|
122
|
+
*
|
|
123
|
+
* Absent on every ordinary row: a row whose manifest entry sits at the
|
|
124
|
+
* expected path has one path, not two.
|
|
125
|
+
*/
|
|
126
|
+
expectedProviderPath?: string;
|
|
127
|
+
tracked: boolean;
|
|
128
|
+
strategy: ManifestEntryV2['strategy'] | null;
|
|
129
|
+
nativeRead: boolean;
|
|
130
|
+
canonicalVersion: string | null;
|
|
131
|
+
viewVersion: string | null;
|
|
132
|
+
/** Versions are comparable only for `copy` views that exist. */
|
|
133
|
+
versionComparable: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* How the view's own version declaration read. `conflict`, `unusable`, and
|
|
136
|
+
* `malformed` are why a comparison may have been withheld.
|
|
137
|
+
*/
|
|
138
|
+
versionEvidence?: ProjectedSkillVersion['state'];
|
|
139
|
+
/** Narrowest safe repair: one concrete scope, never `--scope all`. */
|
|
140
|
+
suggestion: string | null;
|
|
141
|
+
detail: string;
|
|
142
|
+
}
|
|
143
|
+
export interface SkillViewDiagnosis {
|
|
144
|
+
skill: string;
|
|
145
|
+
scope: ConcreteScope;
|
|
146
|
+
/**
|
|
147
|
+
* `unknown-skill` is a distinct top-level result from a skill that exists
|
|
148
|
+
* canonically but reaches no provider view, so missing distribution is never
|
|
149
|
+
* confused with a name the repository does not have.
|
|
150
|
+
*
|
|
151
|
+
* `unavailable` means the diagnostic's own inputs could not be read (an
|
|
152
|
+
* unreadable or invalid manifest, for instance). It is reported in the
|
|
153
|
+
* section with its reason and never raised as a command failure: this
|
|
154
|
+
* diagnostic is additive evidence, so it must not take down the tool detail
|
|
155
|
+
* of the very user whose sync state is already broken.
|
|
156
|
+
*/
|
|
157
|
+
result: 'diagnosed' | 'unknown-skill' | 'unavailable';
|
|
158
|
+
/** Why the diagnosis is `unavailable`; scope-root paths are redacted. */
|
|
159
|
+
reason?: string;
|
|
160
|
+
views: SkillViewDiagnostic[];
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Builds the expected provider path for one canonical skill, per registered
|
|
164
|
+
* adapter that maps skills in this scope.
|
|
165
|
+
*
|
|
166
|
+
* Mirrors the engine's own derivation (`providerDir` + entry name in
|
|
167
|
+
* `computeSyncPlan`). A canonical skill is a directory, and the engine applies
|
|
168
|
+
* `providerExtension` only to file entries, so the directory name is carried
|
|
169
|
+
* through unchanged.
|
|
170
|
+
*
|
|
171
|
+
* `allowedCanonicalPaths` mirrors `computeSyncPlan`'s filter of the same name:
|
|
172
|
+
* a targeted sync narrows the plan to specific canonical paths. No durable
|
|
173
|
+
* config excludes a canonical skill today, so the `oat tools info` wiring
|
|
174
|
+
* passes nothing; the parameter exists so that a filtered projection is
|
|
175
|
+
* reported as `excluded` rather than as a projection gap.
|
|
176
|
+
*/
|
|
177
|
+
export declare function resolveExpectedSkillProjections(input: {
|
|
178
|
+
skillName: string;
|
|
179
|
+
scope: ConcreteScope;
|
|
180
|
+
registrations: readonly ProviderRegistration[];
|
|
181
|
+
allowedCanonicalPaths?: readonly string[];
|
|
182
|
+
}): ExpectedProjection[];
|
|
183
|
+
/**
|
|
184
|
+
* Maps one canonical skill onto one diagnostic per registered provider for a
|
|
185
|
+
* single concrete scope. Pure: every filesystem, manifest, and drift fact is
|
|
186
|
+
* supplied by the caller.
|
|
187
|
+
*/
|
|
188
|
+
export declare function diagnoseSkillViews(input: {
|
|
189
|
+
skillName: string;
|
|
190
|
+
scope: ConcreteScope;
|
|
191
|
+
/** Whether the canonical skill exists in this scope. */
|
|
192
|
+
canonicalPresent: boolean;
|
|
193
|
+
canonicalVersion: string | null;
|
|
194
|
+
providerScopeContext: ProviderScopeContext;
|
|
195
|
+
observations: readonly SkillViewObservation[];
|
|
196
|
+
}): SkillViewDiagnosis;
|
|
197
|
+
//# sourceMappingURL=skill-view-diagnostic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-view-diagnostic.d.ts","sourceRoot":"","sources":["../../src/drift/skill-view-diagnostic.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEhE,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,MAAM,cAAc,GACtB,SAAS,GACT,kBAAkB,GAClB,SAAS,GACT,UAAU,GACV,WAAW,GACX,YAAY,GACZ,UAAU,GACV,aAAa,GACb,UAAU,CAAC;AAEf;;;;;;;;;;GAUG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB,+EAA+E;IAC/E,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;A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