@agent-teams/engineering-foundation 1.9.0 → 1.10.1
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/dist/capabilities/public-api-compatibility/adapters/inbound/configuration/load-native-tool-transition.d.ts +20 -0
- package/dist/capabilities/public-api-compatibility/adapters/inbound/configuration/load-native-tool-transition.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/inbound/configuration/load-native-tool-transition.js +60 -0
- package/dist/capabilities/public-api-compatibility/adapters/inbound/configuration/load-native-tool-transition.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/audit-compiler-bindings.d.ts +9 -7
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/audit-compiler-bindings.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/audit-compiler-bindings.js +128 -76
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/audit-compiler-bindings.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/load-pinned-audit-sdk.d.ts +5 -6
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/load-pinned-audit-sdk.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/load-pinned-audit-sdk.js +34 -10
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/load-pinned-audit-sdk.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/microsoft-public-api-extractor.d.ts +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/microsoft-public-api-extractor.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/microsoft-public-api-extractor.js +48 -138
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/microsoft-public-api-extractor.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/microsoft-public-api-observer.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/microsoft-public-api-observer.js +248 -211
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/microsoft-public-api-observer.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-engine.d.ts +35 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-engine.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-engine.js +97 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-engine.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-excerpt.d.ts +42 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-excerpt.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-excerpt.js +199 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-excerpt.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-inputs.d.ts +9 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-inputs.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-inputs.js +197 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-inputs.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-item.d.ts +23 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-item.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-item.js +103 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-item.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-model.d.ts +19 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-model.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-model.js +250 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-model.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-reference.d.ts +21 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-reference.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-reference.js +269 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/native-public-api-reference.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/staged-public-api-input.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/staged-public-api-input.js +5 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/staged-public-api-input.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/growth-invocation.js +3 -3
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/growth-invocation.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/native-tool-transition-content.d.ts +14 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/native-tool-transition-content.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/native-tool-transition-content.js +40 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/native-tool-transition-content.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/native-transition-archive.d.ts +18 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/native-transition-archive.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/native-transition-archive.js +152 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/native-transition-archive.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/observe-native-tool-transition.d.ts +24 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/observe-native-tool-transition.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/observe-native-tool-transition.js +199 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/observe-native-tool-transition.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/model/native-tool-transition.d.ts +76 -0
- package/dist/capabilities/public-api-compatibility/application/model/native-tool-transition.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/model/native-tool-transition.js +35 -0
- package/dist/capabilities/public-api-compatibility/application/model/native-tool-transition.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/policies/validate-native-tool-transition.d.ts +7 -0
- package/dist/capabilities/public-api-compatibility/application/policies/validate-native-tool-transition.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/policies/validate-native-tool-transition.js +55 -0
- package/dist/capabilities/public-api-compatibility/application/policies/validate-native-tool-transition.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/ports/native-tool-transition.d.ts +10 -0
- package/dist/capabilities/public-api-compatibility/application/ports/native-tool-transition.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/ports/native-tool-transition.js +2 -0
- package/dist/capabilities/public-api-compatibility/application/ports/native-tool-transition.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/use-cases/prepare-native-tool-transition.d.ts +29 -0
- package/dist/capabilities/public-api-compatibility/application/use-cases/prepare-native-tool-transition.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/application/use-cases/prepare-native-tool-transition.js +124 -0
- package/dist/capabilities/public-api-compatibility/application/use-cases/prepare-native-tool-transition.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/module.js +2 -2
- package/dist/capabilities/public-api-compatibility/module.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/native-transition-module.d.ts +37 -0
- package/dist/capabilities/public-api-compatibility/native-transition-module.d.ts.map +1 -0
- package/dist/capabilities/public-api-compatibility/native-transition-module.js +44 -0
- package/dist/capabilities/public-api-compatibility/native-transition-module.js.map +1 -0
- package/dist/capabilities/public-api-compatibility/node.d.ts +2 -0
- package/dist/capabilities/public-api-compatibility/node.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/node.js +1 -0
- package/dist/capabilities/public-api-compatibility/node.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/schemas.d.ts +1 -1
- package/dist/capabilities/public-api-compatibility/schemas.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/schemas.js +1 -0
- package/dist/capabilities/public-api-compatibility/schemas.js.map +1 -1
- package/dist/capabilities/quality-gate-runner/adapters/inbound/configuration/load-quality-gate-policy.d.ts +2 -2
- package/dist/capabilities/quality-gate-runner/adapters/inbound/configuration/load-quality-gate-policy.d.ts.map +1 -1
- package/dist/capabilities/quality-gate-runner/adapters/inbound/configuration/parse-quality-gate-policy.d.ts +2 -2
- package/dist/capabilities/quality-gate-runner/adapters/inbound/configuration/parse-quality-gate-policy.d.ts.map +1 -1
- package/dist/capabilities/quality-gate-runner/adapters/inbound/configuration/parse-quality-gate-policy.js.map +1 -1
- package/dist/capabilities/quality-gate-runner/application/model/quality-gate.d.ts +11 -3
- package/dist/capabilities/quality-gate-runner/application/model/quality-gate.d.ts.map +1 -1
- package/dist/capabilities/quality-gate-runner/application/policies/evaluate-quality-gate-scripts.d.ts +2 -2
- package/dist/capabilities/quality-gate-runner/application/policies/evaluate-quality-gate-scripts.d.ts.map +1 -1
- package/dist/capabilities/quality-gate-runner/application/policies/evaluate-quality-gate-scripts.js.map +1 -1
- package/dist/capabilities/quality-gate-runner/application/policies/validate-quality-gate-graph.d.ts +2 -2
- package/dist/capabilities/quality-gate-runner/application/policies/validate-quality-gate-graph.d.ts.map +1 -1
- package/dist/capabilities/quality-gate-runner/application/policies/validate-quality-gate-graph.js.map +1 -1
- package/dist/capabilities/quality-gate-runner/application/ports/quality-gate-policy-loader.d.ts +2 -2
- package/dist/capabilities/quality-gate-runner/application/ports/quality-gate-policy-loader.d.ts.map +1 -1
- package/dist/capabilities/quality-gate-runner/application/use-cases/analyze-quality-gate-runner.d.ts +2 -2
- package/dist/capabilities/quality-gate-runner/application/use-cases/analyze-quality-gate-runner.d.ts.map +1 -1
- package/dist/capabilities/quality-gate-runner/application/use-cases/create-quality-gate-command.d.ts.map +1 -1
- package/dist/capabilities/quality-gate-runner/application/use-cases/create-quality-gate-command.js +12 -1
- package/dist/capabilities/quality-gate-runner/application/use-cases/create-quality-gate-command.js.map +1 -1
- package/dist/capabilities/quality-gate-runner/application/use-cases/run-quality-gate-profile.d.ts +2 -2
- package/dist/capabilities/quality-gate-runner/application/use-cases/run-quality-gate-profile.d.ts.map +1 -1
- package/dist/capabilities/quality-gate-runner/composition/node-quality-gate-command.d.ts.map +1 -1
- package/dist/capabilities/quality-gate-runner/composition/node-quality-gate-command.js +4 -2
- package/dist/capabilities/quality-gate-runner/composition/node-quality-gate-command.js.map +1 -1
- package/dist/capabilities/repository-agent-workflow/adapters/inbound/configuration/load-agent-workflow-policy.d.ts +1 -1
- package/dist/capabilities/repository-agent-workflow/adapters/inbound/configuration/load-agent-workflow-policy.d.ts.map +1 -1
- package/dist/capabilities/repository-agent-workflow/adapters/inbound/configuration/load-agent-workflow-policy.js +4 -1
- package/dist/capabilities/repository-agent-workflow/adapters/inbound/configuration/load-agent-workflow-policy.js.map +1 -1
- package/dist/capabilities/repository-agent-workflow/adapters/inbound/configuration/parse-agent-workflow-policy.d.ts.map +1 -1
- package/dist/capabilities/repository-agent-workflow/adapters/inbound/configuration/parse-agent-workflow-policy.js +15 -1
- package/dist/capabilities/repository-agent-workflow/adapters/inbound/configuration/parse-agent-workflow-policy.js.map +1 -1
- package/dist/capabilities/repository-agent-workflow/application/policies/evaluate-repository-agent-workflow.d.ts.map +1 -1
- package/dist/capabilities/repository-agent-workflow/application/policies/evaluate-repository-agent-workflow.js +4 -2
- package/dist/capabilities/repository-agent-workflow/application/policies/evaluate-repository-agent-workflow.js.map +1 -1
- package/dist/capabilities/repository-agent-workflow/schemas.d.ts +1 -1
- package/dist/capabilities/repository-agent-workflow/schemas.d.ts.map +1 -1
- package/dist/capabilities/repository-agent-workflow/schemas.js +2 -1
- package/dist/capabilities/repository-agent-workflow/schemas.js.map +1 -1
- package/dist/capabilities/source-dependencies/adapters/outbound/node/node-source-dependency-resolver.d.ts.map +1 -1
- package/dist/capabilities/source-dependencies/adapters/outbound/node/node-source-dependency-resolver.js +2 -6
- package/dist/capabilities/source-dependencies/adapters/outbound/node/node-source-dependency-resolver.js.map +1 -1
- package/dist/capabilities/workspace-dependency-declarations/adapters/inbound/filesystem/load-capability-config.d.ts +1 -1
- package/dist/capabilities/workspace-dependency-declarations/adapters/inbound/filesystem/load-capability-config.d.ts.map +1 -1
- package/dist/capabilities/workspace-dependency-declarations/adapters/inbound/filesystem/load-capability-config.js +4 -1
- package/dist/capabilities/workspace-dependency-declarations/adapters/inbound/filesystem/load-capability-config.js.map +1 -1
- package/dist/capabilities/workspace-dependency-declarations/adapters/inbound/filesystem/parse-capability-config.js.map +1 -1
- package/dist/capabilities/workspace-dependency-declarations/application/model/workspace-dependency-settings.d.ts +1 -1
- package/dist/capabilities/workspace-dependency-declarations/application/model/workspace-dependency-settings.d.ts.map +1 -1
- package/dist/capabilities/workspace-dependency-declarations/application/policies/evaluate-workspace-dependencies.d.ts +2 -1
- package/dist/capabilities/workspace-dependency-declarations/application/policies/evaluate-workspace-dependencies.d.ts.map +1 -1
- package/dist/capabilities/workspace-dependency-declarations/application/policies/evaluate-workspace-dependencies.js +10 -7
- package/dist/capabilities/workspace-dependency-declarations/application/policies/evaluate-workspace-dependencies.js.map +1 -1
- package/dist/capabilities/workspace-dependency-declarations/module.js +1 -1
- package/dist/capabilities/workspace-dependency-declarations/module.js.map +1 -1
- package/dist/capabilities/workspace-dependency-declarations/schemas.d.ts +1 -1
- package/dist/capabilities/workspace-dependency-declarations/schemas.d.ts.map +1 -1
- package/dist/capabilities/workspace-dependency-declarations/schemas.js +2 -1
- package/dist/capabilities/workspace-dependency-declarations/schemas.js.map +1 -1
- package/dist/features/command-host/adapters/inbound/cli/cli-arguments.d.ts.map +1 -1
- package/dist/features/command-host/adapters/inbound/cli/cli-arguments.js +18 -0
- package/dist/features/command-host/adapters/inbound/cli/cli-arguments.js.map +1 -1
- package/dist/features/command-host/adapters/inbound/cli/foundation-cli.d.ts.map +1 -1
- package/dist/features/command-host/adapters/inbound/cli/foundation-cli.js +9 -1
- package/dist/features/command-host/adapters/inbound/cli/foundation-cli.js.map +1 -1
- package/dist/features/command-host/application/command-invocation.d.ts +2 -0
- package/dist/features/command-host/application/command-invocation.d.ts.map +1 -1
- package/dist/features/command-host/application/command-invocation.js.map +1 -1
- package/dist/features/command-host/application/command-services.d.ts +4 -0
- package/dist/features/command-host/application/command-services.d.ts.map +1 -1
- package/dist/features/command-host/composition/node-command-host.d.ts +2 -2
- package/dist/features/command-host/composition/node-command-host.d.ts.map +1 -1
- package/dist/features/command-host/composition/node-command-host.js +8 -5
- package/dist/features/command-host/composition/node-command-host.js.map +1 -1
- package/dist/features/quality-coverage/adapters/consumer-observations.d.ts.map +1 -1
- package/dist/features/quality-coverage/adapters/consumer-observations.js +7 -2
- package/dist/features/quality-coverage/adapters/consumer-observations.js.map +1 -1
- package/dist/features/quality-coverage/api.d.ts +1 -1
- package/dist/features/quality-coverage/api.d.ts.map +1 -1
- package/dist/features/quality-coverage/api.js +1 -1
- package/dist/features/quality-coverage/api.js.map +1 -1
- package/dist/features/quality-coverage/application/script-route.d.ts.map +1 -1
- package/dist/features/quality-coverage/application/script-route.js +11 -7
- package/dist/features/quality-coverage/application/script-route.js.map +1 -1
- package/dist/process-execution/module.d.ts +1 -1
- package/dist/process-execution/module.d.ts.map +1 -1
- package/dist/process-execution/module.js +1 -1
- package/dist/process-execution/module.js.map +1 -1
- package/dist/process-execution/node-process-runner.d.ts.map +1 -1
- package/dist/process-execution/node-process-runner.js +19 -6
- package/dist/process-execution/node-process-runner.js.map +1 -1
- package/dist/schema-catalog.d.ts +1 -1
- package/dist/schema-catalog.d.ts.map +1 -1
- package/dist/schema-ids.d.ts +1 -1
- package/dist/schema-ids.d.ts.map +1 -1
- package/package.json +8 -4
- package/schemas/package-public-api-native-transition/v1.schema.json +173 -0
- package/schemas/repository-agent-workflow/v2.schema.json +94 -0
- package/schemas/workspace-dependency-declarations/v2.schema.json +83 -0
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/pinned-audit-compiler.d.ts +0 -101
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/pinned-audit-compiler.d.ts.map +0 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/pinned-audit-compiler.js +0 -2
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/pinned-audit-compiler.js.map +0 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/prepare-public-api-extractor.d.ts +0 -15
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/prepare-public-api-extractor.d.ts.map +0 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/prepare-public-api-extractor.js +0 -47
- package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/prepare-public-api-extractor.js.map +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PublicApiRepositoryEvidence } from '../../../application/ports/public-api-evidence.js';
|
|
2
|
+
import { type NativeMigrationReview } from '../../../application/model/native-tool-transition.js';
|
|
3
|
+
export type NativeTransitionSchemaAssertion = (id: 'package-public-api-native-transition/v1', value: unknown, phase: string) => Promise<void>;
|
|
4
|
+
/** Paths identify frozen content only. Registry/GitHub origin and protected
|
|
5
|
+
* release execution are authenticated by the consumer's existing operator. */
|
|
6
|
+
export declare function loadNativeTransitionRequest(consumerRoot: string, requestPath: string, assertSchema: NativeTransitionSchemaAssertion, evidence: PublicApiRepositoryEvidence): Promise<{
|
|
7
|
+
releasedRoot: string;
|
|
8
|
+
review: NativeMigrationReview;
|
|
9
|
+
packages: {
|
|
10
|
+
packageName: string;
|
|
11
|
+
baselineBytes: Uint8Array<ArrayBufferLike>;
|
|
12
|
+
archiveBytes: Uint8Array<ArrayBufferLike>;
|
|
13
|
+
configBytes: Uint8Array<ArrayBufferLike>;
|
|
14
|
+
}[];
|
|
15
|
+
configurationFiles: {
|
|
16
|
+
path: string;
|
|
17
|
+
bytes: Uint8Array<ArrayBufferLike>;
|
|
18
|
+
}[];
|
|
19
|
+
}>;
|
|
20
|
+
//# sourceMappingURL=load-native-tool-transition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-native-tool-transition.d.ts","sourceRoot":"","sources":["../../../../../../src/capabilities/public-api-compatibility/adapters/inbound/configuration/load-native-tool-transition.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AACrG,OAAO,EAAiC,KAAK,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AACjI,MAAM,MAAM,+BAA+B,GAAG,CAAC,EAAE,EAAE,yCAAyC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAc9I;8EAC8E;AAC9E,wBAAsB,2BAA2B,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,+BAA+B,EAAE,QAAQ,EAAE,2BAA2B;;;;;;;;;;;;;GA8BhL"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { lstat, realpath } from 'node:fs/promises';
|
|
2
|
+
import { dirname, isAbsolute, join, relative, resolve } from 'node:path';
|
|
3
|
+
import { nativeTransitionError as fail } from '../../../application/model/native-tool-transition.js';
|
|
4
|
+
function contained(root, path) {
|
|
5
|
+
const value = relative(root, path);
|
|
6
|
+
return value === '' || (!isAbsolute(value) && value !== '..' && !value.startsWith(`..${process.platform === 'win32' ? '\\' : '/'}`));
|
|
7
|
+
}
|
|
8
|
+
function filePath(path) {
|
|
9
|
+
if (path.includes('\\') || isAbsolute(path) || path.split('/').some(segment => segment === '' || segment === '.' || segment === '..')) {
|
|
10
|
+
fail('request input path must be a contained relative path');
|
|
11
|
+
}
|
|
12
|
+
return path;
|
|
13
|
+
}
|
|
14
|
+
/** Paths identify frozen content only. Registry/GitHub origin and protected
|
|
15
|
+
* release execution are authenticated by the consumer's existing operator. */
|
|
16
|
+
export async function loadNativeTransitionRequest(consumerRoot, requestPath, assertSchema, evidence) {
|
|
17
|
+
const source = resolve(requestPath);
|
|
18
|
+
const root = await realpath(dirname(source));
|
|
19
|
+
const bytes = await evidence.files.read({ root, candidate: source, maxBytes: 4 * 1024 * 1024 });
|
|
20
|
+
const text = Buffer.from(bytes).toString('utf8');
|
|
21
|
+
evidence.parseYaml(text, 'native-public-api-transition'); // Reject duplicate data keys through the existing strict reader.
|
|
22
|
+
const parsed = JSON.parse(text);
|
|
23
|
+
await assertSchema('package-public-api-native-transition/v1', parsed, 'native-public-api-transition');
|
|
24
|
+
const request = structuredClone(parsed);
|
|
25
|
+
const releasedRoot = join(root, filePath(request.releasedRoot));
|
|
26
|
+
if (!(await lstat(releasedRoot)).isDirectory() || await evidence.paths.traversesSymbolicLink(root, releasedRoot) || await realpath(releasedRoot) !== releasedRoot) {
|
|
27
|
+
fail('released namespace must be a contained ordinary directory');
|
|
28
|
+
}
|
|
29
|
+
const candidate = await realpath(consumerRoot);
|
|
30
|
+
if (contained(candidate, releasedRoot) || contained(releasedRoot, candidate)) {
|
|
31
|
+
fail('historical and candidate namespaces must not overlap');
|
|
32
|
+
}
|
|
33
|
+
let remainingBytes = 128 * 1024 * 1024;
|
|
34
|
+
const read = async (path, maxBytes) => {
|
|
35
|
+
const sourcePath = join(root, filePath(path));
|
|
36
|
+
if (contained(candidate, sourcePath)) {
|
|
37
|
+
fail('historical request content cannot come from the candidate namespace');
|
|
38
|
+
}
|
|
39
|
+
if (remainingBytes === 0) {
|
|
40
|
+
fail('historical request input byte budget exceeded');
|
|
41
|
+
}
|
|
42
|
+
const limit = Math.min(maxBytes, remainingBytes);
|
|
43
|
+
const input = await evidence.files.read({ root, candidate: sourcePath, maxBytes: limit });
|
|
44
|
+
if (input.byteLength > limit) {
|
|
45
|
+
fail('historical request input byte budget exceeded');
|
|
46
|
+
}
|
|
47
|
+
remainingBytes -= input.byteLength;
|
|
48
|
+
return input;
|
|
49
|
+
};
|
|
50
|
+
const packages = [];
|
|
51
|
+
for (const row of request.packages) {
|
|
52
|
+
packages.push({ packageName: row.packageName, baselineBytes: await read(row.baselineInputPath, 32 * 1024 * 1024), archiveBytes: await read(row.archivePath, 8 * 1024 * 1024), configBytes: await read(row.configPath, 32 * 1024 * 1024) });
|
|
53
|
+
}
|
|
54
|
+
const configurationFiles = [];
|
|
55
|
+
for (const row of request.configurationFiles) {
|
|
56
|
+
configurationFiles.push({ path: filePath(row.path), bytes: await read(row.inputPath, 32 * 1024 * 1024) });
|
|
57
|
+
}
|
|
58
|
+
return { releasedRoot, review: request.review, packages, configurationFiles };
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=load-native-tool-transition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-native-tool-transition.js","sourceRoot":"","sources":["../../../../../../src/capabilities/public-api-compatibility/adapters/inbound/configuration/load-native-tool-transition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzE,OAAO,EAAE,qBAAqB,IAAI,IAAI,EAA8B,MAAM,sDAAsD,CAAC;AAQjI,SAAS,SAAS,CAAC,IAAY,EAAE,IAAY;IAC5C,MAAM,KAAK,GAAG,QAAQ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OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAC,CAAC;AAC7E,CAAC"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
+
import { type Node } from "typescript/unstable/ast";
|
|
2
|
+
import type { Checker, Program, Project } from "typescript/unstable/async";
|
|
1
3
|
import type { AuditDeclaration, AuditReference } from "../../../application/model/public-api-observation.js";
|
|
2
|
-
import type { AuditDeclarationInput
|
|
3
|
-
import type { AuditCompilerProgram, PinnedAuditCompiler } from "./pinned-audit-compiler.js";
|
|
4
|
+
import type { AuditDeclarationInput } from "../../../contract/public-api-audit.js";
|
|
4
5
|
interface BindingContext {
|
|
5
|
-
readonly
|
|
6
|
-
readonly
|
|
6
|
+
readonly program: Program;
|
|
7
|
+
readonly checker: Checker;
|
|
8
|
+
readonly project: Project;
|
|
7
9
|
readonly root: string;
|
|
8
10
|
readonly declarations: AuditDeclarationInput;
|
|
9
11
|
}
|
|
10
|
-
/**
|
|
12
|
+
/** Preserve native declaration identity and each actual module-binding occurrence. */
|
|
11
13
|
export declare function bindAuditCompilerReferences(context: BindingContext & {
|
|
12
|
-
readonly pkg: AuditPackageInput;
|
|
13
14
|
readonly items: readonly AuditDeclaration[];
|
|
15
|
+
readonly declarationBindings: ReadonlyMap<string, Node>;
|
|
14
16
|
readonly bindings: Map<AuditReference, string>;
|
|
15
|
-
}): void
|
|
17
|
+
}): Promise<void>;
|
|
16
18
|
export {};
|
|
17
19
|
//# sourceMappingURL=audit-compiler-bindings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-compiler-bindings.d.ts","sourceRoot":"","sources":["../../../../../../src/capabilities/public-api-compatibility/adapters/outbound/api-extractor/audit-compiler-bindings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"audit-compiler-bindings.d.ts","sourceRoot":"","sources":["../../../../../../src/capabilities/public-api-compatibility/adapters/outbound/api-extractor/audit-compiler-bindings.ts"],"names":[],"mappings":"AACA,OAAO,EAEyG,KAAK,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC3J,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAC7G,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAGnF,UAAU,cAAc;IACtB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,qBAAqB,CAAC;CAC9C;AA0GD,sFAAsF;AACtF,wBAAsB,2BAA2B,CAAC,OAAO,EAAE,cAAc,GAAG;IAC1E,QAAQ,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC5C,QAAQ,CAAC,mBAAmB,EAAE,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACxD,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;CAChD,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBhB"}
|
|
@@ -1,131 +1,183 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { isExternalModuleReference, isIdentifier, isImportClause, isImportDeclaration, isImportEqualsDeclaration, isImportSpecifier, isImportTypeNode, isLiteralTypeNode, isNamespaceImport, isQualifiedName, isPropertyAccessExpression, isExportDeclaration, isGetAccessorDeclaration, isSetAccessorDeclaration, isStringLiteralLikeNode, SyntaxKind } from "typescript/unstable/ast";
|
|
3
|
+
import { nativeChildren, nativeParent } from "./native-public-api-excerpt.js";
|
|
4
|
+
async function moduleBinding(node, context) {
|
|
5
|
+
if (!isStringLiteralLikeNode(node) || node.text.startsWith(".")) {
|
|
4
6
|
return;
|
|
5
7
|
}
|
|
6
8
|
const entry = context.declarations.resolutionUniverse.find(candidate => `${candidate.packageName}${candidate.exportPath === "." ? "" : candidate.exportPath.slice(1)}` === node.text);
|
|
7
|
-
const symbol = context.
|
|
9
|
+
const symbol = await context.checker.getSymbolAtLocation(node);
|
|
8
10
|
if (symbol === undefined) {
|
|
9
11
|
return;
|
|
10
12
|
} // Independent diagnostics retain unresolved imports.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
const declaration = symbol.declarations.length === 1 ? await symbol.declarations[0]?.resolve(context.project) : undefined;
|
|
14
|
+
if (entry === undefined || declaration === undefined ||
|
|
15
|
+
resolve(declaration.getSourceFile().fileName) !== resolve(context.root, entry.declarationPath)) {
|
|
13
16
|
throw new Error("Module binding is outside the explicit same-subject universe.");
|
|
14
17
|
}
|
|
15
18
|
return JSON.stringify([entry.packageName, entry.exportPath]);
|
|
16
19
|
}
|
|
17
|
-
function importLiteral(node
|
|
18
|
-
if (node
|
|
19
|
-
return node.argument
|
|
20
|
+
function importLiteral(node) {
|
|
21
|
+
if (isImportTypeNode(node) && isLiteralTypeNode(node.argument)) {
|
|
22
|
+
return node.argument.literal;
|
|
20
23
|
}
|
|
21
|
-
if (node
|
|
24
|
+
if (isExternalModuleReference(node)) {
|
|
22
25
|
return node.expression;
|
|
23
26
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
function parents(node) {
|
|
27
|
-
const names = [];
|
|
28
|
-
let parent = node.parent;
|
|
29
|
-
while (parent !== undefined) {
|
|
30
|
-
if (parent.name?.text !== undefined) {
|
|
31
|
-
names.unshift(parent.name.text);
|
|
32
|
-
}
|
|
33
|
-
parent = parent.parent;
|
|
27
|
+
if (isImportDeclaration(node) || isExportDeclaration(node)) {
|
|
28
|
+
return node.moduleSpecifier;
|
|
34
29
|
}
|
|
35
|
-
|
|
30
|
+
if (isImportEqualsDeclaration(node) && isExternalModuleReference(node.moduleReference)) {
|
|
31
|
+
return node.moduleReference.expression;
|
|
32
|
+
}
|
|
33
|
+
return;
|
|
36
34
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
return names;
|
|
35
|
+
function importedQualifier(node) {
|
|
36
|
+
if (!isQualifiedName(node) && !isPropertyAccessExpression(node)) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
let qualifier = isQualifiedName(node) ? node.left : node.expression;
|
|
40
|
+
while (isQualifiedName(qualifier) || isPropertyAccessExpression(qualifier)) {
|
|
41
|
+
qualifier = isQualifiedName(qualifier) ? qualifier.left : qualifier.expression;
|
|
42
|
+
}
|
|
43
|
+
return qualifier;
|
|
48
44
|
}
|
|
49
|
-
function occurrenceBinding(node, context) {
|
|
50
|
-
// An inline import owns this
|
|
51
|
-
let cursor = node
|
|
52
|
-
while (cursor !== undefined && cursor
|
|
53
|
-
cursor = cursor
|
|
45
|
+
async function occurrenceBinding(node, context) {
|
|
46
|
+
// An inline import owns this occurrence; an unrelated named import cannot lend authority.
|
|
47
|
+
let cursor = nativeParent(node);
|
|
48
|
+
while (cursor !== undefined && (isQualifiedName(cursor) || isPropertyAccessExpression(cursor))) {
|
|
49
|
+
cursor = nativeParent(cursor);
|
|
54
50
|
}
|
|
55
|
-
if (cursor !== undefined && cursor
|
|
51
|
+
if (cursor !== undefined && isImportTypeNode(cursor) && isLiteralTypeNode(cursor.argument)) {
|
|
56
52
|
return moduleBinding(cursor.argument.literal, context);
|
|
57
53
|
}
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
54
|
+
const qualifier = importedQualifier(node);
|
|
55
|
+
if (qualifier !== undefined) {
|
|
56
|
+
// The leftmost name must be this occurrence's actual imported namespace or
|
|
57
|
+
// named alias. A same-spelled import elsewhere cannot authorize this node.
|
|
58
|
+
return occurrenceBinding(qualifier, context);
|
|
59
|
+
}
|
|
60
|
+
const symbol = await context.checker.getSymbolAtLocation(node);
|
|
61
|
+
if (symbol?.declarations.length !== 1) {
|
|
60
62
|
return;
|
|
61
63
|
}
|
|
62
|
-
cursor = symbol.declarations[0];
|
|
63
|
-
|
|
64
|
-
if (!["ImportSpecifier", "NamespaceImport", "ImportClause", "ImportEqualsDeclaration"].some(kind => cursor?.kind === context.compiler.SyntaxKind[kind])) {
|
|
64
|
+
cursor = await symbol.declarations[0]?.resolve(context.project);
|
|
65
|
+
if (cursor === undefined || !(isImportSpecifier(cursor) || isNamespaceImport(cursor) || isImportClause(cursor) || isImportEqualsDeclaration(cursor))) {
|
|
65
66
|
return;
|
|
66
67
|
}
|
|
67
68
|
while (cursor !== undefined) {
|
|
68
|
-
const literal = importLiteral(cursor
|
|
69
|
+
const literal = importLiteral(cursor);
|
|
69
70
|
if (literal !== undefined) {
|
|
70
71
|
return moduleBinding(literal, context);
|
|
71
72
|
}
|
|
72
|
-
cursor = cursor
|
|
73
|
+
cursor = nativeParent(cursor);
|
|
73
74
|
}
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
|
-
function
|
|
77
|
+
function qualifiedText(qualifier) {
|
|
78
|
+
if (isIdentifier(qualifier)) {
|
|
79
|
+
return qualifier.text;
|
|
80
|
+
}
|
|
81
|
+
if (!isQualifiedName(qualifier) && !isPropertyAccessExpression(qualifier)) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const left = qualifiedText(isQualifiedName(qualifier) ? qualifier.left : qualifier.expression);
|
|
85
|
+
return left === undefined ? undefined : `${left}.${isQualifiedName(qualifier) ? qualifier.right.text : qualifier.name.text}`;
|
|
86
|
+
}
|
|
87
|
+
async function bindingDeclarations(node, context) {
|
|
88
|
+
if (!isGetAccessorDeclaration(node)) {
|
|
89
|
+
return [node];
|
|
90
|
+
}
|
|
91
|
+
const symbol = await context.checker.getSymbolAtLocation(node.name);
|
|
92
|
+
if (symbol === undefined) {
|
|
93
|
+
return [node];
|
|
94
|
+
}
|
|
95
|
+
const declarations = [node];
|
|
96
|
+
const isStatic = node.modifiers?.some(modifier => modifier.kind === SyntaxKind.StaticKeyword) === true;
|
|
97
|
+
for (const handle of symbol.declarations) {
|
|
98
|
+
const paired = await handle.resolve(context.project);
|
|
99
|
+
if (paired === undefined || !isSetAccessorDeclaration(paired) || paired.parent !== node.parent ||
|
|
100
|
+
(await context.checker.getSymbolAtLocation(paired.name))?.id !== symbol.id ||
|
|
101
|
+
(paired.modifiers?.some(modifier => modifier.kind === SyntaxKind.StaticKeyword) === true) !== isStatic) {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
declarations.push(paired);
|
|
105
|
+
}
|
|
106
|
+
if (declarations.length > 2) {
|
|
107
|
+
throw new Error("Native property has multiple setter declarations.");
|
|
108
|
+
}
|
|
109
|
+
return declarations; // The model excerpt orders the getter before its own setter.
|
|
110
|
+
}
|
|
111
|
+
async function declarationOccurrences(nodes, context) {
|
|
77
112
|
const occurrences = new Map();
|
|
78
|
-
function
|
|
79
|
-
|
|
80
|
-
if (node.members?.includes(child) === true || child === node.body) {
|
|
113
|
+
function record(text, binding) {
|
|
114
|
+
if (binding === undefined) {
|
|
81
115
|
return;
|
|
82
116
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
117
|
+
const values = occurrences.get(text) ?? [];
|
|
118
|
+
values.push(binding);
|
|
119
|
+
occurrences.set(text, values);
|
|
120
|
+
}
|
|
121
|
+
for (const node of nodes) {
|
|
122
|
+
async function visit(child) {
|
|
123
|
+
// Each container member owns its own excerpt and cannot authorize its container.
|
|
124
|
+
if (("members" in node && Array.isArray(node.members) && node.members.includes(child)) ||
|
|
125
|
+
("body" in node && child === node.body)) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (isQualifiedName(child) || isPropertyAccessExpression(child)) {
|
|
129
|
+
const text = qualifiedText(child);
|
|
130
|
+
if (text !== undefined) {
|
|
131
|
+
record(text, await occurrenceBinding(child, context));
|
|
132
|
+
}
|
|
133
|
+
return; // The model owns one qualified token, not separate identifier edges.
|
|
134
|
+
}
|
|
135
|
+
if (isIdentifier(child)) {
|
|
136
|
+
record(child.text, await occurrenceBinding(child, context));
|
|
137
|
+
}
|
|
138
|
+
for (const nested of nativeChildren(child)) {
|
|
139
|
+
await visit(nested);
|
|
89
140
|
}
|
|
90
141
|
}
|
|
91
|
-
|
|
142
|
+
for (const child of nativeChildren(node)) {
|
|
143
|
+
await visit(child);
|
|
144
|
+
}
|
|
92
145
|
}
|
|
93
|
-
context.compiler.forEachChild(node, visit);
|
|
94
146
|
return occurrences;
|
|
95
147
|
}
|
|
96
|
-
/**
|
|
97
|
-
export function bindAuditCompilerReferences(context) {
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
for (const source of context.program.getSourceFiles()) {
|
|
101
|
-
if (context.program.isSourceFileDefaultLibrary(source)) {
|
|
148
|
+
/** Preserve native declaration identity and each actual module-binding occurrence. */
|
|
149
|
+
export async function bindAuditCompilerReferences(context) {
|
|
150
|
+
for (const path of await context.program.getSourceFileNames()) {
|
|
151
|
+
if ((await context.program.getSourceFileMetadata(path))?.isDefaultLibrary === true) {
|
|
102
152
|
continue;
|
|
103
153
|
}
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
154
|
+
const source = await context.program.getSourceFile(path);
|
|
155
|
+
if (source === undefined) {
|
|
156
|
+
throw new Error("Native compiler source is unavailable.");
|
|
157
|
+
}
|
|
158
|
+
const visit = async (node) => {
|
|
159
|
+
const literal = importLiteral(node);
|
|
108
160
|
if (literal !== undefined) {
|
|
109
|
-
moduleBinding(literal, context);
|
|
161
|
+
await moduleBinding(literal, context);
|
|
110
162
|
}
|
|
111
|
-
|
|
112
|
-
|
|
163
|
+
for (const child of nativeChildren(node)) {
|
|
164
|
+
await visit(child);
|
|
113
165
|
}
|
|
114
|
-
context.compiler.forEachChild(node, visit);
|
|
115
166
|
};
|
|
116
|
-
|
|
167
|
+
for (const child of nativeChildren(source)) {
|
|
168
|
+
await visit(child);
|
|
169
|
+
}
|
|
117
170
|
}
|
|
118
171
|
for (const item of context.items) {
|
|
119
172
|
const unresolved = item.references.filter(reference => reference.resolution === "unresolved");
|
|
120
173
|
if (unresolved.length === 0) {
|
|
121
174
|
continue;
|
|
122
175
|
}
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
if (candidates.length !== 1) {
|
|
176
|
+
const declaration = context.declarationBindings.get(item.identity.canonicalReference);
|
|
177
|
+
if (declaration === undefined) {
|
|
126
178
|
continue;
|
|
127
179
|
}
|
|
128
|
-
const occurrences = declarationOccurrences(
|
|
180
|
+
const occurrences = await declarationOccurrences(await bindingDeclarations(declaration, context), context);
|
|
129
181
|
for (const text of new Set(unresolved.map(reference => reference.text))) {
|
|
130
182
|
const references = unresolved.filter(reference => reference.text === text);
|
|
131
183
|
const actual = occurrences.get(text);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-compiler-bindings.js","sourceRoot":"","sources":["../../../../../../src/capabilities/public-api-compatibility/adapters/outbound/api-extractor/audit-compiler-bindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"audit-compiler-bindings.js","sourceRoot":"","sources":["../../../../../../src/capabilities/public-api-compatibility/adapters/outbound/api-extractor/audit-compiler-bindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,yBAAyB,EAC9G,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,eAAe,EAAE,0BAA0B,EACtH,mBAAmB,EAAE,wBAAwB,EAAE,wBAAwB,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Y,CAAC,CAAC;QAC9F,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAAC,SAAS;QAAC,CAAC;QAC1C,MAAM,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;QACtF,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAAC,SAAS;QAAC,CAAC;QAC5C,MAAM,WAAW,GAAG,MAAM,sBAAsB,CAAC,MAAM,mBAAmB,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;QAC3G,KAAK,MAAM,IAAI,IAAI,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;YACxE,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;YAC3E,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACrC,IAAI,MAAM,EAAE,MAAM,KAAK,UAAU,CAAC,MAAM,EAAE,CAAC;gBAAC,SAAS;YAAC,CAAC;YACvD,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACjG,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
1
|
+
export declare const NATIVE_EXTRACTOR_VERSION = "typescript-native/7.0.2";
|
|
2
|
+
export declare const nativeLibraryDirectory: string;
|
|
3
|
+
export declare const nativeCompilerPath: string;
|
|
4
4
|
export declare const compilerLibraryRoot: string;
|
|
5
|
-
export declare
|
|
6
|
-
export declare
|
|
7
|
-
export declare function pinnedTsdocConfig(): NonNullable<Parameters<typeof ExtractorConfig.prepare>[0]["tsdocConfigFile"]>;
|
|
5
|
+
export declare function assertPinnedAuditSdk(): void;
|
|
6
|
+
export declare function auditToolchainIdentity(): string;
|
|
8
7
|
//# sourceMappingURL=load-pinned-audit-sdk.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-pinned-audit-sdk.d.ts","sourceRoot":"","sources":["../../../../../../src/capabilities/public-api-compatibility/adapters/outbound/api-extractor/load-pinned-audit-sdk.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"load-pinned-audit-sdk.d.ts","sourceRoot":"","sources":["../../../../../../src/capabilities/public-api-compatibility/adapters/outbound/api-extractor/load-pinned-audit-sdk.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,wBAAwB,4BAA4B,CAAC;AAClE,eAAO,MAAM,sBAAsB,QAA2C,CAAC;AAC/E,eAAO,MAAM,kBAAkB,QAAiF,CAAC;AACjH,eAAO,MAAM,mBAAmB,QAAuC,CAAC;AAKxE,wBAAgB,oBAAoB,IAAI,IAAI,CAI3C;AAED,wBAAgB,sBAAsB,IAAI,MAAM,CAW/C"}
|
|
@@ -1,15 +1,39 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
1
2
|
import { createRequire } from "node:module";
|
|
3
|
+
import { readFileSync, realpathSync } from "node:fs";
|
|
2
4
|
import { dirname, join } from "node:path";
|
|
3
|
-
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { version } from "typescript";
|
|
7
|
+
// Fixed private SDK identities; callers cannot select a module or a resolution root.
|
|
4
8
|
const require = createRequire(import.meta.url);
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
const compilerManifestPath = require.resolve("typescript/package.json");
|
|
10
|
+
const nativeManifestPath = createRequire(compilerManifestPath).resolve(`@typescript/typescript-${process.platform}-${process.arch}/package.json`);
|
|
11
|
+
const nativeManifest = JSON.parse(readFileSync(nativeManifestPath, "utf8"));
|
|
12
|
+
const modelPath = require.resolve("@microsoft/api-extractor-model");
|
|
13
|
+
const modelManifestPath = join(dirname(dirname(modelPath)), "package.json");
|
|
14
|
+
const modelManifest = JSON.parse(readFileSync(modelManifestPath, "utf8"));
|
|
15
|
+
export const NATIVE_EXTRACTOR_VERSION = "typescript-native/7.0.2";
|
|
16
|
+
export const nativeLibraryDirectory = join(dirname(nativeManifestPath), "lib");
|
|
17
|
+
export const nativeCompilerPath = join(nativeLibraryDirectory, process.platform === "win32" ? "tsc.exe" : "tsc");
|
|
18
|
+
export const compilerLibraryRoot = realpathSync(nativeLibraryDirectory);
|
|
19
|
+
if (version !== "7.0.2" || nativeManifest.version !== version || nativeManifest.name !== `@typescript/typescript-${process.platform}-${process.arch}`) {
|
|
20
|
+
throw new Error("Public API extraction requires the exact TypeScript 7.0.2 native toolchain.");
|
|
21
|
+
}
|
|
22
|
+
export function assertPinnedAuditSdk() {
|
|
23
|
+
if (version !== "7.0.2" || modelManifest.version !== "7.33.10") {
|
|
24
|
+
throw new Error("Unsupported audit toolchain: require native TypeScript 7.0.2 and API Extractor Model 7.33.10.");
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export function auditToolchainIdentity() {
|
|
28
|
+
assertPinnedAuditSdk();
|
|
29
|
+
const modules = [modelPath, modelManifestPath, compilerManifestPath, nativeManifestPath,
|
|
30
|
+
require.resolve("typescript/unstable/async"), require.resolve("typescript/unstable/ast"), require.resolve("@microsoft/tsdoc"), nativeCompilerPath,
|
|
31
|
+
fileURLToPath(new URL("./native-public-api-engine.js", import.meta.url)),
|
|
32
|
+
fileURLToPath(new URL("./native-public-api-model.js", import.meta.url)),
|
|
33
|
+
fileURLToPath(new URL("./native-public-api-reference.js", import.meta.url)),
|
|
34
|
+
fileURLToPath(new URL("./native-public-api-excerpt.js", import.meta.url)),
|
|
35
|
+
fileURLToPath(new URL("./native-public-api-item.js", import.meta.url))];
|
|
36
|
+
return JSON.stringify({ extractor: NATIVE_EXTRACTOR_VERSION, model: modelManifest.version, compiler: version,
|
|
37
|
+
modules: modules.map(path => ({ digest: `sha256:${createHash("sha256").update(readFileSync(path)).digest("hex")}` })) });
|
|
14
38
|
}
|
|
15
39
|
//# sourceMappingURL=load-pinned-audit-sdk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-pinned-audit-sdk.js","sourceRoot":"","sources":["../../../../../../src/capabilities/public-api-compatibility/adapters/outbound/api-extractor/load-pinned-audit-sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"load-pinned-audit-sdk.js","sourceRoot":"","sources":["../../../../../../src/capabilities/public-api-compatibility/adapters/outbound/api-extractor/load-pinned-audit-sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,qFAAqF;AACrF,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;AACxE,MAAM,kBAAkB,GAAG,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api-evidence.js";
|
|
2
2
|
import { type PublicApiPackagePolicy, type PublicApiSnapshot } from "../../../application/model/public-api.js";
|
|
3
3
|
import type { PublicApiExtractor } from "../../../application/ports/public-api-extractor.js";
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class TypeScriptPublicApiExtractor implements PublicApiExtractor {
|
|
5
5
|
#private;
|
|
6
6
|
constructor(evidence: PublicApiSourceEvidence);
|
|
7
7
|
extract(consumerRoot: string, policy: PublicApiPackagePolicy, packageVersion: string, signal?: AbortSignal): Promise<PublicApiSnapshot>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"microsoft-public-api-extractor.d.ts","sourceRoot":"","sources":["../../../../../../src/capabilities/public-api-compatibility/adapters/outbound/api-extractor/microsoft-public-api-extractor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"microsoft-public-api-extractor.d.ts","sourceRoot":"","sources":["../../../../../../src/capabilities/public-api-compatibility/adapters/outbound/api-extractor/microsoft-public-api-extractor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAC;AAEjG,OAAO,EAA0G,KAAK,sBAAsB,EAAE,KAAK,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AACvN,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AA4B7F,qBAAa,4BAA6B,YAAW,kBAAkB;;IAErE,YAAY,QAAQ,EAAE,uBAAuB,EAAgC;IAEvE,OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAqC5I;CACF"}
|