@inneranimalmedia/agentsam-sdk 2.6.17 → 2.6.19
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 +24 -1
- package/apps/README.md +7 -3
- package/apps/agentsam-browser-site/README.md +30 -0
- package/apps/agentsam-copro-studio/README.md +113 -0
- package/apps/agentsam-copro-studio/agentsam.app.json +125 -0
- package/apps/agentsam-go-worker/LICENSE +110 -0
- package/apps/agentsam-go-worker/README.md +244 -0
- package/apps/agentsam-go-worker/runtime/.agentsam-build-commit +1 -0
- package/apps/agentsam-go-worker/runtime/.agentsam-built-at +1 -0
- package/apps/agentsam-go-worker/runtime/cmd/agentsamd/app_packages.go +443 -0
- package/apps/agentsam-go-worker/runtime/cmd/agentsamd/app_packages_test.go +125 -0
- package/apps/agentsam-go-worker/runtime/cmd/agentsamd/auth.go +27 -0
- package/apps/agentsam-go-worker/runtime/cmd/agentsamd/auth_test.go +45 -0
- package/apps/agentsam-go-worker/runtime/cmd/agentsamd/expose.go +147 -0
- package/apps/agentsam-go-worker/runtime/cmd/agentsamd/expose_test.go +59 -0
- package/apps/agentsam-go-worker/runtime/cmd/agentsamd/hostpath.go +11 -0
- package/apps/agentsam-go-worker/runtime/cmd/agentsamd/language_packs.go +172 -0
- package/apps/agentsam-go-worker/runtime/cmd/agentsamd/language_packs_test.go +32 -0
- package/apps/agentsam-go-worker/runtime/cmd/agentsamd/main.go +253 -0
- package/apps/agentsam-go-worker/runtime/cmd/agentsamd/pair.go +157 -0
- package/apps/agentsam-go-worker/runtime/cmd/agentsamd/pair_test.go +100 -0
- package/apps/agentsam-go-worker/runtime/cmd/agentsamd/relay.go +162 -0
- package/apps/agentsam-go-worker/runtime/cmd/agentsamd/relay_supervisor_test.go +128 -0
- package/apps/agentsam-go-worker/runtime/cmd/agentsamd/tunnel.go +51 -0
- package/apps/agentsam-go-worker/runtime/cmd/server/main.go +135 -0
- package/apps/agentsam-go-worker/runtime/go.mod +8 -0
- package/apps/agentsam-go-worker/runtime/go.sum +4 -0
- package/apps/agentsam-go-worker/runtime/internal/agentserror/envelope.go +100 -0
- package/apps/agentsam-go-worker/runtime/internal/agentserror/envelope_test.go +31 -0
- package/apps/agentsam-go-worker/runtime/internal/backoff/backoff.go +57 -0
- package/apps/agentsam-go-worker/runtime/internal/backoff/backoff_test.go +31 -0
- package/apps/agentsam-go-worker/runtime/internal/dockerapi/client.go +409 -0
- package/apps/agentsam-go-worker/runtime/internal/dockerapi/dockerapi_test.go +178 -0
- package/apps/agentsam-go-worker/runtime/internal/dockerapi/http.go +202 -0
- package/apps/agentsam-go-worker/runtime/internal/execapi/exec.go +148 -0
- package/apps/agentsam-go-worker/runtime/internal/execapi/http.go +18 -0
- package/apps/agentsam-go-worker/runtime/internal/execapi/pty.go +45 -0
- package/apps/agentsam-go-worker/runtime/internal/execapi/pty_sessions.go +543 -0
- package/apps/agentsam-go-worker/runtime/internal/execapi/pty_sessions_test.go +195 -0
- package/apps/agentsam-go-worker/runtime/internal/execapi/pty_test.go +21 -0
- package/apps/agentsam-go-worker/runtime/internal/fsapi/fsapi.go +864 -0
- package/apps/agentsam-go-worker/runtime/internal/fsapi/fsapi_test.go +228 -0
- package/apps/agentsam-go-worker/runtime/internal/gitapi/gitapi.go +589 -0
- package/apps/agentsam-go-worker/runtime/internal/gitapi/gitapi_test.go +113 -0
- package/apps/agentsam-go-worker/runtime/internal/hashop/hashop.go +37 -0
- package/apps/agentsam-go-worker/runtime/internal/hashop/hashop_test.go +26 -0
- package/apps/agentsam-go-worker/runtime/internal/health/health.go +60 -0
- package/apps/agentsam-go-worker/runtime/internal/hostpath/hostpath.go +134 -0
- package/apps/agentsam-go-worker/runtime/internal/hostpath/hostpath_test.go +59 -0
- package/apps/agentsam-go-worker/runtime/internal/imessage/http.go +120 -0
- package/apps/agentsam-go-worker/runtime/internal/imessage/imessage.go +523 -0
- package/apps/agentsam-go-worker/runtime/internal/imessage/imessage_test.go +307 -0
- package/apps/agentsam-go-worker/runtime/internal/inspect/inspect.go +71 -0
- package/apps/agentsam-go-worker/runtime/internal/inspect/inspect_test.go +24 -0
- package/apps/agentsam-go-worker/runtime/internal/localauth/token.go +171 -0
- package/apps/agentsam-go-worker/runtime/internal/localauth/token_test.go +84 -0
- package/apps/agentsam-go-worker/runtime/internal/pairing/dialog.go +56 -0
- package/apps/agentsam-go-worker/runtime/internal/pairing/pairing.go +100 -0
- package/apps/agentsam-go-worker/runtime/internal/pairing/pairing_test.go +75 -0
- package/apps/agentsam-go-worker/runtime/internal/relay/relay.go +519 -0
- package/apps/agentsam-go-worker/runtime/internal/relay/relay_test.go +397 -0
- package/apps/agentsam-go-worker/runtime/internal/runtimeinfo/runtimeinfo.go +49 -0
- package/apps/agentsam-go-worker/runtime/internal/runtimeinfo/runtimeinfo_test.go +20 -0
- package/apps/agentsam-go-worker/runtime/internal/sshtunnel/sshtunnel.go +277 -0
- package/apps/agentsam-go-worker/runtime/internal/sshtunnel/sshtunnel_test.go +176 -0
- package/apps/agentsam-go-worker/runtime/mcp-bridge/ADAPTER_CONTRACT.md +61 -0
- package/apps/agentsam-go-worker/runtime/mcp-bridge/bridge.go +125 -0
- package/apps/agentsam-go-worker/runtime/mcp-bridge/registry.go +53 -0
- package/apps/agentsam-go-worker/runtime/mcp-bridge/tools/echo-go/adapter.go +39 -0
- package/apps/agentsam-go-worker/runtime/mcp-bridge/tools/echo-go/tool.json +21 -0
- package/apps/agentsam-go-worker/runtime/mcp-bridge/tools/echo-http/server.py +33 -0
- package/apps/agentsam-go-worker/runtime/mcp-bridge/tools/echo-http/tool.json +17 -0
- package/apps/agentsam-go-worker/runtime/mcp-bridge/tools/echo-node/adapter.js +13 -0
- package/apps/agentsam-go-worker/runtime/mcp-bridge/tools/echo-node/tool.json +20 -0
- package/apps/agentsam-go-worker/runtime/mcp-bridge/tools/echo-python/adapter.py +18 -0
- package/apps/agentsam-go-worker/runtime/mcp-bridge/tools/echo-python/tool.json +20 -0
- package/apps/agentsam-go-worker/runtime/mcp-bridge/tools/echo-rust/Cargo.toml +12 -0
- package/apps/agentsam-go-worker/runtime/mcp-bridge/tools/echo-rust/src/main.rs +21 -0
- package/apps/agentsam-go-worker/runtime/mcp-bridge/tools/echo-rust/tool.json +21 -0
- package/apps/agentsam-go-worker/runtime/mcp-bridge/tools/echo-ts/adapter.ts +19 -0
- package/apps/agentsam-go-worker/runtime/mcp-bridge/tools/echo-ts/tool.json +22 -0
- package/apps/agentsamd/README.md +107 -0
- package/apps/cad-creator/README.md +9 -9
- 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/README.md +101 -0
- package/apps/design-canvas/agentsam.app.json +155 -0
- package/apps/ecommerce-cms-agentsam/README.md +24 -0
- package/apps/ecommerce-cms-agentsam/agentsam.app.json +531 -0
- package/apps/local-studio/LICENSE +110 -0
- package/apps/local-studio/README.md +61 -0
- package/apps/local-studio/agentsam.app.json +316 -0
- package/apps/samsketch/README.md +21 -0
- package/apps/samsketch/agentsam.app.json +135 -0
- package/apps/samspeaks/README.md +49 -0
- package/apps/theme-gallery-preview/README.md +49 -0
- package/contracts/source-types.v2.json +86 -1
- package/docs/AUTH_IDENTITY_CONTRACT.md +70 -37
- package/docs/CAPABILITIES.md +56 -0
- package/docs/CLI_SHELL.md +19 -8
- 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/adr/ADR-0011-portable-project-context-and-agentsam-authority.md +124 -0
- package/docs/adr/ADR-0012-repository-intelligence-and-knowledge-lane-authority.md +148 -0
- package/docs/adr/ADR-0013-local-studio-identity-and-provider-grant-ownership.md +101 -0
- package/docs/adr/README.md +24 -13
- package/docs/agentsam-remote-control/ARCHITECTURE.md +60 -0
- package/docs/agentsam-remote-control/README.md +127 -0
- package/docs/architecture/ACP_D1_HOSTING.md +113 -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/AGENTSAM_RUNTIME_PROTOCOL.md +6 -4
- package/docs/architecture/AGENTSAM_WORK_IDE_LANES_2026-10-28.md +2 -0
- 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/DESIGN_PROJECT_READS.md +35 -0
- package/docs/architecture/ECOMMERCE_THEME_START_FLOW.md +31 -0
- package/docs/architecture/FS_E2E_CLOSURE_RECEIPT.md +2 -0
- package/docs/architecture/LIVE_AST_AND_CREATIVE_RESOURCE_GRAPH.md +129 -0
- package/docs/architecture/LOCAL_FS_AUTHORITY.md +31 -29
- package/docs/architecture/LOCAL_STUDIO_CLOUDFLARE_OAUTH.md +115 -23
- package/docs/architecture/PRIMETECH_SCENE_V2_READINESS.md +89 -0
- package/docs/architecture/PROVIDER_NEUTRAL_COMPUTE.md +89 -0
- package/docs/architecture/PYTHON_CAD_SERVICE_TRANSPORT.md +116 -0
- package/docs/architecture/SAM_RUNTIME_EXECUTION_PLAN.md +88 -0
- package/docs/architecture/SCHEMA_AUTHORITIES.md +83 -0
- package/docs/architecture/app-module-plugin-classification.md +71 -0
- package/docs/architecture/identity-and-plugin-oauth-ownership.md +70 -0
- package/docs/architecture/marketplace-forms-and-embeds-end-state.md +299 -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 +207 -0
- package/docs/architecture/primetech/PORTABLE_EDITOR_CONTRACTS.md +192 -0
- package/docs/architecture/primetech/README.md +65 -0
- package/docs/architecture/primetech/RESIDENTIAL_DEVELOPMENT_PLAN.md +166 -0
- package/docs/architecture/studio-templates-audit-2026-11-01.md +2 -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/contracts/environment-vocabulary.md +14 -14
- package/docs/contracts/google-cloud-oauth-setup.md +15 -0
- package/docs/document-workflows.md +14 -0
- package/docs/engineering/CMS_DATA_AUTHORITY_2026-11-03.md +4 -2
- package/docs/generated/SDK_CAPABILITY_INVENTORY.md +44 -41
- package/docs/intake/product-capabilities.proposed.ts +6 -6
- package/docs/local-studio/WORKMODE_DONOR_NOTES.md +2 -0
- package/docs/operations/CLOUDFLARE-QUEUE-OBSERVABILITY.md +1 -1
- package/docs/plans/AGENTSAM_SDK_RELEASE_PROGRAM.md +3 -3
- package/docs/plugins.md +82 -37
- package/docs/prd/PRD-agentsam-cad-studio.md +8 -0
- package/docs/primetech/CANVAS_WORKSPACE_SPEC_2026-12-01.md +335 -0
- package/docs/product/AGENTSAM_PRODUCT_EXPERIENCE_STANDARD.md +1 -1
- package/docs/product/COPRO-EXECUTION-PLAN.md +1 -1
- package/docs/product/PLUGIN-GALLERY-DISCOVERY-AND-INSTALL.md +44 -97
- package/docs/reference/AGENTSAM-CLI-WORKFLOWS.md +1 -1
- package/docs/reference/AGENTSAM-REGISTRY.generated.md +41 -29
- package/docs/reference/MCP-DEVELOPMENT.md +32 -0
- package/docs/sam/opencv-media.md +97 -0
- package/docs/standards/DESKTOP_WEB_PARITY_ACCEPTANCE.md +42 -0
- package/migrations/d1/0001_agentsam_plugin_runtime.sql +0 -2
- package/migrations/d1/0011c_agentsam_skill_v2_backfill.sql +23 -1
- 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/20261127_agentsam_r2_list_prefix_pagination.sql +17 -0
- package/migrations/d1/20261128_rename_agentsam_mcp_cloudflare_plugin_key.sql +29 -0
- package/migrations/d1/20261130_release_publish_capability.sql +16 -0
- package/migrations/d1/20261202_plugin_built_in_and_categories.sql +19 -0
- package/migrations/d1/generated/20261123_portable_cli_seed.sql +102 -0
- package/migrations/d1/generated/20261123_source_skill_seed.sql +4329 -0
- package/migrations/runtime/0012_agent_run_event_sequence.sql +27 -0
- package/migrations/runtime/0013_acp_spawn_and_approval_contract.sql +54 -0
- package/migrations/runtime/0014_notification_outbox_channels.sql +41 -0
- package/package.json +77 -23
- 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-abs/README.md +91 -0
- package/packages/agentsam-analytics/LICENSE +110 -0
- package/packages/agentsam-analytics/README.md +92 -0
- package/packages/agentsam-architectural-intelligence/mcp/assembly.mjs +17 -0
- package/packages/agentsam-architectural-intelligence/mcp/server.mjs +2 -8
- package/packages/agentsam-architectural-intelligence/package.json +1 -1
- package/packages/agentsam-assets-core/LICENSE +110 -0
- package/packages/agentsam-brand/README.md +12 -0
- package/packages/agentsam-brand/package.json +9 -3
- package/packages/agentsam-brand/src/adapters/d1-registry.d.ts +58 -0
- package/packages/agentsam-brand/src/adapters/d1-registry.js +437 -15
- package/packages/agentsam-brand/src/cli/controller.js +53 -16
- package/packages/agentsam-brand/src/core/capabilities.js +108 -48
- package/packages/agentsam-brand/src/core/iconography/family.js +569 -0
- package/packages/agentsam-brand/src/extract.js +6 -1
- package/packages/agentsam-brand/src/index.js +16 -1
- 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 +45 -0
- package/packages/agentsam-brand/src/workspace.js +191 -0
- package/packages/agentsam-browser-surface/README.md +28 -0
- package/packages/agentsam-campaign/LICENSE +110 -0
- package/packages/agentsam-campaign/README.md +133 -0
- package/packages/agentsam-cloudflare-images/LICENSE +110 -0
- package/packages/agentsam-cms/README.md +11 -0
- package/packages/agentsam-cms/package.json +4 -3
- package/packages/agentsam-cms/src/chat-storage.js +33 -9
- 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/chat-storage.test.mjs +37 -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/README.md +5 -4
- package/packages/agentsam-communications/package.json +6 -3
- package/packages/agentsam-communications/src/adapters.js +26 -0
- package/packages/agentsam-communications/src/imessage.js +249 -0
- package/packages/agentsam-communications/src/index.js +3 -1
- package/packages/agentsam-communications/src/outbox.js +87 -6
- package/packages/agentsam-communications/src/push.js +146 -0
- package/packages/agentsam-communications/src/samspeaks-runtime.js +126 -0
- package/packages/agentsam-communications/test/communications.test.mjs +43 -1
- package/packages/agentsam-communications/test/imessage.test.mjs +223 -0
- package/packages/agentsam-communications/test/push.test.mjs +113 -0
- package/packages/agentsam-content/LICENSE +110 -0
- package/packages/agentsam-content-studio/LICENSE +110 -0
- package/packages/agentsam-contracts/README.md +72 -0
- package/packages/agentsam-contracts/agentsam.package.json +54 -12
- package/packages/agentsam-contracts/dist/agent.d.ts +6 -5
- 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 +17832 -354
- 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 +151 -38
- package/packages/agentsam-contracts/dist/run.js +41 -22
- 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 +20 -0
- package/packages/agentsam-contracts/package.json +46 -4
- package/packages/agentsam-contracts/schemas/activity.v1.schema.json +142 -0
- package/packages/agentsam-contracts/schemas/approval-decision.v1.schema.json +36 -0
- package/packages/agentsam-contracts/schemas/approval.v1.schema.json +134 -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 +322 -0
- package/packages/agentsam-contracts/schemas/run-spawn.v1.schema.json +74 -0
- package/packages/agentsam-contracts/schemas/run-start.v1.schema.json +40 -0
- package/packages/agentsam-contracts/schemas/run.v1.schema.json +161 -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 -20
- 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 +155 -92
- 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 +24 -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 +58 -46
- 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-database-editor/LICENSE +110 -0
- package/packages/agentsam-database-editor/README.md +105 -0
- package/packages/agentsam-desktop-shell/scripts/app-discovery.mjs +36 -25
- package/packages/agentsam-docs-theme/LICENSE +110 -0
- package/packages/agentsam-docs-theme/README.md +11 -0
- package/packages/agentsam-embeds/README.md +51 -0
- package/packages/agentsam-errors/package.json +1 -1
- package/packages/agentsam-goalguru/README.md +19 -0
- package/packages/agentsam-goalguru/agentsam.app.json +97 -0
- package/packages/agentsam-goap/package.json +2 -2
- package/packages/agentsam-hooks/README.md +14 -0
- package/packages/agentsam-hooks/package.json +1 -1
- package/packages/agentsam-hooks/src/contracts.js +1 -0
- package/packages/agentsam-hooks/src/index.d.ts +1 -1
- package/packages/agentsam-hooks/test/runtime.test.mjs +13 -0
- package/packages/agentsam-ide/README.md +2 -3
- package/packages/agentsam-key-manager/LICENSE +110 -0
- package/packages/agentsam-knowledge/package.json +1 -1
- package/packages/agentsam-loading-scene/LICENSE +110 -0
- package/packages/agentsam-loading-scene/README.md +109 -0
- package/packages/agentsam-merch/package.json +1 -1
- package/packages/agentsam-nav/dist/AdminAppsDialog.d.ts +1 -1
- package/packages/agentsam-nav/dist/NavProvider.d.ts +2 -0
- package/packages/agentsam-nav/dist/Surfaces.d.ts +15 -4
- package/packages/agentsam-nav/dist/browser.global.js +20 -16
- package/packages/agentsam-nav/dist/browser.js +659 -208
- package/packages/agentsam-nav/dist/contracts.d.ts +23 -0
- package/packages/agentsam-nav/dist/index.d.ts +2 -2
- package/packages/agentsam-nav/dist/index.js +587 -108
- package/packages/agentsam-nav/dist/legacy.css +8 -0
- package/packages/agentsam-nav/dist/shell.css +417 -6
- package/packages/agentsam-nav/dist/theme.css +417 -6
- package/packages/agentsam-nav/dist/useAdminApps.d.ts +22 -2
- package/packages/agentsam-nav/package.json +1 -1
- package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-occt.dir/engine.cpp.o +0 -0
- package/packages/agentsam-occt/.native-build/CMakeFiles/agentsam-occt.dir/engine.cpp.o.d +2 -0
- package/packages/agentsam-occt/.native-build/agentsam-occt +0 -0
- package/packages/agentsam-occt/dist/browser.d.ts +2 -2
- 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/native/engine.cpp +3 -0
- package/packages/agentsam-occt/package.json +1 -1
- package/packages/agentsam-occt/src/browser.ts +2 -2
- package/packages/agentsam-occt/src/native-provider.mjs +1 -1
- package/packages/agentsam-occt/test/native-engine.test.mjs +2 -2
- 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-scoring/LICENSE +110 -0
- package/packages/agentsam-sections/README.md +76 -0
- package/packages/agentsam-settings/LICENSE +110 -0
- package/packages/agentsam-settings/README.md +136 -0
- package/packages/agentsam-shell-kit/LICENSE +110 -0
- package/packages/agentsam-shell-kit/README.md +5 -0
- package/packages/agentsam-vault/README.md +16 -8
- package/packages/agentsam-vault/package.json +9 -2
- 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/crypto/oauth-envelope.js +1 -1
- package/packages/agentsam-vault/src/index.d.ts +84 -0
- package/packages/agentsam-vault/src/index.js +14 -0
- package/packages/agentsam-vault/src/providers/registry.js +16 -0
- package/packages/agentsam-vault/src/runtime/account-resolver.js +282 -0
- package/packages/agentsam-vault/src/runtime/oauth-resolver.js +163 -0
- package/packages/agentsam-vault/src/runtime/resolver.js +73 -30
- package/packages/agentsam-work/LICENSE +110 -0
- package/packages/agentsam-work/README.md +64 -0
- package/packages/agentsam-workbench/README.md +27 -3
- package/packages/agentsam-workbench/package.json +31 -4
- package/packages/agentsam-workbench/src/agent/AgentPanel.tsx +2 -0
- package/packages/agentsam-workbench/src/agent/ArtifactCard.tsx +61 -0
- package/packages/agentsam-workbench/src/agent/AskAgentSamPill.tsx +17 -0
- package/packages/agentsam-workbench/src/agent/Composer.tsx +90 -26
- package/packages/agentsam-workbench/src/agent/ConnectedAgentPanel.tsx +8 -0
- package/packages/agentsam-workbench/src/agent/MiniAgentSam.tsx +144 -20
- package/packages/agentsam-workbench/src/agent/Thread.tsx +21 -4
- package/packages/agentsam-workbench/src/agent/ToolReceipt.tsx +48 -8
- package/packages/agentsam-workbench/src/agent/contextual-composer.css +19 -0
- package/packages/agentsam-workbench/src/agent/index.ts +1 -0
- package/packages/agentsam-workbench/src/agent/mini-agentsam.css +72 -2
- package/packages/agentsam-workbench/src/agent/thread.css +20 -0
- package/packages/agentsam-workbench/src/design/DesignWorkspaceFrame.tsx +292 -84
- package/packages/agentsam-workbench/src/design/design-workspace.css +222 -107
- 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 +290 -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/styles.d.ts +1 -0
- package/packages/agentsam-workbench/src/widgets/AskAgentSamWidget.tsx +29 -0
- package/packages/agentsam-workbench/src/widgets/BuiltinWidget.tsx +33 -1
- package/packages/agentsam-workbench/src/widgets/CreativeWidgets.tsx +30 -0
- package/packages/agentsam-workbench/src/widgets/MediaWidget.tsx +21 -0
- package/packages/agentsam-workbench/src/widgets/ProviderWidgets.tsx +96 -0
- package/packages/agentsam-workbench/src/widgets/QueueDepthWidget.tsx +53 -10
- package/packages/agentsam-workbench/src/widgets/ReleaseWidgets.tsx +137 -0
- package/packages/agentsam-workbench/src/widgets/ask-agentsam.ts +25 -0
- package/packages/agentsam-workbench/src/widgets/covers/brand-guidelines.svg +1 -0
- package/packages/agentsam-workbench/src/widgets/covers/brand.svg +28 -0
- package/packages/agentsam-workbench/src/widgets/covers/data.svg +24 -0
- package/packages/agentsam-workbench/src/widgets/covers/design-in-code.svg +1 -0
- package/packages/agentsam-workbench/src/widgets/covers/design-system.svg +1 -0
- package/packages/agentsam-workbench/src/widgets/covers/design.svg +1 -0
- package/packages/agentsam-workbench/src/widgets/covers/docs.svg +21 -0
- package/packages/agentsam-workbench/src/widgets/covers/sheets.svg +17 -0
- package/packages/agentsam-workbench/src/widgets/covers/slides.svg +1 -0
- package/packages/agentsam-workbench/src/widgets/covers/whiteboard.svg +1 -0
- package/packages/agentsam-workbench/src/widgets/covers/workflows.svg +36 -0
- package/packages/agentsam-workbench/src/widgets/creative-covers.ts +54 -0
- package/packages/agentsam-workbench/src/widgets/index.ts +8 -0
- package/packages/agentsam-workbench/src/widgets/register-ask-agentsam-widget.sql +5 -0
- package/packages/agentsam-workbench/src/widgets/register-creative-widgets.sql +10 -0
- package/packages/agentsam-workbench/src/widgets/register-media-widget.sql +1 -0
- package/packages/agentsam-workbench/src/widgets/register-release-widgets.sql +5 -0
- package/packages/agentsam-workbench/src/widgets/registry.ts +68 -40
- package/packages/agentsam-workbench/src/widgets/release-snapshots.ts +28 -0
- package/packages/agentsam-workbench/src/widgets/svg.d.ts +9 -0
- package/packages/agentsam-workbench/src/widgets/widgets.css +82 -0
- package/packages/agentsam-workbench/src/workflows/WorkflowStudio.tsx +1205 -0
- package/packages/agentsam-workbench/src/workflows/index.ts +5 -0
- package/packages/agentsam-workbench/src/workflows/model.ts +213 -0
- package/packages/agentsam-workbench/src/workflows/step-choices.ts +46 -0
- package/packages/agentsam-workbench/src/workflows/types.ts +239 -0
- package/packages/agentsam-workbench/src/workflows/workflow-studio.css +591 -0
- package/packages/analytics-ui/LICENSE +110 -0
- package/packages/analytics-ui/README.md +22 -0
- package/packages/catalog/generated/packages.json +201 -51
- package/packages/connectors/cfoa/OAUTH_STORAGE_AUDIT.md +11 -55
- package/packages/connectors/cfoa/package.json +11 -3
- package/packages/connectors/cfoa/src/PERMISSION_REGISTRY.md +45 -0
- package/packages/connectors/cfoa/src/api-client.js +22 -1
- package/packages/connectors/cfoa/src/capabilities.js +123 -285
- package/packages/connectors/cfoa/src/credential.js +139 -23
- package/packages/connectors/cfoa/src/families/media.js +41 -15
- package/packages/connectors/cfoa/src/index.js +33 -39
- package/packages/connectors/cfoa/src/oauth-persist.js +195 -63
- package/packages/connectors/cfoa/src/owner.js +20 -32
- package/packages/connectors/cfoa/src/permission-options.js +147 -1038
- package/packages/connectors/cfoa/src/routes.js +246 -71
- package/packages/connectors/cfoa/src/scope-catalog.js +16 -351
- package/packages/connectors/cfoa/src/scope-registry.js +263 -0
- package/packages/connectors/cfoa/test/scope-registry.test.mjs +191 -0
- package/packages/connectors/cfoa/tests/api-client-fetch.test.mjs +34 -0
- package/packages/connectors/cfoa/tests/capabilities.test.mjs +86 -45
- package/packages/connectors/cfoa/tests/connection-records.test.mjs +74 -0
- package/packages/connectors/cfoa/tests/connector.test.mjs +266 -1
- package/packages/connectors/cfoa/tests/cross-host-recovery.test.mjs +19 -4
- package/packages/connectors/cfoa/tests/media-discovery.test.mjs +82 -12
- package/packages/connectors/cfoa/tests/oauth-account-selection.test.mjs +51 -0
- package/packages/connectors/cfoa/tests/oauth-persist.test.mjs +131 -0
- package/packages/copro-editor/LICENSE +110 -0
- package/packages/copro-editor/README.md +16 -0
- package/packages/copro-media/LICENSE +110 -0
- package/packages/copro-media/README.md +5 -0
- package/packages/copro-project/LICENSE +110 -0
- package/packages/copro-project/README.md +13 -0
- package/packages/copro-proof/LICENSE +110 -0
- package/packages/copro-proof/README.md +9 -0
- package/packages/copro-provider-contracts/LICENSE +110 -0
- package/packages/copro-provider-contracts/README.md +23 -0
- package/packages/copro-render/LICENSE +110 -0
- package/packages/copro-render/README.md +5 -0
- package/packages/copro-storage/LICENSE +110 -0
- package/packages/copro-storage/README.md +37 -0
- package/packages/copro-templates/LICENSE +110 -0
- package/packages/copro-templates/README.md +52 -0
- package/packages/copro-timeline/LICENSE +110 -0
- package/packages/copro-timeline/README.md +5 -0
- package/packages/copro-ui/LICENSE +110 -0
- package/packages/copro-ui/README.md +7 -0
- package/packages/financial-analytics/README.md +69 -0
- package/packages/iamscene/LICENSE +110 -0
- package/packages/iamscene/README.md +375 -0
- package/packages/identity/.agentsam/features/oauth-login-portal/agentsam.feature.json +1 -1
- package/packages/identity/README.md +1 -1
- package/packages/identity/agentsam.package.json +4 -4
- package/packages/identity/migrations/D1_SCHEMA_MAPPING.md +3 -3
- 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 +15 -7
- package/packages/identity/schema/agentsam.identity/manifest.json +21 -4
- package/packages/identity/src/adapters/account-security-store.js +126 -28
- package/packages/identity/src/adapters/column-support.js +39 -0
- package/packages/identity/src/adapters/iam-compat/index.js +119 -44
- 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/auth-config.js +2 -0
- package/packages/identity/src/contracts/identity-store.js +2 -2
- package/packages/identity/src/core/account-api-key.js +31 -0
- package/packages/identity/src/core/account-security.js +23 -2
- package/packages/identity/src/core/password-gate.js +116 -0
- package/packages/identity/src/core/service-api-key.js +79 -0
- package/packages/identity/src/frontend/auth-portal/README.md +2 -1
- 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/goaude.js +38 -32
- package/packages/identity/src/oauth/native-handoff.js +2 -2
- package/packages/identity/src/recovery/d1-password-reset.js +238 -0
- package/packages/identity/src/server/identity-service.js +15 -3
- package/packages/identity/src/server/mcp-workspace-policy.js +61 -0
- package/packages/identity/src/server/worker-router.js +129 -51
- package/packages/identity/tests/account-api-key.test.mjs +35 -0
- package/packages/identity/tests/account-security.test.mjs +108 -3
- package/packages/identity/tests/d1-password-reset.test.mjs +175 -0
- package/packages/identity/tests/google-desktop-identity-login.test.mjs +65 -35
- package/packages/identity/tests/iam-compat-hosted-migrations.test.mjs +102 -0
- package/packages/identity/tests/identity-portal-e2e.test.mjs +166 -0
- package/packages/identity/tests/identity-service.test.mjs +32 -0
- package/packages/identity/tests/lane1-identity-store-parity.test.mjs +94 -16
- package/packages/identity/tests/lane1-packed-consumer.test.mjs +11 -1
- package/packages/identity/tests/oauth-presets-accounts-ssot.test.mjs +29 -0
- 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/service-api-key.test.mjs +70 -0
- package/packages/identity/tests/session-audit.test.mjs +135 -0
- package/packages/identity/tests/user-oauth-token-owner-migration.test.mjs +72 -0
- package/packages/identity/tests/worker-portal-assets.test.mjs +47 -0
- package/packages/primetech-procedures/LICENSE +110 -0
- package/packages/primetech-procedures/README.md +188 -6
- package/packages/providers/completeful/src/tools.js +3 -4
- package/packages/providers/completeful/test/provider.test.mjs +24 -0
- package/packages/runtime-protocol/src/adapters/agentsamd.js +141 -0
- package/packages/runtime-protocol/src/adapters/execos-legacy.js +39 -0
- package/packages/runtime-protocol/src/adapters/provider-native.js +119 -0
- package/packages/runtime-protocol/src/client.js +299 -0
- package/packages/runtime-protocol/src/dispatch.js +81 -0
- package/packages/runtime-protocol/src/index.js +46 -14
- package/packages/runtime-protocol/src/timeouts.js +25 -0
- package/packages/theme-contract/README.md +5 -0
- package/packages/theme-plain-jane/README.md +42 -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/capabilities/terminal-exec-input.schema.json +2 -2
- package/protocol/contracts/source-types.v2.json +86 -1
- package/protocol/governance/distribution-roadmap.v1.json +2 -2
- package/protocol/models/README.md +9 -6
- package/protocol/models/discovery.mjs +39 -10
- package/protocol/models/workers-ai-curated.mjs +6 -0
- package/protocol/notifications/README.md +3 -3
- package/protocol/plugins/agentsam.plugin-package.v1.schema.json +24 -0
- package/protocol/product-releases/README.md +15 -12
- package/protocol/registry/universal-catalog.v1.json +3092 -0
- package/protocol/runtime/agentsam.runtime.v1.schema.json +1 -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 +322 -0
- package/protocol/sam/run-start.v1.schema.json +40 -0
- package/protocol/sam/run.v1.schema.json +161 -0
- package/protocol/theme-refinery/d1-reconciliation.md +66 -32
- package/protocol/theme-refinery/product-metadata.schema.json +1 -1
- package/python/README.md +121 -18
- 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 +32 -1
- package/python/agentsam_sdk/client.py +165 -31
- package/python/agentsam_sdk/data/d1_bloat.py +0 -1
- package/python/agentsam_sdk/mcp/__init__.py +8 -0
- package/python/agentsam_sdk/mcp/__main__.py +68 -0
- package/python/agentsam_sdk/mcp/server.py +129 -0
- package/python/agentsam_sdk/media/__init__.py +8 -0
- package/python/agentsam_sdk/media/opencv.py +254 -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 +3 -3
- package/python/agentsam_sdk/terminal_art.py +5 -6
- package/python/docs/gaps.md +24 -4
- package/python/docs/tooling.md +4 -4
- package/python/pyproject.toml +5 -1
- package/python/requirements-tui.txt +1 -1
- package/python/scripts/check-dist.py +2 -2
- package/python/tests/fixtures/freecad_host_cases.json +30 -0
- package/python/tests/test_bridge_policy.py +42 -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_cli_distribution.py +3 -0
- package/python/tests/test_mcp_server.py +108 -0
- package/python/tests/test_opencv_media.py +87 -0
- package/python/tests/test_packaging.py +5 -0
- package/python/tests/test_procedure_client.py +6 -0
- package/python/tests/test_public_client.py +97 -2
- 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 +12 -2
- 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 +171 -5
- package/src/acp/agent-executor.js +52 -4
- package/src/acp/client.js +80 -242
- package/src/acp/database-client.js +348 -0
- package/src/acp/dependencies.js +899 -270
- package/src/acp/http.js +47 -0
- package/src/acp/index.js +12 -0
- package/src/acp/queue-executor.js +79 -0
- package/src/acp/runs.js +10 -4
- package/src/acp/runtime-candidates.js +191 -0
- package/src/acp/runtime-registry.js +34 -0
- package/src/acp/runtime-selection.js +35 -9
- package/src/agent/capability-adapter.js +21 -23
- package/src/capabilities/terminal-exec.js +3 -2
- package/src/capabilities/test-run.js +2 -1
- package/src/cli/command-catalog.js +41 -17
- package/src/cli/desktop-launch.js +68 -19
- package/src/cli/dispatch.js +1 -0
- package/src/cli/update-check.js +131 -0
- package/src/cli.js +45 -11
- package/src/commands/account-auth.js +40 -27
- package/src/commands/account-model-inventory.js +84 -0
- package/src/commands/api-key.js +172 -120
- package/src/commands/app-inventory.js +343 -0
- package/src/commands/app.js +174 -34
- package/src/commands/ast.js +80 -0
- package/src/commands/cad.js +2 -0
- package/src/commands/cheat-sheet.js +13 -8
- package/src/commands/cloudflare-login.js +247 -94
- package/src/commands/cloudflare-status.js +38 -0
- package/src/commands/cloudflare.js +76 -54
- package/src/commands/codebaseindex.js +189 -63
- package/src/commands/compute.js +485 -2
- package/src/commands/db.js +471 -41
- package/src/commands/design.js +64 -0
- package/src/commands/document.js +22 -0
- package/src/commands/env.js +16 -6
- package/src/commands/gcloud-auth.js +23 -12
- package/src/commands/go.js +1 -1
- package/src/commands/google-cloud.js +5 -9
- package/src/commands/interactive.js +5 -0
- package/src/commands/knowledge.js +4 -2
- package/src/commands/mcp.js +91 -5
- package/src/commands/models.js +49 -5
- package/src/commands/plugins.js +18 -8
- package/src/commands/preferences.js +48 -6
- package/src/commands/product.js +4 -4
- package/src/commands/providers.js +6 -5
- package/src/commands/python.js +167 -0
- package/src/commands/rc.js +175 -0
- package/src/commands/remote.js +369 -0
- package/src/commands/run.js +39 -18
- package/src/commands/runtime-connect.js +156 -0
- package/src/commands/runtime-status.js +25 -2
- package/src/commands/runtime.js +95 -51
- package/src/commands/setup.js +269 -86
- package/src/commands/shell.js +266 -45
- package/src/commands/skill.js +22 -22
- package/src/commands/terminal.js +30 -144
- package/src/commands/tunnel.js +81 -17
- package/src/commands/update.js +5 -5
- package/src/commands/whoami.js +9 -4
- package/src/commands/workflows.js +213 -0
- 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/index.js +3 -1
- 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 +8 -4
- package/src/knowledge/store-discovery.js +104 -5
- package/src/knowledge/stores/d1.js +206 -0
- package/src/lib/account-session.js +2 -0
- package/src/lib/auth.js +100 -5
- 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.d.ts +1 -1
- package/src/lib/cad/production-operations.js +21 -19
- package/src/lib/cad/project-runtime.js +10 -4
- package/src/lib/cad/project-v2.js +13 -25
- package/src/lib/cad-docker.js +35 -17
- package/src/lib/core-client.js +1 -0
- package/src/lib/design-client.js +68 -0
- package/src/lib/google-desktop-oauth.js +5 -2
- package/src/lib/local-scaffold.js +3 -4
- package/src/lib/local-status.js +2 -1
- package/src/lib/machine-connection.js +120 -0
- package/src/lib/machine-connection.test.js +74 -0
- package/src/lib/provider-credentials.js +64 -18
- package/src/lib/scaffold/mcp-project.js +97 -0
- package/src/lib/scaffold/mcp-server.js +17 -3
- package/src/lib/scaffold/templates/mcp-server/index.js +409 -304
- package/src/lib/scaffold/templates/mcp-server/presets.js +8 -10
- package/src/lib/scaffold/templates/mcp-server/runtime-adapters.js +165 -0
- package/src/lib/scaffold/wizards/mcp-server.js +48 -4
- package/src/lib/setup/runtime-persist.js +12 -8
- package/src/lib/setup/runtime.js +84 -156
- package/src/lib/slash-commands.js +72 -17
- package/src/lib/studio-client.js +81 -0
- package/src/lib/terminal-scopes.js +9 -6
- package/src/lib/whoami-capabilities.js +8 -14
- package/src/local-fs/index.js +29 -2
- package/src/mcp/client.js +18 -10
- package/src/mcp/cloudflare-bundles.js +39 -41
- package/src/mcp/server/account-workspace-policy.js +2 -0
- package/src/mcp/server/index.js +70 -0
- package/src/mcp/server/oauth.js +134 -0
- package/src/mcp/server/studio-host.js +96 -0
- package/src/mcp/server/tools/index.js +81 -0
- package/src/mcp/server/workspace.js +142 -0
- package/src/models/catalog.js +2 -0
- package/src/models/index.js +2 -0
- package/src/models/inventory-core.d.ts +42 -1
- package/src/models/inventory-core.js +120 -38
- package/src/models/media-runtime.d.ts +53 -0
- package/src/models/media-runtime.js +221 -0
- package/src/plugins/cloudflare.js +65 -15
- package/src/plugins/completeful.js +2 -4
- package/src/plugins/contracts.js +60 -6
- package/src/plugins/creative.js +2 -2
- package/src/plugins/index.js +4 -1
- package/src/plugins/primetech-hosted.js +13 -0
- package/src/plugins/registry.js +127 -54
- package/src/plugins/runtime.js +70 -15
- package/src/providers/anthropic-messages.js +7 -3
- package/src/providers/cloudflare-chat.js +5 -2
- package/src/providers/gemini-generate-content.js +8 -20
- package/src/providers/index.js +13 -0
- package/src/providers/multimodal-input.js +181 -0
- package/src/providers/ollama-chat.js +5 -2
- package/src/providers/openai-media.d.ts +18 -0
- package/src/providers/openai-media.js +81 -0
- package/src/providers/openai-responses.js +7 -2
- package/src/registry/generated/inventory.json +432 -96
- package/src/registry/universal-reconcile.js +120 -0
- package/src/registry/universal-source.js +282 -0
- package/src/sam/adapters/audio-transcription.js +122 -0
- package/src/sam/adapters/cloudflare-r2-inventory.js +34 -0
- package/src/sam/adapters/local-script-runtime.js +3 -2
- package/src/sam/adapters/opencv-video.js +293 -0
- package/src/sam/adapters/pdf-document.js +210 -0
- package/src/sam/adapters/tesseract-ocr.js +276 -0
- package/src/sam/adapters/workspace-media.js +15 -2
- package/src/sam/bridge/policy.mjs +50 -0
- package/src/sam/bridge/stdio.mjs +116 -38
- package/src/sam/client.js +48 -84
- package/src/sam/index.js +2 -0
- package/src/sam/model-adapter.js +15 -2
- package/src/sam/operation-packs/generated-v2/background.d.ts +21 -0
- package/src/sam/operation-packs/generated-v2/background.js +6 -0
- package/src/sam/operation-packs/generated-v2/catalog.js +98 -3
- package/src/sam/operation-packs/generated-v2/generated-tool-descriptors.json +98 -3
- package/src/sam/operation-packs/generated-v2/operation-pack.js +2 -2
- package/src/sam/operation-packs/generated-v2/raster.js +54 -13
- package/src/sam/operation-packs/generated-v2/test/background.test.mjs +5 -0
- package/src/sam/operation-packs/generated-v2/test/raster.test.mjs +19 -5
- package/src/sam/operation-packs/generated-v2/test/superbash-client-integration.test.mjs +8 -1
- package/src/sam/operation-packs/generated-v2/tool-types.d.ts +1 -1
- 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/cad-blender-inspect.js +1 -1
- 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/os.js +269 -11
- package/src/sam/packs/cad/index.js +18 -12
- 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/packs/primetech-creative.js +250 -0
- package/src/sam/shell-host.js +141 -18
- package/src/sam/validation.js +3 -0
- package/src/skills/catalog.js +43 -9
- package/src/skills/index.js +3 -1
- package/src/skills/local-store.js +84 -0
- package/src/skills/package-source.js +9 -0
- package/src/skills/registry.js +25 -20
- package/src/tunnel/providers.js +133 -0
- package/src/tunnel/session.js +100 -0
- package/src/ui/boot.js +19 -16
- package/src/ui/brand/agentsam-mark.generated.js +49 -0
- package/src/ui/brand/primetech-mark.generated.js +49 -0
- package/src/ui/cli/brand-profile.js +42 -0
- package/src/ui/cli/prompt-box.js +199 -0
- package/src/ui/home-screen.js +82 -0
- package/src/ui/theme.js +1 -1
- package/docs/acceptance/AGENTSAM_DOCS_CMS_2026-11-10.md +0 -62
- package/docs/agent-briefs/2026-10-28-agent1-ui-product-foundation.md +0 -132
- package/docs/agent-briefs/2026-10-28-agent2-cms-audit.md +0 -144
- package/docs/agent-briefs/2026-10-28-sites-next-wave-acceptance.md +0 -67
- package/packages/primetech-procedures/agentsam.package.json +0 -63
- package/packages/primetech-procedures/package.json +0 -22
- package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/README.md +0 -21
- package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/__pycache__/test_generate_toolpaths.cpython-314.pyc +0 -0
- package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/build_freecad.py +0 -514
- package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/finalize_bundle.py +0 -26
- package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/generate_assets.py +0 -284
- package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/generate_toolpaths.py +0 -715
- package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/package_artifacts.py +0 -154
- package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/parameters.json +0 -51
- package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/procedure.json +0 -101
- package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/render_preview.py +0 -98
- package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/run.py +0 -214
- package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/test_generate_toolpaths.py +0 -50
- package/packages/primetech-procedures/procedures/repo.asset.inventory/__pycache__/run.cpython-312.pyc +0 -0
- package/packages/primetech-procedures/procedures/repo.asset.inventory/procedure.json +0 -65
- package/packages/primetech-procedures/procedures/repo.asset.inventory/run.py +0 -116
- package/packages/primetech-procedures/procedures/repo.asset.inventory/run.sh +0 -11
- package/packages/primetech-procedures/profiles/PRIMETECH_PROCEDURE_ENGINEER.md +0 -25
- package/packages/primetech-procedures/src/index.js +0 -547
- package/packages/primetech-procedures/test/__pycache__/test_inventory.cpython-312.pyc +0 -0
- package/packages/primetech-procedures/test/procedure.test.mjs +0 -207
- package/packages/primetech-procedures/test/test_inventory.py +0 -57
- package/src/commands/start-local.js +0 -98
- package/src/local-fs/capability.js +0 -126
- package/src/local-lsp/host.js +0 -2
- package/src/local-pty/server.js +0 -521
- package/src/ui/art/geaux_boot.json +0 -25
- package/src/ui/companion-art.js +0 -40
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
"""Deterministic OpenCV video preflight and bounded, timecoded frame sampling.
|
|
2
|
+
|
|
3
|
+
The Python API takes a local file path for trusted callers. AgentSam's model-facing
|
|
4
|
+
SAM adapter instead resolves an installation-owned asset, stages its verified
|
|
5
|
+
bytes in a temporary file, and returns scoped derivative IDs—never raw paths.
|
|
6
|
+
OpenCV is an optional extra and is loaded only when this module is used.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import argparse
|
|
12
|
+
import base64
|
|
13
|
+
import json
|
|
14
|
+
import math
|
|
15
|
+
import sys
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
from typing import Any
|
|
18
|
+
|
|
19
|
+
MAX_SAMPLES = 12
|
|
20
|
+
MAX_SOURCE_BYTES = 50 * 1024 * 1024
|
|
21
|
+
MAX_FRAME_PIXELS = 40_000_000
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class OpenCvMediaError(Exception):
|
|
25
|
+
"""Structured media-processing failure with a stable machine-readable code."""
|
|
26
|
+
|
|
27
|
+
def __init__(self, code: str):
|
|
28
|
+
self.code = code
|
|
29
|
+
super().__init__(code)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _opencv() -> Any:
|
|
33
|
+
try:
|
|
34
|
+
import cv2 # type: ignore[import-not-found]
|
|
35
|
+
except ImportError as exc:
|
|
36
|
+
raise OpenCvMediaError("opencv_not_installed") from exc
|
|
37
|
+
return cv2
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _positive_number(value: Any) -> float | None:
|
|
41
|
+
try:
|
|
42
|
+
number = float(value)
|
|
43
|
+
except (TypeError, ValueError):
|
|
44
|
+
return None
|
|
45
|
+
return number if math.isfinite(number) and number > 0 else None
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def _nonnegative_number(value: Any) -> float | None:
|
|
49
|
+
try:
|
|
50
|
+
number = float(value)
|
|
51
|
+
except (TypeError, ValueError):
|
|
52
|
+
return None
|
|
53
|
+
return number if math.isfinite(number) and number >= 0 else None
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _sampling_indices(total: int, count: int) -> list[int]:
|
|
57
|
+
wanted = min(count, total)
|
|
58
|
+
if wanted == 1:
|
|
59
|
+
return [0]
|
|
60
|
+
return sorted({round(index * (total - 1) / (wanted - 1)) for index in range(wanted)})
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def _change_aware_indices(capture: Any, cv2: Any, total: int, count: int) -> list[int]:
|
|
64
|
+
"""Choose scene-change peaks with temporal spread, then fill uniform gaps."""
|
|
65
|
+
wanted = min(count, total)
|
|
66
|
+
if wanted <= 1:
|
|
67
|
+
return [0]
|
|
68
|
+
candidate_count = min(total, max(wanted * 4, 24))
|
|
69
|
+
candidates = _sampling_indices(total, candidate_count)
|
|
70
|
+
previous = None
|
|
71
|
+
scored: list[tuple[float, int]] = []
|
|
72
|
+
for frame_index in candidates:
|
|
73
|
+
if not capture.set(cv2.CAP_PROP_POS_FRAMES, frame_index):
|
|
74
|
+
raise OpenCvMediaError("opencv_video_seek_failed")
|
|
75
|
+
decoded, frame = capture.read()
|
|
76
|
+
if not decoded or frame is None:
|
|
77
|
+
raise OpenCvMediaError("opencv_video_decode_failed")
|
|
78
|
+
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
|
|
79
|
+
source_h, source_w = gray.shape[:2]
|
|
80
|
+
thumb_w = min(96, source_w)
|
|
81
|
+
thumb_h = max(1, round(source_h * thumb_w / source_w))
|
|
82
|
+
thumbnail = cv2.resize(gray, (thumb_w, thumb_h), interpolation=cv2.INTER_AREA)
|
|
83
|
+
score = 0.0 if previous is None else float(cv2.absdiff(previous, thumbnail).mean()) / 255.0
|
|
84
|
+
scored.append((score, frame_index))
|
|
85
|
+
previous = thumbnail
|
|
86
|
+
selected = {candidates[0], candidates[-1]}
|
|
87
|
+
minimum_gap = max(1, total // max(2, wanted))
|
|
88
|
+
for score, frame_index in sorted(scored, key=lambda item: (-item[0], item[1])):
|
|
89
|
+
if len(selected) >= wanted:
|
|
90
|
+
break
|
|
91
|
+
if all(abs(frame_index - chosen) >= minimum_gap for chosen in selected):
|
|
92
|
+
selected.add(frame_index)
|
|
93
|
+
for frame_index in _sampling_indices(total, wanted):
|
|
94
|
+
if len(selected) >= wanted:
|
|
95
|
+
break
|
|
96
|
+
selected.add(frame_index)
|
|
97
|
+
return sorted(selected)[:wanted]
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def inspect_video(
|
|
101
|
+
source: str | Path,
|
|
102
|
+
*,
|
|
103
|
+
sample_count: int = 8,
|
|
104
|
+
max_width: int = 640,
|
|
105
|
+
jpeg_quality: int = 76,
|
|
106
|
+
include_frames: bool = False,
|
|
107
|
+
sampling_strategy: str = 'change_aware',
|
|
108
|
+
) -> dict[str, Any]:
|
|
109
|
+
"""Probe a video and compare selected frames without inferring their meaning.
|
|
110
|
+
|
|
111
|
+
`visual_change_score` is the normalized mean absolute grayscale difference
|
|
112
|
+
between consecutive *sampled* frames. It is not optical-flow magnitude,
|
|
113
|
+
actual UI motion, or proof of a scene transition. FPS/duration supplied by
|
|
114
|
+
video containers may be approximate (notably variable-frame-rate media).
|
|
115
|
+
"""
|
|
116
|
+
if type(sample_count) is not int or not 1 <= sample_count <= MAX_SAMPLES:
|
|
117
|
+
raise OpenCvMediaError("opencv_invalid_sample_count")
|
|
118
|
+
if type(max_width) is not int or not 64 <= max_width <= 960:
|
|
119
|
+
raise OpenCvMediaError("opencv_invalid_max_width")
|
|
120
|
+
if type(jpeg_quality) is not int or not 40 <= jpeg_quality <= 90:
|
|
121
|
+
raise OpenCvMediaError("opencv_invalid_jpeg_quality")
|
|
122
|
+
if type(include_frames) is not bool:
|
|
123
|
+
raise OpenCvMediaError("opencv_invalid_frame_mode")
|
|
124
|
+
if sampling_strategy not in ('uniform', 'change_aware'):
|
|
125
|
+
raise OpenCvMediaError("opencv_invalid_sampling_strategy")
|
|
126
|
+
|
|
127
|
+
path = Path(source)
|
|
128
|
+
try:
|
|
129
|
+
size = path.stat().st_size
|
|
130
|
+
except (OSError, ValueError) as exc:
|
|
131
|
+
raise OpenCvMediaError("opencv_video_not_found") from exc
|
|
132
|
+
if not path.is_file() or not 0 < size <= MAX_SOURCE_BYTES:
|
|
133
|
+
raise OpenCvMediaError("opencv_video_invalid_or_oversized")
|
|
134
|
+
|
|
135
|
+
cv2 = _opencv()
|
|
136
|
+
capture = cv2.VideoCapture(str(path))
|
|
137
|
+
if not capture.isOpened():
|
|
138
|
+
capture.release()
|
|
139
|
+
raise OpenCvMediaError("opencv_video_open_failed")
|
|
140
|
+
try:
|
|
141
|
+
width = _positive_number(capture.get(cv2.CAP_PROP_FRAME_WIDTH))
|
|
142
|
+
height = _positive_number(capture.get(cv2.CAP_PROP_FRAME_HEIGHT))
|
|
143
|
+
fps = _positive_number(capture.get(cv2.CAP_PROP_FPS))
|
|
144
|
+
frame_count = _positive_number(capture.get(cv2.CAP_PROP_FRAME_COUNT))
|
|
145
|
+
if not width or not height or int(width) * int(height) > MAX_FRAME_PIXELS:
|
|
146
|
+
raise OpenCvMediaError("opencv_video_invalid_dimensions")
|
|
147
|
+
# Fail closed rather than inventing times/frames when container metadata
|
|
148
|
+
# is missing. FFprobe can be used separately to diagnose VFR recordings.
|
|
149
|
+
if not frame_count or frame_count > 100_000_000:
|
|
150
|
+
raise OpenCvMediaError("opencv_video_frame_count_unavailable")
|
|
151
|
+
total = int(frame_count)
|
|
152
|
+
samples: list[dict[str, Any]] = []
|
|
153
|
+
previous_gray = None
|
|
154
|
+
previous_actual_ms = None
|
|
155
|
+
decoded_indices: list[int] = []
|
|
156
|
+
selected_indices = (_change_aware_indices(capture, cv2, total, sample_count)
|
|
157
|
+
if sampling_strategy == 'change_aware'
|
|
158
|
+
else _sampling_indices(total, sample_count))
|
|
159
|
+
for frame_index in selected_indices:
|
|
160
|
+
if not capture.set(cv2.CAP_PROP_POS_FRAMES, frame_index):
|
|
161
|
+
raise OpenCvMediaError("opencv_video_seek_failed")
|
|
162
|
+
decoded, frame = capture.read()
|
|
163
|
+
if not decoded or frame is None:
|
|
164
|
+
raise OpenCvMediaError("opencv_video_decode_failed")
|
|
165
|
+
if not hasattr(frame, "shape") or frame.shape[0] * frame.shape[1] > MAX_FRAME_PIXELS:
|
|
166
|
+
raise OpenCvMediaError("opencv_video_frame_invalid")
|
|
167
|
+
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
|
|
168
|
+
height_gray, width_gray = gray.shape[:2]
|
|
169
|
+
thumb_w = min(96, width_gray)
|
|
170
|
+
thumb_h = max(1, round(height_gray * thumb_w / width_gray))
|
|
171
|
+
thumbnail = cv2.resize(gray, (thumb_w, thumb_h), interpolation=cv2.INTER_AREA)
|
|
172
|
+
visual_change_score = None
|
|
173
|
+
if previous_gray is not None:
|
|
174
|
+
previous_at_size = cv2.resize(previous_gray, (thumb_w, thumb_h), interpolation=cv2.INTER_AREA)
|
|
175
|
+
visual_change_score = round(float(cv2.absdiff(previous_at_size, thumbnail).mean()) / 255.0, 5)
|
|
176
|
+
previous_gray = thumbnail
|
|
177
|
+
# Prefer the decoder's presentation position. Fall back to nominal FPS
|
|
178
|
+
# only when the container/codec does not expose a monotonic timecode.
|
|
179
|
+
position_ms = _nonnegative_number(capture.get(cv2.CAP_PROP_POS_MSEC))
|
|
180
|
+
actual_ms = round(position_ms) if position_ms is not None and (
|
|
181
|
+
previous_actual_ms is None or position_ms > previous_actual_ms
|
|
182
|
+
) else None
|
|
183
|
+
if actual_ms is not None:
|
|
184
|
+
timestamp_ms = actual_ms
|
|
185
|
+
timestamp_estimated = False
|
|
186
|
+
previous_actual_ms = position_ms
|
|
187
|
+
else:
|
|
188
|
+
timestamp_ms = round(frame_index / fps * 1000) if fps else None
|
|
189
|
+
timestamp_estimated = True
|
|
190
|
+
sample: dict[str, Any] = {
|
|
191
|
+
"frame_index": frame_index,
|
|
192
|
+
"timestamp_ms": timestamp_ms,
|
|
193
|
+
"timestamp_estimated": timestamp_estimated,
|
|
194
|
+
"visual_change_score": visual_change_score,
|
|
195
|
+
}
|
|
196
|
+
if include_frames:
|
|
197
|
+
frame_height, frame_width = frame.shape[:2]
|
|
198
|
+
if frame_width > max_width:
|
|
199
|
+
target_height = max(1, round(frame_height * max_width / frame_width))
|
|
200
|
+
frame = cv2.resize(frame, (max_width, target_height), interpolation=cv2.INTER_AREA)
|
|
201
|
+
encoded, jpeg = cv2.imencode(".jpg", frame, [int(cv2.IMWRITE_JPEG_QUALITY), jpeg_quality])
|
|
202
|
+
if not encoded:
|
|
203
|
+
raise OpenCvMediaError("opencv_frame_encode_failed")
|
|
204
|
+
sample["jpeg_base64"] = base64.b64encode(jpeg.tobytes()).decode("ascii")
|
|
205
|
+
samples.append(sample)
|
|
206
|
+
decoded_indices.append(frame_index)
|
|
207
|
+
return {
|
|
208
|
+
"schema": "agentsam.media.opencv-video.v1",
|
|
209
|
+
"ok": True,
|
|
210
|
+
"engine": "opencv",
|
|
211
|
+
"video": {
|
|
212
|
+
"width": int(width), "height": int(height),
|
|
213
|
+
"fps_nominal": round(fps, 5) if fps else None,
|
|
214
|
+
"frame_count_reported": total,
|
|
215
|
+
"duration_ms_estimated": round(total / fps * 1000) if fps else None,
|
|
216
|
+
},
|
|
217
|
+
"sampling": {
|
|
218
|
+
"requested": sample_count,
|
|
219
|
+
"decoded": len(decoded_indices),
|
|
220
|
+
"strategy": "change_aware_peaks" if sampling_strategy == "change_aware" else "uniform_frame_indices",
|
|
221
|
+
"candidate_count": min(total, max(min(sample_count, total) * 4, 24)) if sampling_strategy == "change_aware" else len(selected_indices),
|
|
222
|
+
},
|
|
223
|
+
"samples": samples,
|
|
224
|
+
"limitations": [
|
|
225
|
+
"Timestamps and duration use nominal FPS and may be inaccurate for variable-frame-rate video.",
|
|
226
|
+
"Visual change scores compare sampled frames; they do not identify objects, motion direction, or UI behavior.",
|
|
227
|
+
],
|
|
228
|
+
}
|
|
229
|
+
finally:
|
|
230
|
+
capture.release()
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
def main(argv: list[str] | None = None) -> int:
|
|
234
|
+
parser = argparse.ArgumentParser(description="Inspect a trusted local video with optional OpenCV")
|
|
235
|
+
parser.add_argument("--input", required=True, dest="source")
|
|
236
|
+
parser.add_argument("--samples", type=int, default=8)
|
|
237
|
+
parser.add_argument("--width", type=int, default=640)
|
|
238
|
+
parser.add_argument("--quality", type=int, default=76)
|
|
239
|
+
parser.add_argument("--strategy", choices=("uniform", "change_aware"), default="change_aware")
|
|
240
|
+
parser.add_argument("--include-frames", action="store_true")
|
|
241
|
+
args = parser.parse_args(argv)
|
|
242
|
+
try:
|
|
243
|
+
result = inspect_video(args.source, sample_count=args.samples, max_width=args.width,
|
|
244
|
+
jpeg_quality=args.quality, include_frames=args.include_frames,
|
|
245
|
+
sampling_strategy=args.strategy)
|
|
246
|
+
except OpenCvMediaError as error:
|
|
247
|
+
print(json.dumps({"ok": False, "code": error.code}), file=sys.stderr)
|
|
248
|
+
return 2
|
|
249
|
+
print(json.dumps(result, separators=(",", ":")))
|
|
250
|
+
return 0
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
if __name__ == "__main__":
|
|
254
|
+
raise SystemExit(main())
|
|
@@ -43,7 +43,7 @@ class ProcedureClient:
|
|
|
43
43
|
error = result.get("error") or {}
|
|
44
44
|
code = error.get("code") if isinstance(error, dict) else str(error)
|
|
45
45
|
raise ProcedureClientError(code or "primetech_procedure_failed")
|
|
46
|
-
payload = result.get("data") if result.get("schema")
|
|
46
|
+
payload = result.get("data") if result.get("schema") in ("sam.result.v1", "agentsam.result.v1") else result
|
|
47
47
|
if not isinstance(payload, dict) or payload.get("schema") != "inneranimalmedia.primetech.procedure-run.v1":
|
|
48
48
|
raise ProcedureClientError("primetech_procedure_response_invalid")
|
|
49
49
|
if payload.get("status") != "completed" or not (payload.get("verification") or {}).get("ok"):
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Read the actual Python argparse CLI without importing application code.
|
|
3
|
+
|
|
4
|
+
Used by the SDK universal registry generator. No runtime credentials, site state,
|
|
5
|
+
or repository-specific command lists. Python 3.10+ stdlib only.
|
|
6
|
+
"""
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import ast
|
|
10
|
+
import json
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
ROOT = Path(__file__).resolve().parent
|
|
14
|
+
CLI = ROOT / "cli.py"
|
|
15
|
+
PACKAGE = ROOT / "__init__.py"
|
|
16
|
+
PROJECT = ROOT.parent / "pyproject.toml"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _literal(node):
|
|
20
|
+
try:
|
|
21
|
+
return ast.literal_eval(node)
|
|
22
|
+
except (ValueError, TypeError, SyntaxError):
|
|
23
|
+
return None
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def inventory():
|
|
27
|
+
tree = ast.parse(CLI.read_text(encoding="utf-8"), filename=str(CLI))
|
|
28
|
+
parser = next(
|
|
29
|
+
node for node in tree.body
|
|
30
|
+
if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef))
|
|
31
|
+
and node.name == "build_parser"
|
|
32
|
+
)
|
|
33
|
+
# argparse builder variables represent a tree, not a flat list.
|
|
34
|
+
parsers = {"ap": ()}
|
|
35
|
+
subparsers = {}
|
|
36
|
+
candidates = {}
|
|
37
|
+
leaves = set()
|
|
38
|
+
for node in ast.walk(parser):
|
|
39
|
+
if isinstance(node, ast.Assign) and len(node.targets) == 1:
|
|
40
|
+
target = node.targets[0]
|
|
41
|
+
if not isinstance(target, ast.Name) or not isinstance(node.value, ast.Call):
|
|
42
|
+
continue
|
|
43
|
+
call = node.value
|
|
44
|
+
if not isinstance(call.func, ast.Attribute) or not isinstance(call.func.value, ast.Name):
|
|
45
|
+
continue
|
|
46
|
+
owner = call.func.value.id
|
|
47
|
+
if call.func.attr == "add_subparsers" and owner in parsers:
|
|
48
|
+
subparsers[target.id] = parsers[owner]
|
|
49
|
+
elif call.func.attr == "add_parser" and owner in subparsers and call.args:
|
|
50
|
+
segment = _literal(call.args[0])
|
|
51
|
+
if not isinstance(segment, str) or not segment:
|
|
52
|
+
continue
|
|
53
|
+
path = subparsers[owner] + (segment,)
|
|
54
|
+
parsers[target.id] = path
|
|
55
|
+
help_text = next((_literal(k.value) for k in call.keywords if k.arg == "help"), "")
|
|
56
|
+
candidates[target.id] = {"words": list(path), "description": help_text or ""}
|
|
57
|
+
elif isinstance(node, ast.Call) and isinstance(node.func, ast.Attribute):
|
|
58
|
+
if node.func.attr == "set_defaults" and isinstance(node.func.value, ast.Name):
|
|
59
|
+
if any(k.arg == "func" for k in node.keywords):
|
|
60
|
+
leaves.add(node.func.value.id)
|
|
61
|
+
commands = [candidates[name] for name in sorted(leaves) if name in candidates]
|
|
62
|
+
commands.sort(key=lambda row: tuple(row["words"]))
|
|
63
|
+
if not commands or len({tuple(row["words"]) for row in commands}) != len(commands):
|
|
64
|
+
raise RuntimeError("Python CLI leaf dispatch could not be enumerated unambiguously")
|
|
65
|
+
package_tree = ast.parse(PACKAGE.read_text(encoding="utf-8"), filename=str(PACKAGE))
|
|
66
|
+
version = next(
|
|
67
|
+
(_literal(node.value) for node in package_tree.body
|
|
68
|
+
if isinstance(node, ast.Assign)
|
|
69
|
+
and any(isinstance(t, ast.Name) and t.id == "__version__" for t in node.targets)),
|
|
70
|
+
None,
|
|
71
|
+
)
|
|
72
|
+
project_text = PROJECT.read_text(encoding="utf-8")
|
|
73
|
+
if 'name = "agentsam-sdk"' not in project_text or 'agentsam-py = "agentsam_sdk.cli:main"' not in project_text:
|
|
74
|
+
raise RuntimeError("Python distribution or console-script entrypoint changed")
|
|
75
|
+
if not isinstance(version, str) or not version:
|
|
76
|
+
raise RuntimeError("Python distribution version unavailable")
|
|
77
|
+
return {
|
|
78
|
+
"schema": "agentsam.python-cli-source.v1",
|
|
79
|
+
"package": "agentsam-sdk",
|
|
80
|
+
"version": version,
|
|
81
|
+
"executable": "agentsam-py",
|
|
82
|
+
"source": "python/agentsam_sdk/cli.py",
|
|
83
|
+
"commands": commands,
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
if __name__ == "__main__":
|
|
88
|
+
print(json.dumps(inventory(), indent=2, ensure_ascii=False))
|
|
@@ -32,8 +32,8 @@ from .contract import ToolInput, ToolResult
|
|
|
32
32
|
LOG = logging.getLogger(__name__)
|
|
33
33
|
|
|
34
34
|
MAX_FILE_BYTES = 512 * 1024
|
|
35
|
-
DEFAULT_TIMEOUT_MS =
|
|
36
|
-
MAX_TIMEOUT_MS =
|
|
35
|
+
DEFAULT_TIMEOUT_MS = 1_800_000
|
|
36
|
+
MAX_TIMEOUT_MS = 7_200_000
|
|
37
37
|
DEFAULT_OUTPUT_BYTES = 512 * 1024
|
|
38
38
|
MAX_OUTPUT_BYTES = 2 * 1024 * 1024
|
|
39
39
|
MAX_SCRIPT_ARGS = 128
|
|
@@ -902,7 +902,7 @@ class NativeRuntime:
|
|
|
902
902
|
"status": "completed" if error_code is None else "failed",
|
|
903
903
|
}
|
|
904
904
|
response: dict[str, Any] = {
|
|
905
|
-
"schema": "
|
|
905
|
+
"schema": "agentsam.result.v1",
|
|
906
906
|
"operation": operation,
|
|
907
907
|
"ok": error_code is None,
|
|
908
908
|
"data": result_data if error_code is None or (operation == "terminal.exec" and error_code == "sam_operation_failed") else None,
|
|
@@ -9,7 +9,7 @@ import json
|
|
|
9
9
|
import os
|
|
10
10
|
import shutil
|
|
11
11
|
import sys
|
|
12
|
-
from importlib import
|
|
12
|
+
from importlib import resources
|
|
13
13
|
from pathlib import Path
|
|
14
14
|
from typing import Any
|
|
15
15
|
|
|
@@ -51,11 +51,10 @@ def render_half_block(grid: list[str], *, color: bool) -> str:
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
def version_string() -> str:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return __version__
|
|
54
|
+
# __version__ is also what setuptools stamps into wheel metadata, so they agree for real
|
|
55
|
+
# installs; reading it directly keeps a stale editable install from reporting an old version.
|
|
56
|
+
from . import __version__
|
|
57
|
+
return __version__
|
|
59
58
|
|
|
60
59
|
|
|
61
60
|
def boot_header(*, width: int | None = None, color: bool | None = None) -> str:
|
package/python/docs/gaps.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
# AgentSam Python SDK — integration status (2026-11-29)
|
|
2
|
+
|
|
3
|
+
## Unified SDK integration delivered in this work
|
|
4
|
+
|
|
5
|
+
- The Python distribution no longer claims the `agentsam` executable. Its standalone fallback is `agentsam-py`; the Node CLI owns `agentsam` and exposes Python under `agentsam py`.
|
|
6
|
+
- `agentsam py install` manages one environment at `~/.venvs/agentsam-sdk`, installs the MCP extra by default, and removes the legacy Python `agentsam` launcher so an activated venv cannot shadow the Node CLI.
|
|
7
|
+
- `AgentSamClient` keeps Python-native operations native, while account context, model inventory, and Agent Control Plane calls use the canonical Node bridge and Local Studio host manifest.
|
|
8
|
+
- The Node bridge resolves the same local account authority as the Node CLI. The bearer credential stays inside the Node process; the Python runtime does not receive a copied OAuth/API-key secret.
|
|
9
|
+
- Local Studio's Agent Control Plane now accepts verified `agentsam_api_key` authorities only when they carry both `agentsam:context` and `models:invoke`; browser OAuth remains supported.
|
|
10
|
+
|
|
11
|
+
## Remaining integration gaps (do not describe these as complete)
|
|
12
|
+
|
|
13
|
+
1. `ProcedureClient` still requires an explicitly registered trusted procedure invoker; PrimeTech procedure execution is not automatically connected by the shared ACP bridge.
|
|
14
|
+
2. `CadJobClient` still requires a trusted CAD host invoker. Python-native CAD remains available, but hosted CAD job submission is not automatically wired.
|
|
15
|
+
3. `D1Adapter` still uses Wrangler and explicit database configuration. It does not yet resolve a connected Cloudflare plugin grant and remote D1 resource through the shared host authority.
|
|
16
|
+
4. Python's local capability discovery and `invoke()` remain limited to native operations and the Node bridge's explicitly opted-in safe stdio operations. Privileged hosted operations must go through authenticated ACP or a dedicated host adapter.
|
|
17
|
+
5. Project/workspace/artifact CRUD is not yet exposed as a complete Python facade over the same host-owned records.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
1
21
|
# agentsam-sdk — D1 audit port: status
|
|
2
22
|
|
|
3
23
|
Tracks the file list from `plans/active/CLAUDE-AGENTSAM-SDK-D1-AUDIT-PORT-HANDOFF-2026-08.md`.
|
|
@@ -9,16 +29,16 @@ the minimal scaffold from zero, then ports P0.
|
|
|
9
29
|
|
|
10
30
|
Host tools (jq, wrangler, Python): see `docs/tooling.md` + `scripts/check-host-tooling.sh`.
|
|
11
31
|
|
|
12
|
-
## P0 — whole-D1 / agentsam walkers
|
|
32
|
+
## P0 — whole-D1 / agentsam py walkers
|
|
13
33
|
|
|
14
34
|
| Legacy script | SDK target | Status |
|
|
15
35
|
|---|---|---|
|
|
16
36
|
| `scripts/d1_bloat_audit.py` | `agentsam_sdk.data.d1_bloat` | **Ported + aligned (2026-08).** Database-scoped: `--quick` = all tables COUNT(*); `--full` = text LENGTH + briefing. Removed `QUICK_TABLE_RE` / `SKIP_COL_RE` / `--count-only`. Deferred: `--email`/Resend (CLI/ops layer). |
|
|
17
|
-
| `scripts/run-d1-bloat-audit.sh` | `agentsam data d1-bloat` via CLI | **Shimmed**, see below — legacy `npm run audit:d1-bloat*` scripts still work unchanged. GCP-fallback/nohup wrapper behavior not reimplemented in the SDK itself (that's operational, not tool logic); still available via the legacy `.sh`. |
|
|
37
|
+
| `scripts/run-d1-bloat-audit.sh` | `agentsam py data d1-bloat` via CLI | **Shimmed**, see below — legacy `npm run audit:d1-bloat*` scripts still work unchanged. GCP-fallback/nohup wrapper behavior not reimplemented in the SDK itself (that's operational, not tool logic); still available via the legacy `.sh`. |
|
|
18
38
|
| `scripts/walk_agentsam_tables.py` | `agentsam_sdk.data.agentsam_walk` | **Ported, condensed.** Schema/indexes/FKs/row-count/freshness/capability-grouping all present. Not byte-for-byte: duplicate-table detection and some staleness heuristics from the 801-line original are deferred. |
|
|
19
39
|
| `scripts/d1_schema_audit.py` | folded into `agentsam_walk` (schema slice) | **Partially folded.** The capability-grouping + schema dump is covered by `agentsam_walk`. NOT ported: the per-feature markdown chunking into 14 separate `db/agentsam-*.md` files, and the curated `TABLE_META` purpose annotations (760+ lines of hand-written table descriptions) -- that's product documentation content, not audit logic, and belongs in a follow-up pass, not this one. Also note: the legacy script hardcoded a D1 database id as a fallback default (`D1_DATABASE_ID = os.environ.get("D1_DATABASE_ID", "cf87b717-...")`) -- **do not carry that forward**; the new adapter has no such fallback (HARD LAW). |
|
|
20
40
|
|
|
21
|
-
## P1 — agentsam quality / wiring (not started this pass)
|
|
41
|
+
## P1 — agentsam py quality / wiring (not started this pass)
|
|
22
42
|
|
|
23
43
|
`audit_agentsam_full.py`, `agentsam_db_deep_audit.py`, `audit_agentsam_tables.py`,
|
|
24
44
|
`audit_agentsam_schema.py`, `audit_agentsam_table_usage.py`,
|
|
@@ -30,7 +50,7 @@ scope boundary for this pass was P0 only, per the handoff doc's file list.
|
|
|
30
50
|
| Legacy script | SDK target | Status |
|
|
31
51
|
|---|---|---|
|
|
32
52
|
| `scripts/repo-size-inventory.py` (main) / `repo_inventory.py` | `agentsam_sdk.repository.inventory` | **Ported** (category + byte sizes + largest files + extension rollups; jq-friendly JSON; stub fields `by_extension` / `by_top_level_dir` retained). |
|
|
33
|
-
| `tools/scan_bloat.py` (IAM shim) | `agentsam_sdk.repository.scan_bloat` | **Ported.** Per-file KB/lines/est. tokens; CLI `agentsam repository scan-bloat`. D1: `agentsam_scripts.slug=scan_bloat` (not `agentsam_commands`). |
|
|
53
|
+
| `tools/scan_bloat.py` (IAM shim) | `agentsam_sdk.repository.scan_bloat` | **Ported.** Per-file KB/lines/est. tokens; CLI `agentsam py repository scan-bloat`. D1: `agentsam_scripts.slug=scan_bloat` (not `agentsam_commands`). |
|
|
34
54
|
| `repo_cleanup_classify.py`, `repo-cleanup.py` | `agentsam_sdk.repository.cleanup_plan` | **Not started** |
|
|
35
55
|
| `audit_dead_code.py` | `agentsam_sdk.repository.dead_paths` | **Not started** |
|
|
36
56
|
| `audit_hardcoded_identity.py`, `guard-no-hardcoded-identity.sh` | `agentsam_sdk.readiness.boundaries` | **Not started** |
|
package/python/docs/tooling.md
CHANGED
|
@@ -36,11 +36,11 @@ From `agentsam-sdk/`:
|
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
38
|
# category row for docs
|
|
39
|
-
agentsam repository inventory --repo-root .. --format json \
|
|
39
|
+
agentsam py repository inventory --repo-root .. --format json \
|
|
40
40
|
| jq '.data.categories[] | select(.id=="docs")'
|
|
41
41
|
|
|
42
42
|
# top 10 largest files
|
|
43
|
-
agentsam repository inventory --repo-root .. --format json \
|
|
43
|
+
agentsam py repository inventory --repo-root .. --format json \
|
|
44
44
|
| jq '.data.largest_files[:10]'
|
|
45
45
|
|
|
46
46
|
# totals only
|
|
@@ -54,14 +54,14 @@ jq '.by_extension | to_entries | map(select(.value > 100))' \
|
|
|
54
54
|
## jq recipes (per-file source bloat)
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
agentsam repository scan-bloat --root src --min-kb 10 --top 50 --json-envelope \
|
|
57
|
+
agentsam py repository scan-bloat --root src --min-kb 10 --top 50 --json-envelope \
|
|
58
58
|
| jq -r '.files[] | "\(.size_kb)KB\t\(.path)"'
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
## jq recipes (D1 audits)
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
|
-
agentsam data d1-bloat --db "$AGENTSAM_D1_DB_NAME" --quick --format json \
|
|
64
|
+
agentsam py data d1-bloat --db "$AGENTSAM_D1_DB_NAME" --quick --format json \
|
|
65
65
|
--output-dir /tmp/d1-bloat
|
|
66
66
|
jq '.data.tables[:10] | .[] | {name, rows}' /tmp/d1-bloat/*.json 2>/dev/null \
|
|
67
67
|
|| jq '.' /tmp/d1-bloat/receipt-*.json | head
|
package/python/pyproject.toml
CHANGED
|
@@ -27,6 +27,10 @@ classifiers = [
|
|
|
27
27
|
]
|
|
28
28
|
dependencies = ["rich>=13.7,<15"]
|
|
29
29
|
|
|
30
|
+
[project.optional-dependencies]
|
|
31
|
+
opencv = ["opencv-python-headless>=4.10,<5"]
|
|
32
|
+
mcp = ["mcp>=2.3,<3"]
|
|
33
|
+
|
|
30
34
|
[project.urls]
|
|
31
35
|
Homepage = "https://github.com/SamPrimeaux/agentsam-sdk"
|
|
32
36
|
Repository = "https://github.com/SamPrimeaux/agentsam-sdk"
|
|
@@ -34,7 +38,7 @@ Issues = "https://github.com/SamPrimeaux/agentsam-sdk/issues"
|
|
|
34
38
|
npm = "https://www.npmjs.com/package/@inneranimalmedia/agentsam-sdk"
|
|
35
39
|
|
|
36
40
|
[project.scripts]
|
|
37
|
-
agentsam = "agentsam_sdk.cli:main"
|
|
41
|
+
agentsam-py = "agentsam_sdk.cli:main"
|
|
38
42
|
|
|
39
43
|
[tool.setuptools.dynamic]
|
|
40
44
|
version = { attr = "agentsam_sdk.__version__" }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
rich>=13.7.0
|
|
1
|
+
rich>=13.7.0,<15
|
|
@@ -39,8 +39,8 @@ def main() -> int:
|
|
|
39
39
|
if required not in names:
|
|
40
40
|
errors.append(f"{whl.name}: built-in CLI asset missing: {required}")
|
|
41
41
|
entry = next((z.read(n).decode() for n in names if n.endswith("entry_points.txt")), "")
|
|
42
|
-
if "agentsam = agentsam_sdk.cli:main" not in entry:
|
|
43
|
-
errors.append(f"{whl.name}: console script `agentsam` missing")
|
|
42
|
+
if "agentsam-py = agentsam_sdk.cli:main" not in entry:
|
|
43
|
+
errors.append(f"{whl.name}: console script `agentsam-py` missing")
|
|
44
44
|
if not any(n.endswith("licenses/LICENSE") or n.endswith("LICENSE") for n in names):
|
|
45
45
|
errors.append(f"{whl.name}: LICENSE not included")
|
|
46
46
|
if not any(n == "agentsam_sdk/py.typed" for n in names):
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_doc": "Replayed by python/tests/test_cad_native.py and test/cad-freecad-host.test.mjs so the two discovery implementations cannot drift. `files` is the set of paths that exist; `which` maps PATH lookups.",
|
|
3
|
+
"cases": [
|
|
4
|
+
{"name": "macOS bundle python wins over bundle FreeCADCmd", "platform": "darwin", "env": {"HOME": "/Users/u"},
|
|
5
|
+
"files": ["/Applications/FreeCAD.app/Contents/Resources/bin/python", "/Applications/FreeCAD.app/Contents/Resources/bin/freecadcmd"], "which": {},
|
|
6
|
+
"expect": {"executable": "/Applications/FreeCAD.app/Contents/Resources/bin/python", "mode": "python", "platform": "darwin", "source": "native_bundle", "library_dir": "/Applications/FreeCAD.app/Contents/Resources/lib"}},
|
|
7
|
+
{"name": "macOS 1.x bundle with only lowercase freecadcmd", "platform": "darwin", "env": {"HOME": "/Users/u"},
|
|
8
|
+
"files": ["/Applications/FreeCAD.app/Contents/Resources/bin/freecadcmd"], "which": {},
|
|
9
|
+
"expect": {"executable": "/Applications/FreeCAD.app/Contents/Resources/bin/freecadcmd", "mode": "command", "platform": "darwin", "source": "native_bundle", "library_dir": "/Applications/FreeCAD.app/Contents/Resources/lib"}},
|
|
10
|
+
{"name": "macOS user-level ~/Applications install", "platform": "darwin", "env": {"HOME": "/Users/u"},
|
|
11
|
+
"files": ["/Users/u/Applications/FreeCAD.app/Contents/Resources/bin/python"], "which": {},
|
|
12
|
+
"expect": {"executable": "/Users/u/Applications/FreeCAD.app/Contents/Resources/bin/python", "mode": "python", "platform": "darwin", "source": "native_bundle", "library_dir": "/Users/u/Applications/FreeCAD.app/Contents/Resources/lib"}},
|
|
13
|
+
{"name": "AGENTSAM_FREECAD_HOME beats the system bundle", "platform": "darwin", "env": {"HOME": "/Users/u", "AGENTSAM_FREECAD_HOME": "/opt/fc"},
|
|
14
|
+
"files": ["/opt/fc/bin/python", "/Applications/FreeCAD.app/Contents/Resources/bin/python"], "which": {},
|
|
15
|
+
"expect": {"executable": "/opt/fc/bin/python", "mode": "python", "platform": "darwin", "source": "native_bundle", "library_dir": "/opt/fc/lib"}},
|
|
16
|
+
{"name": "Linux lib64 layout uses system python3", "platform": "linux", "env": {},
|
|
17
|
+
"files": ["/usr/lib64/freecad/lib/FreeCAD.so", "/usr/bin/python3"], "which": {"python3": "/usr/bin/python3"},
|
|
18
|
+
"expect": {"executable": "/usr/bin/python3", "mode": "python", "platform": "linux", "source": "system_python", "library_dir": "/usr/lib64/freecad/lib"}},
|
|
19
|
+
{"name": "Linux with only freecadcmd on PATH is command mode", "platform": "linux", "env": {},
|
|
20
|
+
"files": ["/usr/bin/freecadcmd"], "which": {"freecadcmd": "/usr/bin/freecadcmd"},
|
|
21
|
+
"expect": {"executable": "/usr/bin/freecadcmd", "mode": "command", "platform": "linux", "source": "path", "library_dir": null}},
|
|
22
|
+
{"name": "explicit AGENTSAM_FREECAD_PYTHON override", "platform": "linux", "env": {"AGENTSAM_FREECAD_PYTHON": "/custom/py", "AGENTSAM_FREECAD_LIB": "/custom/lib"},
|
|
23
|
+
"files": ["/custom/py", "/usr/bin/freecadcmd"], "which": {"freecadcmd": "/usr/bin/freecadcmd"},
|
|
24
|
+
"expect": {"executable": "/custom/py", "mode": "python", "platform": "linux", "source": "environment", "library_dir": "/custom/lib"}},
|
|
25
|
+
{"name": "explicit AGENTSAM_FREECAD_CMD override", "platform": "linux", "env": {"AGENTSAM_FREECAD_CMD": "/custom/fcmd"},
|
|
26
|
+
"files": ["/custom/fcmd"], "which": {},
|
|
27
|
+
"expect": {"executable": "/custom/fcmd", "mode": "command", "platform": "linux", "source": "environment", "library_dir": null}},
|
|
28
|
+
{"name": "nothing installed", "platform": "linux", "env": {}, "files": [], "which": {}, "expect": null}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""Pure-Python distribution/bridge-configuration tests: no Node installation required."""
|
|
2
|
+
import unittest
|
|
3
|
+
from tempfile import TemporaryDirectory
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from unittest.mock import patch
|
|
6
|
+
|
|
7
|
+
from agentsam_sdk import AgentSamClient, AsyncAgentSamClient, SamClientError
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class BridgeIndependenceTests(unittest.TestCase):
|
|
11
|
+
def test_bridge_timeout_is_configurable_and_validated(self):
|
|
12
|
+
with TemporaryDirectory() as directory:
|
|
13
|
+
sam = AgentSamClient(cwd=directory, bridge_timeout_seconds=600)
|
|
14
|
+
self.assertEqual(sam.bridge_timeout_seconds, 600)
|
|
15
|
+
asynchronous = AsyncAgentSamClient(
|
|
16
|
+
cwd=directory, env={"AGENTSAM_BRIDGE_TIMEOUT_SECONDS": "300"}
|
|
17
|
+
)
|
|
18
|
+
self.assertEqual(asynchronous.bridge_timeout_seconds, 300)
|
|
19
|
+
self.assertEqual(AgentSamClient(cwd=directory, env={}).bridge_timeout_seconds, 7260)
|
|
20
|
+
self.assertEqual(AgentSamClient(cwd=directory, bridge_timeout_seconds=7200).bridge_timeout_seconds, 7200)
|
|
21
|
+
for bad in (-1, 0, 7261, float("nan"), "bad"):
|
|
22
|
+
with self.subTest(bad=bad), self.assertRaises(SamClientError):
|
|
23
|
+
AgentSamClient(cwd=directory, bridge_timeout_seconds=bad)
|
|
24
|
+
|
|
25
|
+
def test_native_operations_work_without_node(self):
|
|
26
|
+
with TemporaryDirectory() as directory:
|
|
27
|
+
Path(directory, "sample.txt").write_text("native works", encoding="utf-8")
|
|
28
|
+
with patch("agentsam_sdk.client._binary", side_effect=SamClientError("sam_node_not_available")):
|
|
29
|
+
sam = AgentSamClient(cwd=directory)
|
|
30
|
+
native = sam.invoke("workspace.read", {"path": "sample.txt"})
|
|
31
|
+
self.assertTrue(native["ok"])
|
|
32
|
+
self.assertEqual(native["schema"], "agentsam.result.v1")
|
|
33
|
+
self.assertIn("native works", str(native["data"]))
|
|
34
|
+
ops = sam.discover(limit=200)["operations"]
|
|
35
|
+
self.assertIn("workspace.read", {op["id"] for op in ops})
|
|
36
|
+
with self.assertRaises(SamClientError) as error:
|
|
37
|
+
sam.invoke("artifact.render", {"title": "Requires optional JS adapter"})
|
|
38
|
+
self.assertEqual(error.exception.code, "sam_node_required")
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
if __name__ == "__main__":
|
|
42
|
+
unittest.main()
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import hashlib
|
|
2
|
+
import io
|
|
3
|
+
import json
|
|
4
|
+
import unittest
|
|
5
|
+
from agentsam_sdk.cad.building import CadBuildingClient
|
|
6
|
+
|
|
7
|
+
class Response(io.BytesIO):
|
|
8
|
+
def __enter__(self):return self
|
|
9
|
+
def __exit__(self,*a):self.close()
|
|
10
|
+
|
|
11
|
+
SHA='a'*64
|
|
12
|
+
ARTIFACT=b'cad output artifact'
|
|
13
|
+
ART_SHA=hashlib.sha256(ARTIFACT).hexdigest()
|
|
14
|
+
FILE={'path':'shell.ifc','uri':'/v1/files/work/derived/building-abc/shell.ifc','bytes':len(ARTIFACT),'sha256':ART_SHA}
|
|
15
|
+
CAPS={'ok':True,'service':'agentsam-cad','version':'1','endpoints':{'cad_building_export':{'handler_installed':True,'operation':'cad.building.export','scope':'single_rectangular_shell_with_north_south_openings','status':'available'}},'tools':{x:{'installed':True} for x in ('freecad','occt','ifc','blender','media')}}
|
|
16
|
+
RECEIPT={'ok':True,'schema':'agentsam.cad.building-export.v1','job_id':'job_123','output_scope':'runtime-derived',
|
|
17
|
+
'source':{'kind':'file','mount':'work','path':'scene.json','source_sha256':SHA,'source_revision':1,'scope':'single_rectangular_shell_with_north_south_openings'},
|
|
18
|
+
'files':[FILE,*[{**FILE,'path':p,'uri':'/v1/files/work/derived/building-abc/'+p} for p in ['shell.step','plan.dxf','plan.svg','preview.png','sheet-A101-proof.pdf','model.glb','model.opt.glb','turntable.mp4']]],
|
|
19
|
+
'receipt':{'status':'passed','checks':[{'id':str(i),'passed':True} for i in range(16)]}}
|
|
20
|
+
|
|
21
|
+
def fake(request,timeout=5):
|
|
22
|
+
if request.full_url.endswith('/v1/capabilities'):return Response(json.dumps(CAPS).encode())
|
|
23
|
+
if request.full_url.endswith('/v1/cad/building/export'):return Response(json.dumps(RECEIPT).encode())
|
|
24
|
+
return Response(ARTIFACT)
|
|
25
|
+
|
|
26
|
+
class CadBuildingPythonClientTests(unittest.TestCase):
|
|
27
|
+
def test_python_host_without_node(self):
|
|
28
|
+
client=CadBuildingClient('http://127.0.0.1:9001','dummy-bearer-token-only',fake)
|
|
29
|
+
with self.assertRaisesRegex(RuntimeError,'unprobed'):
|
|
30
|
+
client.export({'kind':'file','mount':'work','path':'scene.json'})
|
|
31
|
+
self.assertTrue(client.probe())
|
|
32
|
+
self.assertEqual(client.export({'kind':'file','mount':'work','path':'scene.json'},SHA)['receipt']['status'],'passed')
|
|
33
|
+
self.assertEqual(client.download(FILE),ARTIFACT)
|
|
34
|
+
|
|
35
|
+
def test_scope_and_hash_checks(self):
|
|
36
|
+
client=CadBuildingClient('http://127.0.0.1:9001','dummy-bearer-token-only',fake)
|
|
37
|
+
self.assertTrue(client.probe())
|
|
38
|
+
with self.assertRaisesRegex(ValueError,'resource_ref'):
|
|
39
|
+
client.export({'kind':'file','mount':'work','path':'../secret'})
|
|
40
|
+
with self.assertRaisesRegex(RuntimeError,'source_evidence_invalid'):
|
|
41
|
+
client.export({'kind':'file','mount':'work','path':'scene.json'},'b'*64)
|
|
42
|
+
with self.assertRaisesRegex(RuntimeError,'integrity_invalid'):
|
|
43
|
+
client.download({**FILE,'sha256':'b'*64})
|
|
44
|
+
with self.assertRaisesRegex(ValueError,'endpoint_https_required'):
|
|
45
|
+
CadBuildingClient('http://public.example.org','dummy-bearer-token-only')
|
|
46
|
+
|
|
47
|
+
if __name__=='__main__':unittest.main()
|