@dailephd/my-dev-kit-lab 0.4.5 → 0.4.7
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/CHANGELOG.md +26 -1
- package/README.md +43 -3
- package/dist/scripts/cli.js +9 -0
- package/dist/src/audits/core/typescriptJavaScriptAnalyzer.js +30 -12
- package/dist/src/browser/index.js +2 -0
- package/dist/src/browser/playwrightRuntime.js +74 -0
- package/dist/src/browser/types.js +10 -0
- package/dist/src/cli/help.js +376 -0
- package/dist/src/cli/index.js +2 -0
- package/dist/src/cli/runLabCli.js +257 -0
- package/dist/src/commands/runAuditCommand.js +132 -0
- package/dist/src/commands/runControlledExperimentCommand.js +7 -3
- package/dist/{scripts/experiments/describeExperiment.js → src/commands/runExperimentDescribeCommand.js} +14 -10
- package/dist/{scripts/experiments/listExperiments.js → src/commands/runExperimentListCommand.js} +3 -6
- package/dist/{scripts/experiments/runExperiment.js → src/commands/runExperimentRunCommand.js} +80 -22
- package/dist/src/commands/runFinalDemoCommand.js +2 -3
- package/dist/src/commands/runSecurityValidationCommand.js +271 -0
- package/dist/src/commands/runTutorialRunCommand.js +170 -0
- package/dist/src/commands/runTutorialValidateCommand.js +138 -0
- package/dist/src/core/processTree.js +52 -0
- package/dist/src/core/resolveCommand.js +34 -0
- package/dist/src/core/runMeasuredCommand.js +39 -31
- package/dist/src/runtime/index.js +4 -0
- package/dist/src/runtime/labExecutionContext.js +22 -0
- package/dist/src/runtime/managedProcess.js +380 -0
- package/dist/src/runtime/packageResource.js +22 -0
- package/dist/src/runtime/packageRoot.js +37 -0
- package/dist/src/screenshot/captureReportScreenshot.js +30 -27
- package/dist/src/securityValidation/packageChecks/requiredPackageContents.js +14 -1
- package/dist/src/tutorial/index.js +16 -0
- package/dist/src/tutorial/loadTutorialContracts.js +60 -0
- package/dist/src/tutorial/markdownTutorialWriter.js +53 -0
- package/dist/src/tutorial/runTutorial.js +465 -0
- package/dist/src/tutorial/scenarioValidation.js +383 -0
- package/dist/src/tutorial/subtitleWriter.js +88 -0
- package/dist/src/tutorial/targetContractValidation.js +212 -0
- package/dist/src/tutorial/tutorialActions.js +110 -0
- package/dist/src/tutorial/tutorialArtifacts.js +176 -0
- package/dist/src/tutorial/tutorialAssertions.js +249 -0
- package/dist/src/tutorial/tutorialCursor.js +149 -0
- package/dist/src/tutorial/tutorialLocators.js +37 -0
- package/dist/src/tutorial/tutorialManifest.js +74 -0
- package/dist/src/tutorial/tutorialOverlay.js +180 -0
- package/dist/src/tutorial/tutorialPaths.js +86 -0
- package/dist/src/tutorial/tutorialSession.js +398 -0
- package/dist/src/tutorial/types.js +48 -0
- package/dist/src/tutorial/validationPrimitives.js +141 -0
- package/examples/tutorial-browser/index.html +47 -0
- package/examples/tutorial-browser/prepare.mjs +14 -0
- package/examples/tutorial-browser/scenario.json +17 -0
- package/examples/tutorial-browser/server.mjs +14 -0
- package/package.json +13 -9
- package/dist/scripts/audits/runAudit.js +0 -135
- package/dist/scripts/build-gallery.js +0 -3
- package/dist/scripts/capture-demo-report.js +0 -3
- package/dist/scripts/evaluate-token-savings.js +0 -2
- package/dist/scripts/generate-experiment-plots.js +0 -3
- package/dist/scripts/generate-prompt-variants.js +0 -2
- package/dist/scripts/render-experiment-report.js +0 -2
- package/dist/scripts/report-context-integrity-smoke.js +0 -70
- package/dist/scripts/run-agent-prompt.js +0 -2
- package/dist/scripts/run-controlled-experiment.js +0 -2
- package/dist/scripts/run-lab-demo.js +0 -5
- package/dist/scripts/run-visualization-demos.js +0 -3
- package/dist/scripts/security/resolveToolRoot.js +0 -16
- package/dist/scripts/security/runCodeql.js +0 -58
- package/dist/scripts/security/runDependencyChecks.js +0 -58
- package/dist/scripts/security/runFuzzSmoke.js +0 -29
- package/dist/scripts/security/runPackageChecks.js +0 -57
- package/dist/scripts/security/runSemgrep.js +0 -64
- package/dist/scripts/security/validate.js +0 -266
- package/dist/scripts/verify-benchmarks.js +0 -202
- package/examples/demo-report-input.json +0 -78
- package/examples/lab-demo-cases.json +0 -35
- package/examples/real-agent-campaign-cases.json +0 -118
- package/tests/fixtures/android/advanced-security-fixtures/backup-configuration/module-a/src/debug/res/xml/ambiguous_backup_rules.xml +0 -4
- package/tests/fixtures/android/advanced-security-fixtures/backup-configuration/module-a/src/main/res/xml/ambiguous_backup_rules.xml +0 -4
- package/tests/fixtures/android/advanced-security-fixtures/backup-configuration/module-a/src/main/res/xml/backup_rules.xml +0 -5
- package/tests/fixtures/android/advanced-security-fixtures/backup-configuration/module-a/src/main/res/xml/broad_backup_rules.xml +0 -4
- package/tests/fixtures/android/advanced-security-fixtures/backup-configuration/module-a/src/main/res/xml/data_extraction_rules.xml +0 -10
- package/tests/fixtures/android/advanced-security-fixtures/backup-configuration/module-a/src/main/res/xml/unsupported_domain_rules.xml +0 -4
- package/tests/fixtures/android/advanced-security-fixtures/backup-configuration/module-b/src/main/res/xml/malformed_backup_rules.xml +0 -4
- package/tests/fixtures/android/advanced-security-fixtures/backup-configuration/module-b/src/main/res/xml/unsupported_root.xml +0 -4
- package/tests/fixtures/android/advanced-security-fixtures/network-security/module-a/src/debug/res/xml/ambiguous_config.xml +0 -4
- package/tests/fixtures/android/advanced-security-fixtures/network-security/module-a/src/main/res/xml/ambiguous_config.xml +0 -4
- package/tests/fixtures/android/advanced-security-fixtures/network-security/module-a/src/main/res/xml/base_cleartext_false.xml +0 -8
- package/tests/fixtures/android/advanced-security-fixtures/network-security/module-a/src/main/res/xml/broad_and_duplicate_domains.xml +0 -8
- package/tests/fixtures/android/advanced-security-fixtures/network-security/module-a/src/main/res/xml/empty_domain.xml +0 -6
- package/tests/fixtures/android/advanced-security-fixtures/network-security/module-a/src/main/res/xml/malformed_pin.xml +0 -11
- package/tests/fixtures/android/advanced-security-fixtures/network-security/module-a/src/main/res/xml/network_security_config.xml +0 -26
- package/tests/fixtures/android/advanced-security-fixtures/network-security/module-b/src/main/res/xml/malformed_network_security_config.xml +0 -6
- package/tests/fixtures/android/advanced-security-fixtures/network-security/module-b/src/main/res/xml/unsupported_root.xml +0 -4
- package/tests/fixtures/android/advanced-security-fixtures/release-configuration/groovy-release-debuggable-dynamic.gradle +0 -7
- package/tests/fixtures/android/advanced-security-fixtures/release-configuration/groovy-release-debuggable-false.gradle +0 -9
- package/tests/fixtures/android/advanced-security-fixtures/release-configuration/groovy-release-debuggable-true.gradle +0 -13
- package/tests/fixtures/android/advanced-security-fixtures/release-configuration/kotlin-release-debuggable-false.gradle.kts +0 -7
- package/tests/fixtures/android/advanced-security-fixtures/release-configuration/kotlin-release-debuggable-true.gradle.kts +0 -10
- package/tests/fixtures/android/advanced-security-fixtures/release-configuration/missing-release-build-type.gradle.kts +0 -7
- package/tests/fixtures/android/advanced-security-fixtures/resource-resolution/module-a/src/debug/res/xml/network_security_config.xml +0 -8
- package/tests/fixtures/android/advanced-security-fixtures/resource-resolution/module-a/src/main/res/xml/backup_rules.xml +0 -4
- package/tests/fixtures/android/advanced-security-fixtures/resource-resolution/module-a/src/main/res/xml/network_security_config.xml +0 -8
- package/tests/fixtures/android/advanced-security-fixtures/resource-resolution/module-b/src/main/res/xml/malformed_network_security_config.xml +0 -7
- package/tests/fixtures/android/advanced-security-fixtures/secret-candidates/SampleActivity.java +0 -8
- package/tests/fixtures/android/advanced-security-fixtures/secret-candidates/SampleActivity.kt +0 -9
- package/tests/fixtures/android/advanced-security-fixtures/secret-candidates/build.gradle +0 -11
- package/tests/fixtures/android/advanced-security-fixtures/secret-candidates/build.gradle.kts +0 -11
- package/tests/fixtures/android/advanced-security-fixtures/secret-candidates/google-services.json +0 -16
- package/tests/fixtures/android/advanced-security-fixtures/secret-candidates/local.properties +0 -3
- package/tests/fixtures/android/advanced-security-fixtures/secret-candidates-bounds/module/binary.properties +0 -0
- package/tests/fixtures/android/advanced-security-fixtures/secret-candidates-bounds/module/oversized.json +0 -1
- package/tests/fixtures/android/advanced-security-fixtures/signing-configuration/app/fake-release-keystore.jks +0 -1
- package/tests/fixtures/android/advanced-security-fixtures/signing-configuration/build/generated-fake.keystore +0 -1
- package/tests/fixtures/android/compose-app/app/build.gradle.kts +0 -21
- package/tests/fixtures/android/compose-app/app/src/main/AndroidManifest.xml +0 -22
- package/tests/fixtures/android/compose-app/app/src/main/java/com/example/composeapp/MainActivity.kt +0 -11
- package/tests/fixtures/android/compose-app/build.gradle.kts +0 -4
- package/tests/fixtures/android/compose-app/gradle/wrapper/gradle-wrapper.properties +0 -4
- package/tests/fixtures/android/compose-app/settings.gradle.kts +0 -2
- package/tests/fixtures/android/gradle-metadata-fixtures/catalog-only-plugin/build.gradle.kts +0 -3
- package/tests/fixtures/android/gradle-metadata-fixtures/catalog-only-plugin/gradle/libs.versions.toml +0 -5
- package/tests/fixtures/android/gradle-metadata-fixtures/comment-safety.gradle.kts +0 -21
- package/tests/fixtures/android/gradle-metadata-fixtures/dynamic-values.gradle.kts +0 -17
- package/tests/fixtures/android/gradle-metadata-fixtures/groovy-literal.gradle +0 -23
- package/tests/fixtures/android/gradle-metadata-fixtures/wrapper-malformed.properties +0 -4
- package/tests/fixtures/android/gradle-metadata-fixtures/wrapper-missing-url.properties +0 -3
- package/tests/fixtures/android/gradle-metadata-fixtures/wrapper-with-checksum.properties +0 -5
- package/tests/fixtures/android/java-app/app/build.gradle +0 -16
- package/tests/fixtures/android/java-app/app/src/main/AndroidManifest.xml +0 -19
- package/tests/fixtures/android/java-app/app/src/main/java/com/example/javaapp/MainActivity.java +0 -4
- package/tests/fixtures/android/java-app/build.gradle +0 -3
- package/tests/fixtures/android/java-app/gradle/wrapper/gradle-wrapper.properties +0 -4
- package/tests/fixtures/android/java-app/settings.gradle +0 -2
- package/tests/fixtures/android/library/build.gradle.kts +0 -3
- package/tests/fixtures/android/library/gradle/wrapper/gradle-wrapper.properties +0 -4
- package/tests/fixtures/android/library/mylibrary/build.gradle.kts +0 -13
- package/tests/fixtures/android/library/mylibrary/src/main/AndroidManifest.xml +0 -2
- package/tests/fixtures/android/library/settings.gradle.kts +0 -2
- package/tests/fixtures/android/manifest-audit-fixtures/incomplete-intent-filter.xml +0 -14
- package/tests/fixtures/android/manifest-audit-fixtures/malformed-exported.xml +0 -10
- package/tests/fixtures/android/manifest-audit-fixtures/malformed.xml +0 -5
- package/tests/fixtures/android/manifest-audit-fixtures/missing-application.xml +0 -7
- package/tests/fixtures/android/manifest-audit-fixtures/missing-component-name.xml +0 -11
- package/tests/fixtures/android/manifest-audit-fixtures/permission-coverage.xml +0 -29
- package/tests/fixtures/android/manifest-audit-fixtures/risky-components.xml +0 -62
- package/tests/fixtures/android/manifest-audit-fixtures/risky-deep-links.xml +0 -45
- package/tests/fixtures/android/manifest-audit-fixtures/unresolved-placeholder.xml +0 -14
- package/tests/fixtures/android/manifest-audit-fixtures/unusual-namespace-prefix.xml +0 -11
- package/tests/fixtures/android/multi-module/app/build.gradle.kts +0 -22
- package/tests/fixtures/android/multi-module/app/src/androidTest/java/com/example/multimodule/app/ExampleInstrumentedTest.kt +0 -3
- package/tests/fixtures/android/multi-module/app/src/main/AndroidManifest.xml +0 -11
- package/tests/fixtures/android/multi-module/app/src/test/java/com/example/multimodule/app/ExampleUnitTest.kt +0 -3
- package/tests/fixtures/android/multi-module/build.gradle.kts +0 -5
- package/tests/fixtures/android/multi-module/core/build.gradle.kts +0 -14
- package/tests/fixtures/android/multi-module/core/src/main/AndroidManifest.xml +0 -2
- package/tests/fixtures/android/multi-module/feature-login/build.gradle.kts +0 -18
- package/tests/fixtures/android/multi-module/feature-login/src/main/AndroidManifest.xml +0 -2
- package/tests/fixtures/android/multi-module/gradle/libs.versions.toml +0 -8
- package/tests/fixtures/android/multi-module/gradle/wrapper/gradle-wrapper.properties +0 -4
- package/tests/fixtures/android/multi-module/settings.gradle.kts +0 -4
- package/tests/fixtures/android/non-android-gradle/build.gradle.kts +0 -3
- package/tests/fixtures/android/non-android-gradle/core/build.gradle.kts +0 -3
- package/tests/fixtures/android/non-android-gradle/core/src/main/java/com/example/core/Core.java +0 -4
- package/tests/fixtures/android/non-android-gradle/gradle/wrapper/gradle-wrapper.properties +0 -4
- package/tests/fixtures/android/non-android-gradle/settings.gradle.kts +0 -2
- package/tests/fixtures/android/partial/app/build.gradle.kts +0 -7
- package/tests/fixtures/android/partial/settings.gradle.kts +0 -2
- package/tests/fixtures/android/xml-view-app/app/build.gradle.kts +0 -17
- package/tests/fixtures/android/xml-view-app/app/src/main/AndroidManifest.xml +0 -31
- package/tests/fixtures/android/xml-view-app/app/src/main/kotlin/com/example/xmlviewapp/MainActivity.kt +0 -7
- package/tests/fixtures/android/xml-view-app/app/src/main/res/layout/activity_main.xml +0 -4
- package/tests/fixtures/android/xml-view-app/build.gradle.kts +0 -4
- package/tests/fixtures/android/xml-view-app/gradle/wrapper/gradle-wrapper.properties +0 -4
- package/tests/fixtures/android/xml-view-app/settings.gradle.kts +0 -2
- package/tests/fixtures/audits/mixed-language/mixed-docs-claims/README.md +0 -16
- package/tests/fixtures/audits/mixed-language/mixed-docs-claims/build.gradle.kts +0 -4
- package/tests/fixtures/audits/mixed-language/mixed-docs-claims/src/main/java/com/example/Widget.java +0 -7
- package/tests/fixtures/audits/mixed-language/mixed-docs-claims/src/main/kotlin/com/example/Gadget.kt +0 -7
- package/tests/fixtures/audits/mixed-language/mixed-generated-vendor/README.md +0 -10
- package/tests/fixtures/audits/mixed-language/mixed-generated-vendor/build/Main.class +0 -1
- package/tests/fixtures/audits/mixed-language/mixed-generated-vendor/dist/index.js +0 -1
- package/tests/fixtures/audits/mixed-language/mixed-generated-vendor/generated/schema.ts +0 -1
- package/tests/fixtures/audits/mixed-language/mixed-generated-vendor/src/index.ts +0 -3
- package/tests/fixtures/audits/mixed-language/mixed-generated-vendor/vendor/lib.py +0 -2
- package/tests/fixtures/audits/mixed-language/mixed-java-kotlin/README.md +0 -10
- package/tests/fixtures/audits/mixed-language/mixed-java-kotlin/build.gradle.kts +0 -8
- package/tests/fixtures/audits/mixed-language/mixed-java-kotlin/settings.gradle.kts +0 -1
- package/tests/fixtures/audits/mixed-language/mixed-java-kotlin/src/main/java/com/example/FooService.java +0 -7
- package/tests/fixtures/audits/mixed-language/mixed-java-kotlin/src/main/kotlin/com/example/BarService.kt +0 -7
- package/tests/fixtures/audits/mixed-language/mixed-java-kotlin/src/test/java/com/example/FooServiceTest.java +0 -8
- package/tests/fixtures/audits/mixed-language/mixed-java-kotlin/src/test/kotlin/com/example/BarServiceTest.kt +0 -8
- package/tests/fixtures/audits/mixed-language/mixed-python-ts/README.md +0 -8
- package/tests/fixtures/audits/mixed-language/mixed-python-ts/src/app.py +0 -7
- package/tests/fixtures/audits/mixed-language/mixed-python-ts/src/index.ts +0 -3
- package/tests/fixtures/audits/mixed-language/mixed-python-ts/tests/test_app.py +0 -5
- package/tests/fixtures/audits/mixed-language/mixed-ts-js/README.md +0 -7
- package/tests/fixtures/audits/mixed-language/mixed-ts-js/src/helper.js +0 -5
- package/tests/fixtures/audits/mixed-language/mixed-ts-js/src/index.ts +0 -3
- package/tests/fixtures/audits/mixed-language/mixed-ts-js/tests/index.sample.ts +0 -5
- package/tests/fixtures/audits/mixed-language/mixed-ts-python-jvm/README.md +0 -10
- package/tests/fixtures/audits/mixed-language/mixed-ts-python-jvm/build.gradle.kts +0 -4
- package/tests/fixtures/audits/mixed-language/mixed-ts-python-jvm/pytests/test_app.py +0 -5
- package/tests/fixtures/audits/mixed-language/mixed-ts-python-jvm/src/app.py +0 -2
- package/tests/fixtures/audits/mixed-language/mixed-ts-python-jvm/src/helper.js +0 -5
- package/tests/fixtures/audits/mixed-language/mixed-ts-python-jvm/src/index.ts +0 -3
- package/tests/fixtures/audits/mixed-language/mixed-ts-python-jvm/src/main/java/com/example/Multiplier.java +0 -7
- package/tests/fixtures/audits/mixed-language/mixed-ts-python-jvm/src/main/kotlin/com/example/Divider.kt +0 -7
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/corrected-replay/derived/run-integrity-evidence.json +0 -99
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/corrected-replay/producer/implementation-audit.json +0 -1585
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/corrected-replay/producer/implementation-capsule.json +0 -11455
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/00-request.txt +0 -1
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/architecture-context-packet.txt +0 -82
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/behavior-model.txt +0 -104
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/final-report.txt +0 -41
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/implementation-context-packet.txt +0 -114
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/implementation-report.txt +0 -92
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/judge-report.txt +0 -34
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/pseudocode-packet.txt +0 -244
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/request-brief.txt +0 -40
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/test-context-packet.txt +0 -93
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/test-implementation-report.txt +0 -69
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/test-strategy-packet.txt +0 -354
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/verification-report.txt +0 -85
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/derived/run-integrity-evidence.json +0 -98
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/producer/architecture-audit.json +0 -1169
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/producer/architecture-request.json +0 -29
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/producer/implementation-audit.json +0 -1494
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/producer/implementation-capsule.json +0 -11364
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/producer/implementation-request.json +0 -33
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/producer/test-request.json +0 -74
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/reports/architecture-context-retrieval-report.txt +0 -58
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/reports/implementation-context-retrieval-report.txt +0 -75
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/reports/test-context-retrieval-report.txt +0 -84
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/run.json +0 -62
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/tool-versions/my-dev-kit-version.txt +0 -1
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/tool-versions/orchestrator-version.txt +0 -1
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/manifests/corrected-replay-manifest.json +0 -19
- package/tests/fixtures/ecosystem/context-integrity/v0.4.5/manifests/failed-run-manifest.json +0 -56
- package/tests/fixtures/fake-adversarial-cli.js +0 -152
- package/tests/fixtures/fake-my-dev-kit-cli.js +0 -83
- package/tests/fixtures/full-workflow-library/complete-v1.0.0.json +0 -24
- package/tests/fixtures/full-workflow-library/future-minor-v1.1.0-additive.json +0 -25
- package/tests/fixtures/stage-context-expectations/complete-v1.0.0.json +0 -230
- package/tests/fixtures/stage-context-expectations/future-minor-v1.1.0-additive.json +0 -232
- package/tests/fixtures/stage-context-expectations/invalid/malformed-json.txt +0 -1
- package/tests/fixtures/stage-context-expectations/invalid/non-object-root.json +0 -1
- package/tests/fixtures/stage-context-expectations/minimal-v1.0.0.json +0 -18
- package/tests/fixtures/upstream-artifacts/invalid/malformed-json.txt +0 -1
- package/tests/fixtures/upstream-artifacts/invalid/non-object-root.json +0 -1
- package/tests/fixtures/upstream-artifacts/my-dev-kit/1.10.2/context-capsule/complete-v1.0.0.json +0 -504
- package/tests/fixtures/upstream-artifacts/my-dev-kit/1.10.2/context-capsule/future-minor-v1.1.0-additive.json +0 -955
- package/tests/fixtures/upstream-artifacts/my-dev-kit/1.10.2/retrieval-audit-record/complete-v1.0.0.json +0 -190
- package/tests/fixtures/upstream-artifacts/my-dev-kit/1.10.2/retrieval-audit-record/future-minor-v1.1.0-additive.json +0 -327
- package/tests/fixtures/upstream-artifacts/my-dev-kit/1.10.4/PROVENANCE.txt +0 -18
- package/tests/fixtures/upstream-artifacts/my-dev-kit/1.10.4/context-capsule/complete-v1.0.0.json +0 -556
- package/tests/fixtures/upstream-artifacts/my-dev-kit/1.10.4/retrieval-audit-record/complete-v1.0.0.json +0 -238
- package/tests/fixtures/upstream-artifacts/my-dev-kit-1.10.2-identity/PROVENANCE.txt +0 -13
- package/tests/fixtures/upstream-artifacts/my-dev-kit-1.10.2-identity/context-capsule.json +0 -7874
- package/tests/fixtures/upstream-artifacts/my-dev-kit-1.10.2-identity/retrieval-audit-record.json +0 -1076
- package/tests/fixtures/upstream-artifacts/my-dev-kit-orchestrator/1.2.1/workflow-instruction-packet/complete-v1.0.0.json +0 -160
- package/tests/fixtures/upstream-artifacts/my-dev-kit-orchestrator/1.2.1/workflow-instruction-packet/future-minor-v1.1.0-additive.json +0 -186
- package/tests/fixtures/upstream-artifacts/my-dev-kit-orchestrator/1.2.3/run-integrity/PROVENANCE.txt +0 -31
- package/tests/fixtures/upstream-artifacts/my-dev-kit-orchestrator/1.2.3/run-integrity/ready-pass-final-pass.json +0 -132
- package/tests/fixtures/upstream-artifacts/my-dev-kit-orchestrator/1.2.3/run-integrity/refresh-required-need-context.json +0 -146
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
import { access } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
|
+
import { closeBrowserQuietly, errorMessage, isMissingBrowserRuntimeError, launchChromium } from "../browser/index.js";
|
|
4
5
|
const SKIP_WARNING = "PNG screenshot skipped because Playwright or browser runtime is unavailable.";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return (await import("playwright"));
|
|
16
|
-
}
|
|
6
|
+
const REPORT_VIEWPORT = { width: 1440, height: 1080 };
|
|
7
|
+
/**
|
|
8
|
+
* Captures a one-shot PNG of a local HTML report.
|
|
9
|
+
*
|
|
10
|
+
* Playwright loading, Chromium launch, and browser-availability classification
|
|
11
|
+
* are owned by `src/browser`; this module owns only the report-specific policy
|
|
12
|
+
* of mapping a generic runtime outcome onto captured/skipped/failed. A missing
|
|
13
|
+
* Playwright package and a missing Chromium binary are both non-fatal for a
|
|
14
|
+
* report (the HTML report is still produced), so both become "skipped".
|
|
15
|
+
*/
|
|
17
16
|
export async function captureReportScreenshot(htmlPath, pngPath, options) {
|
|
18
|
-
const loadPlaywright = options?.loadPlaywright ?? defaultLoadPlaywright;
|
|
19
17
|
try {
|
|
20
18
|
await access(htmlPath);
|
|
21
19
|
}
|
|
22
|
-
catch
|
|
20
|
+
catch {
|
|
23
21
|
return {
|
|
24
22
|
status: "failed",
|
|
25
23
|
htmlPath,
|
|
@@ -27,11 +25,8 @@ export async function captureReportScreenshot(htmlPath, pngPath, options) {
|
|
|
27
25
|
error: `HTML report not found: ${htmlPath}`
|
|
28
26
|
};
|
|
29
27
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
playwright = await loadPlaywright();
|
|
33
|
-
}
|
|
34
|
-
catch {
|
|
28
|
+
const launch = await launchChromium({ headless: true, loadPlaywright: options?.loadPlaywright });
|
|
29
|
+
if (launch.status === "unavailable") {
|
|
35
30
|
return {
|
|
36
31
|
status: "skipped",
|
|
37
32
|
htmlPath,
|
|
@@ -39,10 +34,17 @@ export async function captureReportScreenshot(htmlPath, pngPath, options) {
|
|
|
39
34
|
warning: SKIP_WARNING
|
|
40
35
|
};
|
|
41
36
|
}
|
|
42
|
-
|
|
37
|
+
if (launch.status === "failed") {
|
|
38
|
+
return {
|
|
39
|
+
status: "failed",
|
|
40
|
+
htmlPath,
|
|
41
|
+
pngPath,
|
|
42
|
+
error: launch.error
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const browser = launch.browser;
|
|
43
46
|
try {
|
|
44
|
-
|
|
45
|
-
const page = await browser.newPage({ viewport: { width: 1440, height: 1080 } });
|
|
47
|
+
const page = await browser.newPage({ viewport: { ...REPORT_VIEWPORT } });
|
|
46
48
|
await page.goto(pathToFileURL(path.resolve(htmlPath)).href, { waitUntil: "load" });
|
|
47
49
|
await page.screenshot({ path: pngPath, fullPage: true });
|
|
48
50
|
await browser.close();
|
|
@@ -53,10 +55,11 @@ export async function captureReportScreenshot(htmlPath, pngPath, options) {
|
|
|
53
55
|
};
|
|
54
56
|
}
|
|
55
57
|
catch (error) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
await closeBrowserQuietly(browser);
|
|
59
|
+
// A post-launch failure can still be a missing-browser-runtime symptom (for
|
|
60
|
+
// example a browser process that dies on first page use), so the same closed
|
|
61
|
+
// classifier applies here as at launch time.
|
|
62
|
+
if (isMissingBrowserRuntimeError(error)) {
|
|
60
63
|
return {
|
|
61
64
|
status: "skipped",
|
|
62
65
|
htmlPath,
|
|
@@ -68,7 +71,7 @@ export async function captureReportScreenshot(htmlPath, pngPath, options) {
|
|
|
68
71
|
status: "failed",
|
|
69
72
|
htmlPath,
|
|
70
73
|
pngPath,
|
|
71
|
-
error:
|
|
74
|
+
error: errorMessage(error)
|
|
72
75
|
};
|
|
73
76
|
}
|
|
74
77
|
}
|
|
@@ -2,9 +2,22 @@ export const REQUIRED_PACKAGE_CONTENTS = [
|
|
|
2
2
|
"CHANGELOG.md",
|
|
3
3
|
"LICENSE",
|
|
4
4
|
"README.md",
|
|
5
|
+
"package.json",
|
|
6
|
+
// Public bin target (installed CLI router entrypoint).
|
|
7
|
+
"dist/scripts/cli.js",
|
|
8
|
+
// Legacy final-demo bin-target compatibility (pre-v0.4.6 package.json bin).
|
|
5
9
|
"dist/scripts/run-final-demo.js",
|
|
10
|
+
// Compiled runtime the installed CLI router and its shared command owners
|
|
11
|
+
// depend on.
|
|
6
12
|
"dist/src/index.js",
|
|
7
|
-
"
|
|
13
|
+
"dist/src/cli/runLabCli.js",
|
|
14
|
+
"dist/src/runtime/labExecutionContext.js",
|
|
15
|
+
"dist/src/runtime/packageRoot.js",
|
|
16
|
+
"dist/src/runtime/packageResource.js",
|
|
17
|
+
// Bundled runtime resources public installed commands read by default
|
|
18
|
+
// (experiment run/controlled, demo final, legacy final-demo invocation).
|
|
19
|
+
"benchmarks/contracts/benchmark-project-profiles.json",
|
|
20
|
+
"examples/token-savings-cases.json",
|
|
8
21
|
];
|
|
9
22
|
function normalizeTarballPath(file) {
|
|
10
23
|
const normalized = file.replace(/\\/g, "/");
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from "./types.js";
|
|
2
|
+
export * from "./scenarioValidation.js";
|
|
3
|
+
export * from "./targetContractValidation.js";
|
|
4
|
+
export * from "./loadTutorialContracts.js";
|
|
5
|
+
export * from "./tutorialPaths.js";
|
|
6
|
+
export * from "./tutorialLocators.js";
|
|
7
|
+
export * from "./tutorialActions.js";
|
|
8
|
+
export * from "./tutorialAssertions.js";
|
|
9
|
+
export * from "./tutorialCursor.js";
|
|
10
|
+
export * from "./tutorialOverlay.js";
|
|
11
|
+
export * from "./tutorialArtifacts.js";
|
|
12
|
+
export * from "./subtitleWriter.js";
|
|
13
|
+
export * from "./markdownTutorialWriter.js";
|
|
14
|
+
export * from "./tutorialManifest.js";
|
|
15
|
+
export * from "./tutorialSession.js";
|
|
16
|
+
export * from "./runTutorial.js";
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { validateTutorialScenario } from "./scenarioValidation.js";
|
|
4
|
+
import { validateTutorialTargetContract } from "./targetContractValidation.js";
|
|
5
|
+
/**
|
|
6
|
+
* Contract loading follows the v0.4.6 invocation-path rule: an absolute path is
|
|
7
|
+
* used as supplied, a relative path resolves against invocationCwd -- never
|
|
8
|
+
* against packageRoot, workspaceRoot or the current process directory.
|
|
9
|
+
*/
|
|
10
|
+
export function resolveInvocationPath(invocationCwd, suppliedPath) {
|
|
11
|
+
return path.isAbsolute(suppliedPath) ? path.resolve(suppliedPath) : path.resolve(invocationCwd, suppliedPath);
|
|
12
|
+
}
|
|
13
|
+
export async function loadTutorialScenario(invocationCwd, suppliedPath) {
|
|
14
|
+
const scenarioPath = resolveInvocationPath(invocationCwd, suppliedPath);
|
|
15
|
+
const parsed = await readJsonFile(scenarioPath, "Tutorial scenario");
|
|
16
|
+
if (!parsed.ok) {
|
|
17
|
+
return { ok: false, errors: parsed.errors };
|
|
18
|
+
}
|
|
19
|
+
const validated = validateTutorialScenario(parsed.value, scenarioPath);
|
|
20
|
+
if (!validated.ok) {
|
|
21
|
+
return { ok: false, errors: validated.errors };
|
|
22
|
+
}
|
|
23
|
+
return { ok: true, value: { scenario: validated.value, scenarioPath } };
|
|
24
|
+
}
|
|
25
|
+
export async function loadTutorialTargetContract(invocationCwd, suppliedPath) {
|
|
26
|
+
const targetContractPath = resolveInvocationPath(invocationCwd, suppliedPath);
|
|
27
|
+
const parsed = await readJsonFile(targetContractPath, "Tutorial target contract");
|
|
28
|
+
if (!parsed.ok) {
|
|
29
|
+
return { ok: false, errors: parsed.errors };
|
|
30
|
+
}
|
|
31
|
+
const validated = validateTutorialTargetContract(parsed.value, targetContractPath);
|
|
32
|
+
if (!validated.ok) {
|
|
33
|
+
return { ok: false, errors: validated.errors };
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
ok: true,
|
|
37
|
+
value: {
|
|
38
|
+
targetContract: validated.value,
|
|
39
|
+
targetContractPath,
|
|
40
|
+
contractRoot: path.dirname(targetContractPath)
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
async function readJsonFile(filePath, label) {
|
|
45
|
+
let raw;
|
|
46
|
+
try {
|
|
47
|
+
raw = await readFile(filePath, "utf8");
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
51
|
+
return { ok: false, errors: [`${label} could not be read: ${filePath} (${reason})`] };
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
return { ok: true, value: JSON.parse(raw) };
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
58
|
+
return { ok: false, errors: [`${label} is not valid JSON: ${filePath} (${reason})`] };
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export function renderTutorialMarkdown(options) {
|
|
2
|
+
const { scenario } = options;
|
|
3
|
+
const stepById = new Map(scenario.steps.map((step) => [step.id, step]));
|
|
4
|
+
const screenshotById = new Map(options.screenshots.filter((record) => record.id !== undefined).map((record) => [record.id, record]));
|
|
5
|
+
const lines = [];
|
|
6
|
+
lines.push(`# ${scenario.title}`);
|
|
7
|
+
if (scenario.description !== undefined && scenario.description.trim().length > 0) {
|
|
8
|
+
lines.push("");
|
|
9
|
+
lines.push(scenario.description.trim());
|
|
10
|
+
}
|
|
11
|
+
let position = 0;
|
|
12
|
+
for (const stepResult of options.steps) {
|
|
13
|
+
// A not-run step never happened, so it is not presented as part of the
|
|
14
|
+
// tutorial at all.
|
|
15
|
+
if (stepResult.status === "not-run") {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
const step = stepById.get(stepResult.id);
|
|
19
|
+
if (!step) {
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
position += 1;
|
|
23
|
+
lines.push("");
|
|
24
|
+
lines.push(`## Step ${position}: ${step.id}`);
|
|
25
|
+
lines.push("");
|
|
26
|
+
lines.push(step.narration.trim());
|
|
27
|
+
if (stepResult.status === "failed") {
|
|
28
|
+
lines.push("");
|
|
29
|
+
// Stated plainly from the run result; no troubleshooting advice is invented.
|
|
30
|
+
lines.push(`**This step failed during execution.** ${stepResult.error ?? ""}`.trim());
|
|
31
|
+
}
|
|
32
|
+
const screenshotId = step.screenshot?.id;
|
|
33
|
+
if (screenshotId !== undefined) {
|
|
34
|
+
const record = screenshotById.get(screenshotId);
|
|
35
|
+
if (record?.status === "written" && record.path !== undefined) {
|
|
36
|
+
lines.push("");
|
|
37
|
+
lines.push(`})`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
lines.push("");
|
|
42
|
+
return `${lines.join("\n")}`;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* tutorial.md lives in `artifacts/` and screenshots live in `screenshots/`, both
|
|
46
|
+
* directly beneath runRoot, so a run-root-relative screenshot path becomes a
|
|
47
|
+
* `../`-prefixed sibling link. POSIX separators keep the document portable; an
|
|
48
|
+
* absolute machine path is never written.
|
|
49
|
+
*/
|
|
50
|
+
export function toMarkdownScreenshotLink(runRelativePosixPath) {
|
|
51
|
+
const normalized = runRelativePosixPath.replace(/\\/g, "/").replace(/^\/+/, "");
|
|
52
|
+
return `../${normalized}`;
|
|
53
|
+
}
|