@openai/codex-security 0.5.1 → 0.7.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/README.md +151 -36
- package/_bundled_plugin/.mcp.json +1 -0
- package/_bundled_plugin/mcp/helpers.mjs.br.part-000 +0 -0
- package/_bundled_plugin/mcp/helpers.mjs.br.part-001 +0 -0
- package/_bundled_plugin/mcp/native/THIRD_PARTY_NOTICES.txt +1 -1
- package/_bundled_plugin/mcp/native/darwin-arm64/unix.node +0 -0
- package/_bundled_plugin/mcp/native/darwin-x64/unix.node +0 -0
- package/_bundled_plugin/mcp/native/linux-arm64-gnu/unix.node +0 -0
- package/_bundled_plugin/mcp/native/linux-arm64-musl/unix.node +0 -0
- package/_bundled_plugin/mcp/native/linux-x64-gnu/unix.node +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/server.mjs.br.part-000 +0 -0
- package/_bundled_plugin/mcp/server.mjs.br.part-001 +0 -0
- package/_bundled_plugin/mcp/server.mjs.br.part-002 +0 -0
- package/_bundled_plugin/references/access-advisory.md +11 -0
- package/_bundled_plugin/references/core-scan.md +30 -77
- package/_bundled_plugin/references/final-report.md +45 -189
- package/_bundled_plugin/references/scan-contract.md +2 -0
- package/_bundled_plugin/references/scan-prologue.md +1 -1
- package/_bundled_plugin/references/scan-runtime.md +1 -5
- package/_bundled_plugin/references/threat-model.md +33 -41
- package/_bundled_plugin/schemas/coverage.schema.json +12 -1
- package/_bundled_plugin/schemas/scan-manifest.schema.json +1 -0
- package/_bundled_plugin/schemas/tools/deep-reducer.schema.json +38 -1
- package/_bundled_plugin/scripts/deep_scan_config.py +39 -39
- package/_bundled_plugin/scripts/deep_scan_workbench.py +145 -85
- package/_bundled_plugin/scripts/finalize_scan_contract.py +189 -57
- package/_bundled_plugin/scripts/report_projection.py +44 -15
- package/_bundled_plugin/scripts/threat_model_projection.py +4 -2
- package/_bundled_plugin/scripts/windows_scan_local_files.py +43 -14
- package/_bundled_plugin/scripts/workbench/retained_coverage.py +3218 -0
- package/_bundled_plugin/scripts/workbench/retained_records.py +627 -0
- package/_bundled_plugin/scripts/workbench/saved_coverage.py +644 -1
- package/_bundled_plugin/scripts/workbench/saved_outputs.py +72 -0
- package/_bundled_plugin/scripts/workbench/saved_sources.py +712 -0
- package/_bundled_plugin/scripts/workbench_cli.py +3 -0
- package/_bundled_plugin/scripts/workbench_coverage_receipts.py +479 -0
- package/_bundled_plugin/scripts/workbench_db.py +51 -22
- package/_bundled_plugin/scripts/workbench_feedback.py +0 -1
- package/_bundled_plugin/scripts/workbench_finding_workflows.py +53 -9
- package/_bundled_plugin/scripts/workbench_native_indexes.py +56 -44
- package/_bundled_plugin/scripts/workbench_saved_results.py +641 -2387
- package/_bundled_plugin/scripts/workbench_scan_history.py +72 -7
- package/_bundled_plugin/scripts/workbench_schema.py +1 -1
- package/_bundled_plugin/scripts/workbench_source_scopes.py +4 -1
- package/_bundled_plugin/scripts/workbench_target.py +142 -17
- package/_bundled_plugin/scripts/workbench_validation.py +9 -2
- package/_bundled_plugin/shared/workbench-history-repairs.json +21 -0
- package/_bundled_plugin/shared/workbench-migrations.json +44 -0
- package/_bundled_plugin/skills/assess-patch-risk/SKILL.md +3 -14
- package/_bundled_plugin/skills/assess-patch-risk/references/windows-validation.md +14 -0
- package/_bundled_plugin/skills/attack-path-analysis/SKILL.md +38 -103
- package/_bundled_plugin/skills/attack-path-analysis/references/attack-path-facts.md +11 -73
- package/_bundled_plugin/skills/attack-path-analysis/references/severity-policy.md +57 -116
- package/_bundled_plugin/skills/deep-security-scan/SKILL.md +28 -51
- package/_bundled_plugin/skills/define-security-policy/SKILL.md +9 -9
- package/_bundled_plugin/skills/finding-discovery/SKILL.md +26 -140
- package/_bundled_plugin/skills/fix-finding/SKILL.md +19 -30
- package/_bundled_plugin/skills/propose-security-hardening/SKILL.md +28 -218
- package/_bundled_plugin/skills/propose-security-hardening/references/proposal-format.md +29 -424
- package/_bundled_plugin/skills/publish-findings/SKILL.md +134 -0
- package/_bundled_plugin/skills/publish-findings/agents/openai.yaml +6 -0
- package/_bundled_plugin/skills/publish-findings/references/wiz-import.md +64 -0
- package/_bundled_plugin/skills/security-diff-scan/SKILL.md +12 -12
- package/_bundled_plugin/skills/security-scan/SKILL.md +28 -16
- package/_bundled_plugin/skills/security-scan/references/desktop-scan.md +11 -17
- package/_bundled_plugin/skills/security-scan/references/scan-artifacts-and-ledger.md +52 -69
- package/_bundled_plugin/skills/threat-model/SKILL.md +16 -9
- package/_bundled_plugin/skills/triage-finding/SKILL.md +5 -15
- package/_bundled_plugin/skills/triage-finding/references/ticket-intake.md +6 -6
- package/_bundled_plugin/skills/validation/SKILL.md +42 -104
- package/_bundled_plugin/skills/validation/references/validation-guidance.md +21 -106
- package/_bundled_plugin/skills/verify-fix/SKILL.md +8 -4
- package/_bundled_plugin/skills/vulnerability-writeup/SKILL.md +21 -159
- package/_bundled_plugin/skills/vulnerability-writeup/references/report-format.md +18 -60
- package/dist/api.d.ts +8 -3
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +414 -72
- package/dist/api.js.map +1 -1
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +4 -1
- package/dist/auth.js.map +1 -1
- package/dist/classify-severity-records.d.ts +5 -2
- package/dist/classify-severity-records.d.ts.map +1 -1
- package/dist/classify-severity-records.js +40 -34
- package/dist/classify-severity-records.js.map +1 -1
- package/dist/classify-severity.d.ts +5 -1
- package/dist/classify-severity.d.ts.map +1 -1
- package/dist/classify-severity.js +20 -30
- package/dist/classify-severity.js.map +1 -1
- package/dist/cli-help.d.ts.map +1 -1
- package/dist/cli-help.js +1 -0
- package/dist/cli-help.js.map +1 -1
- package/dist/cli.d.ts +9 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +802 -149
- package/dist/cli.js.map +1 -1
- package/dist/cloud-endpoint.d.ts +6 -0
- package/dist/cloud-endpoint.d.ts.map +1 -0
- package/dist/cloud-endpoint.js +51 -0
- package/dist/cloud-endpoint.js.map +1 -0
- package/dist/cloud-publish.d.ts.map +1 -1
- package/dist/cloud-publish.js +7 -5
- package/dist/cloud-publish.js.map +1 -1
- package/dist/component-scan.d.ts +8 -2
- package/dist/component-scan.d.ts.map +1 -1
- package/dist/component-scan.js +2 -0
- package/dist/component-scan.js.map +1 -1
- package/dist/contract.d.ts +2 -0
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +67 -33
- package/dist/contract.js.map +1 -1
- package/dist/cost.d.ts +18 -0
- package/dist/cost.d.ts.map +1 -1
- package/dist/cost.js +107 -12
- package/dist/cost.js.map +1 -1
- package/dist/coverage-presentation.d.ts +6 -0
- package/dist/coverage-presentation.d.ts.map +1 -0
- package/dist/coverage-presentation.js +34 -0
- package/dist/coverage-presentation.js.map +1 -0
- package/dist/custom-validation-prompt.js +3 -3
- package/dist/custom-validation-prompt.js.map +1 -1
- package/dist/custom-validation.d.ts.map +1 -1
- package/dist/custom-validation.js +30 -4
- package/dist/custom-validation.js.map +1 -1
- package/dist/deduplication/checkpointed-review.d.ts.map +1 -1
- package/dist/deduplication/checkpointed-review.js +3 -1
- package/dist/deduplication/checkpointed-review.js.map +1 -1
- package/dist/deduplication/scan.d.ts.map +1 -1
- package/dist/deduplication/scan.js +7 -5
- package/dist/deduplication/scan.js.map +1 -1
- package/dist/default-severity-rubric.d.ts +3 -0
- package/dist/default-severity-rubric.d.ts.map +1 -0
- package/dist/default-severity-rubric.js +67 -0
- package/dist/default-severity-rubric.js.map +1 -0
- package/dist/endor-findings.d.ts +8 -0
- package/dist/endor-findings.d.ts.map +1 -0
- package/dist/endor-findings.js +238 -0
- package/dist/endor-findings.js.map +1 -0
- package/dist/external-findings-import.d.ts +5 -0
- package/dist/external-findings-import.d.ts.map +1 -0
- package/dist/external-findings-import.js +46 -0
- package/dist/external-findings-import.js.map +1 -0
- package/dist/external-findings-local.d.ts +63 -0
- package/dist/external-findings-local.d.ts.map +1 -0
- package/dist/external-findings-local.js +344 -0
- package/dist/external-findings-local.js.map +1 -0
- package/dist/external-findings-publish.d.ts +73 -0
- package/dist/external-findings-publish.d.ts.map +1 -0
- package/dist/external-findings-publish.js +721 -0
- package/dist/external-findings-publish.js.map +1 -0
- package/dist/external-findings-read.d.ts +16 -0
- package/dist/external-findings-read.d.ts.map +1 -0
- package/dist/external-findings-read.js +97 -0
- package/dist/external-findings-read.js.map +1 -0
- package/dist/external-findings.d.ts +21 -0
- package/dist/external-findings.d.ts.map +1 -0
- package/dist/external-findings.js +2 -0
- package/dist/external-findings.js.map +1 -0
- package/dist/external-import-contract.d.ts +15 -0
- package/dist/external-import-contract.d.ts.map +1 -0
- package/dist/external-import-contract.js +262 -0
- package/dist/external-import-contract.js.map +1 -0
- package/dist/external-import-models.d.ts +362 -0
- package/dist/external-import-models.d.ts.map +1 -0
- package/dist/external-import-models.js +3 -0
- package/dist/external-import-models.js.map +1 -0
- package/dist/external-imports-feature.d.ts +6 -0
- package/dist/external-imports-feature.d.ts.map +1 -0
- package/dist/external-imports-feature.js +51 -0
- package/dist/external-imports-feature.js.map +1 -0
- package/dist/finding-workflow.d.ts +23 -6
- package/dist/finding-workflow.d.ts.map +1 -1
- package/dist/finding-workflow.js +23 -10
- package/dist/finding-workflow.js.map +1 -1
- package/dist/github-advisories.d.ts +386 -0
- package/dist/github-advisories.d.ts.map +1 -0
- package/dist/github-advisories.js +133 -0
- package/dist/github-advisories.js.map +1 -0
- package/dist/github-findings.d.ts +11 -0
- package/dist/github-findings.d.ts.map +1 -0
- package/dist/github-findings.js +258 -0
- package/dist/github-findings.js.map +1 -0
- package/dist/hosted-remediation-protocol.d.ts +2 -1
- package/dist/hosted-remediation-protocol.d.ts.map +1 -1
- package/dist/hosted-remediation-protocol.js +17 -11
- package/dist/hosted-remediation-protocol.js.map +1 -1
- package/dist/hosted-remediation.d.ts +4 -0
- package/dist/hosted-remediation.d.ts.map +1 -1
- package/dist/hosted-remediation.js +22 -3
- package/dist/hosted-remediation.js.map +1 -1
- package/dist/hosted-scan.d.ts +16 -0
- package/dist/hosted-scan.d.ts.map +1 -1
- package/dist/hosted-scan.js +9 -2
- package/dist/hosted-scan.js.map +1 -1
- package/dist/import-scan.js +1 -1
- package/dist/import-scan.js.map +1 -1
- package/dist/index.d.ts +16 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/knowledge-base.d.ts +1 -0
- package/dist/knowledge-base.d.ts.map +1 -1
- package/dist/knowledge-base.js +17 -8
- package/dist/knowledge-base.js.map +1 -1
- package/dist/models.d.ts +1 -0
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js.map +1 -1
- package/dist/owner-evidence.d.ts +2 -0
- package/dist/owner-evidence.d.ts.map +1 -1
- package/dist/owner-evidence.js +2 -1
- package/dist/owner-evidence.js.map +1 -1
- package/dist/project-config-schema.d.ts +2 -0
- package/dist/project-config-schema.d.ts.map +1 -1
- package/dist/project-config-schema.js +1 -0
- package/dist/project-config-schema.js.map +1 -1
- package/dist/project-config.d.ts +1 -0
- package/dist/project-config.d.ts.map +1 -1
- package/dist/project-config.js +2 -0
- 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 +1 -1
- package/dist/publish.js.map +1 -1
- package/dist/remediation.d.ts +7 -25
- package/dist/remediation.d.ts.map +1 -1
- package/dist/remediation.js +18 -28
- package/dist/remediation.js.map +1 -1
- package/dist/result.d.ts +4 -0
- package/dist/result.d.ts.map +1 -1
- package/dist/result.js +10 -0
- package/dist/result.js.map +1 -1
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +10 -8
- package/dist/runtime.js.map +1 -1
- package/dist/scan-dashboard.d.ts +5 -3
- package/dist/scan-dashboard.d.ts.map +1 -1
- package/dist/scan-dashboard.js +79 -26
- package/dist/scan-dashboard.js.map +1 -1
- package/dist/scan-history-renderer.d.ts.map +1 -1
- package/dist/scan-history-renderer.js +8 -2
- package/dist/scan-history-renderer.js.map +1 -1
- package/dist/scan-owner-suggestions.d.ts +8 -0
- package/dist/scan-owner-suggestions.d.ts.map +1 -0
- package/dist/scan-owner-suggestions.js +33 -0
- package/dist/scan-owner-suggestions.js.map +1 -0
- package/dist/scan-settings.d.ts +1 -0
- package/dist/scan-settings.d.ts.map +1 -1
- package/dist/scan-settings.js +4 -0
- package/dist/scan-settings.js.map +1 -1
- package/dist/scan-usage-display.d.ts +8 -0
- package/dist/scan-usage-display.d.ts.map +1 -0
- package/dist/scan-usage-display.js +46 -0
- package/dist/scan-usage-display.js.map +1 -0
- package/dist/scanner-import.d.ts +20 -0
- package/dist/scanner-import.d.ts.map +1 -0
- package/dist/scanner-import.js +208 -0
- package/dist/scanner-import.js.map +1 -0
- package/dist/security-policy-diff.d.ts +2 -0
- package/dist/security-policy-diff.d.ts.map +1 -0
- package/dist/security-policy-diff.js +197 -0
- package/dist/security-policy-diff.js.map +1 -0
- package/dist/security-policy.d.ts +7 -3
- package/dist/security-policy.d.ts.map +1 -1
- package/dist/security-policy.js +11 -76
- package/dist/security-policy.js.map +1 -1
- package/dist/semgrep-findings.d.ts +10 -0
- package/dist/semgrep-findings.d.ts.map +1 -0
- package/dist/semgrep-findings.js +293 -0
- package/dist/semgrep-findings.js.map +1 -0
- package/dist/severity-review.d.ts +3 -0
- package/dist/severity-review.d.ts.map +1 -1
- package/dist/severity-review.js +19 -0
- package/dist/severity-review.js.map +1 -1
- package/dist/severity-store.js +7 -2
- package/dist/severity-store.js.map +1 -1
- package/dist/skill-authentication.d.ts +18 -0
- package/dist/skill-authentication.d.ts.map +1 -0
- package/dist/skill-authentication.js +82 -0
- package/dist/skill-authentication.js.map +1 -0
- package/dist/snyk-findings.d.ts +10 -0
- package/dist/snyk-findings.d.ts.map +1 -0
- package/dist/snyk-findings.js +350 -0
- package/dist/snyk-findings.js.map +1 -0
- package/dist/suggest-owners.d.ts +4 -1
- package/dist/suggest-owners.d.ts.map +1 -1
- package/dist/suggest-owners.js +53 -21
- package/dist/suggest-owners.js.map +1 -1
- package/dist/targets.d.ts +2 -2
- package/dist/targets.d.ts.map +1 -1
- package/dist/targets.js +16 -3
- package/dist/targets.js.map +1 -1
- package/dist/wiz-csv.d.ts +9 -0
- package/dist/wiz-csv.d.ts.map +1 -0
- package/dist/wiz-csv.js +116 -0
- package/dist/wiz-csv.js.map +1 -0
- package/dist/wiz-findings.d.ts +5 -0
- package/dist/wiz-findings.d.ts.map +1 -0
- package/dist/wiz-findings.js +464 -0
- package/dist/wiz-findings.js.map +1 -0
- package/docs/classify-severity-records.md +30 -13
- package/docs/cli.md +835 -47
- package/docs/findings-service.md +119 -118
- package/docs/hosted-remediation.md +43 -24
- package/docs/hosted-scans.md +38 -0
- package/package.json +11 -9
- package/schemas/external-findings.schema.json +1421 -0
- package/schemas/project-config.schema.json +4 -0
- package/_bundled_plugin/scripts/generate_in_scope_files.py +0 -277
- package/_bundled_plugin/scripts/generate_rank_input.py +0 -350
- package/_bundled_plugin/scripts/rank_preview.py +0 -129
package/dist/scan-dashboard.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ScanBudget } from "./api.js";
|
|
1
|
+
import type { ScanAuthMode, ScanBudget } from "./api.js";
|
|
2
2
|
import type { ScanModelConfiguration } from "./config.js";
|
|
3
3
|
import type { ComponentReceipt, ComponentScanEvent, ComponentScanResult } from "./component-scan.js";
|
|
4
|
-
import { type ScanCost, type ScanSessionEvent } from "./cost.js";
|
|
4
|
+
import { type ScanCost, type ScanSessionEvent, type ScanUsageObservation } from "./cost.js";
|
|
5
5
|
import { type ScanTokenUsage } from "./cost-model.js";
|
|
6
6
|
import type { ScanActivity } from "./scan-activity.js";
|
|
7
7
|
import type { ScanMode } from "./targets.js";
|
|
@@ -49,13 +49,15 @@ export declare class ScanDashboard {
|
|
|
49
49
|
setStage(stage: string): void;
|
|
50
50
|
setComponents(receipts: readonly ComponentReceipt[]): void;
|
|
51
51
|
updateComponent(receipt: ComponentReceipt): void;
|
|
52
|
-
recordComponentEvent(event: ComponentScanEvent): void;
|
|
52
|
+
recordComponentEvent(event: ComponentScanEvent, requestedAuth?: ScanAuthMode): void;
|
|
53
53
|
showComponents(stage: string): void;
|
|
54
54
|
finishComponents(result: ComponentScanResult): void;
|
|
55
55
|
setFiles(files: ScanProgress): void;
|
|
56
56
|
setPublicationProgress(completed: number, total: number): void;
|
|
57
57
|
setCost(cost: Readonly<ScanCost>, maxCostUsd?: number | undefined): void;
|
|
58
58
|
setUsage(usage: Readonly<ScanTokenUsage>): void;
|
|
59
|
+
setUsageObservation(observation: Readonly<ScanUsageObservation>): void;
|
|
60
|
+
setChatGptAuth(enabled: boolean): void;
|
|
59
61
|
requestBudgetIncrease(request: ScanBudget): Promise<number | undefined>;
|
|
60
62
|
note(description: string): void;
|
|
61
63
|
record(activity: ScanActivity): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan-dashboard.d.ts","sourceRoot":"","sources":["../src/scan-dashboard.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"scan-dashboard.d.ts","sourceRoot":"","sources":["../src/scan-dashboard.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EAC1B,MAAM,WAAW,CAAC;AACnB,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AAC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AAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAGzC;IAEM,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAGpE;IAEM,OAAO,CACZ,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,EACxB,UAAU,qBAA2B,GACpC,IAAI,CAKN;IAEM,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,IAAI,CAGrD;IAEM,mBAAmB,CACxB,WAAW,EAAE,QAAQ,CAAC,oBAAoB,CAAC,GAC1C,IAAI,CAIN;IAEM,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAG5C;IAEM,qBAAqB,CAC1B,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAwB7B;IAEM,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAQrC;IAEM,MAAM,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CA8B1C;IAEM,aAAa,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CA8BpD;IAEM,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAajC;CA0kBF"}
|
package/dist/scan-dashboard.js
CHANGED
|
@@ -5,8 +5,9 @@ import { pathToFileURL } from "node:url";
|
|
|
5
5
|
import stripAnsi from "strip-ansi";
|
|
6
6
|
import stringWidth from "string-width";
|
|
7
7
|
import { isRecord } from "./record.js";
|
|
8
|
-
import { formatUsd } from "./cost.js";
|
|
8
|
+
import { formatUsd, } from "./cost.js";
|
|
9
9
|
import { estimateScanCost, formatScanCost, formatScanCosts, formatScanCostTokens, formatTokenUsage, } from "./cost-model.js";
|
|
10
|
+
import { ACCOUNT_LIMITS_UNAVAILABLE, USAGE_TIME_UNAVAILABLE, formatAccountLimits, formatUsageFreshness, isChatGptAuthentication, } from "./scan-usage-display.js";
|
|
10
11
|
import { scanPhaseLabel, scanProgressCount, } from "./worker-progress.js";
|
|
11
12
|
const HIDE_CURSOR = "\u001B[?25l";
|
|
12
13
|
const SHOW_CURSOR = "\u001B[?25h";
|
|
@@ -17,7 +18,7 @@ const DISABLE_ALTERNATE_SCROLL = "\u001B[?1007l";
|
|
|
17
18
|
const CURSOR_HOME = "\u001B[H";
|
|
18
19
|
const ERASE_LINE = "\u001B[2K";
|
|
19
20
|
const MAX_HISTORY_ENTRIES = 2_000;
|
|
20
|
-
const FIXED_SCREEN_ROWS =
|
|
21
|
+
const FIXED_SCREEN_ROWS = 4; // Title, two dividers and elapsed time.
|
|
21
22
|
const ACTIVITY_MARKERS = {
|
|
22
23
|
command: "✓",
|
|
23
24
|
tool: "✓",
|
|
@@ -55,6 +56,9 @@ export class ScanDashboard {
|
|
|
55
56
|
#publicationProgress = null;
|
|
56
57
|
#cost = null;
|
|
57
58
|
#tokens = null;
|
|
59
|
+
#usageFreshness = null;
|
|
60
|
+
#accountLimits = null;
|
|
61
|
+
#chatGptAuth = false;
|
|
58
62
|
#budget = null;
|
|
59
63
|
#timer = null;
|
|
60
64
|
#refreshPending = false;
|
|
@@ -391,7 +395,7 @@ export class ScanDashboard {
|
|
|
391
395
|
component.receipt = { ...receipt };
|
|
392
396
|
this.#refresh();
|
|
393
397
|
}
|
|
394
|
-
recordComponentEvent(event) {
|
|
398
|
+
recordComponentEvent(event, requestedAuth) {
|
|
395
399
|
const dashboard = this.#components.find(({ receipt }) => receipt.id === event.componentId)?.dashboard;
|
|
396
400
|
if (dashboard === undefined)
|
|
397
401
|
return;
|
|
@@ -403,6 +407,9 @@ export class ScanDashboard {
|
|
|
403
407
|
case "activity":
|
|
404
408
|
dashboard.record(event.value);
|
|
405
409
|
break;
|
|
410
|
+
case "authentication":
|
|
411
|
+
dashboard.setChatGptAuth(isChatGptAuthentication(event.value, requestedAuth));
|
|
412
|
+
break;
|
|
406
413
|
case "session":
|
|
407
414
|
dashboard.recordDetails(event.value);
|
|
408
415
|
break;
|
|
@@ -412,6 +419,9 @@ export class ScanDashboard {
|
|
|
412
419
|
case "usage":
|
|
413
420
|
dashboard.setUsage(event.value);
|
|
414
421
|
break;
|
|
422
|
+
case "usage-observation":
|
|
423
|
+
dashboard.setUsageObservation(event.value);
|
|
424
|
+
break;
|
|
415
425
|
case "workers":
|
|
416
426
|
if (event.value.kind === "dispatch")
|
|
417
427
|
dashboard.setStage(scanPhaseLabel(event.value.phase));
|
|
@@ -450,6 +460,15 @@ export class ScanDashboard {
|
|
|
450
460
|
this.#tokens = formatTokenUsage(usage);
|
|
451
461
|
this.#refresh();
|
|
452
462
|
}
|
|
463
|
+
setUsageObservation(observation) {
|
|
464
|
+
this.#usageFreshness = formatUsageFreshness(observation);
|
|
465
|
+
this.#accountLimits = formatAccountLimits(observation);
|
|
466
|
+
this.#refresh();
|
|
467
|
+
}
|
|
468
|
+
setChatGptAuth(enabled) {
|
|
469
|
+
this.#chatGptAuth = enabled;
|
|
470
|
+
this.#refresh();
|
|
471
|
+
}
|
|
453
472
|
requestBudgetIncrease(request) {
|
|
454
473
|
if (request.signal.aborted ||
|
|
455
474
|
this.#timer === null ||
|
|
@@ -531,7 +550,10 @@ export class ScanDashboard {
|
|
|
531
550
|
}
|
|
532
551
|
}
|
|
533
552
|
scroll(lines) {
|
|
534
|
-
const
|
|
553
|
+
const { footer, details } = this.#usageLayout();
|
|
554
|
+
const maximum = Math.max(0, this.#activityLines(this.#width()).length +
|
|
555
|
+
details.length -
|
|
556
|
+
this.#activityRows(footer.length));
|
|
535
557
|
this.#scrollOffset = Math.max(0, Math.min(maximum, this.#scrollOffset + lines));
|
|
536
558
|
this.#refresh();
|
|
537
559
|
}
|
|
@@ -562,7 +584,9 @@ export class ScanDashboard {
|
|
|
562
584
|
const verification = this.#options.presentation === "verification";
|
|
563
585
|
const findingProgress = publication || verification;
|
|
564
586
|
const width = this.#width();
|
|
565
|
-
const
|
|
587
|
+
const { footer, details } = this.#usageLayout();
|
|
588
|
+
const availableRows = this.#availableActivityRows(footer.length);
|
|
589
|
+
const activityRows = Math.max(1, availableRows);
|
|
566
590
|
const divider = ` ${"─".repeat(Math.max(0, width - 4))}`;
|
|
567
591
|
const elapsed = Math.max(0, Math.floor(((this.#finishedAt ?? this.#options.clock.now()) - this.#startedAt) /
|
|
568
592
|
1_000));
|
|
@@ -575,7 +599,9 @@ export class ScanDashboard {
|
|
|
575
599
|
: count.completed > 0
|
|
576
600
|
? `${formatCount(count.completed)} / ${formatCount(count.total)} reviewed`
|
|
577
601
|
: `${formatCount(count.total)} in scope`;
|
|
578
|
-
|
|
602
|
+
let history = this.#activityLines(width);
|
|
603
|
+
if (details.length > 0)
|
|
604
|
+
history = history.concat(details);
|
|
579
605
|
const maximumOffset = Math.max(0, history.length - activityRows);
|
|
580
606
|
this.#scrollOffset = Math.min(this.#scrollOffset, maximumOffset);
|
|
581
607
|
const first = Math.max(0, history.length - activityRows - this.#scrollOffset);
|
|
@@ -603,9 +629,9 @@ export class ScanDashboard {
|
|
|
603
629
|
const model = this.#options.model;
|
|
604
630
|
return this.#formatFrame([
|
|
605
631
|
` CODEX SECURITY · ${publication ? "PUBLISH · " : verification ? "VERIFY-FIX · " : ""}${basename(this.#options.repository)}${this.#options.componentName === undefined ? "" : ` · ${this.#options.componentName}`}${model === undefined ? "" : ` · ${model.model} (${model.reasoningEffort})`}${this.#view === "details" ? ` · DETAILS${this.#source === "all" ? "" : ` · ${typeof this.#source === "number" ? `worker ${this.#source}` : this.#source}`}` : ""}`,
|
|
606
|
-
divider,
|
|
632
|
+
...(availableRows > 0 ? [divider] : []),
|
|
607
633
|
...activity,
|
|
608
|
-
divider,
|
|
634
|
+
...(availableRows >= 0 ? [divider] : []),
|
|
609
635
|
...(findingProgress
|
|
610
636
|
? [
|
|
611
637
|
` STAGE ${this.#stage}`,
|
|
@@ -618,8 +644,7 @@ export class ScanDashboard {
|
|
|
618
644
|
` STAGE ${this.#stage}`,
|
|
619
645
|
` ${count?.label === "reviews" ? "REVIEWS" : "FILES "} ${files}`,
|
|
620
646
|
]),
|
|
621
|
-
...
|
|
622
|
-
...this.#costLines(),
|
|
647
|
+
...footer,
|
|
623
648
|
...(this.#budget === null
|
|
624
649
|
? []
|
|
625
650
|
: [
|
|
@@ -754,24 +779,52 @@ export class ScanDashboard {
|
|
|
754
779
|
#width() {
|
|
755
780
|
return Math.max(1, Math.min(this.#stream.columns ?? 88, 160));
|
|
756
781
|
}
|
|
757
|
-
#activityRows() {
|
|
758
|
-
return Math.max(1,
|
|
782
|
+
#activityRows(usageRows = this.#usageLayout().footer.length) {
|
|
783
|
+
return Math.max(1, this.#availableActivityRows(usageRows));
|
|
784
|
+
}
|
|
785
|
+
#availableActivityRows(usageRows) {
|
|
786
|
+
const findingProgress = this.#options.presentation === "publication" ||
|
|
787
|
+
this.#options.presentation === "verification";
|
|
788
|
+
const stageRows = this.#options.mode === "deep" && !findingProgress ? 0 : 2;
|
|
789
|
+
return ((this.#stream.rows ?? 24) -
|
|
759
790
|
FIXED_SCREEN_ROWS -
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
? 0
|
|
764
|
-
: this.#tokenLines().length - 1 + this.#costLines().length - 1) +
|
|
765
|
-
(this.#options.presentation === "publication" ||
|
|
766
|
-
this.#options.presentation === "verification"
|
|
767
|
-
? 2
|
|
768
|
-
: this.#options.mode === "deep"
|
|
769
|
-
? 2
|
|
770
|
-
: 0));
|
|
791
|
+
stageRows -
|
|
792
|
+
usageRows -
|
|
793
|
+
(this.#budget === null ? 0 : 2));
|
|
771
794
|
}
|
|
772
|
-
#
|
|
773
|
-
|
|
774
|
-
|
|
795
|
+
#usageLayout() {
|
|
796
|
+
if (this.#options.presentation === "publication" ||
|
|
797
|
+
this.#options.presentation === "verification") {
|
|
798
|
+
return { footer: [], details: [] };
|
|
799
|
+
}
|
|
800
|
+
const width = this.#width();
|
|
801
|
+
const limits = this.#accountLimits ??
|
|
802
|
+
(this.#chatGptAuth ? ACCOUNT_LIMITS_UNAVAILABLE : null);
|
|
803
|
+
const lines = [
|
|
804
|
+
...wrapActivity(" TOKENS ", this.#tokens ?? "waiting for usage", width),
|
|
805
|
+
...this.#costLines(),
|
|
806
|
+
...(this.#tokens === null
|
|
807
|
+
? []
|
|
808
|
+
: wrapActivity(" USAGE ", this.#usageFreshness ?? USAGE_TIME_UNAVAILABLE, width)),
|
|
809
|
+
...(limits === null ? [] : wrapActivity(" LIMITS ", limits, width)),
|
|
810
|
+
];
|
|
811
|
+
// Both dividers can give way, but one activity row must remain.
|
|
812
|
+
const capacity = Math.max(0, this.#availableActivityRows(0) + 1);
|
|
813
|
+
if (lines.length <= capacity)
|
|
814
|
+
return { footer: lines, details: [] };
|
|
815
|
+
if (this.#view === "details") {
|
|
816
|
+
return {
|
|
817
|
+
footer: [],
|
|
818
|
+
details: lines.map((text) => ({ text, kind: "path" })),
|
|
819
|
+
};
|
|
820
|
+
}
|
|
821
|
+
const footer = lines.slice(0, capacity);
|
|
822
|
+
if (footer.length > 0)
|
|
823
|
+
footer[footer.length - 1] =
|
|
824
|
+
this.#options.input?.isTTY === true
|
|
825
|
+
? " … Full readings in details"
|
|
826
|
+
: " … Resize for full readings";
|
|
827
|
+
return { footer, details: [] };
|
|
775
828
|
}
|
|
776
829
|
#costLines() {
|
|
777
830
|
if (!this.#showCost)
|