@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,16 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
|
6
|
+
<title>AgentSam — Computational Hyperspace</title>
|
|
7
|
+
<style>
|
|
8
|
+
html, body, #root { margin: 0; height: 100%; background: #000; }
|
|
9
|
+
* { box-sizing: border-box; }
|
|
10
|
+
</style>
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<div id="root"></div>
|
|
14
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "hyperspace-demo",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@inneranimalmedia/agentsam-loading-scene": "*",
|
|
12
|
+
"react": "^19.2.0",
|
|
13
|
+
"react-dom": "^19.2.0"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@types/react": "^19.2.0",
|
|
17
|
+
"@types/react-dom": "^19.2.0",
|
|
18
|
+
"@vitejs/plugin-react": "^5.2.0",
|
|
19
|
+
"vite": "^8.2.0"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { StrictMode, useEffect, useMemo, useState } from "react";
|
|
2
|
+
import { createRoot } from "react-dom/client";
|
|
3
|
+
import {
|
|
4
|
+
HYPERSPACE_STUDIES,
|
|
5
|
+
LoadingSceneController,
|
|
6
|
+
adaptAgentSamEvent,
|
|
7
|
+
computationalHyperspace,
|
|
8
|
+
type HyperspaceStudyId,
|
|
9
|
+
} from "@inneranimalmedia/agentsam-loading-scene";
|
|
10
|
+
import {
|
|
11
|
+
LoadingScene,
|
|
12
|
+
LoadingSceneStatus,
|
|
13
|
+
LoadingSceneDevtools,
|
|
14
|
+
} from "@inneranimalmedia/agentsam-loading-scene/react";
|
|
15
|
+
|
|
16
|
+
const preset = computationalHyperspace;
|
|
17
|
+
|
|
18
|
+
type StudyChoice = HyperspaceStudyId | "auto";
|
|
19
|
+
|
|
20
|
+
function simulateRuntime(
|
|
21
|
+
controller: LoadingSceneController,
|
|
22
|
+
onDone: () => void,
|
|
23
|
+
) {
|
|
24
|
+
const timers: number[] = [];
|
|
25
|
+
const later = (ms: number, fn: () => void) => {
|
|
26
|
+
timers.push(window.setTimeout(fn, ms));
|
|
27
|
+
};
|
|
28
|
+
const emit = (raw: Parameters<typeof adaptAgentSamEvent>[0]) =>
|
|
29
|
+
controller.handle(adaptAgentSamEvent(raw));
|
|
30
|
+
|
|
31
|
+
later(0, () =>
|
|
32
|
+
emit({
|
|
33
|
+
type: "agent.session.started",
|
|
34
|
+
operationId: "boot",
|
|
35
|
+
label: "Preparing runtime",
|
|
36
|
+
detail: "Opening the AgentSam workspace",
|
|
37
|
+
}),
|
|
38
|
+
);
|
|
39
|
+
later(3600, () => controller.complete("boot"));
|
|
40
|
+
|
|
41
|
+
later(3900, () =>
|
|
42
|
+
emit({
|
|
43
|
+
type: "file.read",
|
|
44
|
+
operationId: "read",
|
|
45
|
+
label: "Reading project context",
|
|
46
|
+
detail: "Reviewing files and instructions relevant to the task",
|
|
47
|
+
}),
|
|
48
|
+
);
|
|
49
|
+
later(7700, () => controller.complete("read"));
|
|
50
|
+
|
|
51
|
+
later(8000, () =>
|
|
52
|
+
emit({
|
|
53
|
+
type: "context.workspace.loading",
|
|
54
|
+
operationId: "context",
|
|
55
|
+
label: "Loading context",
|
|
56
|
+
detail: "Assembling the workspace state needed for this turn",
|
|
57
|
+
}),
|
|
58
|
+
);
|
|
59
|
+
later(11900, () => controller.complete("context"));
|
|
60
|
+
|
|
61
|
+
later(12200, () =>
|
|
62
|
+
emit({
|
|
63
|
+
type: "tool.invoke",
|
|
64
|
+
operationId: "tool-a",
|
|
65
|
+
label: "Running tools",
|
|
66
|
+
detail: "Executing the first task action",
|
|
67
|
+
}),
|
|
68
|
+
);
|
|
69
|
+
later(12450, () =>
|
|
70
|
+
emit({
|
|
71
|
+
type: "tool.invoke",
|
|
72
|
+
operationId: "tool-b",
|
|
73
|
+
label: "Tracing dependencies",
|
|
74
|
+
detail: "Following related package and runtime edges",
|
|
75
|
+
}),
|
|
76
|
+
);
|
|
77
|
+
later(16300, () => controller.complete("tool-a"));
|
|
78
|
+
later(16600, () => controller.complete("tool-b"));
|
|
79
|
+
|
|
80
|
+
later(16900, () =>
|
|
81
|
+
emit({
|
|
82
|
+
type: "catalog.indexing",
|
|
83
|
+
operationId: "index",
|
|
84
|
+
label: "Reconciling state",
|
|
85
|
+
detail: "Checking the resulting workspace state",
|
|
86
|
+
}),
|
|
87
|
+
);
|
|
88
|
+
later(20700, () => controller.complete("index"));
|
|
89
|
+
|
|
90
|
+
later(21000, () =>
|
|
91
|
+
emit({
|
|
92
|
+
type: "site.build",
|
|
93
|
+
operationId: "build",
|
|
94
|
+
label: "Building application",
|
|
95
|
+
detail: "Producing the requested preview",
|
|
96
|
+
progress: 0,
|
|
97
|
+
}),
|
|
98
|
+
);
|
|
99
|
+
later(22200, () =>
|
|
100
|
+
emit({
|
|
101
|
+
type: "site.build",
|
|
102
|
+
operationId: "build",
|
|
103
|
+
progress: 0.38,
|
|
104
|
+
}),
|
|
105
|
+
);
|
|
106
|
+
later(23500, () =>
|
|
107
|
+
emit({
|
|
108
|
+
type: "site.build",
|
|
109
|
+
operationId: "build",
|
|
110
|
+
progress: 0.78,
|
|
111
|
+
}),
|
|
112
|
+
);
|
|
113
|
+
later(24900, () => controller.complete("build"));
|
|
114
|
+
|
|
115
|
+
later(26200, onDone);
|
|
116
|
+
|
|
117
|
+
return () => timers.forEach((id) => window.clearTimeout(id));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function PreviewSurface() {
|
|
121
|
+
return (
|
|
122
|
+
<div
|
|
123
|
+
style={{
|
|
124
|
+
height: "100%",
|
|
125
|
+
display: "grid",
|
|
126
|
+
placeItems: "center",
|
|
127
|
+
background: "#090A0E",
|
|
128
|
+
color: "#F7F5FB",
|
|
129
|
+
fontFamily:
|
|
130
|
+
'Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
131
|
+
}}
|
|
132
|
+
>
|
|
133
|
+
<div style={{ textAlign: "center", opacity: 0.9 }}>
|
|
134
|
+
<div
|
|
135
|
+
style={{
|
|
136
|
+
fontSize: 12,
|
|
137
|
+
letterSpacing: "0.12em",
|
|
138
|
+
textTransform: "uppercase",
|
|
139
|
+
color: "#B5B1C0",
|
|
140
|
+
}}
|
|
141
|
+
>
|
|
142
|
+
AgentSam
|
|
143
|
+
</div>
|
|
144
|
+
<div
|
|
145
|
+
style={{
|
|
146
|
+
marginTop: 10,
|
|
147
|
+
fontSize: 30,
|
|
148
|
+
letterSpacing: "-0.035em",
|
|
149
|
+
fontWeight: 600,
|
|
150
|
+
}}
|
|
151
|
+
>
|
|
152
|
+
Runtime complete
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function App() {
|
|
160
|
+
const controller = useMemo(
|
|
161
|
+
() => new LoadingSceneController(preset),
|
|
162
|
+
[],
|
|
163
|
+
);
|
|
164
|
+
const [run, setRun] = useState(0);
|
|
165
|
+
const params = useMemo(
|
|
166
|
+
() => new URLSearchParams(window.location.search),
|
|
167
|
+
[],
|
|
168
|
+
);
|
|
169
|
+
const debug = params.get("debugRuntimeVisuals") === "1";
|
|
170
|
+
const initialStudy = params.get("study") as StudyChoice | null;
|
|
171
|
+
const [study, setStudy] = useState<StudyChoice>(
|
|
172
|
+
initialStudy &&
|
|
173
|
+
(initialStudy === "auto" ||
|
|
174
|
+
HYPERSPACE_STUDIES.some((item) => item.id === initialStudy))
|
|
175
|
+
? initialStudy
|
|
176
|
+
: "auto",
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
useEffect(() => {
|
|
180
|
+
if (debug) return;
|
|
181
|
+
return simulateRuntime(controller, () => {
|
|
182
|
+
window.setTimeout(() => {
|
|
183
|
+
controller.reset();
|
|
184
|
+
setRun((value) => value + 1);
|
|
185
|
+
}, 1500);
|
|
186
|
+
});
|
|
187
|
+
}, [controller, run, debug]);
|
|
188
|
+
|
|
189
|
+
return (
|
|
190
|
+
<div
|
|
191
|
+
style={{
|
|
192
|
+
position: "fixed",
|
|
193
|
+
inset: 0,
|
|
194
|
+
background: "#090A0E",
|
|
195
|
+
}}
|
|
196
|
+
>
|
|
197
|
+
<LoadingScene
|
|
198
|
+
controller={controller}
|
|
199
|
+
preset={preset}
|
|
200
|
+
study={study}
|
|
201
|
+
reducedMotion="auto"
|
|
202
|
+
style={{ width: "100%", height: "100%" }}
|
|
203
|
+
>
|
|
204
|
+
<PreviewSurface />
|
|
205
|
+
</LoadingScene>
|
|
206
|
+
|
|
207
|
+
<div
|
|
208
|
+
style={{
|
|
209
|
+
position: "fixed",
|
|
210
|
+
left: 24,
|
|
211
|
+
bottom: 24,
|
|
212
|
+
pointerEvents: "none",
|
|
213
|
+
zIndex: 5,
|
|
214
|
+
}}
|
|
215
|
+
>
|
|
216
|
+
<LoadingSceneStatus
|
|
217
|
+
controller={controller}
|
|
218
|
+
preset={preset}
|
|
219
|
+
/>
|
|
220
|
+
</div>
|
|
221
|
+
|
|
222
|
+
<div
|
|
223
|
+
style={{
|
|
224
|
+
position: "fixed",
|
|
225
|
+
top: 16,
|
|
226
|
+
right: 16,
|
|
227
|
+
zIndex: 10,
|
|
228
|
+
display: "flex",
|
|
229
|
+
gap: 6,
|
|
230
|
+
flexWrap: "wrap",
|
|
231
|
+
justifyContent: "flex-end",
|
|
232
|
+
maxWidth: "min(860px, calc(100vw - 32px))",
|
|
233
|
+
fontFamily:
|
|
234
|
+
'Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
235
|
+
}}
|
|
236
|
+
>
|
|
237
|
+
{(["auto", ...HYPERSPACE_STUDIES.map((item) => item.id)] as StudyChoice[]).map(
|
|
238
|
+
(item) => (
|
|
239
|
+
<button
|
|
240
|
+
key={item}
|
|
241
|
+
type="button"
|
|
242
|
+
onClick={() => setStudy(item)}
|
|
243
|
+
style={{
|
|
244
|
+
border:
|
|
245
|
+
item === study
|
|
246
|
+
? "1px solid #8B5CF6"
|
|
247
|
+
: "1px solid rgba(255,255,255,.12)",
|
|
248
|
+
background:
|
|
249
|
+
item === study
|
|
250
|
+
? "rgba(139,92,246,.16)"
|
|
251
|
+
: "rgba(9,10,14,.72)",
|
|
252
|
+
color: item === study ? "#F7F5FB" : "#B5B1C0",
|
|
253
|
+
borderRadius: 999,
|
|
254
|
+
padding: "7px 10px",
|
|
255
|
+
fontSize: 11,
|
|
256
|
+
cursor: "pointer",
|
|
257
|
+
backdropFilter: "blur(10px)",
|
|
258
|
+
}}
|
|
259
|
+
>
|
|
260
|
+
{item === "auto"
|
|
261
|
+
? "Auto"
|
|
262
|
+
: HYPERSPACE_STUDIES.find((entry) => entry.id === item)?.title}
|
|
263
|
+
</button>
|
|
264
|
+
),
|
|
265
|
+
)}
|
|
266
|
+
</div>
|
|
267
|
+
|
|
268
|
+
<LoadingSceneDevtools controller={controller} enabled={debug} />
|
|
269
|
+
</div>
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
createRoot(document.getElementById("root")!).render(
|
|
274
|
+
<StrictMode>
|
|
275
|
+
<App />
|
|
276
|
+
</StrictMode>,
|
|
277
|
+
);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import react from "@vitejs/plugin-react";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
plugins: [react()],
|
|
7
|
+
server: {
|
|
8
|
+
host: "0.0.0.0",
|
|
9
|
+
port: 5181,
|
|
10
|
+
allowedHosts: true,
|
|
11
|
+
},
|
|
12
|
+
resolve: {
|
|
13
|
+
alias: {
|
|
14
|
+
"@inneranimalmedia/agentsam-loading-scene/react": path.resolve(
|
|
15
|
+
__dirname,
|
|
16
|
+
"../../packages/agentsam-loading-scene/src/react/index.ts",
|
|
17
|
+
),
|
|
18
|
+
"@inneranimalmedia/agentsam-loading-scene": path.resolve(
|
|
19
|
+
__dirname,
|
|
20
|
+
"../../packages/agentsam-loading-scene/src/index.ts",
|
|
21
|
+
),
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
-- AgentSam universal receipt catalog.
|
|
2
|
+
-- Runtime payloads remain in their native schemas; this table indexes the
|
|
3
|
+
-- universal agentsam.receipt.v1 envelope persisted under inneranimalmedia-schemas.
|
|
4
|
+
CREATE TABLE IF NOT EXISTS agentsam_receipt_catalog (
|
|
5
|
+
id TEXT PRIMARY KEY,
|
|
6
|
+
account_id TEXT NOT NULL,
|
|
7
|
+
receipt_kind TEXT NOT NULL,
|
|
8
|
+
schema_name TEXT NOT NULL,
|
|
9
|
+
status TEXT NOT NULL,
|
|
10
|
+
retention_class TEXT NOT NULL DEFAULT 'ephemeral_success',
|
|
11
|
+
|
|
12
|
+
repository_id TEXT,
|
|
13
|
+
git_sha TEXT,
|
|
14
|
+
run_id TEXT,
|
|
15
|
+
|
|
16
|
+
r2_key TEXT NOT NULL
|
|
17
|
+
CHECK (r2_key LIKE 'agentsam/runtime/receipts/%'),
|
|
18
|
+
content_hash TEXT NOT NULL,
|
|
19
|
+
byte_size INTEGER NOT NULL CHECK (byte_size >= 0),
|
|
20
|
+
|
|
21
|
+
created_at_unix INTEGER NOT NULL,
|
|
22
|
+
expires_at_unix INTEGER,
|
|
23
|
+
|
|
24
|
+
meta_json TEXT
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
CREATE INDEX IF NOT EXISTS idx_agentsam_receipts_account_kind
|
|
28
|
+
ON agentsam_receipt_catalog (account_id, receipt_kind);
|
|
29
|
+
|
|
30
|
+
CREATE INDEX IF NOT EXISTS idx_agentsam_receipts_repo_sha
|
|
31
|
+
ON agentsam_receipt_catalog (repository_id, git_sha);
|
|
32
|
+
|
|
33
|
+
CREATE INDEX IF NOT EXISTS idx_agentsam_receipts_expires
|
|
34
|
+
ON agentsam_receipt_catalog (expires_at_unix)
|
|
35
|
+
WHERE expires_at_unix IS NOT NULL;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
-- Portable AgentSam hook registry and execution evidence.
|
|
2
|
+
--
|
|
3
|
+
-- This is the standalone/local baseline. Shared hosts may map owner_id to their
|
|
4
|
+
-- account authority, but tenant_id/workspace_id are intentionally not part of
|
|
5
|
+
-- the portable contract. Repository/project/session applicability belongs in
|
|
6
|
+
-- scope_type + scope_ref; less common correlations stay in JSON.
|
|
7
|
+
--
|
|
8
|
+
-- Handler secrets are references resolved by the host. Never store API keys,
|
|
9
|
+
-- bearer tokens, or decrypted credentials in handler_config_json or receipts.
|
|
10
|
+
|
|
11
|
+
PRAGMA foreign_keys = ON;
|
|
12
|
+
|
|
13
|
+
CREATE TABLE IF NOT EXISTS agentsam_hook (
|
|
14
|
+
id TEXT PRIMARY KEY DEFAULT ('hook_' || lower(hex(randomblob(8)))),
|
|
15
|
+
owner_id TEXT NOT NULL DEFAULT 'local',
|
|
16
|
+
hook_key TEXT NOT NULL CHECK(length(trim(hook_key)) > 0 AND hook_key = trim(hook_key)),
|
|
17
|
+
event_type TEXT NOT NULL CHECK(length(trim(event_type)) > 0 AND event_type = trim(event_type)),
|
|
18
|
+
source_kind TEXT NOT NULL DEFAULT 'stored'
|
|
19
|
+
CHECK(source_kind IN ('stored','config','code','system')),
|
|
20
|
+
scope_type TEXT NOT NULL DEFAULT 'project'
|
|
21
|
+
CHECK(scope_type IN ('global','account','repository','project','session')),
|
|
22
|
+
scope_ref TEXT,
|
|
23
|
+
handler_type TEXT NOT NULL DEFAULT 'log_only'
|
|
24
|
+
CHECK(length(trim(handler_type)) > 0 AND handler_type = trim(handler_type)),
|
|
25
|
+
handler_config_json TEXT NOT NULL DEFAULT '{}'
|
|
26
|
+
CHECK(json_valid(handler_config_json)),
|
|
27
|
+
match_json TEXT NOT NULL DEFAULT '{}'
|
|
28
|
+
CHECK(json_valid(match_json)),
|
|
29
|
+
failure_mode TEXT NOT NULL DEFAULT 'open'
|
|
30
|
+
CHECK(failure_mode IN ('open','closed','error')),
|
|
31
|
+
priority INTEGER NOT NULL DEFAULT 100,
|
|
32
|
+
timeout_ms INTEGER NOT NULL DEFAULT 30000
|
|
33
|
+
CHECK(timeout_ms BETWEEN 1 AND 600000),
|
|
34
|
+
is_active INTEGER NOT NULL DEFAULT 1 CHECK(is_active IN (0,1)),
|
|
35
|
+
workflow_id TEXT,
|
|
36
|
+
description TEXT,
|
|
37
|
+
metadata_json TEXT NOT NULL DEFAULT '{}'
|
|
38
|
+
CHECK(json_valid(metadata_json)),
|
|
39
|
+
revision INTEGER NOT NULL DEFAULT 1 CHECK(revision >= 1),
|
|
40
|
+
created_at_unix INTEGER NOT NULL DEFAULT (unixepoch()),
|
|
41
|
+
updated_at_unix INTEGER NOT NULL DEFAULT (unixepoch())
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_agentsam_hook_identity
|
|
45
|
+
ON agentsam_hook(owner_id, scope_type, IFNULL(scope_ref, ''), hook_key);
|
|
46
|
+
CREATE INDEX IF NOT EXISTS idx_agentsam_hook_dispatch
|
|
47
|
+
ON agentsam_hook(owner_id, event_type, is_active, priority, hook_key);
|
|
48
|
+
CREATE INDEX IF NOT EXISTS idx_agentsam_hook_scope
|
|
49
|
+
ON agentsam_hook(owner_id, scope_type, scope_ref, is_active);
|
|
50
|
+
|
|
51
|
+
CREATE TABLE IF NOT EXISTS agentsam_hook_execution (
|
|
52
|
+
id TEXT PRIMARY KEY DEFAULT ('hexec_' || lower(hex(randomblob(8)))),
|
|
53
|
+
owner_id TEXT NOT NULL DEFAULT 'local',
|
|
54
|
+
hook_id TEXT,
|
|
55
|
+
hook_key TEXT NOT NULL,
|
|
56
|
+
source_kind TEXT NOT NULL DEFAULT 'stored'
|
|
57
|
+
CHECK(source_kind IN ('stored','config','code','system')),
|
|
58
|
+
event_type TEXT NOT NULL,
|
|
59
|
+
invocation_id TEXT,
|
|
60
|
+
agent_run_id TEXT,
|
|
61
|
+
session_id TEXT,
|
|
62
|
+
conversation_id TEXT,
|
|
63
|
+
status TEXT NOT NULL
|
|
64
|
+
CHECK(status IN ('completed','failed','timeout','skipped','blocked')),
|
|
65
|
+
duration_ms INTEGER NOT NULL DEFAULT 0 CHECK(duration_ms >= 0),
|
|
66
|
+
input_keys_json TEXT NOT NULL DEFAULT '[]' CHECK(json_valid(input_keys_json)),
|
|
67
|
+
output_keys_json TEXT NOT NULL DEFAULT '[]' CHECK(json_valid(output_keys_json)),
|
|
68
|
+
decision TEXT,
|
|
69
|
+
reason TEXT,
|
|
70
|
+
error_code TEXT,
|
|
71
|
+
error_message TEXT,
|
|
72
|
+
receipt_json TEXT NOT NULL DEFAULT '{}' CHECK(json_valid(receipt_json)),
|
|
73
|
+
correlation_json TEXT NOT NULL DEFAULT '{}' CHECK(json_valid(correlation_json)),
|
|
74
|
+
ran_at_unix INTEGER NOT NULL DEFAULT (unixepoch())
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
CREATE INDEX IF NOT EXISTS idx_agentsam_hook_execution_hook
|
|
78
|
+
ON agentsam_hook_execution(owner_id, hook_key, ran_at_unix DESC);
|
|
79
|
+
CREATE INDEX IF NOT EXISTS idx_agentsam_hook_execution_run
|
|
80
|
+
ON agentsam_hook_execution(agent_run_id, ran_at_unix DESC)
|
|
81
|
+
WHERE agent_run_id IS NOT NULL;
|
|
82
|
+
CREATE INDEX IF NOT EXISTS idx_agentsam_hook_execution_session
|
|
83
|
+
ON agentsam_hook_execution(session_id, ran_at_unix DESC)
|
|
84
|
+
WHERE session_id IS NOT NULL;
|
|
85
|
+
CREATE INDEX IF NOT EXISTS idx_agentsam_hook_execution_failure
|
|
86
|
+
ON agentsam_hook_execution(owner_id, status, ran_at_unix DESC)
|
|
87
|
+
WHERE status IN ('failed','timeout','blocked');
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
-- Durable AgentSam run suspension and append-only activity journal.
|
|
2
|
+
-- Keep agentsam_agent_run.status coarse/backward-compatible; waiting detail lives here.
|
|
3
|
+
|
|
4
|
+
CREATE TABLE IF NOT EXISTS agentsam_agent_run_suspension (
|
|
5
|
+
run_id TEXT PRIMARY KEY NOT NULL REFERENCES agentsam_agent_run(id) ON DELETE CASCADE,
|
|
6
|
+
state TEXT NOT NULL
|
|
7
|
+
CHECK (state IN (
|
|
8
|
+
'waiting_external','waiting_child','awaiting_input','awaiting_approval','sleeping','retry_scheduled'
|
|
9
|
+
)),
|
|
10
|
+
reason TEXT NOT NULL
|
|
11
|
+
CHECK (reason IN ('external','child_run','approval','input','retry','scheduled','rate_limit')),
|
|
12
|
+
wake_at_unix INTEGER,
|
|
13
|
+
wake_event TEXT,
|
|
14
|
+
dependency_run_ids_json TEXT NOT NULL DEFAULT '[]',
|
|
15
|
+
resume_step_id TEXT,
|
|
16
|
+
checkpoint_ref TEXT,
|
|
17
|
+
expires_at_unix INTEGER,
|
|
18
|
+
attempt INTEGER NOT NULL DEFAULT 0 CHECK (attempt >= 0),
|
|
19
|
+
metadata_json TEXT NOT NULL DEFAULT '{}',
|
|
20
|
+
created_at_unix INTEGER NOT NULL DEFAULT (unixepoch()),
|
|
21
|
+
updated_at_unix INTEGER NOT NULL DEFAULT (unixepoch())
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
CREATE INDEX IF NOT EXISTS idx_agentsam_agent_run_suspension_due
|
|
25
|
+
ON agentsam_agent_run_suspension(state, wake_at_unix);
|
|
26
|
+
CREATE INDEX IF NOT EXISTS idx_agentsam_agent_run_suspension_event
|
|
27
|
+
ON agentsam_agent_run_suspension(wake_event);
|
|
28
|
+
|
|
29
|
+
CREATE TABLE IF NOT EXISTS agentsam_agent_run_event (
|
|
30
|
+
event_id TEXT PRIMARY KEY NOT NULL,
|
|
31
|
+
run_id TEXT NOT NULL REFERENCES agentsam_agent_run(id) ON DELETE CASCADE,
|
|
32
|
+
parent_run_id TEXT REFERENCES agentsam_agent_run(id) ON DELETE SET NULL,
|
|
33
|
+
seq INTEGER NOT NULL CHECK (seq >= 0),
|
|
34
|
+
event_type TEXT NOT NULL,
|
|
35
|
+
phase TEXT,
|
|
36
|
+
step_id TEXT,
|
|
37
|
+
label TEXT NOT NULL DEFAULT '',
|
|
38
|
+
detail TEXT,
|
|
39
|
+
progress_current REAL,
|
|
40
|
+
progress_total REAL,
|
|
41
|
+
source_kind TEXT,
|
|
42
|
+
source_name TEXT,
|
|
43
|
+
evidence_json TEXT NOT NULL DEFAULT '{}',
|
|
44
|
+
dedupe_key TEXT,
|
|
45
|
+
created_at_unix INTEGER NOT NULL DEFAULT (unixepoch()),
|
|
46
|
+
UNIQUE(run_id, seq)
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
CREATE INDEX IF NOT EXISTS idx_agentsam_agent_run_event_run_created
|
|
50
|
+
ON agentsam_agent_run_event(run_id, created_at_unix, seq);
|
|
51
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_agentsam_agent_run_event_dedupe
|
|
52
|
+
ON agentsam_agent_run_event(run_id, dedupe_key)
|
|
53
|
+
WHERE dedupe_key IS NOT NULL;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
-- Portable durable Queue Control storage for local SQLite / D1-shaped hosts.
|
|
2
|
+
-- Provider queues remain adapters; this is the local durable scheduler and
|
|
3
|
+
-- reference persistence contract.
|
|
4
|
+
|
|
5
|
+
CREATE TABLE IF NOT EXISTS agentsam_queue_job (
|
|
6
|
+
id TEXT PRIMARY KEY NOT NULL,
|
|
7
|
+
account_id TEXT NOT NULL,
|
|
8
|
+
physical_queue TEXT NOT NULL,
|
|
9
|
+
logical_queue TEXT,
|
|
10
|
+
kind TEXT NOT NULL,
|
|
11
|
+
status TEXT NOT NULL DEFAULT 'queued'
|
|
12
|
+
CHECK(status IN (
|
|
13
|
+
'queued','claimed','running','waiting','batch_waiting','awaiting_input',
|
|
14
|
+
'retry_scheduled','completed','failed','cancelled'
|
|
15
|
+
)),
|
|
16
|
+
priority TEXT NOT NULL DEFAULT 'normal'
|
|
17
|
+
CHECK(priority IN ('low','normal','high','urgent')),
|
|
18
|
+
available_at INTEGER NOT NULL DEFAULT (unixepoch()),
|
|
19
|
+
attempt INTEGER NOT NULL DEFAULT 0 CHECK(attempt >= 0),
|
|
20
|
+
max_attempts INTEGER NOT NULL DEFAULT 3 CHECK(max_attempts >= 1),
|
|
21
|
+
idempotency_key TEXT NOT NULL,
|
|
22
|
+
source_run_id TEXT,
|
|
23
|
+
step_id TEXT,
|
|
24
|
+
lease_owner TEXT,
|
|
25
|
+
lease_expires_at INTEGER,
|
|
26
|
+
lease_generation INTEGER NOT NULL DEFAULT 0 CHECK(lease_generation >= 0),
|
|
27
|
+
job_json TEXT NOT NULL CHECK(json_valid(job_json)),
|
|
28
|
+
result_json TEXT CHECK(result_json IS NULL OR json_valid(result_json)),
|
|
29
|
+
error_json TEXT CHECK(error_json IS NULL OR json_valid(error_json)),
|
|
30
|
+
created_at_unix INTEGER NOT NULL DEFAULT (unixepoch()),
|
|
31
|
+
updated_at_unix INTEGER NOT NULL DEFAULT (unixepoch()),
|
|
32
|
+
completed_at_unix INTEGER
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_agentsam_queue_job_idempotency
|
|
36
|
+
ON agentsam_queue_job(account_id, idempotency_key);
|
|
37
|
+
CREATE INDEX IF NOT EXISTS idx_agentsam_queue_job_due
|
|
38
|
+
ON agentsam_queue_job(physical_queue, status, available_at, lease_expires_at);
|
|
39
|
+
CREATE INDEX IF NOT EXISTS idx_agentsam_queue_job_run
|
|
40
|
+
ON agentsam_queue_job(source_run_id, created_at_unix DESC);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
-- Durable parent/child run dependency projection for AgentSam multi-agent orchestration.
|
|
2
|
+
-- WorkGraph remains the planning authority; this table records the execution linkage
|
|
3
|
+
-- needed to wake parents from child completion without model polling.
|
|
4
|
+
|
|
5
|
+
CREATE TABLE IF NOT EXISTS agentsam_agent_run_dependency (
|
|
6
|
+
parent_run_id TEXT NOT NULL REFERENCES agentsam_agent_run(id) ON DELETE CASCADE,
|
|
7
|
+
child_run_id TEXT NOT NULL REFERENCES agentsam_agent_run(id) ON DELETE CASCADE,
|
|
8
|
+
relation TEXT NOT NULL DEFAULT 'blocks'
|
|
9
|
+
CHECK (relation IN ('blocks','requires','observes')),
|
|
10
|
+
work_item_id TEXT,
|
|
11
|
+
step_id TEXT,
|
|
12
|
+
status TEXT NOT NULL DEFAULT 'pending'
|
|
13
|
+
CHECK (status IN ('pending','satisfied','failed','cancelled')),
|
|
14
|
+
metadata_json TEXT NOT NULL DEFAULT '{}',
|
|
15
|
+
created_at_unix INTEGER NOT NULL DEFAULT (unixepoch()),
|
|
16
|
+
completed_at_unix INTEGER,
|
|
17
|
+
updated_at_unix INTEGER NOT NULL DEFAULT (unixepoch()),
|
|
18
|
+
PRIMARY KEY (parent_run_id, child_run_id, relation)
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
CREATE INDEX IF NOT EXISTS idx_agentsam_run_dependency_parent_status
|
|
22
|
+
ON agentsam_agent_run_dependency(parent_run_id, status, created_at_unix);
|
|
23
|
+
CREATE INDEX IF NOT EXISTS idx_agentsam_run_dependency_child
|
|
24
|
+
ON agentsam_agent_run_dependency(child_run_id, status);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
-- Bootstrap compatibility for analytics authority migration 0009.
|
|
2
|
+
--
|
|
3
|
+
-- Production D1 already had the legacy aggregate-shaped agentsam_analytics
|
|
4
|
+
-- table before 0009 was introduced. A fresh portable/local SQLite database did
|
|
5
|
+
-- not, so 0009 could not run its row-count guard or rename step.
|
|
6
|
+
--
|
|
7
|
+
-- This migration intentionally sorts before 0009 and creates the old empty
|
|
8
|
+
-- aggregate shape only when no agentsam_analytics table exists. On production
|
|
9
|
+
-- or any database that already has either the legacy or canonical table, this
|
|
10
|
+
-- is a no-op. 0009 remains immutable after release.
|
|
11
|
+
|
|
12
|
+
CREATE TABLE IF NOT EXISTS agentsam_analytics (
|
|
13
|
+
id TEXT NOT NULL PRIMARY KEY,
|
|
14
|
+
account_id TEXT NOT NULL,
|
|
15
|
+
date_key TEXT NOT NULL DEFAULT '',
|
|
16
|
+
event_type TEXT NOT NULL DEFAULT '',
|
|
17
|
+
event_name TEXT NOT NULL DEFAULT '',
|
|
18
|
+
workflow_key TEXT NOT NULL DEFAULT '',
|
|
19
|
+
task_type TEXT NOT NULL DEFAULT '',
|
|
20
|
+
model_id TEXT NOT NULL DEFAULT '',
|
|
21
|
+
|
|
22
|
+
total_calls INTEGER NOT NULL DEFAULT 0,
|
|
23
|
+
success_calls INTEGER NOT NULL DEFAULT 0,
|
|
24
|
+
failure_calls INTEGER NOT NULL DEFAULT 0,
|
|
25
|
+
timeout_calls INTEGER NOT NULL DEFAULT 0,
|
|
26
|
+
|
|
27
|
+
total_input_tok INTEGER NOT NULL DEFAULT 0,
|
|
28
|
+
total_output_tok INTEGER NOT NULL DEFAULT 0,
|
|
29
|
+
total_cached_tok INTEGER NOT NULL DEFAULT 0,
|
|
30
|
+
|
|
31
|
+
total_cost_usd REAL NOT NULL DEFAULT 0.0,
|
|
32
|
+
avg_latency_ms REAL NOT NULL DEFAULT 0.0,
|
|
33
|
+
p95_latency_ms REAL NOT NULL DEFAULT 0.0,
|
|
34
|
+
|
|
35
|
+
success_rate REAL NOT NULL DEFAULT 0.0,
|
|
36
|
+
|
|
37
|
+
source TEXT NOT NULL DEFAULT 'live',
|
|
38
|
+
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
39
|
+
updated_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
40
|
+
|
|
41
|
+
UNIQUE(account_id, date_key, event_type, event_name, workflow_key, task_type, model_id)
|
|
42
|
+
ON CONFLICT REPLACE
|
|
43
|
+
);
|