@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,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bounded, read-only repository perception. Keep selected repo authorization in
|
|
3
|
+
* the caller; never let model-supplied cwd silently change the active workspace.
|
|
4
|
+
*/
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { execFile } from 'node:child_process';
|
|
8
|
+
import { promisify } from 'node:util';
|
|
9
|
+
import { fileURLToPath } from 'node:url';
|
|
10
|
+
import { machineInspect } from './machine-inspect.js';
|
|
11
|
+
import { createRepositoryCrawl, findRefineryCandidates } from '../../packages/agentsam-repository/src/index.js';
|
|
12
|
+
|
|
13
|
+
const run = promisify(execFile);
|
|
14
|
+
const pythonRoot = fileURLToPath(new URL('../../python',import.meta.url));
|
|
15
|
+
const within = (a,b) => a===b || a.startsWith(b+path.sep);
|
|
16
|
+
|
|
17
|
+
export function authorizedRepository(candidate, roots) {
|
|
18
|
+
const permitted = roots.map(r=>fs.realpathSync(r));
|
|
19
|
+
if(typeof candidate!=='string' || !candidate.trim()) throw new Error('repository_path_required');
|
|
20
|
+
if(!fs.existsSync(candidate)) throw new Error('repository_target_not_found');
|
|
21
|
+
const target=fs.realpathSync(candidate);
|
|
22
|
+
if(!permitted.some(r=>within(target,r))) throw new Error('repository_target_not_authorized');
|
|
23
|
+
return target;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function repositoryIntelligence(input={},root){
|
|
27
|
+
const churnDays=Number(input.churn_days ?? 30);
|
|
28
|
+
if(!Number.isInteger(churnDays)||churnDays<1||churnDays>3650) throw new Error('repository_churn_days_invalid');
|
|
29
|
+
const result=await run(process.platform==='win32'?'python':'python3',
|
|
30
|
+
['-B','-m','agentsam_sdk.repository.intelligence','--repo-root',fs.realpathSync(root),'--churn-days',String(churnDays),'--json'],
|
|
31
|
+
{cwd:root,timeout:90000,maxBuffer:8*1024*1024,env:{...process.env,PYTHONPATH:[pythonRoot,process.env.PYTHONPATH].filter(Boolean).join(path.delimiter)}});
|
|
32
|
+
return JSON.parse(result.stdout);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function repositoryCrawl(input={},root){
|
|
36
|
+
const inspected=machineInspect({path:'.',run_id:input.run_id},root);
|
|
37
|
+
if(!inspected.ok)return inspected;
|
|
38
|
+
const graph=createRepositoryCrawl(inspected.result,{root:fs.realpathSync(root)});
|
|
39
|
+
return {ok:true,graph,provenance:{source:'agentsam-machine',root}};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function repositoryMine(input={},root,{allowedRoots=[root]}={}){
|
|
43
|
+
if(!input.against)return {ok:false,error:'second_repository_required',next:'Specify a second authorized repository as against.'};
|
|
44
|
+
const against=authorizedRepository(input.against,allowedRoots);
|
|
45
|
+
if(against===fs.realpathSync(root))return {ok:false,error:'second_repository_must_differ'};
|
|
46
|
+
const first=repositoryCrawl({run_id:input.run_id},root),second=repositoryCrawl({run_id:input.against_run_id},against);
|
|
47
|
+
if(!first.ok)return first;
|
|
48
|
+
if(!second.ok)return second;
|
|
49
|
+
const limit=Number(input.limit??25);
|
|
50
|
+
if(!Number.isInteger(limit)||limit<1||limit>100)throw new Error('repository_mine_limit_invalid');
|
|
51
|
+
return {ok:true,...findRefineryCandidates([first.graph,second.graph],{limit})};
|
|
52
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { terminalExec } from './terminal-exec.js';
|
|
2
|
+
/** Intentional npm script execution with per-call host authorization. */
|
|
3
|
+
export function testRun(input={},projectRoot) {
|
|
4
|
+
const script=typeof input.script==='string'&&/^[A-Za-z0-9:_-]+$/.test(input.script)?input.script:'test';
|
|
5
|
+
return terminalExec({
|
|
6
|
+
cwd:projectRoot,relative_cwd:input.relative_cwd||'',
|
|
7
|
+
command:'npm',args:['run',script,'--',...(Array.isArray(input.args)?input.args:[])],
|
|
8
|
+
timeout_ms:input.timeout_ms||120000,max_output_bytes:input.max_output_bytes||262144
|
|
9
|
+
},{cwd:projectRoot});
|
|
10
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/** Workspace-scoped file operations for the AgentSam harness. */
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import crypto from 'node:crypto';
|
|
5
|
+
|
|
6
|
+
const MAX_BYTES=512*1024;
|
|
7
|
+
const SKIP_DIRS=new Set(['.git','node_modules','.agentsam','.next','dist','build','coverage','.venv','venv']);
|
|
8
|
+
const PROTECTED=new Set(['.git','node_modules','.env','.npmrc','.pypirc','.netrc','.ssh','.aws','.config','.agentsam']);
|
|
9
|
+
const unsafePart=(part)=>PROTECTED.has(part)||part.startsWith('.env.')||part.endsWith('.pem')||part.endsWith('.key');
|
|
10
|
+
const hash=(value)=>crypto.createHash('sha256').update(value).digest('hex');
|
|
11
|
+
function scope(root,filename,{create=false}={}){
|
|
12
|
+
if(!root || typeof filename !== 'string' || !filename || path.isAbsolute(filename)) throw new Error('workspace_relative_path_required');
|
|
13
|
+
const absoluteRoot=fs.realpathSync(root);
|
|
14
|
+
const requested=path.resolve(absoluteRoot,filename);
|
|
15
|
+
if(requested===absoluteRoot || !requested.startsWith(absoluteRoot+path.sep)) throw new Error('workspace_path_outside_root');
|
|
16
|
+
const relative=path.relative(absoluteRoot,requested);
|
|
17
|
+
if(relative.split(path.sep).some(unsafePart)) throw new Error('workspace_protected_path');
|
|
18
|
+
const parent=path.dirname(requested);
|
|
19
|
+
if(!fs.existsSync(parent))throw new Error('workspace_parent_not_found');
|
|
20
|
+
const realParent=fs.realpathSync(parent);
|
|
21
|
+
if(realParent!==absoluteRoot && !realParent.startsWith(absoluteRoot+path.sep)) throw new Error('workspace_symlink_escape');
|
|
22
|
+
if(fs.existsSync(requested) && fs.lstatSync(requested).isSymbolicLink())throw new Error('workspace_symlink_not_allowed');
|
|
23
|
+
return {root:absoluteRoot,filename:requested,relative};
|
|
24
|
+
}
|
|
25
|
+
export function workspaceRead(input={},projectRoot){
|
|
26
|
+
const target=scope(projectRoot,input.path);
|
|
27
|
+
const stat=fs.statSync(target.filename);
|
|
28
|
+
if(!stat.isFile())throw new Error('workspace_not_regular_file');
|
|
29
|
+
if(stat.size>MAX_BYTES)throw new Error('workspace_read_limit_exceeded');
|
|
30
|
+
const content=fs.readFileSync(target.filename,'utf8');
|
|
31
|
+
if(content.includes('\0'))throw new Error('workspace_binary_file_unsupported');
|
|
32
|
+
return {path:target.relative,content,sha256:hash(content),bytes:stat.size,verified:true};
|
|
33
|
+
}
|
|
34
|
+
export function workspaceWrite(input={},projectRoot){
|
|
35
|
+
const target=scope(projectRoot,input.path,{create:true});
|
|
36
|
+
if(typeof input.content!=='string'||Buffer.byteLength(input.content)>MAX_BYTES)throw new Error('workspace_write_content_invalid');
|
|
37
|
+
const exists=fs.existsSync(target.filename);
|
|
38
|
+
const previous=exists?fs.readFileSync(target.filename):null;
|
|
39
|
+
if(previous){
|
|
40
|
+
if(previous.length>MAX_BYTES)throw new Error('workspace_write_existing_file_too_large');
|
|
41
|
+
if(!input.expected_sha256 || input.expected_sha256!==hash(previous))throw new Error('workspace_write_conflict_expected_sha256_required');
|
|
42
|
+
}else if(input.expected_sha256)throw new Error('workspace_write_conflict_file_missing');
|
|
43
|
+
const temporary=target.filename+'.agentsam-'+crypto.randomBytes(6).toString('hex')+'.tmp';
|
|
44
|
+
try{
|
|
45
|
+
fs.writeFileSync(temporary,input.content,{mode:0o600,flag:'wx'});
|
|
46
|
+
fs.renameSync(temporary,target.filename);
|
|
47
|
+
}finally{if(fs.existsSync(temporary))fs.unlinkSync(temporary);}
|
|
48
|
+
return {path:target.relative,sha256:hash(input.content),bytes:Buffer.byteLength(input.content),written:true};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Bounded, read-only filesystem discovery. No symlink traversal, hidden
|
|
53
|
+
* credential stores, git objects, or compiled dependency trees are exposed.
|
|
54
|
+
*/
|
|
55
|
+
function boundedRoot(projectRoot,requested='.') {
|
|
56
|
+
const root=fs.realpathSync(projectRoot);
|
|
57
|
+
if(typeof requested!=='string'||requested.length>300||path.isAbsolute(requested))throw new Error('workspace_relative_path_required');
|
|
58
|
+
const target=path.resolve(root,requested);
|
|
59
|
+
if(target!==root&&!target.startsWith(root+path.sep))throw new Error('workspace_path_outside_root');
|
|
60
|
+
const parts=path.relative(root,target).split(path.sep).filter(Boolean);
|
|
61
|
+
if(parts.some(unsafePart))throw new Error('workspace_protected_path');
|
|
62
|
+
if(!fs.existsSync(target))throw new Error('workspace_path_not_found');
|
|
63
|
+
if(fs.lstatSync(target).isSymbolicLink())throw new Error('workspace_symlink_not_allowed');
|
|
64
|
+
const real=fs.realpathSync(target);
|
|
65
|
+
if(real!==root&&!real.startsWith(root+path.sep))throw new Error('workspace_symlink_escape');
|
|
66
|
+
if(!fs.statSync(real).isDirectory())throw new Error('workspace_not_directory');
|
|
67
|
+
return {root,dir:real};
|
|
68
|
+
}
|
|
69
|
+
function walk(input={},projectRoot,visit=()=>{}) {
|
|
70
|
+
const {root,dir}=boundedRoot(projectRoot,input.path||'.');
|
|
71
|
+
const maxEntries=Math.max(1,Math.min(300,Number.isInteger(input.max_entries)?input.max_entries:100));
|
|
72
|
+
const maxDepth=Math.max(1,Math.min(5,Number.isInteger(input.depth)?input.depth:3));
|
|
73
|
+
const result=[],pending=[{dir,level:0}];
|
|
74
|
+
let seen=0,truncated=false;
|
|
75
|
+
while(pending.length){
|
|
76
|
+
const {dir:current,level}=pending.shift();
|
|
77
|
+
let files=fs.readdirSync(current,{withFileTypes:true}).sort((a,b)=>a.name.localeCompare(b.name));
|
|
78
|
+
for(const file of files){
|
|
79
|
+
if(seen>=maxEntries){truncated=true;break;}
|
|
80
|
+
const name=file.name;
|
|
81
|
+
if(unsafePart(name)||SKIP_DIRS.has(name)||name.startsWith('.'))continue;
|
|
82
|
+
const absolute=path.join(current,name);
|
|
83
|
+
if(file.isSymbolicLink())continue;
|
|
84
|
+
if(!file.isFile()&&!file.isDirectory())continue;
|
|
85
|
+
const relative=path.relative(root,absolute).split(path.sep).join('/');
|
|
86
|
+
const isDir=file.isDirectory();
|
|
87
|
+
const entry={path:relative,type:isDir?'directory':'file'};
|
|
88
|
+
if(!isDir){const stat=fs.statSync(absolute);entry.bytes=stat.size;}
|
|
89
|
+
result.push(entry);seen++;
|
|
90
|
+
visit(entry,absolute);
|
|
91
|
+
if(isDir&&level+1<maxDepth)pending.push({dir:absolute,level:level+1});
|
|
92
|
+
}
|
|
93
|
+
if(truncated)break;
|
|
94
|
+
}
|
|
95
|
+
return {root:path.relative(root,dir)||'.',entries:result,truncated,limit:maxEntries,depth:maxDepth};
|
|
96
|
+
}
|
|
97
|
+
export function workspaceList(input={},projectRoot){
|
|
98
|
+
const result=walk(input,projectRoot);
|
|
99
|
+
return {schema:'sam.workspace.list.v1',...result};
|
|
100
|
+
}
|
|
101
|
+
export function workspaceSearch(input={},projectRoot){
|
|
102
|
+
if(typeof input.query!=='string'||input.query.trim().length<2||input.query.length>160)
|
|
103
|
+
throw new Error('workspace_search_query_invalid');
|
|
104
|
+
const term=input.query.toLowerCase();
|
|
105
|
+
const limit=Math.max(1,Math.min(30,Number.isInteger(input.limit)?input.limit:15));
|
|
106
|
+
const matches=[];
|
|
107
|
+
const result=walk({path:input.path||'.',depth:input.depth??4,max_entries:input.max_entries??200},
|
|
108
|
+
projectRoot,(entry,absolute)=>{
|
|
109
|
+
if(matches.length>=limit||entry.type!=='file'||entry.bytes>128*1024)return;
|
|
110
|
+
if(/\.(?:png|jpe?g|webp|gif|pdf|ico|woff2?|ttf|otf|zip|gz|sqlite|db|lock|map)$/i.test(entry.path))return;
|
|
111
|
+
let content;
|
|
112
|
+
try{content=fs.readFileSync(absolute,'utf8');}catch{return;}
|
|
113
|
+
if(content.includes('\0'))return;
|
|
114
|
+
const lines=content.split(/\r?\n/);
|
|
115
|
+
for(let i=0;i<lines.length&&matches.length<limit;i++){
|
|
116
|
+
const index=lines[i].toLowerCase().indexOf(term);
|
|
117
|
+
if(index<0)continue;
|
|
118
|
+
matches.push({path:entry.path,line:i+1,
|
|
119
|
+
snippet:lines[i].slice(Math.max(0,index-90),Math.min(lines[i].length,index+term.length+150))});
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
return {schema:'sam.workspace.search.v1',query:input.query,matches,
|
|
123
|
+
inspected_entries:result.entries.length,truncated:result.truncated||matches.length>=limit,
|
|
124
|
+
scope:result.root};
|
|
125
|
+
}
|
|
@@ -8,12 +8,22 @@
|
|
|
8
8
|
/** @type {CliCommandEntry[]} */
|
|
9
9
|
export const CLI_COMMAND_CATALOG = Object.freeze([
|
|
10
10
|
{ id: 'help', aliases: ['-h', '--help'], summary: 'Interactive or topic help from this catalog', topic: 'start', skill: 'agentsam-app-fundamentals', common: true },
|
|
11
|
+
{ id: 'doctor', summary: 'Offline toolchain diagnosis with repair commands', topic: 'start', usage: ['agentsam doctor', 'agentsam doctor --json', 'agentsam doctor --teach'] },
|
|
12
|
+
{ id: 'explain', summary: 'Explain a runtime or package from the offline catalog', topic: 'start', usage: ['agentsam explain rust', 'agentsam explain package agentsam-hooks'] },
|
|
13
|
+
{ id: 'assist', summary: 'Choose software architecture using deterministic questions', topic: 'start', usage: ['agentsam assist', 'agentsam assist --answers <json> --json'] },
|
|
14
|
+
{ id: 'choose', summary: 'Choose an execution runtime from explicit goals', topic: 'start', usage: ['agentsam choose runtime --goal reusable-native-logic'] },
|
|
11
15
|
{ id: 'create', summary: 'Scaffold a new AgentSam project from a preset', topic: 'create', skill: 'agentsam-app-fundamentals', common: false },
|
|
12
16
|
{ id: 'add', summary: 'Add an explicit feature/capability selection', topic: 'create', skill: 'agentsam-app-fundamentals' },
|
|
13
17
|
{ id: 'plugins', summary: 'Install and manage AgentSam plugins', topic: 'create', skill: 'agentsam-app-fundamentals' },
|
|
18
|
+
{ id: 'plugin', summary: 'Inspect and verify governed plugin products', topic: 'create', usage: ['agentsam plugin inspect <target>', 'agentsam plugin verify <target>', 'agentsam plugin receipt <target>'] },
|
|
19
|
+
{ id: 'install', summary: 'Install an explicitly selected plugin', topic: 'create', usage: ['agentsam install plugins [name]'] },
|
|
20
|
+
{ id: 'skill', summary: 'Create, inspect, and install a specific skill', topic: 'start', usage: ['agentsam skill list', 'agentsam skill inspect <path>'] },
|
|
21
|
+
{ id: 'runtime', aliases: ['agentsamd'], summary: 'Manage the local agentsamd runtime and daemon', topic: 'runtime', usage: ['agentsam runtime --help'] },
|
|
22
|
+
{ id: 'terminal', summary: 'Manage terminal identity and enrollment, distinct from PTY sessions', topic: 'runtime', usage: ['agentsam terminal identity', 'agentsam terminal enroll --instance <id>'] },
|
|
14
23
|
{ id: 'dev', summary: 'Run this project’s npm dev script', topic: 'work', skill: 'agentsam-app-fundamentals' },
|
|
15
24
|
{ id: 'inspect', summary: 'Bounded repository inspect / authority view', topic: 'work', skill: 'agentsam-app-fundamentals', operation: 'repository.inspect', common: true },
|
|
16
|
-
{ id: '
|
|
25
|
+
{ id: 'sam', aliases: ['os'], summary: 'Inspect the SAM operations runtime, installed handlers and availability', topic: 'runtime', usage: ['agentsam sam status', 'agentsam sam doctor', 'agentsam sam list', 'agentsam sam describe repository.inspect', 'agentsam sam discover background --json', 'agentsam sam media doctor --json', 'agentsam sam media setup'] },
|
|
26
|
+
{ id: 'machine', summary: 'Machine inspection, evidence crawl, and read-only code reuse proposals', topic: 'work', skill: 'agentsam-app-fundamentals', operation: 'machine.inspect', common: true },
|
|
17
27
|
{ id: 'engine', summary: 'Discover, audit, benchmark, and govern local AI engines', topic: 'runtime', skill: 'agentsam-app-fundamentals', operation: 'engine.audit', common: true },
|
|
18
28
|
{ id: 'package', summary: 'Audit, verify, and plan publication of distributable packages', topic: 'work', skill: 'agentsam-progression-guard', operation: 'package.audit', common: true, usage: ['agentsam package audit [--public] [--offline] [--json]', 'agentsam package status <name> [--offline] [--json]', 'agentsam package verify <name> [--offline] [--json]', 'agentsam package publish-plan [--offline] [--json]'] },
|
|
19
29
|
{ id: 'merch', summary: 'Preflight designs against portable manufacturing profiles', topic: 'work', skill: 'agentsam-app-fundamentals', operation: 'merch.preflight', common: true, usage: ['agentsam merch profiles', 'agentsam merch build <manifest.json> [--all-compatible]'] },
|
|
@@ -47,7 +57,7 @@ export const CLI_COMMAND_CATALOG = Object.freeze([
|
|
|
47
57
|
{ flag: '-i, --interactive', description: 'Open the interactive next-action menu.' },
|
|
48
58
|
],
|
|
49
59
|
},
|
|
50
|
-
{ id: 'db', summary: '
|
|
60
|
+
{ id: 'db', summary: 'Discover local and remote stores, inspect explicit remote D1 schemas, or manage local AgentSam SQLite', topic: 'runtime', skill: 'agentsam-app-fundamentals', usage: ['agentsam db sources', 'agentsam db schema --remote --binding DB --config wrangler.toml --limit 100 --offset 0 --json', 'agentsam db status', 'agentsam db init'] },
|
|
51
61
|
{ id: 'models', summary: 'Probe hosted/local model availability', topic: 'start', skill: 'agentsam-app-fundamentals', common: true },
|
|
52
62
|
{ id: 'hooks', aliases: ['hook'], summary: 'Inspect lifecycle hooks, sources, and execution receipts', topic: 'runtime', skill: 'agentsam-app-fundamentals', common: true, usage: ['agentsam hooks status', 'agentsam hooks list', 'agentsam hooks executions [--limit N]', 'agentsam hooks init'] },
|
|
53
63
|
{ id: 'providers', summary: 'Configure machine provider credentials', topic: 'start', skill: 'agentsam-app-fundamentals' },
|
|
@@ -59,6 +69,7 @@ export const CLI_COMMAND_CATALOG = Object.freeze([
|
|
|
59
69
|
{ id: 'logout', summary: 'Sign out locally', topic: 'start', skill: 'agentsam-app-fundamentals' },
|
|
60
70
|
{ id: 'whoami', summary: 'Authenticated account + tokenPermissions', topic: 'start', skill: 'agentsam-app-fundamentals', common: true },
|
|
61
71
|
{ id: 'resume', summary: 'Resume a saved AgentSam session', topic: 'start', skill: 'agentsam-app-fundamentals' },
|
|
72
|
+
{ id: 'exec', summary: 'Run the existing AgentSam coding agent noninteractively with scoped permissions', topic: 'work', skill: 'agentsam-app-fundamentals', usage: ['agentsam exec --prompt-file <file> --cwd <directory> --model <provider:model> --approval-mode <pending|prompt> --json', 'agentsam exec --prompt <text> --cwd <directory> --json'] },
|
|
62
73
|
{ id: 'shell', summary: 'Interactive slash-command shell', topic: 'inside', skill: 'agentsam-app-fundamentals' },
|
|
63
74
|
{ id: 'start-local', summary: 'Local PTY WebSocket service', topic: 'runtime', skill: 'agentsam-app-fundamentals' },
|
|
64
75
|
{ id: 'ollama', summary: 'Local Ollama setup/status/models', topic: 'runtime', skill: 'agentsam-app-fundamentals' },
|
|
@@ -97,11 +108,13 @@ export const CLI_COMMAND_CATALOG = Object.freeze([
|
|
|
97
108
|
},
|
|
98
109
|
{ id: 'init', summary: 'Knowledge setup or local scaffold', topic: 'create', skill: 'agentsam-app-fundamentals' },
|
|
99
110
|
{ id: 'codebaseindex', aliases: ['ingest', 'codebase-index'], summary: 'Guided codebase ingest: materials, allowlist, embeddings, storage', topic: 'work', skill: 'agentsam-codebaseindex', operation: 'codebaseindex.ingest', common: true },
|
|
111
|
+
{ id: 'site', summary: 'Project-scoped site.scrape crawl and evidence', topic: 'work', skill: 'agentsam-app-fundamentals', operation: 'site.scrape' },
|
|
100
112
|
{ id: 'brand', summary: 'Deterministic brand intelligence', topic: 'work', skill: 'agentsam-app-fundamentals', operation: 'brand.scan' },
|
|
101
113
|
{ id: 'plan', summary: 'Durable project-local work plans + domain plans', topic: 'work', skill: 'agentsam-app-fundamentals' },
|
|
102
114
|
{ id: 'security', aliases: ['sca'], summary: 'Dependency + trust-boundary scan', topic: 'work', skill: 'agentsam-progression-guard', operation: 'security.scan', common: true },
|
|
103
115
|
{ id: 'merkle', summary: 'File integrity snapshots and explorer', topic: 'work', skill: 'agentsam-app-fundamentals' },
|
|
104
|
-
{ id: 'cad', summary: 'Blender/OpenSCAD/FreeCAD
|
|
116
|
+
{ id: 'cad', summary: 'CAD: cad.project.v1 tools (design_project_*/design_model_*), Blender/OpenSCAD/FreeCAD, OCCT native via design_model_build', topic: 'work', skill: 'agentsam-app-fundamentals', operation: 'cad.blender.inspect' },
|
|
117
|
+
{ id: 'robotics', summary: 'SAM Robotics: robotics.scene.inspect/object.locate/grasp.plan/motion.plan/validate/simulate/execute/verify, robot.home, execution.cancel (model: never)', topic: 'work', skill: 'agentsam-app-fundamentals', operation: 'robotics.scene.inspect' },
|
|
105
118
|
{ id: 'dockerize', summary: 'Build/run supported containers', topic: 'create', skill: 'agentsam-app-fundamentals' },
|
|
106
119
|
{ id: 'mini', summary: 'Create a small local gadget', topic: 'create', skill: 'agentsam-jr-dev' },
|
|
107
120
|
{ id: 'recon', summary: 'Bounded-worker packets + finding reports', topic: 'work', skill: 'agentsam-app-fundamentals' },
|
package/src/cli.js
CHANGED
|
@@ -54,6 +54,8 @@ import { runLogin, runLogout } from './commands/account-auth.js';
|
|
|
54
54
|
import { runPlugins } from './commands/plugins.js';
|
|
55
55
|
import { runCredentials } from './commands/credentials.js';
|
|
56
56
|
import { runCheatSheet } from './commands/cheat-sheet.js';
|
|
57
|
+
import { runCatalog } from './commands/catalog.js';
|
|
58
|
+
import { runCatalogDoctor } from './commands/catalog-doctor.js';
|
|
57
59
|
import { runHooks } from './commands/hooks.js';
|
|
58
60
|
import { runCompute } from './commands/compute.js';
|
|
59
61
|
import { runGoogleCloud } from './commands/google-cloud.js';
|
|
@@ -78,13 +80,20 @@ import { renderDiagnosticError } from './errors/index.js';
|
|
|
78
80
|
import { renderHelpOverview, runHelp } from './ui/cli/help.js';
|
|
79
81
|
import { hydrateSecureCredentials } from './security/local-vault.js';
|
|
80
82
|
import { getCliCommand, printAssistTip, suggestCliCommands } from './cli/command-catalog.js';
|
|
83
|
+
import { renderCliError } from '../packages/agentsam-errors/src/cli.js';
|
|
81
84
|
|
|
82
85
|
const VERSION = pkg.version;
|
|
83
86
|
|
|
84
87
|
function reportCliError(error) {
|
|
85
88
|
if (error?.reported) return;
|
|
86
|
-
const
|
|
87
|
-
|
|
89
|
+
const json = process.argv.includes('--json');
|
|
90
|
+
const rendered = error?.envelope
|
|
91
|
+
? renderCliError(error, { json })
|
|
92
|
+
: ['provider','transport'].includes(error?.domain)
|
|
93
|
+
? renderDiagnosticError(error)
|
|
94
|
+
: '✗ ' + (error?.message || String(error)) + '\n next: Run agentsam ' +
|
|
95
|
+
(process.argv[2] || 'help') + ' --help for usage.';
|
|
96
|
+
console.error('\n' + rendered.split('\n').map(line => ' ' + line).join('\n') + '\n');
|
|
88
97
|
}
|
|
89
98
|
|
|
90
99
|
|
|
@@ -92,111 +101,6 @@ function printHelp() {
|
|
|
92
101
|
console.log(renderHelpOverview(VERSION));
|
|
93
102
|
}
|
|
94
103
|
|
|
95
|
-
function printLegacyHelp() {
|
|
96
|
-
console.log(`
|
|
97
|
-
Agent Sam SDK — CLI v${VERSION}
|
|
98
|
-
|
|
99
|
-
Product UX:
|
|
100
|
-
agentsam Enter the interactive Agent Sam experience
|
|
101
|
-
agentsam create <name> --preset <fullstack|cms|prototype|data>
|
|
102
|
-
agentsam add <auth|cms|knowledge|agent|deploy-cloudflare>
|
|
103
|
-
agentsam plugins list|install|connect|status|remove [@agentsam-mcp]
|
|
104
|
-
agentsam dev Run this project's existing npm dev script
|
|
105
|
-
agentsam inspect [--json] Bounded repository index by default; use --view full for authority envelope
|
|
106
|
-
agentsam machine inspect Native deterministic perception + asset discovery (--json)
|
|
107
|
-
agentsam engine status|audit|benchmark|assets Local AI engine + compute tooling
|
|
108
|
-
agentsam brand [scan|…] Deterministic brand intelligence on repository.snapshot authority
|
|
109
|
-
agentsam plan brand Composable brand normalization plan (--goap optional)
|
|
110
|
-
agentsam deploy Graduate an AgentSam project intentionally
|
|
111
|
-
|
|
112
|
-
Capability discovery:
|
|
113
|
-
agentsam setup Discover → plan → approve → install (Homebrew-style)
|
|
114
|
-
agentsam capabilities [capability-id] [--json]
|
|
115
|
-
agentsam skill list|create|inspect|install|alias|remove|invoke
|
|
116
|
-
agentsam skills [skill-id-or-alias] [--references] [--json]
|
|
117
|
-
|
|
118
|
-
Power-user UX:
|
|
119
|
-
agentsam context [--json] Git repo/revision + bridge configuration from any repo
|
|
120
|
-
agentsam init Configure knowledge in this repo; --name scaffolds a new project
|
|
121
|
-
agentsam index Plan/run incremental AST and optional embeddings (--help)
|
|
122
|
-
agentsam codebaseindex Guided ingest: materials/allowlist/embeddings/storage (alias: ingest)
|
|
123
|
-
agentsam search "query" Retrieve indexed code/text; --semantic enables embeddings
|
|
124
|
-
agentsam repo snapshot Git composition/churn; --save retains observations
|
|
125
|
-
agentsam cad blender Programmatic Blender inspect/build/render/export (--help)
|
|
126
|
-
agentsam cad project Editable CAD project tools/workflows (--help)
|
|
127
|
-
agentsam mini <name> Create and preview a small local gadget (--help for options)
|
|
128
|
-
agentsam merkle File integrity, snapshots, comparisons, and interactive explorer (--help)
|
|
129
|
-
agentsam deploy-receipt Merkle deploy/checkpoint capture + promote/failure receipts (--help)
|
|
130
|
-
agentsam recon Bounded-worker task packets + finding-report validation (--help)
|
|
131
|
-
agentsam security Dependency scan, log triage, and verified repair (--help)
|
|
132
|
-
agentsam status [--json] [-i] Honest awareness: account + models + terminal + live Worker
|
|
133
|
-
agentsam db init|status Manage the project-local SQLite database
|
|
134
|
-
agentsam models Verify configured providers and selectable hosted/local models
|
|
135
|
-
agentsam providers Configure, verify, and remove machine provider credentials
|
|
136
|
-
agentsam env init <name> Create a secure provider profile + reusable shell loader
|
|
137
|
-
agentsam login Sign in to Inner Animal Media and persist a secure machine-local session
|
|
138
|
-
agentsam logout Sign out locally; provider credentials stay untouched
|
|
139
|
-
agentsam whoami [--json] Authenticated account identity + safe credential status
|
|
140
|
-
agentsam terminal identity [--json] This machine's hostname, platform, arch, and model
|
|
141
|
-
agentsam terminal enroll --instance <id> [--pair] [--json]
|
|
142
|
-
Needs AGENTSAM_API_KEY; --pair writes AGENTSAM_BRIDGE_KEY
|
|
143
|
-
(one terminal_connection in ~/.execos/profiles/)
|
|
144
|
-
agentsam resume [session] Resume a saved Agent Sam session; omit id for picker
|
|
145
|
-
agentsam eval context Offline context-strategy/economics fixtures (--help)
|
|
146
|
-
agentsam cloudflare Capabilities + CF OAuth packs (agentsam cloudflare login --pack agentsam)
|
|
147
|
-
agentsam go Go runtime discovery/build/deploy (Cloudflare worker-container)
|
|
148
|
-
agentsam rust Rust/Wasm scaffold/doctor/check/build/dev/deploy (explicit deploy)
|
|
149
|
-
agentsam start-local Local PTY on ws://127.0.0.1:3099 (no tunnel, no Cloudflare)
|
|
150
|
-
agentsam ollama Opt-in local Ollama setup/status/model management
|
|
151
|
-
agentsam shell Interactive Agent Sam slash-command shell
|
|
152
|
-
agentsam tunnel Choose/list/inspect/run real Cloudflare Tunnels via Wrangler
|
|
153
|
-
agentsam deploy Graduate to Cloudflare / GCP when ready
|
|
154
|
-
agentsam dockerize Build/run app, knowledge, or CAD containers (--help)
|
|
155
|
-
agentsam identity preview Preview the reusable local auth portal (not production login)
|
|
156
|
-
agentsam identity init Scaffold identity app (+ optional --provider)
|
|
157
|
-
agentsam identity providers|plan|schema|resolve Protocol-driven identity surfaces
|
|
158
|
-
agentsam help
|
|
159
|
-
agentsam --version
|
|
160
|
-
agentsam --help
|
|
161
|
-
|
|
162
|
-
Context options:
|
|
163
|
-
--json Machine-readable output
|
|
164
|
-
--cwd <path> Resolve a different working directory
|
|
165
|
-
|
|
166
|
-
Inspect options:
|
|
167
|
-
--view <full|index|files> Full authority envelope, facet index, or bounded matching files (default index)
|
|
168
|
-
--full Explicitly request the full authority envelope
|
|
169
|
-
--system/--package <name> Filter semantic ownership
|
|
170
|
-
--category/--tag <value> Filter semantic classification
|
|
171
|
-
--layer/--role <value> Filter architecture role
|
|
172
|
-
--path <prefix|glob> Filter repository paths (supports * and **)
|
|
173
|
-
--symbol/--import <value> Filter AST symbols or imports
|
|
174
|
-
--match <text> Lexical AND-match across semantic routing metadata
|
|
175
|
-
--limit <1..500> Bound files view (default 50)
|
|
176
|
-
--facet-limit <1..200> Bound each facet list (default 48)
|
|
177
|
-
--snapshot-file <file> Reuse a saved canonical repository.snapshot; skips Merkle/AST rescan
|
|
178
|
-
--save-snapshot <file> Save the canonical full snapshot while emitting the selected view
|
|
179
|
-
--pretty Pretty-print JSON; machine JSON is compact by default
|
|
180
|
-
--remote <name> Preferred Git remote (default origin; falls back to first remote)
|
|
181
|
-
|
|
182
|
-
Run agentsam from any project to enter the account-aware interactive experience.
|
|
183
|
-
Account, model-provider, terminal, and deploy permissions are requested only when the related capability needs them.
|
|
184
|
-
|
|
185
|
-
Tunnel commands:
|
|
186
|
-
agentsam tunnel Guided picker over Wrangler-visible tunnels
|
|
187
|
-
agentsam tunnel list List real Cloudflare Tunnels
|
|
188
|
-
agentsam tunnel info <id> Inspect one tunnel
|
|
189
|
-
agentsam tunnel run <id> Run/start a connector on this machine
|
|
190
|
-
agentsam tunnel create <name>
|
|
191
|
-
agentsam tunnel quick-start [url]
|
|
192
|
-
|
|
193
|
-
Init options:
|
|
194
|
-
--name <name> Project directory name
|
|
195
|
-
--lane <fullstack|cms|data|crm|creative>
|
|
196
|
-
--run-target <local|cloudflare|gcp> Default: local
|
|
197
|
-
--yes Skip confirmation
|
|
198
|
-
`);
|
|
199
|
-
}
|
|
200
104
|
|
|
201
105
|
function parseInitArgs(argv) {
|
|
202
106
|
const opts = {
|
|
@@ -411,11 +315,22 @@ const rest = process.argv.slice(3);
|
|
|
411
315
|
hydrateSecureCredentials(process.env);
|
|
412
316
|
|
|
413
317
|
const catalogEntry = command && !command.startsWith('-') ? getCliCommand(command) : null;
|
|
414
|
-
if (catalogEntry && command !== 'help')
|
|
318
|
+
if (catalogEntry && command !== 'help' && !rest.includes('--help') &&
|
|
319
|
+
!rest.includes('-h') && catalogEntry.skill &&
|
|
320
|
+
catalogEntry.skill !== 'agentsam-app-fundamentals') {
|
|
415
321
|
printAssistTip(catalogEntry);
|
|
416
322
|
}
|
|
417
323
|
|
|
418
|
-
|
|
324
|
+
try {
|
|
325
|
+
if (command === 'inspect' && (rest.includes('--help') || rest.includes('-h'))) {
|
|
326
|
+
// Keep the existing inspect path/world-state help authoritative instead of a
|
|
327
|
+
// generic registry stub that hides its positional argument and safety boundary.
|
|
328
|
+
await runInspect(rest);
|
|
329
|
+
} else if (command && !command.startsWith('-') && (rest.includes('--help') || rest.includes('-h'))) {
|
|
330
|
+
const entry = getCliCommand(command);
|
|
331
|
+
if (!entry) { console.error('Unknown command: ' + command); process.exitCode = 2; }
|
|
332
|
+
else { console.log('agentsam '+entry.id+' — '+entry.summary); for (const u of entry.usage?.length ? entry.usage : ['agentsam '+entry.id+' [--help]']) console.log(' '+u); }
|
|
333
|
+
} else if (command === '--version' || command === '-v') {
|
|
419
334
|
console.log(VERSION);
|
|
420
335
|
} else if (command === 'help') {
|
|
421
336
|
await runHelp(rest, { version: VERSION });
|
|
@@ -433,6 +348,16 @@ if (command === '--version' || command === '-v') {
|
|
|
433
348
|
} else {
|
|
434
349
|
printHelp();
|
|
435
350
|
}
|
|
351
|
+
} else if (command === 'explain' || command === 'assist' || (command === 'choose' && rest[0] === 'runtime')) {
|
|
352
|
+
const code = await runCatalog(command === 'choose' ? 'choose' : command, command === 'choose' ? rest.slice(1) : rest);
|
|
353
|
+
if (code) process.exitCode = code;
|
|
354
|
+
} else if (command === 'sam' || command === 'os') {
|
|
355
|
+
const { runSam } = await import('./commands/sam.js');
|
|
356
|
+
const result = await runSam(rest);
|
|
357
|
+
if (result?.ok === false) process.exitCode = 2;
|
|
358
|
+
} else if (command === 'doctor') {
|
|
359
|
+
const code = runCatalogDoctor(rest);
|
|
360
|
+
if (code) process.exitCode = code;
|
|
436
361
|
} else if (command === 'create') {
|
|
437
362
|
try {
|
|
438
363
|
const opts = parseCreateArgs(rest);
|
|
@@ -448,7 +373,7 @@ if (command === '--version' || command === '-v') {
|
|
|
448
373
|
} else if (command === 'add') {
|
|
449
374
|
try { await runAdd(rest); }
|
|
450
375
|
catch (e) { reportCliError(e); process.exitCode = 1; }
|
|
451
|
-
} else if (command === 'plugins') {
|
|
376
|
+
} else if (command === 'plugins' || command === 'plugin') {
|
|
452
377
|
try { await runPlugins(rest); }
|
|
453
378
|
catch (e) { reportCliError(e); process.exitCode = 1; }
|
|
454
379
|
} else if (command === 'install' && rest[0] === 'plugins') {
|
|
@@ -634,11 +559,23 @@ if (command === '--version' || command === '-v') {
|
|
|
634
559
|
if (!e?.reported) reportCliError(e);
|
|
635
560
|
process.exitCode = 1;
|
|
636
561
|
}
|
|
562
|
+
} else if (command === 'site') {
|
|
563
|
+
try { await (await import('./commands/site-scrape.js')).runSiteScrape(rest); }
|
|
564
|
+
catch (e) { reportCliError(e); process.exitCode = 1; }
|
|
637
565
|
} else if (command === 'rust' || command === 'wasm' || command === 'rapid-rust') {
|
|
638
566
|
try {
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
567
|
+
if (!rest.length) {
|
|
568
|
+
console.log('agentsam rust — native Rust build and tooling commands');
|
|
569
|
+
console.log(' agentsam rust --help');
|
|
570
|
+
console.log(' agentsam rust doctor');
|
|
571
|
+
console.log(' agentsam rust status (alias of doctor)');
|
|
572
|
+
} else await runRust(rest);
|
|
573
|
+
} catch (e) {
|
|
574
|
+
// This command is a native CLI passthrough, not an HTTP request.
|
|
575
|
+
// Preserve the real exit code and never classify a clap usage error as HTTP 500.
|
|
576
|
+
if (Number.isInteger(e?.exitCode)) {
|
|
577
|
+
console.error(` rust command exited ${e.exitCode}; see native output above`);
|
|
578
|
+
} else if (!e?.reported) reportCliError(e);
|
|
642
579
|
process.exitCode = Number(e?.exitCode || 1);
|
|
643
580
|
}
|
|
644
581
|
} else if (command === 'login') {
|
|
@@ -684,6 +621,16 @@ if (command === '--version' || command === '-v') {
|
|
|
684
621
|
reportCliError(e);
|
|
685
622
|
process.exitCode = 1;
|
|
686
623
|
}
|
|
624
|
+
} else if (command === 'exec') {
|
|
625
|
+
try {
|
|
626
|
+
const { runShell } = await import('./commands/shell.js');
|
|
627
|
+
const result = await runShell(['--exec', ...rest], { interactive: false });
|
|
628
|
+
if (result?.ok === false) process.exitCode = 1;
|
|
629
|
+
} catch (e) {
|
|
630
|
+
if (rest.includes('--json')) console.log(JSON.stringify({ schema:'agentsam.exec.v1', ok:false, status:e?.approval?.status || 'failed', error: e?.envelope || { code: e?.code || 'exec_failed', message: e?.message || String(e) }, ...(e?.approval ? { approval:e.approval } : {}) }));
|
|
631
|
+
else reportCliError(e);
|
|
632
|
+
process.exitCode = 1;
|
|
633
|
+
}
|
|
687
634
|
} else if (command === 'shell') {
|
|
688
635
|
try {
|
|
689
636
|
await runShell(rest);
|
|
@@ -716,7 +663,8 @@ if (command === '--version' || command === '-v') {
|
|
|
716
663
|
process.exitCode = 1;
|
|
717
664
|
}
|
|
718
665
|
} else if (command === 'start-local') {
|
|
719
|
-
|
|
666
|
+
if (rest.includes('--help') || rest.includes('-h')) console.log('agentsam start-local — start the local PTY and filesystem server at 127.0.0.1:3099 (Ctrl+C to stop)');
|
|
667
|
+
else await runStartLocal({});
|
|
720
668
|
} else if (command === 'ollama') {
|
|
721
669
|
try {
|
|
722
670
|
await runOllama(rest);
|
|
@@ -740,7 +688,9 @@ if (command === '--version' || command === '-v') {
|
|
|
740
688
|
}
|
|
741
689
|
} else if (command === 'deploy') {
|
|
742
690
|
try {
|
|
743
|
-
|
|
691
|
+
if (rest.includes('--help') || rest.includes('-h')) {
|
|
692
|
+
console.log('agentsam deploy [--target <cloudflare|gcp|local>] [--account-id <id>] [--dry-run] [--plan]');
|
|
693
|
+
} else await runDeploy(parseDeployArgs(rest));
|
|
744
694
|
} catch (e) {
|
|
745
695
|
reportCliError(e);
|
|
746
696
|
process.exit(1);
|
|
@@ -903,5 +853,10 @@ if (command === '--version' || command === '-v') {
|
|
|
903
853
|
console.error('');
|
|
904
854
|
}
|
|
905
855
|
printHelp();
|
|
906
|
-
process.
|
|
856
|
+
process.exitCode = 2;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
} catch (error) {
|
|
860
|
+
reportCliError(error);
|
|
861
|
+
process.exitCode = error?.exitCode || 1;
|
|
907
862
|
}
|
package/src/commands/app.js
CHANGED
|
@@ -29,48 +29,8 @@ function readJson(filePath) {
|
|
|
29
29
|
return JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const manifest = readJson(manifestPath);
|
|
35
|
-
return {
|
|
36
|
-
id: manifest.id || fallbackId,
|
|
37
|
-
name: manifest.name || fallbackId,
|
|
38
|
-
dir: path.dirname(manifestPath),
|
|
39
|
-
manifestPath,
|
|
40
|
-
bin: manifest.bin || null,
|
|
41
|
-
commands: manifest.commands || {},
|
|
42
|
-
manifest,
|
|
43
|
-
};
|
|
44
|
-
} catch {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export function listAppManifests(root = REPO_ROOT) {
|
|
50
|
-
const out = [];
|
|
51
|
-
const seen = new Set();
|
|
52
|
-
|
|
53
|
-
function addFromDir(parent, entryName) {
|
|
54
|
-
const dir = path.join(parent, entryName);
|
|
55
|
-
const manifestPath = path.join(dir, 'agentsam.app.json');
|
|
56
|
-
if (!fs.existsSync(manifestPath)) return;
|
|
57
|
-
const row = readManifest(manifestPath, entryName);
|
|
58
|
-
if (!row || seen.has(row.id)) return;
|
|
59
|
-
seen.add(row.id);
|
|
60
|
-
out.push(row);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
for (const parentName of ['apps', 'packages']) {
|
|
64
|
-
const parent = path.join(root, parentName);
|
|
65
|
-
if (!fs.existsSync(parent)) continue;
|
|
66
|
-
for (const entry of fs.readdirSync(parent, { withFileTypes: true })) {
|
|
67
|
-
if (!entry.isDirectory()) continue;
|
|
68
|
-
addFromDir(parent, entry.name);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return out.sort((a, b) => a.id.localeCompare(b.id));
|
|
73
|
-
}
|
|
32
|
+
import {listAppManifests} from '../../packages/agentsam-desktop-shell/scripts/app-discovery.mjs';
|
|
33
|
+
export {listAppManifests};
|
|
74
34
|
|
|
75
35
|
function resolveApp(id, root = REPO_ROOT) {
|
|
76
36
|
const apps = listAppManifests(root);
|
|
@@ -176,8 +136,41 @@ function npmDistributionWarnings(app) {
|
|
|
176
136
|
return warnings;
|
|
177
137
|
}
|
|
178
138
|
|
|
139
|
+
/**
|
|
140
|
+
* `embed` tells a host (Local Studio) how to build/stage this app when it is listed in the host's
|
|
141
|
+
* included_apps. Hosts read this; they must not hardcode per-app build logic.
|
|
142
|
+
*/
|
|
143
|
+
export function validateEmbed(manifest, label) {
|
|
144
|
+
const errors = [];
|
|
145
|
+
const embed = manifest?.embed;
|
|
146
|
+
if (embed === undefined) return errors;
|
|
147
|
+
if (!embed || typeof embed !== 'object' || Array.isArray(embed)) return [`${label}: embed must be an object`];
|
|
148
|
+
const argv = (v) => Array.isArray(v) && v.length > 0 && v.every((x) => typeof x === 'string' && x.length > 0);
|
|
149
|
+
const relative = (v) => typeof v === 'string' && v.length > 0 && !v.startsWith('/') && !v.split('/').includes('..');
|
|
150
|
+
if (!/^[a-z0-9][a-z0-9-]*$/.test(embed.stage ?? '')) {
|
|
151
|
+
errors.push(`${label}: embed.stage must be a lowercase kebab-case path segment`);
|
|
152
|
+
}
|
|
153
|
+
const build = embed.build;
|
|
154
|
+
if (build !== undefined) {
|
|
155
|
+
if (!build || typeof build !== 'object' || Array.isArray(build)) {
|
|
156
|
+
errors.push(`${label}: embed.build must be an object`);
|
|
157
|
+
} else {
|
|
158
|
+
if (!argv(build.command)) errors.push(`${label}: embed.build.command must be a non-empty string array`);
|
|
159
|
+
if (!relative(build.output)) errors.push(`${label}: embed.build.output must be a relative path without ".."`);
|
|
160
|
+
if (build.cwd !== undefined && !relative(build.cwd) && build.cwd !== '.') {
|
|
161
|
+
errors.push(`${label}: embed.build.cwd must be a relative path without ".."`);
|
|
162
|
+
}
|
|
163
|
+
if (build.install !== undefined && !argv(build.install?.command)) {
|
|
164
|
+
errors.push(`${label}: embed.build.install.command must be a non-empty string array`);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return errors;
|
|
169
|
+
}
|
|
170
|
+
|
|
179
171
|
function validateOneApp(app, knownIds, root) {
|
|
180
172
|
const errors = [];
|
|
173
|
+
errors.push(...validateEmbed(app.manifest, app.id));
|
|
181
174
|
const warnings = [];
|
|
182
175
|
const m = app.manifest;
|
|
183
176
|
|
|
@@ -261,7 +254,7 @@ function validateOneApp(app, knownIds, root) {
|
|
|
261
254
|
return { id: app.id, errors, warnings };
|
|
262
255
|
}
|
|
263
256
|
|
|
264
|
-
function validateDesktopManifests(root, knownIds) {
|
|
257
|
+
function validateDesktopManifests(root, knownIds, apps = []) {
|
|
265
258
|
const errors = [];
|
|
266
259
|
const warnings = [];
|
|
267
260
|
const dir = path.join(root, 'packages/agentsam-desktop-shell/manifests');
|
|
@@ -302,6 +295,12 @@ function validateDesktopManifests(root, knownIds) {
|
|
|
302
295
|
`desktop ${name}: included_apps entry "${bundledId}" does not resolve to a known APP manifest`,
|
|
303
296
|
);
|
|
304
297
|
}
|
|
298
|
+
const target = apps.find((a) => a.id === bundledId);
|
|
299
|
+
if (target && !target.manifest.embed?.build) {
|
|
300
|
+
errors.push(
|
|
301
|
+
`desktop ${name}: included app "${bundledId}" declares no embed.build in its agentsam.app.json`,
|
|
302
|
+
);
|
|
303
|
+
}
|
|
305
304
|
}
|
|
306
305
|
}
|
|
307
306
|
return { errors, warnings };
|
|
@@ -339,7 +338,7 @@ export function validateApps(options = {}) {
|
|
|
339
338
|
}
|
|
340
339
|
|
|
341
340
|
if (!filterId) {
|
|
342
|
-
const desktop = validateDesktopManifests(root, knownIds);
|
|
341
|
+
const desktop = validateDesktopManifests(root, knownIds, apps);
|
|
343
342
|
allErrors.push(...desktop.errors);
|
|
344
343
|
allWarnings.push(...desktop.warnings);
|
|
345
344
|
}
|