@ankhorage/atlas 0.19.2 → 0.20.0
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/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +2 -0
- package/.next/build-manifest.json +3 -3
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +12 -0
- package/.next/server/app/_global-error/page.js +1 -1
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/dependency-graph/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/inventory/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/workspace/inventory/route/build-manifest.json +12 -0
- package/.next/server/app/api/workspace/inventory/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/workspace/inventory/route.js +10 -0
- package/.next/server/app/api/workspace/inventory/route.js.map +5 -0
- package/.next/server/app/api/workspace/inventory/route.js.nft.json +1 -0
- package/.next/server/app/api/workspace/inventory/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/workspace/retry/route.js +2 -2
- package/.next/server/app/api/workspace/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/selection/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/workspace/selection/route/build-manifest.json +12 -0
- package/.next/server/app/api/workspace/selection/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/workspace/selection/route.js +11 -0
- package/.next/server/app/api/workspace/selection/route.js.map +5 -0
- package/.next/server/app/api/workspace/selection/route.js.nft.json +1 -0
- package/.next/server/app/api/workspace/selection/route_client-reference-manifest.js +3 -0
- package/.next/server/app/page/server-reference-manifest.json +5 -5
- package/.next/server/app/page.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app-paths-manifest.json +2 -0
- package/.next/server/chunks/[root-of-the-server]__0o38po8._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0o38po8._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__13u3w6h._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__13u3w6h._.js.map +1 -0
- package/.next/server/chunks/{[externals]__16594cb._.js → [root-of-the-server]__14-p326._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__14-p326._.js.map +1 -0
- package/.next/server/chunks/_08j7hwz._.js +5 -0
- package/.next/server/chunks/_08j7hwz._.js.map +1 -0
- package/.next/server/chunks/_0qw9gtg._.js +3 -0
- package/.next/server/chunks/_0qw9gtg._.js.map +1 -0
- package/.next/server/chunks/_0s0tudb._.js +3 -0
- package/.next/server/chunks/_0s0tudb._.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_workspace_inventory_route_actions_1d1a228.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_workspace_selection_route_actions_1-bxxis.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_workspace_selection_route_actions_1-bxxis.js.map +1 -0
- package/.next/server/chunks/node_modules_16e4rf7._.js +4 -4
- package/.next/server/chunks/ssr/[root-of-the-server]__0_6mxrx._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__1o19g7g._.js → [root-of-the-server]__1b7nej0._.js} +1 -1
- package/.next/server/chunks/ssr/_0lahb16._.js +1 -1
- package/.next/server/chunks/ssr/_14-yori._.js +1 -1
- package/.next/server/chunks/ssr/_14-yori._.js.map +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +6 -6
- package/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/paradox/badges/npm.svg +3 -3
- package/paradox/diagrams/architecture-overview.mmd +59 -5
- package/paradox/diagrams/export-graph.mmd +12 -0
- package/paradox/diagrams/module-relationships.mmd +47 -5
- package/paradox/index.html +601 -70
- package/paradox/paradox.json +1390 -170
- package/src/app/api/workspace/inventory/route.ts +21 -0
- package/src/app/api/workspace/selection/route.ts +22 -0
- package/src/features/workspace/adapters/inbound/next/createWorkspaceInventoryRoute.ts +38 -0
- package/src/features/workspace/adapters/inbound/next/createWorkspaceProgressResponse.ts +67 -0
- package/src/features/workspace/adapters/inbound/next/createWorkspaceSelectionRoute.ts +90 -0
- package/src/features/workspace/application/use-cases/classifyWorkspaceRepositoryFailure.ts +105 -0
- package/src/features/workspace/composition/analyzeWorkspaceRepositoryAsync.ts +79 -0
- package/src/features/workspace/composition/createWorkspaceRepositoryRuntime.ts +100 -102
- package/src/features/workspace/composition/createWorkspaceRepositoryStatus.ts +12 -8
- package/src/features/workspace/composition/loadWorkspaceProjectSourceAsync.ts +90 -2
- package/src/features/workspace/composition/loadWorkspaceRepositoryBatchAsync.ts +39 -10
- package/src/features/workspace/composition/updateWorkspaceRepositoryRuntimeAsync.ts +137 -0
- package/src/features/workspace/utils/settleBoundedAsync.ts +17 -10
- package/src/types/workspace.ts +42 -0
- package/.next/server/chunks/_0clm3_5._.js +0 -3
- package/.next/server/chunks/_0clm3_5._.js.map +0 -1
- /package/.next/server/chunks/{[externals]__16594cb._.js.map → _next-internal_server_app_api_workspace_inventory_route_actions_1d1a228.js.map} +0 -0
- /package/.next/server/chunks/ssr/{[root-of-the-server]__1o19g7g._.js.map → [root-of-the-server]__1b7nej0._.js.map} +0 -0
- /package/.next/static/{GOvrWiGb2JX15cd-oOcf6 → CthQ01_AjZZJxjY_Q1XBz}/_buildManifest.js +0 -0
- /package/.next/static/{GOvrWiGb2JX15cd-oOcf6 → CthQ01_AjZZJxjY_Q1XBz}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{GOvrWiGb2JX15cd-oOcf6 → CthQ01_AjZZJxjY_Q1XBz}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/next/src/server/create-deduped-by-callsite-server-error-logger.ts","../../../node_modules/next/src/server/request/cookies.ts","../../../node_modules/next/src/server/web/spec-extension/adapters/headers.ts","../../../node_modules/next/src/server/request/headers.ts","../../../node_modules/next/src/server/request/draft-mode.ts","../../../node_modules/next/headers.js","../../../node_modules/next/src/shared/lib/action-revalidation-kind.ts","../../../node_modules/next/src/server/web/spec-extension/adapters/request-cookies.ts","../../../node_modules/pend/index.js","../../../node_modules/yauzl/fd-slicer.js","../../../node_modules/yauzl/crc32.js","../../../node_modules/yauzl/index.js","../../../src/features/workspace/composition/createWorkspaceRepositoryRuntime.ts","../../../src/features/project-analysis/adapters/outbound/project-detector/inspectProjectForAnalysisAsync.ts","../../../src/features/project-analysis/composition/createProjectFileTreeAsync.ts","../../../src/features/dependency-analysis/adapters/outbound/dependency-graph/projectDependencyImportsAsync.ts","../../../node_modules/%40ankhorage/graph/src/features/graph/domain/reverseGraph.ts","../../../node_modules/%40ankhorage/rules-architecture/src/features/detection/domain/inferArchitectureRoles.ts","../../../node_modules/%40ankhorage/rules-architecture/src/features/models/constants/architectureModels.ts","../../../node_modules/%40ankhorage/repository/src/providers/github/services/materializeGitHubRepositoryWithGatewayAsync.ts","../../../node_modules/%40ankhorage/dependency-graph/src/features/source-graph/domain/serializeSourceGraph.ts","../../../node_modules/%40ankhorage/rules/src/features/configuration/domain/validateRulesConfig.ts","../../../node_modules/%40ankhorage/utility/src/node/fs/resolveFileSystemPathWithinRoot.ts","../../../node_modules/%40ankhorage/utility/src/node/fs/readTextFileWithinRoot.ts","../../../node_modules/%40ankhorage/graph/src/features/graph/domain/findStronglyConnectedComponents.ts","../../../node_modules/%40ankhorage/graph/src/features/graph/domain/findCyclePath.ts","../../../node_modules/%40ankhorage/rules/src/features/evaluation/domain/createRuleResult.ts","../../../src/features/github-auth/adapters/inbound/next/readGitHubAuthViewAsync.ts","../../../node_modules/%40ankhorage/rules/src/features/evaluation/domain/createRuleEvaluationPlan.ts","../../../src/types/language.ts","../../../src/features/workspace/utils/settleBoundedAsync.ts","../../../node_modules/%40ankhorage/rules-architecture/src/features/profiles/constants/architectureProfiles.ts","../../../node_modules/%40ankhorage/repository/src/providers/github/adapters/createGitHubHttpRepositoryDiscoveryGateway.ts","../../../node_modules/%40ankhorage/repository/src/providers/github/adapters/rateLimitResponseAsync.ts","../../../node_modules/%40ankhorage/utility/src/object/isRecord.ts","../../../node_modules/%40ankhorage/rules/src/features/evaluation/domain/evaluateConfiguredRules.ts","../../../node_modules/%40ankhorage/rules-architecture/src/features/profiles/domain/evaluateArchitectureProfile.ts","../../../node_modules/%40ankhorage/rules-architecture/src/features/evaluation/domain/evaluateArchitecture.ts","../../../node_modules/%40ankhorage/utility/src/regex/escapeRegExp.ts","../../../node_modules/%40ankhorage/rules-architecture/src/utils/hasSourceCapability.ts","../../../node_modules/%40ankhorage/rules/src/utils/compareRuleEntityIds.ts","../../../node_modules/%40ankhorage/dependency-graph/src/features/source-graph/domain/rollupSourceRelations.ts","../../../node_modules/%40ankhorage/rules/src/features/evaluation/domain/readCachedRuleResult.ts","../../../node_modules/%40ankhorage/rules/src/features/evaluation/domain/writeCachedRuleResult.ts","../../../node_modules/%40ankhorage/repository/src/providers/github/services/resolveGitHubRepositoryRevisionAsync.ts","../../../node_modules/%40ankhorage/repository/src/providers/github/adapters/createGitHubHttpClient.ts","../../../node_modules/%40ankhorage/rules/src/features/evaluation/domain/createRuleRegistry.ts","../../../node_modules/%40ankhorage/dependency-graph/src/features/dependency-analysis/application/projectDependencyGraphFromProjectAnalysisSnapshots.ts","../../../node_modules/%40ankhorage/repository/src/providers/github/adapters/createGitHubHttpRepositoryReadGateway.ts","../../../node_modules/%40ankhorage/repository/src/providers/github/services/materializeGitHubRepositoryAsync.ts","../../../node_modules/%40ankhorage/rules/src/features/evaluation/domain/createRuleEvaluationCacheKey.ts","../../../src/features/project-source/adapters/outbound/archive/materializeSourceJarAsync.ts","../../../node_modules/%40ankhorage/utility/src/node/path/toPortablePath.ts","../../../node_modules/%40ankhorage/dependency-graph/src/features/source-graph/domain/createSourceGraphIndex.ts","../../../node_modules/%40ankhorage/rules/src/features/evaluation/domain/freezeRuleResult.ts","../../../node_modules/%40ankhorage/rules-architecture/src/features/models/domain/findArchitectureModel.ts","../../../node_modules/%40ankhorage/graph/src/features/graph/domain/findCyclicComponents.ts","../../../node_modules/%40ankhorage/repository/src/providers/github/services/resolveGitHubUrlRevisionAsync.ts","../../../node_modules/%40ankhorage/rules-architecture/src/features/profiles/domain/createArchitectureProfileRuleSet.ts","../../../src/features/workspace/application/use-cases/createWorkspaceAnalysisCache.ts","../../../src/utils/parseProjectPath.ts","../../../node_modules/%40ankhorage/repository/src/providers/github/services/resolveGitHubRepositoryRevisionWithGatewayAsync.ts","../../../node_modules/%40ankhorage/rules/src/features/evaluation/domain/evaluateRuleOutcome.ts","../../../node_modules/%40ankhorage/rules-architecture/src/features/rules/domain/createCyclicDependenciesRule.ts","../../../node_modules/%40ankhorage/rules-architecture/src/features/rules/domain/createArchitectureRuleSet.ts","../../../src/features/workspace/application/use-cases/hydrateWorkspaceSnapshot.ts","../../../src/features/project-tree/application/use-cases/buildProjectTree.ts","../../../node_modules/%40ankhorage/repository/src/providers/github/services/parseGitHubRepositoryUrl.ts","../../../node_modules/%40ankhorage/rules/src/features/evaluation/domain/evaluateRules.ts","../../../src/features/workspace/adapters/inbound/next/createWorkspaceRetryRoute.ts","../../../src/features/project-source/adapters/outbound/repository/createGitHubProjectMaterializer.ts","../../../src/features/project-source/application/use-cases/parseProjectSource.ts","../../../src/features/workspace/composition/createWorkspaceRepositoryStatus.ts","../../../src/utils/getProjectName.ts","../../../src/app/api/workspace/retry/route.ts","../../../node_modules/%40ankhorage/repository/src/providers/github/definitions/GitHubRepositoryDiscoveryResult.ts","../../../node_modules/%40ankhorage/utility/src/url/normalizeGitHubRepositoryUrl.ts","../../../node_modules/%40ankhorage/rules-architecture/src/features/profiles/domain/findArchitectureProfile.ts","../../../src/features/audit/domain/evaluateArchitectureTarget.ts","../../../src/features/project-source/composition/loadProjectSourceAsync.ts","../../../src/features/project-analysis/application/use-cases/selectParserLanguage.ts","../../../src/features/audit/domain/resolveAuditConfiguration.ts","../../../node_modules/%40ankhorage/rules-architecture/src/features/detection/domain/detectArchitecture.ts","../../../src/features/project-analysis/adapters/outbound/source-metadata/readPythonProjectFileMetadata.ts","../../../src/features/project-analysis/adapters/outbound/source-metadata/readCppProjectFileMetadata.ts","../../../src/features/project-analysis/adapters/outbound/source-metadata/readDelphiProjectFileMetadata.ts","../../../src/features/project-analysis/adapters/outbound/source-metadata/readKotlinProjectFileMetadata.ts","../../../src/features/project-analysis/adapters/outbound/source-metadata/readTypeScriptProjectFileMetadata.ts","../../../src/features/project-analysis/adapters/outbound/source-metadata/readJavaProjectFileMetadata.ts","../../../src/features/project-source/application/use-cases/resolveProjectSourceAsync.ts","../../../src/features/dependency-analysis/application/use-cases/projectDependencyGraph.ts","../../../src/features/audit/domain/evaluateAuditRules.ts","../../../src/features/audit/application/use-cases/getPackageCyclesWithMembers.ts","../../../src/features/workspace/composition/composeWorkspaceRepositoryRuntimeResult.ts","../../../src/features/audit/application/use-cases/createAuditFromSnapshot.ts","../../../src/features/workspace/composition/loadWorkspaceRepositoryBatchAsync.ts","../../../src/features/workspace/composition/loadWorkspaceProjectSourceAsync.ts","../../../node_modules/next/src/build/templates/app-route.ts"],"sourcesContent":["import * as React from 'react'\n\nconst errorRef: { current: null | Error } = { current: null }\n\n// React.cache is currently only available in canary/experimental React channels.\nconst cache =\n typeof React.cache === 'function'\n ? React.cache\n : (fn: (key: unknown) => void) => fn\n\n// When Cache Components is enabled, we record these as errors so that they\n// are captured by the dev overlay as it's more critical to fix these\n// when enabled.\nconst logErrorOrWarn = process.env.__NEXT_CACHE_COMPONENTS\n ? console.error\n : console.warn\n\n// We don't want to dedupe across requests.\n// The developer might've just attempted to fix the warning so we should warn again if it still happens.\nconst flushCurrentErrorIfNew = cache(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- cache key\n (key: unknown) => {\n try {\n logErrorOrWarn(errorRef.current)\n } finally {\n errorRef.current = null\n }\n }\n)\n\n/**\n * Creates a function that logs an error message that is deduped by the userland\n * callsite.\n * This requires no indirection between the call of this function and the userland\n * callsite i.e. there's only a single library frame above this.\n * Do not use on the Client where sourcemaps and ignore listing might be enabled.\n * Only use that for warnings need a fix independent of the callstack.\n *\n * @param getMessage\n * @returns\n */\nexport function createDedupedByCallsiteServerErrorLoggerDev<Args extends any[]>(\n getMessage: (...args: Args) => Error\n) {\n return function logDedupedError(...args: Args) {\n const message = getMessage(...args)\n\n if (process.env.NODE_ENV !== 'production') {\n const callStackFrames = new Error().stack?.split('\\n')\n if (callStackFrames === undefined || callStackFrames.length < 4) {\n logErrorOrWarn(message)\n } else {\n // Error:\n // logDedupedError\n // asyncApiBeingAccessedSynchronously\n // <userland callsite>\n // TODO: This breaks if sourcemaps with ignore lists are enabled.\n const key = callStackFrames[4]\n errorRef.current = message\n flushCurrentErrorIfNew(key)\n }\n } else {\n logErrorOrWarn(message)\n }\n }\n}\n","import {\n type ReadonlyRequestCookies,\n areCookiesMutableInCurrentPhase,\n RequestCookiesAdapter,\n} from '../web/spec-extension/adapters/request-cookies'\nimport { RequestCookies } from '../web/spec-extension/cookies'\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport {\n throwForMissingRequestStore,\n workUnitAsyncStorage,\n type PrerenderStoreModern,\n type RequestStore,\n} from '../app-render/work-unit-async-storage.external'\nimport {\n postponeWithTracking,\n throwToInterruptStaticGeneration,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n makeDevtoolsIOAwarePromise,\n makeRuntimeHangingPromise,\n RENDER_STAGES_BY_DATA_KIND,\n} from '../dynamic-rendering-utils'\nimport { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'\nimport { isRequestApiAllowedInCurrentPhase } from './utils'\nimport { applyOwnerStack } from '../dynamic-rendering-utils'\nimport { InvariantError } from '../../shared/lib/invariant-error'\n\nexport function cookies(): Promise<ReadonlyRequestCookies> {\n const callingExpression = 'cookies'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n if (workUnitStore && !isRequestApiAllowedInCurrentPhase(workUnitStore)) {\n throw new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside \\`after()\\` while rendering. This is not supported. If you need this data inside an \\`after()\\` callback, use \\`cookies()\\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // cookies object without tracking\n const underlyingCookies = createEmptyCookies()\n return makeUntrackedCookies(underlyingCookies)\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`cookies()\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache':\n const error = new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside \"use cache\". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`cookies()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, cookies)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n case 'unstable-cache':\n throw new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside a function cached with \\`unstable_cache()\\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`cookies()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`\n )\n case 'generate-static-params':\n throw new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside \\`generateStaticParams\\`. This is not supported because \\`generateStaticParams\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n case 'prerender':\n return makeHangingCookies(workStore, workUnitStore)\n case 'prerender-client':\n case 'validation-client':\n const exportName = '`cookies`'\n throw new InvariantError(\n `${exportName} must not be used within a Client Component. Next.js should be preventing ${exportName} from being included in Client Components statically, but did not in this case.`\n )\n case 'prerender-ppr':\n // We need track dynamic access here eagerly to keep continuity with\n // how cookies has worked in PPR without cacheComponents.\n return postponeWithTracking(\n workStore.route,\n callingExpression,\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n // We track dynamic access here so we don't need to wrap the cookies\n // in individual property access tracking.\n return throwToInterruptStaticGeneration(\n callingExpression,\n workStore,\n workUnitStore\n )\n case 'prerender-runtime': {\n const { stagedRendering } = workUnitStore\n if (stagedRendering) {\n return stagedRendering.delayUntilStage(\n RENDER_STAGES_BY_DATA_KIND.sessionData,\n 'cookies',\n workUnitStore.cookies\n )\n } else {\n return makeUntrackedCookies(workUnitStore.cookies)\n }\n }\n case 'private-cache':\n // Private caches are delayed until the runtime stage in use-cache-wrapper,\n // so we don't need an additional delay here.\n return makeUntrackedCookies(workUnitStore.cookies)\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n\n let underlyingCookies: ReadonlyRequestCookies\n\n if (areCookiesMutableInCurrentPhase(workUnitStore)) {\n // We can't conditionally return different types here based on the context.\n // To avoid confusion, we always return the readonly type here.\n underlyingCookies =\n workUnitStore.userspaceMutableCookies as unknown as ReadonlyRequestCookies\n } else {\n underlyingCookies = workUnitStore.cookies\n }\n\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n return makeUntrackedCookiesWithDevWarnings(\n workUnitStore,\n underlyingCookies,\n workStore?.route\n )\n } else if (workUnitStore.asyncApiPromises) {\n if (underlyingCookies === workUnitStore.mutableCookies) {\n return workUnitStore.asyncApiPromises.mutableCookies\n } else {\n return workUnitStore.asyncApiPromises.cookies\n }\n } else {\n return makeUntrackedCookies(underlyingCookies)\n }\n default:\n workUnitStore satisfies never\n }\n }\n }\n\n // If we end up here, there was no work store or work unit store present.\n throwForMissingRequestStore(callingExpression)\n}\n\nfunction createEmptyCookies(): ReadonlyRequestCookies {\n return RequestCookiesAdapter.seal(new RequestCookies(new Headers({})))\n}\n\ninterface CacheLifetime {}\nconst CachedCookies = new WeakMap<\n CacheLifetime,\n Promise<ReadonlyRequestCookies>\n>()\n\nfunction makeHangingCookies(\n workStore: WorkStore,\n prerenderStore: PrerenderStoreModern\n): Promise<ReadonlyRequestCookies> {\n const cachedPromise = CachedCookies.get(prerenderStore)\n if (cachedPromise) {\n return cachedPromise\n }\n\n const promise = makeRuntimeHangingPromise<ReadonlyRequestCookies>(\n prerenderStore.renderSignal,\n workStore.route,\n '`cookies()`',\n prerenderStore\n )\n CachedCookies.set(prerenderStore, promise)\n\n return promise\n}\n\nfunction makeUntrackedCookies(\n underlyingCookies: ReadonlyRequestCookies\n): Promise<ReadonlyRequestCookies> {\n const cachedCookies = CachedCookies.get(underlyingCookies)\n if (cachedCookies) {\n return cachedCookies\n }\n\n const promise = Promise.resolve(underlyingCookies)\n CachedCookies.set(underlyingCookies, promise)\n\n return promise\n}\n\nfunction makeUntrackedCookiesWithDevWarnings(\n requestStore: RequestStore,\n underlyingCookies: ReadonlyRequestCookies,\n route?: string\n): Promise<ReadonlyRequestCookies> {\n if (requestStore.asyncApiPromises) {\n let promise: Promise<ReadonlyRequestCookies>\n if (underlyingCookies === requestStore.mutableCookies) {\n promise = requestStore.asyncApiPromises.mutableCookies\n } else if (underlyingCookies === requestStore.cookies) {\n promise = requestStore.asyncApiPromises.cookies\n } else {\n throw new InvariantError(\n 'Received an underlying cookies object that does not match either `cookies` or `mutableCookies`'\n )\n }\n return instrumentCookiesPromiseWithDevWarnings(promise, route)\n }\n\n const cachedCookies = CachedCookies.get(underlyingCookies)\n if (cachedCookies) {\n return cachedCookies\n }\n\n const promise = makeDevtoolsIOAwarePromise(\n underlyingCookies,\n requestStore,\n RENDER_STAGES_BY_DATA_KIND.sessionData\n )\n\n const proxiedPromise = instrumentCookiesPromiseWithDevWarnings(promise, route)\n\n CachedCookies.set(underlyingCookies, proxiedPromise)\n\n return proxiedPromise\n}\n\nconst warnForSyncAccess = createDedupedByCallsiteServerErrorLoggerDev(\n createCookiesAccessError\n)\n\nfunction instrumentCookiesPromiseWithDevWarnings(\n promise: Promise<ReadonlyRequestCookies>,\n route: string | undefined\n) {\n Object.defineProperties(promise, {\n [Symbol.iterator]: replaceableWarningDescriptorForSymbolIterator(\n promise,\n route\n ),\n size: replaceableWarningDescriptor(promise, 'size', route),\n get: replaceableWarningDescriptor(promise, 'get', route),\n getAll: replaceableWarningDescriptor(promise, 'getAll', route),\n has: replaceableWarningDescriptor(promise, 'has', route),\n set: replaceableWarningDescriptor(promise, 'set', route),\n delete: replaceableWarningDescriptor(promise, 'delete', route),\n clear: replaceableWarningDescriptor(promise, 'clear', route),\n toString: replaceableWarningDescriptor(promise, 'toString', route),\n })\n return promise\n}\n\nfunction replaceableWarningDescriptor(\n target: unknown,\n prop: string,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, `\\`cookies().${prop}\\``)\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction replaceableWarningDescriptorForSymbolIterator(\n target: unknown,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, '`...cookies()` or similar iteration')\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, Symbol.iterator, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction createCookiesAccessError(\n route: string | undefined,\n expression: string\n) {\n const prefix = route ? `Route \"${route}\" ` : 'This route '\n return new Error(\n `${prefix}used ${expression}. ` +\n `\\`cookies()\\` returns a Promise and must be unwrapped with \\`await\\` or \\`React.use()\\` before accessing its properties. ` +\n `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`\n )\n}\n","import type { IncomingHttpHeaders } from 'http'\n\nimport { ReflectAdapter } from './reflect'\n\n/**\n * @internal\n */\nexport class ReadonlyHeadersError extends Error {\n constructor() {\n super(\n 'Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers'\n )\n }\n\n public static callable() {\n throw new ReadonlyHeadersError()\n }\n}\n\nexport type ReadonlyHeaders = Headers & {\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n append(...args: any[]): void\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n set(...args: any[]): void\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n delete(...args: any[]): void\n}\n\n/**\n * The read methods that a sealed view provides itself instead of forwarding to\n * the underlying `Headers`. Deriving the type from `Headers` keeps the\n * implementations in step with the platform signatures.\n */\ntype SealedHeaderMethods = Pick<\n Headers,\n | 'get'\n | 'has'\n | 'getSetCookie'\n | 'keys'\n | 'values'\n | 'entries'\n | 'forEach'\n | typeof Symbol.iterator\n>\n\n/**\n * Builds the read methods for a sealed view that exposes all of `target`.\n */\nfunction createPassThroughMethods(\n target: Headers,\n sealed: ReadonlyHeaders\n): SealedHeaderMethods {\n return {\n get: target.get.bind(target),\n has: target.has.bind(target),\n getSetCookie: target.getSetCookie.bind(target),\n keys: target.keys.bind(target),\n values: target.values.bind(target),\n entries: target.entries.bind(target),\n [Symbol.iterator]: target[Symbol.iterator].bind(target),\n // The native method passes the unsealed target as the callback's `parent`\n // argument. That is a mutable handle on the underlying headers. Pass the\n // sealed view instead.\n forEach(callbackfn, thisArg) {\n for (const [name, value] of target.entries()) {\n callbackfn.call(thisArg, value, name, sealed)\n }\n },\n }\n}\n\n/**\n * Builds the read methods for a sealed view that omits the header names matched\n * by `isHidden`.\n */\nfunction createHidingMethods(\n target: Headers,\n sealed: ReadonlyHeaders,\n isHidden: (name: string) => boolean\n): SealedHeaderMethods {\n function* entries(): HeadersIterator<[string, string]> {\n for (const entry of target.entries()) {\n if (!isHidden(entry[0])) {\n yield entry\n }\n }\n }\n\n return {\n entries,\n [Symbol.iterator]: entries,\n get: (name) => (isHidden(name) ? null : target.get(name)),\n has: (name) => (isHidden(name) ? false : target.has(name)),\n getSetCookie: () => (isHidden('set-cookie') ? [] : target.getSetCookie()),\n *keys(): HeadersIterator<string> {\n for (const name of target.keys()) {\n if (!isHidden(name)) {\n yield name\n }\n }\n },\n *values(): HeadersIterator<string> {\n for (const [, value] of entries()) {\n yield value\n }\n },\n // The native method passes the unsealed target as the callback's `parent`\n // argument. That is a mutable handle on the underlying headers. Pass the\n // sealed view instead.\n forEach(callbackfn, thisArg) {\n for (const [name, value] of entries()) {\n callbackfn.call(thisArg, value, name, sealed)\n }\n },\n }\n}\n\nexport class HeadersAdapter extends Headers {\n private readonly headers: IncomingHttpHeaders\n\n constructor(headers: IncomingHttpHeaders) {\n // We've already overridden the methods that would be called, so we're just\n // calling the super constructor to ensure that the instanceof check works.\n super()\n\n this.headers = new Proxy(headers, {\n get(target, prop, receiver) {\n // Because this is just an object, we expect that all \"get\" operations\n // are for properties. If it's a \"get\" for a symbol, we'll just return\n // the symbol.\n if (typeof prop === 'symbol') {\n return ReflectAdapter.get(target, prop, receiver)\n }\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return undefined.\n if (typeof original === 'undefined') return\n\n // If the original casing exists, return the value.\n return ReflectAdapter.get(target, original, receiver)\n },\n set(target, prop, value, receiver) {\n if (typeof prop === 'symbol') {\n return ReflectAdapter.set(target, prop, value, receiver)\n }\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, use the prop as the key.\n return ReflectAdapter.set(target, original ?? prop, value, receiver)\n },\n has(target, prop) {\n if (typeof prop === 'symbol') return ReflectAdapter.has(target, prop)\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return false.\n if (typeof original === 'undefined') return false\n\n // If the original casing exists, return true.\n return ReflectAdapter.has(target, original)\n },\n deleteProperty(target, prop) {\n if (typeof prop === 'symbol')\n return ReflectAdapter.deleteProperty(target, prop)\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return true.\n if (typeof original === 'undefined') return true\n\n // If the original casing exists, delete the property.\n return ReflectAdapter.deleteProperty(target, original)\n },\n })\n }\n\n /**\n * Seals a Headers instance to prevent modification by throwing an error when\n * any mutating method is called.\n *\n * The sealed view stays live. Later writes to `headers` remain visible\n * through it.\n *\n * `hidden` omits the given header names from every read operation (`get`,\n * `has`, `getSetCookie`, `forEach`, and iteration). The names must be\n * lowercase. The underlying headers are neither copied nor mutated, so hidden\n * headers remain available to the framework.\n */\n public static seal(\n headers: Headers,\n hidden?: ReadonlySet<string>\n ): ReadonlyHeaders {\n const isHidden =\n hidden && hidden.size > 0\n ? (name: string): boolean => hidden.has(name.toLowerCase())\n : null\n\n // The methods are built once per sealed view and reused, so repeated access\n // returns the same function instead of a fresh closure. They are assigned\n // after the proxy exists because `forEach` hands the proxy to its callback.\n // Creating the proxy runs no trap, so nothing can read them before then.\n let methods: SealedHeaderMethods\n\n const sealed: ReadonlyHeaders = new Proxy<ReadonlyHeaders>(headers, {\n get(target, prop, receiver) {\n switch (prop) {\n case 'append':\n case 'delete':\n case 'set':\n return ReadonlyHeadersError.callable\n case Symbol.iterator:\n return methods[Symbol.iterator]\n case 'get':\n case 'has':\n case 'getSetCookie':\n case 'keys':\n case 'values':\n case 'entries':\n case 'forEach':\n return methods[prop]\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n\n methods = isHidden\n ? createHidingMethods(headers, sealed, isHidden)\n : createPassThroughMethods(headers, sealed)\n\n return sealed\n }\n\n /**\n * @param headers\n * @returns A fresh object identity backed by the original value\n */\n public static fresh(headers: ReadonlyHeaders): ReadonlyHeaders {\n return new Proxy<ReadonlyHeaders>(headers, {\n get(target, prop, receiver) {\n return ReflectAdapter.get(target, prop, receiver)\n },\n })\n }\n\n /**\n * Merges a header value into a string. This stores multiple values as an\n * array, so we need to merge them into a string.\n *\n * @param value a header value\n * @returns a merged header value (a string)\n */\n private merge(value: string | string[]): string {\n if (Array.isArray(value)) return value.join(', ')\n\n return value\n }\n\n /**\n * Creates a Headers instance from a plain object or a Headers instance.\n *\n * @param headers a plain object or a Headers instance\n * @returns a headers instance\n */\n public static from(headers: IncomingHttpHeaders | Headers): Headers {\n if (headers instanceof Headers) return headers\n\n return new HeadersAdapter(headers)\n }\n\n public append(name: string, value: string): void {\n const existing = this.headers[name]\n if (typeof existing === 'string') {\n this.headers[name] = [existing, value]\n } else if (Array.isArray(existing)) {\n existing.push(value)\n } else {\n this.headers[name] = value\n }\n }\n\n public delete(name: string): void {\n delete this.headers[name]\n }\n\n public get(name: string): string | null {\n const value = this.headers[name]\n if (typeof value !== 'undefined') return this.merge(value)\n\n return null\n }\n\n public has(name: string): boolean {\n return typeof this.headers[name] !== 'undefined'\n }\n\n public set(name: string, value: string): void {\n this.headers[name] = value\n }\n\n public forEach(\n callbackfn: (value: string, name: string, parent: Headers) => void,\n thisArg?: any\n ): void {\n for (const [name, value] of this.entries()) {\n callbackfn.call(thisArg, value, name, this)\n }\n }\n\n public *entries(): HeadersIterator<[string, string]> {\n for (const key of Object.keys(this.headers)) {\n const name = key.toLowerCase()\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(name) as string\n\n yield [name, value] as [string, string]\n }\n }\n\n public *keys(): HeadersIterator<string> {\n for (const key of Object.keys(this.headers)) {\n const name = key.toLowerCase()\n yield name\n }\n }\n\n public *values(): HeadersIterator<string> {\n for (const key of Object.keys(this.headers)) {\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(key) as string\n\n yield value\n }\n }\n\n public [Symbol.iterator](): HeadersIterator<[string, string]> {\n return this.entries()\n }\n}\n","import {\n HeadersAdapter,\n type ReadonlyHeaders,\n} from '../web/spec-extension/adapters/headers'\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport {\n throwForMissingRequestStore,\n workUnitAsyncStorage,\n type PrerenderStoreModern,\n type RequestStore,\n} from '../app-render/work-unit-async-storage.external'\nimport {\n postponeWithTracking,\n throwToInterruptStaticGeneration,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n makeDevtoolsIOAwarePromise,\n makeRuntimeHangingPromise,\n RENDER_STAGES_BY_DATA_KIND,\n} from '../dynamic-rendering-utils'\nimport { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'\nimport { isRequestApiAllowedInCurrentPhase } from './utils'\nimport { applyOwnerStack } from '../dynamic-rendering-utils'\nimport { InvariantError } from '../../shared/lib/invariant-error'\n\n/**\n * This function allows you to read the HTTP incoming request headers in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers) and\n * [Middleware](https://nextjs.org/docs/app/building-your-application/routing/middleware).\n *\n * Read more: [Next.js Docs: `headers`](https://nextjs.org/docs/app/api-reference/functions/headers)\n */\nexport function headers(): Promise<ReadonlyHeaders> {\n const callingExpression = 'headers'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n if (workUnitStore && !isRequestApiAllowedInCurrentPhase(workUnitStore)) {\n throw new Error(\n `Route ${workStore.route} used \\`headers()\\` inside \\`after()\\` while rendering. This is not supported. If you need this data inside an \\`after()\\` callback, use \\`headers()\\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // headers object without tracking\n const underlyingHeaders = HeadersAdapter.seal(new Headers({}))\n return makeUntrackedHeaders(underlyingHeaders)\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache': {\n const error = new Error(\n `Route ${workStore.route} used \\`headers()\\` inside \"use cache\". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`headers()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, headers)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n }\n case 'unstable-cache':\n throw new Error(\n `Route ${workStore.route} used \\`headers()\\` inside a function cached with \\`unstable_cache()\\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`headers()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`\n )\n case 'generate-static-params':\n throw new Error(\n `Route ${workStore.route} used \\`headers()\\` inside \\`generateStaticParams\\`. This is not supported because \\`generateStaticParams\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n case 'prerender':\n case 'prerender-client':\n case 'validation-client':\n case 'private-cache':\n case 'prerender-runtime':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`headers()\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n return makeHangingHeaders(workStore, workUnitStore)\n case 'prerender-client':\n case 'validation-client':\n const exportName = '`headers`'\n throw new InvariantError(\n `${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`\n )\n case 'prerender-ppr':\n // PPR Prerender (no cacheComponents)\n // We are prerendering with PPR. We need track dynamic access here eagerly\n // to keep continuity with how headers has worked in PPR without cacheComponents.\n // TODO consider switching the semantic to throw on property access instead\n return postponeWithTracking(\n workStore.route,\n callingExpression,\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n // Legacy Prerender\n // We are in a legacy static generation mode while prerendering\n // We track dynamic access here so we don't need to wrap the headers in\n // individual property access tracking.\n return throwToInterruptStaticGeneration(\n callingExpression,\n workStore,\n workUnitStore\n )\n case 'prerender-runtime': {\n const { stagedRendering } = workUnitStore\n if (stagedRendering) {\n return stagedRendering.delayUntilStage(\n RENDER_STAGES_BY_DATA_KIND.sessionData,\n 'headers',\n workUnitStore.headers\n )\n } else {\n return makeUntrackedHeaders(workUnitStore.headers)\n }\n }\n case 'private-cache':\n // Private caches are delayed until the runtime stage in use-cache-wrapper,\n // so we don't need an additional delay here.\n return makeUntrackedHeaders(workUnitStore.headers)\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n return makeUntrackedHeadersWithDevWarnings(\n workUnitStore.headers,\n workStore?.route,\n workUnitStore\n )\n } else if (workUnitStore.asyncApiPromises) {\n return workUnitStore.asyncApiPromises.headers\n } else {\n return makeUntrackedHeaders(workUnitStore.headers)\n }\n break\n default:\n workUnitStore satisfies never\n }\n }\n }\n\n // If we end up here, there was no work store or work unit store present.\n throwForMissingRequestStore(callingExpression)\n}\n\ninterface CacheLifetime {}\nconst CachedHeaders = new WeakMap<CacheLifetime, Promise<ReadonlyHeaders>>()\n\nfunction makeHangingHeaders(\n workStore: WorkStore,\n prerenderStore: PrerenderStoreModern\n): Promise<ReadonlyHeaders> {\n const cachedHeaders = CachedHeaders.get(prerenderStore)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = makeRuntimeHangingPromise<ReadonlyHeaders>(\n prerenderStore.renderSignal,\n workStore.route,\n '`headers()`',\n prerenderStore\n )\n CachedHeaders.set(prerenderStore, promise)\n\n return promise\n}\n\nfunction makeUntrackedHeaders(\n underlyingHeaders: ReadonlyHeaders\n): Promise<ReadonlyHeaders> {\n const cachedHeaders = CachedHeaders.get(underlyingHeaders)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = Promise.resolve(underlyingHeaders)\n CachedHeaders.set(underlyingHeaders, promise)\n\n return promise\n}\n\nfunction makeUntrackedHeadersWithDevWarnings(\n underlyingHeaders: ReadonlyHeaders,\n route: string | undefined,\n requestStore: RequestStore\n): Promise<ReadonlyHeaders> {\n if (requestStore.asyncApiPromises) {\n return instrumentHeadersPromiseWithDevWarnings(\n requestStore.asyncApiPromises.headers,\n route\n )\n }\n\n const cachedHeaders = CachedHeaders.get(underlyingHeaders)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = makeDevtoolsIOAwarePromise(\n underlyingHeaders,\n requestStore,\n RENDER_STAGES_BY_DATA_KIND.sessionData\n )\n\n const proxiedPromise = instrumentHeadersPromiseWithDevWarnings(promise, route)\n\n CachedHeaders.set(underlyingHeaders, proxiedPromise)\n\n return proxiedPromise\n}\n\nconst warnForSyncAccess = createDedupedByCallsiteServerErrorLoggerDev(\n createHeadersAccessError\n)\n\nfunction instrumentHeadersPromiseWithDevWarnings(\n promise: Promise<ReadonlyHeaders>,\n route: string | undefined\n) {\n Object.defineProperties(promise, {\n [Symbol.iterator]: replaceableWarningDescriptorForSymbolIterator(\n promise,\n route\n ),\n append: replaceableWarningDescriptor(promise, 'append', route),\n delete: replaceableWarningDescriptor(promise, 'delete', route),\n get: replaceableWarningDescriptor(promise, 'get', route),\n has: replaceableWarningDescriptor(promise, 'has', route),\n set: replaceableWarningDescriptor(promise, 'set', route),\n getSetCookie: replaceableWarningDescriptor(promise, 'getSetCookie', route),\n forEach: replaceableWarningDescriptor(promise, 'forEach', route),\n keys: replaceableWarningDescriptor(promise, 'keys', route),\n values: replaceableWarningDescriptor(promise, 'values', route),\n entries: replaceableWarningDescriptor(promise, 'entries', route),\n })\n return promise\n}\n\nfunction replaceableWarningDescriptor(\n target: unknown,\n prop: string,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, `\\`headers().${prop}\\``)\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction replaceableWarningDescriptorForSymbolIterator(\n target: unknown,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, '`...headers()` or similar iteration')\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, Symbol.iterator, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction createHeadersAccessError(\n route: string | undefined,\n expression: string\n) {\n const prefix = route ? `Route \"${route}\" ` : 'This route '\n return new Error(\n `${prefix}used ${expression}. ` +\n `\\`headers()\\` returns a Promise and must be unwrapped with \\`await\\` or \\`React.use()\\` before accessing its properties. ` +\n `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`\n )\n}\n","import {\n getDraftModeProviderForCacheScope,\n throwForMissingRequestStore,\n} from '../app-render/work-unit-async-storage.external'\n\nimport type { DraftModeProvider } from '../async-storage/draft-mode-provider'\n\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\nimport {\n abortAndThrowOnSynchronousRequestDataAccess,\n postponeWithTracking,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport { DynamicServerError } from '../../client/components/hooks-server-context'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { ReflectAdapter } from '../web/spec-extension/adapters/reflect'\nimport {\n applyOwnerStack,\n RENDER_STAGES_BY_DATA_KIND,\n} from '../dynamic-rendering-utils'\n\nexport function draftMode(): Promise<DraftMode> {\n const callingExpression = 'draftMode'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (!workStore || !workUnitStore) {\n throwForMissingRequestStore(callingExpression)\n }\n\n switch (workUnitStore.type) {\n case 'prerender-runtime': {\n // TODO(runtime-ppr): does it make sense to delay this? normally it's always microtasky\n const { stagedRendering } = workUnitStore\n if (stagedRendering) {\n return stagedRendering.delayUntilStage(\n RENDER_STAGES_BY_DATA_KIND.sessionData,\n 'draftMode',\n new DraftMode(workUnitStore.draftMode)\n )\n } else {\n return createOrGetCachedDraftMode(workUnitStore.draftMode, workStore)\n }\n }\n case 'request':\n return createOrGetCachedDraftMode(workUnitStore.draftMode, workStore)\n\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n // Inside of `\"use cache\"` or `unstable_cache`, draft mode is available if\n // the outmost work unit store is a request store (or a runtime prerender),\n // and if draft mode is enabled.\n const draftModeProvider = getDraftModeProviderForCacheScope(\n workStore,\n workUnitStore\n )\n\n if (draftModeProvider) {\n return createOrGetCachedDraftMode(draftModeProvider, workStore)\n }\n\n // Otherwise, we fall through to providing an empty draft mode.\n // eslint-disable-next-line no-fallthrough\n case 'prerender':\n case 'prerender-ppr':\n case 'prerender-legacy':\n // Return empty draft mode\n return createOrGetCachedDraftMode(null, workStore)\n case 'prerender-client':\n case 'validation-client': {\n const exportName = '`draftMode`'\n throw new InvariantError(\n `${exportName} must not be used within a Client Component. Next.js should be preventing ${exportName} from being included in Client Components statically, but did not in this case.`\n )\n }\n case 'generate-static-params':\n throw new Error(\n `Route ${workStore.route} used \\`${callingExpression}()\\` inside \\`generateStaticParams\\`. This is not supported because \\`generateStaticParams\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n\n default:\n return workUnitStore satisfies never\n }\n}\n\nfunction createOrGetCachedDraftMode(\n draftModeProvider: DraftModeProvider | null,\n workStore: WorkStore | undefined\n): Promise<DraftMode> {\n const cacheKey = draftModeProvider ?? NullDraftMode\n const cachedDraftMode = CachedDraftModes.get(cacheKey)\n\n if (cachedDraftMode) {\n return cachedDraftMode\n }\n\n if (process.env.NODE_ENV === 'development' && !workStore?.isPrefetchRequest) {\n const route = workStore?.route\n return createDraftModeWithDevWarnings(draftModeProvider, route)\n } else {\n return Promise.resolve(new DraftMode(draftModeProvider))\n }\n}\n\ninterface CacheLifetime {}\nconst NullDraftMode = {}\nconst CachedDraftModes = new WeakMap<CacheLifetime, Promise<DraftMode>>()\n\nfunction createDraftModeWithDevWarnings(\n underlyingProvider: null | DraftModeProvider,\n route: undefined | string\n): Promise<DraftMode> {\n const instance = new DraftMode(underlyingProvider)\n const promise = Promise.resolve(instance)\n\n const proxiedPromise = new Proxy(promise, {\n get(target, prop, receiver) {\n switch (prop) {\n case 'isEnabled':\n warnForSyncAccess(route, `\\`draftMode().${prop}\\``)\n break\n case 'enable':\n case 'disable': {\n warnForSyncAccess(route, `\\`draftMode().${prop}()\\``)\n break\n }\n default: {\n // We only warn for well-defined properties of the draftMode object.\n }\n }\n\n return ReflectAdapter.get(target, prop, receiver)\n },\n })\n\n return proxiedPromise\n}\n\nclass DraftMode {\n /**\n * @internal - this declaration is stripped via `tsc --stripInternal`\n */\n private readonly _provider: null | DraftModeProvider\n\n constructor(provider: null | DraftModeProvider) {\n this._provider = provider\n }\n get isEnabled() {\n if (this._provider !== null) {\n return this._provider.isEnabled\n }\n return false\n }\n public enable() {\n // We have a store we want to track dynamic data access to ensure we\n // don't statically generate routes that manipulate draft mode.\n trackDynamicDraftMode('draftMode().enable()', this.enable)\n if (this._provider !== null) {\n this._provider.enable()\n }\n }\n public disable() {\n trackDynamicDraftMode('draftMode().disable()', this.disable)\n if (this._provider !== null) {\n this._provider.disable()\n }\n }\n}\nconst warnForSyncAccess = createDedupedByCallsiteServerErrorLoggerDev(\n createDraftModeAccessError\n)\n\nfunction createDraftModeAccessError(\n route: string | undefined,\n expression: string\n) {\n const prefix = route ? `Route \"${route}\" ` : 'This route '\n return new Error(\n `${prefix}used ${expression}. ` +\n `\\`draftMode()\\` returns a Promise and must be unwrapped with \\`await\\` or \\`React.use()\\` before accessing its properties. ` +\n `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`\n )\n}\n\nfunction trackDynamicDraftMode(expression: string, constructorOpt: Function) {\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n // We have a store we want to track dynamic data access to ensure we\n // don't statically generate routes that manipulate draft mode.\n if (workUnitStore?.phase === 'after') {\n throw new Error(\n `Route ${workStore.route} used \"${expression}\" inside \\`after()\\`. The enabled status of \\`draftMode()\\` can be read inside \\`after()\\` but you cannot enable or disable \\`draftMode()\\`. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache':\n case 'private-cache': {\n const error = new Error(\n `Route ${workStore.route} used \"${expression}\" inside \"use cache\". The enabled status of \\`draftMode()\\` can be read in caches but you must not enable or disable \\`draftMode()\\` inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, constructorOpt)\n applyOwnerStack(error)\n workStore.invalidDynamicUsageError ??= error\n throw error\n }\n case 'unstable-cache':\n throw new Error(\n `Route ${workStore.route} used \"${expression}\" inside a function cached with \\`unstable_cache()\\`. The enabled status of \\`draftMode()\\` can be read in caches but you must not enable or disable \\`draftMode()\\` inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`\n )\n\n case 'prerender':\n case 'prerender-runtime': {\n const error = new Error(\n `Route ${workStore.route} used ${expression} without first calling \\`await connection()\\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`\n )\n return abortAndThrowOnSynchronousRequestDataAccess(\n workStore.route,\n expression,\n error,\n workUnitStore\n )\n }\n case 'prerender-client':\n case 'validation-client':\n const exportName = '`draftMode`'\n throw new InvariantError(\n `${exportName} must not be used within a Client Component. Next.js should be preventing ${exportName} from being included in Client Components statically, but did not in this case.`\n )\n case 'prerender-ppr':\n return postponeWithTracking(\n workStore.route,\n expression,\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n workUnitStore.revalidate = 0\n\n const err = new DynamicServerError(\n `Route ${workStore.route} couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`\n )\n workStore.dynamicUsageDescription = expression\n workStore.dynamicUsageStack = err.stack\n\n throw err\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n break\n case 'generate-static-params':\n throw new Error(\n `Route ${workStore.route} used \\`${expression}\\` inside \\`generateStaticParams\\`. This is not supported because \\`generateStaticParams\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n default:\n workUnitStore satisfies never\n }\n }\n }\n}\n","module.exports.cookies = require('./dist/server/request/cookies').cookies\nmodule.exports.headers = require('./dist/server/request/headers').headers\nmodule.exports.draftMode = require('./dist/server/request/draft-mode').draftMode\n","export type ActionRevalidationKind = 0 | 1 | 2\n\nexport const ActionDidNotRevalidate = 0\nexport const ActionDidRevalidateStaticAndDynamic = 1\nexport const ActionDidRevalidateDynamicOnly = 2\n","import { RequestCookies } from '../cookies'\n\nimport { ResponseCookies } from '../cookies'\nimport { ReflectAdapter } from './reflect'\nimport { workAsyncStorage } from '../../../app-render/work-async-storage.external'\nimport type { RequestStore } from '../../../app-render/work-unit-async-storage.external'\nimport { ActionDidRevalidateStaticAndDynamic } from '../../../../shared/lib/action-revalidation-kind'\n\n/**\n * @internal\n */\nexport class ReadonlyRequestCookiesError extends Error {\n constructor() {\n super(\n 'Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options'\n )\n }\n\n public static callable() {\n throw new ReadonlyRequestCookiesError()\n }\n}\n\n// We use this to type some APIs but we don't construct instances directly\nexport type { ResponseCookies }\n\n// The `cookies()` API is a mix of request and response cookies. For `.get()` methods,\n// we want to return the request cookie if it exists. For mutative methods like `.set()`,\n// we want to return the response cookie.\nexport type ReadonlyRequestCookies = Omit<\n RequestCookies,\n 'set' | 'clear' | 'delete'\n> &\n Pick<ResponseCookies, 'set' | 'delete'>\n\nexport class RequestCookiesAdapter {\n public static seal(cookies: RequestCookies): ReadonlyRequestCookies {\n return new Proxy(cookies as any, {\n get(target, prop, receiver) {\n switch (prop) {\n case 'clear':\n case 'delete':\n case 'set':\n return ReadonlyRequestCookiesError.callable\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n }\n\n /**\n * @param cookies\n * @returns A fresh object identity backed by the original value\n */\n public static fresh(cookies: ReadonlyRequestCookies): ReadonlyRequestCookies {\n return new Proxy(cookies, {\n get(target, prop, receiver) {\n return ReflectAdapter.get(target, prop, receiver)\n },\n })\n }\n}\n\nconst SYMBOL_MODIFY_COOKIE_VALUES = Symbol.for('next.mutated.cookies')\n\nexport function getModifiedCookieValues(\n cookies: ResponseCookies\n): ResponseCookie[] {\n const modified: ResponseCookie[] | undefined = (cookies as unknown as any)[\n SYMBOL_MODIFY_COOKIE_VALUES\n ]\n if (!modified || !Array.isArray(modified) || modified.length === 0) {\n return []\n }\n\n return modified\n}\n\ntype SetCookieArgs =\n | [key: string, value: string, cookie?: Partial<ResponseCookie>]\n | [options: ResponseCookie]\n\nexport function appendMutableCookies(\n headers: Headers,\n mutableCookies: ResponseCookies\n): boolean {\n const modifiedCookieValues = getModifiedCookieValues(mutableCookies)\n if (modifiedCookieValues.length === 0) {\n return false\n }\n\n // Return a new response that extends the response with\n // the modified cookies as fallbacks. `res` cookies\n // will still take precedence.\n const resCookies = new ResponseCookies(headers)\n const returnedCookies = resCookies.getAll()\n\n // Set the modified cookies as fallbacks.\n for (const cookie of modifiedCookieValues) {\n resCookies.set(cookie)\n }\n\n // Set the original cookies as the final values.\n for (const cookie of returnedCookies) {\n resCookies.set(cookie)\n }\n\n return true\n}\n\ntype ResponseCookie = NonNullable<\n ReturnType<InstanceType<typeof ResponseCookies>['get']>\n>\n\nexport class MutableRequestCookiesAdapter {\n public static wrap(\n cookies: RequestCookies,\n onUpdateCookies?: (cookies: string[]) => void\n ): ResponseCookies {\n const responseCookies = new ResponseCookies(new Headers())\n for (const cookie of cookies.getAll()) {\n responseCookies.set(cookie)\n }\n\n let modifiedValues: ResponseCookie[] = []\n const modifiedCookies = new Set<string>()\n const updateResponseCookies = () => {\n // TODO-APP: change method of getting workStore\n const workStore = workAsyncStorage.getStore()\n if (workStore) {\n workStore.pathWasRevalidated = ActionDidRevalidateStaticAndDynamic\n }\n\n const allCookies = responseCookies.getAll()\n modifiedValues = allCookies.filter((c) => modifiedCookies.has(c.name))\n if (onUpdateCookies) {\n const serializedCookies: string[] = []\n for (const cookie of modifiedValues) {\n const tempCookies = new ResponseCookies(new Headers())\n tempCookies.set(cookie)\n serializedCookies.push(tempCookies.toString())\n }\n\n onUpdateCookies(serializedCookies)\n }\n }\n\n const wrappedCookies = new Proxy(responseCookies, {\n get(target, prop, receiver) {\n switch (prop) {\n // A special symbol to get the modified cookie values\n case SYMBOL_MODIFY_COOKIE_VALUES:\n return modifiedValues\n\n // TODO: Throw error if trying to set a cookie after the response\n // headers have been set.\n case 'delete':\n return function (...args: [string] | [ResponseCookie]) {\n modifiedCookies.add(\n typeof args[0] === 'string' ? args[0] : args[0].name\n )\n try {\n target.delete(...args)\n return wrappedCookies\n } finally {\n updateResponseCookies()\n }\n }\n case 'set':\n return function (...args: SetCookieArgs) {\n modifiedCookies.add(\n typeof args[0] === 'string' ? args[0] : args[0].name\n )\n try {\n target.set(...args)\n return wrappedCookies\n } finally {\n updateResponseCookies()\n }\n }\n\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n\n return wrappedCookies\n }\n}\n\nexport function createCookiesWithMutableAccessCheck(\n requestStore: RequestStore\n): ResponseCookies {\n const wrappedCookies = new Proxy(requestStore.mutableCookies, {\n get(target, prop, receiver) {\n switch (prop) {\n case 'delete':\n return function (...args: [string] | [ResponseCookie]) {\n ensureCookiesAreStillMutable(requestStore, 'cookies().delete')\n target.delete(...args)\n return wrappedCookies\n }\n case 'set':\n return function (...args: SetCookieArgs) {\n ensureCookiesAreStillMutable(requestStore, 'cookies().set')\n target.set(...args)\n return wrappedCookies\n }\n\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n return wrappedCookies\n}\n\nexport function areCookiesMutableInCurrentPhase(requestStore: RequestStore) {\n return requestStore.phase === 'action'\n}\n\n/** Ensure that cookies() starts throwing on mutation\n * if we changed phases and can no longer mutate.\n *\n * This can happen when going:\n * 'render' -> 'after'\n * 'action' -> 'render'\n * */\nfunction ensureCookiesAreStillMutable(\n requestStore: RequestStore,\n _callingExpression: string\n) {\n if (!areCookiesMutableInCurrentPhase(requestStore)) {\n // TODO: maybe we can give a more precise error message based on callingExpression?\n throw new ReadonlyRequestCookiesError()\n }\n}\n\nexport function responseCookiesToRequestCookies(\n responseCookies: ResponseCookies\n): RequestCookies {\n const requestCookies = new RequestCookies(new Headers())\n for (const cookie of responseCookies.getAll()) {\n requestCookies.set(cookie)\n }\n return requestCookies\n}\n","module.exports = Pend;\n\nfunction Pend() {\n this.pending = 0;\n this.max = Infinity;\n this.listeners = [];\n this.waiting = [];\n this.error = null;\n}\n\nPend.prototype.go = function(fn) {\n if (this.pending < this.max) {\n pendGo(this, fn);\n } else {\n this.waiting.push(fn);\n }\n};\n\nPend.prototype.wait = function(cb) {\n if (this.pending === 0) {\n cb(this.error);\n } else {\n this.listeners.push(cb);\n }\n};\n\nPend.prototype.hold = function() {\n return pendHold(this);\n};\n\nfunction pendHold(self) {\n self.pending += 1;\n var called = false;\n return onCb;\n function onCb(err) {\n if (called) throw new Error(\"callback called twice\");\n called = true;\n self.error = self.error || err;\n self.pending -= 1;\n if (self.waiting.length > 0 && self.pending < self.max) {\n pendGo(self, self.waiting.shift());\n } else if (self.pending === 0) {\n var listeners = self.listeners;\n self.listeners = [];\n listeners.forEach(cbListener);\n }\n }\n function cbListener(listener) {\n listener(self.error);\n }\n}\n\nfunction pendGo(self, fn) {\n fn(pendHold(self));\n}\n","// This was adapted from https://github.com/andrewrk/node-fd-slicer by Andrew Kelley under the MIT License.\nvar fs = require('fs');\nvar util = require('util');\nvar stream = require('stream');\nvar Readable = stream.Readable;\nvar PassThrough = stream.PassThrough;\nvar Pend = require('pend');\nvar EventEmitter = require('events').EventEmitter;\n\nexports.BufferSlicer = BufferSlicer;\nexports.FdSlicer = FdSlicer;\n\nutil.inherits(FdSlicer, EventEmitter);\nfunction FdSlicer(fd) {\n EventEmitter.call(this);\n\n this.fd = fd;\n this.pend = new Pend();\n this.pend.max = 1;\n this.refCount = 0;\n}\n\nFdSlicer.prototype.read = function(buffer, offset, length, position, callback) {\n var self = this;\n self.pend.go(function(cb) {\n fs.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) {\n cb();\n callback(err, bytesRead, buffer);\n });\n });\n};\n\nFdSlicer.prototype.createReadStream = function(options) {\n return new ReadStream(this, options);\n};\n\nFdSlicer.prototype.ref = function() {\n this.refCount += 1;\n};\n\nFdSlicer.prototype.unref = function() {\n var self = this;\n self.refCount -= 1;\n if (self.refCount < 0) throw new Error(\"invalid unref\");\n if (self.refCount > 0) return;\n\n fs.close(self.fd, onCloseDone);\n\n function onCloseDone(err) {\n if (err) {\n self.emit('error', err);\n } else {\n self.emit('close');\n }\n }\n};\n\nutil.inherits(ReadStream, Readable);\nfunction ReadStream(context, options) {\n options = options || {};\n Readable.call(this, options);\n\n this.context = context;\n this.context.ref();\n\n this.start = options.start || 0;\n this.endOffset = options.end;\n this.pos = this.start;\n}\n\nReadStream.prototype._read = function(n) {\n var self = this;\n\n var toRead = Math.min(self._readableState.highWaterMark, n);\n if (self.endOffset != null) {\n toRead = Math.min(toRead, self.endOffset - self.pos);\n }\n if (toRead <= 0) {\n self.push(null);\n this._cleanup();\n return;\n }\n self.context.pend.go(function(cb) {\n var buffer = Buffer.allocUnsafe(toRead);\n fs.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {\n if (err) {\n self.destroy(err);\n } else if (bytesRead === 0) {\n self.push(null);\n self._cleanup();\n } else {\n self.pos += bytesRead;\n self.push(buffer.slice(0, bytesRead));\n }\n cb();\n });\n });\n};\n\nReadStream.prototype._destroy = function(err, cb) {\n // Node 14+ calls this automatically at EOF.\n this._cleanup();\n cb(err);\n};\n\nReadStream.prototype._cleanup = function() {\n if (this.context != null) {\n this.context.unref();\n this.context = null;\n }\n};\n\nutil.inherits(BufferSlicer, EventEmitter);\nfunction BufferSlicer(buffer) {\n EventEmitter.call(this);\n\n this.refCount = 0;\n this.buffer = buffer;\n}\n\nBufferSlicer.prototype.read = function(buffer, offset, length, position, callback) {\n if (!(0 <= offset && offset <= buffer.length)) throw new RangeError(\"offset outside buffer: 0 <= \" + offset + \" <= \" + buffer.length);\n if (position < 0) throw new RangeError(\"position is negative: \" + position);\n if (offset + length > buffer.length) {\n // The caller's buffer can't hold all the bytes they're trying to read.\n // Clamp the length instead of giving an error.\n // The callback will be informed of fewer than expected bytes written.\n length = buffer.length - offset;\n }\n if (position + length > this.buffer.length) {\n // Clamp any attempt to read past the end of the source buffer.\n length = this.buffer.length - position;\n }\n if (length <= 0) {\n // After any clamping, we're fully out of bounds or otherwise have nothing to do.\n // This isn't an error; it's just zero bytes written.\n setImmediate(function() {\n callback(null, 0);\n });\n return;\n }\n this.buffer.copy(buffer, offset, position, position + length);\n setImmediate(function() {\n callback(null, length);\n });\n};\n\nBufferSlicer.prototype.createReadStream = function(options) {\n options = options || {};\n var readStream = new PassThrough(options);\n readStream.start = options.start || 0;\n readStream.endOffset = options.end;\n // by the time this function returns, we'll be done.\n readStream.pos = readStream.endOffset || this.buffer.length;\n\n var entireSlice = this.buffer.slice(readStream.start, readStream.pos);\n // Cut the buffer into smaller slices for better memory usage when streaming into a zlib inflate stream.\n // See https://github.com/thejoshwolfe/yauzl/issues/87\n var maxChunkSize = 0x10000;\n var offset = 0;\n while (true) {\n var nextOffset = offset + maxChunkSize;\n if (nextOffset >= entireSlice.length) {\n // last chunk\n if (offset < entireSlice.length) {\n readStream.write(entireSlice.slice(offset, entireSlice.length));\n }\n break;\n }\n readStream.write(entireSlice.slice(offset, nextOffset));\n offset = nextOffset;\n }\n\n readStream.end();\n return readStream;\n};\n\nBufferSlicer.prototype.ref = function() {\n this.refCount += 1;\n};\n\nBufferSlicer.prototype.unref = function() {\n this.refCount -= 1;\n\n if (this.refCount < 0) {\n throw new Error(\"invalid unref\");\n }\n};\n","// Adapted from https://github.com/brianloveswords/buffer-crc32/blob/v0.2.13/index.js\nconst CRC_TABLE = new Int32Array([\n 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,\n 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,\n 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,\n 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,\n 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,\n 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,\n 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,\n 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,\n 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,\n 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,\n 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,\n 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,\n 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,\n 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,\n 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,\n 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,\n 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,\n 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,\n 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,\n 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,\n 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,\n 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,\n 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,\n 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,\n 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,\n 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,\n 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,\n 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,\n 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,\n 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,\n 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,\n 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d,\n]);\n\nfunction crc32(buf) {\n let crc = -1;\n for (let x of buf) {\n crc = CRC_TABLE[(crc ^ x) & 0xff] ^ (crc >>> 8);\n }\n return (crc ^ -1) >>> 0;\n}\n\nmodule.exports = crc32;\n","var fs = require(\"fs\");\nvar zlib = require(\"zlib\");\nvar fd_slicer = require(\"./fd-slicer\");\nvar util = require(\"util\");\nvar EventEmitter = require(\"events\").EventEmitter;\nvar Transform = require(\"stream\").Transform;\nvar PassThrough = require(\"stream\").PassThrough;\nvar Writable = require(\"stream\").Writable;\n\n// Node 20 added zlib.crc32.\nconst crc32 = typeof zlib.crc32 === \"function\" ? zlib.crc32 : require(\"./crc32\");\n\nexports.open = open;\nexports.fromFd = fromFd;\nexports.fromBuffer = fromBuffer;\nexports.fromRandomAccessReader = fromRandomAccessReader;\nexports.openPromise = openPromise;\nexports.fromFdPromise = fromFdPromise;\nexports.fromBufferPromise = fromBufferPromise;\nexports.fromRandomAccessReaderPromise = fromRandomAccessReaderPromise;\n\nexports.dosDateTimeToDate = dosDateTimeToDate;\nexports.getFileNameLowLevel = getFileNameLowLevel;\nexports.validateFileName = validateFileName;\nexports.parseExtraFields = parseExtraFields;\nexports.ZipFile = ZipFile;\nexports.Entry = Entry;\nexports.LocalFileHeader = LocalFileHeader;\nexports.RandomAccessReader = RandomAccessReader;\n\nfunction openPromise(path, options) {\n return new Promise((resolve, reject) => {\n open(path, {...options, lazyEntries: true}, function(err, zipfile) {\n if (err) return reject(err);\n resolve(zipfile);\n });\n });\n}\nfunction fromFdPromise(fd, options) {\n return new Promise((resolve, reject) => {\n fromFd(fd, {...options, lazyEntries: true}, function(err, zipfile) {\n if (err) return reject(err);\n resolve(zipfile);\n });\n });\n}\nfunction fromBufferPromise(buffer, options) {\n return new Promise((resolve, reject) => {\n fromBuffer(buffer, {...options, lazyEntries: true}, function(err, zipfile) {\n if (err) return reject(err);\n resolve(zipfile);\n });\n });\n}\nfunction fromRandomAccessReaderPromise(reader, totalSize, options) {\n return new Promise((resolve, reject) => {\n fromRandomAccessReader(reader, totalSize, {...options, lazyEntries: true}, function(err, zipfile) {\n if (err) return reject(err);\n resolve(zipfile);\n });\n });\n}\n\nfunction open(path, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = null;\n }\n if (options == null) options = {};\n if (options.autoClose == null) options.autoClose = true;\n if (options.lazyEntries == null) options.lazyEntries = false;\n if (options.decodeStrings == null) options.decodeStrings = true;\n if (options.validateEntrySizes == null) options.validateEntrySizes = true;\n if (options.strictFileNames == null) options.strictFileNames = false;\n if (callback == null) callback = defaultCallback;\n fs.open(path, \"r\", function(err, fd) {\n if (err) return callback(err);\n fromFd(fd, options, function(err, zipfile) {\n if (err) fs.close(fd, defaultCallback);\n callback(err, zipfile);\n });\n });\n}\n\nfunction fromFd(fd, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = null;\n }\n if (options == null) options = {};\n if (options.autoClose == null) options.autoClose = false;\n if (options.lazyEntries == null) options.lazyEntries = false;\n if (options.decodeStrings == null) options.decodeStrings = true;\n if (options.validateEntrySizes == null) options.validateEntrySizes = true;\n if (options.strictFileNames == null) options.strictFileNames = false;\n if (callback == null) callback = defaultCallback;\n fs.fstat(fd, function(err, stats) {\n if (err) return callback(err);\n var reader = new fd_slicer.FdSlicer(fd);\n fromRandomAccessReader(reader, stats.size, options, callback);\n });\n}\n\nfunction fromBuffer(buffer, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = null;\n }\n if (options == null) options = {};\n options.autoClose = false;\n if (options.lazyEntries == null) options.lazyEntries = false;\n if (options.decodeStrings == null) options.decodeStrings = true;\n if (options.validateEntrySizes == null) options.validateEntrySizes = true;\n if (options.strictFileNames == null) options.strictFileNames = false;\n var reader = new fd_slicer.BufferSlicer(buffer);\n fromRandomAccessReader(reader, buffer.length, options, callback);\n}\n\nfunction fromRandomAccessReader(reader, totalSize, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = null;\n }\n if (options == null) options = {};\n if (options.autoClose == null) options.autoClose = true;\n if (options.lazyEntries == null) options.lazyEntries = false;\n if (options.decodeStrings == null) options.decodeStrings = true;\n var decodeStrings = !!options.decodeStrings;\n if (options.validateEntrySizes == null) options.validateEntrySizes = true;\n if (options.strictFileNames == null) options.strictFileNames = false;\n if (callback == null) callback = defaultCallback;\n if (typeof totalSize !== \"number\") throw new Error(\"expected totalSize parameter to be a number\");\n if (totalSize > Number.MAX_SAFE_INTEGER) {\n throw new Error(\"zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.\");\n }\n\n // the matching unref() call is in zipfile.close()\n reader.ref();\n\n // eocdr means End of Central Directory Record.\n // search backwards for the eocdr signature.\n // the last field of the eocdr is a variable-length comment.\n // the comment size is encoded in a 2-byte field in the eocdr, which we can't find without trudging backwards through the comment to find it.\n // as a consequence of this design decision, it's possible to have ambiguous zip file metadata if a coherent eocdr was in the comment.\n // we search backwards for a eocdr signature, and hope that whoever made the zip file was smart enough to forbid the eocdr signature in the comment.\n var eocdrWithoutCommentSize = 22;\n var zip64EocdlSize = 20; // Zip64 end of central directory locator\n var maxCommentSize = 0xffff; // 2-byte size\n var bufferSize = Math.min(zip64EocdlSize + eocdrWithoutCommentSize + maxCommentSize, totalSize);\n var buffer = newBuffer(bufferSize);\n var bufferReadStart = totalSize - buffer.length;\n readAndAssertNoEof(reader, buffer, 0, bufferSize, bufferReadStart, function(err) {\n if (err) return callback(err);\n for (var i = bufferSize - eocdrWithoutCommentSize; i >= 0; i -= 1) {\n if (buffer.readUInt32LE(i) !== 0x06054b50) continue;\n // found eocdr\n var eocdrBuffer = buffer.subarray(i);\n\n // 0 - End of central directory signature = 0x06054b50\n // 4 - Number of this disk\n var diskNumber = eocdrBuffer.readUInt16LE(4);\n // 6 - Disk where central directory starts\n // 8 - Number of central directory records on this disk\n // 10 - Total number of central directory records\n var entryCount = eocdrBuffer.readUInt16LE(10);\n // 12 - Size of central directory (bytes)\n // 16 - Offset of start of central directory, relative to start of archive\n var centralDirectoryOffset = eocdrBuffer.readUInt32LE(16);\n // 20 - Comment length\n var commentLength = eocdrBuffer.readUInt16LE(20);\n var expectedCommentLength = eocdrBuffer.length - eocdrWithoutCommentSize;\n if (commentLength !== expectedCommentLength) {\n return callback(new Error(\"Invalid comment length. Expected: \" + expectedCommentLength + \". Found: \" + commentLength + \". Are there extra bytes at the end of the file? Or is the end of central dir signature `PK☺☻` in the comment?\"));\n }\n // 22 - Comment\n // the encoding is always cp437.\n var comment = decodeStrings ? decodeBuffer(eocdrBuffer.subarray(22), false)\n : eocdrBuffer.subarray(22);\n\n // Look for a Zip64 end of central directory locator\n if (i - zip64EocdlSize >= 0 && buffer.readUInt32LE(i - zip64EocdlSize) === 0x07064b50) {\n // ZIP64 format\n var zip64EocdlBuffer = buffer.subarray(i - zip64EocdlSize, i - zip64EocdlSize + zip64EocdlSize);\n // 0 - zip64 end of central dir locator signature = 0x07064b50\n // 4 - number of the disk with the start of the zip64 end of central directory\n // 8 - relative offset of the zip64 end of central directory record\n var zip64EocdrOffset = readUInt64LE(zip64EocdlBuffer, 8);\n // 16 - total number of disks\n\n // ZIP64 end of central directory record\n var zip64EocdrBuffer = newBuffer(56);\n return readAndAssertNoEof(reader, zip64EocdrBuffer, 0, zip64EocdrBuffer.length, zip64EocdrOffset, function(err) {\n if (err) return callback(err);\n\n // 0 - zip64 end of central dir signature 4 bytes (0x06064b50)\n if (zip64EocdrBuffer.readUInt32LE(0) !== 0x06064b50) {\n return callback(new Error(\"invalid zip64 end of central directory record signature\"));\n }\n // 4 - size of zip64 end of central directory record 8 bytes\n // 12 - version made by 2 bytes\n // 14 - version needed to extract 2 bytes\n // 16 - number of this disk 4 bytes\n diskNumber = zip64EocdrBuffer.readUInt32LE(16);\n if (diskNumber !== 0) {\n // Check this only after zip64 overrides. See #118.\n return callback(new Error(\"multi-disk zip files are not supported: found disk number: \" + diskNumber));\n }\n // 20 - number of the disk with the start of the central directory 4 bytes\n // 24 - total number of entries in the central directory on this disk 8 bytes\n // 32 - total number of entries in the central directory 8 bytes\n entryCount = readUInt64LE(zip64EocdrBuffer, 32);\n // 40 - size of the central directory 8 bytes\n // 48 - offset of start of central directory with respect to the starting disk number 8 bytes\n centralDirectoryOffset = readUInt64LE(zip64EocdrBuffer, 48);\n // 56 - zip64 extensible data sector (variable size)\n return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames));\n });\n }\n\n // Not ZIP64 format\n if (diskNumber !== 0) {\n return callback(new Error(\"multi-disk zip files are not supported: found disk number: \" + diskNumber));\n }\n return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames));\n\n }\n\n // Not a zip file.\n callback(new Error(\"End of central directory record signature not found. Either not a zip file, or file is truncated.\"));\n });\n}\n\nutil.inherits(ZipFile, EventEmitter);\nfunction ZipFile(reader, centralDirectoryOffset, fileSize, entryCount, comment, autoClose, lazyEntries, decodeStrings, validateEntrySizes, strictFileNames) {\n var self = this;\n EventEmitter.call(self);\n self.reader = reader;\n // forward close events\n self.reader.on(\"error\", function(err) {\n // error closing the fd\n emitError(self, err);\n });\n self.reader.once(\"close\", function() {\n self.emit(\"close\");\n });\n self.readEntryCursor = centralDirectoryOffset;\n self.fileSize = fileSize;\n self.entryCount = entryCount;\n self.comment = comment;\n self.entriesRead = 0;\n self.autoClose = !!autoClose;\n self.lazyEntries = !!lazyEntries;\n self.decodeStrings = !!decodeStrings;\n self.validateEntrySizes = !!validateEntrySizes;\n self.strictFileNames = !!strictFileNames;\n self.isOpen = true;\n self.emittedError = false;\n self.hasEachEntryBeenCalled = false;\n\n if (!self.lazyEntries) self._readEntry();\n}\nZipFile.prototype.close = function() {\n if (!this.isOpen) return;\n this.isOpen = false;\n this.reader.unref();\n};\n\nfunction emitErrorAndAutoClose(self, err) {\n if (self.autoClose) self.close();\n emitError(self, err);\n}\nfunction emitError(self, err) {\n if (self.emittedError) return;\n self.emittedError = true;\n self.emit(\"error\", err);\n}\n\nZipFile.prototype.readEntry = function() {\n if (!this.lazyEntries) throw new Error(\"readEntry() called without lazyEntries:true\");\n this._readEntry();\n};\nZipFile.prototype._readEntry = function() {\n var self = this;\n if (self.entryCount === self.entriesRead) {\n // done with metadata\n setImmediate(function() {\n if (self.autoClose) self.close();\n if (self.emittedError) return;\n self.emit(\"end\");\n });\n return;\n }\n if (self.emittedError) return;\n var buffer = newBuffer(46);\n readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) {\n if (err) return emitErrorAndAutoClose(self, err);\n if (self.emittedError) return;\n var entry = new Entry();\n // 0 - Central directory file header signature\n var signature = buffer.readUInt32LE(0);\n if (signature !== 0x02014b50) return emitErrorAndAutoClose(self, new Error(\"invalid central directory file header signature: 0x\" + signature.toString(16)));\n // 4 - Version made by\n entry.versionMadeBy = buffer.readUInt16LE(4);\n // 6 - Version needed to extract (minimum)\n entry.versionNeededToExtract = buffer.readUInt16LE(6);\n // 8 - General purpose bit flag\n entry.generalPurposeBitFlag = buffer.readUInt16LE(8);\n // 10 - Compression method\n entry.compressionMethod = buffer.readUInt16LE(10);\n // 12 - File last modification time\n entry.lastModFileTime = buffer.readUInt16LE(12);\n // 14 - File last modification date\n entry.lastModFileDate = buffer.readUInt16LE(14);\n // 16 - CRC-32\n entry.crc32 = buffer.readUInt32LE(16);\n // 20 - Compressed size\n entry.compressedSize = buffer.readUInt32LE(20);\n // 24 - Uncompressed size\n entry.uncompressedSize = buffer.readUInt32LE(24);\n // 28 - File name length (n)\n entry.fileNameLength = buffer.readUInt16LE(28);\n // 30 - Extra field length (m)\n entry.extraFieldLength = buffer.readUInt16LE(30);\n // 32 - File comment length (k)\n entry.fileCommentLength = buffer.readUInt16LE(32);\n // 34 - Disk number where file starts\n // 36 - Internal file attributes\n entry.internalFileAttributes = buffer.readUInt16LE(36);\n // 38 - External file attributes\n entry.externalFileAttributes = buffer.readUInt32LE(38);\n // 42 - Relative offset of local file header\n entry.relativeOffsetOfLocalHeader = buffer.readUInt32LE(42);\n\n if (entry.generalPurposeBitFlag & 0x40) return emitErrorAndAutoClose(self, new Error(\"strong encryption is not supported\"));\n\n self.readEntryCursor += 46;\n\n buffer = newBuffer(entry.fileNameLength + entry.extraFieldLength + entry.fileCommentLength);\n readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) {\n if (err) return emitErrorAndAutoClose(self, err);\n if (self.emittedError) return;\n // 46 - File name\n entry.fileNameRaw = buffer.subarray(0, entry.fileNameLength);\n // 46+n - Extra field\n var fileCommentStart = entry.fileNameLength + entry.extraFieldLength;\n entry.extraFieldRaw = buffer.subarray(entry.fileNameLength, fileCommentStart);\n // 46+n+m - File comment\n entry.fileCommentRaw = buffer.subarray(fileCommentStart, fileCommentStart + entry.fileCommentLength);\n\n // Parse the extra fields, which we need for processing other fields.\n try {\n entry.extraFields = parseExtraFields(entry.extraFieldRaw);\n } catch (err) {\n return emitErrorAndAutoClose(self, err);\n }\n\n // Interpret strings according to bit flags, extra fields, and options.\n if (self.decodeStrings) {\n var isUtf8 = (entry.generalPurposeBitFlag & 0x800) !== 0;\n entry.fileComment = decodeBuffer(entry.fileCommentRaw, isUtf8);\n entry.fileName = getFileNameLowLevel(entry.generalPurposeBitFlag, entry.fileNameRaw, entry.extraFields, self.strictFileNames);\n var errorMessage = validateFileName(entry.fileName);\n if (errorMessage != null) return emitErrorAndAutoClose(self, new Error(errorMessage));\n } else {\n entry.fileComment = entry.fileCommentRaw;\n entry.fileName = entry.fileNameRaw;\n }\n // Maintain API compatibility. See https://github.com/thejoshwolfe/yauzl/issues/47\n entry.comment = entry.fileComment;\n\n self.readEntryCursor += buffer.length;\n self.entriesRead += 1;\n\n // Check for the Zip64 Extended Information Extra Field.\n for (var i = 0; i < entry.extraFields.length; i++) {\n var extraField = entry.extraFields[i];\n if (extraField.id !== 0x0001) continue;\n // Found it.\n\n var zip64EiefBuffer = extraField.data;\n var index = 0;\n // 0 - Original Size 8 bytes\n if (entry.uncompressedSize === 0xffffffff) {\n if (index + 8 > zip64EiefBuffer.length) {\n return emitErrorAndAutoClose(self, new Error(\"zip64 extended information extra field does not include uncompressed size\"));\n }\n entry.uncompressedSize = readUInt64LE(zip64EiefBuffer, index);\n index += 8;\n }\n // 8 - Compressed Size 8 bytes\n if (entry.compressedSize === 0xffffffff) {\n if (index + 8 > zip64EiefBuffer.length) {\n return emitErrorAndAutoClose(self, new Error(\"zip64 extended information extra field does not include compressed size\"));\n }\n entry.compressedSize = readUInt64LE(zip64EiefBuffer, index);\n index += 8;\n }\n // 16 - Relative Header Offset 8 bytes\n if (entry.relativeOffsetOfLocalHeader === 0xffffffff) {\n if (index + 8 > zip64EiefBuffer.length) {\n return emitErrorAndAutoClose(self, new Error(\"zip64 extended information extra field does not include relative header offset\"));\n }\n entry.relativeOffsetOfLocalHeader = readUInt64LE(zip64EiefBuffer, index);\n index += 8;\n }\n // 24 - Disk Start Number 4 bytes\n\n break;\n }\n\n // validate file size\n if (self.validateEntrySizes && entry.compressionMethod === 0) {\n var expectedCompressedSize = entry.uncompressedSize;\n if (entry.isEncrypted()) {\n // traditional encryption prefixes the file data with a header\n expectedCompressedSize += 12;\n }\n if (entry.compressedSize !== expectedCompressedSize) {\n var msg = \"compressed/uncompressed size mismatch for stored file: \" + entry.compressedSize + \" != \" + entry.uncompressedSize;\n return emitErrorAndAutoClose(self, new Error(msg));\n }\n }\n\n self.emit(\"entry\", entry);\n\n if (!self.lazyEntries) self._readEntry();\n });\n });\n};\n\nZipFile.prototype.eachEntry = function() {\n const self = this;\n if (!self.lazyEntries) throw new Error(\"eachEntry() requires lazyEntries: true\");\n if (self.hasEachEntryBeenCalled) throw new Error(\"eachEntry() must only be called once per ZipFile\");\n self.hasEachEntryBeenCalled = true;\n\n let pendingResolveReject = null;\n self.on(\"entry\", onEntry);\n self.on(\"end\", onEnd);\n self.on(\"error\", onError);\n function cleanup() {\n self.removeListener(\"entry\", onEntry);\n self.removeListener(\"end\", onEnd);\n self.removeListener(\"error\", onError);\n if (self.autoClose) self.close();\n }\n\n function onEntry(entry) {\n let {resolve} = pendingResolveReject;\n pendingResolveReject = null;\n resolve({value: entry});\n }\n function onEnd() {\n let {resolve} = pendingResolveReject;\n pendingResolveReject = null;\n cleanup();\n resolve({done: true});\n }\n function onError(err) {\n let {reject} = pendingResolveReject;\n pendingResolveReject = null;\n cleanup();\n reject(err);\n }\n\n return {\n [Symbol.asyncIterator]() {\n // Called once by `for await...of`.\n return this;\n },\n next() {\n // Called on each iteration in a `for await...of`.\n const promise = new Promise((resolve, reject) => {\n if (pendingResolveReject != null) throw new Error(\"next() called before previous Promise was resolved.\");\n pendingResolveReject = {resolve, reject};\n });\n self.readEntry();\n return promise;\n },\n return(value) {\n // Called when breaking, returning, throwing out of a `for await...of`.\n cleanup();\n return Promise.resolve({done: true, value});\n },\n throw(value) {\n // Almost never called. Something about `yield*` maybe?\n cleanup();\n return Promise.reject(value);\n },\n };\n};\n\nZipFile.prototype.openReadStream = function(entry, options, callback) {\n var self = this;\n // parameter validation\n var relativeStart = 0;\n var relativeEnd = entry.compressedSize;\n if (callback == null) {\n callback = options;\n options = null;\n }\n if (options == null) {\n options = {};\n } else {\n if (options.decodeFileData === false) {\n // new, simple option\n if (options.decrypt != null) {\n throw new Error(\"cannot use options.decrypt when options.decodeFileData === false\");\n }\n if (options.decompress != null) {\n throw new Error(\"cannot use options.decompress when options.decodeFileData === false\");\n }\n // start and end are allowed\n } else {\n // old, complicated options\n if (options.decrypt != null) {\n if (!entry.isEncrypted()) {\n throw new Error(\"options.decrypt can only be specified for encrypted entries. See also option decodeFileData.\");\n }\n if (options.decrypt !== false) throw new Error(\"invalid options.decrypt value: \" + options.decrypt);\n if (entry.isCompressed()) {\n if (options.decompress !== false) throw new Error(\"entry is encrypted and compressed, and options.decompress !== false. See also option decodeFileData.\");\n }\n }\n if (options.decompress != null) {\n if (!entry.isCompressed()) {\n throw new Error(\"options.decompress can only be specified for compressed entries. See also option decodeFileData.\");\n }\n if (!(options.decompress === false || options.decompress === true)) {\n throw new Error(\"invalid options.decompress value: \" + options.decompress);\n }\n decompress = options.decompress;\n }\n }\n if (options.start != null) {\n relativeStart = options.start;\n if (relativeStart < 0) throw new Error(\"options.start < 0\");\n if (relativeStart > entry.compressedSize) throw new Error(\"options.start > entry.compressedSize\");\n }\n if (options.end != null) {\n relativeEnd = options.end;\n if (relativeEnd < 0) throw new Error(\"options.end < 0\");\n if (relativeEnd > entry.compressedSize) throw new Error(\"options.end > entry.compressedSize\");\n if (relativeEnd < relativeStart) throw new Error(\"options.end < options.start\");\n }\n }\n var rawMode = (\n options.decodeFileData === false || // Explicitly requested raw.\n (\n (entry.compressionMethod === 0 || // Naturally without compression.\n (entry.compressionMethod === 8 && options.decompress === false) // Deprecated compression bypass option.\n ) &&\n (!entry.isEncrypted() || // Naturally without encryption.\n options.decrypt === false // Deprecated encryption bypass option.\n )\n )\n );\n if (options.start != null || options.end != null) {\n // Ensure slicing deals with raw data.\n if (!rawMode) throw new Error(\"start/end range require options.decodeFileData === false for non-trivial encoded entries.\");\n }\n\n // any further errors can either be caused by the zipfile,\n // or were introduced in a minor version of yauzl,\n // so should be passed to the client rather than thrown.\n if (!self.isOpen) return callback(new Error(\"closed\"));\n if (entry.isEncrypted() && !rawMode) {\n if (options.decrypt !== false) return callback(new Error(\"entry is encrypted, and options.decodeFileData !== false\"));\n }\n var decompress;\n if (rawMode) {\n decompress = false;\n } else if (entry.compressionMethod === 8) {\n // 8 - The file is Deflated\n decompress = options.decodeFileData !== true;\n } else {\n return callback(new Error(\"unsupported compression method: \" + entry.compressionMethod));\n }\n\n self.readLocalFileHeader(entry, {minimal: true}, function(err, localFileHeader) {\n if (err) return callback(err);\n self.openReadStreamLowLevel(\n localFileHeader.fileDataStart, entry.compressedSize,\n relativeStart, relativeEnd,\n decompress, entry.uncompressedSize,\n callback);\n });\n};\n\nZipFile.prototype.openReadStreamLowLevel = function(fileDataStart, compressedSize, relativeStart, relativeEnd, decompress, uncompressedSize, callback) {\n var self = this;\n\n var fileDataEnd = fileDataStart + compressedSize;\n var readStream = self.reader.createReadStream({\n start: fileDataStart + relativeStart,\n end: fileDataStart + relativeEnd,\n });\n var endpointStream = readStream;\n if (decompress) {\n var destroyed = false;\n var inflateFilter = zlib.createInflateRaw();\n readStream.on(\"error\", function(err) {\n // setImmediate here because errors can be emitted during the first call to pipe()\n setImmediate(function() {\n if (!destroyed) inflateFilter.emit(\"error\", err);\n });\n });\n readStream.pipe(inflateFilter);\n\n if (self.validateEntrySizes) {\n endpointStream = new AssertByteCountStream(uncompressedSize);\n inflateFilter.on(\"error\", function(err) {\n // forward zlib errors to the client-visible stream\n setImmediate(function() {\n if (!destroyed) endpointStream.emit(\"error\", err);\n });\n });\n inflateFilter.pipe(endpointStream);\n } else {\n // the zlib filter is the client-visible stream\n endpointStream = inflateFilter;\n }\n // this is part of yauzl's API, so implement this function on the client-visible stream\n installDestroyFn(endpointStream, function() {\n destroyed = true;\n if (inflateFilter !== endpointStream) inflateFilter.unpipe(endpointStream);\n readStream.unpipe(inflateFilter);\n // TODO: the inflateFilter may cause a memory leak. see Issue #27.\n readStream.destroy();\n });\n }\n callback(null, endpointStream);\n};\n\nZipFile.prototype.readLocalFileHeader = function(entry, options, callback) {\n var self = this;\n if (callback == null) {\n callback = options;\n options = null;\n }\n if (options == null) options = {};\n\n self.reader.ref();\n var buffer = newBuffer(30);\n readAndAssertNoEof(self.reader, buffer, 0, buffer.length, entry.relativeOffsetOfLocalHeader, function(err) {\n try {\n if (err) return callback(err);\n // 0 - Local file header signature = 0x04034b50\n var signature = buffer.readUInt32LE(0);\n if (signature !== 0x04034b50) {\n return callback(new Error(\"invalid local file header signature: 0x\" + signature.toString(16)));\n }\n\n var fileNameLength = buffer.readUInt16LE(26);\n var extraFieldLength = buffer.readUInt16LE(28);\n var fileDataStart = entry.relativeOffsetOfLocalHeader + 30 + fileNameLength + extraFieldLength;\n // We now have enough information to do this bounds check.\n if (fileDataStart + entry.compressedSize > self.fileSize) {\n return callback(new Error(\"file data overflows file bounds: \" +\n fileDataStart + \" + \" + entry.compressedSize + \" > \" + self.fileSize));\n }\n\n if (options.minimal) {\n return callback(null, {fileDataStart: fileDataStart});\n }\n\n var localFileHeader = new LocalFileHeader();\n localFileHeader.fileDataStart = fileDataStart;\n\n // 4 - Version needed to extract (minimum)\n localFileHeader.versionNeededToExtract = buffer.readUInt16LE(4);\n // 6 - General purpose bit flag\n localFileHeader.generalPurposeBitFlag = buffer.readUInt16LE(6);\n // 8 - Compression method\n localFileHeader.compressionMethod = buffer.readUInt16LE(8);\n // 10 - File last modification time\n localFileHeader.lastModFileTime = buffer.readUInt16LE(10);\n // 12 - File last modification date\n localFileHeader.lastModFileDate = buffer.readUInt16LE(12);\n // 14 - CRC-32\n localFileHeader.crc32 = buffer.readUInt32LE(14);\n // 18 - Compressed size\n localFileHeader.compressedSize = buffer.readUInt32LE(18);\n // 22 - Uncompressed size\n localFileHeader.uncompressedSize = buffer.readUInt32LE(22);\n // 26 - File name length (n)\n localFileHeader.fileNameLength = fileNameLength;\n // 28 - Extra field length (m)\n localFileHeader.extraFieldLength = extraFieldLength;\n // 30 - File name\n // 30+n - Extra field\n\n buffer = newBuffer(fileNameLength + extraFieldLength);\n self.reader.ref();\n readAndAssertNoEof(self.reader, buffer, 0, buffer.length, entry.relativeOffsetOfLocalHeader + 30, function(err) {\n try {\n if (err) return callback(err);\n localFileHeader.fileName = buffer.subarray(0, fileNameLength);\n localFileHeader.extraField = buffer.subarray(fileNameLength);\n return callback(null, localFileHeader);\n } finally {\n self.reader.unref();\n }\n });\n } finally {\n self.reader.unref();\n }\n });\n};\n\nZipFile.prototype.openReadStreamPromise = function(entry, options) {\n return new Promise((resolve, reject) => {\n this.openReadStream(entry, options, function(err, readStream) {\n if (err) return reject(err);\n resolve(readStream);\n });\n });\n};\nZipFile.prototype.openReadStreamLowLevelPromise = function(fileDataStart, compressedSize, relativeStart, relativeEnd, decompress, uncompressedSize) {\n return new Promise((resolve, reject) => {\n this.openReadStream(fileDataStart, compressedSize, relativeStart, relativeEnd, decompress, uncompressedSize, function(err, readStream) {\n if (err) return reject(err);\n resolve(readStream);\n });\n });\n};\nZipFile.prototype.readLocalFileHeaderPromise = function(entry, options) {\n return new Promise((resolve, reject) => {\n this.readLocalFileHeader(entry, options, function(err, localFileHeader) {\n if (err) return reject(err);\n resolve(localFileHeader);\n });\n });\n};\n\nfunction Entry() {\n}\nEntry.prototype.getLastModDate = function(options) {\n if (options == null) options = {};\n\n if (!options.forceDosFormat) {\n // Check extended fields.\n for (var i = 0; i < this.extraFields.length; i++) {\n var extraField = this.extraFields[i];\n if (extraField.id === 0x5455) {\n // Info-ZIP \"universal timestamp\" extended field (`0x5455` aka `\"UT\"`).\n // See the Info-ZIP source code unix/unix.c:set_extra_field() and zipfile.c:ef_scan_ut_time().\n var data = extraField.data;\n if (data.length < 5) continue; // Too short.\n // The flags define which of the three fields are present: mtime, atime, ctime.\n // We only care about mtime.\n // Also, ctime is never included in practice.\n // And also, atime is only included in the local file header for some reason\n // despite the flags lying about its inclusion in the central header.\n var flags = data[0];\n var HAS_MTIME = 1;\n if (!(flags & HAS_MTIME)) continue; // This will realistically never happen.\n // Although the positions of all of the fields shift around depending on the presence of other fields,\n // mtime is always first if present, and that's the only one we care about.\n var posixTimestamp = data.readInt32LE(1);\n return new Date(posixTimestamp * 1000);\n } else if (extraField.id === 0x000a) {\n var data = extraField.data;\n if (data.length !== 32) continue; // The length is always the same.\n // 4 bytes reserved\n // 2 bytes Tag\n if (data.readUInt16LE(4) !== 1) continue; // Tag1 is actually the only defined Tag.\n // 2 bytes Size\n if (data.readUInt16LE(6) !== 24) continue; // Size is always 24.\n // 8 bytes Mtime\n var hundredNanoSecondsSince1601 = data.readUInt32LE(8) + 4294967296 * data.readInt32LE(12);\n // Convert from NTFS to POSIX milliseconds.\n // The big number below is the milliseconds between year 1601 and year 1970\n // (i.e. the negative POSIX timestamp of 1601-01-01 00:00:00Z)\n var millisecondsSince1970 = hundredNanoSecondsSince1601 / 10000 - 11644473600000;\n // Note on numeric precision: JavaScript Number objects lose precision above Number.MAX_SAFE_INTEGER,\n // and NTFS timestamps are typically much bigger than that limit.\n // (MAX_SAFE_INTEGER would represent 1629-07-17T23:58:45.475Z.)\n // However, we're losing precision in the conversion from 100nanosecond units to millisecond units anyway,\n // and the time at which we also lose 1-millisecond precision is year 275760, the JavaScript Date limit (by design).\n // Up through the year 2057, this conversion only drops 4 bits of precision,\n // which is well under the 13-14 bits ratio between the milliseconds and 100nanoseconds.\n return new Date(millisecondsSince1970);\n }\n }\n }\n\n // Fallback to non-extended encoding.\n return dosDateTimeToDate(this.lastModFileDate, this.lastModFileTime, options.timezone);\n};\n\nEntry.prototype.canDecodeFileData = function() {\n return (\n !this.isEncrypted() &&\n (this.compressionMethod === 0 || this.compressionMethod === 8)\n );\n};\nEntry.prototype.isEncrypted = function() {\n return (this.generalPurposeBitFlag & 0x1) !== 0;\n};\nEntry.prototype.isCompressed = function() {\n return this.compressionMethod === 8;\n};\n\nfunction LocalFileHeader() {\n}\n\nfunction dosDateTimeToDate(date, time, timezone) {\n var day = date & 0x1f; // 1-31\n var month = (date >> 5 & 0xf) - 1; // 1-12, 0-11\n var year = (date >> 9 & 0x7f) + 1980; // 0-128, 1980-2108\n\n var millisecond = 0;\n var second = (time & 0x1f) * 2; // 0-29, 0-58 (even numbers)\n var minute = time >> 5 & 0x3f; // 0-59\n var hour = time >> 11 & 0x1f; // 0-23\n\n if (timezone == null || timezone === \"local\") {\n return new Date(year, month, day, hour, minute, second, millisecond);\n } else if (timezone === \"UTC\") {\n return new Date(Date.UTC(year, month, day, hour, minute, second, millisecond));\n } else {\n throw new Error(\"unrecognized options.timezone: \" + options.timezone);\n }\n}\n\nfunction getFileNameLowLevel(generalPurposeBitFlag, fileNameBuffer, extraFields, strictFileNames) {\n var fileName = null;\n\n // check for Info-ZIP Unicode Path Extra Field (0x7075)\n // see https://github.com/thejoshwolfe/yauzl/issues/33\n for (var i = 0; i < extraFields.length; i++) {\n var extraField = extraFields[i];\n if (extraField.id === 0x7075) {\n if (extraField.data.length < 6) {\n // too short to be meaningful\n continue;\n }\n // Version 1 byte version of this extra field, currently 1\n if (extraField.data.readUInt8(0) !== 1) {\n // > Changes may not be backward compatible so this extra\n // > field should not be used if the version is not recognized.\n continue;\n }\n // NameCRC32 4 bytes File Name Field CRC32 Checksum\n var oldNameCrc32 = extraField.data.readUInt32LE(1);\n if (crc32(fileNameBuffer) !== oldNameCrc32) {\n // > If the CRC check fails, this UTF-8 Path Extra Field should be\n // > ignored and the File Name field in the header should be used instead.\n continue;\n }\n // UnicodeName Variable UTF-8 version of the entry File Name\n fileName = decodeBuffer(extraField.data.subarray(5), true);\n break;\n }\n }\n\n if (fileName == null) {\n // The typical case.\n var isUtf8 = (generalPurposeBitFlag & 0x800) !== 0;\n fileName = decodeBuffer(fileNameBuffer, isUtf8);\n }\n\n if (!strictFileNames) {\n // Allow backslash.\n fileName = fileName.replace(/\\\\/g, \"/\");\n }\n return fileName;\n}\n\nfunction validateFileName(fileName) {\n if (fileName.indexOf(\"\\\\\") !== -1) {\n return \"invalid characters in fileName: \" + fileName;\n }\n if (/^[a-zA-Z]:/.test(fileName) || /^\\//.test(fileName)) {\n return \"absolute path: \" + fileName;\n }\n if (fileName.split(\"/\").indexOf(\"..\") !== -1) {\n return \"invalid relative path: \" + fileName;\n }\n // all good\n return null;\n}\n\nfunction parseExtraFields(extraFieldBuffer) {\n var extraFields = [];\n var i = 0;\n while (i < extraFieldBuffer.length - 3) {\n var headerId = extraFieldBuffer.readUInt16LE(i + 0);\n var dataSize = extraFieldBuffer.readUInt16LE(i + 2);\n var dataStart = i + 4;\n var dataEnd = dataStart + dataSize;\n if (dataEnd > extraFieldBuffer.length) throw new Error(\"extra field length exceeds extra field buffer size\");\n var dataBuffer = extraFieldBuffer.subarray(dataStart, dataEnd);\n extraFields.push({\n id: headerId,\n data: dataBuffer,\n });\n i = dataEnd;\n }\n return extraFields;\n}\n\nfunction readAndAssertNoEof(reader, buffer, offset, length, position, callback) {\n if (length === 0) {\n // fs.read will throw an out-of-bounds error if you try to read 0 bytes from a 0 byte file\n return setImmediate(function() { callback(null, newBuffer(0)); });\n }\n reader.read(buffer, offset, length, position, function(err, bytesRead) {\n if (err) return callback(err);\n if (bytesRead < length) {\n return callback(new Error(\"unexpected EOF\"));\n }\n callback();\n });\n}\n\nutil.inherits(AssertByteCountStream, Transform);\nfunction AssertByteCountStream(byteCount) {\n Transform.call(this);\n this.actualByteCount = 0;\n this.expectedByteCount = byteCount;\n}\nAssertByteCountStream.prototype._transform = function(chunk, encoding, cb) {\n this.actualByteCount += chunk.length;\n if (this.actualByteCount > this.expectedByteCount) {\n var msg = \"too many bytes in the stream. expected \" + this.expectedByteCount + \". got at least \" + this.actualByteCount;\n return cb(new Error(msg));\n }\n cb(null, chunk);\n};\nAssertByteCountStream.prototype._flush = function(cb) {\n if (this.actualByteCount < this.expectedByteCount) {\n var msg = \"not enough bytes in the stream. expected \" + this.expectedByteCount + \". got only \" + this.actualByteCount;\n return cb(new Error(msg));\n }\n cb();\n};\n\nutil.inherits(RandomAccessReader, EventEmitter);\nfunction RandomAccessReader() {\n EventEmitter.call(this);\n this.refCount = 0;\n}\nRandomAccessReader.prototype.ref = function() {\n this.refCount += 1;\n};\nRandomAccessReader.prototype.unref = function() {\n var self = this;\n self.refCount -= 1;\n\n if (self.refCount > 0) return;\n if (self.refCount < 0) throw new Error(\"invalid unref\");\n\n self.close(onCloseDone);\n\n function onCloseDone(err) {\n if (err) return self.emit('error', err);\n self.emit('close');\n }\n};\nRandomAccessReader.prototype.createReadStream = function(options) {\n if (options == null) options = {};\n var start = options.start;\n var end = options.end;\n if (start === end) {\n var emptyStream = new PassThrough();\n setImmediate(function() {\n emptyStream.end();\n });\n return emptyStream;\n }\n var stream = this._readStreamForRange(start, end);\n\n var destroyed = false;\n var refUnrefFilter = new RefUnrefFilter(this);\n stream.on(\"error\", function(err) {\n setImmediate(function() {\n if (!destroyed) refUnrefFilter.emit(\"error\", err);\n });\n });\n installDestroyFn(refUnrefFilter, function() {\n stream.unpipe(refUnrefFilter);\n refUnrefFilter.unref();\n stream.destroy();\n });\n\n var byteCounter = new AssertByteCountStream(end - start);\n refUnrefFilter.on(\"error\", function(err) {\n setImmediate(function() {\n if (!destroyed) byteCounter.emit(\"error\", err);\n });\n });\n installDestroyFn(byteCounter, function() {\n destroyed = true;\n refUnrefFilter.unpipe(byteCounter);\n refUnrefFilter.destroy();\n });\n\n return stream.pipe(refUnrefFilter).pipe(byteCounter);\n};\nRandomAccessReader.prototype._readStreamForRange = function(start, end) {\n throw new Error(\"not implemented\");\n};\nRandomAccessReader.prototype.read = function(buffer, offset, length, position, callback) {\n var readStream = this.createReadStream({start: position, end: position + length});\n var writeStream = new Writable();\n var written = 0;\n writeStream._write = function(chunk, encoding, cb) {\n chunk.copy(buffer, offset + written, 0, chunk.length);\n written += chunk.length;\n cb();\n };\n writeStream.on(\"finish\", callback);\n readStream.on(\"error\", function(error) {\n callback(error);\n });\n readStream.pipe(writeStream);\n};\nRandomAccessReader.prototype.close = function(callback) {\n setImmediate(callback);\n};\n\nutil.inherits(RefUnrefFilter, PassThrough);\nfunction RefUnrefFilter(context) {\n PassThrough.call(this);\n this.context = context;\n this.context.ref();\n this.unreffedYet = false;\n}\nRefUnrefFilter.prototype._flush = function(cb) {\n this.unref();\n cb();\n};\nRefUnrefFilter.prototype.unref = function(cb) {\n if (this.unreffedYet) return;\n this.unreffedYet = true;\n this.context.unref();\n};\n\nvar cp437 = '\\u0000☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&\\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ';\nfunction decodeBuffer(buffer, isUtf8) {\n if (isUtf8) {\n return buffer.toString(\"utf8\");\n } else {\n var result = \"\";\n for (var i = 0; i < buffer.length; i++) {\n result += cp437[buffer[i]];\n }\n return result;\n }\n}\n\nfunction readUInt64LE(buffer, offset) {\n // There is no native function for this, because we can't actually store 64-bit integers precisely.\n // after 53 bits, JavaScript's Number type (IEEE 754 double) can't store individual integers anymore.\n // but since 53 bits is a whole lot more than 32 bits, we do our best anyway.\n // As of 2020, Node has added support for BigInt, which obviates this whole function,\n // but yauzl hasn't been updated to depend on BigInt (yet?).\n var lower32 = buffer.readUInt32LE(offset);\n var upper32 = buffer.readUInt32LE(offset + 4);\n // we can't use bitshifting here, because JavaScript bitshifting only works on 32-bit integers.\n return upper32 * 0x100000000 + lower32;\n // as long as we're bounds checking the result of this function against the total file size,\n // we'll catch any overflow errors, because we already made sure the total file size was within reason.\n}\n\n// Node 10 deprecated new Buffer().\nvar newBuffer;\nif (typeof Buffer.allocUnsafe === \"function\") {\n newBuffer = function(len) {\n return Buffer.allocUnsafe(len);\n };\n} else {\n newBuffer = function(len) {\n return new Buffer(len);\n };\n}\n\n// Node 8 introduced a proper destroy() implementation on writable streams.\nfunction installDestroyFn(stream, fn) {\n if (typeof stream.destroy === \"function\") {\n // New API.\n stream._destroy = function(err, cb) {\n fn();\n if (cb != null) cb(err);\n };\n } else {\n // Old API.\n stream.destroy = fn;\n }\n}\n\nfunction defaultCallback(err) {\n if (err) throw err;\n}\n","import { randomUUID } from 'node:crypto';\n\nimport {\n createProjectAnalysisSnapshotAsync,\n createSourceGraphFromProjectAnalysisSnapshots,\n projectDependencyGraphFromProjectAnalysisSnapshots,\n} from '@ankhorage/dependency-graph';\nimport type { ProjectInspection } from '@ankhorage/project-detector/types';\nimport type {\n GitHubRepositoryAuthentication,\n GitHubRepositoryDiscoveryRepository,\n} from '@ankhorage/repository/github';\n\nimport { inspectProjectForAnalysisAsync } from '@/features/project-analysis/adapters/outbound/project-detector/inspectProjectForAnalysisAsync';\nimport { selectParserLanguage } from '@/features/project-analysis/application/use-cases/selectParserLanguage';\nimport { createProjectFileTreeAsync } from '@/features/project-analysis/composition/createProjectFileTreeAsync';\nimport { parseProjectSource } from '@/features/project-source/application/use-cases/parseProjectSource';\nimport { loadProjectSourceAsync } from '@/features/project-source/composition/loadProjectSourceAsync';\nimport {\n createWorkspaceAnalysisCache,\n type WorkspaceAnalysisCache,\n} from '@/features/workspace/application/use-cases/createWorkspaceAnalysisCache';\nimport type {\n RepositoryAnalysis,\n WorkspaceRepositoryRuntimeResult,\n} from '@/features/workspace/composition/composeWorkspaceRepositoryRuntimeResult';\nimport type { WorkspaceRuntimeState } from '@/features/workspace/composition/loadWorkspaceRepositoryBatchAsync';\nimport { loadWorkspaceRepositoryBatchAsync } from '@/features/workspace/composition/loadWorkspaceRepositoryBatchAsync';\nimport type { ProjectSource, ResolvedProjectSource } from '@/types/projectSource';\n\n/*** Own process-local GitHub workspace state and revision-keyed portable analysis snapshots. */\nexport function createWorkspaceRepositoryRuntime(\n dependencies: WorkspaceRepositoryRuntimeDependencies\n): WorkspaceRepositoryRuntime {\n const cache = dependencies.cache ?? createWorkspaceAnalysisCache<RepositoryAnalysis>(32);\n const workspaces = new Map<string, WorkspaceRuntimeState>();\n\n return createWorkspaceRuntimeActions(workspaces, cache, dependencies);\n}\n\n/*** Bind non-secret retained workspace state to request-scoped operations. */\nfunction createWorkspaceRuntimeActions(\n workspaces: Map<string, WorkspaceRuntimeState>,\n cache: WorkspaceAnalysisCache<RepositoryAnalysis>,\n dependencies: WorkspaceRepositoryRuntimeDependencies\n): WorkspaceRepositoryRuntime {\n return {\n loadAsync: (input, signal) =>\n loadWorkspaceRuntimeAsync(workspaces, cache, dependencies, input, signal),\n retryAsync: (runtimeId, repositoryId, authorization, signal) =>\n retryWorkspaceRuntimeAsync(\n workspaces,\n cache,\n dependencies,\n runtimeId,\n repositoryId,\n authorization,\n signal\n ),\n };\n}\n\n/*** Start one workspace analysis without retaining its request credential. */\nasync function loadWorkspaceRuntimeAsync(\n workspaces: Map<string, WorkspaceRuntimeState>,\n cache: WorkspaceAnalysisCache<RepositoryAnalysis>,\n dependencies: WorkspaceRepositoryRuntimeDependencies,\n input: WorkspaceRepositoryRuntimeInput,\n signal?: AbortSignal\n) {\n const workspace = runtimeWorkspace(input);\n const runtimeId = randomUUID();\n retainWorkspace(workspaces, runtimeId, workspace);\n return runWorkspaceOperationAsync(workspace, () =>\n loadRepositoriesAsync(\n workspace,\n input.repositories,\n runtimeId,\n cache,\n dependencies,\n workspaceRepositoryAuthorization(input),\n signal\n )\n );\n}\n\n/*** Retry a retained repository with authorization supplied for this request only. */\nasync function retryWorkspaceRuntimeAsync(\n workspaces: Map<string, WorkspaceRuntimeState>,\n cache: WorkspaceAnalysisCache<RepositoryAnalysis>,\n dependencies: WorkspaceRepositoryRuntimeDependencies,\n runtimeId: string,\n repositoryId: string,\n authorization = anonymousAuthorization,\n signal?: AbortSignal\n) {\n const workspace = workspaces.get(runtimeId);\n if (workspace === undefined)\n throw new WorkspaceRepositoryRuntimeError(\n 'unavailable',\n 'The workspace runtime is no longer available. Reload it to retry.'\n );\n const repository = workspace.repositories.find(candidate => candidate.id === repositoryId);\n if (repository === undefined)\n throw new WorkspaceRepositoryRuntimeError(\n 'invalid',\n 'The requested repository is not part of this workspace.'\n );\n if (workspace.statuses.get(repository.id)?.status === 'successful')\n throw new WorkspaceRepositoryRuntimeError('stale', 'Only failed repositories can be retried.');\n return runWorkspaceOperationAsync(workspace, () =>\n loadRepositoriesAsync(\n workspace,\n [repository],\n runtimeId,\n cache,\n dependencies,\n authorization,\n signal\n )\n );\n}\n\n/*** Create the ephemeral non-secret state retained for one workspace runtime. */\nfunction runtimeWorkspace(input: WorkspaceRepositoryRuntimeInput): WorkspaceRuntimeState {\n return {\n active: false,\n entries: new Map(),\n generation: 0,\n repositories: input.repositories,\n source: input.source,\n statuses: new Map(),\n };\n}\n\n/*** Resolve request authorization without retaining a credential in the runtime workspace. */\nfunction workspaceRepositoryAuthorization(\n input: WorkspaceRepositoryRuntimeInput\n): WorkspaceRepositoryAuthorization {\n return {\n authentication: input.authentication ?? 'anonymous',\n authorizationScope: input.authorizationScope ?? 'anonymous',\n };\n}\n\n/*** Analyze only the requested repositories, then recompose the whole workspace from retained snapshots. */\nasync function loadRepositoriesAsync(\n workspace: WorkspaceRuntimeState,\n repositories: readonly GitHubRepositoryDiscoveryRepository[],\n runtimeId: string,\n cache: WorkspaceAnalysisCache<RepositoryAnalysis>,\n dependencies: WorkspaceRepositoryRuntimeDependencies,\n authorization: WorkspaceRepositoryAuthorization,\n signal?: AbortSignal\n): Promise<WorkspaceRepositoryRuntimeResult> {\n return loadWorkspaceRepositoryBatchAsync(\n workspace,\n repositories,\n runtimeId,\n async (repository, operationSignal) =>\n analyzeRepositoryAsync(\n repository,\n authorization.authentication,\n authorization.authorizationScope,\n cache,\n dependencies,\n operationSignal\n ),\n signal\n );\n}\n\n/*** Resolve one immutable revision and materialize it only when its validated portable snapshot is absent. */\nasync function analyzeRepositoryAsync(\n repository: GitHubRepositoryDiscoveryRepository,\n authentication: GitHubRepositoryAuthentication,\n authorizationScope: string,\n cache: WorkspaceAnalysisCache<RepositoryAnalysis>,\n dependencies: WorkspaceRepositoryRuntimeDependencies,\n signal?: AbortSignal\n): Promise<RepositoryAnalysis> {\n const revision = await dependencies.resolveRevisionAsync(repository.url, authentication, signal);\n const key = workspaceAnalysisCacheKey(revision, authorizationScope);\n const cached = cache.getAnalysis(key);\n if (cached !== undefined) return cached;\n const source = parseProjectSource(repository.url);\n if (source.kind !== 'github') throw new Error('Workspace repositories must be GitHub sources.');\n const resolved = await (dependencies.materializeAsync ?? loadProjectSourceAsync)(\n { ...source, revision: revision.revision.commitSha },\n signal,\n authentication\n );\n try {\n const inspection = await (dependencies.inspectAsync ?? inspectProjectForAnalysisAsync)(\n resolved.rootPath\n );\n const analysis = await createProjectAnalysisSnapshotAsync({ id: repository.id, inspection });\n const sourceGraph = createSourceGraphFromProjectAnalysisSnapshots([analysis]);\n const dependencyGraph = projectDependencyGraphFromProjectAnalysisSnapshots(sourceGraph, [\n analysis,\n ]);\n const language = selectParserLanguage(inspection.detection);\n const value = {\n analysis,\n files: await createProjectFileTreeAsync(\n inspection,\n dependencyGraph,\n language.language,\n resolved.rootPath\n ),\n language,\n };\n cache.setAnalysis(key, value);\n return value;\n } finally {\n await resolved.cleanupAsync();\n }\n}\n\n/*** Scope immutable analyses to the GitHub identity that was authorized to read them. */\nfunction workspaceAnalysisCacheKey(\n revision: Awaited<ReturnType<WorkspaceRepositoryRuntimeDependencies['resolveRevisionAsync']>>,\n authorization: string\n) {\n return {\n authorization,\n provider: 'github' as const,\n repositoryId: revision.repository.id,\n revision: revision.revision.commitSha,\n schemaVersion: ANALYSIS_SCHEMA_VERSION,\n };\n}\n\n/*** Reject overlapping retry work before it can duplicate materialization or produce stale responses. */\nasync function runWorkspaceOperationAsync<Result>(\n workspace: WorkspaceRuntimeState,\n operation: () => Promise<Result>\n): Promise<Result> {\n if (workspace.active) {\n throw new WorkspaceRepositoryRuntimeError(\n 'rate-limited',\n 'A workspace operation is already in progress. Try again shortly.'\n );\n }\n workspace.active = true;\n try {\n return await operation();\n } finally {\n workspace.active = false;\n }\n}\n\n/*** Bound process-local workspace state without evicting a workspace that is currently materializing. */\nfunction retainWorkspace(\n workspaces: Map<string, WorkspaceRuntimeState>,\n runtimeId: string,\n workspace: WorkspaceRuntimeState\n): void {\n workspaces.set(runtimeId, workspace);\n while (workspaces.size > MAXIMUM_RUNTIME_WORKSPACES) {\n const oldest = [...workspaces.entries()].find(\n ([candidateId, candidate]) => candidateId !== runtimeId && !candidate.active\n );\n if (oldest === undefined) return;\n workspaces.delete(oldest[0]);\n }\n}\n\nexport interface WorkspaceRepositoryRuntime {\n readonly loadAsync: (\n input: WorkspaceRepositoryRuntimeInput,\n signal?: AbortSignal\n ) => Promise<WorkspaceRepositoryRuntimeResult>;\n readonly retryAsync: (\n runtimeId: string,\n repositoryId: string,\n authorization?: WorkspaceRepositoryAuthorization,\n signal?: AbortSignal\n ) => Promise<WorkspaceRepositoryRuntimeResult>;\n}\n\nexport interface WorkspaceRepositoryRuntimeDependencies {\n readonly cache?: WorkspaceAnalysisCache<RepositoryAnalysis>;\n readonly inspectAsync?: (path: string) => Promise<ProjectInspection>;\n readonly materializeAsync?: (\n source: ProjectSource,\n signal?: AbortSignal,\n authentication?: GitHubRepositoryAuthentication\n ) => Promise<ResolvedProjectSource>;\n readonly resolveRevisionAsync: (\n url: string,\n authentication: GitHubRepositoryAuthentication,\n signal?: AbortSignal\n ) => Promise<{\n readonly repository: { readonly id: string };\n readonly revision: { readonly commitSha: string };\n }>;\n}\n\ninterface WorkspaceRepositoryRuntimeInput {\n readonly authentication?: GitHubRepositoryAuthentication;\n readonly authorizationScope?: string;\n readonly repositories: readonly GitHubRepositoryDiscoveryRepository[];\n readonly source: string;\n}\n\nexport interface WorkspaceRepositoryAuthorization {\n readonly authentication: GitHubRepositoryAuthentication;\n readonly authorizationScope: string;\n}\n\nconst anonymousAuthorization: WorkspaceRepositoryAuthorization = {\n authentication: 'anonymous',\n authorizationScope: 'anonymous',\n};\n\n/*** Classifies client-safe runtime failures so inbound transport can select the correct HTTP status. */\nexport class WorkspaceRepositoryRuntimeError extends Error {\n public constructor(\n readonly kind: 'invalid' | 'rate-limited' | 'stale' | 'unavailable',\n message: string\n ) {\n super(message);\n }\n}\n\nconst ANALYSIS_SCHEMA_VERSION = 1;\nconst MAXIMUM_RUNTIME_WORKSPACES = 32;\n","import { inspectProjectAsync } from '@ankhorage/project-detector/node';\nimport type { ProjectInspection } from '@ankhorage/project-detector/types';\n\nconst PROJECT_PATH_ERROR_CODES: ReadonlySet<string> = new Set(['EACCES', 'ENOENT', 'ENOTDIR']);\nconst EXCLUDED_ANALYSIS_DIRECTORIES = [\n '@types',\n '.github',\n 'examples',\n 'test',\n 'tests',\n '__tests__',\n];\nconst EXCLUDED_ANALYSIS_FILES = [\n '**/*.test.*',\n '**/*.spec.*',\n '**/*_test.*',\n '**/*_spec.*',\n '**/test_*.*',\n '**/spec_*.*',\n];\n\n/*** Inspect one project through the canonical bounded filesystem owner. */\nexport async function inspectProjectForAnalysisAsync(\n projectPath: string\n): Promise<ProjectInspection> {\n try {\n const inspection = await inspectProjectAsync(projectPath, {\n excludeDirectories: EXCLUDED_ANALYSIS_DIRECTORIES,\n excludeFiles: EXCLUDED_ANALYSIS_FILES,\n });\n if (!inspection.complete) {\n throw new Error(\n `Project inspection is incomplete: ${inspection.diagnostics\n .map(diagnostic => diagnostic.message)\n .join('; ')}`\n );\n }\n return inspection;\n } catch (error) {\n if (!isProjectPathUnavailableError(error)) throw error;\n\n const projectPathError = new Error(`Invalid or unavailable project path: ${projectPath}`, {\n cause: error,\n });\n projectPathError.name = 'ProjectPathUnavailableError';\n throw projectPathError;\n }\n}\n\n/*** Identify filesystem errors that mean the configured inspection root cannot be used. */\nfunction isProjectPathUnavailableError(error: unknown): boolean {\n return (\n error instanceof Error &&\n 'code' in error &&\n typeof error.code === 'string' &&\n PROJECT_PATH_ERROR_CODES.has(error.code)\n );\n}\n","import path from 'node:path';\n\nimport type { DependencyGraph } from '@ankhorage/dependency-graph';\nimport type { ProjectInspection } from '@ankhorage/project-detector/types';\nimport { resolveFileSystemPathWithinRoot } from '@ankhorage/utility/node/fs';\n\nimport { projectDependencyImportsAsync } from '@/features/dependency-analysis/adapters/outbound/dependency-graph/projectDependencyImportsAsync';\nimport { readCppProjectFileMetadata } from '@/features/project-analysis/adapters/outbound/source-metadata/readCppProjectFileMetadata';\nimport { readDelphiProjectFileMetadata } from '@/features/project-analysis/adapters/outbound/source-metadata/readDelphiProjectFileMetadata';\nimport { readJavaProjectFileMetadata } from '@/features/project-analysis/adapters/outbound/source-metadata/readJavaProjectFileMetadata';\nimport { readKotlinProjectFileMetadata } from '@/features/project-analysis/adapters/outbound/source-metadata/readKotlinProjectFileMetadata';\nimport { readPythonProjectFileMetadata } from '@/features/project-analysis/adapters/outbound/source-metadata/readPythonProjectFileMetadata';\nimport { readTypeScriptProjectFileMetadata } from '@/features/project-analysis/adapters/outbound/source-metadata/readTypeScriptProjectFileMetadata';\nimport { Language } from '@/types/language';\nimport type {\n ProjectFileMetadata,\n ProjectFileTree,\n ProjectImportMetadata,\n} from '@/types/projectFiles';\n\ninterface ReadSourceMetadataInput {\n readonly analysisRootPath: string;\n readonly imports: readonly ProjectImportMetadata[];\n readonly language: Language;\n readonly projectPath: string;\n readonly sourceFile: string;\n}\n\n/*** Create the Atlas file tree from canonical inspection and dependency evidence. */\nexport async function createProjectFileTreeAsync(\n inspection: ProjectInspection,\n dependencyGraph: DependencyGraph,\n language: Language,\n projectPath: string\n): Promise<ProjectFileTree> {\n assertSupportedLanguage(language);\n\n const analysisRoot = analysisRootFor(inspection, language);\n const analysisRootPath = resolveFileSystemPathWithinRoot(projectPath, analysisRoot, {\n allowRoot: true,\n });\n const importsByFile = await importsForLanguageAsync(\n dependencyGraph,\n language,\n projectPath,\n analysisRootPath\n );\n const result = createProjectFileTree();\n const directories = new Map<string, ProjectFileTree>([['', result]]);\n\n for (const directory of inspection.directories) {\n const relativeDirectory = relativeToAnalysisRoot(directory, analysisRoot);\n if (relativeDirectory === undefined || relativeDirectory === '') continue;\n ensureDirectory(directories, relativeDirectory);\n }\n\n for (const sourceFile of inspection.files) {\n const relativeFile = relativeToAnalysisRoot(sourceFile, analysisRoot);\n if (\n relativeFile === undefined ||\n relativeFile === '' ||\n !isMetadataSourceFile(relativeFile, language)\n ) {\n continue;\n }\n\n const fileMetadata = readSourceMetadata({\n analysisRootPath,\n imports: importsByFile.get(relativeFile) ?? [],\n language,\n projectPath,\n sourceFile,\n });\n insertFile(directories, relativeFile, fileMetadata);\n }\n\n return result;\n}\n\n/*** Preserve the established Atlas Tree root while consuming detector-owned source-root evidence. */\nfunction analysisRootFor(inspection: ProjectInspection, language: Language): string {\n if (language === Language.TypeScript) return '.';\n return (\n inspection.detection.languages.find(candidate => candidate.id === String(language))\n ?.sourceRoots[0] ?? '.'\n );\n}\n\n/*** Convert one project-relative inventory path to the selected analysis-root-relative path. */\nfunction relativeToAnalysisRoot(inventoryPath: string, analysisRoot: string): string | undefined {\n if (analysisRoot === '.') return inventoryPath;\n if (inventoryPath === analysisRoot) return '';\n const prefix = `${analysisRoot}/`;\n return inventoryPath.startsWith(prefix) ? inventoryPath.slice(prefix.length) : undefined;\n}\n\n/*** Create one null-prototype directory and index it by relative path. */\nfunction ensureDirectory(\n directories: Map<string, ProjectFileTree>,\n relativeDirectory: string\n): ProjectFileTree {\n const existing = directories.get(relativeDirectory);\n if (existing !== undefined) return existing;\n\n const separator = relativeDirectory.lastIndexOf('/');\n const parentPath = separator < 0 ? '' : relativeDirectory.slice(0, separator);\n const directoryName = separator < 0 ? relativeDirectory : relativeDirectory.slice(separator + 1);\n const parent = ensureDirectory(directories, parentPath);\n const directory = createProjectFileTree();\n\n Object.defineProperty(parent, directoryName, {\n configurable: true,\n enumerable: true,\n value: directory,\n writable: true,\n });\n directories.set(relativeDirectory, directory);\n return directory;\n}\n\n/*** Insert one file beneath its inventoried relative parent directory. */\nfunction insertFile(\n directories: Map<string, ProjectFileTree>,\n relativeFile: string,\n fileMetadata: ProjectFileMetadata\n): void {\n const separator = relativeFile.lastIndexOf('/');\n const parentPath = separator < 0 ? '' : relativeFile.slice(0, separator);\n const fileName = separator < 0 ? relativeFile : relativeFile.slice(separator + 1);\n const parent = ensureDirectory(directories, parentPath);\n\n Object.defineProperty(parent, fileName, {\n configurable: true,\n enumerable: true,\n value: fileMetadata,\n writable: true,\n });\n}\n\n/*** Create a dictionary-shaped Tree node without Object prototype keys. */\nfunction createProjectFileTree(): ProjectFileTree {\n return Object.setPrototypeOf({}, null) as ProjectFileTree;\n}\n\n/*** Project canonical dependency evidence into the existing audit/file metadata shape. */\nasync function importsForLanguageAsync(\n dependencyGraph: DependencyGraph,\n language: Language,\n projectPath: string,\n analysisRootPath: string\n): Promise<ReadonlyMap<string, readonly ProjectImportMetadata[]>> {\n switch (language) {\n case Language.TypeScript:\n return projectDependencyImportsAsync(dependencyGraph, projectPath);\n case Language.Java:\n case Language.Cpp:\n return projectDependencyImportsAsync(\n dependencyGraph,\n projectPath,\n analysisRootPath,\n 'specifier'\n );\n case Language.Kotlin:\n return projectDependencyImportsAsync(\n dependencyGraph,\n projectPath,\n analysisRootPath,\n 'specifier',\n 'kotlin-standard-library'\n );\n case Language.Python:\n return projectDependencyImportsAsync(\n dependencyGraph,\n projectPath,\n analysisRootPath,\n 'specifier',\n 'python-legacy'\n );\n case Language.Delphi:\n return projectDependencyImportsAsync(\n dependencyGraph,\n projectPath,\n analysisRootPath,\n 'specifier',\n 'delphi-standard-library'\n );\n default:\n return new Map();\n }\n}\n\n/*** Read one source file through the language-specific Atlas metadata adapter. */\nfunction readSourceMetadata(input: ReadSourceMetadataInput): ProjectFileMetadata {\n const fullPath = resolveFileSystemPathWithinRoot(input.projectPath, input.sourceFile);\n switch (input.language) {\n case Language.Java:\n return readJavaProjectFileMetadata(fullPath, input.analysisRootPath, input.imports);\n case Language.TypeScript:\n return readTypeScriptProjectFileMetadata(fullPath, input.analysisRootPath, input.imports);\n case Language.Cpp:\n return readCppProjectFileMetadata(fullPath, input.analysisRootPath, input.imports);\n case Language.Python:\n return readPythonProjectFileMetadata(fullPath, input.analysisRootPath, input.imports);\n case Language.Delphi:\n return readDelphiProjectFileMetadata(fullPath, input.analysisRootPath, input.imports);\n case Language.Kotlin:\n return readKotlinProjectFileMetadata(fullPath, input.analysisRootPath, input.imports);\n default:\n throw new Error(`Unsupported parser language: ${input.language}`);\n }\n}\n\n/*** Keep Atlas export metadata limited to the source extensions it currently serializes. */\nfunction isMetadataSourceFile(relativeFile: string, language: Language): boolean {\n const extension = path.extname(relativeFile).toLowerCase();\n switch (language) {\n case Language.Java:\n return extension === '.java';\n case Language.TypeScript:\n return extension === '.ts' || extension === '.tsx';\n case Language.Cpp:\n return ['.cpp', '.cc', '.cxx', '.h', '.hpp', '.hxx'].includes(extension);\n case Language.Python:\n return extension === '.py';\n case Language.Delphi:\n return ['.pas', '.pp', '.dpr'].includes(extension);\n case Language.Kotlin:\n return extension === '.kt' || extension === '.kts';\n default:\n return false;\n }\n}\n\n/*** Fail before metadata projection when Atlas has no compatible export reader. */\nfunction assertSupportedLanguage(language: Language): void {\n if (\n ![\n Language.Java,\n Language.TypeScript,\n Language.Cpp,\n Language.Python,\n Language.Delphi,\n Language.Kotlin,\n ].includes(language)\n ) {\n throw new Error(\n \"Supported language is 'Java', 'TypeScript', 'C++', 'Python', 'Delphi' & 'Kotlin'. More to follow.\"\n );\n }\n}\n","import { readFile } from 'node:fs/promises';\nimport path from 'node:path';\n\nimport type {\n DependencyGraph,\n DependencyGraphNodeData,\n DependencyImportEvidence,\n} from '@ankhorage/dependency-graph';\nimport { resolveFileSystemPathWithinRoot } from '@ankhorage/utility/node/fs';\nimport { toPortablePath } from '@ankhorage/utility/node/path';\n\nimport type { ProjectImportMetadata } from '@/types/projectFiles';\n\ninterface OrderedImport {\n readonly definition: ProjectImportMetadata;\n readonly position: number;\n readonly ordinal: number;\n}\n\ninterface AppendEvidenceInput {\n readonly analysisRoot: string;\n readonly evidence: DependencyImportEvidence;\n readonly importNameMode: ImportNameMode;\n readonly imports: Map<string, OrderedImport[]>;\n readonly intrinsicMode: ImportIntrinsicMode;\n readonly ordinal: number;\n readonly pkg: string;\n readonly projectRoot: string;\n readonly sourceTextByFile: Map<string, Promise<string>>;\n}\n\n/*** Project Atlas import metadata from one canonical dependency graph without rescanning source. */\nexport async function projectDependencyImportsAsync(\n graph: DependencyGraph,\n projectRoot: string,\n analysisRoot: string = projectRoot,\n importNameMode: ImportNameMode = 'package',\n intrinsicMode: ImportIntrinsicMode = 'canonical'\n): Promise<ReadonlyMap<string, readonly ProjectImportMetadata[]>> {\n const canonicalProjectRoot = resolveFileSystemPathWithinRoot(projectRoot, '.', {\n allowRoot: true,\n });\n const canonicalAnalysisRoot = resolveFileSystemPathWithinRoot(\n canonicalProjectRoot,\n resolveFileSystemPathWithinRoot(analysisRoot, '.', { allowRoot: true }),\n { allowRoot: true }\n );\n const nodes = new Map(graph.nodes.map(node => [node.id, node.data] as const));\n const imports = new Map<string, OrderedImport[]>();\n const sourceTextByFile = new Map<string, Promise<string>>();\n let ordinal = 0;\n\n for (const edge of graph.edges) {\n const target = nodes.get(edge.target);\n if (target === undefined) {\n throw new Error(`Missing dependency-graph target node: ${edge.target}`);\n }\n\n const pkg = targetPackage(target);\n for (const evidence of edge.data.evidence) {\n if (pkg === '') continue;\n ordinal = await appendEvidenceAsync({\n analysisRoot: canonicalAnalysisRoot,\n evidence,\n importNameMode,\n imports,\n intrinsicMode,\n ordinal,\n pkg,\n projectRoot: canonicalProjectRoot,\n sourceTextByFile,\n });\n }\n }\n\n return materializeImports(imports);\n}\n\ntype ImportNameMode = 'package' | 'specifier';\ntype ImportIntrinsicMode =\n 'canonical' | 'delphi-standard-library' | 'kotlin-standard-library' | 'python-legacy';\n\n/*** Add one canonical evidence item while retaining the original source declaration position. */\nasync function appendEvidenceAsync(input: AppendEvidenceInput): Promise<number> {\n const absoluteSourceFile = path.resolve(input.projectRoot, input.evidence.sourceFile);\n const sourceFile = toPortablePath(path.relative(input.analysisRoot, absoluteSourceFile));\n const sourceText = await readSourceTextAsync(input.sourceTextByFile, absoluteSourceFile);\n const current = input.imports.get(sourceFile) ?? [];\n\n current.push({\n definition: {\n name: input.importNameMode === 'specifier' ? input.evidence.specifier : input.pkg,\n pkg: input.pkg,\n isIntrinsic: isIntrinsicImport(input.evidence, input.intrinsicMode),\n },\n position: sourceText.indexOf(input.evidence.specifier),\n ordinal: input.ordinal,\n });\n input.imports.set(sourceFile, current);\n return input.ordinal + 1;\n}\n\n/*** Convert collected import evidence into source-order Atlas definitions. */\nfunction materializeImports(\n imports: ReadonlyMap<string, readonly OrderedImport[]>\n): ReadonlyMap<string, readonly ProjectImportMetadata[]> {\n return new Map(\n [...imports].map(([sourceFile, entries]) => [\n sourceFile,\n [...entries]\n .sort((left, right) => {\n const leftPosition = left.position < 0 ? Number.MAX_SAFE_INTEGER : left.position;\n const rightPosition = right.position < 0 ? Number.MAX_SAFE_INTEGER : right.position;\n return leftPosition - rightPosition || left.ordinal - right.ordinal;\n })\n .map(({ definition }) => definition),\n ])\n );\n}\n\n/*** Read source content once so adapter output preserves source declaration order. */\nfunction readSourceTextAsync(\n cache: Map<string, Promise<string>>,\n sourceFile: string\n): Promise<string> {\n const cached = cache.get(sourceFile);\n if (cached !== undefined) return cached;\n\n const sourceText = readOptionalSourceTextAsync(sourceFile);\n cache.set(sourceFile, sourceText);\n return sourceText;\n}\n\n/*** Keep missing evidence source files in canonical order instead of failing projection. */\nasync function readOptionalSourceTextAsync(sourceFile: string): Promise<string> {\n try {\n return await readFile(sourceFile, 'utf8');\n } catch (error) {\n if (error instanceof Error && 'code' in error && error.code === 'ENOENT') return '';\n throw error;\n }\n}\n\n/*** Preserve Atlas presentation semantics independently from canonical graph classification. */\nfunction isIntrinsicImport(evidence: DependencyImportEvidence, mode: ImportIntrinsicMode): boolean {\n if (mode === 'canonical') {\n return evidence.classification === 'intrinsic' || evidence.classification === 'focus';\n }\n if (mode === 'python-legacy') return evidence.specifier.startsWith('.');\n if (mode === 'delphi-standard-library') {\n return (\n evidence.specifier.startsWith('System.') ||\n evidence.specifier.startsWith('Vcl.') ||\n evidence.specifier.startsWith('FMX.') ||\n evidence.specifier.startsWith('Data.') ||\n evidence.specifier.startsWith('Web.')\n );\n }\n\n return (\n evidence.specifier.startsWith('kotlin.') ||\n evidence.specifier.startsWith('java.') ||\n evidence.specifier.startsWith('javax.')\n );\n}\n\n/*** Map canonical dependency nodes to the package notation retained in parser metadata. */\nfunction targetPackage(target: DependencyGraphNodeData): string {\n if (target.kind === 'module') return target.path ?? '';\n if (target.classification === 'intrinsic' && target.focus && target.path === '.') return '';\n return target.packageName ?? target.label;\n}\n","import type { Graph, GraphId } from '../../../types/graph.js';\nimport { createGraph } from './createGraph.js';\n\n/*** Reverse every directed edge while preserving identities and metadata. */\nexport function reverseGraph<\n NodeData,\n EdgeData,\n NodeId extends GraphId = string,\n EdgeId extends GraphId = NodeId,\n>(graph: Graph<NodeData, EdgeData, NodeId, EdgeId>): Graph<NodeData, EdgeData, NodeId, EdgeId> {\n return createGraph({\n nodes: graph.nodes,\n edges: graph.edges.map((edge) => ({\n ...edge,\n source: edge.target,\n target: edge.source,\n })),\n });\n}\n","import type { SourceGraph, SourceNodeData } from '@ankhorage/dependency-graph';\n\nimport type {\n ArchitectureDetectionEvidence,\n ArchitectureRoleAssignment,\n} from '../../../types/architectureAnalysis.js';\nimport type { ArchitectureModel } from '../../../types/architectureModel.js';\n\ntype RoleHints = ReadonlyMap<string, readonly string[]>;\n\nconst ROLE_HINTS = new Map<ArchitectureModel['id'], RoleHints>([\n [\n 'hexagonal',\n new Map([\n ['core', ['application', 'core', 'domain', 'service', 'usecase']],\n ['port', ['gateway', 'interface', 'port', 'repository']],\n [\n 'adapter',\n [\n 'adapter',\n 'client',\n 'controller',\n 'database',\n 'http',\n 'infra',\n 'infrastructure',\n 'persistence',\n ],\n ],\n ['composition', ['bootstrap', 'composition', 'container', 'wiring']],\n ]),\n ],\n [\n 'clean',\n new Map([\n ['entity', ['domain', 'entities', 'entity', 'model']],\n ['use-case', ['application', 'interactor', 'service', 'usecase']],\n ['interface-adapter', ['adapter', 'controller', 'gateway', 'mapper', 'presenter']],\n [\n 'framework',\n ['database', 'framework', 'http', 'infra', 'infrastructure', 'persistence', 'web'],\n ],\n ['composition', ['bootstrap', 'composition', 'container', 'wiring']],\n ]),\n ],\n [\n 'onion',\n new Map([\n ['domain-model', ['domain', 'entity', 'model', 'value']],\n ['domain-service', ['domainservice', 'policy', 'service']],\n ['application-service', ['application', 'applicationservice', 'usecase']],\n ['infrastructure', ['database', 'infra', 'infrastructure', 'persistence', 'repository']],\n ['presentation', ['api', 'controller', 'http', 'presentation', 'ui', 'web']],\n ['composition', ['bootstrap', 'composition', 'container', 'wiring']],\n ]),\n ],\n [\n 'layered',\n new Map([\n ['presentation', ['api', 'controller', 'http', 'presentation', 'ui', 'web']],\n ['domain', ['application', 'business', 'domain', 'service']],\n ['data-source', ['dao', 'data', 'database', 'db', 'persistence', 'repository']],\n ['composition', ['bootstrap', 'composition', 'container', 'wiring']],\n ]),\n ],\n]);\n\nconst OUTER_ROLES = new Map<ArchitectureModel['id'], ReadonlySet<string>>([\n ['hexagonal', new Set(['adapter', 'composition'])],\n ['clean', new Set(['framework', 'interface-adapter', 'composition'])],\n ['onion', new Set(['infrastructure', 'presentation', 'composition'])],\n ['layered', new Set(['data-source', 'presentation', 'composition'])],\n]);\n\n/*** Infer semantic model roles from generic source facts while keeping path names weak evidence. */\nexport function inferArchitectureRoles(\n graph: SourceGraph,\n model: ArchitectureModel,\n): readonly ArchitectureRoleAssignment[] {\n const implementedTargets = new Set(\n graph.graph.edges.filter(({ data }) => data.kind === 'implements').map(({ target }) => target),\n );\n const implementingSources = new Set(\n graph.graph.edges.filter(({ data }) => data.kind === 'implements').map(({ source }) => source),\n );\n const nodeById = new Map(graph.graph.nodes.map((node) => [node.id, node.data]));\n const vendorImportSources = new Set(\n graph.graph.edges\n .filter(({ data }) => data.kind === 'imports')\n .filter(({ target }) => nodeById.get(target)?.classification === 'vendor')\n .map(({ source }) => source),\n );\n\n return graph.graph.nodes.flatMap((node) =>\n inferNodeRole(\n node.id,\n node.data,\n model,\n implementedTargets,\n implementingSources,\n vendorImportSources,\n ),\n );\n}\n\n/*** Infer at most one best role for one semantic source node. */\nfunction inferNodeRole(\n nodeId: number,\n node: SourceNodeData,\n model: ArchitectureModel,\n implementedTargets: ReadonlySet<number>,\n implementingSources: ReadonlySet<number>,\n vendorImportSources: ReadonlySet<number>,\n): readonly ArchitectureRoleAssignment[] {\n if (!isRoleCandidate(node)) return [];\n const ranked = model.roles\n .map(({ id }) =>\n scoreRole(\n nodeId,\n node,\n model.id,\n id,\n implementedTargets,\n implementingSources,\n vendorImportSources,\n ),\n )\n .sort((left, right) => right.score - left.score || compareText(left.roleId, right.roleId));\n const [best, secondBest] = ranked;\n if (best === undefined || best.score < 0.3) return [];\n const ambiguityPenalty = Math.max(0, 0.15 - Math.max(0, best.score - (secondBest?.score ?? 0)));\n return [\n {\n semanticPath: node.semanticPath,\n roleId: best.roleId,\n confidence: round(Math.max(0, Math.min(1, best.score - ambiguityPenalty))),\n evidence: best.evidence,\n },\n ];\n}\n\n/*** Score one role using weak naming evidence plus language-neutral topology facts. */\nfunction scoreRole(\n nodeId: number,\n node: SourceNodeData,\n modelId: ArchitectureModel['id'],\n roleId: string,\n implementedTargets: ReadonlySet<number>,\n implementingSources: ReadonlySet<number>,\n vendorImportSources: ReadonlySet<number>,\n): {\n readonly evidence: readonly ArchitectureDetectionEvidence[];\n readonly roleId: string;\n readonly score: number;\n} {\n const tokens = semanticTokens(node);\n const hints = ROLE_HINTS.get(modelId)?.get(roleId) ?? [];\n const matchedHints = hints.filter((hint) => tokens.has(hint));\n const pathScore = Math.min(0.55, matchedHints.length * 0.32);\n const evidence: ArchitectureDetectionEvidence[] = matchedHints.map((hint) => ({\n kind: 'path',\n semanticPath: node.semanticPath,\n message: `Semantic name/path contains architecture hint \"${hint}\".`,\n weight: 0.32,\n }));\n const topology = topologyScore(\n nodeId,\n node,\n modelId,\n roleId,\n implementedTargets,\n implementingSources,\n vendorImportSources,\n );\n\n return {\n roleId,\n score: Math.min(1, pathScore + topology.score),\n evidence: [...evidence, ...topology.evidence],\n };\n}\n\n/*** Add stronger graph-structural evidence without branching on source language. */\nfunction topologyScore(\n nodeId: number,\n node: SourceNodeData,\n modelId: ArchitectureModel['id'],\n roleId: string,\n implementedTargets: ReadonlySet<number>,\n implementingSources: ReadonlySet<number>,\n vendorImportSources: ReadonlySet<number>,\n): { readonly evidence: readonly ArchitectureDetectionEvidence[]; readonly score: number } {\n const evidence: ArchitectureDetectionEvidence[] = [];\n let score = 0;\n\n if (\n modelId === 'hexagonal' &&\n roleId === 'port' &&\n node.kind === 'interface' &&\n implementedTargets.has(nodeId)\n ) {\n score += 0.45;\n evidence.push({\n kind: 'topology',\n semanticPath: node.semanticPath,\n message: 'Interface is implemented by another source node, supporting a port role.',\n weight: 0.45,\n });\n }\n if (modelId === 'hexagonal' && roleId === 'adapter' && implementingSources.has(nodeId)) {\n score += 0.3;\n evidence.push({\n kind: 'topology',\n semanticPath: node.semanticPath,\n message: 'Source node implements an interface, supporting an adapter role.',\n weight: 0.3,\n });\n }\n if (isOuterRole(modelId, roleId) && vendorImportSources.has(nodeId)) {\n score += 0.25;\n evidence.push({\n kind: 'dependency',\n semanticPath: node.semanticPath,\n message: 'Source node directly imports vendor code, supporting an outer-boundary role.',\n weight: 0.25,\n });\n }\n\n return { score, evidence };\n}\n\n/*** Keep architecture inference on internal executable/declaration nodes rather than containers/vendors. */\nfunction isRoleCandidate(node: SourceNodeData): boolean {\n if (node.classification === 'vendor') return false;\n return (\n node.kind === 'file' ||\n node.kind === 'class' ||\n node.kind === 'interface' ||\n node.kind === 'function' ||\n node.kind === 'type'\n );\n}\n\n/*** Normalize semantic identifiers into language-neutral hint tokens. */\nfunction semanticTokens(node: SourceNodeData): ReadonlySet<string> {\n const raw = [node.semanticPath, node.name, node.path, node.filePath]\n .filter((value): value is string => value !== undefined)\n .join(' ');\n return new Set(\n raw\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .toLowerCase()\n .split(/[^a-z0-9]+/)\n .filter(Boolean)\n .flatMap(expandToken),\n );\n}\n\n/*** Preserve raw tokens and add simple singular variants for common directory naming. */\nfunction expandToken(token: string): readonly string[] {\n if (token.endsWith('ies') && token.length > 3) return [token, `${token.slice(0, -3)}y`];\n if (token.endsWith('s') && !token.endsWith('ss') && token.length > 3) {\n return [token, token.slice(0, -1)];\n }\n return [token];\n}\n\n/*** Identify model roles expected to sit near external technology. */\nfunction isOuterRole(modelId: ArchitectureModel['id'], roleId: string): boolean {\n return OUTER_ROLES.get(modelId)?.has(roleId) ?? false;\n}\n\n/*** Stabilize serializable confidence values for deterministic consumers. */\nfunction round(value: number): number {\n return Math.round(value * 1000) / 1000;\n}\n\n/*** Compare stable identifiers by code units instead of locale-sensitive collation. */\nfunction compareText(left: string, right: string): number {\n return left < right ? -1 : left > right ? 1 : 0;\n}\n","import type {\n ArchitectureModel,\n ArchitectureRoleDependency,\n} from '../../../types/architectureModel.js';\n\nexport const ARCHITECTURE_MODELS: readonly ArchitectureModel[] = [\n {\n id: 'hexagonal',\n name: 'Hexagonal / Ports and Adapters',\n reference: 'https://alistair.cockburn.us/hexagonal-architecture',\n interpretation:\n 'Application behavior communicates through purposeful ports; adapters translate external mechanisms. Composition selects adapters outside the application.',\n roles: [\n { id: 'core', description: 'Application behavior independent from external devices.' },\n { id: 'port', description: 'Application-owned conversation contract.' },\n { id: 'adapter', description: 'Technology-specific translation at a port.' },\n { id: 'composition', description: 'Outer wiring of concrete adapters.' },\n ],\n allowedDependencies: dependencies(\n ['core', 'port', 'adapter', 'composition'],\n [\n ['core', 'port'],\n ['port', 'core'],\n ['adapter', 'core'],\n ['adapter', 'port'],\n ['composition', 'core'],\n ['composition', 'port'],\n ['composition', 'adapter'],\n ],\n ),\n },\n {\n id: 'clean',\n name: 'Clean Architecture',\n reference: 'https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html',\n interpretation:\n 'Static source dependencies point inward from frameworks and interface adapters through use cases toward entities.',\n roles: [\n { id: 'entity', description: 'Enterprise business rules.' },\n { id: 'use-case', description: 'Application-specific business rules.' },\n {\n id: 'interface-adapter',\n description: 'Translation between use cases and external interfaces.',\n },\n { id: 'framework', description: 'External frameworks, devices, and infrastructure.' },\n { id: 'composition', description: 'Outermost assembly of concrete components.' },\n ],\n allowedDependencies: concentricDependencies([\n 'entity',\n 'use-case',\n 'interface-adapter',\n 'framework',\n 'composition',\n ]),\n },\n {\n id: 'onion',\n name: 'Onion Architecture',\n reference: 'https://jeffreypalermo.com/2008/07/the-onion-architecture-part-1/',\n interpretation:\n 'Domain model and services form the core. Application behavior, infrastructure implementations, and presentation depend toward that core.',\n roles: [\n { id: 'domain-model', description: 'Domain entities and value rules.' },\n { id: 'domain-service', description: 'Domain behavior coordinating model concepts.' },\n { id: 'application-service', description: 'Application workflow around the domain.' },\n { id: 'infrastructure', description: 'External persistence and technical implementations.' },\n { id: 'presentation', description: 'External user or program interface.' },\n { id: 'composition', description: 'Outermost assembly of concrete components.' },\n ],\n allowedDependencies: dependencies(\n [\n 'domain-model',\n 'domain-service',\n 'application-service',\n 'infrastructure',\n 'presentation',\n 'composition',\n ],\n [\n ['domain-service', 'domain-model'],\n ['application-service', 'domain-model'],\n ['application-service', 'domain-service'],\n ['infrastructure', 'domain-model'],\n ['infrastructure', 'domain-service'],\n ['infrastructure', 'application-service'],\n ['presentation', 'domain-model'],\n ['presentation', 'domain-service'],\n ['presentation', 'application-service'],\n ['composition', 'domain-model'],\n ['composition', 'domain-service'],\n ['composition', 'application-service'],\n ['composition', 'infrastructure'],\n ['composition', 'presentation'],\n ],\n ),\n },\n {\n id: 'layered',\n name: 'Layered / N-Tier Architecture',\n reference: 'https://martinfowler.com/bliki/PresentationDomainDataLayering.html',\n interpretation:\n 'The initial strict variant follows presentation to domain to data source; domain-to-data-source coupling distinguishes it from inward-dependency models.',\n roles: [\n { id: 'presentation', description: 'Interaction and display concerns.' },\n { id: 'domain', description: 'Business logic and application behavior.' },\n { id: 'data-source', description: 'Persistence and external service access.' },\n { id: 'composition', description: 'Assembly of the layers.' },\n ],\n allowedDependencies: dependencies(\n ['presentation', 'domain', 'data-source', 'composition'],\n [\n ['presentation', 'domain'],\n ['domain', 'data-source'],\n ['composition', 'presentation'],\n ['composition', 'domain'],\n ['composition', 'data-source'],\n ],\n ),\n },\n];\n\n/*** Include same-role coupling and the model's explicit cross-role direction. */\nfunction dependencies(\n roles: readonly string[],\n pairs: readonly (readonly [string, string])[],\n): readonly ArchitectureRoleDependency[] {\n return [\n ...roles.map((role) => ({ source: role, target: role })),\n ...pairs.map(([source, target]) => ({ source, target })),\n ];\n}\n\n/*** Allow outer Clean Architecture rings to depend on equal or inner rings. */\nfunction concentricDependencies(roles: readonly string[]): readonly ArchitectureRoleDependency[] {\n return roles.flatMap((source, index) =>\n roles.slice(0, index + 1).map((target) => ({ source, target })),\n );\n}\n","unable to read source [project]/node_modules/@ankhorage/repository/src/providers/github/services/materializeGitHubRepositoryWithGatewayAsync.ts","import { isRecord } from '@ankhorage/utility/object';\n\nimport type { SourceGraph } from '../../../types/sourceGraph.js';\n\ninterface PackedSourceGraph {\n readonly version: 1;\n readonly strings: readonly string[];\n readonly data: unknown;\n}\n\n/*** Intern repeated source strings while retaining a lossless JSON interchange format. */\nexport function serializeSourceGraph(sourceGraph: SourceGraph): string {\n const strings: string[] = [];\n const ids = new Map<string, number>();\n const data = transform(sourceGraph, (value) => {\n let id = ids.get(value);\n if (id === undefined) {\n id = strings.length;\n strings.push(value);\n ids.set(value, id);\n }\n return `#${id}`;\n });\n return JSON.stringify({ version: 1, strings, data } satisfies PackedSourceGraph);\n}\n\n/*** Restore the complete factual graph before constructing any derived index. */\nexport function deserializeSourceGraph(serialized: string): SourceGraph {\n const packed: unknown = JSON.parse(serialized);\n if (!isPackedSourceGraph(packed)) throw new Error('Invalid source graph serialization.');\n const data = transform(packed.data, (value) => {\n if (!/^#\\d+$/u.test(value)) throw new Error('Invalid source graph string reference.');\n const restored = packed.strings[Number(value.slice(1))];\n if (restored === undefined) throw new Error('Unknown source graph string reference.');\n return restored;\n });\n if (!isSourceGraph(data)) throw new Error('Invalid source graph payload.');\n return data;\n}\n\n/*** Traverse plain JSON values and intern repeated keys as well as string values. */\nfunction transform(value: unknown, mapString: (value: string) => string): unknown {\n if (typeof value === 'string') return mapString(value);\n if (Array.isArray(value)) return value.map((item) => transform(item, mapString));\n if (isRecord(value)) {\n return Object.fromEntries(\n Object.entries(value).map(([key, item]) => [mapString(key), transform(item, mapString)]),\n );\n }\n return value;\n}\n\n/*** Validate the envelope before decoding dictionary references. */\nfunction isPackedSourceGraph(value: unknown): value is PackedSourceGraph {\n if (!isRecord(value)) return false;\n const { version, strings } = value;\n return (\n version === 1 && Array.isArray(strings) && strings.every((item) => typeof item === 'string')\n );\n}\n\n/*** Check the portable graph envelope after restoration. */\nfunction isSourceGraph(value: unknown): value is SourceGraph {\n if (!isRecord(value)) return false;\n const { version, graph, capabilities } = value;\n if (!isRecord(graph)) return false;\n return (\n version === 1 &&\n Array.isArray(capabilities) &&\n Array.isArray(graph.nodes) &&\n Array.isArray(graph.edges)\n );\n}\n","import { isRecord } from '@ankhorage/utility/object';\n\nimport type {\n JsonValue,\n Rule,\n RulesConfig,\n RulesConfigDiagnostic,\n RulesConfigRule,\n RulesConfigValidationOptions,\n RulesConfigValidationResult,\n RuleSeverity,\n} from '../../../types/rules.js';\n\n/*** Validate canonical rules.json data, optionally against a concrete rule registry. */\nexport function validateRulesConfig<TContext>(\n value: unknown,\n options: RulesConfigValidationOptions<TContext> = {},\n): RulesConfigValidationResult {\n const structuralResult = validateRulesConfigStructure(value);\n if (structuralResult.config === null) return structuralResult;\n\n const diagnostics = validateConfiguredRules(structuralResult.config, options);\n return {\n config: diagnostics.length === 0 ? structuralResult.config : null,\n diagnostics,\n };\n}\n\n/*** Validate the JSON-only shape before any provider-specific interpretation occurs. */\nfunction validateRulesConfigStructure(value: unknown): RulesConfigValidationResult {\n if (!isRecord(value)) return invalidConfig('rules.json must contain an object.');\n if (value.version !== 1) return invalidConfig('rules.json \"version\" must be 1.', 'version');\n if (!Array.isArray(value.rules)) {\n return invalidConfig('rules.json \"rules\" must be an array.', 'rules');\n }\n\n const ruleResults = value.rules.map((rule, index) => validateRulesConfigRule(rule, index));\n const diagnostics = ruleResults.flatMap((result) => result.diagnostics);\n if (diagnostics.length > 0) return { config: null, diagnostics };\n\n const rules = ruleResults.flatMap((result) => (result.rule === null ? [] : [result.rule]));\n const duplicateIds = findDuplicateRuleIds(rules);\n if (duplicateIds.length > 0) {\n return {\n config: null,\n diagnostics: duplicateIds.map((id) => ({\n code: 'invalid-rule-id',\n message: `rules.json configures rule \"${id}\" more than once.`,\n path: 'rules',\n ruleId: id,\n })),\n };\n }\n\n return { config: { version: 1, rules }, diagnostics: [] };\n}\n\n/*** Validate one serialized rule selection while retaining its original options exactly. */\nfunction validateRulesConfigRule(\n value: unknown,\n index: number,\n): {\n readonly diagnostics: readonly RulesConfigDiagnostic[];\n readonly rule: RulesConfigRule | null;\n} {\n const path = `rules[${index}]`;\n if (!isRecord(value)) {\n return invalidRuleField('invalid-config', path, 'must be an object.');\n }\n if (!isNonEmptyString(value.id)) {\n return invalidRuleField('invalid-rule-id', `${path}.id`, 'must define a non-empty \"id\".');\n }\n if (typeof value.enabled !== 'boolean') {\n return invalidRuleField(\n 'invalid-config',\n `${path}.enabled`,\n 'must define boolean \"enabled\".',\n value.id,\n );\n }\n if (value.severity !== undefined && !isRuleSeverity(value.severity)) {\n return invalidRuleField(\n 'invalid-severity',\n `${path}.severity`,\n 'has an invalid \"severity\".',\n value.id,\n );\n }\n if (value.options !== undefined && !isJsonValue(value.options)) {\n return invalidRuleField(\n 'invalid-options',\n `${path}.options`,\n 'has non-serializable \"options\".',\n value.id,\n );\n }\n\n return {\n diagnostics: [],\n rule: {\n id: value.id,\n enabled: value.enabled,\n ...(value.severity === undefined ? {} : { severity: value.severity }),\n ...(value.options === undefined ? {} : { options: value.options }),\n },\n };\n}\n\n/*** Apply optional registry and capability knowledge without creating provider-specific engine paths. */\nfunction validateConfiguredRules<TContext>(\n config: RulesConfig,\n options: RulesConfigValidationOptions<TContext>,\n): readonly RulesConfigDiagnostic[] {\n const { registry } = options;\n if (registry === undefined) return [];\n\n const availableCapabilities = new Set(options.capabilities ?? []);\n return config.rules.reduce<RulesConfigDiagnostic[]>((diagnostics, configuredRule, index) => {\n if (!configuredRule.enabled) return diagnostics;\n const rule = registry.ruleById.get(configuredRule.id);\n if (rule === undefined) {\n return [\n ...diagnostics,\n {\n code: 'unknown-rule' as const,\n message: `rules.json configures unknown rule \"${configuredRule.id}\".`,\n path: `rules[${index}].id`,\n ruleId: configuredRule.id,\n },\n ];\n }\n\n const missingCapabilities =\n options.capabilities === undefined\n ? []\n : (rule.requiredCapabilities ?? []).filter(\n (capability) => !availableCapabilities.has(capability),\n );\n const capabilityDiagnostics = missingCapabilities.map((capability) => ({\n code: 'missing-capability' as const,\n message: `Rule \"${rule.identity.id}\" requires unavailable capability \"${capability}\".`,\n path: `rules[${index}]`,\n ruleId: rule.identity.id,\n }));\n const optionDiagnostics = validateConfiguredRuleOptions(rule, configuredRule, index);\n return [...diagnostics, ...capabilityDiagnostics, ...optionDiagnostics];\n }, []);\n}\n\n/*** Translate provider option validation into deterministic configuration diagnostics. */\nfunction validateConfiguredRuleOptions<TContext>(\n rule: Rule<TContext>,\n configuredRule: RulesConfigRule,\n index: number,\n): readonly RulesConfigDiagnostic[] {\n try {\n return (rule.validateOptions?.(configuredRule.options) ?? []).map((diagnostic) => ({\n code: 'invalid-options' as const,\n message: `Rule \"${rule.identity.id}\": ${diagnostic.message}`,\n ruleId: rule.identity.id,\n ...(diagnostic.path === undefined\n ? {}\n : { path: `rules[${index}].options.${diagnostic.path}` }),\n }));\n } catch {\n return [\n {\n code: 'rule-error',\n message: `Rule \"${rule.identity.id}\" threw while validating its options.`,\n path: `rules[${index}].options`,\n ruleId: rule.identity.id,\n },\n ];\n }\n}\n\n/*** Create a consistent structural configuration diagnostic. */\nfunction invalidConfig(message: string, path?: string): RulesConfigValidationResult {\n return {\n config: null,\n diagnostics: [{ code: 'invalid-config', message, ...(path === undefined ? {} : { path }) }],\n };\n}\n\n/*** Create a field-specific diagnostic for one invalid configured rule. */\nfunction invalidRuleField(\n code: RulesConfigDiagnostic['code'],\n path: string,\n detail: string,\n ruleId?: string,\n): { readonly diagnostics: readonly RulesConfigDiagnostic[]; readonly rule: null } {\n return {\n rule: null,\n diagnostics: [\n {\n code,\n message: `rules.json ${path} ${detail}`,\n path,\n ...(ruleId === undefined ? {} : { ruleId }),\n },\n ],\n };\n}\n\n/*** Find duplicate explicit rule selections without relying on object-key ordering. */\nfunction findDuplicateRuleIds(rules: readonly RulesConfigRule[]): readonly string[] {\n const seen = new Set<string>();\n return rules.flatMap((rule) => {\n if (seen.has(rule.id)) return [rule.id];\n seen.add(rule.id);\n return [];\n });\n}\n\n/*** Determine whether a value is a supported generic severity. */\nfunction isRuleSeverity(value: unknown): value is RuleSeverity {\n return value === 'error' || value === 'info' || value === 'warning';\n}\n\n/*** Determine whether a value can be preserved losslessly in JSON configuration. */\nfunction isJsonValue(value: unknown): value is JsonValue {\n if (value === null || typeof value === 'boolean' || typeof value === 'string') return true;\n if (typeof value === 'number') return Number.isFinite(value);\n if (Array.isArray(value)) return value.every(isJsonValue);\n return isRecord(value) && Object.values(value).every(isJsonValue);\n}\n\n/*** Determine whether a raw configuration field is a non-empty identifier. */\nfunction isNonEmptyString(value: unknown): value is string {\n return typeof value === 'string' && value.trim().length > 0;\n}\n","import { lstatSync, realpathSync } from 'node:fs';\nimport path from 'node:path';\n\n/*** Resolves a filesystem path beneath a root while rejecting lexical and symlink escapes. */\nexport function resolveFileSystemPathWithinRoot(\n rootPath: string,\n filePath: string,\n options: { readonly allowRoot?: boolean } = {},\n): string {\n const lexicalRoot = path.resolve(rootPath);\n const lexicalTarget = path.isAbsolute(filePath)\n ? path.resolve(filePath)\n : path.resolve(lexicalRoot, filePath);\n\n assertContainedPath(lexicalRoot, lexicalTarget, filePath, options.allowRoot === true);\n\n const realRoot = realpathSync(lexicalRoot);\n const existingAncestor = findExistingAncestor(lexicalTarget);\n const realAncestor = realpathSync(existingAncestor);\n assertContainedPath(realRoot, realAncestor, filePath, true);\n\n const resolvedTarget = path.resolve(realAncestor, path.relative(existingAncestor, lexicalTarget));\n assertContainedPath(realRoot, resolvedTarget, filePath, options.allowRoot === true);\n\n return resolvedTarget;\n}\n\n/*** Rejects paths outside the root and optionally rejects the root path itself. */\nfunction assertContainedPath(\n rootPath: string,\n targetPath: string,\n inputPath: string,\n allowRoot: boolean,\n): void {\n const relativePath = path.relative(rootPath, targetPath);\n const isRoot = relativePath.length === 0;\n const escapesRoot =\n relativePath === '..' ||\n relativePath.startsWith(`..${path.sep}`) ||\n path.isAbsolute(relativePath);\n\n if (escapesRoot || (isRoot && !allowRoot)) {\n throw new Error(`Path escaped the allowed root: ${inputPath}`);\n }\n}\n\n/*** Finds the nearest existing path so symlink ancestry can be resolved safely. */\nfunction findExistingAncestor(targetPath: string): string {\n if (lstatSync(targetPath, { throwIfNoEntry: false })) return targetPath;\n\n const parentPath = path.dirname(targetPath);\n if (parentPath === targetPath) {\n throw new Error(`Unable to resolve an existing ancestor for path: ${targetPath}`);\n }\n\n return findExistingAncestor(parentPath);\n}\n","import { readFileSync } from 'node:fs';\n\nimport { resolveFileSystemPathWithinRoot } from './resolveFileSystemPathWithinRoot.js';\n\n/*** Reads UTF-8 text only when the requested file stays inside the allowed filesystem root. */\nexport function readTextFileWithinRoot(args: {\n readonly rootPath: string;\n readonly filePath: string;\n}): { readonly content: string; readonly path: string } {\n const path = resolveFileSystemPathWithinRoot(args.rootPath, args.filePath);\n return {\n content: readFileSync(path, 'utf8'),\n path,\n };\n}\n","import type { Graph, GraphId } from '../../../types/graph.js';\nimport { compareGraphIds } from './compareGraphIds.js';\nimport { reverseGraph } from './reverseGraph.js';\n\n/*** Return strongly connected components in deterministic node order. */\nexport function findStronglyConnectedComponents<\n NodeData,\n EdgeData,\n NodeId extends GraphId = string,\n EdgeId extends GraphId = NodeId,\n>(graph: Graph<NodeData, EdgeData, NodeId, EdgeId>): readonly (readonly NodeId[])[] {\n const adjacency = buildAdjacency(graph);\n const finishOrder: NodeId[] = [];\n const visited = new Set<NodeId>();\n\n for (const nodeId of graph.nodes.map(({ id }) => id).sort(compareGraphIds)) {\n visitPostOrder(nodeId, adjacency, visited, finishOrder);\n }\n\n const reversedAdjacency = buildAdjacency(reverseGraph(graph));\n const assigned = new Set<NodeId>();\n const components: NodeId[][] = [];\n\n for (const nodeId of [...finishOrder].reverse()) {\n if (assigned.has(nodeId)) continue;\n const component: NodeId[] = [];\n collectComponent(nodeId, reversedAdjacency, assigned, component);\n components.push(component.sort(compareGraphIds));\n }\n\n return components.sort((left, right) => compareGraphIds(left[0] ?? '', right[0] ?? ''));\n}\n\n/*** Build sorted outgoing adjacency for graph traversal. */\nfunction buildAdjacency<NodeData, EdgeData, NodeId extends GraphId, EdgeId extends GraphId>(\n graph: Graph<NodeData, EdgeData, NodeId, EdgeId>,\n): Map<NodeId, NodeId[]> {\n const adjacency = new Map(graph.nodes.map(({ id }) => [id, [] as NodeId[]]));\n for (const edge of graph.edges) adjacency.get(edge.source)?.push(edge.target);\n for (const targets of adjacency.values()) targets.sort(compareGraphIds);\n return adjacency;\n}\n\n/*** Visit one node depth-first and append it after all descendants. */\nfunction visitPostOrder<NodeId extends GraphId>(\n nodeId: NodeId,\n adjacency: ReadonlyMap<NodeId, readonly NodeId[]>,\n visited: Set<NodeId>,\n finishOrder: NodeId[],\n): void {\n if (visited.has(nodeId)) return;\n visited.add(nodeId);\n for (const target of adjacency.get(nodeId) ?? []) {\n visitPostOrder(target, adjacency, visited, finishOrder);\n }\n finishOrder.push(nodeId);\n}\n\n/*** Collect one strongly connected component from reversed adjacency. */\nfunction collectComponent<NodeId extends GraphId>(\n nodeId: NodeId,\n adjacency: ReadonlyMap<NodeId, readonly NodeId[]>,\n assigned: Set<NodeId>,\n component: NodeId[],\n): void {\n if (assigned.has(nodeId)) return;\n assigned.add(nodeId);\n component.push(nodeId);\n for (const target of adjacency.get(nodeId) ?? []) {\n collectComponent(target, adjacency, assigned, component);\n }\n}\n","import type { Graph, GraphId } from '../../../types/graph.js';\nimport { compareGraphIds } from './compareGraphIds.js';\n\n/*** Return one closed cycle path, optionally restricted to a subset of graph nodes. */\nexport function findCyclePath<\n NodeData,\n EdgeData,\n NodeId extends GraphId = string,\n EdgeId extends GraphId = NodeId,\n>(\n graph: Graph<NodeData, EdgeData, NodeId, EdgeId>,\n nodeIds?: readonly NodeId[],\n): readonly NodeId[] | null {\n const allowedNodeIds = new Set(nodeIds ?? graph.nodes.map(({ id }) => id));\n const graphNodeIds = new Set(graph.nodes.map(({ id }) => id));\n const starts = graph.nodes\n .map(({ id }) => id)\n .filter((id) => allowedNodeIds.has(id))\n .sort(compareGraphIds);\n const adjacency = buildAdjacency(graph, graphNodeIds, allowedNodeIds);\n\n for (const start of starts) {\n const cycle = findCycleFromStart(start, adjacency);\n if (cycle !== null) return cycle;\n }\n\n return null;\n}\n\n/*** Build stable outgoing adjacency while honoring the requested node subset. */\nfunction buildAdjacency<NodeData, EdgeData, NodeId extends GraphId, EdgeId extends GraphId>(\n graph: Graph<NodeData, EdgeData, NodeId, EdgeId>,\n graphNodeIds: ReadonlySet<NodeId>,\n allowedNodeIds: ReadonlySet<NodeId>,\n): ReadonlyMap<NodeId, readonly NodeId[]> {\n const adjacency = new Map(\n graph.nodes\n .map(({ id }) => id)\n .filter((id) => allowedNodeIds.has(id))\n .map((id) => [id, [] as NodeId[]]),\n );\n\n for (const edge of graph.edges) {\n if (\n graphNodeIds.has(edge.source) &&\n graphNodeIds.has(edge.target) &&\n allowedNodeIds.has(edge.source) &&\n allowedNodeIds.has(edge.target)\n ) {\n adjacency.get(edge.source)?.push(edge.target);\n }\n }\n\n for (const targets of adjacency.values()) targets.sort(compareGraphIds);\n\n return adjacency;\n}\n\n/*** Search one deterministic simple cycle that closes back onto the selected start node. */\nfunction findCycleFromStart<NodeId extends GraphId>(\n start: NodeId,\n adjacency: ReadonlyMap<NodeId, readonly NodeId[]>,\n): readonly NodeId[] | null {\n return visitCycle(start, start, adjacency, [], new Set<NodeId>());\n}\n\n/*** Traverse one simple path until it closes back onto the cycle start. */\nfunction visitCycle<NodeId extends GraphId>(\n start: NodeId,\n nodeId: NodeId,\n adjacency: ReadonlyMap<NodeId, readonly NodeId[]>,\n path: readonly NodeId[],\n visited: ReadonlySet<NodeId>,\n): readonly NodeId[] | null {\n const nextPath = [...path, nodeId];\n const nextVisited = new Set(visited).add(nodeId);\n\n for (const target of adjacency.get(nodeId) ?? []) {\n if (target === start) return [...nextPath, start];\n if (nextVisited.has(target)) continue;\n\n const cycle = visitCycle(start, target, adjacency, nextPath, nextVisited);\n if (cycle !== null) return cycle;\n }\n\n return null;\n}\n","import type {\n Rule,\n RuleEvaluationPlanNode,\n RuleExecutionProvenance,\n RuleFinding,\n RuleResult,\n RuleResultDiagnostic,\n} from '../../../types/rules.js';\nimport { freezeRuleResult } from './freezeRuleResult.js';\n\n/*** Assemble an immutable serializable result without inferring status from findings. */\nexport function createRuleResult<TContext>(\n rule: Rule<TContext>,\n node: RuleEvaluationPlanNode,\n status: RuleResult['status'],\n findings: readonly RuleFinding[],\n diagnostics: readonly RuleResultDiagnostic[],\n execution: RuleExecutionProvenance = 'not-executed',\n): RuleResult {\n return freezeRuleResult({\n diagnostics,\n execution,\n findings,\n rule: Object.freeze({ ...rule.identity }),\n scope: Object.freeze({ ...node.scope }),\n status,\n });\n}\n","import type { GitHubRepositoryAuthentication } from '@ankhorage/repository/github';\nimport { cookies } from 'next/headers';\n\nimport { readGitHubAuthSession } from '@/features/github-auth/adapters/inbound/next/githubAuthCookies';\nimport { createGitHubAuthAdapterAsync } from '@/features/github-auth/composition/createGitHubAuthAdapterAsync';\n\n/*** Read only client-safe GitHub account presentation data from the request-scoped server session. */\nexport async function readGitHubAuthViewAsync(): Promise<GitHubAuthView> {\n const session = readGitHubAuthSession((await cookies()).toString());\n if (session === undefined) return { status: 'anonymous' };\n const auth = await createGitHubAuthAdapterAsync({ session });\n if (!auth.available) return { message: auth.message, status: 'unavailable' };\n const result = await auth.adapter.getSession();\n if (!result.ok || result.data === null || result.data === undefined)\n return { status: 'anonymous' };\n return {\n displayName: result.data.user.displayName ?? result.data.user.username ?? 'GitHub account',\n status: 'authenticated',\n };\n}\n\n/*** Resolve a GitHub credential exclusively from the current server session for repository operations. */\nexport async function readGitHubRepositoryAuthenticationAsync(): Promise<GitHubRepositoryAuthorization> {\n const session = readGitHubAuthSession((await cookies()).toString());\n if (session === undefined) return { authentication: 'anonymous', cacheScope: 'anonymous' };\n const auth = await createGitHubAuthAdapterAsync({ session });\n if (!auth.available) return { authentication: 'anonymous', cacheScope: 'anonymous' };\n const result = await auth.adapter.getSession();\n return result.ok && result.data !== null && result.data !== undefined\n ? {\n authentication: { kind: 'user', accessToken: result.data.accessToken },\n cacheScope: `github-user:${result.data.user.id}`,\n }\n : { authentication: 'anonymous', cacheScope: 'anonymous' };\n}\n\nexport interface GitHubRepositoryAuthorization {\n readonly authentication: GitHubRepositoryAuthentication;\n readonly cacheScope: string;\n}\n\nexport type GitHubAuthView =\n | { readonly status: 'anonymous' }\n | { readonly displayName: string; readonly status: 'authenticated' }\n | { readonly message: string; readonly status: 'unavailable' };\n","import type {\n EvaluateRulesOptions,\n Rule,\n RuleEvaluationDiagnostic,\n RuleEvaluationPlan,\n RuleEvaluationPlanFacet,\n RuleEvaluationPlanNode,\n RuleScope,\n} from '../../../types/rules.js';\nimport { compareRuleEntityIds } from '../../../utils/compareRuleEntityIds.js';\n\nconst defaultRuleScope = { id: 'global', kind: 'global' } as const;\n\n/*** Project selected Rules and their complete dependency closure into a deterministic serializable graph. */\nexport function createRuleEvaluationPlan<TContext>(\n rules: readonly Rule<TContext>[],\n options: Pick<EvaluateRulesOptions, 'scope' | 'selection'> = {},\n): RuleEvaluationPlan {\n const scope = options.scope ?? defaultRuleScope;\n const rulesById = groupRulesById(rules);\n const rootRuleIds = resolveRootRuleIds(rulesById, options.selection?.rootRuleIds);\n const closure = resolveDependencyClosure(rootRuleIds, rulesById);\n const nodesById = new Map(\n closure.ruleIds.flatMap((ruleId) => {\n const rule = resolveRule(ruleId, rulesById);\n return rule === null ? [] : [[ruleId, createPlanNode(rule, scope)] as const];\n }),\n );\n const cycleRuleIds = findCycleRuleIds(nodesById);\n const nodes = orderPlanNodes(nodesById, cycleRuleIds);\n\n return {\n diagnostics: [...closure.diagnostics, ...createCycleDiagnostics(cycleRuleIds)].sort(\n compareDiagnostics,\n ),\n nodes,\n rootRuleIds,\n };\n}\n\n/*** Group supplied providers by stable ID so ambiguity remains visible to the plan. */\nfunction groupRulesById<TContext>(\n rules: readonly Rule<TContext>[],\n): ReadonlyMap<string, readonly Rule<TContext>[]> {\n const grouped = new Map<string, readonly Rule<TContext>[]>();\n for (const rule of rules) {\n const existingRules = grouped.get(rule.identity.id) ?? [];\n grouped.set(rule.identity.id, [...existingRules, rule]);\n }\n return grouped;\n}\n\n/*** Use every supplied rule as a root unless the caller explicitly narrows the run. */\nfunction resolveRootRuleIds<TContext>(\n rulesById: ReadonlyMap<string, readonly Rule<TContext>[]>,\n selectedRootRuleIds: readonly string[] | undefined,\n): readonly string[] {\n return [...new Set(selectedRootRuleIds ?? rulesById.keys())].sort(compareStrings);\n}\n\n/*** Resolve a stable rule ID only when exactly one provider defines it. */\nfunction resolveRule<TContext>(\n ruleId: string,\n rulesById: ReadonlyMap<string, readonly Rule<TContext>[]>,\n): Rule<TContext> | null {\n const matches = rulesById.get(ruleId) ?? [];\n return matches.length === 1 ? (matches[0] ?? null) : null;\n}\n\n/*** Discover the selected transitive closure without executing provider code. */\nfunction resolveDependencyClosure<TContext>(\n rootRuleIds: readonly string[],\n rulesById: ReadonlyMap<string, readonly Rule<TContext>[]>,\n): {\n readonly diagnostics: readonly RuleEvaluationDiagnostic[];\n readonly ruleIds: readonly string[];\n} {\n const pendingRuleIds = [...rootRuleIds];\n const visitedRuleIds = new Set<string>();\n const diagnostics: RuleEvaluationDiagnostic[] = [];\n\n for (const ruleId of pendingRuleIds) {\n if (visitedRuleIds.has(ruleId)) continue;\n visitedRuleIds.add(ruleId);\n const matches = rulesById.get(ruleId) ?? [];\n if (matches.length === 0) {\n diagnostics.push(createMissingRuleDiagnostic(ruleId, rootRuleIds.includes(ruleId)));\n continue;\n }\n if (matches.length > 1) {\n diagnostics.push(createAmbiguousRuleDiagnostic(ruleId));\n continue;\n }\n const [rule] = matches;\n if (rule === undefined) continue;\n const dependencyRuleIds = [\n ...new Set(rule.dependencies.map((dependency) => dependency.ruleId)),\n ].sort(compareStrings);\n for (const dependencyRuleId of dependencyRuleIds) {\n const dependencyMatches = rulesById.get(dependencyRuleId) ?? [];\n if (dependencyMatches.length === 0) {\n diagnostics.push(createMissingDependencyDiagnostic(rule.identity.id, dependencyRuleId));\n } else if (dependencyMatches.length > 1) {\n diagnostics.push(createAmbiguousDependencyDiagnostic(rule.identity.id, dependencyRuleId));\n } else {\n pendingRuleIds.push(dependencyRuleId);\n }\n }\n }\n\n return { diagnostics, ruleIds: [...visitedRuleIds].sort(compareStrings) };\n}\n\n/*** Create the serializable graph node for one uniquely resolved provider rule. */\nfunction createPlanNode<TContext>(rule: Rule<TContext>, scope: RuleScope): RuleEvaluationPlanNode {\n return {\n dependencyRuleIds: [...new Set(rule.dependencies.map((dependency) => dependency.ruleId))].sort(\n compareStrings,\n ),\n facets: createPlanFacets(rule),\n id: JSON.stringify([rule.identity.id, rule.identity.version, scope.kind, scope.id]),\n rule: rule.identity,\n scope,\n };\n}\n\n/** Normalize provider facets into a versioned, deterministic plan projection. */\nfunction createPlanFacets<TContext>(rule: Rule<TContext>): readonly RuleEvaluationPlanFacet[] {\n const facetsByIdentity = new Map<string, RuleEvaluationPlanFacet>();\n for (const facet of rule.facets ?? []) {\n const normalizedFacet = {\n id: facet.id,\n value: facet.value,\n version: facet.version ?? rule.identity.version,\n };\n facetsByIdentity.set(JSON.stringify(normalizedFacet), normalizedFacet);\n }\n return [...facetsByIdentity.values()].sort(\n (left, right) =>\n compareStrings(left.id, right.id) ||\n compareStrings(left.value, right.value) ||\n compareStrings(left.version, right.version),\n );\n}\n\n/*** Identify only cyclic nodes so dependent nodes are not misreported as cycle members. */\nfunction findCycleRuleIds(\n nodesById: ReadonlyMap<string, RuleEvaluationPlanNode>,\n): ReadonlySet<string> {\n const components = findStronglyConnectedComponents(nodesById);\n return new Set(components.filter((component) => isCyclicComponent(component, nodesById)).flat());\n}\n\n/*** Partition the graph into deterministic strongly connected components with Tarjan traversal. */\nfunction findStronglyConnectedComponents(\n nodesById: ReadonlyMap<string, RuleEvaluationPlanNode>,\n): readonly (readonly string[])[] {\n const activeRuleIds = new Set<string>();\n const indicesByRuleId = new Map<string, number>();\n const lowLinksByRuleId = new Map<string, number>();\n const stack: string[] = [];\n const components: string[][] = [];\n const visit = (ruleId: string): void => {\n const index = indicesByRuleId.size;\n indicesByRuleId.set(ruleId, index);\n lowLinksByRuleId.set(ruleId, index);\n stack.push(ruleId);\n activeRuleIds.add(ruleId);\n for (const dependencyRuleId of nodesById.get(ruleId)?.dependencyRuleIds ?? []) {\n if (!nodesById.has(dependencyRuleId)) continue;\n const dependencyIndex = indicesByRuleId.get(dependencyRuleId);\n if (dependencyIndex === undefined) {\n visit(dependencyRuleId);\n lowLinksByRuleId.set(\n ruleId,\n Math.min(\n lowLinksByRuleId.get(ruleId) ?? index,\n lowLinksByRuleId.get(dependencyRuleId) ?? index,\n ),\n );\n } else if (activeRuleIds.has(dependencyRuleId)) {\n lowLinksByRuleId.set(\n ruleId,\n Math.min(lowLinksByRuleId.get(ruleId) ?? index, dependencyIndex),\n );\n }\n }\n if (lowLinksByRuleId.get(ruleId) !== index) return;\n const component = stack.splice(stack.lastIndexOf(ruleId));\n for (const memberRuleId of component) {\n activeRuleIds.delete(memberRuleId);\n }\n components.push(component.sort(compareStrings));\n };\n for (const ruleId of [...nodesById.keys()].sort(compareStrings)) {\n if (!indicesByRuleId.has(ruleId)) visit(ruleId);\n }\n return components;\n}\n\n/*** Treat multi-member components and explicit self-references as dependency cycles. */\nfunction isCyclicComponent(\n component: readonly string[],\n nodesById: ReadonlyMap<string, RuleEvaluationPlanNode>,\n): boolean {\n if (component.length > 1) return true;\n const [ruleId] = component;\n return (\n ruleId !== undefined && (nodesById.get(ruleId)?.dependencyRuleIds.includes(ruleId) ?? false)\n );\n}\n\n/*** Return a stable child-before-parent ordering for every acyclic node in the plan. */\nfunction orderPlanNodes(\n nodesById: ReadonlyMap<string, RuleEvaluationPlanNode>,\n cycleRuleIds: ReadonlySet<string>,\n): readonly RuleEvaluationPlanNode[] {\n const acyclicRuleIds = [...nodesById.keys()].filter((ruleId) => !cycleRuleIds.has(ruleId));\n const unresolvedDependencyCounts = new Map(\n acyclicRuleIds.map((ruleId) => [\n ruleId,\n (nodesById.get(ruleId)?.dependencyRuleIds ?? []).filter(\n (dependencyRuleId) =>\n nodesById.has(dependencyRuleId) && !cycleRuleIds.has(dependencyRuleId),\n ).length,\n ]),\n );\n const dependentsByRuleId = new Map<string, readonly string[]>();\n for (const ruleId of acyclicRuleIds) {\n for (const dependencyRuleId of nodesById.get(ruleId)?.dependencyRuleIds ?? []) {\n if (!unresolvedDependencyCounts.has(dependencyRuleId)) continue;\n const dependents = dependentsByRuleId.get(dependencyRuleId) ?? [];\n dependentsByRuleId.set(dependencyRuleId, [...dependents, ruleId]);\n }\n }\n const readyRuleIds = acyclicRuleIds\n .filter((ruleId) => unresolvedDependencyCounts.get(ruleId) === 0)\n .sort(compareStrings);\n const orderedRuleIds: string[] = [];\n while (readyRuleIds.length > 0) {\n const ruleId = readyRuleIds.shift();\n if (ruleId === undefined) continue;\n orderedRuleIds.push(ruleId);\n for (const dependentRuleId of dependentsByRuleId.get(ruleId) ?? []) {\n const remainingDependencies = (unresolvedDependencyCounts.get(dependentRuleId) ?? 0) - 1;\n unresolvedDependencyCounts.set(dependentRuleId, remainingDependencies);\n if (remainingDependencies === 0) {\n readyRuleIds.push(dependentRuleId);\n readyRuleIds.sort(compareStrings);\n }\n }\n }\n const residualRuleIds = [...nodesById.keys()]\n .filter((ruleId) => !orderedRuleIds.includes(ruleId))\n .sort(compareStrings);\n return [...orderedRuleIds, ...residualRuleIds].flatMap((ruleId) => {\n const node = nodesById.get(ruleId);\n return node === undefined ? [] : [node];\n });\n}\n\n/*** Describe an unknown root or child rule without treating it as a provider finding. */\nfunction createMissingRuleDiagnostic(ruleId: string, isRoot: boolean): RuleEvaluationDiagnostic {\n return {\n code: isRoot ? 'unknown-rule' : 'missing-dependency',\n message: isRoot\n ? `Selected rule \"${ruleId}\" is not registered.`\n : `Rule dependency \"${ruleId}\" is not registered.`,\n ruleId,\n };\n}\n\n/*** Describe an unknown child on the provider that declared it. */\nfunction createMissingDependencyDiagnostic(\n ruleId: string,\n dependencyRuleId: string,\n): RuleEvaluationDiagnostic {\n return {\n code: 'missing-dependency',\n message: `Rule \"${ruleId}\" depends on unknown rule \"${dependencyRuleId}\".`,\n ruleId,\n };\n}\n\n/*** Describe an ambiguous selected root. */\nfunction createAmbiguousRuleDiagnostic(ruleId: string): RuleEvaluationDiagnostic {\n return {\n code: 'ambiguous-rule-id',\n message: `Rule ID \"${ruleId}\" is provided more than once.`,\n ruleId,\n };\n}\n\n/*** Describe an ambiguous child on the provider that declared it. */\nfunction createAmbiguousDependencyDiagnostic(\n ruleId: string,\n dependencyRuleId: string,\n): RuleEvaluationDiagnostic {\n return {\n code: 'ambiguous-rule-id',\n message: `Rule \"${ruleId}\" depends on ambiguous rule ID \"${dependencyRuleId}\".`,\n ruleId,\n };\n}\n\n/*** Emit a deterministic error for every provider that participates in a dependency cycle. */\nfunction createCycleDiagnostics(\n cycleRuleIds: ReadonlySet<string>,\n): readonly RuleEvaluationDiagnostic[] {\n return [...cycleRuleIds].sort(compareStrings).map((ruleId) => ({\n code: 'cycle',\n message: `Rule \"${ruleId}\" participates in a dependency cycle.`,\n ruleId,\n }));\n}\n\n/*** Sort diagnostics by their affected rule and then their stable code. */\nfunction compareDiagnostics(\n left: RuleEvaluationDiagnostic,\n right: RuleEvaluationDiagnostic,\n): number {\n return compareStrings(left.ruleId, right.ruleId) || compareStrings(left.code, right.code);\n}\n\n/*** Compare identifiers without locale-dependent ordering. */\nfunction compareStrings(left: string, right: string): number {\n return compareRuleEntityIds({ id: left }, { id: right });\n}\n","/** Atlas-supported parser language selected from canonical project evidence. */\nexport enum Language {\n Cpp = 'cpp',\n Delphi = 'delphi',\n JavaScript = 'javascript',\n Kotlin = 'kotlin',\n Python = 'python',\n TypeScript = 'typescript',\n Java = 'java',\n Unknown = 'unknown',\n}\n","/*** Settle asynchronous work with a fixed upper bound while retaining one deterministic outcome per input. */\nexport async function settleBoundedAsync<Input, Output>(\n inputs: readonly Input[],\n concurrency: number,\n operation: (input: Input, signal: AbortSignal | undefined) => Promise<Output>,\n signal?: AbortSignal\n): Promise<readonly PromiseSettledResult<Output>[]> {\n if (!Number.isSafeInteger(concurrency) || concurrency < 1)\n throw new Error('Concurrency must be a positive integer.');\n const queue = inputs.map((input, index) => ({ input, index }));\n const workerOutcomes = await Promise.all(\n Array.from({ length: Math.min(concurrency, inputs.length) }, async () => {\n const outcomes: {\n readonly index: number;\n readonly outcome: PromiseSettledResult<Output>;\n }[] = [];\n for (;;) {\n const next = queue.shift();\n if (next === undefined) return outcomes;\n if (signal?.aborted) {\n outcomes.push({\n index: next.index,\n outcome: { status: 'rejected', reason: getAbortReason(signal) },\n });\n continue;\n }\n try {\n outcomes.push({\n index: next.index,\n outcome: { status: 'fulfilled', value: await operation(next.input, signal) },\n });\n } catch (reason) {\n outcomes.push({ index: next.index, outcome: { status: 'rejected', reason } });\n }\n }\n })\n );\n return workerOutcomes\n .flat()\n .sort((left, right) => left.index - right.index)\n .map(result => result.outcome);\n}\n\n/*** Preserve the cancelling workspace's reason for work that never started. */\nfunction getAbortReason(signal: AbortSignal): unknown {\n return signal.reason ?? new DOMException('The workspace request was cancelled.', 'AbortError');\n}\n","import type { ArchitectureProfile } from '../../../types/architectureProfile.js';\n\n/*** Built-in project profiles layered on top of generic architecture models. */\nexport const ARCHITECTURE_PROFILES: readonly ArchitectureProfile[] = [\n {\n id: 'ankhorage',\n name: 'Ankhorage Hexagonal Profile',\n baseModelId: 'hexagonal',\n interpretation:\n 'Ankhorage uses feature-first ownership with explicit inward roles and thin package-level delivery edges on top of Hexagonal Architecture.',\n source: {\n featureRoot: 'src/features',\n facadeFiles: ['index.ts'],\n packageWideDirectories: ['constants', 'types', 'utils'],\n deliveryEdgeDirectories: ['app', 'cli', 'host', 'platform'],\n inwardFeatureRoles: ['application', 'contracts', 'domain', 'planning', 'ports'],\n roles: [\n {\n id: 'domain',\n segments: ['domain', 'core'],\n forbiddenOutwardSegments: [\n 'adapters',\n 'app',\n 'application',\n 'cli',\n 'composition',\n 'host',\n 'infrastructure',\n 'platform',\n ],\n ruleId: 'package.architecture.domain-outward-import.disallowed',\n label: 'Domain/core policy',\n },\n {\n id: 'application',\n segments: ['application'],\n forbiddenOutwardSegments: [\n 'adapters',\n 'app',\n 'cli',\n 'composition',\n 'host',\n 'infrastructure',\n 'platform',\n ],\n ruleId: 'package.architecture.application-outward-import.disallowed',\n label: 'Application/use-case code',\n },\n {\n id: 'ports',\n segments: ['ports'],\n forbiddenOutwardSegments: [\n 'adapters',\n 'app',\n 'cli',\n 'composition',\n 'host',\n 'infrastructure',\n 'platform',\n ],\n ruleId: 'package.architecture.port-outward-import.disallowed',\n label: 'Port contracts',\n },\n ],\n featureCombinations: [\n {\n role: 'adapters',\n requiresAnyOf: ['application', 'contracts', 'domain', 'planning', 'ports'],\n ruleId: 'package.architecture.role-combination.invalid',\n },\n {\n role: 'composition',\n requiresAnyOf: ['adapters', 'application', 'planning', 'ports'],\n ruleId: 'package.architecture.role-combination.invalid',\n },\n ],\n thinDeliveryAdapter: {\n pathSegments: ['cli', 'commands'],\n concreteAdapterSegment: 'adapters',\n ruleId: 'package.architecture.delivery-concrete-adapter-import.disallowed',\n },\n },\n },\n];\n","unable to read source [project]/node_modules/@ankhorage/repository/src/providers/github/adapters/createGitHubHttpRepositoryDiscoveryGateway.ts","unable to read source [project]/node_modules/@ankhorage/repository/src/providers/github/adapters/rateLimitResponseAsync.ts","/*** Return whether an unknown value is a non-null, non-array record. */\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n","import type {\n EvaluateConfiguredRulesOptions,\n RuleEvaluationDiagnostic,\n RuleEvaluationResult,\n RuleRegistry,\n RuleResult,\n RulesConfig,\n RulesConfigDiagnostic,\n} from '../../../types/rules.js';\nimport { validateRulesConfig } from '../../configuration/domain/validateRulesConfig.js';\nimport { evaluateRules } from './evaluateRules.js';\n\n/*** Resolve a configured Rule registry and evaluate its enabled rules without provider branches. */\nexport function evaluateConfiguredRules<TContext>(\n context: TContext,\n config: RulesConfig,\n registry: RuleRegistry<TContext>,\n options: EvaluateConfiguredRulesOptions = {},\n): RuleEvaluationResult {\n const validation = validateRulesConfig(config, {\n registry,\n capabilities: options.capabilities,\n });\n if (validation.config === null) {\n return {\n findings: [],\n diagnostics: validation.diagnostics.map(toEvaluationDiagnostic),\n plan: { diagnostics: [], nodes: [], rootRuleIds: [] },\n results: [],\n };\n }\n\n const enabledConfigurations = validation.config.rules.filter((rule) => rule.enabled);\n const optionsByRuleId = new Map(\n enabledConfigurations.map((rule) => [rule.id, rule.options] as const),\n );\n const selectedRuleIds = enabledConfigurations\n .map((configuredRule) => configuredRule.id)\n .filter((ruleId) => registry.ruleById.has(ruleId));\n const result = evaluateRules(context, registry.rules, {\n cache: options.cache,\n cachePartition: options.cachePartition,\n capabilities: options.capabilities,\n disabledRuleIds: registry.rules\n .map((rule) => rule.identity.id)\n .filter((ruleId) => !selectedRuleIds.includes(ruleId)),\n optionsByRuleId,\n selection: { rootRuleIds: selectedRuleIds },\n factsVersion: options.factsVersion,\n scope: options.scope,\n });\n\n const results = applyConfiguredSeverities(result.results, validation.config);\n return {\n diagnostics: result.diagnostics,\n findings: results.flatMap((result) => result.findings),\n plan: result.plan,\n results,\n };\n}\n\n/*** Translate config validation failures into the evaluator's portable diagnostic shape. */\nfunction toEvaluationDiagnostic(diagnostic: RulesConfigDiagnostic): RuleEvaluationDiagnostic {\n return {\n code:\n diagnostic.code === 'missing-capability'\n ? 'missing-capability'\n : diagnostic.code === 'unknown-rule'\n ? 'unknown-rule'\n : diagnostic.code === 'invalid-options'\n ? 'invalid-options'\n : diagnostic.code === 'rule-error'\n ? 'rule-error'\n : 'invalid-config',\n ruleId: diagnostic.ruleId ?? 'rules.config',\n message: diagnostic.message,\n };\n}\n\n/*** Apply configured severity overrides after providers have produced neutral findings. */\nfunction applyConfiguredSeverities(\n results: readonly RuleResult[],\n config: RulesConfig,\n): readonly RuleResult[] {\n const severityByRuleId = new Map(config.rules.map((rule) => [rule.id, rule.severity] as const));\n return results.map((result) => ({\n ...result,\n findings: result.findings.map((finding) => ({\n ...finding,\n severity: severityByRuleId.get(finding.ruleId) ?? finding.severity,\n })),\n }));\n}\n","import type { SourceGraph } from '@ankhorage/dependency-graph';\nimport { createRuleRegistry, evaluateConfiguredRules, evaluateRules } from '@ankhorage/rules';\n\nimport type {\n ArchitectureProfile,\n ArchitectureProfileEvaluationOptions,\n ArchitectureProfileEvaluationResult,\n ArchitectureProfileRuleContext,\n} from '../../../types/architectureProfile.js';\nimport { hasSourceCapability } from '../../../utils/hasSourceCapability.js';\nimport { createArchitectureProfileRuleSet } from './createArchitectureProfileRuleSet.js';\nimport { findArchitectureProfile } from './findArchitectureProfile.js';\n\n/*** Evaluate one explicitly selected project profile through the generic Rules engine. */\nexport function evaluateArchitectureProfile(\n graph: SourceGraph,\n profileId: ArchitectureProfile['id'],\n options: ArchitectureProfileEvaluationOptions = {},\n): ArchitectureProfileEvaluationResult {\n const profile = findArchitectureProfile(profileId);\n const context: ArchitectureProfileRuleContext = { graph, profile };\n const ruleSet = createArchitectureProfileRuleSet(profileId);\n const capabilities = hasSourceCapability(graph, 'imports') ? ['source-graph.imports'] : [];\n const result =\n options.config === undefined\n ? evaluateRules(context, ruleSet.rules, {\n cache: options.cache,\n cachePartition: options.cachePartition,\n capabilities,\n factsVersion: options.factsVersion,\n scope: { id: profile.id, kind: 'architecture-profile' },\n })\n : evaluateConfiguredRules(context, options.config, createRuleRegistry([ruleSet]), {\n capabilities,\n scope: { id: profile.id, kind: 'architecture-profile' },\n });\n return {\n ...result,\n baseModelId: profile.baseModelId,\n profileId: profile.id,\n };\n}\n","import type { SourceCapability, SourceGraph } from '@ankhorage/dependency-graph';\nimport { createRuleRegistry, evaluateConfiguredRules, evaluateRules } from '@ankhorage/rules';\n\nimport type {\n ArchitectureEvaluationOptions,\n ArchitectureEvaluationResult,\n ArchitectureRuleContext,\n} from '../../../types/architectureAnalysis.js';\nimport type { ArchitectureModel } from '../../../types/architectureModel.js';\nimport { hasSourceCapability } from '../../../utils/hasSourceCapability.js';\nimport { inferArchitectureRoles } from '../../detection/domain/inferArchitectureRoles.js';\nimport { findArchitectureModel } from '../../models/domain/findArchitectureModel.js';\nimport { createArchitectureRuleSet } from '../../rules/domain/createArchitectureRuleSet.js';\n\nconst CAPABILITY_NAMES: readonly (readonly [SourceCapability, string])[] = [\n ['imports', 'source-graph.imports'],\n ['extends', 'source-graph.extends'],\n ['implements', 'source-graph.implements'],\n];\n\n/*** Evaluate one explicitly selected architecture model through the generic Rules engine. */\nexport function evaluateArchitecture(\n graph: SourceGraph,\n modelId: ArchitectureModel['id'],\n options: ArchitectureEvaluationOptions = {},\n): ArchitectureEvaluationResult {\n const model = findArchitectureModel(modelId);\n const roleAssignments = inferArchitectureRoles(graph, model);\n const context: ArchitectureRuleContext = { graph, model, roleAssignments };\n const ruleSet = createArchitectureRuleSet(modelId);\n const capabilities = availableRuleCapabilities(graph);\n const result =\n options.config === undefined\n ? evaluateRules(context, ruleSet.rules, {\n cache: options.cache,\n cachePartition: options.cachePartition,\n capabilities,\n factsVersion: options.factsVersion,\n scope: { id: model.id, kind: 'architecture-model' },\n })\n : evaluateConfiguredRules(context, options.config, createRuleRegistry([ruleSet]), {\n capabilities,\n scope: { id: model.id, kind: 'architecture-model' },\n });\n\n return {\n ...result,\n modelId,\n roleAssignments,\n };\n}\n\n/*** Translate analyzer capability reports into generic Rules capability identifiers. */\nfunction availableRuleCapabilities(graph: SourceGraph): readonly string[] {\n if (graph.capabilities.length === 0) return [];\n return CAPABILITY_NAMES.flatMap(([sourceCapability, ruleCapability]) =>\n hasSourceCapability(graph, sourceCapability) ? [ruleCapability] : [],\n );\n}\n","/*** Escapes a literal string so it can be safely embedded in a regular-expression source. */\nexport function escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n","import type { SourceCapability, SourceGraph } from '@ankhorage/dependency-graph';\n\n/*** Report whether every observed project has at least one analyzer that provides a capability. */\nexport function hasSourceCapability(graph: SourceGraph, capability: SourceCapability): boolean {\n const projectIds = new Set(graph.capabilities.map(({ projectId }) => projectId));\n if (projectIds.size === 0) return false;\n\n return [...projectIds].every((projectId) =>\n graph.capabilities.some(\n (report) => report.projectId === projectId && report.available.includes(capability),\n ),\n );\n}\n","/*** Compare Rules-domain entities by identifier using locale-independent code-unit ordering. */\nexport function compareRuleEntityIds(\n left: { readonly id: string },\n right: { readonly id: string },\n): number {\n if (left.id < right.id) return -1;\n if (left.id > right.id) return 1;\n return 0;\n}\n","import type {\n SourceGraph,\n SourceGraphIndex,\n SourceRollupEdge,\n} from '../../../types/sourceGraph.js';\n\n/*** Aggregate observed relationships at the requested containment level, preserving edge IDs. */\nexport function rollupSourceRelations(\n sourceGraph: SourceGraph,\n index: SourceGraphIndex,\n aggregateKind: 'project' | 'package' | 'directory' | 'file',\n relationKind: 'imports' | 'exports' | 'extends' | 'implements' = 'imports',\n): readonly SourceRollupEdge[] {\n const nodesById = new Map(sourceGraph.graph.nodes.map((node) => [node.id, node.data]));\n const namespaceByFileId = new Map(\n sourceGraph.graph.edges.flatMap((edge) =>\n edge.data.kind === 'declares-in' ? [[edge.source, edge.target] as const] : [],\n ),\n );\n const pairs = new Map<string, SourceRollupEdge>();\n for (const edge of sourceGraph.graph.edges) {\n if (edge.data.kind !== relationKind) continue;\n const source = ancestorOfKind(edge.source, aggregateKind, nodesById, namespaceByFileId, index);\n const target = ancestorOfKind(edge.target, aggregateKind, nodesById, namespaceByFileId, index);\n if (source === undefined || target === undefined || source === target) continue;\n const sourceSemanticPath = nodesById.get(source)?.semanticPath;\n const targetSemanticPath = nodesById.get(target)?.semanticPath;\n if (sourceSemanticPath === undefined || targetSemanticPath === undefined) continue;\n const key = `${source}\\u0000${target}`;\n const previous = pairs.get(key);\n pairs.set(key, {\n source,\n target,\n sourceSemanticPath,\n targetSemanticPath,\n weight: (previous?.weight ?? 0) + 1,\n evidenceEdgeIds: [...(previous?.evidenceEdgeIds ?? []), edge.id],\n });\n }\n return [...pairs.values()].sort(\n (left, right) => left.source - right.source || left.target - right.target,\n );\n}\n\n/*** Ascend factual containment to one requested projection level. */\nfunction ancestorOfKind(\n nodeId: number,\n kind: 'project' | 'package' | 'directory' | 'file',\n nodes: ReadonlyMap<number, SourceGraph['graph']['nodes'][number]['data']>,\n namespaces: ReadonlyMap<number, number>,\n index: SourceGraphIndex,\n): number | undefined {\n let current: number | undefined = nodeId;\n while (current !== undefined) {\n if (kind === 'package' && nodes.get(current)?.kind === 'file') {\n const namespace = namespaces.get(current);\n if (namespace !== undefined) return namespace;\n }\n if (nodes.get(current)?.kind === kind) return current;\n current = index.parentByNodeId.get(current);\n }\n const classification = nodes.get(nodeId)?.classification;\n return classification === 'vendor' || classification === 'unknown' ? nodeId : undefined;\n}\n","import type {\n RuleEvaluationCache,\n RuleEvaluationCacheKey,\n RuleEvaluationPlanNode,\n RuleResult,\n} from '../../../types/rules.js';\n\n/*** Read a matching cached result without allowing cache failures or mismatches to fabricate reuse. */\nexport function readCachedRuleResult(\n cache: RuleEvaluationCache | undefined,\n cacheKey: RuleEvaluationCacheKey,\n node: RuleEvaluationPlanNode,\n): RuleResult | undefined {\n try {\n const result = cache?.read(cacheKey);\n return result !== undefined && hasMatchingIdentity(result, node) ? result : undefined;\n } catch {\n return undefined;\n }\n}\n\n/*** Reject cache data that does not belong to the evaluated rule instance. */\nfunction hasMatchingIdentity(result: RuleResult, node: RuleEvaluationPlanNode): boolean {\n return (\n result.rule.id === node.rule.id &&\n result.rule.version === node.rule.version &&\n result.scope.id === node.scope.id &&\n result.scope.kind === node.scope.kind\n );\n}\n","import type {\n RuleEvaluationCache,\n RuleEvaluationCacheKey,\n RuleResult,\n} from '../../../types/rules.js';\n\n/*** Persist only a result produced by actual provider evaluation; cache failures preserve evaluation behavior. */\nexport function writeCachedRuleResult(\n cache: RuleEvaluationCache | undefined,\n cacheKey: RuleEvaluationCacheKey | null,\n result: RuleResult,\n): void {\n if (cacheKey === null) return;\n try {\n cache?.write(cacheKey, result);\n } catch {\n // The optional adapter cannot change a rule's evaluated outcome.\n }\n}\n","unable to read source [project]/node_modules/@ankhorage/repository/src/providers/github/services/resolveGitHubRepositoryRevisionAsync.ts","unable to read source [project]/node_modules/@ankhorage/repository/src/providers/github/adapters/createGitHubHttpClient.ts","import type { Rule, RuleRegistry, RuleSet } from '../../../types/rules.js';\nimport { compareRuleEntityIds } from '../../../utils/compareRuleEntityIds.js';\n\n/*** Create a deterministic registry from independently owned RuleSets. */\nexport function createRuleRegistry<TContext>(\n ruleSets: readonly RuleSet<TContext>[],\n): RuleRegistry<TContext> {\n const sortedRuleSets = [...ruleSets].sort(compareRuleEntityIds);\n assertUniqueRuleSetIds(sortedRuleSets);\n const rules = sortedRuleSets\n .flatMap((ruleSet) => ruleSet.rules)\n .sort((left, right) => compareRuleEntityIds(left.identity, right.identity));\n assertUniqueRuleIds(rules);\n\n return {\n ruleSets: sortedRuleSets,\n rules,\n ruleById: new Map(rules.map((rule) => [rule.identity.id, rule])),\n };\n}\n\n/*** Reject ambiguous provider composition before evaluating a registry. */\nfunction assertUniqueRuleSetIds<TContext>(ruleSets: readonly RuleSet<TContext>[]): void {\n const duplicateId = findDuplicateId(ruleSets.map((ruleSet) => ruleSet.id));\n if (duplicateId !== null) throw new Error(`Duplicate RuleSet ID: ${duplicateId}`);\n}\n\n/*** Reject multiple providers that claim the same public rule identifier. */\nfunction assertUniqueRuleIds<TContext>(rules: readonly Rule<TContext>[]): void {\n const duplicateId = findDuplicateId(rules.map((rule) => rule.identity.id));\n if (duplicateId !== null) throw new Error(`Duplicate rule ID: ${duplicateId}`);\n}\n\n/*** Find the first duplicate in an already deterministic sequence of identifiers. */\nfunction findDuplicateId(ids: readonly string[]): string | null {\n const seen = new Set<string>();\n for (const id of ids) {\n if (seen.has(id)) return id;\n seen.add(id);\n }\n return null;\n}\n","import type { DependencyGraph, DependencyGraphPackage } from '../../../types/dependencyGraph.js';\nimport type { ProjectAnalysisSnapshot } from '../../../types/projectAnalysisSnapshot.js';\nimport type { SourceGraph } from '../../../types/sourceGraph.js';\nimport { projectDependencyGraphFromSourceGraph } from '../domain/projectDependencyGraphFromSourceGraph.js';\n\n/*** Project recomposed portable source facts through the established package/module graph view. */\nexport function projectDependencyGraphFromProjectAnalysisSnapshots(\n sourceGraph: SourceGraph,\n snapshots: readonly ProjectAnalysisSnapshot[],\n): DependencyGraph {\n const packages = snapshots.flatMap(createSnapshotPackages);\n assertUniqueFocusNames(packages);\n return projectDependencyGraphFromSourceGraph(\n sourceGraph,\n packages,\n snapshots.map(({ projectId: id, packages: detected }) => ({ id, packages: detected })),\n );\n}\n\n/*** Normalize portable package and workspace facts into dependency projection contexts. */\nfunction createSnapshotPackages(\n snapshot: ProjectAnalysisSnapshot,\n): readonly DependencyGraphPackage[] {\n const rootPackage = snapshot.packages.find(({ rootPath }) => rootPath === '.');\n const workspaceRoots = new Set(\n snapshot.workspaces\n .filter(({ rootPath }) => rootPath === '.')\n .flatMap(({ packagePaths }) => packagePaths),\n );\n const workspacePackages = snapshot.packages.filter(\n ({ rootPath }) => rootPath !== '.' && workspaceRoots.has(rootPath),\n );\n const root = rootPackage ?? { rootPath: '.' };\n return [root, ...workspacePackages].map(({ rootPath: relativeRoot, name }) => {\n const id = `${snapshot.projectId}:${relativeRoot}`;\n return {\n id,\n nodeId: `package:${id}`,\n projectId: snapshot.projectId,\n relativeRoot,\n ...(name === undefined ? {} : { name }),\n } satisfies DependencyGraphPackage;\n });\n}\n\n/*** Reject ambiguous package names before resolving cross-project source imports. */\nfunction assertUniqueFocusNames(packages: readonly DependencyGraphPackage[]): void {\n const named = packages.filter(\n (item): item is DependencyGraphPackage & { readonly name: string } => item.name !== undefined,\n );\n const duplicates = named.filter(\n (item, index) => named.findIndex(({ name }) => name === item.name) !== index,\n );\n if (duplicates.length > 0) {\n throw new Error(`Duplicate focus package name: ${duplicates[0]?.name ?? 'unknown'}.`);\n }\n}\n","unable to read source [project]/node_modules/@ankhorage/repository/src/providers/github/adapters/createGitHubHttpRepositoryReadGateway.ts","unable to read source [project]/node_modules/@ankhorage/repository/src/providers/github/services/materializeGitHubRepositoryAsync.ts","import type {\n EvaluateRulesOptions,\n RuleEvaluationCacheKey,\n RuleEvaluationPlanNode,\n RuleResult,\n} from '../../../types/rules.js';\nimport { compareRuleEntityIds } from '../../../utils/compareRuleEntityIds.js';\n\n/*** Build the complete cache identity only when callers provide both fact and authenticated partition versions. */\nexport function createRuleEvaluationCacheKey(\n node: RuleEvaluationPlanNode,\n dependencyResults: readonly RuleResult[],\n options: Pick<\n EvaluateRulesOptions,\n 'cachePartition' | 'capabilities' | 'factsVersion' | 'optionsByRuleId'\n >,\n): RuleEvaluationCacheKey | null {\n if (options.cachePartition === undefined || options.factsVersion === undefined) return null;\n\n return {\n capabilities: [...new Set(options.capabilities ?? [])].sort(compareStrings),\n dependencyResults: dependencyResults.map(stripExecutionProvenance),\n factsVersion: options.factsVersion,\n options: options.optionsByRuleId?.get(node.rule.id),\n partition: options.cachePartition,\n rule: node.rule,\n scope: node.scope,\n };\n}\n\n/*** Do not let transient cache provenance invalidate otherwise identical dependent outcomes. */\nfunction stripExecutionProvenance(result: RuleResult): RuleResult {\n const { execution: _execution, ...cacheIdentityResult } = result;\n return cacheIdentityResult;\n}\n\n/*** Compare identifiers without locale-dependent ordering. */\nfunction compareStrings(left: string, right: string): number {\n return compareRuleEntityIds({ id: left }, { id: right });\n}\n","import { createWriteStream } from 'node:fs';\nimport { mkdir, mkdtemp, open, rm, stat } from 'node:fs/promises';\nimport { tmpdir } from 'node:os';\nimport { basename, isAbsolute, join, relative, resolve, sep } from 'node:path';\nimport { Transform } from 'node:stream';\nimport { pipeline } from 'node:stream/promises';\n\nimport { type Entry, openPromise, type ZipFile } from 'yauzl';\n\nimport type { LocalProjectMaterialization } from '@/types/projectSource';\n\nconst SOURCE_FILE_EXTENSION = /\\.(?:c|cc|cpp|cxx|dpr|h|hpp|java|js|jsx|kt|kts|pas|py|ts|tsx)$/iu;\nconst UNIX_FILE_TYPE_MASK = 0o170000;\nconst UNIX_DIRECTORY_TYPE = 0o040000;\nconst UNIX_REGULAR_FILE_TYPE = 0o100000;\nconst ZIP_LOCAL_FILE_HEADER = Buffer.from([0x50, 0x4b, 0x03, 0x04]);\n\ninterface SourceJarLimits {\n readonly maxEntryCount: number;\n readonly maxUncompressedSize: number;\n}\n\ninterface SourceJarMaterializationOptions {\n readonly signal?: AbortSignal;\n readonly limits?: Partial<SourceJarLimits>;\n}\n\nconst SOURCE_JAR_LIMITS: SourceJarLimits = {\n maxEntryCount: 10_000,\n maxUncompressedSize: 256 * 1024 * 1024,\n};\n\n/*** Materializes a bounded local source JAR into an isolated temporary project root. */\nexport async function materializeSourceJarAsync(\n sourcePath: string,\n options: SourceJarMaterializationOptions = {}\n): Promise<LocalProjectMaterialization | null> {\n const limits = getSourceJarLimits(options.limits);\n throwIfAborted(options.signal);\n const sourceStats = await getSourceStatsAsync(sourcePath);\n if (sourceStats === null) return null;\n if (!sourceStats.isFile()) return null;\n if (!isJarPath(sourcePath)) return null;\n await assertZipSignatureAsync(sourcePath);\n throwIfAborted(options.signal);\n\n const temporaryRoot = await mkdtemp(join(tmpdir(), 'atlas-source-jar-'));\n try {\n await extractSourceJarAsync(sourcePath, temporaryRoot, limits, options.signal);\n return {\n rootPath: temporaryRoot,\n projectName: getProjectName(sourcePath),\n cleanupAsync: () => rm(temporaryRoot, { force: true, recursive: true }),\n };\n } catch (error) {\n await rm(temporaryRoot, { force: true, recursive: true });\n if (options.signal?.aborted) throw getAbortError(options.signal);\n throw createSourceJarError(error);\n }\n}\n\n/*** Owns ZIP reader lifetime and cancellation while extraction stays bounded by the adapter policy. */\nasync function extractSourceJarAsync(\n sourcePath: string,\n temporaryRoot: string,\n limits: SourceJarLimits,\n signal: AbortSignal | undefined\n): Promise<void> {\n const zip = await openPromise(sourcePath, {\n autoClose: false,\n lazyEntries: true,\n strictFileNames: true,\n validateEntrySizes: false,\n });\n const closeOnAbort = () => closeZip(zip);\n signal?.addEventListener('abort', closeOnAbort, { once: true });\n try {\n if (zip.entryCount > limits.maxEntryCount) {\n throw new Error('Source JAR contains too many entries.');\n }\n throwIfAborted(signal);\n const result = await extractSourceEntriesAsync(zip, temporaryRoot, limits, signal);\n if (!result.hasSourceFile) {\n throw new Error(\n 'Unsupported binary JAR input: the archive does not contain analyzable source files.'\n );\n }\n } finally {\n signal?.removeEventListener('abort', closeOnAbort);\n closeZip(zip);\n }\n}\n\n/*** Validates and extracts only ordinary archive entries beneath the isolated temporary root. */\nasync function extractSourceEntriesAsync(\n zip: ZipFile,\n temporaryRoot: string,\n limits: SourceJarLimits,\n signal?: AbortSignal\n): Promise<{ readonly hasSourceFile: boolean }> {\n let entryCount = 0;\n let declaredUncompressedSize = 0;\n let hasSourceFile = false;\n const archiveEntries = new Map<string, 'directory' | 'file'>();\n const createEntrySizeLimit = createExtractedSizeLimit(limits.maxUncompressedSize);\n\n for await (const entry of zip.eachEntry()) {\n throwIfAborted(signal);\n entryCount += 1;\n if (entryCount > limits.maxEntryCount) throw new Error('Source JAR contains too many entries.');\n const entryKind = assertSafeArchiveEntry(entry, temporaryRoot);\n assertDistinctArchiveEntry(archiveEntries, entry.fileName, entryKind);\n declaredUncompressedSize += entry.uncompressedSize;\n if (declaredUncompressedSize > limits.maxUncompressedSize) {\n throw new Error('Source JAR expands beyond the supported size limit.');\n }\n if (entryKind === 'directory') {\n await mkdir(resolveArchiveEntryPath(temporaryRoot, entry.fileName), { recursive: true });\n continue;\n }\n const targetPath = resolveArchiveEntryPath(temporaryRoot, entry.fileName);\n await mkdir(resolve(targetPath, '..'), { recursive: true });\n await pipeline(\n await zip.openReadStreamPromise(entry),\n createEntrySizeLimit(),\n createWriteStream(targetPath, { flags: 'wx' }),\n { signal }\n );\n hasSourceFile ||= SOURCE_FILE_EXTENSION.test(entry.fileName);\n }\n\n return { hasSourceFile };\n}\n\n/*** Rejects archive metadata that could escape the temporary root or require unsupported extraction. */\nfunction assertSafeArchiveEntry(entry: Entry, temporaryRoot: string): 'directory' | 'file' {\n const { fileName: filename } = entry;\n const entryKind = filename.endsWith('/') ? 'directory' : 'file';\n assertSafeArchiveEntryPath(filename, entryKind);\n assertSupportedArchiveEncoding(entry);\n assertOrdinaryArchiveEntry(entry, entryKind);\n resolveArchiveEntryPath(temporaryRoot, filename);\n return entryKind;\n}\n\n/*** Rejects absolute, empty, dot, and backslash paths while allowing one directory suffix slash. */\nfunction assertSafeArchiveEntryPath(filename: string, entryKind: 'directory' | 'file'): void {\n const pathWithoutTrailingSlash = entryKind === 'directory' ? filename.slice(0, -1) : filename;\n if (\n filename === '' ||\n filename.includes('\\\\') ||\n isAbsolute(filename) ||\n pathWithoutTrailingSlash.split('/').some(part => part === '' || part === '.' || part === '..')\n ) {\n throw new Error('Source JAR contains an unsafe entry path.');\n }\n}\n\n/*** Restricts extraction to the ZIP compression methods that the bounded reader can validate. */\nfunction assertSupportedArchiveEncoding(entry: Entry): void {\n if (entry.isEncrypted() || ![0, 8].includes(entry.compressionMethod)) {\n throw new Error('Source JAR contains an unsupported encrypted or compressed entry.');\n }\n}\n\n/*** Allows only ordinary files and directories, with metadata consistent with the archive pathname. */\nfunction assertOrdinaryArchiveEntry(entry: Entry, entryKind: 'directory' | 'file'): void {\n const unixFileType = (entry.externalFileAttributes >>> 16) & UNIX_FILE_TYPE_MASK;\n if (\n unixFileType !== 0 &&\n unixFileType !== UNIX_DIRECTORY_TYPE &&\n unixFileType !== UNIX_REGULAR_FILE_TYPE\n ) {\n throw new Error('Source JAR contains an unsupported link or special entry.');\n }\n if (isInconsistentArchiveEntryType(entryKind, unixFileType)) {\n throw new Error('Source JAR contains an inconsistent archive entry type.');\n }\n}\n\n/*** Detects conflicting Unix file-type metadata without requiring it from every ZIP producer. */\nfunction isInconsistentArchiveEntryType(\n entryKind: 'directory' | 'file',\n unixFileType: number\n): boolean {\n return (\n (entryKind === 'directory' && unixFileType === UNIX_REGULAR_FILE_TYPE) ||\n (entryKind === 'file' && unixFileType === UNIX_DIRECTORY_TYPE)\n );\n}\n\n/*** Rejects duplicate targets and file-directory collisions before archive extraction mutates disk. */\nfunction assertDistinctArchiveEntry(\n entries: Map<string, 'directory' | 'file'>,\n filename: string,\n kind: 'directory' | 'file'\n): void {\n const path = kind === 'directory' ? filename.slice(0, -1) : filename;\n if (entries.has(path)) throw new Error('Source JAR contains duplicate archive entries.');\n\n const segments = path.split('/');\n const parentPaths = segments\n .slice(0, -1)\n .map((_, index) => segments.slice(0, index + 1).join('/'));\n if (parentPaths.some(parentPath => entries.get(parentPath) === 'file')) {\n throw new Error('Source JAR contains colliding archive entries.');\n }\n if (kind === 'file' && [...entries.keys()].some(entryPath => entryPath.startsWith(`${path}/`))) {\n throw new Error('Source JAR contains colliding archive entries.');\n }\n entries.set(path, kind);\n}\n\n/*** Counts actual decompressed bytes because ZIP metadata cannot be trusted as a size bound. */\nfunction createExtractedSizeLimit(maxUncompressedSize: number): () => Transform {\n let extractedSize = 0;\n return () =>\n new Transform({\n transform(chunk: Buffer, _encoding, callback) {\n extractedSize += chunk.length;\n if (extractedSize > maxUncompressedSize) {\n callback(new Error('Source JAR expands beyond the supported size limit.'));\n return;\n }\n callback(null, chunk);\n },\n });\n}\n\n/*** Limits test-controlled archive budgets to stricter values than the production security ceiling. */\nfunction getSourceJarLimits(overrides: Partial<SourceJarLimits> | undefined): SourceJarLimits {\n return {\n maxEntryCount: getRestrictedLimit(overrides?.maxEntryCount, SOURCE_JAR_LIMITS.maxEntryCount),\n maxUncompressedSize: getRestrictedLimit(\n overrides?.maxUncompressedSize,\n SOURCE_JAR_LIMITS.maxUncompressedSize\n ),\n };\n}\n\n/*** Rejects invalid limits and prevents callers from weakening production archive protection. */\nfunction getRestrictedLimit(override: number | undefined, maximum: number): number {\n if (override === undefined) return maximum;\n if (!Number.isSafeInteger(override) || override <= 0 || override > maximum) {\n throw new Error('Source JAR limit must be a positive integer within the supported maximum.');\n }\n return override;\n}\n\n/*** Closes an open ZIP reader so cancellation releases its file descriptor without double-closing. */\nfunction closeZip(zip: ZipFile): void {\n if (zip.isOpen) zip.close();\n}\n\n/*** Stops archive work at the adapter boundary while preserving an explicit abort reason. */\nfunction throwIfAborted(signal: AbortSignal | undefined): void {\n if (signal?.aborted) throw getAbortError(signal);\n}\n\n/*** Creates the standard cancellation error when callers did not supply an Error reason. */\nfunction getAbortError(signal: AbortSignal): Error {\n return signal.reason instanceof Error\n ? signal.reason\n : new DOMException('The source JAR operation was aborted.', 'AbortError');\n}\n\n/*** Leaves existing directory and missing-path handling to the canonical project-analysis boundary. */\nasync function getSourceStatsAsync(sourcePath: string) {\n try {\n return await stat(sourcePath);\n } catch {\n return null;\n }\n}\n\n/*** Restricts archive handling to an explicit JAR input form before opening a ZIP reader. */\nfunction isJarPath(sourcePath: string): boolean {\n return sourcePath.toLowerCase().endsWith('.jar');\n}\n\n/*** Verifies the ZIP local-file signature before allocating an extraction root or parsing an archive. */\nasync function assertZipSignatureAsync(sourcePath: string): Promise<void> {\n const source = await open(sourcePath, 'r');\n try {\n const header = Buffer.alloc(ZIP_LOCAL_FILE_HEADER.length);\n const { bytesRead } = await source.read(header, 0, header.length, 0);\n if (bytesRead !== ZIP_LOCAL_FILE_HEADER.length || !header.equals(ZIP_LOCAL_FILE_HEADER)) {\n throw new Error('Unsupported local archive input: provide a valid source JAR file.');\n }\n } finally {\n await source.close();\n }\n}\n\n/*** Resolves one validated archive entry and proves that it remains inside the temporary root. */\nfunction resolveArchiveEntryPath(temporaryRoot: string, filename: string): string {\n const targetPath = resolve(temporaryRoot, filename);\n const targetRelativePath = relative(temporaryRoot, targetPath);\n if (\n targetRelativePath === '' ||\n targetRelativePath === '..' ||\n targetRelativePath.startsWith(`..${sep}`) ||\n isAbsolute(targetRelativePath)\n ) {\n throw new Error('Source JAR contains an unsafe entry path.');\n }\n return targetPath;\n}\n\n/*** Derives display-only project identity without exposing the isolated extraction location. */\nfunction getProjectName(sourcePath: string): string {\n return basename(sourcePath).replace(/\\.jar$/iu, '') || '{unknown}';\n}\n\n/*** Preserves actionable input errors while hiding host paths and archive implementation details. */\nfunction createSourceJarError(error: unknown): Error {\n if (\n error instanceof Error &&\n (error.message.startsWith('Source JAR') || error.message.startsWith('Unsupported binary JAR'))\n ) {\n return error;\n }\n return new Error('Unsupported local archive input: provide a valid source JAR file.', {\n cause: error,\n });\n}\n","/*** Convert backslash path separators to portable forward slashes without normalizing path segments. */\nexport function toPortablePath(value: string): string {\n return value.replaceAll('\\\\', '/');\n}\n","import type { GraphEdge, GraphNode } from '@ankhorage/graph';\n\nimport type {\n SourceEdgeData,\n SourceGraph,\n SourceGraphIndex,\n SourceNodeData,\n} from '../../../types/sourceGraph.js';\n\n/*** Build reusable semantic and adjacency indexes once from observed source facts. */\nexport function createSourceGraphIndex(sourceGraph: SourceGraph): SourceGraphIndex {\n const nodeById = new Map<number, GraphNode<SourceNodeData, number>>();\n const nodeBySemanticPath = new Map<string, GraphNode<SourceNodeData, number>>();\n const fileByPath = new Map<string, GraphNode<SourceNodeData, number>>();\n const symbolsByFileAndName = new Map<string, GraphNode<SourceNodeData, number>[]>();\n const incomingByNodeId = new Map<number, GraphEdge<SourceEdgeData, number, number>[]>();\n const outgoingByNodeId = new Map<number, GraphEdge<SourceEdgeData, number, number>[]>();\n const parentByNodeId = new Map<number, number>();\n\n // Local map mutation constructs lookup tables without rescanning on consumer queries.\n for (const node of sourceGraph.graph.nodes) {\n nodeById.set(node.id, node);\n nodeBySemanticPath.set(node.data.semanticPath, node);\n incomingByNodeId.set(node.id, []);\n outgoingByNodeId.set(node.id, []);\n if (node.data.kind === 'file' && node.data.path !== undefined) {\n fileByPath.set(fileKey(node.data.projectId, node.data.path), node);\n }\n if (node.data.filePath !== undefined && isDeclaration(node.data.kind)) {\n const key = symbolKey(node.data.projectId, node.data.filePath, node.data.name);\n symbolsByFileAndName.set(key, [...(symbolsByFileAndName.get(key) ?? []), node]);\n }\n }\n\n for (const edge of sourceGraph.graph.edges) {\n outgoingByNodeId.get(edge.source)?.push(edge);\n incomingByNodeId.get(edge.target)?.push(edge);\n if (edge.data.kind === 'contains') {\n const existing = parentByNodeId.get(edge.target);\n if (existing !== undefined && existing !== edge.source) {\n throw new Error(`Source node ${edge.target} has multiple containment parents.`);\n }\n parentByNodeId.set(edge.target, edge.source);\n }\n }\n\n return {\n nodeById,\n nodeBySemanticPath,\n fileByPath,\n symbolsByFileAndName,\n incomingByNodeId,\n outgoingByNodeId,\n parentByNodeId,\n };\n}\n\n/*** Distinguish declarations from container and external-package nodes. */\nfunction isDeclaration(kind: SourceNodeData['kind']): boolean {\n return kind !== 'project' && kind !== 'package' && kind !== 'directory' && kind !== 'file';\n}\n\n/*** Scope a path lookup to one observed project. */\nfunction fileKey(projectId: string, path: string): string {\n return `${projectId}\\u0000${path}`;\n}\n\n/*** Scope a symbol lookup to its project, file, and human-readable name. */\nfunction symbolKey(projectId: string, path: string, name: string): string {\n return `${fileKey(projectId, path)}\\u0000${name}`;\n}\n","import type {\n JsonValue,\n RuleFinding,\n RuleResult,\n RuleResultDiagnostic,\n} from '../../../types/rules.js';\n\n/*** Snapshot a result into an immutable JSON-only value before dependent providers receive it. */\nexport function freezeRuleResult(result: RuleResult): RuleResult {\n return Object.freeze({\n ...result,\n diagnostics: Object.freeze(result.diagnostics.map(copyDiagnostic)),\n findings: Object.freeze(result.findings.map(copyFinding)),\n rule: Object.freeze({ ...result.rule }),\n scope: Object.freeze({ ...result.scope }),\n });\n}\n\n/*** Copy a diagnostic so providers cannot retain a mutable reference to evaluator state. */\nfunction copyDiagnostic(diagnostic: RuleResultDiagnostic): RuleResultDiagnostic {\n return Object.freeze({ ...diagnostic });\n}\n\n/*** Snapshot every nested provider finding value before sharing it with dependent providers. */\nfunction copyFinding(finding: RuleFinding): RuleFinding {\n return Object.freeze({\n ...finding,\n evidence: copyJsonValue(finding.evidence),\n sourceLocation:\n finding.sourceLocation === undefined\n ? undefined\n : Object.freeze({ ...finding.sourceLocation }),\n subjects: Object.freeze(finding.subjects.map((subject) => Object.freeze({ ...subject }))),\n });\n}\n\n/*** Copy and deeply freeze the JSON-only evidence contract at the dependency boundary. */\nfunction copyJsonValue(value: JsonValue): JsonValue {\n if (Array.isArray(value)) return Object.freeze(value.map(copyJsonValue));\n if (value !== null && typeof value === 'object') {\n return Object.freeze(\n Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, copyJsonValue(entry)])),\n );\n }\n return value;\n}\n","import type { ArchitectureModel } from '../../../types/architectureModel.js';\nimport { ARCHITECTURE_MODELS } from '../constants/architectureModels.js';\n\n/*** Resolve one built-in architecture model or reject an unsupported explicit target. */\nexport function findArchitectureModel(modelId: ArchitectureModel['id']): ArchitectureModel {\n const model = ARCHITECTURE_MODELS.find(({ id }) => id === modelId);\n if (model === undefined) throw new Error(`Unknown architecture model: ${modelId}`);\n return model;\n}\n","import type { Graph, GraphId } from '../../../types/graph.js';\nimport { findStronglyConnectedComponents } from './findStronglyConnectedComponents.js';\n\n/*** Return strongly connected components that represent graph cycles. */\nexport function findCyclicComponents<\n NodeData,\n EdgeData,\n NodeId extends GraphId = string,\n EdgeId extends GraphId = NodeId,\n>(graph: Graph<NodeData, EdgeData, NodeId, EdgeId>): readonly (readonly NodeId[])[] {\n const selfLoops = new Set(\n graph.edges.filter((edge) => edge.source === edge.target).map((edge) => edge.source),\n );\n\n return findStronglyConnectedComponents(graph).filter(\n (component) =>\n component.length > 1 || (component[0] !== undefined && selfLoops.has(component[0])),\n );\n}\n","unable to read source [project]/node_modules/@ankhorage/repository/src/providers/github/services/resolveGitHubUrlRevisionAsync.ts","import type { SourceEdgeData, SourceGraph, SourceNodeData } from '@ankhorage/dependency-graph';\nimport type { Rule, RuleEvaluationOutcome, RuleFinding, RuleSet } from '@ankhorage/rules';\n\nimport type {\n ArchitectureProfile,\n ArchitectureProfileRole,\n ArchitectureProfileRuleContext,\n} from '../../../types/architectureProfile.js';\nimport { findArchitectureProfile } from './findArchitectureProfile.js';\n\n/*** Create the rule set for one explicitly selected project architecture profile. */\nexport function createArchitectureProfileRuleSet(\n profileId: ArchitectureProfile['id'],\n): RuleSet<ArchitectureProfileRuleContext> {\n const profile = findArchitectureProfile(profileId);\n return {\n id: 'architecture-profile.' + profile.id,\n rules: [\n featureOwnershipRule(),\n roleCombinationRule(),\n ...profile.source.roles.map(roleDirectionRule),\n thinDeliveryAdapterRule(),\n ],\n };\n}\n\n/*** Require source implementation ownership below canonical feature or package-wide roots. */\nfunction featureOwnershipRule(): Rule<ArchitectureProfileRuleContext> {\n return createRule(\n 'package.architecture.feature-ownership.required',\n 'Implementation source must live below an owning feature, package-wide root, or delivery edge.',\n ({ graph, profile }) =>\n sourceFilePaths(graph).flatMap((path) =>\n isAllowedSourcePath(path, profile)\n ? []\n : [\n finding(\n 'package.architecture.feature-ownership.required',\n 'Source implementation is outside canonical Ankhorage ownership: ' + path + '.',\n path,\n { path },\n ),\n ],\n ),\n );\n}\n\n/*** Require adapters and composition roles to coexist with a meaningful inward owner. */\nfunction roleCombinationRule(): Rule<ArchitectureProfileRuleContext> {\n return createRule(\n 'package.architecture.role-combination.invalid',\n 'Feature architecture roles must form a meaningful inward/outward combination.',\n ({ graph, profile }) => {\n const rolesByFeature = collectFeatureRoles(graph, profile);\n return [...rolesByFeature.entries()].flatMap(([feature, roles]) =>\n profile.source.featureCombinations.flatMap((combination) =>\n roles.has(combination.role) &&\n !combination.requiresAnyOf.some((required) => roles.has(required))\n ? [\n finding(\n combination.ruleId,\n combination.role +\n '/ requires at least one inward role in feature ' +\n feature +\n '.',\n profile.source.featureRoot + '/' + feature,\n {\n feature,\n role: combination.role,\n requiresAnyOf: combination.requiresAnyOf,\n },\n ),\n ]\n : [],\n ),\n );\n },\n );\n}\n\n/*** Reject imports from one configured inward role into its outward implementation roles. */\nfunction roleDirectionRule(role: ArchitectureProfileRole): Rule<ArchitectureProfileRuleContext> {\n return createRule(\n role.ruleId,\n role.label + ' must not import outward implementation roles.',\n ({ graph }) =>\n importRelations(graph).flatMap(({ edge, sourcePath, targetPath }) => {\n const sourceSegments = splitPath(sourcePath);\n if (!sourceSegments.some((segment) => role.segments.includes(segment))) return [];\n const targetSegments = splitPath(targetPath);\n const outwardRole = targetSegments.find((segment) =>\n role.forbiddenOutwardSegments.includes(segment),\n );\n if (outwardRole === undefined) return [];\n return [\n finding(\n role.ruleId,\n role.label + ' must not import outward ' + outwardRole + '/ implementation.',\n sourcePath,\n {\n outwardRole,\n sourcePath,\n targetPath,\n },\n firstEvidence(edge),\n ),\n ];\n }),\n true,\n );\n}\n\n/*** Keep package-level CLI commands thin by rejecting direct imports of concrete adapters. */\nfunction thinDeliveryAdapterRule(): Rule<ArchitectureProfileRuleContext> {\n return createRule(\n 'package.architecture.delivery-concrete-adapter-import.disallowed',\n 'Thin delivery adapters must not wire concrete adapter implementations directly.',\n ({ graph, profile }) => {\n const delivery = profile.source.thinDeliveryAdapter;\n return importRelations(graph).flatMap(({ edge, sourcePath, targetPath }) => {\n const sourceSegments = splitPath(sourcePath);\n const targetSegments = splitPath(targetPath);\n return includesSegmentSequence(sourceSegments, delivery.pathSegments) &&\n targetSegments.includes(delivery.concreteAdapterSegment)\n ? [\n finding(\n delivery.ruleId,\n 'Thin delivery adapter must import an application operation or composition boundary instead of a concrete adapter.',\n sourcePath,\n { sourcePath, targetPath },\n firstEvidence(edge),\n ),\n ]\n : [];\n });\n },\n true,\n );\n}\n\n/*** Build one error-level architecture-profile rule. */\nfunction createRule(\n id: string,\n summary: string,\n evaluate: (context: ArchitectureProfileRuleContext) => readonly RuleFinding[],\n requiresImports = false,\n): Rule<ArchitectureProfileRuleContext> {\n return {\n identity: { id, version: '1' },\n facets: [{ id: 'architecture-rule-kind', value: 'profile', version: '1' }],\n summary,\n defaultSeverity: 'error',\n dependencies: [],\n ...(requiresImports ? { requiredCapabilities: ['source-graph.imports'] } : {}),\n evaluate: ({ context }) => outcome(evaluate(context)),\n };\n}\n\n/*** Convert complete architecture-profile evidence into the canonical rule outcome. */\nfunction outcome(findings: readonly RuleFinding[]): RuleEvaluationOutcome {\n return { findings, status: findings.length === 0 ? 'PASS' : 'FAIL' };\n}\n\n/*** Build one portable profile finding with optional graph source evidence. */\nfunction finding(\n ruleId: string,\n message: string,\n path: string,\n evidence: RuleFinding['evidence'],\n relationEvidence?: SourceEdgeData['evidence'][number],\n): RuleFinding {\n return {\n ruleId,\n severity: 'error',\n message,\n subjects: [{ id: path, kind: 'source-file', path }],\n evidence,\n sourceLocation:\n relationEvidence?.location === undefined\n ? undefined\n : { ...relationEvidence.location, path: relationEvidence.sourcePath },\n };\n}\n\n/*** Collect intrinsic source file paths once from the factual graph. */\nfunction sourceFilePaths(graph: SourceGraph): readonly string[] {\n return graph.graph.nodes.flatMap(({ data }) => {\n if (data.kind !== 'file' || data.classification === 'vendor') return [];\n const path = nodePath(data);\n return path?.startsWith('src/') === true ? [path] : [];\n });\n}\n\n/*** Return whether one source file belongs to an allowed Ankhorage ownership root. */\nfunction isAllowedSourcePath(path: string, profile: ArchitectureProfile): boolean {\n const sourcePath = path.slice('src/'.length);\n if (profile.source.facadeFiles.includes(sourcePath)) return true;\n if (path === profile.source.featureRoot || path.startsWith(profile.source.featureRoot + '/')) {\n return true;\n }\n const root = splitPath(sourcePath)[0] ?? '';\n return (\n profile.source.packageWideDirectories.includes(root) ||\n profile.source.deliveryEdgeDirectories.includes(root)\n );\n}\n\n/*** Collect direct feature role directories from factual file paths. */\nfunction collectFeatureRoles(\n graph: SourceGraph,\n profile: ArchitectureProfile,\n): ReadonlyMap<string, ReadonlySet<string>> {\n const prefix = profile.source.featureRoot + '/';\n const roles = new Map<string, Set<string>>();\n for (const path of sourceFilePaths(graph)) {\n if (!path.startsWith(prefix)) continue;\n const [feature, role] = splitPath(path.slice(prefix.length));\n if (feature === undefined || role === undefined) continue;\n const featureRoles = roles.get(feature) ?? new Set<string>();\n featureRoles.add(role);\n roles.set(feature, featureRoles);\n }\n return roles;\n}\n\ninterface ImportRelation {\n readonly edge: {\n readonly data: SourceEdgeData;\n readonly source: number;\n readonly target: number;\n };\n readonly sourcePath: string;\n readonly targetPath: string;\n}\n\n/*** Project factual import edges into source/target file paths. */\nfunction importRelations(graph: SourceGraph): readonly ImportRelation[] {\n const nodeById = new Map(graph.graph.nodes.map((node) => [node.id, node.data]));\n return graph.graph.edges.flatMap((edge) => {\n if (edge.data.kind !== 'imports') return [];\n const source = nodeById.get(edge.source);\n const target = nodeById.get(edge.target);\n if (source === undefined || target === undefined) return [];\n const sourcePath = nodePath(source);\n const targetPath = nodePath(target);\n return sourcePath === undefined || targetPath === undefined\n ? []\n : [{ edge, sourcePath, targetPath }];\n });\n}\n\n/*** Resolve the project-relative path represented by a factual source node. */\nfunction nodePath(node: SourceNodeData): string | undefined {\n return node.path ?? node.filePath;\n}\n\n/*** Return the first source-location evidence for one observed import. */\nfunction firstEvidence(edge: {\n readonly data: SourceEdgeData;\n}): SourceEdgeData['evidence'][number] | undefined {\n return edge.data.evidence[0];\n}\n\n/*** Check whether one path segment sequence occurs contiguously in another. */\nfunction includesSegmentSequence(\n segments: readonly string[],\n expected: readonly string[],\n): boolean {\n return segments.some((_, index) =>\n expected.every((segment, offset) => segments[index + offset] === segment),\n );\n}\n\n/*** Split portable source paths into normalized architecture segments. */\nfunction splitPath(path: string): readonly string[] {\n return path.split('/').filter(Boolean);\n}\n","import type { WorkspaceAnalysisCacheKey } from '@/types/workspace';\n\n/*** Create bounded in-memory discovery and immutable-revision analysis caches for one browser session. */\nexport function createWorkspaceAnalysisCache<Value>(\n maximumEntries: number\n): WorkspaceAnalysisCache<Value> {\n if (!Number.isInteger(maximumEntries) || maximumEntries < 1) {\n throw new Error('Workspace analysis cache requires at least one entry.');\n }\n const discovery = new Map<string, unknown>();\n const analysis = new Map<string, Value>();\n return {\n clearRepository: repositoryId => {\n for (const key of analysis.keys()) {\n if (key.includes(`|${repositoryId}|`)) analysis.delete(key);\n }\n },\n getAnalysis: key => readMostRecent(analysis, serializeAnalysisKey(key)),\n getDiscovery: key => readMostRecent(discovery, key),\n setAnalysis: (key, value) =>\n writeBounded(analysis, serializeAnalysisKey(key), value, maximumEntries),\n setDiscovery: (key, value) => writeBounded(discovery, key, value, maximumEntries),\n };\n}\n\n/*** Serialize all authorization, provider, repository, revision, and schema dimensions into a cache key. */\nfunction serializeAnalysisKey(key: WorkspaceAnalysisCacheKey): string {\n return [key.authorization, key.provider, key.repositoryId, key.revision, key.schemaVersion].join(\n '|'\n );\n}\n\n/*** Read an entry and promote it so bounded eviction preserves recently reopened workspaces. */\nfunction readMostRecent<Value>(entries: Map<string, Value>, key: string): Value | undefined {\n const value = entries.get(key);\n if (value === undefined) return undefined;\n entries.delete(key);\n entries.set(key, value);\n return value;\n}\n\n/*** Insert an entry and evict the least recently used value when the explicit cache bound is exceeded. */\nfunction writeBounded<Value>(\n entries: Map<string, Value>,\n key: string,\n value: Value,\n maximumEntries: number\n): void {\n entries.delete(key);\n entries.set(key, value);\n while (entries.size > maximumEntries) {\n const oldest = entries.keys().next().value;\n if (oldest === undefined) return;\n entries.delete(oldest);\n }\n}\n\nexport interface WorkspaceAnalysisCache<Value> {\n readonly clearRepository: (repositoryId: string) => void;\n readonly getAnalysis: (key: WorkspaceAnalysisCacheKey) => Value | undefined;\n readonly getDiscovery: (key: string) => unknown;\n readonly setAnalysis: (key: WorkspaceAnalysisCacheKey, value: Value) => void;\n readonly setDiscovery: (key: string, value: unknown) => void;\n}\n","import { toPortablePath } from '@ankhorage/utility/node/path';\n\n/*** Returns the configured project path in portable POSIX form. */\nexport const parseProjectPath = (projectPath = process.env.ATLAS_PROJECT_PATH) => {\n if (!projectPath) throw new Error('Missing ENV: ATLAS_PROJECT_PATH');\n\n return toPortablePath(projectPath);\n};\n","unable to read source [project]/node_modules/@ankhorage/repository/src/providers/github/services/resolveGitHubRepositoryRevisionWithGatewayAsync.ts","import type {\n JsonValue,\n Rule,\n RuleEvaluationCache,\n RuleEvaluationCacheKey,\n RuleEvaluationPlanNode,\n RuleFinding,\n RuleResult,\n RuleSeverity,\n} from '../../../types/rules.js';\nimport { compareRuleEntityIds } from '../../../utils/compareRuleEntityIds.js';\nimport { createRuleResult } from './createRuleResult.js';\nimport { writeCachedRuleResult } from './writeCachedRuleResult.js';\n\n/*** Invoke a provider, preserve its factual outcome, and cache only that genuine evaluation. */\nexport function evaluateRuleOutcome<TContext>(\n context: TContext,\n rule: Rule<TContext>,\n node: RuleEvaluationPlanNode,\n dependencyResults: readonly RuleResult[],\n options: JsonValue | undefined,\n cache: RuleEvaluationCache | undefined,\n cacheKey: RuleEvaluationCacheKey | null,\n): RuleResult {\n try {\n const outcome = rule.evaluate({\n context,\n dependencyResults: Object.freeze([...dependencyResults]),\n options,\n scope: node.scope,\n });\n const result = createRuleResult(\n rule,\n node,\n outcome.status,\n outcome.findings.map((finding) =>\n canonicalizeFinding(finding, rule.identity.id, rule.defaultSeverity),\n ),\n [],\n 'evaluated',\n );\n writeCachedRuleResult(cache, cacheKey, result);\n return result;\n } catch {\n return createRuleResult(\n rule,\n node,\n 'ERROR',\n [],\n [createRuleErrorDiagnostic(rule)],\n 'evaluated',\n );\n }\n}\n\n/*** Create a stable diagnostic when the evaluator catches a provider exception. */\nfunction createRuleErrorDiagnostic<TContext>(rule: Rule<TContext>) {\n return {\n code: 'rule-error' as const,\n ruleId: rule.identity.id,\n message: `Rule \"${rule.identity.id}\" threw while the evaluator invoked it.`,\n };\n}\n\n/*** Preserve provider evidence while making identifier and severity engine-controlled facts. */\nfunction canonicalizeFinding(\n finding: RuleFinding,\n ruleId: string,\n severity: RuleSeverity,\n): RuleFinding {\n return {\n ...finding,\n ruleId,\n severity,\n subjects: [...finding.subjects].sort(compareRuleEntityIds),\n };\n}\n","import {\n createSourceGraphIndex,\n rollupSourceRelations,\n type SourceGraph,\n type SourceRollupEdge,\n} from '@ankhorage/dependency-graph';\nimport { findCyclicComponents, type Graph } from '@ankhorage/graph';\nimport type {\n JsonValue,\n Rule,\n RuleEvaluationOutcome,\n RuleFinding,\n RuleOptionDiagnostic,\n} from '@ankhorage/rules';\n\nimport type {\n ArchitectureCycleRuleOptions,\n ArchitectureGraphRuleContext,\n} from '../../../types/architectureAnalysis.js';\n\nconst IMPORTS_CAPABILITY = 'source-graph.imports';\n\n/*** Create the reusable cyclic-dependencies rule for any context that exposes one SourceGraph. */\nexport function createCyclicDependenciesRule<\n TContext extends ArchitectureGraphRuleContext,\n>(): Rule<TContext> {\n return {\n identity: { id: 'cyclic-dependencies', version: '1' },\n facets: [{ id: 'architecture-rule-kind', value: 'cycle', version: '1' }],\n summary: 'Source dependencies must not form cyclic intrinsic components.',\n defaultSeverity: 'warning',\n dependencies: [],\n requiredCapabilities: [IMPORTS_CAPABILITY],\n validateOptions: validateCycleOptions,\n evaluate: ({ context, options }) =>\n outcome(cycleFindings(context.graph, readAggregation(options))),\n };\n}\n\n/*** Convert complete cycle evidence into the canonical rule outcome. */\nfunction outcome(findings: readonly RuleFinding[]): RuleEvaluationOutcome {\n return { findings, status: findings.length === 0 ? 'PASS' : 'FAIL' };\n}\n\n/*** Read the validated aggregation option while preserving the default file-level behavior. */\nfunction readAggregation(\n options: JsonValue | undefined,\n): NonNullable<ArchitectureCycleRuleOptions['aggregation']> {\n if (!isCycleOptionsRecord(options)) return 'file';\n const { aggregation } = options;\n return aggregation === 'package' ? 'package' : 'file';\n}\n\n/*** Validate the optional cycle aggregation level without consumer-specific configuration. */\nfunction validateCycleOptions(options: JsonValue | undefined): readonly RuleOptionDiagnostic[] {\n if (options === undefined) return [];\n if (!isCycleOptionsRecord(options))\n return [{ code: 'invalid-options', message: 'Options must be an object.' }];\n const { aggregation } = options;\n if (aggregation === undefined || aggregation === 'file' || aggregation === 'package') return [];\n return [\n {\n code: 'invalid-options',\n message: 'aggregation must be \"file\" or \"package\".',\n path: 'aggregation',\n },\n ];\n}\n\n/*** Convert canonical source dependencies into deterministic generic cycle findings. */\nfunction cycleFindings(\n sourceGraph: SourceGraph,\n aggregation: NonNullable<ArchitectureCycleRuleOptions['aggregation']>,\n): readonly RuleFinding[] {\n const cycleGraph =\n aggregation === 'file' ? fileCycleGraph(sourceGraph) : packageCycleGraph(sourceGraph);\n const nodeById = new Map(cycleGraph.graph.nodes.map((node) => [node.id, node.data]));\n return findCyclicComponents(cycleGraph.graph).map((component) => {\n const componentIds = new Set(component);\n const semanticPaths = component\n .flatMap((id) => {\n const node = nodeById.get(id);\n return node === undefined ? [] : [node.semanticPath];\n })\n .sort();\n const evidenceEdgeIds = cycleGraph.evidence\n .filter(({ source, target }) => componentIds.has(source) && componentIds.has(target))\n .flatMap(({ evidenceEdgeIds }) => evidenceEdgeIds)\n .sort((left, right) => left - right);\n\n return {\n ruleId: 'cyclic-dependencies',\n severity: 'warning',\n message: `Cyclic ${aggregation} dependency component: ${semanticPaths.join(' -> ')}`,\n subjects: semanticPaths.map((path) => ({ id: path, kind: 'source-node', path })),\n evidence: {\n aggregation,\n evidenceEdgeIds,\n relationKind: 'imports',\n semanticPaths,\n },\n };\n });\n}\n\ninterface CycleGraph {\n readonly graph: Graph<SourceGraph['graph']['nodes'][number]['data'], unknown, number>;\n readonly evidence: readonly SourceRollupEdge[];\n}\n\n/*** Build a file-level cycle graph while preserving original edge IDs as evidence references. */\nfunction fileCycleGraph(sourceGraph: SourceGraph): CycleGraph {\n const fileIds = new Set(\n sourceGraph.graph.nodes\n .filter(({ data }) => data.kind === 'file' && data.classification === 'intrinsic')\n .map(({ id }) => id),\n );\n const edges = sourceGraph.graph.edges.filter(\n ({ source, target, data }) =>\n data.kind === 'imports' && fileIds.has(source) && fileIds.has(target),\n );\n return {\n graph: {\n nodes: sourceGraph.graph.nodes.filter(({ id }) => fileIds.has(id)),\n edges: edges.map(({ id, source, target }) => ({ id, source, target, data: {} })),\n },\n evidence: edges.map(({ id, source, target }) => ({\n source,\n target,\n sourceSemanticPath: '',\n targetSemanticPath: '',\n weight: 1,\n evidenceEdgeIds: [id],\n })),\n };\n}\n\n/*** Build a package-level cycle graph from the canonical deterministic import rollup. */\nfunction packageCycleGraph(sourceGraph: SourceGraph): CycleGraph {\n const index = createSourceGraphIndex(sourceGraph);\n const rollups = rollupSourceRelations(sourceGraph, index, 'package', 'imports');\n const intrinsicPackageIds = new Set(\n sourceGraph.graph.nodes\n .filter(\n ({ data }) =>\n data.kind === 'package' &&\n data.classification !== 'vendor' &&\n data.classification !== 'unknown',\n )\n .map(({ id }) => id),\n );\n const edges = rollups.filter(\n ({ source, target }) => intrinsicPackageIds.has(source) && intrinsicPackageIds.has(target),\n );\n return {\n graph: {\n nodes: sourceGraph.graph.nodes.filter(({ id }) => intrinsicPackageIds.has(id)),\n edges: edges.map(({ source, target }, index) => ({ id: index, source, target, data: {} })),\n },\n evidence: edges,\n };\n}\n\n/*** Narrow only the cyclic-dependency option object accepted by this Rule. */\nfunction isCycleOptionsRecord(\n value: JsonValue | undefined,\n): value is Readonly<Record<string, JsonValue>> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n","import type { SourceCapability, SourceRelationKind } from '@ankhorage/dependency-graph';\nimport type { Rule, RuleEvaluationOutcome, RuleFinding, RuleSet } from '@ankhorage/rules';\n\nimport type { ArchitectureRuleContext } from '../../../types/architectureAnalysis.js';\nimport type { ArchitectureModel } from '../../../types/architectureModel.js';\nimport { hasSourceCapability } from '../../../utils/hasSourceCapability.js';\nimport { findArchitectureModel } from '../../models/domain/findArchitectureModel.js';\nimport { createCyclicDependenciesRule } from './createCyclicDependenciesRule.js';\n\nconst DEPENDENCY_RELATIONS: readonly (readonly [SourceRelationKind, SourceCapability])[] = [\n ['imports', 'imports'],\n ['extends', 'extends'],\n ['implements', 'implements'],\n];\n\n/*** Create architecture rules for one explicitly selected target model. */\nexport function createArchitectureRuleSet(\n modelId: ArchitectureModel['id'],\n): RuleSet<ArchitectureRuleContext> {\n const model = findArchitectureModel(modelId);\n return {\n id: `architecture.${model.id}`,\n rules: [createCyclicDependenciesRule<ArchitectureRuleContext>(), dependencyDirectionRule()],\n };\n}\n\n/*** Enforce dependency direction only against the explicit selected target model. */\nfunction dependencyDirectionRule(): Rule<ArchitectureRuleContext> {\n return {\n identity: { id: 'architecture-dependency-direction', version: '1' },\n facets: [{ id: 'architecture-rule-kind', value: 'dependency-direction', version: '1' }],\n summary: 'Classified source dependencies must follow the selected architecture model.',\n defaultSeverity: 'warning',\n dependencies: [],\n evaluate: ({ context }) => directionOutcome(context),\n };\n}\n\n/*** Preserve available direction findings while marking incomplete relation coverage explicitly. */\nfunction directionOutcome(context: ArchitectureRuleContext): RuleEvaluationOutcome {\n const availableRelations = availableDependencyRelations(context.graph);\n const findings = directionFindings(context, availableRelations);\n return {\n findings,\n status:\n availableRelations.length === DEPENDENCY_RELATIONS.length\n ? findings.length === 0\n ? 'PASS'\n : 'FAIL'\n : 'INCOMPLETE',\n };\n}\n\n/*** Report selected-model dependency violations for confidently inferred endpoint roles. */\nfunction directionFindings(\n context: ArchitectureRuleContext,\n availableRelations: readonly SourceRelationKind[],\n): readonly RuleFinding[] {\n const roleByPath = new Map(\n context.roleAssignments.map((assignment) => [assignment.semanticPath, assignment]),\n );\n const nodeById = new Map(context.graph.graph.nodes.map((node) => [node.id, node.data]));\n\n return context.graph.graph.edges.flatMap((edge) => {\n if (!availableRelations.includes(edge.data.kind)) return [];\n const source = nodeById.get(edge.source);\n const target = nodeById.get(edge.target);\n if (source === undefined || target === undefined) return [];\n const sourceRole = roleByPath.get(source.semanticPath);\n const targetRole = roleByPath.get(target.semanticPath);\n if (sourceRole === undefined || targetRole === undefined) return [];\n if (sourceRole.confidence < 0.3 || targetRole.confidence < 0.3) return [];\n const allowed = context.model.allowedDependencies.some(\n (dependency) =>\n dependency.source === sourceRole.roleId && dependency.target === targetRole.roleId,\n );\n if (allowed) return [];\n\n const [evidence] = edge.data.evidence;\n return [\n {\n ruleId: 'architecture-dependency-direction',\n severity: 'warning',\n message: `${sourceRole.roleId} must not depend on ${targetRole.roleId} in ${context.model.name}.`,\n subjects: [\n { id: source.semanticPath, kind: source.kind, path: source.filePath ?? source.path },\n { id: target.semanticPath, kind: target.kind, path: target.filePath ?? target.path },\n ],\n sourceLocation:\n evidence?.location === undefined\n ? undefined\n : { ...evidence.location, path: evidence.sourcePath },\n evidence: {\n modelId: context.model.id,\n relationKind: edge.data.kind,\n sourceRole: sourceRole.roleId,\n sourceSemanticPath: source.semanticPath,\n targetRole: targetRole.roleId,\n targetSemanticPath: target.semanticPath,\n },\n },\n ];\n });\n}\n\n/*** Read relation kinds backed by complete analyzer evidence for every inspected project. */\nfunction availableDependencyRelations(\n graph: ArchitectureRuleContext['graph'],\n): readonly SourceRelationKind[] {\n return DEPENDENCY_RELATIONS.flatMap(([relation, capability]) =>\n hasSourceCapability(graph, capability) ? [relation] : [],\n );\n}\n","import { buildProjectTree } from '@/features/project-tree/application/use-cases/buildProjectTree';\nimport type { ProjectOverview, WorkspaceSnapshot } from '@/types/workspace';\n\n/*** Rebuilds the workspace view model from the portable Audit without host-specific analysis. */\nexport function hydrateWorkspaceSnapshot(snapshot: WorkspaceSnapshot): ProjectOverview {\n return {\n evaluation: snapshot.audit.evaluation,\n packageGraph: snapshot.audit.packageGraph,\n projectIdentity: createProjectIdentity(snapshot),\n tree: snapshot.navigationTree ?? buildProjectTree(snapshot.audit.files),\n };\n}\n\n/*** Creates a stable browser-safe scope for workspace preferences without exposing a local path. */\nfunction createProjectIdentity(snapshot: WorkspaceSnapshot): string {\n if (snapshot.audit.meta.workspaceIdentity !== undefined)\n return snapshot.audit.meta.workspaceIdentity;\n const { source } = snapshot.audit.meta;\n if (source !== undefined) return `github:${source.url}@${source.revision}`;\n const fingerprint = Array.from(\n JSON.stringify({ files: snapshot.audit.files, graph: snapshot.audit.packageGraph })\n ).reduce((hash, character) => ((hash ^ character.charCodeAt(0)) * 16777619) >>> 0, 2166136261);\n return `snapshot:${fingerprint.toString(36)}`;\n}\n","import type { ProjectFileMetadata, ProjectFileTree } from '@/types/projectFiles';\nimport type { ProjectTreeNode } from '@/types/projectTree';\n\n/*** Converts project file metadata into the serializable hierarchy consumed by the sidebar. */\nexport function buildProjectTree(\n directory: ProjectFileTree,\n parentPath = ''\n): readonly ProjectTreeNode[] {\n return Object.entries(directory)\n .sort(compareEntries)\n .map(([name, value]) => {\n const itemPath = parentPath ? `${parentPath}/${name}` : name;\n if (isProjectFileMetadata(value)) {\n return {\n graphPackage: value.package,\n id: `file:${itemPath}`,\n kind: 'file' as const,\n label: name,\n };\n }\n\n const children = buildProjectTree(value, itemPath);\n return {\n children,\n graphPackage: getCommonGraphPackage(children),\n id: `directory:${itemPath}`,\n kind: 'directory' as const,\n label: name,\n };\n });\n}\n\n/*** Sorts folders before files while keeping each group alphabetic. */\nfunction compareEntries(\n [leftName, left]: [string, ProjectFileTree | ProjectFileMetadata],\n [rightName, right]: [string, ProjectFileTree | ProjectFileMetadata]\n) {\n const kindDelta = Number(isProjectFileMetadata(left)) - Number(isProjectFileMetadata(right));\n return kindDelta || leftName.localeCompare(rightName);\n}\n\n/*** Derives the graph package represented by a filesystem directory from its descendants. */\nfunction getCommonGraphPackage(children: readonly ProjectTreeNode[]): string {\n const packages = children\n .map(child => child.graphPackage)\n .filter(packageName => packageName.length);\n const [firstPackage, ...remainingPackages] = packages;\n if (!firstPackage) return '';\n\n const firstSegments = firstPackage.split('.');\n const mismatchIndex = firstSegments.findIndex((segment, index) =>\n remainingPackages.some(packageName => packageName.split('.').at(index) !== segment)\n );\n const commonLength = mismatchIndex === -1 ? firstSegments.length : mismatchIndex;\n return firstSegments.slice(0, commonLength).join('.');\n}\n\n/*** Distinguishes project file metadata from recursive directory records without relying on class names. */\nfunction isProjectFileMetadata(\n value: ProjectFileTree | ProjectFileMetadata\n): value is ProjectFileMetadata {\n return 'path' in value && typeof value.path === 'string' && 'package' in value;\n}\n","unable to read source [project]/node_modules/@ankhorage/repository/src/providers/github/services/parseGitHubRepositoryUrl.ts","import type {\n EvaluateRulesOptions,\n JsonValue,\n Rule,\n RuleEvaluationDiagnostic,\n RuleEvaluationPlanNode,\n RuleEvaluationResult,\n RuleResult,\n RuleResultDiagnostic,\n} from '../../../types/rules.js';\nimport { compareRuleEntityIds } from '../../../utils/compareRuleEntityIds.js';\nimport { createRuleEvaluationCacheKey } from './createRuleEvaluationCacheKey.js';\nimport { createRuleEvaluationPlan } from './createRuleEvaluationPlan.js';\nimport { createRuleResult } from './createRuleResult.js';\nimport { evaluateRuleOutcome } from './evaluateRuleOutcome.js';\nimport { freezeRuleResult } from './freezeRuleResult.js';\nimport { readCachedRuleResult } from './readCachedRuleResult.js';\n\n/*** Evaluate a deterministic dependency plan once, passing completed child results to each provider. */\nexport function evaluateRules<TContext>(\n context: TContext,\n rules: readonly Rule<TContext>[],\n options: EvaluateRulesOptions = {},\n): RuleEvaluationResult {\n const plan = createRuleEvaluationPlan(rules, options);\n const rulesById = new Map(rules.map((rule) => [rule.identity.id, rule]));\n const diagnosticsByRuleId = groupDiagnosticsByRuleId(plan.diagnostics);\n const availableCapabilities = new Set(options.capabilities ?? []);\n const disabledRuleIds = new Set(options.disabledRuleIds ?? []);\n const resultsByRuleId = new Map<string, RuleResult>();\n\n for (const node of plan.nodes) {\n const rule = rulesById.get(node.rule.id);\n if (rule === undefined) continue;\n const result = evaluatePlanNode(\n context,\n rule,\n node,\n diagnosticsByRuleId.get(node.rule.id) ?? [],\n resultsByRuleId,\n availableCapabilities,\n disabledRuleIds,\n options,\n );\n resultsByRuleId.set(node.rule.id, result);\n }\n\n const results = plan.nodes.flatMap((node) => {\n const result = resultsByRuleId.get(node.rule.id);\n return result === undefined ? [] : [result];\n });\n return {\n diagnostics: [\n ...plan.diagnostics.filter((diagnostic) => !resultsByRuleId.has(diagnostic.ruleId)),\n ...results.flatMap(toEvaluationDiagnostics),\n ].sort(compareDiagnostics),\n findings: results.flatMap((result) => result.findings),\n plan,\n results,\n };\n}\n\n/*** Evaluate one planned rule only after plan, dependency, and provider prerequisites are complete. */\nfunction evaluatePlanNode<TContext>(\n context: TContext,\n rule: Rule<TContext>,\n node: RuleEvaluationPlanNode,\n planDiagnostics: readonly RuleEvaluationDiagnostic[],\n resultsByRuleId: ReadonlyMap<string, RuleResult>,\n availableCapabilities: ReadonlySet<string>,\n disabledRuleIds: ReadonlySet<string>,\n options: EvaluateRulesOptions,\n): RuleResult {\n const planFailure = createPlanFailureResult(rule, node, planDiagnostics);\n if (planFailure !== null) return planFailure;\n if (disabledRuleIds.has(rule.identity.id)) return createDisabledResult(rule, node);\n const dependencyResults = resolveDependencyResults(node, resultsByRuleId);\n const dependencyFailure = createDependencyFailureResult(rule, node, dependencyResults);\n if (dependencyFailure !== null) return dependencyFailure;\n const ruleOptions = options.optionsByRuleId?.get(rule.identity.id);\n const prerequisiteResult = evaluatePrerequisites(rule, node, availableCapabilities, ruleOptions);\n if (prerequisiteResult !== null) return prerequisiteResult;\n\n const cacheKey =\n options.cache === undefined\n ? null\n : createRuleEvaluationCacheKey(node, dependencyResults, options);\n const cachedResult =\n cacheKey === null ? undefined : readCachedRuleResult(options.cache, cacheKey, node);\n if (cachedResult !== undefined)\n return freezeRuleResult({ ...cachedResult, execution: 'cache-hit' });\n return evaluateRuleOutcome(\n context,\n rule,\n node,\n dependencyResults,\n ruleOptions,\n options.cache,\n cacheKey,\n );\n}\n/*** Convert planner failures into an evaluator error without invoking provider code. */\nfunction createPlanFailureResult<TContext>(\n rule: Rule<TContext>,\n node: RuleEvaluationPlanNode,\n diagnostics: readonly RuleEvaluationDiagnostic[],\n): RuleResult | null {\n const relevantDiagnostics = diagnostics.filter(\n (diagnostic) =>\n diagnostic.code === 'ambiguous-rule-id' ||\n diagnostic.code === 'cycle' ||\n diagnostic.code === 'missing-dependency',\n );\n return relevantDiagnostics.length === 0\n ? null\n : createRuleResult(rule, node, 'ERROR', [], relevantDiagnostics);\n}\n/*** Mark an explicitly disabled closure member incomplete without treating it as an executed provider. */\nfunction createDisabledResult<TContext>(\n rule: Rule<TContext>,\n node: RuleEvaluationPlanNode,\n): RuleResult {\n return createRuleResult(\n rule,\n node,\n 'INCOMPLETE',\n [],\n [\n {\n code: 'disabled-dependency',\n message: `Rule \"${rule.identity.id}\" is disabled for this evaluation.`,\n ruleId: rule.identity.id,\n },\n ],\n );\n}\n/*** Collect completed direct child results in the plan's stable dependency order. */\nfunction resolveDependencyResults(\n node: RuleEvaluationPlanNode,\n resultsByRuleId: ReadonlyMap<string, RuleResult>,\n): readonly RuleResult[] {\n return node.dependencyRuleIds.flatMap((dependencyRuleId) => {\n const dependencyResult = resultsByRuleId.get(dependencyRuleId);\n return dependencyResult === undefined ? [] : [dependencyResult];\n });\n}\n\n/*** Prevent a provider from running when a child could not establish complete execution evidence. */\nfunction createDependencyFailureResult<TContext>(\n rule: Rule<TContext>,\n node: RuleEvaluationPlanNode,\n dependencyResults: readonly RuleResult[],\n): RuleResult | null {\n const missingDependencyRuleIds = node.dependencyRuleIds.filter(\n (dependencyRuleId) => !dependencyResults.some((result) => result.rule.id === dependencyRuleId),\n );\n if (missingDependencyRuleIds.length > 0) {\n return createRuleResult(\n rule,\n node,\n 'ERROR',\n [],\n missingDependencyRuleIds.map((dependencyRuleId) => ({\n code: 'dependency-error',\n message: `Rule \"${rule.identity.id}\" could not receive result for dependency \"${dependencyRuleId}\".`,\n ruleId: rule.identity.id,\n })),\n );\n }\n const erroredDependencyRuleIds = dependencyResults\n .filter((result) => result.status === 'ERROR')\n .map((result) => result.rule.id);\n if (erroredDependencyRuleIds.length > 0) {\n return createRuleResult(\n rule,\n node,\n 'ERROR',\n [],\n erroredDependencyRuleIds.map((dependencyRuleId) => ({\n code: 'dependency-error',\n message: `Rule \"${rule.identity.id}\" depends on errored rule \"${dependencyRuleId}\".`,\n ruleId: rule.identity.id,\n })),\n );\n }\n return createIncompleteDependencyResult(rule, node, dependencyResults);\n}\n\n/*** Stop a parent after a child reports incomplete execution evidence. */\nfunction createIncompleteDependencyResult<TContext>(\n rule: Rule<TContext>,\n node: RuleEvaluationPlanNode,\n dependencyResults: readonly RuleResult[],\n): RuleResult | null {\n const incompleteDependencyRuleIds = dependencyResults\n .filter((result) => result.status === 'INCOMPLETE' || result.status === 'SKIPPED')\n .map((result) => result.rule.id);\n return incompleteDependencyRuleIds.length === 0\n ? null\n : createRuleResult(\n rule,\n node,\n 'INCOMPLETE',\n [],\n incompleteDependencyRuleIds.map((dependencyRuleId) => ({\n code: 'dependency-incomplete',\n message: `Rule \"${rule.identity.id}\" depends on incomplete rule \"${dependencyRuleId}\".`,\n ruleId: rule.identity.id,\n })),\n );\n}\n\n/*** Stop execution before a provider runs when its required direct inputs are unavailable. */\nfunction evaluatePrerequisites<TContext>(\n rule: Rule<TContext>,\n node: RuleEvaluationPlanNode,\n availableCapabilities: ReadonlySet<string>,\n ruleOptions: JsonValue | undefined,\n): RuleResult | null {\n const missingCapabilities = (rule.requiredCapabilities ?? []).filter(\n (capability) => !availableCapabilities.has(capability),\n );\n if (missingCapabilities.length > 0) {\n return createRuleResult(\n rule,\n node,\n 'INCOMPLETE',\n [],\n missingCapabilities.map((capability) => ({\n code: 'missing-capability',\n ruleId: rule.identity.id,\n message: `Rule \"${rule.identity.id}\" requires unavailable capability \"${capability}\".`,\n })),\n );\n }\n try {\n const optionDiagnostics = rule.validateOptions?.(ruleOptions) ?? [];\n return optionDiagnostics.length === 0\n ? null\n : createRuleResult(\n rule,\n node,\n 'ERROR',\n [],\n optionDiagnostics.map((diagnostic) => ({\n code: 'invalid-options',\n ruleId: rule.identity.id,\n message: `Rule \"${rule.identity.id}\": ${diagnostic.message}`,\n })),\n );\n } catch {\n return createRuleResult(rule, node, 'ERROR', [], [createRuleErrorDiagnostic(rule)]);\n }\n}\n\n/*** Create a stable diagnostic when provider option validation throws. */\nfunction createRuleErrorDiagnostic<TContext>(rule: Rule<TContext>): RuleResultDiagnostic {\n return {\n code: 'rule-error',\n ruleId: rule.identity.id,\n message: `Rule \"${rule.identity.id}\" threw while the evaluator invoked it.`,\n };\n}\n\n/*** Group plan diagnostics by affected rule for constant-time node evaluation. */\nfunction groupDiagnosticsByRuleId(\n diagnostics: readonly RuleEvaluationDiagnostic[],\n): ReadonlyMap<string, readonly RuleEvaluationDiagnostic[]> {\n const grouped = new Map<string, readonly RuleEvaluationDiagnostic[]>();\n for (const diagnostic of diagnostics) {\n const existingDiagnostics = grouped.get(diagnostic.ruleId) ?? [];\n grouped.set(diagnostic.ruleId, [...existingDiagnostics, diagnostic]);\n }\n return grouped;\n}\n\n/*** Expose per-rule diagnostics through the aggregate result without dropping identity. */\nfunction toEvaluationDiagnostics(result: RuleResult): readonly RuleEvaluationDiagnostic[] {\n return result.diagnostics.map((diagnostic) => ({\n ...diagnostic,\n ruleId: diagnostic.ruleId ?? result.rule.id,\n }));\n}\n\n/*** Sort aggregate diagnostics by stable rule identifier and diagnostic code. */\nfunction compareDiagnostics(\n left: RuleEvaluationDiagnostic,\n right: RuleEvaluationDiagnostic,\n): number {\n return (\n compareRuleEntityIds({ id: left.ruleId }, { id: right.ruleId }) ||\n compareRuleEntityIds({ id: left.code }, { id: right.code })\n );\n}\n","import { isRecord } from '@ankhorage/utility/object';\n\nimport { WorkspaceRepositoryRuntimeError } from '@/features/workspace/composition/createWorkspaceRepositoryRuntime';\n\n/*** Create the HTTP boundary that validates and retries one retained workspace repository. */\nexport function createWorkspaceRetryRoute(retryAsync: WorkspaceRepositoryRetryAsync) {\n return async function POST(request: Request): Promise<Response> {\n try {\n const body: unknown = await request.json();\n if (!isRetryRequest(body))\n return Response.json({ error: 'Invalid workspace retry request.' }, { status: 400 });\n return Response.json(await retryAsync(body.runtimeId, body.repositoryId, request));\n } catch (error) {\n return retryFailureResponse(error);\n }\n };\n}\n\n/*** Accept only opaque runtime and repository identifiers; source URLs and paths never cross this boundary. */\nfunction isRetryRequest(\n value: unknown\n): value is { readonly repositoryId: string; readonly runtimeId: string } {\n return (\n isRecord(value) && isOpaqueIdentifier(value.runtimeId) && isOpaqueIdentifier(value.repositoryId)\n );\n}\n\n/*** Reject empty or unbounded inputs before they reach process-local workspace state. */\nfunction isOpaqueIdentifier(value: unknown): value is string {\n return typeof value === 'string' && value.length > 0 && value.length <= 256;\n}\n\n/*** Translate trusted runtime failure classes without returning internal errors or paths to the browser. */\nfunction retryFailureResponse(error: unknown): Response {\n if (!(error instanceof WorkspaceRepositoryRuntimeError))\n return Response.json({ error: 'Unable to retry repository.' }, { status: 500 });\n const status =\n error.kind === 'invalid'\n ? 400\n : error.kind === 'unavailable'\n ? 410\n : error.kind === 'rate-limited'\n ? 429\n : 409;\n return Response.json({ error: error.message }, { status });\n}\n\ntype WorkspaceRepositoryRetryAsync = (\n runtimeId: string,\n repositoryId: string,\n request: Request\n) => Promise<unknown>;\n","import { materializeGitHubRepositoryAsync } from '@ankhorage/repository/github';\n\nimport type { GitHubProjectMaterializer } from '@/types/projectSource';\n\n/*** Adapt the repository package's GitHub materialization capability to Atlas project sources. */\nexport function createGitHubProjectMaterializer(): GitHubProjectMaterializer {\n return {\n materializeAsync: async (source, signal, authentication = 'anonymous') => {\n const result = await materializeGitHubRepositoryAsync({\n url: source.url,\n ...(source.revision === undefined ? {} : { ref: source.revision }),\n authentication,\n signal,\n });\n return {\n rootPath: result.rootPath,\n projectName: result.repository.name,\n revision: result.revision,\n cleanupAsync: result.cleanupAsync,\n };\n },\n };\n}\n","import { normalizeGitHubRepositoryUrl } from '@ankhorage/utility/url';\n\nimport type { ProjectSource } from '@/types/projectSource';\n\n/*** Parse one CLI/UI source while sharing canonical GitHub repository normalization. */\nexport function parseProjectSource(value: string): ProjectSource {\n const source = value.trim();\n if (source === '') throw new Error('Project source must not be empty.');\n\n try {\n return { kind: 'github', url: normalizeGitHubRepositoryUrl(source) };\n } catch (error) {\n if (source.includes('://') || source.startsWith('github.com/')) {\n throw new Error('Only local project paths and GitHub repository sources are supported.', {\n cause: error,\n });\n }\n return { kind: 'filesystem', path: source };\n }\n}\n","import type { GitHubRepositoryDiscoveryRepository } from '@ankhorage/repository/github';\n\nimport type { WorkspaceRepositoryLoadStatus } from '@/types/workspace';\n\n/*** Build a credential-free runtime status record for one repository operation. */\nexport function createWorkspaceRepositoryStatus(\n repository: GitHubRepositoryDiscoveryRepository,\n status: WorkspaceRepositoryLoadStatus['status']\n): WorkspaceRepositoryLoadStatus {\n return {\n repository: { id: repository.id, name: repository.name, owner: repository.owner },\n status,\n ...(status === 'successful'\n ? {}\n : {\n description:\n status === 'cancelled'\n ? 'Loading was cancelled.'\n : 'Repository materialization failed.',\n }),\n };\n}\n","import { toPortablePath } from '@ankhorage/utility/node/path';\n\nimport { parseProjectPath } from '@/utils/parseProjectPath';\n\n/*** Returns the project name for an explicit or configured project path. */\nexport const getProjectName = (projectPath: string = parseProjectPath()) => {\n const projectName = toPortablePath(projectPath).split('/').pop();\n return projectName === undefined || projectName.length === 0 ? '{unknown}' : projectName;\n};\n","import { readGitHubRepositoryAuthenticationAsync } from '@/features/github-auth/adapters/inbound/next/readGitHubAuthViewAsync';\nimport { createWorkspaceRetryRoute } from '@/features/workspace/adapters/inbound/next/createWorkspaceRetryRoute';\nimport { retryWorkspaceRepositoryAsync } from '@/features/workspace/composition/loadWorkspaceProjectSourceAsync';\n\n/*** Bind the production retry route to the process-local workspace runtime. */\nexport const POST = createWorkspaceRetryRoute(async (runtimeId, repositoryId) => {\n const authorization = await readGitHubRepositoryAuthenticationAsync();\n return retryWorkspaceRepositoryAsync(runtimeId, repositoryId, {\n authentication: authorization.authentication,\n authorizationScope: authorization.cacheScope,\n });\n});\n","unable to read source [project]/node_modules/@ankhorage/repository/src/providers/github/definitions/GitHubRepositoryDiscoveryResult.ts","/***\n * Normalize a GitHub repository URL or owner/repository shorthand to one HTTPS GitHub URL.\n *\n * Existing normal GitHub repository, tree, blob, and commit links keep their path semantics.\n */\nexport function normalizeGitHubRepositoryUrl(value: string): string {\n const input = value.trim();\n if (input === '') throw new Error('GitHub repository must not be empty.');\n\n const candidate = input.startsWith('github.com/') ? `https://${input}` : input;\n if (candidate.startsWith('https://')) return normalizeAbsoluteGitHubUrl(candidate);\n\n if (\n /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,98}[A-Za-z0-9])?\\/[A-Za-z0-9._-]{1,100}(?:\\.git)?$/u.test(\n candidate,\n )\n ) {\n return `https://github.com/${candidate}`;\n }\n\n throw invalidGitHubRepositoryUrl();\n}\n\n/*** Validate one absolute GitHub URL without rewriting its normal route semantics. */\nfunction normalizeAbsoluteGitHubUrl(value: string): string {\n let url: URL;\n try {\n url = new URL(value);\n } catch (error) {\n throw new Error('GitHub repository URL is invalid.', { cause: error });\n }\n\n if (\n url.protocol !== 'https:' ||\n url.hostname.toLowerCase() !== 'github.com' ||\n url.username !== '' ||\n url.password !== ''\n ) {\n throw invalidGitHubRepositoryUrl();\n }\n\n const segments = url.pathname.split('/').filter(Boolean);\n if (segments.length < 2) throw invalidGitHubRepositoryUrl();\n\n return value;\n}\n\n/*** Create the stable validation error for unsupported repository input. */\nfunction invalidGitHubRepositoryUrl(): Error {\n return new Error(\n 'GitHub repository must be owner/repository or a normal https://github.com repository URL.',\n );\n}\n","import type { ArchitectureProfile } from '../../../types/architectureProfile.js';\nimport { ARCHITECTURE_PROFILES } from '../constants/architectureProfiles.js';\n\n/*** Resolve one built-in architecture profile or reject a missing provider definition. */\nexport function findArchitectureProfile(profileId: ArchitectureProfile['id']): ArchitectureProfile {\n const [profile] = ARCHITECTURE_PROFILES;\n if (profile === undefined) throw new Error('Unknown architecture profile: ' + profileId);\n return profile;\n}\n","import type { SourceGraph } from '@ankhorage/dependency-graph';\nimport type { RulesConfig } from '@ankhorage/rules';\nimport { evaluateArchitecture, evaluateArchitectureProfile } from '@ankhorage/rules-architecture';\n\nimport type { AuditArchitectureEvaluation, AuditArchitectureTarget } from '@/types/audit';\n\nconst MODEL_EVALUATION_CONFIG: RulesConfig = {\n version: 1,\n rules: [{ id: 'architecture-dependency-direction', enabled: true }],\n};\n\n/*** Evaluate only an explicitly configured architecture model or profile target. */\nexport function evaluateArchitectureTarget(\n sourceGraph: SourceGraph,\n target: AuditArchitectureTarget | undefined\n): AuditArchitectureEvaluation | undefined {\n if (target === undefined) return undefined;\n\n if (target.kind === 'model') {\n return {\n target,\n result: evaluateArchitecture(sourceGraph, target.id, {\n config: MODEL_EVALUATION_CONFIG,\n }),\n };\n }\n\n return {\n target,\n result: evaluateArchitectureProfile(sourceGraph, target.id),\n };\n}\n","import { materializeSourceJarAsync } from '@/features/project-source/adapters/outbound/archive/materializeSourceJarAsync';\nimport { createGitHubProjectMaterializer } from '@/features/project-source/adapters/outbound/repository/createGitHubProjectMaterializer';\nimport { resolveProjectSourceAsync } from '@/features/project-source/application/use-cases/resolveProjectSourceAsync';\nimport type { ProjectSource, ResolvedProjectSource } from '@/types/projectSource';\n\n/*** Wire the canonical GitHub repository adapter into project-source resolution. */\nexport function loadProjectSourceAsync(\n source: ProjectSource,\n signal?: AbortSignal\n): Promise<ResolvedProjectSource> {\n return resolveProjectSourceAsync(\n source,\n createGitHubProjectMaterializer(),\n {\n materializeAsync: (filesystemSource, materializationSignal) =>\n materializeSourceJarAsync(filesystemSource.path, { signal: materializationSignal }),\n },\n signal\n );\n}\n","import type { ProjectDetection } from '@ankhorage/project-detector/types';\n\nimport { Language } from '@/types/language';\nimport type { ParserSelection } from '@/types/parserSelection';\n\n/*** Select a supported parser by evidence strength, evidence count, then stable parser order. */\nexport function selectParserLanguage(detection: ProjectDetection): ParserSelection {\n const supported = [\n Language.TypeScript,\n Language.Java,\n Language.Cpp,\n Language.Python,\n Language.Delphi,\n Language.Kotlin,\n ];\n const candidates = supported\n .flatMap(language => {\n const detected = detection.languages.find(candidate => candidate.id === String(language));\n return detected ? [{ language, detected }] : [];\n })\n .sort(\n (left, right) =>\n right.detected.score - left.detected.score ||\n right.detected.evidence.length - left.detected.evidence.length ||\n supported.indexOf(left.language) - supported.indexOf(right.language)\n );\n const selected = candidates.at(0);\n if (selected === undefined) {\n throw new Error(\n `No supported parser detected. Found: ${detection.languages.map(language => language.id).join(', ') || 'unknown'}. Supported: ${supported.join(', ')}.`\n );\n }\n return {\n language: selected.language,\n score: selected.detected.score,\n indicators: selected.detected.evidence,\n candidates: detection.languages,\n };\n}\n","import type {\n AuditConfiguration,\n AuditRuleConfiguration,\n ResolveAuditConfigurationInput,\n} from '@/types/audit';\n\n/*** Resolve explicit audit overrides without inferring an architecture enforcement target. */\nexport function resolveAuditConfiguration(\n input: ResolveAuditConfigurationInput = {}\n): AuditConfiguration {\n let cyclicDependenciesMode: AuditRuleConfiguration['mode'] = 'block';\n\n for (const rule of input.rules ?? []) {\n switch (rule.id) {\n case 'cyclic-dependencies':\n cyclicDependenciesMode = rule.mode;\n break;\n default:\n throw new Error(`Unknown audit rule \"${rule.id}\".`);\n }\n }\n\n return {\n ...(input.architectureTarget === undefined\n ? {}\n : { architectureTarget: input.architectureTarget }),\n failOnRuleViolation: input.failOnRuleViolation ?? true,\n rules: [{ id: 'cyclic-dependencies', mode: cyclicDependenciesMode }],\n };\n}\n","import type {\n SourceCapability,\n SourceEdgeData,\n SourceGraph,\n SourceNodeData,\n} from '@ankhorage/dependency-graph';\n\nimport type {\n ArchitectureContradiction,\n ArchitectureDetectionCandidate,\n ArchitectureDetectionEvidence,\n ArchitectureDetectionResult,\n ArchitectureRoleAssignment,\n} from '../../../types/architectureAnalysis.js';\nimport type { ArchitectureModel } from '../../../types/architectureModel.js';\nimport { hasSourceCapability } from '../../../utils/hasSourceCapability.js';\nimport { listArchitectureModels } from '../../models/domain/listArchitectureModels.js';\nimport { inferArchitectureRoles } from './inferArchitectureRoles.js';\n\nconst DETECTION_CAPABILITIES: readonly SourceCapability[] = [\n 'declarations',\n 'extends',\n 'implements',\n 'imports',\n];\n\n/*** Detect plausible architecture models from observed graph facts without selecting an enforcement target. */\nexport function detectArchitecture(graph: SourceGraph): ArchitectureDetectionResult {\n const candidates = listArchitectureModels()\n .map((model) => candidateForModel(graph, model))\n .sort((left, right) => right.score - left.score || compareText(left.modelId, right.modelId));\n\n return { candidates };\n}\n\ninterface ClassifiedDependency {\n readonly allowed: boolean;\n readonly edge: {\n readonly data: SourceEdgeData;\n readonly source: number;\n readonly target: number;\n };\n readonly source: SourceNodeData;\n readonly sourceRole: ArchitectureRoleAssignment;\n readonly target: SourceNodeData;\n readonly targetRole: ArchitectureRoleAssignment;\n}\n\n/*** Build one scored model candidate while preserving ambiguity, evidence, and contradictions. */\nfunction candidateForModel(\n graph: SourceGraph,\n model: ArchitectureModel,\n): ArchitectureDetectionCandidate {\n const roleAssignments = inferArchitectureRoles(graph, model);\n const classified = classifyDependencies(graph, model, roleAssignments);\n const supportingEdges = classified.filter(({ allowed }) => allowed);\n const contradictions = classified\n .filter(({ allowed }) => !allowed)\n .map(({ edge, source, target, sourceRole, targetRole }) =>\n contradiction(\n edge.data.kind,\n source.semanticPath,\n target.semanticPath,\n sourceRole,\n targetRole,\n ),\n );\n const confidence = candidateConfidence(\n graph,\n model,\n roleAssignments,\n classified,\n supportingEdges,\n );\n\n return {\n modelId: model.id,\n confidence,\n score: Math.round(confidence * 100),\n roleAssignments,\n supportingEvidence: supportingEvidence(\n roleAssignments,\n supportingEdges.length,\n classified.length,\n ),\n contradictions,\n unavailableCapabilities: unavailableDetectionCapabilities(graph),\n };\n}\n\n/*** Classify only dependencies whose endpoints have inferred semantic roles. */\nfunction classifyDependencies(\n graph: SourceGraph,\n model: ArchitectureModel,\n assignments: readonly ArchitectureRoleAssignment[],\n): readonly ClassifiedDependency[] {\n const roleByPath = new Map(\n assignments.map((assignment) => [assignment.semanticPath, assignment]),\n );\n const nodeById = new Map(graph.graph.nodes.map((node) => [node.id, node.data]));\n\n return graph.graph.edges.flatMap((edge) => {\n if (\n edge.data.kind !== 'imports' &&\n edge.data.kind !== 'extends' &&\n edge.data.kind !== 'implements'\n ) {\n return [];\n }\n const source = nodeById.get(edge.source);\n const target = nodeById.get(edge.target);\n if (source === undefined || target === undefined) return [];\n const sourceRole = roleByPath.get(source.semanticPath);\n const targetRole = roleByPath.get(target.semanticPath);\n if (sourceRole === undefined || targetRole === undefined) return [];\n const allowed = model.allowedDependencies.some(\n (dependency) =>\n dependency.source === sourceRole.roleId && dependency.target === targetRole.roleId,\n );\n return [{ edge, source, target, sourceRole, targetRole, allowed }];\n });\n}\n\n/*** Score one candidate from role coverage, confidence, topology conformance, and capabilities. */\nfunction candidateConfidence(\n graph: SourceGraph,\n model: ArchitectureModel,\n assignments: readonly ArchitectureRoleAssignment[],\n classified: readonly ClassifiedDependency[],\n supporting: readonly ClassifiedDependency[],\n): number {\n const eligibleNodes = graph.graph.nodes.filter(({ data }) => isEligibleNode(data)).length;\n const assignmentCoverage = eligibleNodes === 0 ? 0 : assignments.length / eligibleNodes;\n const averageConfidence =\n assignments.length === 0\n ? 0\n : assignments.reduce((sum, assignment) => sum + assignment.confidence, 0) /\n assignments.length;\n const topologyConformance = classified.length === 0 ? 0.5 : supporting.length / classified.length;\n const representedRoles = new Set(assignments.map(({ roleId }) => roleId)).size;\n const roleCoverage = model.roles.length === 0 ? 0 : representedRoles / model.roles.length;\n const unavailable = unavailableDetectionCapabilities(graph);\n const capabilityFactor = 1 - unavailable.length / (DETECTION_CAPABILITIES.length * 2);\n const rawScore =\n averageConfidence * 0.35 +\n assignmentCoverage * 0.25 +\n topologyConformance * 0.25 +\n roleCoverage * 0.15;\n\n return round(Math.max(0, Math.min(1, rawScore * capabilityFactor)));\n}\n\n/*** Keep candidate coverage focused on internal executable/declaration source nodes. */\nfunction isEligibleNode(node: SourceNodeData): boolean {\n if (node.classification === 'vendor') return false;\n return (\n node.kind === 'file' ||\n node.kind === 'class' ||\n node.kind === 'interface' ||\n node.kind === 'function' ||\n node.kind === 'type'\n );\n}\n\n/*** Convert one forbidden inferred dependency into explicit contradictory evidence. */\nfunction contradiction(\n relationKind: string,\n sourceSemanticPath: string,\n targetSemanticPath: string,\n sourceRole: ArchitectureRoleAssignment,\n targetRole: ArchitectureRoleAssignment,\n): ArchitectureContradiction {\n return {\n relationKind,\n sourceSemanticPath,\n targetSemanticPath,\n sourceRole: sourceRole.roleId,\n targetRole: targetRole.roleId,\n message: `${sourceRole.roleId} -> ${targetRole.roleId} is not allowed by the inferred model.`,\n };\n}\n\n/*** Summarize role and topology support without overwhelming consumers with every observed edge. */\nfunction supportingEvidence(\n assignments: readonly ArchitectureRoleAssignment[],\n supportingEdges: number,\n classifiedEdges: number,\n): readonly ArchitectureDetectionEvidence[] {\n const roleEvidence = assignments\n .filter(({ confidence }) => confidence >= 0.45)\n .slice(0, 20)\n .map(({ semanticPath, roleId, confidence }) => ({\n kind: 'topology' as const,\n semanticPath,\n message: `Inferred role \"${roleId}\" with confidence ${confidence}.`,\n weight: confidence,\n }));\n const dependencyEvidence: ArchitectureDetectionEvidence[] =\n classifiedEdges === 0\n ? []\n : [\n {\n kind: 'dependency',\n message: `${supportingEdges} of ${classifiedEdges} classified dependencies follow this model's direction.`,\n weight: supportingEdges / classifiedEdges,\n },\n ];\n return [...roleEvidence, ...dependencyEvidence];\n}\n\n/*** Report capabilities that cannot safely be treated as negative architecture evidence. */\nfunction unavailableDetectionCapabilities(graph: SourceGraph): readonly SourceCapability[] {\n if (graph.capabilities.length === 0) return DETECTION_CAPABILITIES;\n return DETECTION_CAPABILITIES.filter((capability) => !hasSourceCapability(graph, capability));\n}\n\n/*** Stabilize serializable detection confidence. */\nfunction round(value: number): number {\n return Math.round(value * 1000) / 1000;\n}\n\n/*** Compare stable identifiers by code units instead of locale-sensitive collation. */\nfunction compareText(left: string, right: string): number {\n return left < right ? -1 : left > right ? 1 : 0;\n}\n","import path from 'node:path';\n\nimport { readTextFileWithinRoot } from '@ankhorage/utility/node/fs';\nimport { toPortablePath } from '@ankhorage/utility/node/path';\n\nimport type { ProjectFileMetadata, ProjectImportMetadata } from '@/types/projectFiles';\n\n/*** Read Python file metadata retained by Atlas Tree and audit exports. */\nexport function readPythonProjectFileMetadata(\n fullPath: string,\n projectRoot: string,\n imports: readonly ProjectImportMetadata[]\n): ProjectFileMetadata {\n const { content, path: resolvedPath } = readTextFileWithinRoot({\n rootPath: projectRoot,\n filePath: fullPath,\n });\n const fileName = path.basename(resolvedPath);\n\n return {\n className: extractClassName(content, fileName),\n package: extractModulePath(resolvedPath, projectRoot),\n imports: [...imports],\n path: toPortablePath(path.relative(projectRoot, resolvedPath)),\n };\n}\n\n/*** Extract the module path retained for Tree mapping. */\nfunction extractModulePath(filePath: string, projectRoot: string): string {\n const relativePath = toPortablePath(path.relative(projectRoot, filePath));\n const parts = relativePath.split('/');\n parts.pop();\n return parts.join('.');\n}\n\n/*** Extract class name with filename fallback. */\nfunction extractClassName(content: string, fileName: string): string {\n const classMatch = /^class\\s+([A-Za-z0-9_]+)/m.exec(content);\n if (classMatch) return classMatch[1];\n return path.basename(fileName, path.extname(fileName));\n}\n","import path from 'node:path';\n\nimport { readTextFileWithinRoot } from '@ankhorage/utility/node/fs';\nimport { toPortablePath } from '@ankhorage/utility/node/path';\n\nimport type { ProjectFileMetadata, ProjectImportMetadata } from '@/types/projectFiles';\n\n/*** Read C++ file metadata retained by Atlas Tree and audit exports. */\nexport function readCppProjectFileMetadata(\n fullPath: string,\n projectRoot: string,\n imports: readonly ProjectImportMetadata[]\n): ProjectFileMetadata {\n const { content, path: resolvedPath } = readTextFileWithinRoot({\n rootPath: projectRoot,\n filePath: fullPath,\n });\n const fileName = path.basename(resolvedPath);\n const namespace = extractNamespace(content);\n\n return {\n className: extractClassName(content, fileName),\n package: namespace,\n imports: [...mergeImports(content, namespace, imports)],\n path: toPortablePath(path.relative(projectRoot, resolvedPath)),\n };\n}\n\n/*** Extract the first namespace used as Atlas package metadata. */\nfunction extractNamespace(content: string): string {\n const match = /namespace\\s+([a-zA-Z0-9_:]+)\\s*\\{/.exec(content);\n return match?.[1]?.replace(/::/g, '.') ?? '';\n}\n\n/*** Retain presentation-only includes that canonical dependency topology intentionally omits. */\nfunction extractPresentationOnlyIncludes(\n content: string,\n namespace: string,\n canonicalImports: readonly ProjectImportMetadata[]\n): ProjectImportMetadata[] {\n const canonicalNames = new Set(canonicalImports.map(({ name }) => name));\n const includeRegex = /#include\\s+([\"<])([^\">]+)[\">]/g;\n const imports: ProjectImportMetadata[] = [];\n let match;\n\n while ((match = includeRegex.exec(content)) !== null) {\n const [, delimiter = '', specifier = ''] = match;\n if (canonicalNames.has(specifier)) continue;\n\n const segments = specifier.replace(/\\.(h|hpp|hxx)$/u, '').split('/');\n const pkg = segments.length > 1 ? segments.slice(0, -1).join('.') : '';\n if (pkg !== '' && pkg !== namespace) continue;\n\n imports.push({\n name: specifier,\n pkg,\n isIntrinsic: delimiter === '\"',\n });\n }\n\n return imports;\n}\n\n/*** Restore complete include metadata in source declaration order. */\nfunction mergeImports(\n content: string,\n namespace: string,\n canonicalImports: readonly ProjectImportMetadata[]\n): readonly ProjectImportMetadata[] {\n return [\n ...canonicalImports,\n ...extractPresentationOnlyIncludes(content, namespace, canonicalImports),\n ].sort((left, right) => content.indexOf(left.name) - content.indexOf(right.name));\n}\n\n/*** Extract a display class/struct name with filename fallback. */\nfunction extractClassName(content: string, fileName: string): string {\n const classMatch = /class\\s+([A-Za-z0-9_]+)/.exec(content);\n if (classMatch) return classMatch[1];\n\n const structMatch = /struct\\s+([A-Za-z0-9_]+)/.exec(content);\n if (structMatch) return structMatch[1];\n\n return path.basename(fileName, path.extname(fileName));\n}\n","import path from 'node:path';\n\nimport { readTextFileWithinRoot } from '@ankhorage/utility/node/fs';\nimport { toPortablePath } from '@ankhorage/utility/node/path';\n\nimport type { ProjectFileMetadata, ProjectImportMetadata } from '@/types/projectFiles';\n\n/*** Read Delphi file metadata retained by Atlas Tree and audit exports. */\nexport function readDelphiProjectFileMetadata(\n fullPath: string,\n projectRoot: string,\n imports: readonly ProjectImportMetadata[]\n): ProjectFileMetadata {\n const { content, path: resolvedPath } = readTextFileWithinRoot({\n rootPath: projectRoot,\n filePath: fullPath,\n });\n const fileName = path.basename(resolvedPath);\n\n return {\n className: extractClassName(content, fileName),\n package: extractUnitPath(resolvedPath, projectRoot),\n imports: [...imports],\n path: toPortablePath(path.relative(projectRoot, resolvedPath)),\n };\n}\n\n/*** Extract package/unit path from Delphi file structure. */\nfunction extractUnitPath(filePath: string, projectRoot: string): string {\n const relativePath = toPortablePath(path.relative(projectRoot, filePath));\n const dir = path.posix.dirname(relativePath);\n return dir === '.' ? '' : dir.replace(/\\//g, '.');\n}\n\n/*** Extract the unit/class name retained in audit file metadata. */\nfunction extractClassName(content: string, fileName: string): string {\n const unitMatch = /\\bunit\\s+([A-Za-z_][A-Za-z0-9_]*)\\s*;/i.exec(content);\n if (unitMatch) return unitMatch[1];\n\n const classMatch = /\\bT([A-Za-z_][A-Za-z0-9_]*)\\s*=\\s*class/i.exec(content);\n if (classMatch) return 'T' + classMatch[1];\n\n return path.basename(fileName, path.extname(fileName));\n}\n","import path from 'node:path';\n\nimport { readTextFileWithinRoot } from '@ankhorage/utility/node/fs';\nimport { toPortablePath } from '@ankhorage/utility/node/path';\n\nimport type { ProjectFileMetadata, ProjectImportMetadata } from '@/types/projectFiles';\n\n/*** Read Kotlin file metadata retained by Atlas Tree and audit exports. */\nexport function readKotlinProjectFileMetadata(\n fullPath: string,\n projectRoot: string,\n imports: readonly ProjectImportMetadata[]\n): ProjectFileMetadata {\n const { content, path: resolvedPath } = readTextFileWithinRoot({\n rootPath: projectRoot,\n filePath: fullPath,\n });\n const fileName = path.basename(resolvedPath);\n\n return {\n className: extractClassName(content, fileName),\n package: extractPackage(content),\n imports: [...imports],\n path: toPortablePath(path.relative(projectRoot, resolvedPath)),\n };\n}\n\n/*** Extract the Kotlin package declaration retained for Tree mapping. */\nfunction extractPackage(content: string): string {\n const packageMatch = /^\\s*package\\s+([\\w.]+)/m.exec(content);\n return packageMatch?.[1] ?? '';\n}\n\n/*** Extract class/object/interface name with filename fallback. */\nfunction extractClassName(content: string, fileName: string): string {\n const classMatch =\n /(?:^|\\n)\\s*(?:data\\s+|sealed\\s+|abstract\\s+|open\\s+)?(?:class|object|interface)\\s+([A-Za-z0-9_]+)/m.exec(\n content\n );\n\n if (classMatch) return classMatch[1];\n return path.basename(fileName, path.extname(fileName));\n}\n","import path from 'node:path';\n\nimport { readTextFileWithinRoot } from '@ankhorage/utility/node/fs';\nimport { toPortablePath } from '@ankhorage/utility/node/path';\n\nimport type { ProjectFileMetadata, ProjectImportMetadata } from '@/types/projectFiles';\n\n/*** Read TypeScript file metadata retained by Atlas Tree and audit exports. */\nexport function readTypeScriptProjectFileMetadata(\n fullPath: string,\n projectRoot: string,\n imports: readonly ProjectImportMetadata[]\n): ProjectFileMetadata {\n const { content, path: resolvedPath } = readTextFileWithinRoot({\n rootPath: projectRoot,\n filePath: fullPath,\n });\n const relativePath = toPortablePath(path.relative(projectRoot, resolvedPath));\n const segments = relativePath.split('/');\n\n return {\n className: extractClassName(content, resolvedPath),\n imports: [...imports],\n package: segments.slice(0, -1).join('.'),\n path: relativePath,\n };\n}\n\n/*** Extract class name with the existing filename fallback used by audit exports. */\nfunction extractClassName(content: string, fileName: string): string {\n const classMatch = /class\\s+(\\w+)/.exec(content);\n if (classMatch) return classMatch[1];\n return path.basename(fileName, '.ts');\n}\n","import path from 'node:path';\n\nimport { readTextFileWithinRoot } from '@ankhorage/utility/node/fs';\nimport { toPortablePath } from '@ankhorage/utility/node/path';\nimport { escapeRegExp } from '@ankhorage/utility/regex';\n\nimport type { ProjectFileMetadata, ProjectImportMetadata } from '@/types/projectFiles';\n\n/*** Read Java file metadata retained by Atlas Tree and audit exports. */\nexport function readJavaProjectFileMetadata(\n fullPath: string,\n projectRoot: string,\n imports: readonly ProjectImportMetadata[]\n): ProjectFileMetadata {\n const { content, path: resolvedPath } = readTextFileWithinRoot({\n rootPath: projectRoot,\n filePath: fullPath,\n });\n const fileName = path.basename(resolvedPath, '.java');\n\n return {\n className: extractClassName(content, fileName),\n package: extractPackageName(content),\n imports: [...imports],\n path: toPortablePath(path.relative(projectRoot, resolvedPath)),\n };\n}\n\n/*** Extract the Java package declaration retained for Tree mapping. */\nfunction extractPackageName(content: string): string {\n const match = /^package\\s+([a-zA-Z0-9_.]+);/m.exec(content);\n return match?.[1] ?? '';\n}\n\n/*** Extract the declaration name retained in audit file metadata. */\nfunction extractClassName(content: string, fileName: string): string {\n const classPattern = new RegExp(\n `(?:public\\\\s+)?(class|interface|enum|record)\\\\s+${escapeRegExp(fileName)}\\\\b`\n );\n const classNameMatch = content.match(classPattern);\n if (classNameMatch) return fileName;\n\n const fallback = /(?:public\\s+)?(class|interface|enum|record)\\s+([A-Za-z0-9_]+)/.exec(content);\n return fallback?.[2] ?? '';\n}\n","import { basename, resolve } from 'node:path';\n\nimport type {\n GitHubProjectMaterializer,\n ProjectSource,\n ResolvedProjectSource,\n SourceJarMaterializer,\n} from '@/types/projectSource';\n\n/*** Resolve one project source into the filesystem root consumed by the existing analysis pipeline. */\nexport async function resolveProjectSourceAsync(\n source: ProjectSource,\n github: GitHubProjectMaterializer,\n sourceJar?: SourceJarMaterializer,\n signal?: AbortSignal\n): Promise<ResolvedProjectSource> {\n if (source.kind === 'filesystem') {\n const materializedSourceJar = await sourceJar?.materializeAsync(source, signal);\n if (materializedSourceJar !== undefined && materializedSourceJar !== null) {\n return { source, ...materializedSourceJar };\n }\n return {\n rootPath: resolve(source.path),\n projectName: basename(resolve(source.path)) || '{unknown}',\n source,\n cleanupAsync: () => Promise.resolve(),\n };\n }\n\n const materialized = await github.materializeAsync(source, signal);\n return {\n rootPath: materialized.rootPath,\n projectName: materialized.projectName,\n revision: materialized.revision,\n source,\n cleanupAsync: materialized.cleanupAsync,\n };\n}\n","import type { DependencyGraph, DependencyGraphNodeData } from '@ankhorage/dependency-graph';\nimport type { GraphEdge, GraphNode } from '@ankhorage/graph';\n\nimport type {\n PackageDependencyEdgeData,\n PackageDependencyGraph,\n PackageDependencyNodeData,\n RepositoryGraphIdentity,\n} from '@/types/dependencyAnalysis';\n\n/*** Project the canonical owner graph into Atlas package identities without re-analyzing source. */\nexport function projectDependencyGraph(\n graph: DependencyGraph,\n repositories: ReadonlyMap<string, RepositoryGraphIdentity> = new Map()\n): PackageDependencyGraph {\n const projectedIds = new Map<string, string>();\n const nodes = new Map<string, GraphNode<PackageDependencyNodeData>>();\n\n for (const node of graph.nodes) {\n const id = packageId(node.data, repositories);\n if (id === undefined) continue;\n projectedIds.set(node.id, id);\n if (!nodes.has(id)) nodes.set(id, projectNode(id, node.data, repositories));\n }\n\n const edges = new Map<string, GraphEdge<PackageDependencyEdgeData>>();\n for (const edge of graph.edges) {\n const source = projectedIds.get(edge.source);\n const target = projectedIds.get(edge.target);\n if (source === undefined || target === undefined || source === target) continue;\n\n const id = `${source}->${target}`;\n const existing = edges.get(id);\n edges.set(id, {\n id,\n source,\n target,\n data: {\n weight: (existing?.data.weight ?? 0) + edge.data.weight,\n evidence: [...(existing?.data.evidence ?? []), ...edge.data.evidence],\n },\n });\n }\n\n return { nodes: [...nodes.values()], edges: [...edges.values()] };\n}\n\n/*** Resolve the stable package identity represented by one canonical dependency node. */\nfunction packageId(\n data: DependencyGraphNodeData,\n repositories: ReadonlyMap<string, RepositoryGraphIdentity>\n): string | undefined {\n const repository = data.projectId === undefined ? undefined : repositories.get(data.projectId);\n if (repository !== undefined) return repositoryPackageId(repository.id, data);\n if (data.kind === 'module') return nonEmpty(data.path);\n if (data.focus && (data.path === undefined || data.path === '.')) return undefined;\n return nonEmpty(data.packageName) ?? nonEmpty(data.label);\n}\n\n/*** Convert one owner node into the metadata shape required by Atlas graph projection. */\nfunction projectNode(\n id: string,\n data: DependencyGraphNodeData,\n repositories: ReadonlyMap<string, RepositoryGraphIdentity>\n): GraphNode<PackageDependencyNodeData> {\n const repository = data.projectId === undefined ? undefined : repositories.get(data.projectId);\n // Every repository explicitly selected into a workspace is first-party, even when its package\n // is observed as an external dependency from another selected repository.\n const intrinsic = repository !== undefined || data.classification === 'intrinsic' || data.focus;\n const parent =\n repository === undefined\n ? data.kind === 'module'\n ? (data.parentPath ?? parentPackage(id))\n : parentPackage(id)\n : repositoryParentId(repository.id, data);\n const label = repository !== undefined && isRepositoryRoot(data) ? repository.label : data.label;\n\n return {\n id,\n data: {\n classification: data.classification,\n path: id,\n parent,\n label,\n name: data.packageName ?? data.label,\n ...(repository === undefined\n ? {}\n : { repositoryId: repository.id, repositoryLabel: repository.label }),\n ...(intrinsic ? { isIntrinsic: true } : {}),\n ...(data.kind === 'package' && data.focus ? { isWorkspaceRoot: true } : {}),\n },\n };\n}\n\n/*** Encode project-local owner nodes beneath their immutable repository identity. */\nfunction repositoryPackageId(\n repositoryId: string,\n data: DependencyGraphNodeData\n): string | undefined {\n const root = repositoryGraphId(repositoryId);\n if (isRepositoryRoot(data)) return root;\n const path = nonEmpty(data.path) ?? nonEmpty(data.packageName) ?? nonEmpty(data.label);\n if (path === undefined) return undefined;\n return `${root}.${data.kind}.${normalizeIdentityPath(path)}`;\n}\n\n/*** Keep compound depth relative to a repository rather than an installation directory. */\nfunction repositoryParentId(repositoryId: string, data: DependencyGraphNodeData): string {\n const root = repositoryGraphId(repositoryId);\n if (isRepositoryRoot(data)) return '';\n const path = data.kind === 'module' ? data.parentPath : parentPackage(data.path ?? '');\n return path ? `${root}.${data.kind}.${normalizeIdentityPath(path)}` : root;\n}\n\n/*** Identify the canonical focus package that represents a selected repository itself. */\nfunction isRepositoryRoot(data: DependencyGraphNodeData): boolean {\n return data.kind === 'package' && data.focus && (data.path === undefined || data.path === '.');\n}\n\n/*** Create an ID that is stable across checkout locations and repository renames. */\nfunction repositoryGraphId(repositoryId: string): string {\n return `repository.${encodeURIComponent(repositoryId).replaceAll('.', '%2E')}`;\n}\n\n/*** Normalize semantic package paths without using temporary materialization paths. */\nfunction normalizeIdentityPath(path: string): string {\n return path.replaceAll('/', '.').replace(/^\\.+|\\.+$/g, '');\n}\n\n/*** Resolve the dotted parent package used by Atlas compound-node projection. */\nfunction parentPackage(id: string): string {\n return id.includes('.') ? id.split('.').slice(0, -1).join('.') : '';\n}\n\n/*** Normalize optional owner identifiers before they become graph identities. */\nfunction nonEmpty(value: string | undefined): string | undefined {\n const normalized = value?.trim();\n if (!normalized) return undefined;\n return normalized;\n}\n","import type { SourceGraph } from '@ankhorage/dependency-graph';\nimport { evaluateRules, type RuleEvaluationResult } from '@ankhorage/rules';\nimport { createArchitectureGraphRuleSet } from '@ankhorage/rules-architecture';\n\nimport type {\n AuditRuleConfiguration,\n AuditRuleResult,\n CyclicDependenciesEvidence,\n EvaluateAuditRulesInput,\n EvaluateAuditRulesResult,\n PackageCycleDetail,\n} from '@/types/audit';\n\n/*** Evaluate enabled Atlas audit rules through the canonical generic Rules provider. */\nexport function evaluateAuditRules(input: EvaluateAuditRulesInput): EvaluateAuditRulesResult {\n const mode = findRuleMode(input.configuration.rules, 'cyclic-dependencies');\n if (mode === 'off') return { genericRules: emptyRuleEvaluation(), rules: [] };\n\n const ruleSet = createArchitectureGraphRuleSet();\n const genericRules = evaluateRules({ graph: input.sourceGraph }, ruleSet.rules, {\n capabilities: sourceRuleCapabilities(input.sourceGraph),\n optionsByRuleId: new Map([['cyclic-dependencies', { aggregation: 'package' }]]),\n });\n\n return {\n genericRules,\n rules: [presentCyclicDependencies(input.cyclicPackages, mode, genericRules)],\n };\n}\n\n/*** Adapt canonical cycle findings into the existing Atlas audit presentation contract. */\nfunction presentCyclicDependencies(\n cycles: readonly PackageCycleDetail[],\n mode: Exclude<AuditRuleConfiguration['mode'], 'off'>,\n genericRules: RuleEvaluationResult\n): AuditRuleResult<CyclicDependenciesEvidence> {\n const findings = genericRules.findings.filter(({ ruleId }) => ruleId === 'cyclic-dependencies');\n const failed = findings.length > 0;\n return {\n id: 'cyclic-dependencies',\n status: failed ? 'failed' : 'passed',\n policy: mode === 'block' ? 'blocking' : 'advisory',\n message: failed\n ? `Detected ${findings.length} cyclic package dependenc${findings.length === 1 ? 'y' : 'ies'}.`\n : 'No cyclic package dependencies detected.',\n details: cycles.map(cycle => cycle.packages.join(' → ')),\n evidence: { cycles },\n };\n}\n\n/*** Expose SourceGraph capabilities using the identifiers required by Architecture Rules. */\nfunction sourceRuleCapabilities(graph: SourceGraph): readonly string[] {\n const projectIds = new Set(graph.capabilities.map(({ projectId }) => projectId));\n if (projectIds.size === 0) return [];\n const importsAvailable = [...projectIds].every(projectId =>\n graph.capabilities.some(\n report => report.projectId === projectId && report.available.includes('imports')\n )\n );\n return importsAvailable ? ['source-graph.imports'] : [];\n}\n\n/*** Create an empty canonical generic Rules result for explicitly disabled audit rules. */\nfunction emptyRuleEvaluation(): RuleEvaluationResult {\n return {\n diagnostics: [],\n findings: [],\n plan: { diagnostics: [], nodes: [], rootRuleIds: [] },\n results: [],\n };\n}\n\n/*** Return the effective mode for one known Atlas audit rule. */\nfunction findRuleMode(\n rules: readonly AuditRuleConfiguration[],\n id: AuditRuleConfiguration['id']\n): AuditRuleConfiguration['mode'] {\n return rules.find(rule => rule.id === id)?.mode ?? 'off';\n}\n","import path from 'node:path';\n\nimport { findCyclePath, findCyclicComponents } from '@ankhorage/graph';\n\nimport type {\n CycleEdgeEvidence,\n CycleProject,\n ImportEvidence,\n PackageCycleDetail,\n} from '@/types/audit';\nimport type { PackageDependencyGraph } from '@/types/dependencyAnalysis';\nimport type { ProjectFileMetadata, ProjectFileTree } from '@/types/projectFiles';\n\n/*** Detect package cycles directly on the canonical package projection and retain owner evidence. */\nexport function getPackageCyclesWithMembers(\n files: ProjectFileTree,\n graph: PackageDependencyGraph\n): {\n cycles: PackageCycleDetail[];\n packageSet: Set<TUniquePackageName>;\n graph: PackageDependencyGraph;\n} {\n const cycleGraph = addPackageContainmentEdges(graph);\n const sccs = findCyclicComponents(cycleGraph);\n const fileMetadata = collectFiles(files);\n const cycles: PackageCycleDetail[] = [];\n const packageSet = new Set<TUniquePackageName>();\n\n for (const scc of sccs) {\n scc.forEach(packageName => packageSet.add(packageName));\n const cycle = [...(findCyclePath(cycleGraph, scc) ?? [...scc, scc[0]])];\n cycles.push({\n packages: cycle,\n displayPackages: cycle.map(\n packageId => cycleGraph.nodes.find(node => node.id === packageId)?.data.label ?? packageId\n ),\n projects: getCycleProjects(cycleGraph, cycle),\n edges: cycle\n .slice(0, -1)\n .map((from, index) => cycleEdgeEvidence(cycleGraph, fileMetadata, from, cycle[index + 1])),\n });\n }\n\n return { cycles, packageSet, graph };\n}\n\n/*** Add canonical package hierarchy relations only for audit cycle traversal, not graph rendering. */\nfunction addPackageContainmentEdges(graph: PackageDependencyGraph): PackageDependencyGraph {\n const nodeIds = new Set(graph.nodes.map(node => node.id));\n const containmentEdges = graph.nodes.flatMap(node => {\n const { parent } = node.data;\n if (parent === '' || !nodeIds.has(parent)) return [];\n const id = `${parent}->${node.id}`;\n return graph.edges.some(edge => edge.id === id)\n ? []\n : [{ data: { evidence: [], weight: 1 }, id, source: parent, target: node.id }];\n });\n return { edges: [...graph.edges, ...containmentEdges], nodes: graph.nodes };\n}\n\n/*** Resolve repository ownership from canonical graph metadata, not presentation identities. */\nfunction getCycleProjects(\n graph: PackageDependencyGraph,\n packages: readonly string[]\n): readonly CycleProject[] {\n const projects = new Map<string, CycleProject>();\n for (const packageId of packages) {\n const data = graph.nodes.find(node => node.id === packageId)?.data;\n if (data?.repositoryId !== undefined && data.repositoryLabel !== undefined) {\n projects.set(data.repositoryId, { id: data.repositoryId, label: data.repositoryLabel });\n }\n }\n return [...projects.values()].toSorted((left, right) => left.id.localeCompare(right.id));\n}\n\ntype TUniquePackageName = string;\n\n/*** Collect project file metadata without consulting dependency metadata stored on the files. */\nfunction collectFiles(root: ProjectFileTree): readonly ProjectFileMetadata[] {\n return Object.values(root).flatMap(entry =>\n isProjectFileMetadata(entry) ? [entry] : collectFiles(entry)\n );\n}\n\n/*** Distinguish project file metadata from recursive directory records. */\nfunction isProjectFileMetadata(\n entry: ProjectFileTree | ProjectFileMetadata\n): entry is ProjectFileMetadata {\n return 'path' in entry && typeof entry.path === 'string' && 'package' in entry;\n}\n\n/*** Project canonical edge evidence into the audit contract for one cycle step. */\nfunction cycleEdgeEvidence(\n graph: PackageDependencyGraph,\n files: readonly ProjectFileMetadata[],\n from: string,\n to: string\n): CycleEdgeEvidence {\n const edge = graph.edges.find(candidate => candidate.source === from && candidate.target === to);\n return {\n from,\n to,\n via: edge?.data.evidence.map(evidence => projectImportEvidence(files, evidence)) ?? [],\n };\n}\n\n/*** Add Atlas file identity to one canonical dependency evidence item. */\nfunction projectImportEvidence(\n files: readonly ProjectFileMetadata[],\n evidence: PackageDependencyGraph['edges'][number]['data']['evidence'][number]\n): ImportEvidence {\n const file = findProjectFile(files, evidence.sourceFile);\n const filePath = file?.path ?? evidence.sourceFile;\n return {\n filePath,\n fileClass: file?.className ?? path.basename(filePath, path.extname(filePath)),\n importName: evidence.specifier,\n isIntrinsic: evidence.classification === 'intrinsic' || evidence.classification === 'focus',\n };\n}\n\n/*** Match owner-relative dependency evidence to Atlas file metadata. */\nfunction findProjectFile(\n files: readonly ProjectFileMetadata[],\n sourceFile: string\n): ProjectFileMetadata | undefined {\n return files.find(file => sourceFile === file.path || sourceFile.endsWith(`/${file.path}`));\n}\n","import {\n createSourceGraphFromProjectAnalysisSnapshots,\n type ProjectAnalysisSnapshot,\n projectDependencyGraphFromProjectAnalysisSnapshots,\n} from '@ankhorage/dependency-graph';\nimport type { GitHubRepositoryDiscoveryRepository } from '@ankhorage/repository/github';\n\nimport { createAuditFromSnapshot } from '@/features/audit/application/use-cases/createAuditFromSnapshot';\nimport { projectDependencyGraph } from '@/features/dependency-analysis/application/use-cases/projectDependencyGraph';\nimport { buildProjectTree } from '@/features/project-tree/application/use-cases/buildProjectTree';\nimport { hydrateWorkspaceSnapshot } from '@/features/workspace/application/use-cases/hydrateWorkspaceSnapshot';\nimport type { ParserSelection } from '@/types/parserSelection';\nimport type { ProjectSnapshot } from '@/types/projectAnalysis';\nimport type { ProjectFileTree } from '@/types/projectFiles';\nimport type { WorkspaceLoadResult, WorkspaceRepositoryLoadStatus } from '@/types/workspace';\n\n/*** Recompose the client-safe workspace view from retained portable repository analyses. */\nexport function composeWorkspaceRepositoryRuntimeResult(\n input: ComposeWorkspaceRepositoryRuntimeResultInput\n): WorkspaceRepositoryRuntimeResult {\n const entries = selectedEntries(input.repositories, input.entries);\n if (entries.length === 0) return unavailableWorkspace(input);\n const analyses = entries.map(({ entry }) => entry.analysis);\n const sourceGraph = createSourceGraphFromProjectAnalysisSnapshots(analyses);\n const dependencyGraph = projectDependencyGraphFromProjectAnalysisSnapshots(sourceGraph, analyses);\n const snapshot = createWorkspaceProjectSnapshot(entries, sourceGraph, dependencyGraph);\n return {\n currentSource: input.source,\n projectName: entries.length === 1 ? entries[0].repository.name : 'GitHub workspace',\n repositoryStatuses: orderedStatuses(input.repositories, input.statuses),\n runtimeId: input.runtimeId,\n workspace: {\n ok: true,\n value: hydrateWorkspaceSnapshot({\n audit: createAuditFromSnapshot(\n snapshot,\n {},\n { workspaceIdentity: workspaceIdentity(entries) }\n ),\n navigationTree: navigationTree(entries),\n version: 1,\n }),\n },\n };\n}\n\n/*** Retain only analyses whose repository remains selected by the trusted server-side workspace. */\nfunction selectedEntries(\n repositories: readonly GitHubRepositoryDiscoveryRepository[],\n entries: ReadonlyMap<string, RepositoryAnalysis>\n): readonly RepositoryEntry[] {\n return repositories.flatMap(repository => {\n const entry = entries.get(repository.id);\n return entry === undefined ? [] : [{ entry, repository }];\n });\n}\n\n/*** Preserve the no-successful-project failure without disclosing runtime details. */\nfunction unavailableWorkspace(\n input: ComposeWorkspaceRepositoryRuntimeResultInput\n): WorkspaceRepositoryRuntimeResult {\n return {\n currentSource: input.source,\n projectName: 'GitHub workspace',\n repositoryStatuses: orderedStatuses(input.repositories, input.statuses),\n runtimeId: input.runtimeId,\n workspace: { ok: false, error: 'No selected GitHub repositories could be analyzed.' },\n };\n}\n\n/*** Build the canonical audit snapshot with global dependency topology and a representative file tree. */\nfunction createWorkspaceProjectSnapshot(\n entries: readonly RepositoryEntry[],\n sourceGraph: ProjectSnapshot['sourceGraph'],\n dependencyGraph: Parameters<typeof projectDependencyGraph>[0]\n): ProjectSnapshot {\n const [first] = entries;\n return {\n files: first.entry.files,\n language: first.entry.language,\n packageGraph: projectDependencyGraph(\n dependencyGraph,\n new Map(\n entries.map(({ repository }) => [\n repository.id,\n { id: repository.id, label: repository.name },\n ])\n )\n ),\n projectPath: '',\n sourceGraph,\n timeStart: Date.now(),\n };\n}\n\n/*** Create virtual owner and repository roots with identities stable across retries and revisions. */\nfunction navigationTree(entries: readonly RepositoryEntry[]) {\n const owners = new Map<string, RepositoryEntry[]>();\n for (const entry of entries)\n owners.set(entry.repository.owner, [...(owners.get(entry.repository.owner) ?? []), entry]);\n return [...owners.entries()]\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([owner, projects]) => ({\n children: projects\n .toSorted((left, right) => left.repository.name.localeCompare(right.repository.name))\n .map(({ repository, entry }) => ({\n children: prefixTree(buildProjectTree(entry.files), repository.id),\n graphPackage: repositoryGraphId(repository.id),\n id: `repository:${repository.id}`,\n kind: 'virtual' as const,\n label: repository.name,\n })),\n graphPackage: '',\n id: `owner:${owner}`,\n kind: 'virtual' as const,\n label: owner,\n }));\n}\n\n/*** Prefix cached project-tree graph references with their selected repository identity. */\nfunction prefixTree(\n nodes: ReturnType<typeof buildProjectTree>,\n repositoryId: string\n): ReturnType<typeof buildProjectTree> {\n return nodes.map(node => ({\n ...node,\n graphPackage:\n node.graphPackage === ''\n ? ''\n : `${repositoryGraphId(repositoryId)}.module.${node.graphPackage}`,\n ...(node.children ? { children: prefixTree(node.children, repositoryId) } : {}),\n }));\n}\n\n/*** Keep identity stable across provider rename and materialization location changes. */\nfunction repositoryGraphId(repositoryId: string): string {\n return `repository.${encodeURIComponent(repositoryId).replaceAll('.', '%2E')}`;\n}\n\n/*** Keep browser preference scope stable when one failed repository becomes available. */\nfunction workspaceIdentity(entries: readonly RepositoryEntry[]): string {\n return `workspace:${entries\n .map(({ repository }) => repository.id)\n .toSorted((left, right) => left.localeCompare(right))\n .join(',')}`;\n}\n\n/*** Render operation state in selected-repository order without exposing provider or filesystem failures. */\nfunction orderedStatuses(\n repositories: readonly GitHubRepositoryDiscoveryRepository[],\n statuses: ReadonlyMap<string, WorkspaceRepositoryLoadStatus>\n): readonly WorkspaceRepositoryLoadStatus[] {\n return repositories\n .map(repository => statuses.get(repository.id) ?? repositoryStatus(repository, 'failed'))\n .toSorted(\n (left, right) => Number(left.status === 'successful') - Number(right.status === 'successful')\n );\n}\n\n/*** Build a credential-free status record suitable for a browser response. */\nfunction repositoryStatus(\n repository: GitHubRepositoryDiscoveryRepository,\n status: WorkspaceRepositoryLoadStatus['status']\n): WorkspaceRepositoryLoadStatus {\n return {\n repository: { id: repository.id, name: repository.name, owner: repository.owner },\n status,\n ...(status === 'successful'\n ? {}\n : {\n description:\n status === 'cancelled'\n ? 'Loading was cancelled.'\n : 'Repository materialization failed.',\n }),\n };\n}\n\nexport interface ComposeWorkspaceRepositoryRuntimeResultInput {\n readonly entries: ReadonlyMap<string, RepositoryAnalysis>;\n readonly repositories: readonly GitHubRepositoryDiscoveryRepository[];\n readonly runtimeId: string;\n readonly source: string;\n readonly statuses: ReadonlyMap<string, WorkspaceRepositoryLoadStatus>;\n}\n\nexport interface RepositoryAnalysis {\n readonly analysis: ProjectAnalysisSnapshot;\n readonly files: ProjectFileTree;\n readonly language: ParserSelection;\n}\n\ninterface RepositoryEntry {\n readonly entry: RepositoryAnalysis;\n readonly repository: GitHubRepositoryDiscoveryRepository;\n}\n\nexport interface WorkspaceRepositoryRuntimeResult {\n readonly currentSource: string;\n readonly projectName: string;\n readonly repositoryStatuses: readonly WorkspaceRepositoryLoadStatus[];\n readonly runtimeId: string;\n readonly workspace: WorkspaceLoadResult;\n}\n","import { serializeSourceGraph } from '@ankhorage/dependency-graph';\nimport type { RuleEvaluationResult } from '@ankhorage/rules';\nimport { detectArchitecture } from '@ankhorage/rules-architecture';\n\nimport { getPackageCyclesWithMembers } from '@/features/audit/application/use-cases/getPackageCyclesWithMembers';\nimport { evaluateArchitectureTarget } from '@/features/audit/domain/evaluateArchitectureTarget';\nimport { evaluateAuditRules } from '@/features/audit/domain/evaluateAuditRules';\nimport { resolveAuditConfiguration } from '@/features/audit/domain/resolveAuditConfiguration';\nimport type {\n Audit,\n AuditArchitectureEvaluation,\n AuditMetaInput,\n ResolveAuditConfigurationInput,\n} from '@/types/audit';\nimport type { ProjectSnapshot } from '@/types/projectAnalysis';\nimport { getProjectName } from '@/utils/getProjectName';\n\n/*** Evaluate provider-backed rules and architecture against the same retained canonical SourceGraph. */\nexport function createAuditFromSnapshot(\n snapshot: ProjectSnapshot,\n configurationInput: ResolveAuditConfigurationInput = {},\n metaInput: AuditMetaInput = {}\n): Audit {\n const configuration = resolveAuditConfiguration(configurationInput);\n const cyclicPackages = getPackageCyclesWithMembers(snapshot.files, snapshot.packageGraph).cycles;\n const ruleEvaluation = evaluateAuditRules({\n configuration,\n cyclicPackages,\n sourceGraph: snapshot.sourceGraph,\n });\n const architecture = detectArchitecture(snapshot.sourceGraph);\n const architectureEvaluation = evaluateArchitectureTarget(\n snapshot.sourceGraph,\n configuration.architectureTarget\n );\n\n return {\n configuration,\n evaluation: {\n architecture,\n ...(architectureEvaluation === undefined ? {} : { architectureEvaluation }),\n cyclicPackages,\n genericRules: mergeRuleEvaluation(ruleEvaluation.genericRules, architectureEvaluation),\n rules: ruleEvaluation.rules,\n },\n files: snapshot.files,\n packageGraph: snapshot.packageGraph,\n sourceGraph: serializeSourceGraph(snapshot.sourceGraph),\n meta: {\n language: snapshot.language,\n projectName: metaInput.projectName ?? getProjectName(snapshot.projectPath),\n ...(metaInput.source === undefined ? {} : { source: metaInput.source }),\n ...(metaInput.workspaceIdentity === undefined\n ? {}\n : { workspaceIdentity: metaInput.workspaceIdentity }),\n timeStart: snapshot.timeStart,\n timeEnd: Date.now(),\n },\n };\n}\n\n/*** Merge target-independent and explicitly targeted generic findings into one Audit view. */\nfunction mergeRuleEvaluation(\n base: RuleEvaluationResult,\n architecture: AuditArchitectureEvaluation | undefined\n): RuleEvaluationResult {\n if (architecture === undefined) return base;\n return {\n diagnostics: [...base.diagnostics, ...architecture.result.diagnostics],\n findings: [...base.findings, ...architecture.result.findings],\n plan: {\n diagnostics: [...base.plan.diagnostics, ...architecture.result.plan.diagnostics],\n nodes: [...base.plan.nodes, ...architecture.result.plan.nodes],\n rootRuleIds: [...base.plan.rootRuleIds, ...architecture.result.plan.rootRuleIds],\n },\n results: [...base.results, ...architecture.result.results],\n };\n}\n","import type { GitHubRepositoryDiscoveryRepository } from '@ankhorage/repository/github';\n\nimport type {\n RepositoryAnalysis,\n WorkspaceRepositoryRuntimeResult,\n} from '@/features/workspace/composition/composeWorkspaceRepositoryRuntimeResult';\nimport { composeWorkspaceRepositoryRuntimeResult } from '@/features/workspace/composition/composeWorkspaceRepositoryRuntimeResult';\nimport { createWorkspaceRepositoryStatus } from '@/features/workspace/composition/createWorkspaceRepositoryStatus';\nimport { settleBoundedAsync } from '@/features/workspace/utils/settleBoundedAsync';\nimport type { WorkspaceRepositoryLoadStatus } from '@/types/workspace';\n\nexport interface WorkspaceRuntimeState {\n active: boolean;\n readonly entries: Map<string, RepositoryAnalysis>;\n generation: number;\n readonly repositories: readonly GitHubRepositoryDiscoveryRepository[];\n readonly source: string;\n readonly statuses: Map<string, WorkspaceRepositoryLoadStatus>;\n}\n\n/*** Load one bounded batch and retain only credential-free workspace analysis results. */\nexport async function loadWorkspaceRepositoryBatchAsync(\n workspace: WorkspaceRuntimeState,\n repositories: readonly GitHubRepositoryDiscoveryRepository[],\n runtimeId: string,\n analyzeAsync: (\n repository: GitHubRepositoryDiscoveryRepository,\n signal?: AbortSignal\n ) => Promise<RepositoryAnalysis>,\n signal?: AbortSignal\n): Promise<WorkspaceRepositoryRuntimeResult> {\n const generation = workspace.generation + 1;\n workspace.generation = generation;\n const outcomes = await settleBoundedAsync(repositories, 4, analyzeAsync, signal);\n if (workspace.generation !== generation)\n throw new DOMException('A newer workspace operation superseded this one.', 'AbortError');\n for (const [index, outcome] of outcomes.entries()) {\n const repository = repositories.at(index);\n if (repository === undefined) continue;\n if (outcome.status === 'fulfilled') {\n workspace.entries.set(repository.id, outcome.value);\n workspace.statuses.set(\n repository.id,\n createWorkspaceRepositoryStatus(repository, 'successful')\n );\n } else {\n workspace.statuses.set(\n repository.id,\n createWorkspaceRepositoryStatus(\n repository,\n isCancellation(outcome.reason) ? 'cancelled' : 'failed'\n )\n );\n }\n }\n return composeWorkspaceRepositoryRuntimeResult({\n entries: workspace.entries,\n repositories: workspace.repositories,\n runtimeId,\n source: workspace.source,\n statuses: workspace.statuses,\n });\n}\n\n/*** Keep deliberate cancellation distinct from a failed repository materialization. */\nfunction isCancellation(error: unknown): boolean {\n return error instanceof DOMException\n ? error.name === 'AbortError'\n : error instanceof Error && error.name === 'AbortError';\n}\n","import type { DependencyGraph } from '@ankhorage/dependency-graph';\nimport type { ProjectInspection } from '@ankhorage/project-detector/types';\nimport {\n type GitHubRepositoryAuthentication,\n type GitHubRepositoryRevisionResolutionResult,\n type GitHubRepositoryVisibility,\n resolveGitHubRepositoryRevisionAsync,\n} from '@ankhorage/repository/github';\nimport { toErrorMessage } from '@ankhorage/utility/error';\n\nimport type { GitHubRepositoryAuthorization } from '@/features/github-auth/adapters/inbound/next/readGitHubAuthViewAsync';\nimport { createGitHubProjectMaterializer } from '@/features/project-source/adapters/outbound/repository/createGitHubProjectMaterializer';\nimport { discoverWorkspaceGitHubSourcesAsync } from '@/features/project-source/composition/discoverWorkspaceGitHubSourcesAsync';\nimport { loadProjectSourceAsync } from '@/features/project-source/composition/loadProjectSourceAsync';\nimport {\n createWorkspaceRepositoryRuntime,\n type WorkspaceRepositoryAuthorization,\n type WorkspaceRepositoryRuntime,\n} from '@/features/workspace/composition/createWorkspaceRepositoryRuntime';\nimport { loadWorkspaceAsync } from '@/features/workspace/composition/loadWorkspaceAsync';\nimport { resolveWorkspaceStartupSource } from '@/features/workspace/composition/resolveWorkspaceStartupSource';\nimport type { ProjectSource, ResolvedProjectSource } from '@/types/projectSource';\nimport type { WorkspaceLoadResult } from '@/types/workspace';\nimport type { WorkspaceRepositoryLoadStatus } from '@/types/workspace';\nimport { getProjectName } from '@/utils/getProjectName';\nimport { parseProjectPath } from '@/utils/parseProjectPath';\n\nexport interface WorkspaceProjectSourceResult {\n readonly currentSource?: string;\n readonly repositoryStatuses?: readonly WorkspaceRepositoryLoadStatus[];\n readonly repositories?: readonly WorkspaceRepositoryOption[];\n readonly runtimeId?: string;\n readonly selectionRequired?: boolean;\n readonly projectName: string;\n readonly workspace: WorkspaceLoadResult;\n}\n\n/*** Retry one failed repository through the process-local runtime that owns its retained snapshots. */\nexport function retryWorkspaceRepositoryAsync(\n runtimeId: string,\n repositoryId: string,\n authorization: WorkspaceRepositoryAuthorization,\n signal?: AbortSignal\n) {\n return defaultWorkspaceRepositoryRuntime.retryAsync(\n runtimeId,\n repositoryId,\n authorization,\n signal\n );\n}\n\n/*** Load the configured local project or discover GitHub sources supplied by the browser query. */\nexport async function loadWorkspaceProjectSourceAsync(\n sourceValue: string | undefined,\n loadDependencyGraphAsync: (inspection: ProjectInspection) => Promise<DependencyGraph>,\n materializeAsync: (\n source: ProjectSource,\n signal?: AbortSignal\n ) => Promise<ResolvedProjectSource> = loadProjectSourceAsync,\n discoverAsync: typeof discoverWorkspaceGitHubSourcesAsync = discoverWorkspaceGitHubSourcesAsync,\n signal?: AbortSignal,\n resolveRevisionAsync: GitHubRevisionResolver = resolveGitHubRevisionAsync,\n runtime?: WorkspaceRepositoryRuntime,\n authentication: GitHubRepositoryAuthentication = 'anonymous',\n authorizationScope = 'anonymous'\n): Promise<WorkspaceProjectSourceResult> {\n const startupSource = resolveWorkspaceStartupSource(sourceValue, process.env.ATLAS_PROJECT_PATH);\n\n if (startupSource.kind === 'filesystem') {\n const projectPath = parseProjectPath(startupSource.path);\n return {\n projectName: getProjectName(projectPath),\n workspace: await loadWorkspaceAsync(projectPath, loadDependencyGraphAsync),\n };\n }\n\n try {\n return await loadGitHubWorkspaceAsync(\n startupSource.source,\n loadDependencyGraphAsync,\n materializeAsync,\n discoverAsync,\n resolveRevisionAsync,\n runtime,\n signal,\n authentication,\n authorizationScope\n );\n } catch (error) {\n return {\n currentSource: startupSource.source,\n projectName: '{unknown}',\n workspace: {\n ok: false,\n error: toErrorMessage(error, 'Unable to load GitHub repository.'),\n },\n };\n }\n}\n\n/*** Delegate multi-project loading to the server-owned revision runtime. */\nasync function loadGitHubWorkspaceAsync(\n sourceValue: string,\n _loadDependencyGraphAsync: (inspection: ProjectInspection) => Promise<DependencyGraph>,\n materializeAsync: (source: ProjectSource, signal?: AbortSignal) => Promise<ResolvedProjectSource>,\n discoverAsync: typeof discoverWorkspaceGitHubSourcesAsync,\n resolveRevisionAsync: GitHubRevisionResolver,\n runtime: WorkspaceRepositoryRuntime | undefined,\n signal?: AbortSignal,\n authentication: GitHubRepositoryAuthentication = 'anonymous',\n authorizationScope = 'anonymous'\n): Promise<WorkspaceProjectSourceResult> {\n const { excludedRepositoryIds, selectedRepositoryIds, source } =\n parseGitHubWorkspaceSource(sourceValue);\n const discovery = await discoverAsync(\n source,\n excludedRepositoryIds,\n selectedRepositoryIds,\n authentication\n );\n const repositories = toRepositoryOptions(discovery);\n if (discovery.selectedRepositories.length === 0)\n return {\n currentSource: source,\n projectName: 'Choose GitHub repositories',\n repositories,\n selectionRequired: true,\n workspace: { ok: false, error: 'Choose one or more repositories, then select Open.' },\n };\n const workspaceRuntime =\n runtime ??\n (materializeAsync === loadProjectSourceAsync &&\n discoverAsync === discoverWorkspaceGitHubSourcesAsync &&\n resolveRevisionAsync === resolveGitHubRevisionAsync\n ? defaultWorkspaceRepositoryRuntime\n : createWorkspaceRepositoryRuntime({ materializeAsync, resolveRevisionAsync }));\n const result = await workspaceRuntime.loadAsync(\n {\n authentication,\n authorizationScope,\n repositories: discovery.selectedRepositories,\n source: sourceValue,\n },\n signal\n );\n return { ...result, repositories };\n}\n\n/*** Load a workspace with the credential resolved at the trusted request boundary. */\nexport function loadAuthenticatedWorkspaceProjectSourceAsync(\n source: string | undefined,\n loadDependencyGraphAsync: (inspection: ProjectInspection) => Promise<DependencyGraph>,\n authorization: GitHubRepositoryAuthorization\n): Promise<WorkspaceProjectSourceResult> {\n return loadWorkspaceProjectSourceAsync(\n source,\n loadDependencyGraphAsync,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n authorization.authentication,\n authorization.cacheScope\n );\n}\n\n/*** Preserve picker state from discovery while keeping the runtime status model separate. */\nfunction toRepositoryOptions(\n discovery: Awaited<ReturnType<typeof discoverWorkspaceGitHubSourcesAsync>>\n): readonly WorkspaceRepositoryOption[] {\n return discovery.repositories.map(repository => ({\n ...repository,\n selected: discovery.selectedRepositories.some(selected => selected.id === repository.id),\n }));\n}\n\n/*** Decode persisted exclusion identities without changing the established source query format. */\nfunction parseGitHubWorkspaceSource(value: string): {\n readonly source: string;\n readonly excludedRepositoryIds: ReadonlySet<string>;\n readonly selectedRepositoryIds?: ReadonlySet<string> | 'all';\n} {\n const [source, selection = ''] = value.split('|');\n const [kind, repositoryIds = ''] = selection.split('=');\n const ids = new Set(\n repositoryIds\n .split(',')\n .map(id => id.trim())\n .filter(Boolean)\n );\n return {\n source,\n excludedRepositoryIds: kind === 'exclude' ? ids : new Set(),\n ...(kind === 'include' ? { selectedRepositoryIds: ids } : {}),\n ...(kind === 'exclude' ? { selectedRepositoryIds: 'all' as const } : {}),\n };\n}\n\nexport interface WorkspaceRepositoryOption {\n readonly id: string;\n readonly name: string;\n readonly owner: string;\n readonly selected: boolean;\n readonly url: string;\n readonly visibility: GitHubRepositoryVisibility;\n}\n\ntype GitHubRevisionResolver = (\n url: string,\n authentication: GitHubRepositoryAuthentication,\n signal?: AbortSignal\n) => Promise<GitHubRepositoryRevisionResolutionResult>;\n\n/*** Resolve a GitHub URL to its immutable revision through the public Repository capability. */\nfunction resolveGitHubRevisionAsync(\n url: string,\n authentication: GitHubRepositoryAuthentication,\n signal?: AbortSignal\n): Promise<GitHubRepositoryRevisionResolutionResult> {\n return resolveGitHubRepositoryRevisionAsync({ authentication, url, signal });\n}\n\n/*** Keep the default cache process-local; another server instance transparently starts a fresh runtime. */\nconst defaultWorkspaceRepositoryRuntime = createWorkspaceRepositoryRuntime({\n materializeAsync: async (source, signal, authentication = 'anonymous') => {\n if (source.kind !== 'github') return loadProjectSourceAsync(source, signal);\n const materialized = await createGitHubProjectMaterializer().materializeAsync(\n source,\n signal,\n authentication\n );\n return { ...materialized, source };\n },\n resolveRevisionAsync: resolveGitHubRevisionAsync,\n});\n","import {\n AppRouteRouteModule,\n type AppRouteRouteHandlerContext,\n type AppRouteRouteModuleOptions,\n} from '../../server/route-modules/app-route/module.compiled'\nimport { RouteKind } from '../../server/route-kind'\nimport { patchFetch as _patchFetch } from '../../server/lib/patch-fetch'\nimport type { IncomingMessage, ServerResponse } from 'node:http'\nimport {\n addRequestMeta,\n getRequestMeta,\n setRequestMeta,\n type RequestMeta,\n} from '../../server/request-meta'\nimport {\n getTracer,\n type Span,\n SpanKind,\n SpanStatusCode,\n} from '../../server/lib/trace/tracer'\nimport { setManifestsSingleton } from '../../server/app-render/manifests-singleton'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { NodeNextRequest, NodeNextResponse } from '../../server/base-http/node'\nimport {\n NextRequestAdapter,\n signalFromNodeResponse,\n} from '../../server/web/spec-extension/adapters/next-request'\nimport { BaseServerSpan } from '../../server/lib/trace/constants'\nimport { getRevalidateReason } from '../../server/instrumentation/utils'\nimport { sendResponse } from '../../server/send-response'\nimport {\n fromNodeOutgoingHttpHeaders,\n toNodeOutgoingHttpHeaders,\n} from '../../server/web/utils'\nimport { getCacheControlHeader } from '../../server/lib/cache-control'\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from '../../lib/constants'\nimport { NoFallbackError } from '../../shared/lib/no-fallback-error.external'\nimport { isRouteCacheOwner } from '../../server/lib/route-cache-key'\nimport {\n CachedRouteKind,\n type ResponseCacheEntry,\n type ResponseGenerator,\n} from '../../server/response-cache'\n\n// These are injected by the loader afterwards. This is injected as a variable\n// instead of a replacement because this could also be `undefined` instead of\n// an empty string.\ndeclare const nextConfigOutput: AppRouteRouteModuleOptions['nextConfigOutput']\n\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\n// INJECT:nextConfigOutput\n\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: 'VAR_DEFINITION_PAGE',\n pathname: 'VAR_DEFINITION_PATHNAME',\n filename: 'VAR_DEFINITION_FILENAME',\n bundlePath: 'VAR_DEFINITION_BUNDLE_PATH',\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: 'VAR_RESOLVED_PAGE_PATH',\n nextConfigOutput,\n // The lazy require factory ensures that:\n // - In dev: devRequestTimingInternalsEnd is set before userland executes,\n // correctly attributing module load time to application-code rather than\n // framework internals.\n // - In all modes: async modules (route files with top-level await) are\n // handled correctly — require() returns a Promise for such modules, which\n // ensureUserland() awaits before the first request is handled.\n userland: () => require('VAR_USERLAND') as typeof import('VAR_USERLAND'),\n // In Turbopack dev mode, also provide a synchronous per-request getter so\n // server HMR updates are picked up without re-executing the entry chunk.\n // Using require() (synchronous) avoids adding async overhead that would be\n // incorrectly attributed to application-code time in devRequestTiming.\n ...(process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER\n ? {\n getUserland: () =>\n require('VAR_USERLAND') as typeof import('VAR_USERLAND'),\n }\n : {}),\n})\n\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule\n\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage,\n })\n}\n\nexport {\n routeModule,\n workAsyncStorage,\n workUnitAsyncStorage,\n serverHooks,\n patchFetch,\n}\n\nexport async function handler(\n req: IncomingMessage,\n res: ServerResponse,\n ctx: {\n waitUntil?: (prom: Promise<void>) => void\n requestMeta?: RequestMeta\n }\n) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta)\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint())\n }\n let srcPage = 'VAR_DEFINITION_PAGE'\n\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/'\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/'\n }\n const multiZoneDraftMode = process.env\n .__NEXT_MULTI_ZONE_DRAFT_MODE as any as boolean\n\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode,\n })\n\n if (!prepareResult) {\n res.statusCode = 400\n res.end('Bad Request')\n ctx.waitUntil?.(Promise.resolve())\n return null\n }\n\n const {\n buildId,\n deploymentId,\n params,\n nextConfig,\n parsedUrl,\n isDraftMode,\n prerenderManifest,\n routerServerContext,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n resolvedPathname,\n clientReferenceManifest,\n serverActionsManifest,\n } = prepareResult\n\n const normalizedSrcPage = normalizeAppPath(srcPage)\n\n // Only this route's prerenders can establish ISR or admit generated params.\n const isPrerendered =\n Boolean(prerenderManifest.routes[resolvedPathname]) &&\n (routeModule.isDev ||\n isRouteCacheOwner(\n resolvedPathname,\n routeModule.cacheOwner,\n prerenderManifest.routes[resolvedPathname]\n ))\n\n let isIsr = Boolean(\n prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered\n )\n\n const render404 = async () => {\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext?.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false)\n } else {\n res.end('This page could not be found')\n }\n return null\n }\n\n if (isIsr && !isDraftMode) {\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]\n\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404()\n }\n throw new NoFallbackError()\n }\n }\n }\n\n let cacheKey: string | null = null\n\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey\n }\n\n const supportsDynamicResponse: boolean =\n // If we're in development, we always support dynamic HTML\n routeModule.isDev === true ||\n // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr\n\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse\n\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest,\n })\n }\n\n const method = req.method || 'GET'\n const tracer = getTracer()\n const activeSpan = tracer.getActiveScopeSpan()\n const isWrappedByNextServer = Boolean(\n routerServerContext?.isWrappedByNextServer\n )\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'))\n\n const incrementalCache =\n getRequestMeta(req, 'incrementalCache') ||\n (await routeModule.getIncrementalCache(\n req,\n nextConfig,\n prerenderManifest,\n isMinimalMode\n ))\n\n incrementalCache?.resetRequestCache()\n ;(globalThis as any).__incrementalCache = incrementalCache\n\n const context: AppRouteRouteHandlerContext = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts),\n useCacheTimeout: nextConfig.experimental.useCacheTimeout,\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n validationLevel: nextConfig.experimental.instantInsights.validationLevel,\n isDraftMode,\n supportsDynamicResponse,\n incrementalCache,\n hmrRefreshHash: getRequestMeta(req, 'hmrRefreshHash'),\n cacheLifeProfiles: nextConfig.cacheLife,\n staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,\n waitUntil: ctx.waitUntil,\n onClose: (cb) => {\n res.on('close', cb)\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (\n error,\n _request,\n errorContext,\n silenceLog\n ) =>\n routeModule.onRequestError(\n req,\n error,\n errorContext,\n silenceLog,\n routerServerContext\n ),\n },\n sharedContext: {\n buildId,\n deploymentId,\n },\n }\n const nodeNextReq = new NodeNextRequest(req)\n const nodeNextRes = new NodeNextResponse(res)\n\n const nextReq = NextRequestAdapter.fromNodeNextRequest(\n nodeNextReq,\n signalFromNodeResponse(res)\n )\n\n const responseGenerator: ResponseGenerator = async ({\n previousCacheEntry,\n }) => {\n try {\n if (\n !isMinimalMode &&\n isOnDemandRevalidate &&\n revalidateOnlyGenerated &&\n !previousCacheEntry\n ) {\n res.statusCode = 404\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED')\n res.end('This page could not be found')\n return null\n }\n\n const response = await routeModule.handle(nextReq, context)\n\n ;(req as any).fetchMetrics = (context.renderOpts as any).fetchMetrics\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil\n\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil)\n pendingWaitUntil = undefined\n }\n }\n const cacheTags = context.renderOpts.collectedTags\n\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob()\n\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers)\n\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags\n }\n\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type\n }\n\n const revalidate =\n typeof context.renderOpts.collectedRevalidate === 'undefined' ||\n context.renderOpts.collectedRevalidate >= INFINITE_CACHE\n ? false\n : context.renderOpts.collectedRevalidate\n\n const expire =\n typeof context.renderOpts.collectedExpire === 'undefined' ||\n context.renderOpts.collectedExpire >= INFINITE_CACHE\n ? // Fall back to the global `expireTime` config when the\n // route has a numeric `revalidate` but didn't declare an\n // explicit `expire` (e.g. via `cacheLife`). This mirrors the\n // build-time fallback in `build/index.ts` so cache entries\n // and the response Cache-Control header agree on the route's\n // effective expire. Routes that opt out of revalidation\n // (`revalidate: false`) or that are dynamic (`revalidate: 0`)\n // keep `expire: undefined`.\n revalidate !== false && revalidate > 0\n ? nextConfig.expireTime\n : undefined\n : context.renderOpts.collectedExpire\n\n // Create the cache entry for the response.\n const cacheEntry: ResponseCacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers,\n },\n cacheControl: { revalidate, expire },\n }\n\n return cacheEntry\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, pendingWaitUntil)\n return null\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry?.isStale) {\n const silenceLog = false\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate,\n }),\n },\n silenceLog,\n routerServerContext\n )\n }\n throw err\n }\n }\n\n const handleResponse = async (\n currentSpan: Span | undefined,\n parentSpan: Span | undefined\n ) => {\n try {\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode,\n })\n\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return\n }\n\n if (cacheEntry?.value?.kind !== CachedRouteKind.APP_ROUTE) {\n throw new Error(\n `Invariant: app-route received invalid cache entry ${cacheEntry?.value?.kind}`\n )\n }\n\n if (!isMinimalMode) {\n res.setHeader(\n 'x-nextjs-cache',\n isOnDemandRevalidate\n ? 'REVALIDATED'\n : cacheEntry.isMiss\n ? 'MISS'\n : cacheEntry.isStale\n ? 'STALE'\n : 'HIT'\n )\n }\n\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader(\n 'Cache-Control',\n 'private, no-cache, no-store, max-age=0, must-revalidate'\n )\n }\n\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers)\n\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER)\n }\n\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (\n cacheEntry.cacheControl &&\n !res.getHeader('Cache-Control') &&\n !headers.get('Cache-Control')\n ) {\n headers.set(\n 'Cache-Control',\n getCacheControlHeader(cacheEntry.cacheControl)\n )\n }\n\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200,\n })\n )\n return\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate,\n }),\n },\n silenceLog,\n routerServerContext\n )\n }\n\n // rethrow so that we can handle serving error page\n\n // If this is during static generation, throw the error again.\n if (isIsr) throw err\n\n // Otherwise, send a 500 response.\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n new Response(null, { status: 500 })\n )\n return\n } finally {\n ;(() => {\n if (!currentSpan) {\n return\n }\n\n let statusCode = res.statusCode\n\n currentSpan.setAttributes({\n 'http.status_code': statusCode,\n 'next.rsc': false,\n })\n\n if (statusCode && statusCode >= 500) {\n // For 5xx status codes: SHOULD be set to 'Error' span status.\n // x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status\n currentSpan.setStatus({\n code: SpanStatusCode.ERROR,\n })\n // For span status 'Error', SHOULD set 'error.type' attribute.\n currentSpan.setAttribute('error.type', statusCode.toString())\n }\n\n const rootSpanAttributes = tracer.getRootSpanAttributes()\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return\n }\n\n if (\n rootSpanAttributes.get('next.span_type') !==\n BaseServerSpan.handleRequest\n ) {\n console.warn(\n `Unexpected root span type '${rootSpanAttributes.get(\n 'next.span_type'\n )}'. Please report this Next.js issue https://github.com/vercel/next.js`\n )\n return\n }\n\n const route = rootSpanAttributes.get('next.route') || normalizedSrcPage\n const name = `${method} ${route}`\n\n currentSpan.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name,\n })\n currentSpan.updateName(name)\n\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== currentSpan) {\n parentSpan.setAttribute('http.route', route)\n parentSpan.updateName(name)\n }\n })()\n }\n }\n\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan, undefined)\n } else {\n let parentSpan = tracer.getActiveScopeSpan()\n await tracer.withPropagatedContext(\n req.headers,\n () =>\n tracer.trace(\n BaseServerSpan.handleRequest,\n {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url,\n },\n },\n (span) => handleResponse(span, parentSpan)\n ),\n undefined,\n !isWrappedByNextServer\n )\n }\n}\n"],"names":["createDedupedByCallsiteServerErrorLoggerDev","errorRef","current","cache","React","fn","logErrorOrWarn","process","env","__NEXT_CACHE_COMPONENTS","console","error","warn","flushCurrentErrorIfNew","key","getMessage","logDedupedError","args","message","NODE_ENV","callStackFrames","Error","stack","split","undefined","length","cookies","callingExpression","workStore","workAsyncStorage","getStore","workUnitStore","workUnitAsyncStorage","isRequestApiAllowedInCurrentPhase","route","forceStatic","underlyingCookies","createEmptyCookies","makeUntrackedCookies","dynamicShouldError","StaticGenBailoutError","type","captureStackTrace","applyOwnerStack","invalidDynamicUsageError","makeHangingCookies","exportName","InvariantError","postponeWithTracking","dynamicTracking","throwToInterruptStaticGeneration","stagedRendering","delayUntilStage","RENDER_STAGES_BY_DATA_KIND","sessionData","trackDynamicDataInDynamicRender","areCookiesMutableInCurrentPhase","userspaceMutableCookies","makeUntrackedCookiesWithDevWarnings","asyncApiPromises","mutableCookies","throwForMissingRequestStore","RequestCookiesAdapter","seal","RequestCookies","Headers","CachedCookies","WeakMap","prerenderStore","cachedPromise","get","promise","makeRuntimeHangingPromise","renderSignal","set","cachedCookies","Promise","resolve","requestStore","instrumentCookiesPromiseWithDevWarnings","makeDevtoolsIOAwarePromise","proxiedPromise","warnForSyncAccess","createCookiesAccessError","Object","defineProperties","Symbol","iterator","replaceableWarningDescriptorForSymbolIterator","size","replaceableWarningDescriptor","getAll","has","delete","clear","toString","target","prop","enumerable","value","defineProperty","writable","configurable","expression","prefix","HeadersAdapter","ReadonlyHeadersError","constructor","callable","createPassThroughMethods","sealed","bind","getSetCookie","keys","values","entries","forEach","callbackfn","thisArg","name","call","createHidingMethods","isHidden","entry","headers","Proxy","receiver","ReflectAdapter","lowercased","toLowerCase","original","find","o","deleteProperty","hidden","methods","fresh","merge","Array","isArray","join","from","append","existing","push","underlyingHeaders","makeUntrackedHeaders","makeHangingHeaders","makeUntrackedHeadersWithDevWarnings","CachedHeaders","cachedHeaders","instrumentHeadersPromiseWithDevWarnings","createHeadersAccessError","draftMode","DraftMode","createOrGetCachedDraftMode","draftModeProvider","getDraftModeProviderForCacheScope","cacheKey","NullDraftMode","cachedDraftMode","CachedDraftModes","isPrefetchRequest","createDraftModeWithDevWarnings","underlyingProvider","instance","provider","_provider","isEnabled","enable","trackDynamicDraftMode","disable","createDraftModeAccessError","constructorOpt","phase","abortAndThrowOnSynchronousRequestDataAccess","revalidate","err","DynamicServerError","dynamicUsageDescription","dynamicUsageStack","module","exports","ActionDidNotRevalidate","ActionDidRevalidateDynamicOnly","ActionDidRevalidateStaticAndDynamic","MutableRequestCookiesAdapter","ReadonlyRequestCookiesError","appendMutableCookies","createCookiesWithMutableAccessCheck","getModifiedCookieValues","responseCookiesToRequestCookies","SYMBOL_MODIFY_COOKIE_VALUES","for","modified","modifiedCookieValues","resCookies","ResponseCookies","returnedCookies","cookie","wrap","onUpdateCookies","responseCookies","modifiedValues","modifiedCookies","Set","updateResponseCookies","pathWasRevalidated","allCookies","filter","c","serializedCookies","tempCookies","wrappedCookies","add","ensureCookiesAreStillMutable","_callingExpression","requestCookies","Pend","pending","max","Infinity","listeners","waiting","prototype","go","pendGo","wait","cb","hold","pendHold","self","called","onCb","shift","cbListener","listener","fs","util","stream","Readable","PassThrough","EventEmitter","BufferSlicer","FdSlicer","inherits","fd","pend","refCount","read","buffer","offset","position","callback","bytesRead","createReadStream","options","ReadStream","ref","unref","close","onCloseDone","emit","context","start","endOffset","end","pos","_read","n","toRead","Math","min","_readableState","highWaterMark","_cleanup","Buffer","allocUnsafe","destroy","slice","_destroy","RangeError","setImmediate","copy","readStream","entireSlice","maxChunkSize","nextOffset","write","CRC_TABLE","Int32Array","crc32","buf","crc","x","zlib","fd_slicer","Transform","Writable","open","fromFd","fromBuffer","fromRandomAccessReader","openPromise","fromFdPromise","fromBufferPromise","fromRandomAccessReaderPromise","dosDateTimeToDate","getFileNameLowLevel","validateFileName","parseExtraFields","ZipFile","Entry","LocalFileHeader","RandomAccessReader","path","options1","reject","lazyEntries","zipfile","reader","totalSize","autoClose","decodeStrings","validateEntrySizes","strictFileNames","defaultCallback","fstat","stats","Number","MAX_SAFE_INTEGER","eocdrWithoutCommentSize","zip64EocdlSize","maxCommentSize","bufferSize","newBuffer","bufferReadStart","readAndAssertNoEof","i","readUInt32LE","eocdrBuffer","subarray","diskNumber","readUInt16LE","entryCount","centralDirectoryOffset","commentLength","expectedCommentLength","comment","decodeBuffer","zip64EocdlBuffer","zip64EocdrOffset","readUInt64LE","zip64EocdrBuffer","fileSize","on","emitError","once","readEntryCursor","entriesRead","isOpen","emittedError","hasEachEntryBeenCalled","_readEntry","emitErrorAndAutoClose","readEntry","signature","versionMadeBy","versionNeededToExtract","generalPurposeBitFlag","compressionMethod","lastModFileTime","lastModFileDate","compressedSize","uncompressedSize","fileNameLength","extraFieldLength","fileCommentLength","internalFileAttributes","externalFileAttributes","relativeOffsetOfLocalHeader","fileNameRaw","fileCommentStart","extraFieldRaw","fileCommentRaw","extraFields","isUtf8","fileComment","fileName","errorMessage","extraField","id","zip64EiefBuffer","data","index","expectedCompressedSize","isEncrypted","msg","eachEntry","pendingResolveReject","onEntry","onEnd","onError","cleanup","removeListener","done","asyncIterator","next","return","throw","openReadStream","relativeStart","relativeEnd","decodeFileData","decrypt","decompress","isCompressed","rawMode","readLocalFileHeader","minimal","localFileHeader","openReadStreamLowLevel","fileDataStart","fileDataEnd","endpointStream","destroyed","inflateFilter","createInflateRaw","pipe","AssertByteCountStream","installDestroyFn","unpipe","openReadStreamPromise","openReadStreamLowLevelPromise","readLocalFileHeaderPromise","getLastModDate","forceDosFormat","flags","HAS_MTIME","posixTimestamp","readInt32LE","Date","hundredNanoSecondsSince1601","millisecondsSince1970","timezone","canDecodeFileData","date","time","day","month","year","millisecond","second","minute","hour","UTC","fileNameBuffer","readUInt8","oldNameCrc32","replace","indexOf","test","extraFieldBuffer","headerId","dataSize","dataStart","dataEnd","dataBuffer","byteCount","actualByteCount","expectedByteCount","_transform","chunk","encoding","_flush","emptyStream","_readStreamForRange","refUnrefFilter","RefUnrefFilter","byteCounter","writeStream","written","_write","unreffedYet","cp437","result","lower32","upper32","len","session","readGitHubAuthViewAsync","status","auth","available","adapter","getSession","ok","displayName","user","username","readGitHubRepositoryAuthenticationAsync","authentication","cacheScope","kind","accessToken","AppRouteRouteModule","RouteKind","patchFetch","_patchFetch","addRequestMeta","getRequestMeta","setRequestMeta","getTracer","SpanKind","SpanStatusCode","setManifestsSingleton","normalizeAppPath","NodeNextRequest","NodeNextResponse","NextRequestAdapter","signalFromNodeResponse","BaseServerSpan","getRevalidateReason","sendResponse","fromNodeOutgoingHttpHeaders","toNodeOutgoingHttpHeaders","getCacheControlHeader","INFINITE_CACHE","NEXT_CACHE_TAGS_HEADER","NoFallbackError","isRouteCacheOwner","CachedRouteKind","routeModule","definition","APP_ROUTE","page","pathname","filename","bundlePath","distDir","__NEXT_RELATIVE_DIST_DIR","relativeProjectDir","__NEXT_RELATIVE_PROJECT_DIR","resolvedPagePath","nextConfigOutput","userland","require","TURBOPACK","__NEXT_DEV_SERVER","getUserland","serverHooks","handler","req","res","ctx","requestMeta","isDev","hrtime","bigint","srcPage","multiZoneDraftMode","__NEXT_MULTI_ZONE_DRAFT_MODE","prepareResult","prepare","statusCode","waitUntil","buildId","deploymentId","params","nextConfig","parsedUrl","isDraftMode","prerenderManifest","routerServerContext","isOnDemandRevalidate","revalidateOnlyGenerated","resolvedPathname","clientReferenceManifest","serverActionsManifest","normalizedSrcPage","isPrerendered","Boolean","routes","cacheOwner","isIsr","dynamicRoutes","render404","prerenderInfo","fallback","adapterPath","supportsDynamicResponse","isStaticGeneration","method","tracer","activeSpan","getActiveScopeSpan","isWrappedByNextServer","isMinimalMode","incrementalCache","getIncrementalCache","resetRequestCache","globalThis","__incrementalCache","previewProps","preview","renderOpts","experimental","authInterrupts","useCacheTimeout","cacheComponents","validationLevel","instantInsights","hmrRefreshHash","cacheLifeProfiles","cacheLife","staticPageGenerationTimeout","onClose","onAfterTaskError","onInstrumentationRequestError","_request","errorContext","silenceLog","onRequestError","sharedContext","nodeNextReq","nodeNextRes","nextReq","fromNodeNextRequest","responseGenerator","previousCacheEntry","setHeader","response","handle","fetchMetrics","pendingWaitUntil","cacheTags","collectedTags","blob","collectedRevalidate","expire","collectedExpire","expireTime","cacheEntry","body","arrayBuffer","cacheControl","isStale","routerKind","routePath","routeType","revalidateReason","handleResponse","currentSpan","parentSpan","routeKind","isFallback","isRoutePPREnabled","isMiss","getHeader","Response","setAttributes","setStatus","code","ERROR","setAttribute","rootSpanAttributes","getRootSpanAttributes","handleRequest","updateName","withPropagatedContext","trace","spanName","SERVER","attributes","url","span"],"mappings":"sHAyCgBA,8CAAAA,qCAAAA,udAzCO,CAAA,CAAA,IAAA,mIAEvB,IAAMC,EAAsC,CAAEC,QAAS,IAAK,EAGtDC,EACmB,YAAvB,OAAOC,EAAMD,KAAK,CACdC,EAAMD,KAAK,CACX,AAACE,GAA+BA,EAKhCC,EAEFI,QAAQE,IAAI,CA0BT,EA5BgBL,OA4BPP,CA5BeQ,CA6B7BO,CAAoC,CA7BJ,CAACN,AA+BjC,OAAO,SAASO,AAAgB,GAAGC,CAAU,EAkBzCX,CAjDoD,CAgCtCS,EA/BhBL,GA+B8BO,GAmBhC,CACF,CAnDYN,AAKmBR,EAE7B,AAACW,CAyCkBI,EAhDJ,CAQb,GAAI,CACFZ,EAAeL,EAASC,OAAO,CACjC,QAAU,CACRD,EAASC,OAAO,CAAG,IACrB,CACF,6BAP0E,4ECY5DwB,UAAAA,qCAAAA,aA5BT,CAAA,CAAA,IAAA,OACwB,CAAA,CAAA,IAAA,KAIxB,CAAA,CAAA,IAAA,OAMA,CAAA,CAAA,IAAA,OAKA,CAAA,CAAA,IAAA,OAC+B,CAAA,CAAA,IAAA,OAK/B,CAAA,CAAA,IAAA,MACqD,CAAA,CAAA,IAAA,OACV,CAAA,CAAA,IAAA,OAEnB,CAAA,CAAA,IAAA,GAExB,SAASA,IACd,IAAMC,EAAoB,UACpBC,EAAYC,EAAAA,gBAAgB,CAACC,QAAQ,GACrCC,EAAgBC,EAAAA,oBAAoB,CAACF,QAAQ,GAEnD,GAAIF,EAAW,CACb,GAAIG,GAAiB,CAACE,GAAAA,EAAAA,iC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CACF,EACF","ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,16,17,18,19,20,21,22,23,24,25,26,28,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,52,53,54,55,56,57,58,61,62,63,64,67,68,75,76,77,82,97]}
|