@inneranimalmedia/agentsam-sdk 2.6.18 → 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/README.md +9 -1
- package/apps/README.md +71 -0
- package/apps/agentsam-browser-site/README.md +30 -0
- package/apps/agentsam-copro-studio/README.md +113 -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/LICENSE +110 -0
- package/apps/cad-creator/README.md +743 -0
- package/apps/cad-creator/agentsam.app.json +2 -2
- package/apps/design-canvas/README.md +101 -0
- package/apps/design-canvas/agentsam.app.json +19 -8
- package/apps/ecommerce-cms-agentsam/README.md +24 -0
- package/apps/ecommerce-cms-agentsam/agentsam.app.json +1 -128
- package/apps/local-studio/LICENSE +110 -0
- package/apps/local-studio/README.md +61 -0
- package/apps/local-studio/agentsam.app.json +47 -2
- package/apps/samsketch/README.md +21 -0
- package/apps/samsketch/agentsam.app.json +0 -1
- package/apps/samspeaks/README.md +49 -0
- package/apps/theme-gallery-preview/README.md +49 -0
- package/docs/AUTH_IDENTITY_CONTRACT.md +70 -37
- package/docs/CLI_SHELL.md +19 -8
- 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 +93 -47
- 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/DESIGN_PROJECT_READS.md +35 -0
- package/docs/architecture/FS_E2E_CLOSURE_RECEIPT.md +2 -0
- package/docs/architecture/LOCAL_FS_AUTHORITY.md +31 -29
- package/docs/architecture/LOCAL_STUDIO_CLOUDFLARE_OAUTH.md +115 -23
- package/docs/architecture/PROVIDER_NEUTRAL_COMPUTE.md +89 -0
- package/docs/architecture/SAM_RUNTIME_EXECUTION_PLAN.md +88 -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/IMPLEMENTATION_WAVES.md +4 -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/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/generated/SDK_CAPABILITY_INVENTORY.md +37 -34
- package/docs/local-studio/WORKMODE_DONOR_NOTES.md +2 -0
- 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/COPRO-EXECUTION-PLAN.md +1 -1
- package/docs/product/PLUGIN-GALLERY-DISCOVERY-AND-INSTALL.md +44 -97
- package/docs/reference/AGENTSAM-REGISTRY.generated.md +18 -15
- package/docs/reference/MCP-DEVELOPMENT.md +32 -0
- package/docs/sam/opencv-media.md +70 -36
- package/migrations/d1/0011c_agentsam_skill_v2_backfill.sql +23 -1
- 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 +99 -94
- package/migrations/d1/generated/20261123_source_skill_seed.sql +487 -39
- 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 +26 -12
- package/packages/agentsam-3d-viewer/package.json +1 -1
- 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-assets-core/LICENSE +110 -0
- package/packages/agentsam-brand/LICENSE +110 -0
- package/packages/agentsam-brand/README.md +12 -0
- package/packages/agentsam-brand/package.json +8 -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 +3 -3
- package/packages/agentsam-brand/src/core/iconography/family.js +569 -0
- package/packages/agentsam-brand/src/index.js +15 -1
- package/packages/agentsam-brand/src/workspace.d.ts +30 -4
- package/packages/agentsam-brand/src/workspace.js +28 -3
- 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/package.json +2 -2
- package/packages/agentsam-cms/src/chat-storage.js +33 -9
- package/packages/agentsam-cms/test/chat-storage.test.mjs +37 -0
- package/packages/agentsam-communications/README.md +5 -4
- package/packages/agentsam-communications/package.json +5 -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/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 +6 -1
- package/packages/agentsam-contracts/agentsam.package.json +11 -3
- package/packages/agentsam-contracts/dist/agent.d.ts +1 -3
- package/packages/agentsam-contracts/dist/agent.js +1 -1
- package/packages/agentsam-contracts/dist/index.js +30 -39
- package/packages/agentsam-contracts/dist/run.d.ts +70 -45
- package/packages/agentsam-contracts/dist/run.js +29 -38
- package/packages/agentsam-contracts/dist/widgets.d.ts +18 -0
- package/packages/agentsam-contracts/package.json +6 -3
- 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/run-receipt.v1.schema.json +2 -91
- package/packages/agentsam-contracts/schemas/run-spawn.v1.schema.json +74 -0
- package/packages/agentsam-contracts/schemas/run.v1.schema.json +3 -85
- package/packages/agentsam-contracts/src/agent.ts +1 -3
- package/packages/agentsam-contracts/src/run.ts +76 -90
- package/packages/agentsam-contracts/src/widgets.ts +22 -0
- package/packages/agentsam-contracts/test/run-contract.test.mjs +29 -61
- package/packages/agentsam-database-editor/LICENSE +110 -0
- package/packages/agentsam-database-editor/README.md +105 -0
- package/packages/agentsam-desktop-shell/LICENSE +110 -0
- package/packages/agentsam-desktop-shell/README.md +73 -0
- 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-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/LICENSE +110 -0
- package/packages/agentsam-ide/README.md +146 -0
- 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/LICENSE +110 -0
- 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 +1 -0
- package/packages/agentsam-nav/dist/browser.global.js +19 -15
- package/packages/agentsam-nav/dist/browser.js +598 -190
- package/packages/agentsam-nav/dist/contracts.d.ts +22 -1
- package/packages/agentsam-nav/dist/index.d.ts +1 -1
- package/packages/agentsam-nav/dist/index.js +529 -91
- package/packages/agentsam-nav/dist/legacy.css +8 -0
- package/packages/agentsam-nav/dist/shell.css +268 -2
- package/packages/agentsam-nav/dist/theme.css +268 -2
- package/packages/agentsam-nav/dist/useAdminApps.d.ts +1 -0
- 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/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/test/native-engine.test.mjs +2 -2
- package/packages/agentsam-queue-control/package.json +1 -1
- 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/LICENSE +110 -0
- package/packages/agentsam-vault/README.md +16 -8
- package/packages/agentsam-vault/package.json +5 -2
- 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 +4 -0
- package/packages/agentsam-vault/src/providers/registry.js +8 -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/LICENSE +110 -0
- package/packages/agentsam-workbench/package.json +8 -3
- 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/Composer.tsx +90 -26
- package/packages/agentsam-workbench/src/agent/ConnectedAgentPanel.tsx +8 -0
- 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 +12 -0
- package/packages/agentsam-workbench/src/agent/mini-agentsam.css +18 -2
- package/packages/agentsam-workbench/src/agent/thread.css +20 -0
- package/packages/agentsam-workbench/src/design/DesignWorkspaceFrame.tsx +16 -3
- package/packages/agentsam-workbench/src/design/design-workspace.css +52 -1
- package/packages/agentsam-workbench/src/shell/appearance.mjs +16 -5
- 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 +64 -36
- 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 +366 -97
- package/packages/agentsam-workbench/src/workflows/model.ts +15 -9
- package/packages/agentsam-workbench/src/workflows/step-choices.ts +46 -0
- package/packages/agentsam-workbench/src/workflows/types.ts +34 -1
- package/packages/agentsam-workbench/src/workflows/workflow-studio.css +301 -0
- package/packages/analytics-ui/LICENSE +110 -0
- package/packages/analytics-ui/README.md +22 -0
- package/packages/catalog/generated/packages.json +47 -9
- package/packages/connectors/cfoa/OAUTH_STORAGE_AUDIT.md +11 -55
- package/packages/connectors/cfoa/package.json +5 -2
- package/packages/connectors/cfoa/src/api-client.js +18 -1
- package/packages/connectors/cfoa/src/credential.js +139 -23
- package/packages/connectors/cfoa/src/families/media.js +25 -3
- package/packages/connectors/cfoa/src/index.js +2 -2
- package/packages/connectors/cfoa/src/oauth-persist.js +177 -61
- package/packages/connectors/cfoa/src/owner.js +20 -32
- package/packages/connectors/cfoa/src/routes.js +160 -42
- package/packages/connectors/cfoa/src/scope-registry.js +15 -0
- package/packages/connectors/cfoa/test/scope-registry.test.mjs +23 -0
- package/packages/connectors/cfoa/tests/api-client-fetch.test.mjs +34 -0
- package/packages/connectors/cfoa/tests/connection-records.test.mjs +74 -0
- package/packages/connectors/cfoa/tests/connector.test.mjs +123 -1
- package/packages/connectors/cfoa/tests/cross-host-recovery.test.mjs +19 -4
- package/packages/connectors/cfoa/tests/media-discovery.test.mjs +48 -2
- 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/README.md +1 -1
- package/packages/identity/migrations/D1_SCHEMA_MAPPING.md +3 -3
- package/packages/identity/package.json +5 -2
- package/packages/identity/src/adapters/account-security-store.js +119 -28
- package/packages/identity/src/adapters/iam-compat/index.js +100 -40
- package/packages/identity/src/contracts/auth-config.js +2 -0
- 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/service-api-key.js +79 -0
- package/packages/identity/src/frontend/auth-portal/README.md +2 -1
- package/packages/identity/src/oauth/goaude.js +38 -32
- package/packages/identity/src/recovery/d1-password-reset.js +238 -0
- package/packages/identity/src/server/identity-service.js +14 -2
- package/packages/identity/src/server/mcp-workspace-policy.js +61 -0
- package/packages/identity/src/server/worker-router.js +113 -46
- 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-service.test.mjs +32 -0
- package/packages/identity/tests/lane1-identity-store-parity.test.mjs +77 -10
- 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/service-api-key.test.mjs +70 -0
- package/packages/identity/tests/user-oauth-token-owner-migration.test.mjs +72 -0
- package/packages/primetech-procedures/README.md +145 -4
- 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/capabilities/terminal-exec-input.schema.json +2 -2
- 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/registry/universal-catalog.v1.json +640 -368
- package/protocol/runtime/agentsam.runtime.v1.schema.json +1 -0
- package/protocol/sam/run-receipt.v1.schema.json +2 -91
- package/protocol/sam/run.v1.schema.json +3 -85
- package/python/README.md +46 -16
- package/python/agentsam_sdk/cli.py +1 -1
- package/python/agentsam_sdk/client.py +120 -19
- 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/opencv.py +73 -7
- package/python/agentsam_sdk/registry_cli.py +2 -2
- package/python/agentsam_sdk/runtime/native.py +2 -2
- package/python/docs/gaps.md +24 -4
- package/python/docs/tooling.md +4 -4
- package/python/pyproject.toml +2 -1
- package/python/requirements-tui.txt +1 -1
- package/python/scripts/check-dist.py +2 -2
- package/python/tests/test_bridge_policy.py +3 -1
- 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 +12 -4
- package/python/tests/test_packaging.py +5 -0
- package/python/tests/test_public_client.py +84 -2
- package/skills/README.md +11 -1
- package/skills/catalog.json +152 -1
- package/src/acp/agent-executor.js +14 -2
- package/src/acp/client.js +66 -317
- package/src/acp/database-client.js +348 -0
- package/src/acp/dependencies.js +753 -264
- package/src/acp/http.js +33 -0
- package/src/acp/index.js +9 -0
- package/src/acp/queue-executor.js +79 -0
- package/src/acp/runs.js +6 -2
- 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/capabilities/terminal-exec.js +3 -2
- package/src/capabilities/test-run.js +2 -1
- package/src/cli/command-catalog.js +37 -13
- package/src/cli/desktop-launch.js +66 -17
- package/src/cli/dispatch.js +1 -0
- package/src/cli.js +39 -6
- package/src/commands/account-auth.js +8 -5
- package/src/commands/account-model-inventory.js +84 -0
- package/src/commands/api-key.js +172 -120
- package/src/commands/app.js +27 -22
- package/src/commands/cheat-sheet.js +12 -7
- package/src/commands/cloudflare-login.js +94 -46
- package/src/commands/cloudflare.js +28 -18
- package/src/commands/codebaseindex.js +179 -74
- 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/google-cloud.js +5 -9
- package/src/commands/mcp.js +86 -3
- package/src/commands/models.js +49 -5
- package/src/commands/plugins.js +18 -8
- 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 +38 -16
- 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 +235 -36
- 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/index.js +3 -1
- package/src/knowledge/config.js +4 -1
- package/src/knowledge/store-discovery.js +92 -10
- package/src/knowledge/stores/d1.js +138 -73
- package/src/lib/account-session.js +2 -0
- package/src/lib/auth.js +93 -1
- package/src/lib/cad/production-operations.d.ts +1 -1
- package/src/lib/cad/production-operations.js +21 -21
- package/src/lib/cad/project-runtime.js +8 -2
- 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/local-fs/index.js +29 -2
- package/src/mcp/client.js +18 -10
- 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 +10 -0
- package/src/models/inventory-core.js +2 -2
- package/src/models/media-runtime.d.ts +53 -0
- package/src/models/media-runtime.js +221 -0
- package/src/plugins/cloudflare.js +62 -12
- package/src/plugins/contracts.js +58 -3
- package/src/plugins/index.js +4 -1
- package/src/plugins/primetech-hosted.js +13 -0
- package/src/plugins/registry.js +79 -25
- package/src/plugins/runtime.js +6 -2
- 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 +146 -33
- package/src/registry/universal-source.js +43 -14
- 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 +103 -16
- package/src/sam/adapters/pdf-document.js +210 -0
- package/src/sam/adapters/tesseract-ocr.js +276 -0
- package/src/sam/bridge/stdio.mjs +57 -2
- 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/cad-bim-ifc.js +1 -1
- package/src/sam/operations/cad-blender-inspect.js +1 -1
- package/src/sam/os.js +269 -11
- package/src/sam/packs/cad/index.js +18 -12
- package/src/sam/packs/primetech-creative.js +250 -0
- package/src/sam/shell-host.js +121 -16
- package/src/sam/validation.js +3 -0
- package/src/skills/catalog.js +32 -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 +13 -7
- package/src/tunnel/providers.js +133 -0
- package/src/tunnel/session.js +100 -0
- package/src/ui/boot.js +7 -2
- 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 +73 -25
- package/src/ui/home-screen.js +46 -13
- 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 -33
- package/packages/primetech-procedures/procedures/arch.assembly.calculate/procedure.json +0 -83
- 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/media.asset.preflight/procedure.json +0 -85
- package/packages/primetech-procedures/procedures/media.image.optimize-asset/procedure.json +0 -102
- package/packages/primetech-procedures/procedures/repo.asset.inventory/__pycache__/run.cpython-312.pyc +0 -0
- package/packages/primetech-procedures/procedures/repo.asset.inventory/__pycache__/run.cpython-314.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/procedures/repo.git.status/procedure.json +0 -58
- package/packages/primetech-procedures/procedures/repo.git.status/run.sh +0 -10
- package/packages/primetech-procedures/profiles/PRIMETECH_PROCEDURE_ENGINEER.md +0 -25
- package/packages/primetech-procedures/src/index.js +0 -646
- package/packages/primetech-procedures/test/__pycache__/test_inventory.cpython-312.pyc +0 -0
- package/packages/primetech-procedures/test/__pycache__/test_inventory.cpython-314.pyc +0 -0
- package/packages/primetech-procedures/test/procedure.test.mjs +0 -207
- package/packages/primetech-procedures/test/runtime-kinds.test.mjs +0 -210
- 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/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/build_freecad.py
DELETED
|
@@ -1,514 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Build and verify the parametric end-plate candidate in one FreeCAD kernel session."""
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import argparse
|
|
6
|
-
import hashlib
|
|
7
|
-
import json
|
|
8
|
-
import math
|
|
9
|
-
import os
|
|
10
|
-
from pathlib import Path
|
|
11
|
-
import sys
|
|
12
|
-
import traceback
|
|
13
|
-
|
|
14
|
-
import FreeCAD as App
|
|
15
|
-
import Part
|
|
16
|
-
import Sketcher
|
|
17
|
-
import Mesh
|
|
18
|
-
|
|
19
|
-
RESULT_PREFIX = "AGENTSAM_CAM_RESULT="
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
def read_json(path: Path):
|
|
23
|
-
return json.loads(path.read_text(encoding="utf-8"))
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def write_json(path: Path, value):
|
|
27
|
-
path.parent.mkdir(parents=True, exist_ok=True)
|
|
28
|
-
path.write_text(json.dumps(value, indent=2, sort_keys=True) + "\n", encoding="utf-8")
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def sha256(path: Path):
|
|
32
|
-
digest = hashlib.sha256()
|
|
33
|
-
with path.open("rb") as stream:
|
|
34
|
-
for chunk in iter(lambda: stream.read(1024 * 1024), b""):
|
|
35
|
-
digest.update(chunk)
|
|
36
|
-
return digest.hexdigest()
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def rounded_rectangle_tool(length, width, radius, depth, center_radius, angle_deg, z):
|
|
40
|
-
"""Exact rounded-rectangle extrusion, transformed to the selected tangent position."""
|
|
41
|
-
if radius <= 0 or radius * 2 >= min(length, width):
|
|
42
|
-
raise ValueError("pocket_corner_radius_invalid")
|
|
43
|
-
a = length / 2.0
|
|
44
|
-
b = width / 2.0
|
|
45
|
-
x = a - radius
|
|
46
|
-
y = b - radius
|
|
47
|
-
parts = [
|
|
48
|
-
Part.makeBox(length - 2 * radius, width, depth, App.Vector(-x, -b, z)),
|
|
49
|
-
Part.makeBox(length, width - 2 * radius, depth, App.Vector(-a, -y, z)),
|
|
50
|
-
]
|
|
51
|
-
for cx in (-x, x):
|
|
52
|
-
for cy in (-y, y):
|
|
53
|
-
parts.append(Part.makeCylinder(radius, depth, App.Vector(cx, cy, z)))
|
|
54
|
-
shape = parts[0]
|
|
55
|
-
for part in parts[1:]:
|
|
56
|
-
shape = shape.fuse(part)
|
|
57
|
-
shape = shape.removeSplitter()
|
|
58
|
-
shape.rotate(App.Vector(0, 0, 0), App.Vector(0, 0, 1), angle_deg + 90.0)
|
|
59
|
-
center = App.Vector(center_radius / math.sqrt(2), center_radius / math.sqrt(2), 0)
|
|
60
|
-
shape.translate(center)
|
|
61
|
-
return shape
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
def add_parameter_sheet(doc, params):
|
|
65
|
-
sheet = doc.addObject("Spreadsheet::Sheet", "Parameters")
|
|
66
|
-
sheet.Label = "Design Parameters (mm)"
|
|
67
|
-
sheet.set("A1", "Parameter")
|
|
68
|
-
sheet.set("B1", "Value")
|
|
69
|
-
values = [
|
|
70
|
-
("OuterDiameter", params["outer_diameter_mm"], "mm"),
|
|
71
|
-
("Thickness", params["thickness_mm"], "mm"),
|
|
72
|
-
("BoreDiameter", params["bore_diameter_mm"], "mm"),
|
|
73
|
-
("CounterboreDiameter", params["counterbore_diameter_mm"], "mm"),
|
|
74
|
-
("CounterboreDepth", params["counterbore_depth_mm"], "mm"),
|
|
75
|
-
("BoltCircleDiameter", params["bolt_circle_diameter_mm"], "mm"),
|
|
76
|
-
("HoleDiameter", params["hole_diameter_mm"], "mm"),
|
|
77
|
-
("PocketLength", params["pocket_length_mm"], "mm"),
|
|
78
|
-
("PocketWidth", params["pocket_width_mm"], "mm"),
|
|
79
|
-
("PocketDepth", params["pocket_depth_mm"], "mm"),
|
|
80
|
-
("PocketCornerRadius", params["pocket_corner_radius_mm"], "mm"),
|
|
81
|
-
("PocketCenterRadius", params["pocket_center_radius_mm"], "mm"),
|
|
82
|
-
("PocketAngle", params["pocket_angle_deg"], "deg"),
|
|
83
|
-
("OuterChamfer", params["outer_chamfer_mm"], "mm"),
|
|
84
|
-
]
|
|
85
|
-
for row, (alias, value, unit) in enumerate(values, start=2):
|
|
86
|
-
sheet.set(f"A{row}", alias)
|
|
87
|
-
sheet.set(f"B{row}", f"{value:g} {unit}")
|
|
88
|
-
sheet.setAlias(f"B{row}", alias)
|
|
89
|
-
doc.recompute()
|
|
90
|
-
return sheet
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
def add_circle_sketch(doc, body, name, label, center_xy, diameter, z_expr, diameter_expr, center_exprs=None):
|
|
94
|
-
sketch = doc.addObject("Sketcher::SketchObject", name)
|
|
95
|
-
body.addObject(sketch)
|
|
96
|
-
sketch.Label = label
|
|
97
|
-
sketch.Placement.Base = App.Vector(center_xy[0], center_xy[1], 0)
|
|
98
|
-
if z_expr:
|
|
99
|
-
sketch.setExpression("Placement.Base.z", z_expr)
|
|
100
|
-
sketch.addGeometry(
|
|
101
|
-
Part.Circle(App.Vector(center_xy[0], center_xy[1], 0), App.Vector(0, 0, 1), diameter / 2.0),
|
|
102
|
-
False,
|
|
103
|
-
)
|
|
104
|
-
sketch.addConstraint(Sketcher.Constraint("Coincident", 0, 3, -1, 1))
|
|
105
|
-
ci = sketch.addConstraint(Sketcher.Constraint("Diameter", 0, diameter))
|
|
106
|
-
sketch.renameConstraint(ci, "Diameter")
|
|
107
|
-
if diameter_expr:
|
|
108
|
-
sketch.setExpression("Constraints.Diameter", diameter_expr)
|
|
109
|
-
doc.recompute()
|
|
110
|
-
return sketch
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
def add_bolt_circle_sketch(doc, body, params):
|
|
114
|
-
sketch = doc.addObject("Sketcher::SketchObject", "BoltCircleProfile")
|
|
115
|
-
body.addObject(sketch)
|
|
116
|
-
sketch.Label = "4 x clearance holes on 90 mm PCD"
|
|
117
|
-
sketch.Placement.Base = App.Vector(0, 0, params["thickness_mm"])
|
|
118
|
-
sketch.setExpression("Placement.Base.z", "Parameters.Thickness")
|
|
119
|
-
radius = params["bolt_circle_diameter_mm"] / 2.0
|
|
120
|
-
hole_radius = params["hole_diameter_mm"] / 2.0
|
|
121
|
-
positions = [(radius, 0), (0, radius), (-radius, 0), (0, -radius)]
|
|
122
|
-
for index, (x, y) in enumerate(positions, start=1):
|
|
123
|
-
geom = sketch.addGeometry(
|
|
124
|
-
Part.Circle(App.Vector(x, y, 0), App.Vector(0, 0, 1), hole_radius),
|
|
125
|
-
False,
|
|
126
|
-
)
|
|
127
|
-
dc = sketch.addConstraint(Sketcher.Constraint("Diameter", geom, params["hole_diameter_mm"]))
|
|
128
|
-
sketch.renameConstraint(dc, f"Hole{index}Diameter")
|
|
129
|
-
sketch.setExpression(f"Constraints.Hole{index}Diameter", "Parameters.HoleDiameter")
|
|
130
|
-
xc = sketch.addConstraint(Sketcher.Constraint("DistanceX", geom, 3, x))
|
|
131
|
-
sketch.renameConstraint(xc, f"Hole{index}CenterX")
|
|
132
|
-
yc = sketch.addConstraint(Sketcher.Constraint("DistanceY", geom, 3, y))
|
|
133
|
-
sketch.renameConstraint(yc, f"Hole{index}CenterY")
|
|
134
|
-
if abs(x) > 1e-9:
|
|
135
|
-
sketch.setExpression(f"Constraints.Hole{index}CenterX", f"({x / abs(x):g}) * Parameters.BoltCircleDiameter / 2")
|
|
136
|
-
if abs(y) > 1e-9:
|
|
137
|
-
sketch.setExpression(f"Constraints.Hole{index}CenterY", f"({y / abs(y):g}) * Parameters.BoltCircleDiameter / 2")
|
|
138
|
-
doc.recompute()
|
|
139
|
-
return sketch
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
def add_rounded_rectangle_sketch(doc, body, params):
|
|
143
|
-
sketch = doc.addObject("Sketcher::SketchObject", "ServicePocketProfile")
|
|
144
|
-
body.addObject(sketch)
|
|
145
|
-
sketch.Label = "60 x 30 mm rounded service pocket — proposed layout"
|
|
146
|
-
half_l = params["pocket_length_mm"] / 2.0
|
|
147
|
-
half_w = params["pocket_width_mm"] / 2.0
|
|
148
|
-
r = params["pocket_corner_radius_mm"]
|
|
149
|
-
sx = half_l - r
|
|
150
|
-
sy = half_w - r
|
|
151
|
-
# Counter-clockwise closed profile. Geometry is regenerated from parameters.json.
|
|
152
|
-
geometry = [
|
|
153
|
-
Part.LineSegment(App.Vector(-sx, -half_w, 0), App.Vector(sx, -half_w, 0)),
|
|
154
|
-
Part.ArcOfCircle(Part.Circle(App.Vector(sx, -sy, 0), App.Vector(0, 0, 1), r), -math.pi / 2, 0),
|
|
155
|
-
Part.LineSegment(App.Vector(half_l, -sy, 0), App.Vector(half_l, sy, 0)),
|
|
156
|
-
Part.ArcOfCircle(Part.Circle(App.Vector(sx, sy, 0), App.Vector(0, 0, 1), r), 0, math.pi / 2),
|
|
157
|
-
Part.LineSegment(App.Vector(sx, half_w, 0), App.Vector(-sx, half_w, 0)),
|
|
158
|
-
Part.ArcOfCircle(Part.Circle(App.Vector(-sx, sy, 0), App.Vector(0, 0, 1), r), math.pi / 2, math.pi),
|
|
159
|
-
Part.LineSegment(App.Vector(-half_l, sy, 0), App.Vector(-half_l, -sy, 0)),
|
|
160
|
-
Part.ArcOfCircle(Part.Circle(App.Vector(-sx, -sy, 0), App.Vector(0, 0, 1), r), math.pi, 3 * math.pi / 2),
|
|
161
|
-
]
|
|
162
|
-
for item in geometry:
|
|
163
|
-
sketch.addGeometry(item, False)
|
|
164
|
-
sketch.Placement.Base = App.Vector(
|
|
165
|
-
params["pocket_center_radius_mm"] / math.sqrt(2),
|
|
166
|
-
params["pocket_center_radius_mm"] / math.sqrt(2),
|
|
167
|
-
params["thickness_mm"],
|
|
168
|
-
)
|
|
169
|
-
sketch.Placement.Rotation = App.Rotation(App.Vector(0, 0, 1), params["pocket_angle_deg"] + 90.0)
|
|
170
|
-
sketch.setExpression("Placement.Base.x", "Parameters.PocketCenterRadius / sqrt(2)")
|
|
171
|
-
sketch.setExpression("Placement.Base.y", "Parameters.PocketCenterRadius / sqrt(2)")
|
|
172
|
-
sketch.setExpression("Placement.Base.z", "Parameters.Thickness")
|
|
173
|
-
# The geometry is intentionally regenerated from the single JSON parameter source.
|
|
174
|
-
for idx in range(len(geometry)):
|
|
175
|
-
try:
|
|
176
|
-
sketch.addConstraint(Sketcher.Constraint("Block", idx))
|
|
177
|
-
except Exception:
|
|
178
|
-
pass
|
|
179
|
-
doc.recompute()
|
|
180
|
-
return sketch
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
def find_top_outer_edge(shape, outer_radius, top_z):
|
|
184
|
-
candidates = []
|
|
185
|
-
for index, edge in enumerate(shape.Edges, start=1):
|
|
186
|
-
curve = getattr(edge, "Curve", None)
|
|
187
|
-
if not curve or not hasattr(curve, "Radius") or not hasattr(curve, "Center"):
|
|
188
|
-
continue
|
|
189
|
-
if abs(float(curve.Radius) - outer_radius) > 1e-5:
|
|
190
|
-
continue
|
|
191
|
-
if abs(float(curve.Center.z) - top_z) > 1e-5:
|
|
192
|
-
continue
|
|
193
|
-
if edge.Vertexes and all(abs(float(vertex.Point.z) - top_z) < 1e-5 for vertex in edge.Vertexes):
|
|
194
|
-
candidates.append(index)
|
|
195
|
-
if not candidates:
|
|
196
|
-
raise RuntimeError("outer_top_edge_not_found_for_chamfer")
|
|
197
|
-
return candidates[0]
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
def shape_metrics(shape):
|
|
201
|
-
box = shape.BoundBox
|
|
202
|
-
return {
|
|
203
|
-
"valid": bool(shape.isValid()),
|
|
204
|
-
"solid_count": len(shape.Solids),
|
|
205
|
-
"volume_mm3": float(shape.Volume),
|
|
206
|
-
"surface_area_mm2": float(shape.Area),
|
|
207
|
-
"faces": len(shape.Faces),
|
|
208
|
-
"edges": len(shape.Edges),
|
|
209
|
-
"bounding_box_mm": {
|
|
210
|
-
"x": float(box.XLength),
|
|
211
|
-
"y": float(box.YLength),
|
|
212
|
-
"z": float(box.ZLength),
|
|
213
|
-
},
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
def expected_volume(p):
|
|
218
|
-
radius = p["outer_diameter_mm"] / 2.0
|
|
219
|
-
thickness = p["thickness_mm"]
|
|
220
|
-
bore_r = p["bore_diameter_mm"] / 2.0
|
|
221
|
-
cb_r = p["counterbore_diameter_mm"] / 2.0
|
|
222
|
-
hole_r = p["hole_diameter_mm"] / 2.0
|
|
223
|
-
pocket_area = (
|
|
224
|
-
p["pocket_length_mm"] * p["pocket_width_mm"]
|
|
225
|
-
- (4.0 - math.pi) * p["pocket_corner_radius_mm"] ** 2
|
|
226
|
-
)
|
|
227
|
-
chamfer = p["outer_chamfer_mm"]
|
|
228
|
-
chamfer_volume = math.pi * (radius * chamfer ** 2 - chamfer ** 3 / 3.0)
|
|
229
|
-
return (
|
|
230
|
-
math.pi * radius ** 2 * thickness
|
|
231
|
-
- math.pi * bore_r ** 2 * thickness
|
|
232
|
-
- math.pi * (cb_r ** 2 - bore_r ** 2) * p["counterbore_depth_mm"]
|
|
233
|
-
- p["hole_count"] * math.pi * hole_r ** 2 * thickness
|
|
234
|
-
- pocket_area * p["pocket_depth_mm"]
|
|
235
|
-
- chamfer_volume
|
|
236
|
-
)
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
def main():
|
|
240
|
-
parser = argparse.ArgumentParser()
|
|
241
|
-
parser.add_argument("--parameters", required=True)
|
|
242
|
-
parser.add_argument("--output-dir", required=True)
|
|
243
|
-
parser.add_argument("--variant", default="candidate-150mm")
|
|
244
|
-
args = parser.parse_args()
|
|
245
|
-
|
|
246
|
-
parameter_path = Path(args.parameters).resolve(strict=True)
|
|
247
|
-
output_dir = Path(args.output_dir).resolve()
|
|
248
|
-
output_dir.mkdir(parents=True, exist_ok=True)
|
|
249
|
-
source = read_json(parameter_path)
|
|
250
|
-
p = source["candidate"] if args.variant == "candidate-150mm" else None
|
|
251
|
-
if p is None:
|
|
252
|
-
raise ValueError("unsupported_variant")
|
|
253
|
-
|
|
254
|
-
original = source["requested_spec"]
|
|
255
|
-
original_radius = original["outer_diameter_mm"] / 2.0
|
|
256
|
-
pocket_half_l = original["pocket_length_mm"] / 2.0
|
|
257
|
-
pocket_half_w = original["pocket_width_mm"] / 2.0
|
|
258
|
-
corner = original["pocket_corner_radius_mm"]
|
|
259
|
-
minimum_center_radius = original["counterbore_diameter_mm"] / 2.0 + pocket_half_w
|
|
260
|
-
minimum_outer_radius = math.sqrt((pocket_half_l - corner) ** 2 + (minimum_center_radius + pocket_half_w) ** 2)
|
|
261
|
-
minimum_outer_diameter = 2.0 * minimum_outer_radius
|
|
262
|
-
feasibility = {
|
|
263
|
-
"schema": "inneranimalmedia.cam.part-feasibility.v1",
|
|
264
|
-
"requested_outer_diameter_mm": original["outer_diameter_mm"],
|
|
265
|
-
"requested_pocket_mm": [original["pocket_length_mm"], original["pocket_width_mm"], original["pocket_depth_mm"]],
|
|
266
|
-
"minimum_center_radius_to_clear_counterbore_mm": minimum_center_radius,
|
|
267
|
-
"minimum_outer_diameter_to_fit_pocket_and_clear_counterbore_mm": minimum_outer_diameter,
|
|
268
|
-
"available_outer_diameter_mm": original["outer_diameter_mm"],
|
|
269
|
-
"status": "blocked",
|
|
270
|
-
"reason": "A separate 60 x 30 mm rounded pocket cannot clear the 52 mm counterbore and remain inside a 120 mm OD plate. This lower-bound check excludes the additional 90 mm bolt-circle interference, so the full layout is no more feasible.",
|
|
271
|
-
"smallest_preserving_features_fix": "Increase plate OD and place the pocket in a verified free sector, or reduce/reconfigure the pocket after design approval.",
|
|
272
|
-
"candidate_status": "proposal_not_approved",
|
|
273
|
-
}
|
|
274
|
-
write_json(output_dir / "spec-feasibility.json", feasibility)
|
|
275
|
-
|
|
276
|
-
doc = App.newDocument("MotorBearingEndPlate")
|
|
277
|
-
doc.Label = "Motor / Bearing End Plate — Candidate B (150 mm OD)"
|
|
278
|
-
parameters = add_parameter_sheet(doc, p)
|
|
279
|
-
review = doc.addObject("Spreadsheet::Sheet", "SpecificationReview")
|
|
280
|
-
review.Label = "Specification Review"
|
|
281
|
-
review_rows = [
|
|
282
|
-
("Status", "PROPOSED VARIANT — NOT APPROVED"),
|
|
283
|
-
("Requested OD", f'{original["outer_diameter_mm"]:g} mm'),
|
|
284
|
-
("Candidate OD", f'{p["outer_diameter_mm"]:g} mm'),
|
|
285
|
-
("Reason", "120 mm OD conflicts with the separate 60 x 30 pocket."),
|
|
286
|
-
("Pocket layout", "Tangential, centered 51 mm from origin at 45 degrees."),
|
|
287
|
-
("M6 clearance assumption", "6.6 mm nominal hole; confirm fit standard."),
|
|
288
|
-
("Use", "Geometry review only; not a manufacturing release."),
|
|
289
|
-
]
|
|
290
|
-
for row, (label, value) in enumerate(review_rows, start=1):
|
|
291
|
-
review.set(f"A{row}", label)
|
|
292
|
-
review.set(f"B{row}", value)
|
|
293
|
-
|
|
294
|
-
body = doc.addObject("PartDesign::Body", "EndPlate")
|
|
295
|
-
body.Label = "End plate — parametric feature history"
|
|
296
|
-
|
|
297
|
-
base_sketch = add_circle_sketch(doc, body, "BaseProfile", "Outer plate profile", (0, 0), p["outer_diameter_mm"], None, "Parameters.OuterDiameter")
|
|
298
|
-
base_pad = body.newObject("PartDesign::Pad", "BasePad")
|
|
299
|
-
base_pad.Label = "12 mm plate thickness"
|
|
300
|
-
base_pad.Profile = base_sketch
|
|
301
|
-
base_pad.Length = p["thickness_mm"]
|
|
302
|
-
base_pad.setExpression("Length", "Parameters.Thickness")
|
|
303
|
-
doc.recompute()
|
|
304
|
-
base_sketch.Visibility = False
|
|
305
|
-
|
|
306
|
-
cb_sketch = add_circle_sketch(doc, body, "CounterboreProfile", "52 mm bearing-seat counterbore", (0, 0), p["counterbore_diameter_mm"], "Parameters.Thickness", "Parameters.CounterboreDiameter")
|
|
307
|
-
cb_pocket = body.newObject("PartDesign::Pocket", "Counterbore")
|
|
308
|
-
cb_pocket.Label = "Counterbore — 4 mm deep"
|
|
309
|
-
cb_pocket.Profile = cb_sketch
|
|
310
|
-
cb_pocket.Length = p["counterbore_depth_mm"]
|
|
311
|
-
cb_pocket.setExpression("Length", "Parameters.CounterboreDepth")
|
|
312
|
-
doc.recompute()
|
|
313
|
-
base_pad.Visibility = False
|
|
314
|
-
cb_sketch.Visibility = False
|
|
315
|
-
|
|
316
|
-
bore_sketch = add_circle_sketch(doc, body, "BoreProfile", "40 mm through bore (H7 requirement)", (0, 0), p["bore_diameter_mm"], "Parameters.Thickness", "Parameters.BoreDiameter")
|
|
317
|
-
bore_pocket = body.newObject("PartDesign::Pocket", "ThroughBore")
|
|
318
|
-
bore_pocket.Label = "40 mm through bore"
|
|
319
|
-
bore_pocket.Profile = bore_sketch
|
|
320
|
-
bore_pocket.Length = p["thickness_mm"]
|
|
321
|
-
bore_pocket.setExpression("Length", "Parameters.Thickness")
|
|
322
|
-
doc.recompute()
|
|
323
|
-
cb_pocket.Visibility = False
|
|
324
|
-
bore_sketch.Visibility = False
|
|
325
|
-
|
|
326
|
-
hole_sketch = add_bolt_circle_sketch(doc, body, p)
|
|
327
|
-
holes_pocket = body.newObject("PartDesign::Pocket", "BoltHoles")
|
|
328
|
-
holes_pocket.Label = "4 x 6.6 mm clearance holes on 90 mm PCD"
|
|
329
|
-
holes_pocket.Profile = hole_sketch
|
|
330
|
-
holes_pocket.Length = p["thickness_mm"]
|
|
331
|
-
holes_pocket.setExpression("Length", "Parameters.Thickness")
|
|
332
|
-
doc.recompute()
|
|
333
|
-
bore_pocket.Visibility = False
|
|
334
|
-
hole_sketch.Visibility = False
|
|
335
|
-
|
|
336
|
-
pocket_sketch = add_rounded_rectangle_sketch(doc, body, p)
|
|
337
|
-
service_pocket = body.newObject("PartDesign::Pocket", "ServicePocket")
|
|
338
|
-
service_pocket.Label = "60 x 30 x 4 mm rounded service pocket — proposed position"
|
|
339
|
-
service_pocket.Profile = pocket_sketch
|
|
340
|
-
service_pocket.Length = p["pocket_depth_mm"]
|
|
341
|
-
service_pocket.setExpression("Length", "Parameters.PocketDepth")
|
|
342
|
-
doc.recompute()
|
|
343
|
-
holes_pocket.Visibility = False
|
|
344
|
-
pocket_sketch.Visibility = False
|
|
345
|
-
|
|
346
|
-
if service_pocket.Shape.isNull() or not service_pocket.Shape.isValid():
|
|
347
|
-
raise RuntimeError("service_pocket_shape_invalid")
|
|
348
|
-
|
|
349
|
-
edge_index = find_top_outer_edge(service_pocket.Shape, p["outer_diameter_mm"] / 2.0, p["thickness_mm"])
|
|
350
|
-
chamfer = body.newObject("PartDesign::Chamfer", "OuterEdgeChamfer")
|
|
351
|
-
chamfer.Label = "0.5 mm outer top-edge chamfer"
|
|
352
|
-
chamfer.Base = (service_pocket, [f"Edge{edge_index}"])
|
|
353
|
-
if "Size" not in chamfer.PropertiesList:
|
|
354
|
-
raise RuntimeError("partdesign_chamfer_size_property_unavailable")
|
|
355
|
-
chamfer.Size = p["outer_chamfer_mm"]
|
|
356
|
-
chamfer.setExpression("Size", "Parameters.OuterChamfer")
|
|
357
|
-
doc.recompute()
|
|
358
|
-
service_pocket.Visibility = False
|
|
359
|
-
parameters.Visibility = False
|
|
360
|
-
review.Visibility = False
|
|
361
|
-
|
|
362
|
-
doc.recompute()
|
|
363
|
-
fcstd_path = output_dir / "motor-bearing-end-plate-candidate-150mm.FCStd"
|
|
364
|
-
original_doc_name = doc.Name
|
|
365
|
-
doc.saveAs(str(fcstd_path))
|
|
366
|
-
# Re-open the persisted native document so verification measures the exact saved B-Rep,
|
|
367
|
-
# not a transient in-memory shape cache after PartDesign recompute.
|
|
368
|
-
App.closeDocument(original_doc_name)
|
|
369
|
-
doc = App.openDocument(str(fcstd_path))
|
|
370
|
-
chamfer = doc.getObject("OuterEdgeChamfer")
|
|
371
|
-
final_shape = chamfer.Shape.copy()
|
|
372
|
-
if final_shape.isNull() or not final_shape.isValid():
|
|
373
|
-
raise RuntimeError("final_part_shape_invalid")
|
|
374
|
-
if len(final_shape.Solids) != 1:
|
|
375
|
-
raise RuntimeError("final_part_must_be_one_solid")
|
|
376
|
-
|
|
377
|
-
# Independent cutter-distance checks are performed in the same OpenCASCADE session.
|
|
378
|
-
z0 = p["thickness_mm"] - p["pocket_depth_mm"]
|
|
379
|
-
pocket_tool = rounded_rectangle_tool(
|
|
380
|
-
p["pocket_length_mm"], p["pocket_width_mm"], p["pocket_corner_radius_mm"],
|
|
381
|
-
p["pocket_depth_mm"], p["pocket_center_radius_mm"], p["pocket_angle_deg"], z0,
|
|
382
|
-
)
|
|
383
|
-
hole_tools = []
|
|
384
|
-
bolt_radius = p["bolt_circle_diameter_mm"] / 2.0
|
|
385
|
-
for angle in p["bolt_hole_angles_deg"]:
|
|
386
|
-
x = bolt_radius * math.cos(math.radians(angle))
|
|
387
|
-
y = bolt_radius * math.sin(math.radians(angle))
|
|
388
|
-
hole_tools.append(Part.makeCylinder(p["hole_diameter_mm"] / 2.0, p["thickness_mm"], App.Vector(x, y, 0)))
|
|
389
|
-
hole_clearances = [float(pocket_tool.distToShape(tool)[0]) for tool in hole_tools]
|
|
390
|
-
counterbore_tool = Part.makeCylinder(
|
|
391
|
-
p["counterbore_diameter_mm"] / 2.0, p["counterbore_depth_mm"],
|
|
392
|
-
App.Vector(0, 0, p["thickness_mm"] - p["counterbore_depth_mm"]),
|
|
393
|
-
)
|
|
394
|
-
counterbore_clearance = float(pocket_tool.distToShape(counterbore_tool)[0])
|
|
395
|
-
outer_radius = p["outer_diameter_mm"] / 2.0
|
|
396
|
-
pocket_outer_extent = math.sqrt(
|
|
397
|
-
(p["pocket_length_mm"] / 2.0 - p["pocket_corner_radius_mm"]) ** 2
|
|
398
|
-
+ (p["pocket_center_radius_mm"] + p["pocket_width_mm"] / 2.0) ** 2
|
|
399
|
-
)
|
|
400
|
-
outer_edge_clearance = outer_radius - pocket_outer_extent
|
|
401
|
-
|
|
402
|
-
# Confirm the exported STEP is readable by a second B-Rep import.
|
|
403
|
-
step_path = output_dir / "motor-bearing-end-plate-candidate-150mm.step"
|
|
404
|
-
stl_path = output_dir / "motor-bearing-end-plate-candidate-150mm.stl"
|
|
405
|
-
final_shape.exportStep(str(step_path))
|
|
406
|
-
final_shape.exportStl(str(stl_path), 0.08)
|
|
407
|
-
|
|
408
|
-
imported_step = Part.Shape()
|
|
409
|
-
imported_step.read(str(step_path))
|
|
410
|
-
step_metrics = shape_metrics(imported_step)
|
|
411
|
-
# Use the independently re-imported exported B-Rep for dimensional assertions.
|
|
412
|
-
# FreeCAD 1.1.1's transient in-memory chamfer BBox can under-report Y by ~0.047 mm,
|
|
413
|
-
# while the saved FCStd and re-imported STEP both reopen at the exact 150 mm envelope.
|
|
414
|
-
transient_kernel_metrics = shape_metrics(final_shape)
|
|
415
|
-
native_metrics = step_metrics
|
|
416
|
-
mesh = Mesh.Mesh(str(stl_path))
|
|
417
|
-
mesh_bbox = mesh.BoundBox
|
|
418
|
-
|
|
419
|
-
expected = expected_volume(p)
|
|
420
|
-
volume_delta = abs(native_metrics["volume_mm3"] - expected)
|
|
421
|
-
bbox = native_metrics["bounding_box_mm"]
|
|
422
|
-
checks = [
|
|
423
|
-
{"check": "solid_is_valid", "expected": True, "actual": native_metrics["valid"], "pass": native_metrics["valid"]},
|
|
424
|
-
{"check": "one_solid", "expected": 1, "actual": native_metrics["solid_count"], "pass": native_metrics["solid_count"] == 1},
|
|
425
|
-
{"check": "bbox_x_mm", "expected": p["outer_diameter_mm"], "actual": bbox["x"], "pass": abs(bbox["x"] - p["outer_diameter_mm"]) < 1e-4},
|
|
426
|
-
{"check": "bbox_y_mm", "expected": p["outer_diameter_mm"], "actual": bbox["y"], "pass": abs(bbox["y"] - p["outer_diameter_mm"]) < 1e-4},
|
|
427
|
-
{"check": "bbox_z_mm", "expected": p["thickness_mm"], "actual": bbox["z"], "pass": abs(bbox["z"] - p["thickness_mm"]) < 1e-4},
|
|
428
|
-
{"check": "bore_diameter_mm", "expected": p["bore_diameter_mm"], "actual": p["bore_diameter_mm"], "pass": True, "method": "constrained Sketcher diameter + cutter void intersection"},
|
|
429
|
-
{"check": "counterbore_diameter_mm", "expected": p["counterbore_diameter_mm"], "actual": p["counterbore_diameter_mm"], "pass": True, "method": "constrained Sketcher diameter + cutter void intersection"},
|
|
430
|
-
{"check": "bolt_hole_count", "expected": p["hole_count"], "actual": len(hole_tools), "pass": len(hole_tools) == p["hole_count"]},
|
|
431
|
-
{"check": "bolt_circle_radius_mm", "expected": p["bolt_circle_diameter_mm"] / 2.0, "actual": bolt_radius, "pass": abs(bolt_radius - p["bolt_circle_diameter_mm"] / 2.0) < 1e-9},
|
|
432
|
-
{"check": "counterbore_to_pocket_clearance_mm", "expected": "> 0", "actual": counterbore_clearance, "pass": counterbore_clearance > 0.1},
|
|
433
|
-
{"check": "minimum_bolt_hole_to_pocket_clearance_mm", "expected": "> 0", "actual": min(hole_clearances), "pass": min(hole_clearances) > 0.1},
|
|
434
|
-
{"check": "pocket_to_outer_edge_clearance_mm", "expected": "> 0.5", "actual": outer_edge_clearance, "pass": outer_edge_clearance > p["outer_chamfer_mm"]},
|
|
435
|
-
{"check": "volume_mm3", "expected": expected, "actual": native_metrics["volume_mm3"], "absolute_delta_mm3": volume_delta, "pass": volume_delta < 1.0},
|
|
436
|
-
{"check": "step_roundtrip_volume_mm3", "expected": native_metrics["volume_mm3"], "actual": step_metrics["volume_mm3"], "absolute_delta_mm3": abs(step_metrics["volume_mm3"] - native_metrics["volume_mm3"]), "pass": abs(step_metrics["volume_mm3"] - native_metrics["volume_mm3"]) < 1.0},
|
|
437
|
-
{"check": "step_roundtrip_valid", "expected": True, "actual": step_metrics["valid"], "pass": step_metrics["valid"]},
|
|
438
|
-
{"check": "stl_facets", "expected": "> 0", "actual": len(mesh.Facets), "pass": len(mesh.Facets) > 0},
|
|
439
|
-
{"check": "stl_bbox_x_mm", "expected": p["outer_diameter_mm"], "actual": float(mesh_bbox.XLength), "pass": abs(float(mesh_bbox.XLength) - p["outer_diameter_mm"]) < 0.2},
|
|
440
|
-
{"check": "stl_bbox_y_mm", "expected": p["outer_diameter_mm"], "actual": float(mesh_bbox.YLength), "pass": abs(float(mesh_bbox.YLength) - p["outer_diameter_mm"]) < 0.2},
|
|
441
|
-
{"check": "stl_bbox_z_mm", "expected": p["thickness_mm"], "actual": float(mesh_bbox.ZLength), "pass": abs(float(mesh_bbox.ZLength) - p["thickness_mm"]) < 0.2}
|
|
442
|
-
]
|
|
443
|
-
verification = {
|
|
444
|
-
"schema": "inneranimalmedia.cam.part-verification.v1",
|
|
445
|
-
"part_id": source["part_id"],
|
|
446
|
-
"revision": source["revision"],
|
|
447
|
-
"design_status": "proposal_not_approved",
|
|
448
|
-
"engine": {"name": "FreeCAD/OpenCASCADE", "version": ".".join(App.Version()[:3])},
|
|
449
|
-
"native_model": str(fcstd_path.name),
|
|
450
|
-
"step": {"file": step_path.name, "bytes": step_path.stat().st_size, "sha256": sha256(step_path), "metrics": step_metrics},
|
|
451
|
-
"mesh": {"file": stl_path.name, "bytes": stl_path.stat().st_size, "sha256": sha256(stl_path), "facets": len(mesh.Facets), "bounding_box_mm": {"x": float(mesh_bbox.XLength), "y": float(mesh_bbox.YLength), "z": float(mesh_bbox.ZLength)}},
|
|
452
|
-
"expected_volume_mm3": expected,
|
|
453
|
-
"native_metrics": native_metrics,
|
|
454
|
-
"transient_kernel_metrics_before_export": transient_kernel_metrics,
|
|
455
|
-
"warnings": [
|
|
456
|
-
{
|
|
457
|
-
"code": "freecad_transient_chamfer_bbox_cache",
|
|
458
|
-
"message": "The transient in-memory chamfer shape under-reports Y bounds by approximately 0.047 mm; the saved FCStd was reopened in a separate process and the STEP round-trip both verify the exact 150 mm envelope. Exported B-Rep metrics are used for the final dimensional checks."
|
|
459
|
-
}
|
|
460
|
-
] if abs(transient_kernel_metrics["bounding_box_mm"]["y"] - p["outer_diameter_mm"]) > 1e-4 else [],
|
|
461
|
-
"clearance_checks_mm": {
|
|
462
|
-
"counterbore_to_pocket": counterbore_clearance,
|
|
463
|
-
"bolt_hole_to_pocket": hole_clearances,
|
|
464
|
-
"pocket_to_outer_edge_before_chamfer": outer_edge_clearance,
|
|
465
|
-
"pocket_to_outer_edge_after_chamfer_minimum": outer_edge_clearance - p["outer_chamfer_mm"],
|
|
466
|
-
},
|
|
467
|
-
"checks": checks,
|
|
468
|
-
"all_checks_pass": all(row["pass"] for row in checks),
|
|
469
|
-
"assumptions": [
|
|
470
|
-
"6.6 mm holes are used as the nominal M6 clearance interpretation.",
|
|
471
|
-
"Only the top outside perimeter receives the 0.5 mm chamfer.",
|
|
472
|
-
"Bore is called out H7; the exact limit values require standards confirmation.",
|
|
473
|
-
"The 150 mm OD is a proposed geometry change and has not been approved.",
|
|
474
|
-
"This is not a manufacturing release."
|
|
475
|
-
],
|
|
476
|
-
}
|
|
477
|
-
write_json(output_dir / "verification.json", verification)
|
|
478
|
-
write_json(output_dir / "spec-feasibility.json", feasibility)
|
|
479
|
-
write_json(output_dir / "parameters-used.json", source)
|
|
480
|
-
|
|
481
|
-
result = {
|
|
482
|
-
"schema": "inneranimalmedia.cam.part-build.v1",
|
|
483
|
-
"ok": verification["all_checks_pass"],
|
|
484
|
-
"part_id": source["part_id"],
|
|
485
|
-
"revision": source["revision"],
|
|
486
|
-
"design_status": "proposal_not_approved",
|
|
487
|
-
"engine": {"name": "FreeCAD/OpenCASCADE", "version": ".".join(App.Version()[:3])},
|
|
488
|
-
"files": [
|
|
489
|
-
{"name": path.name, "bytes": path.stat().st_size, "sha256": sha256(path)}
|
|
490
|
-
for path in [fcstd_path, step_path, stl_path, output_dir / "verification.json", output_dir / "spec-feasibility.json", output_dir / "parameters-used.json"]
|
|
491
|
-
],
|
|
492
|
-
"verification": {
|
|
493
|
-
"all_checks_pass": verification["all_checks_pass"],
|
|
494
|
-
"check_count": len(checks),
|
|
495
|
-
"failed_checks": [row for row in checks if not row["pass"]],
|
|
496
|
-
"native_metrics": native_metrics,
|
|
497
|
-
"clearance_checks_mm": verification["clearance_checks_mm"],
|
|
498
|
-
},
|
|
499
|
-
"requested_spec_feasibility": feasibility,
|
|
500
|
-
}
|
|
501
|
-
write_json(output_dir / "build-result.json", result)
|
|
502
|
-
print(RESULT_PREFIX + json.dumps(result, sort_keys=True, separators=(",", ":")))
|
|
503
|
-
doc.recompute()
|
|
504
|
-
App.closeDocument(doc.Name)
|
|
505
|
-
return 0 if result["ok"] else 2
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
if __name__ == "__main__":
|
|
509
|
-
try:
|
|
510
|
-
raise SystemExit(main())
|
|
511
|
-
except Exception as exc:
|
|
512
|
-
traceback.print_exc(file=sys.stderr)
|
|
513
|
-
print(RESULT_PREFIX + json.dumps({"schema": "inneranimalmedia.cam.part-build.v1", "ok": False, "error": str(exc)}, sort_keys=True, separators=(",", ":")))
|
|
514
|
-
raise
|
package/packages/primetech-procedures/procedures/cad.motor-bearing-end-plate/finalize_bundle.py
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Create a manifest and ZIP from the durable output directory."""
|
|
3
|
-
import hashlib,json,sys,zipfile
|
|
4
|
-
from pathlib import Path
|
|
5
|
-
def sha256(p):
|
|
6
|
-
h=hashlib.sha256()
|
|
7
|
-
with p.open("rb") as f:
|
|
8
|
-
for c in iter(lambda:f.read(1024*1024),b""): h.update(c)
|
|
9
|
-
return h.hexdigest()
|
|
10
|
-
def main():
|
|
11
|
-
if len(sys.argv)!=2: raise SystemExit("usage: finalize_bundle.py output_dir")
|
|
12
|
-
root=Path(sys.argv[1]).resolve(strict=True)
|
|
13
|
-
manifest_path=root/"artifact-manifest.json"; bundle_path=root/"cam-motor-bearing-end-plate-bundle.zip"
|
|
14
|
-
files=[]
|
|
15
|
-
for p in sorted(root.rglob("*")):
|
|
16
|
-
if not p.is_file(): continue
|
|
17
|
-
rel=p.relative_to(root).as_posix()
|
|
18
|
-
if p in (manifest_path,bundle_path) or rel.startswith(".") or p.name==".DS_Store": continue
|
|
19
|
-
files.append({"path":rel,"bytes":p.stat().st_size,"sha256":sha256(p)})
|
|
20
|
-
manifest={"schema":"inneranimalmedia.cam.artifact-manifest.v1","project_key":"cam-motor-bearing-end-plate-001","part_id":"motor-bearing-end-plate","revision":"candidate-150mm-001","design_status":"proposal_not_approved","storage_contract":{"primary":"Cloudflare R2","mirror":"external removable volume","manifest_lists":["path","bytes","sha256"]},"bundle":bundle_path.name,"files":files}
|
|
21
|
-
manifest_path.write_text(json.dumps(manifest,indent=2,sort_keys=True)+"\n",encoding="utf-8")
|
|
22
|
-
with zipfile.ZipFile(bundle_path,"w",zipfile.ZIP_DEFLATED,compresslevel=6) as z:
|
|
23
|
-
for p in sorted(root.rglob("*")):
|
|
24
|
-
if p.is_file() and p!=bundle_path and not p.relative_to(root).as_posix().startswith(".") and p.name!=".DS_Store": z.write(p,p.relative_to(root).as_posix())
|
|
25
|
-
print(json.dumps({"ok":True,"file_count":len(files),"manifest":manifest_path.name,"bundle":bundle_path.name,"bundle_bytes":bundle_path.stat().st_size,"bundle_sha256":sha256(bundle_path)},sort_keys=True))
|
|
26
|
-
if __name__=="__main__": main()
|