@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
package/src/go/probe.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
const EXPECTED_HASH = '2e60bba13dc2bc37d75dd2ce5deb25466f19cb2994e20889388948879875eae9';
|
|
2
|
+
|
|
3
|
+
export async function probeGoDeployment(origin, {
|
|
4
|
+
fetchImpl = globalThis.fetch,
|
|
5
|
+
expectedSource = null,
|
|
6
|
+
expectedSourceCommit = null,
|
|
7
|
+
expectedTarget = null,
|
|
8
|
+
edge = true,
|
|
9
|
+
} = {}) {
|
|
10
|
+
const base = String(origin).replace(/\/+$/, '');
|
|
11
|
+
const results = {};
|
|
12
|
+
const checks = {};
|
|
13
|
+
const probedAt = new Date().toISOString();
|
|
14
|
+
|
|
15
|
+
async function request(key, pathname, init = {}) {
|
|
16
|
+
try {
|
|
17
|
+
const res = await fetchImpl(base + pathname, init);
|
|
18
|
+
let body = null;
|
|
19
|
+
try { body = await res.json(); } catch {}
|
|
20
|
+
results[key] = {
|
|
21
|
+
path: pathname,
|
|
22
|
+
status: res.status,
|
|
23
|
+
ok: res.status >= 200 && res.status < 300,
|
|
24
|
+
body,
|
|
25
|
+
};
|
|
26
|
+
return results[key];
|
|
27
|
+
} catch (error) {
|
|
28
|
+
results[key] = { path: pathname, status: 0, ok: false, error: error.message };
|
|
29
|
+
return results[key];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (edge) {
|
|
34
|
+
await request('edge_root', '/', { headers: { Accept: 'application/json' } });
|
|
35
|
+
await request('edge_health', '/edge/health', { headers: { Accept: 'application/json' } });
|
|
36
|
+
}
|
|
37
|
+
await request('health', '/health', { headers: { Accept: 'application/json' } });
|
|
38
|
+
await request('runtime', '/v1/runtime', { headers: { Accept: 'application/json' } });
|
|
39
|
+
await request('capabilities', '/v1/capabilities', { headers: { Accept: 'application/json' } });
|
|
40
|
+
await request('hash', '/v1/hash', {
|
|
41
|
+
method: 'POST',
|
|
42
|
+
headers: { 'Content-Type': 'application/json', Accept: 'application/json' },
|
|
43
|
+
body: JSON.stringify({ input: 'agentsam', algorithm: 'sha256' }),
|
|
44
|
+
});
|
|
45
|
+
await request('inspect', '/v1/inspect', {
|
|
46
|
+
method: 'POST',
|
|
47
|
+
headers: { 'Content-Type': 'application/json', Accept: 'application/json' },
|
|
48
|
+
body: JSON.stringify({ files: [{ path: 'demo.css', content: '.button { color: #2563eb; }' }] }),
|
|
49
|
+
});
|
|
50
|
+
await request('malformed', '/v1/inspect', {
|
|
51
|
+
method: 'POST',
|
|
52
|
+
headers: { 'Content-Type': 'application/json', Accept: 'application/json' },
|
|
53
|
+
body: JSON.stringify({ not_files: true }),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const health = results.health?.body;
|
|
57
|
+
const runtime = results.runtime?.body;
|
|
58
|
+
const caps = results.capabilities?.body;
|
|
59
|
+
const malformed = results.malformed?.body;
|
|
60
|
+
|
|
61
|
+
if (edge) {
|
|
62
|
+
checks.edge_root = results.edge_root?.status === 200 && results.edge_root?.body?.edge === 'worker';
|
|
63
|
+
checks.edge_health = results.edge_health?.status === 200 && results.edge_health?.body?.edge === 'worker';
|
|
64
|
+
checks.edge_source = expectedSource
|
|
65
|
+
? results.edge_root?.body?.source === expectedSource
|
|
66
|
+
: true;
|
|
67
|
+
}
|
|
68
|
+
checks.health = results.health?.status === 200
|
|
69
|
+
&& health?.ok === true
|
|
70
|
+
&& health?.runtime === 'go'
|
|
71
|
+
&& (!expectedTarget || health?.target === expectedTarget);
|
|
72
|
+
checks.source_identity = expectedSource ? health?.build?.source === expectedSource : true;
|
|
73
|
+
checks.source_commit = expectedSourceCommit ? health?.build?.commit === expectedSourceCommit : true;
|
|
74
|
+
checks.runtime = results.runtime?.status === 200
|
|
75
|
+
&& runtime?.schema === 'agentsam.go-runtime.v1'
|
|
76
|
+
&& runtime?.os === 'linux';
|
|
77
|
+
checks.capabilities = results.capabilities?.status === 200
|
|
78
|
+
&& caps?.schema === 'agentsam.go-capabilities.v1'
|
|
79
|
+
&& ['hash', 'inspect', 'runtime', 'capabilities'].every((name) => caps?.capabilities?.includes(name));
|
|
80
|
+
checks.hash = results.hash?.status === 200 && results.hash?.body?.hash === EXPECTED_HASH;
|
|
81
|
+
checks.inspect = results.inspect?.status === 200
|
|
82
|
+
&& results.inspect?.body?.findings?.some((finding) => finding.kind === 'hardcoded_color' && finding.value === '#2563eb');
|
|
83
|
+
checks.error_envelope = results.malformed?.status === 400
|
|
84
|
+
&& malformed?.ok === false
|
|
85
|
+
&& malformed?.schema_version === 1
|
|
86
|
+
&& malformed?.reason === 'input_invalid'
|
|
87
|
+
&& malformed?.code === 'INVALID_ARGUMENT';
|
|
88
|
+
|
|
89
|
+
results.deterministic_hash = { ok: checks.hash };
|
|
90
|
+
results.deterministic_inspect = { ok: checks.inspect };
|
|
91
|
+
results.malformed_rejected = { ok: checks.error_envelope };
|
|
92
|
+
const ok = Object.values(checks).every(Boolean);
|
|
93
|
+
return { origin: base, ok, checks, results, probed_at: probedAt };
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export async function probeGoDeploymentWithRetry(origin, {
|
|
97
|
+
attempts = 12,
|
|
98
|
+
delayMs = 2500,
|
|
99
|
+
...options
|
|
100
|
+
} = {}) {
|
|
101
|
+
let latest = null;
|
|
102
|
+
for (let attempt = 1; attempt <= attempts; attempt += 1) {
|
|
103
|
+
latest = await probeGoDeployment(origin, options);
|
|
104
|
+
latest.attempt = attempt;
|
|
105
|
+
if (latest.ok) return latest;
|
|
106
|
+
if (attempt < attempts) await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
107
|
+
}
|
|
108
|
+
return latest || { origin, ok: false, checks: {}, results: {}, probed_at: new Date().toISOString() };
|
|
109
|
+
}
|
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process';
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
-
import { parseWranglerVersionId } from '
|
|
4
|
+
import { parseWranglerVersionId } from '../../lib/deploy/health.js';
|
|
5
5
|
import {
|
|
6
6
|
writeDeploymentReceipt,
|
|
7
7
|
writeDeploymentValidationReceipt,
|
|
8
8
|
writeProductRegistryLocal,
|
|
9
9
|
writeProductValidationLocal,
|
|
10
10
|
buildProductRow,
|
|
11
|
-
} from '
|
|
12
|
-
import { applyInnerAnimalMediaOfficialGoProductRegistry } from '
|
|
13
|
-
import { SDK_ROOT } from '
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
} from '../receipts.js';
|
|
12
|
+
import { applyInnerAnimalMediaOfficialGoProductRegistry } from '../official-registry.js';
|
|
13
|
+
import { SDK_ROOT } from '../discover.js';
|
|
14
|
+
import { resolveWranglerBin } from '../contract.js';
|
|
15
|
+
import { probeGoDeploymentWithRetry } from '../probe.js';
|
|
16
16
|
|
|
17
17
|
function resolveWranglerInvocation(productRoot) {
|
|
18
|
-
|
|
19
|
-
if (fs.existsSync(js)) return { command: process.execPath, args: [js] };
|
|
20
|
-
const bin = path.join(productRoot, 'node_modules', '.bin', 'wrangler');
|
|
21
|
-
if (fs.existsSync(bin)) return { command: bin, args: [] };
|
|
22
|
-
return { command: 'npx', args: ['--yes', 'wrangler'] };
|
|
18
|
+
return resolveWranglerBin(productRoot);
|
|
23
19
|
}
|
|
24
20
|
|
|
25
21
|
function runWrangler(wrangler, args, {
|
|
@@ -56,8 +52,11 @@ function publicAccount(account) {
|
|
|
56
52
|
};
|
|
57
53
|
}
|
|
58
54
|
|
|
59
|
-
export function resolveConfiguredDeploymentUrl(
|
|
60
|
-
|
|
55
|
+
export function resolveConfiguredDeploymentUrl(
|
|
56
|
+
productRoot,
|
|
57
|
+
configName = 'wrangler.jsonc',
|
|
58
|
+
) {
|
|
59
|
+
const configPath = path.join(productRoot, configName);
|
|
61
60
|
if (!fs.existsSync(configPath)) return null;
|
|
62
61
|
|
|
63
62
|
try {
|
|
@@ -189,8 +188,9 @@ function deploymentArgs({
|
|
|
189
188
|
dryRun = false,
|
|
190
189
|
source = null,
|
|
191
190
|
builtAt = null,
|
|
191
|
+
configName = 'wrangler.jsonc',
|
|
192
192
|
} = {}) {
|
|
193
|
-
const args = ['deploy', '-c',
|
|
193
|
+
const args = ['deploy', '-c', configName];
|
|
194
194
|
if (source?.identity) args.push('--var', 'AGENTSAM_BUILD_SOURCE:' + source.identity);
|
|
195
195
|
if (source?.commit) args.push('--var', 'AGENTSAM_BUILD_COMMIT:' + source.commit);
|
|
196
196
|
if (builtAt) args.push('--var', 'AGENTSAM_BUILT_AT:' + builtAt);
|
|
@@ -225,8 +225,16 @@ export async function deployGoCloudflare({
|
|
|
225
225
|
spawn = spawnSync,
|
|
226
226
|
fetchImpl = globalThis.fetch,
|
|
227
227
|
} = {}) {
|
|
228
|
-
const
|
|
229
|
-
|
|
228
|
+
const configName = officialRelease
|
|
229
|
+
? 'wrangler.inneranimalmedia.jsonc'
|
|
230
|
+
: 'wrangler.jsonc';
|
|
231
|
+
|
|
232
|
+
const wranglerConfig = path.join(productRoot, configName);
|
|
233
|
+
if (!fs.existsSync(wranglerConfig)) {
|
|
234
|
+
const err = new Error('wrangler_config_missing: ' + wranglerConfig);
|
|
235
|
+
err.code = 'wrangler_config_missing';
|
|
236
|
+
throw err;
|
|
237
|
+
}
|
|
230
238
|
|
|
231
239
|
let cfIdentity = cloudflareIdentity;
|
|
232
240
|
if (!skipDeploy) {
|
|
@@ -247,15 +255,6 @@ export async function deployGoCloudflare({
|
|
|
247
255
|
accountId = cfIdentity.account.id;
|
|
248
256
|
}
|
|
249
257
|
|
|
250
|
-
const docker = spawn('docker', ['info'], { encoding: 'utf8' });
|
|
251
|
-
const dockerOk = docker.status === 0;
|
|
252
|
-
if (!dockerOk && !skipDeploy) {
|
|
253
|
-
const err = new Error('docker_unavailable');
|
|
254
|
-
err.detail = (docker.stderr || docker.stdout || '').trim().slice(0, 400);
|
|
255
|
-
err.hint = 'Cloudflare Containers require a local container engine for image build.';
|
|
256
|
-
throw err;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
258
|
const wrangler = resolveWranglerInvocation(productRoot);
|
|
260
259
|
let deployOutput = '';
|
|
261
260
|
let deployed = false;
|
|
@@ -267,7 +266,12 @@ export async function deployGoCloudflare({
|
|
|
267
266
|
} else if (dryRun) {
|
|
268
267
|
const res = runWrangler(
|
|
269
268
|
wrangler,
|
|
270
|
-
deploymentArgs({
|
|
269
|
+
deploymentArgs({
|
|
270
|
+
dryRun: true,
|
|
271
|
+
source,
|
|
272
|
+
builtAt,
|
|
273
|
+
configName,
|
|
274
|
+
}),
|
|
271
275
|
{ productRoot, spawn, accountId },
|
|
272
276
|
);
|
|
273
277
|
deployOutput = res.output;
|
|
@@ -280,7 +284,11 @@ export async function deployGoCloudflare({
|
|
|
280
284
|
} else {
|
|
281
285
|
const res = runWrangler(
|
|
282
286
|
wrangler,
|
|
283
|
-
deploymentArgs({
|
|
287
|
+
deploymentArgs({
|
|
288
|
+
source,
|
|
289
|
+
builtAt,
|
|
290
|
+
configName,
|
|
291
|
+
}),
|
|
284
292
|
{ productRoot, spawn, accountId },
|
|
285
293
|
);
|
|
286
294
|
deployOutput = res.output;
|
|
@@ -347,7 +355,7 @@ export async function deployGoCloudflare({
|
|
|
347
355
|
|
|
348
356
|
const url = deployed
|
|
349
357
|
? (
|
|
350
|
-
resolveConfiguredDeploymentUrl(productRoot)
|
|
358
|
+
resolveConfiguredDeploymentUrl(productRoot, configName)
|
|
351
359
|
|| extractWorkersDevUrl(deployOutput)
|
|
352
360
|
|| guessWorkersDevUrl(product)
|
|
353
361
|
)
|
|
@@ -483,7 +491,6 @@ export async function deployGoCloudflare({
|
|
|
483
491
|
productPath,
|
|
484
492
|
productRow,
|
|
485
493
|
registry,
|
|
486
|
-
dockerOk,
|
|
487
494
|
cloudflare: cfIdentity,
|
|
488
495
|
deployOutput,
|
|
489
496
|
};
|
|
@@ -499,110 +506,3 @@ export function guessWorkersDevUrl(product) {
|
|
|
499
506
|
return account ? 'https://' + product + '.' + account + '.workers.dev' : null;
|
|
500
507
|
}
|
|
501
508
|
|
|
502
|
-
export async function probeGoDeployment(origin, {
|
|
503
|
-
fetchImpl = globalThis.fetch,
|
|
504
|
-
expectedSource = null,
|
|
505
|
-
expectedSourceCommit = null,
|
|
506
|
-
expectedTarget = null,
|
|
507
|
-
edge = true,
|
|
508
|
-
} = {}) {
|
|
509
|
-
const base = String(origin).replace(/\/+$/, '');
|
|
510
|
-
const results = {};
|
|
511
|
-
const checks = {};
|
|
512
|
-
const probedAt = new Date().toISOString();
|
|
513
|
-
|
|
514
|
-
async function request(key, pathname, init = {}) {
|
|
515
|
-
try {
|
|
516
|
-
const res = await fetchImpl(base + pathname, init);
|
|
517
|
-
let body = null;
|
|
518
|
-
try { body = await res.json(); } catch {}
|
|
519
|
-
results[key] = {
|
|
520
|
-
path: pathname,
|
|
521
|
-
status: res.status,
|
|
522
|
-
ok: res.status >= 200 && res.status < 300,
|
|
523
|
-
body,
|
|
524
|
-
};
|
|
525
|
-
return results[key];
|
|
526
|
-
} catch (error) {
|
|
527
|
-
results[key] = { path: pathname, status: 0, ok: false, error: error.message };
|
|
528
|
-
return results[key];
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
if (edge) {
|
|
533
|
-
await request('edge_root', '/', { headers: { Accept: 'application/json' } });
|
|
534
|
-
await request('edge_health', '/edge/health', { headers: { Accept: 'application/json' } });
|
|
535
|
-
}
|
|
536
|
-
await request('health', '/health', { headers: { Accept: 'application/json' } });
|
|
537
|
-
await request('runtime', '/v1/runtime', { headers: { Accept: 'application/json' } });
|
|
538
|
-
await request('capabilities', '/v1/capabilities', { headers: { Accept: 'application/json' } });
|
|
539
|
-
await request('hash', '/v1/hash', {
|
|
540
|
-
method: 'POST',
|
|
541
|
-
headers: { 'Content-Type': 'application/json', Accept: 'application/json' },
|
|
542
|
-
body: JSON.stringify({ input: 'agentsam', algorithm: 'sha256' }),
|
|
543
|
-
});
|
|
544
|
-
await request('inspect', '/v1/inspect', {
|
|
545
|
-
method: 'POST',
|
|
546
|
-
headers: { 'Content-Type': 'application/json', Accept: 'application/json' },
|
|
547
|
-
body: JSON.stringify({ files: [{ path: 'demo.css', content: '.button { color: #2563eb; }' }] }),
|
|
548
|
-
});
|
|
549
|
-
await request('malformed', '/v1/inspect', {
|
|
550
|
-
method: 'POST',
|
|
551
|
-
headers: { 'Content-Type': 'application/json', Accept: 'application/json' },
|
|
552
|
-
body: JSON.stringify({ not_files: true }),
|
|
553
|
-
});
|
|
554
|
-
|
|
555
|
-
const health = results.health?.body;
|
|
556
|
-
const runtime = results.runtime?.body;
|
|
557
|
-
const caps = results.capabilities?.body;
|
|
558
|
-
const malformed = results.malformed?.body;
|
|
559
|
-
|
|
560
|
-
if (edge) {
|
|
561
|
-
checks.edge_root = results.edge_root?.status === 200 && results.edge_root?.body?.edge === 'worker';
|
|
562
|
-
checks.edge_health = results.edge_health?.status === 200 && results.edge_health?.body?.edge === 'worker';
|
|
563
|
-
checks.edge_source = expectedSource
|
|
564
|
-
? results.edge_root?.body?.source === expectedSource
|
|
565
|
-
: true;
|
|
566
|
-
}
|
|
567
|
-
checks.health = results.health?.status === 200
|
|
568
|
-
&& health?.ok === true
|
|
569
|
-
&& health?.runtime === 'go'
|
|
570
|
-
&& (!expectedTarget || health?.target === expectedTarget);
|
|
571
|
-
checks.source_identity = expectedSource ? health?.build?.source === expectedSource : true;
|
|
572
|
-
checks.source_commit = expectedSourceCommit ? health?.build?.commit === expectedSourceCommit : true;
|
|
573
|
-
checks.runtime = results.runtime?.status === 200
|
|
574
|
-
&& runtime?.schema === 'agentsam.go-runtime.v1'
|
|
575
|
-
&& runtime?.os === 'linux';
|
|
576
|
-
checks.capabilities = results.capabilities?.status === 200
|
|
577
|
-
&& caps?.schema === 'agentsam.go-capabilities.v1'
|
|
578
|
-
&& ['hash', 'inspect', 'runtime', 'capabilities'].every((name) => caps?.capabilities?.includes(name));
|
|
579
|
-
checks.hash = results.hash?.status === 200 && results.hash?.body?.hash === EXPECTED_HASH;
|
|
580
|
-
checks.inspect = results.inspect?.status === 200
|
|
581
|
-
&& results.inspect?.body?.findings?.some((finding) => finding.kind === 'hardcoded_color' && finding.value === '#2563eb');
|
|
582
|
-
checks.error_envelope = results.malformed?.status === 400
|
|
583
|
-
&& malformed?.ok === false
|
|
584
|
-
&& malformed?.schema_version === 1
|
|
585
|
-
&& malformed?.reason === 'input_invalid'
|
|
586
|
-
&& malformed?.code === 'INVALID_ARGUMENT';
|
|
587
|
-
|
|
588
|
-
results.deterministic_hash = { ok: checks.hash };
|
|
589
|
-
results.deterministic_inspect = { ok: checks.inspect };
|
|
590
|
-
results.malformed_rejected = { ok: checks.error_envelope };
|
|
591
|
-
const ok = Object.values(checks).every(Boolean);
|
|
592
|
-
return { origin: base, ok, checks, results, probed_at: probedAt };
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
export async function probeGoDeploymentWithRetry(origin, {
|
|
596
|
-
attempts = 12,
|
|
597
|
-
delayMs = 2500,
|
|
598
|
-
...options
|
|
599
|
-
} = {}) {
|
|
600
|
-
let latest = null;
|
|
601
|
-
for (let attempt = 1; attempt <= attempts; attempt += 1) {
|
|
602
|
-
latest = await probeGoDeployment(origin, options);
|
|
603
|
-
latest.attempt = attempt;
|
|
604
|
-
if (latest.ok) return latest;
|
|
605
|
-
if (attempt < attempts) await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
606
|
-
}
|
|
607
|
-
return latest || { origin, ok: false, checks: {}, results: {}, probed_at: new Date().toISOString() };
|
|
608
|
-
}
|
package/src/go/verify.js
CHANGED
package/src/index.js
CHANGED
|
@@ -25,6 +25,37 @@ export {
|
|
|
25
25
|
suggestCliCommands,
|
|
26
26
|
} from './cli/command-catalog.js';
|
|
27
27
|
export { routeIntent } from './lib/router.js';
|
|
28
|
+
export {
|
|
29
|
+
HOOK_PROTOCOL_SCHEMA,
|
|
30
|
+
HOOK_CONFIG_SCHEMA,
|
|
31
|
+
HOOK_RECEIPT_SCHEMA,
|
|
32
|
+
HOOK_EVENTS,
|
|
33
|
+
PERMISSION_DECISIONS,
|
|
34
|
+
ERROR_HANDLING_DECISIONS,
|
|
35
|
+
HOOK_FAILURE_MODES,
|
|
36
|
+
AgentSamHooks,
|
|
37
|
+
HookExecutionError,
|
|
38
|
+
HookPermissionError,
|
|
39
|
+
normalizeHookEvent,
|
|
40
|
+
normalizeHookOutput,
|
|
41
|
+
createHookEnvelope,
|
|
42
|
+
createHookRuntime,
|
|
43
|
+
createHookRuntimeFromConfig,
|
|
44
|
+
createHookStore,
|
|
45
|
+
registerStoredHooks,
|
|
46
|
+
ensureHookRuntime,
|
|
47
|
+
findHookConfig,
|
|
48
|
+
loadHookConfig,
|
|
49
|
+
createCallbackHookAdapter,
|
|
50
|
+
createCommandHookAdapter,
|
|
51
|
+
createHttpHookAdapter,
|
|
52
|
+
createHookedProviderAdapter,
|
|
53
|
+
createHookedCapabilityAdapter,
|
|
54
|
+
createCompositeCapabilityAdapter,
|
|
55
|
+
createMcpCapabilityAdapter,
|
|
56
|
+
createLspCapabilityAdapter,
|
|
57
|
+
createAgentCapabilityAdapter,
|
|
58
|
+
} from '../packages/agentsam-hooks/src/index.js';
|
|
28
59
|
export { searchToolCards, toToolCard, hydrateToolSchemas } from './tools/index.js';
|
|
29
60
|
export {
|
|
30
61
|
AGENTSAM_PLUGIN_SCHEMA_VERSION,
|
|
@@ -36,6 +67,7 @@ export {
|
|
|
36
67
|
listPlugins,
|
|
37
68
|
listPluginTools,
|
|
38
69
|
recordPluginHealthCheck,
|
|
70
|
+
recordAiPluginModelDiscovery,
|
|
39
71
|
recordToolCall,
|
|
40
72
|
createPluginRuntime,
|
|
41
73
|
createPluginCapabilityAdapter,
|
|
@@ -57,7 +57,7 @@ const CATEGORY_TOOLING = new Set([
|
|
|
57
57
|
/** Generated / historical — review before including. */
|
|
58
58
|
const CATEGORY_GENERATED = new Set([
|
|
59
59
|
'generated', 'fixtures', 'snapshots', 'artifacts',
|
|
60
|
-
'site', 'sites', 'templates', 'level-1',
|
|
60
|
+
'site', 'sites', 'templates', 'level-1',
|
|
61
61
|
]);
|
|
62
62
|
|
|
63
63
|
/** AgentSam / config control plane — review. */
|
|
@@ -77,6 +77,7 @@ export function encodeErrorDetail(value) {
|
|
|
77
77
|
detail.setDomain(envelope.domain);
|
|
78
78
|
if (envelope.tool) detail.setTool(envelope.tool);
|
|
79
79
|
if (envelope.stage) detail.setStage(envelope.stage);
|
|
80
|
+
if (envelope.native_stage) detail.setNativeStage(envelope.native_stage);
|
|
80
81
|
detail.setRemediationAction(envelope.remediation.action);
|
|
81
82
|
if (envelope.remediation.message) detail.setRemediationMessage(envelope.remediation.message);
|
|
82
83
|
detail.setFingerprint(envelope.fingerprint);
|
|
@@ -115,6 +116,7 @@ export function decodeErrorDetail(detail) {
|
|
|
115
116
|
domain: detail.hasDomain?.() ? detail.getDomain() : 'runtime',
|
|
116
117
|
tool: detail.hasTool?.() ? detail.getTool() : null,
|
|
117
118
|
stage: detail.hasStage?.() ? detail.getStage() : null,
|
|
119
|
+
native_stage: detail.hasNativeStage?.() ? detail.getNativeStage() : null,
|
|
118
120
|
remediation: {
|
|
119
121
|
action: detail.hasRemediationAction?.() ? detail.getRemediationAction() : undefined,
|
|
120
122
|
message: detail.hasRemediationMessage?.() ? detail.getRemediationMessage() : null,
|
|
@@ -12,7 +12,7 @@ export const DEPLOY_INPUT_GLOBS = Object.freeze([
|
|
|
12
12
|
'apps/local-studio',
|
|
13
13
|
'packages/agentsam-contracts',
|
|
14
14
|
'packages/agentsam-workbench',
|
|
15
|
-
'packages/connectors/
|
|
15
|
+
'packages/connectors/cfoa',
|
|
16
16
|
]);
|
|
17
17
|
|
|
18
18
|
export function findRepoRoot(start = process.cwd()) {
|
|
@@ -176,7 +176,7 @@ export async function runLocalStudioDeploy({
|
|
|
176
176
|
target.wranglerConfig,
|
|
177
177
|
path.join(target.appRoot, '.env.cloudflare.example'),
|
|
178
178
|
path.join(target.appRoot, 'backend/worker/index.js'),
|
|
179
|
-
path.join(target.repoRoot, 'packages/connectors/
|
|
179
|
+
path.join(target.repoRoot, 'packages/connectors/cfoa/src/index.js'),
|
|
180
180
|
]);
|
|
181
181
|
}
|
|
182
182
|
if (plan.skip) {
|
package/src/lib/mini/scaffold.js
CHANGED
|
@@ -4,7 +4,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
4
4
|
|
|
5
5
|
const templateRoot = fileURLToPath(new URL('../../../templates/mini/', import.meta.url));
|
|
6
6
|
export const MINI_TEMPLATES = Object.freeze({
|
|
7
|
-
gadget: 'A
|
|
7
|
+
gadget: 'A blank interactive widget canvas',
|
|
8
8
|
page: 'A small editable landing page',
|
|
9
9
|
data: 'A searchable JSON viewer',
|
|
10
10
|
});
|
|
@@ -12,6 +12,7 @@ export const SLASH_COMMANDS = [
|
|
|
12
12
|
{ cmd: '/context', description: 'Show model context economics; add repo for Git bridge context', lane: 'context' },
|
|
13
13
|
{ cmd: '/status', description: 'Honest project awareness: account, models, terminal, live deploy', lane: 'local' },
|
|
14
14
|
{ cmd: '/models', description: 'Probe providers and provider-verified known models', lane: 'model' },
|
|
15
|
+
{ cmd: '/hooks', description: 'Inspect lifecycle hook sources, order, and execution receipts', lane: 'agent' },
|
|
15
16
|
{ cmd: '/providers', description: 'Configure and verify machine provider credentials', lane: 'model' },
|
|
16
17
|
{ cmd: '/credentials', description: 'Audit credentials, drift, and remediation (never prints secrets)', lane: 'identity' },
|
|
17
18
|
{ cmd: '/cheat-sheet', description: 'Organized Agent Sam command groups', lane: 'local' },
|
|
@@ -9,7 +9,7 @@ import { listProviderCredentialStatus } from './provider-credentials.js';
|
|
|
9
9
|
import {
|
|
10
10
|
listCloudflareFeaturePacks,
|
|
11
11
|
scopesForFeaturePacks,
|
|
12
|
-
} from '../../packages/connectors/
|
|
12
|
+
} from '../../packages/connectors/cfoa/src/index.js';
|
|
13
13
|
import { projectTerminalCapability } from './terminal-scopes.js';
|
|
14
14
|
|
|
15
15
|
function clean(value) {
|
|
@@ -4,6 +4,8 @@ import { createLocalSqliteDatabase } from './sqlite.js';
|
|
|
4
4
|
import { applyRuntimeMigrations } from './migrations.js';
|
|
5
5
|
import { findCliProjectRoot } from '../lib/cli-preferences.js';
|
|
6
6
|
import { getLocalDatabasePath, tryReadProjectConfig } from '../lib/project-config.js';
|
|
7
|
+
import { createHookStore } from '../../packages/agentsam-hooks/src/store.js';
|
|
8
|
+
import { reconcileParentAfterChildTerminal } from '../acp/dependencies.js';
|
|
7
9
|
|
|
8
10
|
function clean(value) { return value == null ? '' : String(value).trim(); }
|
|
9
11
|
function hash(value) { return createHash('sha256').update(String(value || '')).digest('hex'); }
|
|
@@ -114,6 +116,13 @@ export async function finishRuntimeRun(value = {}) {
|
|
|
114
116
|
Number.isFinite(Number(value.latency_ms)) ? Math.max(0, Math.round(Number(value.latency_ms))) : null,
|
|
115
117
|
value.id,
|
|
116
118
|
).run();
|
|
119
|
+
|
|
120
|
+
await reconcileParentAfterChildTerminal(db, {
|
|
121
|
+
runId: value.id,
|
|
122
|
+
status: clean(value.status) || 'completed',
|
|
123
|
+
errorCode: clean(value.error_code) || null,
|
|
124
|
+
errorMessage: clean(value.error_message) || null,
|
|
125
|
+
});
|
|
117
126
|
});
|
|
118
127
|
}
|
|
119
128
|
|
|
@@ -187,3 +196,48 @@ export async function pruneExpiredRuntimeState(value = {}) {
|
|
|
187
196
|
return { digests: Number(digests.changes || 0), compactions: Number(compactions.changes || 0), approvals_expired: Number(approvals.changes || 0) };
|
|
188
197
|
});
|
|
189
198
|
}
|
|
199
|
+
|
|
200
|
+
function hookStore(db, value = {}) {
|
|
201
|
+
return createHookStore(db, { ownerId: clean(value.owner_id || value.account_id) || 'local' });
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export async function listRuntimeHooks(value = {}) {
|
|
205
|
+
return withStore(value.projectRoot || value.cwd, (db) => hookStore(db, value).listHooks({
|
|
206
|
+
activeOnly: value.activeOnly,
|
|
207
|
+
event_type: value.event_type,
|
|
208
|
+
context: value.context,
|
|
209
|
+
}));
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export async function upsertRuntimeHook(value = {}) {
|
|
213
|
+
return withStore(value.projectRoot || value.cwd, (db) => hookStore(db, value).upsertHook(value));
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export async function setRuntimeHookActive(value = {}) {
|
|
217
|
+
return withStore(value.projectRoot || value.cwd, (db) => hookStore(db, value).setHookActive(value.hook_id || value.hook_key, value.active));
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export async function removeRuntimeHook(value = {}) {
|
|
221
|
+
return withStore(value.projectRoot || value.cwd, (db) => hookStore(db, value).removeHook(value.hook_id || value.hook_key));
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export async function recordRuntimeHookReceipt(value = {}) {
|
|
225
|
+
if (!value.receipt) return null;
|
|
226
|
+
return withStore(value.projectRoot || value.cwd, (db) => hookStore(db, value).recordExecution(value.receipt, {
|
|
227
|
+
source_kind: value.source_kind,
|
|
228
|
+
hook_id: value.hook_id,
|
|
229
|
+
invocation_id: value.invocation_id,
|
|
230
|
+
agent_run_id: value.agent_run_id,
|
|
231
|
+
session_id: value.session_id,
|
|
232
|
+
conversation_id: value.conversation_id,
|
|
233
|
+
context: value.context,
|
|
234
|
+
}));
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export async function listRuntimeHookExecutions(value = {}) {
|
|
238
|
+
return withStore(value.projectRoot || value.cwd, (db) => hookStore(db, value).listExecutions({
|
|
239
|
+
hook_key: value.hook_key,
|
|
240
|
+
status: value.status,
|
|
241
|
+
limit: value.limit,
|
|
242
|
+
}));
|
|
243
|
+
}
|
package/src/models/catalog.js
CHANGED
|
@@ -7,7 +7,6 @@ const DOCS = Object.freeze({
|
|
|
7
7
|
gpt56Sol: 'https://developers.openai.com/api/docs/models/gpt-5.6-sol',
|
|
8
8
|
gpt56Terra: 'https://developers.openai.com/api/docs/models/gpt-5.6-terra',
|
|
9
9
|
gpt56Luna: 'https://developers.openai.com/api/docs/models/gpt-5.6-luna',
|
|
10
|
-
gpt53Codex: 'https://developers.openai.com/api/docs/models/gpt-5.3-codex',
|
|
11
10
|
embeddingLarge: 'https://developers.openai.com/api/docs/models/text-embedding-3-large',
|
|
12
11
|
embeddingSmall: 'https://developers.openai.com/api/docs/models/text-embedding-3-small',
|
|
13
12
|
});
|
|
@@ -226,53 +225,6 @@ const GPT_56_LUNA = openAiAgentModel({
|
|
|
226
225
|
pricing: freezePricing({ input: 0.2, cachedInput: 0.02, cacheWrite: 0.25, output: 1.2, source: DOCS.gpt56Luna }),
|
|
227
226
|
});
|
|
228
227
|
|
|
229
|
-
const GPT_53_CODEX = openAiAgentModel({
|
|
230
|
-
id: 'gpt-5.3-codex',
|
|
231
|
-
label: 'GPT-5.3-Codex',
|
|
232
|
-
source: DOCS.gpt53Codex,
|
|
233
|
-
reasoning: ['low', 'medium', 'high', 'xhigh'],
|
|
234
|
-
contextWindow: 400_000,
|
|
235
|
-
maxOutputTokens: 128_000,
|
|
236
|
-
knowledgeCutoff: '2025-08-31',
|
|
237
|
-
description: 'Agentic coding model for Codex-style software workflows.',
|
|
238
|
-
pricing: freezePricing({
|
|
239
|
-
input: 1.75,
|
|
240
|
-
cachedInput: 0.175,
|
|
241
|
-
cacheWrite: 0,
|
|
242
|
-
output: 14,
|
|
243
|
-
source: DOCS.gpt53Codex,
|
|
244
|
-
longContext: false,
|
|
245
|
-
processing: false,
|
|
246
|
-
}),
|
|
247
|
-
capabilities: {
|
|
248
|
-
web_search: false,
|
|
249
|
-
file_search: false,
|
|
250
|
-
image_generation: false,
|
|
251
|
-
code_interpreter: false,
|
|
252
|
-
hosted_shell: false,
|
|
253
|
-
apply_patch: false,
|
|
254
|
-
skills: false,
|
|
255
|
-
computer_use: false,
|
|
256
|
-
mcp: false,
|
|
257
|
-
tool_search: false,
|
|
258
|
-
async_tool_calls: false,
|
|
259
|
-
mid_turn_steering: false,
|
|
260
|
-
configuration_update: false,
|
|
261
|
-
fast: false,
|
|
262
|
-
flex: false,
|
|
263
|
-
},
|
|
264
|
-
serviceTiers: ['default'],
|
|
265
|
-
contextPolicy: Object.freeze({
|
|
266
|
-
target_input_tokens: 100_000,
|
|
267
|
-
compact_at_tokens: 160_000,
|
|
268
|
-
intervene_at_tokens: 210_000,
|
|
269
|
-
max_normal_input_tokens: 240_000,
|
|
270
|
-
pricing_threshold_tokens: null,
|
|
271
|
-
max_cumulative_input_tokens: 400_000,
|
|
272
|
-
safety_margin_tokens: 20_000,
|
|
273
|
-
}),
|
|
274
|
-
});
|
|
275
|
-
|
|
276
228
|
const TEXT_EMBEDDING_3_LARGE = openAiEmbeddingModel({
|
|
277
229
|
id: 'text-embedding-3-large',
|
|
278
230
|
label: 'text-embedding-3-large',
|
|
@@ -296,7 +248,6 @@ export const MODEL_CATALOG = Object.freeze([
|
|
|
296
248
|
GPT_56_LUNA,
|
|
297
249
|
GPT_56_TERRA,
|
|
298
250
|
GPT_56_SOL,
|
|
299
|
-
GPT_53_CODEX,
|
|
300
251
|
TEXT_EMBEDDING_3_LARGE,
|
|
301
252
|
TEXT_EMBEDDING_3_SMALL,
|
|
302
253
|
]);
|