@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,395 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hydrates CMS-managed slots on marketing pages from D1/KV.
|
|
3
|
+
* Also applies the generic editor settings contract and page section ordering.
|
|
4
|
+
*/
|
|
5
|
+
(function () {
|
|
6
|
+
const pageSlug = document.documentElement.dataset.cmsPage;
|
|
7
|
+
if (!pageSlug) return;
|
|
8
|
+
|
|
9
|
+
const portableReady = import('/js/portable-sections.js').catch((error) => {
|
|
10
|
+
console.error('[CMS] Shared section runtime failed to load', error);
|
|
11
|
+
});
|
|
12
|
+
let atlasReady = null;
|
|
13
|
+
async function ensureSectionRuntime(sections) {
|
|
14
|
+
await portableReady;
|
|
15
|
+
if (!sections.some((section) => String(section?.content?.__editor?.themePreset || '').startsWith('revise-atlas/'))) return;
|
|
16
|
+
if (!atlasReady) {
|
|
17
|
+
atlasReady = import('/js/revise-atlas.js').then(() => {
|
|
18
|
+
if (!document.querySelector('link[data-revise-atlas]')) {
|
|
19
|
+
const stylesheet = document.createElement('link');
|
|
20
|
+
stylesheet.rel = 'stylesheet';
|
|
21
|
+
stylesheet.href = '/js/revise-atlas.css';
|
|
22
|
+
stylesheet.dataset.reviseAtlas = 'true';
|
|
23
|
+
document.head.appendChild(stylesheet);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
await atlasReady;
|
|
28
|
+
}
|
|
29
|
+
if (!document.querySelector('link[data-portable-sections]')) {
|
|
30
|
+
const css = document.createElement('link');
|
|
31
|
+
css.rel = 'stylesheet';
|
|
32
|
+
css.href = '/js/portable-sections.css';
|
|
33
|
+
css.dataset.portableSections = 'true';
|
|
34
|
+
document.head.appendChild(css);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function getPath(obj, path) {
|
|
38
|
+
return path.split(".").reduce((acc, key) => (acc == null ? acc : acc[key]), obj);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function editorStyle() {
|
|
42
|
+
if (document.getElementById("cms-editor-runtime-style")) return;
|
|
43
|
+
const style = document.createElement("style");
|
|
44
|
+
style.id = "cms-editor-runtime-style";
|
|
45
|
+
style.textContent = [
|
|
46
|
+
'[data-cms-width="contained"]{width:min(100%,1200px)!important;margin-inline:auto!important}',
|
|
47
|
+
'[data-cms-width="wide"]{width:min(100%,1440px)!important;margin-inline:auto!important}',
|
|
48
|
+
'[data-cms-width="full-bleed"]{width:100%!important;max-width:none!important}',
|
|
49
|
+
'@media(max-width:767px){[data-cms-hide-mobile="true"]{display:none!important}}'
|
|
50
|
+
].join("");
|
|
51
|
+
document.head?.appendChild(style);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function resolveSlot(el, byKey) {
|
|
55
|
+
const path = el.dataset.cms;
|
|
56
|
+
if (!path) return null;
|
|
57
|
+
|
|
58
|
+
const dot = path.indexOf(".");
|
|
59
|
+
if (dot >= 0) {
|
|
60
|
+
const sectionKey = path.slice(0, dot);
|
|
61
|
+
const content = byKey[sectionKey];
|
|
62
|
+
if (content) return { content, field: path.slice(dot + 1) };
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const section = el.closest?.("[data-cms-section]");
|
|
66
|
+
const sectionKey = section?.dataset.cmsSection;
|
|
67
|
+
const content = sectionKey ? byKey[sectionKey] : null;
|
|
68
|
+
if (!content) return null;
|
|
69
|
+
return { content, field: path };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function applyEditorSettings(sectionEl, content) {
|
|
73
|
+
const editor = content?.__editor;
|
|
74
|
+
if (!editor || typeof editor !== "object") return;
|
|
75
|
+
|
|
76
|
+
const visibility = editor.visibility || {};
|
|
77
|
+
sectionEl.hidden = visibility.enabled === false;
|
|
78
|
+
|
|
79
|
+
const layout = editor.layout || {};
|
|
80
|
+
if (layout.width && layout.width !== "inherit") sectionEl.dataset.cmsWidth = layout.width;
|
|
81
|
+
else delete sectionEl.dataset.cmsWidth;
|
|
82
|
+
|
|
83
|
+
if (layout.alignment && layout.alignment !== "inherit") {
|
|
84
|
+
sectionEl.style.textAlign = layout.alignment;
|
|
85
|
+
} else {
|
|
86
|
+
sectionEl.style.removeProperty("text-align");
|
|
87
|
+
}
|
|
88
|
+
if (Number.isFinite(Number(layout.columns))) {
|
|
89
|
+
const columns = Math.max(1, Math.min(12, Number(layout.columns)));
|
|
90
|
+
sectionEl.dataset.cmsColumns = String(columns);
|
|
91
|
+
sectionEl.style.setProperty("--cms-layout-columns", String(columns));
|
|
92
|
+
} else {
|
|
93
|
+
delete sectionEl.dataset.cmsColumns;
|
|
94
|
+
sectionEl.style.removeProperty("--cms-layout-columns");
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const spacing = editor.spacing || {};
|
|
98
|
+
if (Number.isFinite(Number(spacing.paddingTop))) {
|
|
99
|
+
sectionEl.style.paddingTop = Number(spacing.paddingTop) + "px";
|
|
100
|
+
}
|
|
101
|
+
if (Number.isFinite(Number(spacing.paddingBottom))) {
|
|
102
|
+
sectionEl.style.paddingBottom = Number(spacing.paddingBottom) + "px";
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const appearance = editor.appearance || {};
|
|
106
|
+
if (appearance.backgroundEnabled && appearance.backgroundColor) {
|
|
107
|
+
sectionEl.style.backgroundColor = appearance.backgroundColor;
|
|
108
|
+
} else {
|
|
109
|
+
sectionEl.style.removeProperty("background-color");
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const motion = editor.motion || {};
|
|
113
|
+
if (motion.preset && motion.preset !== "inherit") sectionEl.dataset.hMotion = motion.preset;
|
|
114
|
+
if (motion.intensity !== undefined && motion.intensity !== null && motion.intensity !== "") {
|
|
115
|
+
sectionEl.dataset.hMotionIntensity = String(motion.intensity);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const responsive = editor.responsive || {};
|
|
119
|
+
sectionEl.dataset.cmsHideMobile = responsive.hideMobile === true ? "true" : "false";
|
|
120
|
+
if (responsive.carouselMobile !== undefined) {
|
|
121
|
+
sectionEl.dataset.cmsCarouselMobile = responsive.carouselMobile === false ? "false" : "true";
|
|
122
|
+
} else {
|
|
123
|
+
delete sectionEl.dataset.cmsCarouselMobile;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function rewriteCloneIdentity(node, fromKey, toKey) {
|
|
128
|
+
node.dataset.cmsSection = toKey;
|
|
129
|
+
node.querySelectorAll("[data-cms]").forEach((el) => {
|
|
130
|
+
const value = el.dataset.cms || "";
|
|
131
|
+
if (value.startsWith(fromKey + ".")) {
|
|
132
|
+
el.dataset.cms = toKey + value.slice(fromKey.length);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
const idMap = new Map();
|
|
137
|
+
node.querySelectorAll("[id]").forEach((el) => {
|
|
138
|
+
const original = el.id;
|
|
139
|
+
const next = original + "--" + toKey;
|
|
140
|
+
idMap.set(original, next);
|
|
141
|
+
el.id = next;
|
|
142
|
+
});
|
|
143
|
+
node.querySelectorAll("[href^='#']").forEach((el) => {
|
|
144
|
+
const original = el.getAttribute("href").slice(1);
|
|
145
|
+
if (idMap.has(original)) el.setAttribute("href", "#" + idMap.get(original));
|
|
146
|
+
});
|
|
147
|
+
node.querySelectorAll("[for]").forEach((el) => {
|
|
148
|
+
const original = el.getAttribute("for");
|
|
149
|
+
if (idMap.has(original)) el.setAttribute("for", idMap.get(original));
|
|
150
|
+
});
|
|
151
|
+
return node;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function mountPortableSections(sections) {
|
|
155
|
+
const runtime = window.ThemePortableSections;
|
|
156
|
+
if (!runtime) return;
|
|
157
|
+
const active = new Set();
|
|
158
|
+
for (const entry of sections) {
|
|
159
|
+
if (entry.content?.__editor?.templateKey !== 'portable') continue;
|
|
160
|
+
const markup = runtime.render(entry);
|
|
161
|
+
if (markup === null) {
|
|
162
|
+
console.error('[CMS] Unsupported preset:', entry.content?.__editor?.themePreset);
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
active.add(entry.key);
|
|
166
|
+
const old = Array.from(document.querySelectorAll('[data-cms-section]'))
|
|
167
|
+
.find((node) => node.dataset.cmsSection === entry.key);
|
|
168
|
+
if (!markup) {
|
|
169
|
+
old?.remove();
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
const template = document.createElement('template');
|
|
173
|
+
template.innerHTML = markup;
|
|
174
|
+
const node = template.content.firstElementChild;
|
|
175
|
+
if (!node) continue;
|
|
176
|
+
node.dataset.cmsPortable = 'true';
|
|
177
|
+
if (old) old.replaceWith(node);
|
|
178
|
+
else (document.querySelector('main') || document.body).appendChild(node);
|
|
179
|
+
}
|
|
180
|
+
document.querySelectorAll('[data-cms-portable="true"]').forEach((node) => {
|
|
181
|
+
if (!active.has(node.dataset.cmsSection)) node.remove();
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function ensureDynamicSections(sections) {
|
|
186
|
+
const existing = new Map(
|
|
187
|
+
Array.from(document.querySelectorAll("[data-cms-section]")).map((el) => [el.dataset.cmsSection, el])
|
|
188
|
+
);
|
|
189
|
+
const templateSnapshot = new Map(existing);
|
|
190
|
+
|
|
191
|
+
for (const section of sections) {
|
|
192
|
+
if (existing.has(section.key)) continue;
|
|
193
|
+
const templateKey = section.content?.__editor?.templateKey;
|
|
194
|
+
const template = templateKey ? templateSnapshot.get(templateKey) : null;
|
|
195
|
+
if (!template) continue;
|
|
196
|
+
const clone = rewriteCloneIdentity(template.cloneNode(true), templateKey, section.key);
|
|
197
|
+
clone.dataset.cmsDynamic = "true";
|
|
198
|
+
template.parentNode?.appendChild(clone);
|
|
199
|
+
existing.set(section.key, clone);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function applySectionOrder(sections) {
|
|
204
|
+
const ordered = sections
|
|
205
|
+
.slice()
|
|
206
|
+
.sort((a, b) => Number(a.sort_order || 0) - Number(b.sort_order || 0))
|
|
207
|
+
.map((section) => document.querySelector('[data-cms-section="' + CSS.escape(section.key) + '"]'))
|
|
208
|
+
.filter(Boolean);
|
|
209
|
+
|
|
210
|
+
const groups = new Map();
|
|
211
|
+
for (const node of ordered) {
|
|
212
|
+
if (!node.parentNode) continue;
|
|
213
|
+
if (!groups.has(node.parentNode)) groups.set(node.parentNode, []);
|
|
214
|
+
groups.get(node.parentNode).push(node);
|
|
215
|
+
}
|
|
216
|
+
for (const [parent, nodes] of groups) {
|
|
217
|
+
for (const node of nodes) parent.appendChild(node);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function rewriteBlockIdentity(node, fromId, toId, templateKey) {
|
|
222
|
+
node.dataset.cmsBlock = toId;
|
|
223
|
+
if (templateKey) node.dataset.cmsBlockTemplate = templateKey;
|
|
224
|
+
node.querySelectorAll("[data-cms]").forEach((el) => {
|
|
225
|
+
const value = el.dataset.cms || "";
|
|
226
|
+
if (value.startsWith(fromId + ".")) {
|
|
227
|
+
el.dataset.cms = toId + value.slice(fromId.length);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
if ((node.dataset.cms || "").startsWith(fromId + ".")) {
|
|
231
|
+
node.dataset.cms = toId + node.dataset.cms.slice(fromId.length);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const idMap = new Map();
|
|
235
|
+
node.querySelectorAll("[id]").forEach((el) => {
|
|
236
|
+
const original = el.id;
|
|
237
|
+
const next = original + "--" + toId;
|
|
238
|
+
idMap.set(original, next);
|
|
239
|
+
el.id = next;
|
|
240
|
+
});
|
|
241
|
+
node.querySelectorAll("[href^='#']").forEach((el) => {
|
|
242
|
+
const original = el.getAttribute("href").slice(1);
|
|
243
|
+
if (idMap.has(original)) el.setAttribute("href", "#" + idMap.get(original));
|
|
244
|
+
});
|
|
245
|
+
return node;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function applyBlocks(sectionEl, content) {
|
|
249
|
+
const blockMeta = content?.__editor?.blocks;
|
|
250
|
+
if (!Array.isArray(blockMeta)) return;
|
|
251
|
+
|
|
252
|
+
const existing = new Map(
|
|
253
|
+
Array.from(sectionEl.querySelectorAll("[data-cms-block]")).map((el) => [el.dataset.cmsBlock, el])
|
|
254
|
+
);
|
|
255
|
+
const templates = new Map();
|
|
256
|
+
for (const el of existing.values()) {
|
|
257
|
+
const templateKey = el.dataset.cmsBlockTemplate;
|
|
258
|
+
if (templateKey && !templates.has(templateKey)) templates.set(templateKey, el.cloneNode(true));
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
const allowed = new Set(blockMeta.map((block) => block.id));
|
|
262
|
+
for (const [id, node] of existing) {
|
|
263
|
+
if (!allowed.has(id)) node.hidden = true;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
for (const block of blockMeta) {
|
|
267
|
+
let node = existing.get(block.id);
|
|
268
|
+
if (!node) {
|
|
269
|
+
const template = templates.get(block.templateKey);
|
|
270
|
+
if (!template) continue;
|
|
271
|
+
const sourceId = template.dataset.cmsBlock;
|
|
272
|
+
node = rewriteBlockIdentity(template.cloneNode(true), sourceId, block.id, block.templateKey);
|
|
273
|
+
template.parentNode?.appendChild(node);
|
|
274
|
+
const anchor = Array.from(sectionEl.querySelectorAll("[data-cms-block-template]"))
|
|
275
|
+
.find((candidate) => candidate.dataset.cmsBlockTemplate === block.templateKey);
|
|
276
|
+
anchor?.parentNode?.appendChild(node);
|
|
277
|
+
existing.set(block.id, node);
|
|
278
|
+
}
|
|
279
|
+
node.hidden = block.enabled === false;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
const orderedNodes = blockMeta
|
|
283
|
+
.map((block) => existing.get(block.id))
|
|
284
|
+
.filter(Boolean);
|
|
285
|
+
const groups = new Map();
|
|
286
|
+
for (const node of orderedNodes) {
|
|
287
|
+
if (!node.parentNode) continue;
|
|
288
|
+
if (!groups.has(node.parentNode)) groups.set(node.parentNode, []);
|
|
289
|
+
groups.get(node.parentNode).push(node);
|
|
290
|
+
}
|
|
291
|
+
for (const [parent, nodes] of groups) {
|
|
292
|
+
for (const node of nodes) parent.appendChild(node);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// Resolve merchant-authored destinations without admitting script/data URLs.
|
|
297
|
+
// Shared runtime uses one policy for both draft previews and published pages.
|
|
298
|
+
function safeCmsUrl(value, { media = false } = {}) {
|
|
299
|
+
if (typeof value !== "string") return null;
|
|
300
|
+
const url = value.trim();
|
|
301
|
+
if (!url || /[\u0000-\u001f\u007f]/.test(url)) return null;
|
|
302
|
+
try {
|
|
303
|
+
const scheme = new URL(url, document.baseURI).protocol;
|
|
304
|
+
if (scheme === "http:" || scheme === "https:") return url;
|
|
305
|
+
if (!media && (scheme === "mailto:" || scheme === "tel:")) return url;
|
|
306
|
+
} catch { /* invalid URL */ }
|
|
307
|
+
return null;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function applySections(sections) {
|
|
311
|
+
editorStyle();
|
|
312
|
+
const byKey = Object.fromEntries(sections.map((section) => [section.key, section.content || {}]));
|
|
313
|
+
|
|
314
|
+
mountPortableSections(sections);
|
|
315
|
+
ensureDynamicSections(sections);
|
|
316
|
+
applySectionOrder(sections);
|
|
317
|
+
|
|
318
|
+
document.querySelectorAll("[data-cms-section]").forEach((sectionEl) => {
|
|
319
|
+
const content = byKey[sectionEl.dataset.cmsSection];
|
|
320
|
+
if (content) {
|
|
321
|
+
applyEditorSettings(sectionEl, content);
|
|
322
|
+
applyBlocks(sectionEl, content);
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
document.querySelectorAll("[data-cms]").forEach((el) => {
|
|
327
|
+
const resolved = resolveSlot(el, byKey);
|
|
328
|
+
if (!resolved) return;
|
|
329
|
+
|
|
330
|
+
const value = getPath(resolved.content, resolved.field);
|
|
331
|
+
if (value == null || value === "") return;
|
|
332
|
+
|
|
333
|
+
const attr = el.dataset.cmsAttr || "textContent";
|
|
334
|
+
if (attr === "textContent") {
|
|
335
|
+
el.textContent = value;
|
|
336
|
+
// The authored live heading may contain explicit line breaks. Preserve
|
|
337
|
+
// those when importing it as editable CMS text, without allowing HTML.
|
|
338
|
+
if (typeof value === "string" && value.includes("\n")) el.style.whiteSpace = "pre-line";
|
|
339
|
+
} else if (attr === "innerHTML") {
|
|
340
|
+
el.innerHTML = value;
|
|
341
|
+
} else if (attr === "style.backgroundImage" && typeof value === "string") {
|
|
342
|
+
const safe = safeCmsUrl(value, { media: true });
|
|
343
|
+
if (safe) el.style.backgroundImage = `url("${safe.replace(/"/g, "%22")}")`;
|
|
344
|
+
} else if (attr === "href" || attr === "src") {
|
|
345
|
+
const safe = safeCmsUrl(value, { media: attr === "src" });
|
|
346
|
+
if (safe) el.setAttribute(attr, safe);
|
|
347
|
+
} else if (attr === "alt" || attr === "title" || attr === "aria-label") {
|
|
348
|
+
el.setAttribute(attr, String(value));
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
document.documentElement.classList.add("cms-hydrated");
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
async function fetchPage(slug, preview) {
|
|
356
|
+
const url = `/api/cms/pages/${encodeURIComponent(slug)}${preview ? "?preview=1" : ""}`;
|
|
357
|
+
const res = await fetch(url, preview ? { credentials: "include" } : {});
|
|
358
|
+
if (!res.ok) return null;
|
|
359
|
+
const data = await res.json();
|
|
360
|
+
return data?.page || null;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
async function boot() {
|
|
364
|
+
const preview = new URLSearchParams(location.search).has("preview");
|
|
365
|
+
const slugs = pageSlug === "site" ? ["site"] : ["site", pageSlug];
|
|
366
|
+
|
|
367
|
+
try {
|
|
368
|
+
const pages = await Promise.all(slugs.map((entry) => fetchPage(entry, preview)));
|
|
369
|
+
const sections = pages.filter(Boolean).flatMap((page) => page.sections || []);
|
|
370
|
+
await ensureSectionRuntime(sections);
|
|
371
|
+
if (sections.length) applySections(sections);
|
|
372
|
+
} catch {
|
|
373
|
+
/* static HTML fallback */
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
window.addEventListener("message", (event) => {
|
|
378
|
+
if (event.origin !== location.origin) return;
|
|
379
|
+
const data = event.data;
|
|
380
|
+
if (!data || data.type !== "fnf-cms-preview" || data.slug !== pageSlug) return;
|
|
381
|
+
if (!Array.isArray(data.sections)) return;
|
|
382
|
+
const sections = [
|
|
383
|
+
...(Array.isArray(data.siteSections) ? data.siteSections : []), ...data.sections,
|
|
384
|
+
];
|
|
385
|
+
void ensureSectionRuntime(sections).then(() => applySections(sections)).catch((error) => {
|
|
386
|
+
console.error('[CMS] Draft section renderer failed to load', error);
|
|
387
|
+
});
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
if (document.readyState === "loading") {
|
|
391
|
+
document.addEventListener("DOMContentLoaded", boot);
|
|
392
|
+
} else {
|
|
393
|
+
boot();
|
|
394
|
+
}
|
|
395
|
+
})();
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
function numericSortOrder(section, fallback = 0) {
|
|
2
|
+
const value = Number(section?.sort_order);
|
|
3
|
+
return Number.isFinite(value) ? value : fallback;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export function cmsTemplateKey(section) {
|
|
7
|
+
const explicit = section?.content?.__editor?.templateKey;
|
|
8
|
+
if (typeof explicit === "string" && explicit.trim()) return explicit.trim();
|
|
9
|
+
return String(section?.key || "").trim();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function cmsSectionEnabled(section) {
|
|
13
|
+
if (!section || section.status === "removed") return false;
|
|
14
|
+
return section.content?.__editor?.visibility?.enabled !== false;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function cloneSection(section) {
|
|
18
|
+
return typeof structuredClone === "function"
|
|
19
|
+
? structuredClone(section)
|
|
20
|
+
: JSON.parse(JSON.stringify(section));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function applyEditorSettings(section, content) {
|
|
24
|
+
const editor = content?.__editor || {};
|
|
25
|
+
const width = editor.layout?.width;
|
|
26
|
+
if (width && width !== "inherit") {
|
|
27
|
+
section.appearance = { ...(section.appearance || {}), width };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const motionPreset = editor.motion?.preset;
|
|
31
|
+
const motionIntensity = editor.motion?.intensity;
|
|
32
|
+
if ((motionPreset && motionPreset !== "inherit") || Number.isFinite(Number(motionIntensity))) {
|
|
33
|
+
section.motion = { ...(section.motion || {}) };
|
|
34
|
+
if (motionPreset && motionPreset !== "inherit") section.motion.preset = motionPreset;
|
|
35
|
+
if (Number.isFinite(Number(motionIntensity))) section.motion.intensity = Number(motionIntensity);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
section.cmsEditor = {
|
|
39
|
+
alignment: editor.layout?.alignment || "inherit",
|
|
40
|
+
paddingTop: Number(editor.spacing?.paddingTop || 0),
|
|
41
|
+
paddingBottom: Number(editor.spacing?.paddingBottom || 0),
|
|
42
|
+
backgroundEnabled: editor.appearance?.backgroundEnabled === true,
|
|
43
|
+
backgroundColor: editor.appearance?.backgroundColor || "",
|
|
44
|
+
hideMobile: editor.responsive?.hideMobile === true,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function projectCmsSections(pageSections, cmsSections, { onUnregistered } = {}) {
|
|
49
|
+
if (!Array.isArray(pageSections)) throw new TypeError("pageSections must be an array");
|
|
50
|
+
if (!Array.isArray(cmsSections)) throw new TypeError("cmsSections must be an array");
|
|
51
|
+
|
|
52
|
+
const templates = new Map();
|
|
53
|
+
for (const section of pageSections) {
|
|
54
|
+
if (!section?.cmsKey) continue;
|
|
55
|
+
if (templates.has(section.cmsKey)) {
|
|
56
|
+
throw new Error(`duplicate preset cmsKey: ${section.cmsKey}`);
|
|
57
|
+
}
|
|
58
|
+
templates.set(section.cmsKey, section);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return [...cmsSections]
|
|
62
|
+
.sort((a, b) => numericSortOrder(a) - numericSortOrder(b))
|
|
63
|
+
.filter(cmsSectionEnabled)
|
|
64
|
+
.map((cmsSection) => {
|
|
65
|
+
const templateKey = cmsTemplateKey(cmsSection);
|
|
66
|
+
const template = templates.get(templateKey);
|
|
67
|
+
if (!template) {
|
|
68
|
+
onUnregistered?.(cmsSection, templateKey);
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const section = cloneSection(template);
|
|
73
|
+
section.id =
|
|
74
|
+
cmsSection.key === templateKey
|
|
75
|
+
? template.id
|
|
76
|
+
: `${template.id}--${cmsSection.key}`;
|
|
77
|
+
section.cmsKey = cmsSection.key;
|
|
78
|
+
section.cmsTemplateKey = templateKey;
|
|
79
|
+
section.cmsContent = cmsSection.content || {};
|
|
80
|
+
section.cmsSortOrder = numericSortOrder(cmsSection);
|
|
81
|
+
applyEditorSettings(section, section.cmsContent);
|
|
82
|
+
return section;
|
|
83
|
+
})
|
|
84
|
+
.filter(Boolean);
|
|
85
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* First-party UTM capture for Fuel & Free Time storefront.
|
|
3
|
+
*/
|
|
4
|
+
(function () {
|
|
5
|
+
if (window.__fnfAttributionInit) return;
|
|
6
|
+
window.__fnfAttributionInit = true;
|
|
7
|
+
|
|
8
|
+
function readCookie(name) {
|
|
9
|
+
const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
|
|
10
|
+
return match ? decodeURIComponent(match[1]) : "";
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function parseAttributionCookie() {
|
|
14
|
+
try {
|
|
15
|
+
return JSON.parse(readCookie("fnf_ca") || "null");
|
|
16
|
+
} catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function utmFromLocation() {
|
|
22
|
+
const params = new URLSearchParams(window.location.search);
|
|
23
|
+
return {
|
|
24
|
+
utm_source: params.get("utm_source"),
|
|
25
|
+
utm_medium: params.get("utm_medium"),
|
|
26
|
+
utm_campaign: params.get("utm_campaign"),
|
|
27
|
+
utm_content: params.get("utm_content"),
|
|
28
|
+
utm_term: params.get("utm_term"),
|
|
29
|
+
campaign_id: params.get("fnf_c"),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function hasUtm(utm) {
|
|
34
|
+
return Boolean(
|
|
35
|
+
utm.campaign_id ||
|
|
36
|
+
utm.utm_source ||
|
|
37
|
+
utm.utm_medium ||
|
|
38
|
+
utm.utm_campaign ||
|
|
39
|
+
utm.utm_content ||
|
|
40
|
+
utm.utm_term
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function sendVisit(force) {
|
|
45
|
+
const utm = utmFromLocation();
|
|
46
|
+
const existing = parseAttributionCookie();
|
|
47
|
+
if (!force && !hasUtm(utm) && existing) return;
|
|
48
|
+
|
|
49
|
+
const payload = {
|
|
50
|
+
session_id: readCookie("fnf_vid") || undefined,
|
|
51
|
+
landing_path: window.location.pathname + window.location.search,
|
|
52
|
+
referrer: document.referrer || null,
|
|
53
|
+
previous_path: sessionStorage.getItem("fnf_prev_path") || null,
|
|
54
|
+
channel: utm.utm_source || null,
|
|
55
|
+
campaign_id: utm.campaign_id || existing?.cid || null,
|
|
56
|
+
utm_source: utm.utm_source || existing?.us || null,
|
|
57
|
+
utm_medium: utm.utm_medium || existing?.um || null,
|
|
58
|
+
utm_campaign: utm.utm_campaign || existing?.uc || null,
|
|
59
|
+
utm_content: utm.utm_content || null,
|
|
60
|
+
utm_term: utm.utm_term || null,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
fetch("/api/attribution/visit", {
|
|
64
|
+
method: "POST",
|
|
65
|
+
headers: { "content-type": "application/json" },
|
|
66
|
+
credentials: "same-origin",
|
|
67
|
+
keepalive: true,
|
|
68
|
+
body: JSON.stringify(payload),
|
|
69
|
+
}).catch(function () {});
|
|
70
|
+
|
|
71
|
+
sessionStorage.setItem("fnf_prev_path", window.location.pathname);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (document.readyState === "loading") {
|
|
75
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
76
|
+
sendVisit(false);
|
|
77
|
+
});
|
|
78
|
+
} else {
|
|
79
|
+
sendVisit(false);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
window.fnfAttribution = {
|
|
83
|
+
getAttribution: function () {
|
|
84
|
+
const utm = utmFromLocation();
|
|
85
|
+
const cookie = parseAttributionCookie() || {};
|
|
86
|
+
return {
|
|
87
|
+
campaign_id: utm.campaign_id || cookie.cid || null,
|
|
88
|
+
utm_source: utm.utm_source || cookie.us || null,
|
|
89
|
+
utm_medium: utm.utm_medium || cookie.um || null,
|
|
90
|
+
utm_campaign: utm.utm_campaign || cookie.uc || null,
|
|
91
|
+
visit_id: cookie.vid || null,
|
|
92
|
+
};
|
|
93
|
+
},
|
|
94
|
+
track: function () {
|
|
95
|
+
sendVisit(true);
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
})();
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Applies store SEO prefs from D1 to document head.
|
|
3
|
+
*/
|
|
4
|
+
(function () {
|
|
5
|
+
async function boot() {
|
|
6
|
+
try {
|
|
7
|
+
const res = await fetch("/api/store/meta");
|
|
8
|
+
if (!res.ok) return;
|
|
9
|
+
const data = await res.json();
|
|
10
|
+
const m = data.meta;
|
|
11
|
+
if (!m) return;
|
|
12
|
+
|
|
13
|
+
if (m.homeTitle) {
|
|
14
|
+
document.title = m.homeTitle;
|
|
15
|
+
}
|
|
16
|
+
if (m.metaDescription) {
|
|
17
|
+
let tag = document.querySelector('meta[name="description"]');
|
|
18
|
+
if (!tag) {
|
|
19
|
+
tag = document.createElement("meta");
|
|
20
|
+
tag.name = "description";
|
|
21
|
+
document.head.appendChild(tag);
|
|
22
|
+
}
|
|
23
|
+
tag.content = m.metaDescription;
|
|
24
|
+
}
|
|
25
|
+
if (m.socialImageUrl) {
|
|
26
|
+
for (const prop of ["og:image", "twitter:image"]) {
|
|
27
|
+
let tag = document.querySelector(`meta[property="${prop}"]`) || document.querySelector(`meta[name="${prop}"]`);
|
|
28
|
+
if (!tag) {
|
|
29
|
+
tag = document.createElement("meta");
|
|
30
|
+
if (prop.startsWith("og:")) tag.setAttribute("property", prop);
|
|
31
|
+
else tag.name = prop;
|
|
32
|
+
document.head.appendChild(tag);
|
|
33
|
+
}
|
|
34
|
+
tag.content = m.socialImageUrl;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
} catch {
|
|
38
|
+
/* ignore */
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (document.readyState === "loading") {
|
|
43
|
+
document.addEventListener("DOMContentLoaded", boot);
|
|
44
|
+
} else {
|
|
45
|
+
boot();
|
|
46
|
+
}
|
|
47
|
+
})();
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
(function () {
|
|
2
|
+
function feedback(form, msg, isError) {
|
|
3
|
+
var note = form.querySelector('.fnf-nl-note');
|
|
4
|
+
if (!note) {
|
|
5
|
+
note = document.createElement('div');
|
|
6
|
+
note.className = 'fnf-nl-note';
|
|
7
|
+
note.style.cssText = 'margin-top:8px;font-size:13px;font-weight:600;';
|
|
8
|
+
form.appendChild(note);
|
|
9
|
+
}
|
|
10
|
+
note.textContent = msg;
|
|
11
|
+
note.style.color = isError ? '#ff6b4a' : '#9fe6a0';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function handleSubmit(e) {
|
|
15
|
+
var form = e.target;
|
|
16
|
+
var emailInput = form.querySelector('input[type="email"]');
|
|
17
|
+
if (!emailInput) return;
|
|
18
|
+
|
|
19
|
+
e.preventDefault();
|
|
20
|
+
e.stopImmediatePropagation();
|
|
21
|
+
|
|
22
|
+
var email = emailInput.value.trim();
|
|
23
|
+
if (!email) return;
|
|
24
|
+
|
|
25
|
+
var submitBtn = form.querySelector('button[type="submit"], button');
|
|
26
|
+
if (submitBtn) submitBtn.disabled = true;
|
|
27
|
+
|
|
28
|
+
fetch('/api/newsletter', {
|
|
29
|
+
method: 'POST',
|
|
30
|
+
headers: { 'content-type': 'application/json' },
|
|
31
|
+
body: JSON.stringify({ email: email, source_page: location.pathname }),
|
|
32
|
+
})
|
|
33
|
+
.then(function (r) { return r.json().then(function (d) { return { ok: r.ok, d: d }; }); })
|
|
34
|
+
.then(function (res) {
|
|
35
|
+
if (res.ok) {
|
|
36
|
+
feedback(form, "You're in. Watch for drops.", false);
|
|
37
|
+
form.reset();
|
|
38
|
+
} else {
|
|
39
|
+
feedback(form, res.d && res.d.error ? res.d.error : 'Something went wrong.', true);
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
.catch(function () {
|
|
43
|
+
feedback(form, 'Network error — try again.', true);
|
|
44
|
+
})
|
|
45
|
+
.finally(function () {
|
|
46
|
+
if (submitBtn) submitBtn.disabled = false;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function init() {
|
|
51
|
+
var forms = document.querySelectorAll('form');
|
|
52
|
+
forms.forEach(function (form) {
|
|
53
|
+
if (form.querySelector('input[type="email"]')) {
|
|
54
|
+
form.addEventListener('submit', handleSubmit, true);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (document.readyState === 'loading') {
|
|
60
|
+
document.addEventListener('DOMContentLoaded', init);
|
|
61
|
+
} else {
|
|
62
|
+
init();
|
|
63
|
+
}
|
|
64
|
+
})();
|