@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
|
@@ -4,6 +4,17 @@ import assert from 'node:assert/strict';
|
|
|
4
4
|
import {
|
|
5
5
|
QueueControl,
|
|
6
6
|
MemoryQueueAdapter,
|
|
7
|
+
CloudflareQueueBindingAdapter,
|
|
8
|
+
CloudflareQueueApiAdapter,
|
|
9
|
+
canClaimJobLease,
|
|
10
|
+
claimJobLease,
|
|
11
|
+
computeRetryDelayMs,
|
|
12
|
+
createJobEnvelope,
|
|
13
|
+
createRetrySchedule,
|
|
14
|
+
delaySecondsForAvailableAt,
|
|
15
|
+
jobExecutionIdentity,
|
|
16
|
+
refreshJobLease,
|
|
17
|
+
releaseJobLease,
|
|
7
18
|
buildQueueTopology,
|
|
8
19
|
resolvePhysicalQueue,
|
|
9
20
|
routeWork,
|
|
@@ -98,3 +109,302 @@ test('infrastructure provisioning is approval-gated by default', async () => {
|
|
|
98
109
|
assert.equal(result.provider, 'memory');
|
|
99
110
|
assert.ok(result.created.includes('demo-test-jobs'));
|
|
100
111
|
});
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
test('job envelopes support delayed availability without making early work runnable', async () => {
|
|
115
|
+
const adapter = new MemoryQueueAdapter();
|
|
116
|
+
const control = new QueueControl({
|
|
117
|
+
adapter,
|
|
118
|
+
topology: buildQueueTopology({ namespace: 'demo', environment: 'test' }),
|
|
119
|
+
});
|
|
120
|
+
const queue = resolvePhysicalQueue(control.topology, 'deployments');
|
|
121
|
+
const createdAt = 1_000;
|
|
122
|
+
const availableAt = 1_060;
|
|
123
|
+
const result = await control.enqueue({
|
|
124
|
+
account_id: 'acct_real',
|
|
125
|
+
kind: 'deploy.cloudflare',
|
|
126
|
+
}, {
|
|
127
|
+
created_at: createdAt,
|
|
128
|
+
availableAt,
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
assert.equal(result.job.available_at, availableAt);
|
|
132
|
+
assert.equal((await adapter.pull(queue, 10, { now: 1_059 })).length, 0);
|
|
133
|
+
assert.equal(adapter.depth(queue), 1);
|
|
134
|
+
assert.equal((await adapter.pull(queue, 10, { now: 1_060 })).length, 1);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
test('retry scheduling uses bounded exponential backoff with injectable jitter', () => {
|
|
138
|
+
const job = createJobEnvelope({
|
|
139
|
+
account_id: 'acct_real',
|
|
140
|
+
kind: 'repository.index',
|
|
141
|
+
created_at: 1_000,
|
|
142
|
+
retry: {
|
|
143
|
+
max_attempts: 3,
|
|
144
|
+
initial_delay_ms: 1_000,
|
|
145
|
+
max_delay_ms: 10_000,
|
|
146
|
+
backoff: 'exponential',
|
|
147
|
+
jitter: true,
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
assert.equal(computeRetryDelayMs(job.retry, 1, () => 0), 500);
|
|
152
|
+
assert.equal(computeRetryDelayMs(job.retry, 2, () => 1), 2_000);
|
|
153
|
+
|
|
154
|
+
const retry = createRetrySchedule(job, { now_ms: 1_000_000, random: () => 1 });
|
|
155
|
+
assert.equal(retry.retryable, true);
|
|
156
|
+
assert.equal(retry.job.status, 'retry_scheduled');
|
|
157
|
+
assert.equal(retry.job.attempt, 1);
|
|
158
|
+
assert.equal(retry.available_at, 1_001);
|
|
159
|
+
|
|
160
|
+
const exhausted = createRetrySchedule({ ...job, attempt: 2 }, { now_ms: 1_000_000 });
|
|
161
|
+
assert.equal(exhausted.retryable, false);
|
|
162
|
+
assert.equal(exhausted.exhausted, true);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
test('local queue failures are re-enqueued for a future deterministic retry', async () => {
|
|
166
|
+
const adapter = new MemoryQueueAdapter();
|
|
167
|
+
const control = new QueueControl({
|
|
168
|
+
adapter,
|
|
169
|
+
topology: buildQueueTopology({ namespace: 'demo', environment: 'test' }),
|
|
170
|
+
});
|
|
171
|
+
control.register('repository.*', async () => {
|
|
172
|
+
throw new Error('temporary');
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
await control.enqueue({ account_id: 'acct_real', kind: 'repository.index' }, {
|
|
176
|
+
created_at: 1_000,
|
|
177
|
+
retry: { max_attempts: 3, initial_delay_ms: 1_000, max_delay_ms: 1_000, jitter: false },
|
|
178
|
+
});
|
|
179
|
+
const queue = resolvePhysicalQueue(control.topology, 'indexing');
|
|
180
|
+
const [job] = await adapter.pull(queue, 1, { now: 1_000 });
|
|
181
|
+
const [result] = await control.consume([job]);
|
|
182
|
+
|
|
183
|
+
assert.equal(result.ok, false);
|
|
184
|
+
assert.equal(result.retry.scheduled, true);
|
|
185
|
+
assert.equal(result.retry.provider_managed, false);
|
|
186
|
+
assert.equal(adapter.depth(queue), 1);
|
|
187
|
+
assert.equal((await adapter.pull(queue, 1, { now: result.retry.available_at - 1 })).length, 0);
|
|
188
|
+
assert.equal((await adapter.pull(queue, 1, { now: result.retry.available_at })).length, 1);
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
test('Cloudflare queue binding maps available_at to delaySeconds and rejects delays beyond provider limit', async () => {
|
|
192
|
+
const calls = [];
|
|
193
|
+
const adapter = new CloudflareQueueBindingAdapter({
|
|
194
|
+
bindings: {
|
|
195
|
+
default: {
|
|
196
|
+
async send(body, options) { calls.push({ body, options }); },
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
});
|
|
200
|
+
const job = createJobEnvelope({
|
|
201
|
+
account_id: 'acct_real',
|
|
202
|
+
kind: 'deploy.cloudflare',
|
|
203
|
+
created_at: 1_000,
|
|
204
|
+
available_at: 1_600,
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
const receipt = await adapter.publish('demo', job, { now: 1_000 });
|
|
208
|
+
assert.equal(receipt.delay_seconds, 600);
|
|
209
|
+
assert.equal(calls[0].options.delaySeconds, 600);
|
|
210
|
+
assert.equal(delaySecondsForAvailableAt(87_400, 1_000), 86_400);
|
|
211
|
+
assert.throws(() => delaySecondsForAvailableAt(87_401, 1_000), /exceeds_24h/);
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
test('provider-managed retries receive a deterministic retry delay instead of immediate polling', async () => {
|
|
215
|
+
const adapter = new MemoryQueueAdapter();
|
|
216
|
+
const control = new QueueControl({
|
|
217
|
+
adapter,
|
|
218
|
+
topology: buildQueueTopology({ namespace: 'demo', environment: 'test' }),
|
|
219
|
+
});
|
|
220
|
+
control.register('deploy.*', async () => {
|
|
221
|
+
throw new Error('pending');
|
|
222
|
+
});
|
|
223
|
+
const job = createJobEnvelope({
|
|
224
|
+
account_id: 'acct_real',
|
|
225
|
+
kind: 'deploy.cloudflare',
|
|
226
|
+
logical_queue: 'deployments',
|
|
227
|
+
retry: { max_attempts: 3, initial_delay_ms: 2_000, max_delay_ms: 2_000, jitter: false },
|
|
228
|
+
});
|
|
229
|
+
let retryOptions = null;
|
|
230
|
+
const message = {
|
|
231
|
+
body: job,
|
|
232
|
+
attempts: 1,
|
|
233
|
+
retry(options) { retryOptions = options; },
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
const [result] = await control.consume([message]);
|
|
237
|
+
assert.equal(result.retry.provider_managed, true);
|
|
238
|
+
assert.equal(result.retry.delay_seconds, 2);
|
|
239
|
+
assert.deepEqual(retryOptions, { delaySeconds: 2 });
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
test('job execution identity always carries a stable idempotency key and run/step attribution', () => {
|
|
244
|
+
const job = createJobEnvelope({
|
|
245
|
+
id: 'job_fixed',
|
|
246
|
+
account_id: 'acct_real',
|
|
247
|
+
kind: 'embeddings.generate',
|
|
248
|
+
run_id: 'arun_parent',
|
|
249
|
+
step_id: 'step_embed',
|
|
250
|
+
});
|
|
251
|
+
assert.equal(job.idempotency_key, 'job_fixed');
|
|
252
|
+
assert.deepEqual(jobExecutionIdentity(job), {
|
|
253
|
+
job_id: 'job_fixed',
|
|
254
|
+
run_id: 'arun_parent',
|
|
255
|
+
step_id: 'step_embed',
|
|
256
|
+
attempt: 0,
|
|
257
|
+
idempotency_key: 'job_fixed',
|
|
258
|
+
lease_owner: null,
|
|
259
|
+
lease_expires_at: null,
|
|
260
|
+
lease_generation: 0,
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
const explicit = createJobEnvelope({
|
|
264
|
+
id: 'job_other',
|
|
265
|
+
account_id: 'acct_real',
|
|
266
|
+
kind: 'deploy.cloudflare',
|
|
267
|
+
idempotency_key: 'deploy:commit:abc123',
|
|
268
|
+
});
|
|
269
|
+
assert.equal(explicit.idempotency_key, 'deploy:commit:abc123');
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
test('lease contract supports claim, refresh, release, crash expiry, and rejects live double claims', () => {
|
|
273
|
+
const job = createJobEnvelope({
|
|
274
|
+
account_id: 'acct_real',
|
|
275
|
+
kind: 'repository.index',
|
|
276
|
+
created_at: 1_000,
|
|
277
|
+
});
|
|
278
|
+
const claimed = claimJobLease(job, { owner: 'worker-a', now: 1_000, ttl_seconds: 30 });
|
|
279
|
+
assert.equal(claimed.status, 'claimed');
|
|
280
|
+
assert.equal(claimed.lease_owner, 'worker-a');
|
|
281
|
+
assert.equal(claimed.lease_expires_at, 1_030);
|
|
282
|
+
assert.equal(claimed.lease_generation, 1);
|
|
283
|
+
assert.equal(canClaimJobLease(claimed, { owner: 'worker-b', now: 1_010 }), false);
|
|
284
|
+
assert.throws(
|
|
285
|
+
() => claimJobLease(claimed, { owner: 'worker-b', now: 1_010 }),
|
|
286
|
+
/job_lease_held/,
|
|
287
|
+
);
|
|
288
|
+
|
|
289
|
+
const refreshed = refreshJobLease(claimed, { owner: 'worker-a', now: 1_010, ttl_seconds: 30 });
|
|
290
|
+
assert.equal(refreshed.lease_expires_at, 1_040);
|
|
291
|
+
assert.throws(
|
|
292
|
+
() => refreshJobLease(refreshed, { owner: 'worker-a', now: 1_041, ttl_seconds: 30 }),
|
|
293
|
+
/job_lease_expired/,
|
|
294
|
+
);
|
|
295
|
+
|
|
296
|
+
assert.equal(canClaimJobLease(refreshed, { owner: 'worker-b', now: 1_041 }), true);
|
|
297
|
+
const reclaimed = claimJobLease(refreshed, { owner: 'worker-b', now: 1_041, ttl_seconds: 30 });
|
|
298
|
+
assert.equal(reclaimed.lease_generation, 2);
|
|
299
|
+
assert.equal(reclaimed.lease_owner, 'worker-b');
|
|
300
|
+
|
|
301
|
+
const released = releaseJobLease(reclaimed, { owner: 'worker-b', status: 'queued' });
|
|
302
|
+
assert.equal(released.lease_owner, null);
|
|
303
|
+
assert.equal(released.lease_expires_at, null);
|
|
304
|
+
assert.equal(released.status, 'queued');
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
test('provider-managed retry exhaustion stops requeueing instead of polling forever', async () => {
|
|
309
|
+
const adapter = new MemoryQueueAdapter();
|
|
310
|
+
const control = new QueueControl({
|
|
311
|
+
adapter,
|
|
312
|
+
topology: buildQueueTopology({ namespace: 'demo', environment: 'test' }),
|
|
313
|
+
});
|
|
314
|
+
control.register('deploy.*', async () => {
|
|
315
|
+
throw new Error('still pending');
|
|
316
|
+
});
|
|
317
|
+
const job = createJobEnvelope({
|
|
318
|
+
account_id: 'acct_real',
|
|
319
|
+
kind: 'deploy.cloudflare',
|
|
320
|
+
logical_queue: 'deployments',
|
|
321
|
+
retry: { max_attempts: 3, initial_delay_ms: 1_000, max_delay_ms: 1_000, jitter: false },
|
|
322
|
+
});
|
|
323
|
+
let retried = false;
|
|
324
|
+
let acked = false;
|
|
325
|
+
const [result] = await control.consume([{
|
|
326
|
+
body: job,
|
|
327
|
+
attempts: 3,
|
|
328
|
+
retry() { retried = true; },
|
|
329
|
+
ack() { acked = true; },
|
|
330
|
+
}]);
|
|
331
|
+
assert.equal(retried, true);
|
|
332
|
+
assert.equal(acked, false);
|
|
333
|
+
assert.deepEqual(result.retry, {
|
|
334
|
+
scheduled: false,
|
|
335
|
+
exhausted: true,
|
|
336
|
+
provider_managed: true,
|
|
337
|
+
delegated_to_provider_dlq: true,
|
|
338
|
+
attempt: 3,
|
|
339
|
+
delay_ms: 1000,
|
|
340
|
+
delay_seconds: 1,
|
|
341
|
+
});
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
test('exhausted local retries are materialized as a deterministic dead-letter job', async () => {
|
|
345
|
+
const topology = buildQueueTopology({ namespace: 'acp', environment: 'test' });
|
|
346
|
+
const adapter = new MemoryQueueAdapter();
|
|
347
|
+
const control = new QueueControl({ adapter, topology });
|
|
348
|
+
control.register('always.fail', async () => {
|
|
349
|
+
throw Object.assign(new Error('boom'), { code: 'provider_unavailable' });
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
const job = createJobEnvelope({
|
|
353
|
+
id: 'job_exhaust_local',
|
|
354
|
+
account_id: 'acct_1',
|
|
355
|
+
kind: 'always.fail',
|
|
356
|
+
logical_queue: 'jobs',
|
|
357
|
+
retry: {
|
|
358
|
+
max_attempts: 1,
|
|
359
|
+
backoff: 'fixed',
|
|
360
|
+
initial_delay_ms: 0,
|
|
361
|
+
max_delay_ms: 0,
|
|
362
|
+
jitter: false,
|
|
363
|
+
},
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
const [result] = await control.consume([job]);
|
|
367
|
+
assert.equal(result.ok, false);
|
|
368
|
+
assert.equal(result.retry.exhausted, true);
|
|
369
|
+
assert.equal(result.retry.dead_lettered, true);
|
|
370
|
+
|
|
371
|
+
const dlq = resolvePhysicalQueue(topology, 'dead_letter');
|
|
372
|
+
const [dead] = await adapter.pull(dlq, 1);
|
|
373
|
+
assert.equal(dead.kind, 'dead_letter');
|
|
374
|
+
assert.equal(dead.payload.original_job.id, 'job_exhaust_local');
|
|
375
|
+
assert.equal(dead.payload.failure.code, 'provider_unavailable');
|
|
376
|
+
assert.equal(dead.metadata.dead_letter, true);
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
test('Cloudflare consumer provisioning carries the topology dead-letter queue', async () => {
|
|
380
|
+
const requests = [];
|
|
381
|
+
const adapter = new CloudflareQueueApiAdapter({
|
|
382
|
+
cloudflareAccountId: 'acct_cf',
|
|
383
|
+
apiToken: 'token',
|
|
384
|
+
fetchImpl: async (url, init = {}) => {
|
|
385
|
+
requests.push({ url, init });
|
|
386
|
+
if (init.method === 'POST' && url.endsWith('/consumers')) {
|
|
387
|
+
return Response.json({ success: true, result: { consumer_id: 'consumer_1' } });
|
|
388
|
+
}
|
|
389
|
+
if (init.method === 'POST') {
|
|
390
|
+
const name = JSON.parse(init.body).queue_name;
|
|
391
|
+
return Response.json({ success: true, result: { queue_id: name + '_id', queue_name: name } });
|
|
392
|
+
}
|
|
393
|
+
return Response.json({ success: true, result: [] });
|
|
394
|
+
},
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
const topology = buildQueueTopology({ namespace: 'acp', environment: 'prod' });
|
|
398
|
+
const jobsQueue = resolvePhysicalQueue(topology, 'jobs');
|
|
399
|
+
await adapter.ensureTopology(topology, {
|
|
400
|
+
consumers: {
|
|
401
|
+
[jobsQueue]: { script_name: 'agentsam-acp-consumer', max_retries: 3 },
|
|
402
|
+
},
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
const consumerRequest = requests.find((row) => row.url.endsWith('/consumers'));
|
|
406
|
+
assert.ok(consumerRequest);
|
|
407
|
+
const body = JSON.parse(consumerRequest.init.body);
|
|
408
|
+
assert.equal(body.dead_letter_queue, resolvePhysicalQueue(topology, 'dead_letter'));
|
|
409
|
+
assert.equal(body.settings.max_retries, 3);
|
|
410
|
+
});
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import test from 'node:test';
|
|
6
|
+
import { createLocalSqliteDatabase } from '../../../src/local/sqlite.js';
|
|
7
|
+
import { applyRuntimeMigrations } from '../../../src/local/migrations.js';
|
|
8
|
+
import {
|
|
9
|
+
SqliteQueueAdapter,
|
|
10
|
+
QueueControl,
|
|
11
|
+
buildQueueTopology,
|
|
12
|
+
createJobEnvelope,
|
|
13
|
+
} from '../src/index.js';
|
|
14
|
+
|
|
15
|
+
async function fixture() {
|
|
16
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'agentsam-queue-sqlite-'));
|
|
17
|
+
const db = await createLocalSqliteDatabase(path.join(dir, 'agentsam.sqlite'));
|
|
18
|
+
await applyRuntimeMigrations(db);
|
|
19
|
+
return { dir, db, close: () => db.close() };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
test('SQLite adapter persists delayed work and leases due jobs without polling models', async (t) => {
|
|
23
|
+
const fx = await fixture();
|
|
24
|
+
t.after(fx.close);
|
|
25
|
+
const topology = buildQueueTopology({ namespace: 'test', environment: 'local' });
|
|
26
|
+
const adapter = new SqliteQueueAdapter({ database: fx.db, leaseOwner: 'worker-a', leaseTtlSeconds: 30 });
|
|
27
|
+
const control = new QueueControl({ adapter, topology });
|
|
28
|
+
|
|
29
|
+
const enqueued = await control.enqueue(
|
|
30
|
+
{ kind: 'repository.index', account_id: 'acct_1' },
|
|
31
|
+
{
|
|
32
|
+
account_id: 'acct_1',
|
|
33
|
+
id: 'job_delayed',
|
|
34
|
+
available_at: 120,
|
|
35
|
+
created_at: 100,
|
|
36
|
+
idempotency_key: 'idx:repo:a',
|
|
37
|
+
},
|
|
38
|
+
);
|
|
39
|
+
const queue = enqueued.plan.physical_queue;
|
|
40
|
+
|
|
41
|
+
assert.equal(await adapter.depth(queue), 1);
|
|
42
|
+
assert.deepEqual(await adapter.pull(queue, 1, { now: 119 }), []);
|
|
43
|
+
|
|
44
|
+
const first = await adapter.pull(queue, 1, { now: 120, owner: 'worker-a', ttl_seconds: 30 });
|
|
45
|
+
assert.equal(first.length, 1);
|
|
46
|
+
assert.equal(first[0].status, 'claimed');
|
|
47
|
+
assert.equal(first[0].lease_owner, 'worker-a');
|
|
48
|
+
assert.equal(first[0].lease_expires_at, 150);
|
|
49
|
+
assert.equal(first[0].lease_generation, 1);
|
|
50
|
+
|
|
51
|
+
assert.deepEqual(await adapter.pull(queue, 1, { now: 149, owner: 'worker-b' }), []);
|
|
52
|
+
|
|
53
|
+
const reclaimed = await adapter.pull(queue, 1, { now: 150, owner: 'worker-b', ttl_seconds: 20 });
|
|
54
|
+
assert.equal(reclaimed.length, 1);
|
|
55
|
+
assert.equal(reclaimed[0].lease_owner, 'worker-b');
|
|
56
|
+
assert.equal(reclaimed[0].lease_generation, 2);
|
|
57
|
+
|
|
58
|
+
const ack = await adapter.ack(reclaimed[0], { status: 'completed', result: { indexed: 3 }, now: 151 });
|
|
59
|
+
assert.equal(ack.updated, 1);
|
|
60
|
+
assert.equal(await adapter.depth(queue), 0);
|
|
61
|
+
assert.equal((await adapter.get('job_delayed')).status, 'completed');
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
test('SQLite adapter deduplicates stable idempotency keys across repeated enqueue attempts', async (t) => {
|
|
65
|
+
const fx = await fixture();
|
|
66
|
+
t.after(fx.close);
|
|
67
|
+
const adapter = new SqliteQueueAdapter({ database: fx.db });
|
|
68
|
+
const queue = 'agentsam-local-jobs';
|
|
69
|
+
|
|
70
|
+
const first = createJobEnvelope({
|
|
71
|
+
id: 'job_a',
|
|
72
|
+
account_id: 'acct_1',
|
|
73
|
+
kind: 'deployment.poll',
|
|
74
|
+
idempotency_key: 'deploy:123',
|
|
75
|
+
created_at: 10,
|
|
76
|
+
});
|
|
77
|
+
const duplicate = createJobEnvelope({
|
|
78
|
+
id: 'job_b',
|
|
79
|
+
account_id: 'acct_1',
|
|
80
|
+
kind: 'deployment.poll',
|
|
81
|
+
idempotency_key: 'deploy:123',
|
|
82
|
+
created_at: 11,
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
assert.equal((await adapter.publish(queue, first)).accepted, 1);
|
|
86
|
+
const second = await adapter.publish(queue, duplicate);
|
|
87
|
+
assert.equal(second.accepted, 0);
|
|
88
|
+
assert.equal(second.deduplicated, true);
|
|
89
|
+
assert.equal(second.existing_job_id, 'job_a');
|
|
90
|
+
assert.equal(await adapter.depth(queue), 1);
|
|
91
|
+
});
|
|
@@ -3,3 +3,6 @@
|
|
|
3
3
|
Native Rust CLI source for `agentsam rust` / `agentsam-rapid-rust`.
|
|
4
4
|
|
|
5
5
|
It scaffolds Cloudflare `workers-rs` projects, performs local Wasm checks/builds, runs Wrangler locally, and gates live deployment behind an explicit `--yes`. Compiled binaries are not committed; use `scripts/build_rapid_rust_cli.py` to build/install one.
|
|
6
|
+
|
|
7
|
+
<!-- agentsam:trademark-notice -->
|
|
8
|
+
> Independent project. Not affiliated with, endorsed by, or sponsored by Cloudflare, Inc. or by any other company whose products are named here. Cloudflare is a registered trademark of Cloudflare, Inc. Other names are trademarks of their respective owners. See [TRADEMARKS](https://github.com/SamPrimeaux/agentsam-sdk/blob/main/TRADEMARKS.md).
|
|
@@ -13,3 +13,6 @@ It owns deterministic repository identity and Merkle behavior that must be reusa
|
|
|
13
13
|
It does **not** own authenticated account sessions, CLI commands, UI rendering, knowledge retrieval, deployment orchestration, or product application state. Those layers consume this package through explicit imports.
|
|
14
14
|
|
|
15
15
|
The workspace is private while the extraction stabilizes. Cross-repository consumers should continue using the published `@inneranimalmedia/agentsam-sdk` facade until this package receives its own release policy.
|
|
16
|
+
|
|
17
|
+
<!-- agentsam:trademark-notice -->
|
|
18
|
+
> Independent project. Not affiliated with, endorsed by, or sponsored by Cloudflare, Inc. or by any other company whose products are named here. Cloudflare is a registered trademark of Cloudflare, Inc. Other names are trademarks of their respective owners. See [TRADEMARKS](https://github.com/SamPrimeaux/agentsam-sdk/blob/main/TRADEMARKS.md).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inneranimalmedia/agentsam-repository",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.11",
|
|
4
4
|
"description": "Portable AgentSam repository identity, Merkle, semantic file metadata, persistence, and repository graph runtime contracts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inneranimalmedia/agentsam-vault",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AgentSam credential vault core — contracts, AES-GCM crypto, provider registry, resolver. UI lives in agentsam-key-manager.",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -22,3 +22,46 @@ values are withheld. Cross-origin and sandboxed iframe contents are not inspecte
|
|
|
22
22
|
their host frame may be selected as a contextual resource. Mark semantic ancestors
|
|
23
23
|
with `data-agentsam-resource` and excluded controls with `data-annotation-control`.
|
|
24
24
|
Local Studio stages the annotation in its active conversation draft for review.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## Conversation and runtime surfaces
|
|
28
|
+
|
|
29
|
+
`AgentConversationSurface` is the portable thread + persistent-composer ownership
|
|
30
|
+
boundary. Product apps provide state and actions; the surface guarantees that
|
|
31
|
+
moving between an empty conversation and an active thread does not replace the
|
|
32
|
+
composer DOM ownership.
|
|
33
|
+
|
|
34
|
+
`AgentRuntimeField` projects `@inneranimalmedia/agentsam-loading-scene` into the
|
|
35
|
+
same surface. A lead thread and each co-worker may bind separate controllers, so
|
|
36
|
+
parallel work can show independent semantic scenes and task narration without
|
|
37
|
+
duplicating renderer code in product apps.
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
<AgentConversationSurface
|
|
41
|
+
empty={messages.length === 0}
|
|
42
|
+
runtime={<AgentRuntimeField controller={runtimeController} />}
|
|
43
|
+
thread={<AgentThread messages={messages} />}
|
|
44
|
+
composer={<AgentComposer {...composerProps} />}
|
|
45
|
+
/>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The workbench owns presentation mechanics. The host still owns model/provider
|
|
49
|
+
selection, tool execution, persistence, permissions, runtime events, queueing and
|
|
50
|
+
cancel semantics.
|
|
51
|
+
|
|
52
|
+
## Widgets
|
|
53
|
+
|
|
54
|
+
`@inneranimalmedia/agentsam-workbench/widgets` is the shared widget surface:
|
|
55
|
+
`WidgetFrame` (size/state chrome around any widget body), `useCountdown`, and
|
|
56
|
+
`CountdownWidget`. Widget identity — kind, sizes, data source, deep link — comes
|
|
57
|
+
from the framework-neutral contracts in `@inneranimalmedia/agentsam-contracts/widgets`.
|
|
58
|
+
|
|
59
|
+
Countdown time authority is an absolute deadline, not accumulated interval
|
|
60
|
+
ticks: remaining time is derived from `Date.now()` on every render tick, so a
|
|
61
|
+
sleeping or backgrounded tab cannot corrupt the timer. Import
|
|
62
|
+
`@inneranimalmedia/agentsam-workbench/widgets/widgets.css` once in the host;
|
|
63
|
+
the widget tokens inherit the host theme.
|
|
64
|
+
|
|
65
|
+
Widgets are app-native primitives, not installable prebuilds — the host decides
|
|
66
|
+
where a widget appears and what its data means. Local Studio's `/widgets`
|
|
67
|
+
utilities surface is the proof consumer.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inneranimalmedia/agentsam-workbench",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.11",
|
|
4
4
|
"description": "Reusable AgentSam workbench primitives for agent threads, composer, browser, terminal and resizable work surfaces.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,16 +36,26 @@
|
|
|
36
36
|
"./agent/mini-agentsam.css": "./dist/agent/mini-agentsam.css",
|
|
37
37
|
"./agent/contextual-composer.css": "./dist/agent/contextual-composer.css",
|
|
38
38
|
"./agent/tool-permission.css": "./dist/agent/tool-permission.css",
|
|
39
|
-
"./project-control.css": "./dist/project-control.css"
|
|
39
|
+
"./project-control.css": "./dist/project-control.css",
|
|
40
|
+
"./manufacturing": {
|
|
41
|
+
"types": "./dist/manufacturing/index.d.ts",
|
|
42
|
+
"import": "./dist/manufacturing/index.js"
|
|
43
|
+
},
|
|
44
|
+
"./widgets": {
|
|
45
|
+
"types": "./dist/widgets/index.d.ts",
|
|
46
|
+
"import": "./dist/widgets/index.js"
|
|
47
|
+
},
|
|
48
|
+
"./widgets/widgets.css": "./dist/widgets/widgets.css"
|
|
40
49
|
},
|
|
41
50
|
"scripts": {
|
|
42
|
-
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
51
|
+
"typecheck": "node scripts/ensure-local-deps.mjs && tsc --noEmit -p tsconfig.json",
|
|
43
52
|
"test": "node --test test/*.test.mjs",
|
|
44
53
|
"build": "node scripts/build.mjs",
|
|
45
54
|
"prepack": "npm run build"
|
|
46
55
|
},
|
|
47
56
|
"dependencies": {
|
|
48
|
-
"@inneranimalmedia/agentsam-contracts": "2.6.
|
|
57
|
+
"@inneranimalmedia/agentsam-contracts": "2.6.11",
|
|
58
|
+
"@inneranimalmedia/agentsam-loading-scene": "2.6.11"
|
|
49
59
|
},
|
|
50
60
|
"peerDependencies": {
|
|
51
61
|
"react": ">=18",
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type AgentConversationSurfaceProps = {
|
|
4
|
+
empty?: boolean;
|
|
5
|
+
thread: ReactNode;
|
|
6
|
+
composer: ReactNode;
|
|
7
|
+
emptyState?: ReactNode;
|
|
8
|
+
runtime?: ReactNode;
|
|
9
|
+
status?: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
bodyClassName?: string;
|
|
12
|
+
composerClassName?: string;
|
|
13
|
+
style?: CSSProperties;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Portable thread + persistent composer surface.
|
|
18
|
+
*
|
|
19
|
+
* The composer slot is never conditionally removed when a conversation moves
|
|
20
|
+
* from empty/startup to active. Hosts can restyle the surface, but the DOM
|
|
21
|
+
* ownership contract remains stable across web/desktop/product adapters.
|
|
22
|
+
*/
|
|
23
|
+
export function AgentConversationSurface({
|
|
24
|
+
empty = false,
|
|
25
|
+
thread,
|
|
26
|
+
composer,
|
|
27
|
+
emptyState,
|
|
28
|
+
runtime,
|
|
29
|
+
status,
|
|
30
|
+
className,
|
|
31
|
+
bodyClassName,
|
|
32
|
+
composerClassName,
|
|
33
|
+
style,
|
|
34
|
+
}: AgentConversationSurfaceProps) {
|
|
35
|
+
return (
|
|
36
|
+
<section
|
|
37
|
+
className={className}
|
|
38
|
+
data-agent-conversation-surface=""
|
|
39
|
+
data-agent-conversation-empty={empty ? 'true' : 'false'}
|
|
40
|
+
style={{
|
|
41
|
+
position: 'relative',
|
|
42
|
+
display: 'flex',
|
|
43
|
+
minWidth: 0,
|
|
44
|
+
minHeight: 0,
|
|
45
|
+
flex: 1,
|
|
46
|
+
flexDirection: 'column',
|
|
47
|
+
overflow: 'hidden',
|
|
48
|
+
...style,
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
{runtime}
|
|
52
|
+
|
|
53
|
+
<div
|
|
54
|
+
className={bodyClassName}
|
|
55
|
+
data-agent-conversation-body=""
|
|
56
|
+
data-agent-conversation-body-empty={empty ? 'true' : 'false'}
|
|
57
|
+
style={{
|
|
58
|
+
display: 'flex',
|
|
59
|
+
minWidth: 0,
|
|
60
|
+
minHeight: 0,
|
|
61
|
+
flex: '1 1 auto',
|
|
62
|
+
flexDirection: 'column',
|
|
63
|
+
overflow: 'hidden',
|
|
64
|
+
}}
|
|
65
|
+
>
|
|
66
|
+
{empty ? (
|
|
67
|
+
emptyState ? (
|
|
68
|
+
<div
|
|
69
|
+
data-agent-conversation-empty-state=""
|
|
70
|
+
style={{
|
|
71
|
+
display: 'flex',
|
|
72
|
+
minWidth: 0,
|
|
73
|
+
minHeight: 0,
|
|
74
|
+
flex: '1 1 auto',
|
|
75
|
+
alignItems: 'center',
|
|
76
|
+
justifyContent: 'center',
|
|
77
|
+
}}
|
|
78
|
+
>
|
|
79
|
+
{emptyState}
|
|
80
|
+
</div>
|
|
81
|
+
) : null
|
|
82
|
+
) : (
|
|
83
|
+
thread
|
|
84
|
+
)}
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
{status ? (
|
|
88
|
+
<div data-agent-conversation-status="" style={{ flexShrink: 0 }}>
|
|
89
|
+
{status}
|
|
90
|
+
</div>
|
|
91
|
+
) : null}
|
|
92
|
+
|
|
93
|
+
<div
|
|
94
|
+
className={composerClassName}
|
|
95
|
+
data-agent-conversation-composer=""
|
|
96
|
+
style={{
|
|
97
|
+
position: 'relative',
|
|
98
|
+
zIndex: 2,
|
|
99
|
+
width: '100%',
|
|
100
|
+
flexShrink: 0,
|
|
101
|
+
}}
|
|
102
|
+
>
|
|
103
|
+
{composer}
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
</section>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
@@ -3,6 +3,7 @@ import type { AgentMessage, ModelOption } from '@inneranimalmedia/agentsam-contr
|
|
|
3
3
|
import { AgentThread } from './Thread';
|
|
4
4
|
import { AgentComposer } from './Composer';
|
|
5
5
|
import { AgentModelSelect } from './ModelSelect';
|
|
6
|
+
import { AgentConversationSurface } from './AgentConversationSurface';
|
|
6
7
|
|
|
7
8
|
export interface AgentPanelProps {
|
|
8
9
|
messages: AgentMessage[];
|
|
@@ -24,17 +25,33 @@ export function AgentPanel(props: AgentPanelProps) {
|
|
|
24
25
|
const modelControl = props.models?.length && props.selectedModelId && props.onModelChange
|
|
25
26
|
? <AgentModelSelect value={props.selectedModelId} models={props.models} onChange={props.onModelChange} />
|
|
26
27
|
: null;
|
|
28
|
+
const thread = (
|
|
29
|
+
<AgentThread
|
|
30
|
+
messages={props.messages}
|
|
31
|
+
streaming={props.streaming}
|
|
32
|
+
renderMessage={props.renderMessage}
|
|
33
|
+
empty={props.empty}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
const composer = (
|
|
37
|
+
<AgentComposer
|
|
38
|
+
value={props.draft}
|
|
39
|
+
onChange={props.onDraftChange}
|
|
40
|
+
onSend={props.onSend}
|
|
41
|
+
onCancel={props.onCancel}
|
|
42
|
+
streaming={props.streaming}
|
|
43
|
+
toolbarStart={modelControl}
|
|
44
|
+
/>
|
|
45
|
+
);
|
|
46
|
+
|
|
27
47
|
return (
|
|
28
48
|
<section className={props.className} data-agent-panel="">
|
|
29
49
|
{props.header}
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
onCancel={props.onCancel}
|
|
36
|
-
streaming={props.streaming}
|
|
37
|
-
toolbarStart={modelControl}
|
|
50
|
+
<AgentConversationSurface
|
|
51
|
+
empty={props.messages.length === 0}
|
|
52
|
+
thread={thread}
|
|
53
|
+
composer={composer}
|
|
54
|
+
emptyState={props.empty}
|
|
38
55
|
/>
|
|
39
56
|
</section>
|
|
40
57
|
);
|