@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,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Worker-to-Worker CMS delegation, protocol v1.
|
|
3
|
+
*
|
|
4
|
+
* The caller authenticates its IAM user and site membership BEFORE signing.
|
|
5
|
+
* The destination independently verifies a short-lived HMAC over the exact
|
|
6
|
+
* method, path/query, payload digest, actor, project, timestamp and nonce.
|
|
7
|
+
* No browser credential, Cloudflare API token, or personal provider key crosses.
|
|
8
|
+
*/
|
|
9
|
+
const te = new TextEncoder();
|
|
10
|
+
|
|
11
|
+
const SEG=/^[a-z0-9-]+$/i;
|
|
12
|
+
export function isAllowedStudioCmsBridgeRoute(tail,method) {
|
|
13
|
+
if(tail==='registry'||tail==='store/online')return method==='GET';
|
|
14
|
+
if(tail==='pages'||tail==='theme-projects')return ['GET','POST'].includes(method);
|
|
15
|
+
if(tail==='themes')return method==='GET';
|
|
16
|
+
if(tail==='theme-selection')return method==='PUT';
|
|
17
|
+
const s=tail.split('/');
|
|
18
|
+
// Private Theme Studio project CRUD is account-scoped in the destination
|
|
19
|
+
// API. The bridge only permits canonical methods/paths, not ownership.
|
|
20
|
+
if(s[0]==='theme-projects'&&s.length===2&&/^[A-Za-z0-9_-]{1,160}$/.test(s[1]))
|
|
21
|
+
return ['GET','PUT','DELETE'].includes(method);
|
|
22
|
+
if(s[0]==='theme-projects'&&s.length===3&&/^[A-Za-z0-9_-]{1,160}$/.test(s[1])&&s[2]==='duplicate')
|
|
23
|
+
return method==='POST';
|
|
24
|
+
if(s[0]==='themes'&&s.length===3&&SEG.test(s[1])&&s[2]==='install')
|
|
25
|
+
return method==='POST';
|
|
26
|
+
if(s[0]!=='pages'||!SEG.test(s[1]||''))return false;
|
|
27
|
+
const rest=s.slice(2);
|
|
28
|
+
if(rest.length===0)return ['GET','PUT'].includes(method);
|
|
29
|
+
if(rest.length===1&&['publish','generated-accept','seed','import-live'].includes(rest[0]))return method==='POST';
|
|
30
|
+
if(rest.length===1&&rest[0]==='catalog-resources')return ['GET','POST'].includes(method);
|
|
31
|
+
if(rest.length===3&&rest[0]==='catalog-resources'&&/^[a-z][a-z0-9_]{0,63}$/.test(rest[1])&&rest[2]==='preview')return method==='GET';
|
|
32
|
+
if(rest[0]!=='sections')return false;
|
|
33
|
+
if(rest.length===1)return method==='POST';
|
|
34
|
+
if(!SEG.test(rest[1]||''))return false;
|
|
35
|
+
if(rest.length===2)return ['PUT','DELETE'].includes(method);
|
|
36
|
+
if(rest.length===3&&rest[2]==='generated-revisions')return method==='GET';
|
|
37
|
+
if(rest.length===3&&rest[2]==='generated-restore')return method==='POST';
|
|
38
|
+
if(rest.length===3&&rest[2]==='restore')return method==='POST';
|
|
39
|
+
if(rest.length===3&&['duplicate','move'].includes(rest[2]))return method==='POST';
|
|
40
|
+
if(rest.length===3&&rest[2]==='visibility')return method==='PUT';
|
|
41
|
+
if(rest[2]!=='blocks')return false;
|
|
42
|
+
if(rest.length===3)return method==='POST';
|
|
43
|
+
if(!SEG.test(rest[3]||''))return false;
|
|
44
|
+
if(rest.length===4)return method==='DELETE';
|
|
45
|
+
if(rest.length===5&&['duplicate','move'].includes(rest[4]))return method==='POST';
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const digestHex = (bytes) => [...new Uint8Array(bytes)].map((b) => b.toString(16).padStart(2,'0')).join('');
|
|
50
|
+
const isActor = (s) => /^au_[a-z0-9_-]{4,}$/i.test(s || '');
|
|
51
|
+
const isProject = (s) => /^proj_[a-z0-9_-]{3,}$/i.test(s || '');
|
|
52
|
+
|
|
53
|
+
export function cmsBridgeCanonical({ timestamp, nonce, actor, project, method, path, digest }) {
|
|
54
|
+
return ['agentsam-cms-bridge-v1', timestamp, nonce, actor, project, method, path, digest].join('\n');
|
|
55
|
+
}
|
|
56
|
+
async function bodyDigest(request) {
|
|
57
|
+
const bytes = await request.clone().arrayBuffer();
|
|
58
|
+
if (bytes.byteLength > 9 * 1024 * 1024) throw new Error('cms_bridge_payload_too_large');
|
|
59
|
+
return digestHex(await crypto.subtle.digest('SHA-256', bytes));
|
|
60
|
+
}
|
|
61
|
+
async function mac(secret, canonical) {
|
|
62
|
+
if (!secret || typeof secret !== 'string' || secret.length < 32) throw new Error('cms_bridge_secret_unavailable');
|
|
63
|
+
const key = await crypto.subtle.importKey('raw', te.encode(secret), { name:'HMAC', hash:'SHA-256' }, false, ['sign']);
|
|
64
|
+
return digestHex(await crypto.subtle.sign('HMAC', key, te.encode(canonical)));
|
|
65
|
+
}
|
|
66
|
+
function safeEqual(a,b) {
|
|
67
|
+
if(typeof a!=='string'||typeof b!=='string'||a.length!==b.length)return false;
|
|
68
|
+
let difference=0;
|
|
69
|
+
for(let i=0;i<a.length;i++)difference|=a.charCodeAt(i)^b.charCodeAt(i);
|
|
70
|
+
return difference===0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export async function signCmsBridgeRequest(request, {secret,actor,project,now=Math.floor(Date.now()/1000),nonce=crypto.randomUUID()}={}) {
|
|
74
|
+
if(!isActor(actor)||!isProject(project))throw new Error('cms_bridge_identity_required');
|
|
75
|
+
const url=new URL(request.url);
|
|
76
|
+
const canonical=cmsBridgeCanonical({
|
|
77
|
+
timestamp:String(now),nonce,actor,project,
|
|
78
|
+
method:request.method.toUpperCase(),path:url.pathname+url.search,
|
|
79
|
+
digest:await bodyDigest(request),
|
|
80
|
+
});
|
|
81
|
+
const signature=await mac(secret,canonical);
|
|
82
|
+
return {
|
|
83
|
+
'x-cms-bridge-protocol':'v1',
|
|
84
|
+
'x-cms-bridge-timestamp':String(now),
|
|
85
|
+
'x-cms-bridge-nonce':nonce,
|
|
86
|
+
'x-cms-bridge-actor':actor,
|
|
87
|
+
'x-cms-bridge-project':project,
|
|
88
|
+
'x-cms-bridge-signature':signature,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
export async function verifyCmsBridgeRequest(request, {secret,expectedProject,now=Math.floor(Date.now()/1000)}={}) {
|
|
92
|
+
const h=request.headers;
|
|
93
|
+
const timestamp=h.get('x-cms-bridge-timestamp')||'';
|
|
94
|
+
const nonce=h.get('x-cms-bridge-nonce')||'';
|
|
95
|
+
const actor=h.get('x-cms-bridge-actor')||'';
|
|
96
|
+
const project=h.get('x-cms-bridge-project')||'';
|
|
97
|
+
const provided=h.get('x-cms-bridge-signature')||'';
|
|
98
|
+
if(h.get('x-cms-bridge-protocol')!=='v1'||!/^\d{10}$/.test(timestamp)||
|
|
99
|
+
Math.abs(now-Number(timestamp))>60||!isActor(actor)||!isProject(project)||
|
|
100
|
+
(expectedProject && project!==expectedProject)||
|
|
101
|
+
!/^[a-f0-9-]{20,80}$/i.test(nonce)||
|
|
102
|
+
!/^[a-f0-9]{64}$/i.test(provided)) return {ok:false,error:'cms_bridge_not_authorized'};
|
|
103
|
+
const url=new URL(request.url);
|
|
104
|
+
const canonical=cmsBridgeCanonical({
|
|
105
|
+
timestamp,nonce,actor,project,
|
|
106
|
+
method:request.method.toUpperCase(),path:url.pathname+url.search,
|
|
107
|
+
digest:await bodyDigest(request),
|
|
108
|
+
});
|
|
109
|
+
const expected=await mac(secret,canonical);
|
|
110
|
+
return safeEqual(expected,provided)
|
|
111
|
+
? {ok:true,actor,project,nonce,timestamp:Number(timestamp)}
|
|
112
|
+
: {ok:false,error:'cms_bridge_not_authorized'};
|
|
113
|
+
}
|
|
@@ -21,8 +21,8 @@ test('package runs with an injected host repository without SQL',async()=>{
|
|
|
21
21
|
try{
|
|
22
22
|
db=await createCmsMemoryRepository();
|
|
23
23
|
const operations=makeOperations({repository:db});
|
|
24
|
-
assert.equal(CMS_OPERATION_CONTRACTS.length,
|
|
25
|
-
assert.equal(operations.length,
|
|
24
|
+
assert.equal(CMS_OPERATION_CONTRACTS.length,15);
|
|
25
|
+
assert.equal(operations.length,27);
|
|
26
26
|
const byName=new Map(operations.map(o=>[o.id,o]));
|
|
27
27
|
const created=await byName.get('cms.page.createDraft').handler({pageId:'home',title:'Home',slug:'home'},{});
|
|
28
28
|
assert.equal(created.version,1);
|
|
@@ -34,7 +34,11 @@ test('package runs with an injected host repository without SQL',async()=>{
|
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
test('CMS operation declarations use shared portable metadata and keep CMS effects local',()=>{
|
|
37
|
-
assert.equal(CMS_OPERATION_CONTRACTS.length,
|
|
37
|
+
assert.equal(CMS_OPERATION_CONTRACTS.length,15);
|
|
38
|
+
const navList=CMS_OPERATION_CONTRACTS.find(contract=>contract.id==='cms.navigation.list');
|
|
39
|
+
const navSave=CMS_OPERATION_CONTRACTS.find(contract=>contract.id==='cms.navigation.save');
|
|
40
|
+
assert.equal(navList.effect,'read');
|
|
41
|
+
assert.equal(navSave.effect,'draft_update');
|
|
38
42
|
const inspect=CMS_OPERATION_CONTRACTS.find(contract=>contract.id==='cms.resource.inspect');
|
|
39
43
|
assert.equal(inspect.module,'cms');
|
|
40
44
|
assert.equal(inspect.capabilities[0],'cms.resource.read');
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { signCmsBridgeRequest, verifyCmsBridgeRequest, isAllowedStudioCmsBridgeRoute } from '../src/studio-bridge-protocol.js';
|
|
4
|
+
|
|
5
|
+
const secret = 'studio-cms-integration-' + 'k'.repeat(40);
|
|
6
|
+
const scope = { actor: 'au_ownedaccount01', project: 'proj_ownedsiterow', now: 1810000000, nonce: '12345678-1234-4abc-9abc-123456789abc' };
|
|
7
|
+
|
|
8
|
+
test('portable CMS bridge accepts only allowlisted site authoring operations', () => {
|
|
9
|
+
assert.equal(isAllowedStudioCmsBridgeRoute('pages/site-home/sections', 'POST'), true);
|
|
10
|
+
assert.equal(isAllowedStudioCmsBridgeRoute('theme-projects', 'GET'), true);
|
|
11
|
+
assert.equal(isAllowedStudioCmsBridgeRoute('orders', 'GET'), false);
|
|
12
|
+
assert.equal(isAllowedStudioCmsBridgeRoute('pages/site-home/publish', 'GET'), false);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('bridge authentication is bound to signed payload, actor, project and expiry', async () => {
|
|
16
|
+
const original = new Request('https://cms-worker.internal/api/internal/studio-cms/pages/a?version=8', {
|
|
17
|
+
method: 'PUT', headers: { 'content-type':'application/json' }, body: JSON.stringify({ headline: 'Original' }),
|
|
18
|
+
});
|
|
19
|
+
const signedHeaders = await signCmsBridgeRequest(original, { secret, ...scope });
|
|
20
|
+
const signed = new Request(original, { headers: { ...Object.fromEntries(original.headers), ...signedHeaders } });
|
|
21
|
+
assert.equal((await verifyCmsBridgeRequest(signed,{secret,expectedProject:scope.project,now:scope.now})).ok,true);
|
|
22
|
+
const altered = new Request(original.url, { method:'PUT',headers:signed.headers,body:JSON.stringify({ headline:'Changed' }) });
|
|
23
|
+
assert.equal((await verifyCmsBridgeRequest(altered,{secret,expectedProject:scope.project,now:scope.now})).ok,false);
|
|
24
|
+
assert.equal((await verifyCmsBridgeRequest(signed,{secret,expectedProject:'proj_foreignsite',now:scope.now})).ok,false);
|
|
25
|
+
assert.equal((await verifyCmsBridgeRequest(signed,{secret,expectedProject:scope.project,now:scope.now+65})).ok,false);
|
|
26
|
+
});
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inneranimalmedia/agentsam-communications",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.18",
|
|
4
4
|
"description": "Portable account-scoped communications with pluggable email transports and notification outbox support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./src/index.js",
|
|
8
8
|
"./adapters": "./src/adapters.js",
|
|
9
|
-
"./outbox": "./src/outbox.js"
|
|
9
|
+
"./outbox": "./src/outbox.js",
|
|
10
|
+
"./samspeaks": "./src/samspeaks-runtime.js"
|
|
10
11
|
},
|
|
11
12
|
"files": [
|
|
12
13
|
"src",
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// SamSpeaks provider operations shared by the local Express and hosted Worker adapters.
|
|
2
|
+
// No UI, credentials, Node APIs, or account state are owned by this module.
|
|
3
|
+
const VOICES = new Set(['Puck','Charon','Kore','Fenrir','Zephyr','Aoede','Leda','Orus','Callirrhoe','Autonoe','Sulafat','Enceladus','Gacrux','Despina','Umbriel']);
|
|
4
|
+
const MAX_BODY = 15 * 1024 * 1024;
|
|
5
|
+
const json = (body, status = 200) => Response.json(body, {status, headers:{'cache-control':'private, no-store'}});
|
|
6
|
+
const text = (value, fallback = '', max = 4000) => typeof value === 'string' ? value.trim().slice(0,max) : fallback;
|
|
7
|
+
const voice = (value, fallback) => VOICES.has(value) ? value : fallback;
|
|
8
|
+
const providerText = data => (data?.candidates?.[0]?.content?.parts || []).map(part=>part.text || '').join('').trim();
|
|
9
|
+
const schema = {
|
|
10
|
+
type:'OBJECT', required:['movieTitle','beats'],
|
|
11
|
+
properties:{movieTitle:{type:'STRING'},beats:{type:'ARRAY',items:{
|
|
12
|
+
type:'OBJECT',required:['title','script','ttsMode','voiceName','voiceStyle','cameraShot','transitionType','mood','explodeAmount'],
|
|
13
|
+
properties:Object.fromEntries(['title','script','ttsMode','voiceName','voiceStyle','cameraShot','transitionType','mood','explodeAmount'].map(key=>[key,{type:key==='explodeAmount'?'NUMBER':'STRING'}]))
|
|
14
|
+
}}}
|
|
15
|
+
};
|
|
16
|
+
class ProviderError extends Error {
|
|
17
|
+
constructor(status){super('SamSpeaks provider request failed.');this.status=status;}
|
|
18
|
+
}
|
|
19
|
+
async function generate(key, models, contents, generationConfig, systemInstruction, fetcher) {
|
|
20
|
+
const payload = {contents:typeof contents==='string'?[{role:'user',parts:[{text:contents}]}]:contents,generationConfig};
|
|
21
|
+
if(systemInstruction)payload.systemInstruction={parts:[{text:systemInstruction}]};
|
|
22
|
+
for(const model of [...new Set(models.filter(Boolean))]){
|
|
23
|
+
const response=await fetcher('https://generativelanguage.googleapis.com/v1beta/models/'+encodeURIComponent(model)+':generateContent',{
|
|
24
|
+
method:'POST',headers:{'content-type':'application/json','x-goog-api-key':key},
|
|
25
|
+
body:JSON.stringify(payload),signal:AbortSignal.timeout(45000)
|
|
26
|
+
});
|
|
27
|
+
if(response.ok)return {data:await response.json(),model};
|
|
28
|
+
// Only retry when the configured model does not exist; never repeat quota or credential failures.
|
|
29
|
+
if(response.status===404 && model!==models.at(-1))continue;
|
|
30
|
+
throw new ProviderError(response.status);
|
|
31
|
+
}
|
|
32
|
+
throw new ProviderError(404);
|
|
33
|
+
}
|
|
34
|
+
function audioOutput(part) {
|
|
35
|
+
const mime=part.mimeType || 'audio/wav';
|
|
36
|
+
if(!/^(audio\/(L16|pcm|raw))\b/i.test(mime))return {audioBase64:part.data,mimeType:mime};
|
|
37
|
+
const rate=Number(mime.match(/rate=(\d+)/i)?.[1] || 24000);
|
|
38
|
+
const raw=atob(part.data), bytes=new Uint8Array(44+raw.length), view=new DataView(bytes.buffer);
|
|
39
|
+
const tag=(offset,value)=>{for(let i=0;i<value.length;i++)bytes[offset+i]=value.charCodeAt(i);};
|
|
40
|
+
tag(0,'RIFF');view.setUint32(4,36+raw.length,true);tag(8,'WAVE');tag(12,'fmt ');view.setUint32(16,16,true);
|
|
41
|
+
view.setUint16(20,1,true);view.setUint16(22,1,true);view.setUint32(24,rate,true);view.setUint32(28,rate*2,true);
|
|
42
|
+
view.setUint16(32,2,true);view.setUint16(34,16,true);tag(36,'data');view.setUint32(40,raw.length,true);
|
|
43
|
+
for(let i=0;i<raw.length;i++)bytes[44+i]=raw.charCodeAt(i);
|
|
44
|
+
let binary='';for(let i=0;i<bytes.length;i+=0x4000)binary+=String.fromCharCode(...bytes.subarray(i,i+0x4000));
|
|
45
|
+
return {audioBase64:btoa(binary),mimeType:'audio/wav'};
|
|
46
|
+
}
|
|
47
|
+
export async function handleSamSpeaksRequest(request,{apiKey,ttsModel,textModel,fetcher=fetch}={}) {
|
|
48
|
+
const operation=new URL(request.url).pathname.split('/').filter(Boolean).at(-1);
|
|
49
|
+
if(!['health','tts','script-assist','compose'].includes(operation))return json({error:'not_found'},404);
|
|
50
|
+
const ttsModels=[ttsModel || 'gemini-3.8-flash-tts','gemini-2.5-flash-preview-tts'];
|
|
51
|
+
const textModels=[textModel || 'gemini-4-hydrogen','gemini-3.1-flash-lite','gemini-2.5-flash-lite'];
|
|
52
|
+
if(operation==='health'){
|
|
53
|
+
if(request.method!=='GET')return json({error:'method_not_allowed'},405);
|
|
54
|
+
return json({ok:true,hasApiKey:Boolean(apiKey),ttsModel:ttsModels[0],provider:'gemini'});
|
|
55
|
+
}
|
|
56
|
+
if(request.method!=='POST')return json({error:'method_not_allowed'},405);
|
|
57
|
+
if(Number(request.headers.get('content-length'))>MAX_BODY)return json({error:'request_too_large'},413);
|
|
58
|
+
let body;
|
|
59
|
+
try{
|
|
60
|
+
const raw=await request.text();
|
|
61
|
+
if(new TextEncoder().encode(raw).byteLength>MAX_BODY)return json({error:'request_too_large'},413);
|
|
62
|
+
body=JSON.parse(raw);
|
|
63
|
+
if(!body || typeof body!=='object' || Array.isArray(body))throw new Error('invalid');
|
|
64
|
+
}catch{return json({error:'invalid_json'},400);}
|
|
65
|
+
if(operation==='tts' && (!text(body.text)||body.text.length>4000))return json({error:'Enter a script of 1–4000 characters.'},400);
|
|
66
|
+
if(operation==='compose' && !text(body.prompt) && !(Array.isArray(body.images)&&body.images.length))return json({error:'Enter a movie prompt or add a reference image.'},400);
|
|
67
|
+
if(!apiKey)return json({error:'Connect Gemini in Settings > Keys to use voice, script, and storyboard generation.',code:'gemini_not_connected'},503);
|
|
68
|
+
try{
|
|
69
|
+
if(operation==='tts'){
|
|
70
|
+
const dual=body.mode==='dual';
|
|
71
|
+
const speakerA=text(body.speakerA,'Alex',24)||'Alex';
|
|
72
|
+
const speakerB=text(body.speakerB,'Sam',24)||'Sam';
|
|
73
|
+
if(dual&&speakerA===speakerB)return json({error:'Speaker names must be distinct.'},400);
|
|
74
|
+
const styleA=text(body.styleA,'',300),styleB=text(body.styleB,'',300),style=text(body.stylePrompt,'',300);
|
|
75
|
+
let prompt=body.text.trim();
|
|
76
|
+
const speechConfig=dual?{multiSpeakerVoiceConfig:{speakerVoiceConfigs:[
|
|
77
|
+
{speaker:speakerA,voiceConfig:{prebuiltVoiceConfig:{voiceName:voice(body.voiceA,'Puck')}}},
|
|
78
|
+
{speaker:speakerB,voiceConfig:{prebuiltVoiceConfig:{voiceName:voice(body.voiceB,'Kore')}}}
|
|
79
|
+
]}}:{voiceConfig:{prebuiltVoiceConfig:{voiceName:voice(body.voiceName,'Kore')}}};
|
|
80
|
+
if(dual){
|
|
81
|
+
const lines=prompt.split(/\r?\n+/).map(line=>line.trim()).filter(Boolean);
|
|
82
|
+
prompt=lines.map((line,i)=>{
|
|
83
|
+
const match=/^([^:]{1,23}):\s*(.+)$/.exec(line);
|
|
84
|
+
const prefix=match?.[1]?.toLowerCase();
|
|
85
|
+
const speaker=prefix===speakerA.toLowerCase()?speakerA:prefix===speakerB.toLowerCase()?speakerB:i%2?speakerB:speakerA;
|
|
86
|
+
return speaker+': '+(match?.[2]||line);
|
|
87
|
+
}).join('\n');
|
|
88
|
+
if(styleA||styleB)prompt='Perform this dialogue with '+speakerA+' style: '+(styleA||'natural')+' and '+speakerB+' style: '+(styleB||'natural')+'. Read only the dialogue:\n'+prompt;
|
|
89
|
+
}else if(style)prompt='Read the following text in this style: '+style+'. Read only the text:\n'+prompt;
|
|
90
|
+
const {data,model}=await generate(apiKey,ttsModels,prompt,{responseModalities:['AUDIO'],speechConfig},null,fetcher);
|
|
91
|
+
const part=data?.candidates?.[0]?.content?.parts?.find(p=>p.inlineData?.data)?.inlineData;
|
|
92
|
+
if(!part)return json({error:'Gemini returned no audio data.'},502);
|
|
93
|
+
return json({...audioOutput(part),model});
|
|
94
|
+
}
|
|
95
|
+
if(operation==='script-assist'){
|
|
96
|
+
const subject=text(body.subjectTitle,'Harmonic Astrolabe',150),description=text(body.subjectDescription,'a kinetic spatial sculpture',1200),topic=text(body.topic,'',1000);
|
|
97
|
+
const prompt=body.mode==='dual'
|
|
98
|
+
? `Write a concise, lively 2-turn creative studio dialogue between Alex and Sam reacting to "${subject}" (${description}). ${topic?'Focus on: '+topic+'.':''} Format as two lines starting with "Alex: " and "Sam: ". Keep under 45 words total.`
|
|
99
|
+
: `Write a vivid, cinematic 2-sentence studio showcase narration about "${subject}" (${description}). ${topic?'Focus on: '+topic+'.':''} Keep under 38 words total.`;
|
|
100
|
+
const {data}=await generate(apiKey,textModels,prompt,{},'You are a creative director writing concise expressive voiceover scripts for a 3D XR design studio. Return only script text.',fetcher);
|
|
101
|
+
const script=providerText(data);return script?json({script}):json({error:'No script text returned.'},502);
|
|
102
|
+
}
|
|
103
|
+
const parts=[];
|
|
104
|
+
for(const img of (Array.isArray(body.images)?body.images.slice(0,4):[])){
|
|
105
|
+
if(typeof img?.data!=='string'||!/^image\/(jpeg|png|webp|gif)$/.test(img.mimeType||''))return json({error:'Unsupported reference image.'},400);
|
|
106
|
+
const base64=img.data.includes(',')?img.data.split(',')[1]:img.data;
|
|
107
|
+
if(!base64||!/^[A-Za-z0-9+/=]+$/.test(base64))return json({error:'Invalid reference image.'},400);
|
|
108
|
+
parts.push({inlineData:{mimeType:img.mimeType,data:base64}});
|
|
109
|
+
}
|
|
110
|
+
parts.push({text:[
|
|
111
|
+
'Compose a 3–4 beat cinematic 3D guided movie walkthrough and audio storyboard for SamSpeaks.',
|
|
112
|
+
'Centerpiece: '+text(body.subjectLabel,'Astrolabe',150)+'. Atmosphere: '+text(body.mood,'studio',30)+'.',
|
|
113
|
+
'Creative brief: '+text(body.prompt,'Use the reference images.',4000),
|
|
114
|
+
'Use any reference images in the narration, mood and camera direction.',
|
|
115
|
+
'Each beat needs title, script of 1–2 spoken sentences under 35 words, ttsMode (single or dual), voiceName (one of '+[...VOICES].join(', ')+'), voiceStyle, cameraShot (establishing, hero, closeup, lowAngle, overhead, leftProp, rightProp), transitionType (glide, dolly, orbit, crane, cut), mood (studio, sunset, twilight, noir, dawn), explodeAmount (0–0.85).',
|
|
116
|
+
'For dual narration use two lines prefixed Alex: and Sam:.'
|
|
117
|
+
].join('\n')});
|
|
118
|
+
const {data}=await generate(apiKey,textModels,[{role:'user',parts}],{responseMimeType:'application/json',responseSchema:schema},'You are miniAgentSam, a 3D movie director. Return valid JSON matching the schema.',fetcher);
|
|
119
|
+
const result=JSON.parse(providerText(data)||'{}');
|
|
120
|
+
if(!Array.isArray(result.beats)||!result.beats.length)return json({error:'No storyboard returned.'},502);
|
|
121
|
+
return json({movieTitle:result.movieTitle||'Untitled Spatial Story',beats:result.beats});
|
|
122
|
+
}catch(error){
|
|
123
|
+
const status=error instanceof ProviderError?error.status:0;
|
|
124
|
+
return json({error:status===401||status===403?'Gemini credentials were rejected. Check Settings > Keys.':status===429?'Gemini quota exceeded. Try again later.':'SamSpeaks generation failed. Check the configured Gemini model and try again.',code:'samspeaks_provider_error'},status===429?429:502);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -36,6 +36,22 @@ An operation is a product capability with a stable identity and execution policy
|
|
|
36
36
|
`src/tools/registry.js` is the SDK runtime registry/controller and delegates definition validation to `assertAgentToolDefinition()`. Runtime handlers, local process context, persistence, authorization decisions and product-specific semantics remain with their owning SDK runtime or package. CMS operation semantics remain in `@inneranimalmedia/agentsam-cms`; that package consumes `AgentOperationContract` rather than redefining it.
|
|
37
37
|
|
|
38
38
|
|
|
39
|
+
## Run and activity wire contracts
|
|
40
|
+
|
|
41
|
+
The ACP runtime's public response shapes are owned here rather than existing only as mapper return literals:
|
|
42
|
+
|
|
43
|
+
- `AgentRunV1` and `run.v1.schema.json` describe the public run projection. `status` is the lifecycle view; `storageStatus` is the database's narrower persisted state.
|
|
44
|
+
- `AgentRunStartV1` and `run-start.v1.schema.json` describe the queued control-plane acknowledgement. Queueing is not model execution.
|
|
45
|
+
- `AgentRunReceiptV1` and `run-receipt.v1.schema.json` describe usage, timing, terminal state, suspension and last-event evidence.
|
|
46
|
+
- `AgentActivityEventV1` and `activity.v1.schema.json` describe the normalized activity projection. The schema requires every property the TypeScript contract requires.
|
|
47
|
+
- The ACP `recordAgentRunTimeout()` helper persists a timeout as storage status `failed` plus an idempotent `run.timed_out` event, which the run mapper projects as lifecycle status `timed_out`.
|
|
48
|
+
|
|
49
|
+
`assertAgentJsonSchema()` validates embedded tool/operation schemas against Draft 2020-12 or Draft 7 meta-schemas before registration. It does not fetch remote `$ref` targets; schema-pack publication owns reference resolution.
|
|
50
|
+
|
|
51
|
+
## Runtime JSON Schema validation
|
|
52
|
+
|
|
53
|
+
Tool definitions and operation contracts validate embedded input/output schemas against the declared Draft 2020-12 or Draft 7 meta-schema before registration. Ajv is the package's only runtime dependency; no UI framework or host runtime is required. This checks schema structure, while resolving external `$ref` targets remains the responsibility of the schema-pack publisher.
|
|
54
|
+
|
|
39
55
|
## Universal source-format identity
|
|
40
56
|
|
|
41
57
|
- Canonical catalog: `contracts/source-types.v2.json`.
|
|
@@ -44,3 +60,54 @@ An operation is a product capability with a stable identity and execution policy
|
|
|
44
60
|
- The package build copies the canonical catalog and schema into `schemas/` for npm consumers; those package files are generated mirrors, not a second authority.
|
|
45
61
|
- The catalog describes identity and detection evidence only. Runtime adapters separately declare real inspect, import, preview, validate, convert, transcode and export capabilities.
|
|
46
62
|
- V1 identifiers remain available through the explicit `compatibility.legacyIdMappings` map.
|
|
63
|
+
|
|
64
|
+
## Scene-format capability contract
|
|
65
|
+
|
|
66
|
+
The portable `agentsam.scene-format.v1` contract lives in
|
|
67
|
+
`src/scene-format.ts` and is exported from both the package root and
|
|
68
|
+
`@inneranimalmedia/agentsam-contracts/scene-format`.
|
|
69
|
+
|
|
70
|
+
It defines four independent operations—`import`, `export`, `live-reference`,
|
|
71
|
+
and `round-trip`—plus optional `sourceTypeIds` linking to the existing
|
|
72
|
+
source-type identity catalog, a typed capability descriptor, a SHA-256 source-reference
|
|
73
|
+
receipt (explicitly labeled `identification: extension-hint`), and a semantic round-trip receipt. `assertSceneFormatCapability()`
|
|
74
|
+
rejects missing operation declarations; `assertSceneFormatRoundTripReceipt()`
|
|
75
|
+
rejects reports that simultaneously claim a successful round-trip and
|
|
76
|
+
lost properties. This is a **contract only**: no parsers, geometry kernels,
|
|
77
|
+
renderers, filesystem access, account identity or tool permissions are created
|
|
78
|
+
by importing it.
|
|
79
|
+
|
|
80
|
+
Use `@inneranimalmedia/iamscene` for actual format adapters. The universal
|
|
81
|
+
file-identity catalog is separately owned by `contracts/source-types.v2.json`
|
|
82
|
+
and mirrored into this package during build. Identifying a file by suffix,
|
|
83
|
+
media type or magic bytes cannot imply that a format adapter is available.
|
|
84
|
+
The root capability manifest is a discoverable SDK API directory, not a
|
|
85
|
+
hosted execution grant.
|
|
86
|
+
|
|
87
|
+
## ResourceRef — independent file/asset/scene/project identity
|
|
88
|
+
|
|
89
|
+
The `agentsam.resource-ref.v1` contract lives at `src/resource-ref.ts` and is
|
|
90
|
+
available at `@inneranimalmedia/agentsam-contracts/resource-ref`, with a
|
|
91
|
+
Draft 2020-12 JSON Schema at `./resource-ref/schema`.
|
|
92
|
+
|
|
93
|
+
The supported resource variants are `file(mount,path)`, `asset(id)`,
|
|
94
|
+
`scene(id)` and `project(id, revision?)`. There is **no mandatory project ID**
|
|
95
|
+
for a loose-file operation. File references are relative to mounts explicitly
|
|
96
|
+
provided and authorized by the runtime; the contract is not itself an access
|
|
97
|
+
grant, arbitrary filesystem path or storage implementation. A file's SHA-256
|
|
98
|
+
is the natural optimistic concurrency token, while a project may use its
|
|
99
|
+
separate native revision history.
|
|
100
|
+
|
|
101
|
+
## Scene-document v2 execution/authoring contract
|
|
102
|
+
|
|
103
|
+
`src/scene-document.ts` is the shared `agentsam.scene-document.v2`
|
|
104
|
+
capability vocabulary. It reports create, validate, migrate, edit, render,
|
|
105
|
+
simulate, execute-events and inspect **independently**, with receipt and
|
|
106
|
+
verification validators. It is exported from
|
|
107
|
+
`@inneranimalmedia/agentsam-contracts/scene-document` and has a portable
|
|
108
|
+
Draft 2020-12 descriptor schema at `scene-document/schema`.
|
|
109
|
+
|
|
110
|
+
IAMScene owns the actual v2 document schema and authoring implementation.
|
|
111
|
+
An app must bind and test the renderer, simulator and inspector before those
|
|
112
|
+
operations can be declared implemented. A file loading successfully or a
|
|
113
|
+
form being rendered is not evidence of an executable tool.
|
|
@@ -1,14 +1,34 @@
|
|
|
1
1
|
{
|
|
2
|
-
"avoid_when": [
|
|
2
|
+
"avoid_when": [
|
|
3
|
+
"Using contracts declarations as evidence that a codec, importer, native runtime or hosted agent dispatcher exists.",
|
|
4
|
+
"Duplicating IAMScene file-format registration, actual geometry operations, or tenant/project persistence in the contracts package."
|
|
5
|
+
],
|
|
3
6
|
"catalog_status": "needs-review",
|
|
4
7
|
"class": "package",
|
|
5
8
|
"commands": [],
|
|
6
9
|
"evidence": {
|
|
7
10
|
"directory": "packages/agentsam-contracts",
|
|
8
11
|
"purpose_source": "package-manifest-description",
|
|
9
|
-
"readme": "packages/agentsam-contracts/README.md"
|
|
12
|
+
"readme": "packages/agentsam-contracts/README.md",
|
|
13
|
+
"scene_format_contract": "packages/agentsam-contracts/src/scene-format.ts",
|
|
14
|
+
"tests": [
|
|
15
|
+
"packages/agentsam-contracts/test/scene-format.test.mjs",
|
|
16
|
+
"packages/agentsam-contracts/test/design-workspace.test.mjs",
|
|
17
|
+
"packages/agentsam-contracts/test/resource-ref.test.mjs",
|
|
18
|
+
"packages/agentsam-contracts/test/scene-document.test.mjs"
|
|
19
|
+
],
|
|
20
|
+
"scene_format_schema": "packages/agentsam-contracts/schemas/scene-format.v1.schema.json",
|
|
21
|
+
"resource_ref_contract": "packages/agentsam-contracts/src/resource-ref.ts",
|
|
22
|
+
"resource_ref_schema": "packages/agentsam-contracts/schemas/resource-ref.v1.schema.json",
|
|
23
|
+
"scene_document_contract": "packages/agentsam-contracts/src/scene-document.ts",
|
|
24
|
+
"scene_document_schema": "packages/agentsam-contracts/schemas/scene-document.v2.schema.json"
|
|
10
25
|
},
|
|
11
|
-
"execution_domains": [
|
|
26
|
+
"execution_domains": [
|
|
27
|
+
"browser",
|
|
28
|
+
"node",
|
|
29
|
+
"desktop",
|
|
30
|
+
"headless"
|
|
31
|
+
],
|
|
12
32
|
"id": "agentsam-contracts",
|
|
13
33
|
"install": [
|
|
14
34
|
{
|
|
@@ -22,22 +42,36 @@
|
|
|
22
42
|
"typescript"
|
|
23
43
|
],
|
|
24
44
|
"name": "@inneranimalmedia/agentsam-contracts",
|
|
25
|
-
"purpose": "
|
|
45
|
+
"purpose": "Portable contracts for AgentSam operations, tools, authority, providers, workspaces, and scene-format capability/round-trip receipts; does not implement codecs, renderers, authorization or asset storage.",
|
|
26
46
|
"registry": {
|
|
27
47
|
"kind": "npm",
|
|
28
48
|
"name": "@inneranimalmedia/agentsam-contracts",
|
|
29
49
|
"public_claim": true
|
|
30
50
|
},
|
|
31
51
|
"review_required": [
|
|
32
|
-
"
|
|
33
|
-
"execution_domains",
|
|
34
|
-
"status",
|
|
35
|
-
"topics",
|
|
36
|
-
"use_when"
|
|
52
|
+
"status"
|
|
37
53
|
],
|
|
38
54
|
"schema": "agentsam.package.v1",
|
|
39
55
|
"status": "unknown",
|
|
40
|
-
"topics": [
|
|
41
|
-
|
|
42
|
-
|
|
56
|
+
"topics": [
|
|
57
|
+
"authority",
|
|
58
|
+
"contracts",
|
|
59
|
+
"design-workspace",
|
|
60
|
+
"events",
|
|
61
|
+
"interchange",
|
|
62
|
+
"providers",
|
|
63
|
+
"resource-ref",
|
|
64
|
+
"resource-scope",
|
|
65
|
+
"scene-format",
|
|
66
|
+
"tools",
|
|
67
|
+
"runtime-capability",
|
|
68
|
+
"scene-document",
|
|
69
|
+
"scene-v2"
|
|
70
|
+
],
|
|
71
|
+
"use_when": [
|
|
72
|
+
"Type-checking cross-application scene-format operation availability and loss-aware round-trip receipts without importing a scene engine.",
|
|
73
|
+
"Sharing AgentSam tool, agent, event, workspace, context and resource-scope contracts across independently packaged products.",
|
|
74
|
+
"Representing loose file, asset, scene and optional project references without treating project membership as an authorization grant."
|
|
75
|
+
],
|
|
76
|
+
"version": "2.6.18"
|
|
43
77
|
}
|
|
@@ -18,9 +18,12 @@ export interface AgentInput {
|
|
|
18
18
|
modelId?: string;
|
|
19
19
|
capabilityIds?: string[];
|
|
20
20
|
}
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
21
|
+
export declare const AGENT_RUN_MODES: readonly ["ask", "plan", "agent", "debug", "multitask"];
|
|
22
|
+
export declare const AGENT_RUN_SELECTED_BY: readonly ["manual", "thompson", "fallback"];
|
|
23
|
+
export declare const AGENT_RUN_STATUSES: readonly ["queued", "running", "waiting_external", "waiting_child", "awaiting_input", "awaiting_approval", "sleeping", "retry_scheduled", "partial", "completed", "cancelled", "failed", "timed_out"];
|
|
24
|
+
export type AgentRunMode = typeof AGENT_RUN_MODES[number];
|
|
25
|
+
export type AgentRunSelectedBy = typeof AGENT_RUN_SELECTED_BY[number];
|
|
26
|
+
export type AgentRunStatus = typeof AGENT_RUN_STATUSES[number];
|
|
24
27
|
export type AgentRunTerminalStatus = 'completed' | 'cancelled' | 'failed' | 'timed_out';
|
|
25
28
|
export type AgentRunWaitingStatus = 'waiting_external' | 'waiting_child' | 'awaiting_input' | 'awaiting_approval' | 'sleeping' | 'retry_scheduled';
|
|
26
29
|
export interface AgentRun {
|
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
// src/agent.ts
|
|
2
|
+
var AGENT_RUN_MODES = ["ask", "plan", "agent", "debug", "multitask"];
|
|
3
|
+
var AGENT_RUN_SELECTED_BY = ["manual", "thompson", "fallback"];
|
|
4
|
+
var AGENT_RUN_STATUSES = [
|
|
5
|
+
"queued",
|
|
6
|
+
"running",
|
|
7
|
+
"waiting_external",
|
|
8
|
+
"waiting_child",
|
|
9
|
+
"awaiting_input",
|
|
10
|
+
"awaiting_approval",
|
|
11
|
+
"sleeping",
|
|
12
|
+
"retry_scheduled",
|
|
13
|
+
"partial",
|
|
14
|
+
"completed",
|
|
15
|
+
"cancelled",
|
|
16
|
+
"failed",
|
|
17
|
+
"timed_out"
|
|
18
|
+
];
|
|
2
19
|
function isAgentRunTerminalStatus(status) {
|
|
3
20
|
return status === "completed" || status === "cancelled" || status === "failed" || status === "timed_out";
|
|
4
21
|
}
|
|
@@ -9,6 +26,9 @@ function isAgentRunModelActiveStatus(status) {
|
|
|
9
26
|
return status === "queued" || status === "running";
|
|
10
27
|
}
|
|
11
28
|
export {
|
|
29
|
+
AGENT_RUN_MODES,
|
|
30
|
+
AGENT_RUN_SELECTED_BY,
|
|
31
|
+
AGENT_RUN_STATUSES,
|
|
12
32
|
isAgentRunModelActiveStatus,
|
|
13
33
|
isAgentRunTerminalStatus,
|
|
14
34
|
isAgentRunWaitingStatus
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/** AgentSam BIM semantic model: the engine-neutral shape of what an IFC file MEANS.
|
|
2
|
+
*
|
|
3
|
+
* Geometry lives in the IFC (and its derived GLB). This document carries the
|
|
4
|
+
* semantics: spatial tree, element types, materials, property sets, quantities,
|
|
5
|
+
* the wall -> opening -> door chain and spaces, all keyed by IFC GlobalId so a
|
|
6
|
+
* viewer pick, a schedule row and an edit operation refer to the same object.
|
|
7
|
+
*
|
|
8
|
+
* Engines produce it (IfcOpenShell on the CAD service, web-ifc in a browser);
|
|
9
|
+
* consumers never care which. Lengths are meters and areas square meters here
|
|
10
|
+
* regardless of the unit declared in the source IFC.
|
|
11
|
+
* A validating document is not proof the source IFC is complete or valid BIM.
|
|
12
|
+
*/
|
|
13
|
+
export declare const AGENTSAM_BIM_MODEL: "agentsam.bim.model.v1";
|
|
14
|
+
export type BimScalar = string | number | boolean | null;
|
|
15
|
+
export type BimPropertySets = Record<string, Record<string, BimScalar>>;
|
|
16
|
+
export interface BimLayer {
|
|
17
|
+
material: string;
|
|
18
|
+
thicknessM: number | null;
|
|
19
|
+
}
|
|
20
|
+
export interface BimMaterial {
|
|
21
|
+
name: string;
|
|
22
|
+
layers?: BimLayer[];
|
|
23
|
+
}
|
|
24
|
+
export interface BimSpatialNode {
|
|
25
|
+
globalId: string;
|
|
26
|
+
ifcClass: string;
|
|
27
|
+
name: string | null;
|
|
28
|
+
/** Storeys only: elevation above the project datum, meters. */
|
|
29
|
+
elevationM?: number | null;
|
|
30
|
+
children: BimSpatialNode[];
|
|
31
|
+
}
|
|
32
|
+
export interface BimType {
|
|
33
|
+
globalId: string;
|
|
34
|
+
ifcClass: string;
|
|
35
|
+
name: string | null;
|
|
36
|
+
predefinedType: string | null;
|
|
37
|
+
material?: BimMaterial;
|
|
38
|
+
psets: BimPropertySets;
|
|
39
|
+
}
|
|
40
|
+
export interface BimElement {
|
|
41
|
+
globalId: string;
|
|
42
|
+
ifcClass: string;
|
|
43
|
+
name: string | null;
|
|
44
|
+
predefinedType: string | null;
|
|
45
|
+
/** GlobalId of the element's BimType, if it has one. */
|
|
46
|
+
typeId: string | null;
|
|
47
|
+
/** GlobalId of the storey / building / space that contains it. */
|
|
48
|
+
containerId: string | null;
|
|
49
|
+
material?: BimMaterial;
|
|
50
|
+
psets: BimPropertySets;
|
|
51
|
+
qtos: BimPropertySets;
|
|
52
|
+
/** IfcOpeningElement only: the element it cuts (IfcRelVoidsElement). */
|
|
53
|
+
hostId: string | null;
|
|
54
|
+
/** Host elements: openings that cut them. */
|
|
55
|
+
openingIds: string[];
|
|
56
|
+
/** Door/window: the opening it fills (IfcRelFillsElement). */
|
|
57
|
+
fillsOpeningId: string | null;
|
|
58
|
+
}
|
|
59
|
+
export interface BimSpace {
|
|
60
|
+
globalId: string;
|
|
61
|
+
name: string | null;
|
|
62
|
+
longName: string | null;
|
|
63
|
+
containerId: string | null;
|
|
64
|
+
usage: string | null;
|
|
65
|
+
netFloorAreaM2: number | null;
|
|
66
|
+
grossFloorAreaM2: number | null;
|
|
67
|
+
heightM: number | null;
|
|
68
|
+
/** True when the IfcSpace carries real floor geometry, not just a label. */
|
|
69
|
+
hasGeometry: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface BimModel {
|
|
72
|
+
schema: typeof AGENTSAM_BIM_MODEL;
|
|
73
|
+
source: {
|
|
74
|
+
ifcSchema: string;
|
|
75
|
+
sha256: string;
|
|
76
|
+
byteLength: number;
|
|
77
|
+
};
|
|
78
|
+
project: {
|
|
79
|
+
globalId: string;
|
|
80
|
+
name: string | null;
|
|
81
|
+
lengthUnit: string;
|
|
82
|
+
lengthScaleToM: number;
|
|
83
|
+
};
|
|
84
|
+
spatial: BimSpatialNode | null;
|
|
85
|
+
types: BimType[];
|
|
86
|
+
elements: BimElement[];
|
|
87
|
+
spaces: BimSpace[];
|
|
88
|
+
/** Every IFC class present in the source -> instance count (all classes, not just those listed above). */
|
|
89
|
+
counts: Record<string, number>;
|
|
90
|
+
/** True when a safety cap stopped the lists above short of the full model. */
|
|
91
|
+
truncated: boolean;
|
|
92
|
+
warnings: string[];
|
|
93
|
+
}
|
|
94
|
+
/** Structural plus referential check. Throws `agentsam_bim_model_<reason>`. */
|
|
95
|
+
export declare function assertBimModel(value: unknown): asserts value is BimModel;
|