@inneranimalmedia/agentsam-sdk 2.6.4 → 2.6.5
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/AGENTSAM.md +11 -0
- package/README.md +15 -9
- package/apps/client-cms-editor/AGENTS.md +12 -0
- package/apps/client-cms-editor/IMPORT_PROVENANCE.json +8 -0
- package/apps/client-cms-editor/README.md +72 -0
- package/apps/client-cms-editor/agentsam.app.json +57 -0
- package/apps/client-cms-editor/backend/README.md +5 -0
- package/apps/client-cms-editor/backend/package.json +22 -0
- package/apps/client-cms-editor/backend/src/api/client.ts +200 -0
- package/apps/client-cms-editor/backend/src/demo-bootstrap.ts +145 -0
- package/apps/client-cms-editor/backend/src/index.ts +6 -0
- package/apps/client-cms-editor/backend/src/model.ts +115 -0
- package/apps/client-cms-editor/backend/src/preview/bridge.ts +79 -0
- package/apps/client-cms-editor/backend/src/preview/urls.ts +55 -0
- package/apps/client-cms-editor/backend/src/routing/cms-route.js +293 -0
- package/apps/client-cms-editor/backend/src/routing/index.js +10 -0
- package/apps/client-cms-editor/backend/src/storefront.ts +52 -0
- package/apps/client-cms-editor/backend/tsconfig.json +15 -0
- package/apps/client-cms-editor/backend/worker/index.js +34 -0
- package/apps/client-cms-editor/backend/wrangler.jsonc +11 -0
- package/apps/client-cms-editor/bin/agentsam-cms.mjs +229 -0
- package/apps/client-cms-editor/frontend/index.html +12 -0
- package/apps/client-cms-editor/frontend/package.json +33 -0
- package/apps/client-cms-editor/frontend/src/AgentSamDrawer.tsx +188 -0
- package/apps/client-cms-editor/frontend/src/CmsAgentSurface.tsx +191 -0
- package/apps/client-cms-editor/frontend/src/CmsEditor.tsx +1345 -0
- package/apps/client-cms-editor/frontend/src/env.d.ts +14 -0
- package/apps/client-cms-editor/frontend/src/index.ts +8 -0
- package/apps/client-cms-editor/frontend/src/lib/content-safety.ts +63 -0
- package/apps/client-cms-editor/frontend/src/main.tsx +17 -0
- package/apps/client-cms-editor/frontend/src/mount.tsx +51 -0
- package/apps/client-cms-editor/frontend/src/styles/agentsam-drawer.css +214 -0
- package/apps/client-cms-editor/frontend/src/styles/cmsShell.css +1739 -0
- package/apps/client-cms-editor/frontend/src/styles/studio.css +106 -0
- package/apps/client-cms-editor/frontend/src/surfaces/CmsDashboard.tsx +313 -0
- package/apps/client-cms-editor/frontend/src/surfaces/CmsGuidedChatHero.tsx +121 -0
- package/apps/client-cms-editor/frontend/src/surfaces/CmsHubPage.tsx +132 -0
- package/apps/client-cms-editor/frontend/src/surfaces/CmsSiteSwitcher.tsx +176 -0
- package/apps/client-cms-editor/frontend/src/surfaces/index.ts +5 -0
- package/apps/client-cms-editor/frontend/src/surfaces/types.ts +48 -0
- package/apps/client-cms-editor/frontend/tsconfig.json +25 -0
- package/apps/client-cms-editor/frontend/vite.config.ts +13 -0
- package/apps/client-cms-editor/package-lock.json +3832 -0
- package/apps/client-cms-editor/package.json +23 -0
- package/apps/client-cms-editor/reference/DONOR_README.md +52 -0
- package/apps/client-cms-editor/reference/DONOR_package-lock.json +1253 -0
- package/apps/client-cms-editor/reference/DONOR_tsconfig.json +15 -0
- package/apps/client-cms-editor/shared/cms/package.json +21 -0
- package/apps/client-cms-editor/shared/cms/src/agent-context.ts +35 -0
- package/apps/client-cms-editor/shared/cms/src/cloudflare-bindings.ts +51 -0
- package/apps/client-cms-editor/shared/cms/src/editor-types.ts +58 -0
- package/apps/client-cms-editor/shared/cms/src/index.ts +5 -0
- package/apps/client-cms-editor/shared/cms/src/publication.ts +24 -0
- package/apps/client-cms-editor/shared/cms/src/routes.ts +11 -0
- package/apps/client-cms-editor/shared/cms/tsconfig.json +12 -0
- package/bin/agentsam-rapid-rust +36 -0
- package/docs/AUTH_IDENTITY_CONTRACT.md +2 -0
- package/docs/MACHINE_INTELLIGENCE.md +120 -0
- package/docs/WINDOWS_RUNTIME_INSTALL.md +30 -0
- package/docs/architecture/AGENTSAM_APPLICATION_CONTRACT.md +188 -0
- package/docs/architecture/AGENTSAM_RUNTIME_PROTOCOL.md +151 -0
- package/docs/architecture/LOCAL_STUDIO_CLOUDFLARE_OAUTH.md +12 -4
- package/docs/architecture/R2_SLUG_NAMESPACE.md +20 -0
- package/docs/architecture/WORK_PRODUCT_EXTRACTION.md +97 -0
- package/docs/brand/AGENT_SAM_ICON_GRAMMAR.md +70 -0
- package/docs/content-studio/HOST_MOUNT_CHECKLIST.md +71 -0
- package/docs/content-studio/REVISION_GATE_2026-09-27.md +501 -0
- package/docs/contracts/capability-install-planner.md +67 -0
- package/docs/contracts/environment-vocabulary.md +195 -0
- package/docs/contracts/google-cloud-oauth-setup.md +199 -0
- package/docs/local-studio/WORKMODE_DONOR_NOTES.md +1 -1
- package/docs/plans/LOCAL-STUDIO-GRADUATION-2026-09-26.md +290 -0
- package/docs/plans/LOCAL-STUDIO-REAL-APP-CONTRACT-ADDENDUM-2026-09-27.md +394 -0
- package/docs/plans/MACHINE-FIRST-APPS-TUI-2026-09-24.md +227 -0
- package/docs/plans/TOMORROW-EXTENSIVE-TODO-2026-09-26.md +221 -0
- package/docs/plans/TOMORROW-MACHINE-FIRST-BRIEFING.md +145 -0
- package/docs/plans/UNIVERSAL-INGEST-MACHINE-FIRST-2026-09-24.md +215 -0
- package/docs/plugins.md +2 -2
- package/docs/product/AGENTSAM_PRODUCT_EXPERIENCE_STANDARD.md +280 -0
- package/docs/product/LOCAL_STUDIO_DESKTOP_EXPERIENCE.md +139 -0
- package/docs/product/README.md +8 -0
- package/docs/rapid-rust-wasm.md +35 -0
- package/migrations/d1/0016_cloudflare_oauth_user_oauth_tokens_ssot.sql +14 -0
- package/package.json +73 -14
- package/packages/agentsam-brand/README.md +106 -11
- package/packages/agentsam-brand/bin/agentsam-brand.mjs +9 -0
- package/packages/agentsam-brand/package.json +39 -7
- package/packages/agentsam-brand/src/adapters/cloudflare-images.js +453 -0
- package/packages/agentsam-brand/src/adapters/cloudflare-r2.js +74 -0
- package/packages/agentsam-brand/src/adapters/d1-registry.js +26 -0
- package/packages/agentsam-brand/src/adapters/filesystem.js +59 -0
- package/packages/agentsam-brand/src/adapters/memory.js +31 -0
- package/packages/agentsam-brand/src/cli/controller.js +503 -0
- package/packages/agentsam-brand/src/cli/wizard.js +526 -0
- package/packages/agentsam-brand/src/core/capabilities.js +201 -0
- package/packages/agentsam-brand/src/core/derivatives.js +211 -0
- package/packages/agentsam-brand/src/core/errors.js +12 -0
- package/packages/agentsam-brand/src/core/ingest.js +195 -0
- package/packages/agentsam-brand/src/core/inspect.js +109 -0
- package/packages/agentsam-brand/src/core/keys.js +83 -0
- package/packages/agentsam-brand/src/core/naming.js +142 -0
- package/packages/agentsam-brand/src/core/optimize.js +316 -0
- package/packages/agentsam-brand/src/core/pack.js +305 -0
- package/packages/agentsam-brand/src/core/plan.js +276 -0
- package/packages/agentsam-brand/src/core/preview.js +159 -0
- package/packages/agentsam-brand/src/core/processors/cloudflare.js +68 -0
- package/packages/agentsam-brand/src/core/processors/contract.js +203 -0
- package/packages/agentsam-brand/src/core/processors/index.js +148 -0
- package/packages/agentsam-brand/src/core/processors/native.js +82 -0
- package/packages/agentsam-brand/src/core/processors/sharp.js +113 -0
- package/packages/agentsam-brand/src/core/processors/squoosh-binary.js +195 -0
- package/packages/agentsam-brand/src/core/promote.js +288 -0
- package/packages/agentsam-brand/src/core/receipts.js +155 -0
- package/packages/agentsam-brand/src/core/v2/compile.js +280 -0
- package/packages/agentsam-brand/src/core/v2/derivatives-semantic.js +207 -0
- package/packages/agentsam-brand/src/core/v2/ingest-graph.js +387 -0
- package/packages/agentsam-brand/src/core/v2/roles.js +180 -0
- package/packages/agentsam-brand/src/core/v2/schema.js +209 -0
- package/packages/agentsam-brand/src/core/v2/templates.js +114 -0
- package/packages/agentsam-brand/src/index.js +193 -36
- package/packages/agentsam-brand/src/presets/app-icon.json +16 -0
- package/packages/agentsam-brand/src/presets/favicon.json +17 -0
- package/packages/agentsam-brand/src/presets/hero.json +12 -0
- package/packages/agentsam-brand/src/presets/index.js +40 -0
- package/packages/agentsam-brand/src/presets/logo.json +12 -0
- package/packages/agentsam-brand/src/presets/model.json +8 -0
- package/packages/agentsam-brand/src/presets/og-image.json +10 -0
- package/packages/agentsam-brand/src/presets/product-shot.json +11 -0
- package/packages/agentsam-brand/src/presets/social-image.json +10 -0
- package/packages/agentsam-brand/src/presets/web-image.json +10 -0
- package/packages/agentsam-contracts/src/artifacts.ts +41 -0
- package/packages/agentsam-knowledge/src/autorag/index.js +1 -1
- package/packages/agentsam-knowledge/src/providers/index.js +6 -4
- package/packages/agentsam-knowledge/src/providers/ollama-endpoint.js +31 -0
- package/packages/agentsam-knowledge/test/autorag.test.mjs +22 -1
- package/packages/agentsam-nav/package.json +2 -2
- package/packages/agentsam-rapid-rust/Cargo.lock +344 -0
- package/packages/agentsam-rapid-rust/Cargo.toml +18 -0
- package/packages/agentsam-rapid-rust/README.md +5 -0
- package/packages/agentsam-rapid-rust/src/main.rs +718 -0
- package/packages/agentsam-rapid-rust/templates/api/Cargo.toml.tmpl +18 -0
- package/packages/agentsam-rapid-rust/templates/api/src/lib.rs.tmpl +17 -0
- package/packages/agentsam-rapid-rust/templates/common/README.md.tmpl +22 -0
- package/packages/agentsam-rapid-rust/templates/common/package.json.tmpl +12 -0
- package/packages/agentsam-rapid-rust/templates/common/wrangler.toml.tmpl +6 -0
- package/packages/agentsam-rapid-rust/templates/crypto-auth/Cargo.toml.tmpl +21 -0
- package/packages/agentsam-rapid-rust/templates/crypto-auth/src/lib.rs.tmpl +32 -0
- package/packages/agentsam-rapid-rust/templates/data-processor/Cargo.toml.tmpl +18 -0
- package/packages/agentsam-rapid-rust/templates/data-processor/src/lib.rs.tmpl +41 -0
- package/packages/agentsam-rapid-rust/templates/shared-core/Cargo.toml.tmpl +9 -0
- package/packages/agentsam-rapid-rust/templates/shared-core/core/Cargo.toml.tmpl +7 -0
- package/packages/agentsam-rapid-rust/templates/shared-core/core/src/lib.rs.tmpl +23 -0
- package/packages/agentsam-rapid-rust/templates/shared-core/worker/Cargo.toml.tmpl +12 -0
- package/packages/agentsam-rapid-rust/templates/shared-core/worker/src/lib.rs.tmpl +16 -0
- package/packages/agentsam-rapid-rust/templates/shared-core/wrangler.toml.tmpl +6 -0
- package/packages/agentsam-repository/src/index.js +1 -0
- package/packages/agentsam-repository/src/merkle/semantic.js +3 -10
- package/packages/agentsam-repository/src/source-types.js +85 -0
- package/packages/agentsam-vault/README.md +96 -0
- package/packages/agentsam-vault/package.json +32 -0
- package/packages/agentsam-vault/src/contracts/credential.d.ts +78 -0
- package/packages/agentsam-vault/src/contracts/credential.js +132 -0
- package/packages/agentsam-vault/src/crypto/aes-gcm.d.ts +30 -0
- package/packages/agentsam-vault/src/crypto/aes-gcm.js +107 -0
- package/packages/agentsam-vault/src/crypto/oauth-envelope.js +150 -0
- package/packages/agentsam-vault/src/index.d.ts +9 -0
- package/packages/agentsam-vault/src/index.js +27 -0
- package/packages/agentsam-vault/src/providers/registry.js +90 -0
- package/packages/agentsam-vault/src/runtime/resolver.js +77 -0
- package/packages/agentsam-workbench/README.md +24 -0
- package/packages/agentsam-workbench/package.json +38 -0
- package/packages/agentsam-workbench/src/agent/AgentPanel.tsx +41 -0
- package/packages/agentsam-workbench/src/agent/ArtifactCard.tsx +9 -0
- package/packages/agentsam-workbench/src/agent/Composer.tsx +102 -0
- package/packages/agentsam-workbench/src/agent/ConnectedAgentPanel.tsx +194 -0
- package/packages/agentsam-workbench/src/agent/ContextualComposer.tsx +788 -0
- package/packages/agentsam-workbench/src/agent/GoalStatusStrip.tsx +38 -0
- package/packages/agentsam-workbench/src/agent/MiniAgentSam.tsx +86 -0
- package/packages/agentsam-workbench/src/agent/ModelSelect.tsx +19 -0
- package/packages/agentsam-workbench/src/agent/Thread.tsx +56 -0
- package/packages/agentsam-workbench/src/agent/ToolReceipt.tsx +11 -0
- package/packages/agentsam-workbench/src/agent/contextual-composer.css +611 -0
- package/packages/agentsam-workbench/src/agent/index.ts +10 -0
- package/packages/agentsam-workbench/src/agent/mini-agentsam.css +12 -0
- package/packages/agentsam-workbench/src/browser/BrowserFrame.tsx +37 -0
- package/packages/agentsam-workbench/src/browser/index.ts +1 -0
- package/packages/agentsam-workbench/src/index.ts +6 -0
- package/packages/agentsam-workbench/src/project-control.css +160 -0
- package/packages/agentsam-workbench/src/projects/ProjectsSurface.tsx +131 -0
- package/packages/agentsam-workbench/src/projects/index.ts +1 -0
- package/packages/agentsam-workbench/src/shell/Breadcrumb.tsx +35 -0
- package/packages/agentsam-workbench/src/shell/ResizableStage.tsx +99 -0
- package/packages/agentsam-workbench/src/shell/SidePanel.tsx +5 -0
- package/packages/agentsam-workbench/src/shell/index.ts +4 -0
- package/packages/agentsam-workbench/src/shell/surfaceRegistry.ts +29 -0
- package/packages/agentsam-workbench/src/terminal/TerminalSurface.tsx +5 -0
- package/packages/agentsam-workbench/src/terminal/index.ts +1 -0
- package/packages/agentsam-workbench/src/timeline/GanttBoard.tsx +258 -0
- package/packages/agentsam-workbench/src/timeline/index.ts +1 -0
- package/packages/agentsam-workbench/tsconfig.json +13 -0
- package/packages/connectors/cloudflare/OAUTH_STORAGE_AUDIT.md +53 -0
- package/packages/connectors/cloudflare/package.json +3 -1
- package/packages/connectors/cloudflare/src/api-client.js +279 -0
- package/packages/connectors/cloudflare/src/capabilities.js +585 -0
- package/packages/connectors/cloudflare/src/credential.js +318 -0
- package/packages/connectors/cloudflare/src/families/brand-protection.js +123 -0
- package/packages/connectors/cloudflare/src/families/keyless.js +114 -0
- package/packages/connectors/cloudflare/src/families/pages.js +151 -0
- package/packages/connectors/cloudflare/src/families/scanner.js +123 -0
- package/packages/connectors/cloudflare/src/families/snippets.js +207 -0
- package/packages/connectors/cloudflare/src/families/tag-gateway.js +46 -0
- package/packages/connectors/cloudflare/src/families/tags.js +124 -0
- package/packages/connectors/cloudflare/src/families/token-validation.js +95 -0
- package/packages/connectors/cloudflare/src/families/workflows.js +156 -0
- package/packages/connectors/cloudflare/src/index.js +102 -265
- package/packages/connectors/cloudflare/src/oauth-persist.js +336 -0
- package/packages/connectors/cloudflare/src/owner.js +42 -12
- package/packages/connectors/cloudflare/src/permission-options.js +1064 -0
- package/packages/connectors/cloudflare/src/routes.js +309 -144
- package/packages/connectors/cloudflare/src/scope-catalog.js +345 -0
- package/packages/connectors/cloudflare/src/vault.js +2 -2
- package/packages/connectors/cloudflare/tests/capabilities.test.mjs +276 -0
- package/packages/connectors/cloudflare/tests/connector.test.mjs +26 -30
- package/packages/connectors/cloudflare/tests/oauth-persist.test.mjs +125 -0
- package/packages/identity/.agentsam/features/oauth-login-portal/providers.json +22 -2
- package/packages/identity/.agentsam/features/oauth-login-portal/resources.json +10 -4
- package/packages/identity/.agentsam/features/oauth-login-portal/routes.json +20 -0
- package/packages/identity/README.md +1 -1
- package/packages/identity/backend/README.md +1 -1
- package/packages/identity/migrations/D1_SCHEMA_MAPPING.md +3 -2
- package/packages/identity/migrations/sqlite/004_identity_oauth_consent_catalog.sql +48 -0
- package/packages/identity/package.json +4 -3
- package/packages/identity/scripts/local-identity-bridge.mjs +184 -0
- package/packages/identity/scripts/preview-auth-portal.mjs +7 -7
- package/packages/identity/src/adapters/cloudflare-d1/index.js +31 -2
- package/packages/identity/src/adapters/sqlite/index.js +4 -1
- package/packages/identity/src/contracts/auth-config.js +28 -8
- package/packages/identity/src/contracts/external-identity.js +1 -1
- package/packages/identity/src/contracts/provider.js +1 -0
- package/packages/identity/src/frontend/auth-portal/README.md +2 -1
- package/packages/identity/src/frontend/auth-portal/pages/login.html +6 -5
- package/packages/identity/src/frontend/auth-portal/pages/reset.html +6 -5
- package/packages/identity/src/frontend/auth-portal/pages/signup.html +6 -5
- package/packages/identity/src/frontend/auth-portal/shared/company-branding.js +1 -1
- package/packages/identity/src/frontend/auth-portal/shared/desktop-identity-bridge.js +207 -0
- package/packages/identity/src/index.js +16 -0
- package/packages/identity/src/migrations/0001_identity_core.sql +19 -2
- package/packages/identity/src/migrations/0003_accounts_ssot.sql +20 -0
- package/packages/identity/src/migrations/README.md +5 -2
- package/packages/identity/src/oauth/README.md +10 -5
- package/packages/identity/src/oauth/consent-view.js +388 -0
- package/packages/identity/src/oauth/credentials.js +31 -11
- package/packages/identity/src/oauth/google-desktop-exchange.js +173 -0
- package/packages/identity/src/providers/cloudflare/oauth.js +3 -4
- package/packages/identity/src/providers/cloudflare/profile.js +49 -14
- package/packages/identity/src/providers/iam/index.js +27 -5
- package/packages/identity/src/server/identity-service.js +31 -2
- package/packages/identity/src/server/worker-router.js +111 -81
- package/packages/identity/tests/auth-config.test.mjs +3 -2
- package/packages/identity/tests/identity-init-scaffold.test.mjs +3 -0
- package/packages/identity/tests/identity-service.test.mjs +16 -0
- package/packages/identity/tests/native-session-worker.test.mjs +64 -0
- package/packages/identity/tests/oauth-consent-view.test.mjs +106 -0
- package/packages/identity/tests/oauth-credentials.test.mjs +17 -4
- package/packages/identity/tests/oauth-presets-accounts-ssot.test.mjs +58 -0
- package/packages/identity/tests/preview-auth-portal.test.mjs +3 -3
- package/packages/runtime-protocol/src/index.js +154 -0
- package/packages/theme-scenes/README.md +164 -0
- package/packages/theme-scenes/package.json +53 -0
- package/packages/theme-scenes/src/blocks/index.js +30 -0
- package/packages/theme-scenes/src/contracts/index.js +286 -0
- package/packages/theme-scenes/src/demos/index.js +65 -0
- package/packages/theme-scenes/src/index.js +75 -0
- package/packages/theme-scenes/src/presets/index.js +263 -0
- package/packages/theme-scenes/src/runtime/compile.js +119 -0
- package/packages/theme-scenes/src/scenes/index.js +146 -0
- package/packages/theme-scenes/src/shell/index.js +47 -0
- package/packages/theme-scenes/src/themes/index.js +129 -0
- package/packages/theme-scenes/src/visuals/index.js +41 -0
- package/packages/theme-scenes/test/theme-scenes.test.mjs +179 -0
- package/packages/work-graph/src/index.js +34 -1
- package/packages/work-graph/src/renderers/gantt-model.js +24 -0
- package/packages/work-graph/test/work-graph.test.mjs +27 -7
- package/protocol/README.md +15 -7
- package/protocol/apps/agentsam.app.v1.schema.json +89 -7
- package/protocol/apps/agentsam.host-install.v1.schema.json +36 -0
- package/protocol/assets/README.md +9 -0
- package/protocol/assets/asset-record.v1.schema.json +64 -0
- package/protocol/runtime/agentsam.runtime.v1.schema.json +75 -0
- package/protocol/scoring/README.md +10 -0
- package/protocol/scoring/scorecard.v1.schema.json +65 -0
- package/protocol/ui/icon-registry.mjs +1 -0
- package/registry/cms-rust-machine-20260928/installable-products.json +31 -0
- package/registry/cms-rust-machine-20260928/manifest.json +22 -0
- package/registry/cms-rust-machine-20260928/migration.sql +237 -0
- package/registry/cms-rust-machine-20260928/receipt.json +21 -0
- package/registry/cms-rust-machine-20260928/receipt.sql +27 -0
- package/scripts/build_rapid_rust_cli.py +83 -0
- package/src/attachments/index.js +6 -0
- package/src/attachments/intake.js +235 -0
- package/src/capabilities/repository-snapshot.js +19 -2
- package/src/cli/command-catalog.js +8 -0
- package/src/cli.js +182 -26
- package/src/commands/account-auth.js +94 -8
- package/src/commands/app.js +307 -3
- package/src/commands/billing.js +127 -0
- package/src/commands/brand.js +74 -60
- package/src/commands/cheat-sheet.js +154 -0
- package/src/commands/cloudflare-login.js +222 -0
- package/src/commands/cloudflare.js +453 -23
- package/src/commands/codebaseindex.js +6 -1
- package/src/commands/compute.js +4 -0
- package/src/commands/connections.js +11 -5
- package/src/commands/credentials.js +116 -0
- package/src/commands/gcloud-auth.js +427 -0
- package/src/commands/google-cloud.js +375 -0
- package/src/commands/identity-init.js +2 -2
- package/src/commands/mcp.js +226 -33
- package/src/commands/ollama.js +3 -2
- package/src/commands/plugins.js +7 -2
- package/src/commands/product.js +36 -0
- package/src/commands/runtime-status.js +28 -9
- package/src/commands/runtime.js +313 -0
- package/src/commands/rust.js +24 -0
- package/src/commands/setup.js +279 -0
- package/src/commands/shell.js +16 -3
- package/src/commands/start-local.js +2 -2
- package/src/commands/terminal.js +171 -0
- package/src/commands/update.js +140 -0
- package/src/commands/whoami.js +329 -65
- package/src/features/resolve.js +1 -0
- package/src/index.js +4 -0
- package/src/indexing/ingest/inventory.js +254 -19
- package/src/indexing/ingest/materials.js +3 -9
- package/src/indexing/ingest/style-evidence.js +181 -0
- package/src/knowledge/source.js +3 -3
- package/src/lib/account-session.js +11 -4
- package/src/lib/app-authority.js +172 -0
- package/src/lib/auth.js +94 -21
- package/src/lib/core-client.js +5 -6
- package/src/lib/credentials-audit.js +451 -0
- package/src/lib/deploy/health.js +24 -6
- package/src/lib/detect-context.js +7 -1
- package/src/lib/google-cloud-connection.js +270 -0
- package/src/lib/google-cloud-inventory.js +385 -0
- package/src/lib/google-desktop-oauth.js +372 -0
- package/src/lib/google-studio-brokered-oauth.js +158 -0
- package/src/lib/identity-scaffold.js +24 -6
- package/src/lib/init-options.js +192 -0
- package/src/lib/local-scaffold.js +48 -16
- package/src/lib/provider-command-remediation.js +308 -0
- package/src/lib/provider-credentials.js +8 -0
- package/src/lib/scaffold/index.js +8 -2
- package/src/lib/scaffold/mcp-server.js +43 -0
- package/src/lib/scaffold/templates/mcp-server/index.js +397 -0
- package/src/lib/scaffold/templates/mcp-server/presets.js +39 -0
- package/src/lib/scaffold/wizards/cms.js +93 -0
- package/src/lib/scaffold/wizards/mcp-server.js +61 -0
- package/src/lib/setup/contract.js +26 -0
- package/src/lib/setup/discover.js +116 -0
- package/src/lib/setup/execute.js +205 -0
- package/src/lib/setup/planner.js +134 -0
- package/src/lib/setup/recipes.js +235 -0
- package/src/lib/setup/runtime-persist.js +197 -0
- package/src/lib/setup/runtime.js +394 -0
- package/src/lib/slash-commands.js +2 -0
- package/src/lib/terminal/machine-identity.js +95 -0
- package/src/lib/terminal-local.js +164 -0
- package/src/lib/terminal-scopes.js +52 -0
- package/src/lib/whoami-capabilities.js +184 -0
- package/src/local-pty/server.js +34 -5
- package/src/mcp/authority.js +58 -108
- package/src/mcp/client-adapters.js +68 -144
- package/src/mcp/client.js +142 -122
- package/src/mcp/cloudflare-bundles.js +225 -0
- package/src/mcp/index.js +12 -0
- package/src/plugins/cloudflare.js +1 -1
- package/src/providers/ollama-chat.js +2 -1
- package/src/sam/types.js +27 -2
- package/src/security/inventory.js +12 -2
- package/src/security/local-vault.js +2 -0
- package/src/security/scan.js +1 -1
- package/test/account-session.test.mjs +3 -3
- package/test/app-authority-context.test.mjs +32 -0
- package/test/cli/codebaseindex-plan-ux.test.mjs +1 -1
- package/test/cli/mcp-client.test.mjs +21 -10
- package/test/cli/runtime-persist.test.mjs +56 -0
- package/test/cli/rust-command.test.mjs +21 -0
- package/test/credentials-audit.test.mjs +113 -0
- package/test/deploy-health-scan.test.mjs +29 -1
- package/test/gcloud-auth.test.mjs +111 -0
- package/test/google-cloud-connection.test.mjs +83 -0
- package/test/google-cloud-inventory.test.mjs +64 -0
- package/test/init-options.test.mjs +35 -0
- package/test/integration/app-command.test.mjs +30 -0
- package/test/integration/cad-project.test.mjs +4 -1
- package/test/integration/cms-app-scaffold.test.mjs +71 -0
- package/test/integration/cms-site-tenancy-contract.test.mjs +3 -2
- package/test/integration/codebaseindex-ingest.test.mjs +48 -0
- package/test/integration/features-resolve.test.mjs +30 -11
- package/test/integration/inspect-path-cli.test.mjs +46 -0
- package/test/integration/inventory-evidence.test.mjs +125 -0
- package/test/integration/runtime-status.integration.test.mjs +2 -1
- package/test/knowledge.test.mjs +35 -1
- package/test/loopback-oauth.test.mjs +53 -0
- package/test/ollama.test.mjs +22 -0
- package/test/security.test.mjs +23 -0
- package/test/setup-planner.test.mjs +74 -0
- package/test/setup-runtime.test.mjs +51 -0
- package/test/terminal/local-pty.mock.test.mjs +3 -1
- package/test/terminal-machine-identity.test.mjs +88 -0
- package/test/whoami-resume.test.mjs +27 -6
- package/packages/agentsam-brand/test/brand-scan.test.mjs +0 -106
- package/packages/work-graph/prototype/README.md +0 -32
- package/packages/work-graph/prototype/data/demo-workgraph.js +0 -47
- package/packages/work-graph/prototype/renderers/timeline-model.js +0 -21
- package/packages/work-graph/prototype/renderers/workgraph-runtime.js +0 -38
- package/packages/work-graph/prototype-gnantt.html +0 -655
package/test/ollama.test.mjs
CHANGED
|
@@ -24,6 +24,28 @@ test('Ollama defaults are local-only and match the SDK local-dev contract', () =
|
|
|
24
24
|
assert.deepEqual(resolveOllamaConfig({}, {}), OLLAMA_DEFAULTS);
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
+
test('Ollama endpoints normalize host-only values and honor AgentSam precedence', () => {
|
|
28
|
+
assert.equal(resolveOllamaConfig({}, { OLLAMA_HOST: '0.0.0.0:11434' }).baseUrl, 'http://127.0.0.1:11434');
|
|
29
|
+
assert.equal(resolveOllamaConfig({}, { OLLAMA_HOST: '127.0.0.1:11434' }).baseUrl, 'http://127.0.0.1:11434');
|
|
30
|
+
assert.equal(resolveOllamaConfig({}, { OLLAMA_HOST: 'localhost:11434' }).baseUrl, 'http://localhost:11434');
|
|
31
|
+
assert.equal(resolveOllamaConfig({}, { OLLAMA_HOST: 'http://localhost:11434' }).baseUrl, 'http://localhost:11434');
|
|
32
|
+
|
|
33
|
+
assert.equal(resolveOllamaConfig({}, {
|
|
34
|
+
AGENTSAM_OLLAMA_ENDPOINT: '127.0.0.1:2244',
|
|
35
|
+
OLLAMA_BASE_URL: 'localhost:3344',
|
|
36
|
+
OLLAMA_HOST: '0.0.0.0:4444',
|
|
37
|
+
}).baseUrl, 'http://127.0.0.1:2244');
|
|
38
|
+
|
|
39
|
+
assert.equal(resolveOllamaConfig({}, {
|
|
40
|
+
OLLAMA_BASE_URL: 'localhost:3344',
|
|
41
|
+
OLLAMA_HOST: '0.0.0.0:4444',
|
|
42
|
+
}).baseUrl, 'http://localhost:3344');
|
|
43
|
+
|
|
44
|
+
assert.equal(resolveOllamaConfig({}, {
|
|
45
|
+
OLLAMA_HOST: '0.0.0.0:4444',
|
|
46
|
+
}).baseUrl, 'http://127.0.0.1:4444');
|
|
47
|
+
});
|
|
48
|
+
|
|
27
49
|
test('Ollama setup args require explicit install/pull/start opt-ins', () => {
|
|
28
50
|
assert.deepEqual(parseOllamaArgs(['setup']), {
|
|
29
51
|
command: 'setup',
|
package/test/security.test.mjs
CHANGED
|
@@ -166,6 +166,29 @@ test('repair retains failed candidates and never labels failed verification as f
|
|
|
166
166
|
assert.equal(g('status','--porcelain'),'');
|
|
167
167
|
assert.match(result.reason,/command failed/);
|
|
168
168
|
});
|
|
169
|
+
test('exact release candidate tarball may be scanned without weakening normal local dependency rejection', t => {
|
|
170
|
+
const f = fixture(t);
|
|
171
|
+
f.pkg.dependencies['@inneranimalmedia/agentsam-sdk'] = 'file:./candidate.tgz';
|
|
172
|
+
f.lock.packages[''].dependencies = { ...f.pkg.dependencies };
|
|
173
|
+
f.lock.packages['node_modules/@inneranimalmedia/agentsam-sdk'] = {
|
|
174
|
+
name: '@inneranimalmedia/agentsam-sdk',
|
|
175
|
+
version: '2.6.5',
|
|
176
|
+
resolved: 'file:./candidate.tgz',
|
|
177
|
+
};
|
|
178
|
+
f.write();
|
|
179
|
+
const strict = collectNpmDependencies(f.root);
|
|
180
|
+
assert.ok(strict.issues.some(issue => issue.includes('node_modules/@inneranimalmedia/agentsam-sdk')));
|
|
181
|
+
const candidate = collectNpmDependencies(f.root, {
|
|
182
|
+
releaseCandidate: {
|
|
183
|
+
name: '@inneranimalmedia/agentsam-sdk',
|
|
184
|
+
version: '2.6.5',
|
|
185
|
+
location: 'node_modules/@inneranimalmedia/agentsam-sdk',
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
assert.equal(candidate.issues.some(issue => issue.includes('node_modules/@inneranimalmedia/agentsam-sdk')), false);
|
|
189
|
+
assert.ok(candidate.dependencies.some(dep => dep.name === '@inneranimalmedia/agentsam-sdk' && dep.version === '2.6.5'));
|
|
190
|
+
});
|
|
191
|
+
|
|
169
192
|
test('workspace stale locks and external links are incomplete', async t => {
|
|
170
193
|
const f=fixture(t);
|
|
171
194
|
f.lock.packages['node_modules/external']={link:true,resolved:'../elsewhere'};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import test from 'node:test';
|
|
3
|
+
import { buildSetupPlan, renderSetupPlan } from '../src/lib/setup/planner.js';
|
|
4
|
+
import { listCapabilityRecipes, getCapabilityRecipe } from '../src/lib/setup/recipes.js';
|
|
5
|
+
import { runSetup } from '../src/commands/setup.js';
|
|
6
|
+
|
|
7
|
+
test('recipes include image.vectorize and google.cloud', () => {
|
|
8
|
+
const ids = listCapabilityRecipes().map((r) => r.id);
|
|
9
|
+
assert.ok(ids.includes('image.vectorize'));
|
|
10
|
+
assert.ok(ids.includes('google.cloud'));
|
|
11
|
+
assert.equal(getCapabilityRecipe('image.vectorize').installPlans.darwin.provider, 'homebrew');
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
test('setup plan is satisfied when image tools already installed', async () => {
|
|
15
|
+
const environment = {
|
|
16
|
+
hostname: 'Test-Host',
|
|
17
|
+
host_label: 'Mac',
|
|
18
|
+
platform: 'darwin',
|
|
19
|
+
arch: 'arm64',
|
|
20
|
+
tools: {},
|
|
21
|
+
};
|
|
22
|
+
const plan = await buildSetupPlan({
|
|
23
|
+
environment,
|
|
24
|
+
capabilityIds: ['image.vectorize'],
|
|
25
|
+
});
|
|
26
|
+
assert.equal(plan.schema_version, 'agentsam-setup-plan-v1');
|
|
27
|
+
const image = plan.capabilities.find((c) => c.id === 'image.vectorize');
|
|
28
|
+
assert.ok(image);
|
|
29
|
+
// This machine already has brew imagemagick/potrace from logo work — plan should reflect detect().
|
|
30
|
+
if (image.detected?.ok) {
|
|
31
|
+
assert.equal(plan.would_install.length, 0);
|
|
32
|
+
} else {
|
|
33
|
+
assert.ok(plan.would_install.length >= 1);
|
|
34
|
+
assert.equal(plan.would_install[0].provider, 'homebrew');
|
|
35
|
+
}
|
|
36
|
+
const text = renderSetupPlan(plan);
|
|
37
|
+
assert.match(text, /Agent Sam Setup|Vector image/);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test('renderSetupPlan shows would-install block for synthetic missing tools', () => {
|
|
41
|
+
const text = renderSetupPlan({
|
|
42
|
+
hostname: 'Test-Host',
|
|
43
|
+
host_label: 'Mac',
|
|
44
|
+
platform: 'darwin',
|
|
45
|
+
capabilities: [
|
|
46
|
+
{
|
|
47
|
+
id: 'image.vectorize',
|
|
48
|
+
displayName: 'Vector image tooling',
|
|
49
|
+
detected: { ok: false, detail: 'missing' },
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
would_install: [
|
|
53
|
+
{ provider: 'homebrew', packages: ['imagemagick', 'potrace'], capability: 'image.vectorize' },
|
|
54
|
+
],
|
|
55
|
+
providers: ['homebrew'],
|
|
56
|
+
mutations: [],
|
|
57
|
+
trust_notes: ['no silent trust'],
|
|
58
|
+
});
|
|
59
|
+
assert.match(text, /Would install/);
|
|
60
|
+
assert.match(text, /imagemagick/);
|
|
61
|
+
assert.match(text, /homebrew/);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
test('setup --list and --dry-run exit 0', async () => {
|
|
65
|
+
let out = '';
|
|
66
|
+
const write = (s) => {
|
|
67
|
+
out += s;
|
|
68
|
+
};
|
|
69
|
+
assert.equal(await runSetup(['--list'], { write, env: process.env }), 0);
|
|
70
|
+
assert.match(out, /image\.vectorize/);
|
|
71
|
+
out = '';
|
|
72
|
+
assert.equal(await runSetup(['image.vectorize', '--dry-run'], { write, env: process.env }), 0);
|
|
73
|
+
assert.match(out, /Environment|Agent Sam Setup/);
|
|
74
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { describe, it } from 'node:test';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import fs from 'node:fs';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import {
|
|
7
|
+
RUNTIME_PROFILES,
|
|
8
|
+
planRuntimeSetup,
|
|
9
|
+
writeRuntimePlanReceipt,
|
|
10
|
+
renderRuntimePlan,
|
|
11
|
+
} from '../src/lib/setup/runtime.js';
|
|
12
|
+
|
|
13
|
+
describe('agentsam setup runtime', () => {
|
|
14
|
+
it('exposes five goal profiles', () => {
|
|
15
|
+
assert.equal(RUNTIME_PROFILES.length, 5);
|
|
16
|
+
assert.ok(RUNTIME_PROFILES.some((p) => p.id === 'my_computer'));
|
|
17
|
+
assert.ok(RUNTIME_PROFILES.every((p) => p.runtime_adapter));
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('plans with GOAP and writes receipt under tmp home', async () => {
|
|
21
|
+
const home = fs.mkdtempSync(path.join(os.tmpdir(), 'agentsam-runtime-'));
|
|
22
|
+
const plan = await planRuntimeSetup({
|
|
23
|
+
home,
|
|
24
|
+
facts: {
|
|
25
|
+
schema: 'agentsam.runtime-setup.v1',
|
|
26
|
+
protocol: 'agentsam.runtime.v1',
|
|
27
|
+
host: { hostname: 'test', platform: 'darwin', arch: 'arm64', label: 'Mac' },
|
|
28
|
+
tools: { docker: true, gcloud: false, wrangler: true, go: true },
|
|
29
|
+
agentsamd: { binary: null, installed: false, prior_receipt: null },
|
|
30
|
+
available_capabilities: {
|
|
31
|
+
exec: true,
|
|
32
|
+
pty: true,
|
|
33
|
+
filesystem: true,
|
|
34
|
+
process: true,
|
|
35
|
+
git: true,
|
|
36
|
+
docker: true,
|
|
37
|
+
ports: true,
|
|
38
|
+
persistent_filesystem: true,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
assert.ok(plan.recommended);
|
|
43
|
+
assert.equal(plan.recommended.profile.id, 'my_computer');
|
|
44
|
+
assert.ok(plan.recommended.goap.action_ids.includes('ensure_agentsamd_binary'));
|
|
45
|
+
const receipt = writeRuntimePlanReceipt(plan, home);
|
|
46
|
+
assert.ok(fs.existsSync(receipt));
|
|
47
|
+
const text = renderRuntimePlan(plan);
|
|
48
|
+
assert.match(text, /setup runtime/);
|
|
49
|
+
assert.match(text, /My Computer/);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
@@ -139,7 +139,9 @@ test('local PTY server health check uses an ephemeral local port and no ExecOS t
|
|
|
139
139
|
assert.equal(health.status, 200);
|
|
140
140
|
const body = await health.json();
|
|
141
141
|
assert.equal(body.ok, true);
|
|
142
|
-
assert.equal(body.service, 'agentsam
|
|
142
|
+
assert.equal(body.service, 'agentsam.local.runtime');
|
|
143
|
+
assert.equal(body.plane, 'local');
|
|
144
|
+
assert.equal(body.service_legacy, 'agentsam-local-pty');
|
|
143
145
|
assert.equal(body.port, server.port);
|
|
144
146
|
assert.equal(server.port > 0, true);
|
|
145
147
|
} finally {
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import test from 'node:test';
|
|
3
|
+
|
|
4
|
+
import { runTerminal } from '../src/commands/terminal.js';
|
|
5
|
+
import { normalizeTerminalArch, normalizeTerminalPlatform } from '../src/lib/terminal/machine-identity.js';
|
|
6
|
+
|
|
7
|
+
test('identity command prints this host vocabulary without calling the network', async () => {
|
|
8
|
+
const lines = [];
|
|
9
|
+
const result = await runTerminal(['identity'], {
|
|
10
|
+
write: (line) => lines.push(line),
|
|
11
|
+
collectIdentity: async () => ({
|
|
12
|
+
hostname: 'Sams-iMac',
|
|
13
|
+
platform: 'macos',
|
|
14
|
+
arch: 'arm64',
|
|
15
|
+
model: 'Mac16,2',
|
|
16
|
+
}),
|
|
17
|
+
postJson: async () => {
|
|
18
|
+
throw new Error('identity must not post');
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
assert.equal(result.ok, true);
|
|
22
|
+
assert.equal(result.arch, 'arm64');
|
|
23
|
+
assert.match(lines.join('\n'), /arch:\s+arm64/);
|
|
24
|
+
assert.match(lines.join('\n'), /hw_model:\s+Mac16,2/);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test('enroll without a target does not mint a token', async () => {
|
|
28
|
+
let posted = false;
|
|
29
|
+
const result = await runTerminal(['enroll', '--json'], {
|
|
30
|
+
write: () => {},
|
|
31
|
+
collectIdentity: async () => ({ hostname: 'box', platform: 'linux', arch: 'x86_64', model: 'container' }),
|
|
32
|
+
postJson: async () => { posted = true; return {}; },
|
|
33
|
+
});
|
|
34
|
+
assert.equal(posted, false);
|
|
35
|
+
assert.equal(result.enrolled, false);
|
|
36
|
+
assert.equal(result.arch, 'x86_64');
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('enroll posts canonical identity for the instance the caller named', async () => {
|
|
40
|
+
let body = null;
|
|
41
|
+
const result = await runTerminal(['enroll', '--instance', 'tinst_sams_imac', '--json'], {
|
|
42
|
+
write: () => {},
|
|
43
|
+
collectIdentity: async () => ({
|
|
44
|
+
hostname: 'Sams-iMac',
|
|
45
|
+
platform: 'macos',
|
|
46
|
+
arch: 'arm64',
|
|
47
|
+
model: 'Mac16,2',
|
|
48
|
+
}),
|
|
49
|
+
postJson: async (_path, posted) => {
|
|
50
|
+
body = posted;
|
|
51
|
+
return { instance_id: 'tinst_sams_imac', connection_id: 'conn_mac_local', enrollment_token_id: 'tenr_test', enrollment_token: 'tok_test' };
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
assert.equal(result.enrolled, true);
|
|
55
|
+
assert.equal(body.instance_id, 'tinst_sams_imac');
|
|
56
|
+
assert.equal(body.platform, 'macos');
|
|
57
|
+
assert.equal(body.arch, 'arm64');
|
|
58
|
+
assert.equal(body.hw_model, 'Mac16,2');
|
|
59
|
+
assert.equal(body.kind, 'local_device');
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('enroll --pair consumes the token via ExecOS enroll (writes AGENTSAM_BRIDGE_KEY)', async () => {
|
|
63
|
+
let pairedToken = null;
|
|
64
|
+
const result = await runTerminal(['enroll', '--instance', 'tinst_sams_imac', '--pair', '--json'], {
|
|
65
|
+
write: () => {},
|
|
66
|
+
collectIdentity: async () => ({ hostname: 'box', platform: 'macos', arch: 'arm64', model: 'Mac16,2' }),
|
|
67
|
+
postJson: async () => ({
|
|
68
|
+
instance_id: 'tinst_sams_imac',
|
|
69
|
+
connection_id: 'conn_mac_local',
|
|
70
|
+
enrollment_token: 'tok_pair',
|
|
71
|
+
endpoint_url: 'https://localpty.inneranimalmedia.com',
|
|
72
|
+
}),
|
|
73
|
+
pairImpl: async (token) => {
|
|
74
|
+
pairedToken = token;
|
|
75
|
+
return { ok: true };
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
assert.equal(pairedToken, 'tok_pair');
|
|
79
|
+
assert.equal(result.paired, true);
|
|
80
|
+
assert.equal(result.auth_mode, 'connection_token');
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test('normalizer matches the worker vocabulary', () => {
|
|
84
|
+
assert.equal(normalizeTerminalPlatform('darwin'), 'macos');
|
|
85
|
+
assert.equal(normalizeTerminalPlatform('win32'), 'windows');
|
|
86
|
+
assert.equal(normalizeTerminalArch('x64'), 'x86_64');
|
|
87
|
+
assert.equal(normalizeTerminalArch('aarch64'), 'arm64');
|
|
88
|
+
});
|
|
@@ -32,8 +32,23 @@ test('whoami validates persisted IAM browser identity while never returning acco
|
|
|
32
32
|
cloudflare: { ok: true }, byok: { openai: { configured: true, masked: 'secret' } },
|
|
33
33
|
terminal: {
|
|
34
34
|
available: true,
|
|
35
|
-
instances: [{
|
|
36
|
-
|
|
35
|
+
instances: [{
|
|
36
|
+
id: 'inst_1',
|
|
37
|
+
name: 'Mac',
|
|
38
|
+
provider: 'local',
|
|
39
|
+
last_seen_at: 1789716970,
|
|
40
|
+
metadata_json: 'secret',
|
|
41
|
+
}],
|
|
42
|
+
connections: [{
|
|
43
|
+
id: 'conn_1',
|
|
44
|
+
instance_id: 'inst_1',
|
|
45
|
+
name: 'Tunnel',
|
|
46
|
+
is_active: true,
|
|
47
|
+
is_default: true,
|
|
48
|
+
transport_provider: 'cloudflare_tunnel',
|
|
49
|
+
endpoint_url: 'wss://localpty.example.test/terminal',
|
|
50
|
+
last_seen_at: 1789716970,
|
|
51
|
+
}],
|
|
37
52
|
},
|
|
38
53
|
};
|
|
39
54
|
},
|
|
@@ -41,11 +56,17 @@ test('whoami validates persisted IAM browser identity while never returning acco
|
|
|
41
56
|
assert.equal(status.authenticated, true);
|
|
42
57
|
assert.equal(status.identity.account_id, 'acct_server');
|
|
43
58
|
assert.equal(status.active_auth.source, 'agentsam_browser_oauth');
|
|
44
|
-
assert.equal(status.active_auth.kind, '
|
|
59
|
+
assert.equal(status.active_auth.kind, 'agentsam_browser_oauth');
|
|
45
60
|
assert.equal(status.provider_credentials.find(row => row.provider === 'openai').configured, true);
|
|
61
|
+
assert.equal(status.provider_credentials.find(row => row.provider === 'openai').owner_account_id, 'acct_server');
|
|
62
|
+
assert.equal(status.provider_credentials.find(row => row.provider === 'openai').account_id, 'acct_server');
|
|
63
|
+
assert.equal(status.identity.email, 'dev@example.test');
|
|
46
64
|
assert.equal(status.terminal.connections[0].id, 'conn_1');
|
|
65
|
+
assert.equal(status.terminal.connections[0].connection_id, 'conn_1');
|
|
66
|
+
assert.equal(status.terminal.connections[0].public_url, 'wss://localpty.example.test/terminal');
|
|
67
|
+
assert.match(status.terminal.connections[0].last_seen_at_iso || '', /^2026-/);
|
|
47
68
|
const serialized = JSON.stringify(status);
|
|
48
|
-
assert.doesNotMatch(serialized, /browser_session_do_not_print|sk-never-print-this|masked|
|
|
69
|
+
assert.doesNotMatch(serialized, /browser_session_do_not_print|sk-never-print-this|masked|metadata_json/);
|
|
49
70
|
});
|
|
50
71
|
|
|
51
72
|
test('whoami sends the exact authority returned by the resolver to the default context loader', async t => {
|
|
@@ -86,7 +107,7 @@ test('whoami uses a valid browser session when a stale environment API key is in
|
|
|
86
107
|
},
|
|
87
108
|
});
|
|
88
109
|
assert.equal(status.authenticated, true);
|
|
89
|
-
assert.equal(status.active_auth.kind, '
|
|
110
|
+
assert.equal(status.active_auth.kind, 'agentsam_browser_oauth');
|
|
90
111
|
assert.equal(status.api_key.valid, false);
|
|
91
112
|
assert.equal(status.api_key.error, 'invalid_api_key_prefix');
|
|
92
113
|
});
|
|
@@ -115,7 +136,7 @@ test('whoami refreshes an expired browser session before validating IAM context'
|
|
|
115
136
|
});
|
|
116
137
|
assert.equal(refreshed, 1);
|
|
117
138
|
assert.equal(status.authenticated, true);
|
|
118
|
-
assert.equal(status.active_auth.kind, '
|
|
139
|
+
assert.equal(status.active_auth.kind, 'agentsam_browser_oauth');
|
|
119
140
|
});
|
|
120
141
|
|
|
121
142
|
test('resume restores saved cwd and session through the canonical shell runtime', async t => {
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import os from 'node:os';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import test from 'node:test';
|
|
6
|
-
import { execFileSync } from 'node:child_process';
|
|
7
|
-
import { brandScan, brandResolve } from '../src/index.js';
|
|
8
|
-
import { repositorySnapshot } from '../../../src/capabilities/index.js';
|
|
9
|
-
import { scanTrustBoundary } from '../../../src/security/trust-boundary.js';
|
|
10
|
-
import { suggestNextActions, routeDeterministicIntent } from '../../../src/progression/index.js';
|
|
11
|
-
|
|
12
|
-
function fixtureRepo() {
|
|
13
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'agentsam-brand-'));
|
|
14
|
-
execFileSync('git', ['init'], { cwd: root, stdio: 'ignore' });
|
|
15
|
-
execFileSync('git', ['config', 'user.email', 'test@example.com'], { cwd: root, stdio: 'ignore' });
|
|
16
|
-
execFileSync('git', ['config', 'user.name', 'Test'], { cwd: root, stdio: 'ignore' });
|
|
17
|
-
fs.writeFileSync(path.join(root, '.gitignore'), 'ignored/\nnode_modules/\n');
|
|
18
|
-
fs.mkdirSync(path.join(root, 'src/styles'), { recursive: true });
|
|
19
|
-
fs.mkdirSync(path.join(root, 'src/components'), { recursive: true });
|
|
20
|
-
fs.mkdirSync(path.join(root, 'ignored'), { recursive: true });
|
|
21
|
-
fs.writeFileSync(
|
|
22
|
-
path.join(root, 'src/styles/theme.css'),
|
|
23
|
-
`:root {\n --color-slate-950: #0f172a;\n --black: #111111;\n color: #101010;\n background: rgb(17, 17, 17);\n font-family: "Inter", system-ui;\n font-size: 16px;\n border-radius: 8px;\n}\n`,
|
|
24
|
-
);
|
|
25
|
-
fs.writeFileSync(
|
|
26
|
-
path.join(root, 'src/components/Button.tsx'),
|
|
27
|
-
`export function Button() { return <button className="bg-neutral-950 text-white">Go</button>; }\n`,
|
|
28
|
-
);
|
|
29
|
-
fs.writeFileSync(
|
|
30
|
-
path.join(root, 'src/components/Header.tsx'),
|
|
31
|
-
`export function Header() { return <header style={{ background: '#0f172a' }}>Nav</header>; }\n`,
|
|
32
|
-
);
|
|
33
|
-
fs.writeFileSync(path.join(root, 'ignored/secret.css'), `:root { --should-not-see: #ff0000; }\n`);
|
|
34
|
-
execFileSync('git', ['add', '.'], { cwd: root, stdio: 'ignore' });
|
|
35
|
-
execFileSync('git', ['commit', '-m', 'init'], { cwd: root, stdio: 'ignore' });
|
|
36
|
-
return root;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
test('brand.scan derives stable brand evidence from repository snapshot', async (t) => {
|
|
40
|
-
const root = fixtureRepo();
|
|
41
|
-
t.after(() => fs.rmSync(root, { recursive: true, force: true }));
|
|
42
|
-
|
|
43
|
-
const snapshot = await repositorySnapshot({ cwd: root, churnDays: 30 });
|
|
44
|
-
const one = await brandScan({ cwd: root, snapshot });
|
|
45
|
-
const two = await brandScan({ cwd: root, snapshot });
|
|
46
|
-
|
|
47
|
-
assert.equal(one.capability, 'brand.scan');
|
|
48
|
-
assert.equal(one.deterministic, true);
|
|
49
|
-
assert.equal(one.model_required, false);
|
|
50
|
-
assert.equal(one.repository.snapshot_id, snapshot.snapshot_id);
|
|
51
|
-
assert.equal(one.repository.snapshot_id, two.repository.snapshot_id);
|
|
52
|
-
assert.match(one.content_hash, /^sha256:[a-f0-9]{64}$/);
|
|
53
|
-
assert.equal(one.content_hash, two.content_hash);
|
|
54
|
-
assert.deepEqual(one.tokens.colors.map((c) => c.normalized_value), two.tokens.colors.map((c) => c.normalized_value));
|
|
55
|
-
assert.ok(one.tokens.colors.length >= 2);
|
|
56
|
-
assert.equal(one.sources.css >= 1, true);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
test('brand scan and repository inspection share one file authority', async (t) => {
|
|
60
|
-
const root = fixtureRepo();
|
|
61
|
-
t.after(() => fs.rmSync(root, { recursive: true, force: true }));
|
|
62
|
-
|
|
63
|
-
const snapshot = await repositorySnapshot({ cwd: root, churnDays: 30 });
|
|
64
|
-
const boundary = await scanTrustBoundary(root);
|
|
65
|
-
const brand = await brandScan({ cwd: root, snapshot });
|
|
66
|
-
|
|
67
|
-
assert.equal(snapshot.tree.merkle_root, boundary.merkle_root);
|
|
68
|
-
assert.equal(snapshot.tree.metadata_root, boundary.metadata_root);
|
|
69
|
-
assert.equal(brand.repository.merkle_root, snapshot.tree.merkle_root);
|
|
70
|
-
assert.equal(brand.repository.path_count, snapshot.tree.paths.length);
|
|
71
|
-
assert.equal(snapshot.tree.paths.some((p) => p.startsWith('ignored/')), false);
|
|
72
|
-
assert.equal(
|
|
73
|
-
JSON.stringify(brand).includes('should-not-see') || JSON.stringify(brand).includes('#ff0000'),
|
|
74
|
-
false,
|
|
75
|
-
);
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
test('brand.resolve keeps observed/inferred/declared/resolved separated', async (t) => {
|
|
79
|
-
const root = fixtureRepo();
|
|
80
|
-
t.after(() => fs.rmSync(root, { recursive: true, force: true }));
|
|
81
|
-
const snapshot = await repositorySnapshot({ cwd: root, churnDays: 30 });
|
|
82
|
-
const scan = await brandScan({ cwd: root, snapshot });
|
|
83
|
-
const resolved = brandResolve(scan);
|
|
84
|
-
assert.equal(resolved.capability, 'brand.resolve');
|
|
85
|
-
assert.ok(Array.isArray(resolved.observed.colors));
|
|
86
|
-
assert.equal(typeof resolved.inferred.colors, 'object');
|
|
87
|
-
assert.deepEqual(resolved.declared, {});
|
|
88
|
-
assert.equal(typeof resolved.resolved.colors, 'object');
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
test('progression engine suggests brand next actions without a model', () => {
|
|
92
|
-
const { next_actions } = suggestNextActions({
|
|
93
|
-
capability: 'brand.scan',
|
|
94
|
-
result: { conflicts: [{ kind: 'near_duplicate_color' }], complete: true },
|
|
95
|
-
});
|
|
96
|
-
assert.ok(next_actions.some((a) => a.id === 'brand.inspect.conflicts'));
|
|
97
|
-
assert.ok(next_actions.some((a) => a.command?.includes('plan brand')));
|
|
98
|
-
assert.equal(next_actions.every((a) => a.requires_model === false), true);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
test('deterministic intent router handles what next without a model', () => {
|
|
102
|
-
const hit = routeDeterministicIntent('what should I do next?');
|
|
103
|
-
assert.equal(hit.intent, 'next');
|
|
104
|
-
assert.equal(hit.use_progression, true);
|
|
105
|
-
assert.equal(routeDeterministicIntent('show brand').command, 'agentsam brand');
|
|
106
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# AgentSam Timeline Prototype
|
|
2
|
-
|
|
3
|
-
`prototype-gnantt.html` renders from the WorkGraph demo — bars, board, list, and drawer are projections, not hardcoded markup.
|
|
4
|
-
|
|
5
|
-
Flow:
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
demo-workgraph.js
|
|
9
|
-
|
|
|
10
|
-
v
|
|
11
|
-
workgraph-runtime.js / timeline-model.js
|
|
12
|
-
|
|
|
13
|
-
v
|
|
14
|
-
prototype-gnantt.html (ES module bootstrap)
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
The timeline is a projection of the graph, not the source of truth.
|
|
18
|
-
|
|
19
|
-
Supported projections:
|
|
20
|
-
|
|
21
|
-
- task timeline bars (status-colored)
|
|
22
|
-
- agent / human owner lanes in the sidebar
|
|
23
|
-
- evidence / artifact drawer data
|
|
24
|
-
- timeline event markers
|
|
25
|
-
- board + list views from the same work items
|
|
26
|
-
|
|
27
|
-
Open locally (module imports need a static server):
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npx --yes serve -l 4173 .
|
|
31
|
-
# then http://localhost:4173/prototype-gnantt.html
|
|
32
|
-
```
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
export const demoWorkGraph = {
|
|
2
|
-
id: "mission_indexer_refactor",
|
|
3
|
-
title: "AgentSam Repository Intelligence Upgrade",
|
|
4
|
-
actors: [
|
|
5
|
-
{ id: "sam", type: "human", name: "Sam" },
|
|
6
|
-
{ id: "agent-a1", type: "agent", name: "Indexer Agent", model: "gpt-5-codex" },
|
|
7
|
-
{ id: "agent-a2", type: "agent", name: "Embedding Agent", model: "gpt-5-mini" }
|
|
8
|
-
],
|
|
9
|
-
workItems: [
|
|
10
|
-
{
|
|
11
|
-
id: "repo-discovery",
|
|
12
|
-
title: "Repository discovery",
|
|
13
|
-
owner: "agent-a1",
|
|
14
|
-
status: "complete",
|
|
15
|
-
start: "2026-08-01",
|
|
16
|
-
end: "2026-08-03",
|
|
17
|
-
dependencies: [],
|
|
18
|
-
artifacts: ["repository-manifest.json"],
|
|
19
|
-
evidence: ["run_18291"]
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
id: "ast-indexing",
|
|
23
|
-
title: "AST indexing",
|
|
24
|
-
owner: "agent-a1",
|
|
25
|
-
status: "running",
|
|
26
|
-
start: "2026-08-03",
|
|
27
|
-
end: "2026-08-08",
|
|
28
|
-
dependencies: ["repo-discovery"],
|
|
29
|
-
artifacts: ["index-report.json"],
|
|
30
|
-
evidence: ["run_18292"]
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
id: "embedding-pipeline",
|
|
34
|
-
title: "Embedding pipeline",
|
|
35
|
-
owner: "agent-a2",
|
|
36
|
-
status: "queued",
|
|
37
|
-
start: "2026-08-07",
|
|
38
|
-
end: "2026-08-12",
|
|
39
|
-
dependencies: ["ast-indexing"]
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
timelineEvents: [
|
|
43
|
-
{ type: "commit", label: "Manifest commit created", timestamp: "2026-08-03T14:20" },
|
|
44
|
-
{ type: "test", label: "Compatibility suite passed", timestamp: "2026-08-05T09:00" },
|
|
45
|
-
{ type: "deploy", label: "Preview deployed", timestamp: "2026-08-08T15:30" }
|
|
46
|
-
]
|
|
47
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export function buildTimelineModel(workGraph) {
|
|
2
|
-
return {
|
|
3
|
-
title: workGraph.title,
|
|
4
|
-
lanes: workGraph.actors.map(actor => ({
|
|
5
|
-
id: actor.id,
|
|
6
|
-
name: actor.name,
|
|
7
|
-
type: actor.type,
|
|
8
|
-
items: workGraph.workItems.filter(item => item.owner === actor.id)
|
|
9
|
-
})),
|
|
10
|
-
events: workGraph.timelineEvents ?? []
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function getStatusClass(status) {
|
|
15
|
-
return {
|
|
16
|
-
complete: "green",
|
|
17
|
-
running: "blue",
|
|
18
|
-
blocked: "red",
|
|
19
|
-
queued: "gray"
|
|
20
|
-
}[status] ?? "gray";
|
|
21
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// WorkGraph -> Timeline runtime helpers
|
|
2
|
-
// Keeps the UI renderer independent from mission data shape.
|
|
3
|
-
|
|
4
|
-
export function buildAgentLanes(graph) {
|
|
5
|
-
return (graph.actors || [])
|
|
6
|
-
.filter(actor => actor.type === 'agent' || actor.type === 'human')
|
|
7
|
-
.map(actor => ({
|
|
8
|
-
id: actor.id,
|
|
9
|
-
name: actor.name,
|
|
10
|
-
items: (graph.workItems || []).filter(item => item.owner === actor.id),
|
|
11
|
-
}));
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function buildTimelineBars(graph) {
|
|
15
|
-
return (graph.workItems || []).map(item => ({
|
|
16
|
-
id: item.id,
|
|
17
|
-
label: item.title,
|
|
18
|
-
owner: item.owner,
|
|
19
|
-
status: item.status,
|
|
20
|
-
start: item.start,
|
|
21
|
-
end: item.end,
|
|
22
|
-
artifacts: item.artifacts || [],
|
|
23
|
-
evidence: item.evidence || [],
|
|
24
|
-
}));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function buildEventMarkers(graph) {
|
|
28
|
-
return (graph.timelineEvents || []).map(event => ({
|
|
29
|
-
id: event.id || `${event.type}-${event.timestamp}`,
|
|
30
|
-
type: event.type,
|
|
31
|
-
label: event.label,
|
|
32
|
-
timestamp: event.timestamp,
|
|
33
|
-
}));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function getWorkItemDetails(graph, id) {
|
|
37
|
-
return (graph.workItems || []).find(item => item.id === id) || null;
|
|
38
|
-
}
|