@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,63 @@
|
|
|
1
|
+
# SAM OpenCV media inspection
|
|
2
|
+
|
|
3
|
+
OpenCV is an **optional computer-vision engine**, not an AI model and not a new AgentSam agent, registry, storage service or background worker. The same SAM operations can be called by any model/provider that can invoke AgentSam's host tools.
|
|
4
|
+
|
|
5
|
+
## Install the optional engine
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# In the AgentSam SDK checkout (or in an installed SDK Python environment)
|
|
9
|
+
python3 -m venv python/.venv
|
|
10
|
+
python/.venv/bin/python -m pip install -e './python[opencv]'
|
|
11
|
+
python/.venv/bin/python -c 'import cv2; print(cv2.__version__)'
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
This installs `opencv-python-headless` and its NumPy dependency in a **project-local Python environment**; the Python SDK's normal installation has no OpenCV dependency. The SDK CLI first looks for the packaged Python environment, then for a Python interpreter explicitly configured with `AGENTSAM_OPENCV_PYTHON`, and finally for a compatible `python3` on the host. If no working OpenCV interpreter is available, SAM does **not** advertise tools it cannot execute. For video imports, install FFprobe/FFmpeg separately; those are existing SAM evidence engines.
|
|
15
|
+
|
|
16
|
+
## Model-independent operations
|
|
17
|
+
|
|
18
|
+
| Operation | Side effects | Output |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| `media.local.import` | Authorized library write | Imports a validated, workspace-bounded MP4, MOV, WebM, MKV or AVI into the existing Media Library, or an existing image/GLB |
|
|
21
|
+
| `media.video.inspect` | Read only | Dimensions, nominal FPS, reported frames, estimated duration, uniform timecoded samples, and numeric visual-change scores |
|
|
22
|
+
| `media.video.sample_frames` | Authorized derivative writes | 1–12 JPEG derivatives with frame index, estimated timestamp, change score, SHA-256, source lineage, and existing Media Library asset IDs |
|
|
23
|
+
|
|
24
|
+
All video operations use the **trusted host's account, actor, installation and existing media store**. Neither the model nor the tool input can supply an arbitrary disk path. Cross-account asset access fails, and frame writes require the host to authorize `media_derivative_create`. The original video remains unmodified. The Node adapter uses temporary files with bounded runtime/size and removes them on completion; it does not store private source paths in SAM results.
|
|
25
|
+
|
|
26
|
+
Example once the normal SAM host and user session are connected:
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
const imported = await samAdapter.invoke('media.local.import', {
|
|
30
|
+
relativePath: 'recordings/navigation.mov',
|
|
31
|
+
});
|
|
32
|
+
const metadata = await samAdapter.invoke('media.video.inspect', {
|
|
33
|
+
assetId: imported.data.assetId, sampleCount: 8,
|
|
34
|
+
});
|
|
35
|
+
const frames = await samAdapter.invoke('media.video.sample_frames', {
|
|
36
|
+
assetId: imported.data.assetId, sampleCount: 8, maxWidth: 640,
|
|
37
|
+
});
|
|
38
|
+
// frames.data.frames contains owned Media Library asset IDs, not external URLs.
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Call the standalone Python helper only for **trusted local tooling** (it accepts a filesystem path and does not implement the SAM authorization layer):
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
from agentsam_sdk.media import inspect_video
|
|
45
|
+
metadata = inspect_video('recording.mp4', sample_count=8)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Interpretation boundaries and resource budgets
|
|
49
|
+
|
|
50
|
+
- This is **deterministic media processing**, not semantic vision analysis. A vision-capable model must separately receive the selected frames to interpret UI components, motion, or scenes. Normal chat-attachment ingestion and provider-specific multimodal frame delivery are **not yet automatically wired** by this SDK change.
|
|
51
|
+
- Timestamps and duration are estimated using nominal FPS and may be inaccurate on variable-frame-rate iPhone screen recordings. OpenCV can fail to seek in certain container/codec combinations; such failures are surfaced, not silently guessed.
|
|
52
|
+
- `visual_change_score` is the grayscale difference **between sampled frames**; it does not identify objects, verify interaction, measure optical-flow direction, or prove a scene cut.
|
|
53
|
+
- The current host-local adapter accepts source assets up to **50 MiB**, at most 12 sampled frames, at most 960 pixels of JPEG width, two concurrent jobs, and 45 seconds per job. Larger recordings require a future streaming/object-storage processing lane instead of loading an entire video into memory.
|
|
54
|
+
- FFprobe validates the imported video container before placing it into the existing Media Library. The source MIME, ownership, and SHA-256 are checked again by the OpenCV adapter.
|
|
55
|
+
|
|
56
|
+
## Tests
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
python/.venv/bin/python -m unittest discover -s python/tests -p test_opencv_media.py -v
|
|
60
|
+
node --test test/integration/sam-opencv-media.test.mjs
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The real-engine tests generate tiny videos, verify decoded frame content, prove cross-account isolation and denied writes, and confirm frame derivatives retain source lineage. No video or external cloud storage is required.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# AgentSam Desktop / Web Parity Acceptance
|
|
2
|
+
|
|
3
|
+
**Scope:** The portable Local Studio desktop shell and the hosted AgentSam workbench must expose the same authenticated account capabilities. Native execution and local files remain device-specific; account app state does not.
|
|
4
|
+
|
|
5
|
+
## P0 — Account Apps synchronization
|
|
6
|
+
|
|
7
|
+
1. Both surfaces authenticate against the same identity authority and resolve the canonical `accounts.id` from a verified session. The native Apps API uses its secure bearer session; frontend-supplied account IDs do not authorize inventory access.
|
|
8
|
+
2. Both surfaces read `GET /api/apps/launcher` and display the same account-owned installed, enabled, disabled, pinned and available apps. An unverified response is an error, **not** zero installed apps.
|
|
9
|
+
3. Install, enable, disable, remove, pin and last-opened activity must round-trip through the account Apps API, preserving existing installations. Do not seed demo records or maintain a desktop-only list.
|
|
10
|
+
4. Native service routing is an explicit allowlist: `GET /api/apps/launcher`, `POST|PATCH|DELETE /api/apps/install`, and `POST /api/apps/open`. Other paths and methods fail closed.
|
|
11
|
+
5. Differentiate stale desktop bridge, expired authentication, service outage and verified empty registry. A failed change must not claim success.
|
|
12
|
+
6. The account Apps dialog, Settings Apps page, new-tab launcher, navigation and Side Stage App library must share the same state and refresh on account changes.
|
|
13
|
+
|
|
14
|
+
## P0 — Desktop release integrity
|
|
15
|
+
|
|
16
|
+
1. The built app version, source manifest version and delivery artifact version must agree; verify the installed `/Applications/AgentSam Local Studio.app` independently from repository metadata.
|
|
17
|
+
2. Produce a fresh frontend bundle and native binary from a clean checkout with installed, locked dependencies. Do not reuse a stale `dist` or overwrite an existing user app until the new bundle is tested.
|
|
18
|
+
3. Validate the configured production service origin, signed-in identity status, Apps bridge endpoint methods, and authenticated account ID **without** emitting session tokens or secrets to logs.
|
|
19
|
+
4. Launch the candidate macOS `.app`, sign in to the same account as web, and compare canonical keys/statuses; install only after interactive acceptance. Keep a rollback copy of the previous `.app`.
|
|
20
|
+
|
|
21
|
+
## P1 — Shared multi-agent workspace
|
|
22
|
+
|
|
23
|
+
- Preserve independent conversation/agent sessions and independent Side Stage tabs. Switching agents must not silently close resource tabs; switching resources must not abandon the active conversation.
|
|
24
|
+
- Support real `.md` render/source viewing, code files, PDFs, browser pages, terminal tabs/splits, CAD Creator, MovieMode, Canvas, and files through their actual implementations. No mock editors or fake tool toggles.
|
|
25
|
+
- Reuse `agentsam-workbench` interaction primitives and platform shell/global session orchestration. Product apps own their editors, not the global workspace or another assistant rail.
|
|
26
|
+
- Preserve app tabs, selected resources, split widths, unsaved editor safeguards and independent scroll positions through normal tab switching and supported reloads.
|
|
27
|
+
- Align Chat/Work mode and navigation between web and desktop without collapsing multi-agent orchestration into one chat.
|
|
28
|
+
|
|
29
|
+
## Device acceptance
|
|
30
|
+
|
|
31
|
+
- Primary desktop: **2560×1440** scaled iMac viewport.
|
|
32
|
+
- Secondary desktop: **1920×1080** viewport.
|
|
33
|
+
- Mobile: **390×844** CSS pixels; use one active full-width workspace surface rather than cramped side-by-side editors.
|
|
34
|
+
- Side Stage width modes: **20% Peek, 30% Compact, 42% Working, 50% Expanded**; drag-to-resize, maximize and restore must work.
|
|
35
|
+
|
|
36
|
+
## Evidence checklist before calling this shipped
|
|
37
|
+
|
|
38
|
+
1. Same signed-in user on web and installed desktop: compare app keys, install/enabled states, and actions. The screenshot baseline shows eight installed on web and an unverified desktop Apps request.
|
|
39
|
+
2. Desktop: installed-app navigation, opens, last-opened recents, pin toggles, failure/retry feedback and deep links work against the actual account.
|
|
40
|
+
3. Desktop: open two conversations/agent sessions, several `.md` files and a browser tab; switch, resize, maximize, restore, and verify correct content without duplicate global shells.
|
|
41
|
+
4. Terminal: multiple separate local sessions and splits work; errors identify their own execution transport rather than being mistaken for account-app failures.
|
|
42
|
+
5. Run frontend typecheck, shared-nav tests, account Apps lifecycle tests, native allowlist test, desktop bundle/build gate and hands-on acceptance in the candidate app. The code tests alone are not release acceptance.
|
|
@@ -118,8 +118,6 @@ CREATE TABLE IF NOT EXISTS agentsam_tools (
|
|
|
118
118
|
tool_key TEXT,
|
|
119
119
|
capability_key TEXT,
|
|
120
120
|
handler_key TEXT,
|
|
121
|
-
route_key TEXT,
|
|
122
|
-
workflow_key TEXT,
|
|
123
121
|
task_type TEXT DEFAULT 'tool_use',
|
|
124
122
|
domain TEXT DEFAULT 'general',
|
|
125
123
|
capability_tier TEXT DEFAULT 'common',
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
-- No runtime readers or writers depend on agentsam_tool_handler_families.
|
|
2
|
+
-- Handler ownership is represented by agentsam_tools.handler_key and the
|
|
3
|
+
-- owning plugin's transport/plugin_kind; do not recreate a second registry.
|
|
4
|
+
DROP TABLE IF EXISTS agentsam_tool_handler_families;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
-- agentsam-engine: d1
|
|
2
|
+
-- Forward-only transition of installed tool identity to stable plugin_key.
|
|
3
|
+
-- Retain plugin_id, its FK, and the legacy index while older consumers exist.
|
|
4
|
+
-- Existing installed tools must not lose their plugin ownership or approval policy.
|
|
5
|
+
|
|
6
|
+
UPDATE agentsam_tools
|
|
7
|
+
SET plugin_key = (
|
|
8
|
+
SELECT p.plugin_key FROM agentsam_plugins AS p
|
|
9
|
+
WHERE p.id = agentsam_tools.plugin_id
|
|
10
|
+
LIMIT 1
|
|
11
|
+
)
|
|
12
|
+
WHERE plugin_id IS NOT NULL
|
|
13
|
+
AND (plugin_key IS NULL OR trim(plugin_key) = '')
|
|
14
|
+
AND EXISTS (
|
|
15
|
+
SELECT 1 FROM agentsam_plugins AS p
|
|
16
|
+
WHERE p.id = agentsam_tools.plugin_id
|
|
17
|
+
AND p.plugin_key IS NOT NULL AND trim(p.plugin_key) != ''
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
-- New canonical per-account uniqueness. The old plugin_id-based index remains
|
|
21
|
+
-- for rollback compatibility; do not rebuild agentsam_tools (many FK/view users).
|
|
22
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_agentsam_tools_account_plugin_key_tool_key
|
|
23
|
+
ON agentsam_tools(account_id, plugin_key, tool_key)
|
|
24
|
+
WHERE account_id IS NOT NULL
|
|
25
|
+
AND plugin_key IS NOT NULL AND trim(plugin_key) != ''
|
|
26
|
+
AND tool_key IS NOT NULL AND trim(tool_key) != '';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
-- CAD engine plugin rows are contract-agnostic. The project schema version
|
|
2
|
+
-- (cad.project.v1 / cad.project.v2) lives on the project document, not on an
|
|
3
|
+
-- engine, tool or capability record. Idempotent: no-ops where already applied.
|
|
4
|
+
UPDATE agentsam_plugins
|
|
5
|
+
SET metadata_json = json_remove(metadata_json, '$.contract'), updated_at = unixepoch()
|
|
6
|
+
WHERE plugin_key IN ('cad-engine-occt', 'cad-engine-blender', 'cad-engine-openscad')
|
|
7
|
+
AND json_extract(metadata_json, '$.contract') IS NOT NULL;
|
|
8
|
+
|
|
9
|
+
UPDATE agentsam_plugins
|
|
10
|
+
SET metadata_json = json_set(metadata_json, '$.package', '@inneranimalmedia/agentsam-occt',
|
|
11
|
+
'$.adapters', json('["browser-wasm","native"]')),
|
|
12
|
+
updated_at = unixepoch()
|
|
13
|
+
WHERE plugin_key = 'cad-engine-occt';
|
|
14
|
+
|
|
15
|
+
INSERT OR IGNORE INTO agentsam_plugins
|
|
16
|
+
(id, plugin_key, family_key, provider_key, plugin_kind, category, display_name, description,
|
|
17
|
+
transport, auth_type, tool_lanes_json, composer_visible)
|
|
18
|
+
VALUES
|
|
19
|
+
('plg_cad_engine_freecad', 'cad-engine-freecad', 'build', 'freecad', 'native', 'creativity',
|
|
20
|
+
'FreeCAD', 'Headless BIM and parametric modeling, IFC export for CAD projects.',
|
|
21
|
+
'native', 'none', '["local","remote","cloud"]', 0);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
-- agentsam_tool_call_log is the single record of tool calls. The old
|
|
2
|
+
-- agentsam_mcp_tool_execution table is retired, so the ops trail must not read
|
|
3
|
+
-- it. Migrations 0005 to 0007 recreate the view with that branch; this one
|
|
4
|
+
-- runs after them and leaves the correct view, including on a replay.
|
|
5
|
+
DROP VIEW IF EXISTS v_agentsam_ops_trail;
|
|
6
|
+
CREATE VIEW v_agentsam_ops_trail AS
|
|
7
|
+
SELECT 'agent_run' AS source_table,id AS event_id,created_at_unix AS ts_unix,COALESCE(status,'unknown') AS event_kind,'' AS workspace_id,COALESCE(account_id,'') AS user_id,COALESCE(conversation_id,'') AS conversation_id,COALESCE(model_key,'') AS detail,CAST(NULL AS TEXT) AS error_message FROM agentsam_agent_run WHERE created_at_unix IS NOT NULL
|
|
8
|
+
UNION ALL
|
|
9
|
+
SELECT 'tool_call_log',id,created_at_unix,COALESCE(status,'unknown'),'',COALESCE(account_id,''),COALESCE(conversation_id,''),COALESCE(tool_key,''),error_code FROM agentsam_tool_call_log WHERE created_at_unix IS NOT NULL
|
|
10
|
+
UNION ALL
|
|
11
|
+
SELECT 'error_log',id,created_at,COALESCE(error_type,'error'),'',COALESCE(account_id,''),COALESCE(session_id,''),COALESCE(source,''),error_message FROM agentsam_error_log WHERE created_at IS NOT NULL
|
|
12
|
+
UNION ALL
|
|
13
|
+
SELECT 'deployment_health',id,COALESCE(checked_at_unix,last_checked_at),COALESCE(status,'health'),'',COALESCE(account_id,''),'',COALESCE(worker_name,''),error_message FROM agentsam_deployment_health WHERE COALESCE(checked_at_unix,last_checked_at) IS NOT NULL;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
-- agentsam-engine: d1
|
|
2
|
+
-- Service registry owns provider identity and discovery adapter selection.
|
|
3
|
+
-- Model IDs are always fetched from each account credential; never seed a model catalog.
|
|
4
|
+
CREATE TABLE IF NOT EXISTS agentsam_service_registry (
|
|
5
|
+
service_name TEXT PRIMARY KEY,
|
|
6
|
+
label TEXT NOT NULL,
|
|
7
|
+
kind TEXT NOT NULL DEFAULT 'other',
|
|
8
|
+
created_at INTEGER NOT NULL DEFAULT (unixepoch())
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
ALTER TABLE agentsam_service_registry
|
|
12
|
+
ADD COLUMN metadata_json TEXT NOT NULL DEFAULT '{}';
|
|
13
|
+
|
|
14
|
+
ALTER TABLE agentsam_service_registry
|
|
15
|
+
ADD COLUMN updated_at INTEGER NOT NULL DEFAULT 0;
|
|
16
|
+
|
|
17
|
+
UPDATE agentsam_service_registry
|
|
18
|
+
SET updated_at = unixepoch()
|
|
19
|
+
WHERE updated_at = 0;
|
|
20
|
+
|
|
21
|
+
-- Seed/upgrade provider metadata while preserving unrelated registry metadata.
|
|
22
|
+
INSERT INTO agentsam_service_registry
|
|
23
|
+
(service_name, label, kind, created_at, metadata_json, updated_at)
|
|
24
|
+
VALUES
|
|
25
|
+
('openai', 'OpenAI', 'ai_provider', unixepoch(), json_object('provider_id','openai','credential_kind','provider_api_key','model_discovery',json_object('enabled',json('true'),'adapter','openai')), unixepoch()),
|
|
26
|
+
('meta', 'Meta Model API', 'ai_provider', unixepoch(), json_object('provider_id','meta','credential_kind','provider_api_key','model_discovery',json_object('enabled',json('true'),'adapter','meta')), unixepoch()),
|
|
27
|
+
('anthropic', 'Anthropic', 'ai_provider', unixepoch(), json_object('provider_id','anthropic','credential_kind','provider_api_key','model_discovery',json_object('enabled',json('true'),'adapter','anthropic')), unixepoch()),
|
|
28
|
+
('gemini', 'Gemini', 'ai_provider', unixepoch(), json_object('provider_id','gemini','credential_kind','provider_api_key','model_discovery',json_object('enabled',json('true'),'adapter','gemini')), unixepoch()),
|
|
29
|
+
('google', 'Google AI', 'ai_provider', unixepoch(), json_object('provider_id','gemini','credential_kind','provider_api_key','model_discovery',json_object('enabled',json('true'),'adapter','gemini')), unixepoch()),
|
|
30
|
+
('xai', 'xAI / Grok', 'ai_provider', unixepoch(), json_object('provider_id','xai','credential_kind','provider_api_key','model_discovery',json_object('enabled',json('true'),'adapter','xai')), unixepoch()),
|
|
31
|
+
('cursor', 'Cursor', 'ai_provider', unixepoch(), json_object('provider_id','cursor','credential_kind','provider_api_key','model_discovery',json_object('enabled',json('true'),'adapter','cursor')), unixepoch()),
|
|
32
|
+
('meshy', 'Meshy', 'ai_provider', unixepoch(), json_object('provider_id','meshy','credential_kind','provider_api_key','model_discovery',json_object('enabled',json('false'),'adapter','meshy')), unixepoch()),
|
|
33
|
+
('tavily', 'Tavily', 'ai_provider', unixepoch(), json_object('provider_id','tavily','credential_kind','provider_api_key','model_discovery',json_object('enabled',json('false'),'adapter','tavily')), unixepoch())
|
|
34
|
+
ON CONFLICT(service_name) DO UPDATE SET
|
|
35
|
+
label = excluded.label,
|
|
36
|
+
kind = excluded.kind,
|
|
37
|
+
metadata_json = json_patch(
|
|
38
|
+
CASE WHEN json_valid(agentsam_service_registry.metadata_json)
|
|
39
|
+
THEN agentsam_service_registry.metadata_json ELSE '{}' END,
|
|
40
|
+
excluded.metadata_json
|
|
41
|
+
),
|
|
42
|
+
updated_at = unixepoch();
|
|
43
|
+
|
|
44
|
+
-- Model visibility belongs to the existing account UI preference document.
|
|
45
|
+
-- This is a compatibility-safe create for clean installs; existing rows survive.
|
|
46
|
+
CREATE TABLE IF NOT EXISTS agentsam_user_ui_preferences (
|
|
47
|
+
account_id TEXT PRIMARY KEY REFERENCES accounts(id) ON DELETE CASCADE,
|
|
48
|
+
ui_preferences_json TEXT NOT NULL DEFAULT '{}' CHECK (json_valid(ui_preferences_json)),
|
|
49
|
+
updated_at INTEGER NOT NULL DEFAULT (unixepoch())
|
|
50
|
+
);
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
-- Batch 1 / phase A: stage a corrected multi-skill package catalog.
|
|
2
|
+
-- The production agentsam_skill table currently has UNIQUE(npm_package_name,
|
|
3
|
+
-- npm_version), which rejects two distinct skills in the same npm SDK version.
|
|
4
|
+
-- Keep the old table untouched until source/package receipt and authorization
|
|
5
|
+
-- gates pass; the new table is a non-disruptive staging copy.
|
|
6
|
+
CREATE TABLE IF NOT EXISTS agentsam_skill_next (
|
|
7
|
+
id TEXT PRIMARY KEY,
|
|
8
|
+
scope_type TEXT NOT NULL DEFAULT 'account'
|
|
9
|
+
CHECK(scope_type IN ('platform','account')),
|
|
10
|
+
account_id TEXT,
|
|
11
|
+
name TEXT NOT NULL,
|
|
12
|
+
slash_trigger TEXT NOT NULL CHECK(slash_trigger GLOB '/[a-z0-9][a-z0-9-]*'),
|
|
13
|
+
npm_package_name TEXT,
|
|
14
|
+
npm_version TEXT,
|
|
15
|
+
is_published INTEGER NOT NULL DEFAULT 0 CHECK(is_published IN (0,1)),
|
|
16
|
+
description TEXT NOT NULL DEFAULT '',
|
|
17
|
+
content_markdown TEXT NOT NULL DEFAULT '',
|
|
18
|
+
file_path TEXT NOT NULL DEFAULT '',
|
|
19
|
+
content_checksum TEXT NOT NULL DEFAULT '',
|
|
20
|
+
globs TEXT NOT NULL DEFAULT '[]',
|
|
21
|
+
always_apply INTEGER NOT NULL DEFAULT 0 CHECK(always_apply IN (0,1)),
|
|
22
|
+
task_types_json TEXT NOT NULL DEFAULT '[]',
|
|
23
|
+
route_keys_json TEXT NOT NULL DEFAULT '[]',
|
|
24
|
+
access_mode TEXT NOT NULL DEFAULT 'read_write' CHECK(access_mode IN ('read_only','read_write')),
|
|
25
|
+
icon TEXT NOT NULL DEFAULT '',
|
|
26
|
+
tags_json TEXT NOT NULL DEFAULT '[]',
|
|
27
|
+
metadata_json TEXT NOT NULL DEFAULT '{}',
|
|
28
|
+
invocation_count INTEGER NOT NULL DEFAULT 0,
|
|
29
|
+
last_invoked_at TEXT,
|
|
30
|
+
version INTEGER NOT NULL DEFAULT 1,
|
|
31
|
+
is_active INTEGER NOT NULL DEFAULT 0 CHECK(is_active IN (0,1)),
|
|
32
|
+
sort_order INTEGER NOT NULL DEFAULT 0,
|
|
33
|
+
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
34
|
+
updated_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
35
|
+
CHECK((scope_type='platform' AND account_id IS NULL)
|
|
36
|
+
OR (scope_type='account' AND account_id IS NOT NULL))
|
|
37
|
+
);
|
|
38
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_agentsam_skill_next_scope_slash
|
|
39
|
+
ON agentsam_skill_next(scope_type,COALESCE(account_id,''),slash_trigger);
|
|
40
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_agentsam_skill_next_package_file
|
|
41
|
+
ON agentsam_skill_next(scope_type,COALESCE(account_id,''),
|
|
42
|
+
npm_package_name,npm_version,file_path)
|
|
43
|
+
WHERE npm_package_name IS NOT NULL AND npm_version IS NOT NULL
|
|
44
|
+
AND file_path!='';
|
|
45
|
+
CREATE INDEX IF NOT EXISTS idx_agentsam_skill_next_discoverable
|
|
46
|
+
ON agentsam_skill_next(scope_type,account_id,is_published,is_active);
|
|
47
|
+
|
|
48
|
+
-- Old rows copied as account-owned evidence, never mass-published.
|
|
49
|
+
-- Do not INSERT OR IGNORE old rows: any collision must fail visibly.
|
|
50
|
+
INSERT INTO agentsam_skill_next (
|
|
51
|
+
id,scope_type,account_id,name,slash_trigger,npm_package_name,npm_version,
|
|
52
|
+
is_published,description,content_markdown,file_path,content_checksum,
|
|
53
|
+
globs,always_apply,task_types_json,route_keys_json,access_mode,
|
|
54
|
+
icon,tags_json,metadata_json,invocation_count,last_invoked_at,
|
|
55
|
+
version,is_active,sort_order,created_at,updated_at
|
|
56
|
+
)
|
|
57
|
+
SELECT
|
|
58
|
+
s.id,'account',s.account_id,s.name,s.slash_trigger,s.npm_package_name,s.npm_version,
|
|
59
|
+
s.is_published,s.description,s.content_markdown,s.file_path,s.content_checksum,
|
|
60
|
+
s.globs,s.always_apply,s.task_types_json,s.route_keys_json,s.access_mode,
|
|
61
|
+
s.icon,s.tags_json,s.metadata_json,s.invocation_count,s.last_invoked_at,
|
|
62
|
+
s.version,s.is_active,s.sort_order,s.created_at,s.updated_at
|
|
63
|
+
FROM agentsam_skill s
|
|
64
|
+
WHERE NOT EXISTS (SELECT 1 FROM agentsam_skill_next existing WHERE existing.id=s.id);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
-- Batch 1 / phase A: non-disruptive production staging.
|
|
2
|
+
-- This is deliberately NOT the final agentsam_commands cutover.
|
|
3
|
+
-- A TEMP table disappears when the D1 session ends, so the original
|
|
4
|
+
-- workspace-scoped command records are snapshotted in a persistent table.
|
|
5
|
+
-- Run only against the authorized platform D1 after the source and count gates.
|
|
6
|
+
-- Preserve command runs / slash consumers until a separate cutover is proven.
|
|
7
|
+
CREATE TABLE IF NOT EXISTS agentsam_commands_legacy_snapshot_20261123
|
|
8
|
+
AS SELECT * FROM agentsam_commands WHERE 0;
|
|
9
|
+
|
|
10
|
+
CREATE UNIQUE INDEX IF NOT EXISTS
|
|
11
|
+
idx_agentsam_commands_legacy_snapshot_20261123_id
|
|
12
|
+
ON agentsam_commands_legacy_snapshot_20261123(id);
|
|
13
|
+
|
|
14
|
+
INSERT OR IGNORE INTO agentsam_commands_legacy_snapshot_20261123
|
|
15
|
+
SELECT * FROM agentsam_commands;
|
|
16
|
+
|
|
17
|
+
-- Distribution-aware, versioned candidate catalog.
|
|
18
|
+
-- The package version here is the SOURCE version, not proof of npm/PyPI upload.
|
|
19
|
+
-- Never publish/display a row unless release_state is 'verified' AND the
|
|
20
|
+
-- recorded artifact digest and CLI invocation have passed release verification.
|
|
21
|
+
CREATE TABLE IF NOT EXISTS agentsam_commands_next (
|
|
22
|
+
id TEXT PRIMARY KEY,
|
|
23
|
+
package_manager TEXT NOT NULL CHECK(package_manager IN ('npm','pip')),
|
|
24
|
+
package_name TEXT NOT NULL,
|
|
25
|
+
package_version TEXT NOT NULL,
|
|
26
|
+
executable TEXT NOT NULL,
|
|
27
|
+
command_key TEXT NOT NULL,
|
|
28
|
+
command_words_json TEXT NOT NULL CHECK(json_valid(command_words_json)),
|
|
29
|
+
aliases_json TEXT NOT NULL DEFAULT '[]' CHECK(json_valid(aliases_json)),
|
|
30
|
+
display_name TEXT NOT NULL,
|
|
31
|
+
description TEXT NOT NULL DEFAULT '',
|
|
32
|
+
topic TEXT NOT NULL DEFAULT '',
|
|
33
|
+
source_path TEXT NOT NULL,
|
|
34
|
+
source_sha256 TEXT NOT NULL CHECK(length(source_sha256)=64),
|
|
35
|
+
release_state TEXT NOT NULL DEFAULT 'source_only'
|
|
36
|
+
CHECK(release_state IN ('source_only','verified','withdrawn')),
|
|
37
|
+
verification_json TEXT NOT NULL DEFAULT '{}' CHECK(json_valid(verification_json)),
|
|
38
|
+
verified_at INTEGER,
|
|
39
|
+
is_active INTEGER NOT NULL DEFAULT 0 CHECK(is_active IN (0,1)),
|
|
40
|
+
created_at INTEGER NOT NULL DEFAULT (unixepoch()),
|
|
41
|
+
updated_at INTEGER NOT NULL DEFAULT (unixepoch()),
|
|
42
|
+
UNIQUE(package_manager,package_name,package_version,executable,command_key),
|
|
43
|
+
CHECK(release_state!='verified' OR (verified_at IS NOT NULL AND is_active=1)),
|
|
44
|
+
CHECK(is_active=0 OR release_state='verified')
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
CREATE INDEX IF NOT EXISTS idx_agentsam_commands_next_visible
|
|
48
|
+
ON agentsam_commands_next(package_manager,package_name,release_state,is_active);
|
|
49
|
+
CREATE INDEX IF NOT EXISTS idx_agentsam_commands_next_source
|
|
50
|
+
ON agentsam_commands_next(source_path,source_sha256);
|
|
51
|
+
|
|
52
|
+
-- Safe discovery while the legacy commands table is still in service.
|
|
53
|
+
CREATE VIEW IF NOT EXISTS agentsam_commands_published AS
|
|
54
|
+
SELECT id, package_manager,package_name,package_version,executable,
|
|
55
|
+
command_key,command_words_json,aliases_json,display_name,
|
|
56
|
+
description,topic,source_path,source_sha256,verification_json
|
|
57
|
+
FROM agentsam_commands_next
|
|
58
|
+
WHERE release_state='verified' AND is_active=1;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
-- Keep the archive limited to records that actually carry legacy metadata.
|
|
2
|
+
DELETE FROM agentsam_tool_legacy_metadata
|
|
3
|
+
WHERE NULLIF(trim(COALESCE(tool_code,'')),'') IS NULL
|
|
4
|
+
AND NULLIF(trim(COALESCE(linked_mcp_tool_id,'')),'') IS NULL
|
|
5
|
+
AND NULLIF(trim(COALESCE(internal_seo,'')),'') IS NULL;
|
|
6
|
+
INSERT INTO d1_migrations (name) VALUES ('20261126_agentsam_tool_legacy_metadata_compact.sql');
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
-- Preserve only the small set of legacy identifiers/metadata being removed from the hot tool registry.
|
|
2
|
+
-- No usage baseline is created; usage remains in agentsam_tool_call_log.
|
|
3
|
+
CREATE TABLE IF NOT EXISTS agentsam_tool_legacy_metadata (
|
|
4
|
+
tool_id TEXT PRIMARY KEY,
|
|
5
|
+
tool_code TEXT,
|
|
6
|
+
linked_mcp_tool_id TEXT,
|
|
7
|
+
internal_seo TEXT,
|
|
8
|
+
archived_at INTEGER NOT NULL DEFAULT (unixepoch())
|
|
9
|
+
);
|
|
10
|
+
INSERT INTO agentsam_tool_legacy_metadata (tool_id, tool_code, linked_mcp_tool_id, internal_seo, archived_at)
|
|
11
|
+
SELECT id, tool_code, linked_mcp_tool_id, internal_seo, unixepoch()
|
|
12
|
+
FROM agentsam_tools
|
|
13
|
+
WHERE tool_code IS NOT NULL
|
|
14
|
+
OR linked_mcp_tool_id IS NOT NULL
|
|
15
|
+
OR internal_seo IS NOT NULL
|
|
16
|
+
ON CONFLICT(tool_id) DO UPDATE SET
|
|
17
|
+
tool_code=excluded.tool_code,
|
|
18
|
+
linked_mcp_tool_id=excluded.linked_mcp_tool_id,
|
|
19
|
+
internal_seo=excluded.internal_seo;
|
|
20
|
+
INSERT INTO d1_migrations (name) VALUES ('20261126_agentsam_tools_archive_legacy_metadata.sql');
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
-- Consolidate legacy intent_category_tags and restore Design Studio routing as intent tags.
|
|
2
|
+
-- Completeful's malformed bracketed CSV values are normalized to valid JSON arrays.
|
|
3
|
+
UPDATE agentsam_tools SET intent_tags='["codebase","ast","rag","symbols","calls","callers","callees","graph","imports","structural","d1","hydrate","code","mcp-read"]' WHERE id='ast_agentsam_codebase_retrieve' AND tool_key='agentsam_codebase_retrieve';
|
|
4
|
+
UPDATE agentsam_tools SET intent_tags='["shell","bash","exec","container","cloud_sandbox","batch","linux","uname","cat","ls","echo","curl","system","inspect","os","alpine","terminal","execution"]' WHERE id='ast_agentsam_container_exec' AND tool_key='agentsam_container_exec';
|
|
5
|
+
UPDATE agentsam_tools SET intent_tags='["excalidraw","diagram","wireframe","canvas","draw","design"]' WHERE id='ast_fde0533f115a4726' AND tool_key='agentsam_excalidraw';
|
|
6
|
+
UPDATE agentsam_tools SET intent_tags='["github","merge","pull-request","pr","mutation","squash","rebase"]' WHERE id='ast_0dd3fef0d725effd' AND tool_key='agentsam_github_pr_merge';
|
|
7
|
+
UPDATE agentsam_tools SET intent_tags='["kv","workers-kv","key-value","get","put","delete","list","namespace","cloudflare","byok","storage","mcp-write"]' WHERE id='ast_oauth_agentsam_kv_manage' AND tool_key='agentsam_kv_manage';
|
|
8
|
+
UPDATE agentsam_tools SET intent_tags='["memory","search","agent","recall","semantic"]' WHERE id='ast_74f388ab2c7650b4' AND tool_key='agentsam_memory_search';
|
|
9
|
+
UPDATE agentsam_tools SET intent_tags='["r2","upload","put","object","storage","screenshot","binary","custom-metadata","ticket-proof","asset","attachment","media","mcp-write"]' WHERE id='ast_oauth_agentsam_r2_put' AND tool_key='agentsam_r2_put';
|
|
10
|
+
UPDATE agentsam_tools SET intent_tags='["spawn","subagent","delegate","multi-agent","profile","orchestrate"]' WHERE id='ast_e3bb8124d9f13e48' AND tool_key='agentsam_spawn_profile';
|
|
11
|
+
UPDATE agentsam_tools SET intent_tags='["mcp_zone","sandbox","file_experiment","isolated","zone_shell","terminal","mcp"]' WHERE id='ast_oauth_agentsam_terminal_sandbox' AND tool_key='agentsam_terminal_sandbox';
|
|
12
|
+
UPDATE agentsam_tools SET intent_tags='["ticket","note","attachment","proof","screenshot","media_assets","r2","image","tickets","media","mcp-write"]' WHERE id='ast_cd1bc5d662ed73e6' AND tool_key='agentsam_ticket_add_note';
|
|
13
|
+
UPDATE agentsam_tools SET intent_tags='["ticket","create","attachment","proof","screenshot","media_assets","r2","image","tickets","media","mcp-write"]' WHERE id='ast_db84ccd3cbcbc71c' AND tool_key='agentsam_ticket_create';
|
|
14
|
+
UPDATE agentsam_tools SET intent_tags='["browser","content","dom","html","snapshot","inspect","scrape"]' WHERE id='ast_a0b5fbe47dbe91fc' AND tool_key='browser_content';
|
|
15
|
+
UPDATE agentsam_tools SET intent_tags='["browser","evaluate","script","js"]' WHERE id='ast_4ec70486b938f3a2' AND tool_key='browser_evaluate_script';
|
|
16
|
+
UPDATE agentsam_tools SET intent_tags='["browser","navigate","url","cdt","inspect","page","open"]' WHERE id='ast_a6f856e99488e3fc' AND tool_key='browser_navigate';
|
|
17
|
+
UPDATE agentsam_tools SET intent_tags='["browser","screenshot","capture"]' WHERE id='ast_24023cc9f40bc724' AND tool_key='browser_screenshot';
|
|
18
|
+
UPDATE agentsam_tools SET intent_tags='["completeful","commerce"]' WHERE id='ast_cf_catalog_get' AND tool_key='completeful_catalog_get';
|
|
19
|
+
UPDATE agentsam_tools SET intent_tags='["completeful","commerce"]' WHERE id='ast_cf_catalog_list' AND tool_key='completeful_catalog_list';
|
|
20
|
+
UPDATE agentsam_tools SET intent_tags='["completeful","catalog","semantic-search"]' WHERE id='ast_cf_catalog_semantic_search' AND tool_key='completeful_catalog_semantic_search';
|
|
21
|
+
UPDATE agentsam_tools SET intent_tags='["completeful","commerce"]' WHERE id='ast_cf_catalog_sync' AND tool_key='completeful_catalog_sync';
|
|
22
|
+
UPDATE agentsam_tools SET intent_tags='["completeful","commerce"]' WHERE id='ast_cf_design_create' AND tool_key='completeful_design_create';
|
|
23
|
+
UPDATE agentsam_tools SET intent_tags='["completeful","commerce"]' WHERE id='ast_cf_order_create' AND tool_key='completeful_order_create';
|
|
24
|
+
UPDATE agentsam_tools SET intent_tags='["completeful","commerce"]' WHERE id='ast_cf_order_quote' AND tool_key='completeful_order_quote';
|
|
25
|
+
UPDATE agentsam_tools SET intent_tags='["completeful","commerce"]' WHERE id='ast_cf_product_publish' AND tool_key='completeful_product_publish';
|
|
26
|
+
UPDATE agentsam_tools SET intent_tags='["completeful","commerce"]' WHERE id='ast_cf_product_sync' AND tool_key='completeful_product_sync';
|
|
27
|
+
UPDATE agentsam_tools SET intent_tags='["design_studio"]' WHERE id='ast_cad_v1_design_apply_operation' AND tool_key='design_apply_operation';
|
|
28
|
+
UPDATE agentsam_tools SET intent_tags='["design_studio"]' WHERE id='ast_cad_v1_design_model_build' AND tool_key='design_model_build';
|
|
29
|
+
UPDATE agentsam_tools SET intent_tags='["design_studio"]' WHERE id='ast_cad_v1_design_model_export' AND tool_key='design_model_export';
|
|
30
|
+
UPDATE agentsam_tools SET intent_tags='["design_studio"]' WHERE id='ast_cad_v1_design_model_inspect' AND tool_key='design_model_inspect';
|
|
31
|
+
UPDATE agentsam_tools SET intent_tags='["design_studio"]' WHERE id='ast_cad_v1_design_model_render' AND tool_key='design_model_render';
|
|
32
|
+
UPDATE agentsam_tools SET intent_tags='["design_studio"]' WHERE id='ast_cad_v1_design_project_get' AND tool_key='design_project_get';
|
|
33
|
+
UPDATE agentsam_tools SET intent_tags='["design_studio"]' WHERE id='ast_cad_v1_design_project_restore' AND tool_key='design_project_restore';
|
|
34
|
+
UPDATE agentsam_tools SET intent_tags='["design_studio"]' WHERE id='ast_cad_v1_design_project_save' AND tool_key='design_project_save';
|
|
35
|
+
UPDATE agentsam_tools SET intent_tags='["design_studio"]' WHERE id='ast_cad_v1_design_project_validate' AND tool_key='design_project_validate';
|
|
36
|
+
UPDATE agentsam_tools SET intent_tags='["filesystem","edit","patch","file","local","mutation","str_replace"]' WHERE id='ast_47772deb590984c8' AND tool_key='fs_edit_file';
|
|
37
|
+
UPDATE agentsam_tools SET intent_tags='["filesystem","read","file","local","content","view","cat"]' WHERE id='ast_a51fb9392bed6620' AND tool_key='fs_read_file';
|
|
38
|
+
UPDATE agentsam_tools SET intent_tags='["filesystem","write","file","local","create","overwrite","mutation"]' WHERE id='ast_5a30523dd95e5775' AND tool_key='fs_write_file';
|
|
39
|
+
UPDATE agentsam_tools SET intent_tags='["gdrive","google","drive","list","files","folder","inventory","browse"]' WHERE id='ast_a69899dd5791cd35' AND tool_key='gdrive_list';
|
|
40
|
+
UPDATE agentsam_tools SET intent_tags='["http","fetch","get","url","external","network"]' WHERE id='ast_61891de522cc5a55' AND tool_key='http_fetch';
|
|
41
|
+
UPDATE agentsam_tools SET intent_tags='["image","edit","ai","media","visual","imgx"]' WHERE id='ast_44828e097b577c44' AND tool_key='imgx_edit_image';
|
|
42
|
+
UPDATE agentsam_tools SET intent_tags='["image","generate","ai","media","visual","imgx"]' WHERE id='ast_6c95b4ad138b872b' AND tool_key='imgx_generate_image';
|
|
43
|
+
UPDATE agentsam_tools SET intent_tags='["image","providers","list","ai","media"]' WHERE id='ast_c0aad615e54522fe' AND tool_key='imgx_list_providers';
|
|
44
|
+
UPDATE agentsam_tools SET intent_tags='["video","export","moviemode","media","render"]' WHERE id='ast_78716d89ff689900' AND tool_key='moviemode_export';
|
|
45
|
+
UPDATE agentsam_tools SET intent_tags='["email","broadcast","resend","audience","bulk","marketing","send","campaign"]' WHERE id='ast_7a7003a20db30460' AND tool_key='resend_send_broadcast';
|
|
46
|
+
UPDATE agentsam_tools SET intent_tags='["email","send","resend","transactional","notification"]' WHERE id='ast_a98fad47330f31ad' AND tool_key='resend_send_email';
|
|
47
|
+
UPDATE agentsam_tools SET intent_tags='["social","card","image","generate","og","meta"]' WHERE id='ast_e14214d43ebebe43' AND tool_key='social_card_generate';
|
|
48
|
+
UPDATE agentsam_tools SET intent_tags='["video","generate","veo","ai","media"]' WHERE id='ast_78a2dde65633bbf5' AND tool_key='veo_generate_video';
|
|
49
|
+
INSERT INTO d1_migrations (name) VALUES ('20261126_agentsam_tools_normalize_intent_tags.sql');
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
-- Normalize policy, health, and plugin resolution into their existing owner tables.
|
|
2
|
+
-- No usage-baseline table is created; usage remains derived from agentsam_tool_call_log.
|
|
3
|
+
|
|
4
|
+
ALTER TABLE agentsam_tool_policy
|
|
5
|
+
ADD COLUMN connector_visible INTEGER NOT NULL DEFAULT 0 CHECK (connector_visible IN (0, 1));
|
|
6
|
+
ALTER TABLE agentsam_tool_policy
|
|
7
|
+
ADD COLUMN connector_priority INTEGER;
|
|
8
|
+
ALTER TABLE agentsam_tool_policy
|
|
9
|
+
ADD COLUMN connector_access_class TEXT NOT NULL DEFAULT 'read' CHECK (connector_access_class IN ('read', 'write'));
|
|
10
|
+
ALTER TABLE agentsam_tool_policy
|
|
11
|
+
ADD COLUMN max_calls_per_session INTEGER;
|
|
12
|
+
|
|
13
|
+
UPDATE agentsam_tool_policy
|
|
14
|
+
SET
|
|
15
|
+
connector_visible = COALESCE((SELECT connector_visible FROM agentsam_tools WHERE agentsam_tools.id = agentsam_tool_policy.tool_id), 0),
|
|
16
|
+
connector_priority = (SELECT connector_priority FROM agentsam_tools WHERE agentsam_tools.id = agentsam_tool_policy.tool_id),
|
|
17
|
+
connector_access_class = COALESCE((SELECT connector_access_class FROM agentsam_tools WHERE agentsam_tools.id = agentsam_tool_policy.tool_id), 'read'),
|
|
18
|
+
max_calls_per_session = (SELECT max_calls_per_session FROM agentsam_tools WHERE agentsam_tools.id = agentsam_tool_policy.tool_id);
|
|
19
|
+
|
|
20
|
+
ALTER TABLE agentsam_tool_health
|
|
21
|
+
ADD COLUMN failure_rate REAL NOT NULL DEFAULT 0.0;
|
|
22
|
+
ALTER TABLE agentsam_tool_health
|
|
23
|
+
ADD COLUMN avg_latency_ms REAL;
|
|
24
|
+
|
|
25
|
+
UPDATE agentsam_tool_health
|
|
26
|
+
SET
|
|
27
|
+
failure_rate = COALESCE((SELECT failure_rate FROM agentsam_tools WHERE agentsam_tools.id = agentsam_tool_health.tool_id), 0.0),
|
|
28
|
+
avg_latency_ms = (SELECT avg_latency_ms FROM agentsam_tools WHERE agentsam_tools.id = agentsam_tool_health.tool_id);
|
|
29
|
+
|
|
30
|
+
UPDATE agentsam_tools
|
|
31
|
+
SET plugin_id = (
|
|
32
|
+
SELECT p.id FROM agentsam_plugins p WHERE p.plugin_key = agentsam_tools.plugin_key
|
|
33
|
+
)
|
|
34
|
+
WHERE plugin_id IS NULL
|
|
35
|
+
AND plugin_key IS NOT NULL
|
|
36
|
+
AND EXISTS (SELECT 1 FROM agentsam_plugins p WHERE p.plugin_key = agentsam_tools.plugin_key);
|
|
37
|
+
|
|
38
|
+
DROP VIEW IF EXISTS v_agentsam_tools_runtime;
|
|
39
|
+
CREATE VIEW v_agentsam_tools_runtime AS
|
|
40
|
+
SELECT
|
|
41
|
+
t.id,
|
|
42
|
+
t.tool_name,
|
|
43
|
+
t.tool_key,
|
|
44
|
+
t.display_name,
|
|
45
|
+
t.tool_category,
|
|
46
|
+
t.domain,
|
|
47
|
+
t.description,
|
|
48
|
+
t.handler_type,
|
|
49
|
+
t.handler_key,
|
|
50
|
+
t.handler_config,
|
|
51
|
+
t.input_schema,
|
|
52
|
+
t.output_schema,
|
|
53
|
+
t.capability_key,
|
|
54
|
+
t.plugin_id,
|
|
55
|
+
t.account_id,
|
|
56
|
+
t.intent_tags,
|
|
57
|
+
t.modes_json,
|
|
58
|
+
t.is_active,
|
|
59
|
+
t.notes,
|
|
60
|
+
t.created_at,
|
|
61
|
+
t.updated_at,
|
|
62
|
+
pl.plugin_key,
|
|
63
|
+
pl.endpoint_url,
|
|
64
|
+
pl.transport,
|
|
65
|
+
pl.auth_type,
|
|
66
|
+
p.risk_level,
|
|
67
|
+
p.requires_approval,
|
|
68
|
+
p.requires_confirmation,
|
|
69
|
+
p.dispatch_target,
|
|
70
|
+
p.oauth_visible,
|
|
71
|
+
p.caller_policy,
|
|
72
|
+
p.result_policy_json,
|
|
73
|
+
p.sort_priority,
|
|
74
|
+
p.connector_visible,
|
|
75
|
+
p.connector_priority,
|
|
76
|
+
p.connector_access_class,
|
|
77
|
+
p.max_calls_per_session,
|
|
78
|
+
h.is_degraded,
|
|
79
|
+
h.last_health_check,
|
|
80
|
+
h.failure_rate,
|
|
81
|
+
h.avg_latency_ms,
|
|
82
|
+
cp.cache_policy_json
|
|
83
|
+
FROM agentsam_tools t
|
|
84
|
+
LEFT JOIN agentsam_plugins pl ON pl.id = t.plugin_id
|
|
85
|
+
LEFT JOIN agentsam_tool_policy p ON p.tool_id = t.id
|
|
86
|
+
LEFT JOIN agentsam_tool_health h ON h.tool_id = t.id
|
|
87
|
+
LEFT JOIN agentsam_tool_cache_policy cp ON cp.tool_id = t.id;
|
|
88
|
+
|
|
89
|
+
INSERT INTO d1_migrations (name) VALUES ('20261126_agentsam_tools_normalize_policy_health.sql');
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
-- Remove the obsolete per-tool workspace allowlist from the canonical tool registry.
|
|
2
|
+
-- Tool ownership remains represented by account_id; project/resource authorization
|
|
3
|
+
-- remains in execution context and actor policy.
|
|
4
|
+
DROP VIEW IF EXISTS v_mcp_tools;
|
|
5
|
+
|
|
6
|
+
CREATE VIEW v_mcp_tools AS
|
|
7
|
+
SELECT
|
|
8
|
+
t.tool_key AS tool_name,
|
|
9
|
+
COALESCE(NULLIF(trim(t.display_name), ''), t.tool_key) AS display_name,
|
|
10
|
+
COALESCE(NULLIF(trim(t.tool_category), ''), 'agent') AS tool_category,
|
|
11
|
+
COALESCE(t.mcp_service_url, 'https://mcp.inneranimalmedia.com/mcp') AS mcp_service_url,
|
|
12
|
+
COALESCE(t.description, '') AS description,
|
|
13
|
+
COALESCE(t.input_schema, '{}') AS input_schema,
|
|
14
|
+
COALESCE(t.handler_type, 'mcp') AS handler_type,
|
|
15
|
+
COALESCE(t.handler_config, '{}') AS handler_config,
|
|
16
|
+
COALESCE(t.modes_json, '["auto","agent","debug"]') AS modes_json,
|
|
17
|
+
COALESCE(t.risk_level, 'low') AS risk_level,
|
|
18
|
+
COALESCE(t.requires_approval, 0) AS requires_approval,
|
|
19
|
+
1 AS is_available,
|
|
20
|
+
COALESCE(t.is_active, 1) AS is_active,
|
|
21
|
+
CASE WHEN t.account_id IS NULL THEN 'platform' ELSE 'account' END AS scope_type,
|
|
22
|
+
t.id AS agentsam_tools_id,
|
|
23
|
+
unixepoch() AS synced_at
|
|
24
|
+
FROM agentsam_tools t
|
|
25
|
+
WHERE COALESCE(t.is_active, 1) = 1
|
|
26
|
+
AND COALESCE(t.is_degraded, 0) = 0
|
|
27
|
+
AND trim(COALESCE(t.tool_key, '')) != '';
|
|
28
|
+
|
|
29
|
+
ALTER TABLE agentsam_tools DROP COLUMN workspace_scope;
|