@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,310 @@
|
|
|
1
|
+
import { projectCmsSections } from "./cms-structure.js";
|
|
2
|
+
|
|
3
|
+
const script = document.querySelector('script[type="module"][src$="/js/page-composer.js"]');
|
|
4
|
+
const presetId = script?.dataset.preset;
|
|
5
|
+
const pageId = script?.dataset.page;
|
|
6
|
+
const root = document.getElementById("heuristic-page");
|
|
7
|
+
|
|
8
|
+
function fail(message) {
|
|
9
|
+
throw new Error(`[Heuristic] ${message}`);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function escapeHtml(value) {
|
|
13
|
+
return String(value ?? "")
|
|
14
|
+
.replaceAll("&", "&")
|
|
15
|
+
.replaceAll("<", "<")
|
|
16
|
+
.replaceAll(">", ">")
|
|
17
|
+
.replaceAll('"', """)
|
|
18
|
+
.replaceAll("'", "'");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function safeHref(value) {
|
|
22
|
+
const href = String(value ?? "").trim();
|
|
23
|
+
if (!href) return fail("invalid link: empty");
|
|
24
|
+
if (href.startsWith("#") || /^https:\/\//i.test(href)) {
|
|
25
|
+
return escapeHtml(href);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Normalize same-origin legacy/static CMS links such as "./shop.html" to
|
|
29
|
+
// the canonical storefront route. Old published CMS data must not be able
|
|
30
|
+
// to blank the entire composed page just because it predates clean routes.
|
|
31
|
+
try {
|
|
32
|
+
const url = new URL(href, location.origin + "/");
|
|
33
|
+
if (url.origin !== location.origin) return fail(`invalid link: ${href}`);
|
|
34
|
+
let pathname = url.pathname || "/";
|
|
35
|
+
pathname = pathname === "/index.html" ? "/" : pathname.replace(/\.html$/i, "");
|
|
36
|
+
return escapeHtml(`${pathname}${url.search}${url.hash}`);
|
|
37
|
+
} catch {
|
|
38
|
+
return fail(`invalid link: ${href}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async function requiredJson(url) {
|
|
43
|
+
const response = await fetch(url, { headers: { accept: "application/json" } });
|
|
44
|
+
if (!response.ok) fail(`${url} returned ${response.status}`);
|
|
45
|
+
return response.json();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function requiredString(object, key, context) {
|
|
49
|
+
const value = object?.[key];
|
|
50
|
+
if (typeof value !== "string" || !value.trim()) fail(`${context}.${key} is required`);
|
|
51
|
+
return value.trim();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function requiredBlock(section, type) {
|
|
55
|
+
const block = section.blocks.find((entry) => entry.type === type && entry.visibility?.enabled !== false);
|
|
56
|
+
if (!block) fail(`${section.id} requires block ${type}`);
|
|
57
|
+
return block;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function requiredAsset(assets, key) {
|
|
61
|
+
const value = assets[key];
|
|
62
|
+
if (!value) fail(`asset ${key} is not declared by the preset`);
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function applyTokens(tokens) {
|
|
67
|
+
if (tokens.scope !== "fnf") fail("token scope must be fnf");
|
|
68
|
+
const map = {
|
|
69
|
+
canvas: "--h-color-canvas",
|
|
70
|
+
surface: "--h-color-surface",
|
|
71
|
+
surfaceRaised: "--h-color-surface-raised",
|
|
72
|
+
ink: "--h-color-ink",
|
|
73
|
+
muted: "--h-color-muted",
|
|
74
|
+
line: "--h-color-line",
|
|
75
|
+
accent: "--h-color-accent",
|
|
76
|
+
accentSoft: "--h-color-accent-soft",
|
|
77
|
+
positive: "--h-color-positive",
|
|
78
|
+
};
|
|
79
|
+
for (const [key, variable] of Object.entries(map)) {
|
|
80
|
+
const value = tokens.color?.[key];
|
|
81
|
+
if (!value) fail(`token color.${key} is required`);
|
|
82
|
+
document.documentElement.style.setProperty(variable, value);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function applyCmsContent(section, content) {
|
|
87
|
+
if (!content) fail(`CMS section ${section.cmsKey} is required`);
|
|
88
|
+
const block = (type) => requiredBlock(section, type);
|
|
89
|
+
const templateKey = section.cmsTemplateKey || section.cmsKey;
|
|
90
|
+
|
|
91
|
+
switch (templateKey) {
|
|
92
|
+
case "hero": {
|
|
93
|
+
block("copy.display").content = {
|
|
94
|
+
eyebrow: "The Earned Hours Collection",
|
|
95
|
+
title: `${requiredString(content, "titleLine1", "home.hero")} ${requiredString(content, "titleLine2", "home.hero")}`,
|
|
96
|
+
body: requiredString(content, "subheadline", "home.hero"),
|
|
97
|
+
};
|
|
98
|
+
block("actions.group").content = {
|
|
99
|
+
primary: {
|
|
100
|
+
label: requiredString(content, "ctaLabel", "home.hero"),
|
|
101
|
+
href: requiredString(content, "ctaHref", "home.hero"),
|
|
102
|
+
},
|
|
103
|
+
secondary: { label: "Explore collections", href: "/shop/collections" },
|
|
104
|
+
};
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
case "manifesto": {
|
|
108
|
+
block("copy.display").content.title = `${requiredString(content, "line1", "home.manifesto")} ${requiredString(content, "highlight1", "home.manifesto")} ${requiredString(content, "line2", "home.manifesto")} ${requiredString(content, "highlight2", "home.manifesto")}`;
|
|
109
|
+
block("copy.rich").content.paragraphs = [
|
|
110
|
+
requiredString(content, "body1", "home.manifesto"),
|
|
111
|
+
requiredString(content, "body2", "home.manifesto"),
|
|
112
|
+
requiredString(content, "body3", "home.manifesto"),
|
|
113
|
+
];
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
case "collections": {
|
|
117
|
+
block("copy.section-heading").content = {
|
|
118
|
+
eyebrow: requiredString(content, "badge", "home.collections"),
|
|
119
|
+
title: requiredString(content, "title", "home.collections"),
|
|
120
|
+
};
|
|
121
|
+
["card1", "card2", "card3"].forEach((key, index) => {
|
|
122
|
+
const card = content[key];
|
|
123
|
+
if (!card) fail(`home.collections.${key} is required`);
|
|
124
|
+
const target = section.blocks.filter((entry) => entry.type === "collection.card")[index];
|
|
125
|
+
target.content = {
|
|
126
|
+
...target.content,
|
|
127
|
+
title: requiredString(card, "name", `home.collections.${key}`),
|
|
128
|
+
body: requiredString(card, "description", `home.collections.${key}`),
|
|
129
|
+
href: requiredString(card, "href", `home.collections.${key}`),
|
|
130
|
+
};
|
|
131
|
+
});
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
case "values": {
|
|
135
|
+
block("copy.section-heading").content.title = requiredString(content, "title", "home.values");
|
|
136
|
+
["v1", "v2", "v3"].forEach((key, index) => {
|
|
137
|
+
const value = content[key];
|
|
138
|
+
if (!value) fail(`home.values.${key} is required`);
|
|
139
|
+
const target = section.blocks.filter((entry) => entry.type === "feature.card")[index];
|
|
140
|
+
target.content = {
|
|
141
|
+
title: requiredString(value, "title", `home.values.${key}`),
|
|
142
|
+
body: requiredString(value, "description", `home.values.${key}`),
|
|
143
|
+
};
|
|
144
|
+
});
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
case "community": {
|
|
148
|
+
block("copy.display").content = {
|
|
149
|
+
title: requiredString(content, "title", "home.community"),
|
|
150
|
+
body: requiredString(content, "subtitle", "home.community"),
|
|
151
|
+
};
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
case "newsletter": {
|
|
155
|
+
block("copy.section-heading").content = {
|
|
156
|
+
title: requiredString(content, "title", "home.newsletter"),
|
|
157
|
+
body: requiredString(content, "text", "home.newsletter"),
|
|
158
|
+
};
|
|
159
|
+
block("form.email").content.buttonLabel = requiredString(content, "buttonLabel", "home.newsletter");
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
default:
|
|
163
|
+
fail(`no CMS adapter exists for ${section.cmsKey}`);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function actionMarkup(action, className = "h-button") {
|
|
168
|
+
return `<a class="${className}" href="${safeHref(action.href)}">${escapeHtml(action.label)} <span aria-hidden="true">→</span></a>`;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function renderHero(section, assets) {
|
|
172
|
+
const copy = requiredBlock(section, "copy.display").content;
|
|
173
|
+
const actions = requiredBlock(section, "actions.group").content;
|
|
174
|
+
const media = requiredBlock(section, "media.image").content;
|
|
175
|
+
const image = requiredAsset(assets, media.asset);
|
|
176
|
+
return `<section class="hc-section hc-hero" data-h-section="${escapeHtml(section.id)}" data-h-header-mode="${escapeHtml(section.appearance.headerMode)}">
|
|
177
|
+
<img class="hc-hero__media" src="${escapeHtml(image)}" alt="${escapeHtml(media.alt)}">
|
|
178
|
+
<div class="hc-hero__shade"></div>
|
|
179
|
+
<div class="h-container hc-hero__content">
|
|
180
|
+
<p class="h-eyebrow">${escapeHtml(copy.eyebrow)}</p>
|
|
181
|
+
<h1 class="h-display">${escapeHtml(copy.title)}</h1>
|
|
182
|
+
<p class="hc-lede">${escapeHtml(copy.body)}</p>
|
|
183
|
+
<div class="hc-actions">${actionMarkup(actions.primary)}${actionMarkup(actions.secondary, "h-button h-button--ghost")}</div>
|
|
184
|
+
<div class="hc-proof" aria-label="Store promises"><span>Secure checkout</span><span>Small-batch drops</span><span>Earned in Louisiana</span></div>
|
|
185
|
+
</div>
|
|
186
|
+
</section>`;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function renderStory(section, assets) {
|
|
190
|
+
const title = requiredBlock(section, "copy.display").content.title;
|
|
191
|
+
const paragraphs = requiredBlock(section, "copy.rich").content.paragraphs;
|
|
192
|
+
const media = requiredBlock(section, "media.image").content;
|
|
193
|
+
return `<section class="hc-section hc-story" data-h-section="${escapeHtml(section.id)}">
|
|
194
|
+
<div class="h-container hc-story__grid">
|
|
195
|
+
<div><p class="h-eyebrow">The point of view</p><h2 class="h-display hc-display--medium">${escapeHtml(title)}</h2></div>
|
|
196
|
+
<div class="hc-story__body">${paragraphs.map((text, index) => `<p class="${index === paragraphs.length - 1 ? "is-emphasis" : ""}">${escapeHtml(text)}</p>`).join("")}</div>
|
|
197
|
+
<img class="hc-story__media" src="${escapeHtml(requiredAsset(assets, media.asset))}" alt="${escapeHtml(media.alt)}" loading="lazy">
|
|
198
|
+
</div>
|
|
199
|
+
</section>`;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function renderCollections(section, assets) {
|
|
203
|
+
const heading = requiredBlock(section, "copy.section-heading").content;
|
|
204
|
+
const cards = section.blocks.filter((block) => block.type === "collection.card" && block.visibility?.enabled !== false);
|
|
205
|
+
if (!cards.length) fail(`${section.id} requires collection cards`);
|
|
206
|
+
return `<section class="hc-section hc-collections" data-h-section="${escapeHtml(section.id)}">
|
|
207
|
+
<div class="h-container"><p class="h-eyebrow">${escapeHtml(heading.eyebrow)}</p><h2 class="h-display hc-display--medium">${escapeHtml(heading.title)}</h2>
|
|
208
|
+
<div class="hc-collection-grid">${cards.map((card) => `<a class="hc-collection-card" href="${safeHref(card.content.href)}"><img src="${escapeHtml(requiredAsset(assets, card.content.asset))}" alt="" loading="lazy"><span><strong>${escapeHtml(card.content.title)}</strong><small>${escapeHtml(card.content.body)}</small></span></a>`).join("")}</div>
|
|
209
|
+
</div>
|
|
210
|
+
</section>`;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function renderFeatures(section) {
|
|
214
|
+
const heading = requiredBlock(section, "copy.section-heading").content;
|
|
215
|
+
const cards = section.blocks.filter((block) => block.type === "feature.card" && block.visibility?.enabled !== false);
|
|
216
|
+
return `<section class="hc-section hc-values" data-h-section="${escapeHtml(section.id)}"><div class="h-container"><h2 class="h-display hc-display--medium">${escapeHtml(heading.title)}</h2><div class="hc-value-grid">${cards.map((card, index) => `<article><span>0${index + 1}</span><h3>${escapeHtml(card.content.title)}</h3><p>${escapeHtml(card.content.body)}</p></article>`).join("")}</div></div></section>`;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function renderCommunity(section) {
|
|
220
|
+
const copy = requiredBlock(section, "copy.display").content;
|
|
221
|
+
const action = requiredBlock(section, "actions.group").content.primary;
|
|
222
|
+
return `<section class="hc-section hc-community" data-h-section="${escapeHtml(section.id)}"><div class="h-container hc-community__inner"><div><p class="h-eyebrow">Beyond the product</p><h2 class="h-display hc-display--medium">${escapeHtml(copy.title)}</h2><p class="hc-lede">${escapeHtml(copy.body)}</p></div>${actionMarkup(action)}</div></section>`;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function renderNewsletter(section) {
|
|
226
|
+
const copy = requiredBlock(section, "copy.section-heading").content;
|
|
227
|
+
const form = requiredBlock(section, "form.email").content;
|
|
228
|
+
return `<section class="hc-section hc-newsletter" data-h-section="${escapeHtml(section.id)}"><div class="h-container hc-newsletter__inner"><div><p class="h-eyebrow">First access</p><h2>${escapeHtml(copy.title)}</h2><p>${escapeHtml(copy.body)}</p></div><form action="/api/newsletter" method="post"><label class="sr-only" for="hc-email">Email address</label><input id="hc-email" name="email" type="email" required placeholder="${escapeHtml(form.placeholder)}"><button type="submit">${escapeHtml(form.buttonLabel)}</button></form></div></section>`;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const renderers = new Map([
|
|
232
|
+
["hero.editorial", renderHero],
|
|
233
|
+
["story.immersive", renderStory],
|
|
234
|
+
["collections.lineup", renderCollections],
|
|
235
|
+
["content.feature-grid", renderFeatures],
|
|
236
|
+
["community.callout", renderCommunity],
|
|
237
|
+
["newsletter.signup", renderNewsletter],
|
|
238
|
+
]);
|
|
239
|
+
|
|
240
|
+
async function compose() {
|
|
241
|
+
if (!root || !presetId || !pageId) fail("composer mount, preset, and page are required");
|
|
242
|
+
const base = `/theme/presets/${encodeURIComponent(presetId)}`;
|
|
243
|
+
const preset = await requiredJson(`${base}/preset.json`);
|
|
244
|
+
if (preset.id !== presetId || preset.scope !== "fnf") fail("requested preset identity does not match");
|
|
245
|
+
const pagePath = preset.pages?.[pageId];
|
|
246
|
+
if (!pagePath) fail(`page ${pageId} is not declared by preset ${presetId}`);
|
|
247
|
+
|
|
248
|
+
// The same native section code renders selected donor designs on Home and
|
|
249
|
+
// every other storefront page. No alternate preview markup path.
|
|
250
|
+
await import('/js/portable-sections.js');
|
|
251
|
+
if (!document.querySelector('link[data-portable-sections]')) {
|
|
252
|
+
const link = document.createElement('link');
|
|
253
|
+
link.rel = 'stylesheet';
|
|
254
|
+
link.href = '/js/portable-sections.css';
|
|
255
|
+
link.dataset.portableSections = 'true';
|
|
256
|
+
document.head.appendChild(link);
|
|
257
|
+
}
|
|
258
|
+
const cmsPreview = new URLSearchParams(location.search).has('preview') ? '?preview=1' : '';
|
|
259
|
+
const [tokens, assets, page, cmsResponse] = await Promise.all([
|
|
260
|
+
requiredJson(`${base}/${preset.tokens.replace(/^\.\//, "")}`),
|
|
261
|
+
requiredJson(`${base}/${preset.assets.replace(/^\.\//, "")}`),
|
|
262
|
+
requiredJson(`${base}/${pagePath.replace(/^\.\//, "")}`),
|
|
263
|
+
requiredJson(`/api/cms/pages/${encodeURIComponent(pageId)}${cmsPreview}`),
|
|
264
|
+
]);
|
|
265
|
+
|
|
266
|
+
if (!cmsResponse?.ok || !cmsResponse.page) fail(`CMS page ${pageId} is required`);
|
|
267
|
+
if (!Array.isArray(cmsResponse.page.sections)) fail("CMS page sections are required");
|
|
268
|
+
applyTokens(tokens);
|
|
269
|
+
|
|
270
|
+
const composedSections = projectCmsSections(page.sections, cmsResponse.page.sections, {
|
|
271
|
+
onUnregistered: (cmsSection, templateKey) => {
|
|
272
|
+
console.warn(
|
|
273
|
+
`[Heuristic] ignoring legacy CMS section ${cmsSection.key}; preset template ${templateKey} is not registered`
|
|
274
|
+
);
|
|
275
|
+
},
|
|
276
|
+
});
|
|
277
|
+
const native = new Map(composedSections.map((section) => [section.cmsKey, section]));
|
|
278
|
+
const seen = new Set();
|
|
279
|
+
const renderNative = (section) => {
|
|
280
|
+
if (section.visibility?.enabled === false) return "";
|
|
281
|
+
applyCmsContent(section, section.cmsContent);
|
|
282
|
+
const renderer = renderers.get(section.type);
|
|
283
|
+
if (!renderer) fail(`renderer ${section.type} is not registered`);
|
|
284
|
+
return renderer(section, assets);
|
|
285
|
+
};
|
|
286
|
+
const body = cmsResponse.page.sections.slice()
|
|
287
|
+
.sort((a, b) => Number(a.sort_order || 0) - Number(b.sort_order || 0))
|
|
288
|
+
.map((section) => {
|
|
289
|
+
if (section.status === 'removed') return '';
|
|
290
|
+
if (section.content?.__editor?.templateKey === 'portable') {
|
|
291
|
+
// The registered portable implementation is rendered from live CMS content,
|
|
292
|
+
// not cloned into a fake local preview.
|
|
293
|
+
return globalThis.ThemePortableSections.render(section) || '';
|
|
294
|
+
}
|
|
295
|
+
const def = native.get(section.key);
|
|
296
|
+
if (!def) return '';
|
|
297
|
+
seen.add(section.key);
|
|
298
|
+
return renderNative(def);
|
|
299
|
+
});
|
|
300
|
+
for (const section of composedSections) {
|
|
301
|
+
if (!seen.has(section.cmsKey)) body.push(renderNative(section));
|
|
302
|
+
}
|
|
303
|
+
root.innerHTML = body.join("");
|
|
304
|
+
document.dispatchEvent(new CustomEvent("heuristic:page-composed", { detail: { presetId, pageId } }));
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
compose().catch((error) => {
|
|
308
|
+
console.error(error);
|
|
309
|
+
if (root) root.innerHTML = `<section class="hc-compose-error" role="alert"><strong>Page composition failed.</strong><span>${escapeHtml(error.message)}</span></section>`;
|
|
310
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
(function () {
|
|
2
|
+
const hero = document.getElementById("fnfShopHero");
|
|
3
|
+
const mv = document.getElementById("fnfShopMV");
|
|
4
|
+
const glbWrap = document.querySelector(".fnf-shop-glb");
|
|
5
|
+
const parallaxLayers = hero ? hero.querySelectorAll("[data-parallax-speed]") : [];
|
|
6
|
+
|
|
7
|
+
const GLB_SRC = "/media/3d-models/emblem-of-elegance.glb";
|
|
8
|
+
const prefersReduce = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
9
|
+
|
|
10
|
+
if (mv && mv.getAttribute("src") !== GLB_SRC) {
|
|
11
|
+
mv.setAttribute("src", GLB_SRC);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let heroProgress = 0;
|
|
15
|
+
let smoothProgress = 0;
|
|
16
|
+
let ticking = false;
|
|
17
|
+
|
|
18
|
+
function heroScrollProgress() {
|
|
19
|
+
if (!hero) return 0;
|
|
20
|
+
const rect = hero.getBoundingClientRect();
|
|
21
|
+
const total = Math.max(hero.offsetHeight - window.innerHeight * 0.35, 1);
|
|
22
|
+
const scrolled = Math.min(Math.max(-rect.top, 0), total);
|
|
23
|
+
return scrolled / total;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function updateParallax(progress) {
|
|
27
|
+
parallaxLayers.forEach((layer) => {
|
|
28
|
+
const speed = parseFloat(layer.dataset.parallaxSpeed || "0.2");
|
|
29
|
+
const y = progress * speed * 120;
|
|
30
|
+
layer.style.transform = `translate3d(0, ${y.toFixed(2)}px, 0) scale(1.06)`;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function updateGlb(progress) {
|
|
35
|
+
if (!mv || prefersReduce) return;
|
|
36
|
+
|
|
37
|
+
const theta = 42 + progress * 28;
|
|
38
|
+
const phi = 62 - progress * 10;
|
|
39
|
+
const radius = 112 - progress * 6;
|
|
40
|
+
|
|
41
|
+
mv.cameraOrbit = `${theta.toFixed(2)}deg ${phi.toFixed(2)}deg ${radius.toFixed(1)}%`;
|
|
42
|
+
|
|
43
|
+
if (glbWrap) {
|
|
44
|
+
const lift = progress * -22;
|
|
45
|
+
const scale = 1 + progress * 0.025;
|
|
46
|
+
glbWrap.style.transform = `translate3d(0, ${lift.toFixed(2)}px, 0) scale(${scale.toFixed(4)})`;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function updateHeaderTone() {
|
|
51
|
+
if (!hero) return;
|
|
52
|
+
const inHero = hero.getBoundingClientRect().bottom > window.innerHeight * 0.42;
|
|
53
|
+
document.body.classList.toggle("fnf-shop-at-hero", inHero);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function frame() {
|
|
57
|
+
heroProgress = heroScrollProgress();
|
|
58
|
+
smoothProgress += (heroProgress - smoothProgress) * 0.12;
|
|
59
|
+
|
|
60
|
+
updateParallax(smoothProgress);
|
|
61
|
+
updateGlb(smoothProgress);
|
|
62
|
+
updateHeaderTone();
|
|
63
|
+
|
|
64
|
+
ticking = false;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function onScroll() {
|
|
68
|
+
if (!ticking) {
|
|
69
|
+
requestAnimationFrame(frame);
|
|
70
|
+
ticking = true;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (hero) {
|
|
75
|
+
window.addEventListener("scroll", onScroll, { passive: true });
|
|
76
|
+
window.addEventListener("resize", onScroll, { passive: true });
|
|
77
|
+
frame();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (mv) {
|
|
81
|
+
mv.addEventListener("load", () => {
|
|
82
|
+
if (!prefersReduce) mv.cameraOrbit = "42deg 62deg 112%";
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
})();
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
(function () {
|
|
2
|
+
const CART_KEY = "fnf_cart";
|
|
3
|
+
const DISCOUNT_KEY = "fnf_discount";
|
|
4
|
+
|
|
5
|
+
const CART_SVG = `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M6 6h15l-1.5 9h-12z"/><path d="M6 6 5 3H2"/><circle cx="9" cy="20" r="1.5"/><circle cx="18" cy="20" r="1.5"/></svg>`;
|
|
6
|
+
|
|
7
|
+
function money(cents) {
|
|
8
|
+
return "$" + (Number(cents) / 100).toFixed(2);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function getCart() {
|
|
12
|
+
return window.FNF_STORE?.getCart() || JSON.parse(localStorage.getItem(CART_KEY) || "[]");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function getDiscount() {
|
|
16
|
+
try {
|
|
17
|
+
return JSON.parse(localStorage.getItem(DISCOUNT_KEY) || "null");
|
|
18
|
+
} catch {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function setDiscount(data) {
|
|
24
|
+
if (!data) localStorage.removeItem(DISCOUNT_KEY);
|
|
25
|
+
else localStorage.setItem(DISCOUNT_KEY, JSON.stringify(data));
|
|
26
|
+
renderTotals(getCart());
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function setCart(items) {
|
|
30
|
+
if (window.FNF_STORE) window.FNF_STORE.setCart(items);
|
|
31
|
+
else localStorage.setItem(CART_KEY, JSON.stringify(items));
|
|
32
|
+
render();
|
|
33
|
+
updateBadge();
|
|
34
|
+
window.FNF_SHELL?.updateCartBadge?.();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function updateBadge() {
|
|
38
|
+
const cart = getCart();
|
|
39
|
+
const n = cart.reduce((sum, i) => sum + i.qty, 0);
|
|
40
|
+
document.querySelectorAll("[data-cart-count]").forEach((el) => {
|
|
41
|
+
el.textContent = String(n);
|
|
42
|
+
el.hidden = n === 0;
|
|
43
|
+
});
|
|
44
|
+
const countEl = document.getElementById("cart-item-count");
|
|
45
|
+
if (countEl) {
|
|
46
|
+
countEl.textContent = n === 1 ? "1 item" : `${n} items`;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function renderCheckoutLines(cart) {
|
|
51
|
+
const lines = document.getElementById("checkout-lines");
|
|
52
|
+
if (!lines) return;
|
|
53
|
+
lines.innerHTML = cart
|
|
54
|
+
.map(
|
|
55
|
+
(item) =>
|
|
56
|
+
`<div class="checkout-line"><span>${item.qty}× ${item.title}${item.size ? " · " + item.size : ""}</span><strong>${money((item.price_cents || 0) * item.qty)}</strong></div>`
|
|
57
|
+
)
|
|
58
|
+
.join("");
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function renderTotals(cart) {
|
|
62
|
+
const subtotal = cart.reduce((sum, item) => sum + (item.price_cents || 0) * item.qty, 0);
|
|
63
|
+
const shippingGoal = 7500;
|
|
64
|
+
const discount = getDiscount();
|
|
65
|
+
const discountCents = discount?.discount_cents || 0;
|
|
66
|
+
const total = Math.max(0, subtotal - discountCents);
|
|
67
|
+
|
|
68
|
+
const subtotalRow = document.getElementById("checkout-subtotal-row");
|
|
69
|
+
const discountRow = document.getElementById("checkout-discount-row");
|
|
70
|
+
const subtotalEl = document.getElementById("cart-subtotal");
|
|
71
|
+
const discountEl = document.getElementById("cart-discount");
|
|
72
|
+
const totalEl = document.getElementById("cart-total");
|
|
73
|
+
|
|
74
|
+
if (subtotalRow) subtotalRow.hidden = !discount || discountCents <= 0;
|
|
75
|
+
if (discountRow) discountRow.hidden = !discount || discountCents <= 0;
|
|
76
|
+
if (subtotalEl) subtotalEl.textContent = money(subtotal);
|
|
77
|
+
if (discountEl) discountEl.textContent = "−" + money(discountCents);
|
|
78
|
+
if (totalEl) totalEl.textContent = money(total);
|
|
79
|
+
|
|
80
|
+
const progress = document.getElementById("cart-progress");
|
|
81
|
+
const progressBar = document.getElementById("cart-progress-bar");
|
|
82
|
+
const progressLabel = document.getElementById("cart-progress-label");
|
|
83
|
+
const progressValue = document.getElementById("cart-progress-value");
|
|
84
|
+
if (progress) progress.hidden = cart.length === 0;
|
|
85
|
+
if (progressBar) progressBar.style.width = `${Math.min(100, (subtotal / shippingGoal) * 100)}%`;
|
|
86
|
+
if (progressLabel) progressLabel.textContent = subtotal >= shippingGoal ? "Shipping milestone unlocked." : "Build your order toward complimentary shipping.";
|
|
87
|
+
if (progressValue) progressValue.textContent = subtotal >= shippingGoal ? "Ready" : `${money(shippingGoal - subtotal)} to go`;
|
|
88
|
+
|
|
89
|
+
const codeInput = document.getElementById("checkout-discount");
|
|
90
|
+
const msg = document.getElementById("checkout-discount-msg");
|
|
91
|
+
if (codeInput && discount?.code && !codeInput.value) codeInput.value = discount.code;
|
|
92
|
+
if (msg && discount?.message) {
|
|
93
|
+
msg.textContent = discount.message;
|
|
94
|
+
msg.className = "checkout-promo-msg ok";
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function render() {
|
|
99
|
+
const root = document.getElementById("cart-root");
|
|
100
|
+
const form = document.getElementById("checkout-form");
|
|
101
|
+
if (!root) return;
|
|
102
|
+
|
|
103
|
+
const cart = getCart();
|
|
104
|
+
updateBadge();
|
|
105
|
+
|
|
106
|
+
if (!cart.length) {
|
|
107
|
+
root.innerHTML = `
|
|
108
|
+
<div class="cart-empty">
|
|
109
|
+
<div class="cart-empty-icon">${CART_SVG}</div>
|
|
110
|
+
<h2>Your cart is empty</h2>
|
|
111
|
+
<p>Add something from the shop — your picks stay saved on this device until checkout.</p>
|
|
112
|
+
<a class="store-btn" href="/shop">Browse the shop</a>
|
|
113
|
+
</div>`;
|
|
114
|
+
if (form) form.hidden = true;
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (form) form.hidden = false;
|
|
119
|
+
let total = 0;
|
|
120
|
+
root.innerHTML = cart
|
|
121
|
+
.map((item, idx) => {
|
|
122
|
+
const line = (item.price_cents || 0) * item.qty;
|
|
123
|
+
total += line;
|
|
124
|
+
const productHref = item.slug ? `/products/${item.slug}` : "/shop";
|
|
125
|
+
return `
|
|
126
|
+
<article class="cart-line" data-idx="${idx}" data-h-product="${item.slug || item.product_id || ""}">
|
|
127
|
+
<a href="${productHref}"><img src="${item.image || ""}" alt=""></a>
|
|
128
|
+
<div class="cart-line-body">
|
|
129
|
+
<h2><a href="${productHref}">${item.title}</a></h2>
|
|
130
|
+
<p class="cart-line-meta">${item.size ? "Size " + item.size : "One size"} · ${money(item.price_cents)} each</p>
|
|
131
|
+
<div class="cart-qty">
|
|
132
|
+
<button type="button" data-dec aria-label="Decrease quantity">−</button>
|
|
133
|
+
<span>${item.qty}</span>
|
|
134
|
+
<button type="button" data-inc aria-label="Increase quantity">+</button>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
<div class="cart-line-side">
|
|
138
|
+
<div class="cart-line-total">${money(line)}</div>
|
|
139
|
+
<button type="button" class="cart-remove" data-remove>Remove</button>
|
|
140
|
+
</div>
|
|
141
|
+
</article>`;
|
|
142
|
+
})
|
|
143
|
+
.join("");
|
|
144
|
+
|
|
145
|
+
renderCheckoutLines(cart);
|
|
146
|
+
renderTotals(cart);
|
|
147
|
+
|
|
148
|
+
root.querySelectorAll("[data-dec]").forEach((btn) => {
|
|
149
|
+
btn.addEventListener("click", () => {
|
|
150
|
+
const idx = Number(btn.closest(".cart-line").dataset.idx);
|
|
151
|
+
const next = [...getCart()];
|
|
152
|
+
if (next[idx].qty > 1) next[idx].qty -= 1;
|
|
153
|
+
else next.splice(idx, 1);
|
|
154
|
+
setCart(next);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
root.querySelectorAll("[data-inc]").forEach((btn) => {
|
|
158
|
+
btn.addEventListener("click", () => {
|
|
159
|
+
const idx = Number(btn.closest(".cart-line").dataset.idx);
|
|
160
|
+
const next = [...getCart()];
|
|
161
|
+
if (next[idx].qty < 10) next[idx].qty += 1;
|
|
162
|
+
setCart(next);
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
root.querySelectorAll("[data-remove]").forEach((btn) => {
|
|
166
|
+
btn.addEventListener("click", () => {
|
|
167
|
+
const idx = Number(btn.closest(".cart-line").dataset.idx);
|
|
168
|
+
const next = [...getCart()];
|
|
169
|
+
next.splice(idx, 1);
|
|
170
|
+
setCart(next);
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
async function applyDiscount() {
|
|
176
|
+
const cart = getCart();
|
|
177
|
+
const code = document.getElementById("checkout-discount")?.value?.trim();
|
|
178
|
+
const msg = document.getElementById("checkout-discount-msg");
|
|
179
|
+
if (!code || !cart.length) return;
|
|
180
|
+
|
|
181
|
+
msg.textContent = "Checking code…";
|
|
182
|
+
msg.className = "checkout-promo-msg";
|
|
183
|
+
|
|
184
|
+
try {
|
|
185
|
+
const res = await fetch("/api/store/discounts/validate", {
|
|
186
|
+
method: "POST",
|
|
187
|
+
headers: { "Content-Type": "application/json" },
|
|
188
|
+
credentials: "same-origin",
|
|
189
|
+
body: JSON.stringify({
|
|
190
|
+
code,
|
|
191
|
+
email: document.getElementById("checkout-email")?.value?.trim() || "",
|
|
192
|
+
items: cart.map((i) => ({ variant_id: i.variant_id, qty: i.qty })),
|
|
193
|
+
}),
|
|
194
|
+
});
|
|
195
|
+
const data = await res.json();
|
|
196
|
+
if (!res.ok) throw new Error(data.error || "Invalid discount code");
|
|
197
|
+
|
|
198
|
+
setDiscount({
|
|
199
|
+
code: data.code,
|
|
200
|
+
title: data.title,
|
|
201
|
+
discount_cents: data.discount_cents || 0,
|
|
202
|
+
free_shipping: !!data.free_shipping,
|
|
203
|
+
message: data.message || "Discount applied",
|
|
204
|
+
});
|
|
205
|
+
msg.textContent = data.message || "Discount applied";
|
|
206
|
+
msg.className = "checkout-promo-msg ok";
|
|
207
|
+
} catch (err) {
|
|
208
|
+
setDiscount(null);
|
|
209
|
+
msg.textContent = err.message || "Invalid discount code";
|
|
210
|
+
msg.className = "checkout-promo-msg err";
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
async function checkout(e) {
|
|
215
|
+
e.preventDefault();
|
|
216
|
+
const email = document.getElementById("checkout-email")?.value?.trim();
|
|
217
|
+
const status = document.getElementById("checkout-status");
|
|
218
|
+
const btn = document.getElementById("checkout-submit");
|
|
219
|
+
const cart = getCart();
|
|
220
|
+
if (!email || !cart.length) return;
|
|
221
|
+
|
|
222
|
+
btn.disabled = true;
|
|
223
|
+
status.textContent = "Placing order…";
|
|
224
|
+
status.className = "checkout-status";
|
|
225
|
+
|
|
226
|
+
try {
|
|
227
|
+
const attribution = window.fnfAttribution?.getAttribution?.() || {};
|
|
228
|
+
const res = await fetch("/api/store/checkout/session", {
|
|
229
|
+
method: "POST",
|
|
230
|
+
headers: { "Content-Type": "application/json" },
|
|
231
|
+
credentials: "same-origin",
|
|
232
|
+
body: JSON.stringify({
|
|
233
|
+
email,
|
|
234
|
+
items: cart.map((i) => ({ variant_id: i.variant_id, qty: i.qty })),
|
|
235
|
+
attribution,
|
|
236
|
+
discount_code: getDiscount()?.code || document.getElementById("checkout-discount")?.value?.trim() || "",
|
|
237
|
+
}),
|
|
238
|
+
});
|
|
239
|
+
const data = await res.json();
|
|
240
|
+
if (!res.ok) throw new Error(data.error || "Checkout failed");
|
|
241
|
+
|
|
242
|
+
// Redirect to Stripe-hosted checkout. Do NOT clear cart/discount here —
|
|
243
|
+
// the confirmation page clears them on "paid", so a cancelled checkout
|
|
244
|
+
// keeps the cart intact.
|
|
245
|
+
status.textContent = "Redirecting to secure checkout…";
|
|
246
|
+
status.className = "checkout-status";
|
|
247
|
+
window.location.href = data.url;
|
|
248
|
+
} catch (err) {
|
|
249
|
+
status.textContent = err.message || "Checkout failed";
|
|
250
|
+
status.className = "checkout-status err";
|
|
251
|
+
btn.disabled = false;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
document.getElementById("checkout-form")?.addEventListener("submit", checkout);
|
|
256
|
+
document.getElementById("checkout-apply-discount")?.addEventListener("click", applyDiscount);
|
|
257
|
+
document.addEventListener("fnf:cart-updated", () => {
|
|
258
|
+
render();
|
|
259
|
+
updateBadge();
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
if (document.readyState === "loading") {
|
|
263
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
264
|
+
render();
|
|
265
|
+
updateBadge();
|
|
266
|
+
});
|
|
267
|
+
} else {
|
|
268
|
+
render();
|
|
269
|
+
updateBadge();
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
if (new URLSearchParams(location.search).get("cancelled") === "1") {
|
|
273
|
+
var s = document.getElementById("checkout-status");
|
|
274
|
+
if (s) { s.textContent = "Checkout cancelled — your cart is saved."; s.className = "checkout-status"; }
|
|
275
|
+
}
|
|
276
|
+
})();
|