@inneranimalmedia/agentsam-sdk 2.6.9 → 2.6.11
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 +21 -0
- package/TRADEMARKS.md +22 -0
- package/apps/README.md +3 -0
- package/apps/cad-creator/LICENSE +21 -0
- package/apps/cad-creator/README.md +4 -1
- package/apps/cad-creator/shared/cad/package.json +1 -1
- package/apps/client-cms-editor/LICENSE +21 -0
- package/apps/client-cms-editor/README.md +3 -0
- package/apps/client-cms-editor/backend/package.json +3 -3
- package/apps/client-cms-editor/frontend/package.json +4 -4
- package/apps/client-cms-editor/package-lock.json +43 -43
- package/apps/client-cms-editor/package.json +3 -3
- package/apps/client-cms-editor/reference/harvest/HARVEST_RECEIPT.json +1 -1
- package/apps/client-cms-editor/reference/harvest/README.md +1 -1
- package/apps/client-cms-editor/reference/harvest/plans/ARCHIVE-INTAKE.md +1 -1
- package/apps/client-cms-editor/reference/harvest/plans/HARVEST-INDEX.md +1 -1
- package/apps/client-cms-editor/reference/harvest/plans/TOOLING-LAB.md +1 -1
- package/apps/client-cms-editor/shared/cms/package.json +2 -2
- package/docs/MINI.md +4 -2
- package/docs/REPO_FILE_MAP.txt +0 -1
- package/docs/SOURCE_ARCHITECTURE.md +1 -1
- package/docs/architecture/DUAL_ANALYTICS_PRODUCT.md +140 -0
- package/docs/architecture/HOOKS-MODELS-SELF-HOSTING-PLAN.md +199 -0
- package/docs/content-studio/REVISION_GATE_2026-09-27.md +1 -1
- package/docs/engineering/go-portability/01-product-project-deployment-authority.md +69 -0
- package/docs/engineering/provider-internal-renames/01-lane-initialization.md +20 -0
- package/docs/engineering/provider-internal-renames/01a-runtime-environment-contract.md +115 -0
- package/docs/engineering/provider-internal-renames/02-cfoa.md +57 -0
- package/docs/engineering/provider-internal-renames/03-gclioa.md +32 -0
- package/docs/engineering/provider-internal-renames/04-goaude.md +50 -0
- package/docs/engineering/provider-internal-renames/05-gdrv.md +33 -0
- package/docs/engineering/provider-internal-renames/06-verification.md +103 -0
- package/docs/engineering/provider-internal-renames/README.md +77 -0
- package/docs/engineering/provider-internal-renames/runtime-environment-contract.json +220 -0
- package/docs/engineering/test-diagnostics/go-cli-test-hang-20261003.md +49 -0
- package/docs/engineering/test-diagnostics/go-skip-deploy-docker-fix.md +90 -0
- package/docs/knowledge-service-verification.md +3 -3
- package/docs/plans/AGENTSAM-SUSPEND-QUEUE-KNOWLEDGE-RDP-2026-10-03.md +870 -0
- package/docs/plans/LOCAL-STUDIO-GRADUATION-2026-09-26.md +9 -9
- package/docs/plans/MACHINE-FIRST-APPS-TUI-2026-09-24.md +11 -11
- package/docs/plans/RECONCILIATION-2026-09-19.md +6 -6
- package/docs/plans/SAM_WORK_PROTOCOL.md +667 -0
- package/docs/plans/TOMORROW-EXTENSIVE-TODO-2026-09-26.md +2 -2
- package/docs/plans/UNIVERSAL-INGEST-MACHINE-FIRST-2026-09-24.md +3 -3
- package/examples/hyperspace-demo/index.html +16 -0
- package/examples/hyperspace-demo/package.json +21 -0
- package/examples/hyperspace-demo/src/main.tsx +277 -0
- package/examples/hyperspace-demo/tsconfig.json +9 -0
- package/examples/hyperspace-demo/vite.config.ts +24 -0
- package/migrations/d1/0020_agentsam_receipt_catalog.sql +35 -0
- package/migrations/runtime/0005_agentsam_hooks.sql +87 -0
- package/migrations/runtime/0006_agent_run_suspend_activity.sql +53 -0
- package/migrations/runtime/0007_queue_control.sql +40 -0
- package/migrations/runtime/0008_agent_run_dependencies.sql +24 -0
- package/migrations/runtime/0008_analytics_legacy_bootstrap.sql +43 -0
- package/migrations/runtime/0009_analytics_authority.sql +108 -0
- package/package.json +45 -14
- package/packages/agentsam-brand/README.md +3 -0
- package/packages/agentsam-brand/package.json +2 -2
- package/packages/agentsam-brand/src/core/v2/compile.js +1 -1
- package/packages/agentsam-brand/src/core/v2/schema.js +1 -1
- package/packages/agentsam-contracts/dist/adapter.d.ts +22 -0
- package/packages/agentsam-contracts/dist/adapter.js +0 -0
- package/packages/agentsam-contracts/dist/agent.d.ts +66 -0
- package/packages/agentsam-contracts/dist/agent.js +15 -0
- package/packages/agentsam-contracts/dist/artifacts.d.ts +70 -0
- package/packages/agentsam-contracts/dist/artifacts.js +0 -0
- package/packages/agentsam-contracts/dist/authority.d.ts +21 -0
- package/packages/agentsam-contracts/dist/authority.js +0 -0
- package/packages/agentsam-contracts/dist/context.d.ts +14 -0
- package/packages/agentsam-contracts/dist/context.js +0 -0
- package/packages/agentsam-contracts/dist/errors.d.ts +121 -0
- package/packages/agentsam-contracts/dist/errors.js +5 -0
- package/packages/agentsam-contracts/dist/events.d.ts +53 -0
- package/packages/agentsam-contracts/dist/events.js +0 -0
- package/packages/agentsam-contracts/dist/execution.d.ts +38 -0
- package/packages/agentsam-contracts/dist/execution.js +0 -0
- package/packages/agentsam-contracts/dist/hooks.d.ts +31 -0
- package/packages/agentsam-contracts/dist/hooks.js +0 -0
- package/packages/agentsam-contracts/dist/identity.d.ts +15 -0
- package/packages/agentsam-contracts/dist/identity.js +0 -0
- package/packages/agentsam-contracts/dist/index.d.ts +16 -0
- package/packages/agentsam-contracts/dist/index.js +164 -0
- package/packages/agentsam-contracts/dist/models.d.ts +9 -0
- package/packages/agentsam-contracts/dist/models.js +0 -0
- package/packages/agentsam-contracts/dist/providers.d.ts +27 -0
- package/packages/agentsam-contracts/dist/providers.js +0 -0
- package/packages/agentsam-contracts/dist/repository.d.ts +56 -0
- package/packages/agentsam-contracts/dist/repository.js +15 -0
- package/packages/agentsam-contracts/dist/run.d.ts +113 -0
- package/packages/agentsam-contracts/dist/run.js +132 -0
- package/packages/agentsam-contracts/dist/tools.d.ts +82 -0
- package/packages/agentsam-contracts/dist/tools.js +0 -0
- package/packages/agentsam-contracts/dist/widgets.d.ts +38 -0
- package/packages/agentsam-contracts/dist/widgets.js +0 -0
- package/packages/agentsam-contracts/package.json +9 -1
- package/packages/agentsam-contracts/scripts/build.mjs +1 -1
- package/packages/agentsam-contracts/src/agent.ts +78 -3
- package/packages/agentsam-contracts/src/errors.ts +19 -10
- package/packages/agentsam-contracts/src/index.ts +2 -0
- package/packages/agentsam-contracts/src/run.ts +320 -0
- package/packages/agentsam-contracts/src/widgets.ts +58 -0
- package/packages/agentsam-contracts/test/contracts.test.mjs +1 -1
- package/packages/agentsam-contracts/test/run-contract.test.mjs +94 -0
- package/packages/agentsam-errors/package.json +11 -3
- package/packages/agentsam-errors/protocol/agentsam.error.v2.schema.json +821 -0
- package/packages/agentsam-errors/protocol/error-catalog.json +3512 -0
- package/packages/agentsam-errors/src/envelope.js +63 -11
- package/packages/agentsam-errors/src/error.js +6 -0
- package/packages/agentsam-errors/src/fingerprint.js +9 -1
- package/packages/agentsam-errors/src/normalize.js +51 -6
- package/packages/agentsam-errors/src/recovery.js +9 -35
- package/packages/agentsam-errors/src/transport.js +6 -1
- package/packages/agentsam-errors/src/vocabulary.js +515 -126
- package/packages/agentsam-errors/test/catalog-v2.test.mjs +106 -0
- package/packages/agentsam-errors/types/index.d.ts +157 -0
- package/packages/agentsam-goap/README.md +3 -0
- package/packages/agentsam-goap/package.json +2 -2
- package/packages/agentsam-hooks/README.md +206 -0
- package/packages/agentsam-hooks/bin/agentsam-hooks.mjs +64 -0
- package/packages/agentsam-hooks/bindings/go/command.go +55 -0
- package/packages/agentsam-hooks/bindings/go/errors_generated.go +402 -0
- package/packages/agentsam-hooks/bindings/go/go.mod +3 -0
- package/packages/agentsam-hooks/bindings/go/hooks.go +285 -0
- package/packages/agentsam-hooks/bindings/go/hooks_test.go +48 -0
- package/packages/agentsam-hooks/bindings/rust/Cargo.toml +11 -0
- package/packages/agentsam-hooks/bindings/rust/src/errors_generated.rs +396 -0
- package/packages/agentsam-hooks/bindings/rust/src/lib.rs +397 -0
- package/packages/agentsam-hooks/package.json +69 -0
- package/packages/agentsam-hooks/schema/manifest.json +54 -0
- package/packages/agentsam-hooks/scripts/clean-protocol.mjs +17 -0
- package/packages/agentsam-hooks/scripts/sync-protocol.mjs +27 -0
- package/packages/agentsam-hooks/src/adapters/agents.js +108 -0
- package/packages/agentsam-hooks/src/adapters/callback.js +4 -0
- package/packages/agentsam-hooks/src/adapters/capability.js +122 -0
- package/packages/agentsam-hooks/src/adapters/command.js +104 -0
- package/packages/agentsam-hooks/src/adapters/composite.js +31 -0
- package/packages/agentsam-hooks/src/adapters/http.js +58 -0
- package/packages/agentsam-hooks/src/adapters/lsp.js +116 -0
- package/packages/agentsam-hooks/src/adapters/mcp.js +76 -0
- package/packages/agentsam-hooks/src/adapters/provider.js +129 -0
- package/packages/agentsam-hooks/src/config.js +143 -0
- package/packages/agentsam-hooks/src/contracts.js +284 -0
- package/packages/agentsam-hooks/src/errors-generated.js +2732 -0
- package/packages/agentsam-hooks/src/index.d.ts +209 -0
- package/packages/agentsam-hooks/src/index.js +14 -0
- package/packages/agentsam-hooks/src/policy.js +34 -0
- package/packages/agentsam-hooks/src/runtime.js +312 -0
- package/packages/agentsam-hooks/src/store.js +264 -0
- package/packages/agentsam-hooks/test/adapters.test.mjs +216 -0
- package/packages/agentsam-hooks/test/runtime.test.mjs +258 -0
- package/packages/agentsam-knowledge/package.json +1 -1
- package/packages/agentsam-knowledge/src/backends/index.js +1 -1
- package/packages/agentsam-merch/README.md +62 -0
- package/packages/agentsam-merch/bin/agentsam-merch.mjs +16 -0
- package/packages/agentsam-merch/package.json +65 -0
- package/packages/agentsam-merch/profiles/completeful/dtg-back-large.json +42 -0
- package/packages/agentsam-merch/profiles/completeful/laser-engraving.json +39 -0
- package/packages/agentsam-merch/profiles/generic/embroidery-digitization.json +22 -0
- package/packages/agentsam-merch/schemas/collection-candidate.schema.json +66 -0
- package/packages/agentsam-merch/schemas/manufacturing-profile.schema.json +221 -0
- package/packages/agentsam-merch/src/adapters-completeful.js +50 -0
- package/packages/agentsam-merch/src/cli.js +93 -0
- package/packages/agentsam-merch/src/collection-lab.js +60 -0
- package/packages/agentsam-merch/src/compatibility.js +501 -0
- package/packages/agentsam-merch/src/derivatives.js +112 -0
- package/packages/agentsam-merch/src/index.d.ts +316 -0
- package/packages/agentsam-merch/src/index.js +46 -0
- package/packages/agentsam-merch/src/node/index.d.ts +58 -0
- package/packages/agentsam-merch/src/node/index.js +6 -0
- package/packages/agentsam-merch/src/node/raster.js +142 -0
- package/packages/agentsam-merch/src/node/vector.js +239 -0
- package/packages/agentsam-merch/src/product-concepts.js +118 -0
- package/packages/agentsam-merch/src/profile-registry.js +104 -0
- package/packages/agentsam-merch/src/profile.js +158 -0
- package/packages/agentsam-merch/src/transforms.js +215 -0
- package/packages/agentsam-merch/test/merch.test.mjs +332 -0
- package/packages/agentsam-merch/test/node-transforms.test.mjs +149 -0
- package/packages/agentsam-nav/dist/Nav.d.ts +43 -0
- package/packages/agentsam-nav/dist/NavCollapsible.d.ts +10 -0
- package/packages/agentsam-nav/dist/NavContent.d.ts +2 -0
- package/packages/agentsam-nav/dist/NavFooter.d.ts +2 -0
- package/packages/agentsam-nav/dist/NavGroup.d.ts +3 -0
- package/packages/agentsam-nav/dist/NavHeader.d.ts +2 -0
- package/packages/agentsam-nav/dist/NavMenu.d.ts +22 -0
- package/packages/agentsam-nav/dist/NavProvider.d.ts +35 -0
- package/packages/agentsam-nav/dist/NavTrigger.d.ts +2 -0
- package/packages/agentsam-nav/dist/Surfaces.d.ts +41 -0
- package/packages/agentsam-nav/dist/browser.d.ts +11 -0
- package/packages/agentsam-nav/dist/browser.global.js +172 -0
- package/packages/agentsam-nav/dist/browser.js +9688 -0
- package/packages/agentsam-nav/dist/contracts.d.ts +76 -0
- package/packages/agentsam-nav/dist/index.d.ts +11 -0
- package/packages/agentsam-nav/dist/index.js +9689 -0
- package/packages/agentsam-nav/dist/legacy.css +83 -0
- package/packages/agentsam-nav/dist/shell.css +113 -0
- package/packages/agentsam-nav/dist/theme.css +113 -0
- package/packages/agentsam-nav/dist/utils.d.ts +1 -0
- package/packages/agentsam-nav/package.json +1 -1
- package/packages/agentsam-queue-control/README.md +4 -1
- package/packages/agentsam-queue-control/package.json +4 -3
- package/packages/agentsam-queue-control/schemas/job-envelope.schema.json +111 -11
- package/packages/agentsam-queue-control/src/adapters/cloudflare.js +34 -6
- package/packages/agentsam-queue-control/src/adapters/memory.js +11 -2
- package/packages/agentsam-queue-control/src/adapters/sqlite.js +259 -0
- package/packages/agentsam-queue-control/src/contracts.js +207 -3
- package/packages/agentsam-queue-control/src/control-plane.js +62 -2
- package/packages/agentsam-queue-control/src/index.js +1 -0
- package/packages/agentsam-queue-control/test/queue-control.test.mjs +310 -0
- package/packages/agentsam-queue-control/test/sqlite-adapter.test.mjs +91 -0
- package/packages/agentsam-rapid-rust/README.md +3 -0
- package/packages/agentsam-repository/README.md +3 -0
- package/packages/agentsam-repository/package.json +1 -1
- package/packages/agentsam-vault/package.json +1 -1
- package/packages/agentsam-workbench/README.md +43 -0
- package/packages/agentsam-workbench/package.json +14 -4
- package/packages/agentsam-workbench/src/agent/AgentConversationSurface.tsx +108 -0
- package/packages/agentsam-workbench/src/agent/AgentPanel.tsx +25 -8
- package/packages/agentsam-workbench/src/agent/AgentRuntimeField.tsx +152 -0
- package/packages/agentsam-workbench/src/agent/Composer.tsx +10 -1
- package/packages/agentsam-workbench/src/agent/RunMode.ts +26 -0
- package/packages/agentsam-workbench/src/agent/Thread.tsx +18 -3
- package/packages/agentsam-workbench/src/agent/index.ts +3 -0
- package/packages/agentsam-workbench/src/index.ts +4 -0
- package/packages/agentsam-workbench/src/manufacturing/PreflightIndicator.tsx +203 -0
- package/packages/agentsam-workbench/src/manufacturing/index.ts +2 -0
- package/packages/agentsam-workbench/src/manufacturing/loading.ts +147 -0
- package/packages/agentsam-workbench/src/widgets/BuiltinWidget.tsx +22 -0
- package/packages/agentsam-workbench/src/widgets/CountdownWidget.tsx +68 -0
- package/packages/agentsam-workbench/src/widgets/WidgetFrame.tsx +56 -0
- package/packages/agentsam-workbench/src/widgets/countdown.ts +25 -0
- package/packages/agentsam-workbench/src/widgets/index.ts +6 -0
- package/packages/agentsam-workbench/src/widgets/registry.ts +13 -0
- package/packages/agentsam-workbench/src/widgets/useCountdown.ts +128 -0
- package/packages/agentsam-workbench/src/widgets/widgets.css +102 -0
- package/packages/connectors/{cloudflare → cfoa}/package.json +3 -3
- package/packages/heuristic-theme/package.json +1 -1
- package/packages/identity/README.md +3 -0
- package/packages/identity/backend/README.md +3 -0
- package/packages/identity/package.json +2 -2
- package/packages/identity/src/frontend/auth-portal/README.md +3 -0
- package/packages/identity/src/index.js +1 -1
- package/packages/identity/src/oauth/README.md +4 -1
- package/packages/identity/src/oauth/credentials.js +1 -1
- package/packages/identity/src/server/worker-router.js +1 -1
- package/packages/identity/tests/google-desktop-identity-login.test.mjs +1 -1
- package/packages/identity/tests/lane1-packed-consumer.test.mjs +1 -1
- package/packages/identity/tests/oauth-presets-accounts-ssot.test.mjs +1 -1
- package/packages/providers/completeful/package.json +1 -1
- package/packages/theme-church-site/package.json +2 -2
- package/packages/theme-companions-site/package.json +2 -2
- package/packages/theme-floors-site/package.json +2 -2
- package/packages/theme-fuelnfree-site/package.json +2 -2
- package/packages/theme-handyman-site/package.json +2 -2
- package/packages/theme-insurance-site/package.json +2 -2
- package/packages/theme-scenes/package.json +1 -1
- package/packages/theme-shinshu-site/package.json +2 -2
- package/packages/work-graph/package.json +1 -1
- package/protocol/apps/agentsam.app.v1.schema.json +1 -1
- package/protocol/apps/agentsam.host-install.v1.schema.json +1 -1
- package/protocol/assets/asset-record.v1.schema.json +1 -1
- package/protocol/brand/brandpack.v1.schema.json +1 -1
- package/protocol/capabilities/capability-manifest.schema.json +1 -1
- package/protocol/capabilities/knowledge-search-input.schema.json +1 -0
- package/protocol/credentials/issue.v1.schema.json +1 -1
- package/protocol/database/agentsam.schema-pack.v1.schema.json +1 -1
- package/protocol/database/connection.v1.schema.json +1 -1
- package/protocol/embeddings/embedding-profile.v1.schema.json +1 -1
- package/protocol/errors/README.md +36 -0
- package/protocol/errors/agentsam.error.v2.schema.json +821 -0
- package/protocol/errors/error-catalog.json +3506 -158
- package/protocol/errors/error-envelope.schema.json +195 -52
- package/protocol/errors/recovery.v1.schema.json +1 -1
- package/protocol/features/agentsam.feature.v1.schema.json +1 -1
- package/protocol/hooks/README.md +18 -0
- package/protocol/hooks/agentsam.hook.output.v1.schema.json +27 -0
- package/protocol/hooks/agentsam.hook.receipt.v1.schema.json +61 -0
- package/protocol/hooks/agentsam.hook.v1.schema.json +35 -0
- package/protocol/hooks/agentsam.hooks.config.v1.schema.json +78 -0
- package/protocol/local-engine/benchmark.v1.schema.json +1 -1
- package/protocol/local-engine/engine.v1.schema.json +1 -1
- package/protocol/models/README.md +3 -0
- package/protocol/models/model-inventory-v2.schema.json +1 -1
- package/protocol/models/provider-model-snapshot.v1.schema.json +22 -0
- package/protocol/receipts/agentsam.receipt.v1.json +95 -0
- package/protocol/rpc/v1/errors.proto +1 -0
- package/protocol/runtime/agentsam.runtime.v1.schema.json +1 -1
- package/protocol/runtime/workspace-fs.v1.schema.json +1 -1
- package/protocol/sam/activity.v1.schema.json +1 -1
- package/protocol/sam/answer.v1.schema.json +1 -1
- package/protocol/sam/calibration.v1.schema.json +1 -1
- package/protocol/sam/decision-receipt.v1.schema.json +1 -1
- package/protocol/sam/evaluation.v1.schema.json +1 -1
- package/protocol/sam/operation.schema.json +1 -1
- package/protocol/sam/outcome.v1.schema.json +1 -1
- package/protocol/sam/question.v1.schema.json +1 -1
- package/protocol/sam/result.schema.json +1 -1
- package/protocol/sam/state.v1.schema.json +1 -1
- package/protocol/scoring/scorecard.v1.schema.json +1 -1
- package/protocol/skills/agentsam.interaction.v1.schema.json +1 -1
- package/protocol/skills/agentsam.skill.v1.schema.json +1 -1
- package/protocol/theme-refinery/product-metadata.schema.json +1 -1
- package/protocol/theme-refinery/receipts/products-registry-batch-20260924.json +6 -6
- package/protocol/theme-refinery/receipts/theme-harvest-20260924.json +6 -6
- package/protocol/theme-refinery/reconciliation-receipt.schema.json +1 -1
- package/protocol/ui/icon.v1.schema.json +1 -1
- package/python/README.md +20 -0
- package/python/agentsam_sdk/errors/__init__.py +4 -0
- package/python/agentsam_sdk/errors/vocabulary.py +2730 -0
- package/python/agentsam_sdk/hooks/__init__.py +32 -0
- package/python/agentsam_sdk/hooks/adapters.py +132 -0
- package/python/agentsam_sdk/hooks/contracts.py +121 -0
- package/python/agentsam_sdk/hooks/runtime.py +253 -0
- package/python/tests/test_hooks.py +115 -0
- package/skills/README.md +3 -0
- package/src/acp/agent-executor.js +106 -0
- package/src/acp/client.js +316 -0
- package/src/acp/dependencies.js +426 -0
- package/src/acp/http.js +207 -0
- package/src/acp/index.js +22 -0
- package/src/acp/runs.js +125 -0
- package/src/acp/runtime-selection.js +180 -0
- package/src/agent/responses-runner.js +145 -1
- package/src/cli/command-catalog.js +4 -0
- package/src/cli.js +33 -0
- package/src/commands/cheat-sheet.js +1 -0
- package/src/commands/cloudflare-login.js +1 -1
- package/src/commands/cloudflare.js +2 -2
- package/src/commands/connections.js +1 -1
- package/src/commands/go.js +76 -6
- package/src/commands/hooks.js +260 -0
- package/src/commands/merch.js +5 -0
- package/src/commands/mini.js +1 -1
- package/src/commands/models.js +1 -1
- package/src/commands/receipts.js +140 -0
- package/src/commands/run.js +253 -0
- package/src/commands/shell.js +114 -9
- package/src/errors/diagnostic.js +9 -9
- package/src/go/container.js +1 -1
- package/src/go/contract.js +61 -18
- package/src/go/discover.js +0 -4
- package/src/go/index.js +13 -1
- package/src/go/probe.js +109 -0
- package/src/go/{cloudflare.js → providers/cloudflare.js} +36 -136
- package/src/go/verify.js +1 -1
- package/src/index.js +32 -0
- package/src/indexing/ingest/inventory.js +1 -1
- package/src/knowledge/service/grpc-codec.js +2 -0
- package/src/lib/deploy/local-studio.js +2 -2
- package/src/lib/mini/scaffold.js +1 -1
- package/src/lib/slash-commands.js +1 -0
- package/src/lib/whoami-capabilities.js +1 -1
- package/src/local/runtime-store.js +54 -0
- package/src/mcp/cloudflare-bundles.js +1 -1
- package/src/models/catalog.js +0 -49
- package/src/models/inventory-core.js +69 -0
- package/src/plugins/index.js +9 -1
- package/src/plugins/registry.js +115 -6
- package/src/receipts/contract.js +68 -0
- package/src/receipts/index.js +20 -0
- package/src/receipts/prune.js +64 -0
- package/src/receipts/sinks.js +285 -0
- package/src/rpc/generated/errors_pb.js +49 -1
- package/src/tools/runtime.js +13 -5
- package/templates/mini/gadget/app.js +15 -40
- package/templates/mini/gadget/index.html +7 -7
- package/templates/mini/shared/style.css +1 -1
- /package/packages/connectors/{cloudflare → cfoa}/OAUTH_STORAGE_AUDIT.md +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/api-client.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/capabilities.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/credential.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/brand-protection.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/keyless.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/pages.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/scanner.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/snippets.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/tag-gateway.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/tags.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/token-validation.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/vectorize.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/workflows.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/index.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/oauth-persist.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/owner.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/permission-options.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/routes.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/scope-catalog.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/vault.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/tests/capabilities.test.mjs +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/tests/connector.test.mjs +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/tests/oauth-persist.test.mjs +0 -0
- /package/packages/identity/src/oauth/{google-desktop-exchange.js → goaude.js} +0 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { useEffect, useRef, type CSSProperties } from 'react';
|
|
2
|
+
import type {
|
|
3
|
+
LoadingSceneController,
|
|
4
|
+
ScenePreset,
|
|
5
|
+
} from '@inneranimalmedia/agentsam-loading-scene';
|
|
6
|
+
import {
|
|
7
|
+
HyperspaceRenderer,
|
|
8
|
+
computationalHyperspace,
|
|
9
|
+
} from '@inneranimalmedia/agentsam-loading-scene';
|
|
10
|
+
import {
|
|
11
|
+
LoadingSceneNarration,
|
|
12
|
+
useLoadingScene,
|
|
13
|
+
} from '@inneranimalmedia/agentsam-loading-scene/react';
|
|
14
|
+
|
|
15
|
+
export type AgentRuntimeFieldProps = {
|
|
16
|
+
controller: LoadingSceneController;
|
|
17
|
+
preset?: ScenePreset;
|
|
18
|
+
blocking?: boolean;
|
|
19
|
+
className?: string;
|
|
20
|
+
style?: CSSProperties;
|
|
21
|
+
activeOpacity?: number;
|
|
22
|
+
passiveOpacity?: number;
|
|
23
|
+
narration?: boolean;
|
|
24
|
+
narrationStyle?: CSSProperties;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Reusable workbench runtime surface.
|
|
29
|
+
*
|
|
30
|
+
* Product apps own runtime state and event production. This primitive owns the
|
|
31
|
+
* presentation contract: one persistent semantic scene, task-aware narration,
|
|
32
|
+
* resize handling and blocking/non-blocking composition.
|
|
33
|
+
*/
|
|
34
|
+
export function AgentRuntimeField({
|
|
35
|
+
controller,
|
|
36
|
+
preset = computationalHyperspace,
|
|
37
|
+
blocking = false,
|
|
38
|
+
className,
|
|
39
|
+
style,
|
|
40
|
+
activeOpacity = 1,
|
|
41
|
+
passiveOpacity = 0.34,
|
|
42
|
+
narration = true,
|
|
43
|
+
narrationStyle,
|
|
44
|
+
}: AgentRuntimeFieldProps) {
|
|
45
|
+
const scene = useLoadingScene(controller);
|
|
46
|
+
const hostRef = useRef<HTMLDivElement | null>(null);
|
|
47
|
+
const canvasRef = useRef<HTMLCanvasElement | null>(null);
|
|
48
|
+
const rendererRef = useRef<HyperspaceRenderer | null>(null);
|
|
49
|
+
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
const host = hostRef.current;
|
|
52
|
+
const canvas = canvasRef.current;
|
|
53
|
+
if (!host || !canvas) return;
|
|
54
|
+
|
|
55
|
+
const renderer = new HyperspaceRenderer(preset, {
|
|
56
|
+
canvas,
|
|
57
|
+
reducedMotion: 'auto',
|
|
58
|
+
});
|
|
59
|
+
rendererRef.current = renderer;
|
|
60
|
+
|
|
61
|
+
const fit = () => renderer.setSize(host.clientWidth, host.clientHeight);
|
|
62
|
+
fit();
|
|
63
|
+
|
|
64
|
+
const observer =
|
|
65
|
+
typeof ResizeObserver !== 'undefined' ? new ResizeObserver(fit) : null;
|
|
66
|
+
observer?.observe(host);
|
|
67
|
+
renderer.setScene(controller.getScene());
|
|
68
|
+
|
|
69
|
+
return () => {
|
|
70
|
+
observer?.disconnect();
|
|
71
|
+
renderer.dispose();
|
|
72
|
+
rendererRef.current = null;
|
|
73
|
+
};
|
|
74
|
+
}, [controller, preset]);
|
|
75
|
+
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
const renderer = rendererRef.current;
|
|
78
|
+
if (!renderer) return;
|
|
79
|
+
|
|
80
|
+
renderer.setScene(scene);
|
|
81
|
+
if (
|
|
82
|
+
scene.status === 'running' ||
|
|
83
|
+
scene.status === 'waiting' ||
|
|
84
|
+
scene.status === 'error'
|
|
85
|
+
) {
|
|
86
|
+
renderer.resume();
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const timeout = window.setTimeout(
|
|
91
|
+
() => renderer.suspend(),
|
|
92
|
+
preset.transition.settleMs + 300,
|
|
93
|
+
);
|
|
94
|
+
return () => window.clearTimeout(timeout);
|
|
95
|
+
}, [scene, preset]);
|
|
96
|
+
|
|
97
|
+
const active =
|
|
98
|
+
blocking ||
|
|
99
|
+
scene.status === 'running' ||
|
|
100
|
+
scene.status === 'waiting' ||
|
|
101
|
+
scene.status === 'error';
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<div
|
|
105
|
+
ref={hostRef}
|
|
106
|
+
data-agent-runtime-field=""
|
|
107
|
+
aria-hidden={active ? undefined : true}
|
|
108
|
+
className={className}
|
|
109
|
+
style={{
|
|
110
|
+
position: 'absolute',
|
|
111
|
+
inset: 0,
|
|
112
|
+
overflow: 'hidden',
|
|
113
|
+
pointerEvents: blocking ? 'auto' : 'none',
|
|
114
|
+
opacity: active ? 1 : 0,
|
|
115
|
+
transition: 'opacity 500ms ease',
|
|
116
|
+
background: blocking ? preset.palette.canvas : 'transparent',
|
|
117
|
+
...style,
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
<canvas
|
|
121
|
+
ref={canvasRef}
|
|
122
|
+
aria-hidden="true"
|
|
123
|
+
style={{
|
|
124
|
+
position: 'absolute',
|
|
125
|
+
inset: 0,
|
|
126
|
+
width: '100%',
|
|
127
|
+
height: '100%',
|
|
128
|
+
opacity: blocking ? activeOpacity : passiveOpacity,
|
|
129
|
+
}}
|
|
130
|
+
/>
|
|
131
|
+
|
|
132
|
+
{active && narration ? (
|
|
133
|
+
<LoadingSceneNarration
|
|
134
|
+
controller={controller}
|
|
135
|
+
preset={preset}
|
|
136
|
+
align={blocking ? 'center' : 'start'}
|
|
137
|
+
showStudy
|
|
138
|
+
showMeta
|
|
139
|
+
style={{
|
|
140
|
+
position: 'absolute',
|
|
141
|
+
left: blocking ? '50%' : 18,
|
|
142
|
+
top: blocking ? '50%' : 'auto',
|
|
143
|
+
bottom: blocking ? 'auto' : 18,
|
|
144
|
+
transform: blocking ? 'translate(-50%, -50%)' : undefined,
|
|
145
|
+
pointerEvents: 'none',
|
|
146
|
+
...narrationStyle,
|
|
147
|
+
}}
|
|
148
|
+
/>
|
|
149
|
+
) : null}
|
|
150
|
+
</div>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useRef, type KeyboardEvent, type ReactNode, type TextareaHTMLAttributes } from 'react';
|
|
2
|
+
import type { AgentRunMode } from '@inneranimalmedia/agentsam-contracts';
|
|
2
3
|
|
|
3
4
|
export interface AgentComposerProps {
|
|
4
5
|
value: string;
|
|
@@ -17,6 +18,8 @@ export interface AgentComposerProps {
|
|
|
17
18
|
toolbarClassName?: string;
|
|
18
19
|
textareaProps?: Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'value' | 'onChange' | 'placeholder'>;
|
|
19
20
|
maxHeight?: number;
|
|
21
|
+
/** Semantic run mode. Hosts own behavior; the primitive exposes it for accessible styling. */
|
|
22
|
+
runMode?: AgentRunMode;
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
/**
|
|
@@ -43,6 +46,7 @@ export function AgentComposer({
|
|
|
43
46
|
toolbarClassName,
|
|
44
47
|
textareaProps,
|
|
45
48
|
maxHeight = 220,
|
|
49
|
+
runMode = 'agent',
|
|
46
50
|
}: AgentComposerProps) {
|
|
47
51
|
const areaRef = useRef<HTMLTextAreaElement>(null);
|
|
48
52
|
|
|
@@ -66,7 +70,12 @@ export function AgentComposer({
|
|
|
66
70
|
const defaultStop = <button type="button" onClick={() => void onCancel?.()}>Stop</button>;
|
|
67
71
|
|
|
68
72
|
return (
|
|
69
|
-
<div
|
|
73
|
+
<div
|
|
74
|
+
className={containerClassName}
|
|
75
|
+
data-agent-composer=""
|
|
76
|
+
data-agent-mode={runMode}
|
|
77
|
+
aria-busy={streaming || undefined}
|
|
78
|
+
>
|
|
70
79
|
<textarea
|
|
71
80
|
{...textareaProps}
|
|
72
81
|
ref={areaRef}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AgentRunMode } from '@inneranimalmedia/agentsam-contracts';
|
|
2
|
+
|
|
3
|
+
export type AgentRunModeTone = 'blue' | 'yellow' | 'red' | 'multicolor' | 'green';
|
|
4
|
+
|
|
5
|
+
export type AgentRunModeProfile = Readonly<{
|
|
6
|
+
id: AgentRunMode;
|
|
7
|
+
label: string;
|
|
8
|
+
description: string;
|
|
9
|
+
tone: AgentRunModeTone;
|
|
10
|
+
}>;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Presentation metadata for the canonical AgentSam run modes.
|
|
14
|
+
* Runtime meaning remains owned by @inneranimalmedia/agentsam-contracts.
|
|
15
|
+
*/
|
|
16
|
+
export const AGENT_RUN_MODE_PROFILES: readonly AgentRunModeProfile[] = Object.freeze([
|
|
17
|
+
{ id: 'agent', label: 'Agent', description: 'Execute and open surfaces', tone: 'blue' },
|
|
18
|
+
{ id: 'plan', label: 'Plan', description: 'Design technical plans', tone: 'yellow' },
|
|
19
|
+
{ id: 'debug', label: 'Debug', description: 'Inspect, prove, and fix', tone: 'red' },
|
|
20
|
+
{ id: 'multitask', label: 'Multitask', description: 'Coordinate managed workflows', tone: 'multicolor' },
|
|
21
|
+
{ id: 'ask', label: 'Ask', description: 'Talk and answer questions', tone: 'green' },
|
|
22
|
+
]);
|
|
23
|
+
|
|
24
|
+
export function agentRunModeProfile(mode: AgentRunMode): AgentRunModeProfile {
|
|
25
|
+
return AGENT_RUN_MODE_PROFILES.find((profile) => profile.id === mode) ?? AGENT_RUN_MODE_PROFILES[0]!;
|
|
26
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect, useRef, type ReactNode, type UIEvent } from 'react';
|
|
1
|
+
import { useEffect, useRef, type CSSProperties, type ReactNode, type UIEvent } from 'react';
|
|
2
2
|
import type { AgentMessage } from '@inneranimalmedia/agentsam-contracts';
|
|
3
3
|
|
|
4
4
|
export interface AgentThreadProps {
|
|
@@ -8,6 +8,8 @@ export interface AgentThreadProps {
|
|
|
8
8
|
empty?: ReactNode;
|
|
9
9
|
scrollerClassName?: string;
|
|
10
10
|
listClassName?: string;
|
|
11
|
+
scrollerStyle?: CSSProperties;
|
|
12
|
+
listStyle?: CSSProperties;
|
|
11
13
|
stickThreshold?: number;
|
|
12
14
|
}
|
|
13
15
|
|
|
@@ -18,6 +20,8 @@ export function AgentThread({
|
|
|
18
20
|
empty = null,
|
|
19
21
|
scrollerClassName,
|
|
20
22
|
listClassName,
|
|
23
|
+
scrollerStyle,
|
|
24
|
+
listStyle,
|
|
21
25
|
stickThreshold = 80,
|
|
22
26
|
}: AgentThreadProps) {
|
|
23
27
|
const scroller = useRef<HTMLDivElement>(null);
|
|
@@ -35,8 +39,19 @@ export function AgentThread({
|
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
return (
|
|
38
|
-
<div
|
|
39
|
-
|
|
42
|
+
<div
|
|
43
|
+
ref={scroller}
|
|
44
|
+
className={scrollerClassName}
|
|
45
|
+
data-agent-thread=""
|
|
46
|
+
onScroll={onScroll}
|
|
47
|
+
style={
|
|
48
|
+
scrollerStyle ??
|
|
49
|
+
(scrollerClassName
|
|
50
|
+
? undefined
|
|
51
|
+
: { minHeight: 0, flex: 1, overflowY: 'auto' })
|
|
52
|
+
}
|
|
53
|
+
>
|
|
54
|
+
<div className={listClassName} style={listStyle}>
|
|
40
55
|
{messages.length === 0
|
|
41
56
|
? empty
|
|
42
57
|
: messages.map((message, index) =>
|
|
@@ -2,6 +2,7 @@ export * from './AgentPanel';
|
|
|
2
2
|
export * from './Thread';
|
|
3
3
|
export * from './Composer';
|
|
4
4
|
export * from './ModelSelect';
|
|
5
|
+
export * from './RunMode';
|
|
5
6
|
export * from './ToolReceipt';
|
|
6
7
|
export * from './ArtifactCard';
|
|
7
8
|
export * from './ConnectedAgentPanel';
|
|
@@ -10,3 +11,5 @@ export * from './MiniAgentSam';
|
|
|
10
11
|
export * from './ContextualComposer';
|
|
11
12
|
|
|
12
13
|
export * from './ToolPermissionRequest';
|
|
14
|
+
export * from './AgentConversationSurface';
|
|
15
|
+
export * from './AgentRuntimeField';
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type PreflightStatus =
|
|
4
|
+
| 'ready'
|
|
5
|
+
| 'ready_with_warning'
|
|
6
|
+
| 'ready_with_transform'
|
|
7
|
+
| 'prepared_for_digitization'
|
|
8
|
+
| 'needs_variant'
|
|
9
|
+
| 'unsupported';
|
|
10
|
+
|
|
11
|
+
export interface PreflightIssueView {
|
|
12
|
+
code: string;
|
|
13
|
+
message: string;
|
|
14
|
+
action?: string | null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface PreflightIndicatorProps {
|
|
18
|
+
status: PreflightStatus;
|
|
19
|
+
effectivePpi?: number | null;
|
|
20
|
+
readyPpi?: number | null;
|
|
21
|
+
minimumPpi?: number | null;
|
|
22
|
+
issues?: readonly PreflightIssueView[];
|
|
23
|
+
actions?: readonly string[];
|
|
24
|
+
onAction?: (action: string) => void;
|
|
25
|
+
compact?: boolean;
|
|
26
|
+
title?: ReactNode;
|
|
27
|
+
className?: string;
|
|
28
|
+
style?: CSSProperties;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const STATUS_COPY: Record<PreflightStatus, { label: string; tone: string }> = {
|
|
32
|
+
ready: { label: 'Production ready', tone: 'ready' },
|
|
33
|
+
ready_with_warning: { label: 'Usable with warning', tone: 'warning' },
|
|
34
|
+
ready_with_transform: { label: 'Quick fix available', tone: 'transform' },
|
|
35
|
+
prepared_for_digitization: { label: 'Prepared for digitization', tone: 'handoff' },
|
|
36
|
+
needs_variant: { label: 'Needs another asset variant', tone: 'error' },
|
|
37
|
+
unsupported: { label: 'Unsupported for this process', tone: 'error' },
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const ACTION_LABELS: Record<string, string> = {
|
|
41
|
+
trim_alpha: 'Auto-Crop Alpha',
|
|
42
|
+
vectorize_monochrome: 'Convert to Monochrome Vector',
|
|
43
|
+
scale_to_safe_zone: 'Scale to Fit Safe Zone',
|
|
44
|
+
normalize_svg: 'Normalize SVG',
|
|
45
|
+
outline_text: 'Outline Text',
|
|
46
|
+
lossless_optimize: 'Optimize Losslessly',
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
function labelForAction(action: string) {
|
|
50
|
+
if (ACTION_LABELS[action]) return ACTION_LABELS[action];
|
|
51
|
+
if (action.startsWith('normalize_color_space:')) return 'Normalize Color';
|
|
52
|
+
if (action.startsWith('convert:')) return 'Convert Format';
|
|
53
|
+
if (action.startsWith('rasterize:')) return 'Rasterize for Print';
|
|
54
|
+
return action
|
|
55
|
+
.replace(/[:_-]+/g, ' ')
|
|
56
|
+
.replace(/\b\w/g, (value) => value.toUpperCase());
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function qualityPercent(
|
|
60
|
+
effectivePpi: number | null | undefined,
|
|
61
|
+
readyPpi: number | null | undefined,
|
|
62
|
+
) {
|
|
63
|
+
if (!effectivePpi || !readyPpi) return null;
|
|
64
|
+
return Math.max(0, Math.min(100, (effectivePpi / readyPpi) * 100));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function PreflightIndicator({
|
|
68
|
+
status,
|
|
69
|
+
effectivePpi,
|
|
70
|
+
readyPpi,
|
|
71
|
+
minimumPpi,
|
|
72
|
+
issues = [],
|
|
73
|
+
actions = [],
|
|
74
|
+
onAction,
|
|
75
|
+
compact = false,
|
|
76
|
+
title = 'Print quality',
|
|
77
|
+
className,
|
|
78
|
+
style,
|
|
79
|
+
}: PreflightIndicatorProps) {
|
|
80
|
+
const state = STATUS_COPY[status];
|
|
81
|
+
const quality = qualityPercent(effectivePpi, readyPpi);
|
|
82
|
+
const uniqueActions = [...new Set(actions)];
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<section
|
|
86
|
+
className={className}
|
|
87
|
+
data-agentsam-preflight=""
|
|
88
|
+
data-preflight-status={status}
|
|
89
|
+
data-preflight-tone={state.tone}
|
|
90
|
+
style={{
|
|
91
|
+
border: '1px solid var(--agentsam-preflight-border, rgba(90, 92, 98, 0.24))',
|
|
92
|
+
borderRadius: 12,
|
|
93
|
+
padding: compact ? 10 : 14,
|
|
94
|
+
background: 'var(--agentsam-preflight-bg, rgba(255,255,255,0.72))',
|
|
95
|
+
display: 'grid',
|
|
96
|
+
gap: compact ? 8 : 10,
|
|
97
|
+
...style,
|
|
98
|
+
}}
|
|
99
|
+
>
|
|
100
|
+
<div
|
|
101
|
+
style={{
|
|
102
|
+
display: 'flex',
|
|
103
|
+
alignItems: 'baseline',
|
|
104
|
+
justifyContent: 'space-between',
|
|
105
|
+
gap: 12,
|
|
106
|
+
}}
|
|
107
|
+
>
|
|
108
|
+
<strong style={{ fontSize: compact ? 12 : 13, fontWeight: 650 }}>{title}</strong>
|
|
109
|
+
<span
|
|
110
|
+
data-preflight-state=""
|
|
111
|
+
style={{
|
|
112
|
+
fontSize: 11,
|
|
113
|
+
opacity: 0.72,
|
|
114
|
+
textAlign: 'right',
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
{state.label}
|
|
118
|
+
</span>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
{quality != null ? (
|
|
122
|
+
<div style={{ display: 'grid', gap: 5 }}>
|
|
123
|
+
<div
|
|
124
|
+
aria-label={`Effective print resolution ${Math.round(effectivePpi!)} PPI`}
|
|
125
|
+
role="meter"
|
|
126
|
+
aria-valuemin={0}
|
|
127
|
+
aria-valuemax={readyPpi || 300}
|
|
128
|
+
aria-valuenow={Math.round(effectivePpi!)}
|
|
129
|
+
style={{
|
|
130
|
+
height: 5,
|
|
131
|
+
borderRadius: 999,
|
|
132
|
+
overflow: 'hidden',
|
|
133
|
+
background: 'var(--agentsam-preflight-track, rgba(90,92,98,0.14))',
|
|
134
|
+
}}
|
|
135
|
+
>
|
|
136
|
+
<div
|
|
137
|
+
style={{
|
|
138
|
+
height: '100%',
|
|
139
|
+
width: `${quality}%`,
|
|
140
|
+
borderRadius: 'inherit',
|
|
141
|
+
background:
|
|
142
|
+
status === 'needs_variant' || status === 'unsupported'
|
|
143
|
+
? 'var(--agentsam-preflight-error, #9f4d4d)'
|
|
144
|
+
: status === 'ready_with_warning'
|
|
145
|
+
? 'var(--agentsam-preflight-warning, #a87320)'
|
|
146
|
+
: 'var(--agentsam-preflight-ready, #54745b)',
|
|
147
|
+
transition: 'width 120ms ease',
|
|
148
|
+
}}
|
|
149
|
+
/>
|
|
150
|
+
</div>
|
|
151
|
+
<div
|
|
152
|
+
style={{
|
|
153
|
+
display: 'flex',
|
|
154
|
+
gap: 10,
|
|
155
|
+
fontSize: 11,
|
|
156
|
+
opacity: 0.72,
|
|
157
|
+
}}
|
|
158
|
+
>
|
|
159
|
+
<span>{Math.round(effectivePpi!)} PPI effective</span>
|
|
160
|
+
{readyPpi ? <span>{Math.round(readyPpi)} target</span> : null}
|
|
161
|
+
{minimumPpi && minimumPpi !== readyPpi ? (
|
|
162
|
+
<span>{Math.round(minimumPpi)} minimum</span>
|
|
163
|
+
) : null}
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
) : null}
|
|
167
|
+
|
|
168
|
+
{!compact && issues.length ? (
|
|
169
|
+
<div style={{ display: 'grid', gap: 4 }}>
|
|
170
|
+
{issues.slice(0, 3).map((issue) => (
|
|
171
|
+
<div key={issue.code} style={{ fontSize: 12, lineHeight: 1.35, opacity: 0.82 }}>
|
|
172
|
+
{issue.message}
|
|
173
|
+
</div>
|
|
174
|
+
))}
|
|
175
|
+
</div>
|
|
176
|
+
) : null}
|
|
177
|
+
|
|
178
|
+
{uniqueActions.length && onAction ? (
|
|
179
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 6 }}>
|
|
180
|
+
{uniqueActions.slice(0, compact ? 2 : 4).map((action) => (
|
|
181
|
+
<button
|
|
182
|
+
key={action}
|
|
183
|
+
type="button"
|
|
184
|
+
onClick={() => onAction(action)}
|
|
185
|
+
style={{
|
|
186
|
+
border: '1px solid var(--agentsam-preflight-button-border, rgba(70,72,76,0.24))',
|
|
187
|
+
borderRadius: 8,
|
|
188
|
+
padding: compact ? '5px 8px' : '6px 9px',
|
|
189
|
+
background: 'var(--agentsam-preflight-button-bg, rgba(255,255,255,0.82))',
|
|
190
|
+
color: 'inherit',
|
|
191
|
+
font: 'inherit',
|
|
192
|
+
fontSize: 11,
|
|
193
|
+
cursor: 'pointer',
|
|
194
|
+
}}
|
|
195
|
+
>
|
|
196
|
+
{labelForAction(action)}
|
|
197
|
+
</button>
|
|
198
|
+
))}
|
|
199
|
+
</div>
|
|
200
|
+
) : null}
|
|
201
|
+
</section>
|
|
202
|
+
);
|
|
203
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
LoadingSceneController,
|
|
3
|
+
LoadingSceneSemantic,
|
|
4
|
+
MetricPointProgress,
|
|
5
|
+
} from '@inneranimalmedia/agentsam-loading-scene';
|
|
6
|
+
|
|
7
|
+
export type ManufacturingLoadingState =
|
|
8
|
+
| 'UPLOADING'
|
|
9
|
+
| 'PREFLIGHT_CHECK'
|
|
10
|
+
| 'NORMALIZING_COLOR'
|
|
11
|
+
| 'VECTORIZING'
|
|
12
|
+
| 'COMPILING_MANUFACTURING'
|
|
13
|
+
| 'DIGITIZATION_HANDOFF';
|
|
14
|
+
|
|
15
|
+
export type ReceiptLoadingState =
|
|
16
|
+
| 'VERIFYING_HASHES'
|
|
17
|
+
| 'PERSISTING_RECEIPT'
|
|
18
|
+
| 'CLEANING_WORKSPACE';
|
|
19
|
+
|
|
20
|
+
interface PipelineStateConfig {
|
|
21
|
+
semantic: LoadingSceneSemantic;
|
|
22
|
+
label: string;
|
|
23
|
+
detail: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const MANUFACTURING_STATES: Record<ManufacturingLoadingState, PipelineStateConfig> = {
|
|
27
|
+
UPLOADING: {
|
|
28
|
+
semantic: 'asset_ingest',
|
|
29
|
+
label: 'Ingesting master artwork',
|
|
30
|
+
detail: 'Raster/vector parser',
|
|
31
|
+
},
|
|
32
|
+
PREFLIGHT_CHECK: {
|
|
33
|
+
semantic: 'preflight',
|
|
34
|
+
label: 'Evaluating physical print resolution',
|
|
35
|
+
detail: 'Calculating effective PPI from placement geometry',
|
|
36
|
+
},
|
|
37
|
+
NORMALIZING_COLOR: {
|
|
38
|
+
semantic: 'color_normalization',
|
|
39
|
+
label: 'Normalizing production color',
|
|
40
|
+
detail: 'Color profile and transparency normalization',
|
|
41
|
+
},
|
|
42
|
+
VECTORIZING: {
|
|
43
|
+
semantic: 'vectorization',
|
|
44
|
+
label: 'Tracing production paths',
|
|
45
|
+
detail: 'Raster boundary to monochrome vector',
|
|
46
|
+
},
|
|
47
|
+
COMPILING_MANUFACTURING: {
|
|
48
|
+
semantic: 'manufacturing_compile',
|
|
49
|
+
label: 'Compiling manufacturing derivative',
|
|
50
|
+
detail: 'Provider profile validation and export',
|
|
51
|
+
},
|
|
52
|
+
DIGITIZATION_HANDOFF: {
|
|
53
|
+
semantic: 'digitization_handoff',
|
|
54
|
+
label: 'Preparing digitization handoff',
|
|
55
|
+
detail: 'Embroidery source is prepared, not yet a stitch file',
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const RECEIPT_STATES: Record<ReceiptLoadingState, PipelineStateConfig> = {
|
|
60
|
+
VERIFYING_HASHES: {
|
|
61
|
+
semantic: 'verification',
|
|
62
|
+
label: 'Verifying snapshot integrity',
|
|
63
|
+
detail: 'Pre/post hashes and stale-write evidence',
|
|
64
|
+
},
|
|
65
|
+
PERSISTING_RECEIPT: {
|
|
66
|
+
semantic: 'receipt_persistence',
|
|
67
|
+
label: 'Persisting receipt envelope',
|
|
68
|
+
detail: 'agentsam.receipt.v1 to durable catalog storage',
|
|
69
|
+
},
|
|
70
|
+
CLEANING_WORKSPACE: {
|
|
71
|
+
semantic: 'workspace_cleanup',
|
|
72
|
+
label: 'Cleaning ephemeral workspace',
|
|
73
|
+
detail: 'Reclaiming local temporary storage',
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export interface PipelineTransitionOptions {
|
|
78
|
+
label?: string;
|
|
79
|
+
detail?: string;
|
|
80
|
+
progress?: number | null;
|
|
81
|
+
metricPoints?: MetricPointProgress;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function createController<TState extends string>(
|
|
85
|
+
controller: LoadingSceneController,
|
|
86
|
+
states: Record<TState, PipelineStateConfig>,
|
|
87
|
+
operationId: string,
|
|
88
|
+
) {
|
|
89
|
+
let started = false;
|
|
90
|
+
let completed = false;
|
|
91
|
+
|
|
92
|
+
function transitionTo(state: TState, options: PipelineTransitionOptions = {}) {
|
|
93
|
+
const config = states[state];
|
|
94
|
+
if (!config || completed) return;
|
|
95
|
+
|
|
96
|
+
const payload = {
|
|
97
|
+
operationId,
|
|
98
|
+
semantic: config.semantic,
|
|
99
|
+
label: options.label || config.label,
|
|
100
|
+
detail: options.detail || config.detail,
|
|
101
|
+
progress: options.progress,
|
|
102
|
+
metricPoints: options.metricPoints,
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
if (!started) {
|
|
106
|
+
controller.start({ ...payload, scope: 'asset' });
|
|
107
|
+
started = true;
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
controller.activity(payload);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return {
|
|
115
|
+
transitionTo,
|
|
116
|
+
complete() {
|
|
117
|
+
if (!started || completed) return;
|
|
118
|
+
completed = true;
|
|
119
|
+
controller.complete(operationId);
|
|
120
|
+
},
|
|
121
|
+
fail(detail?: string) {
|
|
122
|
+
if (!started || completed) return;
|
|
123
|
+
completed = true;
|
|
124
|
+
controller.fail(operationId, detail);
|
|
125
|
+
},
|
|
126
|
+
destroy() {
|
|
127
|
+
if (started && !completed) controller.complete(operationId);
|
|
128
|
+
completed = true;
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function createManufacturingLoadingController(
|
|
134
|
+
controller: LoadingSceneController,
|
|
135
|
+
{ operationId = 'manufacturing-preflight' }: { operationId?: string } = {},
|
|
136
|
+
) {
|
|
137
|
+
return createController(controller, MANUFACTURING_STATES, operationId);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export function createReceiptPipelineLoadingController(
|
|
141
|
+
controller: LoadingSceneController,
|
|
142
|
+
{ operationId = 'receipt-pipeline' }: { operationId?: string } = {},
|
|
143
|
+
) {
|
|
144
|
+
return createController(controller, RECEIPT_STATES, operationId);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export { MANUFACTURING_STATES, RECEIPT_STATES };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CountdownWidget } from './CountdownWidget';
|
|
2
|
+
|
|
3
|
+
export interface BuiltinWidgetProps {
|
|
4
|
+
widgetId: string;
|
|
5
|
+
compact?: boolean;
|
|
6
|
+
configuration?: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function BuiltinWidget({
|
|
10
|
+
widgetId,
|
|
11
|
+
compact = false,
|
|
12
|
+
configuration = {},
|
|
13
|
+
}: BuiltinWidgetProps) {
|
|
14
|
+
if (widgetId === 'countdown') {
|
|
15
|
+
const requested = Number(configuration.durationMs);
|
|
16
|
+
const durationMs = Number.isFinite(requested) && requested > 0
|
|
17
|
+
? requested
|
|
18
|
+
: 5 * 60_000;
|
|
19
|
+
return <CountdownWidget durationMs={durationMs} compact={compact} />;
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|