@inneranimalmedia/agentsam-sdk 2.6.17 → 2.6.18
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 +19 -0
- package/README.md +15 -0
- package/apps/agentsam-copro-studio/agentsam.app.json +125 -0
- package/apps/cad-creator/agentsam.app.json +230 -0
- package/apps/cad-creator/shared/cad/package.json +1 -1
- package/apps/cad-creator/shared/cad/src/index.ts +1 -0
- package/apps/cad-creator/shared/cad/src/lighting.test.ts +32 -0
- package/apps/cad-creator/shared/cad/src/lighting.ts +79 -0
- package/apps/cad-creator/shared/cad/src/types.ts +106 -4
- package/apps/design-canvas/agentsam.app.json +144 -0
- package/apps/ecommerce-cms-agentsam/agentsam.app.json +658 -0
- package/apps/local-studio/agentsam.app.json +271 -0
- package/apps/samsketch/agentsam.app.json +136 -0
- package/contracts/source-types.v2.json +86 -1
- package/docs/CAPABILITIES.md +56 -0
- package/docs/PRODUCT_LIFECYCLE.md +2 -0
- package/docs/REPOSITORY_KNOWLEDGE.md +24 -0
- package/docs/adr/ADR-0010-widget-contributions-registry-persistence.md +60 -0
- package/docs/architecture/ACP_D1_HOSTING.md +67 -0
- package/docs/architecture/AGENTSAM-PRODUCT-CATALOG-RELEASES-20261028.md +3 -1
- package/docs/architecture/AGENTSAM_APPLICATION_CONTRACT.md +6 -2
- package/docs/architecture/AGENTSAM_APPLICATION_INVENTORY.md +135 -0
- package/docs/architecture/AGENTSAM_DISTRIBUTION_OWNERSHIP.md +1 -1
- package/docs/architecture/AGENTSAM_GO_RUNTIME.md +1 -1
- package/docs/architecture/APP_PRODUCT_DATA_MODEL.md +121 -0
- package/docs/architecture/BRAND_WORKSPACE_V1.md +71 -0
- package/docs/architecture/CANONICAL_CAD_FORMAT_SPINE.md +79 -0
- package/docs/architecture/ECOMMERCE_THEME_START_FLOW.md +31 -0
- package/docs/architecture/LIVE_AST_AND_CREATIVE_RESOURCE_GRAPH.md +129 -0
- package/docs/architecture/PRIMETECH_SCENE_V2_READINESS.md +89 -0
- package/docs/architecture/PYTHON_CAD_SERVICE_TRANSPORT.md +116 -0
- package/docs/architecture/SCHEMA_AUTHORITIES.md +83 -0
- package/docs/architecture/app-module-plugin-classification.md +71 -0
- package/docs/architecture/primetech/BARNDOMINIUM_BIM_BUILDOUT_RUNBOOK_20261123.md +139 -0
- package/docs/architecture/primetech/BARNDOMINIUM_SPACE_DELIVERY_20261123.md +58 -0
- package/docs/architecture/primetech/CAPABILITY_AND_ACCEPTANCE_MATRIX.md +176 -0
- package/docs/architecture/primetech/IMPLEMENTATION_WAVES.md +203 -0
- package/docs/architecture/primetech/PORTABLE_EDITOR_CONTRACTS.md +192 -0
- package/docs/architecture/primetech/README.md +65 -0
- package/docs/architecture/universal-registry-recovery.md +62 -0
- package/docs/audits/2026-11-22-sdk-d1-registry-parity.md +116 -0
- package/docs/brand/BRAND_CAPABILITY_INVENTORY.md +160 -0
- package/docs/cad/FORMAT_SUPPORT.md +46 -0
- package/docs/cad/LIB_CAD_REMASTER_AUDIT.md +49 -0
- package/docs/engineering/CMS_DATA_AUTHORITY_2026-11-03.md +4 -2
- package/docs/generated/SDK_CAPABILITY_INVENTORY.md +10 -10
- package/docs/intake/product-capabilities.proposed.ts +6 -6
- package/docs/operations/CLOUDFLARE-QUEUE-OBSERVABILITY.md +1 -1
- package/docs/product/AGENTSAM_PRODUCT_EXPERIENCE_STANDARD.md +1 -1
- package/docs/reference/AGENTSAM-CLI-WORKFLOWS.md +1 -1
- package/docs/reference/AGENTSAM-REGISTRY.generated.md +25 -16
- package/docs/sam/opencv-media.md +63 -0
- package/docs/standards/DESKTOP_WEB_PARITY_ACCEPTANCE.md +42 -0
- package/migrations/d1/0001_agentsam_plugin_runtime.sql +0 -2
- package/migrations/d1/0028_drop_unused_tool_handler_families.sql +4 -0
- package/migrations/d1/0029_agentsam_tools_account_plugin_key_unique.sql +26 -0
- package/migrations/d1/0030_cad_engine_plugins_contract_agnostic.sql +21 -0
- package/migrations/d1/0031_ops_trail_single_tool_call_source.sql +13 -0
- package/migrations/d1/0033_service_registry_model_discovery.sql +50 -0
- package/migrations/d1/20261123_skill_package_staging.sql +64 -0
- package/migrations/d1/20261123_universal_registry_stage.sql +58 -0
- package/migrations/d1/20261126_agentsam_tool_legacy_metadata_compact.sql +6 -0
- package/migrations/d1/20261126_agentsam_tools_archive_legacy_metadata.sql +20 -0
- package/migrations/d1/20261126_agentsam_tools_normalize_intent_tags.sql +49 -0
- package/migrations/d1/20261126_agentsam_tools_normalize_policy_health.sql +89 -0
- package/migrations/d1/20261126_agentsam_tools_remove_legacy_scope_keys.sql +29 -0
- package/migrations/d1/20261126_agentsam_tools_runtime_view_compat.sql +65 -0
- package/migrations/d1/generated/20261123_portable_cli_seed.sql +97 -0
- package/migrations/d1/generated/20261123_source_skill_seed.sql +3881 -0
- package/migrations/runtime/0012_agent_run_event_sequence.sql +27 -0
- package/package.json +57 -17
- package/packages/agentsam-3d-viewer/README.md +5 -0
- package/packages/agentsam-3d-viewer/package.json +1 -1
- package/packages/agentsam-3d-viewer/src/atmosphere.js +90 -0
- package/packages/agentsam-3d-viewer/src/gltf-loader.js +42 -0
- package/packages/agentsam-3d-viewer/src/index.d.ts +53 -1
- package/packages/agentsam-3d-viewer/src/index.js +18 -3
- package/packages/agentsam-3d-viewer/src/pbr-materials.js +330 -0
- package/packages/agentsam-3d-viewer/src/procedural-material.js +96 -0
- package/packages/agentsam-3d-viewer/src/procedural-textures.js +334 -0
- package/packages/agentsam-3d-viewer/src/renderer-capabilities.js +12 -0
- package/packages/agentsam-3d-viewer/src/stroke-geometry.js +4 -0
- package/packages/agentsam-3d-viewer/src/studio-finishes.js +67 -0
- package/packages/agentsam-3d-viewer/test/atmosphere.test.mjs +17 -0
- package/packages/agentsam-3d-viewer/test/gltf-loader.test.mjs +49 -0
- package/packages/agentsam-3d-viewer/test/pbr-mined-presets.test.mjs +44 -0
- package/packages/agentsam-3d-viewer/test/procedural-material.test.mjs +56 -0
- package/packages/agentsam-3d-viewer/test/renderer-capabilities.test.mjs +18 -0
- package/packages/agentsam-3d-viewer/test/studio-shared.test.mjs +23 -0
- package/packages/agentsam-architectural-intelligence/package.json +1 -1
- package/packages/agentsam-brand/package.json +3 -2
- package/packages/agentsam-brand/src/core/capabilities.js +108 -48
- package/packages/agentsam-brand/src/extract.js +6 -1
- package/packages/agentsam-brand/src/index.js +1 -0
- package/packages/agentsam-brand/src/public.js +15 -1
- package/packages/agentsam-brand/src/scan.js +47 -0
- package/packages/agentsam-brand/src/workspace.d.ts +19 -0
- package/packages/agentsam-brand/src/workspace.js +166 -0
- package/packages/agentsam-cms/README.md +11 -0
- package/packages/agentsam-cms/package.json +4 -3
- package/packages/agentsam-cms/src/contracts.js +16 -0
- package/packages/agentsam-cms/src/studio-bridge-protocol.js +113 -0
- package/packages/agentsam-cms/test/standalone.test.mjs +7 -3
- package/packages/agentsam-cms/test/studio-bridge-protocol.test.mjs +26 -0
- package/packages/agentsam-communications/package.json +3 -2
- package/packages/agentsam-communications/src/samspeaks-runtime.js +126 -0
- package/packages/agentsam-contracts/README.md +67 -0
- package/packages/agentsam-contracts/agentsam.package.json +46 -12
- package/packages/agentsam-contracts/dist/agent.d.ts +6 -3
- package/packages/agentsam-contracts/dist/agent.js +20 -0
- package/packages/agentsam-contracts/dist/bim-model.d.ts +95 -0
- package/packages/agentsam-contracts/dist/bim-model.js +57 -0
- package/packages/agentsam-contracts/dist/cad-source-formats.d.ts +55 -0
- package/packages/agentsam-contracts/dist/cad-source-formats.js +9617 -0
- package/packages/agentsam-contracts/dist/design-workspace.d.ts +13 -1
- package/packages/agentsam-contracts/dist/index.d.ts +6 -0
- package/packages/agentsam-contracts/dist/index.js +17836 -349
- package/packages/agentsam-contracts/dist/json-schema.d.ts +8 -0
- package/packages/agentsam-contracts/dist/json-schema.js +7787 -0
- package/packages/agentsam-contracts/dist/operations.d.ts +6 -1
- package/packages/agentsam-contracts/dist/operations.js +7795 -5
- package/packages/agentsam-contracts/dist/resource-ref.d.ts +21 -0
- package/packages/agentsam-contracts/dist/resource-ref.js +23 -0
- package/packages/agentsam-contracts/dist/run.d.ts +91 -3
- package/packages/agentsam-contracts/dist/run.js +28 -0
- package/packages/agentsam-contracts/dist/scene-document.d.ts +32 -0
- package/packages/agentsam-contracts/dist/scene-document.js +30 -0
- package/packages/agentsam-contracts/dist/scene-format.d.ts +44 -0
- package/packages/agentsam-contracts/dist/scene-format.js +35 -0
- package/packages/agentsam-contracts/dist/source-types-registry.d.ts +9 -0
- package/packages/agentsam-contracts/dist/source-types-registry.js +9512 -0
- package/packages/agentsam-contracts/dist/tools.d.ts +2 -1
- package/packages/agentsam-contracts/dist/tools.js +7794 -9
- package/packages/agentsam-contracts/dist/widgets.d.ts +2 -0
- package/packages/agentsam-contracts/package.json +42 -3
- package/packages/agentsam-contracts/schemas/activity.v1.schema.json +142 -0
- package/packages/agentsam-contracts/schemas/bim-model.v1.schema.json +76 -0
- package/packages/agentsam-contracts/schemas/resource-ref.v1.schema.json +18 -0
- package/packages/agentsam-contracts/schemas/run-receipt.v1.schema.json +411 -0
- package/packages/agentsam-contracts/schemas/run-start.v1.schema.json +40 -0
- package/packages/agentsam-contracts/schemas/run.v1.schema.json +243 -0
- package/packages/agentsam-contracts/schemas/sam-operation.v1.schema.json +8 -0
- package/packages/agentsam-contracts/schemas/scene-document.v2.schema.json +212 -0
- package/packages/agentsam-contracts/schemas/scene-format.v1.schema.json +173 -0
- package/packages/agentsam-contracts/schemas/source-types.v2.json +86 -1
- package/packages/agentsam-contracts/scripts/build.mjs +2 -1
- package/packages/agentsam-contracts/src/agent.ts +10 -18
- package/packages/agentsam-contracts/src/bim-model.ts +143 -0
- package/packages/agentsam-contracts/src/cad-source-formats.ts +195 -0
- package/packages/agentsam-contracts/src/design-workspace.ts +9 -0
- package/packages/agentsam-contracts/src/index.ts +6 -0
- package/packages/agentsam-contracts/src/json-schema.ts +37 -0
- package/packages/agentsam-contracts/src/operations.ts +12 -1
- package/packages/agentsam-contracts/src/resource-ref.ts +36 -0
- package/packages/agentsam-contracts/src/run.ts +93 -16
- package/packages/agentsam-contracts/src/scene-document.ts +58 -0
- package/packages/agentsam-contracts/src/scene-format.ts +91 -0
- package/packages/agentsam-contracts/src/source-types-registry.ts +65 -0
- package/packages/agentsam-contracts/src/tools.ts +4 -1
- package/packages/agentsam-contracts/src/widgets.ts +2 -0
- package/packages/agentsam-contracts/test/bim-model.test.mjs +66 -0
- package/packages/agentsam-contracts/test/cad-source-formats.test.mjs +103 -0
- package/packages/agentsam-contracts/test/contracts.test.mjs +23 -1
- package/packages/agentsam-contracts/test/resource-ref.test.mjs +29 -0
- package/packages/agentsam-contracts/test/run-contract.test.mjs +44 -0
- package/packages/agentsam-contracts/test/scene-document.test.mjs +30 -0
- package/packages/agentsam-contracts/test/scene-format.test.mjs +40 -0
- package/packages/agentsam-contracts/test/source-types.test.mjs +29 -0
- package/packages/agentsam-desktop-shell/scripts/app-discovery.mjs +36 -25
- package/packages/agentsam-errors/package.json +1 -1
- package/packages/agentsam-goalguru/agentsam.app.json +97 -0
- package/packages/agentsam-goap/package.json +2 -2
- package/packages/agentsam-hooks/package.json +1 -1
- package/packages/agentsam-knowledge/package.json +1 -1
- package/packages/agentsam-merch/package.json +1 -1
- package/packages/agentsam-nav/dist/Surfaces.d.ts +14 -4
- package/packages/agentsam-nav/dist/browser.global.js +16 -16
- package/packages/agentsam-nav/dist/browser.js +65 -22
- package/packages/agentsam-nav/dist/contracts.d.ts +2 -0
- package/packages/agentsam-nav/dist/index.d.ts +1 -1
- package/packages/agentsam-nav/dist/index.js +62 -21
- package/packages/agentsam-nav/dist/shell.css +149 -4
- package/packages/agentsam-nav/dist/theme.css +149 -4
- package/packages/agentsam-nav/dist/useAdminApps.d.ts +21 -2
- package/packages/agentsam-nav/package.json +1 -1
- package/packages/agentsam-occt/dist/native-provider.d.mts +1 -1
- package/packages/agentsam-occt/dist/native-provider.mjs +1 -1
- package/packages/agentsam-occt/package.json +1 -1
- package/packages/agentsam-occt/src/native-provider.mjs +1 -1
- package/packages/agentsam-queue-control/package.json +1 -1
- package/packages/agentsam-queue-control/src/adapters/sqlite.js +8 -6
- package/packages/agentsam-repository/package.json +1 -1
- package/packages/agentsam-vault/package.json +5 -1
- package/packages/agentsam-vault/src/crypto/aes-gcm.d.ts +25 -0
- package/packages/agentsam-vault/src/crypto/aes-gcm.js +149 -0
- package/packages/agentsam-vault/src/crypto/classify.d.ts +22 -0
- package/packages/agentsam-vault/src/crypto/classify.js +83 -0
- package/packages/agentsam-vault/src/crypto/oauth-envelope.d.ts +7 -0
- package/packages/agentsam-vault/src/index.js +10 -0
- package/packages/agentsam-vault/src/providers/registry.js +8 -0
- package/packages/agentsam-workbench/README.md +27 -3
- package/packages/agentsam-workbench/package.json +26 -4
- package/packages/agentsam-workbench/src/agent/AskAgentSamPill.tsx +17 -0
- package/packages/agentsam-workbench/src/agent/MiniAgentSam.tsx +144 -20
- package/packages/agentsam-workbench/src/agent/contextual-composer.css +7 -0
- package/packages/agentsam-workbench/src/agent/index.ts +1 -0
- package/packages/agentsam-workbench/src/agent/mini-agentsam.css +54 -0
- package/packages/agentsam-workbench/src/design/DesignWorkspaceFrame.tsx +277 -82
- package/packages/agentsam-workbench/src/design/design-workspace.css +173 -109
- package/packages/agentsam-workbench/src/index.ts +1 -0
- package/packages/agentsam-workbench/src/shell/InspectorPicker.tsx +38 -0
- package/packages/agentsam-workbench/src/shell/ResizableStage.tsx +26 -5
- package/packages/agentsam-workbench/src/shell/SidePanel.tsx +3 -3
- package/packages/agentsam-workbench/src/shell/StudioCommands.tsx +32 -0
- package/packages/agentsam-workbench/src/shell/appearance.d.mts +28 -0
- package/packages/agentsam-workbench/src/shell/appearance.mjs +279 -0
- package/packages/agentsam-workbench/src/shell/index.ts +2 -0
- package/packages/agentsam-workbench/src/shell/inspector-picker.css +48 -0
- package/packages/agentsam-workbench/src/shell/studio-icons.ts +104 -0
- package/packages/agentsam-workbench/src/shell/studio-panels.ts +21 -0
- package/packages/agentsam-workbench/src/widgets/registry.ts +4 -4
- package/packages/agentsam-workbench/src/workflows/WorkflowStudio.tsx +936 -0
- package/packages/agentsam-workbench/src/workflows/index.ts +5 -0
- package/packages/agentsam-workbench/src/workflows/model.ts +207 -0
- package/packages/agentsam-workbench/src/workflows/types.ts +206 -0
- package/packages/agentsam-workbench/src/workflows/workflow-studio.css +290 -0
- package/packages/catalog/generated/packages.json +157 -45
- package/packages/connectors/cfoa/package.json +7 -2
- package/packages/connectors/cfoa/src/PERMISSION_REGISTRY.md +45 -0
- package/packages/connectors/cfoa/src/api-client.js +4 -0
- package/packages/connectors/cfoa/src/capabilities.js +123 -285
- package/packages/connectors/cfoa/src/families/media.js +16 -12
- package/packages/connectors/cfoa/src/index.js +31 -37
- package/packages/connectors/cfoa/src/oauth-persist.js +18 -2
- package/packages/connectors/cfoa/src/permission-options.js +147 -1038
- package/packages/connectors/cfoa/src/routes.js +92 -35
- package/packages/connectors/cfoa/src/scope-catalog.js +16 -351
- package/packages/connectors/cfoa/src/scope-registry.js +248 -0
- package/packages/connectors/cfoa/test/scope-registry.test.mjs +168 -0
- package/packages/connectors/cfoa/tests/capabilities.test.mjs +86 -45
- package/packages/connectors/cfoa/tests/connector.test.mjs +143 -0
- package/packages/connectors/cfoa/tests/media-discovery.test.mjs +34 -10
- package/packages/identity/.agentsam/features/oauth-login-portal/agentsam.feature.json +1 -1
- package/packages/identity/agentsam.package.json +4 -4
- package/packages/identity/migrations/apply-portable.js +11 -4
- package/packages/identity/migrations/sqlite/007_identity_session_revoke_reason.sql +3 -0
- package/packages/identity/migrations/sqlite/008_identity_accounts.sql +41 -0
- package/packages/identity/migrations/sqlite/009_identity_scope.sql +30 -0
- package/packages/identity/package.json +11 -6
- package/packages/identity/schema/agentsam.identity/manifest.json +21 -4
- package/packages/identity/src/adapters/account-security-store.js +7 -0
- package/packages/identity/src/adapters/column-support.js +39 -0
- package/packages/identity/src/adapters/iam-compat/index.js +19 -4
- package/packages/identity/src/adapters/portable-d1/index.js +3 -1
- package/packages/identity/src/adapters/portable-store.js +80 -51
- package/packages/identity/src/app/verify-app.js +27 -0
- package/packages/identity/src/contracts/identity-store.js +2 -2
- package/packages/identity/src/core/password-gate.js +116 -0
- package/packages/identity/src/frontend/auth-portal/pages/login.html +1 -1
- package/packages/identity/src/frontend/auth-portal/pages/reset.html +1 -1
- package/packages/identity/src/frontend/auth-portal/pages/signup.html +1 -1
- package/packages/identity/src/frontend/auth-portal/shared/company-branding.js +18 -7
- package/packages/identity/src/frontend/auth-portal/shared/default-auth-logo.svg +4 -0
- package/packages/identity/src/frontend/auth-portal/store-access.js +97 -0
- package/packages/identity/src/migrations/0005_session_audit_columns.sql +6 -0
- package/packages/identity/src/migrations/README.md +2 -0
- package/packages/identity/src/oauth/native-handoff.js +2 -2
- package/packages/identity/src/server/identity-service.js +1 -1
- package/packages/identity/src/server/worker-router.js +16 -5
- package/packages/identity/tests/identity-portal-e2e.test.mjs +166 -0
- package/packages/identity/tests/lane1-identity-store-parity.test.mjs +17 -6
- package/packages/identity/tests/password-gate.test.mjs +66 -0
- package/packages/identity/tests/portable-identity-scope.test.mjs +59 -0
- package/packages/identity/tests/session-audit.test.mjs +135 -0
- package/packages/identity/tests/worker-portal-assets.test.mjs +47 -0
- package/packages/primetech-procedures/README.md +46 -5
- package/packages/primetech-procedures/agentsam.package.json +6 -6
- package/packages/primetech-procedures/package.json +14 -3
- package/packages/primetech-procedures/procedures/arch.assembly.calculate/procedure.json +83 -0
- package/packages/primetech-procedures/procedures/media.asset.preflight/procedure.json +85 -0
- package/packages/primetech-procedures/procedures/media.image.optimize-asset/procedure.json +102 -0
- package/packages/primetech-procedures/procedures/repo.asset.inventory/__pycache__/run.cpython-314.pyc +0 -0
- package/packages/primetech-procedures/procedures/repo.git.status/procedure.json +58 -0
- package/packages/primetech-procedures/procedures/repo.git.status/run.sh +10 -0
- package/packages/primetech-procedures/src/index.js +140 -41
- package/packages/primetech-procedures/test/__pycache__/test_inventory.cpython-314.pyc +0 -0
- package/packages/primetech-procedures/test/runtime-kinds.test.mjs +210 -0
- package/packages/theme-scenes/package.json +1 -1
- package/packages/work-graph/package.json +1 -1
- package/protocol/README.md +18 -0
- package/protocol/capabilities/capability-manifest.schema.json +111 -19
- package/protocol/capabilities/manifest.json +12 -1
- package/protocol/contracts/source-types.v2.json +86 -1
- package/protocol/product-releases/README.md +15 -12
- package/protocol/registry/universal-catalog.v1.json +2820 -0
- package/protocol/sam/activity.v1.schema.json +111 -17
- package/protocol/sam/operation.schema.json +8 -0
- package/protocol/sam/run-receipt.v1.schema.json +411 -0
- package/protocol/sam/run-start.v1.schema.json +40 -0
- package/protocol/sam/run.v1.schema.json +243 -0
- package/protocol/theme-refinery/d1-reconciliation.md +66 -32
- package/protocol/theme-refinery/product-metadata.schema.json +1 -1
- package/python/README.md +81 -8
- package/python/agentsam_sdk/cad/__init__.py +26 -3
- package/python/agentsam_sdk/cad/adapters/__init__.py +6 -0
- package/python/agentsam_sdk/cad/adapters/freecad.py +200 -0
- package/python/agentsam_sdk/cad/building.py +42 -0
- package/python/agentsam_sdk/cad/jobs.py +174 -0
- package/python/agentsam_sdk/cad/native.py +68 -9
- package/python/agentsam_sdk/cad/service.py +570 -0
- package/python/agentsam_sdk/cli.py +31 -0
- package/python/agentsam_sdk/client.py +49 -16
- package/python/agentsam_sdk/data/d1_bloat.py +0 -1
- package/python/agentsam_sdk/media/__init__.py +8 -0
- package/python/agentsam_sdk/media/opencv.py +188 -0
- package/python/agentsam_sdk/procedures/client.py +1 -1
- package/python/agentsam_sdk/registry_cli.py +88 -0
- package/python/agentsam_sdk/runtime/native.py +1 -1
- package/python/agentsam_sdk/terminal_art.py +5 -6
- package/python/pyproject.toml +3 -0
- package/python/tests/fixtures/freecad_host_cases.json +30 -0
- package/python/tests/test_bridge_policy.py +40 -0
- package/python/tests/test_cad_building_client.py +47 -0
- package/python/tests/test_cad_jobs_client.py +102 -0
- package/python/tests/test_cad_native.py +104 -1
- package/python/tests/test_cad_service_client.py +288 -0
- package/python/tests/test_opencv_media.py +79 -0
- package/python/tests/test_procedure_client.py +6 -0
- package/python/tests/test_public_client.py +13 -0
- package/services/cad/blender/adapter.py +49 -0
- package/services/cad/ifc/__pycache__/adapter.cpython-311.pyc +0 -0
- package/services/cad/ifc/adapter.py +836 -0
- package/services/cad/server.py +435 -132
- package/skills/README.md +1 -1
- package/skills/agentsam-app-fundamentals/agentsam.skill.json +20 -0
- package/skills/agentsam-arch-bim/SKILL.md +166 -6
- package/skills/agentsam-arch-bim/agentsam.skill.json +2 -2
- package/skills/agentsam-cad/SKILL.md +122 -36
- package/skills/agentsam-cad/agentsam.skill.json +20 -0
- package/skills/agentsam-cad/evals/README.md +56 -0
- package/skills/agentsam-cad/references/engines-and-lanes.md +70 -0
- package/skills/agentsam-cad/references/projects-and-operations.md +112 -0
- package/skills/agentsam-cad/references/proof-and-triage.md +89 -0
- package/skills/agentsam-cad/references/python-service-and-jobs.md +102 -0
- package/skills/agentsam-cad/references/scene-geometry-bim.md +113 -0
- package/skills/agentsam-canvas-creation/agentsam.skill.json +20 -0
- package/skills/agentsam-cloudflare-workers/agentsam.skill.json +20 -0
- package/skills/agentsam-cms-ready-creation/agentsam.skill.json +20 -0
- package/skills/agentsam-codebaseindex/agentsam.skill.json +20 -0
- package/skills/agentsam-jr-dev/agentsam.skill.json +20 -0
- package/skills/agentsam-plan-and-goap/agentsam.skill.json +20 -0
- package/skills/agentsam-progression-guard/agentsam.skill.json +20 -0
- package/skills/agentsam-repo-recon/agentsam.skill.json +20 -0
- package/skills/agentsam-sam-operations/SKILL.md +76 -36
- package/skills/agentsam-sam-operations/agentsam.skill.json +20 -0
- package/skills/agentsam-sdk-orientation/agentsam.skill.json +20 -0
- package/skills/catalog.json +21 -6
- package/src/acp/agent-executor.js +38 -2
- package/src/acp/client.js +128 -39
- package/src/acp/dependencies.js +159 -19
- package/src/acp/http.js +14 -0
- package/src/acp/index.js +3 -0
- package/src/acp/runs.js +5 -3
- package/src/agent/capability-adapter.js +21 -23
- package/src/cli/command-catalog.js +4 -4
- package/src/cli/desktop-launch.js +2 -2
- package/src/cli/update-check.js +131 -0
- package/src/cli.js +6 -5
- package/src/commands/account-auth.js +36 -26
- package/src/commands/app-inventory.js +343 -0
- package/src/commands/app.js +162 -27
- package/src/commands/ast.js +80 -0
- package/src/commands/cad.js +2 -0
- package/src/commands/cheat-sheet.js +1 -1
- package/src/commands/cloudflare-login.js +170 -65
- package/src/commands/cloudflare-status.js +38 -0
- package/src/commands/cloudflare.js +54 -42
- package/src/commands/codebaseindex.js +34 -13
- package/src/commands/db.js +2 -2
- package/src/commands/go.js +1 -1
- package/src/commands/interactive.js +5 -0
- package/src/commands/knowledge.js +4 -2
- package/src/commands/mcp.js +5 -2
- package/src/commands/preferences.js +48 -6
- package/src/commands/product.js +4 -4
- package/src/commands/run.js +3 -4
- package/src/commands/shell.js +32 -10
- package/src/go/contract.js +1 -1
- package/src/go/official-registry.js +41 -36
- package/src/go/product-catalog.test.mjs +52 -0
- package/src/go/receipts.js +19 -6
- package/src/indexing/index.js +10 -0
- package/src/indexing/live-ast.js +200 -0
- package/src/indexing/live-cad-graph.js +107 -0
- package/src/indexing/live-resource-graph.js +95 -0
- package/src/knowledge/config.js +5 -4
- package/src/knowledge/store-discovery.js +22 -5
- package/src/knowledge/stores/d1.js +141 -0
- package/src/lib/auth.js +7 -4
- package/src/lib/cad/bim-bridge.d.ts +6 -0
- package/src/lib/cad/bim-bridge.js +96 -0
- package/src/lib/cad/d1-project-store.js +1 -1
- package/src/lib/cad/delivery-profiles.d.ts +1 -1
- package/src/lib/cad/delivery-profiles.js +82 -6
- package/src/lib/cad/format-policy.d.ts +11 -0
- package/src/lib/cad/format-policy.js +14 -0
- package/src/lib/cad/freecad-host.d.ts +19 -0
- package/src/lib/cad/freecad-host.js +171 -0
- package/src/lib/cad/freecad.js +38 -65
- package/src/lib/cad/ifc-cli.js +82 -0
- package/src/lib/cad/ifc.js +152 -0
- package/src/lib/cad/index.js +3 -0
- package/src/lib/cad/production-operations.js +2 -0
- package/src/lib/cad/project-runtime.js +2 -2
- package/src/lib/cad/project-v2.js +13 -25
- package/src/lib/cad-docker.js +35 -17
- package/src/lib/whoami-capabilities.js +8 -14
- package/src/mcp/cloudflare-bundles.js +39 -41
- package/src/models/inventory-core.d.ts +32 -1
- package/src/models/inventory-core.js +118 -36
- package/src/plugins/cloudflare.js +3 -3
- package/src/plugins/completeful.js +2 -4
- package/src/plugins/contracts.js +2 -3
- package/src/plugins/creative.js +2 -2
- package/src/plugins/registry.js +52 -33
- package/src/plugins/runtime.js +64 -13
- package/src/registry/generated/inventory.json +289 -66
- package/src/registry/universal-reconcile.js +120 -0
- package/src/registry/universal-source.js +253 -0
- package/src/sam/adapters/opencv-video.js +206 -0
- package/src/sam/adapters/workspace-media.js +15 -2
- package/src/sam/bridge/policy.mjs +50 -0
- package/src/sam/bridge/stdio.mjs +61 -38
- package/src/sam/operations/architectural-knowledge.js +1 -0
- package/src/sam/operations/artifact-render.js +2 -1
- package/src/sam/operations/cad-bim-ifc.js +89 -0
- package/src/sam/operations/decision-evaluate.js +1 -0
- package/src/sam/operations/planning-goap.js +1 -0
- package/src/sam/operations/repository-inspect.js +1 -0
- package/src/sam/operations/robotics.js +1 -1
- package/src/sam/packs/core.js +2 -0
- package/src/sam/packs/evidence/endpoint.js +39 -0
- package/src/sam/packs/evidence/media.js +3 -2
- package/src/sam/packs/evidence/store-hosted.js +5 -3
- package/src/sam/shell-host.js +26 -8
- package/src/skills/catalog.js +12 -1
- package/src/skills/registry.js +16 -17
- package/src/ui/boot.js +12 -14
- package/src/ui/brand/agentsam-mark.generated.js +49 -0
- package/src/ui/cli/prompt-box.js +151 -0
- package/src/ui/home-screen.js +49 -0
- package/apps/README.md +0 -67
- package/apps/cad-creator/README.md +0 -743
- package/packages/agentsam-brand/LICENSE +0 -110
- package/packages/agentsam-desktop-shell/LICENSE +0 -110
- package/packages/agentsam-desktop-shell/README.md +0 -73
- package/packages/agentsam-ide/LICENSE +0 -110
- package/packages/agentsam-ide/README.md +0 -147
- package/packages/agentsam-nav/LICENSE +0 -110
- package/packages/agentsam-vault/LICENSE +0 -110
- package/packages/agentsam-workbench/LICENSE +0 -110
- package/src/ui/art/geaux_boot.json +0 -25
- package/src/ui/companion-art.js +0 -40
- /package/{apps/cad-creator → packages/primetech-procedures}/LICENSE +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local stdio interop is an explicit, operation-owned contract.
|
|
3
|
+
*
|
|
4
|
+
* No operation becomes callable merely because it is registered or claims to
|
|
5
|
+
* be read-only. Host-scoped, process-running, network and write operations
|
|
6
|
+
* must use the existing authenticated host capability transport instead.
|
|
7
|
+
*/
|
|
8
|
+
export function stdioMode(operation) {
|
|
9
|
+
if (!operation || typeof operation.handler !== 'function' ||
|
|
10
|
+
operation.status !== 'stable' || operation.risk !== 'read_only') return null;
|
|
11
|
+
const exec = operation.execution;
|
|
12
|
+
if (!exec || exec.sideEffects !== 'none' || !exec.lanes?.includes('local') ||
|
|
13
|
+
operation.authority?.length || operation.auth?.account ||
|
|
14
|
+
operation.auth?.provider?.length) return null;
|
|
15
|
+
|
|
16
|
+
const mode = operation.interop?.stdio;
|
|
17
|
+
if (mode === 'pure' || mode === 'workspace_read') {
|
|
18
|
+
if (exec.model !== 'never' || exec.network !== 'none' ||
|
|
19
|
+
exec.provider_spend !== 'never') return null;
|
|
20
|
+
// Workspace-scoped reads must also have a closed input schema.
|
|
21
|
+
if (mode === 'workspace_read' &&
|
|
22
|
+
(operation.input_schema?.type !== 'object' ||
|
|
23
|
+
operation.input_schema.additionalProperties !== false)) return null;
|
|
24
|
+
return mode;
|
|
25
|
+
}
|
|
26
|
+
// This isolated SAM OS has no model/provider binding. Only the built-in,
|
|
27
|
+
// deterministic/heuristic decision path may be requested over stdio.
|
|
28
|
+
if (mode === 'decision' && exec.model === 'optional' &&
|
|
29
|
+
exec.network === 'optional' && exec.provider_spend === 'optional') {
|
|
30
|
+
return mode;
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function assertLocalDecisionInput(input) {
|
|
36
|
+
if (!input || typeof input !== 'object' || Array.isArray(input))
|
|
37
|
+
throw new Error('sam_bridge_invalid_input');
|
|
38
|
+
if (Object.hasOwn(input, 'evaluators') || Object.hasOwn(input, 'activity') ||
|
|
39
|
+
Object.hasOwn(input, 'model') || Object.hasOwn(input, 'provider'))
|
|
40
|
+
throw new Error('sam_bridge_decision_evaluator_not_allowed');
|
|
41
|
+
const questions = Array.isArray(input.questions)
|
|
42
|
+
? input.questions
|
|
43
|
+
: input.questions && typeof input.questions === 'object'
|
|
44
|
+
? Object.values(input.questions)
|
|
45
|
+
: [];
|
|
46
|
+
if (questions.some(q => q && typeof q === 'object' &&
|
|
47
|
+
(q.evaluator_hint === 'semantic' || q.evaluator === 'semantic')))
|
|
48
|
+
throw new Error('sam_bridge_decision_semantic_not_allowed');
|
|
49
|
+
return input;
|
|
50
|
+
}
|
package/src/sam/bridge/stdio.mjs
CHANGED
|
@@ -1,59 +1,82 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
3
|
* Restricted local SAM bridge for other-language clients.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
*
|
|
5
|
+
* An operation opts in through its validated interop.stdio contract. The
|
|
6
|
+
* shared SAM OS remains the single handler registry; no operation-name
|
|
7
|
+
* allowlist or second capability catalog is maintained here.
|
|
8
|
+
*
|
|
9
|
+
* This transport has no host identity, remote credentials, terminal access,
|
|
10
|
+
* or write permission. Those operations require an authorized host API.
|
|
6
11
|
*/
|
|
7
12
|
import { readFileSync, realpathSync } from 'node:fs';
|
|
8
13
|
import path from 'node:path';
|
|
9
14
|
import { AgentSamClient } from '../client.js';
|
|
10
15
|
import { createSamOS } from '../os.js';
|
|
16
|
+
import { stdioMode, assertLocalDecisionInput } from './policy.mjs';
|
|
17
|
+
|
|
18
|
+
const sam = new AgentSamClient({ os: createSamOS(), cwd: process.cwd(), autoSeed: false });
|
|
19
|
+
const modeFor = id => stdioMode(typeof id === 'string' ? sam.os.get(id) : null);
|
|
11
20
|
|
|
12
|
-
const READ_OPERATIONS = new Set(['repository.inspect','artifact.render','decision.evaluate']);
|
|
13
|
-
const sam = new AgentSamClient({os:createSamOS(),cwd:process.cwd(),autoSeed:false});
|
|
14
21
|
function insideRoot(input) {
|
|
15
|
-
if(!input || typeof input!=='object' || Array.isArray(input))
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
22
|
+
if (!input || typeof input !== 'object' || Array.isArray(input))
|
|
23
|
+
throw new Error('sam_bridge_invalid_input');
|
|
24
|
+
const root = realpathSync(process.cwd());
|
|
25
|
+
const target = realpathSync(path.resolve(root, input.root || input.cwd || root));
|
|
26
|
+
if (target !== root && !target.startsWith(root + path.sep))
|
|
19
27
|
throw new Error('sam_bridge_path_outside_workspace');
|
|
20
|
-
return {...input,root:target};
|
|
28
|
+
return { ...input, root: target };
|
|
21
29
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
|
|
30
|
+
|
|
31
|
+
async function handle(request) {
|
|
32
|
+
if (!request || typeof request !== 'object' || Array.isArray(request))
|
|
33
|
+
throw new Error('sam_bridge_invalid_request');
|
|
34
|
+
switch (request.method) {
|
|
35
|
+
case 'discover': {
|
|
36
|
+
const query = request.query || {};
|
|
37
|
+
const full = await sam.discover({ ...query, limit: Number.MAX_SAFE_INTEGER });
|
|
38
|
+
const permitted = full.operations.filter(operation => modeFor(operation.id));
|
|
39
|
+
const limit = Number.isInteger(query.limit) ? Math.min(1000, Math.max(0, query.limit)) : 20;
|
|
40
|
+
return { ok: true, count: Math.min(limit, permitted.length), operations: permitted.slice(0, limit) };
|
|
31
41
|
}
|
|
32
42
|
case 'describe':
|
|
33
|
-
if(!
|
|
43
|
+
if (!modeFor(request.id)) throw new Error('sam_bridge_operation_not_allowed');
|
|
34
44
|
return sam.describe(request.id);
|
|
35
45
|
case 'status':
|
|
36
|
-
if(!
|
|
37
|
-
return {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
if (!modeFor(request.id))
|
|
47
|
+
return {
|
|
48
|
+
schema: 'sam.capability.readiness.v1', id: request.id, declared: false,
|
|
49
|
+
registered: false, bound: false, authorized: false, available: false,
|
|
50
|
+
verified: false, ready: false, readiness: 'unavailable',
|
|
51
|
+
reason: 'sam_bridge_operation_not_allowed',
|
|
52
|
+
};
|
|
41
53
|
return sam.status(request.id);
|
|
42
|
-
case 'decide':
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
54
|
+
case 'decide':
|
|
55
|
+
return sam.decide(assertLocalDecisionInput(request.input || {}));
|
|
56
|
+
case 'invoke': {
|
|
57
|
+
const mode = modeFor(request.id);
|
|
58
|
+
if (!mode) throw new Error('sam_bridge_operation_not_allowed');
|
|
59
|
+
const input = request.input || {};
|
|
60
|
+
if (!input || typeof input !== 'object' || Array.isArray(input))
|
|
61
|
+
throw new Error('sam_bridge_invalid_input');
|
|
62
|
+
return sam.invoke(request.id,
|
|
63
|
+
mode === 'workspace_read' ? insideRoot(input)
|
|
64
|
+
: mode === 'decision' ? assertLocalDecisionInput(input)
|
|
65
|
+
: input);
|
|
47
66
|
}
|
|
48
|
-
default:
|
|
67
|
+
default:
|
|
68
|
+
throw new Error('sam_bridge_unknown_method');
|
|
49
69
|
}
|
|
50
70
|
}
|
|
51
|
-
try{
|
|
52
|
-
const input=readFileSync(0,'utf8');
|
|
53
|
-
if(Buffer.byteLength(input)>1024*1024)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
process.
|
|
71
|
+
try {
|
|
72
|
+
const input = readFileSync(0, 'utf8');
|
|
73
|
+
if (Buffer.byteLength(input) > 1024 * 1024)
|
|
74
|
+
throw new Error('sam_bridge_request_too_large');
|
|
75
|
+
const result = await handle(JSON.parse(input));
|
|
76
|
+
process.stdout.write(JSON.stringify({ ok: true, result }) + '\n');
|
|
77
|
+
} catch (error) {
|
|
78
|
+
process.stdout.write(JSON.stringify({
|
|
79
|
+
ok: false, error: { code: error.code || error.message || 'sam_bridge_error' },
|
|
80
|
+
}) + '\n');
|
|
81
|
+
process.exitCode = 1;
|
|
59
82
|
}
|
|
@@ -23,6 +23,7 @@ export const architecturalKnowledgeOps=tools.map(tool=>defineSamOperation({
|
|
|
23
23
|
skill:skills[tool.name],
|
|
24
24
|
execution:{lanes:['local','remote','sandbox'],model:'never',network:'none',sideEffects:'none'},
|
|
25
25
|
risk:'read_only',
|
|
26
|
+
interop:{stdio:'pure'},
|
|
26
27
|
capabilities:[tool.name],
|
|
27
28
|
docs:{section:'Architectural Knowledge'},
|
|
28
29
|
status:'stable',
|
|
@@ -8,6 +8,7 @@ export const artifactRenderOp = defineSamOperation({
|
|
|
8
8
|
outcome: 'Return an in-memory HTML/Markdown bundle and SHA-256 manifest; no implicit filesystem writes.',
|
|
9
9
|
description: 'Deterministic SAM artifact composition; caller owns findings, evidence and storage.',
|
|
10
10
|
execution: { lanes: ['local','remote','sandbox'], model:'never', embedding:'never',network:'none',sideEffects:'none',provider_spend:'never' },
|
|
11
|
-
risk: 'read_only',
|
|
11
|
+
risk: 'read_only',
|
|
12
|
+
interop: { stdio: 'pure' }, capabilities: ['artifact.render'], artifacts:['sam.artifact.bundle.v1'],
|
|
12
13
|
status:'stable', handler(input={}) {return renderSamArtifact(input);}
|
|
13
14
|
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { defineSamOperation } from '../define.js';
|
|
2
|
+
import { ifcDiff, ifcEdit, ifcInspect, ifcValidate, IFC_EDIT_OPERATIONS } from '../../lib/cad/ifc.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Real IFC machinery, one IfcOpenShell adapter. Reads are read_only; edit writes a
|
|
6
|
+
* NEW .ifc (never the source) and refuses to write unless it can prove no new
|
|
7
|
+
* validation errors, every GlobalId kept, and no change outside the edited objects.
|
|
8
|
+
*/
|
|
9
|
+
const PATH = { type: 'string', minLength: 1, maxLength: 4096 };
|
|
10
|
+
const GUID = { type: 'string', pattern: '^[0-9A-Za-z_$]{22}$' };
|
|
11
|
+
const NAME = { type: 'string', pattern: '^[A-Za-z][A-Za-z0-9_ .:-]{0,127}$' };
|
|
12
|
+
const common = {
|
|
13
|
+
python: { type: 'string', description: 'Optional Python interpreter that has ifcopenshell; discovered when omitted.' },
|
|
14
|
+
timeoutSeconds: { type: 'integer', minimum: 1, maximum: 600 },
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const editSchema = {
|
|
18
|
+
oneOf: [
|
|
19
|
+
{ type: 'object', required: ['op', 'globalId', 'attribute', 'value'], additionalProperties: false,
|
|
20
|
+
properties: { op: { const: 'attribute.set' }, globalId: GUID,
|
|
21
|
+
attribute: { enum: ['Name', 'Description', 'ObjectType', 'LongName', 'Tag'] },
|
|
22
|
+
value: { type: ['string', 'null'] } } },
|
|
23
|
+
{ type: 'object', required: ['op', 'globalId', 'pset', 'name', 'value'], additionalProperties: false,
|
|
24
|
+
properties: { op: { const: 'property.set' }, globalId: GUID, pset: NAME, name: NAME,
|
|
25
|
+
value: { type: ['string', 'number', 'boolean'] } } },
|
|
26
|
+
{ type: 'object', required: ['op', 'globalId', 'pset', 'name'], additionalProperties: false,
|
|
27
|
+
properties: { op: { const: 'property.remove' }, globalId: GUID, pset: NAME, name: NAME } },
|
|
28
|
+
{ type: 'object', required: ['op', 'globalId', 'delta_m'], additionalProperties: false,
|
|
29
|
+
properties: { op: { const: 'placement.move' }, globalId: GUID,
|
|
30
|
+
delta_m: { type: 'array', items: { type: 'number' }, minItems: 3, maxItems: 3 },
|
|
31
|
+
with_children: { type: 'boolean' } } },
|
|
32
|
+
{ type: 'object', required: ['op', 'globalId', 'depth_m'], additionalProperties: false,
|
|
33
|
+
properties: { op: { const: 'solid.extrusion_depth' }, globalId: GUID, depth_m: { type: 'number', exclusiveMinimum: 0 } } },
|
|
34
|
+
{ type: 'object', required: ['op', 'globalId'], additionalProperties: false,
|
|
35
|
+
properties: { op: { const: 'element.remove' }, globalId: GUID, cascade: { type: 'boolean' } } },
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const base = (action, summary, description, extra) => ({
|
|
40
|
+
version: 1, module: 'cad', action, summary, description, status: 'stable',
|
|
41
|
+
execution: { lanes: ['local', 'sandbox'], model: 'never', network: 'none', ...extra.execution },
|
|
42
|
+
risk: extra.risk, capabilities: [`cad.bim.ifc.${action.replace('bim.ifc.', '')}`],
|
|
43
|
+
cli: { command: [['cad', 'ifc', action.replace('bim.ifc.', '')]] }, docs: { section: 'CAD' },
|
|
44
|
+
skill: 'agentsam-arch-bim',
|
|
45
|
+
});
|
|
46
|
+
const cwdOf = (input, ctx) => input.cwd || ctx.cwd || process.cwd();
|
|
47
|
+
|
|
48
|
+
export const cadBimIfcInspectOp = defineSamOperation({
|
|
49
|
+
...base('bim.ifc.inspect', 'Read an IFC into a semantic model keyed by GlobalId.',
|
|
50
|
+
'Spatial tree, types, elements, spaces, property sets and relationships via IfcOpenShell. Check `model.truncated`.',
|
|
51
|
+
{ risk: 'read_only', execution: { sideEffects: 'none' } }),
|
|
52
|
+
id: 'cad.bim.ifc.inspect',
|
|
53
|
+
input_schema: { type: 'object', required: ['input'], additionalProperties: false,
|
|
54
|
+
properties: { input: PATH, maxElements: { type: 'integer', minimum: 1, maximum: 200000 }, cwd: PATH, ...common } },
|
|
55
|
+
handler: async (input = {}, ctx = {}) => ifcInspect({ ...input, cwd: cwdOf(input, ctx) }),
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export const cadBimIfcValidateOp = defineSamOperation({
|
|
59
|
+
...base('bim.ifc.validate', 'Validate an IFC against its schema.',
|
|
60
|
+
'IfcOpenShell schema validation (no EXPRESS rules). Not building-code compliance and not an IDS check.',
|
|
61
|
+
{ risk: 'read_only', execution: { sideEffects: 'none' } }),
|
|
62
|
+
id: 'cad.bim.ifc.validate',
|
|
63
|
+
input_schema: { type: 'object', required: ['input'], additionalProperties: false,
|
|
64
|
+
properties: { input: PATH, cwd: PATH, ...common } },
|
|
65
|
+
handler: async (input = {}, ctx = {}) => ifcValidate({ ...input, cwd: cwdOf(input, ctx) }),
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
export const cadBimIfcDiffOp = defineSamOperation({
|
|
69
|
+
...base('bim.ifc.diff', 'Compare two IFC files by GlobalId.',
|
|
70
|
+
'Added, removed and changed objects (attributes, property sets, placement, extrusion geometry, type, container). States what it does not compare.',
|
|
71
|
+
{ risk: 'read_only', execution: { sideEffects: 'none' } }),
|
|
72
|
+
id: 'cad.bim.ifc.diff',
|
|
73
|
+
input_schema: { type: 'object', required: ['input', 'other'], additionalProperties: false,
|
|
74
|
+
properties: { input: PATH, other: PATH, cwd: PATH, ...common } },
|
|
75
|
+
handler: async (input = {}, ctx = {}) => ifcDiff({ ...input, cwd: cwdOf(input, ctx) }),
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
export const cadBimIfcEditOp = defineSamOperation({
|
|
79
|
+
...base('bim.ifc.edit', 'Edit an IFC by GlobalId into a new, proven copy.',
|
|
80
|
+
`Allowlisted edits (${IFC_EDIT_OPERATIONS.join(', ')}). Never overwrites the source. Writes nothing unless the copy adds no validation errors, keeps every GlobalId (except explicit removals) and changes nothing outside the edited objects. 'base' is the sha256 of the source you read; a mismatch is a revision conflict.`,
|
|
81
|
+
{ risk: 'write', execution: { sideEffects: 'local_write' } }),
|
|
82
|
+
id: 'cad.bim.ifc.edit',
|
|
83
|
+
input_schema: { type: 'object', required: ['input', 'output', 'edits'], additionalProperties: false,
|
|
84
|
+
properties: { input: PATH, output: PATH, base: { type: 'string', pattern: '^[a-f0-9]{64}$' },
|
|
85
|
+
edits: { type: 'array', minItems: 1, maxItems: 500, items: editSchema }, cwd: PATH, ...common } },
|
|
86
|
+
handler: async (input = {}, ctx = {}) => ifcEdit({ ...input, cwd: cwdOf(input, ctx) }),
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
export const cadBimIfcOps = [cadBimIfcInspectOp, cadBimIfcValidateOp, cadBimIfcDiffOp, cadBimIfcEditOp];
|
|
@@ -24,6 +24,7 @@ export const decisionEvaluateOp = defineSamOperation({
|
|
|
24
24
|
provider_spend: 'optional',
|
|
25
25
|
},
|
|
26
26
|
risk: 'read_only',
|
|
27
|
+
interop: { stdio: 'decision' },
|
|
27
28
|
capabilities: ['decision.evaluate', 'planning.goap'],
|
|
28
29
|
artifacts: ['decision.evaluation', 'decision.receipt'],
|
|
29
30
|
cli: { command: [] },
|
|
@@ -27,6 +27,7 @@ export const planningGoapOp = defineSamOperation({
|
|
|
27
27
|
provider_spend: 'never',
|
|
28
28
|
},
|
|
29
29
|
risk: 'read_only',
|
|
30
|
+
interop: { stdio: 'pure' },
|
|
30
31
|
capabilities: ['planning.goap', 'planning.astar'],
|
|
31
32
|
artifacts: ['planning.goap.plan', 'planning.receipt'],
|
|
32
33
|
cli: { command: [['plan', 'brand', '--goap']] },
|
|
@@ -36,6 +36,7 @@ export const repositoryInspect = defineSamOperation({
|
|
|
36
36
|
provider_spend: 'never',
|
|
37
37
|
},
|
|
38
38
|
risk: 'read_only',
|
|
39
|
+
interop: { stdio: 'workspace_read' },
|
|
39
40
|
capabilities: ['repository.snapshot', 'repository.ast', 'repository.merkle'],
|
|
40
41
|
artifacts: ['repository.snapshot', 'evidence.refs'],
|
|
41
42
|
cli: { command: [['inspect']] },
|
|
@@ -8,7 +8,7 @@ const cache = new MotionCache();
|
|
|
8
8
|
const exec = { lanes: ['local', 'sandbox'], model: 'never', embedding: 'never', network: 'none', sideEffects: 'none', provider_spend: 'never' };
|
|
9
9
|
const mk = (id, action, summary, handler) => defineSamOperation({
|
|
10
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',
|
|
11
|
+
skill: { id: 'agentsam-app-fundamentals', help: true }, execution: exec, risk: 'read_only', interop: { stdio: 'pure' },
|
|
12
12
|
capabilities: [id], artifacts: ['robotics.receipt'], status: 'stable', handler,
|
|
13
13
|
});
|
|
14
14
|
const needWorld = (i) => { if (!i?.world?.objects) throw new Error('invalid_input:world_required'); };
|
package/src/sam/packs/core.js
CHANGED
|
@@ -3,6 +3,7 @@ import { brandScanOp } from '../operations/brand-scan.js';
|
|
|
3
3
|
import { securityScanOp } from '../operations/security-scan.js';
|
|
4
4
|
import { terminalExecOp } from '../operations/terminal-exec.js';
|
|
5
5
|
import { cadBlenderInspectOp } from '../operations/cad-blender-inspect.js';
|
|
6
|
+
import { cadBimIfcOps } from '../operations/cad-bim-ifc.js';
|
|
6
7
|
import { codebaseindexIngestOp } from '../operations/codebaseindex-ingest.js';
|
|
7
8
|
import { planningAstarOp } from '../operations/planning-astar.js';
|
|
8
9
|
import { planningGoapOp } from '../operations/planning-goap.js';
|
|
@@ -18,6 +19,7 @@ export const CORE_OPERATIONS = [
|
|
|
18
19
|
securityScanOp,
|
|
19
20
|
terminalExecOp,
|
|
20
21
|
cadBlenderInspectOp,
|
|
22
|
+
...cadBimIfcOps,
|
|
21
23
|
codebaseindexIngestOp,
|
|
22
24
|
planningAstarOp,
|
|
23
25
|
planningGoapOp,
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one definition of an app's evidence endpoint. An app opts in by declaring
|
|
3
|
+
* `storage.evidenceEndpoint` in its agentsam.app.json; the hosted EvidenceStore and
|
|
4
|
+
* `agentsam app validate` both read it from here, so they cannot drift apart.
|
|
5
|
+
* Nothing in this file names a bucket, account or app: those come from the manifest.
|
|
6
|
+
*/
|
|
7
|
+
export const EVIDENCE_ENDPOINT = /^\/api\/([a-z][a-z0-9-]*)\/evidence$/;
|
|
8
|
+
|
|
9
|
+
/** Scope prefix an app's evidence endpoint is guarded by, e.g. /api/cad/evidence -> "cad". */
|
|
10
|
+
export function evidenceScopePrefix(endpoint) {
|
|
11
|
+
return typeof endpoint === 'string' ? EVIDENCE_ENDPOINT.exec(endpoint)?.[1] ?? null : null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Problems with a manifest `storage` block that opts into evidence; empty means valid. */
|
|
15
|
+
export function evidenceStorageProblems(storage) {
|
|
16
|
+
const problems = [];
|
|
17
|
+
const prefix = evidenceScopePrefix(storage?.evidenceEndpoint);
|
|
18
|
+
if (!prefix) {
|
|
19
|
+
problems.push('evidenceEndpoint must look like /api/<app>/evidence (lowercase kebab-case segment)');
|
|
20
|
+
}
|
|
21
|
+
if (typeof storage?.bucketName !== 'string' || !/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/.test(storage.bucketName)) {
|
|
22
|
+
problems.push('bucketName must be the R2 bucket name (3-63 lowercase letters, digits or hyphens)');
|
|
23
|
+
}
|
|
24
|
+
if (typeof storage?.artifactBinding !== 'string' || !/^[A-Z][A-Z0-9_]*$/.test(storage.artifactBinding)) {
|
|
25
|
+
problems.push('artifactBinding must be the Worker R2 binding name (UPPER_SNAKE_CASE)');
|
|
26
|
+
}
|
|
27
|
+
if (typeof storage?.principal !== 'string' || !storage.principal.trim()) {
|
|
28
|
+
problems.push('principal must name the credential verifier that authorizes evidence writes');
|
|
29
|
+
}
|
|
30
|
+
if (prefix) {
|
|
31
|
+
const scopes = Array.isArray(storage.requiredScopes) ? storage.requiredScopes : [];
|
|
32
|
+
for (const action of ['read', 'write']) {
|
|
33
|
+
if (!scopes.includes(`${prefix}:evidence.${action}`)) {
|
|
34
|
+
problems.push(`requiredScopes must include "${prefix}:evidence.${action}"`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return problems;
|
|
39
|
+
}
|
|
@@ -10,11 +10,12 @@ const BIG = { maxBuffer: 32 * 1024 * 1024 };
|
|
|
10
10
|
* decoder smoke check, not visual parity. Browser recordings often lack a duration header, so the
|
|
11
11
|
* duration falls back to what the decoder actually read.
|
|
12
12
|
*/
|
|
13
|
-
export function createFfprobeMedia({ ffprobe = 'ffprobe', ffmpeg = 'ffmpeg', decode = true, exec = defaultExec } = {}) {
|
|
13
|
+
export function createFfprobeMedia({ ffprobe = 'ffprobe', ffmpeg = 'ffmpeg', decode = true, exec = defaultExec, probeTimeoutMs = null } = {}) {
|
|
14
14
|
return {
|
|
15
15
|
async probe({ path: file }) {
|
|
16
16
|
if (typeof file !== 'string' || file.length === 0) throw evidenceError('evidence_media_path_required');
|
|
17
|
-
const { stdout } = await exec(ffprobe, ['-v', 'error', '-show_format', '-show_streams', '-of', 'json', file],
|
|
17
|
+
const { stdout } = await exec(ffprobe, ['-v', 'error', '-show_format', '-show_streams', '-of', 'json', file],
|
|
18
|
+
{ ...BIG, ...(probeTimeoutMs ? { timeout: probeTimeoutMs } : {}) });
|
|
18
19
|
const meta = JSON.parse(stdout);
|
|
19
20
|
const streams = meta.streams ?? [];
|
|
20
21
|
const video = streams.find((s) => s.codec_type === 'video');
|
|
@@ -2,15 +2,17 @@ import { createHash } from 'node:crypto';
|
|
|
2
2
|
import { Readable } from 'node:stream';
|
|
3
3
|
import { assertSafeKey } from './naming.js';
|
|
4
4
|
import { evidenceError } from './contract.js';
|
|
5
|
+
import { EVIDENCE_ENDPOINT } from './endpoint.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
|
-
* Host-injected remote EvidenceStore backed by
|
|
8
|
-
*
|
|
8
|
+
* Host-injected remote EvidenceStore backed by the app's own R2 authority, located
|
|
9
|
+
* by the app manifest's storage.evidenceEndpoint. No account/project literals,
|
|
10
|
+
* Cloudflare keys, or user-supplied URLs.
|
|
9
11
|
* The host's authenticated request port owns OAuth and dispatch.
|
|
10
12
|
*/
|
|
11
13
|
export function createHostedEvidenceStore({ appManifest, request, principal } = {}) {
|
|
12
14
|
const route = appManifest?.storage?.evidenceEndpoint;
|
|
13
|
-
if (typeof route !== 'string' ||
|
|
15
|
+
if (typeof route !== 'string' || !EVIDENCE_ENDPOINT.test(route))
|
|
14
16
|
throw evidenceError('evidence_hosted_endpoint_manifest_required');
|
|
15
17
|
if (typeof request !== 'function') throw evidenceError('evidence_hosted_authenticated_request_required');
|
|
16
18
|
const digest = value => createHash('sha256').update(value).digest('hex');
|
package/src/sam/shell-host.js
CHANGED
|
@@ -14,6 +14,7 @@ import { createObjectMediaStore } from './adapters/object-media-store.js';
|
|
|
14
14
|
import { readMediaStorageSelection } from './media/environment.js';
|
|
15
15
|
import { createLocalScriptStore } from './adapters/local-script-store.js';
|
|
16
16
|
import { createLocalScriptRuntime, isLocalBashAvailable } from './adapters/local-script-runtime.js';
|
|
17
|
+
import { findOpenCvPython, createOpenCvVideoOperations } from './adapters/opencv-video.js';
|
|
17
18
|
import { createWorkspaceMediaImportOperation, projectInstallationId } from './adapters/workspace-media.js';
|
|
18
19
|
|
|
19
20
|
const LOCAL_SCRIPT_OPERATIONS = Object.freeze(['sam.script.save', 'sam.script.get', 'sam.superbash']);
|
|
@@ -31,6 +32,8 @@ const LOCAL_MEDIA_OPERATIONS = Object.freeze([
|
|
|
31
32
|
'media.image.normalize_color',
|
|
32
33
|
'media.model.inspect',
|
|
33
34
|
'media.model.validate',
|
|
35
|
+
'media.video.inspect',
|
|
36
|
+
'media.video.sample_frames',
|
|
34
37
|
]);
|
|
35
38
|
|
|
36
39
|
/**
|
|
@@ -56,7 +59,7 @@ export async function resolveShellSamIdentity({ state, authorityLoader = resolve
|
|
|
56
59
|
} catch { return null; }
|
|
57
60
|
}
|
|
58
61
|
|
|
59
|
-
export function createShellSamAdapter({ state, authorize, trustedIdentity = null, mediaBindings = null } = {}) {
|
|
62
|
+
export function createShellSamAdapter({ state, authorize, trustedIdentity = null, mediaBindings = null, procedureOperationIds = [] } = {}) {
|
|
60
63
|
if (!state?.cwd || typeof authorize !== 'function') return null;
|
|
61
64
|
const readTrustedIdentity = () => {
|
|
62
65
|
const session = readAccountSession({home:state.home});
|
|
@@ -101,18 +104,33 @@ export function createShellSamAdapter({ state, authorize, trustedIdentity = null
|
|
|
101
104
|
},
|
|
102
105
|
authorize: permit,
|
|
103
106
|
}});
|
|
104
|
-
if (assetStore)
|
|
105
|
-
|
|
106
|
-
resolveTrustedContext: async () => {
|
|
107
|
+
if (assetStore) {
|
|
108
|
+
const resolvePrincipal = async () => {
|
|
107
109
|
const principal = readTrustedIdentity();
|
|
108
110
|
if (!principal) throw new Error('sam_authenticated_session_required');
|
|
109
111
|
return principal;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
};
|
|
113
|
+
samOS.install([createWorkspaceMediaImportOperation({
|
|
114
|
+
root, assetStore, resolveTrustedContext: resolvePrincipal, authorize: permit,
|
|
115
|
+
})]);
|
|
116
|
+
const opencvPython = findOpenCvPython();
|
|
117
|
+
if (opencvPython) samOS.install(createOpenCvVideoOperations({
|
|
118
|
+
assetStore, resolveTrustedContext: resolvePrincipal, authorize: permit,
|
|
119
|
+
pythonExecutable: opencvPython,
|
|
120
|
+
}));
|
|
121
|
+
}
|
|
113
122
|
return createSamCapabilityAdapter({
|
|
114
123
|
os:samOS,
|
|
115
|
-
|
|
124
|
+
// Additional core operations are exposed only when declared by a packaged
|
|
125
|
+
// procedure and independently installed as harmless read-only operations.
|
|
126
|
+
// An unbound procedure never creates a synthetic executor or permission.
|
|
127
|
+
expose:[...new Set([
|
|
128
|
+
...LOCAL_MEDIA_OPERATIONS, ...LOCAL_SCRIPT_OPERATIONS,
|
|
129
|
+
...procedureOperationIds.filter(id => {
|
|
130
|
+
const op = samOS.get(id);
|
|
131
|
+
return op?.risk === 'read_only' && op?.execution?.sideEffects === 'none';
|
|
132
|
+
}),
|
|
133
|
+
])].filter(id => samOS.get(id)),
|
|
116
134
|
// Provider dispatch performs a separate allowlist check. The bound
|
|
117
135
|
// SAM handlers make the actual privileged auth decision above.
|
|
118
136
|
authorize: async () => !!readTrustedIdentity(),
|
package/src/skills/catalog.js
CHANGED
|
@@ -14,11 +14,22 @@ function normalizeSkillId(value) {
|
|
|
14
14
|
return String(value ?? '').trim().toLowerCase();
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
// Only advertise instructions physically shipped in this SDK distribution.
|
|
18
|
+
// The source catalog may contain additional skills intentionally held from npm.
|
|
19
|
+
function skillIsAvailable(skill) {
|
|
20
|
+
try {
|
|
21
|
+
return fs.existsSync(safeSkillPath(skill.entry));
|
|
22
|
+
} catch {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
17
27
|
function resolveSkillRecord(idOrAlias) {
|
|
18
28
|
const needle = normalizeSkillId(idOrAlias);
|
|
19
29
|
if (!needle) return null;
|
|
20
30
|
const catalog = readCatalog();
|
|
21
31
|
return catalog.skills.find((skill) => {
|
|
32
|
+
if (!skillIsAvailable(skill)) return false;
|
|
22
33
|
if (normalizeSkillId(skill.id) === needle) return true;
|
|
23
34
|
return (skill.aliases ?? []).some((alias) => normalizeSkillId(alias) === needle);
|
|
24
35
|
}) ?? null;
|
|
@@ -34,7 +45,7 @@ function safeSkillPath(relativePath) {
|
|
|
34
45
|
}
|
|
35
46
|
|
|
36
47
|
export function listSkills() {
|
|
37
|
-
return readCatalog().skills.map((skill) => ({ ...skill }));
|
|
48
|
+
return readCatalog().skills.filter(skillIsAvailable).map((skill) => ({ ...skill }));
|
|
38
49
|
}
|
|
39
50
|
|
|
40
51
|
export function getSkill(idOrAlias) {
|
package/src/skills/registry.js
CHANGED
|
@@ -46,24 +46,21 @@ function builtinSuggestedTrigger(skill) {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
function builtinToManifest(skill, skillsRoot) {
|
|
49
|
+
const declarationPath = path.join(skillsRoot, path.dirname(skill.entry), 'agentsam.skill.json');
|
|
50
|
+
const declaration = normalizeSkillManifest(JSON.parse(fs.readFileSync(declarationPath, 'utf8')));
|
|
51
|
+
if (declaration.id !== skill.id || declaration.instructions.ref !== 'SKILL.md'
|
|
52
|
+
|| declaration.instructions.source !== 'local_file') {
|
|
53
|
+
throw new Error(`sdk_skill_manifest_mismatch:${skill.id}`);
|
|
54
|
+
}
|
|
55
|
+
// Keep existing SDK slash names and catalog aliases stable. An adjacent manifest
|
|
56
|
+
// is authoritative metadata; the package_file projection resolves its SKILL.md.
|
|
49
57
|
return normalizeSkillManifest({
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
instructions: {
|
|
57
|
-
source: 'package_file',
|
|
58
|
-
ref: skill.entry,
|
|
59
|
-
},
|
|
60
|
-
execution: {
|
|
61
|
-
mode: 'turn',
|
|
62
|
-
tools: [],
|
|
63
|
-
operations: [],
|
|
64
|
-
capabilities: [],
|
|
65
|
-
},
|
|
66
|
-
package: '@inneranimalmedia/agentsam-sdk',
|
|
58
|
+
...declaration,
|
|
59
|
+
name: skill.title || declaration.name,
|
|
60
|
+
description: skill.description || declaration.description,
|
|
61
|
+
slash: { suggested: builtinSuggestedTrigger(skill) || declaration.slash?.suggested },
|
|
62
|
+
instructions: { source: 'package_file', ref: skill.entry },
|
|
63
|
+
package: declaration.package || '@inneranimalmedia/agentsam-sdk',
|
|
67
64
|
});
|
|
68
65
|
}
|
|
69
66
|
|
|
@@ -92,6 +89,8 @@ export class SkillRegistry {
|
|
|
92
89
|
|
|
93
90
|
if (this.includeBuiltins) {
|
|
94
91
|
for (const row of listBuiltinCatalog()) {
|
|
92
|
+
// Custom or packaged skill roots may intentionally omit source-only skills.
|
|
93
|
+
if (!fs.existsSync(path.join(this.skillsRoot, row.entry))) continue;
|
|
95
94
|
const manifest = builtinToManifest(row, this.skillsRoot);
|
|
96
95
|
byId.set(manifest.id, {
|
|
97
96
|
id: manifest.id,
|
package/src/ui/boot.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import pc from 'picocolors';
|
|
3
3
|
import pkg from '../../package.json' with { type: 'json' };
|
|
4
|
-
import {
|
|
4
|
+
import { renderHomeScreen } from './home-screen.js';
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
function compactHome(value) {
|
|
@@ -34,22 +34,20 @@ export function renderBootSummary({ identity, preferences }) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export async function runBootScene({
|
|
37
|
-
identity,
|
|
37
|
+
identity,
|
|
38
38
|
write = process.stderr.write.bind(process.stderr),
|
|
39
39
|
}) {
|
|
40
40
|
// Presentation belongs on stderr and never pollutes data-oriented stdout.
|
|
41
41
|
if (!process.stderr.isTTY || process.env.CI) return;
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
cwd: compactHome(identity.root),
|
|
42
|
+
const color = !process.env.NO_COLOR && process.env.TERM !== 'dumb';
|
|
43
|
+
const rows = process.stderr.rows || 24;
|
|
44
|
+
// Scroll earlier output into scrollback instead of erasing it, then draw from the top.
|
|
45
|
+
write('\n'.repeat(rows) + '\x1b[H' + renderHomeScreen({
|
|
47
46
|
version: pkg.version,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
write(' Type / and press Enter for the command menu.\n\n');
|
|
47
|
+
cwd: compactHome(identity.root),
|
|
48
|
+
branch: identity.branch || '',
|
|
49
|
+
cols: process.stderr.columns || 80,
|
|
50
|
+
rows,
|
|
51
|
+
color,
|
|
52
|
+
}));
|
|
55
53
|
}
|