@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,108 @@
|
|
|
1
|
+
import { defineSamOperation } from '../../define.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Portable authoring operations. The compiler is an explicitly installed Theme
|
|
5
|
+
* Tools adapter. All privileged reads/writes go through the host's existing CMS.
|
|
6
|
+
* No FNF paths, hardcoded tenant or second revision/publishing authority.
|
|
7
|
+
*/
|
|
8
|
+
export function createAuthoringOperations({compiler,repository,resolveTrustedContext,authorize}={}) {
|
|
9
|
+
for (const name of ['compileHtmlAuthoring','compileScopedStyles','compileSourcePatch']) {
|
|
10
|
+
if (typeof compiler?.[name]!=='function') throw new Error('sam_authoring_compiler_missing:'+name);
|
|
11
|
+
}
|
|
12
|
+
if (typeof repository?.getSource!=='function' || typeof repository?.saveDraftStyles!=='function' ||
|
|
13
|
+
typeof repository?.saveSourceDraft!=='function' || typeof resolveTrustedContext!=='function' ||
|
|
14
|
+
typeof authorize!=='function') throw new Error('sam_authoring_requires_authorized_cms_adapter');
|
|
15
|
+
|
|
16
|
+
const principalFor=async (action, ctx, input)=>{
|
|
17
|
+
const principal=await resolveTrustedContext(ctx);
|
|
18
|
+
if (!principal?.accountId || !principal?.actorId) throw new Error('sam_authoring_trusted_principal_required');
|
|
19
|
+
if (!input?.artifactId || typeof input.artifactId!=='string') throw new Error('sam_authoring_artifact_id_required');
|
|
20
|
+
if (await authorize({principal,action,artifactId:input.artifactId,pageId:input.pageId,sectionId:input.sectionId})!==true) {
|
|
21
|
+
throw new Error('sam_authoring_access_denied');
|
|
22
|
+
}
|
|
23
|
+
return principal;
|
|
24
|
+
};
|
|
25
|
+
const read=async(principal,input)=>{
|
|
26
|
+
const record=await repository.getSource({principal,artifactId:input.artifactId});
|
|
27
|
+
if (!record || typeof record.source!=='string' || !Number.isInteger(record.revision) || !record.contentHash) {
|
|
28
|
+
throw new Error('sam_authoring_source_unavailable');
|
|
29
|
+
}
|
|
30
|
+
return record;
|
|
31
|
+
};
|
|
32
|
+
const compile=(record,input)=>compiler.compileHtmlAuthoring({
|
|
33
|
+
html:record.source,filename:record.filename||input.artifactId,
|
|
34
|
+
scope:input.scope,fragment:record.fragment??false
|
|
35
|
+
});
|
|
36
|
+
const requireExpected=(input,record)=>{
|
|
37
|
+
if (!Number.isInteger(input.expectedRevision) || input.expectedRevision!==record.revision ||
|
|
38
|
+
typeof input.expectedHash!=='string' || input.expectedHash!==record.contentHash) {
|
|
39
|
+
throw new Error('sam_authoring_stale_revision');
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const op=(id,action,capability,handler,write=false)=>defineSamOperation({
|
|
43
|
+
id,module:'authoring',action,summary:'Authorized component '+action+' through the installed source compiler and existing CMS.',
|
|
44
|
+
purpose:'Portable and scoped component authoring without another CMS authority.',
|
|
45
|
+
execution:{lanes:['local','remote','sandbox'],model:'never',network:'optional',sideEffects:write?'cms_draft':'none'},
|
|
46
|
+
risk:write?'write':'read_only',capabilities:[capability],status:'experimental',handler
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
return [
|
|
50
|
+
op('sam.authoring.inspect','inspect','cms.artifact.read',async(input={},ctx={})=>{
|
|
51
|
+
const principal=await principalFor('read',ctx,input);
|
|
52
|
+
const record=await read(principal,input);
|
|
53
|
+
const compiled=compile(record,input);
|
|
54
|
+
return {artifactId:input.artifactId,revision:record.revision,contentHash:record.contentHash,
|
|
55
|
+
schema:compiled.schema,scope:compiled.scope,bindings:compiled.bindings,diagnostics:compiled.diagnostics};
|
|
56
|
+
}),
|
|
57
|
+
op('sam.authoring.previewStyles','previewStyles','cms.section.read',async(input={},ctx={})=>{
|
|
58
|
+
const principal=await principalFor('read',ctx,input);
|
|
59
|
+
const record=await read(principal,input);
|
|
60
|
+
requireExpected(input,record);
|
|
61
|
+
const compiled=compile(record,input);
|
|
62
|
+
const compiledCss=compiler.compileScopedStyles({compiled,edits:input.edits||[]});
|
|
63
|
+
return {artifactId:input.artifactId,revision:record.revision,contentHash:record.contentHash,
|
|
64
|
+
annotatedHtml:compiled.annotatedHtml,css:compiledCss.css,bindings:compiled.bindings};
|
|
65
|
+
}),
|
|
66
|
+
op('sam.authoring.saveDraftStyles','saveDraftStyles','cms.section.write',async(input={},ctx={})=>{
|
|
67
|
+
const principal=await principalFor('write',ctx,input);
|
|
68
|
+
const record=await read(principal,input);
|
|
69
|
+
requireExpected(input,record);
|
|
70
|
+
if (typeof input.pageId!=='string'||!input.pageId||typeof input.sectionId!=='string'||!input.sectionId) {
|
|
71
|
+
throw new Error('sam_authoring_page_and_section_required');
|
|
72
|
+
}
|
|
73
|
+
const compiled=compile(record,input);
|
|
74
|
+
const compiledCss=compiler.compileScopedStyles({compiled,edits:input.edits||[]});
|
|
75
|
+
// The host adapter must atomically check expected CMS revision and update
|
|
76
|
+
// cms_page_sections through cms_revisions. No raw SQL or publication here.
|
|
77
|
+
const saved=await repository.saveDraftStyles({principal,pageId:input.pageId,sectionId:input.sectionId,
|
|
78
|
+
artifactId:input.artifactId,scope:compiled.scope,edits:input.edits||[],css:compiledCss.css,
|
|
79
|
+
expectedRevision:input.expectedRevision,expectedHash:input.expectedHash,expectedCmsRevision:input.expectedCmsRevision});
|
|
80
|
+
if (!saved || saved.ok!==true || !saved.revisionId) throw new Error('sam_authoring_draft_write_unconfirmed');
|
|
81
|
+
return {saved:true,revisionId:saved.revisionId,published:false,artifactId:input.artifactId};
|
|
82
|
+
},true),
|
|
83
|
+
op('sam.authoring.proposeSourcePatch','proposeSourcePatch','cms.artifact.read',async(input={},ctx={})=>{
|
|
84
|
+
const principal=await principalFor('read',ctx,input);
|
|
85
|
+
const record=await read(principal,input);
|
|
86
|
+
requireExpected(input,record);
|
|
87
|
+
const result=compiler.compileSourcePatch({source:record.source,patches:input.patches});
|
|
88
|
+
return {artifactId:input.artifactId,baseRevision:record.revision,contentHash:record.contentHash,
|
|
89
|
+
proposedSource:result.source,patches:result.patches,published:false};
|
|
90
|
+
}),
|
|
91
|
+
op('sam.authoring.saveSourceDraft','saveSourceDraft','cms.artifact.write',async(input={},ctx={})=>{
|
|
92
|
+
const principal=await principalFor('write',ctx,input);
|
|
93
|
+
const record=await read(principal,input);
|
|
94
|
+
requireExpected(input,record);
|
|
95
|
+
if (input.approved!==true) throw new Error('sam_authoring_source_patch_review_required');
|
|
96
|
+
const result=compiler.compileSourcePatch({source:record.source,patches:input.patches});
|
|
97
|
+
// Immutable versioned R2 artifact and CMS revision are enforced by adapter.
|
|
98
|
+
// The operation never executes JS or publishes to live.
|
|
99
|
+
const saved=await repository.saveSourceDraft({principal,artifactId:input.artifactId,
|
|
100
|
+
source:result.source,patches:result.patches,
|
|
101
|
+
expectedRevision:input.expectedRevision,expectedHash:input.expectedHash});
|
|
102
|
+
if (!saved || saved.ok!==true || !saved.revisionId || !saved.artifactId) {
|
|
103
|
+
throw new Error('sam_authoring_source_write_unconfirmed');
|
|
104
|
+
}
|
|
105
|
+
return {saved:true,published:false,revisionId:saved.revisionId,artifactId:saved.artifactId};
|
|
106
|
+
},true)
|
|
107
|
+
];
|
|
108
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { CAD_PROJECT_TOOLS } from '../../../lib/cad/project-tools.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Reuse existing CAD API routes with an already authenticated host request.
|
|
5
|
+
* This adapter never accepts an arbitrary URL, cookies, or credentials from a
|
|
6
|
+
* model/tool argument. Cloud Worker and local host can supply different routes
|
|
7
|
+
* through their *own* authenticated transport, not through the guest iframe.
|
|
8
|
+
*/
|
|
9
|
+
export function createCadHttpPorts({ request } = {}) {
|
|
10
|
+
if (typeof request !== 'function') throw new Error('sam_cad_authenticated_request_required');
|
|
11
|
+
const call = async (path, method, payload, scope) => {
|
|
12
|
+
const response = await request(path, {
|
|
13
|
+
method, signal: scope?.signal,
|
|
14
|
+
...(payload ? { headers: { 'content-type': 'application/json' }, body: JSON.stringify(payload) } : {}),
|
|
15
|
+
}, scope?.principal);
|
|
16
|
+
if (!response || typeof response.json !== 'function') {
|
|
17
|
+
throw new Error('sam_cad_invalid_host_response');
|
|
18
|
+
}
|
|
19
|
+
const type = response.headers?.get?.('content-type') ?? '';
|
|
20
|
+
if (!type.includes('application/json')) throw new Error('sam_cad_invalid_host_response');
|
|
21
|
+
const data = await response.json();
|
|
22
|
+
if (!response.ok || data?.ok === false || data?.error) {
|
|
23
|
+
const code = typeof data?.error === 'string' ? data.error :
|
|
24
|
+
(data?.error?.code || 'sam_cad_host_request_failed');
|
|
25
|
+
throw new Error(code);
|
|
26
|
+
}
|
|
27
|
+
return data;
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
projectTools: {
|
|
31
|
+
async execute(name, args, scope) {
|
|
32
|
+
if (!CAD_PROJECT_TOOLS.some(tool => tool.name === name)) throw new Error('sam_cad_unrecognized_project_tool');
|
|
33
|
+
const data = await call('/api/cad/project/tools/' + encodeURIComponent(name),
|
|
34
|
+
'POST', args, scope);
|
|
35
|
+
return data.result;
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
jobs: {
|
|
39
|
+
async submit(args, scope) {
|
|
40
|
+
if (!['openscad', 'freecad', 'blender'].includes(args.engine)) throw new Error('sam_cad_invalid_engine');
|
|
41
|
+
const route = args.engine === 'openscad' ? '/api/cad/openscad/generate'
|
|
42
|
+
: args.engine === 'freecad' ? '/api/cad/freecad/script'
|
|
43
|
+
: '/api/cad/blender/script';
|
|
44
|
+
return call(route, 'POST', args, scope);
|
|
45
|
+
},
|
|
46
|
+
async get(args, scope) {
|
|
47
|
+
return call('/api/cad/jobs/' + encodeURIComponent(args.job_id), 'GET', null, scope);
|
|
48
|
+
},
|
|
49
|
+
async execute(args, scope) {
|
|
50
|
+
return call('/api/cad/jobs/' + encodeURIComponent(args.job_id) + '/execute',
|
|
51
|
+
'POST', { project_id: args.project_id, workspace_id: args.workspace_id }, scope);
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { defineSamOperation } from '../../define.js';
|
|
2
|
+
import { CAD_PROJECT_TOOLS } from '../../../lib/cad/project-tools.js';
|
|
3
|
+
import { createCadProductionOperations } from '../../../lib/cad/production-operations.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Donor compatibility only. UI labels never grant tool execution permission.
|
|
7
|
+
* Each destination is an existing CAD operation or provider-specific tool.
|
|
8
|
+
*/
|
|
9
|
+
export const CAD_DONOR_OPERATOR_MAPPINGS = Object.freeze({
|
|
10
|
+
generateFreeCAD: { operation: 'cad.job.generate', engine: 'freecad' },
|
|
11
|
+
generateBlender: { operation: 'cad.job.generate', engine: 'blender' },
|
|
12
|
+
generateOpenSCAD: { operation: 'cad.job.generate', engine: 'openscad' },
|
|
13
|
+
executeScript: { operation: 'cad.job.execute' },
|
|
14
|
+
exportGLB: { operation: 'cad.model.export', format: 'glb' },
|
|
15
|
+
generateObject: { existing_tool: 'meshy_text_to_3d' },
|
|
16
|
+
meshyRig: { existing_tool: 'meshy_rig' },
|
|
17
|
+
meshyAnimate: { existing_tool: 'meshy_animate' },
|
|
18
|
+
meshyRemesh: { existing_tool: 'meshy_remesh' },
|
|
19
|
+
meshyConvert: { existing_tool: 'meshy_convert' },
|
|
20
|
+
meshyResize: { existing_tool: 'meshy_resize' },
|
|
21
|
+
meshyUvUnwrap: { existing_tool: 'meshy_uv_unwrap' },
|
|
22
|
+
meshyRetexture: { existing_tool: 'meshy_retexture' },
|
|
23
|
+
repairGeometry: { planner_required: true },
|
|
24
|
+
addCube: { viewport_only: true },
|
|
25
|
+
deleteSelected: { viewport_only: true },
|
|
26
|
+
resetScene: { viewport_only: true },
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const PROJECT_NAMES = Object.freeze({
|
|
30
|
+
design_project_get: 'cad.project.get',
|
|
31
|
+
design_project_validate: 'cad.project.validate',
|
|
32
|
+
design_apply_operation: 'cad.project.apply',
|
|
33
|
+
design_project_save: 'cad.project.save',
|
|
34
|
+
design_project_restore: 'cad.project.restore',
|
|
35
|
+
design_model_build: 'cad.model.build',
|
|
36
|
+
design_model_inspect: 'cad.model.inspect',
|
|
37
|
+
design_model_render: 'cad.model.render',
|
|
38
|
+
design_model_export: 'cad.model.export',
|
|
39
|
+
});
|
|
40
|
+
const ID = { type: 'string', minLength: 1, maxLength: 100, pattern: '^[A-Za-z0-9_-]+$' };
|
|
41
|
+
const JOB_INPUT = {
|
|
42
|
+
type: 'object',
|
|
43
|
+
properties: {
|
|
44
|
+
project_id: ID,
|
|
45
|
+
workspace_id: ID,
|
|
46
|
+
engine: { type: 'string', enum: ['openscad', 'freecad', 'blender'] },
|
|
47
|
+
prompt: { type: 'string', minLength: 3, maxLength: 12000 },
|
|
48
|
+
job_id: ID,
|
|
49
|
+
model_key: { type: 'string', minLength: 1, maxLength: 140 },
|
|
50
|
+
},
|
|
51
|
+
additionalProperties: false,
|
|
52
|
+
};
|
|
53
|
+
const needsApproval = new Set(['design_apply_operation', 'design_project_save', 'design_project_restore',
|
|
54
|
+
'design_model_build', 'design_model_render', 'design_model_export']);
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Create actually executable CAD operations bound to a *trusted host*.
|
|
58
|
+
* Ports are existing authorities, not alternative file/database/job stores:
|
|
59
|
+
* projectTools.execute(name,args,{principal,signal}) -> canonical design_project_* receipt
|
|
60
|
+
* jobs.submit(args,{principal,signal}) -> existing agentsam_cad_jobs record
|
|
61
|
+
* jobs.get(args,{principal,signal}) -> owner-scoped job
|
|
62
|
+
* jobs.execute(args,{principal,signal}) -> authorized runner dispatch
|
|
63
|
+
*
|
|
64
|
+
* The host owns hooks/permission prompts, OAuth, runner routing and revision policy.
|
|
65
|
+
* Do not install the pack at all if no real authorized service exists.
|
|
66
|
+
*/
|
|
67
|
+
export function createCadOperations({
|
|
68
|
+
projectTools, jobs, production, resolveTrustedContext, authorize, requestApproval,
|
|
69
|
+
} = {}) {
|
|
70
|
+
if (!projectTools && !jobs && !production)
|
|
71
|
+
throw new Error('sam_cad_host_adapter_required');
|
|
72
|
+
if (production && !projectTools && !jobs)
|
|
73
|
+
return createCadProductionOperations(production);
|
|
74
|
+
if (typeof resolveTrustedContext !== 'function' || typeof authorize !== 'function'
|
|
75
|
+
|| typeof requestApproval !== 'function') {
|
|
76
|
+
throw new Error('sam_cad_trusted_authorization_and_approval_required');
|
|
77
|
+
}
|
|
78
|
+
if (projectTools && typeof projectTools.execute !== 'function') {
|
|
79
|
+
throw new Error('sam_cad_project_tool_executor_required');
|
|
80
|
+
}
|
|
81
|
+
if (jobs && ['submit', 'get', 'execute'].some(name => typeof jobs[name] !== 'function')) {
|
|
82
|
+
throw new Error('sam_cad_job_executor_required');
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const scoped = async (action, input, ctx, approve = false) => {
|
|
86
|
+
const principal = await resolveTrustedContext(ctx);
|
|
87
|
+
if (!principal?.accountId || !principal?.actorId || !principal?.tenantId) {
|
|
88
|
+
throw new Error('sam_cad_trusted_principal_required');
|
|
89
|
+
}
|
|
90
|
+
const projectId = input?.project_id ?? input?.project?.id;
|
|
91
|
+
if (!projectId || typeof projectId !== 'string') {
|
|
92
|
+
throw new Error('sam_cad_project_id_required');
|
|
93
|
+
}
|
|
94
|
+
if (await authorize({ principal, action, projectId, jobId: input?.job_id }) !== true) {
|
|
95
|
+
throw new Error('sam_cad_access_denied');
|
|
96
|
+
}
|
|
97
|
+
if (approve && await requestApproval({ principal, action, projectId, input }) !== true) {
|
|
98
|
+
throw new Error('sam_cad_approval_required');
|
|
99
|
+
}
|
|
100
|
+
return { principal, signal: ctx?.signal };
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const project = projectTools ? CAD_PROJECT_TOOLS.map(tool => {
|
|
104
|
+
const id = PROJECT_NAMES[tool.name];
|
|
105
|
+
if (!id) throw new Error('sam_cad_unmapped_project_tool:' + tool.name);
|
|
106
|
+
const write = needsApproval.has(tool.name);
|
|
107
|
+
return defineSamOperation({
|
|
108
|
+
id, version: 1, module: 'cad', action: id.slice(4),
|
|
109
|
+
summary: tool.description, description: tool.description,
|
|
110
|
+
execution: {
|
|
111
|
+
lanes: ['local', 'remote'], model: 'never', network: 'required',
|
|
112
|
+
sideEffects: write ? 'remote_write' : 'none',
|
|
113
|
+
},
|
|
114
|
+
risk: write ? 'write' : 'read_only',
|
|
115
|
+
capabilities: [tool.capability_key, id],
|
|
116
|
+
input_schema: tool.input_schema,
|
|
117
|
+
status: 'stable',
|
|
118
|
+
async handler(input = {}, ctx = {}) {
|
|
119
|
+
const scope = await scoped(tool.name, input, ctx, write);
|
|
120
|
+
return projectTools.execute(tool.name, input, scope);
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
}) : [];
|
|
124
|
+
|
|
125
|
+
const job = (id, action, summary, schema, handler, write) => defineSamOperation({
|
|
126
|
+
id, version: 1, module: 'cad', action,
|
|
127
|
+
summary, description: summary,
|
|
128
|
+
execution: { lanes: ['local', 'remote'], model: 'never', network: 'required',
|
|
129
|
+
sideEffects: write ? 'remote_write' : 'none' },
|
|
130
|
+
risk: write ? 'write' : 'read_only',
|
|
131
|
+
capabilities: [id],
|
|
132
|
+
input_schema: schema,
|
|
133
|
+
status: 'stable',
|
|
134
|
+
handler: async (input = {}, ctx = {}) => {
|
|
135
|
+
const scope = await scoped(action, input, ctx, write);
|
|
136
|
+
return handler(input, scope);
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
const jobOps = !jobs ? [] : [
|
|
141
|
+
job('cad.job.generate', 'job.generate',
|
|
142
|
+
'Submit a typed CAD generation intent to an authorized OpenSCAD, FreeCAD or Blender job runner. Do not ask the user to write scripts.',
|
|
143
|
+
{ ...JOB_INPUT, required: ['project_id', 'workspace_id', 'engine', 'prompt'] },
|
|
144
|
+
(input, scope) => jobs.submit(input, scope), true),
|
|
145
|
+
job('cad.job.status', 'job.status',
|
|
146
|
+
'Read the status and real generated artifacts of a project-scoped CAD job.',
|
|
147
|
+
{ ...JOB_INPUT, required: ['project_id', 'job_id'] },
|
|
148
|
+
(input, scope) => jobs.get(input, scope), false),
|
|
149
|
+
job('cad.job.execute', 'job.execute',
|
|
150
|
+
'Execute an approved existing script_ready CAD job using the connected CAD runner.',
|
|
151
|
+
{ ...JOB_INPUT, required: ['project_id', 'workspace_id', 'job_id'] },
|
|
152
|
+
(input, scope) => jobs.execute(input, scope), true),
|
|
153
|
+
];
|
|
154
|
+
const productionOps = production
|
|
155
|
+
? createCadProductionOperations(production)
|
|
156
|
+
: [];
|
|
157
|
+
return [...project, ...jobOps, ...productionOps];
|
|
158
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createSamOS } from '../../os.js';
|
|
2
|
+
import { createSamCapabilityAdapter } from '../../model-adapter.js';
|
|
3
|
+
import { createHookedCapabilityAdapter } from '../../../../packages/agentsam-hooks/src/adapters/capability.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Install the real CAD operations into AgentSam's *existing* model tool loop.
|
|
7
|
+
* No second mini-agent, no client-side job credentials, no duplicate compiler.
|
|
8
|
+
* The host supplies trusted CAD ports, model-tool authorization, and optional
|
|
9
|
+
* existing AgentSam Hooks runtime.
|
|
10
|
+
*/
|
|
11
|
+
export function createCadModelTools({
|
|
12
|
+
cad, modelAuthorize, hookRuntime = null, requestPermission = undefined, invocation = {},
|
|
13
|
+
expose = null,
|
|
14
|
+
} = {}) {
|
|
15
|
+
if (typeof modelAuthorize !== 'function') throw new Error('sam_cad_model_tool_authorization_required');
|
|
16
|
+
const os = createSamOS({ core: false, cad });
|
|
17
|
+
const allowed = expose ?? os.list().map(op => op.id);
|
|
18
|
+
const adapter = createSamCapabilityAdapter({ os, expose: allowed, authorize: modelAuthorize });
|
|
19
|
+
return hookRuntime
|
|
20
|
+
? createHookedCapabilityAdapter(adapter, { hookRuntime, requestPermission, invocation })
|
|
21
|
+
: adapter;
|
|
22
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed CAD task modes resolve to real registered SAM operations.
|
|
3
|
+
* These are execution intents, not chat styles or prompt prefixes.
|
|
4
|
+
* Principal/permissions/approvals remain authoritative in the installed
|
|
5
|
+
* CAD operation pack, never in a browser-controlled argument.
|
|
6
|
+
*/
|
|
7
|
+
export const CAD_RUN_MODES = Object.freeze({
|
|
8
|
+
'cad.inspect': { operation: 'cad.project.get', effect: 'read' },
|
|
9
|
+
'cad.create': { operation: 'cad.project.save', effect: 'write' },
|
|
10
|
+
'cad.edit': { operation: 'cad.project.apply', effect: 'write' },
|
|
11
|
+
'cad.export': { operation: 'cad.model.export', effect: 'export' },
|
|
12
|
+
'cad.generate': { operation: 'cad.job.generate', effect: 'write' },
|
|
13
|
+
});
|
|
14
|
+
const validId = input => typeof input === 'string' && /^[A-Za-z0-9_-]{1,100}$/.test(input);
|
|
15
|
+
const validRevision = input => Number.isSafeInteger(input) && input >= 0;
|
|
16
|
+
|
|
17
|
+
function paramsForMode(mode, input) {
|
|
18
|
+
if (!input || typeof input !== 'object' || Array.isArray(input)) throw new Error('cad_run_invalid_input');
|
|
19
|
+
switch (mode) {
|
|
20
|
+
case 'cad.inspect': {
|
|
21
|
+
if (!validId(input.project_id)) throw new Error('cad_run_project_id_required');
|
|
22
|
+
const args = { project_id: input.project_id };
|
|
23
|
+
if (input.revision !== undefined) {
|
|
24
|
+
if (!validRevision(input.revision) || input.revision < 1) throw new Error('cad_run_invalid_revision');
|
|
25
|
+
args.revision = input.revision;
|
|
26
|
+
}
|
|
27
|
+
return args;
|
|
28
|
+
}
|
|
29
|
+
case 'cad.create': {
|
|
30
|
+
// No synthetic blank CAD documents. The host/model tooling must first
|
|
31
|
+
// produce an actual validated project document with this authoritative API.
|
|
32
|
+
if (!input.project || typeof input.project !== 'object' || Array.isArray(input.project)
|
|
33
|
+
|| !validId(input.project.id) || !validRevision(input.expected_revision)) {
|
|
34
|
+
throw new Error('cad_run_project_document_and_revision_required');
|
|
35
|
+
}
|
|
36
|
+
return { project: input.project, expected_revision: input.expected_revision,
|
|
37
|
+
...(typeof input.message === 'string' ? { message: input.message.slice(0,2000) } : {}) };
|
|
38
|
+
}
|
|
39
|
+
case 'cad.edit': {
|
|
40
|
+
if (!validId(input.project_id) || !validRevision(input.expected_revision)
|
|
41
|
+
|| !input.operation || typeof input.operation !== 'object' || Array.isArray(input.operation)
|
|
42
|
+
|| typeof input.operation.type !== 'string') {
|
|
43
|
+
throw new Error('cad_run_edit_operation_and_revision_required');
|
|
44
|
+
}
|
|
45
|
+
return { project_id: input.project_id, expected_revision: input.expected_revision,
|
|
46
|
+
operation: input.operation,
|
|
47
|
+
...(typeof input.message === 'string' ? { message: input.message.slice(0,2000) } : {}) };
|
|
48
|
+
}
|
|
49
|
+
case 'cad.export': {
|
|
50
|
+
if (!validId(input.project_id) || !['glb','stl','obj'].includes(input.format)
|
|
51
|
+
|| (input.revision !== undefined && (!validRevision(input.revision) || input.revision < 1))) {
|
|
52
|
+
throw new Error('cad_run_export_project_format_required');
|
|
53
|
+
}
|
|
54
|
+
return { project_id: input.project_id, format: input.format,
|
|
55
|
+
...(input.revision !== undefined ? { revision: input.revision } : {}) };
|
|
56
|
+
}
|
|
57
|
+
case 'cad.generate': {
|
|
58
|
+
if (!validId(input.project_id) || !validId(input.workspace_id)
|
|
59
|
+
|| !['freecad','blender','openscad'].includes(input.engine)
|
|
60
|
+
|| typeof input.prompt !== 'string' || input.prompt.trim().length < 3
|
|
61
|
+
|| input.prompt.length > 12000) {
|
|
62
|
+
throw new Error('cad_run_generation_scope_engine_prompt_required');
|
|
63
|
+
}
|
|
64
|
+
return { project_id: input.project_id, workspace_id: input.workspace_id,
|
|
65
|
+
engine: input.engine, prompt: input.prompt.trim() };
|
|
66
|
+
}
|
|
67
|
+
default: throw new Error('cad_run_unknown_mode');
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export async function executeCadRunMode({ mode, input }, { sam, authorizeMode } = {}) {
|
|
72
|
+
const definition = CAD_RUN_MODES[mode];
|
|
73
|
+
if (!definition) throw new Error('cad_run_unknown_mode');
|
|
74
|
+
if (!sam || typeof sam.invoke !== 'function') throw new Error('cad_run_sam_runtime_unavailable');
|
|
75
|
+
// Validate BEFORE authorization to avoid granting permissions for unknown input.
|
|
76
|
+
const args = paramsForMode(mode, input);
|
|
77
|
+
if (typeof authorizeMode !== 'function') throw new Error('cad_run_mode_authorization_required');
|
|
78
|
+
const authorized = await authorizeMode({ mode, operation: definition.operation, effect: definition.effect, input: args });
|
|
79
|
+
if (authorized !== true) throw new Error('cad_run_mode_denied');
|
|
80
|
+
// SAM performs its own principal/project scope checks, tool permissions,
|
|
81
|
+
// provider/runner availability and explicit approval on write/export.
|
|
82
|
+
const result = await sam.invoke(definition.operation, args);
|
|
83
|
+
if (result?.ok === false || result?.status === 'error') {
|
|
84
|
+
throw new Error(result?.error?.message || result?.error || 'cad_run_operation_failed');
|
|
85
|
+
}
|
|
86
|
+
return Object.freeze({ schema: 'agentsam.cad.run.v1', mode, operation: definition.operation, result });
|
|
87
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CMS_COMPATIBILITY_ALIASES } from '../../../../packages/agentsam-cms/src/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CMS_OPERATION_CONTRACTS, CMS_CONTRACTS_BY_NAME } from '../../../../packages/agentsam-cms/src/index.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createCmsOperations as createPortableCmsOperations, validateCmsSchema } from '../../../../packages/agentsam-cms/src/index.js';
|
|
2
|
+
import { defineSamOperation } from '../../define.js';
|
|
3
|
+
export { validateCmsSchema };
|
|
4
|
+
export function createCmsOperations(options = {}) {
|
|
5
|
+
return createPortableCmsOperations({ ...options, defineSamOperation });
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createNodeSqliteCmsRepository } from '../../../../packages/agentsam-cms/src/node.js';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { repositoryInspect } from '../operations/repository-inspect.js';
|
|
2
|
+
import { brandScanOp } from '../operations/brand-scan.js';
|
|
3
|
+
import { securityScanOp } from '../operations/security-scan.js';
|
|
4
|
+
import { terminalExecOp } from '../operations/terminal-exec.js';
|
|
5
|
+
import { cadBlenderInspectOp } from '../operations/cad-blender-inspect.js';
|
|
6
|
+
import { codebaseindexIngestOp } from '../operations/codebaseindex-ingest.js';
|
|
7
|
+
import { planningAstarOp } from '../operations/planning-astar.js';
|
|
8
|
+
import { planningGoapOp } from '../operations/planning-goap.js';
|
|
9
|
+
import { decisionEvaluateOp } from '../operations/decision-evaluate.js';
|
|
10
|
+
import { artifactRenderOp } from '../operations/artifact-render.js';
|
|
11
|
+
import { packageAuditOp } from '../operations/package-audit.js';
|
|
12
|
+
import { roboticsOps } from '../operations/robotics.js';
|
|
13
|
+
|
|
14
|
+
export const CORE_OPERATIONS = [
|
|
15
|
+
repositoryInspect,
|
|
16
|
+
brandScanOp,
|
|
17
|
+
securityScanOp,
|
|
18
|
+
terminalExecOp,
|
|
19
|
+
cadBlenderInspectOp,
|
|
20
|
+
codebaseindexIngestOp,
|
|
21
|
+
planningAstarOp,
|
|
22
|
+
planningGoapOp,
|
|
23
|
+
decisionEvaluateOp,
|
|
24
|
+
packageAuditOp,
|
|
25
|
+
artifactRenderOp,
|
|
26
|
+
...roboticsOps,
|
|
27
|
+
];
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# AgentSamEvidence (`sam.evidence.*`)
|
|
2
|
+
|
|
3
|
+
Systematic capture of agent work: stills, recordings, traces and receipts stored under one numbered,
|
|
4
|
+
named layout, so a capture can feed QA, a changelog, a case study or an editor, and so names never drift.
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
sam.evidence.begin declare flows, steps, states, viewports and checks before capturing
|
|
8
|
+
sam.evidence.capture capture an asset against a declared state (optionally across the viewport matrix)
|
|
9
|
+
sam.evidence.seal verify coverage and codecs, derive web copies, compute facts, write the manifest last
|
|
10
|
+
sam.evidence.deliver serve a sealed run read-only on loopback (port 0 by default)
|
|
11
|
+
sam.evidence.compare pair the same state across two sealed runs and crop what changed
|
|
12
|
+
sam.evidence.ingest plan (default) or apply importing an existing folder into the canonical layout
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Use from a terminal (any agent)
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
agentsam sam evidence doctor
|
|
19
|
+
agentsam sam evidence begin --input begin.json
|
|
20
|
+
agentsam sam evidence capture --input - < capture.json
|
|
21
|
+
agentsam sam evidence seal --input seal.json
|
|
22
|
+
agentsam sam evidence audit <dir> --allow <dir>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Input and output are JSON. The store is `<project>/.agentsam/evidence` (git-ignored). `doctor` reports exactly
|
|
26
|
+
which adapters are wired. The read-only stdio bridge deliberately cannot reach these operations.
|
|
27
|
+
|
|
28
|
+
## Names cannot drift
|
|
29
|
+
|
|
30
|
+
- One viewport vocabulary (`viewports.js`): `mobile-390x844`, `tablet-768x1024`, `desktop-1440x900`, and four more.
|
|
31
|
+
Viewport is a folder, so file names are identical across sizes.
|
|
32
|
+
- Files are `Flow-Step-State[variant]-Name.ext`, zero-padded and CamelCase, checked on every write.
|
|
33
|
+
- A subject cannot contain a date or a version. Those live in the run id and the series.
|
|
34
|
+
- `seal` flags any file in a run that the pack did not write (`noncanonical_files:<n>`).
|
|
35
|
+
- `ingest` maps legacy folders ("iphone", "390", "1440-detail") onto the vocabulary; originals are never touched.
|
|
36
|
+
|
|
37
|
+
## Layout
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
<subject>--<YYYYMMDD>--<run7>/
|
|
41
|
+
README.md review.html facts.json evidence.manifest.json (written last)
|
|
42
|
+
01-Brief/<Name>.<ext> 02-Recon/<date>/<Name>.<ext>
|
|
43
|
+
03-Flow/flow.map.json
|
|
44
|
+
04-Build/<date>/<FF-Flow>/<viewport>/<FF-SS-NN[variant]-Name>.<ext> (+ .evidence.json sidecars)
|
|
45
|
+
05-Review/<date>/... web copies 05-Review/Final/ approved set 05-Review/compare/<earlier-run>/
|
|
46
|
+
06-Handoff/ covers/ markers.*.srt screenplay.md/.json project.copro.json assets.json
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Keys are slug paths under `<project-slug>/`; ids belong in manifest fields only.
|
|
50
|
+
|
|
51
|
+
## Adapters (all optional, all injected)
|
|
52
|
+
|
|
53
|
+
`sources` capture drivers (`playwright`, `blender-camera`) · `media` (ffprobe) · `derive` (sharp: WebP/AVIF ladder,
|
|
54
|
+
covers; ffmpeg: web MP4 and posters) · `images` (sharp, for compare) · `facts` (git) · `exporters` (copro).
|
|
55
|
+
Without `media`, a video run is `degraded` with `media_unverified`. Without `derive`, originals ship as they are.
|
|
56
|
+
|
|
57
|
+
## Status
|
|
58
|
+
|
|
59
|
+
Computed from the tree: `verified`, `degraded` (missing, unreported, unverified or drifted) or `failed`.
|
|
60
|
+
A capture failure returns `{ ok: false, error }` and never throws into the agent's task.
|
|
61
|
+
|
|
62
|
+
## Not included
|
|
63
|
+
|
|
64
|
+
The viewer-side "open evidence package" action lives in the editor app, not here. `deliver` serves the package
|
|
65
|
+
and the generated `review.html`. Hosted (container) Blender execution plugs into the same `exec` shape.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
const TILE = 16;
|
|
2
|
+
const THRESHOLD = 48;
|
|
3
|
+
const PAD = 24;
|
|
4
|
+
const MAX_REGIONS = 8;
|
|
5
|
+
|
|
6
|
+
async function decode(sharp, bytes) {
|
|
7
|
+
const { data, info } = await sharp(bytes).ensureAlpha().raw().toBuffer({ resolveWithObject: true });
|
|
8
|
+
return { data, width: info.width, height: info.height };
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function diffTiles(a, b) {
|
|
12
|
+
const { width, height } = a;
|
|
13
|
+
const cols = Math.ceil(width / TILE);
|
|
14
|
+
const rows = Math.ceil(height / TILE);
|
|
15
|
+
const tiles = new Uint8Array(cols * rows);
|
|
16
|
+
let changed = 0;
|
|
17
|
+
for (let y = 0; y < height; y += 1) {
|
|
18
|
+
for (let x = 0; x < width; x += 1) {
|
|
19
|
+
const i = (y * width + x) * 4;
|
|
20
|
+
const d = Math.abs(a.data[i] - b.data[i]) + Math.abs(a.data[i + 1] - b.data[i + 1]) + Math.abs(a.data[i + 2] - b.data[i + 2]);
|
|
21
|
+
if (d > THRESHOLD) { changed += 1; tiles[Math.floor(y / TILE) * cols + Math.floor(x / TILE)] = 1; }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return { tiles, cols, rows, changed };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function regionsFrom({ tiles, cols, rows }, width, height) {
|
|
28
|
+
const seen = new Uint8Array(tiles.length);
|
|
29
|
+
const out = [];
|
|
30
|
+
for (let start = 0; start < tiles.length; start += 1) {
|
|
31
|
+
if (!tiles[start] || seen[start]) continue;
|
|
32
|
+
const stack = [start];
|
|
33
|
+
seen[start] = 1;
|
|
34
|
+
let minC = cols; let maxC = -1; let minR = rows; let maxR = -1; let count = 0;
|
|
35
|
+
while (stack.length > 0) {
|
|
36
|
+
const cur = stack.pop();
|
|
37
|
+
const c = cur % cols;
|
|
38
|
+
const r = Math.floor(cur / cols);
|
|
39
|
+
count += 1;
|
|
40
|
+
minC = Math.min(minC, c); maxC = Math.max(maxC, c); minR = Math.min(minR, r); maxR = Math.max(maxR, r);
|
|
41
|
+
for (let dr = -1; dr <= 1; dr += 1) for (let dc = -1; dc <= 1; dc += 1) {
|
|
42
|
+
const nc = c + dc; const nr = r + dr;
|
|
43
|
+
if (nc < 0 || nr < 0 || nc >= cols || nr >= rows) continue;
|
|
44
|
+
const n = nr * cols + nc;
|
|
45
|
+
if (tiles[n] && !seen[n]) { seen[n] = 1; stack.push(n); }
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
out.push({ x: minC * TILE, y: minR * TILE, w: Math.min((maxC + 1) * TILE, width) - minC * TILE, h: Math.min((maxR + 1) * TILE, height) - minR * TILE, tiles: count });
|
|
49
|
+
}
|
|
50
|
+
return out.sort((a, b) => b.tiles - a.tiles).slice(0, MAX_REGIONS);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Pair stills by phase, state, viewport and variant across two sealed runs of the same project, and
|
|
55
|
+
* crop what changed side by side (then | now). Results are written under the newer run. Needs `sharp`.
|
|
56
|
+
*/
|
|
57
|
+
export async function compareRuns({ sharp, store, rootA, rootB, runA, manifestA, manifestB, now }) {
|
|
58
|
+
const stills = (m) => m.assets.filter((a) => a.kind === 'still' && a.contentType === 'image/png');
|
|
59
|
+
const keyOf = (a) => [a.phase, a.stateId ?? '', a.viewport ?? '', a.variant ?? ''].join('|');
|
|
60
|
+
const unmatchedA = new Map(stills(manifestA).map((a) => [keyOf(a), a]));
|
|
61
|
+
const base = `05-Review/compare/${runA}`;
|
|
62
|
+
const pairs = [];
|
|
63
|
+
const unmatchedB = [];
|
|
64
|
+
for (const assetB of stills(manifestB)) {
|
|
65
|
+
const assetA = unmatchedA.get(keyOf(assetB));
|
|
66
|
+
if (!assetA) { unmatchedB.push(assetB.key); continue; }
|
|
67
|
+
unmatchedA.delete(keyOf(assetB));
|
|
68
|
+
const label = { stateId: assetB.stateId ?? null, viewport: assetB.viewport ?? null, variant: assetB.variant ?? null, a: assetA.key, b: assetB.key };
|
|
69
|
+
const [bufA, bufB] = await Promise.all([store.get(`${rootA}/${assetA.key}`), store.get(`${rootB}/${assetB.key}`)]);
|
|
70
|
+
if (!bufA || !bufB) { pairs.push({ ...label, status: 'unreadable', regions: [] }); continue; }
|
|
71
|
+
if (assetA.sha256 === assetB.sha256) { pairs.push({ ...label, status: 'unchanged', changedRatio: 0, regions: [] }); continue; }
|
|
72
|
+
const [da, db] = await Promise.all([decode(sharp, bufA), decode(sharp, bufB)]);
|
|
73
|
+
if (da.width !== db.width || da.height !== db.height) {
|
|
74
|
+
pairs.push({ ...label, status: 'dimension_changed', sizeA: [da.width, da.height], sizeB: [db.width, db.height], regions: [] });
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
const diff = diffTiles(da, db);
|
|
78
|
+
const regions = [];
|
|
79
|
+
let n = 0;
|
|
80
|
+
for (const r of regionsFrom(diff, da.width, da.height)) {
|
|
81
|
+
const left = Math.max(0, r.x - PAD); const top = Math.max(0, r.y - PAD);
|
|
82
|
+
const width = Math.min(da.width, r.x + r.w + PAD) - left; const height = Math.min(da.height, r.y + r.h + PAD) - top;
|
|
83
|
+
const [cropA, cropB] = await Promise.all([
|
|
84
|
+
sharp(bufA).extract({ left, top, width, height }).png().toBuffer(), sharp(bufB).extract({ left, top, width, height }).png().toBuffer(),
|
|
85
|
+
]);
|
|
86
|
+
const sheet = await sharp({ create: { width: width * 2 + 8, height, channels: 4, background: { r: 24, g: 24, b: 24, alpha: 1 } } })
|
|
87
|
+
.composite([{ input: cropA, left: 0, top: 0 }, { input: cropB, left: width + 8, top: 0 }]).png().toBuffer();
|
|
88
|
+
n += 1;
|
|
89
|
+
const name = `${assetB.stateId ?? 'brief'}${assetB.variant ?? ''}${assetB.viewport ? `-${assetB.viewport}` : ''}-r${n}.png`;
|
|
90
|
+
await store.put(`${rootB}/${base}/${name}`, sheet);
|
|
91
|
+
regions.push({ x: left, y: top, w: width, h: height, key: `${base}/${name}` });
|
|
92
|
+
}
|
|
93
|
+
pairs.push({ ...label, status: diff.changed === 0 ? 'unchanged' : 'changed', changedRatio: Number((diff.changed / (da.width * da.height)).toFixed(6)), regions });
|
|
94
|
+
}
|
|
95
|
+
const doc = { schema: 'agentsam.evidence.compare.v1', a: runA, b: manifestB.runId, createdAt: now().toISOString(), pairs, unmatchedA: [...unmatchedA.values()].map((a) => a.key), unmatchedB };
|
|
96
|
+
await store.put(`${rootB}/${base}/compare.json`, `${JSON.stringify(doc, null, 2)}\n`);
|
|
97
|
+
return { ...doc, key: `${base}/compare.json` };
|
|
98
|
+
}
|