@inneranimalmedia/agentsam-sdk 2.6.12 → 2.6.13
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/AGENTSAM.md +32 -0
- package/DEVELOPMENT.md +69 -74
- package/README.md +11 -0
- package/apps/cad-creator/README.md +12 -0
- package/apps/cad-creator/shared/cad/package.json +1 -1
- package/apps/cad-creator/shared/cad/src/domain/project-contract.js +2 -75
- package/apps/cad-creator/shared/cad/src/domain/project-tools.js +2 -24
- package/apps/cad-creator/shared/cad/src/types.ts +2 -2
- package/apps/client-cms-editor/backend/package.json +2 -2
- package/apps/client-cms-editor/frontend/package.json +3 -3
- package/apps/client-cms-editor/frontend/src/adapters/http.ts +25 -13
- package/apps/client-cms-editor/frontend/src/editor/CmsEditor.tsx +7 -4
- package/apps/client-cms-editor/frontend/src/editor/canvas/PreviewCanvas.tsx +31 -3
- package/apps/client-cms-editor/frontend/src/editor/host-preview.test.tsx +104 -0
- package/apps/client-cms-editor/package-lock.json +8 -8
- package/apps/client-cms-editor/package.json +2 -1
- package/apps/client-cms-editor/shared/cms/package.json +1 -1
- package/docs/AUTORAG.md +2 -0
- package/docs/CAPABILITIES.md +28 -0
- package/docs/adr/ADR-0003-copro-clean-room-product-architecture.md +6 -0
- package/docs/architecture/AGENTSAM-CANONICAL-DISCOVERY-FIRST-SLICE.md +70 -0
- package/docs/architecture/AGENTSAM-REGISTRY-CLI-AGENT-PARITY.md +133 -0
- package/docs/architecture/AGENTSAM_APPLICATION_CONTRACT.md +6 -0
- package/docs/architecture/CAD_OPERATOR_CAPABILITIES.md +64 -0
- package/docs/architecture/CAD_ROBOTICS_RELEASE_LEDGER_20261016.md +43 -0
- package/docs/architecture/CAD_RUN_MODES.md +34 -0
- package/docs/architecture/CLI-BOOT-REMOTE-DB-READINESS-20261015.md +65 -0
- package/docs/architecture/EXISTING-MCP-D1-AGENT-BRIDGE.md +47 -0
- package/docs/architecture/PLAN-PORTABILITY-SAM-FIRST-SPRINT-20261015.md +36 -0
- package/docs/architecture/PLUGIN-PRODUCTIZATION-SPINE.md +101 -0
- package/docs/architecture/SAMOS_PRODUCT_MODEL.md +49 -0
- package/docs/architecture/SAM_KERNEL.md +40 -0
- package/docs/architecture/SAM_RESOURCE_CRUD_STANDARD.md +96 -0
- package/docs/architecture/SAM_SYSTEMATIC_AUTONOMOUS_MACHINERY.md +79 -0
- package/docs/architecture/USER_GLOBAL_AGENT_INSTRUCTIONS.md +55 -0
- package/docs/autorag-workflow.md +13 -0
- package/docs/brand/AGENT_SAM_ICON_GRAMMAR.md +4 -0
- package/docs/contracts/capability-install-planner.md +66 -38
- package/docs/contracts/environment-vocabulary.md +5 -5
- package/docs/engineering/SUPERBASH_LOCAL_RUNTIME.md +100 -0
- package/docs/generated/SDK_CAPABILITY_INVENTORY.md +313 -0
- package/docs/handoffs/AGENT_HANDOFF_SUPERBASH_AND_MODEL_PERFORMANCE_2026-10-14.md +134 -0
- package/docs/intake/product-capabilities.proposed.ts +232 -0
- package/docs/knowledge-supabase-node-api.md +51 -0
- package/docs/plans/MEDIA_TRUTH_SOURCE_RECOVERY_20261008.md +31 -0
- package/docs/plans/OFFLINE_CLI_KNOWLEDGE_AGENT_HANDOFF.md +104 -0
- package/docs/plans/OFFLINE_CLI_KNOWLEDGE_RUNBOOK.md +81 -0
- package/docs/plans/SAM_EXPERIENCE_AGENT_DISPATCH_2026-10-15.md +107 -0
- package/docs/plans/SAM_MACHINERY_TO_EXPERIENCE_2026-10-15.md +172 -0
- package/docs/plans/UI_POLISH_DESKTOP_2026-10-16.md +102 -0
- package/docs/plans/WORK-UX-REMASTER-2026-10-15.md +48 -0
- package/docs/plans/WORK-WORKSPACE-PLAN-2026-10-14.md +212 -0
- package/docs/product/AGENTSAM-UI-QUALITY-GATE.md +148 -0
- package/docs/product/AGENTSAM_PRODUCT_EXPERIENCE_STANDARD.md +2 -0
- package/docs/product/MEDIA-PRODUCTION-FAMILY.md +47 -0
- package/docs/product/OFFER-PORTFOLIO.md +14 -0
- package/docs/product/PACKAGE-TAXONOMY.md +17 -0
- package/docs/product/PLUGIN-GALLERY-DISCOVERY-AND-INSTALL.md +97 -0
- package/docs/product/README.md +2 -0
- package/docs/product/WIDGET-GALLERY-PHASE-ONE.md +43 -0
- package/docs/reference/AGENTSAM-CLI-WORKFLOWS.md +73 -0
- package/docs/reference/AGENTSAM-ERROR-REASONS.md +267 -0
- package/docs/reference/AGENTSAM-REGISTRY.generated.md +288 -0
- package/docs/reference/INNERANIMALMEDIA_EXPERIENCE_ACCEPTANCE_2026-10-15.md +99 -0
- package/docs/releases/cad-v2-sdk-2.6.13.md +25 -0
- package/docs/roadmaps/ROAD_TO_REAL_DISTRIBUTION.md +97 -0
- package/docs/robotics-chess-handoff.md +15 -0
- package/docs/standards/DELIVERY_CLOSURE.md +33 -0
- package/docs/standards/SAM_MACHINE_BUILD_AND_GAPS.md +91 -0
- package/docs/workflows/ISSUE_TO_SAMOS.md +59 -0
- package/package.json +60 -8
- package/packages/agentsam-brand/package.json +1 -1
- package/packages/agentsam-cms/README.md +56 -0
- package/packages/agentsam-cms/agentsam.package.json +46 -0
- package/packages/agentsam-cms/package.json +36 -0
- package/packages/agentsam-cms/src/aliases.js +74 -0
- package/packages/agentsam-cms/src/contracts.js +105 -0
- package/packages/agentsam-cms/src/index.d.ts +80 -0
- package/packages/agentsam-cms/src/index.js +3 -0
- package/packages/agentsam-cms/src/machine.js +221 -0
- package/packages/agentsam-cms/src/node-sqlite-repository.js +148 -0
- package/packages/agentsam-cms/src/node.d.ts +7 -0
- package/packages/agentsam-cms/src/node.js +1 -0
- package/packages/agentsam-cms/src/schema/cms-local-runtime.v1.sql +365 -0
- package/packages/agentsam-cms/test/standalone.test.mjs +28 -0
- package/packages/agentsam-contracts/agentsam.package.json +43 -0
- package/packages/agentsam-contracts/dist/errors.d.ts +1 -1
- package/packages/agentsam-contracts/dist/widgets.d.ts +7 -0
- package/packages/agentsam-contracts/package.json +1 -1
- package/packages/agentsam-contracts/src/errors.ts +1 -1
- package/packages/agentsam-contracts/src/widgets.ts +7 -0
- package/packages/agentsam-desktop-shell/README.md +38 -0
- package/packages/agentsam-desktop-shell/scripts/app-discovery.mjs +43 -0
- package/packages/agentsam-errors/README.md +14 -0
- package/packages/agentsam-errors/agentsam.package.json +43 -0
- package/packages/agentsam-errors/package.json +1 -1
- package/packages/agentsam-errors/protocol/error-catalog.json +12 -0
- package/packages/agentsam-errors/src/cli.js +56 -0
- package/packages/agentsam-errors/src/index.js +2 -0
- package/packages/agentsam-errors/src/vocabulary.js +2 -0
- package/packages/agentsam-errors/test/approval-contract.test.mjs +12 -0
- package/packages/agentsam-errors/types/index.d.ts +5 -1
- package/packages/agentsam-goap/agentsam.package.json +42 -0
- package/packages/agentsam-goap/package.json +2 -2
- package/packages/agentsam-hooks/agentsam.package.json +45 -0
- package/packages/agentsam-hooks/bindings/go/errors_generated.go +1 -0
- package/packages/agentsam-hooks/bindings/rust/src/errors_generated.rs +1 -0
- package/packages/agentsam-hooks/package.json +1 -1
- package/packages/agentsam-hooks/src/errors-generated.js +10 -0
- package/packages/agentsam-ide/README.md +59 -0
- package/packages/agentsam-ide/src/lsp/host.d.mts +13 -0
- package/packages/agentsam-ide/src/lsp/host.mjs +133 -0
- package/packages/agentsam-knowledge/agentsam.package.json +42 -0
- package/packages/agentsam-knowledge/package.json +1 -1
- package/packages/agentsam-knowledge/src/autorag/index.js +25 -4
- package/packages/agentsam-knowledge/src/backends/index.js +21 -1
- package/packages/agentsam-knowledge/src/backends/supabase-node-api.js +91 -0
- package/packages/agentsam-knowledge/test/autorag.test.mjs +13 -0
- package/packages/agentsam-knowledge/test/supabase-node-api.test.mjs +59 -0
- package/packages/agentsam-merch/agentsam.package.json +43 -0
- package/packages/agentsam-merch/package.json +1 -1
- package/packages/agentsam-nav/dist/browser.global.js +18 -21
- package/packages/agentsam-nav/dist/browser.js +4 -3
- package/packages/agentsam-nav/dist/index.js +4 -3
- package/packages/agentsam-nav/package.json +1 -1
- package/packages/agentsam-queue-control/agentsam.package.json +42 -0
- package/packages/agentsam-queue-control/package.json +1 -1
- package/packages/agentsam-rapid-rust/Cargo.toml +5 -0
- package/packages/agentsam-rapid-rust/agentsam.package.json +42 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/0b22ca9c5f8cddc15e6816df4a2467a28d41aa174361cdfed9019ee4e04dfbb8.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/0c5064875a5d7645013880f04d71f56c0dfa1bc87ac9fd59adc3e9a93a2745da.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/11ebd15702c169ee0666656be851cc549f70f84498dbca3c5b72d2ceaa91c851.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/1d7f2c8ad9588cd2077a1d07fce156e0bd47be686d8c9f26885bab14874c4ab5.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/1f21ba21e7b631b0d4893cbdd7a6bb7345d34e8b1a0ee9cf644cc30aeb3c8b8d.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/23f4d4b90def0782de32e7a57558cba24525f12ba3c009728ea4881259a74099.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/26b60985b6ef62e4f20e06c37e47c6996c1a2f457335fa9eb4a68d1288e18490.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/2b27d15a1b8c3637a56f631d583cc9ba584bed2b7018dd962a9340d5e1c50a1d.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/3110a5568a544c4c38de6585dcdabc21fa5f54a5772ecf4e1f4076ee0d49e933.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/357ce3db8299e01866bf4fc3d8ee1c784ef53c7455cf86bb17c52f3dad20d050.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/4516c6e03636538cacc7a6e4063d98a7ed2f0090c3a02c5ee817f1c512b1070e.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/649e02dbaec2edabbd40372e0c5f72f114164fe7704e7825220b1955f6a7c74e.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/81c266d4c150a4f6c5a73c9c4fef6541577fd0acd8c1f911f02781deb5f0be0f.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/86b4b8de30eed9902750b3de9fb54276d229244671a8b6035345bbe705463d82.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/8a877fdc5dbc6a66c344b4ebc4d9b746d47f95153e98872210becd85ca941ddd.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/96a11200f7b42ddd1281e4f749e88dcb8455ab0e3883f943934e0a9a7935147a.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/9e2df2335cfc73ec021bdd6b2d34af798f6ed9c52e3061ce16b6ceabae4e275f.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/a405fe3addeaab2908ed58836997be3b679d990ec9102d06bece3569e4bd4a81.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/a63915da0a45f86a5938ba9a2b2e87d469e7d07f7ea9cc531136fdc9e055557e.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/a8452c2dcaa959ced25e3597931b311999c0aa5b257ca8610fe415e8cfa598cc.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/b35fc2ae65ea07fbbfdd242a3d76489947462399e7a2db91f8545ca50d97d86f.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/b966932defe9c7b5ec9599c9276d333bd09ad1605adae80300d825d2161ad20c.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/ca9060e5ccb91f3a2663f57afd47a25099b6b3313c2a7436c4634993ff6e9afc.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/d0eba82a259be203c68c3ebf6d5b8a376f31a3b84fad418fdb9b5e2715c59869.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/d8838513009c65079aba67314ab130920484c674c5f0b8a356c8777eb6174eb2.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/dda01925b7f0a213215b983979ce23625dd0f6cfdb49c483ec1ff73e64def56f.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/e4956d8f97608f8324607b22cc93635d8183b23021d79cb4c21668c8b8a6ce87.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/e80c1e517e7173dcbde78869d2bf67a24a11b0bb9df5a87fb12934e39497abc8.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/eeeaa9394ac979eb4ffa557e97d67ed96dbd61437e09058f7c776bdc0483f050.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/f9264d8d7d1ccfb415362a28b4a1b4fa0dfbdf828ff970d1aaecfb0ebe208978.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/cache/machine-parser.v1/f957a80b89d32af4f33f9f840b4795af1b5145fc44780ad88a6a3b1b3a7ea3bc.json +1 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_2b0d196f16961f88/asset-manifest.json +418 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_2b0d196f16961f88/findings.json +308 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_2b0d196f16961f88/frontend-manifest.json +70 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_2b0d196f16961f88/graph.json +322 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_2b0d196f16961f88/inventory.json +932 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_2b0d196f16961f88/summary.json +21 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_2d70e3d4fe8290fb/asset-manifest.json +418 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_2d70e3d4fe8290fb/findings.json +308 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_2d70e3d4fe8290fb/frontend-manifest.json +70 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_2d70e3d4fe8290fb/graph.json +322 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_2d70e3d4fe8290fb/inventory.json +932 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_2d70e3d4fe8290fb/summary.json +21 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_63fab76b2f18c2f0/asset-manifest.json +418 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_63fab76b2f18c2f0/findings.json +308 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_63fab76b2f18c2f0/frontend-manifest.json +70 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_63fab76b2f18c2f0/graph.json +322 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_63fab76b2f18c2f0/inventory.json +932 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_63fab76b2f18c2f0/summary.json +21 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_72fe856b80b0c46f/asset-manifest.json +418 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_72fe856b80b0c46f/findings.json +300 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_72fe856b80b0c46f/frontend-manifest.json +70 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_72fe856b80b0c46f/graph.json +322 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_72fe856b80b0c46f/inventory.json +932 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_72fe856b80b0c46f/summary.json +21 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_a5834156504f3050/asset-manifest.json +418 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_a5834156504f3050/findings.json +308 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_a5834156504f3050/frontend-manifest.json +70 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_a5834156504f3050/graph.json +322 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_a5834156504f3050/inventory.json +932 -0
- package/packages/agentsam-repository/.agentsam/machine/runs/run_a5834156504f3050/summary.json +21 -0
- package/packages/agentsam-repository/README.md +25 -0
- package/packages/agentsam-repository/agentsam.package.json +42 -0
- package/packages/agentsam-repository/package.json +6 -3
- package/packages/agentsam-repository/src/crawl.js +220 -0
- package/packages/agentsam-repository/src/index.js +3 -0
- package/packages/agentsam-repository/src/merkle/semantic.js +20 -0
- package/packages/agentsam-repository/src/refinery.js +96 -0
- package/packages/agentsam-repository/test/crawl-refinery.test.mjs +113 -0
- package/packages/agentsam-site-scrape/README.md +357 -0
- package/packages/agentsam-site-scrape/agentsam_site_scrape/__init__.py +4 -0
- package/packages/agentsam-site-scrape/agentsam_site_scrape/__main__.py +349 -0
- package/packages/agentsam-site-scrape/agentsam_site_scrape/classify.py +80 -0
- package/packages/agentsam-site-scrape/agentsam_site_scrape/config.py +83 -0
- package/packages/agentsam-site-scrape/agentsam_site_scrape/contract.py +108 -0
- package/packages/agentsam-site-scrape/agentsam_site_scrape/crawl.py +395 -0
- package/packages/agentsam-site-scrape/agentsam_site_scrape/evidence.py +226 -0
- package/packages/agentsam-site-scrape/agentsam_site_scrape/htmlparse.py +109 -0
- package/packages/agentsam-site-scrape/agentsam_site_scrape/imageops.py +121 -0
- package/packages/agentsam-site-scrape/agentsam_site_scrape/jsonrun.py +127 -0
- package/packages/agentsam-site-scrape/agentsam_site_scrape/net.py +121 -0
- package/packages/agentsam-site-scrape/agentsam_site_scrape/pageextract.py +202 -0
- package/packages/agentsam-site-scrape/agentsam_site_scrape/r2_upload.py +140 -0
- package/packages/agentsam-site-scrape/agentsam_site_scrape/ssrf.py +57 -0
- package/packages/agentsam-site-scrape/agentsam_site_scrape/storage.py +57 -0
- package/packages/agentsam-site-scrape/agentsam_site_scrape/wrangler_bucket.py +98 -0
- package/packages/agentsam-site-scrape/pyproject.toml +21 -0
- package/packages/agentsam-site-scrape/runtime/client.mjs +32 -0
- package/packages/agentsam-site-scrape/runtime/core.mjs +211 -0
- package/packages/agentsam-site-scrape/runtime/index.mjs +31 -0
- package/packages/agentsam-site-scrape/runtime/knowledge.mjs +38 -0
- package/packages/agentsam-site-scrape/runtime/node-runner.mjs +231 -0
- package/packages/agentsam-site-scrape/runtime/node-storage.mjs +146 -0
- package/packages/agentsam-site-scrape/runtime/project-site.mjs +74 -0
- package/packages/agentsam-site-scrape/runtime/secure-fetch.mjs +88 -0
- package/packages/agentsam-site-scrape/runtime/test/knowledge-handoff.test.mjs +51 -0
- package/packages/agentsam-site-scrape/runtime/test/project-index-command.test.mjs +109 -0
- package/packages/agentsam-site-scrape/runtime/test/runtime.test.mjs +145 -0
- package/packages/agentsam-site-scrape/tests/__init__.py +0 -0
- package/packages/agentsam-site-scrape/tests/test_contract.py +83 -0
- package/packages/agentsam-site-scrape/tests/test_core.py +119 -0
- package/packages/agentsam-site-scrape/tests/test_evidence.py +88 -0
- package/packages/agentsam-site-scrape/tests/test_evidence_pipeline.py +112 -0
- package/packages/agentsam-site-scrape/tests/test_jsonrun.py +63 -0
- package/packages/agentsam-site-scrape/tests/test_redirects.py +68 -0
- package/packages/agentsam-site-scrape/tests/test_storage.py +34 -0
- package/packages/agentsam-site-scrape/worker/index.mjs +259 -0
- package/packages/agentsam-site-scrape/worker/project-config.mjs +57 -0
- package/packages/agentsam-site-scrape/worker/test/worker.test.mjs +191 -0
- package/packages/agentsam-vault/package.json +1 -1
- package/packages/agentsam-workbench/README.md +18 -0
- package/packages/agentsam-workbench/package.json +13 -4
- package/packages/agentsam-workbench/src/agent/capability-catalog.ts +96 -0
- package/packages/agentsam-workbench/src/agent/index.ts +2 -0
- package/packages/agentsam-workbench/src/knowledge/AutoRagWorkflowDialog.tsx +166 -0
- package/packages/agentsam-workbench/src/knowledge/README.md +14 -0
- package/packages/agentsam-workbench/src/knowledge/autorag-workflow.css +6 -0
- package/packages/agentsam-workbench/src/knowledge/index.ts +2 -0
- package/packages/agentsam-workbench/src/widgets/registry.ts +266 -1
- package/packages/catalog/README.md +69 -0
- package/packages/catalog/assist/questions.json +205 -0
- package/packages/catalog/assist/rules.json +149 -0
- package/packages/catalog/doctor/toolchains.json +12 -0
- package/packages/catalog/evidence/agentsam-abs.json +76 -0
- package/packages/catalog/evidence/agentsam-analytics.json +59 -0
- package/packages/catalog/evidence/agentsam-assets-core.json +38 -0
- package/packages/catalog/evidence/agentsam-brand.json +73 -0
- package/packages/catalog/evidence/agentsam-browser-surface.json +42 -0
- package/packages/catalog/evidence/agentsam-campaign.json +48 -0
- package/packages/catalog/evidence/agentsam-cloudflare-images.json +38 -0
- package/packages/catalog/evidence/agentsam-content-studio.json +42 -0
- package/packages/catalog/evidence/agentsam-content.json +70 -0
- package/packages/catalog/evidence/agentsam-contracts.json +92 -0
- package/packages/catalog/evidence/agentsam-database-editor.json +82 -0
- package/packages/catalog/evidence/agentsam-desktop-shell.json +56 -0
- package/packages/catalog/evidence/agentsam-docs-theme.json +35 -0
- package/packages/catalog/evidence/agentsam-errors.json +42 -0
- package/packages/catalog/evidence/agentsam-goap.json +52 -0
- package/packages/catalog/evidence/agentsam-hooks.json +100 -0
- package/packages/catalog/evidence/agentsam-ide.json +64 -0
- package/packages/catalog/evidence/agentsam-identity.json +91 -0
- package/packages/catalog/evidence/agentsam-key-manager.json +46 -0
- package/packages/catalog/evidence/agentsam-knowledge.json +42 -0
- package/packages/catalog/evidence/agentsam-loading-scene.json +54 -0
- package/packages/catalog/evidence/agentsam-merch.json +68 -0
- package/packages/catalog/evidence/agentsam-nav.json +63 -0
- package/packages/catalog/evidence/agentsam-queue-control.json +60 -0
- package/packages/catalog/evidence/agentsam-rapid-rust.json +46 -0
- package/packages/catalog/evidence/agentsam-repository.json +56 -0
- package/packages/catalog/evidence/agentsam-scoring.json +39 -0
- package/packages/catalog/evidence/agentsam-sections.json +52 -0
- package/packages/catalog/evidence/agentsam-settings.json +58 -0
- package/packages/catalog/evidence/agentsam-shell-kit.json +56 -0
- package/packages/catalog/evidence/agentsam-vault.json +61 -0
- package/packages/catalog/evidence/agentsam-work-graph.json +51 -0
- package/packages/catalog/evidence/agentsam-work.json +64 -0
- package/packages/catalog/evidence/agentsam-workbench.json +96 -0
- package/packages/catalog/evidence/analytics-ui.json +43 -0
- package/packages/catalog/evidence/cms-runtime.json +49 -0
- package/packages/catalog/evidence/copro-editor.json +42 -0
- package/packages/catalog/evidence/copro-media.json +42 -0
- package/packages/catalog/evidence/copro-project.json +42 -0
- package/packages/catalog/evidence/copro-proof.json +48 -0
- package/packages/catalog/evidence/copro-provider-contracts.json +40 -0
- package/packages/catalog/evidence/copro-render.json +40 -0
- package/packages/catalog/evidence/copro-storage.json +44 -0
- package/packages/catalog/evidence/copro-templates.json +42 -0
- package/packages/catalog/evidence/copro-timeline.json +44 -0
- package/packages/catalog/evidence/copro-ui.json +52 -0
- package/packages/catalog/evidence/fnf-theme.json +34 -0
- package/packages/catalog/evidence/theme-contract.json +34 -0
- package/packages/catalog/evidence/theme-cypress.json +41 -0
- package/packages/catalog/evidence/theme-ember.json +41 -0
- package/packages/catalog/evidence/theme-forge.json +41 -0
- package/packages/catalog/evidence/theme-grove.json +41 -0
- package/packages/catalog/evidence/theme-harbor.json +41 -0
- package/packages/catalog/evidence/theme-heuristic.json +50 -0
- package/packages/catalog/evidence/theme-iasf.json +48 -0
- package/packages/catalog/evidence/theme-resolve.json +41 -0
- package/packages/catalog/evidence/theme-scenes.json +68 -0
- package/packages/catalog/evidence/theme-summit.json +41 -0
- package/packages/catalog/evidence/theme-violet.json +41 -0
- package/packages/catalog/generated/packages.json +2649 -0
- package/packages/catalog/topics/runtime.json +33 -0
- package/packages/connectors/cfoa/agentsam.package.json +46 -0
- package/packages/connectors/cfoa/package.json +1 -1
- package/packages/connectors/cfoa/src/capabilities.js +22 -2
- package/packages/connectors/cfoa/src/families/analytics-sql.js +44 -0
- package/packages/connectors/cfoa/src/families/basin.js +30 -0
- package/packages/connectors/cfoa/src/index.js +3 -0
- package/packages/connectors/cfoa/src/routes.js +11 -2
- package/packages/connectors/cfoa/test/analytics-sql.test.mjs +27 -0
- package/packages/connectors/cfoa/test/basin.test.mjs +30 -0
- package/packages/heuristic-theme/README.md +14 -0
- package/packages/heuristic-theme/agentsam.package.json +42 -0
- package/packages/heuristic-theme/contracts/README.md +15 -0
- package/packages/heuristic-theme/contracts/block.schema.json +33 -0
- package/packages/heuristic-theme/contracts/header-presets.json +20 -0
- package/packages/heuristic-theme/contracts/page.schema.json +18 -0
- package/packages/heuristic-theme/contracts/preset.schema.json +18 -0
- package/packages/heuristic-theme/contracts/section.schema.json +83 -0
- package/packages/heuristic-theme/package.json +13 -3
- package/packages/heuristic-theme/presets/fuel-free-time/assets.json +8 -0
- package/packages/heuristic-theme/presets/fuel-free-time/globals/shell.json +30 -0
- package/packages/heuristic-theme/presets/fuel-free-time/pages/about.json +4 -0
- package/packages/heuristic-theme/presets/fuel-free-time/pages/cart.json +4 -0
- package/packages/heuristic-theme/presets/fuel-free-time/pages/collection.json +4 -0
- package/packages/heuristic-theme/presets/fuel-free-time/pages/collections.json +4 -0
- package/packages/heuristic-theme/presets/fuel-free-time/pages/community.json +4 -0
- package/packages/heuristic-theme/presets/fuel-free-time/pages/home.json +92 -0
- package/packages/heuristic-theme/presets/fuel-free-time/pages/order-confirmation.json +39 -0
- package/packages/heuristic-theme/presets/fuel-free-time/pages/product.json +4 -0
- package/packages/heuristic-theme/presets/fuel-free-time/pages/shop.json +9 -0
- package/packages/heuristic-theme/presets/fuel-free-time/preset.json +23 -0
- package/packages/heuristic-theme/presets/fuel-free-time/tokens.json +23 -0
- package/packages/heuristic-theme/storefront/about.html +1103 -0
- package/packages/heuristic-theme/storefront/assets/presets/fuel-free-time/GENERATED-ASSETS.md +15 -0
- package/packages/heuristic-theme/storefront/assets/presets/fuel-free-time/earned-hours-hero.webp +0 -0
- package/packages/heuristic-theme/storefront/assets/presets/fuel-free-time/essentials.webp +0 -0
- package/packages/heuristic-theme/storefront/assets/presets/fuel-free-time/masters.webp +0 -0
- package/packages/heuristic-theme/storefront/cart.html +64 -0
- package/packages/heuristic-theme/storefront/collaborate.html +58 -0
- package/packages/heuristic-theme/storefront/collection.html +10 -0
- package/packages/heuristic-theme/storefront/collections.html +10 -0
- package/packages/heuristic-theme/storefront/community.html +921 -0
- package/packages/heuristic-theme/storefront/css/content-page.css +199 -0
- package/packages/heuristic-theme/storefront/css/global-footer.css +401 -0
- package/packages/heuristic-theme/storefront/css/heuristic-theme.css +81 -0
- package/packages/heuristic-theme/storefront/css/page-composer.css +76 -0
- package/packages/heuristic-theme/storefront/css/shop-hero.css +230 -0
- package/packages/heuristic-theme/storefront/css/store-cart.css +422 -0
- package/packages/heuristic-theme/storefront/css/store-collections.css +36 -0
- package/packages/heuristic-theme/storefront/css/store-pdp.css +459 -0
- package/packages/heuristic-theme/storefront/css/store-shell.css +474 -0
- package/packages/heuristic-theme/storefront/css/store-shop.css +117 -0
- package/packages/heuristic-theme/storefront/home.html +25 -0
- package/packages/heuristic-theme/storefront/js/cms-hydrate.js +395 -0
- package/packages/heuristic-theme/storefront/js/cms-structure.js +85 -0
- package/packages/heuristic-theme/storefront/js/fnf-attribution.js +98 -0
- package/packages/heuristic-theme/storefront/js/fnf-head.js +47 -0
- package/packages/heuristic-theme/storefront/js/fnf-newsletter.js +64 -0
- package/packages/heuristic-theme/storefront/js/global-footer.js +277 -0
- package/packages/heuristic-theme/storefront/js/heuristic-runtime.js +78 -0
- package/packages/heuristic-theme/storefront/js/order-confirmation.js +109 -0
- package/packages/heuristic-theme/storefront/js/page-composer.js +310 -0
- package/packages/heuristic-theme/storefront/js/shop-hero.js +85 -0
- package/packages/heuristic-theme/storefront/js/store-cart.js +276 -0
- package/packages/heuristic-theme/storefront/js/store-catalog.js +140 -0
- package/packages/heuristic-theme/storefront/js/store-collections.js +45 -0
- package/packages/heuristic-theme/storefront/js/store-product.js +287 -0
- package/packages/heuristic-theme/storefront/js/store-shell.js +449 -0
- package/packages/heuristic-theme/storefront/order-confirmation.html +30 -0
- package/packages/heuristic-theme/storefront/policies.html +43 -0
- package/packages/heuristic-theme/storefront/product.html +27 -0
- package/packages/heuristic-theme/storefront/shop.html +113 -0
- package/packages/heuristic-theme/storefront/terms.html +45 -0
- package/packages/heuristic-theme/test/commerce-portability.test.mjs +16 -0
- package/packages/heuristic-theme/theme.json +55 -0
- package/packages/heuristic-theme/theme.schema.json +32 -0
- package/packages/identity/agentsam.package.json +42 -0
- package/packages/identity/package.json +1 -1
- package/packages/identity/src/oauth/iam-platform.js +4 -2
- package/packages/identity/src/recovery/password-reset.js +8 -8
- package/packages/identity/src/server/worker-router.js +63 -1
- package/packages/identity/tests/lane1-packed-consumer.test.mjs +12 -1
- package/packages/identity/tests/password-enrollment.test.mjs +82 -0
- package/packages/identity/tests/password-reset.test.mjs +43 -0
- package/packages/providers/completeful/package.json +1 -1
- package/packages/theme-cypress/agentsam.package.json +42 -0
- package/packages/theme-cypress/package.json +1 -1
- package/packages/theme-ember/agentsam.package.json +42 -0
- package/packages/theme-ember/package.json +1 -1
- package/packages/theme-forge/agentsam.package.json +42 -0
- package/packages/theme-forge/package.json +1 -1
- package/packages/theme-grove/agentsam.package.json +42 -0
- package/packages/theme-grove/package.json +1 -1
- package/packages/theme-harbor/agentsam.package.json +42 -0
- package/packages/theme-harbor/package.json +1 -1
- package/packages/theme-resolve/agentsam.package.json +42 -0
- package/packages/theme-resolve/package.json +1 -1
- package/packages/theme-scenes/agentsam.package.json +42 -0
- package/packages/theme-scenes/package.json +1 -1
- package/packages/theme-summit/agentsam.package.json +42 -0
- package/packages/theme-summit/package.json +1 -1
- package/packages/theme-violet/agentsam.package.json +42 -0
- package/packages/theme-violet/package.json +1 -1
- package/packages/work-graph/agentsam.package.json +42 -0
- package/packages/work-graph/package.json +1 -1
- package/protocol/apps/agentsam.app.v1.schema.json +27 -1
- package/protocol/cad/README.md +77 -0
- package/protocol/cad/cad.project.v2.schema.json +451 -0
- package/protocol/cad/v2/core/artifact-receipt.schema.json +126 -0
- package/protocol/cad/v2/core/coordinate-system.schema.json +364 -0
- package/protocol/cad/v2/core/geometry-constraint.schema.json +136 -0
- package/protocol/cad/v2/core/geometry-entity.schema.json +73 -0
- package/protocol/cad/v2/core/geometry-feature.schema.json +115 -0
- package/protocol/cad/v2/core/geometry-relationship.schema.json +67 -0
- package/protocol/cad/v2/core/project-revision.schema.json +111 -0
- package/protocol/cad/v2/core/topology-reference.schema.json +80 -0
- package/protocol/cad/v2/intent/design-decision.schema.json +126 -0
- package/protocol/cad/v2/intent/design-option.schema.json +88 -0
- package/protocol/cad/v2/interchange/ifc-mapping.schema.json +145 -0
- package/protocol/cad/v2/interchange/native-document.schema.json +130 -0
- package/protocol/cad/v2/interchange/reference-model.schema.json +141 -0
- package/protocol/cad/v2/modules/architecture.v1.schema.json +278 -0
- package/protocol/cad/v2/modules/landscape.v1.schema.json +157 -0
- package/protocol/cad/v2/modules/mechanical.v1.schema.json +325 -0
- package/protocol/cad/v2/modules/parametric.v1.schema.json +89 -0
- package/protocol/cad/v2/modules/product-design.v1.schema.json +178 -0
- package/protocol/cad/v2/modules/robotics.v1.schema.json +246 -0
- package/protocol/cad/v2/presentation/camera-path.schema.json +143 -0
- package/protocol/cad/v2/presentation/drawing.schema.json +162 -0
- package/protocol/cad/v2/presentation/production.schema.json +166 -0
- package/protocol/cad/v2/presentation/scene.schema.json +198 -0
- package/protocol/cad/v2/presentation/sheet.schema.json +254 -0
- package/protocol/cad/v2/presentation/view.schema.json +190 -0
- package/protocol/cad/v2/presentation/walkthrough.schema.json +199 -0
- package/protocol/cad/v2/schema-pack.manifest.json +189 -0
- package/protocol/cad/v2/validation/deliverable-manifest.schema.json +199 -0
- package/protocol/cad/v2/validation/result.schema.json +141 -0
- package/protocol/capabilities/evidence-manifest.schema.json +404 -0
- package/protocol/capabilities/manifest.json +101 -10
- package/protocol/capabilities/repository-crawl-input.schema.json +17 -0
- package/protocol/capabilities/repository-crawl-result.schema.json +79 -0
- package/protocol/capabilities/repository-mine-input.schema.json +27 -0
- package/protocol/capabilities/repository-mine-result.schema.json +51 -0
- package/protocol/capabilities/site-index.schema.json +15 -0
- package/protocol/capabilities/site-scrape-evidence-manifest.schema.json +114 -0
- package/protocol/capabilities/site-scrape-input.schema.json +90 -0
- package/protocol/capabilities/site-scrape-project-authority.schema.json +15 -0
- package/protocol/capabilities/site-scrape-result.schema.json +198 -0
- package/protocol/capabilities/site-scrape-worker-job.schema.json +18 -0
- package/protocol/errors/error-catalog.json +12 -0
- package/protocol/governance/distribution-roadmap.v1.json +335 -0
- package/protocol/governance/github-labels.v1.json +232 -0
- package/protocol/models/workers-ai-curated.mjs +14 -0
- package/protocol/plugins/agentsam.plugin-evidence-bundle.v1.schema.json +55 -0
- package/protocol/plugins/agentsam.plugin-product.v1.schema.json +227 -0
- package/protocol/plugins/agentsam.plugin-quality-evidence.v1.schema.json +47 -0
- package/protocol/plugins/agentsam.plugin-quality-receipt.v1.schema.json +160 -0
- package/protocol/ui/agentsam.ui-quality.v1.schema.json +31 -0
- package/python/agentsam_sdk/__init__.py +4 -0
- package/python/agentsam_sdk/client.py +202 -0
- package/python/agentsam_sdk/errors/vocabulary.py +10 -0
- package/python/tests/test_public_client.py +82 -0
- package/services/cad/blender/adapter.py +0 -0
- package/services/cad/occt/CMakeLists.txt +43 -0
- package/services/cad/occt/README.md +38 -0
- package/services/cad/occt/main.cpp +95 -0
- package/services/cad/server.py +103 -21
- package/skills/README.md +6 -0
- package/skills/agentsam-cad/SKILL.md +59 -0
- package/skills/agentsam-plan-and-goap/SKILL.md +77 -0
- package/skills/agentsam-repo-recon/SKILL.md +63 -0
- package/skills/agentsam-sam-operations/SKILL.md +71 -0
- package/skills/agentsam-sdk-orientation/SKILL.md +75 -0
- package/skills/catalog.json +85 -0
- package/src/AgentSam.js +2 -0
- package/src/agent/capability-adapter.js +207 -9
- package/src/agent/index.js +1 -0
- package/src/agent/intent.js +12 -0
- package/src/agent/project-discovery.js +47 -0
- package/src/agent/project-resources.js +157 -0
- package/src/agent/responses-runner.js +64 -12
- package/src/capabilities/cloudflare-d1-provision.js +48 -0
- package/src/capabilities/knowledge-operations.js +87 -0
- package/src/capabilities/local-sqlite-resources.js +124 -0
- package/src/capabilities/machine-inspect.js +28 -0
- package/src/capabilities/mcp-d1-bridge.js +98 -0
- package/src/capabilities/plan-operation-ids.js +6 -0
- package/src/capabilities/plan-operations.js +85 -0
- package/src/capabilities/repository-awareness.js +52 -0
- package/src/capabilities/test-run.js +10 -0
- package/src/capabilities/workspace-files.js +125 -0
- package/src/cli/command-catalog.js +16 -3
- package/src/cli.js +71 -116
- package/src/commands/app.js +43 -44
- package/src/commands/autorag-node-api.js +96 -0
- package/src/commands/autorag.js +178 -17
- package/src/commands/catalog-doctor.js +52 -0
- package/src/commands/catalog.js +151 -0
- package/src/commands/cheat-sheet.js +92 -63
- package/src/commands/cloudflare.js +64 -2
- package/src/commands/codebaseindex.js +2 -2
- package/src/commands/db.js +17 -0
- package/src/commands/goap-world.js +4 -0
- package/src/commands/interactive.js +21 -1
- package/src/commands/knowledge.js +8 -3
- package/src/commands/machine-binary.js +3 -2
- package/src/commands/machine.js +66 -15
- package/src/commands/mcp.js +98 -8
- package/src/commands/plan-ledger.js +60 -22
- package/src/commands/plan.js +3 -3
- package/src/commands/plugins.js +34 -2
- package/src/commands/product.js +21 -0
- package/src/commands/rust.js +4 -1
- package/src/commands/sam-evidence.js +87 -0
- package/src/commands/sam-media.js +78 -0
- package/src/commands/sam.js +117 -0
- package/src/commands/shell.js +97 -8
- package/src/commands/site-scrape.js +9 -0
- package/src/context/resolve.js +5 -1
- package/src/index.js +13 -0
- package/src/knowledge/d1-schema.js +65 -0
- package/src/knowledge/engine.js +55 -15
- package/src/knowledge/source.js +8 -0
- package/src/knowledge/store-discovery.js +9 -3
- package/src/knowledge/stores/sqlite.js +8 -0
- package/src/knowledge/wrangler-binding-discovery.js +43 -0
- package/src/lib/agent-instructions.js +29 -5
- package/src/lib/auth.js +46 -7
- package/src/lib/cad/delivery-profiles.d.ts +7 -0
- package/src/lib/cad/delivery-profiles.js +122 -0
- package/src/lib/cad/docker-executor.js +1 -1
- package/src/lib/cad/editable-project-contract.js +75 -0
- package/src/lib/cad/index.js +6 -0
- package/src/lib/cad/occt-native-provider.mjs +138 -0
- package/src/lib/cad/openscad.js +13 -1
- package/src/lib/cad/production-operations.d.ts +8 -0
- package/src/lib/cad/production-operations.js +74 -0
- package/src/lib/cad/project-cli.d.ts +1 -1
- package/src/lib/cad/project-contract.js +1 -1
- package/src/lib/cad/project-runtime.d.ts +1 -1
- package/src/lib/cad/project-runtime.js +48 -3
- package/src/lib/cad/project-tools.js +24 -0
- package/src/lib/cad/project-v2.d.ts +48 -0
- package/src/lib/cad/project-v2.js +288 -0
- package/src/lib/cad-docker.js +48 -4
- package/src/lib/dockerize.js +3 -3
- package/src/lib/execution-approvals.js +29 -3
- package/src/local-fs/capability.js +5 -0
- package/src/local-lsp/host.js +2 -0
- package/src/local-pty/server.js +21 -0
- package/src/mcp/client.js +2 -1
- package/src/mcp/oauth-connection.js +109 -0
- package/src/models/inventory-core.js +2 -10
- package/src/plugins/index.js +13 -0
- package/src/plugins/productization.js +348 -0
- package/src/providers/gemini-generate-content.js +18 -0
- package/src/registry/generated/inventory.json +4266 -0
- package/src/registry/index.js +96 -0
- package/src/registry/turn-one.js +45 -0
- package/src/sam/adapters/local-media-store.js +71 -0
- package/src/sam/adapters/local-script-runtime.js +122 -0
- package/src/sam/adapters/local-script-store.js +103 -0
- package/src/sam/adapters/object-media-store.js +89 -0
- package/src/sam/adapters/workspace-media.js +78 -0
- package/src/sam/artifacts/render.js +94 -0
- package/src/sam/bridge/stdio.mjs +59 -0
- package/src/sam/client.js +269 -22
- package/src/sam/index.js +30 -1
- package/src/sam/local-execution.js +8 -0
- package/src/sam/media/environment.js +96 -0
- package/src/sam/model-adapter.js +45 -0
- package/src/sam/operation-packs/generated-v2/background.js +54 -0
- package/src/sam/operation-packs/generated-v2/catalog.js +1746 -0
- package/src/sam/operation-packs/generated-v2/generated-execution-policies.json +401 -0
- package/src/sam/operation-packs/generated-v2/generated-tool-descriptors.json +1352 -0
- package/src/sam/operation-packs/generated-v2/glb.js +41 -0
- package/src/sam/operation-packs/generated-v2/inneranimalmedia-provider.js +24 -0
- package/src/sam/operation-packs/generated-v2/operation-pack.js +126 -0
- package/src/sam/operation-packs/generated-v2/raster.js +140 -0
- package/src/sam/operation-packs/generated-v2/scripts.js +63 -0
- package/src/sam/operation-packs/generated-v2/sdk-adapter.js +9 -0
- package/src/sam/operation-packs/generated-v2/test/alias-runtime.test.mjs +51 -0
- package/src/sam/operation-packs/generated-v2/test/background.test.mjs +19 -0
- package/src/sam/operation-packs/generated-v2/test/glb.test.mjs +19 -0
- package/src/sam/operation-packs/generated-v2/test/raster.test.mjs +38 -0
- package/src/sam/operation-packs/generated-v2/test/real-asset-bindings.test.mjs +74 -0
- package/src/sam/operation-packs/generated-v2/test/registration.test.mjs +65 -0
- package/src/sam/operation-packs/generated-v2/test/scripts.test.mjs +32 -0
- package/src/sam/operation-packs/generated-v2/test/superbash-client-integration.test.mjs +215 -0
- package/src/sam/operation-packs/generated-v2/tool-types.d.ts +53 -0
- package/src/sam/operations/artifact-render.js +13 -0
- package/src/sam/operations/repository-inspect.js +12 -2
- package/src/sam/operations/robotics.js +45 -0
- package/src/sam/os.js +117 -0
- package/src/sam/packs/authoring/README.md +13 -0
- package/src/sam/packs/authoring/index.js +108 -0
- package/src/sam/packs/cad/http-ports.js +55 -0
- package/src/sam/packs/cad/index.js +158 -0
- package/src/sam/packs/cad/model-tools.js +22 -0
- package/src/sam/packs/cad/modes.js +87 -0
- package/src/sam/packs/cms/aliases.js +1 -0
- package/src/sam/packs/cms/contracts.js +1 -0
- package/src/sam/packs/cms/machine.js +6 -0
- package/src/sam/packs/cms/node.js +1 -0
- package/src/sam/packs/core.js +27 -0
- package/src/sam/packs/evidence/README.md +65 -0
- package/src/sam/packs/evidence/compare.js +98 -0
- package/src/sam/packs/evidence/contract.js +56 -0
- package/src/sam/packs/evidence/derive.js +59 -0
- package/src/sam/packs/evidence/driver-blender.js +96 -0
- package/src/sam/packs/evidence/driver-playwright.js +91 -0
- package/src/sam/packs/evidence/exporter-copro.js +70 -0
- package/src/sam/packs/evidence/facts.js +37 -0
- package/src/sam/packs/evidence/host-local.js +74 -0
- package/src/sam/packs/evidence/index.js +494 -0
- package/src/sam/packs/evidence/media.js +44 -0
- package/src/sam/packs/evidence/naming.js +67 -0
- package/src/sam/packs/evidence/normalize.js +117 -0
- package/src/sam/packs/evidence/review-page.js +102 -0
- package/src/sam/packs/evidence/screenplay.js +34 -0
- package/src/sam/packs/evidence/seal.js +55 -0
- package/src/sam/packs/evidence/serve.js +74 -0
- package/src/sam/packs/evidence/store.js +93 -0
- package/src/sam/packs/evidence/viewports.js +23 -0
- package/src/sam/robotics/chess-adapter.js +14 -0
- package/src/sam/robotics/franka.js +44 -0
- package/src/sam/robotics/index.js +4 -0
- package/src/sam/robotics/receipt.js +21 -0
- package/src/sam/robotics/world.js +57 -0
- package/src/sam/seed.js +10 -40
- package/src/sam/shell-host.js +120 -0
- package/src/sam/validation.js +40 -0
- package/src/security/local-vault.js +6 -1
- package/src/ui/cli/help.js +6 -0
- package/templates/clay/clay-blueprint-template.html +481 -0
- package/templates/clay/clay-case-study-blueprint.html +269 -0
- package/templates/clay/conversion-showcase-section.html +534 -0
- package/templates/clay/enhancing-conversion-section.html +141 -0
- package/templates/clay/nuant-wireframe.html +117 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import {defaultConfig} from '../../../../src/knowledge/config.js';
|
|
7
|
+
import {createLocalArchive,verifyLocalArchive} from '../node-storage.mjs';
|
|
8
|
+
import {crawlSite} from '../core.mjs';
|
|
9
|
+
import {runNativeSiteScrape} from '../node-runner.mjs';
|
|
10
|
+
import {resolveProjectSeed,latestProjectArchive} from '../project-site.mjs';
|
|
11
|
+
|
|
12
|
+
async function tempProject(testContext) {
|
|
13
|
+
const root=fs.mkdtempSync(path.join(os.tmpdir(),'agentsam-exact-site-index-'));
|
|
14
|
+
testContext.after(()=>fs.rmSync(root,{recursive:true,force:true}));
|
|
15
|
+
fs.mkdirSync(path.join(root,'.agentsam'));
|
|
16
|
+
const config=defaultConfig({include:['src'],scope:'app'});
|
|
17
|
+
config.embedding={provider:'fixture',model:'fixture-test',revision:'1',dimensions:3,parameters:{}};
|
|
18
|
+
fs.writeFileSync(path.join(root,'.agentsam','knowledge.json'),JSON.stringify(config));
|
|
19
|
+
return root;
|
|
20
|
+
}
|
|
21
|
+
function response(url,body,contentType='text/html'){
|
|
22
|
+
return {url,status:200,body:Buffer.from(body),contentType};
|
|
23
|
+
}
|
|
24
|
+
async function archiveFixture(root) {
|
|
25
|
+
const archive=createLocalArchive({projectRoot:root});
|
|
26
|
+
const receipt=await crawlSite({url:'https://example.com/',maxPages:1,fetchPage:async(url)=>
|
|
27
|
+
url.endsWith('/robots.txt')?response(url,'User-agent: *\nDisallow: /secret','text/plain'):
|
|
28
|
+
response(url,'<html><head><title>Site</title></head><body><h1>Indexed project page</h1></body></html>'),
|
|
29
|
+
onPage:archive.onPage});
|
|
30
|
+
return archive.finalize(receipt);
|
|
31
|
+
}
|
|
32
|
+
async function command(args,cwd) {
|
|
33
|
+
let stdout='',stderr='';
|
|
34
|
+
const code=await runNativeSiteScrape(args,{cwd,stdout:{write:part=>stdout+=part},stderr:{write:part=>stderr+=part}});
|
|
35
|
+
return {code,stdout,stderr,json:()=>JSON.parse(stdout)};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
test('exact `agentsam site index` indexes the latest project archive, not a missing cwd manifest',async t=>{
|
|
39
|
+
const root=await tempProject(t),staged=await archiveFixture(root);
|
|
40
|
+
const result=await command(['index'],root);
|
|
41
|
+
assert.equal(result.code,0,result.stderr);
|
|
42
|
+
assert.equal(result.json().action,'site.index');
|
|
43
|
+
assert.equal(result.json().run_id,staged.manifest.run_id);
|
|
44
|
+
assert.equal(result.json().knowledge.published,true);
|
|
45
|
+
const repeated=await command(['index'],root);
|
|
46
|
+
assert.equal(repeated.code,0,repeated.stderr);
|
|
47
|
+
assert.equal(repeated.json().knowledge.no_change,true);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test('exact `agentsam site index .` treats dot as the project and leaves source unchanged',async t=>{
|
|
51
|
+
const root=await tempProject(t),staged=await archiveFixture(root);
|
|
52
|
+
const result=await command(['index','.'],root);
|
|
53
|
+
assert.equal(result.code,0,result.stderr);
|
|
54
|
+
assert.equal(result.json().project_root,fs.realpathSync(root));
|
|
55
|
+
assert.equal(result.json().run_id,staged.manifest.run_id);
|
|
56
|
+
assert.equal(verifyLocalArchive(staged.root).run_id,staged.manifest.run_id);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test('bare site index without project evidence/site config gives actionable guidance instead of ENOENT',async t=>{
|
|
60
|
+
const root=await tempProject(t);
|
|
61
|
+
const none=await command(['index'],root);
|
|
62
|
+
assert.equal(none.code,2);
|
|
63
|
+
assert.match(none.stderr,/No crawl archive or project site URL/);
|
|
64
|
+
assert.match(none.stderr,/site index https:\/\//);
|
|
65
|
+
assert.doesNotMatch(none.stderr,/ENOENT|manifest.json/);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
test('project Wrangler custom routes determine site seed without hardcoded FNF or ALLOWED_ORIGINS',async t=>{
|
|
69
|
+
const root=await tempProject(t);
|
|
70
|
+
fs.writeFileSync(path.join(root,'wrangler.toml'),`[vars]\nALLOWED_ORIGINS = 'https://api.example.net'\n[[routes]]\npattern = 'www.project-example.com'\ncustom_domain = true\n[[routes]]\npattern = 'project-example.com'\ncustom_domain = true\n`);
|
|
71
|
+
assert.deepEqual(resolveProjectSeed(root),{url:'https://project-example.com/',source:'project-wrangler-custom-domain'});
|
|
72
|
+
const project=path.join(root,'.agentsam','site-scrape.json');
|
|
73
|
+
fs.writeFileSync(project,JSON.stringify({site:{url:'https://other-example.com/start'}}));
|
|
74
|
+
assert.deepEqual(resolveProjectSeed(root),{url:'https://other-example.com/start',source:'project:.agentsam/site-scrape.json'});
|
|
75
|
+
assert.equal(latestProjectArchive(root),null);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
test('graph view is separately named and verified, index is not raw JSON export',async t=>{
|
|
79
|
+
const root=await tempProject(t),archive=await archiveFixture(root);
|
|
80
|
+
const graph=await command(['graph',archive.root],root);
|
|
81
|
+
assert.equal(graph.code,0,graph.stderr);
|
|
82
|
+
assert.equal(graph.json().schema,'agentsam.site.index.v1');
|
|
83
|
+
const verified=await command(['verify',archive.root],root);
|
|
84
|
+
assert.equal(verified.code,0,verified.stderr);
|
|
85
|
+
assert.equal(verified.json().ok,true);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
test('JS-hydrated site uses robots-listed XML sitemap to crawl real public URLs within the page budget',async()=>{
|
|
89
|
+
const fetched=[],observed=[];
|
|
90
|
+
const base='https://example.com/';
|
|
91
|
+
const resources=new Map([
|
|
92
|
+
[base+'robots.txt',{body:'User-agent: *\nDisallow: /admin\nSitemap: https://example.com/sitemap.xml',type:'text/plain'}],
|
|
93
|
+
[base+'sitemap.xml',{body:'<?xml version="1.0"?><urlset><url><loc>https://example.com/</loc></url><url><loc>https://example.com/shop</loc></url><url><loc>https://example.com/products/item</loc></url><url><loc>https://example.com/admin</loc></url></urlset>',type:'application/xml'}],
|
|
94
|
+
[base,{body:'<html><title>Home</title><main id="app"></main></html>',type:'text/html'}],
|
|
95
|
+
[base+'shop',{body:'<html><title>Shop</title><main id="app"></main></html>',type:'text/html'}],
|
|
96
|
+
[base+'products/item',{body:'<html><title>Item</title><main id="app"></main></html>',type:'text/html'}],
|
|
97
|
+
]);
|
|
98
|
+
const fetchPage=async(url)=>{
|
|
99
|
+
fetched.push(url);
|
|
100
|
+
const item=resources.get(url);
|
|
101
|
+
return item?{url,body:Buffer.from(item.body),contentType:item.type,status:200}:
|
|
102
|
+
{url,body:Buffer.from('not found'),contentType:'text/plain',status:404};
|
|
103
|
+
};
|
|
104
|
+
const result=await crawlSite({url:base,maxPages:3,concurrency:2,fetchPage,onPage:page=>observed.push(page)});
|
|
105
|
+
assert.equal(result.counts.pages_fetched,3);
|
|
106
|
+
assert.deepEqual(observed.map(p=>p.url).sort(),[base,base+'shop',base+'products/item'].sort());
|
|
107
|
+
assert.ok(fetched.includes(base+'sitemap.xml'));
|
|
108
|
+
assert.equal(fetched.includes(base+'admin'),false);
|
|
109
|
+
});
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { extractHtml, crawlSite, robotsAllowed } from '../core.mjs';
|
|
7
|
+
import { assertPublicUrl, isPublicAddress, createSecureFetch } from '../secure-fetch.mjs';
|
|
8
|
+
import { resolveProjectStorage, createLocalArchive, verifyLocalArchive } from '../node-storage.mjs';
|
|
9
|
+
import { runNativeSiteScrape } from '../node-runner.mjs';
|
|
10
|
+
|
|
11
|
+
function response(url,body,status=200,contentType='text/html') {
|
|
12
|
+
return {url,status,contentType,body:Buffer.from(body)};
|
|
13
|
+
}
|
|
14
|
+
const site='https://example.com/';
|
|
15
|
+
const mockPages={
|
|
16
|
+
[site]:'<html><head><title>Home</title><meta name="description" content="Test"/></head><body><h1>Welcome</h1><nav><a href="/about">About</a></nav><img src="/hero.png" alt="Hero"></body></html>',
|
|
17
|
+
'https://example.com/about':'<html><title>About</title><h2>Who we are</h2><a href="/">Home</a><a href="https://other.example.net/">Other</a></html>'
|
|
18
|
+
};
|
|
19
|
+
const stub=async (url)=>{
|
|
20
|
+
if(url==='https://example.com/robots.txt')return response(url,'User-agent: *\nDisallow: /secret',200,'text/plain');
|
|
21
|
+
if(url==='https://example.com/hero.png')return response(url,'image-content',200,'image/png');
|
|
22
|
+
if(mockPages[url])return response(url,mockPages[url]);
|
|
23
|
+
return response(url,'not found',404);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
test('parse HTML semantics and deduplicate links/images',()=>{
|
|
27
|
+
const parsed=extractHtml(mockPages[site],site);
|
|
28
|
+
assert.equal(parsed.title,'Home');assert.equal(parsed.meta.description,'Test');
|
|
29
|
+
assert.deepEqual(parsed.links.map(a=>a.url),['https://example.com/about']);
|
|
30
|
+
assert.deepEqual(parsed.images.map(a=>a.url),['https://example.com/hero.png']);
|
|
31
|
+
assert.equal(parsed.content[0].kind,'h1');
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('robots group applies allow before disallow and blocks secret',()=>{
|
|
35
|
+
assert.equal(robotsAllowed('User-agent: *\nDisallow: /private\nAllow: /private/public','https://example.com/private/public'),true);
|
|
36
|
+
assert.equal(robotsAllowed('User-agent: *\nDisallow: /private','https://example.com/private/data'),false);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('crawl is bounded and emits canonical receipt with image evidence callbacks',async()=>{
|
|
40
|
+
const pages=[],assets=[];
|
|
41
|
+
const rec=await crawlSite({url:site,maxPages:2,concurrency:2,captureAssets:true,fetchPage:stub,
|
|
42
|
+
onPage:p=>pages.push(p),onAsset:a=>assets.push(a),clock:()=>1000});
|
|
43
|
+
assert.equal(rec.capability,'site.scrape');assert.equal(rec.status,'completed');
|
|
44
|
+
assert.equal(rec.counts.pages_fetched,2);assert.equal(rec.counts.images_fetched,1);
|
|
45
|
+
assert.equal(pages.length,2);assert.equal(assets.length,1);
|
|
46
|
+
assert.equal(rec.runtime,'node-local');assert.ok(/^sha256:[0-9a-f]{64}$/.test(rec.content_hash));
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('robots is fail-closed when it cannot be fetched',async()=>{
|
|
50
|
+
const rec=await crawlSite({url:site,fetchPage:async()=>{throw Error('network unavailable');}});
|
|
51
|
+
assert.equal(rec.status,'failed');assert.equal(rec.counts.pages_fetched,0);
|
|
52
|
+
assert.equal(rec.errors[0].kind,'blocked');
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test('non-public address, internal host, DNS rebinding targets rejected',()=>{
|
|
56
|
+
for(const ip of ['127.0.0.1','10.2.3.4','192.168.1.2','172.18.1.2','169.254.169.254','100.64.0.1','::1','fd00::1','::ffff:127.0.0.1']){
|
|
57
|
+
assert.equal(isPublicAddress(ip),false,ip);
|
|
58
|
+
}
|
|
59
|
+
for(const value of ['http://localhost/','http://127.0.0.1:4321/','https://metadata.google.internal/','file:///etc/passwd']){
|
|
60
|
+
assert.throws(()=>assertPublicUrl(value));
|
|
61
|
+
}
|
|
62
|
+
assert.equal(isPublicAddress('1.1.1.1'),true);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test('manual redirects refuse leaving the selected site before making second request',async()=>{
|
|
66
|
+
let calls=0;
|
|
67
|
+
const worker=createSecureFetch({seedUrl:site,fetchImpl:async()=>{
|
|
68
|
+
calls++;return {status:301,headers:new Headers({location:'http://127.0.0.1/admin'}),body:{cancel:async()=>{}}};
|
|
69
|
+
}});
|
|
70
|
+
await assert.rejects(worker.fetchPage(site),/blocked non-public IP/);
|
|
71
|
+
assert.equal(calls,1);await worker.close();
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
test('project chooses its own storage; no publisher bucket fallback',()=>{
|
|
75
|
+
const root=fs.mkdtempSync(path.join(os.tmpdir(),'agentsam-project-storage-'));
|
|
76
|
+
try {
|
|
77
|
+
assert.equal(resolveProjectStorage(root).provider,'local');
|
|
78
|
+
fs.writeFileSync(path.join(root,'wrangler.jsonc'),'// mine\n{"r2_buckets":[{"binding":"CRAWL_EVIDENCE","bucket_name":"my-own-crawl-bucket"},{"binding":"WEBSITE_ASSETS","bucket_name":"my-site-assets"}]}');
|
|
79
|
+
assert.equal(resolveProjectStorage(root).bucket,'my-own-crawl-bucket');
|
|
80
|
+
assert.equal(resolveProjectStorage(root,{bucket:'selected-other-bucket'}).bucket,'selected-other-bucket');
|
|
81
|
+
fs.mkdirSync(path.join(root,'.agentsam'));
|
|
82
|
+
fs.writeFileSync(path.join(root,'.agentsam','site-scrape.json'),JSON.stringify({storage:{evidence:{provider:'local'}}}));
|
|
83
|
+
assert.equal(resolveProjectStorage(root).provider,'local');
|
|
84
|
+
}finally{fs.rmSync(root,{recursive:true,force:true});}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test('durable archive checksum protects extracted pages after crawl',async()=>{
|
|
88
|
+
const root=fs.mkdtempSync(path.join(os.tmpdir(),'agentsam-node-crawl-'));
|
|
89
|
+
try {
|
|
90
|
+
const archive=createLocalArchive({projectRoot:root,accountId:'au_testaccount123',projectId:'proj_test123'});
|
|
91
|
+
const receipt=await crawlSite({url:site,maxPages:1,fetchPage:stub,onPage:archive.onPage,onAsset:archive.onAsset});
|
|
92
|
+
const {root:location,manifest}=archive.finalize(receipt);
|
|
93
|
+
assert.equal(verifyLocalArchive(location).objects.length,3);
|
|
94
|
+
assert.match(manifest.prefix,/^v1\/accounts\/au_testaccount123\/projects\/proj_test123\/runs\/scrp_/);
|
|
95
|
+
const index=JSON.parse(fs.readFileSync(path.join(location,'index.json'),'utf8'));
|
|
96
|
+
assert.equal(index.schema,'agentsam.site.index.v1');
|
|
97
|
+
assert.equal(index.counts.pages,1);
|
|
98
|
+
fs.appendFileSync(path.join(location,'pages/00001.json'),'tamper');
|
|
99
|
+
assert.throws(()=>verifyLocalArchive(location),/checksum/);
|
|
100
|
+
}finally{fs.rmSync(root,{recursive:true,force:true});}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
test('remote upload fails closed without project destination or account identity',async()=>{
|
|
104
|
+
const root=fs.mkdtempSync(path.join(os.tmpdir(),'agentsam-node-runner-'));
|
|
105
|
+
try {
|
|
106
|
+
let output='',error='';
|
|
107
|
+
const code=await runNativeSiteScrape(['scrape',site,'--project-root',root,'--upload-archive'],{
|
|
108
|
+
stdout:{write:s=>output+=s},stderr:{write:s=>error+=s},cwd:root});
|
|
109
|
+
assert.equal(code,2);assert.match(error,/authorized account\/project identity/);assert.equal(output,'');
|
|
110
|
+
}finally{fs.rmSync(root,{recursive:true,force:true});}
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
test('native project R2 uploader requires per-project selection and uploads completion marker last',async()=>{
|
|
114
|
+
const { uploadProjectArchive }=await import('../node-storage.mjs');
|
|
115
|
+
const root=fs.mkdtempSync(path.join(os.tmpdir(),'agentsam-project-r2-'));
|
|
116
|
+
try {
|
|
117
|
+
const archive=createLocalArchive({projectRoot:root,accountId:'au_testaccount123',projectId:'proj_test123'});
|
|
118
|
+
const receipt=await crawlSite({url:site,maxPages:1,fetchPage:stub,onPage:archive.onPage});
|
|
119
|
+
const staged=archive.finalize(receipt);
|
|
120
|
+
const written=[];
|
|
121
|
+
const result=await uploadProjectArchive({archiveRoot:staged.root,projectRoot:root,bucket:'my-project-crawls',concurrency:2,
|
|
122
|
+
put:async item=>{written.push(item);}});
|
|
123
|
+
assert.equal(result.bucket,'my-project-crawls');assert.equal(result.uploaded,4);
|
|
124
|
+
assert.match(written.at(-1).key,/\/manifest.json$/);
|
|
125
|
+
assert.ok(written.every(item=>item.bucket==='my-project-crawls'));
|
|
126
|
+
const errorWrites=[];
|
|
127
|
+
await assert.rejects(uploadProjectArchive({archiveRoot:staged.root,projectRoot:root,bucket:'my-project-crawls',
|
|
128
|
+
put:async item=>{errorWrites.push(item);if(item.key.endsWith('/index.json'))throw Error('injected R2 outage');}}),/completion marker NOT uploaded/);
|
|
129
|
+
assert.ok(!errorWrites.some(x=>x.key.endsWith('/manifest.json')));
|
|
130
|
+
}finally{fs.rmSync(root,{recursive:true,force:true});}
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
test('native upload command refuses a resumed archive without user-selected project bucket',async()=>{
|
|
134
|
+
const root=fs.mkdtempSync(path.join(os.tmpdir(),'agentsam-project-resume-'));
|
|
135
|
+
try{
|
|
136
|
+
const archive=createLocalArchive({projectRoot:root,accountId:'au_testaccount123',projectId:'proj_test123'});
|
|
137
|
+
const receipt=await crawlSite({url:site,maxPages:1,fetchPage:stub,onPage:archive.onPage});
|
|
138
|
+
const staged=archive.finalize(receipt);
|
|
139
|
+
let error='';
|
|
140
|
+
const code=await runNativeSiteScrape(['upload',staged.root,'--project-root',root],
|
|
141
|
+
{cwd:root,stdout:{write(){}},stderr:{write:s=>error+=s}});
|
|
142
|
+
assert.equal(code,2);assert.match(error,/no project R2 crawl bucket selected/);
|
|
143
|
+
assert.equal(verifyLocalArchive(staged.root).run_id,receipt.run_id);
|
|
144
|
+
}finally{fs.rmSync(root,{recursive:true,force:true});}
|
|
145
|
+
});
|
|
File without changes
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"""site.scrape receipt contract tests — no network, schema read from protocol/."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import re
|
|
7
|
+
import unittest
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
from types import SimpleNamespace
|
|
10
|
+
|
|
11
|
+
from agentsam_site_scrape.contract import build_result, classify_error
|
|
12
|
+
|
|
13
|
+
SCHEMA_DIR = Path(__file__).resolve().parents[3] / "protocol" / "capabilities"
|
|
14
|
+
RESULT_SCHEMA = json.loads((SCHEMA_DIR / "site-scrape-result.schema.json").read_text())
|
|
15
|
+
INPUT_SCHEMA = json.loads((SCHEMA_DIR / "site-scrape-input.schema.json").read_text())
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _crawl(pages, errors, visited=None):
|
|
19
|
+
return SimpleNamespace(
|
|
20
|
+
seed_urls=["https://example.com/"],
|
|
21
|
+
pages=[SimpleNamespace(url=u, title=t, image_count=n) for u, t, n in pages],
|
|
22
|
+
errors=errors,
|
|
23
|
+
pages_visited=visited if visited is not None else len(pages) + len(errors),
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _build(crawl_result):
|
|
28
|
+
return build_result(
|
|
29
|
+
crawl_result, started_at=1_700_000_000.0, completed_at=1_700_000_005.0,
|
|
30
|
+
scope={"maxPages": 10}, policy={"respectRobots": True}, capture={"assets": False},
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class TestContract(unittest.TestCase):
|
|
35
|
+
def test_schemas_parse_and_ids_follow_convention(self):
|
|
36
|
+
for schema in (RESULT_SCHEMA, INPUT_SCHEMA):
|
|
37
|
+
self.assertTrue(schema["$id"].startswith("https://schemas.inneranimalmedia.com/agentsam/capabilities/"))
|
|
38
|
+
|
|
39
|
+
def test_receipt_has_every_required_key(self):
|
|
40
|
+
r = _build(_crawl([("https://example.com/", "Home", 3)], []))
|
|
41
|
+
for key in RESULT_SCHEMA["required"]:
|
|
42
|
+
self.assertIn(key, r)
|
|
43
|
+
for key in RESULT_SCHEMA["properties"]["counts"]["required"]:
|
|
44
|
+
self.assertIn(key, r["counts"])
|
|
45
|
+
self.assertRegex(r["run_id"], RESULT_SCHEMA["properties"]["run_id"]["pattern"])
|
|
46
|
+
self.assertRegex(r["content_hash"], RESULT_SCHEMA["properties"]["content_hash"]["pattern"])
|
|
47
|
+
json.dumps(r) # serializable
|
|
48
|
+
|
|
49
|
+
def test_status_vocabulary(self):
|
|
50
|
+
allowed = set(RESULT_SCHEMA["properties"]["status"]["enum"])
|
|
51
|
+
ok = _build(_crawl([("https://example.com/", "Home", 0)], []))
|
|
52
|
+
partial = _build(_crawl([("https://example.com/", "Home", 0)], [{"url": "x", "error": "boom"}]))
|
|
53
|
+
failed = _build(_crawl([], [{"url": "x", "error": "blocked_by_robots"}]))
|
|
54
|
+
self.assertEqual([ok["status"], partial["status"], failed["status"]], ["completed", "partial", "failed"])
|
|
55
|
+
self.assertTrue({ok["status"], partial["status"], failed["status"]} <= allowed)
|
|
56
|
+
|
|
57
|
+
def test_error_kinds_and_counts(self):
|
|
58
|
+
errs = [
|
|
59
|
+
{"url": "a", "error": "blocked_by_robots"},
|
|
60
|
+
{"url": "b", "error": "redirect_left_site"},
|
|
61
|
+
{"url": "c", "error": "HTTPError: 500"},
|
|
62
|
+
]
|
|
63
|
+
r = _build(_crawl([("https://example.com/", "Home", 1)], errs, visited=4))
|
|
64
|
+
self.assertEqual([e["kind"] for e in r["errors"]], ["blocked", "skipped", "failed"])
|
|
65
|
+
self.assertEqual(
|
|
66
|
+
r["counts"],
|
|
67
|
+
{"pages_visited": 4, "pages_fetched": 1, "pages_blocked": 1, "pages_skipped": 1, "pages_failed": 1},
|
|
68
|
+
)
|
|
69
|
+
self.assertEqual(classify_error("anything else"), "failed")
|
|
70
|
+
|
|
71
|
+
def test_content_hash_is_order_independent_and_run_id_stable(self):
|
|
72
|
+
a = _build(_crawl([("https://a/", "A", 0), ("https://b/", "B", 0)], []))
|
|
73
|
+
b = _build(_crawl([("https://b/", "B", 0), ("https://a/", "A", 0)], []))
|
|
74
|
+
self.assertEqual(a["content_hash"], b["content_hash"])
|
|
75
|
+
self.assertEqual(a["run_id"], b["run_id"])
|
|
76
|
+
|
|
77
|
+
def test_unsupported_inputs_are_reported_not_hidden(self):
|
|
78
|
+
r = _build(_crawl([("https://example.com/", "Home", 0)], []))
|
|
79
|
+
self.assertIn("scope.maxDepth", r["applied"]["ignored"])
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
if __name__ == "__main__":
|
|
83
|
+
unittest.main()
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"""Unit tests — no network."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import tempfile
|
|
7
|
+
import unittest
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
from agentsam_site_scrape.classify import AssetNamer, aspect_label, classify_section
|
|
11
|
+
from agentsam_site_scrape.htmlparse import parse
|
|
12
|
+
from agentsam_site_scrape.imageops import sniff_image_ext
|
|
13
|
+
from agentsam_site_scrape.pageextract import clean_url, extract_page, page_slug
|
|
14
|
+
from agentsam_site_scrape.ssrf import assert_public_http_url
|
|
15
|
+
from agentsam_site_scrape.wrangler_bucket import resolve_website_assets_bucket
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class TestSsrf(unittest.TestCase):
|
|
19
|
+
def test_allows_public(self):
|
|
20
|
+
assert_public_http_url("https://example.com/path")
|
|
21
|
+
|
|
22
|
+
def test_blocks_localhost(self):
|
|
23
|
+
with self.assertRaises(ValueError):
|
|
24
|
+
assert_public_http_url("http://127.0.0.1/")
|
|
25
|
+
with self.assertRaises(ValueError):
|
|
26
|
+
assert_public_http_url("http://localhost/x")
|
|
27
|
+
|
|
28
|
+
def test_blocks_metadata(self):
|
|
29
|
+
with self.assertRaises(ValueError):
|
|
30
|
+
assert_public_http_url("http://169.254.169.254/latest/meta-data")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class TestHtmlParse(unittest.TestCase):
|
|
34
|
+
def test_nested_text_content(self):
|
|
35
|
+
root = parse("<p>Hello <span>world</span></p>")
|
|
36
|
+
p = root.find_all("p")[0]
|
|
37
|
+
self.assertIn("Hello", p.text_content())
|
|
38
|
+
self.assertIn("world", p.text_content())
|
|
39
|
+
|
|
40
|
+
def test_nav_ancestor_tokens(self):
|
|
41
|
+
root = parse('<nav class="Main-Nav"><a href="/about">About</a></nav>')
|
|
42
|
+
a = root.find_all("a")[0]
|
|
43
|
+
tokens = set(a.ancestor_tokens())
|
|
44
|
+
self.assertIn("nav", tokens)
|
|
45
|
+
self.assertIn("main", tokens)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class TestPageExtract(unittest.TestCase):
|
|
49
|
+
def test_clean_strips_utm(self):
|
|
50
|
+
url = clean_url("https://Example.com/a?utm_source=x&id=1")
|
|
51
|
+
self.assertEqual(url, "https://example.com/a?id=1")
|
|
52
|
+
|
|
53
|
+
def test_page_slug_home(self):
|
|
54
|
+
self.assertEqual(page_slug("https://x.com/"), "home")
|
|
55
|
+
self.assertEqual(page_slug("https://x.com/about-us"), "about-us")
|
|
56
|
+
|
|
57
|
+
def test_nested_paragraph_content(self):
|
|
58
|
+
html = """
|
|
59
|
+
<html><head><title>T</title></head>
|
|
60
|
+
<body><p>Outer <strong>inner</strong> text</p>
|
|
61
|
+
<nav><a href="/about">About</a></nav>
|
|
62
|
+
<div class="hero"><img src="/h.jpg" alt="hero"></div>
|
|
63
|
+
</body></html>
|
|
64
|
+
"""
|
|
65
|
+
page = extract_page(html, "https://example.com/")
|
|
66
|
+
self.assertEqual(page.title, "T")
|
|
67
|
+
self.assertTrue(any("inner" in c["text"] for c in page.content))
|
|
68
|
+
self.assertTrue(any(i.url.endswith("/h.jpg") for i in page.images))
|
|
69
|
+
hero = next(i for i in page.images if i.url.endswith("/h.jpg"))
|
|
70
|
+
self.assertEqual(classify_section(hero.ancestor_context), "hero")
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class TestClassify(unittest.TestCase):
|
|
74
|
+
def test_nav_token_match(self):
|
|
75
|
+
self.assertEqual(classify_section("a nav header"), "nav")
|
|
76
|
+
self.assertEqual(classify_section("div logo brand"), "logo")
|
|
77
|
+
|
|
78
|
+
def test_aspect_16x9(self):
|
|
79
|
+
self.assertEqual(aspect_label(1920, 1080), "16x9")
|
|
80
|
+
|
|
81
|
+
def test_namer_collision(self):
|
|
82
|
+
n = AssetNamer()
|
|
83
|
+
a = n.next("home", "hero", "16x9")
|
|
84
|
+
b = n.next("home", "hero", "16x9")
|
|
85
|
+
self.assertEqual(a.stem(), "home-hero-16x9")
|
|
86
|
+
self.assertEqual(b.stem(), "home-hero-16x9-02")
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class TestSniff(unittest.TestCase):
|
|
90
|
+
def test_png_magic(self):
|
|
91
|
+
data = b"\x89PNG\r\n\x1a\n" + b"\x00" * 20
|
|
92
|
+
self.assertEqual(sniff_image_ext(data), ".png")
|
|
93
|
+
|
|
94
|
+
def test_jpeg_magic(self):
|
|
95
|
+
self.assertEqual(sniff_image_ext(b"\xff\xd8\xff" + b"\x00" * 20), ".jpg")
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
class TestWranglerBucket(unittest.TestCase):
|
|
99
|
+
def test_jsonc_resolve(self):
|
|
100
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
101
|
+
root = Path(tmp)
|
|
102
|
+
(root / "wrangler.jsonc").write_text(
|
|
103
|
+
'{\n // comment\n "r2_buckets": [\n'
|
|
104
|
+
' { "binding": "WEBSITE_ASSETS", "bucket_name": "companionscpas" }\n'
|
|
105
|
+
" ]\n}\n",
|
|
106
|
+
encoding="utf-8",
|
|
107
|
+
)
|
|
108
|
+
self.assertEqual(resolve_website_assets_bucket(root), "companionscpas")
|
|
109
|
+
|
|
110
|
+
def test_missing_fails_loud(self):
|
|
111
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
112
|
+
root = Path(tmp)
|
|
113
|
+
(root / "wrangler.jsonc").write_text(json.dumps({"name": "x"}), encoding="utf-8")
|
|
114
|
+
with self.assertRaises(RuntimeError):
|
|
115
|
+
resolve_website_assets_bucket(root)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
if __name__ == "__main__":
|
|
119
|
+
unittest.main()
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"""Private evidence staging and R2 integration tests (no external writes)."""
|
|
2
|
+
import json
|
|
3
|
+
import tempfile
|
|
4
|
+
import unittest
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from types import SimpleNamespace
|
|
7
|
+
from unittest.mock import patch
|
|
8
|
+
|
|
9
|
+
from agentsam_site_scrape.evidence import (
|
|
10
|
+
evidence_prefix, stage_evidence, upload_evidence, verify_evidence,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
ACCOUNT = 'au_testaccount123'
|
|
14
|
+
PROJECT = 'proj_testproject'
|
|
15
|
+
RUN = 'scrp_' + '1' * 24
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class EvidenceTests(unittest.TestCase):
|
|
19
|
+
def fixture(self, root):
|
|
20
|
+
base = Path(root)
|
|
21
|
+
page = base / 'page.json'
|
|
22
|
+
page.write_text('{"url":"https://example.com"}', encoding='utf-8')
|
|
23
|
+
photo = base / 'hero.png'
|
|
24
|
+
photo.write_bytes(b'png-proof')
|
|
25
|
+
result = SimpleNamespace(
|
|
26
|
+
pages=[SimpleNamespace(url='https://example.com/', json_path=str(page))],
|
|
27
|
+
images=[SimpleNamespace(url='https://example.com/hero.png', ok=True,
|
|
28
|
+
optimized_path=str(photo))],
|
|
29
|
+
)
|
|
30
|
+
receipt = {'run_id': RUN, 'status': 'completed', 'capability': 'site.scrape'}
|
|
31
|
+
return result, receipt
|
|
32
|
+
|
|
33
|
+
def test_keys_have_valid_identity_and_no_path_escape(self):
|
|
34
|
+
self.assertEqual(evidence_prefix(ACCOUNT, PROJECT, RUN),
|
|
35
|
+
'v1/accounts/' + ACCOUNT + '/projects/' + PROJECT + '/runs/' + RUN)
|
|
36
|
+
for invalid in ('../au_admin', 'au_bad/../path', 'au_', 'AU_notvalid'):
|
|
37
|
+
with self.subTest(invalid=invalid), self.assertRaises(ValueError):
|
|
38
|
+
evidence_prefix(invalid, PROJECT, RUN)
|
|
39
|
+
with self.assertRaises(ValueError):
|
|
40
|
+
evidence_prefix(ACCOUNT, 'proj_../../other', RUN)
|
|
41
|
+
|
|
42
|
+
def test_archives_are_private_content_addressed_and_immutable(self):
|
|
43
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
44
|
+
result, receipt = self.fixture(tmp)
|
|
45
|
+
archive = stage_evidence(result, receipt, account_id=ACCOUNT,
|
|
46
|
+
project_id=PROJECT, archive_dir=Path(tmp) / 'archives')
|
|
47
|
+
root = Path(archive['root'])
|
|
48
|
+
manifest = verify_evidence(root)
|
|
49
|
+
self.assertEqual(manifest['visibility'], 'private')
|
|
50
|
+
self.assertEqual(len(manifest['objects']), 4)
|
|
51
|
+
self.assertEqual(sorted(o['key'].split('/')[0] for o in manifest['objects']),
|
|
52
|
+
['assets', 'index.json', 'pages', 'receipt.json'])
|
|
53
|
+
with self.assertRaises(FileExistsError):
|
|
54
|
+
stage_evidence(result, receipt, account_id=ACCOUNT,
|
|
55
|
+
project_id=PROJECT, archive_dir=Path(tmp) / 'archives')
|
|
56
|
+
(root / 'pages/00001.json').write_text('tampered', encoding='utf-8')
|
|
57
|
+
with self.assertRaisesRegex(ValueError, 'checksum mismatch'):
|
|
58
|
+
verify_evidence(root)
|
|
59
|
+
|
|
60
|
+
def test_upload_is_explicit_and_manifest_last(self):
|
|
61
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
62
|
+
result, receipt = self.fixture(tmp)
|
|
63
|
+
archive = stage_evidence(result, receipt, account_id=ACCOUNT,
|
|
64
|
+
project_id=PROJECT, archive_dir=Path(tmp) / 'archives')
|
|
65
|
+
with patch('agentsam_site_scrape.evidence.wrangler_put') as put:
|
|
66
|
+
summary = upload_evidence(archive['root'], bucket='agentsam-crawl-evidence',
|
|
67
|
+
repo_root=Path(tmp))
|
|
68
|
+
self.assertEqual(summary['uploaded'], 5)
|
|
69
|
+
self.assertEqual(put.call_count, 5)
|
|
70
|
+
self.assertTrue(put.call_args.args[2].endswith('/manifest.json'))
|
|
71
|
+
self.assertTrue(all(call.args[5] == 'private, no-store' for call in put.call_args_list))
|
|
72
|
+
with self.assertRaises(ValueError):
|
|
73
|
+
upload_evidence(archive['root'], bucket='../other', repo_root=Path(tmp))
|
|
74
|
+
|
|
75
|
+
def test_failed_remote_object_does_not_upload_commit_marker(self):
|
|
76
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
77
|
+
result, receipt = self.fixture(tmp)
|
|
78
|
+
archive = stage_evidence(result, receipt, account_id=ACCOUNT,
|
|
79
|
+
project_id=PROJECT, archive_dir=Path(tmp) / 'archives')
|
|
80
|
+
with patch('agentsam_site_scrape.evidence.wrangler_put', side_effect=RuntimeError('network unavailable')) as put:
|
|
81
|
+
with self.assertRaisesRegex(RuntimeError, 'network unavailable'):
|
|
82
|
+
upload_evidence(archive['root'], bucket='agentsam-crawl-evidence', repo_root=Path(tmp))
|
|
83
|
+
self.assertEqual(put.call_count, 1)
|
|
84
|
+
self.assertFalse(put.call_args.args[2].endswith('/manifest.json'))
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
if __name__ == '__main__':
|
|
88
|
+
unittest.main()
|