@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,65 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { createGeneratedSamOperations, validateSamInput } from '../operation-pack.js';
|
|
4
|
+
import { OPERATION_CATALOG } from '../catalog.js';
|
|
5
|
+
const identity = { accountId:'acct_a', actorId:'au_a',installationId:'install_a' };
|
|
6
|
+
function makePack(opts={}) {
|
|
7
|
+
const registry=new Map();
|
|
8
|
+
const info=createGeneratedSamOperations({
|
|
9
|
+
defineSamOperation: x => x,
|
|
10
|
+
registerSamOperation: x => registry.set(x.id,x),
|
|
11
|
+
getSamOperation: x => registry.get(x),
|
|
12
|
+
resolveTrustedContext:async()=>identity,
|
|
13
|
+
authorize:async()=>true,
|
|
14
|
+
handlers: opts.handlers || {},
|
|
15
|
+
});
|
|
16
|
+
return {registry,info};
|
|
17
|
+
}
|
|
18
|
+
test('all catalog names unique, including canonical image background remove',()=>{
|
|
19
|
+
const names=OPERATION_CATALOG.map(x=>x.name);
|
|
20
|
+
assert.equal(names.length,new Set(names).size);
|
|
21
|
+
assert.ok(names.includes('media.image.background.remove'));
|
|
22
|
+
assert.ok(names.includes('media.image.generate'));
|
|
23
|
+
assert.ok(names.includes('media.image.edit'));
|
|
24
|
+
});
|
|
25
|
+
test('only bound domain tools are registered, no magical Bash dependency',async()=>{
|
|
26
|
+
const {registry,info}=makePack({handlers:{'cms.page.inspect':async()=>({ok:true,id:'p'})}});
|
|
27
|
+
assert.deepEqual([...registry.keys()],['cms.page.inspect']);
|
|
28
|
+
assert.ok(info.unavailable.some(x=>x.name==='sam.superbash'&&x.reason==='handler_not_bound'));
|
|
29
|
+
assert.equal((await registry.get('cms.page.inspect').handler({pageId:'x'},{})).id,'p');
|
|
30
|
+
});
|
|
31
|
+
test('already owned CMS domain operations are not misreported as generated-v2 unavailable',()=>{
|
|
32
|
+
const existing = new Set(['cms.definition.list','cms.page.createDraft','cms.page.publish']);
|
|
33
|
+
const info = createGeneratedSamOperations({
|
|
34
|
+
defineSamOperation:x=>x,
|
|
35
|
+
registerSamOperation:()=>{throw new Error('should_not_register_existing');},
|
|
36
|
+
getSamOperation:id=>existing.has(id)?{id}:null,
|
|
37
|
+
resolveTrustedContext:async()=>identity,
|
|
38
|
+
authorize:async()=>true,
|
|
39
|
+
});
|
|
40
|
+
for(const name of existing) {
|
|
41
|
+
assert.ok(info.registered.some(x=>x.name===name&&x.status==='existing'));
|
|
42
|
+
assert.equal(info.unavailable.some(x=>x.name===name),false);
|
|
43
|
+
}
|
|
44
|
+
assert.equal(info.unavailable.some(x=>x.name==='cms.section.updateDraft'),true);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test('sam.superbash requires exactly one source, not both',()=>{
|
|
48
|
+
const schema=OPERATION_CATALOG.find(x=>x.name==='sam.superbash').input_schema;
|
|
49
|
+
assert.throws(()=>validateSamInput({},schema),/exactly_one_source/);
|
|
50
|
+
assert.throws(()=>validateSamInput({script:'echo hello',scriptArtifactRef:'s1'},schema),/exactly_one_source/);
|
|
51
|
+
assert.doesNotThrow(()=>validateSamInput({script:'echo hello'},schema));
|
|
52
|
+
});
|
|
53
|
+
test('auth controls execution and handles are not promoted to success',async()=>{
|
|
54
|
+
const {registry}=makePack({handlers:{'cms.page.inspect':async()=>({ok:false,error:'failed'})}});
|
|
55
|
+
await assert.rejects(registry.get('cms.page.inspect').handler({pageId:'a'},{}),/failed/);
|
|
56
|
+
await assert.rejects(registry.get('cms.page.inspect').handler({pageId:'a',accountId:'other'},{}),/unknown_field/);
|
|
57
|
+
});
|
|
58
|
+
test('denied authorization prevents executor call',async()=>{
|
|
59
|
+
let called=false; const registry=new Map();
|
|
60
|
+
createGeneratedSamOperations({defineSamOperation:x=>x,registerSamOperation:x=>registry.set(x.id,x),
|
|
61
|
+
resolveTrustedContext:async()=>identity,authorize:async()=>false,
|
|
62
|
+
handlers:{'cms.page.inspect':async()=>{called=true;return {};}}});
|
|
63
|
+
await assert.rejects(registry.get('cms.page.inspect').handler({pageId:'1'},{}),/denied/);
|
|
64
|
+
assert.equal(called,false);
|
|
65
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import {createScriptHandlers} from '../scripts.js';
|
|
4
|
+
const ctx={accountId:'acct_a',actorId:'au_a',installationId:'inst_a',authorizedLaneRef:'owned-device'};
|
|
5
|
+
test('save/get are separate from shell execution and version constrained by store',async()=>{
|
|
6
|
+
const saved=[];const store={saveVersion:async args=>{saved.push(args);return {scriptId:'script-a',version:1}},getVersion:async()=>({scriptId:'script-a',script:'echo hi',version:1})};
|
|
7
|
+
const h=createScriptHandlers({scriptStore:store});
|
|
8
|
+
assert.ok(h['sam.script.save']);assert.ok(h['sam.script.get']);assert.equal(h['sam.superbash'],undefined);
|
|
9
|
+
const s=await h['sam.script.save']({script:'echo hi'},ctx);
|
|
10
|
+
assert.equal(s.version,1);assert.equal(saved[0].accountId,'acct_a');
|
|
11
|
+
});
|
|
12
|
+
test('superbash calls authorized injected ExecOS process runtime, model cannot pick lane',async()=>{
|
|
13
|
+
const args=[];const h=createScriptHandlers({processRuntime:{executeScript:async a=>{args.push(a);return {executionId:'ex1',status:'completed',exitCode:0}}}});
|
|
14
|
+
const out=await h['sam.superbash']({script:'echo safe',relativeCwd:'.'},ctx);
|
|
15
|
+
assert.equal(out.executionId,'ex1');assert.equal(args[0].laneRef,'owned-device');assert.equal(args[0].actorId,'au_a');
|
|
16
|
+
});
|
|
17
|
+
test('nonzero exit is not success and missing identity cannot execute',async()=>{
|
|
18
|
+
const h=createScriptHandlers({processRuntime:{executeScript:async()=>({executionId:'ex2',status:'failed',exitCode:3})}});
|
|
19
|
+
const failed = await h['sam.superbash']({script:'exit 3'},ctx);
|
|
20
|
+
assert.equal(failed.ok,false);
|
|
21
|
+
assert.equal(failed.exitCode,3);
|
|
22
|
+
assert.equal(failed.error.code,'script_execution_failed');
|
|
23
|
+
for (const result of [
|
|
24
|
+
{executionId:'queued',status:'queued',exitCode:0},
|
|
25
|
+
{executionId:'timeout',status:'timed_out',exitCode:-1},
|
|
26
|
+
{executionId:'unknown',status:'completed'},
|
|
27
|
+
]) {
|
|
28
|
+
const check=createScriptHandlers({processRuntime:{executeScript:async()=>result}});
|
|
29
|
+
assert.equal((await check['sam.superbash']({script:'pwd'},ctx)).ok,false);
|
|
30
|
+
}
|
|
31
|
+
await assert.rejects(h['sam.superbash']({script:'pwd'},{}),/trusted_identity_required/);
|
|
32
|
+
});
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Superbash through AgentSamClient with the REAL local adapters (bash runtime + versioned script store).
|
|
3
|
+
*
|
|
4
|
+
* What this proves is why superbash exists: repetitive, deterministic work (repo sweeps, audits, inventories)
|
|
5
|
+
* runs as one saved script instead of many LLM tool calls — the model sends a short artifact ref, gets a
|
|
6
|
+
* compact digest back, and the receipt shows zero provider calls. Output is bounded, redacted and
|
|
7
|
+
* environment-isolated before anything can reach a model.
|
|
8
|
+
*/
|
|
9
|
+
import test, { after, before } from 'node:test';
|
|
10
|
+
import assert from 'node:assert/strict';
|
|
11
|
+
import { createHash } from 'node:crypto';
|
|
12
|
+
import { execFileSync, spawnSync } from 'node:child_process';
|
|
13
|
+
import fs from 'node:fs';
|
|
14
|
+
import os from 'node:os';
|
|
15
|
+
import path from 'node:path';
|
|
16
|
+
import { AgentSamClient } from '../../../client.js';
|
|
17
|
+
import { createGeneratedSamOperations } from '../operation-pack.js';
|
|
18
|
+
import { createLocalScriptRuntime, isLocalBashAvailable } from '../../../adapters/local-script-runtime.js';
|
|
19
|
+
import { createLocalScriptStore } from '../../../adapters/local-script-store.js';
|
|
20
|
+
|
|
21
|
+
const identity = { accountId: 'test-account', actorId: 'test-actor', installationId: 'test-installation', authorizedLaneRef: 'local' };
|
|
22
|
+
const sha = (value) => createHash('sha256').update(value).digest('hex');
|
|
23
|
+
const canRun = isLocalBashAvailable() && spawnSync('git', ['--version']).status === 0;
|
|
24
|
+
const skip = canRun ? false : 'bash and git are required for real superbash execution';
|
|
25
|
+
|
|
26
|
+
// ---- fixture: three small repos, one project root, one outside dir for escape attempts -------------------------
|
|
27
|
+
const GIT_ENV = {
|
|
28
|
+
...process.env, GIT_AUTHOR_NAME: 't', GIT_AUTHOR_EMAIL: 't@t', GIT_COMMITTER_NAME: 't', GIT_COMMITTER_EMAIL: 't@t',
|
|
29
|
+
GIT_CONFIG_GLOBAL: '/dev/null', GIT_CONFIG_NOSYSTEM: '1',
|
|
30
|
+
};
|
|
31
|
+
const scratch = [];
|
|
32
|
+
const tmp = (prefix) => { const dir = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), `superbash-${prefix}-`))); scratch.push(dir); return dir; };
|
|
33
|
+
let fx;
|
|
34
|
+
before(() => {
|
|
35
|
+
if (!canRun) return;
|
|
36
|
+
const project = tmp('project');
|
|
37
|
+
const outside = tmp('outside');
|
|
38
|
+
const repo = (name, commits) => {
|
|
39
|
+
const dir = path.join(project, 'repos', name);
|
|
40
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
41
|
+
const git = (...args) => execFileSync('git', args, { cwd: dir, stdio: 'pipe', env: GIT_ENV });
|
|
42
|
+
git('init', '-q');
|
|
43
|
+
git('symbolic-ref', 'HEAD', 'refs/heads/main');
|
|
44
|
+
for (let i = 1; i <= commits; i++) { fs.writeFileSync(path.join(dir, `f${i}.txt`), String(i)); git('add', '.'); git('commit', '-q', '-m', `c${i}`); }
|
|
45
|
+
return { dir, git };
|
|
46
|
+
};
|
|
47
|
+
repo('alpha', 1); // clean
|
|
48
|
+
const beta = repo('beta', 2); // 1 modified + 1 untracked
|
|
49
|
+
fs.writeFileSync(path.join(beta.dir, 'f1.txt'), 'changed');
|
|
50
|
+
fs.writeFileSync(path.join(beta.dir, 'scratch.txt'), 'x');
|
|
51
|
+
repo('gamma', 3).git('branch', 'wip/x'); // 2 branches
|
|
52
|
+
fs.symlinkSync(outside, path.join(project, 'escape'));
|
|
53
|
+
fx = { project, outside };
|
|
54
|
+
});
|
|
55
|
+
after(() => { for (const dir of scratch) fs.rmSync(dir, { recursive: true, force: true }); });
|
|
56
|
+
|
|
57
|
+
// ---- harness: real runtime + real store, with a spy in front of the runtime -----------------------------------
|
|
58
|
+
function harness({ authorized = true, maxOutputBytes = 4096, runtime = true, store = true } = {}) {
|
|
59
|
+
const operations = new Map();
|
|
60
|
+
const spy = [];
|
|
61
|
+
const local = runtime && fx ? createLocalScriptRuntime({ root: fx.project, maxOutputBytes }) : null;
|
|
62
|
+
const registration = createGeneratedSamOperations({
|
|
63
|
+
defineSamOperation: (x) => x, registerSamOperation: (x) => operations.set(x.id, x), getSamOperation: (id) => operations.get(id),
|
|
64
|
+
resolveTrustedContext: async () => identity, authorize: async () => authorized,
|
|
65
|
+
scriptStore: store ? createLocalScriptStore({ root: tmp('store') }) : undefined,
|
|
66
|
+
processRuntime: local ? { executeScript: async (args) => { spy.push(args); return local.executeScript(args); } } : undefined,
|
|
67
|
+
});
|
|
68
|
+
return { client: new AgentSamClient({ os: { get: (id) => operations.get(id) }, autoSeed: false }), spy, operations, registration };
|
|
69
|
+
}
|
|
70
|
+
const free = (result) => { // deterministic work must cost zero model calls
|
|
71
|
+
assert.equal(result.usage.provider_calls, 0);
|
|
72
|
+
assert.equal(result.receipt.execution.model_used, false);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// One digest function, used by both the single-repo and the sweep script.
|
|
76
|
+
const DIGEST_FN = String.raw`digest() {
|
|
77
|
+
branch=$(git branch --show-current)
|
|
78
|
+
dirty=$(git status --porcelain | wc -l | tr -d ' ')
|
|
79
|
+
untracked=$(git ls-files --others --exclude-standard | wc -l | tr -d ' ')
|
|
80
|
+
commits=$(git rev-list --count HEAD)
|
|
81
|
+
branches=$(git for-each-ref refs/heads --format='%(refname:short)' | wc -l | tr -d ' ')
|
|
82
|
+
stashes=$(git stash list | wc -l | tr -d ' ')
|
|
83
|
+
worktrees=$(git worktree list | wc -l | tr -d ' ')
|
|
84
|
+
printf '{"repo":"%s","branch":"%s","dirty":%s,"untracked":%s,"commits":%s,"branches":%s,"stashes":%s,"worktrees":%s}' \
|
|
85
|
+
"$(basename "$PWD")" "$branch" "$dirty" "$untracked" "$commits" "$branches" "$stashes" "$worktrees"
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
88
|
+
const SINGLE = `${DIGEST_FN}digest; echo\n`;
|
|
89
|
+
const SWEEP = `${DIGEST_FN}sep=""; printf '['; for d in repos/*/; do printf '%s' "$sep"; (cd "$d" && digest); sep=","; done; echo ']'\n`;
|
|
90
|
+
|
|
91
|
+
// ---- tests ----------------------------------------------------------------------------------------------------
|
|
92
|
+
test('superbash and the script library are unavailable without their runtime/store', () => {
|
|
93
|
+
const noRuntime = harness({ runtime: false });
|
|
94
|
+
assert.equal(noRuntime.operations.has('sam.superbash'), false);
|
|
95
|
+
assert.equal(noRuntime.registration.unavailable.find((x) => x.name === 'sam.superbash')?.reason, 'handler_not_bound');
|
|
96
|
+
const noStore = harness({ store: false });
|
|
97
|
+
assert.equal(noStore.operations.has('sam.script.save'), false);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
test('save once, run by ref: a short ref replaces re-sending the script, at zero model cost', { skip }, async () => {
|
|
101
|
+
const { client } = harness();
|
|
102
|
+
const saved = await client.invoke('sam.script.save', { script: SINGLE, description: 'repo digest' });
|
|
103
|
+
assert.equal(saved.ok, true); free(saved);
|
|
104
|
+
const { artifactRef } = saved.data;
|
|
105
|
+
const expected = { alpha: [0, 1, 1], beta: [2, 2, 1], gamma: [0, 3, 2] }; // [dirty, commits, branches]
|
|
106
|
+
for (const [name, [dirty, commits, branches]] of Object.entries(expected)) {
|
|
107
|
+
const input = { scriptArtifactRef: artifactRef, relativeCwd: `repos/${name}` };
|
|
108
|
+
const run = await client.invoke('sam.superbash', input);
|
|
109
|
+
assert.equal(run.ok, true, JSON.stringify(run.error)); free(run);
|
|
110
|
+
const digest = JSON.parse(run.data.stdout);
|
|
111
|
+
assert.deepEqual([digest.repo, digest.branch, digest.dirty, digest.commits, digest.branches], [name, 'main', dirty, commits, branches]);
|
|
112
|
+
assert.ok(run.data.stdout.length < 400, 'the model gets a digest, not a log dump');
|
|
113
|
+
assert.ok(JSON.stringify(input).length * 3 < run.data.scriptBytes, 'the call payload must be far smaller than the script it replaces');
|
|
114
|
+
assert.equal(run.data.scriptHash, sha(SINGLE));
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
test('one sweep call replaces N per-repo tool calls and is reproducible', { skip }, async () => {
|
|
119
|
+
const { client } = harness();
|
|
120
|
+
const a = await client.invoke('sam.superbash', { script: SWEEP });
|
|
121
|
+
const b = await client.invoke('sam.superbash', { script: SWEEP });
|
|
122
|
+
assert.equal(a.ok, true, JSON.stringify(a.error)); free(a);
|
|
123
|
+
const repos = JSON.parse(a.data.stdout);
|
|
124
|
+
assert.deepEqual(repos.map((r) => r.repo), ['alpha', 'beta', 'gamma']);
|
|
125
|
+
assert.equal(repos.find((r) => r.repo === 'beta').untracked, 1);
|
|
126
|
+
assert.equal(a.data.stdout, b.data.stdout); // same script, same answer
|
|
127
|
+
assert.equal(a.data.scriptHash, b.data.scriptHash);
|
|
128
|
+
assert.equal(a.receipt.input_hash, b.receipt.input_hash); // cacheable by hash
|
|
129
|
+
assert.notEqual(a.data.executionId, b.data.executionId); // but each run is its own execution
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
test('script versions are immutable and stale updates are rejected', { skip }, async () => {
|
|
133
|
+
const { client } = harness();
|
|
134
|
+
const v1 = await client.invoke('sam.script.save', { script: 'echo one\n' });
|
|
135
|
+
const v2 = await client.invoke('sam.script.save', { script: 'echo two\n', scriptId: v1.data.scriptId, expectedVersion: 1 });
|
|
136
|
+
assert.equal(v2.data.version, 2);
|
|
137
|
+
const stale = await client.invoke('sam.script.save', { script: 'echo three\n', scriptId: v1.data.scriptId, expectedVersion: 1 });
|
|
138
|
+
assert.equal(stale.ok, false);
|
|
139
|
+
assert.equal(stale.error.message, 'script_version_conflict');
|
|
140
|
+
assert.equal((await client.invoke('sam.script.get', { scriptId: v1.data.scriptId })).data.script, 'echo two\n');
|
|
141
|
+
assert.equal((await client.invoke('sam.superbash', { scriptArtifactRef: v1.data.artifactRef })).data.stdout, 'one\n'); // v1 still runs
|
|
142
|
+
assert.equal((await client.invoke('sam.superbash', { scriptArtifactRef: v2.data.artifactRef })).data.stdout, 'two\n');
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test('failures are structured results, never false success (-e and pipefail are on)', { skip }, async () => {
|
|
146
|
+
const { client } = harness();
|
|
147
|
+
const exit3 = await client.invoke('sam.superbash', { script: 'echo bad >&2; exit 3' });
|
|
148
|
+
assert.equal(exit3.ok, false);
|
|
149
|
+
assert.equal(exit3.data.exitCode, 3);
|
|
150
|
+
assert.match(exit3.data.stderr, /bad/);
|
|
151
|
+
assert.equal(exit3.error.code, 'script_execution_failed');
|
|
152
|
+
const piped = await client.invoke('sam.superbash', { script: 'false | cat; echo SHOULD_NOT_PRINT' });
|
|
153
|
+
assert.equal(piped.ok, false);
|
|
154
|
+
assert.doesNotMatch(piped.data.stdout, /SHOULD_NOT_PRINT/);
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
test('output is bounded before it can reach a model', { skip }, async () => {
|
|
158
|
+
const { client } = harness({ maxOutputBytes: 4096 });
|
|
159
|
+
const flood = await client.invoke('sam.superbash', { script: 'yes x | head -c 200000' });
|
|
160
|
+
assert.equal(flood.ok, false);
|
|
161
|
+
assert.equal(flood.data.status, 'output_limit');
|
|
162
|
+
assert.equal(flood.error.code, 'process_output_limit');
|
|
163
|
+
assert.ok(flood.data.stdout.length <= 4096);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
test('secrets are redacted and the host environment is not inherited', { skip }, async () => {
|
|
167
|
+
const fragment = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
|
168
|
+
const fakes = [['Bearer', fragment].join(' '), ['s', 'k-', fragment, 'ABCD'].join(''), ['gh', 'p_', fragment, 'AB'].join(''), ['aak', '_0967db1234567890abcdef'].join('')];
|
|
169
|
+
process.env.SAM_TEST_HOST_SECRET = 'host-secret-value';
|
|
170
|
+
try {
|
|
171
|
+
const { client } = harness();
|
|
172
|
+
const run = await client.invoke('sam.superbash', {
|
|
173
|
+
script: [`echo "Authorization: ${fakes[0]}"`, `echo "key=${fakes[1]}"`, `echo "${fakes[2]}"`, `echo "AGENTSAM_API_KEY=${fakes[3]}"`, 'echo "host=${SAM_TEST_HOST_SECRET:-unset}"'].join('\n'),
|
|
174
|
+
});
|
|
175
|
+
assert.equal(run.ok, true, JSON.stringify(run.error));
|
|
176
|
+
for (const raw of [fragment, 'aak_0967db']) assert.ok(!run.data.stdout.includes(raw), `${raw} must not reach the model`);
|
|
177
|
+
assert.match(run.data.stdout, /\[REDACTED\]/);
|
|
178
|
+
assert.match(run.data.stdout, /host=unset/);
|
|
179
|
+
} finally { delete process.env.SAM_TEST_HOST_SECRET; }
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
test('the working directory cannot leave the project, including through a symlink', { skip }, async () => {
|
|
183
|
+
const { client, spy } = harness();
|
|
184
|
+
for (const relativeCwd of ['..', 'escape']) {
|
|
185
|
+
const run = await client.invoke('sam.superbash', { script: 'pwd', relativeCwd });
|
|
186
|
+
assert.equal(run.ok, false);
|
|
187
|
+
assert.equal(run.error.message, 'script_relative_cwd_outside_project');
|
|
188
|
+
}
|
|
189
|
+
assert.equal((await client.invoke('sam.superbash', { script: 'pwd', relativeCwd: '/tmp' })).error.message, 'script_relative_cwd_invalid');
|
|
190
|
+
assert.equal(spy.length, 3); // the runtime refused them itself; nothing executed
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
test('exactly one script source is accepted', { skip }, async () => {
|
|
194
|
+
const { client } = harness();
|
|
195
|
+
const saved = await client.invoke('sam.script.save', { script: 'echo a\n' });
|
|
196
|
+
const both = await client.invoke('sam.superbash', { script: 'echo a', scriptArtifactRef: saved.data.artifactRef });
|
|
197
|
+
assert.equal(both.error.code, 'input:exactly_one_source_required');
|
|
198
|
+
assert.equal((await client.invoke('sam.superbash', {})).ok, false);
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
test('trusted lane comes from the host, authorization denies before execution, idempotency keys are only hashed', { skip }, async () => {
|
|
202
|
+
const allowed = harness();
|
|
203
|
+
const run = await allowed.client.invoke('sam.superbash', { script: 'echo hi', idempotencyKey: 'raw-idempotency-key' });
|
|
204
|
+
assert.equal(run.ok, true);
|
|
205
|
+
assert.equal(allowed.spy[0].laneRef, 'local');
|
|
206
|
+
assert.equal(allowed.spy[0].accountId, 'test-account');
|
|
207
|
+
assert.equal(run.data.idempotencyKeyHash, sha('raw-idempotency-key'));
|
|
208
|
+
assert.ok(!JSON.stringify(run).includes('raw-idempotency-key'));
|
|
209
|
+
const smuggled = await allowed.client.invoke('sam.superbash', { script: 'echo hi', laneRef: 'owned-device' });
|
|
210
|
+
assert.equal(smuggled.ok, false); // a model cannot choose its own lane
|
|
211
|
+
assert.equal(allowed.spy.length, 1);
|
|
212
|
+
const denied = harness({ authorized: false });
|
|
213
|
+
assert.equal((await denied.client.invoke('sam.superbash', { script: 'echo hi' })).ok, false);
|
|
214
|
+
assert.equal(denied.spy.length, 0);
|
|
215
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Generated by SAM deterministic code writer; source JSON Schemas are authoritative.
|
|
2
|
+
export interface SamGeneratedInputs {
|
|
3
|
+
"sam.superbash": { "script"?: string; "scriptArtifactRef"?: string; "relativeCwd"?: string; "idempotencyKey"?: string; };
|
|
4
|
+
"sam.script.save": { "script": string; "scriptId"?: string; "expectedVersion"?: number; "description"?: string; };
|
|
5
|
+
"sam.script.get": { "scriptId": string; "version"?: number; };
|
|
6
|
+
"cms.definition.list": { "kind"?: string; "status"?: string; };
|
|
7
|
+
"cms.page.inspect": { "pageId": string; };
|
|
8
|
+
"cms.page.createDraft": { "templateKey": string; "title": string; "path": string; };
|
|
9
|
+
"cms.section.inspect": { "pageId": string; "sectionId": string; };
|
|
10
|
+
"cms.section.create": { "pageId": string; "definitionKey": string; "expectedVersion": number; };
|
|
11
|
+
"cms.section.updateDraft": { "sectionId": string; "settings": { }; "expectedVersion": number; };
|
|
12
|
+
"cms.section.duplicate": { "sectionId": string; "expectedVersion": number; };
|
|
13
|
+
"cms.section.move": { "sectionId": string; "targetIndex": number; "expectedVersion": number; };
|
|
14
|
+
"cms.section.visibility": { "sectionId": string; "visible": boolean; "expectedVersion": number; };
|
|
15
|
+
"cms.section.remove": { "sectionId": string; "expectedVersion": number; };
|
|
16
|
+
"cms.block.add": { "sectionId": string; "definitionKey": string; "parentBlockId"?: string; "expectedVersion": number; };
|
|
17
|
+
"cms.block.update": { "blockId": string; "settings": { }; "expectedVersion": number; };
|
|
18
|
+
"cms.block.move": { "blockId": string; "targetIndex": number; "expectedVersion": number; };
|
|
19
|
+
"cms.block.remove": { "blockId": string; "expectedVersion": number; };
|
|
20
|
+
"cms.page.publish": { "pageId": string; "expectedVersion": number; };
|
|
21
|
+
"media.asset.inspect": { "assetId": string; };
|
|
22
|
+
"media.asset.upload": { "sourceArtifactRef": string; "filename": string; "contentType"?: string; };
|
|
23
|
+
"media.asset.prepare": { "assetId": string; "operations": Array<{ "kind": "optimize" | "resize" | "crop" | "convert" | "trim_alpha" | "normalize_color"; "width"?: number; "height"?: number; "left"?: number; "top"?: number; "format"?: "png" | "jpeg" | "webp"; "quality"?: number; "fit"?: "inside" | "cover" | "contain" | "fill"; "allowUpscale"?: boolean; }>; "expectedVersion": number; "idempotencyKey"?: string; };
|
|
24
|
+
"media.asset.job.status": { "jobId": string; };
|
|
25
|
+
"media.asset.background.remove": { "assetId": string; "method"?: string; };
|
|
26
|
+
"media.asset.versions.list": { "assetId": string; };
|
|
27
|
+
"media.model.inspect": { "assetId": string; };
|
|
28
|
+
"media.model.validate": { "assetId": string; };
|
|
29
|
+
"media.model.optimize": { "assetId": string; "profile": "web" | "mobile" | "original_preserving"; "expectedVersion"?: number; };
|
|
30
|
+
"product.artwork.preflight": { "assetId": string; "productId": string; "placement"?: string; };
|
|
31
|
+
"cloudflare.r2.buckets.list": { "connectionRef"?: string; };
|
|
32
|
+
"cloudflare.r2.objects.inventory": { "bucketRef": string; "prefix"?: string; "cursor"?: string; "pageSize"?: number; };
|
|
33
|
+
"media.image.background.remove": { "assetId": string; "method"?: "flat_connected" | "subject_ai"; "tolerance"?: number; "idempotencyKey"?: string; };
|
|
34
|
+
"media.image.generate": { "prompt": string; "model"?: string; "size"?: string; "variations"?: number; };
|
|
35
|
+
"media.image.edit": { "prompt": string; "sourceArtifactRef": string; "model"?: string; "size"?: string; };
|
|
36
|
+
"media.image.inspect": { "assetId": string; };
|
|
37
|
+
"media.image.optimize": { "assetId": string; "idempotencyKey"?: string; "format"?: "png" | "webp" | "jpeg"; "quality"?: number; };
|
|
38
|
+
"media.image.resize": { "assetId": string; "idempotencyKey"?: string; "format"?: "png" | "webp" | "jpeg"; "quality"?: number; "width"?: number; "height"?: number; "fit"?: "inside" | "cover" | "contain" | "fill"; "allowUpscale"?: boolean; };
|
|
39
|
+
"media.image.crop": { "assetId": string; "idempotencyKey"?: string; "format"?: "png" | "webp" | "jpeg"; "quality"?: number; "left": number; "top": number; "width": number; "height": number; };
|
|
40
|
+
"media.image.convert": { "assetId": string; "idempotencyKey"?: string; "format"?: "png" | "webp" | "jpeg"; "quality"?: number; };
|
|
41
|
+
"media.image.trim_alpha": { "assetId": string; "idempotencyKey"?: string; "format"?: "png" | "webp" | "jpeg"; "quality"?: number; };
|
|
42
|
+
"media.image.normalize_color": { "assetId": string; "idempotencyKey"?: string; "format"?: "png" | "webp" | "jpeg"; "quality"?: number; };
|
|
43
|
+
"media.model.validateStructural": { "assetId": string; };
|
|
44
|
+
"media.artwork.normalize": { "assetId": string; "profile": string; "idempotencyKey"?: string; };
|
|
45
|
+
"media.artwork.vector.trace": { "assetId": string; "profile"?: string; };
|
|
46
|
+
"media.artwork.svg.normalize": { "assetId": string; };
|
|
47
|
+
}
|
|
48
|
+
export type SamGeneratedToolName = keyof SamGeneratedInputs;
|
|
49
|
+
export interface SamGeneratedOperationResult { ok?: boolean; [key: string]: unknown }
|
|
50
|
+
export interface SamGeneratedAssetStore {
|
|
51
|
+
getOwnedAsset(input: {assetId: string; accountId: string; actorId: string; installationId: string}): Promise<{id:string; accountId:string; bytes: Uint8Array}|null>;
|
|
52
|
+
writeDerivative(input: {sourceAssetId: string; accountId: string; actorId: string; installationId: string; bytes: Uint8Array; preservation: "retain_original"; [key:string]: unknown}): Promise<{id:string}>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineSamOperation } from '../define.js';
|
|
2
|
+
import { renderSamArtifact } from '../artifacts/render.js';
|
|
3
|
+
|
|
4
|
+
export const artifactRenderOp = defineSamOperation({
|
|
5
|
+
id: 'artifact.render', version: 1, module: 'artifact', action: 'render',
|
|
6
|
+
summary: 'Render evidence-backed findings, plans and wireframe sections to portable HTML and Markdown.',
|
|
7
|
+
purpose: 'Turn already verified or explicitly unverified structured work into a presentable artifact.',
|
|
8
|
+
outcome: 'Return an in-memory HTML/Markdown bundle and SHA-256 manifest; no implicit filesystem writes.',
|
|
9
|
+
description: 'Deterministic SAM artifact composition; caller owns findings, evidence and storage.',
|
|
10
|
+
execution: { lanes: ['local','remote','sandbox'], model:'never', embedding:'never',network:'never',sideEffects:'none',provider_spend:'never' },
|
|
11
|
+
risk: 'read_only', capabilities: ['artifact.render'], artifacts:['sam.artifact.bundle.v1'],
|
|
12
|
+
status:'stable', handler(input={}) {return renderSamArtifact(input);}
|
|
13
|
+
});
|
|
@@ -40,8 +40,18 @@ export const repositoryInspect = defineSamOperation({
|
|
|
40
40
|
artifacts: ['repository.snapshot', 'evidence.refs'],
|
|
41
41
|
cli: { command: [['inspect']] },
|
|
42
42
|
docs: { section: 'Repository', examples: ['repository-inspect-basic'] },
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
// This operation accepts root/cwd; the repository.snapshot capability
|
|
44
|
+
// schema requires cwd + churnDays and is not a valid model-facing contract
|
|
45
|
+
// for repository.inspect. Keep a truthful, directly consumable input schema.
|
|
46
|
+
input_schema: {
|
|
47
|
+
type: 'object',
|
|
48
|
+
additionalProperties: false,
|
|
49
|
+
properties: {
|
|
50
|
+
root: { type: 'string', minLength: 1 },
|
|
51
|
+
cwd: { type: 'string', minLength: 1 },
|
|
52
|
+
churnDays: { type: 'integer', minimum: 1, maximum: 3650 },
|
|
53
|
+
},
|
|
54
|
+
},
|
|
45
55
|
status: 'stable',
|
|
46
56
|
async handler(input = {}, ctx = {}) {
|
|
47
57
|
const root = typeof input === 'string'
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineSamOperation } from '../define.js';
|
|
2
|
+
import { createWorld, locateObject, squareToWorld, applyRelocation } from '../robotics/world.js';
|
|
3
|
+
import { FRANKA, checkJointLimits, reachable, planTrajectory, relocationSequence } from '../robotics/franka.js';
|
|
4
|
+
import { buildExecutionReceipt, cacheKey, MotionCache } from '../robotics/receipt.js';
|
|
5
|
+
import { hashJson } from '../result.js';
|
|
6
|
+
|
|
7
|
+
const cache = new MotionCache();
|
|
8
|
+
const exec = { lanes: ['local', 'sandbox'], model: 'never', embedding: 'never', network: 'none', sideEffects: 'none', provider_spend: 'none' };
|
|
9
|
+
const mk = (id, action, summary, handler) => defineSamOperation({
|
|
10
|
+
id, version: 1, module: 'robotics', action, summary, purpose: summary, outcome: 'Deterministic robotics evidence; zero model calls.',
|
|
11
|
+
skill: { id: 'agentsam-app-fundamentals', help: true }, execution: exec, risk: 'read_only',
|
|
12
|
+
capabilities: [id], artifacts: ['robotics.receipt'], status: 'stable', handler,
|
|
13
|
+
});
|
|
14
|
+
const needWorld = (i) => { if (!i?.world?.objects) throw new Error('invalid_input:world_required'); };
|
|
15
|
+
|
|
16
|
+
export const roboticsOps = [
|
|
17
|
+
mk('robotics.scene.inspect', 'scene.inspect', 'Inspect structured robotics world state', async (i = {}) => { needWorld(i); return { schema: i.world.schema, scene_hash: i.world.scene_hash, objects: i.world.objects.length, frames: i.world.frames, source: i.world.source ?? null, evidence: { scene_hash: i.world.scene_hash, deterministic: true } }; }),
|
|
18
|
+
mk('robotics.object.locate', 'object.locate', 'Locate object by stable identity', async (i = {}) => { needWorld(i); return locateObject(i.world, i.object_id); }),
|
|
19
|
+
mk('robotics.grasp.plan', 'grasp.plan', 'Plan grasp sequence (Mode A visual / Mode B physics)', async (i = {}) => relocationSequence({ mode: i.mode || 'A', measured: i.measured })),
|
|
20
|
+
mk('robotics.motion.plan', 'motion.plan', 'Plan joint-space trajectory to a square/pose', async (i = {}) => {
|
|
21
|
+
needWorld(i); const loc = locateObject(i.world, i.object_id); if (!loc.found) return { ok: false, status: 'not_found', error: 'object_not_found' };
|
|
22
|
+
const dest = i.to_square ? squareToWorld(i.to_square) : i.to_pose; const reach = reachable(dest);
|
|
23
|
+
if (!reach.ok) return { ok: false, status: 'unreachable', reach };
|
|
24
|
+
const key = cacheKey({ world: i.world, objectId: i.object_id, to: i.to_square || JSON.stringify(dest) });
|
|
25
|
+
const hit = cache.get(key); if (hit) return { ...hit, cache_hit: true };
|
|
26
|
+
const traj = planTrajectory(i.from_joints || FRANKA.home, i.target_joints || FRANKA.home);
|
|
27
|
+
const out = { ok: traj.ok, status: traj.status, trajectory: traj, sequence: relocationSequence({ mode: i.mode || 'A' }), reach, cache_hit: false };
|
|
28
|
+
if (traj.ok) cache.set(key, out); return out;
|
|
29
|
+
}),
|
|
30
|
+
mk('robotics.motion.validate', 'motion.validate', 'Validate joint limits and reachability', async (i = {}) => ({ joints: checkJointLimits(i.joints || FRANKA.home), reach: i.pose ? reachable(i.pose) : null })),
|
|
31
|
+
mk('robotics.motion.simulate', 'motion.simulate', 'Simulate relocation (Mode A synchronized)', async (i = {}) => {
|
|
32
|
+
needWorld(i); const before = i.world.scene_hash; const next = applyRelocation(i.world, i.object_id, i.to_square);
|
|
33
|
+
return { ok: true, mode: 'A', grasp_claim: 'visual_attachment', grasp_verified: false, before_hash: before, after_hash: next.scene_hash, world: next };
|
|
34
|
+
}),
|
|
35
|
+
mk('robotics.motion.execute', 'motion.execute', 'Execute relocation and emit receipt (simulation lane)', async (i = {}) => {
|
|
36
|
+
needWorld(i); const loc = locateObject(i.world, i.object_id); const t0 = Date.now();
|
|
37
|
+
const next = applyRelocation(i.world, i.object_id, i.to_square); const seq = relocationSequence({ mode: i.mode || 'A', measured: i.measured });
|
|
38
|
+
const receipt = buildExecutionReceipt({ operation_id: 'robotics.motion.execute', execution_id: i.execution_id || `exec_${hashJson({ o: i.object_id, t: i.to_square }).slice(0, 12)}`, scene_hash: next.scene_hash, target_object: i.object_id, source_pose: loc.pose, destination_pose: squareToWorld(i.to_square), plan: seq.steps, trajectory_validation: { ok: true }, simulation_started: true, motion_completed: true, visual_placement: true, grasp_verified: seq.grasp_verified, goal_verified: true, duration_ms: Date.now() - t0 });
|
|
39
|
+
return { ok: true, world: next, receipt, evidence: { receipt_hash: hashJson(receipt), deterministic: true, model_calls: 0 } };
|
|
40
|
+
}),
|
|
41
|
+
mk('robotics.motion.verify', 'motion.verify', 'Verify object is at expected square', async (i = {}) => { needWorld(i); const loc = locateObject(i.world, i.object_id); return { ok: loc.found && loc.square === i.expected_square, actual: loc }; }),
|
|
42
|
+
mk('robotics.robot.home', 'robot.home', 'Return Franka to home pose', async () => ({ ok: true, joints: FRANKA.home, limits: checkJointLimits(FRANKA.home) })),
|
|
43
|
+
mk('robotics.execution.cancel', 'execution.cancel', 'Cancel robotics execution', async (i = {}) => ({ ok: true, cancelled: i.execution_id || null, status: 'cancelled' })),
|
|
44
|
+
];
|
|
45
|
+
export { createWorld };
|
package/src/sam/os.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SAM OS bootstrap. Local packaged operations never require D1/network calls.
|
|
3
|
+
* Hosts may register independently installed operation packs; a D1 tool record
|
|
4
|
+
* alone does not bind a handler or grant an execution permission.
|
|
5
|
+
*/
|
|
6
|
+
import { CORE_OPERATIONS } from './packs/core.js';
|
|
7
|
+
import { getSamOperation, registerSamOperation, listSamOperations } from './registry.js';
|
|
8
|
+
import { createGeneratedSamOperations } from './operation-packs/generated-v2/operation-pack.js';
|
|
9
|
+
import { defineSamOperation } from './define.js';
|
|
10
|
+
import { createCmsOperations } from './packs/cms/machine.js';
|
|
11
|
+
import { createAuthoringOperations } from './packs/authoring/index.js';
|
|
12
|
+
import { createEvidenceOperations } from './packs/evidence/index.js';
|
|
13
|
+
import { createCadOperations } from './packs/cad/index.js';
|
|
14
|
+
|
|
15
|
+
const packs = new Map();
|
|
16
|
+
|
|
17
|
+
export function registerOSPack({ id, install }) {
|
|
18
|
+
if (typeof id !== 'string' || !id.trim() || typeof install !== 'function') {
|
|
19
|
+
throw new TypeError('sam_os_pack_requires_id_and_sync_install');
|
|
20
|
+
}
|
|
21
|
+
if (packs.has(id)) throw new Error('sam_os_pack_already_registered:' + id);
|
|
22
|
+
packs.set(id, { id, install, result: null });
|
|
23
|
+
return id;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function ensureOS() {
|
|
27
|
+
for (const op of CORE_OPERATIONS) {
|
|
28
|
+
if (!getSamOperation(op.id)) registerSamOperation(op);
|
|
29
|
+
}
|
|
30
|
+
for (const pack of packs.values()) {
|
|
31
|
+
if (pack.result) continue;
|
|
32
|
+
const result = pack.install();
|
|
33
|
+
if (result?.then) throw new TypeError('sam_os_pack_install_must_be_synchronous:' + pack.id);
|
|
34
|
+
pack.result = result ?? { registered: [], unavailable: [] };
|
|
35
|
+
}
|
|
36
|
+
return getOSStatus();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function getOSStatus() {
|
|
40
|
+
const operations = listSamOperations();
|
|
41
|
+
return {
|
|
42
|
+
schema: 'agentsam.os.status.v1',
|
|
43
|
+
available: operations.map(op => op.id),
|
|
44
|
+
core_count: CORE_OPERATIONS.filter(op => operations.some(item => item.id === op.id)).length,
|
|
45
|
+
pack_status: [...packs.values()].map(({ id, result }) => ({
|
|
46
|
+
id, installed: result !== null,
|
|
47
|
+
registered: result?.registered || [],
|
|
48
|
+
unavailable: result?.unavailable || [],
|
|
49
|
+
})),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Isolated SAM OS for an SDK installation/tenant.
|
|
56
|
+
* Unlike the legacy global registry, no state is shared with other OS instances.
|
|
57
|
+
* The host must inject a real resource-scoped store, identity and authorization.
|
|
58
|
+
*/
|
|
59
|
+
export function createSamOS({ core = true, generated = null, cms = null, authoring = null, cad = null, evidence = null } = {}) {
|
|
60
|
+
const registry = new Map();
|
|
61
|
+
const unavailable = [];
|
|
62
|
+
const aliases = new Map();
|
|
63
|
+
// Compatibility aliases resolve to their canonical handler without creating
|
|
64
|
+
// duplicate model tools or relaxing the canonical execution authorization.
|
|
65
|
+
const get = (id) => registry.get(id) || registry.get(aliases.get(id)) || null;
|
|
66
|
+
const register = (def) => {
|
|
67
|
+
if (registry.has(def.id) || aliases.has(def.id)) throw new Error('sam_os_duplicate_operation:' + def.id);
|
|
68
|
+
registry.set(def.id, def);
|
|
69
|
+
return def;
|
|
70
|
+
};
|
|
71
|
+
if (core) for (const op of CORE_OPERATIONS) register(op);
|
|
72
|
+
if (cms) for (const op of createCmsOperations(cms)) register(op);
|
|
73
|
+
if (authoring) for (const op of createAuthoringOperations(authoring)) register(op);
|
|
74
|
+
if (cad) for (const op of createCadOperations(cad)) register(op);
|
|
75
|
+
if (evidence) for (const op of createEvidenceOperations(evidence)) register(op);
|
|
76
|
+
if (generated) {
|
|
77
|
+
const result = createGeneratedSamOperations({
|
|
78
|
+
defineSamOperation, getSamOperation: get,
|
|
79
|
+
registerSamOperation: register,
|
|
80
|
+
...generated,
|
|
81
|
+
});
|
|
82
|
+
unavailable.push(...result.unavailable);
|
|
83
|
+
for (const alias of result.aliases || []) {
|
|
84
|
+
if (registry.has(alias.name) || aliases.has(alias.name)) {
|
|
85
|
+
throw new Error('sam_os_duplicate_operation:' + alias.name);
|
|
86
|
+
}
|
|
87
|
+
aliases.set(alias.name, alias.aliasFor);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const os = {
|
|
91
|
+
get,
|
|
92
|
+
list: () => [...registry.values()].sort((a,b)=>a.id.localeCompare(b.id)),
|
|
93
|
+
status: () => ({
|
|
94
|
+
schema:'agentsam.os.status.v1',
|
|
95
|
+
core_count: CORE_OPERATIONS.filter(op => registry.has(op.id)).length,
|
|
96
|
+
available: [...registry.keys()].sort(),
|
|
97
|
+
generated_unavailable: [...unavailable],
|
|
98
|
+
generated_aliases: [...aliases].map(([name, aliasFor]) => ({
|
|
99
|
+
name, aliasFor, bound: registry.has(aliasFor),
|
|
100
|
+
})),
|
|
101
|
+
}),
|
|
102
|
+
// Explicitly installed adapters may register additional real SAM operations.
|
|
103
|
+
install: (defs) => {
|
|
104
|
+
// Validate the entire pack before modifying this instance. A duplicate ID
|
|
105
|
+
// inside the batch must not leave a partially installed capability set.
|
|
106
|
+
const pending = [...defs].map(def => defineSamOperation(def));
|
|
107
|
+
const seen = new Set([...registry.keys(), ...aliases.keys()]);
|
|
108
|
+
for (const def of pending) {
|
|
109
|
+
if (seen.has(def.id)) throw new Error('sam_os_duplicate_operation:' + def.id);
|
|
110
|
+
seen.add(def.id);
|
|
111
|
+
}
|
|
112
|
+
for (const def of pending) registry.set(def.id, def);
|
|
113
|
+
return os.status();
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
return Object.freeze(os);
|
|
117
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# SAM Universal Authoring operation pack
|
|
2
|
+
|
|
3
|
+
Install via `createSamOS({authoring:{compiler,repository,resolveTrustedContext,authorize}})`.
|
|
4
|
+
The compiler is the `@inneranimalmedia/theme-authoring-compiler` adapter.
|
|
5
|
+
The host's **existing** CMS remains the authority; no default database or
|
|
6
|
+
global principal exists. Repository methods:
|
|
7
|
+
- `getSource({principal,artifactId})` returns exact immutable source, revision, hash, filename, fragment.
|
|
8
|
+
- `saveDraftStyles({principal,pageId,sectionId,artifactId,scope,edits,css,expectedRevision,expectedHash,expectedCmsRevision})`: atomically check expected revisions, write existing CMS draft, emit canonical revision receipt.
|
|
9
|
+
- `saveSourceDraft({principal,artifactId,source,patches,expectedRevision,expectedHash})`: atomically store immutable R2 artifact, version canonical D1 revision. Never publish.
|
|
10
|
+
- Authorization is required on every invocation; `principal` must come from trusted execution context, not input.
|
|
11
|
+
|
|
12
|
+
Operations: inspect, previewStyles, saveDraftStyles, proposeSourcePatch, saveSourceDraft.
|
|
13
|
+
**Not yet a complete installation** until the CMS host implements these adapter methods and the preview/publish/render/reset path passes an end-to-end test.
|