@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,140 @@
|
|
|
1
|
+
# Dual Analytics Product Architecture
|
|
2
|
+
|
|
3
|
+
## Non-negotiable boundary
|
|
4
|
+
|
|
5
|
+
Commerce analytics and AgentSam runtime analytics are both first-class products.
|
|
6
|
+
|
|
7
|
+
Do not collapse ecommerce into AgentSam telemetry merely because AgentSam can
|
|
8
|
+
measure AI cost or execute ecommerce work.
|
|
9
|
+
|
|
10
|
+
```text
|
|
11
|
+
@inneranimalmedia/analytics-ui
|
|
12
|
+
/ / @inneranimalmedia/commerce-analytics @inneranimalmedia/agentsam-analytics
|
|
13
|
+
| |
|
|
14
|
+
revenue/orders/products/customers runs/tools/models/GOAP
|
|
15
|
+
conversion/COGS/cohorts/AOV waits/retries/cost/scores
|
|
16
|
+
store health + AI attribution runtime health + priors
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Commerce stays commerce-owned
|
|
20
|
+
|
|
21
|
+
Examples:
|
|
22
|
+
|
|
23
|
+
- gross revenue
|
|
24
|
+
- orders
|
|
25
|
+
- average order value
|
|
26
|
+
- units sold
|
|
27
|
+
- product mix
|
|
28
|
+
- conversion funnel
|
|
29
|
+
- customer cohorts
|
|
30
|
+
- repeat customer rate
|
|
31
|
+
- pending/refunded share
|
|
32
|
+
- estimated COGS
|
|
33
|
+
- gross margin
|
|
34
|
+
- commerce infrastructure health
|
|
35
|
+
- AgentSam AI spend attributable to commerce operations
|
|
36
|
+
|
|
37
|
+
An order is not an AgentSam event.
|
|
38
|
+
A customer is not a model run.
|
|
39
|
+
Revenue is not a generic reward signal.
|
|
40
|
+
|
|
41
|
+
## AgentSam runtime analytics stays runtime-owned
|
|
42
|
+
|
|
43
|
+
Examples:
|
|
44
|
+
|
|
45
|
+
- run/tool/model events
|
|
46
|
+
- GOAP transitions
|
|
47
|
+
- verification gates
|
|
48
|
+
- test results
|
|
49
|
+
- duration
|
|
50
|
+
- active model time
|
|
51
|
+
- queue wait
|
|
52
|
+
- external wait
|
|
53
|
+
- retries
|
|
54
|
+
- token usage
|
|
55
|
+
- provider/model cost
|
|
56
|
+
- failure origin
|
|
57
|
+
- artifact references
|
|
58
|
+
- versioned score families
|
|
59
|
+
|
|
60
|
+
## Correlation, not collapse
|
|
61
|
+
|
|
62
|
+
The domains may correlate through stable identifiers such as:
|
|
63
|
+
|
|
64
|
+
- account_id
|
|
65
|
+
- tenant_id
|
|
66
|
+
- run_id
|
|
67
|
+
- receipt_id
|
|
68
|
+
- source_id
|
|
69
|
+
- dimensions.order_id
|
|
70
|
+
- dimensions.product_id
|
|
71
|
+
- dimensions.customer_id
|
|
72
|
+
- dimensions.campaign_id
|
|
73
|
+
|
|
74
|
+
This enables useful cross-domain questions:
|
|
75
|
+
|
|
76
|
+
- AI cost per fulfilled order
|
|
77
|
+
- image-generation cost per sellable product
|
|
78
|
+
- merchandising automation cost vs gross margin
|
|
79
|
+
- support-agent cost per resolved commerce incident
|
|
80
|
+
- test/deploy cost per storefront release
|
|
81
|
+
|
|
82
|
+
## Storage/read path
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
meaningful AgentSam operation
|
|
86
|
+
|
|
|
87
|
+
v
|
|
88
|
+
emitAnalyticsFact()
|
|
89
|
+
|
|
|
90
|
+
+--> agentsam_analytics (D1 hot fact authority)
|
|
91
|
+
|
|
|
92
|
+
+--> AGENTSAM_ACTIVITY -> Basin -> Iceberg/Parquet
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Commerce continues to use commerce-owned operational and aggregate sources.
|
|
96
|
+
|
|
97
|
+
UI reads stable read models, never raw tables directly.
|
|
98
|
+
|
|
99
|
+
## Visual grammar
|
|
100
|
+
|
|
101
|
+
Fuel & Free Time remains the donor:
|
|
102
|
+
|
|
103
|
+
- light application shell
|
|
104
|
+
- dark analytical cards
|
|
105
|
+
- compact KPI row
|
|
106
|
+
- dense tables
|
|
107
|
+
- range selector
|
|
108
|
+
- status indicators
|
|
109
|
+
- sparklines
|
|
110
|
+
- time-series charts
|
|
111
|
+
- health/incident views
|
|
112
|
+
|
|
113
|
+
AgentSam surfaces:
|
|
114
|
+
- Overview
|
|
115
|
+
- Usage & Cost
|
|
116
|
+
- Performance
|
|
117
|
+
- Health
|
|
118
|
+
- Scores
|
|
119
|
+
|
|
120
|
+
Commerce surfaces stay intact and can grow:
|
|
121
|
+
- Overview
|
|
122
|
+
- Finance
|
|
123
|
+
- Health
|
|
124
|
+
- Merch
|
|
125
|
+
- Products
|
|
126
|
+
- Customers
|
|
127
|
+
- Fulfillment
|
|
128
|
+
- Marketing
|
|
129
|
+
- AI Cost Attribution
|
|
130
|
+
|
|
131
|
+
## Instrumentation law
|
|
132
|
+
|
|
133
|
+
Do not instrument every helper.
|
|
134
|
+
|
|
135
|
+
Instrument meaningful boundaries that consume:
|
|
136
|
+
time, tokens, paid APIs, compute, I/O, network, queue capacity, storage,
|
|
137
|
+
external quota, or durable state mutation.
|
|
138
|
+
|
|
139
|
+
Raw facts are evidence.
|
|
140
|
+
Scores are recomputable interpretations.
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Hooks, model inventory, and self-hosting plan
|
|
2
|
+
|
|
3
|
+
Status: active implementation plan (2026-10-02)
|
|
4
|
+
|
|
5
|
+
## Decisions
|
|
6
|
+
|
|
7
|
+
### Hooks are one runtime concept
|
|
8
|
+
|
|
9
|
+
AgentSam has one lifecycle event catalog, one output merge algorithm, and one
|
|
10
|
+
receipt format. It has multiple **authoring sources**, not multiple kinds of
|
|
11
|
+
hook:
|
|
12
|
+
|
|
13
|
+
| Source | Authored in | Dashboard/CLI behavior | Durable definition row |
|
|
14
|
+
|---|---|---|---|
|
|
15
|
+
| `code` | SDK registration | visible, read-only | no |
|
|
16
|
+
| `config` | `agentsam.hooks.json` or `.agentsam/hooks.json` | visible, file-owned | no |
|
|
17
|
+
| `stored` | CLI/API/dashboard | visible and mutable | `agentsam_hook` |
|
|
18
|
+
| `system` | AgentSam runtime | visible, read-only | only when a host intentionally materializes it |
|
|
19
|
+
|
|
20
|
+
React hooks (`useAgentHooks`, `useHookList`) are UI implementation details and
|
|
21
|
+
must never be called lifecycle hooks in product copy.
|
|
22
|
+
|
|
23
|
+
Dispatch order is priority, then hook key. Source does not create a second
|
|
24
|
+
semantics path. A source badge answers where to edit a definition. Execution
|
|
25
|
+
receipts from all sources go to the same `agentsam_hook_execution` projection.
|
|
26
|
+
|
|
27
|
+
### Portable ownership is owner + optional scope
|
|
28
|
+
|
|
29
|
+
The portable hook schema deliberately has no `tenant_id`, `workspace_id`,
|
|
30
|
+
`user_id`, `person_uuid`, or installation-specific foreign keys.
|
|
31
|
+
|
|
32
|
+
- `owner_id` is an opaque host/account/local owner key.
|
|
33
|
+
- `scope_type` is `global`, `account`, `repository`, `project`, or `session`.
|
|
34
|
+
- `scope_ref` contains the corresponding opaque id/path when needed.
|
|
35
|
+
- `agent_run_id`, `session_id`, and `conversation_id` are the common execution
|
|
36
|
+
correlations.
|
|
37
|
+
- Rare correlations (plan, todo, workflow run, command run, route) belong in
|
|
38
|
+
`correlation_json`, not a permanently sparse column set.
|
|
39
|
+
- `workflow_id` is a soft reference on the definition. The hook pack remains
|
|
40
|
+
installable without a workflow table family.
|
|
41
|
+
- Handler credentials are references resolved by the host. They are never
|
|
42
|
+
values in `handler_config_json`.
|
|
43
|
+
|
|
44
|
+
The canonical fresh-install SQL is
|
|
45
|
+
`migrations/runtime/0005_agentsam_hooks.sql`. The standalone hooks package
|
|
46
|
+
ships a generated byte-identical copy plus `schema/manifest.json`.
|
|
47
|
+
|
|
48
|
+
Existing hosted tables with required `user_id` or tenant/workspace columns are
|
|
49
|
+
**not** silently rebuilt. The hosted owner must inspect references and run an
|
|
50
|
+
explicit copy/verify/swap migration. Portable initialization is idempotent and
|
|
51
|
+
will not guess that `user_id` equals an account owner.
|
|
52
|
+
|
|
53
|
+
### The existing model surfaces keep their jobs
|
|
54
|
+
|
|
55
|
+
No new per-model-per-user table is introduced.
|
|
56
|
+
|
|
57
|
+
| Existing surface | Authority |
|
|
58
|
+
|---|---|
|
|
59
|
+
| `src/models/catalog.js` / hosted `agentsam_model_catalog` | curated provider-qualified reference capabilities; never credential availability |
|
|
60
|
+
| `agentsam_model_pricing` | global/versioned reference pricing |
|
|
61
|
+
| `agentsam_plugins` with `plugin_kind='ai'` | one installation per account/environment/provider/credential reference; health and last good credential-scoped model snapshot |
|
|
62
|
+
| `user_secrets` / machine vault | provider secret material; never model metadata |
|
|
63
|
+
| `agentsam_api_credentials` | authentication to AgentSam itself; never provider keys |
|
|
64
|
+
| `agentsam_model_eval_observations` | eval evidence; not a portable customer model catalog |
|
|
65
|
+
|
|
66
|
+
A successful provider probe writes a compact
|
|
67
|
+
`agentsam.provider-model-snapshot.v1` object into the AI plugin row's
|
|
68
|
+
`metadata_json.model_snapshot`. It contains sorted model ids, count, hash, and
|
|
69
|
+
fetch time. `recordAiPluginModelDiscovery` writes it through the existing
|
|
70
|
+
plugin registry and health-check log. A failed probe updates health evidence
|
|
71
|
+
but preserves the last good snapshot. Secret values and hashes of secret values
|
|
72
|
+
are never included.
|
|
73
|
+
|
|
74
|
+
The provider API remains the availability authority at use time. A snapshot is
|
|
75
|
+
stale-while-revalidate evidence for UI convenience, not an authorization gate.
|
|
76
|
+
Reference catalog enrichment is never an availability claim. Unknown models
|
|
77
|
+
continue to work with unknown/reference capabilities where the adapter can use
|
|
78
|
+
them.
|
|
79
|
+
|
|
80
|
+
Provider/model identity is the pair `(provider, provider_model_id)`. The SDK's
|
|
81
|
+
`model_key` already encodes that pair (`openai:gpt-…`, `cursor:…`). Hosted SQL
|
|
82
|
+
must use `UNIQUE(provider, model_key)` (or a provider-qualified `model_key`),
|
|
83
|
+
not global `UNIQUE(model_key)`. Provider ids should match SDK canonical ids:
|
|
84
|
+
`openai`, `anthropic`, `gemini`, `xai`, `cursor`, `cloudflare`, and `ollama`.
|
|
85
|
+
Display names are not ids.
|
|
86
|
+
|
|
87
|
+
## Product and CLI experience
|
|
88
|
+
|
|
89
|
+
`agentsam hooks` and `/hooks` are the factual control surface:
|
|
90
|
+
|
|
91
|
+
- `status` — source counts, project config, and stored registry health.
|
|
92
|
+
- `list` — merged dispatch order with source, handler, state, and priority.
|
|
93
|
+
- `executions` — recent value-free receipts and redacted failures.
|
|
94
|
+
- `validate` — portable config validation.
|
|
95
|
+
- `init` — idempotently creates `.agentsam/hooks.json`.
|
|
96
|
+
- `enable` / `disable` — toggles stored definitions only.
|
|
97
|
+
|
|
98
|
+
The dashboard should consume the same status/list/execution projection. It must
|
|
99
|
+
not maintain a second event list or merge algorithm. Code rows are read-only;
|
|
100
|
+
config rows link to their source file; stored rows expose full editing. A future
|
|
101
|
+
priority/disable override for code hooks must be an explicit overlay keyed by
|
|
102
|
+
`(owner_id, source_kind, hook_key)`, not a copied code definition.
|
|
103
|
+
|
|
104
|
+
The model picker follows a similar provenance rule:
|
|
105
|
+
|
|
106
|
+
1. show models discovered for the selected plugin/credential installation;
|
|
107
|
+
2. enrich from the global catalog when a provider-qualified match exists;
|
|
108
|
+
3. label every limit/capability as provider, reference, or unknown;
|
|
109
|
+
4. keep pinned/default visibility in the AI plugin's `config_json`;
|
|
110
|
+
5. never write discovered ids into the global catalog.
|
|
111
|
+
|
|
112
|
+
## Dogfooding matrix
|
|
113
|
+
|
|
114
|
+
| Runtime point | Hook event | Current owner |
|
|
115
|
+
|---|---|---|
|
|
116
|
+
| interactive shell open/close | `session_start`, `session_end` | CLI shell |
|
|
117
|
+
| submitted/transformed input | `user_prompt_submitted`, `user_prompt_transformed` | provider-neutral runner |
|
|
118
|
+
| paid inference boundaries | `pre_model_use`, `post_model_use` | provider adapter |
|
|
119
|
+
| capability side effects | `pre_tool_use`, `post_tool_use`, `post_tool_use_failure` | capability adapter |
|
|
120
|
+
| provider/tool failures | `error_occurred` | provider/capability adapters |
|
|
121
|
+
| autonomous continuation | `agent_stop` | runner with bounded continuation count |
|
|
122
|
+
| delegated work | `subagent_start`, `subagent_stop` | delegated-agent adapter |
|
|
123
|
+
|
|
124
|
+
The interactive CLI loads code, project config, and active stored hooks into the
|
|
125
|
+
same runtime. `session_start.modified_config` may override the session's model,
|
|
126
|
+
reasoning, service tier, and compaction preference; arbitrary process or path
|
|
127
|
+
configuration is not applied. Session context is injected through normal
|
|
128
|
+
context items. Every invocation uses the same receipt observer and local
|
|
129
|
+
execution table.
|
|
130
|
+
|
|
131
|
+
`session_end` remains best effort. Handlers must be idempotent, and durable
|
|
132
|
+
cleanup must eventually be backed by an idle-session sweeper rather than an
|
|
133
|
+
assumption that a process always exits normally.
|
|
134
|
+
|
|
135
|
+
## Delivery sequence
|
|
136
|
+
|
|
137
|
+
### Phase 1 — portable core (implemented in this change)
|
|
138
|
+
|
|
139
|
+
- Canonical portable hook tables and schema-pack manifest.
|
|
140
|
+
- Generic injected-SQL hook store for SQLite/D1-shaped adapters.
|
|
141
|
+
- Stored/config/code source merging.
|
|
142
|
+
- CLI `/hooks` discovery and value-free execution history.
|
|
143
|
+
- Actual shell/runner dogfooding, including session and transformed-prompt
|
|
144
|
+
events.
|
|
145
|
+
- Compact AI plugin model snapshot contract and existing-plugin persistence API with last-good preservation.
|
|
146
|
+
|
|
147
|
+
### Phase 2 — hosted compatibility migration
|
|
148
|
+
|
|
149
|
+
1. Inventory every FK/view/query referencing hosted `agentsam_hook` and
|
|
150
|
+
`agentsam_hook_execution`.
|
|
151
|
+
2. Create `_v2` tables from the portable columns plus host-required indexes.
|
|
152
|
+
3. Map `owner_id` from the hosted account authority; do not infer it from a
|
|
153
|
+
tenant/workspace label.
|
|
154
|
+
4. Move legacy handler fields into `handler_config_json` and legacy correlation
|
|
155
|
+
fields into `correlation_json`.
|
|
156
|
+
5. Validate row counts, active definitions, orphan references, JSON validity,
|
|
157
|
+
and sampled execution history.
|
|
158
|
+
6. Swap in one transaction where supported; retain a rollback table until
|
|
159
|
+
production verification completes.
|
|
160
|
+
7. Add the dashboard API only after ownership checks are enforced by the host.
|
|
161
|
+
|
|
162
|
+
### Phase 3 — shared dashboard projection
|
|
163
|
+
|
|
164
|
+
- Expose merged definitions and receipts through an injected HookRegistry API.
|
|
165
|
+
- Add source badges, event filters, dry-run input, and last-failure state.
|
|
166
|
+
- Add stored-hook create/edit with handler-specific forms.
|
|
167
|
+
- Add explicit code-hook overrides without copying handler definitions.
|
|
168
|
+
- Reuse the protocol conformance fixtures in UI/API integration tests.
|
|
169
|
+
|
|
170
|
+
### Phase 4 — model snapshot persistence
|
|
171
|
+
|
|
172
|
+
- Apply `createAiPluginProbePatch` in the hosted provider probe transaction.
|
|
173
|
+
- Compare `models_hash`; avoid writes when the snapshot is unchanged.
|
|
174
|
+
- Refresh stale snapshots in the background and through `agentsam models
|
|
175
|
+
--refresh` without blocking startup.
|
|
176
|
+
- Keep last good ids on auth/network failures and expose health separately.
|
|
177
|
+
- Add retention only to probe history, not the last good plugin snapshot.
|
|
178
|
+
|
|
179
|
+
### Phase 5 — lifecycle reliability
|
|
180
|
+
|
|
181
|
+
- Add stale-session sweep and idempotent cleanup jobs.
|
|
182
|
+
- Add execution retention/compaction policy.
|
|
183
|
+
- Add local↔remote receipt sync by immutable execution id where explicitly
|
|
184
|
+
enabled; never sync secrets or full prompt/tool values.
|
|
185
|
+
- Run JSON conformance fixtures in JavaScript, Python, Go, and Rust CI.
|
|
186
|
+
|
|
187
|
+
## Acceptance checks
|
|
188
|
+
|
|
189
|
+
- Fresh SQLite and D1-shaped installs produce the same hook tables.
|
|
190
|
+
- No portable hook query requires tenant/workspace/user tables.
|
|
191
|
+
- A prompt value or tool result value cannot be found in a hook receipt row.
|
|
192
|
+
- Config and stored hooks execute in one deterministic priority order.
|
|
193
|
+
- The CLI lists every active source that can affect a turn.
|
|
194
|
+
- A provider probe with 1,000 model ids produces one AI plugin metadata update,
|
|
195
|
+
not 1,000 catalog rows.
|
|
196
|
+
- Failed model refreshes preserve the last successful model id list.
|
|
197
|
+
- A catalog miss never blocks a provider-verified model solely because the
|
|
198
|
+
reference package is older.
|
|
199
|
+
- Provider and AgentSam credentials remain separate authorities.
|
|
@@ -260,7 +260,7 @@ forces a package change, the seam is wrong.
|
|
|
260
260
|
|
|
261
261
|
| Field | Value |
|
|
262
262
|
|---|---|
|
|
263
|
-
| Worktree |
|
|
263
|
+
| Worktree | `worktree://content-studio-audit` |
|
|
264
264
|
| Branch | `audit/agentsam-content-studio-transplant-20260927` |
|
|
265
265
|
| Base head | `28ef451` (transplant on main) |
|
|
266
266
|
| Brand audit | `/tmp/agentsam-brand-authority-audit.json` |
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# AgentSam Go Product / Project / Deployment Authority
|
|
2
|
+
|
|
3
|
+
## Product
|
|
4
|
+
|
|
5
|
+
`@inneranimalmedia/agentsam-go-worker` is a distributable AgentSam product.
|
|
6
|
+
|
|
7
|
+
The portable package owns source code and the generic Cloudflare Worker +
|
|
8
|
+
Container configuration.
|
|
9
|
+
|
|
10
|
+
It does not own a customer's Cloudflare account, domain, or mutable project
|
|
11
|
+
state.
|
|
12
|
+
|
|
13
|
+
## Project instance
|
|
14
|
+
|
|
15
|
+
Mutable AgentSam Go state belongs to the caller repository:
|
|
16
|
+
|
|
17
|
+
`<project>/.agentsam/go/`
|
|
18
|
+
|
|
19
|
+
This rule applies equally to maintainers and third-party users.
|
|
20
|
+
|
|
21
|
+
Product source must not become state authority merely because it was discovered
|
|
22
|
+
from the SDK repository.
|
|
23
|
+
|
|
24
|
+
## Deployment
|
|
25
|
+
|
|
26
|
+
A deployment belongs to the Cloudflare account selected by the current user.
|
|
27
|
+
|
|
28
|
+
The published portable config:
|
|
29
|
+
|
|
30
|
+
`apps/agentsam-go-worker/wrangler.jsonc`
|
|
31
|
+
|
|
32
|
+
must not contain InnerAnimalMedia's production hostname.
|
|
33
|
+
|
|
34
|
+
InnerAnimalMedia production deployment is a separate explicit maintainer path:
|
|
35
|
+
|
|
36
|
+
`apps/agentsam-go-worker/wrangler.inneranimalmedia.jsonc`
|
|
37
|
+
|
|
38
|
+
That file is intentionally excluded from the npm package `files` contract.
|
|
39
|
+
|
|
40
|
+
## Invariants
|
|
41
|
+
|
|
42
|
+
- `runtime.inneranimalmedia.com` is Sam's deployment, not the AgentSam Go product.
|
|
43
|
+
- self-host mode uses `wrangler.jsonc`
|
|
44
|
+
- official release mode uses `wrangler.inneranimalmedia.jsonc`
|
|
45
|
+
- self-host state belongs to the caller project
|
|
46
|
+
- maintainer state follows the same caller-project rule
|
|
47
|
+
- no live deployment is performed by portability tests
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## Receipt location
|
|
51
|
+
|
|
52
|
+
Interactive `agentsam go` asks the operator where run receipts/state should live.
|
|
53
|
+
|
|
54
|
+
Supported choices:
|
|
55
|
+
|
|
56
|
+
- project-local
|
|
57
|
+
- central `~/.agentsam/receipts/<project>`
|
|
58
|
+
- custom directory
|
|
59
|
+
|
|
60
|
+
Non-interactive callers may use:
|
|
61
|
+
|
|
62
|
+
`--receipt-root <path>`
|
|
63
|
+
|
|
64
|
+
Distribution verification remains offline by default. Ambient Cloudflare
|
|
65
|
+
credentials do not enable remote/container verification. Explicit opt-in is:
|
|
66
|
+
|
|
67
|
+
`AGENTSAM_VERIFY_GO_CLOUDFLARE=1`
|
|
68
|
+
|
|
69
|
+
Dry-run and skip-deploy lanes must never execute Docker.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Stage 01 — Lane Initialization
|
|
2
|
+
|
|
3
|
+
## Change
|
|
4
|
+
|
|
5
|
+
Created a clean worktree from `origin/main` for the Work Suite
|
|
6
|
+
graduation and provider-internal rename pass.
|
|
7
|
+
|
|
8
|
+
## Reason
|
|
9
|
+
|
|
10
|
+
The ordinary SDK checkout may contain unrelated work. Mechanical
|
|
11
|
+
provider renames need an isolated ancestry so later functional work
|
|
12
|
+
has a trustworthy base.
|
|
13
|
+
|
|
14
|
+
## Acceptance
|
|
15
|
+
|
|
16
|
+
- clean dedicated worktree
|
|
17
|
+
- dedicated feature branch
|
|
18
|
+
- rename policy documented before code mutation
|
|
19
|
+
- auth/provider authority explicitly documented
|
|
20
|
+
- no production/runtime provider contracts changed
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Runtime Environment Contract
|
|
2
|
+
|
|
3
|
+
Schema: `agentsam.runtime-environment-contract.v1`
|
|
4
|
+
|
|
5
|
+
Status: **APPROVED / PROTECTED**
|
|
6
|
+
|
|
7
|
+
## Meaning of "safe"
|
|
8
|
+
|
|
9
|
+
These runtime bindings are known-good parts of the existing
|
|
10
|
+
AgentSam / Local Studio environment contract.
|
|
11
|
+
|
|
12
|
+
"Safe" means:
|
|
13
|
+
|
|
14
|
+
- preserve the binding name
|
|
15
|
+
- preserve its existing environment value
|
|
16
|
+
- preserve Variable vs Secret classification
|
|
17
|
+
- allow existing Production / Previews / Base wiring to continue
|
|
18
|
+
- do not reinterpret the name during internal provider refactors
|
|
19
|
+
|
|
20
|
+
It does **not** mean secret values are public.
|
|
21
|
+
|
|
22
|
+
Secret values must remain encrypted and must never be written into
|
|
23
|
+
this repository, logs, frontend state, query parameters, generated
|
|
24
|
+
documentation, test snapshots, or Git diffs.
|
|
25
|
+
|
|
26
|
+
## Approved runtime variables
|
|
27
|
+
|
|
28
|
+
- `CLOUDFLARE_ACCOUNT_ID`
|
|
29
|
+
- `GITHUB_APP_ID`
|
|
30
|
+
- `GITHUB_CLIENT_ID`
|
|
31
|
+
- `GOOGLE_CLIENT_ID`
|
|
32
|
+
- `GOOGLE_DESKTOP_CLIENT_ID`
|
|
33
|
+
- `IAM_CLIENT_ID`
|
|
34
|
+
- `IAM_OAUTH_ISSUER`
|
|
35
|
+
|
|
36
|
+
## Approved runtime secrets
|
|
37
|
+
|
|
38
|
+
- `AGENTSAM_API_KEY`
|
|
39
|
+
- `AGENTSAM_BRIDGE_KEY`
|
|
40
|
+
- `CLOUDFLARE_API_TOKEN`
|
|
41
|
+
- `CLOUDFLARE_BREAK_GLASS_ADMIN_TOKEN`
|
|
42
|
+
- `CLOUDFLARE_OAUTH_CLIENT_ID`
|
|
43
|
+
- `CURSOR_API_KEY`
|
|
44
|
+
- `GEMINI_API_KEY`
|
|
45
|
+
- `GITHUB_APP_PRIVATE_KEY`
|
|
46
|
+
- `GITHUB_CLIENT_SECRET`
|
|
47
|
+
- `GITHUB_WEBHOOK_SECRET`
|
|
48
|
+
- `GOOGLE_CLIENT_SECRET`
|
|
49
|
+
- `GOOGLE_DESKTOP_CLIENT_SECRET`
|
|
50
|
+
- `IAM_CLIENT_SECRET`
|
|
51
|
+
- `OPENAI_API_KEY`
|
|
52
|
+
- `VAULT_MASTER_KEY`
|
|
53
|
+
|
|
54
|
+
## Refactor protection
|
|
55
|
+
|
|
56
|
+
Internal provider abbreviations are implementation-path vocabulary:
|
|
57
|
+
|
|
58
|
+
- `cfoa`
|
|
59
|
+
- `gclioa`
|
|
60
|
+
- `goaude`
|
|
61
|
+
- `gdrv`
|
|
62
|
+
|
|
63
|
+
They MUST NOT cause environment variables such as:
|
|
64
|
+
|
|
65
|
+
- `CLOUDFLARE_ACCOUNT_ID`
|
|
66
|
+
- `CLOUDFLARE_API_TOKEN`
|
|
67
|
+
- `CLOUDFLARE_OAUTH_CLIENT_ID`
|
|
68
|
+
- `GOOGLE_CLIENT_ID`
|
|
69
|
+
- `GOOGLE_CLIENT_SECRET`
|
|
70
|
+
- `GOOGLE_DESKTOP_CLIENT_ID`
|
|
71
|
+
- `GOOGLE_DESKTOP_CLIENT_SECRET`
|
|
72
|
+
|
|
73
|
+
to be renamed.
|
|
74
|
+
|
|
75
|
+
Environment-variable names are runtime contracts, not implementation
|
|
76
|
+
filenames.
|
|
77
|
+
|
|
78
|
+
## Existing `.env` / deployment behavior
|
|
79
|
+
|
|
80
|
+
Preserve the working runtime environment pattern.
|
|
81
|
+
|
|
82
|
+
This lane does not require moving, deleting, rotating, renaming, or
|
|
83
|
+
changing the values of these bindings.
|
|
84
|
+
|
|
85
|
+
Environment-specific values remain managed by their existing runtime
|
|
86
|
+
environment / secret-management authority.
|
|
87
|
+
|
|
88
|
+
## OAuth boundary
|
|
89
|
+
|
|
90
|
+
Provider implementation-file cleanup does not redesign authentication.
|
|
91
|
+
|
|
92
|
+
Existing Google, Google Desktop, Cloudflare, IAM, GitHub, AgentSam,
|
|
93
|
+
bridge, Vault, and model-provider credentials retain their current
|
|
94
|
+
runtime authority.
|
|
95
|
+
|
|
96
|
+
Portable UI packages must consume server/native capability adapters.
|
|
97
|
+
They must not ingest these secrets directly.
|
|
98
|
+
|
|
99
|
+
## Environments
|
|
100
|
+
|
|
101
|
+
Approved contract scopes:
|
|
102
|
+
|
|
103
|
+
- Production
|
|
104
|
+
- Previews
|
|
105
|
+
- Base
|
|
106
|
+
|
|
107
|
+
A later deployment hardening pass may intentionally vary whether a
|
|
108
|
+
particular credential is populated in each environment, but that is
|
|
109
|
+
separate from this mechanical rename lane.
|
|
110
|
+
|
|
111
|
+
## Values
|
|
112
|
+
|
|
113
|
+
Actual runtime values are intentionally omitted from this document.
|
|
114
|
+
|
|
115
|
+
The repository records the contract, not the credentials.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Stage 02 — Cloudflare OAuth Internal Directory
|
|
2
|
+
|
|
3
|
+
## Change
|
|
4
|
+
|
|
5
|
+
Renamed:
|
|
6
|
+
|
|
7
|
+
`packages/connectors/cloudflare/`
|
|
8
|
+
→ `packages/connectors/cfoa/`
|
|
9
|
+
|
|
10
|
+
`cfoa` means **Cloudflare OAuth**.
|
|
11
|
+
|
|
12
|
+
## Scope
|
|
13
|
+
|
|
14
|
+
This stage changes implementation filesystem naming only.
|
|
15
|
+
|
|
16
|
+
It does **not** rename:
|
|
17
|
+
|
|
18
|
+
- runtime provider ID `cloudflare`
|
|
19
|
+
- Cloudflare OAuth routes
|
|
20
|
+
- Cloudflare API URLs
|
|
21
|
+
- environment variables
|
|
22
|
+
- D1/R2 scope strings
|
|
23
|
+
- D1/R2 provider IDs
|
|
24
|
+
- persisted connection/provider values
|
|
25
|
+
- public package names
|
|
26
|
+
|
|
27
|
+
## Rewritten tracked references
|
|
28
|
+
|
|
29
|
+
- `apps/agentsamd/agentsam.package.json`
|
|
30
|
+
- `apps/local-studio/backend/worker/cloudflare-code-mode.js`
|
|
31
|
+
- `apps/local-studio/backend/worker/connections-registry.js`
|
|
32
|
+
- `apps/local-studio/backend/worker/database-service.js`
|
|
33
|
+
- `apps/local-studio/backend/worker/index.js`
|
|
34
|
+
- `apps/local-studio/backend/worker/plugin-registry.js`
|
|
35
|
+
- `apps/local-studio/package-lock.json`
|
|
36
|
+
- `docs/SOURCE_ARCHITECTURE.md`
|
|
37
|
+
- `docs/engineering/provider-internal-renames/README.md`
|
|
38
|
+
- `package-lock.json`
|
|
39
|
+
- `package.json`
|
|
40
|
+
- `packages/agentsam-knowledge/src/backends/index.js`
|
|
41
|
+
- `packages/connectors/cfoa/package.json`
|
|
42
|
+
- `packages/identity/src/oauth/credentials.js`
|
|
43
|
+
- `scripts/verify-package.mjs`
|
|
44
|
+
- `src/commands/cloudflare-login.js`
|
|
45
|
+
- `src/commands/cloudflare.js`
|
|
46
|
+
- `src/commands/connections.js`
|
|
47
|
+
- `src/lib/deploy/local-studio.js`
|
|
48
|
+
- `src/lib/whoami-capabilities.js`
|
|
49
|
+
- `src/mcp/cloudflare-bundles.js`
|
|
50
|
+
- `test/cloudflare-connector.test.mjs`
|
|
51
|
+
- `test/local-studio-deploy.test.mjs`
|
|
52
|
+
|
|
53
|
+
## Architecture
|
|
54
|
+
|
|
55
|
+
Cloudflare authentication remains a host/provider authority.
|
|
56
|
+
Portable Work/content UI packages consume capability-bearing
|
|
57
|
+
adapters and must not own OAuth tokens themselves.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Stage 03 — Google CLI OAuth Internal Filename
|
|
2
|
+
|
|
3
|
+
## Change
|
|
4
|
+
|
|
5
|
+
Renamed:
|
|
6
|
+
|
|
7
|
+
`apps/local-studio/backend/worker/google-cli-cloud.js`
|
|
8
|
+
→ `apps/local-studio/backend/worker/gclioa.js`
|
|
9
|
+
|
|
10
|
+
`gclioa` means **Google CLI OAuth**.
|
|
11
|
+
|
|
12
|
+
## Important boundary
|
|
13
|
+
|
|
14
|
+
This stage intentionally does not globally replace the string
|
|
15
|
+
`google-cli-cloud`.
|
|
16
|
+
|
|
17
|
+
Any external OAuth route, callback identifier, protocol value,
|
|
18
|
+
persisted value, or API contract retains its existing name.
|
|
19
|
+
|
|
20
|
+
Only the implementation filename and module references were
|
|
21
|
+
mechanically revised.
|
|
22
|
+
|
|
23
|
+
## Tracked files rewritten
|
|
24
|
+
|
|
25
|
+
- `apps/local-studio/backend/worker/index.js`
|
|
26
|
+
- `docs/engineering/provider-internal-renames/README.md`
|
|
27
|
+
|
|
28
|
+
## Auth authority
|
|
29
|
+
|
|
30
|
+
This remains the existing Google CLI/cloud OAuth lane. No new
|
|
31
|
+
credential store, identity system, or frontend token transport
|
|
32
|
+
is introduced.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Stage 04 — Google Desktop OAuth Exchange Internals
|
|
2
|
+
|
|
3
|
+
## Change
|
|
4
|
+
|
|
5
|
+
Renamed the two implementation files representing the desktop
|
|
6
|
+
Google OAuth/native handoff lane:
|
|
7
|
+
|
|
8
|
+
`apps/local-studio/backend/worker/google-desktop-exchange.js`
|
|
9
|
+
→ `apps/local-studio/backend/worker/goaude.js`
|
|
10
|
+
|
|
11
|
+
`packages/identity/src/oauth/google-desktop-exchange.js`
|
|
12
|
+
→ `packages/identity/src/oauth/goaude.js`
|
|
13
|
+
|
|
14
|
+
`goaude` is the compact internal name for the Google OAuth
|
|
15
|
+
desktop/dashboard exchange implementation.
|
|
16
|
+
|
|
17
|
+
## Preserved behavior
|
|
18
|
+
|
|
19
|
+
The existing desktop PKCE/native OAuth architecture remains
|
|
20
|
+
unchanged.
|
|
21
|
+
|
|
22
|
+
This stage does not rename or redesign:
|
|
23
|
+
|
|
24
|
+
- OAuth callback URLs
|
|
25
|
+
- native deep-link protocols
|
|
26
|
+
- PKCE semantics
|
|
27
|
+
- native handoff records
|
|
28
|
+
- IAM session semantics
|
|
29
|
+
- Google provider identity
|
|
30
|
+
- browser-to-native exchange behavior
|
|
31
|
+
|
|
32
|
+
## Tracked references revised
|
|
33
|
+
|
|
34
|
+
- `apps/local-studio/backend/worker/goaude.js`
|
|
35
|
+
- `apps/local-studio/backend/worker/index.js`
|
|
36
|
+
- `apps/local-studio/scripts/google-desktop-exchange.test.mjs`
|
|
37
|
+
- `apps/local-studio/scripts/smoke-desktop-auth.mjs`
|
|
38
|
+
- `docs/engineering/provider-internal-renames/README.md`
|
|
39
|
+
- `package.json`
|
|
40
|
+
- `packages/identity/src/index.js`
|
|
41
|
+
- `packages/identity/src/oauth/README.md`
|
|
42
|
+
- `packages/identity/src/server/worker-router.js`
|
|
43
|
+
- `packages/identity/tests/google-desktop-identity-login.test.mjs`
|
|
44
|
+
- `packages/identity/tests/oauth-presets-accounts-ssot.test.mjs`
|
|
45
|
+
|
|
46
|
+
## SDK law
|
|
47
|
+
|
|
48
|
+
Installed Local Studio remains independently usable. Desktop
|
|
49
|
+
Google OAuth must continue through its existing native/PKCE
|
|
50
|
+
authority rather than depending on a hosted-only Work UI flow.
|