@openai/codex-security 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/_bundled_plugin/mcp/helpers.mjs.br.part-000 +0 -0
- package/_bundled_plugin/mcp/native/win32-arm64/windows.node +0 -0
- package/_bundled_plugin/mcp/native/win32-x64/windows.node +0 -0
- package/_bundled_plugin/mcp/permission-profile-preflight.mjs +60 -9
- package/_bundled_plugin/mcp/server.mjs.br.part-000 +0 -0
- package/_bundled_plugin/mcp/server.mjs.br.part-001 +0 -0
- package/_bundled_plugin/schemas/definitions/artifact-common.schema.json +1 -1
- package/_bundled_plugin/scripts/finalize_scan_contract.py +12 -1
- package/_bundled_plugin/scripts/generate_in_scope_files.py +6 -6
- package/_bundled_plugin/scripts/generate_rank_input.py +12 -6
- package/_bundled_plugin/scripts/report_projection.py +2 -1
- package/_bundled_plugin/scripts/threat_model_projection.py +1 -3
- package/_bundled_plugin/scripts/workbench/saved_coverage.py +234 -0
- package/_bundled_plugin/scripts/workbench_cli.py +5 -7
- package/_bundled_plugin/scripts/workbench_db.py +12 -6
- package/_bundled_plugin/scripts/workbench_native_indexes.py +10 -7
- package/_bundled_plugin/scripts/workbench_publication.py +4 -3
- package/_bundled_plugin/scripts/workbench_remediation.py +5 -1
- package/_bundled_plugin/scripts/workbench_saved_results.py +542 -148
- package/_bundled_plugin/scripts/workbench_scan_history.py +79 -78
- package/_bundled_plugin/scripts/workbench_scan_usage.py +61 -13
- package/_bundled_plugin/scripts/workbench_target.py +21 -7
- package/_bundled_plugin/scripts/workbench_validation.py +21 -18
- package/_bundled_plugin/shared/workbench-migrations.json +10 -0
- package/dist/api.d.ts +1 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +161 -57
- package/dist/api.js.map +1 -1
- package/dist/classify-scan-severity.d.ts.map +1 -1
- package/dist/classify-scan-severity.js +16 -18
- package/dist/classify-scan-severity.js.map +1 -1
- package/dist/cli-daybreak.d.ts +5 -0
- package/dist/cli-daybreak.d.ts.map +1 -0
- package/dist/cli-daybreak.js +89 -0
- package/dist/cli-daybreak.js.map +1 -0
- package/dist/cli.d.ts +5 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +821 -591
- package/dist/cli.js.map +1 -1
- package/dist/codeowners.js +2 -2
- package/dist/codeowners.js.map +1 -1
- package/dist/component-plan.d.ts.map +1 -1
- package/dist/component-plan.js +3 -2
- package/dist/component-plan.js.map +1 -1
- package/dist/component-scan.js +2 -2
- package/dist/component-scan.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +5 -1
- package/dist/config.js.map +1 -1
- package/dist/cost.d.ts +2 -1
- package/dist/cost.d.ts.map +1 -1
- package/dist/cost.js +17 -8
- package/dist/cost.js.map +1 -1
- package/dist/custom-validation.d.ts.map +1 -1
- package/dist/custom-validation.js +2 -5
- package/dist/custom-validation.js.map +1 -1
- package/dist/deduplication/codex-review.d.ts.map +1 -1
- package/dist/deduplication/codex-review.js +8 -6
- package/dist/deduplication/codex-review.js.map +1 -1
- package/dist/deduplication/local.d.ts.map +1 -1
- package/dist/deduplication/local.js +5 -2
- package/dist/deduplication/local.js.map +1 -1
- package/dist/deduplication/retry.d.ts.map +1 -1
- package/dist/deduplication/retry.js +5 -0
- package/dist/deduplication/retry.js.map +1 -1
- package/dist/deduplication/scan.js +5 -1
- package/dist/deduplication/scan.js.map +1 -1
- package/dist/deep-scan.d.ts +6 -0
- package/dist/deep-scan.d.ts.map +1 -1
- package/dist/deep-scan.js +8 -6
- package/dist/deep-scan.js.map +1 -1
- package/dist/findings-import.d.ts.map +1 -1
- package/dist/findings-import.js +23 -3
- package/dist/findings-import.js.map +1 -1
- package/dist/host-protocol.d.ts +1 -0
- package/dist/host-protocol.d.ts.map +1 -1
- package/dist/host-protocol.js +1 -1
- package/dist/host-protocol.js.map +1 -1
- package/dist/hosted-remediation-protocol.d.ts +5 -0
- package/dist/hosted-remediation-protocol.d.ts.map +1 -0
- package/dist/hosted-remediation-protocol.js +26 -0
- package/dist/hosted-remediation-protocol.js.map +1 -0
- package/dist/hosted-remediation.d.ts +89 -0
- package/dist/hosted-remediation.d.ts.map +1 -0
- package/dist/hosted-remediation.js +122 -0
- package/dist/hosted-remediation.js.map +1 -0
- package/dist/import-scan.d.ts +1 -0
- package/dist/import-scan.d.ts.map +1 -1
- package/dist/import-scan.js +5 -1
- package/dist/import-scan.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/multiscan.d.ts.map +1 -1
- package/dist/multiscan.js +3 -1
- package/dist/multiscan.js.map +1 -1
- package/dist/project-config.d.ts.map +1 -1
- package/dist/project-config.js +13 -9
- package/dist/project-config.js.map +1 -1
- package/dist/publish.d.ts +2 -0
- package/dist/publish.d.ts.map +1 -1
- package/dist/publish.js +9 -0
- package/dist/publish.js.map +1 -1
- package/dist/remediation.d.ts +63 -0
- package/dist/remediation.d.ts.map +1 -0
- package/dist/remediation.js +110 -0
- package/dist/remediation.js.map +1 -0
- package/dist/request-metadata.d.ts +17 -7
- package/dist/request-metadata.d.ts.map +1 -1
- package/dist/request-metadata.js +43 -8
- package/dist/request-metadata.js.map +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +21 -14
- package/dist/runtime.js.map +1 -1
- package/dist/saved-scan-bootstrap.d.ts +1 -0
- package/dist/saved-scan-bootstrap.d.ts.map +1 -1
- package/dist/saved-scan-bootstrap.js +16 -4
- package/dist/saved-scan-bootstrap.js.map +1 -1
- package/dist/scan-activity.js +8 -8
- package/dist/scan-activity.js.map +1 -1
- package/dist/scan-comparison.d.ts.map +1 -1
- package/dist/scan-comparison.js +15 -9
- package/dist/scan-comparison.js.map +1 -1
- package/dist/scan-dashboard.d.ts.map +1 -1
- package/dist/scan-dashboard.js +12 -6
- package/dist/scan-dashboard.js.map +1 -1
- package/dist/scan-executor.d.ts +5 -1
- package/dist/scan-executor.d.ts.map +1 -1
- package/dist/scan-executor.js +9 -8
- package/dist/scan-executor.js.map +1 -1
- package/dist/{deep-progress.d.ts → scan-progress.d.ts} +15 -7
- package/dist/scan-progress.d.ts.map +1 -0
- package/dist/scan-progress.js +138 -0
- package/dist/scan-progress.js.map +1 -0
- package/dist/security-policy.js +1 -1
- package/dist/security-policy.js.map +1 -1
- package/dist/server/embeddings.d.ts.map +1 -1
- package/dist/server/embeddings.js +4 -0
- package/dist/server/embeddings.js.map +1 -1
- package/dist/server/sqlite-store.d.ts.map +1 -1
- package/dist/server/sqlite-store.js +14 -2
- package/dist/server/sqlite-store.js.map +1 -1
- package/dist/severity-store.js +4 -1
- package/dist/severity-store.js.map +1 -1
- package/dist/timestamps.d.ts +3 -0
- package/dist/timestamps.d.ts.map +1 -0
- package/dist/timestamps.js +14 -0
- package/dist/timestamps.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +13 -2
- package/dist/version.js.map +1 -1
- package/dist/workbench-arguments.d.ts.map +1 -1
- package/dist/workbench-arguments.js +9 -3
- package/dist/workbench-arguments.js.map +1 -1
- package/dist/worker-progress.d.ts +11 -1
- package/dist/worker-progress.d.ts.map +1 -1
- package/dist/worker-progress.js +11 -1
- package/dist/worker-progress.js.map +1 -1
- package/docs/cli.md +86 -15
- package/docs/findings-service.md +7 -2
- package/docs/hosted-remediation.md +117 -0
- package/docs/hosted-scans.md +8 -3
- package/package.json +5 -4
- package/dist/deep-progress.d.ts.map +0 -1
- package/dist/deep-progress.js +0 -92
- package/dist/deep-progress.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classify-scan-severity.d.ts","sourceRoot":"","sources":["../src/classify-scan-severity.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC5B,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"classify-scan-severity.d.ts","sourceRoot":"","sources":["../src/classify-scan-severity.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC5B,MAAM,wBAAwB,CAAC;AAahC,MAAM,WAAW,0BAA2B,SAAQ,sBAAsB;IACxE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,2BAA4B,SAAQ,uBAAuB;IAC1E,yFAAyF;IACzF,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,wFAAwF;IACxF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,qFAAqF;AACrF,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,0BAA0B,CAAC,CAErC;AAwCD,sGAAsG;AACtG,wBAAsB,6BAA6B,CACjD,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,0BAA0B,CAAC,CAErC"}
|
|
@@ -4,7 +4,8 @@ import { join } from "node:path";
|
|
|
4
4
|
import { classifySeverityInternal, validateSeverityClassification, } from "./classify-severity.js";
|
|
5
5
|
import { loadContractWithScanDirectory } from "./contract.js";
|
|
6
6
|
import { CodexSecurityError } from "./errors.js";
|
|
7
|
-
import { bundledPluginRoot
|
|
7
|
+
import { bundledPluginRoot } from "./runtime.js";
|
|
8
|
+
import { savedScanWorkbench } from "./saved-scan-bootstrap.js";
|
|
8
9
|
import { resolveCompletedScan, } from "./saved-scan.js";
|
|
9
10
|
import { SeverityStore } from "./severity-store.js";
|
|
10
11
|
const CLASSIFICATION_FILE = "severity-classification.json";
|
|
@@ -17,41 +18,38 @@ export async function classifyScanSeverityInternal(scanId, options = {}, depende
|
|
|
17
18
|
options.signal?.throwIfAborted();
|
|
18
19
|
const environment = options.environment ?? process.env;
|
|
19
20
|
const pluginRoot = await bundledPluginRoot();
|
|
21
|
+
const currentDirectory = dependencies.currentDirectory?.() ?? process.cwd();
|
|
22
|
+
const bootstrap = dependencies.runWorkbench
|
|
23
|
+
? undefined
|
|
24
|
+
: await savedScanWorkbench(scanId, {
|
|
25
|
+
environment,
|
|
26
|
+
pluginRoot,
|
|
27
|
+
currentDirectory,
|
|
28
|
+
signal: options.signal,
|
|
29
|
+
});
|
|
20
30
|
const scan = await resolveCompletedScan(scanId, {
|
|
21
|
-
currentDirectory:
|
|
22
|
-
runWorkbench: dependencies.runWorkbench ??
|
|
23
|
-
(async (args) => {
|
|
24
|
-
const stateEnvironment = workbenchEnvironment(environment);
|
|
25
|
-
return runWorkbench({
|
|
26
|
-
environment: stateEnvironment,
|
|
27
|
-
pluginRoot,
|
|
28
|
-
python: await resolvePluginPython({
|
|
29
|
-
environment: stateEnvironment,
|
|
30
|
-
}),
|
|
31
|
-
signal: options.signal,
|
|
32
|
-
failureMessage: "Could not read Codex Security scan history",
|
|
33
|
-
}, args);
|
|
34
|
-
}),
|
|
31
|
+
currentDirectory: () => currentDirectory,
|
|
32
|
+
runWorkbench: (args, input) => (dependencies.runWorkbench ?? bootstrap)(args, input, options.signal),
|
|
35
33
|
});
|
|
36
34
|
if (options.expectedScanId !== undefined &&
|
|
37
35
|
options.expectedScanId !== scan.scanId) {
|
|
38
36
|
throw new CodexSecurityError("Saved scan does not match expectedScanId.");
|
|
39
37
|
}
|
|
40
|
-
return classifyScanDirectorySeverityInternal(scan.scanDir, { ...options, expectedScanId: scan.scanId }, surface);
|
|
38
|
+
return classifyScanDirectorySeverityInternal(scan.scanDir, { ...options, expectedScanId: scan.scanId }, surface, bootstrap?.protectedRoots);
|
|
41
39
|
}
|
|
42
40
|
/** Classify a sealed scan directory and save a separate assessment without changing its artifacts. */
|
|
43
41
|
export async function classifyScanDirectorySeverity(scanDirectory, options = {}) {
|
|
44
42
|
return classifyScanDirectorySeverityInternal(scanDirectory, options);
|
|
45
43
|
}
|
|
46
44
|
/** @internal */
|
|
47
|
-
export async function classifyScanDirectorySeverityInternal(requestedDirectory, options = {}, surface = "sdk") {
|
|
45
|
+
export async function classifyScanDirectorySeverityInternal(requestedDirectory, options = {}, surface = "sdk", protectedRoots = []) {
|
|
48
46
|
const { contract, scanDirectory } = await loadContractWithScanDirectory(requestedDirectory, {
|
|
49
47
|
pluginRoot: await bundledPluginRoot(),
|
|
50
48
|
expectedScanId: options.expectedScanId,
|
|
51
49
|
signal: options.signal,
|
|
52
50
|
});
|
|
53
51
|
const findings = selectClassificationFindings(contract.findings.findings, options.findingIds);
|
|
54
|
-
const store = new SeverityStore(options.environment ?? process.env, scanDirectory, options.signal);
|
|
52
|
+
const store = new SeverityStore(options.environment ?? process.env, scanDirectory, options.signal, protectedRoots);
|
|
55
53
|
const result = {
|
|
56
54
|
...(await classifySeverityInternal(findings, options, surface, store.checkpoint(contract.manifest.scan.id, findings.map(({ findingId }) => findingId), options.reprocess ?? false))),
|
|
57
55
|
scanId: contract.manifest.scan.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classify-scan-severity.js","sourceRoot":"","sources":["../src/classify-scan-severity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,wBAAwB,EACxB,8BAA8B,GAG/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,oBAAoB,GAErB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,a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,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,aAAqB,EACrB,MAAc,EACd,QAA4B,EAC5B,MAAoB,EACpB,WAAW,GAAsB,OAAO,CAAC,GAAG;IAE5C,MAAM,cAAc,GAAG,MAAM,IAAI,aAAa,CAC5C,WAAW,EACX,aAAa,EACb,MAAM,CACP,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACf,OAAO,cAAc,KAAK,SAAS;QACjC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,8BAA8B,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAC/D,CAAC","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport { rename, rm, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport {\n classifySeverityInternal,\n validateSeverityClassification,\n type ClassifySeverityOptions,\n type SeverityClassification,\n} from \"./classify-severity.js\";\nimport { loadContractWithScanDirectory } from \"./contract.js\";\nimport { CodexSecurityError } from \"./errors.js\";\nimport type { Finding } from \"./models.js\";\nimport {\n bundledPluginRoot,\n workbenchEnvironment,\n resolvePluginPython,\n runWorkbench,\n} from \"./runtime.js\";\nimport {\n resolveCompletedScan,\n type SavedScanDependencies,\n} from \"./saved-scan.js\";\nimport { SeverityStore } from \"./severity-store.js\";\n\nconst CLASSIFICATION_FILE = \"severity-classification.json\";\nexport interface ScanSeverityClassification extends SeverityClassification {\n scanId: string;\n}\n\nexport interface ClassifyScanSeverityOptions extends ClassifySeverityOptions {\n /** Exact selection, such as dedupe's uniqueFindingIds. Omit to classify all findings. */\n findingIds?: readonly string[];\n /** Reclassify selected findings even when their saved assessment matches the inputs. */\n reprocess?: boolean;\n expectedScanId?: string;\n}\n\n/** Resolve a saved scan ID, unique prefix, or latest and save its classification. */\nexport async function classifyScanSeverity(\n scanId: string,\n options: ClassifyScanSeverityOptions = {},\n): Promise<ScanSeverityClassification> {\n return classifyScanSeverityInternal(scanId, options);\n}\n\n/** @internal */\nexport async function classifyScanSeverityInternal(\n scanId: string,\n options: ClassifyScanSeverityOptions = {},\n dependencies: Partial<SavedScanDependencies> = {},\n surface: \"sdk\" | \"cli\" = \"sdk\",\n): Promise<ScanSeverityClassification> {\n options.signal?.throwIfAborted();\n const environment = options.environment ?? process.env;\n const pluginRoot = await bundledPluginRoot();\n const scan = await resolveCompletedScan(scanId, {\n currentDirectory: dependencies.currentDirectory ?? (() => process.cwd()),\n runWorkbench:\n dependencies.runWorkbench ??\n (async (args) => {\n const stateEnvironment = workbenchEnvironment(environment);\n return runWorkbench(\n {\n environment: stateEnvironment,\n pluginRoot,\n python: await resolvePluginPython({\n environment: stateEnvironment,\n }),\n signal: options.signal,\n failureMessage: \"Could not read Codex Security scan history\",\n },\n args,\n );\n }),\n });\n if (\n options.expectedScanId !== undefined &&\n options.expectedScanId !== scan.scanId\n ) {\n throw new CodexSecurityError(\"Saved scan does not match expectedScanId.\");\n }\n return classifyScanDirectorySeverityInternal(\n scan.scanDir,\n { ...options, expectedScanId: scan.scanId },\n surface,\n );\n}\n\n/** Classify a sealed scan directory and save a separate assessment without changing its artifacts. */\nexport async function classifyScanDirectorySeverity(\n scanDirectory: string,\n options: ClassifyScanSeverityOptions = {},\n): Promise<ScanSeverityClassification> {\n return classifyScanDirectorySeverityInternal(scanDirectory, options);\n}\n\n/** @internal */\nexport async function classifyScanDirectorySeverityInternal(\n requestedDirectory: string,\n options: ClassifyScanSeverityOptions = {},\n surface: \"sdk\" | \"cli\" = \"sdk\",\n): Promise<ScanSeverityClassification> {\n const { contract, scanDirectory } = await loadContractWithScanDirectory(\n requestedDirectory,\n {\n pluginRoot: await bundledPluginRoot(),\n expectedScanId: options.expectedScanId,\n signal: options.signal,\n },\n );\n const findings = selectClassificationFindings(\n contract.findings.findings,\n options.findingIds,\n );\n const store = new SeverityStore(\n options.environment ?? process.env,\n scanDirectory,\n options.signal,\n );\n const result: ScanSeverityClassification = {\n ...(await classifySeverityInternal(\n findings,\n options,\n surface,\n store.checkpoint(\n contract.manifest.scan.id,\n findings.map(({ findingId }) => findingId),\n options.reprocess ?? false,\n ),\n )),\n scanId: contract.manifest.scan.id,\n };\n options.signal?.throwIfAborted();\n const temporary = join(\n scanDirectory,\n `.severity-classification-${randomUUID()}.json`,\n );\n try {\n await writeFile(temporary, `${JSON.stringify(result, null, 2)}\\n`, {\n flag: \"wx\",\n mode: 0o600,\n signal: options.signal,\n });\n options.signal?.throwIfAborted();\n await rename(temporary, join(scanDirectory, CLASSIFICATION_FILE));\n } finally {\n await rm(temporary, { force: true });\n }\n return result;\n}\n\n/** @internal */\nexport function selectClassificationFindings(\n findings: readonly Finding[],\n findingIds?: readonly string[],\n): readonly Finding[] {\n if (findingIds === undefined) return findings;\n const selected = new Set(findingIds);\n const result = findings.filter((finding) => selected.has(finding.findingId));\n if (result.length !== selected.size) {\n throw new CodexSecurityError(\n \"Selected finding IDs must belong to the supplied scan.\",\n );\n }\n return result;\n}\n\n/** @internal */\nexport async function readScanSeverityClassification(\n scanDirectory: string,\n scanId: string,\n findings: readonly Finding[],\n signal?: AbortSignal,\n environment: NodeJS.ProcessEnv = process.env,\n): Promise<SeverityClassification | undefined> {\n const classification = await new SeverityStore(\n environment,\n scanDirectory,\n signal,\n ).read(scanId);\n return classification === undefined\n ? undefined\n : validateSeverityClassification(classification, findings);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"classify-scan-severity.js","sourceRoot":"","sources":["../src/classify-scan-severity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,wBAAwB,EACxB,8BAA8B,GAG/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,O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CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IAC7E,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,IAAI,EAAE,CAAC;QACpC,MAAM,IAAI,kBAAkB,CAC1B,wDAAwD,CACzD,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,aAAqB,EACrB,MAAc,EACd,QAA4B,EAC5B,MAAoB,EACpB,WAAW,GAAsB,OAAO,CAAC,GAAG;IAE5C,MAAM,cAAc,GAAG,MAAM,IAAI,aAAa,CAC5C,WAAW,EACX,aAAa,EACb,MAAM,CACP,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACf,OAAO,cAAc,KAAK,SAAS;QACjC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,8BAA8B,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAC/D,CAAC","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport { rename, rm, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport {\n classifySeverityInternal,\n validateSeverityClassification,\n type ClassifySeverityOptions,\n type SeverityClassification,\n} from \"./classify-severity.js\";\nimport { loadContractWithScanDirectory } from \"./contract.js\";\nimport { CodexSecurityError } from \"./errors.js\";\nimport type { Finding } from \"./models.js\";\nimport { bundledPluginRoot } from \"./runtime.js\";\nimport { savedScanWorkbench } from \"./saved-scan-bootstrap.js\";\nimport {\n resolveCompletedScan,\n type SavedScanDependencies,\n} from \"./saved-scan.js\";\nimport { SeverityStore } from \"./severity-store.js\";\n\nconst CLASSIFICATION_FILE = \"severity-classification.json\";\nexport interface ScanSeverityClassification extends SeverityClassification {\n scanId: string;\n}\n\nexport interface ClassifyScanSeverityOptions extends ClassifySeverityOptions {\n /** Exact selection, such as dedupe's uniqueFindingIds. Omit to classify all findings. */\n findingIds?: readonly string[];\n /** Reclassify selected findings even when their saved assessment matches the inputs. */\n reprocess?: boolean;\n expectedScanId?: string;\n}\n\n/** Resolve a saved scan ID, unique prefix, or latest and save its classification. */\nexport async function classifyScanSeverity(\n scanId: string,\n options: ClassifyScanSeverityOptions = {},\n): Promise<ScanSeverityClassification> {\n return classifyScanSeverityInternal(scanId, options);\n}\n\n/** @internal */\nexport async function classifyScanSeverityInternal(\n scanId: string,\n options: ClassifyScanSeverityOptions = {},\n dependencies: Partial<SavedScanDependencies> = {},\n surface: \"sdk\" | \"cli\" = \"sdk\",\n): Promise<ScanSeverityClassification> {\n options.signal?.throwIfAborted();\n const environment = options.environment ?? process.env;\n const pluginRoot = await bundledPluginRoot();\n const currentDirectory = dependencies.currentDirectory?.() ?? process.cwd();\n const bootstrap = dependencies.runWorkbench\n ? undefined\n : await savedScanWorkbench(scanId, {\n environment,\n pluginRoot,\n currentDirectory,\n signal: options.signal,\n });\n const scan = await resolveCompletedScan(scanId, {\n currentDirectory: () => currentDirectory,\n runWorkbench: (args, input) =>\n (dependencies.runWorkbench ?? bootstrap!)(args, input, options.signal),\n });\n if (\n options.expectedScanId !== undefined &&\n options.expectedScanId !== scan.scanId\n ) {\n throw new CodexSecurityError(\"Saved scan does not match expectedScanId.\");\n }\n return classifyScanDirectorySeverityInternal(\n scan.scanDir,\n { ...options, expectedScanId: scan.scanId },\n surface,\n bootstrap?.protectedRoots,\n );\n}\n\n/** Classify a sealed scan directory and save a separate assessment without changing its artifacts. */\nexport async function classifyScanDirectorySeverity(\n scanDirectory: string,\n options: ClassifyScanSeverityOptions = {},\n): Promise<ScanSeverityClassification> {\n return classifyScanDirectorySeverityInternal(scanDirectory, options);\n}\n\n/** @internal */\nexport async function classifyScanDirectorySeverityInternal(\n requestedDirectory: string,\n options: ClassifyScanSeverityOptions = {},\n surface: \"sdk\" | \"cli\" = \"sdk\",\n protectedRoots: readonly string[] = [],\n): Promise<ScanSeverityClassification> {\n const { contract, scanDirectory } = await loadContractWithScanDirectory(\n requestedDirectory,\n {\n pluginRoot: await bundledPluginRoot(),\n expectedScanId: options.expectedScanId,\n signal: options.signal,\n },\n );\n const findings = selectClassificationFindings(\n contract.findings.findings,\n options.findingIds,\n );\n const store = new SeverityStore(\n options.environment ?? process.env,\n scanDirectory,\n options.signal,\n protectedRoots,\n );\n const result: ScanSeverityClassification = {\n ...(await classifySeverityInternal(\n findings,\n options,\n surface,\n store.checkpoint(\n contract.manifest.scan.id,\n findings.map(({ findingId }) => findingId),\n options.reprocess ?? false,\n ),\n )),\n scanId: contract.manifest.scan.id,\n };\n options.signal?.throwIfAborted();\n const temporary = join(\n scanDirectory,\n `.severity-classification-${randomUUID()}.json`,\n );\n try {\n await writeFile(temporary, `${JSON.stringify(result, null, 2)}\\n`, {\n flag: \"wx\",\n mode: 0o600,\n signal: options.signal,\n });\n options.signal?.throwIfAborted();\n await rename(temporary, join(scanDirectory, CLASSIFICATION_FILE));\n } finally {\n await rm(temporary, { force: true });\n }\n return result;\n}\n\n/** @internal */\nexport function selectClassificationFindings(\n findings: readonly Finding[],\n findingIds?: readonly string[],\n): readonly Finding[] {\n if (findingIds === undefined) return findings;\n const selected = new Set(findingIds);\n const result = findings.filter((finding) => selected.has(finding.findingId));\n if (result.length !== selected.size) {\n throw new CodexSecurityError(\n \"Selected finding IDs must belong to the supplied scan.\",\n );\n }\n return result;\n}\n\n/** @internal */\nexport async function readScanSeverityClassification(\n scanDirectory: string,\n scanId: string,\n findings: readonly Finding[],\n signal?: AbortSignal,\n environment: NodeJS.ProcessEnv = process.env,\n): Promise<SeverityClassification | undefined> {\n const classification = await new SeverityStore(\n environment,\n scanDirectory,\n signal,\n ).read(scanId);\n return classification === undefined\n ? undefined\n : validateSeverityClassification(classification, findings);\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JsonObject } from "./config.js";
|
|
2
|
+
type CyberAccessProgram = "standard" | "daybreakBlue" | "daybreakRed";
|
|
3
|
+
export declare function appServerCyberAccessProgram(config: JsonObject, model: string, provider: string, threadId: string, request: (method: string, params: JsonObject) => Promise<JsonObject>): Promise<CyberAccessProgram | undefined>;
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=cli-daybreak.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-daybreak.d.ts","sourceRoot":"","sources":["../src/cli-daybreak.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9C,KAAK,kBAAkB,GAAG,UAAU,GAAG,cAAc,GAAG,aAAa,CAAC;AAItE,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,UAAU,CAAC,GACnE,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAsFzC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { isRecord } from "./record.js";
|
|
2
|
+
// App-server clients resolve Daybreak from the catalog before starting a turn,
|
|
3
|
+
// just as native Codex exec does; the config key alone does not select a program.
|
|
4
|
+
export async function appServerCyberAccessProgram(config, model, provider, threadId, request) {
|
|
5
|
+
const features = new Map();
|
|
6
|
+
let featureCursor;
|
|
7
|
+
do {
|
|
8
|
+
const result = await request("experimentalFeature/list", {
|
|
9
|
+
threadId,
|
|
10
|
+
...(featureCursor === undefined ? {} : { cursor: featureCursor }),
|
|
11
|
+
});
|
|
12
|
+
const flags = result["data"];
|
|
13
|
+
if (Array.isArray(flags)) {
|
|
14
|
+
for (const flag of flags) {
|
|
15
|
+
if (isRecord(flag) && typeof flag["name"] === "string")
|
|
16
|
+
features.set(flag["name"], flag["enabled"]);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
if (features.get("cli_daybreak") === false)
|
|
20
|
+
return undefined;
|
|
21
|
+
if (features.has("cli_daybreak") &&
|
|
22
|
+
features.has("api_key_cyber_access_programs")) {
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
featureCursor =
|
|
26
|
+
typeof result["nextCursor"] === "string"
|
|
27
|
+
? result["nextCursor"]
|
|
28
|
+
: undefined;
|
|
29
|
+
} while (featureCursor !== undefined);
|
|
30
|
+
if (!features.has("cli_daybreak")) {
|
|
31
|
+
throw new Error("Codex did not report the effective cli_daybreak feature");
|
|
32
|
+
}
|
|
33
|
+
const enabled = config["daybreak"] === true;
|
|
34
|
+
if (provider !== "openai") {
|
|
35
|
+
if (enabled)
|
|
36
|
+
throw new Error("Daybreak requires the OpenAI model provider");
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
const accountType = async () => {
|
|
40
|
+
const result = await request("account/read", { refreshToken: false });
|
|
41
|
+
return isRecord(result["account"]) ? result["account"]["type"] : undefined;
|
|
42
|
+
};
|
|
43
|
+
if (enabled) {
|
|
44
|
+
const account = await accountType();
|
|
45
|
+
if (account !== "chatgpt" && account !== "apiKey") {
|
|
46
|
+
throw new Error("Daybreak requires a signed-in ChatGPT account or an OpenAI API key");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
let cursor;
|
|
50
|
+
do {
|
|
51
|
+
const result = await request("model/list", {
|
|
52
|
+
includeHidden: true,
|
|
53
|
+
...(cursor === undefined ? {} : { cursor }),
|
|
54
|
+
}).catch(() => undefined);
|
|
55
|
+
if (result === undefined)
|
|
56
|
+
return undefined;
|
|
57
|
+
const models = result["data"];
|
|
58
|
+
const selected = Array.isArray(models)
|
|
59
|
+
? models.find((entry) => isRecord(entry) && entry["model"] === model)
|
|
60
|
+
: undefined;
|
|
61
|
+
if (isRecord(selected)) {
|
|
62
|
+
const access = selected["availableAccessPrograms"];
|
|
63
|
+
const programs = isRecord(access) ? access["cyber"] : undefined;
|
|
64
|
+
if (!Array.isArray(programs) || programs.length === 0)
|
|
65
|
+
return undefined;
|
|
66
|
+
if (enabled) {
|
|
67
|
+
for (const program of ["daybreakBlue", "daybreakRed"]) {
|
|
68
|
+
if (programs.includes(program))
|
|
69
|
+
return program;
|
|
70
|
+
}
|
|
71
|
+
throw new Error(`Daybreak is unavailable for model ${model}; turn it off or choose a compatible model`);
|
|
72
|
+
}
|
|
73
|
+
if (!programs.includes("standard"))
|
|
74
|
+
return undefined;
|
|
75
|
+
const account = await accountType().catch(() => undefined);
|
|
76
|
+
return account === "chatgpt" ||
|
|
77
|
+
(account === "apiKey" &&
|
|
78
|
+
features.get("api_key_cyber_access_programs") === true)
|
|
79
|
+
? "standard"
|
|
80
|
+
: undefined;
|
|
81
|
+
}
|
|
82
|
+
cursor =
|
|
83
|
+
typeof result["nextCursor"] === "string"
|
|
84
|
+
? result["nextCursor"]
|
|
85
|
+
: undefined;
|
|
86
|
+
} while (cursor !== undefined);
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=cli-daybreak.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-daybreak.js","sourceRoot":"","sources":["../src/cli-daybreak.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIvC,+EAA+E;AAC/E,kFAAkF;AAClF,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,MAAkB,EAClB,KAAa,EACb,QAAgB,EAChB,QAAgB,EAChB,OAAoE;IAEpE,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAmB,CAAC;IAC5C,IAAI,aAAiC,CAAC;IACtC,GAAG,CAAC;QACF,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,0BAA0B,EAAE;YACvD,QAAQ;YACR,GAAG,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;SAClE,CAAC,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,CAAC,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AC;YAChE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,SAAS,CAAC;YACxE,IAAI,OAAO,EAAE,CAAC;gBACZ,KAAK,MAAM,OAAO,IAAI,CAAC,cAAc,EAAE,aAAa,CAAU,EAAE,CAAC;oBAC/D,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC;wBAAE,OAAO,OAAO,CAAC;gBACjD,CAAC;gBACD,MAAM,IAAI,KAAK,CACb,qCAAqC,KAAK,4CAA4C,CACvF,CAAC;YACJ,CAAC;YACD,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC;gBAAE,OAAO,SAAS,CAAC;YACrD,MAAM,OAAO,GAAG,MAAM,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;YAC3D,OAAO,OAAO,KAAK,SAAS;gBAC1B,CAAC,OAAO,KAAK,QAAQ;oBACnB,QAAQ,CAAC,GAAG,CAAC,+BAA+B,CAAC,KAAK,IAAI,CAAC;gBACzD,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,SAAS,CAAC;QAChB,CAAC;QACD,MAAM;YACJ,OAAO,MAAM,CAAC,YAAY,CAAC,KAAK,QAAQ;gBACtC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;gBACtB,CAAC,CAAC,SAAS,CAAC;IAClB,CAAC,QAAQ,MAAM,KAAK,SAAS,EAAE;IAC/B,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import type { JsonObject } from \"./config.js\";\nimport { isRecord } from \"./record.js\";\n\ntype CyberAccessProgram = \"standard\" | \"daybreakBlue\" | \"daybreakRed\";\n\n// App-server clients resolve Daybreak from the catalog before starting a turn,\n// just as native Codex exec does; the config key alone does not select a program.\nexport async function appServerCyberAccessProgram(\n config: JsonObject,\n model: string,\n provider: string,\n threadId: string,\n request: (method: string, params: JsonObject) => Promise<JsonObject>,\n): Promise<CyberAccessProgram | undefined> {\n const features = new Map<string, unknown>();\n let featureCursor: string | undefined;\n do {\n const result = await request(\"experimentalFeature/list\", {\n threadId,\n ...(featureCursor === undefined ? {} : { cursor: featureCursor }),\n });\n const flags = result[\"data\"];\n if (Array.isArray(flags)) {\n for (const flag of flags) {\n if (isRecord(flag) && typeof flag[\"name\"] === \"string\")\n features.set(flag[\"name\"], flag[\"enabled\"]);\n }\n }\n if (features.get(\"cli_daybreak\") === false) return undefined;\n if (\n features.has(\"cli_daybreak\") &&\n features.has(\"api_key_cyber_access_programs\")\n ) {\n break;\n }\n featureCursor =\n typeof result[\"nextCursor\"] === \"string\"\n ? result[\"nextCursor\"]\n : undefined;\n } while (featureCursor !== undefined);\n if (!features.has(\"cli_daybreak\")) {\n throw new Error(\"Codex did not report the effective cli_daybreak feature\");\n }\n const enabled = config[\"daybreak\"] === true;\n if (provider !== \"openai\") {\n if (enabled) throw new Error(\"Daybreak requires the OpenAI model provider\");\n return undefined;\n }\n\n const accountType = async (): Promise<unknown> => {\n const result = await request(\"account/read\", { refreshToken: false });\n return isRecord(result[\"account\"]) ? result[\"account\"][\"type\"] : undefined;\n };\n if (enabled) {\n const account = await accountType();\n if (account !== \"chatgpt\" && account !== \"apiKey\") {\n throw new Error(\n \"Daybreak requires a signed-in ChatGPT account or an OpenAI API key\",\n );\n }\n }\n\n let cursor: string | undefined;\n do {\n const result = await request(\"model/list\", {\n includeHidden: true,\n ...(cursor === undefined ? {} : { cursor }),\n }).catch(() => undefined);\n if (result === undefined) return undefined;\n const models = result[\"data\"];\n const selected = Array.isArray(models)\n ? models.find((entry) => isRecord(entry) && entry[\"model\"] === model)\n : undefined;\n if (isRecord(selected)) {\n const access = selected[\"availableAccessPrograms\"];\n const programs = isRecord(access) ? access[\"cyber\"] : undefined;\n if (!Array.isArray(programs) || programs.length === 0) return undefined;\n if (enabled) {\n for (const program of [\"daybreakBlue\", \"daybreakRed\"] as const) {\n if (programs.includes(program)) return program;\n }\n throw new Error(\n `Daybreak is unavailable for model ${model}; turn it off or choose a compatible model`,\n );\n }\n if (!programs.includes(\"standard\")) return undefined;\n const account = await accountType().catch(() => undefined);\n return account === \"chatgpt\" ||\n (account === \"apiKey\" &&\n features.get(\"api_key_cyber_access_programs\") === true)\n ? \"standard\"\n : undefined;\n }\n cursor =\n typeof result[\"nextCursor\"] === \"string\"\n ? result[\"nextCursor\"]\n : undefined;\n } while (cursor !== undefined);\n return undefined;\n}\n"]}
|
package/dist/cli.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { z } from "incur";
|
|
|
4
4
|
import { type ValidateFunction } from "ajv/dist/2020.js";
|
|
5
5
|
import { type ArtifactExportArguments } from "./artifact-export.js";
|
|
6
6
|
export { exportEnvironment } from "./artifact-export.js";
|
|
7
|
-
import { CodexSecurity, type ScanAuthMode, type ScanAuthentication } from "./api.js";
|
|
7
|
+
import { CodexSecurity, type ScanAuthMode, type ScanAuthentication, type ScanOptions } from "./api.js";
|
|
8
8
|
import { suggestOwnersInternal } from "./suggest-owners.js";
|
|
9
9
|
import { publishScanToCustom } from "./custom-publish.js";
|
|
10
10
|
import { deduplicateScanInternal } from "./deduplication/scan.js";
|
|
@@ -63,6 +63,7 @@ interface SkillCommandOutput {
|
|
|
63
63
|
readonly threadSource: SkillThreadSource;
|
|
64
64
|
readonly sandbox?: "read-only" | "workspace-write";
|
|
65
65
|
readonly externalSandbox?: boolean;
|
|
66
|
+
readonly cyberAccessProgram?: ScanOptions["cyberAccessProgram"];
|
|
66
67
|
readonly onEvent?: (event: Readonly<Record<string, unknown>>) => void;
|
|
67
68
|
};
|
|
68
69
|
}
|
|
@@ -114,6 +115,7 @@ interface CliDependencies {
|
|
|
114
115
|
runRepositoryCommand(command: "git" | "gh" | "glab", args: readonly string[], repository: string, options?: {
|
|
115
116
|
trim?: boolean;
|
|
116
117
|
environment?: NodeJS.ProcessEnv;
|
|
118
|
+
input?: string;
|
|
117
119
|
}): Promise<string>;
|
|
118
120
|
assessPatchRisk?: (request: PatchRiskRequest) => Promise<PatchRiskReport>;
|
|
119
121
|
bulkScan?: BulkScanDiscoveryDependencies;
|
|
@@ -126,6 +128,7 @@ interface CliDependencies {
|
|
|
126
128
|
matchFindings: typeof matchScanFindings;
|
|
127
129
|
checkForUpdate(signal: AbortSignal): Promise<UpdateNotice | undefined>;
|
|
128
130
|
}
|
|
131
|
+
export declare const runRepositoryCommand: CliDependencies["runRepositoryCommand"];
|
|
129
132
|
export declare function runCodexSkillCommand(args: readonly string[], output?: SkillCommandOutput, command?: CodexCommand, processEnvironment?: NodeJS.ProcessEnv, input?: string): Promise<number>;
|
|
130
133
|
export declare function main(argv?: readonly string[], output?: Writable, errorOutput?: Writable, dependencies?: CliDependencies): Promise<number>;
|
|
131
134
|
declare function readSavedFindings(scanId: string, workbench: CliDependencies["runWorkbench"]): Promise<readonly Finding[]>;
|
|
@@ -139,6 +142,7 @@ export declare function readSkillCommandOutput(stream: AsyncIterable<Buffer | st
|
|
|
139
142
|
readonly input: NodeJS.WritableStream;
|
|
140
143
|
readonly sandbox?: "read-only" | "workspace-write";
|
|
141
144
|
readonly externalSandbox?: boolean;
|
|
145
|
+
readonly cyberAccessProgram?: ScanOptions["cyberAccessProgram"];
|
|
142
146
|
readonly onEvent?: (event: Readonly<Record<string, unknown>>) => void;
|
|
143
147
|
}): Promise<{
|
|
144
148
|
message?: string;
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAgDA,OAAO,EAAE,QAAQ,EAA4B,MAAM,aAAa,CAAC;AAOjE,OAAO,EAAO,CAAC,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;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